Repository navigation
refactor(mcp): bind layout, browser scenario, runtime observation, guided workflow and native matching tools through the shared table - #11646
Conversation
…ided workflow and native matching tools through the shared table
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
[Medium impact] The reviewed patch appears safe to merge, but its equivalent is already present in local SummaryThis refactor routes six existing MCP tools through the shared binding table so they reuse common request checks, logging and Evidence delivery instead of separate registration files.
No new correctness or security issues found. Existing tests were inspected, not rerun. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Server composition] --> B[Shared service binding table]
B --> C[Evidence handler: layout, runtime, native matching]
B --> D[Retained summary handler: browser scenario]
B --> E[Value handler: guided workflows]
C --> F[Existing application workflows]
D --> F
E --> F
F --> G[Shared logging and result delivery]
C -. session admission and recording .-> H[Session]
D -. session admission and recording .-> H
Reviews (2) · Last reviewed commit: "refactor(mcp): bind layout, browser scen..." · Reviewed by Greptile |
Summary
Binds six more MCP tools through the shared service binding table and deletes their bespoke registration files:
inspect_binary_layout,capture_browser_scenario,list_javascript_runtime_targets,observe_javascript_runtime,guided_workflowsandmatch_native_functions. Base: main. Refs #10583.Problem and expected behavior
Each of these tools had its own
register*.tsthat re-wired admission, logging, optional-provider refusal, retained-summary delivery and Evidence recording by hand, so they could drift from the shared handlers every other tool uses. Expected: each binding says what the tool runs; the shared handler its kind selects owns the rest, with the same results.Change and scope
src/server/serviceToolBindings.ts, new groups:binaryLayout(run, application admission): the tool parses its own request so a refusal names the field, then preflights and projects the retained summary throughretainedSummaryDelivery(same pattern asinspect_web_network_capture).browserScenario(summary, SDK admission): the scenario parser owns field-path diagnostics; a provider that failed to load is refused after validation, as before.javascriptRuntime(runwithunavailable): a failed provider load refuses every call before admission, asrunEvidenceToolOperationdid.guidedWorkflows(value, application admission) over the prompts the server advertises.nativeFunctionMatching(run): resolves the per-call allowance, records the sources it read and summarizes into the session. It registers in its ownregisterServiceToolscall with session admission andsession.recordEvidence, so the other session tools keep their dependencies.src/server/createServer.ts,src/server/registerSessionTools.ts: compose the new groups.registerBinaryDiagnosticsTools.ts,registerBrowserScenarioTool.ts,registerJavaScriptRuntimeObservationTools.ts(2 sites),registerGuidedWorkflowTool.ts,registerNativeFunctionMatchingTool.ts.bespoke-mcp-tool-registrationbaseline: 19 → 13 sites.scripts/ci/scopes.mjsroutes the table instead of the deleted file.src/server/registerGuidedWorkflowTool.test.ts→guidedWorkflowsTool.test.ts, registering through the table.Not included: close/reset lifecycle,
registerEvidenceTools, reverse engineering, desktop build (follow-up slices) and Electron (waits on D7).Contract and boundary impact
Small differences visible to MCP clients: an invalid
inspect_binary_layoutrequest is now refused inside session admission (which waits only for an in-flight open/close transition, not for a target), likeinspect_web_network_capture;guided_workflowscalls are now logged by the shared value handler; layout and runtime-observation workflows now receive the request's progress reporter with its signal, as every otherrunbinding does.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
For evidence-bearing changes:
Validation performed
npm run test:focused -- src/server/guidedWorkflowsTool.test.ts tests/boundary/mcp/guidedWorkflowsMcp.test.ts tests/boundary/mcp/binaryDiagnosticsMcp.test.ts tests/boundary/mcp/javascriptRuntimeObservationMcp.test.ts tests/boundary/mcp/browserScenarioMcp.test.ts tests/boundary/mcp/browserScenarioInputDiagnosticsMcp.test.ts tests/boundary/mcp/optionalProviderIsolation.test.ts tests/acceptance/tools/nativeFunctionMatching.test.ts tests/boundary/mcp/analysisSummaryDetailMcp.test.ts— 51 passed (22 s wall, 1.6 GB peak RSS)npm run test:focused -- tests/boundary/mcp/serverLifecycleMcp.test.ts tests/boundary/mcp/hostRestrictedAvailabilityMcp.test.ts tests/boundary/mcp/evidenceInputContractsMcp.test.ts tests/boundary/mcp/observationPartialEvidenceDelivery.test.ts tests/boundary/mcp/contractToolBindings.test.ts tests/evaluation/moduleBoundaries.test.ts— 181 passednpm run test:focused -- tests/boundary/filesystem/ciChangeScope.test.ts tests/boundary/filesystem/ciRequiredLanes.test.ts— 433 passednpm run check:fast— passed;npx oxfmt --checkon changed files — passed;node scripts/verify/architecture-guards.mjs --shrink-baselines— baseline lowered, guards passedCompatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.