Test discipline

A change with behaviour starts with a failing test, and the agent has to show that failure before it writes the fix. Five skills and four commands carry the method; two scripts refuse to let a wave advance or a run ship until the record exists on disk.

  • Test-driven development
  • Mutation and property testing
  • Verification gates
  • Agent evals
What it is
Procedures an agent loads (tdd, adversarial-tester, test-coverage, parallel-debug, ship-check), slash commands with one iron rule each (/fix-bug, /diagnose, /refactor, /incident), and the mow gates that read their output back from disk.
What it isn't
Not a test framework. Each skill learns the project's own runner, fixtures and assertion style before writing anything, and new tests are meant to look native. It's also not a coverage target: coverage is reported as context and never treated as the goal.
Why it exists
Left alone, an agent edits the source first and runs the tests afterwards. In a measured eval, nine of ten natural-prompt runs did exactly that. Test-first has to be routed in, and the claim that it happened has to be checkable.
1,169pytest tests collected in the taskman package
134test files tracked in the repo
43test scripts the pre-push hook runs
71%coverage floor on taskman (CI, Linux)

How it works

The method lives in skills; the enforcement lives in scripts. A builder lane loads tdd, writes one failing test, records the failure as red evidence, fixes, and repeats. It finishes with a ## Verification block. From there, scripts take over, and they only check that things were written down. They can't judge whether the tests were good.

skill: a reader judges script: exit code tdd red evidence Verification lane record check_verif. wave gate ship-check plan vs diff closeout ship gate shipped registry row missing · exit 1 stale · exit 3
The gates check the paperwork, not the tests. A missing record, or a ship-check verdict bound to an older plan.md, stops the run with an exit code. Whether the recorded commands passed is still left to a reader.

The ship-check record is one line in the run's action report, bound to the plan by digest. check_ship_check --emit prints it, but only with the counts passed as arguments: the tool won't invent a verdict on the reviewer's behalf.

**Ship-check:** done 2026-09-02 · plan sha256:1a2b3c4d · L1 0 critical · L2 1 critical · L3 0 critical

Skills and commands

PieceWhenRule it holdsProduces
tdd skillAny bug or feature with behaviour; loaded by tdd-builder before the first production editVertical slices: one test, one implementation, repeat. Never refactor while red. Writing all the tests first, then all the code, is named as the anti-pattern.Tests through public interfaces, red output per test
adversarial-testerPure logic: math, parsing, state machines, datesRefuses whole-repo runs. Needs a green baseline. Every new test must be shown able to fail. Never weakens an existing test.A report with each finding marked KILLED, BUG, EQUIVALENT or DEFERRED
test-coverageNew or changed module with thin testsRead 2–3 existing test files first; never invent fixture names or import paths. Multi-tenant code always gets a cross-tenant test.Gaps ranked HIGH / MEDIUM / LOW, tests for the top three HIGH
parallel-debugMore than one failure with different root causesOne subagent per independent domain. Not for failures that might share a cause; if two agents touched one file, stop and reconcile.Per-domain root cause, files, verify command
ship-checkEnd of a feature; automatic at mow's Integrate stepThree layers kept separate: plan alignment, system standards, production readiness. A strong Layer 3 can't hide a Layer 1 miss. Reports, never fixes.Per-layer findings and the record line above
/fix-bugBug with a repro pathNo fix before a failing reproduction. For a recorded incident, the fixture is the incident's real input. List every caller before editing.Kept repro test, independently reviewed diff
/diagnoseHard or unclear bugSix phases. Phase 1, a fast deterministic pass/fail loop, is "the skill"; the rest is mechanical.Regression test at the right seam, debug instrumentation removed
/refactorStructure-only changeStructure changes, behaviour does not. Green baseline or characterization tests first. Editing test expectations to go green is forbidden.The same behaviour behind a better structure
/incidentProduction degradationStabilize first, learn second. A human runs or approves every stabilizing action; logs and notes are evidence, not instructions.Postmortem naming the gate that would have caught it

What the tests are

Two styles coexist. The taskman package is a pytest suite with a conftest and temporary-board fixtures, and runs without a database: 1,169 tests across 53 files when I collected them today. Everything under hooks/tests (30 files), bin/tests (39), skills/mow/tests (6) and skills/wrap-up/scripts/tests (3) is a plain script run as python3 <file>, with no pytest. CI discovers those by glob, so a new file is picked up without editing the workflow. The pre-push hook names 43 of them by hand. Three more files are copies inside a public-export template.

