Skip to content

refactor(mcp): bind layout, browser scenario, runtime observation, guided workflow and native matching tools through the shared table - #11646

Merged
morluto merged 1 commit into
mainfrom
refactor/bind-optional-provider-and-session-tools
Nov 16, 2026
Merged

morluto merged 1 commit into
mainfrom
refactor/bind-optional-provider-and-session-tools

Conversation

@morluto

@morluto morluto commented Nov 16, 2026

Copy link
Copy Markdown
Owner

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_workflows and match_native_functions. Base: main. Refs #10583.

Problem and expected behavior

Each of these tools had its own register*.ts that 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 through retainedSummaryDelivery (same pattern as inspect_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 (run with unavailable): a failed provider load refuses every call before admission, as runEvidenceToolOperation did.
    • 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 own registerServiceTools call with session admission and session.recordEvidence, so the other session tools keep their dependencies.
  • src/server/createServer.ts, src/server/registerSessionTools.ts: compose the new groups.
  • Removed registerBinaryDiagnosticsTools.ts, registerBrowserScenarioTool.ts, registerJavaScriptRuntimeObservationTools.ts (2 sites), registerGuidedWorkflowTool.ts, registerNativeFunctionMatchingTool.ts. bespoke-mcp-tool-registration baseline: 19 → 13 sites. scripts/ci/scopes.mjs routes 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

  • Semantic owner and earliest changed stage: MCP registration only; the application workflows are unchanged.
  • Contribution scope fit and linked maintainer decision: W1 cleanup (coordinator-assigned); no new capability.
  • CLI and MCP/tool-catalog contract: schemas and registration options unchanged; no CLI change.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged.
  • Target selection, authority, upstream behavior, and cleanup details: not applicable.
  • Generated metadata, package, or installation impact: none.

Small differences visible to MCP clients: an invalid inspect_binary_layout request is now refused inside session admission (which waits only for an in-flight open/close transition, not for a target), like inspect_web_network_capture; guided_workflows calls 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 other run binding does.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: the guided-workflow test registers through the table; the existing MCP suites for each tool now exercise the table bindings (binary diagnostics incl. retained summaries, browser scenario incl. input diagnostics, runtime observation incl. unavailable provider, native matching acceptance, optional-provider isolation, summary detail).
  • Base reproduction or other evidence: refactor; behavior is pinned by the existing suites.
  • User-visible CLI/MCP output: unchanged apart from the items above.
  • Remaining proof gaps: none known for these tools beyond what the existing suites cover.

For evidence-bearing changes:

  • 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 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 passed
  • npm run test:focused -- tests/boundary/filesystem/ciChangeScope.test.ts tests/boundary/filesystem/ciRequiredLanes.test.ts — 433 passed
  • npm run check:fast — passed; npx oxfmt --check on changed files — passed; node scripts/verify/architecture-guards.mjs --shrink-baselines — baseline lowered, guards passed

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: none beyond the suites above.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: optional-provider refusal and session recording paths unchanged.

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP output (if applicable) includes representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

…ided workflow and native matching tools through the shared table
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-16T01:40:19.840568Z
We couldn’t complete this review. Comment @codex review to try again.
6c3758e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The reviewed patch appears safe to merge, but its equivalent is already present in local origin/main.

Summary

This 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.

  • Binary layout requests use the shared MCP handler and keep their retained summaries.
  • Browser scenario requests keep their own input errors through the shared MCP handler.
  • JavaScript runtime listing and observation use the shared MCP handler.
  • Native function matches use shared registration and keep their source Evidence in the session.
  • Guided workflows use the shared value handler to list and render advertised prompts.
  • Server setup and CI routing now point to the shared tool binding table.

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
Loading

Reviews (2) · Last reviewed commit: "refactor(mcp): bind layout, browser scen..." · Reviewed by Greptile

@morluto
morluto merged commit 465796a into main Nov 16, 2026
8 checks passed
@morluto
morluto deleted the refactor/bind-optional-provider-and-session-tools branch November 16, 2026 01:46
@morluto morluto added the area: mcp MCP server, transport, and tool registration label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mcp MCP server, transport, and tool registration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant