Every cast bundle carries a sibling _provenance.json: the forensic record of what was produced, from which Mold revision, by which method, and what each reference’s deterministic-vs-LLM provenance looks like. It is required, but it is not part of the skill — consumers read SKILL.md and references/; maintainers read _provenance.json.
Contract of record. The authoritative schema is the repo-local JSON Schema at scripts/lib/schemas/cast-provenance.schema.json (provenance_schema_version is a const: 2). It is Foundry-authored — there is no upstream package and no package_export; the upstream link above points at the in-repo file. The narrative in docs/COMPILATION_PIPELINE.md describes why the shape is what it is; this note plus the JSON Schema are the contract. When the two disagree, the JSON Schema wins.
Enforcement. The deterministic verifier scripts/cast-skill-verify.ts AJV-validates every committed _provenance.json against the schema and additionally rejects any entry still carrying pending_llm: true (an unfilled mode: condense placeholder). The verifier — not a packaged validator_bin — is the enforcement point, which is why this note declares neither package nor validator_bin.
Versioning. provenance_schema_version is a hard const, currently 2. A future v3 is a deliberate schema bump: change the const, migrate or re-cast existing bundles, and revise this note rather than silently widening v2. Old bundles do not auto-upgrade; foundry status surfaces staleness and foundry cast regenerates.
What it records
mold— name, source path,revision,content_hash, and thecommitthe cast was taken from. Drift detection compares the live Moldindex.mdcontent hash againstmold.content_hash; a mismatch marks the cast stale.refs[]— one entry per resolved typed reference, sorted by(kind, src)for stable diffs. Each recordsmode(verbatim/condense/sidecar), resolvedsrcand bundledst,src_hash/dst_hash(sha256 at cast time), andsource(deterministicvsllm). Verbatim copies and sidecars are deterministic; onlymode: condenserefs are LLM-produced.- LLM provenance — when
source: llm, the entry must carryprompt(origin + identity, optionally hash) so a cast can be reproduced;model(name/version) is optional but strongly recommended.pending_llm: truemarks a condense slot the deterministic phase emitted but the LLM phase has not yet filled — committed provenance with any such entry fails verification. artifacts— the pipeline handoff contract copied from the Mold’s frontmatter:produces[](with producer-ownedschema) andconsumes[](withinherited_schemaand resolvedproducers), so a harness can wire a prior step’s output path to a stableid.validation_results[]— process evidence from artifact-validator CLI runs:validator_bin,status(passed/failed/error),exit_code(authoritative), and capturedstdout/stderrplus their hashes (opaque diagnostics).
Why it exists
Provenance is the foundation for three things the Foundry promises: drift detection (Mold or ref changed since the cast), reproducibility audits (which prompt and model produced a condensed reference), and “why does this cast contain X” forensics (every dst traces back to a Mold ref and a src hash). Deterministic assembly is expected to be byte-stable aside from timestamps and cast_history; explicit LLM condensation is not guaranteed byte-identical, but source, prompt, and model make each LLM-produced byte reviewable.
The field tables below are generated from the JSON Schema itself; anchors are stable for deep-linking from Mold bodies and design docs.