refactor(claw-eval): use the standard <task>/task.json layout - #334
Conversation
Perry2004
left a comment
There was a problem hiding this comment.
Thanks for the contribution. Though I'd suggest an alternative approach:
- Instead of changing the workflow it's better to use this chance to re-organize the claw-eval port's structure. It should go with the standard
test-cases/claw-eval/<task-identifier>/task.jsonstructure as native ClawBench tasks. - After the structure change we can then simplify the TUI and batch discovery logic to a standard
task.jsonsearch. - I believe there's no need for extracting the json schema validation logic to a separate script and add tests on it given the simplicity of the logic.
The claw-eval port shipped as flat test-cases/claw-eval/<name>.json files while every native corpus uses <name>/task.json. That one difference is what TIGER-AI-Lab#292 is actually about: the validate-task workflow selects on task.json in four separate places -- the paths: trigger, the workflow_dispatch find, the schema-changed glob, and the per-changed-path test -- so none of them ever saw the suite. Move the 19 tasks into directories and the workflow covers them with no change to the workflow. Discovery goes back to a plain */task.json search: - batch._all_cases_in drops _flat_case_files entirely - batch.discover_cases drops the "or a bare .json file" pattern branch - tui.load_cases drops its parallel flat glob - test_host_tasks stops assembling task files from two globs, and can assert every discovered case is a directory containing task.json The eligibility-report.json exclusion goes with them; it existed only to keep a non-task file out of the flat glob. Verified against the workflow's own selection logic, unmodified: it now selects 320 task files where it previously selected 301, the 19 new ones being claw-eval, and all 19 validate cleanly against task.schema.json including the extra_info path-existence check. So this turns the job on for the suite without turning it red. (The 20 v1-lite JSON errors that show up locally are a Windows checkout artifact -- v1-lite is symlinks -- and are present on main.)
13175ad to
3f3599d
Compare
|
Thanks — took all three points; the PR is rewritten rather than patched, so it is worth reading fresh.
Agreed, and it is the better fix for a reason I had missed: with the layout corrected, the workflow needs no change at all. All four of its selection rules — the
Done, and it removed more than I expected:
The 9 insertions, 30 deletions outside the file moves.
Dropped — Verification. Ran the workflow's own selection logic, unmodified, against the restructured tree: it selects 320 task files where it previously selected 301, the 19 new ones being claw-eval, and all 19 validate cleanly against Test suite unchanged from I will close #337 as superseded — it taught the CI script to validate flat suites, and there are none left. |
|
CI green, and this run is the demonstration the previous version of this PR could not give.
All 19 are claw-eval. Before this change the same job on the same suite selected zero — the run on the old branch reported Run: https://github.com/TIGER-AI-Lab/ClawBench/actions/runs/33666380236 |
Closes #292. Rewritten to take @Perry2004's suggested approach — this PR no longer touches the workflow at all. See the review reply below for what changed and why.
The problem
test-cases/claw-eval/shipped as flat<task-identifier>.jsonfiles while every native corpus uses<task-identifier>/task.json.validate-taskselects ontask.jsonin four separate places:paths:trigger (PR + push)test-cases/**/task.jsonworkflow_dispatchfallbackfind test-cases -path "*/task.json"repo.glob("test-cases/**/task.json")path.name == "task.json"None of them ever saw the suite. Nineteen tasks could be added, edited or broken without the job noticing.
The fix
Move the 19 tasks into directories. The workflow then covers them with no change to the workflow — every rule above already does the right thing once the layout matches.
Discovery collapses back to a plain
*/task.jsonsearch:batch._all_cases_indrops_flat_case_filesentirelybatch.discover_casesdrops its "…or a bare.jsonfile" pattern branchtui.load_casesdrops its parallel flat globtest_host_tasksstops assembling task files from two globs, and can now assert every discovered case is a directory containingtask.jsonThe
eligibility-report.jsonexclusion goes with them — it existed only to keep a non-task file out of the flat glob.Net: 9 insertions, 30 deletions outside the file moves.
Verification
Ran the workflow's own selection logic, unmodified, against the new tree:
301 before, 320 after. All 19 validate cleanly against
task.schema.json, including theextra_infopath-existence check — so this turns the job on for the suite without turning it red, which is worth confirming separately: a trigger fix that surfaced 19 broken tasks would be a different PR.213 passed, 4 skipped— unchanged frommain. (test_host_tasks.py::…[v1-lite]fails onmaintoo on Windows:v1-liteis symlinks, which check out as text files. Same cause as the 20v1-liteJSON errors in the local validation run above. Unrelated to this change.)Also checked by hand:
clawbench-batch --cases-dir test-cases/claw-eval --all-casesdiscovers all 19, and pattern matching (--cases 'ce-T046*') still resolves.One correction to the issue text
#292 states claw-eval was entirely unchecked. Not quite:
tests/test_host_tasks.pyglobbed the flat files and calledvalidate_task_data(), which checks four fields. What never reached the suite was the fulltask.schema.jsonvalidation and theextra_infopath-existence check. That is the real gap, and it is what this closes.Supersedes #337
#337 taught the CI script to validate flat suites. With no flat suites left, there is nothing for it to teach — closing it.