A self-healing test suite: CircleCI runs Stryker mutation testing on every push, and when mutants survive, the pipeline hands the surviving mutants to a CircleCI Chunk agent that writes the missing tests and opens a PR. A human reviews and merges; the next run is green.
push to main
└─ install ─ unit-tests
└─ mutation-tests Stryker, JSON report -> score, prompt.txt, REMEDIATE
├─ gate re-scores; RED while mutants survive
└─ remediate score < 70% -> triggers a Chunk agent task
└─ Chunk agent writes killing tests, opens PR
└─ PR gate must hit 100% -> human merges
└─ next main run: green
src/— four small, pure modules (age,numbers,strings,validation). Every mutant Stryker generates for them is killable, so 100% is a fair bar.test/— starts deliberately weak: happy-path assertions only. Mutation score 46.97%.scripts/survivors.mjs— turns Stryker'smutation.jsoninto the loop artifacts: ascorefile, aprompt.txttask brief for the agent, and aREMEDIATEflag..circleci/config.yml— the four-job loop.mutation-testsis failure-safe (it can never strand the loop);gateis the tamper-resistant scoring authority (re-scores with CI-supplied arguments and rejects PRs that touch anything buttest/).agents.md— standing instructions for the Chunk agent.
npm ci
npm test # 15 green tests
npm run mutation # score 46.97%, exit 1 — the weak suite caught red-handedSee RUNBOOK.md for the one-time CircleCI/Chunk wiring.