WORK-111
ID:WORK-111Status:done

Replace hardcoded density contexts with configurable childDensity

Remove the hardcoded COMPACT_CONTEXTS and MINIMAL_CONTEXTS sets from the identity transform engine and replace them with a childDensity field on RuneConfig. This lets community packages declare density behavior without modifying the engine.

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

Criteria completion

No incremental history — criteria tracking started on Apr 20.

Branches 3
History 5
  1. f2b3512
    Content editedby Claude
    Add {ID}-{slug}.md filename convention + migrate filenames subcommand
  2. 59ded4a
    Content editedby Claude
    Implement SPEC-037 plan package hardening: all 7 work items
  3. f262d7b
    Content editedby Claude
  4. da12420
    statusreadydone
    by Claude
  5. 41d5c52
    Created (ready)by Claude
    Accept SPEC-033 and break down into work items WORK-110–116

Acceptance Criteria

  • RuneConfig in packages/transform/src/types.ts has childDensity?: 'compact' | 'minimal' field
  • The engine in packages/transform/src/engine.ts reads childDensity from the parent rune's config instead of checking hardcoded sets
  • data-density attribute is applied to child runes identically to current behavior
  • Core config in packages/runes/src/config.ts declares childDensity for Grid, Bento, Gallery, Showcase, Split (compact) and Backlog, DecisionLog (minimal)
  • Hardcoded COMPACT_CONTEXTS and MINIMAL_CONTEXTS sets are removed from the engine
  • Community packages can declare childDensity in their RunePackage.theme.runes config
  • All existing tests pass — HTML output is identical before and after
  • TypeScript compiles cleanly

Approach

  1. Add childDensity to RuneConfig in types
  2. Add childDensity entries to the 7 core runes in packages/runes/src/config.ts
  3. Modify the engine's density resolution to look up the parent's RuneConfig.childDensity from the theme config map
  4. Remove the hardcoded sets
  5. Verify with refrakt inspect that output is unchanged for affected runes

References

  • SPEC-033 (Feature 4 — Configurable Density Contexts)