Preserve and reject independent replay tampering (P2-08-C) #644
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!644
Loading…
Reference in a new issue
No description provided.
Delete branch "phase2/p2-08-c-preserved-tamper-corpus"
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 #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
a426eeb9e2576d16f868f12560723c48d138c91din 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.