[PR #867] [MERGED] refactor: colocate investigation record implementation #2303

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

📋 Pull Request Information

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

Base: main ← Head: refactor/investigation-source-layout


📝 Commits (1)

  • 94365c7 refactor: colocate investigation record implementation

📊 Changes

9 files changed (+28 additions, -22 deletions)

View changed files

📝 docs/capability-migration.md (+6 -0)
📝 src/application/EvidenceBundleCommands.ts (+1 -1)
📝 src/application/EvidenceInputResolver.test.ts (+1 -1)
📝 src/application/investigation/EvidenceLedger.residualUnknown.test.ts (+3 -3)
📝 src/application/investigation/EvidenceLedger.test.ts (+4 -4)
📝 src/application/investigation/EvidenceLedger.ts (+6 -6)
📝 src/application/investigation/InvestigationRecords.test.ts (+1 -1)
📝 src/application/investigation/InvestigationRecords.ts (+2 -2)
📝 src/application/investigation/UnknownEvidence.ts (+4 -4)

📄 Description

Summary

Complete the first mechanical capability folder move in #740: colocate the existing Evidence ledger and Unknown Evidence helper with the composed investigation record owner and narrow ports.

Problem and expected behavior

Record ownership already belongs to InvestigationRecords, but its ledger/helper and behavior tests remained in the application root. The new layout should make this ownership visible without changing Evidence identity, atomic mutations, retained references, lifecycle or binary snapshots.

Change and scope

Move EvidenceLedger.ts, its two original tests and UnknownEvidence.ts into src/application/investigation. Update the actual record owner, bundle-validation and test consumers. Implementation bodies and assertions are unchanged except local import paths; no compatibility barrel, storage copy or new interface is introduced. Update the owning migration guide.

Contract and boundary impact

  • Semantic owner and earliest changed stage: investigation source ownership and compiled local module resolution.
  • CLI and MCP/tool-catalog contract: unchanged.
  • Provider/bridge/target/platform compatibility: unchanged; no provider-side asset paths move.
  • Evidence/artifact/provenance contract: unchanged, including target subjects, detached reads, Unknown revisions and import deltas.
  • Process/authorization/cleanup impact: unchanged; #721 still owns retention policy.
  • Generated metadata/package/installation impact: internal compiled module paths change with all imports; generated catalog/public package entrypoints are unchanged.

Evidence and regression coverage

  • Exact before/after comparison confirmed the four moved files differ only in local import specifiers.
  • 48 source/composition cases passed, including 10,001 records, a >64MiB inline record, CAS/rollback, record observers, input resolution, snapshots and binary session lifecycle.
  • 17 existing filesystem/MCP/acceptance cases passed for bundle transfer, retained references, inline Evidence, Unknowns and target-free/session workflows.
  • User-visible CLI/MCP output: unchanged.
  • Remaining proof gaps: no new provider or platform support claim.

For evidence-bearing changes:

  • Observed, derived and inferred claims remain distinguishable.
  • Artifact identity, provenance and failed attempts remain preserved.
  • Unsupported and uncertain outcomes remain visible.

Validation performed

  • Focused source/composition tests — 48 passed.
  • Focused filesystem/MCP/acceptance tests — 17 passed.
  • npm run check -- --output-logs=errors-only — all five tasks passed.
  • npm run docs:check — passed; generated outputs unchanged.
  • npm run verify:package — full installed CLI/MCP verification passed, including bundle transfer, 127 advertised tools, lifecycle, setup recovery and updater fixtures. Startup to tools/list: 2012ms.
  • npm run verify:test-discovery — all 502 test files discovered exactly once.
  • git diff --check — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; no public exports change.
  • Real Hopper/Ghidra/browser/OS coverage: no real engine run locally for this internal record move; full CI provider/platform lanes remain required before merging.
  • Package/release impact: internal source organization only.
  • Security/privacy/process review: explicit task files only; no credentials, private host paths, binaries or local planning artifacts. Heavy tests run serially on two CPUs. The existing large-record suite peaked at approximately 1.4GiB RSS; subsequent lanes are lighter.

Review checklist

  • One mechanical outcome and Conventional Commit title.
  • Refs #740; subsequent domains and final T7 guidance stay open.
  • Existing behavior and meaningful failure cases verified.
  • Owning documentation updated; generated contracts unchanged.
  • User-visible output examples: unchanged.
  • Final diff checked for unrelated changes and unsupported claims.

🔄 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/867 **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-source-layout` --- ### 📝 Commits (1) - [`94365c7`](https://github.com/morluto/rea/commit/94365c7ddefdd7ba3601c4a315705b229380c291) refactor: colocate investigation record implementation ### 📊 Changes **9 files changed** (+28 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `docs/capability-migration.md` (+6 -0) 📝 `src/application/EvidenceBundleCommands.ts` (+1 -1) 📝 `src/application/EvidenceInputResolver.test.ts` (+1 -1) 📝 `src/application/investigation/EvidenceLedger.residualUnknown.test.ts` (+3 -3) 📝 `src/application/investigation/EvidenceLedger.test.ts` (+4 -4) 📝 `src/application/investigation/EvidenceLedger.ts` (+6 -6) 📝 `src/application/investigation/InvestigationRecords.test.ts` (+1 -1) 📝 `src/application/investigation/InvestigationRecords.ts` (+2 -2) 📝 `src/application/investigation/UnknownEvidence.ts` (+4 -4) </details> ### 📄 Description ## Summary Complete the first mechanical capability folder move in #740: colocate the existing Evidence ledger and Unknown Evidence helper with the composed investigation record owner and narrow ports. ## Problem and expected behavior Record ownership already belongs to InvestigationRecords, but its ledger/helper and behavior tests remained in the application root. The new layout should make this ownership visible without changing Evidence identity, atomic mutations, retained references, lifecycle or binary snapshots. ## Change and scope Move EvidenceLedger.ts, its two original tests and UnknownEvidence.ts into src/application/investigation. Update the actual record owner, bundle-validation and test consumers. Implementation bodies and assertions are unchanged except local import paths; no compatibility barrel, storage copy or new interface is introduced. Update the owning migration guide. ## Contract and boundary impact - Semantic owner and earliest changed stage: investigation source ownership and compiled local module resolution. - CLI and MCP/tool-catalog contract: unchanged. - Provider/bridge/target/platform compatibility: unchanged; no provider-side asset paths move. - Evidence/artifact/provenance contract: unchanged, including target subjects, detached reads, Unknown revisions and import deltas. - Process/authorization/cleanup impact: unchanged; #721 still owns retention policy. - Generated metadata/package/installation impact: internal compiled module paths change with all imports; generated catalog/public package entrypoints are unchanged. ## Evidence and regression coverage - Exact before/after comparison confirmed the four moved files differ only in local import specifiers. - 48 source/composition cases passed, including 10,001 records, a >64MiB inline record, CAS/rollback, record observers, input resolution, snapshots and binary session lifecycle. - 17 existing filesystem/MCP/acceptance cases passed for bundle transfer, retained references, inline Evidence, Unknowns and target-free/session workflows. - User-visible CLI/MCP output: unchanged. - Remaining proof gaps: no new provider or platform support claim. For evidence-bearing changes: - [x] Observed, derived and inferred claims remain distinguishable. - [x] Artifact identity, provenance and failed attempts remain preserved. - [x] Unsupported and uncertain outcomes remain visible. ## Validation performed - Focused source/composition tests — 48 passed. - Focused filesystem/MCP/acceptance tests — 17 passed. - `npm run check -- --output-logs=errors-only` — all five tasks passed. - `npm run docs:check` — passed; generated outputs unchanged. - `npm run verify:package` — full installed CLI/MCP verification passed, including bundle transfer, 127 advertised tools, lifecycle, setup recovery and updater fixtures. Startup to tools/list: 2012ms. - `npm run verify:test-discovery` — all 502 test files discovered exactly once. - `git diff --check` — passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none; no public exports change. - Real Hopper/Ghidra/browser/OS coverage: no real engine run locally for this internal record move; full CI provider/platform lanes remain required before merging. - Package/release impact: internal source organization only. - Security/privacy/process review: explicit task files only; no credentials, private host paths, binaries or local planning artifacts. Heavy tests run serially on two CPUs. The existing large-record suite peaked at approximately 1.4GiB RSS; subsequent lanes are lighter. ## Review checklist - [x] One mechanical outcome and Conventional Commit title. - [x] Refs #740; subsequent domains and final T7 guidance stay open. - [x] Existing behavior and meaningful failure cases verified. - [x] Owning documentation updated; generated contracts unchanged. - [x] User-visible output examples: unchanged. - [x] Final diff checked for unrelated changes and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:17:00 +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#2303
No description provided.