[PR #869] [MERGED] refactor: give Inspector its own capability directory #2307

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

📋 Pull Request Information

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

Base: main ← Head: refactor/inspector-capability-layout


📝 Commits (1)

  • f64463d refactor: give Inspector its own capability directory

📊 Changes

29 files changed (+73 additions, -41 deletions)

View changed files

📝 AGENTS.md (+2 -2)
📝 docs/architecture.mermaid (+4 -0)
📝 docs/capability-migration.md (+18 -0)
📝 docs/testing.md (+9 -0)
📝 package.json (+1 -1)
📝 scripts/lib/catalog-core.mjs (+1 -1)
📝 scripts/lib/module-boundaries.mjs (+1 -0)
📝 scripts/verify/inspector/runtime-observation.mjs (+2 -4)
📝 src/browser/providerIdentities.ts (+0 -7)
📝 src/composition/javascriptRuntimeObservation.ts (+1 -1)
📝 src/composition/optionalObservationProviders.ts (+1 -1)
📝 src/inspector/JavaScriptRuntimeScope.test.ts (+0 -0)
📝 src/inspector/JavaScriptRuntimeScope.ts (+1 -1)
📝 src/inspector/V8InspectorCaptureProjection.ts (+0 -0)
📝 src/inspector/V8InspectorEndpoint.ts (+1 -1)
📝 src/inspector/V8InspectorProvider.cleanup.test.ts (+0 -0)
📝 src/inspector/V8InspectorProvider.ts (+4 -4)
➕ src/inspector/providerIdentity.ts (+8 -0)
📝 tests/boundary/cli/javascriptRuntimeObservationCli.test.ts (+2 -2)
📝 tests/boundary/cli/productCatalog.test.ts (+1 -1)

...and 9 more files

📄 Description

Summary

Give passive V8 Inspector its own adapter, fixture and verification ownership in #740 while preserving existing typed ports and caller behavior.

Problem and expected behavior

Node Inspector discovery/capture lived among browser providers, its loopback fixtures and real verifier were scattered, and one socket-backed reconciliation case ran in the composition lane. Extension and repair should have an explicit Inspector owner and the appropriate producer boundary without changing observation meaning or authority.

Change and scope

  • Move Inspector provider, endpoint/capture/location helpers and their original adapter tests into src/inspector. Move its exact lightweight identity there; retain implementation reexport and fresh typed production factory.
  • Move loopback fixture, real Node fixture and producer boundaries into Inspector directories. Reclassify the socket-backed reconciliation case into the forked boundary lane with identical assertions.
  • Move the real verifier to scripts/verify/inspector/runtime-observation.mjs, preserving npm verify:inspector and adjusting its repository/fixture paths.
  • Update actual import consumers, generator source path, explicit Vitest adapter discovery, settled ownership guard/probes and architecture/testing/contribution guidance. Existing CDP transport/endpoint/value and file-location helpers remain shared at their current adapter boundary.

Contract and boundary impact

  • Semantic owner and earliest changed stage: Inspector adapter source ownership and local/compiled module resolution.
  • CLI and MCP/tool catalog: unchanged names, schemas and complete discovery.
  • Provider/bridge/target/platform compatibility: exact provider identity and producer parsing preserved; no engine or platform support expansion.
  • Evidence/artifact/provenance contract: unchanged, including unresolved discovery identity and independently resolved loaded scripts.
  • Process/authorization/cleanup impact: unchanged passive attach-only behavior, cancellation and cleanup; no new permission fields or eager acquisition.
  • Generated metadata/package/installation: generated outputs unchanged; internal compiled adapter paths and development verifier path move with their consumers.

Evidence and regression coverage

  • Exact comparison confirmed all moved implementations, fixtures and test assertions remain unchanged except import paths. The real verifier changes only repository/fixture paths.
  • 97 source/producer/MCP/guard cases passed, including 57 resolved-boundary probes, cancellation/cleanup, optional failure isolation, lossy target locations, retained runtime Evidence and reconciliation.
  • After a clean rebuild, 14 CLI/catalog/compiled MCP cases passed; old compiled browser/V8InspectorProvider is absent and the new Inspector module is present. This includes normal/reversed contract presentation.
  • Real Linux Node Inspector passed 8 CLI/MCP filename fixtures through the relocated verifier.
  • User-visible output: unchanged.
  • Remaining proof gaps: local real Node is Linux; real Windows Inspector and platform package checks must pass in CI before merge. No Electron GUI or new deep engine claim.

For evidence-bearing changes:

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

Validation performed

  • Focused source/producer/MCP/guard cases — 97 passed.
  • Freshly compiled CLI/catalog/contract presentation cases — 14 passed.
  • npm run check -- --output-logs=errors-only — all five tasks passed.
  • npm run docs:check — passed; generated outputs unchanged.
  • npm run verify:test-discovery — all 502 files discovered exactly once; Inspector adapter and producer tests have forked ownership.
  • npm run verify:inspector — all 8 real Linux CLI/MCP fixtures passed.
  • npm run verify:package — full installed CLI/MCP validation passed, including 127 tools, Evidence transfer, lifecycle/setup recovery/update. Startup to tools/list: 2279ms; sampled MCP peak RSS: approximately 413MiB.
  • git diff --check — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: supported package entrypoints and tool contracts are unchanged; internal module paths move; no broad compatibility barrel.
  • Real Hopper/Ghidra/browser/OS coverage: real Linux Node workflow performed; corresponding Windows workflow required in CI. Real Hopper/Ghidra/Electron GUI were not rerun locally for this adapter move.
  • Package/release impact: internal paths only; no version/dependency manifest change.
  • Security/privacy/process review: two CPU affinity, bounded heap, serial heavy lanes; no host paths, credentials, binaries or local artifacts committed. Windows D remains untouched. Locked dependencies were refreshed with npm ci without lifecycle scripts after the branch baseline update.

Review checklist

  • One coherent capability move and Conventional Commit title.
  • Refs #740; remaining domain migrations and final extension map stay open.
  • Existing behavior and meaningful failure paths verified.
  • Owning docs/test configuration/generator paths updated together.
  • Caller output examples unchanged.
  • Final diff checked for unrelated changes and unsupported claims.

Additional browser CI investigation

The first real-browser run failed when the popup MCP capture reported incomplete browser cleanup. The affected scenario implementation, execution boundary, popup verifier and Playwright dependency are unchanged by this migration. Its existing close boundary is 1 second; the public failure does not expose the underlying cause, so a timing explanation remains an inference. The exact standalone real Chromium popup verifier passed locally through direct capture, CLI and MCP, including nested popups, selected events and shared-context isolation. One rerun of that failed CI job is required; no assertions, deadlines or cleanup semantics were relaxed.

The full local browser lane separately stopped before the popup step because the available Chromium produced a 1393-pixel screenshot height where the unchanged fixture expects 1536. This is not a passing full-browser proof. CI uses its own Chrome executable and must pass the complete real-browser workflow before merge.


🔄 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/869 **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/inspector-capability-layout` --- ### 📝 Commits (1) - [`f64463d`](https://github.com/morluto/rea/commit/f64463d8de5f97ce5ecac86e3009d4fc8182d2d8) refactor: give Inspector its own capability directory ### 📊 Changes **29 files changed** (+73 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `AGENTS.md` (+2 -2) 📝 `docs/architecture.mermaid` (+4 -0) 📝 `docs/capability-migration.md` (+18 -0) 📝 `docs/testing.md` (+9 -0) 📝 `package.json` (+1 -1) 📝 `scripts/lib/catalog-core.mjs` (+1 -1) 📝 `scripts/lib/module-boundaries.mjs` (+1 -0) 📝 `scripts/verify/inspector/runtime-observation.mjs` (+2 -4) 📝 `src/browser/providerIdentities.ts` (+0 -7) 📝 `src/composition/javascriptRuntimeObservation.ts` (+1 -1) 📝 `src/composition/optionalObservationProviders.ts` (+1 -1) 📝 `src/inspector/JavaScriptRuntimeScope.test.ts` (+0 -0) 📝 `src/inspector/JavaScriptRuntimeScope.ts` (+1 -1) 📝 `src/inspector/V8InspectorCaptureProjection.ts` (+0 -0) 📝 `src/inspector/V8InspectorEndpoint.ts` (+1 -1) 📝 `src/inspector/V8InspectorProvider.cleanup.test.ts` (+0 -0) 📝 `src/inspector/V8InspectorProvider.ts` (+4 -4) ➕ `src/inspector/providerIdentity.ts` (+8 -0) 📝 `tests/boundary/cli/javascriptRuntimeObservationCli.test.ts` (+2 -2) 📝 `tests/boundary/cli/productCatalog.test.ts` (+1 -1) _...and 9 more files_ </details> ### 📄 Description ## Summary Give passive V8 Inspector its own adapter, fixture and verification ownership in #740 while preserving existing typed ports and caller behavior. ## Problem and expected behavior Node Inspector discovery/capture lived among browser providers, its loopback fixtures and real verifier were scattered, and one socket-backed reconciliation case ran in the composition lane. Extension and repair should have an explicit Inspector owner and the appropriate producer boundary without changing observation meaning or authority. ## Change and scope - Move Inspector provider, endpoint/capture/location helpers and their original adapter tests into src/inspector. Move its exact lightweight identity there; retain implementation reexport and fresh typed production factory. - Move loopback fixture, real Node fixture and producer boundaries into Inspector directories. Reclassify the socket-backed reconciliation case into the forked boundary lane with identical assertions. - Move the real verifier to scripts/verify/inspector/runtime-observation.mjs, preserving npm verify:inspector and adjusting its repository/fixture paths. - Update actual import consumers, generator source path, explicit Vitest adapter discovery, settled ownership guard/probes and architecture/testing/contribution guidance. Existing CDP transport/endpoint/value and file-location helpers remain shared at their current adapter boundary. ## Contract and boundary impact - Semantic owner and earliest changed stage: Inspector adapter source ownership and local/compiled module resolution. - CLI and MCP/tool catalog: unchanged names, schemas and complete discovery. - Provider/bridge/target/platform compatibility: exact provider identity and producer parsing preserved; no engine or platform support expansion. - Evidence/artifact/provenance contract: unchanged, including unresolved discovery identity and independently resolved loaded scripts. - Process/authorization/cleanup impact: unchanged passive attach-only behavior, cancellation and cleanup; no new permission fields or eager acquisition. - Generated metadata/package/installation: generated outputs unchanged; internal compiled adapter paths and development verifier path move with their consumers. ## Evidence and regression coverage - Exact comparison confirmed all moved implementations, fixtures and test assertions remain unchanged except import paths. The real verifier changes only repository/fixture paths. - 97 source/producer/MCP/guard cases passed, including 57 resolved-boundary probes, cancellation/cleanup, optional failure isolation, lossy target locations, retained runtime Evidence and reconciliation. - After a clean rebuild, 14 CLI/catalog/compiled MCP cases passed; old compiled browser/V8InspectorProvider is absent and the new Inspector module is present. This includes normal/reversed contract presentation. - Real Linux Node Inspector passed 8 CLI/MCP filename fixtures through the relocated verifier. - User-visible output: unchanged. - Remaining proof gaps: local real Node is Linux; real Windows Inspector and platform package checks must pass in CI before merge. No Electron GUI or new deep engine claim. For evidence-bearing changes: - [x] Observed, derived and inferred claims remain distinguishable. - [x] Identity, source provenance and failed attempts remain preserved. - [x] Unsupported and uncertain outcomes remain visible. ## Validation performed - Focused source/producer/MCP/guard cases — 97 passed. - Freshly compiled CLI/catalog/contract presentation cases — 14 passed. - `npm run check -- --output-logs=errors-only` — all five tasks passed. - `npm run docs:check` — passed; generated outputs unchanged. - `npm run verify:test-discovery` — all 502 files discovered exactly once; Inspector adapter and producer tests have forked ownership. - `npm run verify:inspector` — all 8 real Linux CLI/MCP fixtures passed. - `npm run verify:package` — full installed CLI/MCP validation passed, including 127 tools, Evidence transfer, lifecycle/setup recovery/update. Startup to tools/list: 2279ms; sampled MCP peak RSS: approximately 413MiB. - `git diff --check` — passed. ## Compatibility, safety, and release - Breaking changes or migration steps: supported package entrypoints and tool contracts are unchanged; internal module paths move; no broad compatibility barrel. - Real Hopper/Ghidra/browser/OS coverage: real Linux Node workflow performed; corresponding Windows workflow required in CI. Real Hopper/Ghidra/Electron GUI were not rerun locally for this adapter move. - Package/release impact: internal paths only; no version/dependency manifest change. - Security/privacy/process review: two CPU affinity, bounded heap, serial heavy lanes; no host paths, credentials, binaries or local artifacts committed. Windows D remains untouched. Locked dependencies were refreshed with npm ci without lifecycle scripts after the branch baseline update. ## Review checklist - [x] One coherent capability move and Conventional Commit title. - [x] Refs #740; remaining domain migrations and final extension map stay open. - [x] Existing behavior and meaningful failure paths verified. - [x] Owning docs/test configuration/generator paths updated together. - [x] Caller output examples unchanged. - [x] Final diff checked for unrelated changes and unsupported claims. ### Additional browser CI investigation The first real-browser run failed when the popup MCP capture reported incomplete browser cleanup. The affected scenario implementation, execution boundary, popup verifier and Playwright dependency are unchanged by this migration. Its existing close boundary is 1 second; the public failure does not expose the underlying cause, so a timing explanation remains an inference. The exact standalone real Chromium popup verifier passed locally through direct capture, CLI and MCP, including nested popups, selected events and shared-context isolation. One rerun of that failed CI job is required; no assertions, deadlines or cleanup semantics were relaxed. The full local browser lane separately stopped before the popup step because the available Chromium produced a 1393-pixel screenshot height where the unchanged fixture expects 1536. This is not a passing full-browser proof. CI uses its own Chrome executable and must pass the complete real-browser workflow before merge. --- <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:03 +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#2307
No description provided.