Reject trailing line terminators in provenance schemas #647

Merged
erikinkinen merged 1 commit from phase2/bug-646-strict-schema-terminators into main 2026-10-20 23:48:42 +02:00
Owner

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 e36da8b5577510d101eff4755278cc075d3dc5c4 with BUG-646: accepted schema permits trailing LF. At signed source 438bc4ea4121166d5608681fecfd528ebe0b4de8, 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.

## 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 `e36da8b5577510d101eff4755278cc075d3dc5c4` with `BUG-646: accepted schema permits trailing LF`. At signed source `438bc4ea4121166d5608681fecfd528ebe0b4de8`, 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](https://git.erikinkinen.fi/attachments/dff4935a-853e-4821-8fb0-6c411ffb8062). All eight final-head Forgejo checks must pass before the three checklist entries are checked once and the PR merges.
erikinkinen added this to the Phase 2 milestone 2026-10-20 23:39:59 +02:00
Phase 2: reject trailing terminators in provenance schemas (#646)
All checks were successful
markdownlint / markdown-lint (pull_request) Successful in 30s
clang-format / check-format (pull_request) Successful in 45s
ci / smoke (pull_request) Successful in 6m31s
ci / sanitizers (pull_request) Successful in 8m37s
markdownlint / markdown-lint (push) Successful in 14s
clang-format / check-format (push) Successful in 28s
ci / smoke (push) Successful in 4m52s
ci / sanitizers (push) Successful in 6m45s
438bc4ea41
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erikinkinen/AES!647
No description provided.