Skip to content

IR-746: route generated JSON and corpus names through the canonical encoder - #356

Merged
kreneskyp merged 13 commits into
mainfrom
code/ir-746-canonical-migration
Oct 11, 2026
Merged

kreneskyp merged 13 commits into
mainfrom
code/ir-746-canonical-migration

Conversation

@kreneskyp

@kreneskyp kreneskyp commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Boolean source maps and Kani proof graphs previously emitted struct-order JSON, and corpus case names hashed non-canonical JSON. This change routes the three typed artifact records through core::canonical for RFC 8785 bytes and one trailing newline, with a counted 16 MiB projection limit. Corpus names now hash a separate counted 1 MiB canonical preimage that preserves full i128 values as decimal strings. Encoding refusals remain typed and occur before any corpus identity is claimed.

The change also removes duplicate JSON and artifact wrappers and the dated panic-scan exception. The corpus preimage takes foreign record fields from their owning serializers, preserving only the existing three input key aliases, order-independent object/reference tuples, and CG-owned request representation; this resolved a preparatory high-severity schema-drift finding. Tests check exact canonical key order, a generated name against a hand-authored preimage and fixed SHA-256 digest, wide-integer distinction, both size limits, typed refusals, and the single encoder boundary. Independent code/Rust, gap, and spec reviews are recorded in SR-7200–SR-7203; both unique findings were fixed on this branch. Two later test assertions were corrected without weakening their source-scan, schema, or trace checks.

The initial pre-PR validation ran on clean head 8f7ec72354ed453e845ac2085d6538ddfc6ac42a and Cargo.lock blob c188e43f68bf23138088a8acb8c5dd2bdfa339c8: formatting, spec validation, Clippy, MSRV, and ordinary tests passed (221 library, 443 integration with 27 intentional real-Kani ignores, one doctest). The sandboxed make ci stopped only when cargo deny could not write its advisory database lock; an elevated same-head tail passed deny, the one-copy check, unsafe audit, and rustdoc. The separate real make kani-gate passed all 27 Kani/replay cases with Kani 0.68.0 and CBMC 6.11.0, peak 7,478,013,952 bytes under the 20 GiB cap.

A final-diff review (SR-7688/7689) found that a 1 MiB preflight on the verbose owning FiniteInput could refuse a case whose normalized identity fits. The fix uses a derived 4 MiB bound only for that intermediate projection; the final canonical preimage retains its 1 MiB limit. Focused positive admission and existing over-limit refusal tests pass. The same reviewer confirmed the fix and the final trace-only delta, including correction of an overbroad FR-015-AC-94 test tag. The reviewed public head is 9b5638be11ec2a856309a000f520ac9aa122bc26; final-head native validation is complete: formatting, Quire spec validation, Clippy, both MSRV and ordinary full tests, deny, one-copy, unsafe audit, and rustdoc passed on the clean head. make ci reached deny and stopped only because the sandbox made the advisory database lock read-only; an elevated same-head tail passed the remaining targets. The second real Kani gate passed on the reviewed 9b5638be11ec2a856309a000f520ac9aa122bc26 head: 27/27 Kani/replay cases, kani-gate: result=passed, Kani 0.68.0, clean tree and unchanged lockfile. The final merge-resolution head 40509e4805fedaa31af3c58a1a3a50c539b17349 incorporates CG main 9ca8759 and resolves one spec matrix conflict, preserving both TC-042 and TC-052. Its src, tests, and Cargo.lock tree objects are byte-identical to reviewed and proved 9b5638b; make spec and git diff --check pass on 40509e4.

@kreneskyp
kreneskyp marked this pull request as ready for review October 11, 2026 10:40
@kreneskyp
kreneskyp merged commit 91d5943 into main Oct 11, 2026
3 checks passed
@kreneskyp
kreneskyp deleted the code/ir-746-canonical-migration branch October 11, 2026 10:40
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