From b97685f238f80a03989c2585e34f252f8577f935 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 13 Oct 2026 09:15:38 +0200 Subject: [PATCH 1/2] File item 108: mutation-test the code each chunk changes, so every test must catch a real bug --- todo.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/todo.md b/todo.md index 46c7c841..05688f53 100644 --- a/todo.md +++ b/todo.md @@ -6,7 +6,7 @@ `Bar = 9` -`Next ID = 108` +`Next ID = 109` | Goal | W | |---|---| @@ -25,6 +25,7 @@ | ID | Release | Exempt | Item | R | S | A | G | Goals | Score | |---|---|---|---|---|---|---|---|---|---| | 107 | 0.1.0 | | **Have loop-claude put the README's Goals and Audience into every fresh worker prompt, under a line that the item sets the scope and the goals choose within it.** | 3 | 3 | 8 | 8 | 1.1, 1.2 | 28.1 | +| 108 | 0.1.0 | | **Measure whether each test catches a real bug, by mutation testing the code each chunk changes, so a test that only runs lines fails review.** | 2 | 4 | 7 | 8 | 1.1 | 26.8 | | 98 | 0.1.0 | | **Score R and S from a measurement wherever one exists, and calibrate each guessed score against the finished chunk's measured outcome.** | 2 | 5 | 6 | 7 | 1.1, 1.4 | 22.6 | | 99 | 0.1.0 | | **Drop the comprehension panel as a merge gate, and keep recording its scores and the places in the code its seats found hard, for later measurement and for other reviewers and agents to improve.** | 4 | 5 | 7 | 7 | 1.1, 1.4, 1.5 | 22.6 | | 87 | 0.1.0 | | **Score every `todo.md` item's complexity C from 1 to 10, and have `rank_todo.py` fail on an item without one.** | 3 | 4 | 6 | 7 | 1.1, 1.4 | 21.9 | @@ -75,6 +76,18 @@ Today loop-claude hands the premises only to the judge (`bin/loop_claude/cycle/j - Above them, one line: the item sets the scope, and the goals choose between ways to meet it. A worker then extends no item towards a goal. - For a session outside the loop, add one line to `CLAUDE.md`'s working loop: read the README's Goals and Audience before starting a chunk. +### 108. Measure whether each test catches a real bug, by mutation testing the code each chunk changes, so a test that only runs lines fails review. + +lilleman, 2026-10-13: tests should be as valuable as possible, never written to tick a box. Today the technical principles ask that most code has tests, written first, and that coverage not decline (item 69). The stability reviewer asks, by reading, whether each test would fail if the behaviour broke. Coverage counts the lines a test runs, so a test with no meaningful assertion still raises it. + +Mutation testing measures what coverage cannot: it makes small changes to the code, such as flipping a comparison, and counts the changes no test notices. Each survivor is a bug the tests would miss. + +- Run it on the lines a chunk changes, so its cost stays per chunk (goal 1.4), through each project's own tooling, with a widely deployed tool per language, such as mutmut for Python and Stryker for TypeScript. +- Make a surviving mutant in the changed code a finding of the stability pass, which then names the test to add or strengthen. +- Set any score threshold from a published source, or ask (`CLAUDE.md` → "Web research"). +- Say in the principle "Most, if not all, code should have automated tests" what a valuable test is: it checks behaviour through the unit's interface, and fails when that behaviour breaks. +- Decide whether this replaces item 69's coverage measure. + ### 98. Score R and S from a measurement wherever one exists, and calibrate each guessed score against the finished chunk's measured outcome. A score that can be computed from the code it touches, such as the files an item names, comes from that computation. Otherwise size and risk are estimated from finished work, the way reference-class forecasting estimates a project from earlier projects like it. When a chunk merges, record its measured outcome beside the item's guessed R and S: lines and files changed, review rounds, 🔴 and 🟡 findings, and fixes the code needed later. Show the scorer, when it files an item, the finished items whose guessed scores sat nearest and what they measured. Once enough chunks are recorded, report how far each guess was from its outcome, so a scorer whose S runs high can be corrected. Item 87's C is scored and calibrated the same way. -- 2.52.0 From a76fba84086ad169e295b745125d2e0bab77fe99 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 13 Oct 2026 09:16:38 +0200 Subject: [PATCH 2/2] Answer prose round 1: the tagline says what mutation testing checks, and the detail defines a mutant --- todo.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/todo.md b/todo.md index 05688f53..a7b91eb1 100644 --- a/todo.md +++ b/todo.md @@ -25,7 +25,7 @@ | ID | Release | Exempt | Item | R | S | A | G | Goals | Score | |---|---|---|---|---|---|---|---|---|---| | 107 | 0.1.0 | | **Have loop-claude put the README's Goals and Audience into every fresh worker prompt, under a line that the item sets the scope and the goals choose within it.** | 3 | 3 | 8 | 8 | 1.1, 1.2 | 28.1 | -| 108 | 0.1.0 | | **Measure whether each test catches a real bug, by mutation testing the code each chunk changes, so a test that only runs lines fails review.** | 2 | 4 | 7 | 8 | 1.1 | 26.8 | +| 108 | 0.1.0 | | **Mutation-test the lines each chunk changes, and make each mutant no test catches a finding of the stability pass.** | 2 | 4 | 7 | 8 | 1.1 | 26.8 | | 98 | 0.1.0 | | **Score R and S from a measurement wherever one exists, and calibrate each guessed score against the finished chunk's measured outcome.** | 2 | 5 | 6 | 7 | 1.1, 1.4 | 22.6 | | 99 | 0.1.0 | | **Drop the comprehension panel as a merge gate, and keep recording its scores and the places in the code its seats found hard, for later measurement and for other reviewers and agents to improve.** | 4 | 5 | 7 | 7 | 1.1, 1.4, 1.5 | 22.6 | | 87 | 0.1.0 | | **Score every `todo.md` item's complexity C from 1 to 10, and have `rank_todo.py` fail on an item without one.** | 3 | 4 | 6 | 7 | 1.1, 1.4 | 21.9 | @@ -76,15 +76,14 @@ Today loop-claude hands the premises only to the judge (`bin/loop_claude/cycle/j - Above them, one line: the item sets the scope, and the goals choose between ways to meet it. A worker then extends no item towards a goal. - For a session outside the loop, add one line to `CLAUDE.md`'s working loop: read the README's Goals and Audience before starting a chunk. -### 108. Measure whether each test catches a real bug, by mutation testing the code each chunk changes, so a test that only runs lines fails review. +### 108. Mutation-test the lines each chunk changes, and make each mutant no test catches a finding of the stability pass. -lilleman, 2026-10-13: tests should be as valuable as possible, never written to tick a box. Today the technical principles ask that most code has tests, written first, and that coverage not decline (item 69). The stability reviewer asks, by reading, whether each test would fail if the behaviour broke. Coverage counts the lines a test runs, so a test with no meaningful assertion still raises it. +lilleman, 2026-10-13: tests should be as valuable as possible, never written to tick a box. Today the technical principles ask that most code has tests, written first, and that coverage not decline, which item 69 would measure. The stability reviewer asks, by reading, whether each test would fail if the behaviour broke. Coverage counts the lines a test runs, so a test with no meaningful assertion still raises it. -Mutation testing measures what coverage cannot: it makes small changes to the code, such as flipping a comparison, and counts the changes no test notices. Each survivor is a bug the tests would miss. +Mutation testing measures what coverage cannot: it makes small changes to the code, called mutants, such as flipping a comparison, and counts the mutants no test notices. A mutant that survives usually marks a bug the tests would miss; one that leaves behaviour unchanged is not. -- Run it on the lines a chunk changes, so its cost stays per chunk (goal 1.4), through each project's own tooling, with a widely deployed tool per language, such as mutmut for Python and Stryker for TypeScript. -- Make a surviving mutant in the changed code a finding of the stability pass, which then names the test to add or strengthen. -- Set any score threshold from a published source, or ask (`CLAUDE.md` → "Web research"). +- Run it only on the lines a chunk changes, so its cost grows with the chunk (goal 1.4). Use a widely deployed tool for each language, such as mutmut for Python and Stryker for TypeScript. +- Make a surviving mutant in the changed code a finding of the stability pass, which names the test to add or strengthen. The reviewer drops a mutant that leaves behaviour unchanged. - Say in the principle "Most, if not all, code should have automated tests" what a valuable test is: it checks behaviour through the unit's interface, and fails when that behaviour breaks. - Decide whether this replaces item 69's coverage measure. -- 2.52.0