Repository navigation
Check member order after sorting instead of trusting the sort (breaking: new error variant) - #57
Draft
hyperpolymath wants to merge 1 commit into
Draft
hyperpolymath wants to merge 1 commit into
hyperpolymath wants to merge 1 commit into
Conversation
Owner ruling of 2026-12-01. write_object_jcs sorts members with slice::sort_by and then requires their keys to be strictly increasing in UTF-16 code-unit order (jcs_core::strictly_increasing, with a Pearlite contract); otherwise it returns CanonicalizationError::MemberOrder. The trusted part of the sort shrinks to its being a permutation. BREAKING: CanonicalizationError gains the variant MemberOrder; the enum is not non_exhaustive. Recorded in the new CHANGELOG.adoc. Members are now collected once as (key bytes, value) pairs, which also removes the per-key map lookup. No verifier has been run; J-6 stays OPEN. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDfneftEg71bUadt3v3
|
Review these changes at https://app.gitnotebooks.com/hyperpolymath/ijson-jcs/pull/57 |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
❌ The last analysis has failed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Owner ruling of 2026-12-01 (hardening a): prove member order instead of trusting
sort_by. Stacked on #55 (baseclaude/beta-proof-reader), the top of the #53 → #54 → #55 stack.Breaking change
CanonicalizationErrorgains a variant,MemberOrder. The enum is not#[non_exhaustive], so downstream code that matches it without a wildcard arm stops compiling. This lands before any 0.1 tag, as ruled, and is recorded in a newCHANGELOG.adoc.Change
write_object_jcsstill sorts withslice::sort_by, but then callsjcs_core::strictly_increasingand returnsMemberOrderunless every adjacent pair of keys is in strict UTF-16 order. Under a strict total order, a strictly increasing sequence is the one sorted arrangement of its keys, so anything written is in canonical order. What is trusted of the sort shrinks from "sorted" to "a permutation of its input" (assumption A-3, reworded).Members are collected once as
(key bytes, value)pairs, which removes the per-key map lookup. No input is known to trigger the new error.Evidence (rustc 1.99.1)
cargo test --locked --all-featuresstrictly_increasing_refuses_disorder_and_repeats,test_member_order_is_certified_not_trustedscripts/tests/proof-gate-test.sh(stub verifiers)-D warnings,cargo fmt --checkscripts/proven-coverage.shunreachableexclusions (the refusal and thereturn false), each named with the unit test that executes it; no other new uncovered linecargo bench --locked,canonical-object-v1, median of 9One thing the tests cannot show: deleting the call to
certify_member_orderwould not fail any test, because the standard sort never returns disorder. That call is three lines read by eye; the check it calls is what carries the contract.No verifier has been run.
Ledger
J-6(members written in strictly increasing order): status staysOPEN; scope now namesstrictly_increasingand its contract, and says which three lines are outside Creusot's scope.A-3narrowed to "permutation". Census unchanged: 16 obligations,PROVEN0,TESTED8,OPEN8; 7ASSUMEDboundaries.Generated by Claude Code