Proof Portal
jsonparser
ProbeLabs36 findings · 123 requirementsGetArrayLen returns the number of elements in the addressed JSON array (0 for an empty array), and GetObjectLen returns the number of key-value pairs in the addressed JSON object (0 for an empty object).
Specification
The requirement exactly as authored — its complete prose text and, where present, the formal FRETish sentence it compiles to.
GetArrayLen returns the number of elements in the addressed JSON array (0 for an empty array), and GetObjectLen returns the number of key-value pairs in the addressed JSON object (0 for an empty object). Both helpers address the container by key path without invoking a caller callback, returning KeyPathNotFoundError when the path is missing and MalformedArrayError / MalformedObjectError when the addressed value is not the expected container type.
the parser shall always satisfy !addressed_container_is_array_or_object | returns_container_element_count
Rationale & tags
Why this requirement exists, and how it is categorised.
Rationale & tags
Why this requirement exists, and how it is categorised.
Existing ArrayEach/ObjectEach iteration APIs force the caller to provide a callback that runs per element; callers who only need the count pay callback overhead and must carry mutation hazards in the callback closure. A direct length accessor closes the gap as a v1.4.0 exported helper.
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
- human:buger · lead_engineer
- Reviewed
- Jul 28, 2026, 08:49 UTC
History
- Created
- Jul 28, 2026, 08:28 UTC · human:cli
- Modified
- Jul 28, 2026, 08:49 UTC · human:buger
Obligations
What this requirement must witness to be considered satisfied — the required evidence, and the tests that discharge each one.
3 obligations · 3 discharged
Browse the catalogueHappy-path behavior with valid inputs.
GetArrayLen/GetObjectLen return a count that does not match the actual number of elements/pairs in the addressed container, silently corrupting downstream length-based branching.
- nominalrequiredpresentCovered by 2 tests
Behavior at limits, thresholds, and edge-of-range values.
An empty addressed array ([]) or object ({}) drives a regression in scanContainerLen that double-counts the closing delimiter or panics on the empty body, inverting the zero-vs-nonzero branch downstream.
- nominalrequiredpresentCovered by 2 tests
Behavior when inputs are syntactically or structurally invalid.
A non-container addressed value (scalar, mismatched bracket) or a missing path returns a silent zero count or a wrong error type (e.g. nil instead of MalformedArrayError / KeyPathNotFoundError), hiding the lookup failure from the caller.
- negativerequiredpresentCovered by 2 tests
- nominalrequiredpresentCovered by 2 tests
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 !addressed_container_is_array_or_object | returns_container_element_count
Variables
| Name | Type | Direction | Description |
|---|---|---|---|
| addressed_container_is_array_or_object | — | True when the value addressed by the GetArrayLen/GetObjectLen key path is a JSON array (GetArrayLen) or object (GetObjectLen) container rather than a scalar or missing path. | |
| returns_container_element_count | — | True when GetArrayLen returns the number of elements in the addressed array (0 for an empty array) or GetObjectLen returns the number of key-value pairs in the addressed object (0 for an empty object), with no caller callback invoked. |
Witnesses· 3 scenarios total
- TestGetArrayLenlen_uint_test.go:8
- TestGetObjectLenlen_uint_test.go:92
- TestMCDC_SYS_REQ_112_Row1_TriggerFalsemcdc_spec_witnesses_test.go:3538exercises 1 condition scenario
- TestMCDC_SYS_REQ_112_Row2_InvariantViolationmcdc_spec_witnesses_test.go:3550exercises 1 condition scenario
- TestMCDC_SYS_REQ_112_Row3_Nominalmcdc_spec_witnesses_test.go:3566exercises 1 condition scenario
Its place
This requirement shown inside its trace neighbourhood — the parents it satisfies, the code and tests attached to it, and its findings.
Loading graph…
Trace evidence
The concrete artifacts linked to this requirement — implementing code, verifying tests, documents, and the findings raised against it.
Impact
Blast radius — if you change this requirement, what else may need re-checking, and what it in turn depends on.
Impact
Blast radius — if you change this requirement, what else may need re-checking, and what it in turn depends on.
If you change this
Files to re-check (1)
- parser.goparser.go
Tests to re-run (3)
- len_uint_test.golen_uint_test.go
- mcdc_spec_witnesses_test.gomcdc_spec_witnesses_test.go
- parser_test.goparser_test.go
What this rests on
Parent requirements (1)
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.