[PR #845] [MERGED] refactor: compose investigation record ownership #2283

Closed
opened 2026-10-16 21:16:43 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: refactor/investigation-record-ownership


📝 Commits (1)

  • d12858d refactor: compose investigation record ownership

📊 Changes

27 files changed (+627 additions, -127 deletions)

View changed files

📝 docs/architecture.mermaid (+7 -0)
📝 docs/capability-migration.md (+29 -1)
📝 src/application/BinarySession.ts (+6 -2)
📝 src/application/BinarySessionComposition.ts (+2 -0)
📝 src/application/BinarySessionPort.ts (+4 -41)
📝 src/application/BinarySessionRecords.ts (+25 -45)
➕ src/application/investigation/InvestigationRecordPort.ts (+67 -0)
➕ src/application/investigation/InvestigationRecords.test.ts (+145 -0)
➕ src/application/investigation/InvestigationRecords.ts (+142 -0)
📝 src/server/promptCompletion.ts (+2 -1)
📝 src/server/registerAndroidTools.ts (+2 -2)
📝 src/server/registerApplicationTools/types.ts (+8 -4)
📝 src/server/registerArtifactTools.ts (+2 -2)
📝 src/server/registerBrowserScenarioTool.ts (+2 -2)
📝 src/server/registerBrowserTools.ts (+2 -2)
📝 src/server/registerElectronTools.ts (+2 -2)
📝 src/server/registerEnhancedTools.ts (+8 -5)
📝 src/server/registerEvidenceTools.ts (+2 -2)
📝 src/server/registerFirmwareTools.ts (+2 -2)
📝 src/server/registerJavaScriptRuntimeObservationTools.ts (+2 -2)

...and 7 more files

📄 Description

BinarySessionRecords currently constructs the investigation ledger together with binary snapshots. Compose one InvestigationRecords owner around the existing EvidenceLedger, and keep BinarySessionRecords as the compatible binary snapshot/notification facade. Non-binary MCP callback consumers now use narrow Evidence read/write/atomic ports; BinarySessionPort retains its existing structural methods.

The facade supplies the same active target for recordUnknown/updateUnknown; atomic Evidence-plus-Unknown writes keep their target-free mutation subject. Snapshot imports notify after both record and cache commits. Unknown-only bundle changes still notify when no new Evidence is added. Close, failed-cleanup clearing, target switching, detached reads, optimistic revisions, Evidence identities and snapshot constraints are preserved. No second ledger, persistence, global state, permission field or retention-policy change is introduced.

Refs #740 (T2 ownership pilot; the roadmap remains open). This does not close #721.

Verification:

  • 15 record/snapshot pilot cases passed, including eight new service/composition regressions for exact subjects, rollback, revision conflicts, store isolation, observer failures and post-commit notification order.
  • 36 existing session, retained-reference, bundle, Unknown, lifecycle and filesystem snapshot cases passed. All five inline/retained application workflows and connection isolation remain compatible.
  • Five original ledger cases passed serially, including more than 10,000 records and an inline record larger than 64 MiB.
  • 15 MCP capture/workflow cases passed across eight files for browser, scenarios, Electron, Inspector, Android, firmware and managed behavior.
  • npm run check, npm run verify:test-discovery (490 files exactly once) and npm run docs:check passed; generated public schemas and catalogs are unchanged.
  • npm run verify:inspector passed on Linux with eight native Node CLI/MCP fixtures.
  • npm run verify:package passed, including installed CLI/MCP, full catalog, target-free lifecycle, bundle/Unknown workflows and isolated setup.

Real Hopper/Ghidra and other substituted engines were not exercised locally. Recording ports establish composition and lifecycle behavior; real Inspector and packaged-artifact checks establish their stated narrower boundaries. Existing provider authority and resource limits are unchanged.


🔄 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/845 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `refactor/investigation-record-ownership` --- ### 📝 Commits (1) - [`d12858d`](https://github.com/morluto/rea/commit/d12858dfd5e15dad8f44657486d9b21325871b29) refactor: compose investigation record ownership ### 📊 Changes **27 files changed** (+627 additions, -127 deletions) <details> <summary>View changed files</summary> 📝 `docs/architecture.mermaid` (+7 -0) 📝 `docs/capability-migration.md` (+29 -1) 📝 `src/application/BinarySession.ts` (+6 -2) 📝 `src/application/BinarySessionComposition.ts` (+2 -0) 📝 `src/application/BinarySessionPort.ts` (+4 -41) 📝 `src/application/BinarySessionRecords.ts` (+25 -45) ➕ `src/application/investigation/InvestigationRecordPort.ts` (+67 -0) ➕ `src/application/investigation/InvestigationRecords.test.ts` (+145 -0) ➕ `src/application/investigation/InvestigationRecords.ts` (+142 -0) 📝 `src/server/promptCompletion.ts` (+2 -1) 📝 `src/server/registerAndroidTools.ts` (+2 -2) 📝 `src/server/registerApplicationTools/types.ts` (+8 -4) 📝 `src/server/registerArtifactTools.ts` (+2 -2) 📝 `src/server/registerBrowserScenarioTool.ts` (+2 -2) 📝 `src/server/registerBrowserTools.ts` (+2 -2) 📝 `src/server/registerElectronTools.ts` (+2 -2) 📝 `src/server/registerEnhancedTools.ts` (+8 -5) 📝 `src/server/registerEvidenceTools.ts` (+2 -2) 📝 `src/server/registerFirmwareTools.ts` (+2 -2) 📝 `src/server/registerJavaScriptRuntimeObservationTools.ts` (+2 -2) _...and 7 more files_ </details> ### 📄 Description BinarySessionRecords currently constructs the investigation ledger together with binary snapshots. Compose one InvestigationRecords owner around the existing EvidenceLedger, and keep BinarySessionRecords as the compatible binary snapshot/notification facade. Non-binary MCP callback consumers now use narrow Evidence read/write/atomic ports; BinarySessionPort retains its existing structural methods. The facade supplies the same active target for recordUnknown/updateUnknown; atomic Evidence-plus-Unknown writes keep their target-free mutation subject. Snapshot imports notify after both record and cache commits. Unknown-only bundle changes still notify when no new Evidence is added. Close, failed-cleanup clearing, target switching, detached reads, optimistic revisions, Evidence identities and snapshot constraints are preserved. No second ledger, persistence, global state, permission field or retention-policy change is introduced. Refs #740 (T2 ownership pilot; the roadmap remains open). This does not close #721. Verification: - 15 record/snapshot pilot cases passed, including eight new service/composition regressions for exact subjects, rollback, revision conflicts, store isolation, observer failures and post-commit notification order. - 36 existing session, retained-reference, bundle, Unknown, lifecycle and filesystem snapshot cases passed. All five inline/retained application workflows and connection isolation remain compatible. - Five original ledger cases passed serially, including more than 10,000 records and an inline record larger than 64 MiB. - 15 MCP capture/workflow cases passed across eight files for browser, scenarios, Electron, Inspector, Android, firmware and managed behavior. - `npm run check`, `npm run verify:test-discovery` (490 files exactly once) and `npm run docs:check` passed; generated public schemas and catalogs are unchanged. - `npm run verify:inspector` passed on Linux with eight native Node CLI/MCP fixtures. - `npm run verify:package` passed, including installed CLI/MCP, full catalog, target-free lifecycle, bundle/Unknown workflows and isolated setup. Real Hopper/Ghidra and other substituted engines were not exercised locally. Recording ports establish composition and lifecycle behavior; real Inspector and packaged-artifact checks establish their stated narrower boundaries. Existing provider authority and resource limits are unchanged. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:16:43 +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#2283
No description provided.