interplane.Get Omega
Read in your language

aien-receipts

Append-only AIEN verification receipts, indexed by repository and exact source commit. Read verdicts, signatures and retained logs before making a claim.

Brought by drakestapleton

branch main Branches Tags History

aien-receipts / docs / receipt-index.md

220 lines · 14677 bytes Raw Blame History Source

Receipt index and replay

Linear DRA-167. Status: proposed on branch feat/dra-167-receipt-index as a draft pull request. It changes the layout of this repository, so under AGENTS.md ("Safety and approvals") it needs explicit maintainer approval and a change to the ADR 0033 doctrine in aien-architecture. Drake Stapleton has delegated merge judgment to Queen, the Completion Hive coordinator (DRA-162, 59767dce); Queen's approval of this pull request is the maintainer approval. The ADR 0033 amendment is drafted below and lands in aien-architecture before this pull request merges. Neither has happened yet.

index/receipt_index.json lists receipts that may be cited as evidence. For each one it pins where the bytes live, what they hash to, which correction applies and what verdict follows. tools/replay_receipt.py rebuilds every entry from the pinned commits, checks the shelf HEAD for a later correction, and refuses an entry whose recomputed fields differ from the file or that carries a field the tool does not check.

What an entry records

FieldMeaning
idEntry name (no :).
issue_or_gateThe issue or gate the receipt evidences: value, basis and verified. Derived from the receipt where it names one: for signed bundles the repository and the gate of every required check, for Omega receipts milestone and contract_id. A receipt that names neither carries operator text with verified: false, and replay prints it as UNVERIFIED.
kindsigned-bundle (this shelf) or omega-qualification-receipt (aien-dev/omega-evidence).
shelfRepository, commit, path, SHA-256 and byte length of the receipt bytes at that commit.
sourceThe verified repository and commit. For Omega receipts also: the field that named the commit, whether it resolves upstream, and the result for every artifact digest (match, mismatch, absent, commit-unresolved, not-recoverable (build output)).
trust_anchorSigned bundles: the first parent of the source commit, with its .aien/verify.pub and .aien/always.
correctionThe adjacent <basename>.correction.json at the shelf commit, which must be byte-identical at the shelf HEAD: path, SHA-256, id, supersedes_historical_status_for_admission, qualification_claim. null when none exists at either.
historical_verdict, effective_verdict, effective_basisThe status the receipt states, the verdict after the admission check, and which rule decided it.
replayThe command that replays the entry: exactly python3 tools/replay_receipt.py replay <id>.

Any other field, in an entry or at the top level of the index, is REJECTED (UNKNOWN_FIELD): a claim the tool does not check cannot sit in the index. The descriptive top-level fields (issue, generated_by, independence, admission_check, precedence, exit_codes, scope, excluded, generated_utc) are known but not recomputed; see "Values taken on trust".

The admission check

Applied in this order. The first rule that decides wins.

  1. Bytes. The file at shelf.repository@shelf.commit:shelf.path must hash to shelf.sha256. Otherwise the entry is REJECTED (DIGEST_MISMATCH).
  2. Correction. The adjacent <basename>.correction.json must be byte-identical at the shelf commit and at the current HEAD of the shelf repository; a correction added or changed after the indexed commit is REJECTED (STALE_CORRECTION) until the entry is re-admitted at the HEAD. If the correction exists, its corrects member must name this repository, path and SHA-256. Otherwise REJECTED (CORRECTION_UNBOUND). When it sets supersedes_historical_status_for_admission, its qualification_claim is the effective verdict. The receipt bytes are never changed. Signed bundles have no correction rule yet, so a bundle.correction.json is REJECTED (CORRECTION_UNSUPPORTED) rather than ignored. Each kind lives on one shelf (signed-bundle in this repository, omega-qualification-receipt in aien-dev/omega-evidence); any other shelf is REJECTED (SHELF_REPOSITORY).
  3. Signed bundles. The key must equal .aien/verify.pub from the first parent of the source commit, never a key found only in the bundle. The Ed25519 signature must verify over the canonical bytes without signature. The repository and commit must match the shelf path, executor.id must be the SHA-256 of the key, every gate in .aien/always must be present and required, and the declared verdict must equal the computed one (FAIL if any required check failed; PASS if every required check ran or was cached with PASS; NOT_RUN otherwise). Any failure is REJECTED with the aien-test reason code. Otherwise the bundle verdict stands.
  4. Omega receipts without a superseding correction. The named implementation commit (qualified_implementation_commit, else git_commit) must exist in the source repository, and every recoverable source artifact must hash to its recorded digest at that commit. Otherwise the effective verdict is REFUSED_SOURCE_PROVENANCE. build/ outputs cannot be recovered and are not counted. The receipt_commit field is recorded but does not decide.
  5. Index drift. Every field except id and replay is recomputed, issue_or_gate included, and replay must be the exact command for the id. Any difference from the index is REJECTED (INDEX_DRIFT); an unknown field is REJECTED (UNKNOWN_FIELD). An index whose entry was edited to claim, say, "hardware qualified on GB10" fails here.

The shelf HEAD is printed on every replay but not stored, so a new publish on the shelf does not change the index unless it touches a correction.

A historical QUALIFIED / PASS is therefore never admitted on its own text.

Replaying

Needs network access to GitHub, Python 3, Git and OpenSSL 3. Each run uses a fresh temporary Git cache unless --cache DIR is given.

