Reject trailing line terminators in provenance schemas #647
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!647
Loading…
Reference in a new issue
No description provided.
Delete branch "phase2/bug-646-strict-schema-terminators"
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 #646. Unblocks P2-09 (#100) once the corrected shared schema is integrated.
Summary
Research event and checkpoint schemas accepted a numeric identity or 64-character digest followed by LF, although the decoders rejected those strings. Require the actual end of each provenance string using a negative lookahead that also rejects line terminators. Valid wire encodings and execution behavior are unchanged.
Scope
Correct the shared identity pattern and all four event/checkpoint digest fields. Preserve the two original failing JSONL fixtures and add schema/decoder probes for LF, CR, CRLF, U+2028 and U+2029 at each string boundary and in the middle. Retain high-bit u64, maximum-u64 and lowercase SHA-256 boundary checks.
The frozen replay corpus and its manifest are unchanged. Preserve its original schema as a hash-verified historical test input and validate each corpus record against both that schema and the corrected current schema. The historical copy is not permitted for new artifacts.
Design intent
Schema validation must recognize the same complete identity and digest strings as the decoder. Preserve the archival schema identity separately while requiring current artifacts to pass the corrected contract.
Phase discipline
Found during P2-09 independent schema validation. This bug has its own issue, branch and PR; the tape component remains on its separate branch. No protocol, campaign data or accepted historical evidence is rewritten.
Verification
The new regression assertion fails against accepted baseline
e36da8b5577510d101eff4755278cc075d3dc5c4withBUG-646: accepted schema permits trailing LF. At signed source438bc4ea4121166d5608681fecfd528ebe0b4de8, all 78 CTests pass in Debug, Release and Clang ASan/UBSan. This includes 109 complete schema/decoder cases, 166 scalar boundary probes and all 105 historical tamper replay rejections. All eight repository hooks pass.Preserved reproduction, before/after logs, full CTest/JUnit and toolchains. All eight final-head Forgejo checks must pass before the three checklist entries are checked once and the PR merges.