Skip to content

refactor(mcp): bind session record tools through the shared table - #11625

Merged
morluto merged 1 commit into
refactor/bind-frida-toolsfrom
refactor/bind-session-records
Nov 16, 2026
Merged

morluto merged 1 commit into
refactor/bind-frida-toolsfrom
refactor/bind-session-records

Conversation

@morluto

@morluto morluto commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Summary

Binds the seven session record tools (export_evidence_bundle, import_evidence_bundle, get_evidence_bundle, list_unknowns, record_unknown, update_unknown, verify_unknown_resolution) through the shared binding table as session-admitted value bindings, instead of seven hand-written registerTool handlers. Stacked on #11622.

Problem and expected behavior

registerSessionRecordTools.ts repeated session admission and delivery per tool, and two tools passed an overflow receipt (the committed unknown's id, revision and mutation Evidence) that the value binding could not express. Expected: the table binds them with admitted: true under session admission, and a value binding can return a committed record with its receipt.

Change and scope

  • src/server/contractToolHandler.ts: CommittedValue (a value plus the receipt an overflowing response names); the value handler delivers it with that receipt.
  • src/server/serviceToolBindings.ts: sessionRecords group ({ session, resources }); committedUnknown builds the receipt from the session's committed unknown.
  • src/server/registerSessionTools.ts: registers sessionRecords beside sessionDerived with session admission (withAdmittedAnalysis({ kind: "session", session }), as each handler built before).
  • Removed src/server/registerSessionRecordTools.ts; baseline 7 sites removed.

Behavior visible to MCP clients: these tools are now logged like the other bound tools; results, errors and receipts are unchanged.

Not included: the remaining lifecycle/process tools in registerSessionTools.ts (next PR).

Contract and boundary impact

  • Semantic owner and earliest changed stage: MCP registration of session record tools.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: schemas unchanged; CLI unchanged.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): bundle file reads and writes keep the server's artifact resource scope; import cancellation after the read still leaves the session unchanged.
  • Generated metadata (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.

  • 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

  • evidenceImportCancellation.test.ts: its two cancellation cases observed the failure through a spy on toCallToolResult; value failures go through the shared partial-error delivery since refactor(mcp): bind Frida discovery and session tools through the shared table #11621, so the spies now observe toPartialErrorToolResult. Assertions on the error (cancelled, exact reason, session unchanged, retry succeeds) are unchanged.
  • serverUnknownsMcp.test.ts covers the committed-unknown receipt on overflow; unknown, bundle, overflow, lifecycle and HTTP suites run unchanged.
  • Remaining proof gaps: none known beyond the suites listed.

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 -- tests/boundary/mcp/serverUnknownsMcp.test.ts tests/boundary/mcp/oversizedErrorDeliveryMcp.test.ts tests/boundary/mcp/contextEvidenceOverflow.test.ts tests/boundary/mcp/evidenceImportCancellation.test.ts tests/boundary/mcp/investigationLifecycleMcp.test.ts tests/boundary/mcp/resetArtifactCleanupMcp.test.ts tests/boundary/mcp/errorEvidenceLifecycleMcp.test.ts tests/boundary/mcp/toolErrorSchemaDelivery.test.ts tests/boundary/mcp/evidenceBundleInline.test.ts tests/boundary/mcp/streamableHttpMcp.test.ts — 2 failed in evidenceImportCancellation (spy on the old delivery method), 46 passed; after the spy update evidenceImportCancellation 4 passed
  • npm run test:focused -- tests/boundary/mcp/processCleanupRetryMcp.test.ts tests/boundary/mcp/kunaCloseRetryMcp.test.ts tests/boundary/mcp/bundleComparisonCancellation.test.ts tests/process-global/processSnapshotCleanupMcp.test.ts tests/boundary/mcp/javascriptRuntimeObservationMcp.test.ts tests/boundary/mcp/analysisViewMcp.test.ts tests/boundary/mcp/artifactMcp.test.ts — 60 passed
  • node scripts/verify/architecture-guards.mjs --shrink-baselines — baseline lowered, passed
  • npm run check:fast — passed
  • npx oxfmt on changed files — clean

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

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 changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@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-16T00:27:26.944764Z
We couldn’t complete this review. Comment @codex review to try again.
c5e221d 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.

Base automatically changed from refactor/bind-browser-tools to refactor/bind-frida-tools November 16, 2026 00:27
@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 code appears safe to merge; no actionable issues were found.

Summary

Moves seven session record tools into the shared binding table. Adds CommittedValue so overflow errors can name committed unknown revisions and their Evidence.

  • Session record tools now run through the shared MCP binding table.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Session record tool] --> B[Shared binding table]
  B --> C[Session admission]
  C --> D[Run and log operation]
  D --> E{Result}
  E -->|Plain value| F[Contract delivery]
  E -->|CommittedValue| G[Unwrap value and receipt]
  G --> F
  E -->|Failure| H[Shared error delivery]
  F --> I{Fits response budget?}
  I -->|Yes| J[Return value]
  I -->|No| K[Return overflow error with receipt]
Loading

Reviews (1) · Last reviewed commit: "refactor(mcp): bind session record tools..." · Reviewed by Greptile

@morluto
morluto force-pushed the refactor/bind-frida-tools branch from 55906a7 to b939d38 Compare November 16, 2026 00:41
@morluto
morluto force-pushed the refactor/bind-session-records branch from c5e221d to a50e418 Compare November 16, 2026 00:41
@morluto
morluto merged commit e1639f1 into refactor/bind-frida-tools Nov 16, 2026
1 check passed
@morluto
morluto deleted the refactor/bind-session-records branch November 16, 2026 00:42
morluto added a commit that referenced this pull request Nov 16, 2026
…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
@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