[PR #988] [MERGED] refactor(process): separate capture implementation from analyst workflows #2557

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

📋 Pull Request Information

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

Base: main ← Head: refactor/process-capture-owners


📝 Commits (5)

  • 401c1a6 refactor(process): separate capture implementation from analyst workflows
  • 9370dd9 chore: integrate main for process owner path conflict
  • e83c6ff Merge main to preserve process snapshot regressions
  • 5967ad6 fix(ci): generate source catalog before shard tests
  • 30e46eb chore: integrate process contracts and generated catalog prerequisites

📊 Changes

98 files changed (+214 additions, -141 deletions)

View changed files

📝 .github/workflows/ci.yml (+4 -0)
📝 docs/capability-migration.md (+26 -0)
📝 docs/testing.md (+9 -0)
📝 docs/user-visible-errors.csv (+6 -6)
📝 scripts/lib/catalog-core.mjs (+1 -1)
📝 scripts/lib/module-boundaries.d.mts (+1 -0)
📝 scripts/lib/module-boundaries.mjs (+8 -0)
📝 scripts/verify-package-install.mjs (+2 -2)
📝 src/application/EvidenceBundleFiles.ts (+1 -1)
📝 src/application/ReconstructionObligationCandidates.ts (+1 -1)
📝 src/application/ReconstructionObligationLedger.authority.test.ts (+3 -3)
📝 src/application/ReconstructionObligationLedger.closure.test.ts (+3 -3)
📝 src/application/WindowsCapabilities.ts (+1 -1)
📝 src/application/process/ProcessCli.ts (+10 -10)
📝 src/application/process/ProcessEvidence.ts (+6 -6)
📝 src/cli/processCommands.ts (+1 -1)
📝 src/cliEnvironmentSeam.test.ts (+3 -3)
📝 src/cliLogging.test.ts (+1 -1)
📝 src/contracts/investigationExamples.ts (+2 -2)
➕ src/contracts/process/processCaptureExample.ts (+2 -0)

...and 78 more files

📄 Description

Summary

Separate process capture implementation from analyst workflows so capture fixes and extensions have a clear owner. Related to #740 (incremental capability migration).

Problem and expected behavior

The application directory owned PTY producer handling, terminal rendering, sampling, filesystem effects and cleanup alongside Evidence projection. These modules should follow their actual responsibilities while preserving existing CLI/MCP behavior and process ownership guarantees.

Change and scope

  • Group portable scenario, capture, trace and comparison semantics under src/domain/process/.
  • Move capture implementation and helper tests to src/process/capture/; retain Evidence and file workflows under src/application/process/.
  • Put producer-backed Evidence/host tests in the serial process-boundary lane; keep shared session contracts shared.
  • Update source/compiled consumers, both installed capability-probe paths, documentation and source references. Add an inward capture dependency guard.

Contract and boundary impact

  • Semantic owner and earliest changed stage: source ownership and import resolution; capture identity imports the existing canonical pure declaration directly.
  • CLI and MCP/tool-catalog contract: unchanged; canonical and reordered SDK schema/parity regressions pass.
  • Provider, bridge, target-format, or platform compatibility: unchanged; existing Windows PTY-unavailable outcome retained.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged, including host identity and observation/comparison semantics.
  • Process execution, authorization, cleanup, or containment impact: implementation bodies preserved; existing actual PTY, descendant cleanup, cancellation and late-output tests pass.
  • Generated metadata, package, or installation impact: three tracked generated commitments match the baseline; the source catalog follows the upstream build-generated, gitignored lifecycle; installed probe paths follow the new emitted module owner.

Evidence and regression coverage

  • Tests added or updated: nine allowed/forbidden dependency probes; existing assertions and fixtures move with their owners. The existing Apple job also runs the relocated snapshot descriptor/cancellation suite, with no new runner or platform version.

  • Base reproduction or other evidence: 90 affected TS/MJS AST bodies, mapped imports and file-URL roots match the frozen baseline, apart from the separately reviewed guard and canonical identity dependency.

  • User-visible CLI/MCP output: unchanged; 461 cases in 60 suites pass after conflict integration.

  • Remaining proof gaps: Windows PTY descendant cleanup remains unverified and capture remains unavailable. Package startup does not establish that workflow.

  • 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 pass.
  • npm run docs:check and npm run build:cached — pass; generated commitments unchanged, relocated/excluded outputs and removal of old emitted paths checked.
  • Focused Vitest run with one worker — 461 cases across 60 suites pass after conflict integration, including actual POSIX PTY, CLI/MCP Evidence, lifecycle and schema boundaries.
  • npm run verify:test-discovery — all 565 test files discovered exactly once.
  • npm run verify:package — installed CLI/MCP, terminal/PTY capability probes (including missing optional modules), setup/backups/recovery/update and lifecycle pass; 133 tools, six prompts and no owned descendants.

Necessary main integrations preserve the complete upstream CSV and process snapshot/lifecycle regression bodies, rebasing their source references. The later affected input/schema and build-generated catalog changes are preserved as well; the source catalog stays gitignored. The separately reviewed ctime fixture repair is already merged in #999. The independent CI prerequisite repair is tracked by #1001 / #1002; it is distinct from the transient MinGW download stall, which passed on retry. The final process-owner diff is confined to 149 source/destination paths, including two new upstream test import consumers.

Compatibility, safety, and release

  • Breaking changes or migration steps: none for callers; internal owners move together with their consumers.
  • Real Hopper/Ghidra, browser, or OS coverage: no fresh engine workflow needed or claimed; actual POSIX process capture/cleanup executed locally. Native CI remains required before merge.
  • Package or release metadata impact: public inventory unchanged; no dependency or installation changes.
  • Security, privacy, process, or containment review: selected child environment, capture roots, output/evidence and cleanup behavior preserved. Heavy local lanes run serially with two CPU affinity, reduced priority, one worker and a one-GiB Node heap.

Review checklist

  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP behavior is preserved and exercised.
  • I checked the final diff for secrets, unrelated cleanup, 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/988 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `refactor/process-capture-owners` --- ### 📝 Commits (5) - [`401c1a6`](https://github.com/morluto/rea/commit/401c1a65350bca8899a3442dd74958085106a84a) refactor(process): separate capture implementation from analyst workflows - [`9370dd9`](https://github.com/morluto/rea/commit/9370dd912bbbbf5ea71e2eb767d79087bf4e8771) chore: integrate main for process owner path conflict - [`e83c6ff`](https://github.com/morluto/rea/commit/e83c6ff719828d44594b56b113741805c4bcfd5b) Merge main to preserve process snapshot regressions - [`5967ad6`](https://github.com/morluto/rea/commit/5967ad62abaa3c0c59099fb806c3ae17e0808d89) fix(ci): generate source catalog before shard tests - [`30e46eb`](https://github.com/morluto/rea/commit/30e46ebacef83c841a8d753184e385468bd1d08d) chore: integrate process contracts and generated catalog prerequisites ### 📊 Changes **98 files changed** (+214 additions, -141 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+4 -0) 📝 `docs/capability-migration.md` (+26 -0) 📝 `docs/testing.md` (+9 -0) 📝 `docs/user-visible-errors.csv` (+6 -6) 📝 `scripts/lib/catalog-core.mjs` (+1 -1) 📝 `scripts/lib/module-boundaries.d.mts` (+1 -0) 📝 `scripts/lib/module-boundaries.mjs` (+8 -0) 📝 `scripts/verify-package-install.mjs` (+2 -2) 📝 `src/application/EvidenceBundleFiles.ts` (+1 -1) 📝 `src/application/ReconstructionObligationCandidates.ts` (+1 -1) 📝 `src/application/ReconstructionObligationLedger.authority.test.ts` (+3 -3) 📝 `src/application/ReconstructionObligationLedger.closure.test.ts` (+3 -3) 📝 `src/application/WindowsCapabilities.ts` (+1 -1) 📝 `src/application/process/ProcessCli.ts` (+10 -10) 📝 `src/application/process/ProcessEvidence.ts` (+6 -6) 📝 `src/cli/processCommands.ts` (+1 -1) 📝 `src/cliEnvironmentSeam.test.ts` (+3 -3) 📝 `src/cliLogging.test.ts` (+1 -1) 📝 `src/contracts/investigationExamples.ts` (+2 -2) ➕ `src/contracts/process/processCaptureExample.ts` (+2 -0) _...and 78 more files_ </details> ### 📄 Description ## Summary Separate process capture implementation from analyst workflows so capture fixes and extensions have a clear owner. Related to #740 (incremental capability migration). ## Problem and expected behavior The application directory owned PTY producer handling, terminal rendering, sampling, filesystem effects and cleanup alongside Evidence projection. These modules should follow their actual responsibilities while preserving existing CLI/MCP behavior and process ownership guarantees. ## Change and scope - Group portable scenario, capture, trace and comparison semantics under `src/domain/process/`. - Move capture implementation and helper tests to `src/process/capture/`; retain Evidence and file workflows under `src/application/process/`. - Put producer-backed Evidence/host tests in the serial process-boundary lane; keep shared session contracts shared. - Update source/compiled consumers, both installed capability-probe paths, documentation and source references. Add an inward capture dependency guard. ## Contract and boundary impact - Semantic owner and earliest changed stage: source ownership and import resolution; capture identity imports the existing canonical pure declaration directly. - CLI and MCP/tool-catalog contract: unchanged; canonical and reordered SDK schema/parity regressions pass. - Provider, bridge, target-format, or platform compatibility: unchanged; existing Windows PTY-unavailable outcome retained. - Evidence, artifact, provenance, or reconstruction contract: unchanged, including host identity and observation/comparison semantics. - Process execution, authorization, cleanup, or containment impact: implementation bodies preserved; existing actual PTY, descendant cleanup, cancellation and late-output tests pass. - Generated metadata, package, or installation impact: three tracked generated commitments match the baseline; the source catalog follows the upstream build-generated, gitignored lifecycle; installed probe paths follow the new emitted module owner. ## Evidence and regression coverage - Tests added or updated: nine allowed/forbidden dependency probes; existing assertions and fixtures move with their owners. The existing Apple job also runs the relocated snapshot descriptor/cancellation suite, with no new runner or platform version. - Base reproduction or other evidence: 90 affected TS/MJS AST bodies, mapped imports and file-URL roots match the frozen baseline, apart from the separately reviewed guard and canonical identity dependency. - User-visible CLI/MCP output: unchanged; 461 cases in 60 suites pass after conflict integration. - Remaining proof gaps: Windows PTY descendant cleanup remains unverified and capture remains unavailable. Package startup does not establish that workflow. - [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 pass. - `npm run docs:check` and `npm run build:cached` — pass; generated commitments unchanged, relocated/excluded outputs and removal of old emitted paths checked. - Focused Vitest run with one worker — 461 cases across 60 suites pass after conflict integration, including actual POSIX PTY, CLI/MCP Evidence, lifecycle and schema boundaries. - `npm run verify:test-discovery` — all 565 test files discovered exactly once. - `npm run verify:package` — installed CLI/MCP, terminal/PTY capability probes (including missing optional modules), setup/backups/recovery/update and lifecycle pass; 133 tools, six prompts and no owned descendants. Necessary main integrations preserve the complete upstream CSV and process snapshot/lifecycle regression bodies, rebasing their source references. The later affected input/schema and build-generated catalog changes are preserved as well; the source catalog stays gitignored. The separately reviewed ctime fixture repair is already merged in #999. The independent CI prerequisite repair is tracked by #1001 / #1002; it is distinct from the transient MinGW download stall, which passed on retry. The final process-owner diff is confined to 149 source/destination paths, including two new upstream test import consumers. ## Compatibility, safety, and release - Breaking changes or migration steps: none for callers; internal owners move together with their consumers. - Real Hopper/Ghidra, browser, or OS coverage: no fresh engine workflow needed or claimed; actual POSIX process capture/cleanup executed locally. Native CI remains required before merge. - Package or release metadata impact: public inventory unchanged; no dependency or installation changes. - Security, privacy, process, or containment review: selected child environment, capture roots, output/evidence and cleanup behavior preserved. Heavy local lanes run serially with two CPU affinity, reduced priority, one worker and a one-GiB Node heap. ## Review checklist - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP behavior is preserved and exercised. - [x] I checked the final diff for secrets, unrelated cleanup, 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-17 21:07:32 +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#2557
No description provided.