Repository navigation
fix(readers): dashboard generate and hits judge refuse a directory they cannot list, eval inspect reports it - #1390
Conversation
…ntel#1360) `ResultsAggregator.aggregate` found the result files with three `rglob` calls, which skip a subdirectory they cannot list (mode 0o111) without an error, so `results/sub/eval_y.json` was missing from the dashboard and nothing said so. It now lists the tree once with `listed_entries`, which raises the `OSError`, and keeps the entries the three patterns matched (`Path.match`, so a Windows run still ignores case). `dashboard generate` reports the error as an input error with exit 2, naming the directory. A tree that can be listed gives the same files in the same order of concatenation. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
…ot list (intel#1364) `_Texts.task_dir` found a task with `rglob("task.json")` over `<batch>/_eval/content`, which skips a directory it cannot list (mode 0o111), so a task below it was reported as "no directory of task ... with a task.json", which blames a missing task and not a permission. It now lists the content with `listed_entries` and filters by name (`Path.match`). A directory it cannot list raises `HitsInputError` naming the directory and the OS reason, which `repo hits judge` and `repo hits sheet` already report as an input error with exit 2 before any judge call. A content directory that does not exist, and a task that is really absent, behave as before. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
…ping it (intel#1365) `_Scan.walk` listed a directory with `iterdir()` inside `except OSError: return`, so the tasks below a directory it could not list (mode 0o111) were left out of `eval inspect` and nothing said so. On that `OSError` the walk now adds the directory as an `unknown` entry with the problem `cannot read: <error>` and returns, as it already does for a `task.md` it cannot read. The walk keeps its own recursion, skip rules and file cap, and the other tasks of the tree are still reported; a root that cannot be listed is the same entry. `eval inspect` still exits 0 for an `unknown` entry. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s). CI at Test notes (1)
Review details
|
… rglob does Settles the exai-bot thread on aggregator.py:95: the strict listing never descends into a symlink, so a results/eval that links to a directory of snapshots lost its files, where the old rglob followed it. _result_files now lists the children of an eval or evaluations symlink to a directory (iterdir, so an unlistable target still raises), and a test compares it with the rglob lists. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1390 +/- ##
==========================================
- Coverage 96.22% 96.22% -0.01%
==========================================
Files 509 509
Lines 67762 67781 +19
Branches 11766 11769 +3
==========================================
+ Hits 65203 65221 +18
+ Misses 1576 1575 -1
- Partials 983 985 +2
🚀 New features to boost your workflow:
|
…o case where paths do Settles the review point that the symlink check compared the name as lowercase text, while rglob and the later Path.match are case-insensitive on Windows, so results/EVAL or results/Evaluations as a directory symlink was not read through there. The check now uses Path.match, as the patterns after it do. A test feeds Windows paths to _result_files and fails with the old comparison. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
|
xaleryb
left a comment
There was a problem hiding this comment.
Approved on 7868a1d. dashboard generate and hits judge exit 2 naming a results directory they cannot list, eval inspect reports it, and a readable tree gives the same output as main (checked with a real chmod 111 directory and 10 mutants). Both symlink threads are fixed. Windows smoke had not started (the hosted Windows queue was stuck); every other check passed.
Summary
Three readers list a user's tree with a call that skips a directory it cannot list (mode
0o111, a non-root user) without an error, so results are missing and nothing says so. Onmain, with a tree whosesubdirectory ischmod 111:maindashboard generate(#1360)results/top/eval_x.json,results/sub/eval_y.jsontop/eval_x.jsononlyrepo hits judge/repo hits sheet(#1364)_eval/content/sub/task1/task.jsoneval inspect(#1365)ok/task.mdandsub/mytask/task.mdok;sub/mytaskis not reportedFixes taken:
ResultsAggregator.aggregatelists the tree once withdigest_entries.listed_entries, which raises theOSError, and keeps the entries the threerglobpatterns matched (Path.match, so a Windows run still ignores case).dashboard generatereports the error as an input error, exit 2._Texts.task_dirlists withlisted_entriesand filters by name. The error is aHitsInputError, the typerepo hits judgeandrepo hits sheetalready report as an input error (exit 2) before any judge call._Scan.walkadds the directory as anunknownitem with the problemcannot read: <error>, as it already does for atask.mdit cannot read, and goes on with the rest of the tree. The other option (raise and map toInputError) was not taken: one unreadable subdirectory would hide every task found in the rest of the tree.listed_entriesdoes not fit this walk, which keeps its own recursion, skip rules and file cap.Closes #1360
Closes #1364
Closes #1365
The same cause in
repo_glob.py:29(reached throughrepo_config) is tracked in #1387, incommands/catalog_novelty.py:479in #1388, and in the globs that read a root directory they cannot list as empty (harnesses/benchflow.py,skills/formats.py,report/summary.py,agent_profiles/loader.py,commands/subjects.py) in #1389.Changes
dokimi/dashboard/aggregator.py:_result_filesreplaces the threerglobcalls (eval/*.json, theneval_*.json, thenevaluations/*.json: the three patterns are listed in that order, one list after the other;aggregatestill deduplicates and sorts). Anevalorevaluationsthat is a symlink to a directory is read through, asrglobnamed it (a symlink with another name is not read); the name is matched withPath.match, so a Windows run readsEVALandEvaluationstoo. A results path that is not a directory has no files.commands/dashboard.pyturns theOSErrorinto anInputErrornaming the results directory and the unlistable one.docs/benchmarking-and-comparison.mdsays so in one sentence.dokimi/repos/hits_judge.py:_Texts.task_dirlists<batch>/_eval/contentwithlisted_entries. A content directory that does not exist, and a task that is really absent, report "no directory of task ..." as before.dokimi/task_formats/detect.py:_Scan.walkreports a directory it cannot list as anunknownitem.docs/coding-harnesses.mdsays so in one sentence.tests/test_dashboard_cli.py(exit 2 naming the directory),tests/test_dashboard.py(a listable tree gives the files of the threerglobs, one of them twice),tests/test_repo_hits_judge_unlistable.py(judge and sheet exit 2, no call made; a batch with no exported content),tests/test_task_format_detect.py(the unreadable directory is an item and the table prints it). Each skips when the process can list a mode0o111directory (root).Risk
dashboard generateexits 2 where it exited 0 with a smaller dashboard, for a results tree with a directory it cannot list.repo hits judgeandrepo hits sheetexit 2 where they reported the pair as not judged, for a batch whose_eval/contenthas a directory they cannot list.eval inspectlists one more item (the directory, formatunknown, with a problem). Its exit code is unchanged:cmd_tasks_inspectreturns normally for anunknownitem, so 0, with the item in the table and underitemsof the--jsondocument. A tree that can be listed gives the same items, files and order as before.InputErrorimport line ofcommands/dashboard.py, and Part of #94 (F1b, model + judge) #1197 changes other paragraphs ofdocs/benchmarking-and-comparison.md.Testing
On a Linux review host, at
7868a1d5(onmain52f9de6):make ci-local: 38 passed, 0 failed, 16 skipped (steps that need docker and network, a job condition of a PR run, micromamba, semgrep, other matrix legs). 30831 tests passed, 27 skipped; changed-line coverage 100%; mutation of changed lines: 25 mutants, 25 killed, 0 survived._result_filesfed entries whose relative paths are Windows paths (EVAL,x\Evaluations, symlinks to a directory) reads through both (tests/test_dashboard.py); with the name check compared as lowercase text instead ofPath.match, that test fails.results/evala symlink to a directory of snapshots andresults/x/evaluationsanother:rgloblistseval/a.jsonandx/evaluations/a.json; the strict listing alone listed none._result_filesnow lists both (tests/test_dashboard.py). Three mutants, each failing a test there: the symlink branch dropped, theeval/evaluationsname check dropped (a symlink namedotherto a mode0o111directory then raises), theis_dircheck dropped (a danglingevallink then raises).0o111directory, as a non-root user) fail onmainas the table shows and pass here. The new tests onmain's code:test_dashboard_cli.py1 failed, 4 passed (exit 0, not 2);test_repo_hits_judge_unlistable.py2 failed, 1 passed (exit 0, not 2);test_task_format_detect.py1 failed, 75 passed (KeyError: 'sub').test_dashboard.pypasses onmain's code: it pins that a listable tree gives the same files.evaluations/*.jsonpattern dropped, the not-a-directory guard dropped, theInputErrorconversion indashboard generatedropped, theOSErroroftask_dirswallowed, the missing-content guard dropped, theunknownitem of_Scan.walkdropped.fix/unlistable-run-treesonmain52f9de6:pytest -n auto30834 passed, 27 skipped,mypyclean,ruff checkclean.Path.matchcalls keep the case-insensitive matchingrglobhad there), and the run as root, where the new tests skip.Open questions
None.
Revert
A plain revert restores the old behaviour. Nothing is stored.
Checklist
pytestpassesruff,mypy, and schema checks passAGENTS.mdraise/exit and test names the doc, contract or issue it traces to.github/.licenserc.yaml)