Skip to content

feat(witness): anchored trace replay for causal failure experiments - #42

Draft
ruvnet wants to merge 7 commits into
mainfrom
sota/anchored-trace-replay
Draft

feat(witness): anchored trace replay for causal failure experiments#42
ruvnet wants to merge 7 commits into
mainfrom
sota/anchored-trace-replay

Conversation

@ruvnet

@ruvnet ruvnet commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the infrastructure half of #41: a deterministic anchored trace replay primitive in @dream-machine/witness so repair experiments can prove they reconstructed the same causal prefix before regenerating a downstream suffix.

What changed

  • adds canonical JSON hashing for JSON-safe trace evidence
  • adds createAnchoredReplay, verifyReplayPrefix, and finalizeAnchoredReplay
  • binds prefix length/digest, exact anchor identity/evidence, original suffix digest, and original full-trace digest
  • rejects unsupported evidence, duplicate ids, non-monotonic steps, moved or modified anchors, prefix mutation, suffix boundary crossing, and immutable id reuse
  • exports the API from @dream-machine/witness
  • adds deterministic adversarial tests
  • adds ADR-0003 and updates the ADR index

Security boundary

Trace digests prove evidence identity only. They grant no execution or promotion authority. RVM remains the authority boundary. No merge, deployment, credential change, or irreversible migration is performed by this PR.

Research basis

SymTrace, arXiv:2608.25920, submitted 2026-08-26, reports that unguided whole-trajectory reruns have poor failure reproduction and repair rates. This PR does not claim to reproduce the paper's repair gains. It only adds the smaller reusable invariant needed to run a controlled RuV reproduction.

Validation plan

Repository CI must pass build, typecheck, lint, existing witness tests, and the new replay tests. A separate MetaHarness reproduction should compare whole rerun, anchored no-intervention replay, and anchored symptom-driven intervention under identical model, seeds, tools, budgets, and evaluator.

Rollback

Fully additive. Revert the module export, trace replay source/tests, and ADR. No stored-data migration or existing witness format changes.

Closes infrastructure portion of #41. Performance claims remain gated on independent reproduction.

@ruvnet ruvnet left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Portfolio verdict on this exact head: ACCEPT. The canonical evidence encoder now rejects sparse arrays, extra array properties, non-plain objects, symbol keys, non-enumerable/accessor properties, undefined values, non-finite numbers, cycles, and unsupported primitives. The accessor regression proves untrusted evidence code is not invoked. Local npm ci, build, lint, and 108/108 tests passed; CI run 33150021211 and CodeQL run 33150021171 passed. This is still provenance integrity only: it grants no execution or promotion authority, and human review remains required.

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.

1 participant