Surface / foldkit-metadata

Exports

CallMeaning
Metadata.key<A>(name, { merge, summarize })Declares a slot and returns a key with of and get.
Metadata.emptyA 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 / WalkedRecord constructors and $match / $is helpers.

Limits

  • Opaque and frozen. Only of and combine construct a valid Metadata. 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.summarize outputs 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 Enumerated or Bounded evidence: foldkit-entity.
  • See how laws and evidence fit together: Laws.