Proof Portal
jsonparser
ProbeLabsviewing a historical runWhen internal helper tokenEnd returns len(data) as a sentinel value indicating no delimiter was found, all callers of tokenEnd shall treat this sentinel as an end-of-input condition and shall not use it as an unchecked array index that could exceed the valid data range.
Specification
The requirement exactly as authored — its complete prose text and, where present, the formal FRETish sentence it compiles to.
When internal helper tokenEnd returns len(data) as a sentinel value indicating no delimiter was found, all callers of tokenEnd shall treat this sentinel as an end-of-input condition and shall not use it as an unchecked array index that could exceed the valid data range.
the parser shall always satisfy !tokenEnd_returns_len_data | caller_bounds_checks_tokenEnd_sentinel
Rationale & tags
Why this requirement exists, and how it is categorised.
Rationale & tags
Why this requirement exists, and how it is categorised.
The root cause of PR #280 was that tokenEnd returns len(data) as a sentinel, and Delete used data[endOffset+tokEnd] without checking whether endOffset+tokEnd >= len(data). This data constraint must be formalized.
Verification & provenance
How this requirement was checked: the review trail, edit history, and the machine-analysis status terms (each ⓘ explains what it means).
Review
- Status
- approved
- Reviewer
- Buger · lead_engineer
- Reviewed
- Aug 20, 2026, 13:11 UTC
History
- Created
- Apr 14, 2026, 18:00 UTC · Claude · AI agent
- Modified
- Aug 20, 2026, 13:11 UTC · Buger
Change history
Every recorded revision of this requirement's source file — newest first, each with its commit message and the diff for that change.
Review history
Human and AI-agent approvals of this requirement — the 'why was this approved' lineage, each with the reviewer's justification and the code it cites.
- Claude:spec Conformance · AI agentApprovedSpec conformanceAug 20, 2026 · last monthREVIEW-26
tokenEnd (parser.go:55) returns len(data) as the no-delimiter sentinel and never a negative value, matching the four in-range lemmas. Every caller treats the sentinel safely: the Delete cleanup paths guard with
if endOffset+tokEnd >= len(data) { return data, false }before any deref (parser.go:1291, parser.go:1328) and gate each byte access onlen(data) > idx, while the internalGet scalar path uses endOffset+end only as a slice upper bound (parser.go:1621), which cannot exceed len(data). The inline comments about a '-1 sentinel' are factually wrong (tokenEnd never returns -1) but the actual >=len(data) guards are the correct check, so conformance holds.Cited code (4)
Obligations
What this requirement must witness to be considered satisfied — the required evidence, and the tests that discharge each one.
1 obligation · 1 discharged
Browse the catalogueA caller of tokenEnd uses the returned len(data) sentinel as data[end] rather than treating it as EOF (e.g. value classification peeks data[tokenEnd(...)] for the next delimiter), panicking with index-out-of-range.
- nominalrequiredpresentCovered by 1 test
Formula evidence
The formal formula behind this requirement, the variables it is written over, and the tests that exercise it (each term is explained inline).
Formula evidence
The formal formula behind this requirement, the variables it is written over, and the tests that exercise it (each term is explained inline).
FRETish formula
the parser shall always satisfy !tokenEnd_returns_len_data | caller_bounds_checks_tokenEnd_sentinel
Variables
| Name | Type | Direction | Description |
|---|---|---|---|
| tokenEnd_returns_len_data | — | True when the internal helper tokenEnd returns len(data) as a sentinel value indicating no delimiter was found in the remaining input. | |
| caller_bounds_checks_tokenEnd_sentinel | — | True when all callers of tokenEnd treat the len(data) sentinel as an end-of-input condition and do not use it as an unchecked array index. |
Witnesses· 3 scenarios total
- TestMCDC_SYS_REQ_044_Row1_TriggerFalseexercises 1 condition scenario
- TestMCDC_SYS_REQ_044_Row2_InvariantViolationexercises 1 condition scenario
- TestMCDC_SYS_REQ_044_Row3_BoundsCheckedexercises 1 condition scenario
MC/DC truth table· 3 rows
Each row assigns the formula's conditions (T/F) and shows the Result— the formula's value for that input row, not a test pass/fail. A row proves a condition when flipping only that condition flips the outcome. The test that covers each row is linked.
mcdc:ignoreNo-actionfalse-result row satisfied by designUncoveredneeds a covering test| # | caller_bounds_checks_tokenEnd_sentinel | tokenEnd_returns_len_data | Result | Proves | Covering test |
|---|---|---|---|---|---|
| 1 | F | F | T | tokenEnd_returns_len_data | |
| 2 | F | T | F | caller_bounds_checks_tokenEnd_sentinel | |
| 3 | T | T | T | caller_bounds_checks_tokenEnd_sentinel |
Its place
How this requirement connects — what proves it, what it affects, and what it rests on. Authored links only here; automatically derived links come from the audit index.
Loading graph…
Trace evidence
The concrete artifacts linked to this requirement — implementing code, verifying tests, documents, and the findings raised against it.
No findings affect this requirement
Nothing was flagged against this requirement in the pinned run.
Impact
Blast radius — authored trace links only (automatically derived links come from the audit index and aren't shown here).
Impact
Blast radius — authored trace links only (automatically derived links come from the audit index and aren't shown here).
If you change this
Files to re-check (1)
- parser.goparser.go
Tests to re-run (4)
- dead_code_audit_test.godead_code_audit_test.go
- deep_spec_test.godeep_spec_test.go
- mcdc_spec_witnesses_test.gomcdc_spec_witnesses_test.go
- obligation_evidence_test.goobligation_evidence_test.go
What this rests on
Discussions
Discuss this with the proof team. Nothing changes in your audit automatically — you open a request and a staff member records any outcome inside the thread.