Skip to content

Receipts v5 (A18): instrument version 5 from the 'Show me the receipts' slides, inactive by default - #5364

Merged
realmarcin merged 24 commits into
mainfrom
feat/receipts-v5-upgrade
Oct 31, 2026
Merged

realmarcin merged 24 commits into
mainfrom
feat/receipts-v5-upgrade

Conversation

@realmarcin

@realmarcin realmarcin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Receipts instrument version 5 (board item A18), built from the "Show me the receipts" slides (JBIMS Workshop, 23 Oct 2026, slides 7, 8, 13 and 14). It is inactive. No current path selects v5:

  • registrations accept only version 4;
  • neither a marker in a receipt nor an environment variable can choose it;
  • activating v5 will take a registration change.

v3/v4 stay the defaults, and v10/A21 reads v4 (the owner's D64 item 11).

Status

  • Merge-ready as an inactive instrument, per claude's independent re-review on 2026-10-29. Merging still needs the owner's go-ahead.
  • Not ready to activate.
  • Merge timing: merging changes the code identity that shared-generation v2 registrations pin (finding N11). So merge it before the A21 registration is rebuilt, or after A21 completes, never in between.

History of the fixes

  • codex's review R_V5 found 9 findings, fixed in d64a761a3, 30a25af97 and 851e7cc84.
  • claude's review of 562ca36b2 found it fix-first. N1, N3 and N4 blocked even an inactive merge:
    • N1: a model-written receipt_format_version, or an environment variable, could select v5 over a registered v4. Fixed in 9bf4b8841: the instrument now comes only from the registration and the run's own provenance.
    • N3: model-supplied regex ran with no bound. Fixed in 4e0b4278a, with bounded patterns and inputs, and a worker subprocess with a 250 ms timeout.
    • N4: a v3/v4 coverage change. Fixed in 4b87bf52d: the guard applies to v5 only.
  • claude's re-review of e8e033bf6 found it merge-ready as inactive after R4. R4, a new gate on v3/v4, is fixed in e754b790d. claude checked the causal tests in a real checkout: 3 failed and 2 passed before, all 5 pass after. R6's reproduction and wording fixes are in 3997aff96, 00854fbe2 and 93edcc76c.

Inertness with v5 off

Byte-identical to the A13 base 148c869dd on:

  • the 54 v3/v4 corpus receipt blocks;
  • the 335 report_claims records at v7/v8;
  • both CHORUS v10 canary receipt-completion requests;
  • the generic_v10/A21 assembly digest.

codex proved this, rebuilding the base from git, and the re-review independently re-ran the comparison. Acceptance: 899 passed, 19 existing skips.

Activation blockers (filed as issues)

  • N2: tool receipts credit values that no source supports.
  • N5–N10: polarity, reconcile-edit handling, evidence_source validation, entailment, LinkML-Map verification, and provedown binding.
  • R1: the wall-clock regex budget makes a check nondeterministic across machines.
  • R2: stopping the parent orphans the regex worker.
  • R3: there is no aggregate regex bound.
  • R5 and the N12–N17 items: smaller items.

Earlier issues: #5224–#5227.

🤖 Generated with Claude Code

… provedown watermarks, and linkml-map transformation receipts
…eipts-v5-upgrade

# Conflicts:
#	src/data_sheets_schema/receipts.py
N1: remove artifact and environment selection; retain validated registration/provenance authority and report format-version discrepancies. Add causal selection and sidecar tests and update obsolete unsafe-selection expectations. Offline focused validation: 189 passed.
N3: cap patterns at 200 characters and sources at 48 Ki characters; compile and count in an isolated stdlib subprocess killed and reaped after 250 ms. Timeout, compile overflow and worker failures refuse coverage. The reviewer pathological pattern is bounded through verify_tool_receipt and check with snapshot coverage. Focused validation: 94 passed.
N4: thread the selected version through receipt-path coverage and completion planning. Preserve A13 v3/v4 numeric-scalar coverage and D37 counts; retain v5 refusal. Causal regressions cover integer, float and boolean snippets at all three versions. Focused validation: 186 passed.
N3: record the offline review portability finding and remove the test subprocess dependency on the developer harness. The child uses the parent dependency paths and measured source tree with site startup disabled.
N1, N3, N4: final causal tests produce 38 failures and 14 controls at 562ca36, then all 52 pass after remediation. The 18-module offline suite passes 894 tests with 19 existing skips. Replayed the reviewer exact slices against A13: 54 receipt records, 335 v7/v8 report records, both CHORUS v10 saved requests, and generic_v10/A21 assembly digest are identical within the documented path normalization. Preserve helper scripts, raw pytest logs/XML, and hashed comparison ledgers; note N11 without changing shared_generation.py. No network, provider calls, push, protected-path edits, or STATUS.md changes.
R4: report receipt_format_version_mismatch without gating v3/v4; retain v5 gating. Causal tests on a copied v3 corpus record and registered v4 fixtures move from 3 failures / 2 controls passing to 5 passing. Keep pytest scratch under TMPDIR/codex-v5r4-pt.
R6: archive pinned A13 into TMPDIR at runtime, recover both CHORUS canaries from pinned git objects, and compare rebuilt outputs with committed baseline hashes. Fresh one-record receipt and report canaries passed in both trees. Qualify worker reaping by parent lifetime per R2; retain the protected ROUTING_CODE concern as an offline issue draft.
R6: macOS TMPDIR uses /var while imports resolve /private/var. Assert that the declared tree resolves to the actual imported tree, then display that caller spelling so path-only normalization remains exact. Record the portability finding as an offline issue draft.
R4/R6: retain the 3-failed/2-passed to 5-passed causal transition, 899 passed and 19 skipped acceptance result, and all four equal inertness slices against a fresh git archive of A13. Record the separate read-only review and offline issue drafts; leave activation blockers and protected paths unchanged.
Resolve the scanner ConfigError at receipts.py:1532 (unsupported effect on model-text local container: projected receiving object) behind #5364's CI shard failures. Replace the any-generator's regex match receiver with an explicit short-circuit loop; preserve matching, evaluation order and results without changing the scanner.

The complete specificity module passes 357 tests, the scan matches origin/main's 96 violations with no additions, and v5 acceptance passes 899 tests with 19 skips. Retain the offline serial validation helper for the remaining A13 and related-module checks.
Record verification of the scanner ConfigError behind #5364's CI failures. The final scanner module passes 357 tests; the selected 82 modules pass 4502 tests with 20 skips. Preserve the 899-pass v5 acceptance run, all four established A13 inertness comparisons, and refreshed scans with 96 violations on both head and pinned main and zero new findings.

Retain serial offline launchers, per-module checkpoints, raw evidence and hashes. CI tests collection succeeds with 20475 cases and exact shard 4/6 selections. Record the 17 whole-root collection errors as an offline issue draft; complete shard execution and Python 3.12 validation are not claimed. No scanner/configuration changes, provider calls, network, push or protected-file edits.
CI run 41015551110 for PR #5364 failed shard 4 at tests/test_report_original_removal.py::test_unknown_instruments_are_not_mislabelled[9]: DID NOT RAISE ValueError. Version 9 is now supported, so exercise unsupported versions 10 and 99 while retaining 6, string 8, and float 8.0.

Add caller-only v9 controls for both explicit opt-ins, unchanged v7/v8 labels, measured artifacts and environment inputs, and AST checks of production callers and the runner report gate. The receipt-v5 unsupported-version test already uses 6.

Validation: 167 focused tests passed serially and offline with provider keys unset and external pytest basetemp. No production files changed. Merged-main shard validation remains pending because the upstream merge changes protected evidence paths.
@realmarcin
realmarcin marked this pull request as ready for review October 31, 2026 07:02
@realmarcin
realmarcin merged commit ee8e891 into main Oct 31, 2026
16 checks passed
@realmarcin
realmarcin deleted the feat/receipts-v5-upgrade branch October 31, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant