ci(validate-task): validate flat suites, not just <case>/task.json - #337
Closed
vaibhavdabas16 wants to merge 1 commit into
Closed
ci(validate-task): validate flat suites, not just <case>/task.json#337vaibhavdabas16 wants to merge 1 commit into
vaibhavdabas16 wants to merge 1 commit into
Conversation
validate-task.yml fired only on "test-cases/**/task.json", which cannot match claw-eval's 19 flat files (test-cases/claw-eval/ce-T046-cve-research.json and friends). The suite is a first-class --cases-suite target, registered in CASE_SUITES and offered in the TUI, so a malformed task there was reaching run time instead of failing review. The trigger was only half of it. The collector inside the workflow keyed on `path.name == "task.json"`, and the validate-everything glob was `test-cases/**/task.json`, so even once the workflow fired it would still have validated nothing from that suite. The issue guessed the checker "likely" handled flat files; it did not. Both layouts are now recognised, using the same rule the runner already applies -- batch._flat_case_files and tests/test_host_tasks treat every <suite>/*.json except eligibility-report.json as a case -- with a test pinning the two definitions together so CI cannot start checking a different set of files than the runner executes. The logic moves to scripts/ci/validate_tasks.py, following the pattern scripts/ci/check_markdown_links.py already set for validate-docs.yml. A 90-line heredoc inside YAML cannot be tested, which is precisely how the gap survived; the script's collection rules now have coverage. The workflow_dispatch path no longer builds a file list with `find` only to re-derive the same set in Python -- it calls the script with --all. Confirmed this does not turn CI red on merge: all 19 claw-eval tasks already validate against test-cases/task.schema.json, and none of them use extra_info. The full corpus is 300 task files excluding v1-lite, whose task.json entries are git symlinks this Windows checkout materialises as text. pyproject's pyright config gains extraPaths so the test can import the script. "src" is listed alongside "scripts/ci" because setting extraPaths replaces the implicit source root, which otherwise breaks resolution of clawbench itself. Fixes TIGER-AI-Lab#292.
Contributor
Author
|
Superseded by #334, which takes @Perry2004's suggested approach: instead of teaching the CI script to validate flat suites, the claw-eval port moves to the standard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes #292.
validate-task.ymlfired only ontest-cases/**/task.json, which cannot match claw-eval's 19 flat files (test-cases/claw-eval/ce-T046-cve-research.json, …). That suite is a first-class--cases-suitetarget — registered inCASE_SUITESand offered in the TUI — so a malformed task there reached run time instead of failing review.The trigger was only half of it
The issue guessed the checker itself "likely" handled flat files. It did not. The collector inside the workflow keyed on
path.name == "task.json", and the validate-everything branch globbedtest-cases/**/task.json. So even after broadening thepaths:filter, the workflow would have fired and then validated nothing from that suite — a green check that still proved nothing.Both halves are fixed, and both have tests.
Recognising the two layouts
The rule is taken from what the runner already does rather than invented here:
batch._flat_case_filesandtests/test_host_tasks._task_files_for_suiteboth treat every<suite>/*.jsonexcepteligibility-report.jsonas a case.test_the_flat_predicate_matches_the_runners_own_rulepins the two definitions together, so CI cannot quietly start checking a different set of files than the runner executes.Broadening the trigger to
test-cases/**/*.jsonalso means more non-task JSON reaches the collector, so the exclusions (task.schema.json,eligibility-report.json, anything underextra_info/, non-.json) are covered by their own test.Why the logic moved to a script
scripts/ci/validate_tasks.py, following the patternscripts/ci/check_markdown_links.pyalready set forvalidate-docs.yml. A 90-line Python heredoc embedded in YAML cannot be tested, which is precisely how this gap survived — the trigger and the collector were both wrong and nothing could have caught either. The collection rules now have coverage.While moving it: the
workflow_dispatchpath used to build a file list withfindonly for Python to re-derive the same set; it now calls the script with--all.Corpus
CI plumbing only — no task content changed. It does newly validate claw-eval, see below.
Test plan
test-cases/task.schema.json, and none of them useextra_info. Turning on a check for a suite that has never been checked is the obvious risk here, so I verified it before changing the trigger rather than after.test_the_real_claw_eval_suite_validateskeeps that true.tests/test_validate_tasks_script.py, 20 tests: both layouts recognised; non-task JSON excluded; the flat predicate agreeing with the runner's; changed flat task / changed nested task / changedextra_infopulling in its owner; a schema change re-validating both layouts; a deleted file not being read; a malformed flat task actually being reported; and the workflow's ownpaths:filter asserted forpull_requestandpush.task.jsonentries are git symlinks, mode120000, that this Windows checkout materialises as text; they resolve normally on the ubuntu runner.)ruff format --checkclean. Forruff checkI verified against the ruleset CI actually resolves (E4,E7,E9,F—pyproject.tomlsets noselect): both new files pass. The# noqa: E402on the script import is load-bearing — removing it producesE402 Module level import not at top of fileunder that exact ruleset, which I checked rather than assumed.pyright --pythonplatform Linux src/clawbench tests: 0 errors.Note on the
pyproject.tomlchange[tool.pyright]gainsextraPathsso the test can import the CI script."src"is listed alongside"scripts/ci"because settingextraPathsreplaces the implicit source root — with only"scripts/ci"there, pyright stops resolvingclawbenchitself and reports 32 errors in pre-existing test files. Flagging it since it's the one change outside CI's own files.Related issues
Fixes #292. Related: #291's markdown link checker established the
scripts/ci/pattern this follows.