[PR #454] [MERGED] fix(mcp): clarify target routing and caller diagnostics #2001

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

📋 Pull Request Information

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

Base: main ← Head: fix/mcp-routing-diagnostics


📝 Commits (4)

  • 969519c fix(mcp): clarify routing and advertise input examples
  • 0f96bf3 fix(errors): preserve actionable analysis diagnostics
  • 281e41f fix(verify): follow dynamic Hopper tool availability
  • 59d4659 docs: refresh managed completion manifest

📊 Changes

25 files changed (+223 additions, -43 deletions)

View changed files

📝 docs/mcp-prompts.md (+4 -0)
📝 docs/product-catalog.json (+3 -3)
📝 docs/user-visible-errors.csv (+1 -1)
📝 docs/verification/managed-conformance-manifest.json (+2 -2)
📝 scripts/lib/real-hopper-semantic.mjs (+10 -2)
📝 scripts/verify-real-hopper.mjs (+15 -10)
📝 skills/reverse-engineer-anything/SKILL.md (+9 -2)
📝 src/application/ArtifactInventory/scanCanonical.ts (+1 -1)
📝 src/artifacts/ArtifactReader.ts (+1 -0)
📝 src/contracts/artifactToolContracts.ts (+8 -3)
📝 src/contracts/promptContracts.ts (+2 -2)
📝 src/domain/analysisErrorPresentation.ts (+8 -2)
📝 src/domain/analysisErrorProjection.ts (+1 -0)
📝 src/domain/errors.ts (+3 -0)
📝 src/domain/inputIssueProjection.ts (+7 -1)
📝 src/generatedMcpToolCatalog.ts (+1 -1)
📝 src/server/createServer.ts (+1 -1)
📝 src/server/registerSessionStatusTool.ts (+1 -1)
📝 src/server/toolRegistrationOptions.ts (+11 -8)
📝 tests/contractSnapshot.test.ts (+22 -0)

...and 5 more files

📄 Description

Description

This PR tightens REA's agent-facing MCP contracts around target routing, examples, and failure recovery.

Target-free sessions now explain that archive and package workflows must call open_binary before active-target artifact tools, and session status plus the guided prompt use the same route. Every advertised MCP input schema now carries the validated examples already owned by its contract, while extraction rejects relative output roots at the caller boundary.

Projected diagnostics retain schema-authored correction messages, distinguish disabled artifact-integrity continuation from unsupported formats, and give missing residual unknowns a session-specific lookup/remediation message. The real-Hopper verifier now compares tools/list with the session's available capabilities and accepts the current correlated bridge-progress wording.

Suggested review order: public contract and routing changes, error projection tests and presentation, then the verifier-only changes and generated artifacts.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Performance improvement
  • Refactoring (no functional change)
  • Tool contract change (MCP schema modification)

Testing Performed

  • Unit tests added or updated
  • TypeScript typecheck passes (npm run typecheck)
  • Linting passes (npm run lint, with five existing warnings and no errors)
  • Full test suite passes — the PR gate observed one tests/ghidraClient.test.ts startup-cancellation cleanup failure under local process contention
  • Real Hopper verification performed — attempted; a direct real-Hopper binding/binary_overview probe passed, but the full verifier was blocked when the environment's sentinel process reported binary_overview disabled
  • Linux real Hopper verification performed — not run
  • Real browser verification performed — unavailable because no Chrome-family executable is installed
  • Package verification performed (npm run verify:package)

Also passed:

  • npm run check:fast
  • npm run docs:check:built
  • npm pack --dry-run
  • focused error, input-projection, contract-snapshot, session, artifact, integration, replay, ledger, inspector, and browser/managed prerequisite checks from the final implementation tree

The initial npm run check:pr run also caught the expected generated-manifest drift caused by the bundled skill digest; docs/verification/managed-conformance-manifest.json was regenerated in the final documentation commit, and the generated-document check passes now.

Tool Contract Impact

  • inventory_artifact and inspect_artifact explicitly document their active-target-only input and target-free open_binary prerequisite.
  • Advertised input JSON Schemas expose each contract's validated examples values.
  • compare_application_versions now advertises open_binary before artifact inventory.
  • artifactExtractionInputSchema.output_root now requires an absolute path.
  • Canonical catalog and bundled-skill metadata were regenerated; tool count remains 111.

No provider wire protocol or target mutation authority changed. Ghidra and browser real-provider verification remain environment-dependent and were not completed here.

No directly matching open issue was found.


🔄 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/454 **Author:** [@morluto](https://github.com/morluto) **Created:** 7/29/2026 **Status:** ✅ Merged **Merged:** 7/29/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/mcp-routing-diagnostics` --- ### 📝 Commits (4) - [`969519c`](https://github.com/morluto/rea/commit/969519c00f31b5bc0f23dcffe8867e091461fda6) fix(mcp): clarify routing and advertise input examples - [`0f96bf3`](https://github.com/morluto/rea/commit/0f96bf365c330a7eb121a173bfa140cc2b652764) fix(errors): preserve actionable analysis diagnostics - [`281e41f`](https://github.com/morluto/rea/commit/281e41f7660066addcc7a204128fb1f49bf7a674) fix(verify): follow dynamic Hopper tool availability - [`59d4659`](https://github.com/morluto/rea/commit/59d465971ea86f933e9037fa32ac2787d935d076) docs: refresh managed completion manifest ### 📊 Changes **25 files changed** (+223 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `docs/mcp-prompts.md` (+4 -0) 📝 `docs/product-catalog.json` (+3 -3) 📝 `docs/user-visible-errors.csv` (+1 -1) 📝 `docs/verification/managed-conformance-manifest.json` (+2 -2) 📝 `scripts/lib/real-hopper-semantic.mjs` (+10 -2) 📝 `scripts/verify-real-hopper.mjs` (+15 -10) 📝 `skills/reverse-engineer-anything/SKILL.md` (+9 -2) 📝 `src/application/ArtifactInventory/scanCanonical.ts` (+1 -1) 📝 `src/artifacts/ArtifactReader.ts` (+1 -0) 📝 `src/contracts/artifactToolContracts.ts` (+8 -3) 📝 `src/contracts/promptContracts.ts` (+2 -2) 📝 `src/domain/analysisErrorPresentation.ts` (+8 -2) 📝 `src/domain/analysisErrorProjection.ts` (+1 -0) 📝 `src/domain/errors.ts` (+3 -0) 📝 `src/domain/inputIssueProjection.ts` (+7 -1) 📝 `src/generatedMcpToolCatalog.ts` (+1 -1) 📝 `src/server/createServer.ts` (+1 -1) 📝 `src/server/registerSessionStatusTool.ts` (+1 -1) 📝 `src/server/toolRegistrationOptions.ts` (+11 -8) 📝 `tests/contractSnapshot.test.ts` (+22 -0) _...and 5 more files_ </details> ### 📄 Description ## Description This PR tightens REA's agent-facing MCP contracts around target routing, examples, and failure recovery. Target-free sessions now explain that archive and package workflows must call `open_binary` before active-target artifact tools, and session status plus the guided prompt use the same route. Every advertised MCP input schema now carries the validated examples already owned by its contract, while extraction rejects relative output roots at the caller boundary. Projected diagnostics retain schema-authored correction messages, distinguish disabled artifact-integrity continuation from unsupported formats, and give missing residual unknowns a session-specific lookup/remediation message. The real-Hopper verifier now compares `tools/list` with the session's available capabilities and accepts the current correlated bridge-progress wording. Suggested review order: public contract and routing changes, error projection tests and presentation, then the verifier-only changes and generated artifacts. ## Type of Change - [x] Bug fix - [ ] New feature - [x] Documentation update - [ ] Performance improvement - [ ] Refactoring (no functional change) - [x] Tool contract change (MCP schema modification) ## Testing Performed - [x] Unit tests added or updated - [x] TypeScript typecheck passes (`npm run typecheck`) - [x] Linting passes (`npm run lint`, with five existing warnings and no errors) - [ ] Full test suite passes — the PR gate observed one `tests/ghidraClient.test.ts` startup-cancellation cleanup failure under local process contention - [ ] Real Hopper verification performed — attempted; a direct real-Hopper binding/`binary_overview` probe passed, but the full verifier was blocked when the environment's sentinel process reported `binary_overview` disabled - [ ] Linux real Hopper verification performed — not run - [ ] Real browser verification performed — unavailable because no Chrome-family executable is installed - [x] Package verification performed (`npm run verify:package`) Also passed: - `npm run check:fast` - `npm run docs:check:built` - `npm pack --dry-run` - focused error, input-projection, contract-snapshot, session, artifact, integration, replay, ledger, inspector, and browser/managed prerequisite checks from the final implementation tree The initial `npm run check:pr` run also caught the expected generated-manifest drift caused by the bundled skill digest; `docs/verification/managed-conformance-manifest.json` was regenerated in the final documentation commit, and the generated-document check passes now. ## Tool Contract Impact - `inventory_artifact` and `inspect_artifact` explicitly document their active-target-only input and target-free `open_binary` prerequisite. - Advertised input JSON Schemas expose each contract's validated `examples` values. - `compare_application_versions` now advertises `open_binary` before artifact inventory. - `artifactExtractionInputSchema.output_root` now requires an absolute path. - Canonical catalog and bundled-skill metadata were regenerated; tool count remains 111. No provider wire protocol or target mutation authority changed. Ghidra and browser real-provider verification remain environment-dependent and were not completed here. ## Related Issues No directly matching open issue was found. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:13: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#2001
No description provided.