Skip to content

Verifying agent-written code means building deterministic, tamper-resistant checks strong enough that a green CI run proves correctness without a human reading every diff line. Developers wire these checks into local loops and pipelines, while tech leads govern Station 5 (Verification) across the Software Factory.

An agent opens a 600-line pull request carrying 40 green tests. Reading everything burns an afternoon; merging blindly trusts assertions authored by the same agent trying to pass them. The six guides below prove checks catch bugs, lock them against silent edits, and catch erosion, slop, and bad packages automatically.

Work top to bottom: a strong suite the authoring agent can edit proves nothing.

Engineering questionGuideRole in Station 5
Do tests actually fail when code breaks?Oracle strengthMutation score, negative controls, provenance, flake discipline
Can the agent edit tests or CI to pass?Protecting the oracleSession locks, CODEOWNERS, out-of-diff CI, private holdouts
How do we grade copy, docs, or visuals?Model-graded checksCalibrated cross-vendor rubric judges with spot-checks
How do we stop architectural erosion?Architecture fitness functionsLayering, cycles, complexity, clones, and API ratchets
How do we catch plausible-but-wrong code?Slop detectionLint/AST detectors + fresh reviewers for swallowed errors and dead layers
How do we stop hallucinated packages?Dependency verificationLockfile-diff CI gates, cooldowns, proxies, and approval hooks

Pair these gates with test-driven development, acceptance criteria, and the lifecycle test stage.

Keep decisive gates inside repo scripts and CI so every tool clears one standard:

Four signals replacing line-by-line test review

Section titled “Four signals replacing line-by-line test review”
SignalReady to trust whenOwner
Changed-code mutation scoreClears break threshold; every survivor triagedDeveloper
Criterion-to-test mapEvery criterion links to a fail-then-pass checkDeveloper / reviewer
Oracle protectionTest and CI edits require code-owner reviewTech lead
Zero-retry flake rateFlaky tests quarantined instead of retriedTech lead

These signals feed the evidence bundle (see evidence, not diffs). Audit Station 5 automatically via npx @wondelai/harness-audit (Harness Audit).

  • Green suites leak bugs: Tests assert on mocks. Recovery: Run diff mutation testing and assert observable behavior.
  • Assertions weaken during fixes: Exact checks relax into loose matchers. Recovery: Revert and lock oracle paths via CODEOWNERS and CI.
  • Line coverage replaces verification: Assertionless tests execute branches silently. Recovery: Gate on criterion mapping and mutation scores.
  • Generated suites grow slow and flaky: Red builds get retried blindly. Recovery: Prune redundant tests and quarantine flippers on zero-retry sweeps.

Did this guide help you?

One tap, no sign-in.

not at all a lot