KB-5DF1
C1 Staging Codex R3 Fixes — P6 Digest Source Proof
3 min read Revision 1
c1stagingcodex-r3-fixesready-for-r42026-06-23
06 — P6 DIGEST SOURCE PROOF
c1_digest() in sql/p6-evidence-readback.sql (sha256 a021c88b…) now authenticates all three evidence
families, computed only after the gate passes, inside the SHARE-locked gated txn, persisted then read back
(never recomputed post-hoc).
Digest spans
- Vocab + P4 verification facts —
vops= ordered serialization ofcanonical_operation:operation_code|operation_title|operation_group|required_inputs|expected_outputs|allowed_modes|status|evidence. Theevidencecolumn (the P4 verify result jsonb written byc1_verify) is now included → the digest authenticates the P4 facts, answering attack A9. - Bad-input harness rows —
vharness= ordered serialization ofc1_test_resultsphase='bad':case_no|expect_code|expect_state|outcome|reject_code|sqlstate|pass(R2-3, retained) → A8. - Upstream success stamps —
vstamp= ordered serialization of the DONE stampsop|sandbox_idforc1_vocab_build/c1_verify/c1_bad_input_harness→ ties the ledger success facts into the digest (A11 reinforcement).
Emitted fields
vocab_row_count, vocab_md5, harness_row_count, harness_md5, stamp_row_count, stamp_md5,
combined_md5 = md5(vops || "##C1_HARNESS##" || vharness || "##C1_STAMPS##" || vstamp), generated_at.
combined_md5 excludes generated_at, so it is time-independent and reproducible.
Persistence & ordering
- The gate
DO $g$precedes theINSERT INTO sbx_meta.dot_manage_ledger(... 'c1_evidence_readback' ..., jsonb_build_object('gate','C1_STAGING_FAST_DRY_RUN_PASS','digest',c1_digest()))and theCOMMIT. - If the gate RAISEs → ON_ERROR_STOP aborts → the INSERT/COMMIT never run → no digest, no P6_DONE, no
verdict. The readback
SELECTreads the persisted digest row.
Read-only proof (VALUES/constants, live PG16.13)
vopsmd5 over a 2-row canonical-like set (inclevidence): deterministic (f8dcce78…).vstampover the 3 stamp rows:stamp_rows=3, deterministic md5 (16fed550…).- Determinism confirmed (string_agg ORDER BY keys; md5 stable).