Repository navigation
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. |
[Medium impact] The reviewed changes appear safe to merge; no new blocking issue was found. SummaryMoves objdump, Rizin commands, and the ten desktop build tools into the shared binding table.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Shared binding table"] --> B["inspect_with_objdump"]
B --> C["Analysis admission and Evidence delivery"]
A --> D["execute_rizin_command"]
D --> E["prepareRizinCommand"]
E -->|Refused| F["Return error without retiring target"]
E -->|Ready| G["External-mutation admission"]
G --> H["Clear snapshot, run command, retire target"]
H --> I["Deliver Evidence or partial error"]
A --> J["Desktop build tools"]
J --> K["Parse input and run existing workflow"]
K --> L["Deliver value and forwarded content"]
L --> M["Redact returned text and structured content"]
Reviews (2) · Last reviewed commit: "refactor(mcp): bind the desktop build to..." · Reviewed by Greptile |
a1c89a2 to
d86456b
Compare
1e170dc to
5f9f252
Compare
c90ca83 to
5f0003b
Compare
|
Issue 1 (moved checks lose mutation coverage) is fixed in 3365272, and #11658 (desktop build) is collapsed into this branch; details in the resolved thread. @greptileai review |
986be5a
into
refactor/bind-provider-operation-tools
) * refactor(mcp): bind provider operations through the shared table * fix(mcp): bind a provider operation only to the contract of the same name * refactor(mcp): bind objdump and Rizin commands through the shared table (#11653) * refactor(mcp): bind objdump and Rizin commands through the shared table * test(rizin): keep the pre-admission Rizin checks under the mutation sweep * refactor(mcp): bind the desktop build tools through the shared table
…shared table (#11647) * refactor(mcp): bind close_binary and reset_investigation through the shared table * refactor(mcp): bind provider operations through the shared table (#11649) * refactor(mcp): bind provider operations through the shared table * fix(mcp): bind a provider operation only to the contract of the same name * refactor(mcp): bind objdump and Rizin commands through the shared table (#11653) * refactor(mcp): bind objdump and Rizin commands through the shared table * test(rizin): keep the pre-admission Rizin checks under the mutation sweep * refactor(mcp): bind the desktop build tools through the shared table
Summary
Binds
inspect_with_objdumpandexecute_rizin_commandthrough the shared binding table and deletesregisterReverseEngineeringTools.ts. The Rizin command runs on the external-mutation kind already used by the debuggers, with a newpreparestep that validates the request and settles inspection cleanup before admission. Stacked on #11649. Refs #10583.Problem and expected behavior
The reverse-engineering registration re-implemented external-mutation admission, the retirement-failure mapping and partial-error delivery that
externalMutationToolHandleralready owns for Rizin debug, GDB and Cutter, and also calledinvalidateSnapshotForExternalMutationinside an admission that already invalidates the snapshot itself (BinarySession.withAdmittedExternalMutation). Expected: one owner for external-mutation commands; a malformed request or a still-failing inspection cleanup is refused before admission, so the bound target stays open, as today.Change and scope
src/server/externalMutationToolHandler.ts: theevidencekind takes eitherrunorprepare(input) → Result<EvidenceCommand>; apreparerefusal is delivered without entering admission.src/server/serviceToolBindings.ts:reverseEngineeringgroup.inspect_with_objdumpis arunbinding (analysis admission, shared recording/partial delivery).execute_rizin_commandismutation: { kind: "evidence", prepare, retryCleanup }:prepareresolves the request withresolveRizinCommandRequestand retries the service's inspection cleanup; the command runsexecuteRizinCommandValidated.BinarySessionPort.invalidateSnapshotForExternalMutation(its only caller; the session invalidates the snapshot inside the same admission before the command runs).scripts/ci/scopes.mjs,vitest.reverse-tools.config.ts,tsconfig.reverse-tools-mutation.json,stryker.config.mjs) point atexternalMutationToolHandler.tsinstead of the deleted file.tests/support/reverseEngineeringMcpHarness.tsregisters through the table;reverseEngineeringPartialMcp.test.tscall sites use it. The two tests that asserted the adapter's own snapshot invalidation (with a fake admission, and the "legacy" no-session path production never composes) are replaced by: admission before dispatch; a still-failing inspection cleanup refuses before admission; malformed input never enters admission. The symlink test uses the realBinarySessionand still checks that the target is retired and must be reopened.bespoke-mcp-tool-registration: 10 → 8 sites; with refactor(mcp): bind layout, browser scenario, runtime observation, guided workflow and native matching tools through the shared table #11646–refactor(mcp): bind provider operations through the shared table #11649 and this PR, only desktop build (2) and Electron (6) remain.Includes #11658 (collapsed here): the ten desktop build tools bind through the table (
ForwardedValueoutcome,presentResultwhole-response redaction), so the guard lists only Electron (6 sites). Not included: Electron (D7).Review fix:
prepareis now the namedprepareRizinCommand, selected as its own Stryker target and included in the reverse-tools coverage and mutation tsconfig. Removing either pre-admission check failsrefuses a Rizin command before admission while inspection cleanup still fails/refuses malformed Rizin input before admission(checked by hand).Contract and boundary impact
BinarySession/externalMutationAdmission.ts.Visible differences: when the active analysis cannot be retired after a successful Rizin command, the message is the shared one ("The external command may have changed the bound artifact, but the active analysis session could not be retired.") instead of naming Rizin; the error code and details are unchanged. A malformed Rizin request is refused immediately rather than after waiting for an in-flight open/close transition. Without a session, the inspection cleanup retry also runs before the command (the command already retried it itself).
Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
runOwned).For evidence-bearing changes:
Validation performed
npm run test:focused -- tests/boundary/mcp/reverseEngineeringPartialMcp.test.ts tests/boundary/mcp/commandObservationViews.test.ts tests/boundary/mcp/reverseEngineeringProviderEnvironmentMcp.test.ts tests/boundary/mcp/reverseEngineeringEnvironmentMcp.test.ts tests/boundary/mcp/capabilityRemediationMcp.test.ts tests/boundary/mcp/workflowSnapshotReplayMcp.test.ts tests/acceptance/rizinCommandRejection.test.ts tests/acceptance/rizinCommandOutcomes.test.ts tests/boundary/mcp/debuggerExternalMutationLifecycleMcp.test.ts tests/boundary/mcp/toolSchemaValidity.test.ts— 1 failed first (a fake service lackedretryCleanup, whichpreparenow calls on the no-session path; fixture updated), then passednpm run test:focused -- tests/composition/reverseEngineering.test.ts tests/composition/reverseEngineeringAdmission.test.ts tests/composition/reverseEngineeringEdgeCases.test.ts tests/composition/reverseEngineeringCancellation.test.ts tests/composition/analysis-sessions/binarySession.test.ts— 167 passednpm run test:focused -- tests/boundary/filesystem/ciChangeScope.test.ts tests/boundary/filesystem/reverseToolsMutationConfig.test.ts— 413 passed (after repointing the reverse-tools configs)npm run test:focused -- tests/boundary/filesystem/ciChangeScope.test.ts tests/boundary/filesystem/reverseToolsMutationConfig.test.ts tests/boundary/mcp/reverseEngineeringPartialMcp.test.ts— 428 passed after the review fix; with bothprepareRizinCommandchecks removed by hand, the two pre-admission refusal tests failednpm run test:focused --the eighttests/boundary/mcp/build*Mcp.test.ts/compactInputSchemaMcp.test.tsfiles — 125 passednpm run check:fast— passed;npx oxfmt --check .— passed; architecture guards with--shrink-baselines— lowered to Electron only, passedCompatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.