Repository navigation
refactor(mcp): bind the session target, context and process capture tools through the shared table - #11640
Merged
morluto merged 1 commit intoNov 16, 2026
Conversation
…ools through the shared table Value bindings can return a ReducibleValue (alternatives tried when the complete value overflows) or a DetailedFailure (facts delivered beside the error's details). A new query binding reads the analysis its required admission grants. open_binary and open_bundle_resources bind as values; get_navigation_context and inspect_address_context as queries; capture_process_scenario on the analyze kind through an application owner that records its Evidence and residual unknowns.
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. |
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryMoves five session tools into the shared binding table and moves process-capture recording into
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[MCP request] --> B[Shared binding table]
B --> C[Binary target value]
B --> D[Admitted context query]
B --> E[Admitted process capture]
C --> F[Session opens target]
D --> G[Granted analysis]
E --> H[Capture and record Evidence]
F --> I[Shared delivery]
G --> I
H -->|Reuse recording receipt| I
Reviews (2) · Last reviewed commit: "refactor(mcp): bind the session target, ..." · Reviewed by Greptile |
morluto
added a commit
that referenced
this pull request
Nov 16, 2026
…ssion through the shared table (#11637) * refactor(mcp): bind GDB and Cutter tools under external-mutation admission through the shared table GDB start and status, and Cutter discovery, bind as values outside admission; gdb_console and cutter_command bind on the external-mutation evidence kind (gdb_console with delivery detail), and close_gdb_session on owned-cleanup. Tests build their servers through one debugger fixture, and the Rizin lifecycle regressions now run for all three debuggers. * refactor(mcp): bind the session target, context and process capture tools through the shared table (#11640) Value bindings can return a ReducibleValue (alternatives tried when the complete value overflows) or a DetailedFailure (facts delivered beside the error's details). A new query binding reads the analysis its required admission grants. open_binary and open_bundle_resources bind as values; get_navigation_context and inspect_address_context as queries; capture_process_scenario on the analyze kind through an application owner that records its Evidence and residual unknowns.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Binds the last five session tools in
registerSessionTools.ts(open_binary,open_bundle_resources,get_navigation_context,inspect_address_context,capture_process_scenario) through the shared service binding table, with the three delivery capabilities they needed (coordinator decision): a query binding on the admitted analysis port, oversized-response alternatives for value results, and a detailed failure that keepsopen_binary's error format. Stacked on #11637. Refs #10583.Problem and expected behavior
These tools wired admission, logging and delivery by hand because the table could not express them: value bindings had no access to the analysis admission grants, no overflow alternatives, and no failure that carries facts beside the error (
open_binaryreportsselection_at_failure,target_at_open_completion,provider_id_at_open_completion). Process capture recorded Evidence and residual unknowns inside the server adapter. Expected: each tool is one binding; the shared handlers own admission, logging and delivery; the results and errors are unchanged.Change and scope
src/server/contractToolHandler.ts: value workflows may returnReducibleValue(value + alternatives tried in order when the complete value overflows) or fail withDetailedFailure(error + facts added to its details); the value handler passes the analysis admission grants.src/server/contractToolBindings.ts: newquerybinding kind ((input, analysis, request) => value), refused at startup when the server admits no analysis, likeanalyze.src/server/ToolResultDelivery.ts:toOpenFailureToolResultbecomestoDetailedErrorToolResult(error, details, targetContent)(same projection, no recovery substitution);toCallToolResultwraps alternatives inresultfor session contracts like the value itself, so callers no longer pre-wrap them.src/server/admittedToolOperation.ts: passes the granted analysis to the operation.src/application/process/ProcessSessionCapture.ts(new owner): plan or capture a scenario, record its Evidence and each residual unknown in the session; returns{ evidence, recorded }so delivery does not record twice.src/server/serviceToolBindings.ts: groupsbinaryTarget(open_binary, open_bundle_resources: values outside admission, as before),analysisContext(navigation and address context: queries; address context returns aReducibleValueoveromitContextEvidenceForDelivery),processCapture(analyzekind under session admission).src/server/registerSessionTools.ts: 5 registration sites and ~300 lines removed; it keeps lifecycle composition (close, reset, status, process resource cleanup, native function matching). Baseline lowered.Not included:
close_binary,reset_investigation,match_native_functions(their own files), Electron (D7).Contract and boundary impact
ProcessSessionCapture(application).ProcessCaptureResourceScope.Behavior visible to MCP clients (no result or error shape changes):
get_navigation_contextandinspect_address_contextcalls are now logged by the shared handler (they were not logged).capture_process_scenarionow reports operation start and end progress (as everyanalyzeworkflow does) around its existing capture progress, when the client requests progress.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
tests/boundary/mcp/contractToolBindings.test.ts): a query receives exactly the analysis its admission grants, is admitted under its own tool name, and a server that admits none refuses the binding at startup.oversizedErrorDeliveryMcp.test.tsdrivestoDetailedErrorToolResultwith the open-failure facts (oversized open failure still delivered within budget).providerSelectionMcp:selection_at_failure,target_at_open_completion), address-context overflow alternatives (contextEvidenceOverflow,addressContextCapacity), navigation (navigationContextMcp), address input errors and bookmarks, capture Evidence identity, residual unknowns and cleanup (processEvidenceIdentityMcp,processCaptureCleanupSchema,serverUnknownsMcp,shutdown), session target requirements, tool families and catalog identity.providerSelectionMcp"reports confirmed snapshot binding differences" fails on main since feat(snapshots)!: persist the target identity as the snapshot target #11551 (stale expectation; fixed by test(snapshots): expect a snapshot binding mismatch to name targets by their persisted identity #11639). It fails at thebinding_mismatchassertion, after the open-failure detail assertions pass.For evidence-bearing changes:
Validation performed
npm run test:focused -- tests/boundary/mcp/contractToolBindings.test.ts— 5 passednpm run test:focused -- tests/boundary/mcp/contextEvidenceOverflow.test.ts tests/boundary/mcp/addressContextCapacity.test.ts tests/boundary/mcp/navigationContextMcp.test.ts tests/boundary/mcp/addressContextInputErrors.test.ts tests/boundary/mcp/addressContextBookmarks.test.ts tests/boundary/mcp/oversizedErrorDeliveryMcp.test.ts tests/boundary/mcp/processEvidenceIdentityMcp.test.ts tests/boundary/mcp/processCaptureCleanupSchema.test.ts tests/boundary/mcp/sessionMcp.test.ts tests/boundary/mcp/sessionTargetRequirements.test.ts tests/boundary/mcp/shutdown.test.ts tests/boundary/mcp/toolResult.test.ts— 109 passednpm run test:focused -- tests/boundary/mcp/serverUnknownsMcp.test.ts tests/boundary/mcp/processComparisonVerificationMcp.test.ts tests/boundary/mcp/processComparisonDiagnosticsMcp.test.ts tests/boundary/mcp/processTraceAdaptersParity.test.ts tests/boundary/mcp/hostRestrictedAvailabilityMcp.test.ts tests/boundary/mcp/toolFamiliesMcp.test.ts tests/boundary/mcp/serverIdentity.test.ts tests/boundary/mcp/idaToolEffects.test.ts tests/boundary/mcp/evidenceBundleInline.test.ts tests/boundary/mcp/sourcePublicationContext.test.ts tests/boundary/mcp/guidedWorkflowsMcp.test.ts tests/boundary/mcp/compactInputSchemaMcp.test.ts src/server/sessionDerivedArtifactComparison.test.ts tests/boundary/mcp/providerSelectionMcp.test.ts— 118 passed, 1 failed (the main failure above)npm run check:fast— passed;npx oxfmt --check .— passed; architecture guards (baseline lowered) — passed; pre-push hook — passedCompatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.