Repository navigation
refactor(mcp): bind close_binary and reset_investigation through the shared table - #11647
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. |
[High impact] The reviewed changes appear safe to merge; no blocking issue was found. SummaryMoves lifecycle tools, provider operations, reverse-engineering tools, and desktop build tools through the shared binding table.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Server composition] --> B[Shared service bindings]
B --> C[Named contract registration]
C --> D[Provider handler]
C --> E[External mutation handler]
C --> F[Value handler]
D --> G[Analysis admission]
E --> H[Session orders mutation and cleanup]
F --> I[Lifecycle or desktop operation]
G --> J[Evidence delivery]
H --> J
I --> K[Value delivery]
K --> L[Desktop result redaction when configured]
Reviews (7) · Last reviewed commit: "refactor(mcp): bind provider operations ..." · Reviewed by Greptile |
268fb29 to
770ae95
Compare
|
Rebased onto main (770ae95) after #11646 merged, to clear the merge conflict the gate reported; content unchanged. @greptileai review |
) * 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
close_binaryandreset_investigationthrough the shared service binding table as value bindings outside analysis admission, and deletesregisterCloseLifecycleTool.tsandregisterResetInvestigationTool.ts. Stacked on #11646. Refs #10583.Problem and expected behavior
The two session lifecycle tools registered by hand, each re-implementing logging and result delivery next to the cleanup composition they own. Expected: the bindings state the lifecycle calls; the shared value handler logs and delivers; the cleanup composition stays in one module.
Change and scope
src/server/registerCloseLifecycleTool.ts→src/server/sessionLifecycle.ts:closeWithProcessResources(session close + process-capture cleanup, unchanged composition and retry binding) andresetCleanupRetry(process + artifact cleanup a reset joins, moved from the reset file unchanged).CLOSE_RETRYexported.src/server/serviceToolBindings.ts:sessionLifecyclegroup.close_binarykeeps the ordering rule (the close is enqueued before progress transport is awaited, so a later open cannot overtake it), the progress start/end reports and the snapshot receipt.reset_investigationcallssession.resetInvestigationwith the same arguments.src/server/registerSessionTools.ts: lifecycle and status register in oneregisterServiceToolscall;LifecycleToolRegistrationis nowSessionStatusToolOptions & SessionLifecycleOptions(the unusedcloseContractis gone).bespoke-mcp-tool-registrationbaseline: 13 → 11 sites.tests/boundary/mcp/processCleanupRetryMcp.test.tscaptured the composed error by spying ontoCallToolResult; the value handler delivers errors throughtoPartialErrorToolResult(identical wire output without a session writer), so the spy moves there. Assertions unchanged.Not included:
registerEvidenceTools, reverse engineering, desktop build (next slices); Electron (D7).Contract and boundary impact
BinarySessionstill owns lifecycle ordering, checkpoint publication and cleanup retry.close_binary), same ordering.Visible difference: the shared value handler's log line now covers the whole close call (including progress reports) rather than only the close itself; reset calls are now logged.
Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
processCleanupRetryMcp.test.ts(spy seam only).close_binary(returned/thrown/synchronous session-close failure composed with the pending root, then retry), reset artifact cleanup, snapshot close and replay, selected snapshot cleanup, session availability recovery.For evidence-bearing changes:
Validation performed
npm run test:focused -- tests/boundary/mcp/sessionMcp.test.ts tests/boundary/mcp/processCleanupRetryMcp.test.ts tests/boundary/mcp/resetArtifactCleanupMcp.test.ts tests/boundary/mcp/investigationLifecycleMcp.test.ts tests/boundary/mcp/selectedSnapshotCleanupMcp.test.ts tests/boundary/mcp/sessionAvailabilityRecovery.test.ts tests/boundary/mcp/successEvidenceLifecycleMcp.test.ts tests/boundary/mcp/errorEvidenceLifecycleMcp.test.ts tests/boundary/mcp/toolSchemaValidity.test.ts— 3 failed inprocessCleanupRetryMcp(thetoCallToolResultspy saw no error); after moving the spy,processCleanupRetryMcp.test.ts4 passed; the other 8 files passednpm run test:focused -- tests/boundary/mcp/workflowSnapshotReplayMcp.test.ts tests/boundary/mcp/investigationAnalysisMcp.test.ts tests/boundary/mcp/providerSelectionMcp.test.ts tests/acceptance/nativeDispatchSnapshot.test.ts tests/boundary/mcp/absoluteLocalPathSchema.test.ts— 61 passednpm run check:fast— passed;npx oxfmton changed files; architecture guards with--shrink-baselines— lowered, passed; pre-push hook passedCompatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.