docs(mutmut): document why the mutation gate covers only retry.py#107
Merged
Merged
Conversation
The [tool.mutmut] policy declares 7 security-critical serving modules as mutation targets (enforced by test_mutmut_policy.py), but the CI gate (scripts/mutation_report.py) mutates only the duckdb-free retry.py. Those serving modules transitively import duckdb, whose compiled subpackage (_duckdb._sqltypes) fails to import inside mutmut's mutants/ workspace and crashes the run with every mutant left "not checked" -- reproduced in a Linux container, so it is a mutmut x duckdb harness limitation, not platform-specific. Make this gap explicit at the three places a reader meets it (the pyproject policy list, the runner's MODULE_TARGETS, and the policy test) so declared coverage is not mistaken for live mutation coverage. Comments only; no logic change. Extending the gate to serving modules needs isolated mutant execution (subprocess/spawn) or a different mutation tool. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
DORA Metrics
|
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.
What
Document why the mutation-testing gate only mutates
sdk/agentflow/retry.py, despite[tool.mutmut]declaring 7 security-critical serving modules as targets.Why
tests/unit/test_mutmut_policy.pyenforces that 7 security-critical modules (sql_guard, authmanager/key_rotation,masking,rate_limiter,nl_queries,sql_builder) are declared mutation targets. But the CI gate (scripts/mutation_report.py) drives mutation from its ownMODULE_TARGETS, which contains onlyretry.py. The declared serving modules are never mutated — and cannot be: they all transitively import duckdb, and duckdb's compiled subpackage_duckdb._sqltypesfails to import inside mutmut'smutants/workspace ('_duckdb' is not a package), crashing the run with every mutant leftnot checked.Reproduced in a Linux container (
python:3.11), so this is a mutmut × duckdb harness limitation, not platform-specific.retry.pyworks precisely because it is duckdb-free; duckdb itself imports fine under normal pytest (the full suite passes) — only mutmut's workspace breaks it.Without this note, the policy test reads as if the security modules are mutation-covered when they are not (false assurance).
Change
Comments only, at the three places a reader meets the claim —
pyproject.toml [tool.mutmut], the runner'sMODULE_TARGETS, andtest_mutmut_policy.py. No logic change.Verification
ruff check+ruff format --check: cleanpytest tests/unit/test_mutmut_policy.py tests/unit/test_mutation_report.py: 5 passedFollow-up (not in this PR)
Extending the gate to serving modules needs isolated mutant execution (subprocess/spawn) or a different mutation tool (e.g. cosmic-ray / mutatest) — a separate, CI-affecting decision.
🤖 Generated with Claude Code