Keep a Rust file's test modules as planted when task-bench checks a fix
CI / tests (pull_request) Failing after 5m10s
CI / tests (pull_request) Failing after 5m10s
This commit is contained in:
@@ -29,8 +29,9 @@ 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. A Rust test that
|
||||
stands in the file of the code it tests is the exception: the bench takes that file whole, so a change to such a test counts.
|
||||
A test Haiku changed, removed or added doesn't count, and neither does a file under a `testdata` folder. In a Rust file, each
|
||||
inline `#[cfg(test)]` module stands as the planted file has it, and the rest is as Haiku left it. A Rust mutant is passed over
|
||||
where its file's modules cannot be told apart, as where two share a name or a brace, string or comment is never closed.
|
||||
|
||||
--image is the project's development image, such as golang:1.27.4. The bench adds Claude Code to it, as its installer installs it,
|
||||
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
|
||||
@@ -173,6 +174,7 @@ import uuid
|
||||
|
||||
from task_bench.tasks import Asked, Bench, BUG, check_made, committed, Kind, KINDS, on_disk, Planned, SHIPPED, Task, tests_in_copy
|
||||
from task_bench.planted_mutant import bug_at_sides, Mutant
|
||||
from task_bench.rust_test_modules import modules
|
||||
from claude_code.reply import Claude
|
||||
from task_bench.bench_folder import clear_left, held
|
||||
from task_bench.runs import closed, Containers, docker_cli, fix_attempted, MEMORY_MIB, opened, ran_tests, TimedOut, TOKEN, WORK
|
||||
@@ -489,7 +491,8 @@ def planted(bench: Bench, number: int, mutant: Mutant) -> Task | Failure | None:
|
||||
if isinstance(sources, Failure):
|
||||
return sources
|
||||
bugs = bug_at_sides(mutant, diff, sources)
|
||||
if bugs is None:
|
||||
# The check keeps a Rust file's test modules as planted, which it can only do where it tells them apart.
|
||||
if bugs is None or (mutant.path.endswith(".rs") and any(modules(source.decode("utf-8", "surrogateescape")) is None for source in bugs.values())):
|
||||
return None
|
||||
trees: dict[Side, str] = {}
|
||||
messages: dict[Side, str] = {}
|
||||
|
||||
Reference in New Issue
Block a user