[PR #1721] [MERGED] perf(evidence): reuse authenticated file snapshots during session import #4776

Closed
opened 2026-10-31 00:54:56 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1721
Author: @N0zoM1z0
Created: 10/11/2026
Status: ✅ Merged
Merged: 10/11/2026
Merged by: @N0zoM1z0

Base: main ← Head: perf/evidence-bundle-authentication


📝 Commits (1)

  • 91377ba perf(evidence): reuse authenticated file snapshots during session import

📊 Changes

4 files changed (+95 additions, -33 deletions)

View changed files

📝 src/application/EvidenceBundleFiles.ts (+18 -2)
📝 src/application/investigation/EvidenceLedger.ts (+3 -2)
📝 src/server/registerSessionRecordTools.ts (+2 -2)
📝 tests/boundary/filesystem/evidenceBundleFiles.test.ts (+72 -27)

📄 Description

File-backed MCP imports previously authenticated and copied the same newly imported Evidence record across the filesystem reader, ledger parser and immutable commit. Seal an authenticated snapshot specifically for session import, so the ledger reuses its identity; ordinary CLI/comparison reads keep their mutable behavior. Validate internally constructed unknown candidates directly with the existing immutable bundle constructor.

Semantic and manifest authentication, process-capture validation, atomic unknown merges, detached public reads and complete output are preserved. No domain parser API or tool schema changes.

Closes #1718.

Validation:

  • npm run check: typecheck, lint, format, knip, metadata and architecture guards passed.
  • Focused filesystem and compiled CLI boundaries: 18 tests passed, including snapshot identity reuse, detached mutation, malformed/tampered input and unknown history rejection.
  • Evidence/ledger source tests: 38 passed with the normal deadline. The existing >125,000-dependent graph case timed out on this busy single-CPU host, then passed in a separate CPU-profile run (~30.3s) with a 120s profiling deadline; its workload, assertions and repository timeout are unchanged.
  • Real stdio MCP / SDK 2.3.1: three fresh servers before and after, using a complete 3,062,416-byte JS Evidence bundle. First/duplicate import, tamper rejection, full exported-bundle equality, ping and awaited cleanup passed.
  • Flameox analyzed server-only import profiles and the actual heavy Vitest fork. Shared-host wall times were variable and do not establish a stable latency speedup. Native providers, live cloud models and Windows were not exercised by this change.

Large-snapshot admission remains separately tracked in #1680.


🔄 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/1721 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/11/2026 **Status:** ✅ Merged **Merged:** 10/11/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `perf/evidence-bundle-authentication` --- ### 📝 Commits (1) - [`91377ba`](https://github.com/morluto/rea/commit/91377bacc7cc27168572be7de9090f5390924172) perf(evidence): reuse authenticated file snapshots during session import ### 📊 Changes **4 files changed** (+95 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `src/application/EvidenceBundleFiles.ts` (+18 -2) 📝 `src/application/investigation/EvidenceLedger.ts` (+3 -2) 📝 `src/server/registerSessionRecordTools.ts` (+2 -2) 📝 `tests/boundary/filesystem/evidenceBundleFiles.test.ts` (+72 -27) </details> ### 📄 Description File-backed MCP imports previously authenticated and copied the same newly imported Evidence record across the filesystem reader, ledger parser and immutable commit. Seal an authenticated snapshot specifically for session import, so the ledger reuses its identity; ordinary CLI/comparison reads keep their mutable behavior. Validate internally constructed unknown candidates directly with the existing immutable bundle constructor. Semantic and manifest authentication, process-capture validation, atomic unknown merges, detached public reads and complete output are preserved. No domain parser API or tool schema changes. Closes #1718. Validation: - `npm run check`: typecheck, lint, format, knip, metadata and architecture guards passed. - Focused filesystem and compiled CLI boundaries: 18 tests passed, including snapshot identity reuse, detached mutation, malformed/tampered input and unknown history rejection. - Evidence/ledger source tests: 38 passed with the normal deadline. The existing >125,000-dependent graph case timed out on this busy single-CPU host, then passed in a separate CPU-profile run (~30.3s) with a 120s profiling deadline; its workload, assertions and repository timeout are unchanged. - Real stdio MCP / SDK 2.3.1: three fresh servers before and after, using a complete 3,062,416-byte JS Evidence bundle. First/duplicate import, tamper rejection, full exported-bundle equality, ping and awaited cleanup passed. - Flameox analyzed server-only import profiles and the actual heavy Vitest fork. Shared-host wall times were variable and do not establish a stable latency speedup. Native providers, live cloud models and Windows were not exercised by this change. Large-snapshot admission remains separately tracked in #1680. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:54:56 +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#4776
No description provided.