WORK-099
ID:WORK-099Status:done

Migrate simple core runes from Model to createContentModelSchema

Migrate the straightforward core runes that use @group decorators with sequential or sectioned patterns. These have no custom processChildren logic — they map directly to sequence, sections, or delimited content models.

Priority:highComplexity:simpleMilestone:v1.0.0Source:SPEC-032

Criteria completion

Criteria completion: 7 of 7 (100%) checked; history from Apr 2 to Apr 30%25%50%75%100%Apr 2Apr 3
Branches 3
History 5
  1. e900a90
    Created (done)by bjornolofandersson
  2. f262d7b
    Content editedby Claude
  3. f0a845a
    • ☑ `accordion` rewritten using `createContentModelSchema` with `sections` content model
    • ☑ `budget` rewritten using `createContentModelSchema` with `sequence` content model
    • ☑ `reveal` rewritten using `createContentModelSchema` with `delimited` content model
    • ☑ `sandbox` rewritten using `createContentModelSchema` with `sequence` content model
    • ☑ `refrakt inspect <rune> --type=all` output is identical before and after for each rune
    • ☑ All existing tests pass after each migration
    • ☑ No Model class import remains in any of the migrated files
    by Claude
  4. a20f532
    statusreadydone
    by Claude
  5. 5c72bef
    Created (ready)by Claude
    Add work items WORK-099 through WORK-104 for legacy Model removal

Runes

RuneFilePatternContent model
accordionpackages/runes/src/tags/accordion.ts@group sectionssections
budgetpackages/runes/src/tags/budget.ts@group sequentialsequence
revealpackages/runes/src/tags/reveal.ts@group delimiteddelimited
sandboxpackages/runes/src/tags/sandbox.ts@group sequentialsequence

Acceptance Criteria

  • accordion rewritten using createContentModelSchema with sections content model
  • budget rewritten using createContentModelSchema with sequence content model
  • reveal rewritten using createContentModelSchema with delimited content model
  • sandbox rewritten using createContentModelSchema with sequence content model
  • refrakt inspect <rune> --type=all output is identical before and after for each rune
  • All existing tests pass after each migration
  • No Model class import remains in any of the migrated files

Approach

For each rune:

  1. Capture baseline output with refrakt inspect <rune> --type=all --json
  2. Rewrite schema using createContentModelSchema — map @attribute to attributes, @group to content model fields, transform() to the transform function
  3. Compare output to baseline — must be identical
  4. Run npx vitest run for any related test files

References

  • SPEC-032 (parent spec)