fix(protocol): make tool contract assertions reviewable - #259
Conversation
Coverage: 96.01% lines, 91.95% branches
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
🟢 Approval recommended
The changes are confined to test assertions, improve reviewability of the contract checks, and align with the stated intent without introducing behavioral risk.
Pull request overview
This PR updates the MCP integration tests to replace opaque whole-object SHA-256 “frozen” assertions with explicit, reviewable structural contract snapshots for tool schemas, while preserving strict served-vs-source equality checks for full and lite tool catalogs.
Changes:
- Replace SHA-256 structural digest assertions with explicit per-tool structural snapshots (including required fields, property order, types, bounds, enums, defaults).
- Add a regression assertion proving that description-only wording changes do not affect the structural snapshot contract.
- Extend snapshots to include explicit
propertyOrderassertions for schema properties.
File summaries
| File | Description |
|---|---|
| tests/integration/mcp-handlers.test.ts | Reworks tool contract assertions from SHA digests to explicit structural snapshots, adding propertyOrder and a description-only invariance regression. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Replaces the opaque whole-definition SHA-256 assertions with reviewable structural contract assertions. Exact served-versus-source equality remains for full and Lite tool catalogs, explicit snapshots retain names, annotations, required fields, property order, types, bounds, enums, and defaults, and a focused regression proves description-only wording changes are structurally inert. Verification: targeted MCP handler suite 51/51; full coverage suite 765/765 at 96.01% lines and 91.95% branches; lint and build passed; no-live built E2E 23/23; git diff --check passed.