Skip to content

fix(readers): dashboard generate and hits judge refuse a directory they cannot list, eval inspect reports it - #1390

Merged
xaleryb merged 5 commits into
intel:mainfrom
antonwolfy:fix/unlistable-input-readers
Nov 29, 2026
Merged

xaleryb merged 5 commits into
intel:mainfrom
antonwolfy:fix/unlistable-input-readers

Conversation

@antonwolfy

@antonwolfy antonwolfy commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

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. On main, with a tree whose sub directory is chmod 111:

Reader Input Output on main
dashboard generate (#1360) results/top/eval_x.json, results/sub/eval_y.json exit 0, a dashboard of top/eval_x.json only
repo hits judge / repo hits sheet (#1364) task under _eval/content/sub/task1/task.json the pair is "not judged: no directory of task task1 with a task.json under /_eval/content", blaming a missing task, exit 0
eval inspect (#1365) ok/task.md and sub/mytask/task.md one item, ok; sub/mytask is not reported

Fixes taken:

Closes #1360
Closes #1364
Closes #1365

The same cause in repo_glob.py:29 (reached through repo_config) is tracked in #1387, in commands/catalog_novelty.py:479 in #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_files replaces the three rglob calls (eval/*.json, then eval_*.json, then evaluations/*.json: the three patterns are listed in that order, one list after the other; aggregate still deduplicates and sorts). An eval or evaluations that is a symlink to a directory is read through, as rglob named it (a symlink with another name is not read); the name is matched with Path.match, so a Windows run reads EVAL and Evaluations too. A results path that is not a directory has no files. commands/dashboard.py turns the OSError into an InputError naming the results directory and the unlistable one. docs/benchmarking-and-comparison.md says so in one sentence.
  • dokimi/repos/hits_judge.py: _Texts.task_dir lists <batch>/_eval/content with listed_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.walk reports a directory it cannot list as an unknown item. docs/coding-harnesses.md says so in one sentence.
  • Tests: tests/test_dashboard_cli.py (exit 2 naming the directory), tests/test_dashboard.py (a listable tree gives the files of the three rglobs, 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 mode 0o111 directory (root).
  • Changelog fragment (Fixed), one for the three readers.

Risk

Testing

On a Linux review host, at 7868a1d5 (on main 52f9de6):

  • 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.
  • Windows-style names: _result_files fed 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 of Path.match, that test fails.
  • A results tree with results/eval a symlink to a directory of snapshots and results/x/evaluations another: rglob lists eval/a.json and x/evaluations/a.json; the strict listing alone listed none. _result_files now lists both (tests/test_dashboard.py). Three mutants, each failing a test there: the symlink branch dropped, the eval/evaluations name check dropped (a symlink named other to a mode 0o111 directory then raises), the is_dir check dropped (a dangling eval link then raises).
  • The repros of the three issues (a mode 0o111 directory, as a non-root user) fail on main as the table shows and pass here. The new tests on main's code: test_dashboard_cli.py 1 failed, 4 passed (exit 0, not 2); test_repo_hits_judge_unlistable.py 2 failed, 1 passed (exit 0, not 2); test_task_format_detect.py 1 failed, 75 passed (KeyError: 'sub'). test_dashboard.py passes on main's code: it pins that a listable tree gives the same files.
  • Six mutants, one break per copy, each fails the test that pins it: the evaluations/*.json pattern dropped, the not-a-directory guard dropped, the InputError conversion in dashboard generate dropped, the OSError of task_dir swallowed, the missing-content guard dropped, the unknown item of _Scan.walk dropped.
  • Merged together with fix/unlistable-run-trees on main 52f9de6: pytest -n auto 30834 passed, 27 skipped, mypy clean, ruff check clean.
  • Not run: the other Python versions (3.11, 3.12, 3.14), Windows (the Path.match calls keep the case-insensitive matching rglob had 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

  • Tests added/updated and pytest passes
  • ruff, mypy, and schema checks pass
  • Docs updated (or N/A) — see the docs-drift checklist in CONTRIBUTING.md
  • Self-reviewed per "Before opening a PR" in AGENTS.md
  • Each new raise/exit and test names the doc, contract or issue it traces to
  • No ad-hoc run artifacts committed
  • New files carry the SPDX license header (or are exempt in .github/.licenserc.yaml)

…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>
@exai-bot

exai-bot commented Nov 28, 2026 •

Copy link
Copy Markdown

✅ OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s).

CI at 7868a1d: 25 passing, 4 skipped.

Test notes (1)
  • dokimi/tests/test_repo_hits_judge_unlistable.py: dokimi/tests/test_repo_hits_judge_unlistable.py passes at the head and also at the merge base, where the code this pull request changes is still as it was. No test in it fails without the change, so none of them would notice if the change were undone.
Review details
  • Commit reviewed: 7868a1d against merge base 74fe4a4
  • Coverage: 2 files in 1 groups
  • Engine: OpenCodeReview v1.13.5-exai.4.8f73eada, us.openai.gpt-6.1-sol
  • Usage: 49k tokens (29k from cache), 17s
  • Tool calls: 4 (4 file_read)
  • small change set: 2 files

Comment thread dokimi/dokimi/dashboard/aggregator.py Resolved
… 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-commenter

codecov-commenter commented Nov 28, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.22%. Comparing base (52f9de6) to head (7868a1d).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

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     
Files with missing lines Coverage Δ
dokimi/dokimi/commands/dashboard.py 97.87% <100.00%> (+0.14%) ⬆️
dokimi/dokimi/dashboard/aggregator.py 98.11% <100.00%> (+0.11%) ⬆️
dokimi/dokimi/repos/hits_judge.py 92.78% <100.00%> (+0.93%) ⬆️
dokimi/dokimi/task_formats/detect.py 100.00% <100.00%> (+1.70%) ⬆️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread dokimi/dokimi/dashboard/aggregator.py Resolved
…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

xaleryb commented Nov 29, 2026

Copy link
Copy Markdown
Contributor
  • Ran: the full suite and gates (ruff, mypy, bandit, growth, comment-block) on this head merged with current main; a real non-root chmod 111 directory through dashboard generate, hits judge and eval inspect; a readable results tree compared with main; 10 mutants of the new guards.
  • No open findings. An unlistable directory now exits 2 with cannot list the results in ... (the InputError convention), eval inspect reports it as an unknown item, and a readable tree gives the same output as main.
  • Both earlier symlink threads are fixed: the read-through and the case-insensitive name match each fail a test when reverted.
  • The note that the hits test passes at the merge base does not hold against main: with main's dokimi/ code both parametrized cases exit 0 and fail.
  • No commits from us; nothing left for the author.

@xaleryb xaleryb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@xaleryb
xaleryb merged commit fef4939 into intel:main Nov 29, 2026
37 of 38 checks passed
@antonwolfy
antonwolfy deleted the fix/unlistable-input-readers branch November 29, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants