WORK-639
ID:WORK-639Status:ready

Marks are a value shape; metaType decides what they look like

A metaFields entry can render its value as marks: rating: { total } makes the engine emit total spans, the first value of them data-filled="true" (buildRatingValue, packages/transform/src/engine.ts). The mechanism is generic (its own doc comment says "star ratings, progress dots, etc."), but the output is not:

Priority:mediumComplexity:simpleSource:SPEC-161
claude/v041-plan-runes-keep-content View source

Criteria completion

Criteria completion: 0 of 8 (0%) checked; tracking started on Oct 10, no incremental history yet0%25%50%75%100%Oct 10Oct 11

Tracking started Oct 10 — check back for trends.

History 1
  1. 8dca765
    Created (ready)by bjornolofandersson

Acceptance Criteria

  • The field shape is marks: { total, values? }; rating: { total } keeps working as an alias for one release, with a deprecation note
  • The marks element carries the field's metaType as data-meta-type, like the other shapes; a field with no metaType gets none
  • values maps an enum to a filled count ({ trivial: 1, simple: 2, moderate: 3, complex: 4 }); a value with no entry renders as plain text
  • The marks carry a text alternative (for example role="img" and aria-label="3 of 4", localisable), asserted in a test
  • metaType gains rating; testimonial declares metaType: 'rating' and renders exactly as today
  • Lumina draws stars for [data-meta-type="rating"] marks and neutral dots for every other marks element
  • work renders complexity through marks, and the five [data-complexity] ::after rules in work.css are deleted
  • Contracts are regenerated on both copies and the diff reviewed; the SEO baseline does not move (rating still publishes ratingValue)

Approach

buildRatingValue becomes buildMarksValue, reads f.field.marks ?? f.field.rating, resolves the filled count through values when present, and copies f.field.metaType onto the element as buildIconValue does. ResolvedField.ratingTotal follows the rename. The metaType unions in packages/transform/src/types.ts gain 'rating'.

A composed rune declares marks through metaFields in frontmatter, as testimonial's does in SPEC-161 D1, so the composition path needs nothing beyond the rename.

References

  • SPEC-161 D1: the composed testimonial, which measured the rating shape publishing through a composition.