Skip to content

test(mcp): check whole replies against canonical output contracts at the remaining held listed definitions - #11182

Merged
morluto merged 3 commits into
mainfrom
test/canonical-output-held-definitions
Nov 15, 2026
Merged

morluto merged 3 commits into
mainfrom
test/canonical-output-held-definitions

Conversation

@morluto

@morluto morluto commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Follow-up to #10693 (W3). Retiring the full output profile left listed tool definitions without output schemas. Tests that held a listed definition and passed it to the SDK as toolDefinition therefore stopped checking complete replies. This PR attaches the canonical output schema at the 41 remaining sites (28 files) with withCanonicalOutputSchema, as docs/development/testing.md requires.

Refs #10389.

Problem and expected behavior

After #10693, tools/list omits output schemas by default (off), and compact bounds them. A test that does listTools() → find(name) → callTool(..., { toolDefinition }) now hands the SDK a definition with no outputSchema, so the SDK skips reply validation. parseEvidence still checks the Evidence envelope but accepts any normalized_result. Greptile flagged this on #10693 for nativeObservationViewsMcp.test.ts and nativeViewPredicateMcp.test.ts, and the same pattern appears across the boundary and acceptance tests.

Expected: every held REA tool definition passed to the SDK carries the canonical output contract.

Change and scope

Not changed (intentionally):

  • Definitions that come from advertisedMcpToolSchemas. That fixture already attaches the canonical schema.
  • environmentServeWritesMcp.test.ts. Its environment-served tools have no REA contract.
  • deferredRuntime, mcpDoctor and stdioFrameDiagnostics. They exercise the listing each output profile produces.
  • toolErrorSchemaDelivery.test.ts. It checks error delivery.
  • packageCatalogVerification.test.ts. Its forwarded-argument expectation compares what the verifier received.
  • No lint or architecture guard is added. Telling a listed definition apart from a canonical one needs data flow, not syntax. A follow-up could give tests a single held-definition helper instead.

Contract and boundary impact

  • Semantic owner and earliest changed stage: tests/fixtures/canonicalOutputSchema.ts owns the canonical reply contract for tests. Tests only.
  • Contribution scope fit and linked maintainer decision: within the approved W3 plan (test coverage the retirement in feat(mcp)!: retire the full schema profiles and declare schema facts as typed annotations #10693 requires).
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • 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

  • Tests updated: the 28 files above now validate every successful reply against the canonical output contract.
  • Base reproduction: not separately demonstrated. These are strength fixes; the current replies already conform.
  • Remaining proof gaps: javascriptRecoveryMcp.test.ts skipped locally (3 tests; it needs an optional local tool). Real providers were not run.

Validation performed

  • npm run check:fast: passed.
  • npm run test:focused over the 28 changed files in two batches: 15 passed and 1 skipped (124 tests passed, 3 skipped), then 12 passed (72 tests).
  • Pre-push hook (typecheck, lint, architecture guards): passed.

Review fix (d8286b3): nativeInstructionReferencesView.test.ts wraps the held definition once, so continuation pages also check the canonical output contract.

  • npm run test:focused -- tests/boundary/mcp/nativeInstructionReferencesView.test.ts: 2 tests passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none (tests only).
  • Real Hopper/Ghidra, browser, or OS coverage: not run.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none affected.

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.

…the remaining held listed definitions

Retiring the full output profile (#10693) left listed tool definitions without output schemas, so tests that handed one to the SDK as toolDefinition stopped validating complete replies. Attach the canonical output schema with withCanonicalOutputSchema at the 41 remaining sites in 28 files that hold a definition taken directly from tools/list.
@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-15T13:59:00.629676Z
We couldn’t complete this review. Comment @codex review to try again.
8106bb0 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.

@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 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: apex

[Low impact] The reviewed changes appear safe to merge; no blocking code issue remains.

Summary

Acceptance and boundary tests now attach canonical output schemas to held MCP definitions before calling the SDK.

  • MCP and CLI tests check complete replies against each tool’s canonical output contract.

Reviews (3) · Last reviewed commit: "Merge branch 'main' into test/canonical-..." · Reviewed by Greptile

@morluto
morluto merged commit a4a8734 into main Nov 15, 2026
15 checks passed
@morluto
morluto deleted the test/canonical-output-held-definitions branch November 15, 2026 20:00
@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