Repository navigation
refactor(mcp): bind Rizin debugger tools under external-mutation admission through the shared table - #11629
Conversation
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. |
…ssion through the shared table
f2372f8 to
cb16c32
Compare
[Low impact] No new blocking issue found; confirm whether this PR should close as superseded. SummaryMoves the four Rizin debugger tools into the shared binding table while preserving mutation admission, cleanup ownership, and saved Evidence.
Supersession: Local No new actionable defect or security issue found. Tests were not rerun. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[MCP request] --> B[Shared binding table]
B -->|Status| C[Rizin status read]
B -->|Start, command, close| D[Shared mutation handler]
D --> E[Session admission and cleanup ownership]
E --> F[Rizin manager]
F --> G[Retire bound analysis]
G --> H[Deliver result or retained partial Evidence]
C --> H
Reviews (3) · Last reviewed commit: "test(mcp): cancel a Rizin command during..." · Reviewed by Greptile |
…ute moved code to the reverse-tools lane
…red table (#11621) * refactor(mcp): bind Frida discovery and session tools through the shared table * refactor(mcp): bind browser observation tools through the shared table (#11622) * refactor(mcp): bind session record tools through the shared table (#11625) * fix(mcp): record a completed provider-backed workflow's Evidence once before delivery * refactor(mcp): bind Rizin debugger tools under external-mutation admission through the shared table (#11629) * refactor(mcp): bind Rizin debugger tools under external-mutation admission through the shared table * test(mcp): cancel a Rizin command during its retirement close, and route moved code to the reverse-tools lane
Summary
Adds a binding kind for commands that run under the session's external-mutation admission with owned cleanup, and binds the four Rizin debugger tools (
start_rizin_debug_session,rizin_debug_command,rizin_debug_session_status,close_rizin_debug_session) through the shared table with it. Stacked on #11625. GDB and Cutter follow in their own PRs (maintainer-approved scope: same admission, cleanup ownership and failure retention).Problem and expected behavior
The table had no kind for tools that may change the bound artifact, so GDB, Rizin and Cutter each re-wired
runWithExternalMutationAdmission/runOwnedCleanupWithExternalMutationAdmission, cleanup retry and delivery by hand. Expected: the binding states what the command is, and one handler owns admission, cleanup retry, owned close and delivery, unchanged.Change and scope
src/server/externalMutationToolHandler.ts:ExternalMutation(evidence|value|owned-cleanup) and its handler. It calls the existing admission helpers with the same arguments the Rizin handlers passed:retryCleanupbeforeevidence/valuecommands; the completed Evidence as partial when retirement fails or is cancelled; avaluecommand'sretainedidentifiers (Rizin'ssession_id) kept on cancellation;owned-cleanupthroughrunOwnedCleanupWithExternalMutationAdmissionkeyed by the resource the input names.evidencetakesdetail: "delivery"for a retained summary (GDB console, next PR).src/server/contractToolBindings.ts:ExternalMutationBinding({ session, mutation }).src/server/serviceToolBindings.ts:rizinDebuggroup; status is a plain value binding (no admission, as before).createServer.tsregisters it with the session.src/server/registerRizinDebugTools.ts; baseline 4 sites removed.scripts/ci/scopes.mjsroutes the moved code (externalMutationToolHandler.ts,serviceToolBindings.ts, the Rizin MCP tests and fixture) to thereverse_toolslane in place of the deleted file. Tests that registered it build the server withtests/fixtures/rizinDebugMcp.ts.Behavior visible to MCP clients: a failed start or close is delivered through the shared partial-error path (identical unless the error carries partial Evidence, which these do not today); start, command and close are logged as before.
Contract and boundary impact
externalMutationAdmission.tsandBinarySession.docs/public/product-catalog.json), package, or installation impact: none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
Lifecycle regressions added (
tests/boundary/mcp/rizinExternalMutationLifecycleMcp.test.ts, realBinarySessionadmission, fake manager):Existing Rizin MCP suites pass unchanged through the new server fixture (launch provenance, startup admission across a bound session, command cancellation, pending and preserved output, stopped session, inferior stdin).
Remaining proof gaps: the new regressions use a fake manager; real Rizin runs only in the provider suites listed (8 skipped where Rizin or a TTY is unavailable).
For evidence-bearing changes:
Validation performed
npm run test:focused -- tests/boundary/mcp/rizinExternalMutationLifecycleMcp.test.ts tests/boundary/mcp/rizinDebuggerCancellationMcp.test.ts tests/boundary/mcp/rizinOutputPreservation.test.ts tests/boundary/mcp/rizinPendingOutput.test.ts tests/boundary/mcp/rizinStoppedSessionMcp.test.ts tests/boundary/providers/RizinDebugSessionInferiorStdin.test.ts tests/boundary/mcp/fridaLifecycleMcp.test.ts tests/boundary/mcp/fridaMcp.test.ts tests/boundary/mcp/optionalProviderIsolation.test.ts tests/boundary/mcp/browserMcp.test.ts tests/boundary/mcp/serverUnknownsMcp.test.ts tests/boundary/mcp/evidenceImportCancellation.test.ts tests/boundary/mcp/environmentBundleMcp.test.ts— 148 passed, 8 skipped (on d4a7c17)npm run test:focused -- tests/boundary/filesystem/ciChangeScope.test.ts tests/boundary/filesystem/ciRequiredLanes.test.ts tests/boundary/filesystem/ciQualification.test.ts tests/boundary/filesystem/reverseToolsMutationConfig.test.ts tests/boundary/mcp/rizinExternalMutationLifecycleMcp.test.ts— 460 passed; the cleanup-cancellation test fails with completed-Evidence retention removednode scripts/verify/architecture-guards.mjs --shrink-baselines— baseline lowered, passednpm run check:fast— passednpx oxfmton changed files — cleanCompatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.