triage_test_coverage
Audit files and directories to rank them by mutation score, weakest first. Pinpoint fragile test coverage across your codebase in a single run.
Instructions
Batch triage: audit a set of files and/or directories and return a weakest-first ranked leaderboard of mutation scores, so you can see where the test suite is most fragile in one call. Directories are recursively expanded to supported source files (.ts/.js/.py/.rs/.php), skipping test files. Files are audited in parallel (see fileConcurrency, default min(4, cpus-1)), under a shared wall-clock budget (see totalTimeoutMs). Drill into a weak file with audit_code_resilience for per-mutant survivor detail: each row's file is relative to the server's working directory, so it can be passed straight back as that tool's filePath (its own target is spelled differently — see that tool's description).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paths | No | Files and/or directories to triage, resolved against the server's working directory. Directories are recursively expanded to supported source files. Each ranked row reports its `file` in that same spelling, so a row can be fed straight back to this tool or to audit_code_resilience. Example: ["src/utils", "src/index.ts"] | |
| diffBase | No | Auto-scope the triage to files changed in git. "HEAD" (uncommitted), "staged", or any ref/branch/SHA (merge-base with HEAD). Makes "paths" optional: diffBase alone scans all changed supported source files; diffBase + paths intersects with those paths. TypeScript files are mutated only on changed lines; other languages run whole-file. Example: "main" | |
| maxFiles | No | Cap on the number of files audited (precedence: this arg > config.defaultMaxFiles > 25). Files beyond the cap are skipped (reported in the summary). Example: 25 | |
| minScore | No | Gate: if any file's mutation score is below this (0–100), the result reports gate.passed=false and lists the failing files. Never causes an error. Example: 80. | |
| timeoutMs | No | Per-file mutation-run timeout in milliseconds. Default: 300000 (5 minutes). Must be <= 2147483647 (the largest delay a timer accepts). Also clamped by whatever remains of totalTimeoutMs. | |
| outputFormat | No | Output format. "json" (default) or "text". | |
| totalTimeoutMs | No | Wall-clock budget for the WHOLE sweep in milliseconds. Default: 900000 (15 minutes). Files not started before it runs out are returned in "unaudited" rather than audited, so a large sweep still returns the ranking it produced. Must be <= 2147483647 (the largest delay a timer accepts). Example: 1800000 | |
| fileConcurrency | No | How many files to audit in parallel. Default min(4, cpus-1). When >1, the per-file worker count is capped for every engine that has one (StrykerJS --concurrency, cargo-mutants -j, Infection --threads), and for StrykerJS each mutant's test run is additionally pinned to a single vitest worker, so those three layers multiply out to roughly the core count. Rust is the exception to watch: `cargo build`/`cargo test` parallelise internally and take no cap, so a Rust sweep runs fileConcurrency concurrent cargo builds, each of which wants its own multi-GB target directory — lower this to 1 or 2 on a memory-constrained machine. Raise with care on a workstation: a sweep is still the most resource-hungry thing this server does. Example: 4 | |
| mutatorDenylist | No | Stryker mutator names to exclude, applied to every TypeScript/JS file. | |
| survivorsPerFile | No | How many top (severity-ranked, enriched) survivor groups to inline per ranked file. 0 (default) returns a scores-only leaderboard. Example: 3 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gate | No | ||
| mode | Yes | ||
| note | Yes | ||
| errors | Yes | ||
| ranking | Yes | ||
| summary | Yes | ||
| scopeNote | No | ||
| unaudited | No | ||
| stoppedReason | No |