Answer product-owner round 1: 0 🔴, 3 🟡 (0 misread); say how the tools get their dependencies and which names count as tests, file item 544

This commit is contained in:
2026-11-26 11:42:20 +01:00
parent 874e417e27
commit ea4d2408b2
3 changed files with 42 additions and 23 deletions
+32 -20
View File
@@ -14,17 +14,20 @@ origin's as last fetched, else main or master. Where --base names the head's own
No model judges anything: the bench runs programs, and reads Haiku's own stream.
- Plant. It copies the tree at the base and runs a mutation tool there, over the files that hold the places `larv-review places`
prints, the ones the comprehension seats found hardest: Gremlins over the Go files, as `gremlins unleash`, mutmut 3 over
the Python files, as `mutmut run`, cargo-mutants over the Rust files, as `cargo mutants`, Infection over the PHP files, as
`vendor/bin/infection`, and Stryker over the TypeScript and JavaScript files, as `npx stryker run`. No other language is
planted in so far. Infection and Stryker run at the copy's top, with the project's config for the tool there. Stryker's json
reporter must write where it does by default, `reports/mutation/mutation.json`. It takes the mutants the tests kill in the order --seed sets, 1 by default, until --bugs of
them, 5 by default, have become bugs. A mutant becomes a bug where the lines it changes stand unchanged at the head, and where,
planted at each side, a test fails and prints a message that says more than the test's name. The bench reads that message
from `go test`'s output for a Go file, from pytest's for a Python file, from `cargo test`'s for a Rust file, from PHPUnit's
for a PHP file and from `node --test`'s for a TypeScript or JavaScript file, so --test must run the tests of each language the
places name, with that runner: pytest as it prints by default, or with --tb=short, `cargo test` without --nocapture, PHPUnit
as it prints by default, and `node --test` with its spec reporter. Any other mutant is passed over, so a change to the very lines of a bug is not benched.
prints, the ones the comprehension seats found hardest: Gremlins over the Go files, as `gremlins unleash`, Infection over the
PHP files, as `vendor/bin/infection`, mutmut 3 over the Python files, as `mutmut run`, cargo-mutants over the Rust files, as
`cargo mutants`, and Stryker over the TypeScript and JavaScript files, as `npx --no --package=@stryker-mutator/core stryker
run`, which runs the Stryker the project installs and downloads none. No other language is planted in so far. Infection and
Stryker each run at the top of a copy of that tree, with the project's config for the tool there, and the copy is removed
with all the tool wrote. Stryker's json reporter must write where it does by default, `reports/mutation/mutation.json`.
The bench takes the mutants the tests kill in the order --seed sets, 1 by default, until --bugs of them, 5 by default, have
become bugs. A mutant becomes a bug where the lines it changes stand unchanged at the head, and where, planted at each side,
a test fails and prints a message that says more than the test's name. The bench reads that message from `go test`'s output
for a Go file, from PHPUnit's for a PHP file, from pytest's for a Python file, from `cargo test`'s for a Rust file and from
`node --test`'s for a TypeScript or JavaScript file. So --test must run the tests of each language the places name, with
that runner: PHPUnit as it prints by default, pytest as it prints by default or with --tb=short, `cargo test` without
--nocapture, and `node --test --test-reporter=spec`. Any other mutant is passed over, so a change to the very lines of a
bug is not benched.
- Run. Haiku fixes each bug --runs times at each side, 5 by default, the sides in turn. A fix starts from a copy of that side's
tree with the bug in it, committed once, so git doesn't show which line the bug is on. In the copy, in a container, `claude -p
--strict-mcp-config --disable-slash-commands --no-session-persistence --model claude-haiku-5-5 --effort low` works with every
@@ -32,7 +35,10 @@ No model judges anything: the bench runs programs, and reads Haiku's own stream.
Claude home is new and empty, so the project's own CLAUDE.md, or AGENTS.md, in the copy is all the setup that loads. Its network
reaches api.anthropic.com and nothing else. A fix ends after 30 minutes.
- Check. The test command runs over the planted tree with each file that is no test as Haiku left it; a fix passes where it exits 0.
A test Haiku changed, removed or added doesn't count, and neither does a file under a `testdata` folder. In a Rust file, each
A test Haiku changed, removed or added doesn't count, and neither does a file under a `testdata` folder. The bench
tells a test by its path: a folder named `test`, `tests` or `__tests__`, or a file named `test_*.py`, `*_test.py`,
`*_test.go`, `*.test.*` or `*.spec.*`. A test of any other name counts as code, such as `src/PickTest.php` or
`src/pick-test.js`, so Haiku's change to it stands. In a Rust file, each
inline `#[cfg(test)]` module stands as the planted file has it, and the rest is as Haiku left it. Where the planted file has such
modules and Haiku's file lacks one of them, or its modules cannot be told apart, the planted file stands whole; where the planted
file has none, or its modules cannot be told apart, Haiku's stands. A Rust mutant whose file's modules cannot be told apart, as where two share a name or a brace, string or comment
@@ -43,11 +49,13 @@ No model judges anything: the bench runs programs, and reads Haiku's own stream.
so the image needs curl and bash; the result names the version. Haiku works in that image. So does --test: sh runs that text at
the copy's top, with no network, so the image must hold what the tests would otherwise download.
--prefix is shell text that runs the mutation tool, on the host, as mutate-changes' --prefix does: sh runs `<prefix> "$@"` with
the tool's command as "$@", such as `gremlins unleash ...`, `mutmut run ...` or `cargo mutants ...`. Gremlins,
cargo-mutants, Infection and Stryker run in the copy of the base, and mutmut in a copy of the folder there that holds its settings;
$PWD is the folder the tool runs in. Without --prefix, the bench runs the `gremlins`, the `mutmut`, the `cargo` or the `npx` on
the host's PATH, or the copy's own `vendor/bin/infection`. For example,
for Go, for Python and then for Rust:
the tool's command as "$@", such as `gremlins unleash ...`, `mutmut run ...` or `cargo mutants ...`. Gremlins and cargo-mutants
run in the copy of the base, Infection and Stryker in a copy of that copy, and mutmut in a copy of the folder there that holds
its settings; $PWD is the folder the tool runs in. That folder holds the files git tracks and no others, so for Infection and
Stryker the prefix first installs the project's dependencies there, as `composer install` and `npm ci` do. Infection also
needs PHP with a coverage driver, pcov or Xdebug. Without --prefix, the bench runs the `gremlins`, the `mutmut`, the `cargo`
or the `npx` on the host's PATH, or the tree's own `vendor/bin/infection`, which only a project that tracks `vendor` has.
For example, for Go, for Python, for Rust and then for TypeScript:
docker run --rm --memory 16g --memory-swap 16g -v "$PWD:$PWD" -w "$PWD" golang:1.27.4 \
sh -c 'shift; exec go run github.com/go-gremlins/gremlins/cmd/gremlins@v0.6.0 "$@"' sh
@@ -57,6 +65,9 @@ for Go, for Python and then for Rust:
docker run --rm --memory 16g --memory-swap 16g --user "$(id -u):$(id -g)" -e CARGO_HOME=/tmp/cargo -v "$PWD:$PWD" -w "$PWD" \
rust:1.100.0 sh -c 'cargo install --quiet --locked cargo-mutants@27.1.0 && exec "$@"' sh
docker run --rm --memory 16g --memory-swap 16g --user "$(id -u):$(id -g)" -e HOME=/tmp -v "$PWD:$PWD" -w "$PWD" \
node:24.19.0-alpine3.24 sh -c 'npm ci --silent && exec "$@"' sh
Where the places name files in more than one language, the one prefix gets each tool's command, Gremlins' first and
Stryker's last, and a tool it cannot run fails the bench. Such a prefix picks the tool by "$1", which is `gremlins`,
`vendor/bin/infection`, `mutmut`, `cargo` or `npx`, as here for Go
@@ -364,11 +375,12 @@ def features_planner(features: Features, checkout: str, trees: dict[Side, str])
def bugs_planner(given: dict[str, str], env: typing.Mapping[str, str], places: str, base: str) -> typing.Callable[[Bench], Planned | Failure] | Failure:
"""What plans a bench of bugs: of the mutants the tests kill in the files of the tree at base that are in a language of plant's LANGUAGES and hold a place
in places, those --seed draws first become bugs, until --bugs of them have."""
"""What plans a bench of bugs. The bugs' files are those of the tree at base that hold a place in places and are in a language
of plant's LANGUAGES. Of the mutants the tests kill in those files, the ones --seed draws first become bugs, until --bugs of
them have."""
files = [path for path in place_files(places) if pathlib.Path(base, path).is_file()]
if not files:
return Failure("The places the seats found hard don't name any file that the base holds in a language the bench plants bugs in, so there is nowhere to plant a bug.")
return Failure("The places the seats found hard don't name any file at the base in a language the bench plants bugs in, so there is nowhere to plant a bug.")
run = functools.partial(run_tool, prefix=given.get("--prefix"), env=env, killpg=os.killpg)
mutants = killed_mutants(base, files, run, CPUS_PER_SLOT)
return mutants if isinstance(mutants, Failure) else functools.partial(planted_tasks, mutants=mutants, seed=int(given["--seed"]), bugs=int(given["--bugs"]))
+2 -2
View File
@@ -236,7 +236,7 @@ class BenchTest(unittest.TestCase):
def test_the_command_line_fails_with_the_reason_where_the_places_or_the_bench_fail(self):
argv = [part for name, value in self.given.items() for part in (name, value)]
for places, said in ((Failure("no history"), "no history\n"), ("- `gone.go:1` `Gone`: removed\n", "The places the seats found hard don't name any file that the base holds in a language the bench plants bugs in, so there is nowhere to plant a bug.\n")):
for places, said in ((Failure("no history"), "no history\n"), ("- `gone.go:1` `Gone`: removed\n", "The places the seats found hard don't name any file at the base in a language the bench plants bugs in, so there is nowhere to plant a bug.\n")):
with contextlib.redirect_stdout(io.StringIO()) as out, contextlib.redirect_stderr(io.StringIO()) as errors:
self.assertEqual(main.main(argv, self.env, lambda home: places), 1)
self.assertEqual((out.getvalue(), errors.getvalue().splitlines(keepends=True)[-1]), ("", said))
@@ -309,7 +309,7 @@ class BenchTest(unittest.TestCase):
def test_fails_where_the_places_name_no_file_of_the_base_in_a_language_the_bench_plants_in(self):
with contextlib.redirect_stderr(io.StringIO()):
found = main.bench({**self.given, "--base": "main"}, self.env, lambda home: "- `gone.go:1` `Gone`: removed\n- `README.md:1` `Calc`: thin\n", self.home)
self.assertEqual(found, Failure("The places the seats found hard don't name any file that the base holds in a language the bench plants bugs in, so there is nowhere to plant a bug."))
self.assertEqual(found, Failure("The places the seats found hard don't name any file at the base in a language the bench plants bugs in, so there is nowhere to plant a bug."))
self.assertFalse(self.log.exists())
def test_fails_where_the_tests_fail_without_a_bug(self):
+8 -1
View File
@@ -6,7 +6,7 @@
`Bar = 0.1`
`Next ID = 544`
`Next ID = 545`
## Items
@@ -23,6 +23,7 @@
| 538 | 0.17.0 | | | **Flag validation that checks a value other than the one the code goes on to use, such as before trimming, stripping or converting it.** | 1 | 2 | 2 | 3 | 1 | 1.1 by 2 | 0.9 |
| 541 | 0.17.0 | | | **Find a Gitea pull request by its branch and head however many pull requests are newer, so `chunk-pr clean`, `chunk-pr merge` and `chunk-preflight` see an older one.** | 2 | 2 | 3 | 5 | 2 | 1 by 2 | 0.8 |
| 539 | 0.17.0 | | | **Leave out of a `task-bench` fix a change Haiku makes to a Rust test kept in a file of its own.** | 2 | 2 | 1 | 3 | 3 | 1.1 by 1 | 0.4 |
| 544 | 0.17.0 | | | **Leave out of a `task-bench` fix a change Haiku makes to a PHP or JavaScript test that PHPUnit or `node --test` finds by a name `is_test` does not know.** | 2 | 2 | 1 | 3 | 3 | 1.1 by 1 | 0.4 |
| 480 | 0.18.0 | | owner | **Resolve every path the tools use in one module: the release root (the folder the running code ships in), the config folder, the state folder and the Claude home. Then only that module names `~/.claude`, and the loop still runs from `~/.claude`.** | 3 | 2 | 3 | 6 | 6 | 1.6 by 3, code health by 3 | 2.4 |
| 481 | 0.18.0 | 480 | owner | **Put the release's tools on `PATH` for every session the loop starts and every hook it runs, name them bare in the prose in place of `~/.claude/bin/<tool>`, and refuse the old spelling in new prose.** | 3 | 2 | 3 | 6 | 6 | 1.4 by 2, code health by 2 | 1.6 |
| 482 | 0.19.0 | 478, 481 | owner | **Install the setup with `uv tool install` from a release tag, with `do-release` and `do-epic` on `PATH`, and replace `deploy-release` with `do-release self-update`.** | 3 | 2 | 3 | 6 | 7 | 1.6 by 4, 1.3 by 3 | 1.3 |
@@ -219,6 +220,12 @@ Touches:
- `bin/task_bench/test_task_bench.py`
- `bin/task_bench/main.py`: lines 30-37
### 544. Leave out of a `task-bench` fix a change Haiku makes to a PHP or JavaScript test that PHPUnit or `node --test` finds by a name `is_test` does not know.
PHPUnit finds a test by `*Test.php`, wherever it stands, and `node --test` also by `*-test.js`, `*_test.js`, `test-*.js` and `test.js`, with `.ts`, `.mjs` and `.cjs` alike. `mutate_changes.changed_lines.is_test` tells a test by a folder named `test`, `tests` or `__tests__`, or by a name such as `*.test.*`, so `src/PickTest.php` and `src/pick-test.js` count as code. `checked_tree` in `bin/task_bench/runs.py` then takes such a file as Haiku left it, so a fix that edits or deletes the failing test passes, at both sides alike, and `place_files` in `bin/task_bench/plant.py` may hand the file to the mutation tool as code. The help's Check paragraph says so.
Recommended: tell these names as tests inside task-bench, for a `.php` file and for the suffixes Stryker covers, and keep `is_test` as it is, since changing it would change what `mutate-changes` skips; item 539 does the same for Rust. A product-owner finding on item 527's chunk raised this.
### 480. Resolve every path the tools use in one module: the release root (the folder the running code ships in), the config folder, the state folder and the Claude home. Then only that module names `~/.claude`, and the loop still runs from `~/.claude`.
Part of the standalone-install plan lilleman approved on 2026-11-20. `do-release` and `do-epic` stand for the names item 478 picks. Today about 160 references in some 40 modules name `~/.claude`; `bin/loop_state/paths.py` holds a few. This item changes no behaviour.