TestGuard takes the promises your code makes, breaks each one on purpose, and reports every promise your tests did not notice breaking.
Coverage tells you a line ran. It does not tell you that a test checked the result. A codebase can have full coverage and no defense, and CI gives no warning.
expect(store.writeAudit).toHaveBeenCalledWith( expect.objectContaining({ action: 'MASK', scope: 'g1', ruleCount: 1 }), ); // `content` is never named — so nothing checks it
objectContaining ignores keys it does not list. Replace the redacted text with the
raw secret and this test still passes. Coverage of that line is 100%. The audit log
now leaks the data it must protect.
Fig. 1 — One line of code, two questions. Only one question matters.
You broke it and a test failed. Good. The tests defend that behavior.
You broke it and every test still passed. A blind spot.
The word confuses everyone once: the fault survived, not the test. SURVIVED is bad news. A healthy report shows mostly killed.
A tool that reports every fault as caught is worse than no tool, because nobody questions good news.
Neither suite was sloppy. One had ~4,900 disciplined tests, no snapshots, and 0.4% zero-assertion. Both were green. Both had big blind spots.
Fig. 2 — Measured, not modelled. Each dot is one injected fault.
One file copied the authorization logic into the test and checked its own copy. Fifteen tests were green, and all passed for the wrong reason. You could delete the production path and no test would notice.
The largest gap was in a compliance-critical path with 100% coverage. The
one assertion that mattered used objectContaining and left out the field that holds the
data. This is the example on page one.
A green suite is evidence that the tests agree with the code. It is not evidence that either one is right.
Fig. 3 — The probe loop. Every step repeats per fault; the baseline is cached per defender set.
The order is the specification. Each check stops the checks below it. So the tool never gives a good answer from a question it should not have asked.
Fig. 4 — Verdict order. Every ambiguity resolves downward, toward “unproven”.
Run time is predictable. For each claim:
(baseline runs + faults × N) × cost of the
claim's defender set
Measured, not estimated:
testguard.cost-budget.json records the real CI cost of each set.
--cost reports the cost per claim and per file.
The defender set is the unit, not the file. A run executes all tests of a claim at once. So one slow acceptance test named by five claims runs thirty times, and the report names that file.
Baselines are cached per defender set. A verdict is reused when the source, the defenders and the fault are unchanged.
| Verdict | What it means |
|---|---|
| killed | A test body ran and rejected the behavior. The only good outcome. |
| SURVIVED | Everything passed. A real blind spot in the tests. |
| NOCOVER | No test even looks at this code. Not “weak tests” — no tests. |
| UNVERIFIABLE | The fault did not apply: its anchor moved or matches twice. Nothing was learned. |
| FAULT-INVALID | The injected fault did not compile. The error is ours, not yours. |
| TIMEOUT | The suite hung. A hang is not a detection. |
| FLAKY-DEFENDER | The tests are too unstable on untouched code to probe. |
Fig. 5 — Claims in, evidence out, and a gate that measures the delta rather than the debt.
Probing checks a claim. It does not say which claim to write next, whether a new test is worth keeping, or whether the agent that edits your code knows.
| Verb | Why it exists |
|---|---|
status | Shows the project state and the one next action. --json is the machine entry point. |
init | Installs the agent layer at the git root: skill, session-start hook, AGENTS.md section. |
claims | Lists the claims and reports drift against the @claim annotations in the code. |
scaffold | Proposes faults by rule for one file, as a draft claims document. A start, not an answer. |
sweep | The cold start: probes files with no claim (a diff, the write surface, or a one-line concern). |
probe | The engine. Injects each fault, runs its defenders, reports what survived. |
admit | The two-gate rule as one verb: green on HEAD and failing on every fault of the claim. If not, the test is not a defender. |
baseline | Freezes today's unproven findings so only new ones gate. |
gate | Fails when a changed source file carries no claim and no excusing entry. Unclaimed code is a blind spot before any test is. |
brief | Outputs the blind-spot block for an agent's session-start context. |
mcp | Serves status, brief, claims and evidence read-only over MCP. The loop then works in any agent harness. |
replay | Would this suite have caught the bugs that already escaped? Reports, never gates. |
Every mutation tool must answer this. Most do not.
replay answers it with data: it takes real fix commits from your history, reverts each
fix, runs the tests that exist now, and records whether they notice.
guard-removed missed 7/9 p=0.78 ci [0.45, 0.94] field-dropped missed 4/4 p=1.00 ci [0.51, 1.00]
Read as: when a real bug of this class
escapes, how often does the suite miss it? Each bug gets the label of the fault class its diff
most resembles. This label is the join key. It turns a score nobody can read into a statement with a sample
size. You can recompute every p and interval from n, and the validator
does.
caught, blind, and
nocover. The last counts as a miss, because no tests must not score better than weak tests.flaky and
unverifiable prove nothing, so they must not improve the number.caught.Does a calibration from a repository with history work on a new repository that has none? AI-authored code has no history, so calibration is the only link. That transfer is unproven. It is the core product bet. This tool tests the bet. It is not the answer.
A verifier with no claim about a feature says nothing about it. Every defect that escaped in the field reports was a claim gap, not a probe miss.
So the engine is not the scarce part. The oracle is: a sentence about what must be
true, written by someone other than the code. gate lists the changed files that have no
claim and stops. That is correct, because a human must state a claim. But a team that adopts it reads
that list, has nothing to compare it with, and gives up.
Twenty-six faults on the persistence path of seven server actions in a real AI-authored application. They hit the write and its fields.
Fig. 7 — The save button reports success. The suite agrees. The column is empty.
The third number is the read-back answer. A test that replaces the database proves only the
call shape. A where that matches no rows, a rolled-back transaction and a
rejected constraint all pass against a mock. On this surface a clean probe is not evidence of
persistence. It is evidence that no test could measure it, and the tool says so before any verdict.
The evidence now names the mocked layer and the assertion shape (exact, partial or argument-free)
beside the survivor’s verdict.
sweep takes the files that gate reported as uncovered, proposes
faults by rule, probes a limited selection, and reports what no test noticed. It orders
candidates by what this project’s own runs show survives. This feedback took
Google’s productive rate from 15% to 89%.
A concern names a kind of promise and where to look. Five lines of JSON, “every admin route refuses a caller without the admin role”, found a
route whose owner/manager check can be forced to false with no test failing. One
sentence covered twenty-four routes, with no model.
The survivors worth defending become the first claims: a statement, its faults, and a reproducer already in hand.
Four rules keep the lower rungs safe. A sweep never writes the claims file, because a sentence nobody wrote is not a claim. Its evidence never replaces the canonical record. It does not fail on its own bad guess: only a survivor or an untested file exits non-zero. It counts whatever it does not probe: past the cap, outside the concern, or presentational (an icon or a static wrapper nobody would test).
A sweep is weaker evidence than a probe, and says so. It is stronger than nothing, which is what a repository with no claims has.
Breaking code to test your tests is mutation testing, and it dates to the 1970s. Stryker, PIT, mutmut and Cosmic Ray all do it. Anyone who says that part is new is wrong. Two industrial programs solved the parts that make it usable. This tool takes both.
Mutating two billion lines is infeasible. So Petrović et al. mutate only changed lines, suppress “arid” nodes nobody would test, show at most seven mutants per file, and order candidates by the measured productivity of the operator in similar context. Developer feedback over six years took their productive rate from 15% to 89%. A later study found that reported mutants link to real faults: the bugs it analyzed would have been caught if a mutant had been shown.
Taken here: the diff scope, the cap, and a productivity-ordered selection, measured on real probed faults, not assumed. We measured their arid-node suppression instead of copying it: Google's categories are under 1% of what the producers propose. The arid class here is presentational JSX, now set aside and counted.
ACH inverts the generator: an engineer writes a concern in plain text, an LLM drafts faults for that concern. Each fault must build, survive the existing suite, and not be equivalent before a test is generated to kill it. Engineers accepted 73% of the resulting tests. Nothing is trusted because a model said it. Execution gates every step, and the reviewer sees the mutant as proof that the test catches something real.
Taken here: the concern as the unit a human writes, and an execution gate between every model step and the record.
Neither tool binds a fault to a stated promise. That gap remains, and the next section covers it.
→ Mutation score: 73%
A number. You cannot act on it or audit it, and it does not say which promise is at risk.
→ “Your project says a missing scope fails closed. Nothing checks that.”
A finding. An assessor reads your claims, which you review like code, not a score.
Fig. 6 — A score compresses everything into one number; a claim keeps the finding attributable.
That is the difference between a metric and an audit, and it is the whole design.
“No model decides a verdict” is a design rule elsewhere in this brief. It is also a
result. A calibrated commercial decision model was shadow-evaluated against real probed verdicts on
an AI-authored codebase. It had to say whether a given test would catch a given fault. It scored
AUC 0.813. Its errors went in the forbidden direction: it confidently said
that a test would catch a fault that in fact survived. On hand-built fixtures the same model looked
far better. This is the second finding: a synthetic fixture flatters any judge, because its blind
spots were written to be easy to see. Only execution may say
killed.
One gap it names: a claim that
disappeared is invisible to all of the above. probe verifies the claims that
exist, and deleting a claim is cheaper than weakening it. So it reports removal too, against any
reference, with the last verdict of the claim. Removal is allowed, because claims can be wrong, superseded
or split. It is never silent.
Most tools mark a mutant killed when the test command exits non-zero. That confuses “a test caught it” with “everything failed.” Here the verdict set is closed, and each verdict has its own meaning.
Schema-validated JSON with stable fingerprints, shared with the other Guard tools. Freeze today's blind spots, gate CI on new ones.
When an agent writes the tests, the failure mode is not “no tests.” It is confident, plausible tests that assert nothing. This is exactly what it detects.
Coverage tells you a line ran. TestGuard tells you which of your promises nobody is actually defending.