Repository navigation
test(devtools): mutation campaign coverage discipline (#1304) - #1413
Conversation
Closes #1304. Wire freshness accountability around the existing mutation-campaign catalog so registered campaigns can be tracked without depending on agents remembering to run them. - New devtools verify-mutation-freshness lint reads docs/plans/campaign-coverage.yaml and reports campaigns whose newest artifact under .local/mutation-campaigns/<name>/*.json is older than freshness_days (default 60) or missing entirely. Soft by default so the standard devtools verify baseline can include it without gating on local mutation-run cadence; --strict turns missing/stale into a hard fail and is wired into devtools verify --lab plus is intended for nightly jobs. - Surfaces orphan artifact directories whose name no longer appears in the manifest so the .local/ tree and registry can't silently drift apart. - devtools mutmut-campaign run now defaults the JSON/Markdown output to the timestamped per-campaign layout when --json-out/--markdown-out are unset, so freshness lint and status readouts always have something to discover. Explicit flags still override. - New devtools mutmut-campaign status subcommand renders the per- campaign state/age/freshness budget/kill rate table by reusing the freshness assess helper. - verify-manifests gains a default artifact_glob for mutation_campaigns matching the new layout, so declared freshness_days no longer requires an explicit artifact_glob. Verification: - nix develop -c pytest tests/unit/devtools/test_verify_mutation_freshness.py -> 11 passed - nix develop -c devtools verify-mutation-freshness -> 19 missing, exit 0 - nix develop -c devtools verify-mutation-freshness --strict -> exit 1 - nix develop -c devtools verify-manifests -> manifest checks passed - nix develop -c mypy devtools/verify_mutation_freshness.py devtools/mutmut_campaign.py tests/unit/devtools/test_verify_mutation_freshness.py -> no issues Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThis PR implements mutation campaign freshness verification infrastructure that enforces mutation kill threshold accountability. It adds a ChangesMutation campaign freshness verification
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90381f3863
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Closes #1304. Adds freshness accountability around the existing
mutation-campaign catalog so registered campaigns can be tracked
without depending on agents remembering to run them.
Problem
.local/mutation-campaigns/does not exist onmaster(no committedcampaign artifacts).
docs/plans/campaign-coverage.yamlregisters 19campaigns but nothing detects when a registered campaign has not
been run in N days.
The infrastructure exists; the accountability surface was missing.
Solution
devtools verify-mutation-freshness(devtools/verify_mutation_freshness.py):Reads
docs/plans/campaign-coverage.yaml, walks each active mutationcampaign, and reports campaigns whose newest artifact at
.local/mutation-campaigns/<name>/*.jsonis older than thecampaign's
freshness_daysbudget (default 60). Three states:fresh,stale,missing. Also surfaces orphan artifact directorieswhose name no longer appears in the manifest, so the local tree and
registry can't silently drift apart. Soft by default (always exit 0)
so the standard
devtools verifybaseline can include it withoutgating on local mutation-run cadence;
--strictturnsmissing/stale into a hard fail and is intended for nightly jobs and
devtools verify --lab.devtools mutmut-campaign status(devtools/mutmut_campaign.py):New subcommand renders the per-campaign state/age/budget/kill-rate
table by reusing the same freshness
assess_campaignhelper.devtools mutmut-campaign runnow writesto
.local/mutation-campaigns/<name>/<timestamp>.{json,md}when--json-out/--markdown-outare unset. Explicit flags stilloverride. This guarantees the freshness lint and the status command
always have something to discover.
verify-manifestsnow defines a defaultartifact_globformutation_campaignsmatching the new layout, mirroring the existingdefault for
benchmark_campaigns. Declaredfreshness_daysnolonger requires an explicit
artifact_glob.devtools verifyas a soft step (betweenverify-test-clock-hygieneandverification-impact check) and intodevtools verify --labas a hard--strictstep.assess_campaignfor the four states, orphandetection, soft vs strict
main(), the committed manifest, theinitial-registry coverage AC from test(devtools): mutation campaign coverage discipline — track per-module mutmut campaigns #1304, and the default artifact
layout.
Acceptance criteria mapping:
docs/plans/campaign-coverage.yamlis the registry;freshness_daysschema field already declared in
CampaignCoverageManifest(default 60 applied by the lint when entries omit it).
verify-mutation-freshnesslint that fails if not run in N days:--strictmode does this; soft mode reports as warnings.mutmut-campaign runwrites structured artifact: existingrunner already emits a complete
CampaignResultJSON; new defaultartifact path locates it under
.local/mutation-campaigns/<name>/.mutmut-campaign statusshows per-module last-run + kill rate+ threshold check: new subcommand.
19; test asserts the 10 named seed modules are present.
this PR lands is the prerequisite; a follow-up PR can add the
GitHub Actions workflow that runs
devtools mutmut-campaign runon a rotating campaign and pushes the artifact. Tracked under
test(devtools): mutation campaign coverage discipline — track per-module mutmut campaigns #1304 follow-up; not a hidden TODO.
Verification
Summary by CodeRabbit
New Features
verify-mutation-freshnessdeveloper command that checks mutation campaign artifact freshness against a coverage manifest with soft (warnings) and strict (error) modes, supporting JSON or human-readable output.Documentation
Tests