Preserve and reject independent replay tampering (P2-08-C) #644

Merged
erikinkinen merged 2 commits from phase2/p2-08-c-preserved-tamper-corpus into main 2026-10-20 22:59:40 +02:00
Owner

Task

Closes #99. Plan ID: P2-08-C.

Summary

Preserve reproducible false-evidence logs and require rejection at the intended replay check. The new corpus covers independent delta, outcome, counter, cursor and digest mutations under all seven mechanisms, including checkpoint resume.

Scope

Add seven frozen ten-event baseline logs, initialization checkpoints and final canonical execution/archive documents, plus 35 complete mutated JSONL logs. A closed manifest records file/schema/generator hashes and exact changed JSON pointers and values. The independent Python checker verifies those bytes and the event schema; a C++ driver verifies actual execution and rejection behavior. Normal tests never regenerate expected artifacts. Production runtime code is unchanged.

Design intent

All mutant events remain individually canonical and valid under the event schema and production codec. Delta corruption changes a retained-view descriptor without altering its identity. Outcome corruption keeps a coherent status/reason pair. Counter corruption preserves internal totals. Cursor corruption shifts both before/after cursors while violating the preceding boundary. Digest corruption retains valid hexadecimal spelling.

Each of the 35 mutations must fail through atomic single-event replay, full compressed replay, and resume from the verified frozen initialization checkpoint: 105 targeted rejections per build. The cursor stream cases must fail at continuity; other stream cases must reach the actual-event comparison. Tests assert specific rejection messages, omit expected whole-log hashes, and use raw zstd compression to bypass writer validation. Single-event rejection must preserve complete state, then accept the original event and suffix to the exact expected final bytes.

Phase discipline

These are implementation fixtures, not scientific observations or modeled recovery experiments. P2-08 parent closure and the required Phase 5 csaI supplement remain separate. The corpus tests independent evidence-field corruption; trusted external provenance remains necessary against coordinated replacement of all artifacts.

Verification

All 77 CTests pass at signed source a426eeb9e2576d16f868f12560723c48d138c91d in Debug, Release and Clang ASan/UBSan. All eight local hooks and the frozen protocol/source checks pass. All 350 mutated event records pass independent schema validation and individual codec round trips; 35 exact mutation sets and 105 specific replay rejections pass in each build.

Four additional checker probes reject a stale file hash, a removed mutation with an updated hash, Boolean integer metadata, and an unknown manifest field before invoking the C++ verifier. Their script and observed failures are included in the evidence archive.

Exact-source JUnit, build logs, toolchains and checker-guard probes. Acceptance and input/output hashes are recorded in artifacts/backlog/2.2.1/P2-08-C/.

All eight final-head Forgejo checks are required before checking the single issue step once and merging.

## Task Closes #99. Plan ID: P2-08-C. ## Summary Preserve reproducible false-evidence logs and require rejection at the intended replay check. The new corpus covers independent delta, outcome, counter, cursor and digest mutations under all seven mechanisms, including checkpoint resume. ## Scope Add seven frozen ten-event baseline logs, initialization checkpoints and final canonical execution/archive documents, plus 35 complete mutated JSONL logs. A closed manifest records file/schema/generator hashes and exact changed JSON pointers and values. The independent Python checker verifies those bytes and the event schema; a C++ driver verifies actual execution and rejection behavior. Normal tests never regenerate expected artifacts. Production runtime code is unchanged. ## Design intent All mutant events remain individually canonical and valid under the event schema and production codec. Delta corruption changes a retained-view descriptor without altering its identity. Outcome corruption keeps a coherent status/reason pair. Counter corruption preserves internal totals. Cursor corruption shifts both before/after cursors while violating the preceding boundary. Digest corruption retains valid hexadecimal spelling. Each of the 35 mutations must fail through atomic single-event replay, full compressed replay, and resume from the verified frozen initialization checkpoint: 105 targeted rejections per build. The cursor stream cases must fail at continuity; other stream cases must reach the actual-event comparison. Tests assert specific rejection messages, omit expected whole-log hashes, and use raw zstd compression to bypass writer validation. Single-event rejection must preserve complete state, then accept the original event and suffix to the exact expected final bytes. ## Phase discipline These are implementation fixtures, not scientific observations or modeled recovery experiments. P2-08 parent closure and the required Phase 5 csaI supplement remain separate. The corpus tests independent evidence-field corruption; trusted external provenance remains necessary against coordinated replacement of all artifacts. ## Verification All 77 CTests pass at signed source `a426eeb9e2576d16f868f12560723c48d138c91d` in Debug, Release and Clang ASan/UBSan. All eight local hooks and the frozen protocol/source checks pass. All 350 mutated event records pass independent schema validation and individual codec round trips; 35 exact mutation sets and 105 specific replay rejections pass in each build. Four additional checker probes reject a stale file hash, a removed mutation with an updated hash, Boolean integer metadata, and an unknown manifest field before invoking the C++ verifier. Their script and observed failures are included in the evidence archive. [Exact-source JUnit, build logs, toolchains and checker-guard probes](https://git.erikinkinen.fi/attachments/970ec9f2-3a8c-40ce-815d-ca812cca228d). Acceptance and input/output hashes are recorded in `artifacts/backlog/2.2.1/P2-08-C/`. All eight final-head Forgejo checks are required before checking the single issue step once and merging.
erikinkinen added this to the Phase 2 milestone 2026-10-20 22:50:24 +02:00
Phase 2: record preserved replay tamper acceptance (#99)
All checks were successful
markdownlint / markdown-lint (pull_request) Successful in 19s
clang-format / check-format (pull_request) Successful in 31s
ci / smoke (pull_request) Successful in 7m15s
ci / sanitizers (pull_request) Successful in 9m12s
markdownlint / markdown-lint (push) Successful in 12s
clang-format / check-format (push) Successful in 28s
ci / smoke (push) Successful in 6m36s
ci / sanitizers (push) Successful in 9m40s
9d4824733e
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!644
No description provided.