[PR #4159] [CLOSED] fix(evidence): preserve derived replay after unknown updates #6096

Closed
opened 2026-10-31 01:11:50 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4159
Author: @rudrakshkarpe
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: fix/derived-evidence-replay


📝 Commits (1)

  • c8ee80d fix(evidence): preserve derived replay after unknown updates

📊 Changes

3 files changed (+205 additions, -5 deletions)

View changed files

📝 src/application/investigation/EvidenceLedger.ts (+6 -5)
📝 src/application/investigation/InvestigationRecords.test.ts (+38 -0)
➕ tests/acceptance/derivedEvidenceReplay.test.ts (+161 -0)

📄 Description

Purpose

Fixes #3925.

Repeating a process or function comparison fails with revision_conflict / already-exists after an analyst updates its generated unknown. The inputs and derived Evidence are unchanged, but the ledger compares the original creation request against the latest unknown revision.

Match replay against the stored creation revision instead. Preserve the current head and full history, and continue rejecting conflicting creation requests, stale explicit updates, and invalid Evidence. No schema, identity algorithm, dependency, or persistence-format changes.

This is separate from #3503, which prevents different queries from sharing an unknown identity, and #4065, which preserves the requested capture freshness limit.

Test Plan

npm run test:focused -- tests/acceptance/derivedEvidenceReplay.test.ts src/application/investigation/InvestigationRecords.test.ts src/application/investigation/EvidenceLedger.test.ts src/application/investigation/EvidenceLedger.residualUnknown.test.ts tests/boundary/mcp/serverUnknownsMcp.test.ts tests/boundary/mcp/functionComparisonMcp.test.ts
npm run check
npm run verify:test-discovery
git diff --check

Test Result

Validated on macOS arm64 with Node 24.18.0 and npm 11.16.0.

Check Result
New acceptance tests on unmodified production source at 9d6651e5b Both fail on replay after the first unknown update
Focused suite with the fix 39 passed across six files
Process and function comparison over compiled MCP stdio Equal Evidence and unchanged bundles after investigating and resolved updates
Import into a fresh MCP session Replay succeeds; resolved head and all three revisions preserved
Rejection controls Stale updates, tampered Evidence, and conflicting creation intent rejected
npm run check Passed; lint has zero errors and existing warnings
Test discovery All 1,348 files discovered exactly once
git diff --check Passed

The captures and function dossiers are synthetic canonical fixtures. No native provider or target was executed. Linux, Windows, and the full test suite were not run locally. Hosted CI requires separate verification.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/4159 **Author:** [@rudrakshkarpe](https://github.com/rudrakshkarpe) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/derived-evidence-replay` --- ### 📝 Commits (1) - [`c8ee80d`](https://github.com/morluto/rea/commit/c8ee80d3021e64c0b916a74e4b70c89617261577) fix(evidence): preserve derived replay after unknown updates ### 📊 Changes **3 files changed** (+205 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/application/investigation/EvidenceLedger.ts` (+6 -5) 📝 `src/application/investigation/InvestigationRecords.test.ts` (+38 -0) ➕ `tests/acceptance/derivedEvidenceReplay.test.ts` (+161 -0) </details> ### 📄 Description ## Purpose Fixes #3925. Repeating a process or function comparison fails with `revision_conflict` / `already-exists` after an analyst updates its generated unknown. The inputs and derived Evidence are unchanged, but the ledger compares the original creation request against the latest unknown revision. Match replay against the stored creation revision instead. Preserve the current head and full history, and continue rejecting conflicting creation requests, stale explicit updates, and invalid Evidence. No schema, identity algorithm, dependency, or persistence-format changes. This is separate from #3503, which prevents different queries from sharing an unknown identity, and #4065, which preserves the requested capture freshness limit. ## Test Plan ```sh npm run test:focused -- tests/acceptance/derivedEvidenceReplay.test.ts src/application/investigation/InvestigationRecords.test.ts src/application/investigation/EvidenceLedger.test.ts src/application/investigation/EvidenceLedger.residualUnknown.test.ts tests/boundary/mcp/serverUnknownsMcp.test.ts tests/boundary/mcp/functionComparisonMcp.test.ts npm run check npm run verify:test-discovery git diff --check ``` ## Test Result Validated on macOS arm64 with Node 24.18.0 and npm 11.16.0. | Check | Result | | --- | --- | | New acceptance tests on unmodified production source at `9d6651e5b` | Both fail on replay after the first unknown update | | Focused suite with the fix | 39 passed across six files | | Process and function comparison over compiled MCP stdio | Equal Evidence and unchanged bundles after investigating and resolved updates | | Import into a fresh MCP session | Replay succeeds; resolved head and all three revisions preserved | | Rejection controls | Stale updates, tampered Evidence, and conflicting creation intent rejected | | `npm run check` | Passed; lint has zero errors and existing warnings | | Test discovery | All 1,348 files discovered exactly once | | `git diff --check` | Passed | The captures and function dossiers are synthetic canonical fixtures. No native provider or target was executed. Linux, Windows, and the full test suite were not run locally. Hosted CI requires separate verification. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:11:50 +00:00
Sign in to join this conversation.
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
morluto/rea#6096
No description provided.