Repository navigation
Add CLI/MCP contract coverage - #64
Merged
Merged
Conversation
added 2 commits
June 7, 2026 21:24
Add cross-surface contract tests for focus, template metadata, query execution, and shared error semantics so drift between the CLI and MCP adapters fails in CI. Update template info output and document the contract-testing rule for new shared capabilities.
Apply Black formatting to the new CLI/MCP contract test file so the lint and format CI job passes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
This PR adds a CLI/MCP semantic contract test suite so future changes to shared snapshot capabilities fail in CI when the two adapters drift apart.
The goal is to make
pt-snapCLI andpt-snap-mcpcontinue to represent the same underlying behavior as the shared API/core layer evolves, especially around focus handling, template metadata, query execution, and shared error cases.🔗 Related Issue
Fixes #61
Why this change
The project already moved core behavior into shared services, but that alone does not prevent adapter drift:
This PR adds CI-visible contract checks so that kind of drift fails early.
What changed
tests/test_contract_cli_mcp.pypt-snap query --template-infooutput to include:CategoryDevicesso CLI metadata now exposes the same shared fields already available through the API/MCP path.
README.md🧪 Testing
Verification run locally in the issue worktree:
conda run -n cc ruff check .conda run -n cc pytest→292 passed✅ Checklist
📸 Screenshots (if applicable)
📋 Additional Notes
The contract tests intentionally normalize CLI text output before comparing it with MCP results, so the suite checks semantic parity rather than raw formatting identity.