Repository navigation
Proofs (reader): noncharacter and safe-integer core with Pearlite contracts and a Verus model, not yet run - #55
Draft
hyperpolymath wants to merge 1 commit into
Draft
hyperpolymath wants to merge 1 commit into
hyperpolymath wants to merge 1 commit into
Conversation
…h contracts (not yet run) - src/ijson_core.rs: is_noncharacter (arithmetic, no bit mask), is_safe_i64, is_safe_u64, with Pearlite contracts behind cfg(creusot) and a lemma tying the arithmetic form to the Unicode list. Exhaustive test over every code point; boundary test for the safe range. - Harness: includes the new file by path; one more true and false control; the gate self-test and SCOPE follow. - verification/verus/reader_model.rs: model of the predicates, bounded traversal and duplicate-key rejection. Not run. - verification/PROOF-STATUS.adoc: reader section R-1 to R-7, A-6, A-7. No verifier has been run; every proof row stays OPEN or TESTED. 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/55 |
|
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.
Proof module 2 of the beta track:
src/strict.rsandsrc/ijson.rs. Stacked on #54 (base branchclaude/beta-proof-gate), which is stacked on #53; review those first.No verifier has been run. Every proof row is
OPENorTESTED.Scope, and what is not in it
In scope and done: the Unicode and numeric predicates, moved to a dependency-free core (
src/ijson_core.rs) with Pearlite contracts, included by path in the Creusot harness, with one more true control and one more false control.Not annotated on the production code, with the reason:
StrictVisitorimplementsserde::de::Visitorand is driven byserde_json::Deserializer, andvalidate_valuerecurses overserde_json::Value. Termination underMAX_DEPTH, panic-freedom and duplicate rejection before insertion all need a trusted Pearlite model ofValue,Mapand theVisitor/MapAccessprotocol first. That model is the trust boundary the brief names, and I have recorded it (A-6) but not written it. Those rows therefore stayTESTEDon existing tests orOPEN; I did not write contracts I could not anchor to a model.A Verus model covers the same properties at the model level (
verification/verus/reader_model.rs): the predicates, traversal with a termination measure, and duplicate-key rejection with a proof that the reader accepts exactly the key sequences with no repeat. It is a separately written model, so it is not a proof of the production code and not a second independent witness (policy §1.2).Production change
is_noncharacternow testscode_point % 0x10000 >= 0xFFFEinstead of(code_point & 0xFFFF) >= 0xFFFE, so its contract needs no bit-vector reasoning.validate_number_is_i_jsoncallsis_safe_i64/is_safe_u64. Behaviour is unchanged, as tested below.Evidence (executed here, rustc 1.99.1)
cargo test --locked --all-featuresis_noncharactervs the previous definition, every value in 0..=0x20FFFF (covers all code points)src/ijson_core.rsscripts/tests/proof-gate-test.sh(stub verifiers)-D warnings,cargo fmt --checkscripts/proven-coverage.shsrc/ijson.rsexclusions re-bound to moved lines; still exits 1 for the pre-existingparse_jcslinesNot executed: Creusot, Why3, Verus, Kani, Z3, CVC5. Kani has no scope: no
unsafe, no FFI.Row census
Denominator: the 7 obligations R-1 to R-7 added to
PROOF-STATUS.adoc.PROVENPROVEN-WITH-AXIOMSTESTEDASSUMEDOPENWith #53: 16 obligations,
PROVEN0,TESTED8,OPEN8; 7ASSUMEDboundaries.Open points
check_integer_tokensindexes under an unstated precondition (the text already parsed). It holds at both call sites, so this is not a hole, but the proof would be simpler and unconditional if the scan bounds-checked. Not changed here; it needs a ruling because it adds unreachable branches.TESTEDuntil the serde model (A-6) is written and a Creusot image exists.Generated by Claude Code