Proof Portal

Projects

jsonparser

ProbeLabs36 findings · 123 requirements
SYS-REQ-114SystemApproved

ParsePath converts a JSONPath-style string (root $.

PriorityshallTypeguaranteeCategoryfunctionalComponentparserAssuranceBFindingsnone open

Specification

The requirement exactly as authored — its complete prose text and, where present, the formal FRETish sentence it compiles to.

Description

ParsePath converts a JSONPath-style string (root $. optionally followed by dot-delimited keys, [N] numeric array-index bracket components, [*] wildcard, and "quoted" keys containing dots or brackets) into the path-component slice accepted by Get/Set/Delete/ArrayEach/EachKey. CompilePath parses the path once and returns a CompiledPath value whose Get/GetString/GetInt/Set/Delete/ArrayEach/EachKey methods behave identically to invoking the equivalent top-level function with the parsed components. ParsePath returns errEmptyPath for an empty input and errMalformedPath for any non-conforming syntax (unbalanced bracket, missing key between dots, control character in quoted key, non-numeric bracket index other than *).

FRETish formula
the parser shall always satisfy compiled_jsonpath_resolves_to_same_result_as_equivalent_key_path

Rationale & tags

Why this requirement exists, and how it is categorised.

v1.4.0 exposes a JSONPath compiler so callers can amortize the cost of parsing a path string across many Get/Set/Delete operations and so external callers can express bracket-index paths without hand-assembling [N] tokens. The contract that CompiledPath methods are observationally equivalent to the equivalent top-level function must be explicit so future refactors do not diverge the compiled and uncompiled code paths.

jsonpathcompilerpathparsenominalboundarymalformed_input

Verification & provenance

How this requirement was checked: the review trail, edit history, and the machine-analysis status terms (each ⓘ explains what it means).

Assurance levelB
Formalizationvalid
Realizabilityrealizable
Vacuitychecked_ok
Strategyfretish

Review

Status
approved
Reviewer
human:buger · lead_engineer
Reviewed
Jul 28, 2026, 09:13 UTC
Severity lowered from high to medium on the nominal hazard (consistent with SYS-REQ-112/113 nominal hazards) so high_severity_obligation_without_vector does not require a vector for a non-security-relevant observational-equivalence hazard.

History

Created
Jul 28, 2026, 08:29 UTC · human:cli
Modified
Jul 28, 2026, 09:13 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 catalogue
Discharged

Happy-path behavior with valid inputs.

Worst case if violatedMedium

CompiledPath methods diverge observationally from invoking the equivalent top-level function with the parsed components (different error semantics, different returned offsets, different mutated document shape), breaking the substitution invariant callers rely on.

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    Covered by 2 tests
Discharged

Behavior at limits, thresholds, and edge-of-range values.

Worst case if violatedMedium

A root path ("$" or "$.") or empty input drives ParsePath to return a wrong-shaped slice (nil vs empty) or to panic; the root-array-index case ("$[0]") misroutes through the dotted-key parser and returns errMalformedPath for a valid path.

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    Covered by 1 test
  • negativerecommendedpresent
    Covered by 1 test
Discharged

Behavior when inputs are syntactically or structurally invalid.

Worst case if violatedHigh

An unbalanced bracket, missing key between dots, control character in a quoted key, or non-numeric bracket index other than * is accepted as a parsed component instead of returning errMalformedPath / errUnterminatedKey, producing a path slice that silently fails to resolve downstream or crashes searchKeys.

Discharging evidence2/2 required witnessed
  • negativerequiredpresent
    Covered by 1 test
  • nominalrequiredpresent
    Covered 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).

FRETish formula

the parser shall always satisfy compiled_jsonpath_resolves_to_same_result_as_equivalent_key_path

Variables

NameTypeDirectionDescription
compiled_jsonpath_resolves_to_same_result_as_equivalent_key_pathTrue when ParsePath converts a JSONPath-style string ($.dot, [N], [*], "quoted") into the path-component slice accepted by Get/Set/Delete/ArrayEach/EachKey and CompiledPath methods are observationally equivalent to invoking the matching top-level function with the parsed components, with errEmptyPath for empty input and errMalformedPath for non-conforming syntax.

Witnesses· 2 scenarios total

  • TestMCDC_SYS_REQ_114_Row1_InvariantViolation
    mcdc_spec_witnesses_test.go:3621exercises 1 condition scenario
  • TestMCDC_SYS_REQ_114_Row2_Nominal
    mcdc_spec_witnesses_test.go:3639exercises 1 condition scenario
  • TestCompilePathRoundTrip
    path_compiler_test.go:165
  • TestParsePathErrors
    path_compiler_test.go:84
  • TestParsePath
    path_compiler_test.go:9

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.

If you change this

Requirements
0
Files
1
Tests
3
At-risk contracts
0

Files to re-check (1)

  • path_compiler.gopath_compiler.go

Tests to re-run (3)

  • mcdc_spec_witnesses_test.gomcdc_spec_witnesses_test.go
  • parser_test.goparser_test.go
  • path_compiler_test.gopath_compiler_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.

Sign in to discuss this with the proof team.Sign in