Skip to content

test(replay): audit survivability simulation suite (Wave 14)#344

Open
ctol3r wants to merge 1 commit into
wave/replay-identity-w10from
wave/replay-survivability-w14
Open

test(replay): audit survivability simulation suite (Wave 14)#344
ctol3r wants to merge 1 commit into
wave/replay-identity-w10from
wave/replay-survivability-w14

Conversation

@ctol3r
Copy link
Copy Markdown
Owner

@ctol3r ctol3r commented May 12, 2026

Summary

Wave 14 of the trust-convergence migration. Stacked on #343 (Wave 10 canonical replay identity). Test-only PR — no product code changes.

Pins the six runtime-turbulence scenarios the brief named against the canonical replay-identity scheme, plus three audit-chain integrity invariants.

Scenarios simulated (20 jest tests)

# Scenario Property Outcome
1 Deploy replacement byte-identical ids across two independent input-object instances
2 Replay corruption tampering with any input field diverges the runId; cannot be forged
3 Degraded restoration empty-artifact run → distinct deterministic id; lineageKey preserved
4 Runtime restart 50-iteration loop → one unique id; no state drift
5 Partial persistence outage subset checksums → preserved lineageKey + different well-defined runId
6 Stale replay recovery wall-clock independence; same inputs → same id always

Audit-chain integrity invariants

  • chronological lineage continuity across N snapshots
  • gap tolerance (missing intermediate snapshots do not break lineage)
  • cross-subject collision impossibility

New doc

docs/architecture/replay-survivability-matrix.md — survivability matrix for 10 named runtime events + 6 audit-chain integrity properties + out-of-scope follow-ups linked to their wave numbers.

Truth rules

  • Banned-strings scan: CLEAN
  • No claims about external verification; ids only

Validation

  • Jest: 20/20 passing (src/services/replay/__tests__/replaySurvivability.test.ts)
  • No product code changed
  • No new dependencies

Scope

  • 2 files added (1 test, 1 doc)
  • 0 source files modified

Stacked on #343 (Wave 10). Pins the six runtime-turbulence scenarios
the brief names against the canonical replay-identity scheme, plus
three audit-chain integrity invariants the identity layer must
uphold.

Scenarios simulated (20 jest tests, all green):
  1. deploy replacement       — same v1 algorithm across two
                                independent input objects → byte-
                                identical ids; scheme-version prefix
                                recognizable.
  2. replay corruption        — tampering with entityId / lastCheckedAt
                                / artifact checksum / channel always
                                diverges the runId; ids cannot be
                                forged from a different evidence set.
  3. degraded restoration     — empty-artifact run produces a
                                deterministic distinct id (NOT a
                                random fallback); lineageKey preserved
                                across complete → degraded → restored
                                cycle.
  4. runtime restart          — 50-iteration loop yields one unique id;
                                no in-memory state drift.
  5. partial persistence      — checksum subset preserves lineageKey,
     outage                     yields a different well-defined runId;
                                runId space behaves like a hash
                                (adjacent inputs do not collide).
  6. stale replay recovery    — wall-clock independence; six-month-old
                                inputs yield same id today.

Audit-chain invariants:
  - chronological lineage continuity preserved across N snapshots
  - gap tolerance (missing intermediate snapshots do not break lineage)
  - cross-subject collision impossibility

New doc: docs/architecture/replay-survivability-matrix.md
  - Survivability matrix for the 10 named runtime events
  - 6 audit-chain integrity properties enumerated
  - Out-of-scope follow-ups linked to their wave numbers

No product code changed. No new dependencies. Test-only PR.

Validation: 20/20 jest tests passing; no banned strings.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vcv-web Ready Ready Preview, Comment May 12, 2026 2:07pm
vitalcv Ready Ready Preview, Comment May 12, 2026 2:07pm

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3d173966e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +172 to +174
it('a verifier comparing two runIds for the same lineageKey can detect inconsistency', () => {
const lineageA = computeReplayIdentity(BASE).lineageKey;
const lineageB = computeReplayIdentity({ ...BASE, entityId: '0000000000' }).lineageKey;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Verify same-lineage runIds, not just lineageKey values

This test claims to validate that a verifier can detect inconsistent runIds for the same lineage, but it never compares any runId values and it switches entityId, which creates a different lineage entirely. As written, a regression where two snapshots for the same subject incorrectly produce the same runId would still pass, leaving the stated partial-persistence invariant untested.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants