[PR #1354] [MERGED] fix(snapshot): preserve complete investigation revision histories #2820

Closed
opened 2026-10-17 21:10:41 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1354
Author: @Y0UW1SH
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @morluto

Base: main ← Head: fix/snapshot-investigation-history


📝 Commits (1)

  • 0fafd3d fix(snapshot): preserve complete investigation revision histories

📊 Changes

4 files changed (+322 additions, -46 deletions)

View changed files

📝 docs/cli.md (+6 -0)
📝 src/domain/evidenceBundle.test.ts (+130 -0)
📝 src/domain/evidenceBundle.ts (+44 -45)
📝 tests/boundary/mcp/workflowSnapshotReplayMcp.test.ts (+142 -1)

📄 Description

A question created on target A keeps its investigation scope when updated while target B is active. Snapshot projection previously filtered each revision by its referenced Evidence subject. It could therefore save a valid snapshot containing revision 1 (open) while the live ledger contained revision 2 (resolved).

This change selects complete histories by unknown ID and retains their referenced registry mutation Evidence even when those edits were recorded on another active target. Original Evidence subjects and revision digests remain intact. Histories with incompatible observation or question dependencies are pruned as complete units, including their dependents, so exclusions cannot silently revert a disposition or create revision gaps. Unrelated foreign-target observations and questions remain excluded.

Regression coverage includes public MCP record/update, target switching, snapshot save/read, and reopen/list for verified, withdrawn, and out-of-scope resolutions. It also checks intermediate-revision exclusions, dependent-history pruning, projection idempotence, and the existing graph with more than 125,000 dependents. The CLI snapshot guide explains the scope rules.

Validation:

  • 49 tests passed across the MCP workflow, snapshot filesystem, binary-session, and direct snapshot replay suites.
  • Domain bundle/snapshot and investigation-owner checks passed; the final bundle suite passed all 6 tests.
  • npm run check:ci: passed, with 0 lint errors.
  • npm run docs:check: passed.
  • npm run test:changed -- --base origin/main: 551 passed, 4 skipped, 2 failed. Both failures also reproduce on unchanged main (750fb656) before any snapshot projection: binarySessionCleanupRetry.test.ts cases "retains Hopper process handles, private files, and lease until an actual session cleanup retry succeeds" and "reports a direct Hopper close failure and retries the retained owned process" return HopperStartError during startup.

Real Hopper, Ghidra, and IDA execution was not performed. The requested independent second review found no remaining blockers and independently reran all 6 new domain/MCP cases successfully. The published tree matches the verified local tree. This PR remains a draft.


🔄 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/1354 **Author:** [@Y0UW1SH](https://github.com/Y0UW1SH) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/snapshot-investigation-history` --- ### 📝 Commits (1) - [`0fafd3d`](https://github.com/morluto/rea/commit/0fafd3d90f2904697cfa9b444dbfef31e6ab2f67) fix(snapshot): preserve complete investigation revision histories ### 📊 Changes **4 files changed** (+322 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `docs/cli.md` (+6 -0) 📝 `src/domain/evidenceBundle.test.ts` (+130 -0) 📝 `src/domain/evidenceBundle.ts` (+44 -45) 📝 `tests/boundary/mcp/workflowSnapshotReplayMcp.test.ts` (+142 -1) </details> ### 📄 Description A question created on target A keeps its investigation scope when updated while target B is active. Snapshot projection previously filtered each revision by its referenced Evidence subject. It could therefore save a valid snapshot containing revision 1 (open) while the live ledger contained revision 2 (resolved). This change selects complete histories by unknown ID and retains their referenced registry mutation Evidence even when those edits were recorded on another active target. Original Evidence subjects and revision digests remain intact. Histories with incompatible observation or question dependencies are pruned as complete units, including their dependents, so exclusions cannot silently revert a disposition or create revision gaps. Unrelated foreign-target observations and questions remain excluded. Regression coverage includes public MCP record/update, target switching, snapshot save/read, and reopen/list for verified, withdrawn, and out-of-scope resolutions. It also checks intermediate-revision exclusions, dependent-history pruning, projection idempotence, and the existing graph with more than 125,000 dependents. The CLI snapshot guide explains the scope rules. Validation: - 49 tests passed across the MCP workflow, snapshot filesystem, binary-session, and direct snapshot replay suites. - Domain bundle/snapshot and investigation-owner checks passed; the final bundle suite passed all 6 tests. - `npm run check:ci`: passed, with 0 lint errors. - `npm run docs:check`: passed. - `npm run test:changed -- --base origin/main`: 551 passed, 4 skipped, 2 failed. Both failures also reproduce on unchanged main (`750fb656`) before any snapshot projection: `binarySessionCleanupRetry.test.ts` cases "retains Hopper process handles, private files, and lease until an actual session cleanup retry succeeds" and "reports a direct Hopper close failure and retries the retained owned process" return `HopperStartError` during startup. Real Hopper, Ghidra, and IDA execution was not performed. The requested independent second review found no remaining blockers and independently reran all 6 new domain/MCP cases successfully. The published tree matches the verified local tree. This PR remains a draft. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:10:41 +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#2820
No description provided.