Repository navigation
fix(contracts): stop writing volatile reasoner_git_sha and cpu_ms to the witness (P5) - #5752
Conversation
…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
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
|
§13.11 rung 1 — quorum shadow verdict Shadow mode: this records a verdict and merges nothing. A refusal |
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_writtenanda_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