Plan History
note

This rune is part of @refrakt-md/plan. Install with npm install @refrakt-md/plan and add "@refrakt-md/plan" to the plugins array in your refrakt.config.json.

Plan History

Renders a timeline of lifecycle events for plan entities, derived directly from git history. Every status transition, priority change, criteria check-off, and resolution is extracted from consecutive commits — no separate activity log or event database required.

This is a self-closing aggregation rune. The pipeline's aggregate hook extracts history from git during the build, and the postProcess hook resolves the sentinel into a styled vertical timeline.

Per-entity timeline

Show the full history for a single entity by passing its ID.

{% plan-history id="WORK-024" /%}

Each event in the timeline shows:

  • Date and commit hash (linked to the repository when a remote is configured)
  • Attribute changesstatus: ready → done, priority: low → high
  • Criteria progress — checked/unchecked acceptance criteria with ☑/☐ markers
  • Resolution events — when a ## Resolution section is added
  • Content edits — body changes with no structured diff

Events are displayed newest-first. When more than 3 criteria change in a single event, the list collapses with a "+N more criteria" summary.

Visual language

  • Filled circle markers (●) for events with structured changes
  • Open circle markers (○) for creation events
  • Attribute values use data-type="add|remove" with diff-style background tints — green for new values, red (with strikethrough) for old values

Global activity feed

Omit the id attribute for a project-wide feed grouped by commit.

{% plan-history /%}
{% plan-history limit=10 /%}
{% plan-history type="work" /%}
{% plan-history since="7d" /%}

In global mode, events from the same commit are grouped together, showing the commit message and a compact summary for each affected entity. This makes atomic operations visible — when a spec is accepted and 5 work items are created in one commit, they appear as a single grouped entry.

Content-only events (body edits with no attribute/criteria/resolution change) are omitted from the global feed to reduce noise.

Attributes

AttributeTypeRequiredDescription
idstringEntity ID for single-entity mode. Omit for global feed.
limitnumberMaximum number of events (per-entity) or commits (global) to show.
typestringEntity type filter: work, bug, spec, decision, or comma-separated.
sincestringTime filter: "7d", "30d", or ISO date.
groupstringGlobal mode grouping: commit or entity.

Universal attributes

bg

The background layer (SPEC-088): image, video, gradient, flat overlay wash and legibility scrim, in a single injected layer behind the rune's content.

AttributeTypeRequiredDescription
bgstringBackground preset applied to this block
bg-fromstringGradient start colour — a semantic token name (→ var(--rf-color-*))
bg-gradient"to-t" | "to-b" | "to-l" | "to-r" | "to-tr" | "to-br" | "to-bl" | "to-tl"Gradient direction (bounded named set)
bg-gradient-type"linear" | "radial" | "conic"Gradient type
bg-tostringGradient end colour — a semantic token name
bg-viastringOptional middle gradient stop — a semantic token name
scrim"top" | "bottom" | "left" | "right" | "none"Scrim direction (heaviest edge); presence turns the scrim on, "none" opts out of the default cover scrim
scrim-blur"none" | "sm" | "md" | "lg"Frost scrim blur amount
scrim-strength"sm" | "md" | "lg"Gradient scrim strength
scrim-tone"dark" | "light"Whether the scrim darkens (for light text) or lightens (for dark text)
scrim-type"gradient" | "frost"Scrim treatment: gradient (default) or frost (backdrop blur)
elevation

The chrome/depth ladder (SPEC-107). The skin maps each rung to a chrome bundle by attribute, so there is no BEM class.

AttributeTypeRequiredDescription
elevation"sunken" | "flush" | "flat" | "raised" | "floating" | "overlay" | "none" | "sm" | "md" | "lg"Surface depth on the SPEC-107 ladder (sunken→overlay); none/sm/md/lg are deprecated aliases
inset

Internal padding override.

AttributeTypeRequiredDescription
inset"flush" | "tight" | "default" | "loose" | "breathe"Inner padding of this block
motion