python3 tools/replay_receipt.py replay spark-rsi@f72209e6     # one entry
python3 tools/replay_receipt.py replay --all                  # the whole index
python3 tools/replay_receipt.py replay spark-rsi@f72209e6 --bytes /tmp/copy.json   # control

The last line is the result, for example REPLAY omega-evidence/M8: REFUSED_UNSUPPORTED_PROVENANCE rc=4.

ExitMeaning
0PASS
1FAIL: an authenticated FAIL verdict
2NOT_RUN: an input could not be reached, or a usage error
3REJECTED: bytes, signature, binding, correction binding, stale correction, unknown field or index drift
4REFUSED: by a shelf correction or by the source-provenance check

replay --all exits 0 only when every entry reproduces exactly as indexed, whatever its verdict. Never treat a nonzero exit of a single replay as a pass.

Keep negative controls outside this checkout. --bytes replays a local copy instead of the fetched file, so a byte-corrupted copy must end in REJECTED DIGEST_MISMATCH with exit 3.

The offline tests build disposable repositories and serve them over file://:

python3 -m unittest discover -s tests -v

Admitting a new receipt

Every later receipt goes through the same check. admit computes the entry from pinned commits and prints it; it exits 3 instead when rule 1, 2 or 3 rejects the receipt. Admit at the shelf HEAD: an older commit fails rule 2 whenever a correction has landed since.

python3 tools/replay_receipt.py admit --kind signed-bundle \
  --shelf aien-dev/aien-receipts@<shelf-commit>:<repo>/<sha>/bundle.json --id <repo>@<short-sha>
python3 tools/replay_receipt.py admit --kind omega-qualification-receipt \
  --shelf aien-dev/omega-evidence@<shelf-commit>:<receipt>.json --source-repo aien-dev/omega-mv \
  --id omega-evidence/<milestone>

--issue-or-gate "<text>" is accepted only for a receipt that names no issue or gate; the text is recorded with verified: false. For a receipt that names one, the option is a usage error (exit 2).

Append the printed object to entries, increase index_version when the schema changes, and run replay --all. Never write an entry by hand: a hand-typed digest, verdict or issue fails rule 5.

Values taken on trust

The tool cannot recompute these from the pinned bytes. A reader relies on them as stated:

Version 2 contents

Version 1 was generated on 2026-11-06 by Receipts167. Version 2 was regenerated by admit at the same pinned shelf commits; only issue_or_gate changed, every digest and verdict is identical. Replayed on the Spark on 2026-11-06: replay --all 16/16 entries reproduce, and every issue_or_gate is derived from its receipt.

EntryEffective verdictBasis
spark-rsi@68528ecaFAILSigned bundle; RSI-TEST FAIL. DRA-167 source anchor (recorded here, not in the index).
spark-rsi@f72209e6, aien-architecture@1a359434PASSSigned bundles.
omega-evidence/M4, M10, M11, M12, M13, M14, M15, M17PASSNamed commit resolves; source digests match.
omega-evidence/M8, M9REFUSED_UNSUPPORTED_PROVENANCEShelf corrections recorded 2026-10-26.
omega-evidence/M5REFUSED_SOURCE_PROVENANCEgit_commit does not exist in aien-dev/omega-mv. No shelf correction yet.
omega-evidence/M6REFUSED_SOURCE_PROVENANCEAt the named commit, src/omega_self_host.c is absent and both AArch64 sources differ. No shelf correction yet.
omega-evidence/M7REFUSED_SOURCE_PROVENANCEAt the named commit, src/omega_verify.c is absent and src/omega_validate.c differs. No shelf correction yet.

Also recorded, not deciding:

index.excluded lists the omega-evidence receipts in other layouts, which are not yet covered.

Limits

ADR 0033 amendment (draft)

To be added to docs/adr/0033-aien-verification-pipeline.md in aien-dev/aien-architecture (drafted against ad8d1eb), after the 2026-10-26 amendment and before "Not decided here":

Amendment 2026-11-06 (receipt index on the receipts shelf)

Approved for the maintainer by Queen, the Completion Hive coordinator, under Drake Stapleton's delegation of merge judgment (DRA-162, 59767dce), with aien-dev/aien-receipts#12 (DRA-167). Nothing in Decisions 1 to 14 or in the earlier amendments changes, and published <repo>/<sha>/bundle.json files keep their bytes, layout and meaning.

  1. A receipt index on the same shelf. aien-dev/aien-receipts gains index/receipt_index.json, the replay tool tools/replay_receipt.py, its offline tests tests/test_replay.py and the description docs/receipt-index.md. The index lists the receipts that may be cited: signed bundles from this shelf and Omega qualification receipts from aien-dev/omega-evidence, each with the pinned shelf commit, SHA-256, the correction that applies and the effective verdict.
  2. Written only by the tool. Entries are written only by tools/replay_receipt.py admit. Replay recomputes every entry except its name and command, and rejects any difference, any field it does not check, and any correction that differs between the indexed commit and the shelf HEAD.
  3. Corrections outrank historical status. A .correction.json that supersedes a receipt's historical status decides the effective verdict; a historical QUALIFIED / PASS is never admitted on its own text. Omega receipts without a superseding correction must also match their named source commit.
  4. Bundles unchanged. Signed bundles are checked as in Decision 6 (key from the source commit's first parent, verdict algebra of Decision 7). The index does not re-sign or move them, and a bundle correction file is refused until a rule for it is decided.
  5. Not a gate. The index is a citation aid. It is not an input to `aien-test verify-bundle`, the AIEN Alpha job or any merge gate, and a replay by the index's author is not an independent review.