feat: add MCP corruption corpus coverage artifact#197
Merged
ProfRandom92 merged 4 commits intoMay 21, 2026
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a system for generating and verifying MCP corruption coverage artifacts, including a generation script, the resulting coverage JSON, and a comprehensive test suite. The reviewer provided feedback to improve the robustness of JSON parsing by handling null values and validating item types, suggested removing redundant sorting logic in evidence key collection, and recommended using idiomatic pytest fixtures for mocking instead of subprocess calls.
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.
Motivation
ContractValidator.Description
scripts/generate_mcp_corruption_coverage_artifact.pywhich loadsartifacts/mcp_trace_corruption_manifest.json, source originals, materialized corruptions, and original contracts, then runsContractValidatorto compute observed failure labels and per-entry native coverage and evidence, failing on missing files, unregistered labels, malformed entries, or adapter gaps.artifacts/mcp_corruption_coverage.json(sorted keys,indent=2, no timestamps, repository-relative paths) that contains top-level metadata, coverage summary, operator/family/label distributions, and per-entry deterministic evidence.tests/test_mcp_corruption_coverage_artifact.pythat assert committed artifact equals regenerated output, generation stability, exact summary/distribution counts, per-entry coverage invariants, taxonomy registration, no absolute paths/timestamps, and generator failure on missing expected labels.Testing
scripts/generate_mcp_corruption_coverage_artifact.py,artifacts/mcp_corruption_coverage.json,tests/test_mcp_corruption_coverage_artifact.py.python scripts/generate_mcp_corruption_coverage_artifact.pywhich completed and wroteartifacts/mcp_corruption_coverage.json(pass).pytest -q tests/test_mcp_corruption_coverage_artifact.py(6 passed).pytest -q tests/test_mcp_trace_corruption_validation.py(6 passed),pytest -q tests/test_mcp_trace_corruption_manifest.py tests/test_mcp_trace_corruption_materialization.py(combined pass), andpytest -q tests/test_contract_validator.py(19 passed).npm run checkwhich executed the python and dashboard checks andpytestsuite and completed successfully (321 passed).Codex Task