ID:WORK-059Status:done
Metadata Dimensions on StructureEntry
Priority:highComplexity:moderateMilestone:v0.9.0Source:SPEC-024
Summary
Add three semantic metadata fields to the StructureEntry interface: metaType, metaRank, and sentimentMap. The identity transform reads these from rune configs and emits data-meta-type, data-meta-rank, and data-meta-sentiment attributes on generated badge elements. This is the foundation that enables themes to style every metadata badge generically with ~18 CSS rules.
Acceptance Criteria
StructureEntryinpackages/transform/src/types.tsgainsmetaType,metaRank, andsentimentMapoptional fields- Identity transform engine emits
data-meta-typewhenmetaTypeis present on a structure entry child - Identity transform engine emits
data-meta-rankwhenmetaRankis present - Identity transform engine resolves sentiment by looking up the current modifier value in
sentimentMap, emittingdata-meta-sentimentwhen a match exists - Existing structure entries without metadata fields continue to work unchanged (backwards compatible)
refrakt inspectoutput shows the new data attributes on badge elements- Unit tests in
packages/transform/test/verify metadata attribute emission for: status with sentiment, category without sentiment, temporal, quantity, tag, and id types
Approach
- Extend
StructureEntryinterface inpackages/transform/src/types.tswith the three optional fields - In
packages/transform/src/engine.ts, in the code path that processes structure entry children, add logic to: readmetaTypeand emitdata-meta-type, readmetaRankand emitdata-meta-rank, look up the current modifier value insentimentMapand emitdata-meta-sentimentif found - The existing
data-{modifier-name}attributes continue to be emitted as before — metadata attributes are additive
References
- Metadata System (Metadata System — Extending StructureEntry, Identity Transform)
Relationships
History
- 59ded4aContent edited
- f262d7bsource+SPEC-024
- 4954888statusready→done
- ☑ `StructureEntry` in `packages/transform/src/types.ts` gains `metaType`, `metaRank`, and `sentimentMap` optional fields
- ☑ Identity transform engine emits `data-meta-type` when `metaType` is present on a structure entry child
- ☑ Identity transform engine emits `data-meta-rank` when `metaRank` is present
- +4 more criteria
- a129a9emilestone+v0.9.0
- a333007Created (ready, high, moderate, transform, themes, metadata)