Reject leading-zero numbers and non-JSON whitespace in legacy logs #633
No reviewers
Labels
No labels
bug
cli
core
docs
event
experiment
figure
invariant
metrics
oracle
phase-0
phase-1
phase-2
phase-3
phase-4
phase-5
phase-6
provenance
revocation
tests
workload
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erikinkinen/AES!633
Loading…
Reference in a new issue
No description provided.
Delete branch "phase2/bug-632-jsonl-numeric-grammar"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task
Closes #632.
Summary
The legacy decoder accepted
"v":03and treated vertical tab/form feed as JSON whitespace. Restrict numeric digits and whitespace to JSON's ASCII grammar and reject a leading zero before another digit. Valid legacy records retain their canonical encoding.Scope
Change only the legacy parser's lexical boundary and add a regression test covering versions 0–3. The test checks nested numeric fields, unsigned overflow, all four valid whitespace characters, invalid whitespace positions, zero and the maximum u64 value. Version-4 codec implementation remains P2-07-B.
Design intent
Return ParseError for malformed input rather than accepting a partial or silently normalized record. Preserve existing successful event semantics and archived legacy fixture bytes.
Phase discipline
This independently reproduced parser bug was found during preparation for the Phase 2 strict research codec. It has its own issue, branch and PR. P2-07-A is already merged; no scientific protocol or data contract changes are included.
Verification
Before the fix the new regression CTest ran and failed with 61 lexical acceptance failures. After the fix it passes 44 valid canonical/whitespace round trips and rejects all 117 malformed cases. The standalone probe changes from
leading_zero_accepted=1toleading_zero_accepted=0while the canonical record still succeeds.All 59 CTests pass at signed source
a0130fac20efeb36721d3d351e86e9ff7d39c767in Debug, Release and Clang ASan/UBSan, including the archived legacy fixture suite. All repository hooks pass. Before/after logs, probe source, JUnit and toolchain evidence.All eight final-head Forgejo checks must pass before the three issue checklist entries are checked once and the PR is merged.