Skip to content

fix(contracts): stop writing volatile reasoner_git_sha and cpu_ms to the witness (P5) - #5752

Merged
noahgift merged 1 commit into
mainfrom
fix/p5-witness-volatile
Oct 19, 2026
Merged

noahgift merged 1 commit into
mainfrom
fix/p5-witness-volatile

Conversation

@noahgift

Copy link
Copy Markdown
Contributor

P5: 12 of 13 DIRTY PRs conflicted on the shared witness json because each regen rewrote reasoner_git_sha and cpu_ms.

Both fields are now read-tolerant (serde default) and never serialized; the committed witness drops them. Old files still parse.

Tests: new RED→GREEN volatile_fields_are_never_written and a_witness_with_the_old_volatile_fields_still_parses; 2359 aprender-contracts lib tests pass.

Residual: census_id_set_sha256 still changes when a PR adds a contract (PR-2).

🤖 Generated with Claude Code

…the witness (P5)

A regen at another HEAD rewrote the shared witness file, so 12 of 13 DIRTY PRs conflicted on it.
Both fields are now read-tolerant and never serialized; the committed witness drops them.

Agent: aprender-w5404
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@noahgift
noahgift enabled auto-merge October 19, 2026 11:13

@noahgift noahgift left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seat 1, aprender-pace @012be68d6183063060e3a52c65c220e8d683a289

Non-author (0 aprender-pace trailers). Read the full delta (witness.rs +2, witness_tests.rs +36, the committed witness json -3 lines).
#[serde(default, skip_serializing)] on reasoner_git_sha and cpu_ms: reads of old files still work (default), writes drop the two volatile fields, so a regen at another HEAD/timing is byte-identical. The two new tests cover exactly that (identical output for different sha/cpu_ms; old-shape file still parses). Consumers I found (consistency_gate.rs:154-155, a report copy; refines_gate/liskov use a different witness type, untouched) only copy the values; I found no verdict reading them. After this, a read of the new file gives None/0 for both, so any report field showing them becomes empty, which is the intent.
NOT verified: tests run, CI, whether any non-Rust script greps the json for those keys beyond a git grep of crates/scripts/.github/ci/Makefile.

@noahgift noahgift left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seat 2: aprender-w5382 (claude-sonnet-5-5, non-author) at 012be68. Diff read in full (3 files). Witness gets #[serde(default, skip_serializing)] on reasoner_git_sha and cpu_ms: new writes drop both, old files still parse (default), and the committed witness json loses exactly those two lines, the rest byte-identical. Tests cover both directions: two witnesses differing only in sha/timing serialize identically with neither key present, and an old-shape value with both fields still deserializes. Checked consumers at this head: consistency_gate.rs copies witness.reasoner_git_sha/cpu_ms into its own receipt struct (in-memory values, still populated on read; on a fresh pv-sat run they stay set in memory, only the written file omits them), and pv-sat main.rs still sets and prints cpu_ms. No other reader of the written file's two keys found by grep in crates/scripts/ci/.github. Not run by me; CI not read. APPROVE the diff.

@github-actions

Copy link
Copy Markdown

§13.11 rung 1 — quorum shadow verdict

S13-SHADOW pr=5752 head=012be68d6183063060e3a52c65c220e8d683a289 verdict=REFUSE class=Q1 arm_rc=1

Shadow mode: this records a verdict and merges nothing. A refusal
to arm is not a block (§13 adds zero rows to §7) — the pull request is
exactly as green as it was.

@noahgift
noahgift added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit bf957b2 Oct 19, 2026
12 checks passed
@noahgift
noahgift deleted the fix/p5-witness-volatile branch October 19, 2026 18:15
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