WORK-412
ID:WORK-412Status:done

Complete the standardised fixture corpus

With the format + loader in place (WORK-411), author a good fixture for every rune so the gallery, editor, and inspect render the whole catalogue correctly. The WORK-407 gallery surfaced ~25 runes with no real fixture (rendering the broken stub) and several child runes shown standalone.

Priority:highComplexity:complexMilestone:v0.22.0Source:SPEC-102

Criteria completion

Criteria completion: 2 of 4 (50%) checked; history from Jun 12 to Jun 120%25%50%75%100%Jun 12Jun 12
Branches 2
History 5
  1. cdaa05d
    • ☑ The gallery deduplicates byte-identical variant cells.
    • ☑ A `refrakt gallery` run shows no stub artefacts and no identical-output variant noise across the catalogue.
    by bjornolofandersson
  2. ac9b655
    Content editedby Claude
    WORK-412: complete the renderable fixture corpus + gallery hygiene
  3. 320213c
    Created (pending)by bjornolofandersson
  4. 62575eb
    Content editedby Claude
    WORK-411: unify fixtures into packages/runes/fixtures + generated RUNE_E
  5. 09b3a2e
    Content editedby Claude
    plan: accept SPEC-102 and break it into work items (WORK-411–415)

Scope

  • Author canonical fixtures for every rune that can render standalone but lacked one (badge, bar, card, gallery, progress, drawer, juxtapose, section, annotate, reveal, deflist, …). badge and other inline runes embed in prose (a standalone block paragraph inside an inline span is the <p>-in-<span> bug).
  • Gallery handling of non-standalone runes — child runes that declare a specific parent (budget-line-item, form-field, reveal-step, …) are skipped; directive / registry / post-process runes that can't render outside the cross-page pipeline (bg, tint, aggregate, collection, relationships, expand, file-ref, blog, snippet) show an honest "no standalone preview" gap marker, never the broken stub.
  • Dedupe byte-identical variant cells in the gallery so no-op variants don't add noise.

(Frontmatter field parsing/validation — role / attributes — and <rune>.<scenario>.md scenarios are consumed by WORK-414 (validation) and WORK-413 (AI few-shot); fixtures carry the frontmatter now, parsing lands there.)

Acceptance Criteria

  • Every standalone-renderable rune has a canonical fixture that parses, transforms, and renders correctly (no <p>-in-inline-span breakage); inline runes embed in prose.
  • Child runes (specific parent) are skipped; directive/registry/post-process runes show an honest gap marker, never the broken stub.
  • The gallery deduplicates byte-identical variant cells.
  • A refrakt gallery run shows no stub artefacts and no identical-output variant noise across the catalogue.

Dependencies

  • Requires WORK-411 (format + loader). Validated against the WORK-407 gallery.

References

  • SPEC-102 · packages/runes/fixtures/**.md · packages/cli/src/commands/gallery.ts.

Resolution

Completed: 2026-06-12

Branch: claude/work-412-fixture-corpus.

What was done

Gallery hygiene (packages/cli/src/commands/gallery.ts):

  • Skip child runes that declare a specific parent (e.g. budget-line-item → Budget); parent: '*' wrappers are not auto-skipped.
  • Dedupe byte-identical variant cells per rune — removed the bulk of the "identical variants" noise.
  • Runes with no real fixture render an honest gap marker (hasFixture() added to cli/lib/fixtures.ts), never the broken stub.

Corpus — authored 11 canonical fixtures (packages/runes/fixtures/*.md) for the standalone-renderable runes that lacked one: badge, annotate, bar, card, deflist, drawer, gallery, juxtapose, progress, reveal, section. Content adapted from the rune docs and verified via inspect. badge is authored inline (embedded in prose) — the standalone-block form was the root of the <p>-in-<span> bug, now fixed (0 occurrences).

Impact

  • Gallery: 51 → 46 runes (5 child runes skipped), 239 → 139 cells (dedup + skips), 0 <p>-in-<span>, and only 9 gap markers remain — all genuinely non-standalone-renderable: directive (bg, tint), registry/post-process (aggregate, collection, relationships, expand, file-ref, blog, snippet). These need the cross-page pipeline + registry, which the gallery's per-page render doesn't run.
  • 790 runes+gallery tests green (incl. the examples drift test, which now regenerates from the larger corpus).

Scope / notes

  • Frontmatter field parsing/validation (role/attributes) + <rune>.<scenario>.md scenarios were re-homed to WORK-414 (validation) and WORK-413 (AI), where the fields are consumed. Fixtures carry the frontmatter (role: canonical, notes) now; the block is stripped on load.
  • The 9 gap-marker runes are a gallery limitation, not missing fixtures — the gallery renders the per-page identity transform, not the register/aggregate/post-process phases. A future "registry-fed gallery" (or a documented skip-list) could cover them; out of scope here.