Skip to content

bench: junit-grade testFileFrom=task keeps grading assets out of the workDir - #110

Open
lec77 wants to merge 1 commit into
SJTU-IPADS:mainfrom
lec77:bench-junit-grade-task-assets
Open

bench: junit-grade testFileFrom=task keeps grading assets out of the workDir#110
lec77 wants to merge 1 commit into
SJTU-IPADS:mainfrom
lec77:bench-junit-grade-task-assets

Conversation

@lec77

@lec77 lec77 commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Problem

A junit-grade task can only ship its test file through fixtures/, and fixtures/ is copied into the workDir the agent runs in. So the grading assets — the test file itself, plus any sibling expected_* / golden outputs it reads — sit in a directory the agent can freely list, read, and overwrite. An agent that reads the answer key is not being graded on the task, and nothing in the results distinguishes that run from an honest one.

Change

Adds an optional testFileFrom to the evaluator payload:

  • "fixtures" (default) — today's behaviour, unchanged for every existing task.
  • "task"testFile and its sibling expected/golden files resolve against the task directory, which is never copied into the workDir.

The test subprocess still runs with cwd = workDir, so nothing changes for the code under test — only where the grader loads its own assets from. Bench conditions forward task.taskDir through EvaluatorConfig automatically, so a task opting in needs no wiring.

Verification

bunx tsc --noEmit clean; bun test 1299 pass / 0 fail. test/bench/evaluators/junit-grade.test.ts covers both resolution modes, sibling-file resolution, and the missing-taskDir error path; test/bench/run-condition.test.ts asserts conditions forward taskDir.

🤖 Generated with Claude Code

…workDir

A junit-graded task had to ship its test file through fixtures/, which is copied
into the agent-visible workDir — so the grading assets, including expected and
golden outputs, sat in the directory the agent is free to read and write. An
agent that reads the answer key is not being graded on the task.

Add an optional testFileFrom on the payload: with "task", testFile and its
sibling expected/golden files resolve against the task directory instead of
fixtures/, so they never enter the workDir. The test subprocess still runs with
cwd=workDir, so nothing changes for the code under test. Bench conditions
forward task.taskDir through EvaluatorConfig automatically, and the default
stays fixtures/ so existing tasks are unaffected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant