[PR #886] [MERGED] refactor(binary): group session selection and snapshot ownership #2318

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

📋 Pull Request Information

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

Base: main ← Head: refactor/binary-application-owner


📝 Commits (1)

  • e72d2bc refactor(binary): group session selection and snapshot ownership

📊 Changes

59 files changed (+220 additions, -190 deletions)

View changed files

📝 docs/adr/0001-provider-selection-and-analysis-profiles.md (+2 -2)
📝 docs/capability-migration.md (+21 -0)
📝 docs/testing.md (+6 -0)
📝 src/application/DirectAnalysis.ts (+1 -1)
📝 src/application/binary/AbortablePromise.ts (+0 -0)
📝 src/application/binary/AnalysisClientCleanup.ts (+4 -4)
📝 src/application/binary/AnalysisProviderEvaluation.ts (+6 -6)
📝 src/application/binary/AnalysisProviderRegistry.test.ts (+7 -7)
📝 src/application/binary/AnalysisProviderRegistry.ts (+8 -8)
📝 src/application/binary/AnalysisSnapshotCache.test.ts (+6 -6)
📝 src/application/binary/AnalysisSnapshotCache.ts (+11 -11)
📝 src/application/binary/AnalysisSnapshotFiles.ts (+4 -4)
📝 src/application/binary/BinarySession.ts (+12 -12)
📝 src/application/binary/BinarySessionComposition.ts (+2 -2)
📝 src/application/binary/BinarySessionExecution.ts (+10 -10)
📝 src/application/binary/BinarySessionOpen.ts (+10 -10)
📝 src/application/binary/BinarySessionPort.ts (+10 -10)
📝 src/application/binary/BinarySessionRecords.ts (+14 -14)
📝 src/application/binary/BinarySessionStatus.ts (+3 -3)
📝 src/application/binary/CompositeProvider.ts (+5 -5)

...and 39 more files

📄 Description

Summary

Give binary session, provider selection and target/profile snapshots one application owner. Incremental T6 work for #740.

Problem and expected behavior

Session lifecycle, routing, cache/persistence and their helpers were scattered across the shared application root. They now live together in src/application/binary/, so a session repair has a clear source owner and verification family.

Change and scope

Move 19 files, including three existing application tests. Update consumers in production composition, main/CLI/MCP, shared fixtures and existing composition/filesystem/SDK cases. Correct ADR source links and document the owner and proof lanes. All 56 affected TypeScript implementations/assertions and mapped import owners were compared with the frozen base.

Keep shared AnalysisProvider types and cross-domain target resolution at the shared root. The existing binary runtime remains the exact temporary production composition entrypoint while direct-analysis callers are migrated deliberately.

Contract and boundary impact

  • Semantic owner and earliest changed stage: application source ownership and local/compiled module resolution.
  • CLI and MCP/tool-catalog contract: unchanged named schemas, handlers, discovery and Evidence.
  • Provider, bridge, target-format, or platform compatibility: unchanged selection, bridge/assets and provider coverage.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged investigation owner/facade, identities, atomic mutations, target/profile cache partitions and snapshot mismatch failures; retention #721 stays separate.
  • Process execution, authorization, cleanup, or containment impact: unchanged switching, cancellation, rollback and owned cleanup; no new permissions.
  • Generated metadata, package, or installation impact: generated outputs unchanged; no dependency or version change.

Evidence and regression coverage

  • Tests added or updated: move existing tests and change imports only; original assertions retained.

  • Base evidence: unchanged normalized implementation/assertion ASTs and mapped import owners for all 56 affected TypeScript files.

  • User-visible output: existing CLI/MCP behavior preserved.

  • Remaining proof gaps: the actual local Ghidra workflow below is narrower than complete real-provider conformance. No new local real Hopper, IDA or Windows-engine claim.

  • Observed, derived, and inferred claims remain distinguishable.

  • Artifact identity, source provenance, and failed attempts remain preserved.

  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run check -- --output-logs=errors-only — five static gates passed.
  • npm run docs:check — fresh build and unchanged generated documents passed. All 16 implementation modules exist at new compiled paths; old paths absent.
  • Exact source/composition/filesystem/SDK/compiled CLI/catalog/normal-reversed presentation cases — 96 tests passed in 23 files.
  • npm run verify:test-discovery — all 508 test files discovered exactly once.
  • npm run test:local -- <three moved test paths> --dry-run — existing developer selection resolves new paths in the services project.
  • Actual isolated Linux Ghidra 12.1.4 — CLI inspect and MCP open/list/decompile/read-bytes/file-mapping/close passed, with independent original-byte oracle, unchanged target digest, empty runtime, preserved caller files and no owned processes remaining. Existing engine/JDK reused; sampled process-family peak ~1.08GiB under two-CPU affinity.
  • npm run verify:package — passed: 129 tools, six prompts, installed CLI/MCP Evidence, lifecycle, setup/backup/recovery and update. Startup to tools/list 2080.38ms; sampled MCP peak RSS 482443264 bytes (~460MiB).
  • git diff --check and final diff review — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none for CLI/MCP users; internal source imports migrated together.
  • Real Hopper/Ghidra, browser, or OS coverage: narrow actual Linux Ghidra workflow executed; complete real Ghidra/Hopper/IDA conformance not newly claimed. Relevant CI remains required.
  • Package or release metadata impact: one distribution and complete catalog; no new assets or tool acquisition.
  • Security, privacy, process, or containment review: selected paths, state and diagnostics preserved; heavy lanes serial with two CPUs, nice priority and bounded heaps. No Windows host writes or tool installations.

Review checklist

  • One focused outcome and Conventional Commit title.
  • Roadmap linked.
  • Relevant failure, cancellation, cleanup, snapshot and atomic-record boundaries covered.
  • Owning docs, recursive test/discovery/developer selection and package resolution checked.
  • CLI/MCP contracts and generated metadata preserved.
  • Final diff contains no secrets, binaries, unrelated changes or 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/886 **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/binary-application-owner` --- ### 📝 Commits (1) - [`e72d2bc`](https://github.com/morluto/rea/commit/e72d2bcfa3508538a8e3ed2a5d56da2802f229ea) refactor(binary): group session selection and snapshot ownership ### 📊 Changes **59 files changed** (+220 additions, -190 deletions) <details> <summary>View changed files</summary> 📝 `docs/adr/0001-provider-selection-and-analysis-profiles.md` (+2 -2) 📝 `docs/capability-migration.md` (+21 -0) 📝 `docs/testing.md` (+6 -0) 📝 `src/application/DirectAnalysis.ts` (+1 -1) 📝 `src/application/binary/AbortablePromise.ts` (+0 -0) 📝 `src/application/binary/AnalysisClientCleanup.ts` (+4 -4) 📝 `src/application/binary/AnalysisProviderEvaluation.ts` (+6 -6) 📝 `src/application/binary/AnalysisProviderRegistry.test.ts` (+7 -7) 📝 `src/application/binary/AnalysisProviderRegistry.ts` (+8 -8) 📝 `src/application/binary/AnalysisSnapshotCache.test.ts` (+6 -6) 📝 `src/application/binary/AnalysisSnapshotCache.ts` (+11 -11) 📝 `src/application/binary/AnalysisSnapshotFiles.ts` (+4 -4) 📝 `src/application/binary/BinarySession.ts` (+12 -12) 📝 `src/application/binary/BinarySessionComposition.ts` (+2 -2) 📝 `src/application/binary/BinarySessionExecution.ts` (+10 -10) 📝 `src/application/binary/BinarySessionOpen.ts` (+10 -10) 📝 `src/application/binary/BinarySessionPort.ts` (+10 -10) 📝 `src/application/binary/BinarySessionRecords.ts` (+14 -14) 📝 `src/application/binary/BinarySessionStatus.ts` (+3 -3) 📝 `src/application/binary/CompositeProvider.ts` (+5 -5) _...and 39 more files_ </details> ### 📄 Description ## Summary Give binary session, provider selection and target/profile snapshots one application owner. Incremental T6 work for #740. ## Problem and expected behavior Session lifecycle, routing, cache/persistence and their helpers were scattered across the shared application root. They now live together in `src/application/binary/`, so a session repair has a clear source owner and verification family. ## Change and scope Move 19 files, including three existing application tests. Update consumers in production composition, main/CLI/MCP, shared fixtures and existing composition/filesystem/SDK cases. Correct ADR source links and document the owner and proof lanes. All 56 affected TypeScript implementations/assertions and mapped import owners were compared with the frozen base. Keep shared `AnalysisProvider` types and cross-domain target resolution at the shared root. The existing binary runtime remains the exact temporary production composition entrypoint while direct-analysis callers are migrated deliberately. ## Contract and boundary impact - Semantic owner and earliest changed stage: application source ownership and local/compiled module resolution. - CLI and MCP/tool-catalog contract: unchanged named schemas, handlers, discovery and Evidence. - Provider, bridge, target-format, or platform compatibility: unchanged selection, bridge/assets and provider coverage. - Evidence, artifact, provenance, or reconstruction contract: unchanged investigation owner/facade, identities, atomic mutations, target/profile cache partitions and snapshot mismatch failures; retention #721 stays separate. - Process execution, authorization, cleanup, or containment impact: unchanged switching, cancellation, rollback and owned cleanup; no new permissions. - Generated metadata, package, or installation impact: generated outputs unchanged; no dependency or version change. ## Evidence and regression coverage - Tests added or updated: move existing tests and change imports only; original assertions retained. - Base evidence: unchanged normalized implementation/assertion ASTs and mapped import owners for all 56 affected TypeScript files. - User-visible output: existing CLI/MCP behavior preserved. - Remaining proof gaps: the actual local Ghidra workflow below is narrower than complete real-provider conformance. No new local real Hopper, IDA or Windows-engine claim. - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npm run check -- --output-logs=errors-only` — five static gates passed. - `npm run docs:check` — fresh build and unchanged generated documents passed. All 16 implementation modules exist at new compiled paths; old paths absent. - Exact source/composition/filesystem/SDK/compiled CLI/catalog/normal-reversed presentation cases — 96 tests passed in 23 files. - `npm run verify:test-discovery` — all 508 test files discovered exactly once. - `npm run test:local -- <three moved test paths> --dry-run` — existing developer selection resolves new paths in the services project. - Actual isolated Linux Ghidra 12.1.4 — CLI inspect and MCP open/list/decompile/read-bytes/file-mapping/close passed, with independent original-byte oracle, unchanged target digest, empty runtime, preserved caller files and no owned processes remaining. Existing engine/JDK reused; sampled process-family peak ~1.08GiB under two-CPU affinity. - `npm run verify:package` — passed: 129 tools, six prompts, installed CLI/MCP Evidence, lifecycle, setup/backup/recovery and update. Startup to tools/list 2080.38ms; sampled MCP peak RSS 482443264 bytes (~460MiB). - `git diff --check` and final diff review — passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none for CLI/MCP users; internal source imports migrated together. - Real Hopper/Ghidra, browser, or OS coverage: narrow actual Linux Ghidra workflow executed; complete real Ghidra/Hopper/IDA conformance not newly claimed. Relevant CI remains required. - Package or release metadata impact: one distribution and complete catalog; no new assets or tool acquisition. - Security, privacy, process, or containment review: selected paths, state and diagnostics preserved; heavy lanes serial with two CPUs, nice priority and bounded heaps. No Windows host writes or tool installations. ## Review checklist - [x] One focused outcome and Conventional Commit title. - [x] Roadmap linked. - [x] Relevant failure, cancellation, cleanup, snapshot and atomic-record boundaries covered. - [x] Owning docs, recursive test/discovery/developer selection and package resolution checked. - [x] CLI/MCP contracts and generated metadata preserved. - [x] Final diff contains no secrets, binaries, unrelated changes or 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:12 +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#2318
No description provided.