Scroll-reveal entrance (SPEC-105). The author declares the character, the theme owns the choreography, a behaviour owns the timing.

AttributeTypeRequiredDescription
reveal"none" | "fade" | "slide" | "scale" | "blur"Scroll-reveal entrance character (none|fade|slide|scale|blur); the theme owns the choreography
staggerbooleanCascade this block's items in as it reveals (no-op on single-child runes)
spacing

Block-level rhythm override.

AttributeTypeRequiredDescription
spacing"flush" | "tight" | "default" | "loose" | "breathe"Vertical spacing above and below this block
substrate

Generated pattern fills (SPEC-087). Markers only — the engine sets the attributes and cell/opacity custom properties, CSS draws the pattern.

AttributeTypeRequiredDescription
substrate"dots" | "grid" | "lines" | "cross" | "checker" | "none"Generated surface pattern
substrate-fill"inherit" | "inset"Surface fill the pattern sits on (full colour stays with tint)
substrate-opacity"sm" | "md" | "lg"Pattern ink strength
substrate-size"sm" | "md" | "lg"Pattern cell size
substrate-target"self" | "media"Which surface the pattern fills (overrides the rune/theme default)
tint

Per-rune colour override (SPEC-053): a named tint from the theme registry, with inline per-token overrides layered on top.

AttributeTypeRequiredDescription
tintstringColor tint preset applied to this block
tint-mode"auto" | "dark" | "light"Whether the tint adapts to auto, dark, or light mode
width

The track a block rune occupies.

AttributeTypeRequiredDescription
width"compact" | "narrow" | "content" | "wide" | "full"Maximum width constraint for this block
Not availableWhy
dropcap, readingthis rune declares no prose body
framethis rune declares neither a `frameTarget` nor a media section
prominencethis rune has no page-section header

Event types

The history extractor classifies each commit into one of five event kinds:

KindMeaning
createdEntity file first appeared in git
attributesOne or more tag attributes changed (status, priority, etc.)
criteriaAcceptance criteria checkboxes were checked or unchecked
resolutionA ## Resolution section was added or modified
contentFile changed but no attribute/criteria/resolution diff detected

How it works

History is derived from git commits, not a separate event store:

  1. git log --follow retrieves the ordered commit list for each entity file
  2. git show <hash>:<path> retrieves the file contents at each commit
  3. The opening Markdoc tag (line 1) is parsed for attribute changes
  4. Checkbox lines (- [ ] / - [x]) are diffed for criteria changes
  5. The ## Resolution section is checked for appearance or modification
  6. Consecutive versions are compared to emit typed events

Results are cached in .plan-history-cache.json, keyed by each file's latest commit hash. Subsequent builds skip files whose history hasn't changed.

Shallow clones

In shallow clones (common in CI), only available commits are processed. The timeline may be incomplete — earlier events are simply absent rather than fabricated.

Rename tracking

git log --follow tracks files across renames, so entity history is preserved even when files are reorganised. The rename itself is not surfaced as an event.

Output structure

Per-entity HTML

<section class="rf-plan-history" data-rune="plan-history">
  <ol class="rf-plan-history__events">
    <li class="rf-plan-history__event" data-kind="attributes">
      <time class="rf-plan-history__date">Apr 12</time>
      <code class="rf-plan-history__hash">a295513</code>
      <div class="rf-plan-history__changes">
        <span class="rf-plan-history__change">
          <span class="rf-plan-history__field">status</span>
          <span class="rf-plan-history__value" data-type="remove">ready</span>
          <span class="rf-plan-history__arrow">→</span>
          <span class="rf-plan-history__value" data-type="add">done</span>
        </span>
      </div>
    </li>
  </ol>
</section>

Global feed HTML

The global feed adds the rf-plan-history--global modifier and uses __commit-message and __entity-summary elements for the commit-grouped layout.

CLI companion

The refrakt plan history command provides the same history data in the terminal, with additional filtering options (--author, --status).