Commit f0aa9d3
authored
AGENTS: document cargo-mutants as a periodic package-owner tool (#298)
## Summary
Add a rust-style entry covering `cargo-mutants` as a package-owner
audit, not a CI gate. Lands next to the `cargo-careful` paragraph so the
two behavior-validation tools sit together. Source fragment edited in
`agents-md/sections/06-rust-style.md`; `AGENTS.md` and `CLAUDE.md`
regenerated via `nix run .#agents-md -- --write`.
## Trial results
Ran on `code-tokenizer` (37 tests, all-pure tokenizer, no async, no
FFI):
```sh
nix shell nixpkgs#cargo-mutants -c cargo mutants --package code-tokenizer --in-place --no-shuffle
```
31 mutants tested in 2 min: 19 caught, 3 timeouts (also caught), 6
unviable (compile errors), **3 missed**. The three survivors are real
gaps:
- `packages/code-tokenizer/src/lib.rs:113` `self.position += 1` → `*= 1`
(EOF early-return).
- `packages/code-tokenizer/src/lib.rs:144` `self.position += 1` → `*= 1`
(normal token-boundary return).
- `packages/code-tokenizer/src/lib.rs:140` `current_offset +=
ch.len_utf8()` → `*=` (separator branch).
`packages/code-tokenizer/src/tests/helpers.rs` only collects
`token.text`, so `Token::position`, `offset_from`, and `offset_to` are
never asserted. Tracked separately in #297 so this PR stays focused on
the trial decision.
## Recommendation
Keep cargo-mutants a periodic package-owner tool rather than a CI gate:
- Runtime scales linearly with mutant count; even 31 mutants on a tiny
pure crate ran 2 min, the same workload across the workspace would
dominate CI.
- Equivalent mutants need human judgment: the survivor on line 113 is
reachable but inert for any caller that ignores `Token::position`, which
is a real call-site question, not a binary pass/fail.
- A surviving mutant is a prompt to look, not a regression to block. CI
gating would push the team toward writing assertions just to kill
mutants instead of asking whether the behavior is worth pinning.
## Test plan
- [x] `nix run .#lint`
- [x] `nix run .#agents-md -- --write` produces no further diff
- [x] cargo-mutants trial captured above
Closes #252
Refs #2971 parent 0bccf43 commit f0aa9d3
3 files changed
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
307 | 318 | | |
308 | 319 | | |
309 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
307 | 318 | | |
308 | 319 | | |
309 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
0 commit comments