Surface / foldkit-metadata
Exports
| Call | Meaning |
|---|---|
Metadata.key<A>(name, { merge, summarize }) | Declares a slot and returns a key with of and get. |
Metadata.empty | A Metadata value holding no entries. |
Metadata.combine(parts) | Merges entries from each part using each key's merge rule. |
Metadata.summarize(metadata) | Formats each key's entries as text for docs and tooling. |
Metadata.is(value) | Returns true only for values created by this module. |
Evidence.issuedBy(record) | Returns Option.some(producer) if stamped, else Option.none(). |
Evidence.runtimeOnly({ transition, law, why }) | Creates a stamped RuntimeOnly record; requires non-empty why. |
Evidence.issuer(name) | Creates a module-level issuer that freezes and stamps records. |
Evidence.Enumerated / Bounded / Scenario / Walked | Record constructors and $match / $is helpers. |
Limits
- Opaque and frozen. Only
ofandcombineconstruct a validMetadata. Spreads,structuredClone, or hand-built objects read and combine as empty. Entry arrays are shallow-frozen, so keep entry values immutable as well. - Key identity is per module instance. Duplicate installs or hot-reloaded copies of an interpreter declare distinct key objects and will not see each other's entries. Declare keys once at module scope. Evidence stamps follow the same rule across duplicate copies of
foldkit-metadata. - Not serializable.
Metadata.summarizeoutputs text for display and tooling; there is no built-in deserialization back to typed entries.
Next
- Attach metadata to Model projections:
foldkit-surface. - Declare domain invariants and emit
EnumeratedorBoundedevidence:foldkit-entity. - See how laws and evidence fit together: Laws.