Repository navigation
3.x.x: list the legacy audit rows import-audits refuses for 2.x's window-proof parts digest, and write their sidecars in shards (#731) - #732
Conversation
…dow-proof parts digest, and write their sidecars in shards (#731) 2.x wrote an audit-bundle.v2 body's share_parts_digest_hex over its share parts in insertion order, and 3.x recomputes it with serde_json's sorted keys. So import-audits refuses every such body whose canonical sidecar is missing from its root (#731); on the cutover drill's restored tree that was 9,531 rows. The bodies are intact, and the cutover path is the canonical sidecars that prism_legacy_range_sidecars.py (#715) proves and writes. scripts/prism_legacy_parts_digest_check.py lists those rows without reading any slot. It follows import's order: a row whose sidecar is in the import root is not checked further. For a v2 body it recomputes the digest in 2.x's form and in the form 3.x recomputes, writes the refused rows in the sidecar tool's --rows format, runs in parallel with --jobs, and exits 0 only when no row would be refused. scripts/prism_legacy_range_sidecars_sharded.sh runs the sidecar tool with --write over N disjoint shards, each with its own CSV, work directory and report; the tool's report would otherwise be one shared file. It exits 0 only when every shard does and no temporary file is left in the import root, and refuses an output directory inside the import root or one that is not empty. A fixture written by 2.x.x's own writer pins both forms. The checker's 2.x digest reproduces the one 2.x stored, and the real canonicalizer refuses the body exactly when the checker lists it, then accepts it, with the canonical bytes' sha256 equal to the committed digest, once the digest is in the checker's 3.x form. The tests also run the sharded runner with the real canonicalizer and check its guards. CI's real-canonicalizer step and make test-prism-legacy-range-sidecars run the new module, and docs/prism-rust-migration.md documents the procedure. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af7c13ddbe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…r cover has-sidecar means only that the sidecar file is there, and import verifies its bytes; the checker's exit 0 covers this digest, missing or unreadable bodies and v2 bodies for another digest, not the other ways import can refuse a row, such as #709's escaped range digests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4bd8c036a3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…er's edge cases as 3.x does ShellCheck refused the runner's `ls shard-*.csv | wc -l` (SC2012). It now keeps the shards in an array, accepts 1 to 99 shards (the two-digit split suffix), and succeeds only when every shard has left an exit status. The checker now treats an empty share_parts_digest_hex as 3.x does: as a value it compares and refuses, not as a missing digest. It reports a body-ref that commits to another audit digest as body-digest-differs, and a body that raises while being classified is reported as body-unreadable instead of ending the run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…2026-08-24 have no canonical sidecar The guide said 2.x wrote a sidecar beside every v2 body. It writes one beside each new body only since #173 was deployed. On union, the bodies from before 2026-08-24, about 9,500 of them, have none, so most legacy v2 rows reach the parts-digest check. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Set VERSION and [workspace.package].version to 3.0.0-rc.5: rc.4 plus #737's fixes in #742 (fatal-state clear accepts a tip that only grew, takes --timeout-seconds, and runs the integrity report under its own statement timeout) and #744 (migration 026: the report computes each set once); the deferred share-hash backfill in #743 and #746 (migrate --defer-share-hashes, then the throttled backfill-share-hashes after go-live); #745 (migrate --offline-indexes, which composes with --defer-share-hashes); the cutover tooling merged after rc.4's tag (#728, #732, #736, #740); and #747, a test-only fix for #724. Both Cargo.lock files move only their workspace-member entries. doc/release-notes-3.0.0-rc.5.md, dated 2026-10-08, covers: - the changes, with the report's estimated 57 to 29 s since 026, the migrate --defer-share-hashes command measured on the pair at 5 min 06 s (539d6c9, before #745), backfill-share-hashes' throttle, record of 2 and safe rerun, the evidence scripts' changes, and the offline index builds' estimated gain; - upgrading: migrate is needed again (a binary-only upgrade refuses "missing migration(s) 26", and this export refuses a database without 026), the cutover's migrate step with both flags, and finishing the backfill after go-live under #738's snapshot rule, with self-check only at low share rates. Rolling back to rc.4 at fence 2 goes only by finishing the backfill first or from the pre-migrate backup or physical copy, and each rc.4 refusal is quoted where it applies: a start meets the cursor first and says to run migrate, which rc.4's migrate refuses. The rules still in force: #737's statement timeout for rc.4's tools, 026 or not, #738's snapshot rule, and fatal-state clear --timeout-seconds, whose bound ends before the commit; - the same evidence set as rc.4's, with each PR's merge SHA, the pair's serving evidence carried, and the rehearsal's full measurements left to the cutover's go/no-go record; - the known issues: rc.4's, minus #737's F1, F2, F4 and F5, plus #737's open part, #738 (its fix planned for rc.6), #739, #741, #731 and #734, with #582 closed and #712 and #724 updated. docs/prism-rust-migration.md now says how earlier candidates refuse a database at fence 2: a start with the backfill's own refusal, whose advice to run migrate holds only for this release, and their migrate, or a start with PRISM_POSTGRES_INIT_SCHEMA=1, with the fence. The development-line notes name 3.0.0-rc.5, and they and the 3.0.0 notes link all five candidates' notes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Why
The cutover drill's
import-auditsstopped withinvalid audit body ref: window proof share_parts_digest_hex mismatch.share_parts_digest_hexover its share parts in insertion order.serde_json::json!, which sorts the keys (3.x.x: 2.x audit-bundle.v2 bodies fail 'window proof share_parts_digest_hex mismatch' because 3.x recomputes the parts digest with serde_json's sorted keys and 2.x hashed insertion order (post-cutover; sidecars cover the cutover) #731). So 3.x refuses every 2.x v2 body.--root. On the drill's restored tree that was 9,531 rows: v2segment_rangebodies at heights 17 to 53,294.The bodies are intact. The cutover path is canonical sidecars, proven and written by
scripts/prism_legacy_range_sidecars.py(#715). #731 tracks the runtime fix for after the cutover.This PR pins the two scripts the drill uses tonight. They are byte-for-byte the copies the drill runs:
scripts/prism_legacy_parts_digest_check.pybb517f29ef2a2d8c4e57bb7fa239b8f037d5e12433767be6da8898b3434f7fa5scripts/prism_legacy_range_sidecars_sharded.sh7c24c260ee0a2eae0ca85ccb31528ae07e5908aea3709328123d9a3a7e3a3205What
scripts/prism_legacy_parts_digest_check.pylists the rows import would refuse, without reading any slot.--sidecar-dir(import's--root) ishas-sidecar, and its body isn't read.--affected-csvwrites the refused rows (2x-order-only,matches-neither) in the sidecar tool's--rowsformat.--jobs Nparses bodies in parallel.scripts/prism_legacy_range_sidecars_sharded.shruns the sidecar tool with--writeover N disjoint shards.sidecar-ok) instead of rewriting them.tests/fixtures/prism-legacy-v2-audit-body/is a v2 body and its two slots, written by 2.x.x's own writer (AuditArtifactStore.prepare_external_audit_bodyat50e208ca) for a bundle built byqbit-prism-build-audit-bundle. Its README records exactly how it was made. 2.x's v2 writer only emitssegment_rangeparts, so the fixture has no inline part.tests/test_prism_legacy_parts_digest_check.py:--jobsparity;PRISM_AUDIT_CANONICALIZE_BIN, the fixture against the real canonicalizer:make test-prism-legacy-range-sidecarsrun the new module.docs/prism-rust-migration.mddocuments the procedure next to 3.x.x: legacy audit segment range digests use Python's ASCII-escaped JSON; also accept that form so 1.x/2.x bodies with non-ASCII worker names verify without sidecars #709's.Test evidence (local)
python3 -m unittest tests.test_prism_legacy_parts_digest_check: 18 tests, OK (2 skipped without the binary).PRISM_AUDIT_CANONICALIZE_BIN=target/debug/qbit-prism-audit-canonicalize,tests.test_prism_legacy_range_sidecarsplus the new module: 38 tests, OK. The new module also passed three repeat runs.check_gate_env_reads.py,check_prism_settings.py,check_deleted_test_map.py,check_toolchain_pin.py,tests.test_docs_lab_prism_references,tests.test_check_prism_settings,tests.test_check_gate_env_readsandtests.test_makefile_lifecycleall pass.Refs #731
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.