The graded test suite is writable by the agent, and mutations are not detected
RepoTransAgent/run.py:67
shutil.copytree(self.target_base_path, self.working_path)
copies the whole target bundle — including tests/original/ — into the agent's working
directory. CreateFile accepts any path under that directory, so the agent can overwrite
the tests it is scored against. Nothing checks afterwards whether it did.
Observed
Running RepoTransAgent on antirez_smaz (C → Python, 20 iterations, Claude Haiku 4.5),
the agent rewrote a graded test:
tests/original/test_smaz_original.py
-def test_smaz_fixed_strings(smaz_mock_funcs):
+def test_smaz_original_fixed_strings(smaz_mock_funcs):
The other two test files were untouched. Re-scoring its final tree against the pristine
suite instead of its own copy, the rename was worth exactly one test — 8/24 became 7/21
under the harness's own parser.
Small in this instance. But it is unbounded in principle: an agent that stubs out or
deletes the assertions in tests/original/ scores higher, and the run records nothing
unusual. Since scoring reads the agent's copy rather than the bundle, the harness cannot
distinguish "solved the task" from "edited the test".
Why I am not sending a patch
The fixes I can see are design decisions, not bug fixes, and they belong to you:
- Grade from a pristine copy of
tests/ rather than the working tree.
- Mount or copy
tests/ read-only, and reject CreateFile paths that land inside it.
- Leave it writable but diff
tests/ against the bundle before scoring and flag or
invalidate runs that modified it.
(3) is the smallest and preserves current behaviour, since a legitimate translation never
needs to edit tests/original/. But which of these is right depends on whether you intend
the agent to be able to touch the target-language test scaffolding at all — for some
language pairs it plausibly does need to create build files next to the tests.
Happy to send a PR for whichever you prefer.
Two separate PRs are open against related issues, both self-contained:
and #4, which changes no behaviour: API credentials are logged to stdout and persisted into
conversation_logs/*.json.
The graded test suite is writable by the agent, and mutations are not detected
RepoTransAgent/run.py:67copies the whole target bundle — including
tests/original/— into the agent's workingdirectory.
CreateFileaccepts any path under that directory, so the agent can overwritethe tests it is scored against. Nothing checks afterwards whether it did.
Observed
Running
RepoTransAgentonantirez_smaz(C → Python, 20 iterations, Claude Haiku 4.5),the agent rewrote a graded test:
The other two test files were untouched. Re-scoring its final tree against the pristine
suite instead of its own copy, the rename was worth exactly one test — 8/24 became 7/21
under the harness's own parser.
Small in this instance. But it is unbounded in principle: an agent that stubs out or
deletes the assertions in
tests/original/scores higher, and the run records nothingunusual. Since scoring reads the agent's copy rather than the bundle, the harness cannot
distinguish "solved the task" from "edited the test".
Why I am not sending a patch
The fixes I can see are design decisions, not bug fixes, and they belong to you:
tests/rather than the working tree.tests/read-only, and rejectCreateFilepaths that land inside it.tests/against the bundle before scoring and flag orinvalidate runs that modified it.
(3) is the smallest and preserves current behaviour, since a legitimate translation never
needs to edit
tests/original/. But which of these is right depends on whether you intendthe agent to be able to touch the target-language test scaffolding at all — for some
language pairs it plausibly does need to create build files next to the tests.
Happy to send a PR for whichever you prefer.
Two separate PRs are open against related issues, both self-contained:
test_analyzer.py:126)treeis used byrun.py:246but not installed indocker/Dockerfileand #4, which changes no behaviour: API credentials are logged to stdout and persisted into
conversation_logs/*.json.