Skip to content

test(sdk): Go parity guards for spawn and tool constants (#1098) - #1099

Merged
samuv merged 1 commit into
sdk/38-tool-refusalfrom
sdk/39-parity
Sep 7, 2026
Merged

samuv merged 1 commit into
sdk/38-tool-refusalfrom
sdk/39-parity

Conversation

@samuv

@samuv samuv commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Scenario 9 of the TypeScript SDK local-daemon milestone needs compile-time-adjacent guards for constants shared across the Node client and Go server. This PR implements ADR 0292 parity checks without changing the server, protocol, or engine:

  • source-parse the SDK ready document, spawn argv, callback-tool bounds, and MCP spec manifests from root-module Go tests
  • compare those manifests bidirectionally with the Go ready document and protobuf fields where applicable
  • guard the feature identifier, server-name grammar and bounds, output cap, serve flags, and socketpair lifetime-FD support

Closes #1098
Related: #821

Acceptance criteria

  • AC9.1: ready-document fields and schema match readyDoc and readyDocSchema in both directions
  • AC9.2: the callback-tool feature identifier matches server.FeatureMCPServersOnCreate
  • AC9.3: SDK MCP server fields match McpServerSpec protobuf fields
  • AC9.4: every SDK spawn argv flag is defined by mecated serve
  • AC9.5: all guards live in the root Go module and read SDK sources
  • AC9.6: server-name grammar, length, and count bounds match the Go implementation
  • AC9.7: the callback-tool output cap matches toolkit.MaxOutputBytes

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe): cross-language parity tests

Test plan

Required baseline

  • Linting (task lint)
  • Offline test suite (task test) — run twice; Scenario 9 and internal/adapter/server pass, while unrelated existing failures remain in cmd/mecatequi, internal/adapter/acp, and internal/app
  • Offline demo (go run ./cmd/mecademo) — not run under the Taskfile-only session constraint

Conditional checks

  • Markdown changed: documentation generation and checks (task docs)
  • User docs or user-facing behavior changed: user-docs site build (task site:build)
  • Guarded engine API surface affected: compatibility check (task api:check)
  • Intentional guarded engine API change: baselines regenerated (task api:update) and engine/CHANGELOG.md updated
  • Manual testing (describe below)

Additional automated verification:

  • task sdk:install sdk:lint sdk:typecheck sdk:test sdk:build sdk:pack sdk:api:check
  • task ac-trace — all seven Scenario 9 acceptance criteria resolve to the six exact Go proof names
  • 33 SDK test files and 179 SDK tests pass

Changes

File Change
internal/adapter/server/sdk_typescript_local_parity_test.go Adds the six root-module Go parity guards
sdk/typescript/src/spawn.ts Adds parseable ready-document and spawn-flag manifests
sdk/typescript/src/tool.ts Adds parseable MCP-field and server-name-rule manifests
sdk/typescript/src/tool-host.ts Delimits the output-cap parity constant

Does this introduce a user-facing change?

No.

Implementation plan

Approved implementation plan

Scenario 9 of docs/acceptance/sdk-typescript-local.md, governed by ADR 0292.

Special notes for reviewers

The spawn guard also pins checkLifetimePipeFD socketpair handling because Node and Bun supply the lifetime channel through stdio.

sdk/40-e2e stacks on sdk/39-parity.

@samuv samuv changed the title test(sdk): add local daemon parity guards test(sdk): Go parity guards for spawn and tool constants (#1098) Sep 4, 2026
@samuv samuv self-assigned this Sep 4, 2026
Co-Authored-By: OpenAI Codex <[email protected]>

Signed-off-by: Samuele Verzi <[email protected]>
@samuv
samuv merged commit 8fc4ad2 into main Sep 7, 2026
22 of 24 checks passed
@samuv
samuv deleted the sdk/39-parity branch September 7, 2026 08:10
@samuv samuv mentioned this pull request Sep 7, 2026
6 of 13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sdk/39: Go parity guards for spawn and tool constants

1 participant