Skip to content

feat(tasks): detect eval-task formats with tasks inspect - #210

Open
napetrov wants to merge 3 commits into
intel:mainfrom
napetrov:feat/task-format-detect
Open

napetrov wants to merge 3 commits into
intel:mainfrom
napetrov:feat/task-format-detect

Conversation

@napetrov

Copy link
Copy Markdown
Contributor

Summary

New dokimi tasks inspect <path> [--json]. It works out which eval-task format a file, task directory or tree is in, then reports the kind, the item count, which parts are present or missing (instruction / environment / oracle / verifier / metadata), lint problems, and which dokimi backends can consume it today. This PR only detects formats. It doesn't run or convert any new format, and tasks list / tasks run / catalog behave as before.

 dokimi/dokimi/
+├── task_formats/        # tracks layer (added to LAYERS)
+│   ├── model.py         # Fingerprint, Report, Probe protocol
+│   ├── source.py        # parse each file once, safely (YAML aliases refused, .py never imported)
+│   ├── dirs.py          # harbor + task-md (wrap harnesses.tasks), terminal-bench v1
+│   ├── datasets.py      # swe-bench, inspect samples, openai evals, skill-creator x2, skill-reach, questions
+│   ├── configs.py       # promptfoo, Inspect @task (regex text scan)
+│   └── detect.py        # registry, ambiguity, tree scan, unknown fallback
 └── commands/tasks.py    # + `tasks inspect`
Format Kind Consumable by
harbor executable harbor (when harbor_task_problem is None), docker-*
task-md executable benchflow, docker-*
terminal-bench-v1 executable none-yet
swe-bench executable none-yet
inspect-samples answer-only none-yet
inspect-task (.py) answer-only (executable when it has sandbox=) none-yet
openai-evals answer-only none-yet
skill-creator-evals answer-only none-yet
skill-creator-trigger trigger none-yet
skill-reach trigger none-yet
dokimi-questions (v1/v2) answer-only (trigger when it has expected_skill) questions track (when load_questions accepts it)
unknown unknown lists files/keys plus likely prompt and verifier files

I took field names from upstream source, not from memory: SWE-bench swebench/types.py, Inspect dataset/_dataset.py (Sample / FieldSpec), terminal-bench original-tasks/* (241 task.yaml keys tallied), skill-creator references/schemas.md and SKILL.md, skill-reach models.py / queries.py (including the legacy id -> query_id migration and the out_of_scope rule), the promptfoo examples (149 configs tallied), and openai/evals docs/build-eval.md.

Evidence

  • Before: tasks inspect doesn't exist, and nothing reads the trigger sets that dokimi writes.
    After: a run over real upstream samples:
original-tasks/hello-world        terminal-bench-v1  executable          -> none-yet
swe-bench/lite-3.jsonl (HF Lite)  swe-bench          executable  3 items -> none-yet
openai-evals/match.jsonl (coqa)   openai-evals       answer-only 5 items -> none-yet
inspect examples/computer.py      inspect-task       executable  1 item  -> none-yet
inspect _examples/security_guide  inspect-samples    answer-only 16 items
promptfoo examples x2             promptfoo          answer-only
intel-skills skills/*/evals.json  skill-creator-evals x10
intel-skills evaluation/harbor    harbor x15         -> harbor, docker-*
benchflow demo_task               task-md            -> benchflow, docker-*  (+ drift problem)
  • tests/test_task_format_detect.py: 37 tests. They cover every format, ambiguity, unknown, malformed JSON/JSONL/YAML/TOML/YAML-alias inputs (each becomes a problem, not a crash), an Inspect file that would write a marker if imported (the marker is never written), a mixed tree, and a regression check that discover_tasks is unchanged.
  • make ci-local: tests (7840 passed), mypy, ruff, growth, import contract, coverage, mkdocs and cli-surface all pass. pip-audit fails on the setuptools GHSA-xmj3-9gf7-h52w advisory; that failure is on main too and isn't caused by this PR.

Merge Danger

Door: two-way. It adds a new command and a new package and changes no existing behaviour or persisted format. The --json output isn't a versioned artifact yet.

Blast Radius: additive

🤖 Generated with Claude Code

A probe registry (dokimi.task_formats) names the format of a file, a task
directory or a tree, and reports kind, item count, present/missing parts,
lint problems and which dokimi backends consume it today. Probes: harbor and
task-md (wrapping harnesses.tasks), terminal-bench v1, SWE-bench, Inspect AI
samples and @task files (text scan, never imported), OpenAI evals,
skill-creator evals.json and trigger sets, skill-reach QuerySet, promptfoo
and dokimi questions. Unknown paths get a best-effort structure report;
malformed files are lint problems. Detection only: nothing new runs.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
@github-actions github-actions Bot added the cli-interface-change Changes dokimi's user-facing CLI surface label Oct 24, 2026
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

