[PR #597] [MERGED] fix!: repair boundary contracts across CLI and MCP #2097

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

📋 Pull Request Information

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

Base: main ← Head: fix/boundary-root-causes


📝 Commits (7)

  • e77ad69 fix(comparisons)!: preserve unknowns across partial observations
  • fe14b2e fix(javascript): preserve projected result binding semantics
  • 716d301 fix(native)!: admit complete parser values and preserve typed failures
  • 887a943 fix(process): preserve host identity and actionable boundary failures
  • 551c87e fix(browser): preserve cleanup and document-transition evidence
  • 1d49b39 fix(adapters): align managed targets and typed CLI outcomes
  • 2ea6117 docs: refresh boundary contracts and shipped roadmap behavior

📊 Changes

134 files changed (+3546 additions, -811 deletions)

View changed files

📝 docs/adr/0003-managed-code-evidence-and-provider-boundary.md (+7 -4)
📝 docs/managed-code-analysis.md (+12 -9)
📝 docs/product-catalog.json (+2 -2)
📝 docs/roadmap.md (+11 -10)
📝 docs/verification/managed-conformance-manifest.json (+2 -2)
📝 scripts/verify-managed-conformance.mjs (+28 -1)
📝 scripts/verify-package-managed.mjs (+2 -1)
📝 skills/reverse-engineer-anything/SKILL.md (+1 -1)
📝 src/application/BinaryTargetResolver.ts (+28 -1)
📝 src/application/BrowserEvidence.ts (+8 -3)
📝 src/application/BrowserScenarioEvidence.ts (+6 -3)
📝 src/application/ClientRegistrationStatus.ts (+18 -1)
📝 src/application/DirectAnalysis.ts (+50 -9)
➕ src/application/Doctor.systemHost.test.ts (+43 -0)
📝 src/application/Doctor.test.ts (+22 -3)
📝 src/application/Doctor.ts (+128 -70)
📝 src/application/DoctorDiagnostics.ts (+1 -1)
📝 src/application/ElectronActiveEvidence.ts (+7 -4)
📝 src/application/ElectronEvidence.ts (+8 -3)
📝 src/application/EnhancedNativeInvestigation.test.ts (+2 -0)

...and 80 more files

📄 Description

Managed inspection could inherit an unrelated native provider, CLI failures could exit successfully, and comparisons could report definite changes from incomplete evidence. This repairs the contracts at their shared owners and adds regressions through the consuming adapters.

  • Run all three managed inspections against explicit PE/CLI paths through a native-independent session. Retain the last successful managed selection and bind Evidence to the inspected file.
  • Classify complete CLI error envelopes and exhaustive setup/update/uninstall outcomes. Check coverage against actual registered CLI commands, with explicit declarations for MCP operations without dedicated CLI commands.
  • Share absence and digest rules; preserve unknown body and membership facets; use unique managed type/name/signature matching before structural fallback.
  • Share JavaScript property and assigned-result rules, retain destructuring projections, and keep projected downstream relationships partial rather than claiming whole-result identity.
  • Preserve selected process/Doctor host identity and actionable PTY, filesystem, provider, and lease failures. Drain cancelled lazy loads and exclude exited descendants from verified lineage.
  • Make browser teardown cancellation-aware, retain primary errors alongside cleanup failures, share frame-tree/navigation rules, and invalidate stale WebMCP registrations without pruning unrelated frames.
  • Decode complete native tool representations, remove the unused load-command field, rename the Ghidra fixture, link fake-backed suites to real verification lanes, and refresh generated contracts and the roadmap.

Managed MCP example, independent of an active native target:

{"name":"inspect_managed_artifact","arguments":{"path":"C:\\fixtures\\Fixture.Managed.dll"}}
{"name":"inspect_managed_members","arguments":{"path":"C:\\fixtures\\Fixture.Managed.dll"}}
{"name":"inspect_managed_native_boundaries","arguments":{"path":"C:\\fixtures\\Fixture.Managed.dll"}}

Each result retains the complete inline Evidence record and subject identity for that managed file.

Verification:

  • npm run check:pr: 364 test files, 2,070 tests passed, two host-specific skips; typecheck, lint, formatting, dead-code and generated-document checks passed.
  • npm run verify:browser: live Chrome, browser scenarios, CLI/MCP screenshots, and owned versus attached browser cleanup passed.
  • npm run verify:inspector: live Node Inspector discovery and observation through CLI/MCP passed.
  • npm run verify:managed: 11 managed conformance cases passed; optional operator-local and ILSpy proofs remain unconfigured.
  • npm run verify:package: isolated installed-package setup/update, managed workflows, Evidence composition and MCP startup passed.
  • Actual macOS otool -h -l /bin/ls parsing passed; npm run docs:check passed after the roadmap update.

Real Hopper and Ghidra verification was not performed. Windows execution must be verified by its CI lane; this change does not enable Windows Ghidra or process-tree ownership.

BREAKING CHANGE: Native load-command results omit the unused, always-null file_offset. Managed comparison metadata adds the exact-signature basis and exact_signature count, and reports exact-signature-fallback name matching.

Fixes #568
Fixes #566
Fixes #565
Fixes #563
Fixes #562
Fixes #561
Fixes #560
Fixes #559
Fixes #558
Fixes #557
Fixes #553

Issue #551 was already resolved on main by #585; this branch includes that fix. The unproven secondary seed allegation in #553 was narrowed away after checking the graph families and existing matchers. #529 is resolved by #577, and #544 is consolidated into the concrete boundary issues above.


🔄 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/597 **Author:** [@morluto](https://github.com/morluto) **Created:** 10/5/2026 **Status:** ✅ Merged **Merged:** 10/5/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/boundary-root-causes` --- ### 📝 Commits (7) - [`e77ad69`](https://github.com/morluto/rea/commit/e77ad6937f49f7308365274e60ac5c6a13474c3b) fix(comparisons)!: preserve unknowns across partial observations - [`fe14b2e`](https://github.com/morluto/rea/commit/fe14b2e3456c008a5af91a221516b20976291052) fix(javascript): preserve projected result binding semantics - [`716d301`](https://github.com/morluto/rea/commit/716d301da8cdb3163927cc2c0e606036466e1163) fix(native)!: admit complete parser values and preserve typed failures - [`887a943`](https://github.com/morluto/rea/commit/887a943fd5df7e8735ff44980d0cfd6626ce78aa) fix(process): preserve host identity and actionable boundary failures - [`551c87e`](https://github.com/morluto/rea/commit/551c87e01ce3347e397657b94d630da63ebb5b92) fix(browser): preserve cleanup and document-transition evidence - [`1d49b39`](https://github.com/morluto/rea/commit/1d49b39661b7549d27f2b76fe060a4996a23664d) fix(adapters): align managed targets and typed CLI outcomes - [`2ea6117`](https://github.com/morluto/rea/commit/2ea6117b29f6e8d9830e4599545ceaca0ab3dbde) docs: refresh boundary contracts and shipped roadmap behavior ### 📊 Changes **134 files changed** (+3546 additions, -811 deletions) <details> <summary>View changed files</summary> 📝 `docs/adr/0003-managed-code-evidence-and-provider-boundary.md` (+7 -4) 📝 `docs/managed-code-analysis.md` (+12 -9) 📝 `docs/product-catalog.json` (+2 -2) 📝 `docs/roadmap.md` (+11 -10) 📝 `docs/verification/managed-conformance-manifest.json` (+2 -2) 📝 `scripts/verify-managed-conformance.mjs` (+28 -1) 📝 `scripts/verify-package-managed.mjs` (+2 -1) 📝 `skills/reverse-engineer-anything/SKILL.md` (+1 -1) 📝 `src/application/BinaryTargetResolver.ts` (+28 -1) 📝 `src/application/BrowserEvidence.ts` (+8 -3) 📝 `src/application/BrowserScenarioEvidence.ts` (+6 -3) 📝 `src/application/ClientRegistrationStatus.ts` (+18 -1) 📝 `src/application/DirectAnalysis.ts` (+50 -9) ➕ `src/application/Doctor.systemHost.test.ts` (+43 -0) 📝 `src/application/Doctor.test.ts` (+22 -3) 📝 `src/application/Doctor.ts` (+128 -70) 📝 `src/application/DoctorDiagnostics.ts` (+1 -1) 📝 `src/application/ElectronActiveEvidence.ts` (+7 -4) 📝 `src/application/ElectronEvidence.ts` (+8 -3) 📝 `src/application/EnhancedNativeInvestigation.test.ts` (+2 -0) _...and 80 more files_ </details> ### 📄 Description Managed inspection could inherit an unrelated native provider, CLI failures could exit successfully, and comparisons could report definite changes from incomplete evidence. This repairs the contracts at their shared owners and adds regressions through the consuming adapters. - Run all three managed inspections against explicit PE/CLI paths through a native-independent session. Retain the last successful managed selection and bind Evidence to the inspected file. - Classify complete CLI error envelopes and exhaustive setup/update/uninstall outcomes. Check coverage against actual registered CLI commands, with explicit declarations for MCP operations without dedicated CLI commands. - Share absence and digest rules; preserve unknown body and membership facets; use unique managed type/name/signature matching before structural fallback. - Share JavaScript property and assigned-result rules, retain destructuring projections, and keep projected downstream relationships partial rather than claiming whole-result identity. - Preserve selected process/Doctor host identity and actionable PTY, filesystem, provider, and lease failures. Drain cancelled lazy loads and exclude exited descendants from verified lineage. - Make browser teardown cancellation-aware, retain primary errors alongside cleanup failures, share frame-tree/navigation rules, and invalidate stale WebMCP registrations without pruning unrelated frames. - Decode complete native tool representations, remove the unused load-command field, rename the Ghidra fixture, link fake-backed suites to real verification lanes, and refresh generated contracts and the roadmap. Managed MCP example, independent of an active native target: ```json {"name":"inspect_managed_artifact","arguments":{"path":"C:\\fixtures\\Fixture.Managed.dll"}} {"name":"inspect_managed_members","arguments":{"path":"C:\\fixtures\\Fixture.Managed.dll"}} {"name":"inspect_managed_native_boundaries","arguments":{"path":"C:\\fixtures\\Fixture.Managed.dll"}} ``` Each result retains the complete inline Evidence record and subject identity for that managed file. Verification: - `npm run check:pr`: 364 test files, 2,070 tests passed, two host-specific skips; typecheck, lint, formatting, dead-code and generated-document checks passed. - `npm run verify:browser`: live Chrome, browser scenarios, CLI/MCP screenshots, and owned versus attached browser cleanup passed. - `npm run verify:inspector`: live Node Inspector discovery and observation through CLI/MCP passed. - `npm run verify:managed`: 11 managed conformance cases passed; optional operator-local and ILSpy proofs remain unconfigured. - `npm run verify:package`: isolated installed-package setup/update, managed workflows, Evidence composition and MCP startup passed. - Actual macOS `otool -h -l /bin/ls` parsing passed; `npm run docs:check` passed after the roadmap update. Real Hopper and Ghidra verification was not performed. Windows execution must be verified by its CI lane; this change does not enable Windows Ghidra or process-tree ownership. BREAKING CHANGE: Native load-command results omit the unused, always-null `file_offset`. Managed comparison metadata adds the `exact-signature` basis and `exact_signature` count, and reports `exact-signature-fallback` name matching. Fixes #568 Fixes #566 Fixes #565 Fixes #563 Fixes #562 Fixes #561 Fixes #560 Fixes #559 Fixes #558 Fixes #557 Fixes #553 Issue #551 was already resolved on main by #585; this branch includes that fix. The unproven secondary seed allegation in #553 was narrowed away after checking the graph families and existing matchers. #529 is resolved by #577, and #544 is consolidated into the concrete boundary issues above. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:14:14 +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#2097
No description provided.