Surface / foldkit-metadata

Evidence

A law such as Product.reservedWithinStock is satisfied by a transition (write:Sell) when an Evidence record attests to it:

RecordIssued byWhen
EnumeratedLaws.check (foldkit-entity)Verified by enumerating the declared shapes
BoundedLaws.check (foldkit-entity)Proved from declared number bounds across all rows
WalkedWalk.run (foldkit-remote/testing)Every seeded walk from every start passed
ScenarioScenario.run (planned)A multi-step scenario ran with no mismatch
RuntimeOnlyEvidence.runtimeOnlyDeclared manually when only production enforces the law

Because a record is plain data, each producer creates an issuer once and stamps every record it returns by object identity. A record built directly with Evidence.Enumerated(...) or copied via object spread carries no stamp, so a reader can reject it:

ts
import { Option } from 'effect'
import { Evidence } from 'foldkit-metadata'

const line = Evidence.runtimeOnly({
  transition: 'write:Sell',
  law: 'Product.reservedWithinStock',
  why: 'only the writer reads stock and reserved together, where the sale commits',
})

Evidence.issuedBy(line) // Option.some('foldkit-metadata/runtimeOnly')
Evidence.issuedBy({ ...line }) // Option.none(): a copy was issued by no one

Evidence.runtimeOnly throws if why is empty or blank. Application code typically calls only runtimeOnly and issuedBy, and pattern-matches records with Evidence.$match.

What the stamp proves. A stamp identifies which issuer created the record object, not that the underlying claim is bug-free. Calling Evidence.issuer(name) twice with the same name throws, so later modules cannot impersonate an existing producer. Keep Evidence.issuer calls inside dedicated evidence-producing modules, and remember that a Walked record covers only the seeds and steps it ran.