CLI interface change detected

This PR changes dokimi's user-facing CLI surface (commands and/or options):

+ added command `dokimi tasks inspect`
    + argument `path`
    + option `--help/-h`
    + option `--json`
    + option `--out`

Updated on every push; the cli-interface-change label is on while the diff is non-empty.

@codecov-commenter

codecov-commenter commented Oct 24, 2026 •

Copy link
Copy Markdown

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

Codecov Report

❌ Patch coverage is 93.93258% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.07%. Comparing base (09be35b) to head (e4b4e80).

Files with missing lines Patch % Lines
dokimi/dokimi/task_formats/source.py 84.11% 12 Missing and 5 partials ⚠️
dokimi/dokimi/task_formats/detect.py 87.96% 8 Missing and 5 partials ⚠️
dokimi/dokimi/task_formats/datasets.py 95.95% 5 Missing and 5 partials ⚠️
dokimi/dokimi/task_formats/dirs.py 91.08% 4 Missing and 5 partials ⚠️
dokimi/dokimi/task_formats/configs.py 97.71% 1 Missing and 3 partials ⚠️
dokimi/dokimi/commands/tasks.py 97.43% 0 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #210      +/-   ##
==========================================
+ Coverage   92.01%   92.07%   +0.05%     
==========================================
  Files         223      232       +9     
  Lines       27768    28658     +890     
  Branches     4563     4686     +123     
==========================================
+ Hits        25552    26388     +836     
- Misses       1570     1600      +30     
- Partials      646      670      +24     
Files with missing lines Coverage Δ
dokimi/dokimi/__init__.py 100.00% <ø> (ø)
dokimi/dokimi/artifacts.py 95.12% <ø> (ø)
dokimi/dokimi/task_formats/__init__.py 100.00% <100.00%> (ø)
dokimi/dokimi/task_formats/links.py 100.00% <100.00%> (ø)
dokimi/dokimi/task_formats/model.py 100.00% <100.00%> (ø)
dokimi/dokimi/task_formats/pointers.py 100.00% <100.00%> (ø)
dokimi/dokimi/commands/tasks.py 92.77% <97.43%> (+1.43%) ⬆️
dokimi/dokimi/task_formats/configs.py 97.71% <97.71%> (ø)
dokimi/dokimi/task_formats/dirs.py 91.08% <91.08%> (ø)
dokimi/dokimi/task_formats/datasets.py 95.95% <95.95%> (ø)
... and 2 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

`tasks inspect --json` now prints a stamped task_inspect.v1 artifact and
`--out FILE` writes it through save_artifact, as `repo budget` does.

Probes added or widened from runs over upstream checkouts:
- a dataset file a config names is read as that config says: Inspect
  FieldSpec remaps, OpenAI evals registry specs (openai-evals-spec, with
  model-graded samples needing no ideal), promptfoo `tests: file://`
  (promptfoo-tests);
- git-LFS pointer stubs are git-lfs-pointer, with the expected format
  when a config names them;
- CSV datasets, promptfooconfig.<variant>.yaml and redteam configs,
  ExploreBench task YAML (dokimi-explore-task, localization);
- a task.md with no BenchFlow front matter and no task part directories
  is no longer a task-md task.
YAML aliases are reported as refused, not as invalid YAML.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
tests/fixtures/task_formats/ holds small upstream files of every format
the probes know (intel/skills, skillsbench, terminal-bench, Inspect AI,
openai/evals, promptfoo; licenses in LICENSES/) and generated ones where
no public file exists (SWE-bench row, skill-creator evals.json,
skill-reach QuerySet, and the output of dokimi's trigger-set writers).
MANIFEST.yaml records each file's source, commit and license and what
inspect must report; test_task_format_corpus.py inspects the corpus as
one mixed tree, validates every --json report as task_inspect.v1, and
reads back what to_skill_creator, to_reach and to_questions write.

The fixture tree is kept out of pytest collection, ruff and the license
header check: its test_*.py are the verifiers of copied tasks.

Fixes found on the way: a task.md scan leaked the loader's UserWarning
from the fingerprint, and a path that is neither file nor directory
(/dev/null) crashed the tree scan.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
napetrov added a commit to napetrov/dokimi that referenced this pull request Oct 24, 2026
…azily

A task.yaml task loads as a TaskSpec and runs under docker-oracle and
docker-claude as terminal-bench's harness runs it (solution.sh at /oracle,
run-tests.sh + tests/ at /tests, image user, TEST_DIR and compose env,
pytest-summary verdict). Tasks one docker run cannot reproduce are refused
with the reason. Harbor-backed harnesses and benchflow run a content-keyed
Harbor export whose test.sh applies the same pytest-summary rule.

Stacked on intel#210.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli-interface-change Changes dokimi's user-facing CLI surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants