Skip to content

Add manifest tool-list parity tests - #102

Open
IvanK-Nitro wants to merge 2 commits into
mainfrom
manifest-tools-parity-check
Open

Add manifest tool-list parity tests#102
IvanK-Nitro wants to merge 2 commits into
mainfrom
manifest-tools-parity-check

Conversation

@IvanK-Nitro

Copy link
Copy Markdown
Contributor

What

Adds tests that fail when the tools array in manifest.json drifts from the tools the server actually registers.

Why

The tools array is maintained by hand. mcpb pack copies the manifest through as-is rather than populating it from the running server, so the committed array is what anything reading the manifest (instead of calling tools/list) advertises.

Nothing verified the two agreed, and they had already drifted: a tool was registered at runtime but absent from the manifest. That was corrected by hand in #100, but the array is still hand-maintained, so the next tool added can reintroduce the same gap.

Coverage

Three ways the two can disagree, one test each:

  • a registered tool missing from the manifest (the drift that already happened)
  • a manifest entry for a tool the server no longer registers
  • a description edited in only one of the two places

Plus a whole-list equality check whose failure output prints the exact array to paste into manifest.json.

Verified the tests actually fail, not just pass — reproduced both real-world failure modes against a modified manifest:

Simulated drift Result
removed a tool from the manifest 2 tests fail, naming the missing tool
truncated one description 2 tests fail, naming the affected tool

Design note

This is a test rather than a build-time generator, deliberately. Generating the array during task build would put it on the release path, where a generator bug ships silently — a test fails in CI on the PR that introduces the drift instead. Keeping the array committed also means clients that read the manifest get the full list rather than having to generate one.

Also

Extracts the in-memory client setup duplicated from annotations.test.ts into tests/helpers/client.ts, now shared by both suites. No behaviour change there.

Testing

task check (format/types/lint) and task test pass — 191 passed, 1 pre-existing skip (+4 new tests). No production code touched.

🤖 Generated with Claude Code

Ivan Kalgashkin and others added 2 commits July 29, 2026 14:32
The `tools` array in manifest.json is maintained by hand -- `mcpb pack` copies
the manifest through as-is rather than populating it from the running server.
Nothing verified the two agreed, and they had already drifted once: a tool was
registered but missing from the manifest, so anything reading the manifest
rather than calling tools/list advertised an incomplete list.

Adds tests that fail when the committed array diverges from what the server
registers, covering the three ways they can disagree: a registered tool missing
from the manifest, a manifest entry for a tool that no longer exists, and a
description edited in only one place. On failure the last test prints the exact
array to paste back into manifest.json.

Deliberately a test rather than a build-time generator. Generating the array
during `task build` would put it on the release path, where a bug in the
generator ships silently; a test fails in CI on the PR that causes the drift.
Keeping the array committed also means clients that read the manifest get the
full list without having to generate one.

Extracts the in-memory client setup from annotations.test.ts into
tests/helpers/client.ts, now shared by both suites.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CLAUDE.md already required keeping manifest.json's tools array in sync; point
at the test that now checks it, so a failure is recognised as that rule rather
than an unrelated breakage.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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