Skip to content

Contract/CI gates for the MCP tool surface and reform-input validation#42

Merged
vahid-ahmadi merged 1 commit into
mainfrom
ci-tool-surface-contract
Jul 19, 2026
Merged

Contract/CI gates for the MCP tool surface and reform-input validation#42
vahid-ahmadi merged 1 commit into
mainfrom
ci-tool-surface-contract

Conversation

@vahid-ahmadi

Copy link
Copy Markdown
Contributor

What CI covered before

  • test-integration.yml — fast suite on PR/push to integration/**.
  • deploy-mcp.yml — deploy + remote smoke test.
  • validate-deployment.yml — daily + post-deploy live correctness; slow legs only on manual deep dispatch.
  • contract.yml — nightly upstream contracts. Failing since CI hygiene: job timeouts + action version bumps #36 (see below).

Gap: the tool surface was only ever checked as a subset (EXPECTED_TOOLS <= names), and the in-process check sat in a slow-marked test that PR CI skips. A tool added, removed or renamed shipped with a green pipeline.

Added

  • tests/tool_surface.py — golden list of the 10 published tool names, shared by the in-process, stdio and live tests.
  • tests/test_tool_surface.py — exact names, exact count, no duplicates, per-tool description/schema, and a guard that country/people stay schema-optional (Actionable reform-input validation for the MCP/CLI tools #38 regression).
  • Subset checks in test_remote_mcp.py / test_mcp_server.py upgraded to exact equality.
  • Reform-input validation (Actionable reform-input validation for the MCP/CLI tools #38) asserted as served: date-range rejection, missing country, empty reform, plus a valid dated reform that must be accepted and score correctly.
  • test-integration.yml: both suites wired as named hard gates.
  • validate-deployment.yml: weekly Sunday deep cron for the slow investment-closure / OBR-bridge legs.

Genuine failure found

contract.yml pinned astral-sh/setup-uv@v8, but that action publishes no moving v8 major tag (latest is v8.3.2). The nightly contract job has been dying in ~5s at "Set up job" since the action bump in #36 — e.g. run 29676226032. Pinned to v8.3.2.

Verification

Fast suite green, and the full live remote suite run against the deployed Modal server: 14 passed, 2 skipped (slow). No assertions loosened or tests skipped.

🤖 Generated with Claude Code

The hosted tool surface was only ever checked as a SUBSET
(`EXPECTED_TOOLS <= names`), and the in-process check lived in a
slow-marked test that PR CI skips entirely. Adding, removing or renaming
a tool could therefore ship to clients with a fully green pipeline.

- tests/tool_surface.py: single golden list of the 10 published tool
  names, shared by the in-process, stdio and live-deployment tests, with
  an assert_surface() helper that reports added/removed names.
- tests/test_tool_surface.py: fast, PolicyEngine-free contract on exact
  names, exact count, no duplicates, per-tool description/schema, plus a
  regression guard that country/people stay schema-optional (#38).
- test_remote_mcp.py / test_mcp_server.py: subset checks upgraded to
  exact-surface equality against the same golden list.
- test_remote_mcp.py: reform-input validation (#38) now asserted AS
  SERVED — date-range rejection, missing country, empty reform, and a
  valid dated reform that must be accepted and score correctly.
- test-integration.yml: the tool-surface and reform-input suites run as
  named hard gates before the general suite.
- validate-deployment.yml: weekly Sunday deep run so the slow
  investment-closure and OBR bridge legs are exercised on a schedule
  instead of only on a manual dispatch.

Also fixes a genuinely broken job: contract.yml pinned
astral-sh/setup-uv@v8, but that action publishes no moving `v8` tag, so
the nightly contract run had been failing in ~5s at "Set up job" since
the action bump in #36. Pinned to v8.3.2.

Verified: fast suite and the full live remote suite (14 passed) run
locally against the deployed server.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
macromod Ready Ready Preview, Comment Jul 19, 2026 9:37am

Request Review

@vahid-ahmadi
vahid-ahmadi merged commit c86a8ce into main Jul 19, 2026
3 checks passed
@vahid-ahmadi
vahid-ahmadi deleted the ci-tool-surface-contract branch July 19, 2026 09:48
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.

1 participant