Skip to content

sdk/40: offline spawn/tool e2e on Node and Bun #1111

Description

@samuv

Scenario 10 acceptance criteria:

  • AC10.1: On Node, spawn() starts a same-checkout mecated, a scripted turn calls mcp__sdk__lookup, the TypeScript handler runs, and its result reaches the model's next turn — the full round trip on real wire.
  • AC10.2: One named test exercises the spawn → tool round trip → clean shutdown path under Bun. Whether the whole suite runs on Bun in CI is a job-composition fact discharged by AC10.12, not by this test.
  • AC10.3: The spawned daemon opens no TCP port: the ready document reports unix transport with no http_address, and a real TCP connect to mecated's default --grpc-addr and default HTTP address, made while the daemon is up, is refused with ECONNREFUSED.
  • AC10.4: close() stops the daemon and removes the socket and runtime directory; the process is gone by the time close() resolves.
  • AC10.5: Killing the parent process without a clean close() stops the daemon through the lifetime pipe, on Node and on Bun.
  • AC10.6: query(prompt, { retainSession: true }) on the real wire leaves a session a later client can load, and the default query() leaves none.
  • AC10.7: A startup failure on the real wire — an unresolvable binary and a binary given an argument mecated rejects — produces the typed error and the redacted stderr tail, with no orphan process.
  • AC10.8: A handler that throws on the real wire yields a generic model-facing error, and the run continues to its terminal rather than failing.
  • AC10.9: A readOnly: true tool is dispatched in the harness's concurrent read batch — two calls in one turn overlap in flight, where a mutating tool is dispatched alone. readOnlyHint steers dispatch, not permissions, so a read-only callback still raises an ask; both halves run the same default posture so the assertion isolates the readOnly assertion itself.
  • AC10.10: A default (mutating) tool raises a permission.ask; an onPermissionAsk responder allowing it lets the call reach the handler, and a responder-less query() denies it while the run still reaches its terminal.
  • AC10.11: The MCP handshake is completed by the real pinned Go client against the hand-written host on the wire — version negotiation included — so a protocol revision that changes it fails this suite rather than a user's first tool call.
  • AC10.12: The sdk CI job runs the new unit suites and these e2e suites on Node, and the Bun leg either runs or is explicitly recorded as deferred with its reason.
  • AC10.13: A callback tool reached through the default --authority-evaluator local is denied by the capability-set evaluator, with the run still reaching its terminal. This pins the known limitation recorded under "Deferred decisions and known risks" so the eventual RootAuthority widening has a failing test to flip rather than a silent behaviour change.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions