Repository navigation
Make the integer-token scan total: bounds-check the string loop - #56
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. check_integer_tokens indexed bytes[i] while skipping a string, relying on the caller having parsed the text first. The loop now stops at the end of the text, so the function cannot panic on any input and panic-freedom needs no precondition. Behaviour on text that parsed is unchanged. Must-fail test: integer_token_scan_never_panics panics with an index out of bounds against the unchecked loop. 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/56 |
|
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
|
|
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 b): make
check_integer_tokensbounds-checked so panic-freedom needs no precondition. Stacked on #50 (baseclaude/beta-holes-first) because both changesrc/strict.rsand the same exclusion row.Change
While skipping a string, the scan indexed
bytes[i]until it met a closing quote, relying on the caller having parsed the text first. That held at both call sites, so this was not a reachable hole, but the function panicked on any text with an unterminated string. The loop now stops at the end of the text, and the object key is taken withinput.get(..). Behaviour on text that parsed is unchanged.Evidence (rustc 1.99.1)
cargo test --locked --lib integer_token_scaninteger_token_scan_never_panicsFAILED:index out of bounds: the len is 1 but the index is 1cargo test --locked --all-features-D warnings,cargo fmt --checkscripts/proven-coverage.shThe new test runs the scan on six malformed texts and on every string of up to five symbols over nine characters (66,430 inputs). That is
TESTEDwith those bounds, not a proof.Ledger
verification/PROOF-STATUS.adoc, row "No panic on any input": status unchanged (OPEN); the reason now records that the precondition is gone and names the test. No verifier has been run. Row census unchanged: 0 of 7 rows of theparse_jcsplan table change status.Generated by Claude Code