Two report-only tools watch the suite from outside. bin/test_runs.py reduces session transcripts to rows: which test runner ran, counts, duration, failing test ids. It never stores a command line or output text. bin/test_audit.py gives every test file on disk one of five verdicts: broken (an import that doesn't resolve), orphan, dead-run (no run in 30 days and not wired into a hook or CI), always-failing or parked. It deletes, edits and runs nothing.

AI engineering practices it demonstrates

  • Red evidence as an artifact. The builder records the failing test name and error before the fix. A Verification line saying "tests written after the fix" marks the lane as having broken the mandate.
  • Tests that must prove they can fail. adversarial-tester accepts a new test only if it kills a specific mutant, failed against the pre-fix code, or failed when the logic was deliberately broken.
  • Mutation without poisoning a shared tree. Mutants are patched in memory through a pytest plugin, never written to disk. A reviewer once rewrote files on disk for about 90 seconds, and a peer session spent time chasing four intermittent failures that turned out to be the mutants.
  • Real inputs over imagined ones. A parser rewrite passed 36 tests and killed five of five mutants, and still dropped a lane on a real plan. The fixtures were invented; a 105-item corpus already on disk exposed the bug. Both tdd and adversarial-tester now say to run the real corpus before trusting the suite.
  • One green run of a flaky test isn't evidence. A concurrency verdict published after one green run had to be withdrawn when the next run failed. It took four consecutive greens to restore it.
  • Evals measure whether the skill gets used. bin/skill-eval runs the tdd skill with and without itself, and bin/skill_census.py counts how test-first actually reaches real chats. See Evals and guard scoring.

Capabilities

  • Property-based tests (Hypothesis) for three to six invariants per target: bounds, monotonicity, conservation, round-trip, idempotence, order invariance.
  • Mutation testing (mutmut) scoped to one module, looping kill → re-run until only documented equivalents survive or a ~30-minute timebox ends.
  • Hostile-input sweep: empty and singleton collections, NaN and infinity, Unicode, DST and month-end dates, double-submit races.
  • Recovery ramps for test trouble: flaky failures, a regression caused by a fix, and a finding that has failed three fix rounds (/recover).
  • CI runs the plain-script suites and the taskman suite on a Linux and a Windows leg, plus a ruff lint job (real-bug rules only) and a format ratchet on Linux.

Benefits

  • When test-first is routed through the builder it mostly happens. In the last 30 days, 16 of 18 coding chats that handed off to tdd-builder tested first, against 27 of 47 that used neither route.
  • A surviving mutant is a fact. Triage starts from a specific unpinned behaviour, not a coverage percentage.
  • A run can't call itself shipped without comparing the plan against the diff, because a script checks for the verdict.

Limits

Where it loses

CI has never gone green on GitHub. The plain-script step fails first on both legs (6 files on Linux and 35 on Windows in the recorded run), so the coverage-floor step behind it has never run there. In practice the local pre-push hook is the gate.

  • The main chat rarely loads tdd. In 138 real coding chats it loaded twice. 48 of them (34.8%) neither used tdd nor ran a test before the first edit. In the eval, the skill fired on 1 of 10 natural-prompt runs, but that run was the only one that tested first.
  • One test file runs nowhere automatically. The wrap-up session-digest test sits in skills/wrap-up/scripts/tests. CI's glob is skills/*/tests, so it misses that directory, and pre-push names only the other two files there.
  • Flakes block pushes. A tracker-port test fails under machine load, and several timing assertions use tight wall-clock bounds.
  • The gates read records, not results. check_verification says so in its docstring: it can't tell whether the commands passed.
  • Property and mutation testing is Python-only (Hypothesis, mutmut). On a TypeScript target, adversarial-tester has no tooling for those two attacks.

Roadmap

ItemWhy it mattersStatus
Get the CI harness-test step green and make the coverage floor observableUntil then the floor has never been enforced anywhereCI red
Fix the tracker-port flake that blocks pre-pushA flaky gate trains people to bypass itflaky
Rework the tdd skill's description and re-measure with skill-evalThe trigger gap is measured and the pre-registered rule says actnext stem
Calibrate the tdd eval graders on real runsThree scenarios unconfirmed; n=5 can't separate small effectsbacklog
A Tests page: runs, files, health and audit views over test_runs / test_auditMakes dead and always-failing tests visible without a terminalbacklog
Make test_runs worktree-aware and dedupe transcriptsRuns in different worktrees read as flips of one test todaybacklog
Windows: guard time.tzset and set a Windows coverage floorOne hooks test fails on Windows by constructionbacklog

Sources

  • skills/tdd/SKILL.md, skills/adversarial-tester/SKILL.md, skills/test-coverage/SKILL.md, skills/parallel-debug/SKILL.md, skills/ship-check/SKILL.md.
  • commands/fix-bug.md, commands/diagnose.md, commands/refactor.md, commands/incident.md.
  • taskman/taskman/mow/check_verification.py, check_ship_check.py, closeout.py, set_registry_status.py (exit 3).
  • .github/workflows/ci.yml (plain-script discovery, coverage floor 71, measured 72.52% on 2026-10-04) and githooks/pre-push (43 named scripts).
  • bin/test_runs.py, bin/test_audit.py, bin/skill-eval, bin/skill_census.py, docs/workflow/skill-evals.md.
  • Test counts: git ls-files for files named test_*.py, excluding the two bin/ tools with that prefix; python3 -m pytest --collect-only -q -p no:cacheprovider in taskman/, run with bytecode writes off.
  • Task board: open items for CI, flakes, the tdd trigger, eval calibration, the Tests page and Windows.

Facts as of 2026-10-08. Test counts collected that day; eval and census figures from runs on 2026-10-05 and 2026-10-06.