Repository evaluation contract¶
Status: implemented core with scoped extensions. Validation, static scanning, reach, task execution, reporting and arm comparison are available. Individual sections describe their limits and proposed extensions. The rationale is recorded in the pull requests that build it out. See the feature cards. Implemented so far (slice S1): the
repo_manifest.v1schema, validation of the manifest and of everytask.jsonagainst one repository snapshot (with git history, every task base must resolve and the guidance globs are evaluated at each base), therepo_static.v1schema (§4.4), the suite manifest for bases in other repositories (§2.1), and thereposubject kind:python cli.py eval check --schema-only <dir | dir@rev | url@rev> --manifest <path> [--json] [--fail-on warn|fail] python cli.py repo fetch <url@rev> [--json] # bare, blob-less clone cached per URLSlice S3 adds harness profiles (§6) and the reach probe (§7):
python cli.py repo reach <source> --manifest <path> --model <id> [--harness claude-code|codex|copilot|copilot-review|<profile.yaml>] [--bin <cli>] [--scenarios root,cwd,read[,shadow]] [--only <scenario>] [--dry-run]Slice S2 adds the L0 scan (§8):
python cli.py repo scan <source> --manifest <path> [--static <repo_static.json>] [--out readiness.json] [--json] [--fail-on fail] [--baseline <earlier readiness.json>]
repo budgetsizes what the tree puts into an agent's context (no manifest, no LLM call): root CLAUDE.md files and their@imports plus the skill listing at start (AGENTS.md files and their imports too, unless a root CLAUDE*,.claude/CLAUDE.mdorCLAUDE.local.mdturns them off), nested guidance lazily, skill bodies on demand, and AGENTS.md files a root CLAUDE* turns off, or a CLAUDE.md,CLAUDE.local.mdor.claude/CLAUDE.mdin the AGENTS.md file's own directory (not one in a parent below the root). Both rules hold only with a profile that setsguidance.claude_displaces_agents, asclaude-codedoes: withcopilot, a root AGENTS.md isstartbeside a root CLAUDE.md. Imports are followed only with a profile that declaresguidance.imports(claude-code; it is null forcodexandcopilot). For a profile withguidance.claude_rules(claude-code),.claude/rules/**/*.mdfiles areruleentries: at start in the root.claude/rules/unless their frontmatter'spathsnames a pattern, lazily then and in a subdirectory's.claude/rules/; a rule a root CLAUDE.md or AGENTS.md imports isstartwhatever itspaths; an@path in a rule is not followed, unless a CLAUDE.md or AGENTS.md imports the rule: then its@imports are followed, transitively and within the hop limit. A root import loads the rule at start; a nested CLAUDE.md import loads it lazily, when that nested file is read. Thestarttotal is not an upper bound: it is too low by what it does not count (non-.mdimports, skills behind a linked directory, rules behind a link at or below.claude/rulesto a directory or a root.claudelink, or a submodule there, which warns, nested.claude/skills/skills, and imports past the profile'sguidance.import_max_depth, four hops for Claude Code, which warns naming what was skipped), and too high by whatever the harness cuts from the skill listing. Usage:python cli.py repo budget <source> [--harness claude-code] [--out FILE] [--json] [--fail-on warn]
--outcarries the inventory as arepo_budget.v1artifact (schemas/repo_budget.v1.json), stamped with itsschema_version;--jsonprints the same artifact underdataof acli_output.v1document.
repo inspect(§8.1) needs no manifest: a static look at what the tree offers an agent.python cli.py repo inspect <source> [--index index.scip] [--out environment.json] [--json] [--large-bytes N] [--fail-on warn|fail]
--manifest-file <local.yaml>onvalidate,scanandreachreads the manifest from outside the tree, for a repository that has not added it yet.scanandreachneed onlyguidance; given neither a manifest in the tree nor--manifest-file, they check the default globs**/AGENTS.md,**/CLAUDE.md,.github/copilot-instructions.mdand.github/instructions/*.md, and say so on stderr. Therescanalso checks the Markdown files Claude Code loads with them, whichrepo budgetlists asruleandimportfor theclaude-codeprofile:.claude/rules/**/*.mdand the files a CLAUDE.md@import chain reaches. It also checks a committedCLAUDE.local.mdthat nothing imports (a gitignored one is not in the tree), because Claude Code loads it with the project's guidance. Every rule file is checked, loaded or not: a rule whosepathspattern is invalid is counted lazy byrepo budget, and a stale path in it is still stale. A rule the tree cannot list (a link to the rules directory, a root.claudelink, a submodule at.claudeor under.claude/rules, a dangling link) makes the scanincomplete. They are named by path, so a tree without them gets no warning.Slice S5 adds the repository-mode runner: workspace preparation (§3), the containers of §1.1, the
repo_grade.v1schema (§4.2), the self-check (§4.3) and agent runs with their report:python cli.py eval check <source> --manifest <path> [--task <id>] [--warm] [--allow-unsupported] python cli.py repo run <source> --manifest <path> --arm guidance:raw --model <id> --reps N --name NAME --agent-network host python cli.py repo report <out>/<batch> python cli.py repo compare <out>/<batch> --baseline guidance:noneNot implemented yet: the egress proxy (§2), so a task with
egressis refused and an agent reaches its model only through an explicit--agent-network; running thestaticentry point; the regrade sample of §4.2; and the split by base date against a model's cutoff. See Running below.
A repository that wants to be evaluated keeps its evaluation content in its own tree: a manifest, tasks, graders and a build image. Dokimi reads that content, runs agents against it, and reports the results. Nothing repository-specific is added to dokimi.
1. What the repository provides¶
<repo>/
<eval-dir>/ # any path; default .agent-eval/
repo-eval.yaml # manifest (§2)
tasks/<task-id>/task.json # one directory per task (§3)
tasks/<task-id>/... # patches, hidden tests, review gold, mutants
<grader code> # whatever the `grade` entry point runs (§4)
Dockerfile # build image for this repository
The framework removes <eval-dir> from every agent workspace, so tasks, gold
answers and graders are never visible to the agent.
1.1 Where the evaluation content comes from¶
Two trees are involved in every run:
- the eval tree: the revision the manifest was loaded from, for example
oneDAL@<sha of the PR that added the tasks>. Tasks, graders, the Dockerfile and the manifest are read from it. - the task tree: each task's
base, which is usually older and may not contain<eval-dir>at all.
The framework copies <eval-dir> from the eval tree to a read-only directory
outside every workspace and passes its absolute path to entry points as
{eval_dir} (§2). The agent never sees it:
- The agent runs in its own container, which mounts only the workspace, the
per-run scratch and config dirs, and the caches.
{eval_dir}and{source_dir}are not mounted.task.json,meta.json,events.jsonlandanswer.txtare written to{run_dir}after the agent's container exits. gradeandoraclerun in a separate container from the same image, after the agent's container has exited. That container mounts{eval_dir}and{source_dir}read-only and{run_dir}read-write (and, for a built-in grader (§4.5), the framework's grader code at/eval/graders, read-only). It gets aHOMEof its own ({run_dir}/grade-home, made empty before each run; the agent never had it),PYTHONNOUSERSITE=1, and git configuration overrides that disablecore.fsmonitorand hooks (core.hooksPath=/dev/null); the workspace's.git/configand.git/hooksare moved aside to{run_dir}/agent-git/before it starts, so a filter, diff driver, alias or include the agent configured does not run in the grader. What a grader still trusts from the agent, and must treat as untrusted input: every file in the workspace (including.gitattributes,conftest.py, build files and the rest of.git), and any directoryimage.envplaces under{run_dir}, which both containers share. A grader that imports or runs workspace code runs the agent's code.- Fixed paths. Inside every container
{run_dir}is/eval/run,{eval_dir}is/eval/content,{source_dir}is/eval/source, and the built-in graders' code is/eval/graders(grading container only, §4.5). The agent container mounts the workspace at/eval/run/workspace, the same path graders see. An absolute path in an answer or grade therefore means the same thing after a run directory is archived or regraded on another host. On oneDAL, 14 of 308 copied runs regraded differently because build answers name an absolute artifact path; a fixed mount fixes that without changing any repository. - Image build. The build context is the eval tree's repository root,
checked out at the eval revision (no
.git, no untracked files, every tracked file as git stores it) and with thetasksdirectory removed. One image serves every task of that eval revision; per-base images would mean one build per base (18 on oneDAL) for the same toolchain. The Dockerfile mayCOPYtooling from anywhere in that context, for example a build wrapper under<eval-dir>, and must work for every task base: a version pinned in the task tree (such as.bazelversion) is read at run time, not baked in. A build that runs past--timeout build=SECseconds (3 hours by default) fails as a container error rather than hanging the batch. eval check(§4.3) fails a task whose agent container can read any file undertasksor{source_dir}.
1.2 Code index input¶
A repository can be read through a SCIP index (index.scip, the format of
scip.proto) that another tool wrote. dokimi never runs an indexer. The
reader, dokimi.repos.code_index.load(path, root_prefix=...), answers
definitions, references, enclosing scopes and base classes; the queries are
documented in dokimi/repos/code_index/index.py.
- Document paths are relative to the directory the indexer ran in; pass
root_prefixto map them to repository paths. - Enclosing scopes need an indexer that writes enclosing ranges (scip-python does, scip-clang 0.4 does not).
bases()returns the bases the index lists; on an index that lists every ancestor (scip-clang) it returns a truncated ancestor graph, not declared direct bases. scip-python lists direct bases, so its result is those. scip-clang lists every ancestor, which the reader reduces to a minimal set of bases that still reaches each ancestor (C : B, AwithB : AgivesBalone). An inherited base can therefore be absent.bases(symbol, minimal=False)gives the list unreduced. The reader knows both tools by name; for another tool it decides from the relationships themselves.- An occurrence repeated identically in one document is kept once.
- A
local Nid is scoped to one document, so only per-document reads return it.
The decoder uses only the standard library. A malformed, empty, or garbled
file raises CodeIndexError. A file cut at a document boundary still reads,
with fewer documents, so compare the indexed files with the tree. repo
inspect --index reads one (§8.1), and eval tasks generate --from graph
builds tasks from one (§4.7).
2. repo-eval.yaml¶
schema: repo_manifest.v1
id: onedal
source: {url: https://github.com/uxlfoundation/oneDAL} # sha comes from each task's `base`
eval_dir: dev/agent_evals
guidance: # what the guidance:* arms add, remove or replace
globs: ["**/AGENTS.md", ".github/instructions/*.md", ".github/copilot-instructions.md"]
also_scan: ["CONTRIBUTING.md"] # checked by L0, never changed by arms
image:
dockerfile: dev/agent_evals/Dockerfile
caches: # volumes shared across runs, mounted read-write
- {name: bazel-repo-cache, path: /cache/bazel-repo}
- {name: bazel-disk-cache, path: /cache/bazel-disk}
env: {EVAL_BAZEL_OUTPUT_BASE: "{run_dir}/ob"} # per-run build state; a value under {run_dir}/ is a plain
# name (`ob`, `ob/sub`), never a framework entry such as `agent-git`
network: none # or: public
entry_points: # run inside the image, cwd = {run_dir}/workspace
# the commands are the repository's own; these are examples
grade: "python3 {eval_dir}/run.py grade --contract {run_dir}"
oracle: "python3 {eval_dir}/run.py oracle --contract {run_dir}" # applies the reference solution
static: "python3 {eval_dir}/static_check.py --out {out}" # optional, repo_static.v1 (§4.4)
test: "python3 -m pytest -q -p no:cacheprovider --junitxml={out} {tests}" # optional, dokimi:hidden_tests (§4.5)
tasks: dev/agent_evals/tasks
explore_tasks: null # optional ExploreBench YAML directory
build_systems: [bazel, make] # selects L0 claim-check adapters
process_metrics: # optional repository counters, result.json `process.counters` (§4.1)
bazel_cmds: '\bbazel(?:isk)?\b' # a plain regex searches the command text
icpx_missing: {regex: "icpx is not found", match: output} # match: text (default), output or any
probes: # optional: target -> patterns of `probe` events (§4.1)
cpu: [nproc, "py:os.cpu_count"] # a listed target replaces its defaults; [] turns it off
label_host: false # optional: true runs a task the host misses and records the miss (§4.3)
Rules:
- Every path is relative to the repository root.
eval_dir,tasksandentry_pointscome together or not at all. Without them the manifest is guidance-only:scanandreachrun on it andvalidatechecks its globs, whileeval checkandrunrefuse it.imageandexplore_tasksneedeval_dir, and so doesprocess_metricsandlabel_host.entry_points.gradeis required only when some task'sgraderdoes not start withdokimi:(a grader built into the framework);eval check --schema-onlynames the tasks that need it.process_metricsmaps a name (letters, digits,_; not starting with a digit) to a Python regex, given as a string or as{regex: <regex>, match: text|output|any}. For each name the framework counts thecommandevents of the run whosetext(default),outputor either contains a match (re.search); denied commands count too, since the agent asked for them, but a denied command is searched in itstextonly (itsoutputis the hook's refusal message).eval check --schema-onlyrefuses a regex that does not compile.eval_diris a proper subdirectory, andtasksandexplore_taskssit inside it: it is the one directory deleted from every workspace (§3).{eval_dir},{source_dir},{run_dir},{out},{task}and{tests}are the only placeholders.{eval_dir}is the read-only copy from the eval tree (§1.1), not a path inside the workspace.entry_points.testis the repository's test command, whichdokimi:hidden_tests(§4.5) runs on a task's hidden tests. It must name{tests}and{out}, and{tests}is refused in any other entry point. A word that is{tests}becomes one argument per hidden test (workspace-relative paths); inside a longer word it is the paths joined by spaces.{out}is the JUnit XML report the command writes ({run_dir}/hidden-tests.xml). It is required when some task'sgraderisdokimi:hidden_tests(eval check --schema-onlyandeval checksay which). It may not use{source_dir}, which is only forgradeandoracle.{source_dir}is a read-only, full-history clone ofsource.urlwith blobs, for graders that read hidden tests or mined fix commits (oneDAL'sfixgrader reads the fix commit named bybase). It is allowed only ingradeandoracle, and needssource.url. History holds every fix, so it is never mounted in the agent container (§1.1). A placeholder rather than a flag: using it is what tells the framework to provide it.- Guidance globs are evaluated at every task base, not only at the eval
tree: a file deleted upstream after a base still exists at that base and
the
guidance:nonearm must remove it there. A glob warns only if it matches nothing at every base. image.networkapplies to entry points and to every command the agent runs. Withnone, those have no network at all. A task that needs a package index adds the hosts to itsegresskey (§3), which opens them through the proxy below for that task only. There is no per-taskpublic: full network would let the agent fetch the upstream fix. Baking the dependency into the image is better when it can be done.- Caches are mounted read-write in every run, because Bazel's disk cache
writes. A run may depend on them for speed, never for correctness. With
network: nonethey are filled byeval check --warm(§4.3): one base is not enough when bases pin different tool versions (7 Bazel versions on oneDAL). - Container runtime. The framework starts every container with an init
process as PID 1 (
docker run --init) and with an empty--entrypoint, so the command is the whole argv whatever the image'sENTRYPOINT; without one, a daemonizing build server such as Bazel's hangs on shutdown and its cache writes are lost.HOMEis a per-run writable directory under{run_dir}, never the container layer. Large tool state that should be shared across runs (a Bazel install base is about 1 GB per version) goes to a declared cache, set throughimage.envor the repository's wrapper. - The harness process itself must reach its model. The framework gives the
agent container one egress route: a proxy it runs, which allows only the
hosts in the harness profile's
egresslist (§6) and refuses everything else. A command the agent runs can reach those hosts too, so give the harness short-lived credentials scoped to the model endpoint. Every connection through the proxy is logged with the run.
2.1 Suite manifest (suite_manifest.v1)¶
A task's base is normally a commit of the eval tree's source (§1.1). A task
whose base is in another repository, such as a scaffold that a benchmark shares
or a library at a fixed revision, is listed in a suite file kept in the eval
tree:
schema: suite_manifest.v1
id: linreg-cpu-solver
repos:
sklearn-scaffold: https://github.com/example/scikit-learn-scaffold@<40-hex sha>
numpy-scaffold: /path/to/numpy-scaffold@<40-hex sha>
tasks:
- id: solver-pick-cholesky
repo: sklearn-scaffold
repo run --suite <path>reads the file from the eval tree; the path is relative to its root and may not leave it. Each listed task takes its base checkout from the repository it names; itstask.jsonkeeps the rest of the task. A task the suite does not list keeps its eval-tree base. Every listed task must be a task oftasks(§2), or the run stops before any cell.- Each repository is
<url>@<rev>or a local<path>@<rev>, as in §1.1. The revision must be a full commit SHA. A branch, tag or other ref is refused unless the run passes--allow-floating-suite-revs; it is resolved again when each run starts, and the batch pin (_eval/batch.json, keysuite) records the commits. A resume is refused withuse another --namewhen the revision now resolves to another commit: the batch does not follow a moved branch or tag, and it does not reuse a later commit. The pin also records the suite file's path, the task-to-repository mapping and the repository locations (keysuite_plan): a resume with another suite file, or without--suite, is refused. - A repository that cannot be opened, or a base that is not a commit of it,
leaves that task's cells unsupported (§9):
unsupported.jsongives the reason, andrepo reportcounts the cells neither as failed nor as missing. A cell that runs recordsbase_repo({"repo", "source"}) inmeta.json. A base that the cached clone of a remote lacks is fetched once before it counts as missing. eval checkreports these tasks as not checked when their repository is missing and fails only on the other bad tasks; when every selected task is not checked it exits 1 (incomplete), asrepo rundoes, since nothing was checked.- Not covered yet:
eval check --schema-onlychecks the bases of the eval tree only; a suite task's{source_dir}is still the eval-tree source; and aguidance:rev:<sha>arm is pinned against the eval-tree source.
The schema is dokimi/schemas/suite_manifest.v1.json; an example is
data/suites/example-suite.yaml.
3. task.json¶
The framework interprets the core and workspace keys. Every other key
belongs to the repository's grader and is passed through unread, except grader, which the framework reads to tell a dokimi: name (§4.5) from a repository's.
eval check --schema-only reports a task.json that is not valid JSON, not a JSON object, or cannot be
read (a link that loops, names a directory or nothing, or leaves the repository, in a tree or at <dir>@rev) as an error: line, and exits 1.
| Key | Required | Read by | Meaning |
|---|---|---|---|
id |
yes | framework | equals the directory name, and contains no whitespace or comma: the workflow's tasks, smoke-tasks and exclude-tasks inputs are lists of ids split on whitespace and commas, so eval check --schema-only refuses an id containing either |
family |
yes | framework (reporting) | free string; common values: build, fix, feature, test, review, navigate (§4.7) |
base |
yes | framework | commit to snapshot: a hex SHA, optionally followed by ^ (the parent, the usual form for a mined fix). Branch names, tags and HEAD are refused, because repetitions of one task must get one snapshot. Use the full 40-character SHA; a shorter one is accepted with a warning. It must resolve in the source. meta.json records it as base_rev and the resolved full SHA as base_sha |
prompt |
yes | framework | what the agent is told |
grader |
yes | framework for dokimi:<name> (§4.5); repository otherwise |
grader name; any other name is interpreted by the grade entry point |
setup_patches |
no | framework | applied after the snapshot, before the arm (for example an injected bug) |
review_patch |
no | framework | applied with git am as the HEAD commit under review |
gate |
no | framework | what counts as success; default ["pass"]. Each entry is a boolean metric name, which must be true, or {"metric": <name>, "min": <number>} for a numeric metric |
score |
for score-only tasks | framework | {"metric": <name>, "max": <number>}: the metric that is the result when pass is null, and the value the oracle must reach (§4.3) |
timeout_s, max_turns, budget_usd |
no | framework | per-task caps, overriding run defaults; each a finite number > 0 |
host |
no | framework | {"min_cpus": <int>, "cpu_vendors": [<str>], "cpu_flags": [<str>]}, every key optional: what the hidden test needs to show the bug (a thread race that needs 3+ CPUs, an ISA path). Vendor and flag names are /proc/cpuinfo's (GenuineIntel, avx512f); both match in any case, and a vendor other than GenuineIntel, AuthenticAMD, HygonGenuine, CentaurHauls, Shanghai is refused (eval check --schema-only too). A probe that read neither vendor nor flags from /proc/cpuinfo is a probe failure, not a miss They are checked against a probe container started like the grading one: CPUs are its affinity mask capped by its cgroup CPU quota (docker --cpus). On a host that misses them the task is unsupported (§4.3), unless the manifest's label_host or repo run --label-host runs it and records the miss, and the probed facts go to meta.json host of a cell that runs, or to its unsupported.json host when it does not |
egress |
no | framework | extra hosts (DNS names, optional :port; * stands for one whole label and the last two labels are literal, so *.pythonhosted.org passes and * or *.org does not) this task's agent and entry points reach through the proxy (§2), for example ["pypi.org", "files.pythonhosted.org"] |
expected_skill |
no | framework | the name (directory name) of the skill the agent should use; a skill-catalog: arm must install it, or the arm is refused before anything runs. On a guidance:as-skill catalog arm the generated <repo>-guidance skill is refused too (its usage is guidance_skill_loaded). result.json skills records whether the agent used it and whether it used it first |
useful |
no | framework | the definition of the run's first useful result, reported as first_useful in result.json (§4.1): {"command": "<regex>"} for a task whose grade runs the target tests, or {"edit": "<glob>"} (or a list of globs) for one that grades an edit to a target file. Omit it when no event is the useful result. A malformed value is refused by eval check --schema-only, tasks check and repo run |
version |
no | framework (reporting) | the task's revision, a non-empty string or an integer; absent is unknown. dokimi:typecheck reads mypy_version for the mypy pin and uses version as a deprecated fallback when mypy_version is absent (§4.5) |
provenance |
no | framework (reporting) | source (hand-written, generated:<tool>@<version> or imported:<format>; eval tasks generate writes generated:dokimi-tasks-generate@<dokimi version>), reviewed_by (a non-empty string) and status (candidate, validated or frozen); every key optional. repo report shows each task's status in a column, unknown when absent. A malformed block fails eval check --schema-only (dokimi/provenance.py) |
| anything else | — | repository | for example hidden_files, targets, regression_targets, manifest |
setup_patch (a single string) is accepted as a synonym for a one-element
setup_patches.
Workspace preparation, done by the framework¶
<base>'s tree into<run_dir>/workspace, as git stores it: nocore.autocrlfor other git configuration of the host, and noexport-ignore/export-subst(unlikegit archive)- delete
eval_dir git initand commit (no history, so fixes cannot leak)- apply
setup_patches - apply the arm:
guidance:none,guidance:raw,guidance:bridge,guidance:overlay,guidance:rev:<rev>,patch:<file>,guidance:format=xml(the guidance files rendered as tagged sections,dokimi/repos/guidance_format.py) orguidance:as-skill(the guidance files removed, their text packaged as one skill, see Guidance formats and packaging) - amend the commit
- apply
review_patchwithgit amunder a neutral author - expire the reflog and prune unreachable objects: the
commits steps 6 and 7 replaced hold the unpatched code, the removed
guidance and the upstream author, and
git diff HEAD@{1}would show them. Prep's git never runsgc --auto, which would pack them whereprunecannot reach
Every guidance:* arm is made by the framework from guidance.globs, the
harness profile and the source's own history; a repository supplies no arm
content. The globs are matched against the files the workspace holds after
step 4, not against git's index: a file a setup patch adds is matched, and one
it deletes is not.
nonedeletes every file the globs match and every overlayAGENTS.<agent>.md, which is matched by its name, not by the globs;as-skilldrops the same files, packaging only the matched ones;rawkeeps them.bridgeexists only for a profile with abridgekey. It writes that file (for Claude Code, aCLAUDE.mdcontaining@AGENTS.md) next to every matchedAGENTS.md, not only at the root. Whether a harness needs it depends on its version: Claude Code 2.1.286 loadsAGENTS.mditself, but only when noCLAUDE.mdis in its start-up chain, so a repository-side bridge arm would mean different things on different versions.overlayexists only for a profile with anoverlaykey (the agent name, for Claude Codeclaude). It is the per-agent overlay of agentsmd/agents.md#185:AGENTS.<agent>.mdbeside anAGENTS.md, at any depth. The workspace keeps the baseAGENTS.mdand theAGENTS.<overlay>.mdfiles and removes every otherAGENTS.<name>.md(not the harness's own names such asAGENTS.override.md, nor files under.claude). The files are recognised by name, not byguidance.globs. The name must be theoverlaykey of a builtin profile (claude,codex,copilot):AGENTS.ja.mdis an ordinary file. A profile loaded from a path can reuse one of those names (a copy ofclaude-code.yamlkeepsoverlay: claude), but one whoseoverlaykey is not a builtin name has no recognised overlay, so its arm is refused. A base with noAGENTS.mdat its root, or with noAGENTS.<overlay>.md, is a preparation error, so a cell cannot be the base alone or an overlay with no base by accident. The arm does not make a harness load its overlay: the reach probe reports that.rev:<rev>keeps the base's code and replaces its guidance with that of another revision of the source: the matched files are deleted and the files the globs match at<rev>(outsideeval_dir) are written. It keeps the overlays: a repository with overlays that wants a revision without them lists**/AGENTS.*.mdinguidance.globstoo. It answers "does this PR'sAGENTS.mdhelp?" by running the same tasks withguidance:rev:mainand with the PR's head.<rev>is a SHA, tag or branch (/allowed) of the source's git dir; for a remote source a branch or tag is fetched first.repo runresolves it once per batch and names the arm by the full SHA,guidance:rev:<sha>: a branch that moves later gives another arm with its own cells, never more cells of the old one, andrepo compareselects the arm by that name.
patch:<file> is the one arm whose content comes from the evaluator rather
than from the globs: a unified diff on the host running repo run, applied
with git apply on top of guidance:raw (after setup_patches). It is for
tooling or layout treatments, such as a new script or a Makefile target, that
no task carries. The file is read once per batch, so every cell applies the
same bytes, and the arm is named patch:<name>@<first 12 hex of its
sha256>, where <name> is the file name without its directory: each run of
characters outside [A-Za-z0-9.-] becomes one _, a leading or trailing _ is
dropped, the result is cut to 40 characters and a _ the cut leaves at the end
is dropped too (patch if nothing is left), so my fix (v2).diff gives
my_fix_v2_.diff. The name holds no / for BATCH/ARM selectors; the exact
name is printed on the repo run stderr line arm <name> = <path>, sha256 ....
A patch that does not apply to a task's base, or that writes into eval_dir,
fails that cell's preparation. A cell has one arm: guidance:rev: and patch:
do not combine.
Both write files, as step 1 does: no object of the source's git dir is copied into the workspace, so its object store gains only the blobs of the files the arm wrote, and step 8 drops the guidance the arm replaced.
A skill arm (skill:<path>, skill-catalog:<dir>, joined to a guidance part
with +) installs skill directories into .claude/skills/<dir name>/ after the
guidance part, so guidance:none+skill:x keeps x. The arm is named by the
directory names (guidance:none+skill:x, no /), so repo compare can select it.
The name in a skill's SKILL.md has to equal its directory name. A skill is refused before
any cell runs if it holds a link that copying cannot take (out of the skill,
dangling, looping, to a directory) or a file that is not regular. Preparation
also refuses to write through a .claude or .claude/skills the repository
ships as a link. A directory at the skill's target that holds only empty directories is replaced; one with a directory under it that cannot be listed is refused as a preparation error, not read as empty. A batch records the content of each skill arm it ran
(_eval/skills.json), so resuming it with another path of the same
directory name, or with edited skill content, is refused.
meta.json records the base (base_rev, base_sha, base_date), the arm,
the SHA of every applied patch, and start_sha: the workspace HEAD after
step 7, the commit the agent starts from (§4). base_sha names the upstream
commit and is not in the workspace, because step 3 starts a new history; a
grader diffs the agent's changes from start_sha. With the arm come
arm_files, the files it deleted, wrote or changed; for guidance:rev: an
arm_rev object (rev as given, its sha, and removed: the base's guidance
files with no counterpart at <rev>), which also records the guidance history
of <rev> (dokimi/repos/guidance_history.py): guidance_latest, for
each guidance file the arm wrote, the commit reachable from <rev> that last
touched it, or for a link it or any path its resolution goes through (each
intermediate link and the file it resolves to), by committer date;
guidance_commits, the commits reachable from <rev> that touch a path the
guidance globs match outside eval_dir (which the arm leaves out, as it does
the files) or a path a guidance link resolves through, newest first by committer
date, at most 200, each with its subject; guidance_commits_truncated,
true when that cap cut the list; and guidance_imported_by, for each guidance
file the arm wrote that another file's @ import chain reaches, the files whose
chains reach it, root files first. It is read in the workspace as the agent gets
it (the revision's guidance, the task's base elsewhere, after the review patch and
the skills), among every file on disk, one a .gitignore ignores too, with repo budget's import walker
(dokimi/repos/budget.py) by the cell's harness profile: the chains of every
CLAUDE* file and every AGENTS.md its guidance.names holds, but an AGENTS.md
that guidance.claude_displaces_agents turns off and no root CLAUDE* or
CLAUDE* that turns it off links to (the link is read as that AGENTS.md), relative to
the importer, not in a code span or block, within guidance.import_max_depth,
and none ({}) for a profile with no guidance.imports; with no profile, by
Claude Code's rules, which follow imports. Each commit has its sha, authored and
committed (strict ISO 8601, %aI and %cI; a UTC date is written Z,
whichever form the git that read the history prints). The history needs the whole of it: a shallow
git dir (a local checkout cloned with --depth) fails the cell's preparation
(git fetch --unshallow), as its history stops at the boundary commit. A merge commit counts for a
path when its result differs there from every parent: a conflict resolution,
an edit made in the merge, or a clean merge of its parents' edits to
different parts of one file; a merge that takes the path as one parent has
it does not, and the commits it merged count. repo compare (§9) reads
guidance_latest against a replay task's public_at (§4.6) and flags the
task when a guidance file that applies to it was committed after the task's
answer was public, and reads the guidance_commits subjects for the task's
PR; it reads committed, as an amend or a rebase keeps the author date. For patch: an arm_patch object (the
file's absolute path and full sha256, added: the files the patch added
that neither the guidance globs nor .mcp.json match, and mcp_servers: the servers
the patch added to the .mcp.json at the root, read before the agent runs); for guidance:format= a
guidance_links_kept list of the guidance links that keep their raw bytes; for guidance:as-skill a
guidance_skill object (name, path, sha256) that is not in skills. args_if_present lists the profile's
args_if_present files the cell's command line carries (§6): [] when the
workspace has none of them, and always outside the all tool mode.
Step 3 removes history only. A fix that landed upstream before a model's training cutoff may still be known to the model, so reports split results by base commit date against the model's cutoff where the cutoff is known.
4. Entry points¶
Inputs available in {run_dir} when grade runs¶
| Path | Content |
|---|---|
workspace/ |
the agent's final tree |
task.json |
copy of the task |
answer.txt |
the agent's final message |
events.jsonl |
normalized trace, one JSON object per line, harness-independent (§4.1) |
meta.json |
arm, harness, harness_version, model, model_resolved (the model(s) the trace says answered: a name, a sorted list, or null when the trace format cannot tell), rep; base_rev (as written in task.json), base_sha (resolved, 40 characters), base_date (committer date, ISO 8601); patches (SHA of each applied patch); start_sha (workspace HEAD the agent started from, §3) |
Graders must not parse a harness-specific trace. A grader that needs "did the
agent run bazel?" reads the command events in events.jsonl. A grader
reads the upstream base (base_sha) and the workspace start commit
(start_sha) from meta.json and does not derive either from the workspace.
4.1 events.jsonl¶
The line format, its version and the promise that comes with it: events-format.md.
{"t": 12.4, "kind": "command", "text": "bazel test //cpp/...:x_host", "rc": 0}
{"t": 3.1, "kind": "read", "path": "AGENTS.md"}
{"t": 5.0, "kind": "edit", "path": "cpp/oneapi/dal/algo/kmeans/detail/foo.cpp"}
{"t": 20.2, "kind": "tool", "name": "WebFetch", "denied": true}
{"t": 31.0, "kind": "command", "text": "bazel test :x", "rc": 1, "output": "ERROR: icpx is not found", "output_truncated": false}
outputis optional: the command's output as the harness returned it. Whether stdout and stderr are merged depends on the harness (Claude Code merges them), so graders must not rely on telling them apart. Output over 8 KB (8,192 bytes) keeps up to 4,096 bytes at each end around a[... N bytes omitted ...]line, andoutput_truncatedistrue; build errors are usually at the end. A UTF-8 character that a cut splits is dropped whole, so an end can keep fewer than 4,096 bytes, andNcounts every byte not kept, the dropped partial characters included. Output of exactly 8,192 bytes is kept whole.rcis what the harness reports. Where it reports only success or failure (Claude Code),rcis0or1; a Claude CodeSkilltool event carries it too (1: the skill was not loaded). A Copilot shell command takes itsrcfromshellExecution.exitCodewhen present. A completion that reports onlysuccessretains its 0/1 outcome and recordsrc_from: "success". The counters andfirst_usefulretain that outcome. An install or removal choice requires the command’s own exit code. It isnullwhen no result came back, for example when the run stopped at its turn or budget limit; a grader must not countnullas a failure.agentis present on an event a subagent made: the id of the parent'sAgent/Taskcall that started it. Events without it are the parent's.- A
readevent may have nopath: a refused Claude Code Bash read of a relative path after an earlier call moved the shell, whose file is not known ({"kind": "read", "denied": true}). - A
probeevent follows thecommandevent of a command that asks the host for its facts, one per pattern it matches (a command may give several):{"t": 4.0, "kind": "probe", "target": "cpu", "pattern": "nproc", "text": "nproc", "rc": 0}.targetis one ofcpu,gpu,os,memory,packages,env,network;patternis the configured pattern it matched;text,rcandagentare the command's. The defaults (dokimi/repos/probes.py,DEFAULT_PROBES):cpulscpu,/proc/cpuinfo,nproc,sysctl,Get-CimInstance Win32_Processor,py:os.cpu_count,py:platform.processor;gpunvidia-smi,rocm-smi,py:torch.cuda.is_available;osuname,/etc/os-release,sw_vers,systeminfo;memoryfree,/proc/meminfo;packagespip list,pip show,pip freeze,conda list;envenv,printenv. A pattern is matched on the program the shell or PowerShell runs, with the words it names in any order and case (grep nproc READMErunsgrep: no probe), on a file a reading command (cat,head,grep, ...) names for a path pattern, and on the call in the code of apython -cone-liner forpy:NAME. A$( )substitution or abash -cscript counts as a command the agent ran. Not matched: a Python heredoc, a script the agent runs from a file, a pattern with a|that is not a pipeline of the same commands, and a launcher the wrapper lists do not know (docker exec,nix develop -c).env,timeout,xargs,conda runanduv runrun the program after them;envwith no program after its options is its own probe (env -Sis not read). Each cell'smeta.jsonrecords the patterns per target (probes) that it ran with. A manifest'sprobes(§2) replaces a target's defaults, andrepo run --probes FILE(YAML or JSON, the same mapping) replaces them again; nothing else changes the events, and theprocess_metricscounters do not count probes. - A
choiceevent follows thecommandoreditevent of a call that installs, imports, uses or removes a candidate the run names:{"t": 5.0, "kind": "choice", "candidate": "sklearn", "act": "install", "path": null}(repo run --candidates FILE, YAML or JSON,dokimi/repos/choices.py). The file maps a candidate id toinstallandremove(package names a package manager is given; a removal matches both lists),import(modules an addedimportorfromline names) anduse(dotted names an added line mentions, textually: a comment counts too). Only added text counts: the new side of anEdit, the content of aWrite, never what the edit replaced. A harness whose edit events carry no added text (Copilot'sedit,create,str_replace_editor,writeandapply_patch, Codex'sfile_change) gives install and remove events only: no import or use choice there does not mean the agent did not choose the candidate. A choice needs the call's own exit code 0: a failed or denied call, or one with no result, gives none. An install or removal gives a choice only when its command joins every part to the next with&&and has no pipe: the harness reports one exit code per command, so a;,||or|part could have failed or never run. A missing install choice leaves the installation unmeasured, including when output from a pipeline mentions success. A--dry-runinstalls nothing and gives none, nor doespoetry ... --lock, which rewrites the lock file only. An install in abash -cwrapper, or whose first word carries a parenthesis ((pip install X)), gives none. Choice events are written toevents.jsonl; the counters andfirst_usefuldo not read them.
result.json reports the agent's tokens (input_tokens, output_tokens,
cache_read_tokens, cache_write_tokens) over the same scope as cost_usd.
The per-call turn events of events.jsonl and the usage_remainder line that closes them against these totals are in events-format.md.
usage_scope is tree when they include subagents and helper models (Claude
Code's modelUsage), main when the harness reported the parent's only, and
null when it reported none. Codex counts cached_input_tokens inside its
input_tokens; the converter moves them to cache_read_tokens, so
input_tokens is the uncached part in every cell that reports tokens, as with
Claude. subagent_calls counts the parent's and subagents' Agent/Task
calls; null when the harness wrote no result record.
first_prompt_tokens is what the first main-thread model call was sent
(input + cache_creation + cache_read tokens of that call, counted once per
message id, as trace inspect reads it): everything start-up loaded plus the
task, so two arms that differ only in guidance differ there by what start-up
loaded of it. It is null when the trace has no main-thread call with
usage, when the first call's usage reports none of the three counts (only
output_tokens), and for a trace format that carries none (text).
result.json process holds what the framework counts in the events, the
parent's and subagents' together, so a grader need not:
| Key | Meaning |
|---|---|
tool_calls |
every tool event (command, read, edit, tool, not the turn and compaction events of events-format.md): each tool call the agent made, and each shell-derived read event kept, a denied one or one of a failed multi-file read too (see guidance_read and §7) |
commands |
command events |
failed_commands |
commands not denied whose rc is neither 0 nor null |
denied_commands |
commands with denied: true (a hook or the harness's permissions refused them) |
guidance_read |
sorted, distinct workspace paths (normalized: ./a, a/../b; not ~; a .. after a link is followed as the system does, by the links the workspace had at the start, not collapsed: alias/../AGENTS.md with alias -> docs/nested is docs/AGENTS.md) of read events, neither denied nor failed (rc 1: the file does not exist), that guidance.globs match. A read event is a read tool's (Claude Code's Read, Copilot's view) or a shell read: a Claude Code Bash call, Codex command or Copilot bash command that only prints files, as §7 lists (a bare cat, head, tail, nl or sed -n; a head or tail whose count prints nothing is no read: head -n 0, -c 0, -0, --lines=0, -n +0, tail -n -0, but head -n -0 and tail -n +0 print every line, tail -f -n 0 prints what is appended, and POSIXLY_CORRECT=1 head AGENTS.md -n 0 (also env POSIXLY_CORRECT=1, and head after an export POSIXLY_CORRECT=1 of the same call, in its own shell, until unset POSIXLY_CORRECT or export -n POSIXLY_CORRECT, which keeps a value it assigns for a later export POSIXLY_CORRECT; an export or unset after && or || counts only when it runs, known after true, : and false, and after another command the read stays when either state prints it; the commands inside a brace group that && or || skips are skipped too, a function named true, false or : has an exit not known, unset -f and export -f leave the variable, an export with a redirect still counts, and a function named export or unset shadows the builtin, which builtin and command (also command -p and --) run) prints the file, as its options end at the first file or at a - operand, so POSIXLY_CORRECT=1 tail -n 0 AGENTS.md -f is no read, -f being a file there, and env -i, env - or env -u POSIXLY_CORRECT drops the variable; timed too: time cat AGENTS.md, X=1 time cat AGENTS.md, or after command: command cat AGENTS.md, not after env, which runs a program, never a builtin: env command cat AGENTS.md and env builtin cat AGENTS.md run no cat; cd <dir>; cat AGENTS.md reads <dir>/AGENTS.md; not a call of a shell function of that name the same Bash call defined (Claude Code starts each call in a new shell, which keeps no function of an earlier call): cat() { echo hi; }; cat AGENTS.md, \cat AGENTS.md and cat() ( echo hi ); cat AGENTS.md too, is no read, as bash runs the function, nor one after a function named command, env, builtin or time, not the keyword: command() { echo hi; }; command cat AGENTS.md). A command that is one such read naming one file, alone, the one command of a brace group ({ cat AGENTS.md; }) or after cd commands (cd sub && cat AGENTS.md; time cd, command cd, builtin cd, X=1 cd, a quoted or escaped "cd" or \cd too, not env cd) or a virtualenv's activate (source .venv/bin/activate && cat AGENTS.md, source 'my env/bin/activate' too), and fails is no read; one naming two keeps its reads, even when only one is known (cd -; cat missing.md /ws/AGENTS.md). Because such a call cannot say which of its files failed, a path counts only when the workspace held that guidance file when the agent started, the arm's files included, also when the path leads to it through a link (alias/AGENTS.md with alias -> docs), by the links the workspace had at the start, so a link the agent removes or retargets later does not unlist a read it made through it: a path that never existed (cat docs/AGENTS.md 2>/dev/null in a workspace without it), a link that dangles or loops (also one that returns to a directory through a .. component: alias -> alias/../docs, and one whose target goes .. out of a name that was no directory at the start: alias -> missing/../docs, which the system refuses), a file the arm removed and a file the agent created itself are not listed. Guidance seen through a pipe, grep or rg is not a read here (a search is guidance_searched), nor is a relative read after an earlier Claude Code Bash call ran a cd (time cd and command cd too), pushd, popd, or an eval, source or . (which may run one; not source .venv/bin/activate, a virtualenv's activate script alone, assumed to run none, §7), its name quoted or escaped too ("source" "$ENV", \cd "$D"), or called a shell function whose body names one of these (f() { cd sub; } defined in that call; source and . only as a command, not of an activate script: f() { git add .; } names none), in its own shell, not in a subshell, pipeline or background job (the shell keeps its directory between calls, so the file is not known; a call a hook or the permissions refused ran nothing, so it moves nothing). That holds across agents: after the parent's cd, a subagent's relative reads are dropped too, and the reverse, since a subagent may share the parent's shell (not checked on a real trace; dropping a read is the safe side either way); to count those, add a process_metrics counter on the command text (§2), which also counts denied commands, unlike this row |
guidance_searched |
sorted, distinct workspace paths, normalized (a .. after a link followed, as in guidance_read) and filtered as guidance_read is (guidance.globs match, the workspace held the file when the agent started), of the files a search showed lines of: the searched list of a command event not refused, or of a Claude Code Grep or Copilot grep tool event (events format). A search is not a read: it adds no read event, so tool_calls and guidance_read stay as they were, and a file both printed and searched is in both lists. A part of a Claude Code Bash call, Codex command or Copilot bash command is a search when it runs grep, egrep, fgrep, rg or git grep (/bin/grep and command grep too, git --no-pager grep, git -P grep and git -c k=v grep, not git -C dir grep, nor a shell function of that name the same call defined) and names the file as an operand: past the pattern, after -e or -- (-ewarn and -nefoo, with the expression attached, too), not the value of an option (-m 1) nor a pattern file (-f F, -fF); git grep takes the paths after -- or after the pattern. The cd rules are guidance_read's (cd sub && grep x AGENTS.md searches sub/AGENTS.md; a relative file after an earlier call's cd is dropped, and is not added to unknown_reads, which counts reads only). A Grep call counts when it has a path and output_mode content (a relative path starts at the directory the harness started in, as a Bash call does, and is dropped after an earlier Bash call that may have moved the shell, as a relative Bash search is): Claude Code's default mode (files_with_matches) and count print no line of a file, and nor does a result that is empty or says No matches found (also an offset past the last line), as an error result does not. Not counted, since no line of the file reached the agent or no file is named: -q, --quiet, --silent, -l, --files-with-matches, -L, --files-without-match (not rg's -L, which follows links), -c, --count, --count-matches, -V and rg's --files and -h (grep -h is --no-filename and stays a search; for grep, an unambiguous prefix of a long option too, also one that takes a value: --qui, --cou, --exclude-d AGENTS.md, whose AGENTS.md is no operand; rg reads none); a directory operand (grep -r x docs, rg x docs name no guidance file); a glob or a computed operand (*.md, $f, $(ls)); stdout redirected to a file or /dev/null; stdin (cat AGENTS.md \| grep x, which is not a read either); a negated (! grep), subshell or refused command. A search piped only into head or tail with known options (grep x AGENTS.md \| head -n 20, \| head -n 20 2>/dev/null, \|& head, \| /usr/bin/head and \| LC_ALL=C head too; also after if, while or then) counts; a pipe into any other stage, a head or tail that names a file, takes an unknown option or a value the tool refuses (tail --follow=bad, --pid=x, -s x, -n x; --follow=name too, which tail refuses for its input before it prints a line), --help or --version, passes no line (-n 0, -c 0) or is a shell function the same call defined, does not. A search of several files lists every file it named when its command showed a line, without attributing the lines to files (grep visible AGENTS.md docs/AGENTS.md whose output is only AGENTS.md:1:visible lists both). A search that fails as one search of one file (rc 1: no line matched, or 2: an error; for Claude Code any nonzero exit) is no search of it, as a failed one-file read is no read; one naming several files, when every search of the command is in its last part (grep x AGENTS.md sub/AGENTS.md, echo hi; grep x AGENTS.md, cd sub && grep x AGENTS.md \| head), loses them all on rc 1 (no line matched in any of them) and, for Claude Code, on any error; on another rc (2: an error, perhaps in one file of several) or when an earlier part also searched (grep a A.md; grep b B.md, whose exit says nothing of the first), it keeps them, as a multi-file read does; unless the trace gives the command's result as the empty text, which no search showed a line in (grep x AGENTS.md \| head exits 0 with nothing matched; a result that is absent from the trace is not taken for empty). A Copilot grep tool call counts under the rules of a Grep call: its paths (one string or a list, each resolved from the start directory as a view path is; an empty or non-string entry names nothing) in output_mode content, not the default mode, files_with_matches or count, and not a call with no paths; a failed result, an empty one or No matches found. drops it, and a relative path is not dropped after an earlier bash call's cd, as view's is not. A PowerShell command is not parsed |
unknown_reads |
the relative shell reads, of calls neither refused nor failed as one read of one file (see guidance_read; cd -; cat missing.md failing counts none), that the trace made at a directory the converter could not follow (after source env.sh, cd -, a call of a function that runs a cd, or a cd in an earlier Claude Code Bash call): they have no read event, so guidance_read may miss them; 0 when there are none |
counters |
each process_metrics name (§2) and its count |
process is null when the trace could not be read, the agent left none (no event and no result record), or computing the metrics failed (the error is in agent.trace_errors).
result.json first_useful is the run's first useful result: the first event that
hits the task's useful key (§3). The definition depends on the grader:
| Grader | Declare | Hit |
|---|---|---|
| test: the grade runs the target tests | {"command": "<regex>"} |
the first command event whose text matches the regex (regex.search) and whose rc is 0. rc 0 says that command passed, not that every target test did, so the regex should name the target tests |
| edit or diff: the grade reads a target file | {"edit": "<glob>"} or a list |
the first edit event whose path matches a glob (match_glob, as the guidance globs; a .. after a link in the path is followed as in guidance_read, so sub/alias/../x with sub/alias -> ../docs/nested is docs/x) |
review (dokimi:review_*) |
none | none, so not_declared: the answer is the product, so no event is the useful result. A declared key is measured all the same |
| any other repository grader | either form, or none | none declared, not_declared |
A refused event (denied) never hits, nor does an edit without a success result (rc 0): an error result (rc 1) means the file was not changed, and no result at all (a killed run) proves nothing. An edit that deletes its file (a Codex file_change of kind delete, a Copilot *** Delete File: patch) is no hit either: the target is gone, not the useful change. steps counts the tool events up to and
including the hit, the parent's and subagents' (as process.tool_calls does); turn and compaction events are not steps.
issued_s is the hit's t: the time the call was issued, since a call's result
is not timed. first_useful is {"kind": "command"|"edit"|null, "reason": ...,
"issued_s": number|null, "steps": int|null}. reason is null when the hit was
found and timed; otherwise it says why issued_s (and steps, with no hit) is
null: not_declared (no definition), unobserved (the trace was not read: the
harness never started, it did not parse, or a line of the trace was dropped: an unreadable record or block, such as a tool call without an id, a name or an object of input, a content block without a string type, a Codex file change without a path, or Copilot shell, read or edit arguments that are not an object), never (no event hit), timeout (a command pattern ran past
2 s on one event: no verdict, and the rest of the trace is not searched) or untimed
(the trace format has no timestamps, so steps is set and issued_s is null).
A cell of an older batch has no first_useful. Each cell that declares a definition
is counted in repo report: the row says how many observed a hit, and the medians
cover only those. A cell whose steps is past the measure bound is counted in that
row's total but not as observed, and shows no reason (steps 5 and steps 1e200 give
1 of 2 observed). repo compare pairs first_useful_rate per task (the share of its
declared cells with a verdict that observed a hit, so a task where most runs never hit it is not read
through its medians alone; a cell unobserved or timeout has no verdict, so it is neither a hit nor
a miss and is left out of the share, as is a cell whose steps is past the measure bound) and its header counts observed of measured cells per arm, with
the unmeasured ones. An edit made by a shell command (sed -i) is not an edit event, so it is not seen. A
compared task has one kind, but the mean delta pools the tasks of both kinds: a per-task
row shows which.
A cell of an arm that installs skills also has a skills object in
result.json: measured, skills_installed (the installed skill names),
skills_used (the installed skills the agent called with the Skill tool or
whose SKILL.md it read, the call or read neither denied nor failed, a .. after a link in the read path followed as in guidance_read, in order of first use), expected_skill (the task's,
or null), skill_invoked (the expected skill was used; any installed skill
when the task names none) and skill_selected_correct (the expected skill was
the first one used; null when the task names none). When the trace could not
be read (the harness never started), measured is false and skill_invoked
and skill_selected_correct are null: the usage is unknown, not "did not use
the skill". repo report leaves such cells out of its skill counts.
A guidance:as-skill cell has no skills entry for its generated skill: its
usage is guidance_skill_loaded (true when the agent called that skill or read
its SKILL.md, false when not, null when the trace could not be read).
For a patch: arm with added files or mcp_servers, result.json has an
uptake object: whether the agent used what the arm added. files and
mcp_servers list what it added (sorted); commands counts
command events that name an added file as a workspace path (tools/fmt,
./tools/fmt, /eval/run/workspace/tools/fmt, not cd tools && ./fmt; a file
with no / only as ./name, under the workspace path or after an interpreter (a bare name resolves through PATH), so
npm run lint does not name a lint file), reads the read events of one that did not fail (a
read of an added script counts as use; a .. after a link in the path is followed as in guidance_read, so alias/../tools/fmt with alias -> docs/nested reads docs/tools/fmt), mcp_calls the calls of the servers' tools
(mcp__<server>__<tool>), none of them a call the harness denied; used
is whether any is non-zero, and measured is
false when the agent left no trace to count from. repo report shows the
cells that used it per row. repo compare puts an uptake entry per treatment
in its summary ({cells, used, unmeasured}: the measured cells, how many of
them used it, and how many could not be measured; the text lines say so), prints it as an uptake: ...
line, and warns about a treatment whose cells used none of it: its deltas then
measure the patch's text, such as a guidance line, not the tool.
4.2 grade.json (written by grade to {run_dir}/grade.json)¶
{
"schema": "repo_grade.v1",
"task": "fix_avx2_dispatch",
"grader": "test_pass_files",
"pass": true,
"metrics": {"strict_pass": true, "regress_pass": true, "format_ok": false,
"diff_lines": 14, "root_cause_fixed": true},
"details": {"changed_files": ["cpp/daal/src/foo.cpp"]},
"errors": []
}
passistrue,falseornull.nullmeans score-only, for example review replay, where recall is the result.metricsvalues are numbers, booleans ornull. A metric that was not measured isnull, neverfalse. Onlymetricsare aggregated, gated and tested for significance.detailsis optional and free-form (lists, objects, strings: changed files, per-class recall, commands the grader ran). It is stored with the run and shown in reports, never aggregated.pass: nullwith emptyerrorsmeans score-only, and is accepted only for a task whosetask.jsonhasscore; for any other task it is a grader failure.pass: nullwith non-emptyerrorsmeans the grader failed.- A grader failure counts as a failure of the run on every gated metric.
The same applies when
gradeexits non-zero, times out, or writes no validgrade.json. An agent that breaks the tree so badly the grader crashes has failed the task; excluding the run would favour arms that break workspaces. This holds for a host-side failure after the agent ran too (a read-only.git, an unreadable trace): the cell gets a grader-failureresult.jsonand the batch budget is charged the run's cost, or its cap when none was reported. Reports show the grader-failure count per arm next to the pass rate. - A grader failure on the null or oracle workspace is a grader bug.
tasks checkreports it and the task is excluded from paid runs until it is fixed. - Grading must be deterministic. The framework regrades a sample and flags any mismatch.
- A task that also has a maintainer rubric reports
mergeableandmerge_score. They come from deterministic scope and test-integrity checks plus an LLM rubric judge that the framework runs; see repo-evaluation-mergeability.md (proposed). The judge is not deterministic. Instead of a determinism check, it reports agreement between two judges and must pass a calibration gate (repo rubric check, a separate paid subcommand;eval checkstays free of LLM calls). The regrade sample bypasses the verdict cache. Whether one judge repeats its own verdict on the same input is not measured yet.
4.3 Self-check (eval check, no LLM)¶
For every task, before any paid run:
- the null workspace (prepared, untouched) must fail the gate
- the workspace after
oraclemust pass the gate (adokimi:typechecktask with noreference/has no oracle step: its null step alone must fail, §4.5) - for score-only tasks, the oracle must reach
score.maxonscore.metric - the agent container must not be able to read any file under
tasksor{source_dir}(§1.1) - for a
dokimi:hidden_teststask (§4.5), whose verdict comes from tests, the null and the oracle steps run twice each, each run in a workspace of its own (<task>__null2,<task>__oracle2). When the two runs of a step differ in their status,passor the count of passed, failed, errored or skipped tests, the task isflaky, with both runs in its problems: not ok, soeval checkexits 1 for it, as for a broken task.check.jsonholds the second runs asnull_againandoracle_again
A task whose host requirements (§3) the probe container does not meet is
unsupported with the reason, like a task whose egress needs the missing
proxy, and eval check exits 1 for it. With --allow-unsupported it is
still printed with its reason but does not make the exit code 1 unless no task
is ok (below); broken tasks, tasks that need egress and tasks whose host probe
failed still do. The probed facts are recorded in check.json host, and for
repo run in the batch's _eval/host.json. repo run does not run its cells:
each holds an unsupported.json with the reason, and repo report lists them
apart, neither failed nor missing. If the probe itself fails, a task with
host requirements is not run either, and repo run exits 1 when one of its
cells is left unrun; a cell that already has a result.json keeps it. A harness that exits nonzero
before its first trace line is not a verdict on the cell: the cell is a crash, the batch exits 5, and it writes
no result.json, so the next run runs it again. A harness the cap killed before its first trace line is a fail
cell, as before.
The probe also fingerprints the host (dokimi/repos/host_fingerprint.py, collectors_version 1).
Its collectors are os, cpu, memory, gpu, python, tools, network and virt; each is a
flat dict of JSON scalars under collectors in the probe's facts, beside the container's own keys
(cpus, cpu_vendor, ...), which are unchanged. A collector that fails reports {"error": ...}
and the others still run. Linux reads /proc, /sys and /etc/os-release; macOS reads sysctl;
Windows reads the kernel's memory status, takes the CPU model and vendor from the registry (not from
platform.processor(), which reads PROCESSOR_IDENTIFIER) and spawns only git --version, nvidia-smi and the other
tools' --version calls when they are on the path. gpu is NVIDIA only. virt reads a container
from /.dockerenv, podman's /run/.containerenv or the cgroup, and a VM from DMI or the hypervisor
CPU flag. Nothing identifying is recorded: no host or user name, IP address, environment value,
interface name or absolute path; an error text is cut to 300 characters with its paths replaced.
fingerprint_id hashes the CPU and identity collectors but not network, so a bridge that appears
between runs does not split a batch. tools count by presence only (a version change or a timed-out
--version does not split a host), and a collector that still fails after one retry is left out.
label_host: true in the manifest, or repo run --label-host, runs a task that the host misses, instead of marking it unsupported; repo run --no-label-host turns the manifest's setting off for one run. Each
cell's result.json and meta.json hold host_match: the fingerprint, the report's met, and one
field per declared requirement with met true, false, or null where the probe could not tell. The
report's met is false if any field is, else null if any is undecided, else true. The requirements
are checked against the grading container's CPU view, as in §3, not against the host's collectors,
which only enter the fingerprint. repo report groups rows by host_fingerprint and notes a
labelled miss ("labelled, unmet: cpu_flags.avx512f"). Without the flag, cells are not run on a host that misses the requirements, but results still carry host_fingerprint and repo report still splits rows by it.
A missing cell counts on its host’s row when one exists. Otherwise it counts on the sole row for
its task, arm and model, or only in the batch total when there are zero or multiple such rows.
Both commands exit 2, before any build, on a source that does not parse (a local path that is not a
directory, an unpinned remote), on a pinned local path inside a repository that is not its root, on a --cache-dir (or, without the flag, a $DOKIMI_REPO_CACHE) that is not a usable directory and on a --cache-root or --cache NAME=DIR that is not one; a
source that parses but cannot be opened (clone, fetch, revision) exits 1 with a ✗ line. A manifest that
is missing or malformed exits 1 too; a --manifest path that leaves the source tree is refused as a
source and exits 2, for an unpinned local directory and for a pinned source (<repo>@<sha>) alike; a link in the tree that leads out of it, the default
manifest's or one --manifest names, is part of the tree and exits 1.
Nothing checked is not a pass. Both commands refuse an export with no task, and
exit 1 as incomplete when nothing was measured: eval check when no task
passed the self-check (every one unsupported, even with --allow-unsupported),
repo run when no cell of the batch has a result (every one unsupported). The
repo run summary line counts unsupported cells beside ran, done, crashed and
not started.
Each task runs with its own network (image.network plus its egress).
eval check --warm runs the same null and oracle steps with network and
writable caches, to fill the caches before offline runs (§2); it judges task
host requirements as an offline check does.
4.4 repo_static.v1 (written by static to {out})¶
{"schema": "repo_static.v1",
"claims": [{"file": "AGENTS.md", "line": 12, "status": "fail", "kind": "path",
"claim": "cpp/daal/foo.h", "why": "no such file"}]}
Required: schema, and per claim file, line and status. The status
class is the part before the first _: ok, unresolved or fail, so a
refinement such as oneDAL's ok_basename counts as ok. Only fail counts
against the repository. Every other key, per claim and at the top level, is
free-form and stored with the scan. A fixed minimum lets L0 merge any
repository's checks with its own without knowing their rules.
4.5 Built-in graders¶
A task whose grader is dokimi:<name> is graded by the framework, not by
the repository's grade and oracle entry points; any other name goes to
those entry points. Such a task is data only: its directory holds
task.json, the patch and the JSON files the grader reads (and, for
dokimi:typecheck, an optional reference/ directory, §4.5 below). The dokimi:
prefix is the framework's: an unknown dokimi: name fails eval check and
the run's grade, and is never handed to the repository.
A built-in grader runs where grade and oracle run: in the grading
container, with the same mounts, network and environment (§4.2). Dokimi
stages the grader code alongside the exported {eval_dir}. The Docker daemon
must be able to see that directory's parent and the staged grader directory
inside it. The grading container mounts the staged code read-only at
/eval/graders and runs
python3 -I -B /eval/graders/main.py grade|oracle <name> <task dir> /eval/run,
where <task dir> is the task's directory under {eval_dir}. It uses the
standard library only and the image's python3 (3.8 or newer), except
dokimi:typecheck, which imports the image's mypy (the pinned one, on Python
3.10 or newer). -I keeps
PYTHONPATH from image.env and the workspace off sys.path; -B prevents
writing .pyc files to the read-only mount. An image with no python3 on
PATH is a grader failure that says so: the grader exits 127 and its
<kind>.err file shows exec python3 failed. Any
other exit 127 is reported as a plain grade exited 127.
gradereadstask.jsonandanswer.txtfrom{run_dir}and the data files from the task's directory, and writesgrade.json(§4.2): numbers, booleans andnullundermetrics; strings, lists and objects underdetails, withdetails.grader_version. A grader that raises writespass: nullwitherrors. A metric the task'sgatenames that the grader did not produce isnull.oraclewrites the reference answer toanswer.txtand leaves the workspace alone, exceptdokimi:typecheck, whoseoraclecopiesreference/over the workspace (see its paragraph below), anddokimi:hidden_tests, whoseoracledoes the same and then deletesreference_deleted.
A review task with pass: null is scored, not gated: give it score. A gate
on its metrics is not applied (success is null), and without score the run
is a grader failure. A clean-diff control (no seeds) has recall: null, so it
takes no score; its gate is the default ["pass"]. The manifest's
entry_points.grade is optional when every task's grader starts with
dokimi:.
Both review graders read the answer the same way. Its last parseable
```json fence (one nesting arrays or objects more than 100 deep counts
as unparseable, whatever json.loads accepts) must be an array of findings
{"file", "line", "severity", "rule", "message"}; entries that are not
objects are dropped. file is made repository-relative: a path is cut after
/eval/run/workspace/, then after the last /repo/ (a standalone oneDAL
run's workspace; a relative a/repo/b becomes b, the seed's or thread's
file as well as the finding's), then leading ./ and / go. line is
read with Python's int() ("6" is 6, 5.9 is 5); a missing or falsy line
(null, 0, ""), or a value int() cannot read, is -99, near nothing. severity blocker or major counts toward
n_severe. An answer with no such array gives only pass: false,
parse_error: true and every recall 0 (recall; replay also recall_all
and recall_addressed; null when there is nothing to recall): the agent
failed the task, and on a task with score that is a failed run with score
0, not a grader failure.
grader |
data next to task.json (key that renames it) |
pass |
metrics |
details |
|---|---|---|---|---|
dokimi:review_seeds |
manifest.json (manifest); oracle answer oracle.json (oracle_answer), a list of findings |
null; for a manifest with no seeds (a clean-diff control), true when no finding is blocker or major |
n_findings, n_severe, n_decoys, unmatched, recall (null with no seeds) |
seeds_hit, decoys_flagged, recall_by_class ("hit/total") |
dokimi:review_replay |
gold.json (gold); task.json window, default 5 |
null (score-only) |
n_findings, n_severe, n_threads, recall (= recall_all), recall_addressed, precision_proxy |
threads_hit, matches, recall_by_kind, decoys_flagged (always []) |
dokimi:hidden_tests |
hidden/ (the hidden files at their repository paths) and an optional reference/; the task's own fields hidden_tests (the files entry_points.test runs), hidden_files (the files copied in, default hidden_tests) and reference_deleted |
true when the test command exited 0, did not time out, and its report holds a test case and every one passed (a skipped one fails it), else false |
n_tests, n_passed, n_failed, n_errors, n_skipped, pass_share (passed over all the cases, skipped ones included; 0 when there is none, so a run that broke the test command counts, §4.2), tests_rc, tests_timed_out |
not_passed (the first 50 failed, errored or skipped cases, classname::name), report (why no case was read) |
dokimi:graph_enum |
gold.json (gold): answer_key (files, functions or classes), gold, exclude, accepted (§4.7) |
null (score-only); false with parse_error: true and every metric 0 when the answer has no list under the key |
f1, recall, precision, n_gold, n_answer, n_false_positive |
missed, false_positive, accepted_extra (first 50 each) |
dokimi:typecheck |
none: the task's own fields tool (mypy), mypy_version (the image's mypy, exactly; version only as a deprecated fallback), paths (workspace-relative files) |
true when no error is reported on a listed file, every listed file exists, and nothing silences mypy, else false |
n_errors, n_missing, n_suppressions, n_files |
errors (first 50, file:line: message [code], and each silenced spot), missing, tool, tool_version |
dokimi:typecheck checks the listed files only. Its pass is "no error on a
listed file" (an error in a module a listed file imports belongs to that module,
not to the listed file; an installed module without types is read as Any, not an error), and a listed file that is missing fails. Silencing mypy fails too: a # type: ignore or # mypy: comment, the name no_type_check, or a branch mypy never checks because it takes TYPE_CHECKING (or MYPY) as true (if not TYPE_CHECKING:, the else of if TYPE_CHECKING:, and the same for a condition that combines it with not, and or or, such as if not TYPE_CHECKING and x: or if TYPE_CHECKING or x: with an else) in a listed file, or a .pyi anywhere in the workspace (it would replace the module it names; a dot directory such as .venv or .git that holds no listed file is not read, as no import can name it), or a top-level module or package named as a standard-library one or one the image's site-packages provides (json.py, requests/__init__.py, the same replacement; the repository's own package is not one when the image installed it from the workspace directory, pip install . or pip install -e . there, which its direct_url.json records as dir_info, and is one when installed from any other directory), is a suppression, and the grade counts it in n_suppressions. A listed path
reached through a symbolic link is missing, not read. A symbolic link in the workspace whose target
lies outside it (outside such a dot directory) refuses the whole grade (a grader error, not a pass), listed or not, whenever mypy runs, that is
when some listed file is present: mypy follows an import through a link, so an unlisted module could supply what a
listed file imports. When every listed file is missing, mypy does not run, and the grade is a failure with
n_missing set, not a grader error, even if a link lies outside. The exception
is a blocking error (a syntax error, a duplicate module) that stops mypy before
it reaches the listed files: then that error is the grade's, and the grade fails.
Not counted, so not guarded: other code mypy takes as unreachable and does not check (under a sys.version_info or
sys.platform guard the image's Python does not take, after assert False), and a change to an unlisted module that
hides a listed file's error (a module __getattr__ returning Any, a return type widened to Any). A repository's
own code has both, and the grader cannot read the base to tell them from the agent's; --warn-unreachable would
report only the assert False kind, along with the repository's own unreachable branches. A task that needs these
guarded checks them in its own grade entry point.
reference/ is optional. The task's oracle copies its reference/ directory, when it has one, over the
workspace, so a reference repair is what gets graded; its answer is empty. A directory of reference/ that
cannot be listed makes the oracle fail with a ValueError naming it, and a directory of the workspace that
cannot be listed leaves the run not graded (the error is in grade.json), not read as a smaller tree. Without reference/ the grade
reads the listed files as they are, and the self-check (§4.3) runs the null step only: the untouched
listed files must fail, since there is no reference repair for the oracle step to pass.
It runs mypy in-process in the grading container, so the image's python3
must import the pinned mypy: a mypy_version other than the installed one is a
grader failure, not a fail. version is the task's revision, so the pin lives in mypy_version; a task
written before that key pins through version still, with a deprecation note on the grade's stderr, and
mypy_version takes precedence when both are set. It is not "no new errors against the base": the
grader is stdlib-only and cannot run git to read the base, and it does not
start basedpyright (the L0 check, §8.2, runs mypy or basedpyright on the host, as --typecheck-tool selects). A repository that
needs that comparison writes it in its own grade entry point.
dokimi:hidden_tests grades the workspace with the repository's own tests, held out of it
until the grade. Before the grader runs, the framework copies each hidden_files path from the
task's hidden/ into the workspace, with its file mode, replacing a file (or a link) the workspace has there; a
directory on the way that is a symbolic link or not a directory, or a directory at the path,
stops the copy and the grade is a grader error; so does a hidden file that is a symbolic link
(eval check --schema-only reports it) or cannot be copied. It then runs entry_points.test (§2) in a
container like the grading one (same mounts, network and environment, no grader code), with
its output in test.log and test.err, records its exit in hidden-tests.json, and runs
the grader, which reads that record and the JUnit report at {out}
(hidden-tests.xml). A test case with a failure element failed, one with error errored,
one with skipped was skipped, and any other passed. No report, an unreadable one, one over 64 MB,
or one that declares a DOCTYPE or an entity is a failed run with no test case (n_tests 0,
details.report says why), not a grader error: the subject's code may break the test command.
The gate is the default ["pass"]: every hidden test ran and passed; pass_share is the
partial credit repo compare --metric pass_share reads. A skipped case fails the gate and counts
against pass_share: a test that skips when the change is absent (pytest.importorskip of a module
the change adds) shows nothing. So a task whose oracle run skips a case (a platform skipif) is
broken in the self-check (§4.3): drop that case from the task's tests, or the task. The test command runs the subject's
code with the run dir writable, as a repository's grade does, so a run that rewrites the
report is not detected. Its oracle copies reference/ over the workspace as
dokimi:typecheck's does and then deletes each reference_deleted path, refusing one reached
through a symbolic link. eval tasks generate --from prs writes these tasks (§4.8).
manifest.json is {"seeds": [{id, class, file, lines, kw}], "decoys":
[{id, file, lines, kw}]}; file "*" matches any file, and kw is a
regular expression searched case-insensitively in the finding's rule,
message and evidence.
- A finding on a seed's file hits every seed whose
kwmatches. When none matches, it hits the one seed (not"*") whoselinesare nearest, if within 1 line. - A finding that hits no seed is a false positive when it is on a decoy's
file and matches its
kwor one of itslines; it is listed indecoys_flagged. Otherwise it counts asunmatched. recallis seeds hit / seeds.
gold.json is [{id, file, line, kind, comment, addressed}]: one human
review thread of a merged PR, anchored on a line of the reviewed revision.
- A finding on a thread's file within
windowlines of its anchor can hit it. Matching is one-to-one and nearest first: one finding credits at most one thread, and one thread at most one finding. matchesholds one object per credited pair, inthreads_hitorder: the thread'sthread(id),thread_file,thread_lineandcomment, the finding'sfinding(its index among the answer's objects),file(repository-relative),line(as read for matching),severityandmessage, and theirdistancein lines;comment,severityandmessageare cut to 200 characters.repo report --hitslists them (§9).- Judged recall (
repo hits judge, §9) is an optional, paid step after grading; the grader stays deterministic andgrade.jsonis not rewritten. A judge model labels each credited pairsame point,relatedorunrelated, reading the thread's fullcommentfrom the gold file and the finding's fullmessage(with itsruleandevidence) from the cell'sanswer.txtat indexfinding;matchesgives the pairing, and a full text that does not start with the match's cut of it changed since grading and is not judged.recall_judgedis thesame pointpairs overn_threads, and null when a pair of the cell is unjudged (not measured, so not a 0). Only credited pairs are rescored: a thread no finding was credited with stays missed, and a finding outside the window is not judged, sorecall_judgedis at mostrecall.repo compare --metric judge:recall_judgedcompares it across arms (§9). It is a judge's reading, not a verdict: quote a figure only next to a person's labels for a sample of the pairs (repo hits sheet, then--labels), whose agreement with the judge and Cohen's kappa per arm and answer model the command reports; without them, or when no pair carries both a person's and the judge's label, it says the figure is uncalibrated, and it names the rows (arm and model) that no labelled pair covers: one model's labels do not calibrate the judge on another model's findings. recall_addressedcounts only threads withaddressed: true(the code changed in response),recall_by_kindgroups bykind, andprecision_proxyis the share of findings within the window of any thread, a lower bound on precision. Humans miss problems and raise non-defects, so neither is a verdict.- The oracle answer is one finding per thread, at its anchor.
eval tasks generate --from replaywrites these tasks from recorded review threads (§4.6).
4.6 Replay tasks from review threads¶
eval tasks generate --from replay writes dokimi:review_replay tasks (§4.5) from the review
threads of merged pull requests, so gold.json is not written by hand. It
makes no GitHub call: the threads come from a file gh api graphql wrote, so a
private repository works the same way and the command needs no network for a
local source.
# a window of merged PRs with their threads; --slurp writes the pages as one JSON list
gh api graphql --paginate --slurp -F query=@replay-threads.graphql \
-F q='repo:IntelPython/dpnp is:pr is:merged merged:2026-10-01..2026-10-27' > threads.json
python cli.py eval tasks generate ~/dpnp --from replay --threads threads.json --out-dir ~/dpnp/.agent-eval/tasks
replay-threads.graphql asks for the fields the command reads. A search
returns at most 1000 pull requests, so split a larger window by date. The
query reads up to 100 threads per pull request and 50 comments per thread;
raise first: for a pull request with more.
query($q: String!, $endCursor: String) {
search(query: $q, type: ISSUE, first: 10, after: $endCursor) {
pageInfo { hasNextPage endCursor }
nodes {
... on PullRequest {
number title url author { login __typename }
headRefOid mergeCommit { oid }
reviewThreads(first: 100) {
nodes {
path originalLine diffSide subjectType
comments(first: 50) {
nodes { author { login __typename } body createdAt url originalCommit { oid } }
}
}
}
reviews(first: 50) { nodes { author { login __typename } body } }
}
}
}
}
Any JSON holding pull request objects with number and reviewThreads is
read: one response, the pages --paginate --slurp writes, or a list of pull
requests. A pull request on two pages is read once. A commit that is not given
as a full 40- or 64-character hex SHA counts as missing.
Gold threads. A thread is gold when its first comment was written by
someone other than the PR's author and not by a bot (__typename Bot, or a
login ending in [bot]), on a line of the new file (subjectType other than
FILE, diffSide other than LEFT, an originalLine), and names its
originalCommit. Every
other thread is listed with the reason, and so is every non-empty review body
by a reviewer: it has no line and is never gold.
One task per pull request, in <out>/review_replay_pr<number>/:
- The reviewed revision is the
originalCommitmost gold threads were written on (on a tie, the one with the latest comment).baseis its merge base withmergeCommit^1, the base branch as the PR merged. That holds for a squash, merge-commit or rebase merge; a PR merged by fast-forward (mergeCommitisheadRefOid) is skipped, since itsmergeCommit^1is one of its own commits. change.patchis the diff frombaseto the reviewed revision as one commit titled with the PR's title, binary files included.git amstrips the CR at the end of each line of a plain mail, so a diff holding a CR (a file with CRLF line ends) is written base64-encoded, which keeps it.task.jsonhasfamily: review,grader: dokimi:review_replay,score: {metric: recall, max: 1.0},review_patch,gold,window(--window, default 5) and the prompt (--prompt-filereplaces the default, which asks for the findings JSON of §4.5). For the reader it addssource_pr,source_url,reviewed_commit,merge_commit,left_out_files,patch_filesandpublic_at.patch_filesis the sorted pathschange.patchchanges, from the same diff (a rename as both its paths, since the diff follows none; theleft_out_filesnot among them).public_atis the earliestcreatedAtof a gold thread's first comment, as the threads file gives it, the time the task's answer was public. It is absent when any gold thread'screatedAtis missing, not ISO 8601 or has no offset (Zis one), as the earliest time is then unknown; the build's notes name those threads.repo compare(§9) reads both from a cell's copy oftask.json: it flags the task when a guidance file that applies to a path ofpatch_fileswas committed, by thecommitteddate aguidance:rev:arm records (§3), afterpublic_at. A task built beforepatch_fileswas written is read as if every guidance file applied to it.gold.jsonholds{id, file, line, kind, comment, addressed, reply, url}per thread.idispr<number>-t<n>,nbeing the thread's position among all the PR's threads, so ids stay the same when a thread is dropped.kindisunknown, andreplyis the PR author's first later comment in the thread.
GitHub names a thread's file as it is now, so the file's name at the
thread's originalCommit is followed back through its renames from
headRefOid, one commit at a time (git log --follow). A thread written on
another revision is carried to the reviewed one commit by commit along the
first-parent path between the two, or through the one diff between them when
history was rewritten. It is left out when its line changed on the way, and so
is a thread whose line is not in the file at the reviewed revision. A thread
that a commit on the first-parent path up to the reviewed revision answered (as
addressed reads it) is left out too: the change under review holds the fix.
Guidance and eval_dir are left out. Workspace preparation applies the
arm before the review patch (§3, steps 5 and 7): guidance:none deletes the
files the guidance globs match and every AGENTS.<agent>.md overlay,
guidance:overlay deletes the overlays of other agents and guidance:rev:
replaces the matched files, so a hunk on one would not apply, and a guidance
file the PR adds would reach every arm. Overlays count as guidance here.
eval_dir is never in a workspace. Files of either kind are left out of the
patch and listed in left_out_files, and their threads are left out of
gold.json. A pull request that changes nothing else gets no task.
addressed is true when one of the PR's own commits after the thread
changed its file within window lines of its line; deleting the file is such
a change. The command walks the first-parent commits from the thread's
originalCommit to headRefOid and carries the line through each. A commit
counts when it has one parent and no bot wrote it ([bot] in its author's name
or email, as in pre-commit.ci's fixes); a commit GitHub made from a reviewer's
suggestion counts, since accepting it is the response. Any other commit only
moves the line: a merge of the base branch into the PR does, and the commits it
brings in are not on that path, so a change another PR made next to the line is
not a response. When such a commit rewrites the line itself, the walk stops
there with addressed false and the thread is listed for a maintainer to
check. A fix that a later merge undid is still addressed, since the author
accepted the comment. When no first-parent path leads from the thread's
originalCommit to headRefOid (a force-push rewrote history, or the revision
is reached only through a merge), the diff between the two is read instead,
and the thread is listed too.
Before a run a maintainer sets kind, and sets addressed to false where
reply declines the comment ("it's intended") but a commit changed the lines
nearby for another reason. A task directory that has a task.json is kept as
it is on the next run; --force rewrites it.
Commits. For a remote source the commits the clone lacks are fetched from
origin by SHA: the reviewed revision of a squash-merged PR is reachable only
from refs/pull/<number>/head, which GitHub serves. A local repository is read
as it is, so fetch those refs first, for example
git fetch origin '+refs/pull/*/head:refs/remotes/origin/pull/*'. A thread
whose revision is still missing is listed and left out.
The command exits 2, before it reads the threads file, on a malformed source,
an unpinned remote, a local source that is not a directory, a pinned local path inside a repository
that is not its root (<repo>/sub@<sha>: give the root), or a --cache-dir that is not a usable directory. It exits 1 when the threads file cannot be read or holds no pull
request, when no pull request gave a task (written, or kept from before), and
on an error that is not one pull request's own: a malformed pull request, a
source it cannot open, a manifest that is missing or malformed, the prompt file, or a task it cannot write. Each prints
✗ and the reason; a --manifest path that leaves the source tree exits 2 instead, pinned or not. A git failure while one pull request is built skips that
pull request with the reason.
eval check then runs the tasks, and two arms measure the guidance
(§9):
python cli.py repo compare repo-runs/replay --baseline guidance:none --metric recall_addressed
4.7 Graph tasks from a code index¶
eval tasks generate --from graph writes dokimi:graph_enum tasks (§4.5)
whose gold is read from a SCIP index of the source (§1.2). No LLM, no docker:
a task is as right as the index it came from.
# the index must be built at the revision the source names; that SHA is each task's base
python cli.py eval tasks generate ~/repo@<sha> --from graph --index index.scip \
--out-dir ~/repo/.agent-eval/tasks [--references 9] [--derives 3] [--seed 7] [--dry-run]
Two questions:
- references: every file that references one function, outside the files
that define it. On an index with enclosing ranges (scip-python) the answer is
functions when every function the index defines has an enclosing range
(otherwise files),
path::namewith the name as it reads inside its file (Impl.runfor a method), the innermost function whose definition (signature or body) holds each reference; module-level code and class bodies are not a function. Test files count. SCIP does not tell a call from another use, so the question is references, not calls. On scip-clang a declaration (a header prototype) has no role that tells it from a use, so its file is gold and the prompt counts a declaration as a reference. C++ overloads share one qualified name the prompt cannot tell apart, so they are one target and the prompt says how many overloads count; on scip-python, which has no overloads, each symbol is its own target. - derives: every class whose bases (as the reader gives them, §1.2) include
one class, answered as
path::Class. On scip-clang the bases are the reader's minimal set, and the index cannot tell a class that names the target next to an intermediate base from one that derives through it: every class that lists the target but is not in that set goes toaccepted, so naming it is neither a hit nor a false positive.
Targets. A function or class defined in a tree file that is neither a
test nor generated; dunder methods and C++ operators are never targets. A
target with a reference (or, for derives, a subclass) outside the tree's files
or defined only in a test is dropped, since the gold would be incomplete. The
gold size must be between 5 and 40 (derives: 2 to 40 subclasses). The index
paths are mapped onto the tree as repo inspect --index does (§8.1). A tree
file under the index's root, of an extension the indexed files have, that the
index lacks (a test file too) holds references no gold has: a target whose
name is a word in one is dropped, and the command prints a warning with their
count, the first one and how many targets were dropped.
Choice. Seeded (--seed): about half the tasks of each kind have a name
other targets share (the prompt says how many and which one counts), since
telling one run from another is what a text search gets wrong. Names and
task ids are distinct. An id is graph_<kind>_<name>_<hash>, the hash over
the target's SCIP symbols, so another seed or revision that picks another
run writes another directory (as does the same function after the package
version in its symbol changes).
Files. <out>/<id>/task.json (family: navigate, base, grader,
score {metric: f1, max: 1.0}, max_turns, and the provenance fields
question, answer_key, symbols, ambiguous_name, code_index {tool,
sha256}) and gold.json (answer_key, gold, exclude: the defining files
for references, accepted: right answers not required, such as a class's
second defining file (a .pyi next to its .py); a person may add more;
distinct: the other functions (for function answers) or classes (for class
answers) of a gold file whose last name is a gold item's, so a bare name that
fits one of them names no gold item). The
manifest needs entry_points: {} when every task uses a built-in grader. A
task directory that has a task.json is kept and printed as kept <id>;
--force rewrites it.
Grading. The agent's last parseable ```json fence is the answer (a later fence that does not parse is skipped, as dokimi:graph_enum reads it); one
without the answer key as a list gives pass: false, parse_error: true and
every metric 0, a failed run. A path is cut after the agent's workspace and
loses a leading ./; in a name :: reads as . and a trailing () is
dropped. A name that matches no item exactly names the one gold or accepted
item of its file whose name ends with it, or that it ends with, in whole parts (go for
Impl.go, ns.Impl for Impl), when there is one and no distinct item
of the file fits it too; a name that agrees with several names the one sharing
the most trailing parts with it (cli.Impl.go names Impl.go, not go); B.go never names Impl.go. An item in an
exclude file is dropped, an item in accepted counts neither way. The score
is F1 against gold. A gold file with an unknown answer_key, an empty
gold, a blank gold entry, a gold entry in an exclude file, or an
exclude, accepted or distinct that is not a list of strings is a grader
error.
The command exits 2 without --index, with --references 0 --derives 0, on
an unpinned source, a --cache-dir that is not a usable directory, an index that does not read, or one that maps to no file
of the tree; 1 when no target gave a task, a task cannot be written, or the source cannot be resolved at the revision.
4.8 Authoring tasks from merged pull requests¶
Review replay (§4.6) measures guidance for reviewing; most guidance is read while writing code.
eval tasks generate --from prs writes dokimi:hidden_tests tasks (§4.5) from merged pull requests: the
agent gets the PR's title and description, the PR's own tests are held out of the workspace
and run at grade time, and the rest of the PR's diff is the oracle. Like replay it makes no
GitHub call and reads the history with git.
gh api graphql --paginate --slurp -F query=@authoring-prs.graphql \
-F q='repo:intel/dokimi is:pr is:merged merged:2026-10-01..2026-10-27' > prs.json
python cli.py eval tasks generate ~/dokimi --from prs --prs prs.json --out-dir ~/dokimi/.agent-eval/tasks
query($q: String!, $endCursor: String) {
search(query: $q, type: ISSUE, first: 50, after: $endCursor) {
pageInfo { hasNextPage endCursor }
nodes {
... on PullRequest {
number title body url createdAt author { login __typename }
headRefOid mergeCommit { oid }
}
}
}
}
The file is read as replay reads its threads file (one response, the pages --slurp writes, or
a list), taking every object with number and mergeCommit; body and createdAt are the
fields replay's query lacks, so adding them to the §4.6 query makes one file serve both
commands. An object without body is skipped with that reason, since its prompt would be the
title alone; an empty body is a PR with no description. The files a PR changes come from git, not from the file.
One task per pull request, in <out>/authoring_pr<number>/:
baseis the merge base ofheadRefOidwithmergeCommit^1, as replay takes it (§4.6), and the change is the diff frombasetoheadRefOid. A PR merged by fast-forward is skipped. A file the guidance globs match, an overlay or a file undereval_diris left out and listed inleft_out_files, as in replay.- Of the rest, a test path is a file whose name a test runner collects (
test_*,*_test.*,*_tests.*,*.test.*,*.spec.*), aconftest.py, or any file under a directory namedtest,testsor__tests__. The test paths the PR adds or changes arehidden_files, written tohidden/at their repository paths; those whose name a runner collects arehidden_tests, the filesentry_points.testruns. A test path the PR deletes is not hidden: the base's copy stays in the workspace. - Every other path is the oracle:
reference/holds each file the PR adds or changes, with its content and mode atheadRefOid, andreference_deletedlists the ones it deletes.oracle_linesis the lines it adds and removes there (a binary file counts none). task.jsonhasfamily(fixwhen the title starts withfix,bugfixorhotfix, elsefeature),base,prompt,grader: dokimi:hidden_tests,hidden_tests,hidden_files, and for the readersource_pr,source_url,merge_commit,head_commit,patch_files(every path the change makes outsideleft_out_files, tests included, the rename of a file as both its paths),oracle_lines,prompt_dropped, and when they applyreference_deleted,left_out_filesandpublic_at. Nogate: the default["pass"]is that every hidden test ran and passed, andpass_shareis ingrade.jsonbeside it.public_atis the PR'screatedAtas the file gives it, absent (with a note) when it is missing, not ISO 8601 or has no offset.repo compareflags these tasks by the rule it applies to replay tasks (§4.6, §9): a guidance file that applies to a path ofpatch_files, committed afterpublic_at.
The prompt is the PR's title, its description, and a fixed instruction (implement the
change; its tests are hidden and run after the agent finishes); --prompt-file replaces the
instruction, not the PR's text. From the description the command removes, counting each kind
in prompt_dropped:
code_blocks: a fenced block whose info string isdifforpatch, that holds a diff line (diff --git,@@ -,+++,--- a/), or half or more of whose lines of 4 or more characters are lines the PR's diff adds or removes;links: a link or URL to/commit/,/commits/,/compare/, a.diffor.patch, or/pull/<number>of the PR itself, and a word of 7 to 40 hex digits that starts one of the PR's commits (base..headRefOid);test_lines: a line naming a hidden test: its path, its file name without the extension (not a baretestortests), or a function or class whose name starts withtestorTestthat a line the PR adds to a hidden test file defines (def,async def,class). A PR with more than 5 such lines is skipped: its description is its tests.
Which pull requests give a task. The build's filter is cheap: the PR adds or changes a
hidden test, changes something outside its tests, and its oracle_lines is at most
--max-lines (default 400). eval check (§4.3) decides the rest: the untouched base must
fail the hidden tests, the oracle must pass them, each twice, or the task is broken or flaky.
A pull request that gives no task is listed with the reason:
| Reason | When |
|---|---|
not merged: no mergeCommit in the input |
mergeCommit is null or not a full SHA |
no headRefOid in the input |
the same for headRefOid |
its mergeCommit <sha> is not in the source (fetch the base branch), its headRefOid <sha> is not in the source (fetch refs/pull/<n>/head) |
the commit is missing |
merged by fast-forward: ... |
mergeCommit is headRefOid |
its headRefOid <sha> shares no history with the base branch |
no merge base |
<sha> changes nothing against its base <sha> |
an empty diff |
it changes only guidance files or files under eval_dir |
nothing is left after left_out_files |
it adds or changes no test file |
no hidden_tests |
it changes only test files, so there is nothing to implement |
no oracle |
its diff outside the tests changes <n> lines, more than --max-lines <m> |
oracle_lines over the limit |
it makes <path> a symbolic link or a submodule, which a task copies no file for |
the PR's version of a hidden or oracle file is not a regular file |
its description names the hidden tests on <n> lines, more than 5: the description is its tests |
test_lines over 5 |
git <command> failed: ..., git <command> timed out ... |
a git failure while that PR is built |
A task directory that has a task.json is kept as it is; --force rewrites it, and its
hidden/ and reference/ with it. For a remote source the clone fetches the mergeCommit
and headRefOid it lacks from origin; a local repository is read as it is, so fetch
refs/pull/*/head first (§4.6).
The command prints one line per pull request (written, kept or skipped, with the
reason or the counts) and a summary. It exits 2, before it reads the pull request file, on a
malformed source, an unpinned remote, a local source that is not a directory, a pinned local path inside
a repository that is not its root (<repo>/sub@<sha>: give the root), or a --cache-dir that is not a usable directory. It exits 1 when the pull request file cannot be read or
holds no pull request, when no pull request gave a task (written, or kept from before), and on
an error that is not one pull request's own: a malformed pull request (a number that is not
an integer), a source it cannot open, a manifest that is missing or malformed, the prompt file (unreadable or empty), or a task it
cannot write. Each prints ✗ and the reason; a --manifest path that leaves the source tree exits 2 instead, pinned or not. Grading a task needs the manifest's
entry_points.test (§2).
From commits: eval tasks generate --from history¶
The same tasks, from the source's own history, need no pull request file:
python cli.py eval tasks generate ~/repo@main --from history --out-dir ~/repo/.agent-eval/tasks \
[--commits 300] [--subject REGEX] [--max-lines 400] [--prompt-file FILE] [--dry-run]
- The commits are the non-merge ones among the newest
--commits(default 300) first-parent commits of the pinned revision (a branch, tag or SHA, resolved once), and of those, the ones whose subject--subjectmatches, case-insensitively. A merge, and so the commits of a branch merged with--no-ff, gives no task; the output counts the merges left out. A revert (a subject that starts withrevertorback out),fixup!,squash!oramend!commit is never one, whatever the pattern. Leading bracketed tags such as[backport]and a conventional commit prefix are ignored when recognizing these subjects. The default pattern holds the words a fix's subject uses (fix,bug,regress,crash,wrong,incorrect,broken,no longer,never,hang,leak,off-by,mismatch,silently);.takes every commit. - Each commit is a change from its first parent to itself. A root commit is skipped. The task
is
<out>/authoring_<first 12 hex of the SHA>/, written by the same writer, filter and prompt rules as above. The commit's subject is the title and the rest of its message, less the trailer lines that name people (Signed-off-by:,Co-authored-by:,Reviewed-by:, ...),Change-Id:and(cherry picked from commit ...), is the description. A subject that ends with(#<n>)(a squash merge) loses that suffix, andnbecomessource_pr, so a link to/pull/<n>is dropped. A commit with no such suffix drops no pull request link. One change is one task: a commit whose(#<n>)already has a task in--out-dir(authoring_pr<n>from--from prs) iskeptas that task, and--from prskeeps PRnas theauthoring_<sha12>whosesource_prisn;--forcerewrites neither. Two commits with one(#<n>)give one task, the newest's, and--dry-runsays so. task.jsonhassource_commitin place ofsource_url,merge_commitandhead_commit.familyis alsofixwhen the title matches the default--subjectpattern, whatever--subjectis (Crash on negis afix).public_atis the commit’s author date (%aI) for commits without a PR suffix. It is omitted for squash merges because Git does not record the PR’s opening date. A pull request was public from when it was opened, which git does not know.--from historyreads--commits,--subject,--max-lines,--manifest,--manifest-file,--prompt-fileand--dry-run. Any other source flag given here (--index,--prs,--threads, ...), even at its default value, is a usage error (2),<flag> is for --from <sources>, and so are--commitsand--subjectwith another source. So is a--subjectthat is empty or does not compile, an unpinned source, and the source errors--from prsexits 2 on.- It prints how many of the non-merge commits it read the pattern matched, one line per commit
(
written,would writewith--dry-run,keptorskippedwith the reason), and a summary. It exits 1 when no commit gave a task (written, or kept from before), on a git failure, on a shallow clone (history generation needs a full clone; run git fetch --unshallow), and on the errors--from prsexits 1 on (a source it cannot open, a missing or malformed manifest, a prompt file that is empty or cannot be read, a task it cannot write), each with✗and the reason.
On dokimi's own history (the newest 60 first-parent commits), 22 subjects match and 15 tasks are
written. 7 are skipped: 6 over --max-lines, 1 with no test file. The two PRs that both sources
cover (#393, #405) give the same hidden tests and oracle_lines; into one --out-dir, whichever
runs second keeps the first one's task.
4.9 run_context.v1 (written by repo run to {run_dir}/run_context.json)¶
Beside events.jsonl, one record per cell: what the agent CLI printed about the run it made.
Every field comes from the CLI's own start-up record (system/init, or Copilot's session.start),
its closing record (result, turn.completed, turn.failed), or the command line dokimi started
it with. A field the CLI did not print is null; nothing is taken from a default, so a sparse
trace gives nulls. The schema is dokimi/schemas/run_context.v1.json.
{"schema_version": "run_context.v1", "harness": "claude-code", "harness_version": "2.1.400",
"model_requested": "m-1", "model_served": {"init": "claude-sonnet-x", "usage": ["claude-sonnet-x"]},
"effort": "high", "thinking": null, "credential_kind": "ANTHROPIC_API_KEY",
"permission_mode": {"mode": "bypassPermissions", "sandbox": null, "approval": null},
"tools": {"allowed": ["Read", "Bash"], "disallowed": ["WebFetch", "WebSearch"]},
"extensions": {"plugins": [], "skills": null, "mcp_servers": ["docs"], "agents": null, "output_style": "default"},
"outcome": {"stop_reason": "end_turn", "terminal_reason": "completed", "num_turns": 3,
"permission_denials": 0, "safety_stops": 0},
"config_sha256": {"settings.json": "<64 hex>"}}
harnessis the profile's name (claude-code,codex,copilot), which dokimi started; the CLI does not print it.harness_versionis the CLI's own version (claude_code_version), else the version dokimi probed (version_cmd).model_requestedis the model the evaluator asked for (repo run --model), whether or not the profile passes it to the CLI.model_served.initis the model the start-up record names;model_served.usagelists the keys of the closing record'smodelUsage, which include helper models. Codex prints no model, so both are null there.effortis the start-up record'sper_turn_effort_active, else--effort, else Codex's-c model_reasoning_effort=.thinkingis the--thinkingvalue.permission_modeandtoolsare what the CLI printed, else the flags dokimi passed. For Codex the sandbox and approval values stand in for tool lists, which are null there.extensionslists names only (plugins, skills, MCP servers, agents) and the output style.outcome.permission_denialsis the number of refused tool calls.outcome.safety_stopsis the number of main-thread replies whosestop_reasonwasrefusal; it is null when no reply carried a stop reason. A reply split over several records (onemessage.id) counts once, by its laststop_reason.config_sha256holds the SHA-256 of each config file dokimi wrote for the run, and of each workspace file the profile'sargs_if_presentnamed, taken before the agent starts. Keys are file names, never paths, with any character outsideA-Za-z0-9._-written as_: a nested workspace file is keyed by its base name, or byworkspace.and its dotted path when that name is already a key. Contents are never recorded. A link, or a file under a linked directory, is not read, and a file that cannot be read is left out.
A record that cannot be written is a note in the cell's trace_errors, not a failed cell.
5. Aligning oneDAL dev/agent_evals (uxlfoundation/oneDAL#3818)¶
oneDAL drops its standalone mode: the generic parts of its harness move into
dokimi (#41), and dev/agent_evals keeps only its tasks, its image and the
graders that know oneDAL. These changes make that content runnable by the
framework.
| Today | Change |
|---|---|
guidance globs in config.py |
move to repo-eval.yaml guidance.globs |
task.json keys |
already match the core keys. Add gate: ["strict_pass"] to fix tasks, so a hidden-test pass that breaks a regression suite is not counted as success. Add score: {metric: recall, max: 1.0} to review tasks with seeds or threads, not to clean-diff controls (§4.5) |
base is a 8–12 character SHA |
expand to the full 40-character SHA (keep a trailing ^) |
entry points call dev/agent_evals/run.py |
call {eval_dir}/run.py; the graders must not assume they sit inside the workspace (§1.1) |
prep() in common.py |
goes: the framework prepares every workspace (§3) |
arms none / main-raw |
become guidance:none / guidance:raw. guidance:bridge is framework-only (§3); oneDAL keeps no bridge arm |
graders read history from ONEDAL_EVAL_SRC |
read {source_dir}, the only full-history source; the variable goes |
contract.py derives the base when meta.json has none |
diff from meta.json start_sha, and read base_sha / base_rev for the upstream commit (§4); nothing derives it |
build_make_gnu pip-installs MKL and TBB |
install them in the image, or give the task egress: [pypi.org, files.pythonhosted.org] |
Bazel install base in the container's HOME |
put it on a declared cache (bin/bazel --output_user_root) |
static_check.py --out writes files / counts / claims |
add "schema": "repo_static.v1"; the claim fields already fit §4.4 |
run.py grade <run_dir> writes a flat dict |
run.py grade --contract reads the §4 inputs and writes repo_grade.v1 (scalar fields under metrics, lists and objects under details); it stays for the graders that are not built in: build.py and make.py, which know oneDAL, and the fix and mutation graders until dokimi:hidden_tests and dokimi:mutation exist (#41) |
graders/review.py and replay.py (task grader review, review_replay) |
review tasks name dokimi:review_seeds or dokimi:review_replay (§4.5) and keep manifest.json, oracle.json or gold.json; both files go. The built-in graders give the same metrics for the same answers |
graders read Claude stream-json via traces.py |
read events.jsonl instead; traces.py becomes the Claude Code → events converter, which moves to the framework's harness profile |
oracle logic spread across run.py check |
expose it as the oracle entry point; review tasks need none (§4.5) |
bin/bazel wrapper, shared caches, MKLROOT removal |
expressed in the Dockerfile and image.caches / image.env |
| clean-ancestor guard, no-background hook, per-run config dir | done by the framework for every harness |
| fix and feature tasks have no review-level grading | add rubric.json per task (mergeability §2), starting from the tasks mined from reviewed PRs; maintainers approve each rubric |
static_check.py |
exposed as the static entry point. Its generic parts (links, paths, identifiers, fences) are framework L0 checks (§8); oneDAL rules such as the //... policy stay in oneDAL, and repo scan --static merges them |
6. Harness profiles¶
A harness is described by a harness_profile.v1 file. Built-in profiles live
in dokimi/repos/profiles/; --harness also takes a path. The model
is passed through as an opaque string.
schema: harness_profile.v1
name: claude-code
bin: claude # --bin overrides it, for example to pin a CLI version
version_cmd: ["{bin}", "--version"]
invoke: ["{bin}", "-p", "{prompt}", "--model", "{model}", "--output-format", "stream-json",
"--verbose", "--max-turns", "{max_turns}", "--max-budget-usd", "{budget}",
"--no-session-persistence", "--strict-mcp-config",
"--permission-mode", "bypassPermissions", "{tools}"]
tools: # what the "{tools}" element expands to
none: ["--tools", ""]
read: ["--tools", "Read"]
bash: ["--tools", "Bash"] # optional: repo reach --scenarios bash (§7)
all: ["--disallowedTools", "WebFetch", "WebSearch"]
delegation: # --delegation none: these replace the tool mode's arguments
none:
none: ["--tools", ""] # list every tool mode a run may use, even if unchanged
read: ["--tools", "Read"]
all: ["--disallowedTools", "WebFetch", "WebSearch", "Agent", "Task", "Workflow"]
config_dir_env: CLAUDE_CONFIG_DIR # a fresh directory per run
env_allow: [PATH, HOME, AWS_REGION, AWS_BEARER_TOKEN_BEDROCK, ANTHROPIC_API_KEY,
CLAUDE_CODE_USE_BEDROCK, https_proxy, no_proxy, ...]
env_set: {CLAUDE_CODE_DISABLE_BACKGROUND_TASKS: "1", DISABLE_AUTOUPDATER: "1"}
egress: ["bedrock-runtime.*.amazonaws.com", "api.anthropic.com"] # the only hosts the agent container reaches (§2)
endpoint_env: ANTHROPIC_BASE_URL # used by payload capture, if set
trace: claude-stream-json # converter to events.jsonl; or: codex-json, copilot-json, text
guidance: # DECLARED; verified by the reach probe, never trusted
names: [CLAUDE.md, CLAUDE.local.md, AGENTS.md]
resolution: ancestors-of-cwd + lazy-on-subtree-access
imports: "@path"
shadow_file: CLAUDE.local.md # written by `repo reach --scenarios shadow` (§7)
claude_displaces_agents: true # repo budget: a root CLAUDE* turns off every AGENTS.md, a nested one its own directory's
bridge: {for: AGENTS.md, write: CLAUDE.md, content: "@AGENTS.md"}
overlay: claude # the AGENTS.claude.md the guidance:overlay arm keeps (agentsmd/agents.md#185)
args_if_present: # argv added after the "{tools}" element when the workspace file exists and the tool mode is `all`
.mcp.json: ["--mcp-config", ".mcp.json"]
invokeandversion_cmdare argv lists. Each element becomes exactly one argument after substitution, and nothing passes through a shell.- The placeholders are
{bin},{prompt},{model},{max_turns}and{budget};version_cmdtakes only{bin}. A substituted value is never substituted again.invokeholds the element"{tools}"exactly once. - The child gets only the
env_allownames, thenenv_set, thenconfig_dir_env. User settings, memory and unrelated credentials stay out. In a container the host'sPATHandHOMEare dropped: the image'sPATHand the per-runHOMEapply. - Optional
prompt_suffixis appended to every task prompt, and optionalconfig_files(name → content) are written into the per-run config directory, with{config_dir}and{support_dir}(the framework's helper scripts) as the agent's container sees them. The built-inclaude-codeprofile uses them for a hook that refuses backgrounded shell commands. - Optional
delegation.nonemaps a tool mode to the argumentsrepo run --delegation noneuses instead, so the agent cannot start a subagent. It is an allow-list: list every tool mode the run may use (fornoneandreadthe arguments are the native ones); a tool mode it leaves out is refused. A profile withoutdelegation.nonerefuses--delegation nonebefore anything runs. The default,--delegation native, runs the tool mode as written: underall, Claude Code may start subagents.--delegation nonelimits the tools the agent is given, not the skills it loads: a skill whose frontmatter sayscontext: forkcan still start a subagent undernone. Do not read anonecell as subagent-free when the run's skills include one (tracked in intel/dokimi, "repo run: block fork-context skills under --delegation none"). -
args_if_presentchecks that the file exists, not that the harness accepts it. The built-inclaude-codeprofile passes.mcp.jsonas--mcp-configin thealltool mode, and the CLI exits 1 before its first turn on a file that is not valid MCP configuration ({for one). So a.mcp.jsonthat is not a JSON object, or whosemcpServersis not an object, is caught up front:eval check --schema-onlywarns about the one at each task base (at the eval tree when the source has no git history) and still succeeds,repo run --tools allexits 2 before any cell (a config the CLI rejects is a usage error; the cell is not run, so it is not rerun), and a cell whose arm wrote such a file (apatch:arm) is a cell error, not a graded run. The check reads the task base, so apatch:arm that repairs the file does not help. Fix or remove the file in the task base;--tools readornonedo not pass it, sorepo rundoes not check it there. -
tracenames the converter of the harness's stdout toevents.jsonl:claude-stream-json,codex-json(codex exec --json),copilot-json(copilot -p --output-format json) ortext(stdout is the answer, no events). Codex has no read tool, so itsreadevents come from shell commands that only print files (cat,head,tail,sed -n,nl); Copilot's shell commands and Claude Code's Bash calls give them too. Neither Codex nor Copilot reports a cost:cost_usdisnulland a batch budget counts each cell's cap. bin_companionsnames files the executable starts from its own directory.repo runmounts the executable alone at/eval/harness/<name>, so each companion is mounted read-only beside it, from the directory of the file--binresolves to (a symlink is followed); a missing one stops the run before any agent starts. Codex 0.160 needscodex-code-mode-host: every tool call goes through it.repo reachwritesconfig_filesinto each scenario's config directory asrepo rundoes, with{config_dir}and{support_dir}as host paths.- Optional
guidance.shadow_filenames a file the harness loads by convention that, put in a directory, should turn the other guidance there off: a file name or a path relative to the directory.repo reach --scenarios shadowwrites it to measure that (§7); a profile without it refuses that kind (exit 2). Only the built-inclaude-codeprofile sets it, toCLAUDE.local.md. native_prompt: truemarks a harness that runs its own built-in prompt, such as a native review mode.invokethen passes no{prompt}(and there is noprompt_suffix), the agent never sees the task prompt, andrepo reachrefuses the profile. Use such a profile only on tasks whose grader reads what it answers, whichanswer_formatprovides.answer_formatconverts the final answer before grading.codex-reviewkeeps Codex's review text and appends a```jsonblock of findings{file, line, end_line, severity, priority, rule, message}parsed from its- [P1] title — path:12-14lines (a failed run, an empty answer, an answer with no finding and no clean-verdict sentence, or a[Pn]header that does not parse gets no block, so no block means no review, not a clean one; a priority outside P0–P3 getsseveritynull):filerelative to the workspace,severityblocker(P0),major(P1) orminor(P2, P3),rulethe title andmessagethe body. The final message decides when it holds a finding or a clean-verdict sentence (No issues found.): an earlier draft it revises or takes back is not graded. A final message with neither (Review finished.) points back at the review, so the findings of every message are read, each once as its last version.
Built-in profiles besides claude-code:
| profile | runs | trace | notes |
|---|---|---|---|
codex |
codex exec --json … -- {prompt} |
codex-json |
CODEX_HOME is the per-run config dir; no turn or spend flag, the timeout bounds a run; none/read get Codex's read-only sandbox, which needs unprivileged user namespaces |
codex-review |
codex exec review --commit HEAD --json |
codex-json |
native_prompt, answer_format: codex-review; review tasks only (the change under review is HEAD) |
copilot |
copilot --prompt={prompt} --output-format json --allow-all-tools … |
copilot-json |
COPILOT_HOME per run; a GitHub token as COPILOT_GITHUB_TOKEN (GH_TOKEN and GITHUB_TOKEN are not forwarded: Copilot leaves them readable by the agent's commands), or BYOK through the COPILOT_PROVIDER_* variables; none names a tool that does not exist, because an empty --available-tools leaves every tool on |
copilot-review |
as copilot, with the prompt /review {prompt} |
copilot-json |
a prompt variant of copilot, not Copilot's review agent: under -p, /review reaches the model as plain text, with the same system prompt and tools; the task prompt still asks for its answer format |
npm installs codex and copilot as Node launchers. A run mounts one file as
the harness, so --bin names the native binary the launcher starts
(@openai/codex-<platform>/vendor/<triple>/bin/codex,
@github/copilot-<platform>/copilot). To route a CLI to another endpoint,
copy its profile: for Copilot, set the COPILOT_PROVIDER_* variables (and
COPILOT_OFFLINE=true to skip GitHub sign-in); for Codex, add a config.toml
under config_files that defines a model_providers entry with the endpoint's
base_url, wire_api = "responses" and env_key = "CODEX_API_KEY" (the variable that
holds its key; without it Codex sends no Authorization header) and selects it with model_provider.
Add the endpoint's host to egress in both cases. The hosted pull-request
reviewers (Copilot code review, @codex review, CodeRabbit) are not CLIs and
have no profile.
Profiles for other harnesses (Gemini CLI, Cursor agent, Aider, OpenCode,
in-house agents) follow the same shape. Their guidance
blocks start as the vendor's documented behaviour and are corrected by the
reach probe. Loading changes between versions of one harness, so
reach results are keyed by version.
7. Reach probe (guidance_reach.v1)¶
Protocol:
- Build a skeleton workspace in a temporary directory: the guidance files at
their repository paths, one probe file per guidance directory, and a
one-commit git repository.
- Guidance files are those matching
guidance.globs, plus every file named like the profile'sguidance.names, outsideeval_dir. - Loading depends on paths and names, not on the rest of the tree. A skeleton also keeps a blob-less clone from fetching every blob.
- The probe refuses to run if any ancestor of the workspace holds a
guidance file: a name some harness loads by convention, one of the
profile's
guidance.names, or, when a shadow scenario is planned, itsguidance.shadow_file, the path as given (.claude/CLAUDE.local.mdlooks for that path in each ancestor, not forCLAUDE.local.md). - It also refuses a tree path with a
\, a:, or a.,..or.gitcomponent, which would be written outside the workspace or into its git directory. - A symlink is one file, as in a checkout. With
CLAUDE.md -> AGENTS.md,AGENTS.mdis seeded once andCLAUDE.mdis recreated as a link to it, so a harness that loadsCLAUDE.mdloadsAGENTS.md's tokens. Where the OS refuses a symlink (Windows without Developer Mode), the link is written as a copy of the seeded file, andalias_kind: copysays so: a harness that skips symlinks would then still show the file loaded. - A link that escapes the tree, dangles, loops or names a directory is not
seeded. It is listed in
unresolvedwith the reason. When every guidance file is such a link, nothing is left to probe:repo reachstops with exit 1 before any scenario, and--dry-runstops the same way.
- Guidance files are those matching
- Seed the workspace. Each guidance file gets a head token, placed after any
YAML front matter, and a tail token. A token is
RCplus the first 6 hex digits of sha256(salt, path, position). - Run each scenario once per (harness, version, model), with a cheap model.
Each run gets a fresh config directory. The harness runs on the host, not
in the agent container (§2), so the profile's
egresslist is not enforced.cwd=.: started at the repository root, tools off.cwd=<dir>: started in each guidance directory, tools off.read=<dir>: started at the root, read tool on. The agent is told to read<dir>/REACH_PROBE.txt, then list tokens.bash=<dir>: started at the root, the profile'sbashtool mode (Claude Code: the Bash tool alone). The agent is told to runcat <dir>/REACH_PROBE.txt(the path shell-quoted,./before a leading-), then list tokens: it shows whether a shell read of a file in<dir>loads that directory's guidance. Only with--scenarios bash(the default isroot,cwd,read); a profile without abashtool mode (Codex and Copilot, whose shell commands are already their reads) is a usage error (exit 2) naming the profile. The shell runs on the host with the harness's credentials, so the mode must refuse every other command: Claude Code's gets the onecatinDOKIMI_REACH_COMMAND, and a PreToolUse hook blocks any other call (and every call if the hook fails).shadow=.andshadow=<dir>, only with--scenarios shadow(the default isroot,cwd,read): the profile'sguidance.shadow_file(§6) is written into the workspace for that one scenario, seeded with its own head and tail tokens, so a tree that holds none still shows what it turns off.shadow=.writes it at the root and runs ascwd=.;shadow=<dir>writes it in each guidance directory that holds a file not namedCLAUDE*(anAGENTS.md-class file) and runs asread=<dir>. A directory where the tree already has a file or a directory (an empty one included) at that path, or a file where the path needs a directory, gets no shadow scenario. The tree's files are compared ignoring case, as they would collide in the workspace on a case-insensitive disk; an empty directory is found by the disk's own lookup. A shadow path that would replace or go under a file of the probe's own (aREACH_PROBE.txt, a seeded file or a link) stops the run with an error once the workspace is built, before any scenario runs and before anything is written. The file is not committed, and it is removed when its scenario ends, after an error or a timeout too, with the directories it needed that the workspace lacked, so no other scenario sees it.- A scenario that runs past
--timeoutis anerror; its raw stdout up to the kill is kept in the trace. Its harness is killed with its process group (POSIX) or job object (Windows), and so is anything left in that group when the harness exits on its own. The group is also killed when thedokimiCLI gets SIGTERM or SIGHUP (fromtimeout(1), a CI cancel or a closed terminal); the CLI then exits with that signal. Not contained: the group of a CLI killed with SIGKILL, of a library caller that did not callprocess.install_signal_handlers(), and a process that leaves the group, such as one that callssetsid()or daemonizes. These can outlive the run with the harness's environment, credentials included.
- Ask for every token in the instructions or context, including context
attached to a tool result. Parse the reported tokens from the answer, and
the reads from
events.jsonl.
--dry-run prints the probed files and the argv of every planned scenario,
and calls no harness. It makes each check a run makes before its first
harness call (the harness's version command), so it refuses what a run would
refuse, with the same message and exit code: a selection that leaves no
scenario, a receipt that would replace the probe, and the checks of steps 1
and 2. For those it builds the workspace, in --work-dir when given, and
removes it, --keep or not. A --work-dir that is missing, not a directory
or not writable, and a write the workspace refuses (a full disk), stop a dry
run and a run alike with a ✗ line naming the directory and exit 1.
Output: <out>/reach.json and <out>/traces/ (raw stdout and events.jsonl
per scenario).
-
One record is written per (file, scenario):
{"file": "sub/AGENTS.md", "scenario": "cwd=.", "harness": "claude-code", "harness_version": "2.1.286", "model": "claude-haiku-4-5", "head": false, "tail": false, "read_by_tool": false, "class": "not_loaded"} -
fileis the link target. Links to it are listed once, asaliasesof its entry infiles; they share its tokens and its records. classis one of:loaded: both tokens reported;truncated: one token reported;fetched: reported only after the agent read the file with a tool (a read that was denied or failed is none; a..after a link in the read path is followed as inguidance_read, by the links of the probe workspace, aCLAUDE.mdlink among them). For the Claude Code (its Bash tool), Codex and Copilot profiles a shell read counts only as a barecat,head,tail,nlorsed -n, after thetimekeyword too (time -p cat AGENTS.md,time -- cat AGENTS.md; the keyword takes one-p, then--, sotime -x cat AGENTS.mdruns-xand is none), or /usr/bin/time with no option (X=1 time cat AGENTS.md,\time cat AGENTS.md: it passes the command's stdout through), orcommand(command cat AGENTS.md; not pastenv, which runs a program:env command cat AGENTS.mdruns nocat, andenv command cd submoves nothing); a call of a shell function the agent defined with a printer's name (cat() { echo hi; }; cat AGENTS.md,\cattoo, or a body in parentheses:cat() ( echo hi ),function cat ( echo hi ); bash runs the function) is no read, unlikecommand cat,env cator/bin/cat, and so is a printer after a function namedcommand,env,builtinortime(not the keyword:command() { echo hi; }; command cat AGENTS.md); a command that is one such read naming one file, alone, in a brace group ({ cat AGENTS.md; }) or aftercdcommands (cd sub && cat AGENTS.md;time cd,command cd,builtin cd,X=1 cd,"cd"too, notenv cd) or a virtualenv's activate, and exits non-zero is not a read (the exit code ofcat a missingdoes not say which file failed, so both stay reads, as the known one does when the other is at a directory not known). A read through a pipe,greporrg, or negated (! cat AGENTS.md, whose exit says nothing of the file), is not seen, nor, under Claude Code, a relative read after an earlier Bash call of any agent (the parent's or a subagent's, which may share its shell) ran acd,pushd,popd,eval,sourceor., or called a shell function the same call defined whose body names one of these, or that has the name of one (cd() { ...; }), in its own shell (not in a subshell, pipeline or background job, and not refused), so such a file can be classedloaded.sourceor.of a virtualenv's activate script alone (source .venv/bin/activate,. "/opt/venv/bin/activate": one operand ending inbin/activate, no more arguments, a redirection such as> /dev/nullaside) is assumed to move no shell: the scripts venv, virtualenv and uv write set variables andPATHand run nocd. Any othersource(source env.sh, a computedsource $V/bin/activate,bin/activate.fish) may;not_loaded;error: the scenario produced no usable answer: no answer, a non-zero exit, or an error result.
- Each scenario also records:
unknown: tokens the model reported that were never seeded;prose: words besides tokens. A lead-in line of at most 12 words ending in:before the tokens (the first non-empty line, when a later line holds a token) is not counted. A high count usually means an explanation or a refusal, so read that trace before trusting itsnot_loadedcells.shadow, on a shadow scenario only: the shadow file'spath, its twotokens, andhead,tail,read_by_toolandclassas in a record. It is not a tree file, so it has nofilesentry, no records and no matrix row; the matrix prints one line per shadow scenario with its class.
- Overlays (
overlaysinguidance_reach.v1, the design note of §3): everyAGENTS.<name>.mdis probed, even where the globs miss it, so a foreign overlay is tested rather than assumed absent. The expectation is that foreign overlays arenot_loaded.cross_loadedlists each foreign overlay some scenario reported asloaded,truncatedorfetched; the text report prints it as afinding:line.own_loadedlists the harness's own overlays that loaded in some scenario; when none did, the text report says so, but only if some own-overlay scenario read asnot_loadedand every own-overlay scenario gave a usable answer (none errored, none was a refusal); otherwise it says loading could not be determined.ownis the profile'soverlay.ambiguouslists the names of a load that could have been read under another name: a file with aliases when any harness-native guidance file is present in the probe (it could import the target), or when the alias group holds two overlay names. Those loads are neither own nor cross loads. The rule does not depend on the profile'sguidance.imports: codex and copilot (imports: null) have it too, so with theirAGENTS.mdin the probe every overlay link is ambiguous and never afinding:. The text report prints no own-overlay note for them, and a foreign target with an own alias is listed there too, not reported as a cross load. - If payload capture is available, a
payloadfield records whether each token was in the request bytes. This settles cells where the model under-reports, which is how a small model produces falsetruncatedcells.
7.1 Effective-instructions receipt (effective_instructions.v1)¶
repo reach --format receipt prints, and writes to effective_instructions.json
in --out-dir, a receipt in the shape of effective-instructions/v0
(agentsmd/agents.md#213). It is built from the reach payload and from the
start-up chain of repo budget (repos/budget.py). It makes no
LLM call. repo reach --from <reach.json> --format receipt builds the same
receipt from a saved probe without running the harness. The source is read
again: the file must be for the same repository, harness and commit (a
different one is a usage error, exit 2). With --from, a receipt also needs a
pinned source (<path>@<rev>) and a saved probe made at a commit: a working
tree, or a probe of one (repo.sha null), is a usage error (exit 2), because
sha256 and the expectations are computed from the source as it is at
conversion time and a working tree can change after the probe. A live
repo reach --format receipt run is not held to this: it builds the receipt
from the source it probes, but it reads sha256 and the expectations after
the harness exits. An edit to a guidance file made while the run is in flight
therefore appears in the receipt next to the observations of the old text;
the receipt's unknowns says so for a working tree, and a pinned source
(<path>@<rev>) has no such window. The matrix (without --format receipt)
still accepts an unpinned source. expected comes from the harness profile as
it is at conversion time, so a receipt with --from also needs the profile's
guidance to be the one the probe saved (harness.declared), its free-text
notes aside: a different one is a usage error (exit 2). A probe saved without harness.declared is not
compared, and its receipt is the same only for an unchanged profile. The receipt is written
beside the saved file; a name that resolves to the saved probe is a usage error
(exit 2), and a write that fails is a runtime failure (exit 1). The probe-only flags (--model,
--max-usd-per-cell, --scenarios, --only and the rest) cannot be combined with
--from. The schema is schemas/effective_instructions.v1.json; the code is
repos/receipt.py.
One artifact is written to effective_instructions.json, with one entry in its
receipts array per reach scenario and run_id <salt>:<scenario id>.
The shadow scenarios (§7) get no entry: they run with a file the tree does not
hold, and the receipt describes the tree as committed. Their results stay in
reach.json and the matrix. Each source carries:
| Receipt field | From | Meaning |
|---|---|---|
path, alias_of |
reach files, aliases |
a link is adapter scope and takes its target's tokens |
sha256 |
the text dokimi reads (LF-normalised UTF-8) | null when the file is not readable as text |
scope |
path | repo for a root-level file and for .claude/CLAUDE.md and .claude/AGENTS.md only; subtree for a nested AGENTS.md, CLAUDE.md or CLAUDE.local.md (.claude/CLAUDE.local.md included); else unknown (a skill, for one) |
expected |
budget when |
see the table below |
observed |
reach class | loaded → loaded, fetched → fetched, not_loaded → not_loaded, truncated and error → unknown |
observation_method |
unknown for every source: the thread vocabulary's method, since no runtime event, prompt capture or hook backs the probe |
|
dokimi_method |
marker_self_report for a source the probe recorded; null for a start-up file budget found and reach did not probe |
|
states.accessed |
the harness's read events | true if the trace has a read event of the file, neither denied nor failed (a read tool, or a shell read §7 lists, under all three harnesses); for a probed source false with tools off, else unknown; always unknown for a start-up file budget found and reach did not probe |
states.selected |
the class | true for loaded or fetched (the source entered the request, by the harness or a read), else unknown |
states.loaded |
the class | true for loaded, false for not_loaded, unknown for fetched, truncated and error: a tool read is not proof that start-up loading did not happen |
states.followed |
always unknown (the schema's const) |
runtime is the harness's name and version, as reach records them. model is
the string passed with --model, not the harness's name or a resolved model
version. observation.method is unknown and observation.dokimi_method is
marker_self_report: the model reports the tokens it can see, and the request
sent to the provider is not captured. A reported token is evidence of loading,
not a copy of the bytes received. The name is not prompt_capture, because
dokimi does not capture the prompt.
Expected state. budget's start-up rules are Claude Code's. They apply when
the probe's harness profile sets guidance.claude_displaces_agents: true, the
key repo budget reads, whatever the harness is named; the receipt reads it
from the guidance the probe saved (harness.declared in reach.json). A probe
saved without harness.declared goes by the harness name: only a
claude-code run gets the rules. Otherwise every expected is unknown and
the receipt's unknowns says so.
budget when |
expected |
Reason |
|---|---|---|
start |
true |
loaded at start-up in every run |
off |
false |
a root CLAUDE*.md, or one in the AGENTS.md file's own directory, turns AGENTS.md off |
lazy, run directory is the file's directory or inside it |
true |
loaded when the work reaches that directory |
lazy, run directory outside it |
false |
not reached by this run |
lazy on a link, an import, a root file, or a file another guidance file @-imports |
unknown |
budget's flattened when does not say which directory activates the file, so only a nested AGENTS/CLAUDE file that budget lists under its own path, and that no guidance file imports, gets a verdict |
on demand or absent |
unknown |
budget does not say |
Precedence. precedence_observed lists a displacement only: a root
CLAUDE*.md (CLAUDE.md, CLAUDE.local.md, .claude/CLAUDE.md) observed
loaded in a run, with an off AGENTS.md observed not_loaded in that run. It
does not give an order of entry. The displacement follows budget's rule as
written (repos/budget.py): an AGENTS.md is off while a root CLAUDE*.md
exists, nested ones included, unless a root CLAUDE* file aliases it or
@-imports it (start), or a nested CLAUDE* file @-imports it (lazy). So
nested AGENTS.md files can appear, and an AGENTS.md at the root is not always
off. Without a root CLAUDE*.md, a nested AGENTS.md that resolves is off when its own
directory holds a CLAUDE*.md that does not alias or @-import it; no root
file wins there, so precedence_observed lists none of those. If budget's
rule changes, the receipt follows it.
What the marker method can and cannot show. It shows which tokens were
reported in a run, so it can support loaded, fetched and not_loaded as
observations of that run. It cannot show:
- that an instruction was followed (
followedis alwaysunknown); - a shell read that the converter does not turn into a read event: under
Claude Code, Codex and Copilot alike, only the shell commands §7 lists are
read events, so
rg,grepor a pipe stays unseen (the guidance files a search showed lines of areguidance_searched, §4.1, not a read event); - which directory a Claude Code subagent's Bash shell is in: the converter
assumes it shares the parent's, so a
cdin either drops the later relative reads of both (this only drops reads; no real trace was checked); - where a
cdinside a shell function the agent defined and then called went: a call of a function whose body names a directory builtin anywhere (sourceand.only as a command's word, and not of an activate script:find .andsource .venv/bin/activatename none), or calls another such function, defined in the same Bash call (a Claude Code call starts in a new shell, which keeps none of an earlier call's functions), is taken as moving the shell to a directory not known, as aneval,sourceor.is, so the later relative reads are dropped, and so is a call of a function named like a directory builtin (cd() { ...; }; cd sub;command cd subandbuiltin cd subrun the builtin, and are followed). A definition's body is skipped, as defining a function runs nothing, also with its{on a later line (f(), a newline or a comment line,{). A body in parentheses (f() ( cd sub ),function f ( cd sub )) runs in a subshell, so a call of it moves nothing. A call of any function the agent defined is no read (cat() { echo hi; }; cat AGENTS.md), and a function named like a wrapper runs in its place (command() { ...; }; command cat AGENTS.mdreads nothing). A body whose closing}is not seen (f() { cd sub; }>log) is taken to run to the end of the script. A name defined again keeps what each definition named, and a definition in a subshell, one that never ran or one later in the script counts too: all of these only drop reads. A command the parser does not fully follow counts as moving the shell when its command word, afterbuiltin,commandortimeand their options (and, aftertime, assignments:time X=1 cd subruns thecdhere), names a directory builtin (X="a b" cd "$D",time -p cd sub; nottime git add .), and so does one in acasearm (acaseopens only as a command word:echo caseand the patterna|case)open none).timeis that keyword only as the first word, unquoted (X=1 time cd suband\time cd subrun /usr/bin/time). Where only the directory is at stake, any dash word aftertimecounts as its option:time -x cd subloses the directory, though bash runs-x; - that a virtualenv's activate script runs no
cd:sourceor.of one alone (source .venv/bin/activate) is assumed to leave the shell where it was, as the scripts venv, virtualenv and uv write do; one that moved it would leave the later relative reads at the wrong directory; - when a source entered the request, or in what order (no timestamps);
- start-up imports, start-up rules and skill listings from budget, which reach does not probe:
they appear with
observed: unknown. A skill body is loaded on demand, so it is not listed; the receipt-level unknown says both; - anything a model under-reports; a prose-heavy answer is flagged.
Each run lists its own unknowns (no usable answer, a source with one token
reported, prose above the limit, unseeded tokens). The receipt-level unknowns
repeat the limits above and carry the notice that start-up imports, start-up rules and
skill listings are not probed.
The same receipt, run over the fixtures in data/reach-conformance/ for several
harnesses and versions, is the reach conformance matrix; see
reach-matrix.md.
8. L0 scan (repo_readiness.v1)¶
repo scan <source> checks every mechanically checkable claim in the guidance
files (guidance.globs plus also_scan) against the same snapshot. It makes
no LLM call and needs no checkout: a blob-less clone fetches the blobs it reads
in one request.
| Check | Claims |
|---|---|
| generic | Markdown links (inline and reference definitions, <angle-bracket> targets; relative, and blob/tree links to source.url), paths and globs in code spans (see below), identifiers (a word in some tracked file that is not prose; a missing ALL_CAPS name is unresolved, since a tool outside the tree may read it), python <script> paths, a command wrapped in backticks inside a shell fence, Python versions on a line that names a workflow, against what its jobs run (see below) |
bazel |
--config values against .bazelrc and its imports, flag aliases, labels against the target and output names (name, outs, and the files of a top-level exports_files([...])) that the package's BUILD.bazel, else BUILD, spells out in either quote style (a package that calls a macro or computes a name, "t_" + s, a comprehension or exports_files(glob(...)), gives unresolved, not fail), macros and keyword arguments in Starlark fences against tracked .bzl files, load() symbols against the public top-level names (a def or an assignment) of the in-tree .bzl an absolute label names, labels of an external repository against its BUILD file when the tree holds one (see below), and @<module>// alone as this repository |
make |
targets against the rules of every makefile (a %: catch-all or a rule named by a variable gives unresolved), VAR=value against the makefiles |
cmake |
-D variables against the CMake sources (CMake built-ins and <Pkg>_DIR/_ROOT pass), --preset against CMake(User)Presets.json, -S <dir> against a CMakeLists.txt in that directory (ok when any ancestor directory of the guidance file holds it; fail only after a literal cd, and there a miss inside a declared submodule is unresolved; without a cd the directory the command runs in is not known, so a miss is unresolved; a glob such as examples/* is not a literal directory and gets no claim; a %VAR%, a drive path such as C:/x, and a -S word holding a backslash get no claim) |
pytest |
path arguments and ::test nodes; with --pyargs, a dotted name that is no path in the tree is a module: pkg.tests is pkg/tests.py or pkg/tests/__init__.py below any directory (a directory with no __init__.py is no module, as in pytest by default). ok means that file is in the tree, not that it imports without an install (a src/ layout needs one); fail when the tree holds a package the name lies in but not the module (pkg.tests.test_a with pkg/__init__.py and no pkg/tests/), and that package is where an import would find it: at the root or in src/, of the tree or of a directory from the guidance file up; unresolved when the tree holds no such package (an installed one), or holds it only deeper (docs/examples/pkg/, a vendored copy), where it may not be the one imported |
pre-commit |
pre-commit run <hook> against hook ids and aliases |
build_systems picks the adapters. Without it they are detected from the
files at the root (any conftest.py or a pytest section also selects
pytest), and the report says so.
Starlark is a Python dialect, so guidance often fences a BUILD snippet as
python. With the bazel adapter on, such a fence is checked as Starlark when
it reads as BUILD code: it loads a label, or a line starts a call to a native
rule only Bazel has (cc_library, http_archive). A call to a macro of a
tracked .bzl file does not count (run( and build( are as often plain
Python), nor does test_suite(. Any other python fence is not checked.
Every string of a checked fence that is a label is looked up, in either quote
style; a string such as //cdn.example.com/x.tar (a host name) is not a label. An
external repository's BUILD file is in the tree when a tracked file is named
for the repository (zlib.BUILD, BUILD.zlib, mkl.tpl.BUILD,
mkl_win.tpl.BUILD, with an optional .bazel) and a .bzl file,
MODULE.bazel or WORKSPACE names that file, as a build_file or a
template, and MODULE.bazel does not take the repository from a registry
with bazel_dep (its repo_name, else its name). A label in the root package of such a repository is ok when one of
those files spells the name out (or lists it in exports_files([...])), or
the target is all, * or all-targets. It is unresolved when one of those
files computes names (a macro, exports_files(glob(...)), or a template's
%{...} substitution), when the target contains a ., or when the name
appears as any string in the file (a source in srcs); otherwise it is
fail. Labels of any other
external repository stay unresolved. A BUILD, .bzl, WORKSPACE or MODULE.bazel file that was not read
(binary, over the size limit, a dangling or escaping link) makes its bazel_label and starlark_load claims
unresolved, with the reason (X was not read (...)). Such a file also adds the warning
build file not scanned: <path>: <why> and makes the scan incomplete. Only these exact names count: BUILD,
BUILD.* (BUILD.bazel, an external BUILD.zlib), WORKSPACE, WORKSPACE.bazel, MODULE.bazel, *.bzl, *.bazelrc, *.BUILD (and an unread
.bazelrc import of any name); a file such as BUILD_status.png does not, and none counts unless bazel is a build system of the scan.
L0 checks only what holds for any repository. The rules of oneDAL's own
checker that are repository policy were not ported, and oneDAL dropped them
along with that checker: bazel test and bazel run without --config, the
refusal of //... and of bare cc_library/cc_test, a Starlark call to
anything not defined in its three .bzl files, PLAT=/COMPILER= values
from its dev/make tree, and a label or make target that the build files do
not spell out literally (L0 reports that one unresolved, because a macro or a
computed rule name may make it). A repository that wants rules like these adds
them through its own static entry point (§4.4), merged as described below.
--static <file> merges the output of the repository's static entry point
(§4.4). A repository claim replaces the framework claim on the same file, line
and claim text, because the repository knows its own rules; by_source keeps
both sides' counts before the merge. Running the entry point itself belongs to
the task runner (S5), which runs entry points in the image.
Shell lines are split at &&, |, ; and the like, and redirections are
dropped, so each simple command is checked on its own. A command continued
with a trailing backslash is one line, reported at its first line; a comment
line ends a continuation, and the body of a heredoc is not a command. A word
that holds an expansion ($VAR, ${VAR}, $(cmd), a backtick substitution)
is never looked up: not as a make target, a -D variable, a preset, a
--config value, a hook id, a path or a label. The literal key of
VAR=$(cmd) is still checked. A <placeholder> inside a word
(//pkg/<algo>:tests, make <target>) is one too, not a pair of
redirections.
A literal cd dir moves the relative paths of the later commands in the same
fence or span, and a subshell ends at its closing parenthesis. After a cd to a
directory the tree lacks or to a non-literal one, after pushd/popd, and
after a cd that follows || or |, relative paths are unresolved.
A path in a code span is tried at the file's directory and each of its
ancestors. If none has it, the path is fail when its parent directory exists
at one of those bases (a rename or a deleted file), ok_suffix when it ends a
longer path in the tree (a root file naming paths inside a subproject), and
unresolved otherwise (a build output, a path inside a submodule). A code span equal to the owner/name of a GitHub source.url (letter case ignored) is ok, as this repository, unless the tree holds a path of that name; an operand of a command is always a path. A missing
path that a tracked .gitignore ignores is unresolved rather than fail,
with the .gitignore line in the reason (also for a path that was unresolved
already): guidance that warns about generated files names paths no snapshot
holds. A directory counts as ignored when git ignores it, or, when no ! line
names the directory itself (!*/ names every directory, so it does not count),
would ignore every file probed directly inside it: a plain name and each name a
! line re-includes. So include/* ignores include/, and so does out/* with
!*/, while a whitelist of *, !*/, !*.py does not ignore a missing
olddir/, nor !/setup.py a missing setup.py. A path without a trailing slash counts when it
would be as a file or as a directory: under that whitelist * ignores a missing
olddir read as a file, so a directory needs its trailing slash to be checked
as a rename. A glob counts when one of the files it is
probed with would be: its wildcards filled in, and each name an ignoring line
matches that the glob matches too (gen.h for pkg/g*.h), when a literal
starts or ends the glob's last segment: maintenance/* or pkg/*_* would match
the name of any rule (_skbuild), which says nothing about the glob. The probe
tries a few names, not every name the glob matches. .git/info/exclude and
core.excludesFile belong to a clone, not the tree,
and are not read. ok_suffix
and ok_basename resolve a path but cannot see it renamed, which then reads as
unresolved; guidance the gate must protect names its paths from the repository
root. A bare name
that names some file or directory is ok_basename. A glob is tried the same
way: ok when something matches at the file's directory or an ancestor, fail
when its literal parent directory exists there and nothing in it matches
(src/*.zzz), ok_suffix when it ends a longer path in the tree,
ok_basename when it has no / and matches the name of some file or
directory (type_dispatch*.hpp), and unresolved otherwise (build/*.o, out/<run>/grade.json). A <placeholder>
or a wildcard in the directory part is never fail. A * may span
directories and **/ matches zero or more. A trailing slash on a file
(src/mod.py/) is fail, and a glob ending in / (src/m*/) matches only a directory. A GitHub Action reference (actions/checkout@v6) is not a
path claim. An Action named without its ref (actions/checkout, owner/repo/path)
that the tree does not hold at the file's directory or an ancestor is ok when a
job or step uses it as uses: <name>@<ref> (or, for a local reference, uses: ./<name>
with no ref, which a claim ./<name> finds, as does <name>, while a ./<name> claim finds no remote use: ./source/.github/actions/setup
used by a step is ok, a typo of it stays unresolved), in a .yml or .yaml workflow
directly in .github/workflows/ (not a nested one, which GitHub does not run) or
a local composite action under .github/ (action.yml, action.yaml); the
reason names the first such file, workflows first (used by
.github/workflows/ci.yml). Only a workflow's jobs count (a job's own uses: and
its steps'), and only an action's runs.steps when its runs.using is
composite; a file that is both, .github/workflows/action.yml, is a workflow. A name into a submodule stays unresolved (below)
even when a step uses it, as the snapshot does not hold what is there; after that
check, and before the parent-directory fail, the used Action is ok, so a
.github/actions/ beside it does not fail it. A name whose directory the tree
holds at the repository root (tools/gone beside tools/, or beside a root
link tools to a directory, or tools/sub/gone where tools/sub is a directory
through such a link) is judged as a path even when a step uses it, so a
stale path still fails, below such a link as below a real directory (tools/ exists but tools/gone does not); a directory found only
beside the guidance file does not count. A name only in a run: script
does not count, and an Action no step uses is judged as any other path. When
one of those workflows or local actions was not read (too big, binary, a dangling
link), an owner/name the tree does not hold, outside a root directory (or a link to one), that no
read file uses keeps its unresolved (tried ...) or fail (<dir>/ exists but
...) verdict, and its reason also names each such file, as <file> was not read
(<why>), joined with ;. A path or glob the rules above leave unresolved,
whose first directory is not one at the repository root (nor a link to a
directory there), is ok when the
repository configures it as a branch (a fail, ok_suffix or other verdict
stays): a --branch name or a --pattern regex, in each form the hook's
argparse reads (-b X, -bX, -b=X, --branch=X, a prefix such as --bra X;
the same of -p), in the args of a no-commit-to-branch hook of the
root .pre-commit-config.yaml, or a branches or branches-ignore filter of
on.push, on.pull_request, on.pull_request_target, on.merge_group or
on.workflow_run in the same workflows. The claim matches when it
equals the name or pattern, or when the pattern starts (after a leading ^ or
!) with the claim's first directory and a slash, and matches the claim with each
wildcard filled in: a hook pattern as the hook reads it (re.match, so
maintenance/* matches maintenance/.*), a filter as GitHub does (* stops at
/, ** does not, ? and + make the character or [...] before them
optional or repeated, stacked ones fold into one (a++ is a+, a?+ is a*,
and after * or ** they add nothing), [...] is one of its letters, digits or ranges such as
0-9, \ escapes the next character; a leading ! is dropped), so
release/* matches release/**, release/v1 matches release/v[12], and
** alone names no path. A filter that excludes branches, a branches-ignore
entry or one with a leading !, names them as one that includes them does: the
workflow skips release/x under branches: ['**', '!release/**'], but release/x
is still a branch, so it is ok, and release/1.x equals the entry !release/1.x
as it does release/1.x. A range that runs backwards or mixes lowercase,
uppercase and digits (9-0, a-Z) makes its [...] literal text. A
--branch name matches only when equal, and so does any source for a claim whose
last segment ends in an extension some file of the tree has (release/CHANGELOG.md
in a tree with a .md file), which reads as a file. The reason names the first match, hooks before workflows, with the line of
its value: branch pattern of no-commit-to-branch (.pre-commit-config.yaml:17),
branch of no-commit-to-branch (.pre-commit-config.yaml:19) or branch filter of
on.push (.github/workflows/ci.yml:3). A file that is missing, not read or does not parse, an
args that is not a list, a value that is not a string, an invalid regex, a hook pattern that can backtrack exponentially, another hook's args and a name only in a run: script give no branch, and the
claim keeps its path verdict. Such a pattern is refused before any claim is
matched against it, read from the parse re makes of it: a repeat that can run
more than once (*, +, {m,n} with n over 1) around, at any depth and
lookarounds included, a varying item (a repeat with m under n, ? too) that
can end at the same place two ways, or an alternation two of whose branches can
start with the same character, in either case (İ and i are one character to
a case-insensitive re), or can match nothing, lazy and possessive repeats
alike: (a+)+b, (a*)*, (a{1,5})+, (a?a?)+, (a|aa)+. A varying item ends
two ways when the first character of its body, or the characters that can
follow it (the rest of the repeat's body, then the start of the next pass), are
not known or share a character: ([0-9]+\.)+[0-9]+ and (ab?)+ pass, each pass
ending at a character the item does not take. A branch or an item is read by its
first character, a [...] of characters and ranges of at most 256, or a group
or repeat that starts with one; one that starts with anything else (., a class
such as \w or [^a], an anchor, a group holding an alternation, something
that can match nothing as in a?b) overlaps any other. So (ab|Ab)+, which
matches fast, is refused too, as is a varying item followed by more than 64
items in a row that can match nothing, so the check stays linear in the
pattern. Other slow shapes pass and can still take long on
a long claim, such as maintenance/.*a.*a.*a.*b. When .pre-commit-config.yaml or one of those
workflows was not read, the reason of a claim that stays unresolved here also
names it, as <file> was not read (<why>) after the rest, in tree order and once
even when the Action note above names it too. A link or path into a submodule is unresolved, and so is a bare name that matches only a submodule (mod/ for third_party/mod). A pinned snapshot's submodules are its .gitmodules paths and every gitlink it holds, declared or not. A
blob or tree link to source.url holds <ref>/<path> and the ref may contain
slashes. A default branch, a commit or a version tag is one segment; any other
ref is tried at each slash, shortest first, and the link is ok if some
remainder is in the tree. Failing that, a blob link is fail, and so is a tree
link on a one-segment ref; a tree link on any other ref is unresolved (it may
name a branch). refs/heads/ and refs/tags/ belong to the ref, and a link to
a ref alone is not checked. A
link to a directory inside the tree is followed, as in a checkout, so
linkdir/core.py with linkdir -> src/pkg is ok. The linkdir/ it makes
is judged as that directory, also through a link higher up: linkdir/gone is
fail (linkdir/ exists but linkdir/gone does not), a glob is matched in
src/pkg and named below the link (linkdir/*.py -> linkdir/core.py) or
fails when nothing there matches, and linkdir/core.py/ is a file, fail. A
link that dangles or names a file makes no directory.
A line that names a workflow of the tree (a code span or a link ending in
.yml or .yaml under .github/workflows/, a blob or tree link to
source.url too; a bare file name that several workflows end in is the one in
.github/workflows/ itself, else none of them) is also checked for the Python
versions it gives. A run of versions that py, Python or cp starts is a
python_versions claim when it is a range written with a dash (py3.12-3.14t,
Python 3.12–3.14) or a list of two or more (Python 3.12, 3.13 and 3.14); a
single version gets no claim, to is no range ("moved from Python 3.11 to
3.13"), and a cp tag starts no range (cp313-cp313 is the two tags of a
wheel's name). A version with no marker in front needs its dot (30 in
"Python 3.12, 3.13, 30 min timeout" is no version), and the workflow's own
name, in a code span or a link text, is no version. What the workflow runs is
the values of every matrix key whose name holds python (3.12, cp312 or
py312), the keys of include entries too, less a value that exclude takes
out of every combination of the matrix, and the python-version its steps set
up (actions/setup-python, or another action's input of that name;
${{ matrix.<key> }} there makes <key> a Python key), over its jobs and the
workflows of this tree its jobs call with uses: ./…. In a called workflow, a
step's ${{ inputs.<name> }} is what the calling job passes as <name> in its
with:: a version it pins, or its own ${{ matrix.<key> }}, which makes <key>
a Python key of the caller's matrix. A pre-release (3.14.0-rc.1, 3.14.0a1,
3.14-dev) runs its minor version, and a 3.14t value or a cp314t tag in
any matrix string is a free-threaded build, less a value that exclude takes
out. A range is ok when its ends are the lowest and highest version the
workflow runs (both ends written with t: of the free-threaded builds), a list
when each version runs, and a version written with t must run free-threaded;
anything else is fail. A range that holds for the matrices and not with the
versions setup steps pin, or with them and not for the matrices alone (a lint
or docs job on another Python), is unresolved, since the range may count that
job or leave it out on purpose; with no matrix version, the pins are what the
workflow runs. A matrix, an include, an exclude or a step version computed
from an expression (${{ fromJSON(…) }}), an exclude over more than 256
combinations or too large to read, a Python value that names no one version (3.x, >=3.12), a
python-version-file with no python-version, an input a called workflow
sets up Python from that its caller does not pass, a call to another
repository's workflow or to one the tree lacks, a workflow that is not valid
YAML, and a workflow with no Python version make the claim unresolved. Python that a job installs any other
way (a run: step, a container image) is not read.
Not checked by L0 (a follow-up): the #fragment of a link (docs/x.md#setup
is checked as docs/x.md; a bare #anchor is skipped), and HTML in Markdown
(<a href>, <img src>).
Guidance files are read with symlinks followed, the same way from a working tree and from a commit. A guidance file that links to another guidance file is scanned once, as the file it names.
The report lists warnings for guidance the manifest names but the tree lacks:
a glob with no match, a missing also_scan file, no guidance at all, and a
guidance file that cannot be read (a link that dangles or leaves the tree, a
binary file, a file over 2 MB), named with the reason. A --static
file that cannot be read or is not JSON exits 2; a document that fails the
repo_static.v1 schema is not merged, and the command exits 1. --fail-on fail also exits 1
when any claim fails, an also_scan file is missing, a guidance file cannot be
read or listed (a directory above it cannot be searched), a Bazel build input (BUILD, .bzl, .bazelrc, ...)
cannot be read, or no guidance file matched
(incomplete). A glob that matches nothing
does not fail the gate, so a file the gate must see belongs in also_scan.
incomplete_reasons lists the warnings that make the scan incomplete, as
they appear in warnings and in its order ([] for a complete scan). The text
output prints them after the warnings, on one incomplete: ... line, and when
--fail-on fail exits 1 on an incomplete scan it prints them on stderr as
✗ scan incomplete: ....
Statuses are those of §4.4. Only fail counts against the guidance;
unresolved needs a human look.
Dead links name the missing target. A literal YAML, TOML, CFG or INI configuration
path with a directory component also fails when the snapshot lacks its parent,
unless it has two or more directories and the first is absent too (a sibling
repository's file or a placeholder stays unresolved).
For one release, --fail-on-fail accepts the same gate and warns on stderr.
A gate any repository can adopt (#851). Three things keep --fail-on fail from failing on noise
the repository cannot fix:
- A bare identifier (
`mkl_random`,`PyArray_Resize`) the tracked non-doc files lack isunresolved_identifier, notfail: it may be an external API, a sibling package or a builtin. A name that is the stem of a tracked file (`bench_fftnd`forbench_fftnd.py) isok_stem. Paths, links, scripts and labels still fail when the tree lacks them. .dokimi/scan.tomlin the tree is the repository's own setting.identifiers = "fail"restores failing on a missing identifier. Each[[ignore]]entry (pattern, an fnmatch on the claim text; optionalkind; a requiredreason) turns a matching claim that is notokintounresolved_ignored. That claim stays in theunresolvedclass;counts,by_file,by_kind,by_sourceandsummary.claimsof the--jsondocument addignored, how many of theunresolvedclaims areunresolved_ignored(absent when none is), the console line readsunresolved 2 (1 ignored)andreport summaryshowsclaims.ignored 1, sounresolvedminusignoredis what is still open. The report'sscan_configblock lists each entry with its hit count, and a file with any error (bad TOML, an unknown key, also inside an[[ignore]], an[[ignore]]without areason, a non-listignore) is a warning that discards every setting in it and keeps the defaults, and makes the scanincomplete, so--fail-on failexits 1 until the file is fixed. An ignore applies to the claims of--statictoo, after they are merged; the identifier setting applies to the scan's own claims.--baseline FILEreads an earlier report (--out, or the--jsondocument). Afailclaim that report also fails, matched by file, kind and text and not by line, isbaselined(once per claim the baseline holds), and the gate counts only the rest. A key the baseline fails n times covers n claims; a repeat beyond that is new. Thebaselineblock givesknown,newandfixed. A repository commits one report as its baseline, so adoption needs no cleanup first and a PR fails only on drift it adds. Not implemented yet: the pre-commit↔CI file-set parity check.
Measured on oneDAL and scikit-learn-intelex, claim by claim against their own checkers: see the pull request that added the scan (#68).
8.1 Inspection (repo_environment.v1)¶
repo inspect <source> reads the tree and, with --index, a code index of
it, nothing else: no manifest, no LLM
call, no command of the repository run. Where L0 asks whether what the
guidance says is true, inspection asks what the guidance may have left out:
which instruction files exist and where they apply, how a change can be built
and checked, and what a session or a command it runs could do beyond editing
files. Its findings are hypotheses for repo reach and repo run to test,
not measured effects.
The report keeps observations apart from findings:
instructions: one record per instruction file and per harness rule it matches (a rootAGENTS.md, a nestedCLAUDE.md,.cursor/rules/*.mdcat the root or in a subdirectory,.github/instructions/*.instructions.md, …), with itsscope(root,path-specific,mode-specific,local-private,legacy,capability,unknown),activation, thedirectoryit applies to (for a record whose scope isunknown, the one it would apply to) and its size (for a link, the size of the file it names). A link that loops, dangles, escapes the tree or names a directory is left out, with aninstructions.unusablewarning. This is what each harness documents; which files a given harness version loads is measured by the reach probe (§7).checks: ways to build, test, lint and type-check, per project root (the root and every directory below it with apackage.json, makefile,pyproject.toml,setup.py,setup.cfg,Pipfile,go.modorCargo.toml; Bazel, CMake, Gradle, Maven, .NET and Autotools are read tree-wide).basis: declaredmeans the repository names it: a script, a make target, a config section, a pre-commit hook.basis: toolchainmeans the tool offers the command whether or not there is anything for it to run (go testbeside ago.mod): a place to start, not evidence of tests.capabilities: what the harness gets from the repository: MCP configs, Claude Code hooks of any type (command,http,prompt,agent) and plugins, settings commands (statusLine,apiKeyHelper),enableAllProjectMcpServers, skills, editor settings, each with a risk tier (documentation under.claude/hooks/is low; a.claude-plugin/manifest is medium, and high when it declareshooksormcpServersor cannot be read).scripts: rootpackage.jsonscripts that are install hooks, delete the root, home, a glob or the whole tree (rm -rf distis not flagged;git clean -nis a dry run), pipe a download into a shell, or publish and deploy.hook_risks: the concrete path, a hook the harness fires on its own (SessionStart,SessionEnd,PreCompact,Notification,UserPromptSubmit,Stop,SubagentStop) that installs packages with lifecycle scripts on, runs apackage.jsonscript (npm run,npm test,yarn build, …),make, or executes a path in the tree (also behindVAR=value,sudo -u x,nice -n 10,timeout -s KILL 30,env -u X,/usr/bin/env,source,sh -c,eval,$(…)in double quotes, orecho '…' | sh), so starting a session or running tools executes code from the checked-out branch. Hook commands are read word by word, with quotes (also across lines) and comments honoured, so a command named insideecho '…'or after#does not count. A heredoc or here-string body counts only when a shell reads it (bash <<EOF,cat <<EOF | sh,bash <<< '…'), not underbash -cor a non-shell command.npm update,dedupeand the like count as installs.--ignore-scripts(the last such flag wins),npm_config_ignore_scripts=true, a root.npmrcwithignore-scripts=true(npm, pnpm) and a global install (-g,yarn global) clear the install risk. A.claude/settings.jsonor.claude/settings.local.jsonthat cannot be parsed is listed undernot_observed, since its hooks were not read.files: counts and bytes, generated files (lockfiles,vendor/,third_party/, test fixtures,*_pb2.py, …), minified bundles, test files, and files over--large-bytes(default 100 000, about 30k tokens: large for an agent to read, far below what a disk-size lint flags). From a blob-less clone sizes are not read, since listing them would fetch every blob; the report says so undernot_observed.
Each finding has a rule, a severity (error, warning, info) and,
separately, a confidence, the stages it affects (orient, bootstrap,
navigate, edit, verify, deploy), a path (null for
the whole repository) and why. Only stages that some warning or error can
reach are reported; how a change is reviewed and merged is not visible in the
tree and is listed under not_observed. A stage is blocked by an error,
attention on a warning, and at best no_known_blocker, never ready:
not_observed lists what the tree cannot show, such as whether the commands
pass, CI secrets and the agent's network. risk is the worst of the launch
observations. There is no overall score. --fail-on fail exits 1 when any
finding is an error, and --fail-on warn when any is an error or a warning.
With --index FILE, a SCIP index of the tree (§1.2), the report adds a
structure section. The index's root prefix is found by matching its document
paths to the tree's files; documents that are not files of the tree are
counted and left out; an index none of whose documents is a file of the tree
exits 2. tree_files_not_in_index counts the tree's non-test files under the
root prefix, of an extension the indexed files have, that the index lacks (an
index cut at a document boundary still reads); not_observed names the count. A module is a directory; one holding more indexed non-test files
than max(30, n // 20), n the indexed non-test files of the tree and // integer division, is split
into its subdirectories,
the files right in it staying its own. Test files are neither modules nor
callers. Per module:
reference_fanin: the files outside the module that reference a function or method defined in it. The index records references, not calls: a reference to a function or method counts, a use of a type does not, and a declaration counts only when the indexer records it as a reference, not as a definition. This is not a caller count.other_tree_modules: the modules of another tree (the first two path components,cpp/daalagainstcpp/oneapi; a module shallower than that is of the tree of the modules under it, except the root., which is a tree of its own, so every module it shares a reference with counts as another tree's) it shares a reference with, either way.ambiguity: the share of its function and method names that a different function of the same name is defined in another module. A function declared in one module and defined in another is one symbol and does not count. Dunder names (__init__,__repr__, …) and C++ operator overloads (operator==,operator=, …) are neither counted nor ambiguous. It isnullwhen the module has no function names: no names is not a share of zero.in_guidance: whether an instruction file names the module's path as a token (no word, hyphen or extension continues it; a leading./may precede it), or its name between backticks. A module with an instruction file of its own is in guidance too, since no path names it: the root.with a root instruction file,src/corewith a path-specificsrc/core/AGENTS.md. A local-private file does not count.
A module is kept with at least 3 files and a fan-in of 3. Of the ten kept
modules with most fan-in, one with an ambiguity of 0.5 or more gets a
structure.name_ambiguity finding, one sharing references with 5 or more
modules of another tree gets structure.cross_tree_bridge; rules records
these numbers; both are info with low confidence: on
oneDAL they tracked agent cost or error over 39 modules only, which cannot
separate structure from question design.
Whether the index is current is not checked: not_observed says so.
8.2 Python fences (repo scan --typecheck)¶
--typecheck type-checks every fence tagged
python, py or python3 in the guidance files, with --typecheck-tool mypy|basedpyright
(default mypy). Each fence that parses is one
python_fence claim, so the report and --fail-on fail treat it like any other
claim:
ok: the tool reports no error in the fence.fail: a stale-API candidate. The claim's line is the error's line in the guidance file, and itswhynames the first error (mypy: line N: message).unresolved: the fence is not valid Python (a placeholder such asf(<arg>)), is too deeply nested for the parser, or no--python-envwas given, so nothing was checked. It is also unresolved when its only errors are missing context (any undefined name, as from an earlier fence or an omitted import, so a removed builtin such asunicodeis unresolved too;await/return/yield/yield from,break/continueoutside a loop,async with/async foroutside a function,nonlocalat module level, a relative import above the fence's package), or a module the environment does not have (see below), or when the repository is older than the tool checks (mypy: Python 3.10). The reason says which.
--python-env PYTHON names the repository's interpreter, a virtualenv with its
pinned dependencies installed (and the repository itself, if its fences import
it). The fences are checked against that site-packages with imports followed
silently (--follow-imports=silent), so only errors in the fence count. A
module the environment does not have is unresolved, not fail: the fence's own
import fails, so nothing it says about that module can be checked, and a fence that
imports an uninstalled package is not a stale-API candidate. Two missing modules are fail all the same: a
standard-library one the repository's Python lacks (import imp on 3.13; the names are dokimi's Python's and
those the pinned mypy's typeshed lists), and with mypy a submodule of a package the repository interpreter finds as a regular package (json.nosuch, yaml.nosuch; not a relative import, nor a namespace package such as google). A module the environment has without types
(no py.typed or stubs) is unresolved too: mypy reads it as Any. A real error in the same fence still
fails it. pip install
dokimi does not install mypy: the tested pin is the one in
requirements-test.txt, and a missing mypy exits 2. basedpyright must be on PATH and
is recorded with the version it reports, not pinned by dokimi. The report's
typecheck block names the tool, its version, the interpreter (null: unknown) and the counts
(fences, checked, fail, unknown, syntax); it is null without the
flag. --python-env and --typecheck-tool need --typecheck. The fences are parsed with the
grammar of the repository interpreter's version, and mypy runs with that
--python-version and an explicit empty config, so the subject's and the host's
mypy settings do not apply. basedpyright gets the same version as pythonVersion
in its explicit project file, since --pythonpath alone sets the import paths. The tools run on the host through
dokimi.process; one run covers every fence of the repository. When mypy stops on a blocking error, it runs
again on the fences that error did not name, so one fence cannot leave the others unchecked.
python cli.py repo scan <source> --manifest <path> --typecheck --python-env <repo-venv>/bin/python
A guidance note under test can be scored the same way as any other content:
feed the note as a patch:<file> arm (see §3) and grade the arm's workspace with
the dokimi:typecheck grader above.
9. Running¶
eval check and repo run need docker. Both export eval_dir from the
eval tree to <out>/_eval/content, and build the image from the eval tree
without its tasks directory (tag dokimi/<id>:<sha>) unless
--image names one. Cache directories default to
~/.cache/dokimi/caches/<id>/<name>; --cache-root moves them all and
--cache NAME=DIR points one elsewhere. A --cache-root or --cache NAME=DIR that is a regular file or
below one (checked before a remote source is cloned), or a --cache-root that holds a regular file named after a
cache, is refused before the image build with exit 2, naming the flag and the path; so is one that cannot be resolved (a symbolic link loop), and a
--cache-root that is a regular file is refused also when every cache has its own --cache and when the
manifest declares no cache. Without --cache-root, the default root (caches/<id> next to $DOKIMI_REPO_CACHE
when it is set) is checked the same way for each cache with no --cache, and a --cache naming no cache of the
manifest is refused there too. An existing
read-only directory is accepted. {source_dir} is the source's own git directory, or
--source-dir.
Cloning and fetching a remote source (url@rev, in every repo command) is
non-interactive by design: git runs with GIT_TERMINAL_PROMPT=0, stdin
closed and no terminal, so neither git nor ssh prompts on a terminal for a
password, a token, a key passphrase or a new host key. An askpass program the
environment names (GIT_ASKPASS, SSH_ASKPASS, or core.askPass) still runs:
it is how some CI systems and editors hand git a token, and a graphical one
(VS Code sets GIT_ASKPASS) can still show a dialog. Set up access before
the run: a credential helper holding a token for an https:// URL (for
GitHub, gh auth setup-git), or for an SSH URL a key loaded into
ssh-agent and the host in ~/.ssh/known_hosts. When git would have prompted, the error names the line
git or ssh printed (Host key verification failed.,
Permission denied (publickey), could not read Username ...: terminal
prompts disabled) and the fix; any other git failure shows its last fatal:
line, else its last error: line, else its last line.
# self-check: no LLM; exits 1 if any task is broken or unsupported, or none is ok
# (with --allow-unsupported, a task this host cannot run does not fail it on its own)
python cli.py eval check ~/oneDAL@<sha> --manifest dev/agent_evals/repo-eval.yaml \
--task fix_finiteness_mut --build-network host --cache bazel-repo-cache=/cache/bazel-repo -j 3
# agents: one cell per (task, arm, model, rep) under repo-runs/<batch>/
python cli.py repo run ~/oneDAL@<sha> --manifest dev/agent_evals/repo-eval.yaml \
--task fix_finiteness_mut --arm guidance:none,guidance:raw \
--model us.anthropic.claude-haiku-4-5-20251001-v1:0 --reps 3 --name pilot \
--bin /opt/claude-2.1.286/claude --agent-network host --max-usd-per-cell 1 --max-usd 20
python cli.py repo report repo-runs/pilot
python cli.py repo compare repo-runs/pilot --baseline guidance:none --metric root_cause_fixed
# enumeration tasks with gold from a SCIP index built at <sha> (§4.7): no LLM, no docker
python cli.py eval tasks generate ~/dpnp@<sha> --from graph --index index.scip --out-dir ~/dpnp/.agent-eval/tasks
# review tasks from the threads of merged PRs (§4.6): no LLM, no docker, no GitHub call
python cli.py eval tasks generate ~/dpnp --from replay --threads threads.json --out-dir ~/dpnp/.agent-eval/tasks
# a task starts from its PR's base: guidance:rev:<sha> runs the guidance under review there
# (replace <sha> with that revision; the quotes keep the shell from reading <sha> as a redirect)
python cli.py repo run ~/dpnp --task review_replay_pr3107 --arm 'guidance:none,guidance:rev:<sha>' \
--model claude-sonnet-5-5 --name replay --agent-network host
# decide on the score row (recall, p_holm); metric:recall_addressed is descriptive
python cli.py repo compare repo-runs/replay --baseline guidance:none --metric recall_addressed
# judged recall (§4.5): a sample for a person to label (no LLM), then the judge (paid)
python cli.py repo hits sheet repo-runs/replay --out labels.json
python cli.py repo hits judge repo-runs/replay --judge openai/gpt-5.1 --labels labels.json --max-usd 5
# authoring tasks from merged PRs (§4.8): no LLM, no docker, no GitHub call; the manifest needs entry_points.test
python cli.py eval tasks generate ~/dokimi --from prs --prs prs.json --out-dir ~/dokimi/.agent-eval/tasks
python cli.py eval check ~/dokimi --task authoring_pr405 # base fails, oracle passes, twice each
python cli.py repo compare repo-runs/authoring --baseline guidance:none --metric pass_share
- Each cell holds the §4 inputs plus
agent.stdout(the raw trace) andresult.json, the framework's verdict. A cell withresult.jsonis skipped on a rerun unless--force; a cell without one is reported as missing, not failed, and the next run of the batch fills it.meta.jsonandresult.jsonrecordexecution: the tool mode, the delegation mode (the one whose arguments ran; a skill withcontext: forkcan still start a subagent undernone) and anidhashing the profile's name,invoke, tool arguments,env_set,env_allow,config_dir_env,config_files,prompt_suffix,egress,bridge,trace(unlessclaude-stream-json),answer_format, the SHA-256 of the harness executable (--bin), the SHA-256 of eachbin_companionsfile and harness version. Arepo runwith--candidatesor--probesadds the digest of each parsed mapping. A task manifest’sprobesmapping also contributes to theid. A rerun whoseiddiffers (another--tools, another--candidatesor--probesmapping, changed manifest probes, a--delegationthat changes the tool arguments, profile, harness binary or harness version, or an editedinvoke,env_set,env_allow,config_dir_env,config_files,prompt_suffix,egress,bridge,traceoranswer_format) is refused before any agent starts, and--forceor another--nameruns it.--forcereplaces the cells of the run's plan only: if the batch dir holds finished cells outside that plan whoseiddiffers from this run's (e.g.--reps 2, then--reps 1 --delegation none --force), the run is refused before any agent starts, because the report would pool both executions in one row; use another--name. The same goes for the finished cells of a task this host cannot run, which--forcekeeps; that refusal comes after the host probe, before any agent starts. A result from beforeexecutionwas recorded is refused asunrecorded, not counted as native;--forceor another--nameruns it. Aresult.jsonthat is not UTF-8, not JSON or not a JSON object is that cell's error, naming the file, and the other cells still run; the file is left in place, and removing it or--forceruns the cell again. The same holds for a finished cell of a task this host cannot run, except that--forcekeeps it: once its file is removed, the cell runs on a host that meets the task's requirements. A--forcerun that stops part way (Ctrl-C, a crash, a failed cell), or a harness binary replaced while the batch runs, can leave finished cells of twoids in one arm and model;repo reportrefuses such a batch andrepo comparesuch a compared row, naming bothids, until a--forcerun over every arm and model of the batch (the same--taskand--reps) reruns them. A plan naming one cell twice (a repeated--taskor--model, or two--modelstrings with one directory name,a/banda:b, or names that differ only in case) is refused before any agent starts. Ctrl-C starts no queued cell: it sets the halt first, and a cell a worker takes after that is dropped before it reserves budget or prepares a workspace (a cell a worker took before the main thread ran the handler is not stopped by that). It kills, by name, the agent containers the running cells started; a cell whose agent was killed is not recorded and runs again on the next invocation (what a killed agent spent without reporting a cost is open: #834). A cell past its agent is not killed: its grading container finishes (Ctrl-C waits for it), the cell is recorded, and its agent is not run again on resume. A batch stays on the eval tree it started with: its revision, or for a working tree the digests of itseval_dirand of the image build context. A batch with a task that names adokimi:grader (or a task directory that cannot be read) also stays on the built-in graders' sources. - The agent's container mounts the workspace, the per-run
home,configand scratch directories (eachimage.envvalue under{run_dir}/), the caches, the harness executable (--bin, read-only at/eval/harness, with itsbin_companionsbeside it, §6) and the framework's helper scripts (read-only at/eval/support). Before a batch, the harness must report its version inside the image, and a probe container with the same mounts must see neither/eval/contentnor/eval/source, no entry named like a task, and no guidance file above the workspace. --timeout,--max-turnsand--max-usd-per-cellapply unlesstask.jsonsetstimeout_s,max_turnsorbudget_usd. On a timeout thedocker runCLI gets SIGTERM, which it passes to the container, and 10 s to stop it; then the CLI's process group is killed, the container is killed by name, and the cell is still graded.--max-usdstarts no new cell once the batch has spent that much, earlier invocations included (kept in_eval/spend.json), counting the budget of each cell in flight. When the batch budget is the only reason a cell was not started, the finished cells keep theirresult.jsonand the command exits 3 (inconclusive); with a cell error or a failed probe too it exits 1 (5 for a cell that crashed of the machinery).- Every container runs with
--security-opt no-new-privileges,--cap-drop ALLand a--pids-limit, as the caller's uid and gid. --agent-networkis required while the egress proxy is missing: it gives the agent's container that docker network, so the agent's commands can reach any host, which is what §2 forbids.meta.jsonrecords it and the report warns.- The report gives, per (task, arm, model), passes over finished cells with a
Wilson 95% interval (score-only tasks: the mean of
score.metric), grader failures (counted as failures too), missing cells, and mean cost and turns. When cells carryresult.jsonprocess(§4.1), a line under the row gives the mean of each count over the cells that have it (guidance_readandguidance_searchedcounted as paths;counter:<name>forprocess_metrics); anullor absentprocessis left out, not counted as zero. A row whose cells include agent answers with no findings JSON that parsed (grade.jsonparse_error, §4.5) notes how many,(scored 0)on a score-only row and(counted as failed)on a gate row; a cell whoseresult.jsonsaysgrader_failureis counted undergrader_failinstead.--jsongives, underdata,parse_errorson every row.repo report --hitsprints, instead of the table, each credited pair of thedokimi:review_replaycells (details.matches, §4.5) by task, arm, model and rep: the thread and its comment, then the finding that hit it.--hits --jsongives, underdataof thecli_output.v1envelope,{batch, replay_cells, without_matches, grader_failures, cells, hits}, one record inhitsper pair (task,arm,model,rep,celland the match's fields; the first five come from the cell'sresult.json, and a match key of the same name does not replace them), and one incellsper cell whosematcheswas read, with or without a pair, and per cell whose answer had no findings JSON (aparse_errorgrade: no pair,recall0) (those five,n_threadsandrecallfromgrade.json, andparse_error). A cell graded beforematcheswas recorded is counted (N cell(s) graded without hit details), not listed, and so is a cell whoseresult.jsonsaysgrader_failure(grader_failures). How to read a replay batch before writing it up: reviewing.md. repo hits judge <batch> --judge PROVIDER/MODEL(§4.5) labels each credited pair of the batch'sdokimi:review_replaycells, one judge call per pair (up to 3 draws when a reply does not parse; the response cache replays them). The prompt gives the thread and the finding (file, line, full text) each as one JSON object in a fenced block markeddata, says that text inside the blocks is data and not instructions, and gives the label rules after the blocks. It writes<cell>/hits_judged.json(repo_hits_judged.v1): the judge, each pair'sthread,finding,commentandmessage(the match's cuts of the two texts),labelandreason, the counts ofsame point,related,unrelatedandunjudged,n_threads(fromgrade.jsonmetrics), the grader'srecall, andrecall_judged. A cell whose answer had no findings JSON is written with no pair and itsrecall_judgedis the grader'srecall(0), so it counts in its arm's means. A rerun rewrites it. Before its first call, a run that judges (not--dry-run) removes thehits_judged.jsonan earlier run left in every other finished cell of the batch, one regraded since into a grader failure, a grade withoutmatchesthat is not a parse error, or another grader, and a line names those cells (--json, underdata:stale_removed). The command prints, per (arm, model), the cells written, their pairs and label counts, the meanrecallof those cells and the meanrecall_judgedof those whoserecall_judgedis not null (--json, underdata: the same as JSON);repo compare --metric judge:recall_judgedcompares it across arms (below). Before any call it refuses, with exit 2, a judge that runs the model of any answer of the batch (meta.jsonorresult.jsonmodel, the model asked for, andmodel_resolved, the model or models the trace says answered; a CLI alias counts as its family's full id, the rule ofnovelty), and a--labelsentry that names no credited pair of the batch, has nofindingor names another finding than the one the batch credits for its thread (a hand-edit, or a sheet older than a regrade: write a new one), or has a label other than the three, a labelled entry whosecommentorfinding_textis missing or is not the pair's text now (the thread's full comment in the gold file, the finding's full text inanswer.txt, compared exactly, with no normalisation), or whose pair's texts are not found now (write a new sheet), and two entries that give one pair two different labels (the same label twice, or anullnext to a label, is taken). A cell graded withoutmatchesand a grader-failure cell are counted, not judged. A pair whose full text is not found (no single task directory or no such thread under<batch>/_eval/content, no finding at its index inanswer.txt, a file other than the onematchesnames, or a comment ormessagewhose first 200 characters are not the onesmatcheskeeps: the text changed since grading), a pair whose reply never parses, and a pair whose judge call fails (a provider error past the client's retries:errorisjudge call failed: <type>: <message>) areunjudged, witherrorsaying why, and never count assame point. When 3 judge calls in a row fail with one error (an auth error, a missing key; a response-cache miss before a live call is not a failed call), the run stops there: a✗line gives the error, the judge calls made and their cost, and says the cells written before keep their files; the cell in progress gets none (an earlier one is removed), and the command exits 1. A cell with an unjudged pair is written withrecall_judgednull and left out of the meanrecall_judged; a line counts and names those cells (unjudged cells: N;--json, underdata:unjudged_cells).--dry-runcounts the pairs and prints their cost at list price (one call each; prompt characters over 4, 100 reply tokens) and makes no call. A run that judges holds the batch's lock (<batch>/_eval/lock, whichrepo runholds while it rewrites_eval/contentand regrades cells) from before it reads the pairs to its end; when another run holds it, the command exits 1 with the messagerepo rungives, and when it cannot be taken (a read-only batch) it exits 2 naming the lock, both before any call.--dry-runwrites nothing and takes no lock.--max-usd Xstarts no new call once X is spent: a cell not fully judged gets nohits_judged.json(one an earlier run wrote is removed), and the command exits 3 (inconclusive; the cells judged keep their files). After a live judge reply with no known price, such a run starts no further live call, asnovelty's spend cap does: the cap cannot be enforced on spend it cannot see. That reply still labels its pair when it parses (a redraw would be a further call), and pairs replayed from the response cache still finish; when pairs are left, the cells they are in get no file, the line naming those cells says why (--json, underdata:budget_stop; drop--max-usdto run unmetered), and the command exits 3. When none is left, the run ends as one with no cap does (exit 0,budget_stopnull). Without--max-usdan unpriced call counts as 0, and the spend line says how many calls had no price and that the spend is not known (--json, underdata:unpriced_calls). A reply replayed from the response cache is free. Ahits_judged.jsonthat cannot be written, or an earlier one that cannot be removed (a read-only batch, a directory in its place), stops the run there with no further call: a✗line names the path and the error, the judge calls made and their cost, and says the cells written before keep their files; the command exits 2. With--labels FILEit reports, per row of the table (arm and answer model), the pairs both the person and the judge labelled, the share with equal labels, and Cohen's kappa over the three labels (calibration: one entry per row with a labelled pair, with itsarmandmodel). Without it, or when no pair carries both the person's and the judge's label (a sheet leftnull,[], labels only on pairs the judge leftunjudged), a line saysrecall_judgedis uncalibrated; when only some rows have such pairs, a line names the others asarm (model).--jsonlists, underdata, the rows with no such pair inuncalibrated_rows, sorted, each{"arm", "model"}(every row without--labels);calibrationisnullwithout--labels.repo hits sheet <batch> --out FILEmakes no call. It writes a JSON list of credited pairs for a person to label: each with itscell,task,arm,model,rep,thread,finding, their files and lines, the fullcommentandfinding_text, andlabel: null. It takes--per-arm Npairs of each arm and answer model, a row of therepo hits judgetable (default 25; all of a row's pairs when it has fewer), drawn withrandom.Random(seed)for--seed N(default 0), so a seed gives one sheet; a pair whose full text is not found is left out. Set eachlabelto one of the three (nullleaves the pair unlabelled) and pass the file torepo hits judge --labels. When--outnames a file that holds a JSON list with an entry whoselabelis set, the command refuses with exit 2 before writing, naming the path and the number of labelled entries (move it aside or pass another--out); a file with no label set, a blank file, or JSON that is not a list, is replaced. A file at--outthat cannot be read (no read permission, a directory, not UTF-8 text) or parsed as JSON (a trailing comma, a BOM) is refused the same way, exit 2 before writing and naming the path, since whether it holds labels is not known.- The measure bound.
repo reportreads a score, cost, turn count, token count orprocesscount, andrepo comparealso reads a--metricvalue, as a measurement only when it is finite and its magnitude is at most 1e150 (SCORE_BOUNDindokimi/measure.py), so that sums and squared deltas stay finite; a value past it is no measurement. Ascoremetric past it makes the grade a grader failure (grade.json has no numeric metrics.<name> that is finite and within +-1e+150; a storedresult.jsonwhosegrade.scoreis past it is read as one too), andrepo comparecounts that grader failure as a score of 0 in its mean, and acost_usd,num_turns, token count orscore_maxpast it makesrepo reportandrepo comparerefuse thatresult.json. Any other value past it (a--metric, aprocesscount,first_prompt_tokens,first_useful_s,first_useful_steps) is left out of the mean and ofn, as a value that is absent. A cell whosefirst_usefulstepsis past it is left out offirst_useful_rateand itsn, and out of the compare header's observed-of-measured count (it shows as unmeasured), as neither a hit nor a miss (steps 5 and steps 1e200 give a rate of 1.0 withn1). Inrepo comparea task whosemetric:xis absent in either arm is unpaired (no metric:x in baseline or treatment), so three tasks whosemetric:xis 1.7e308 in both arms give nometric:xrow at all, not an overflow, and the same three at 1e150 give a row with means of 1e150. repo comparereduces cells to one value per (task, arm, model) first: repetitions share a task's difficulty and are not paired across arms, so the task is the unit. Per treatment arm, model and measure (gate share, score, cost, turns,first_prompt_tokens,first_useful_sandfirst_useful_steps(the median over a task's cells that observed the first useful result, §4.1),first_useful_rate(the share of a task's declared cells with a verdict that observed one; a cell whosestepsis no measure is left out), each--metricfromgrade.json(orjudge:recall_judgedfromhits_judged.json, below), and eachprocesscount a compared cell reports asprocess:<key>orcounter:<name>) it gives the mean per-task delta against the baseline with a 95% interval over tasks, the tasks up, down and tied, and a two-sided sign-flip permutation p (exact up to 16 changed tasks, Monte Carlo above with a fixed seed; at one cell per task and arm it equals McNemar's exact test). Every measure's interval inverts that test (dokimi/eval/sign_flip.py, which the arms track shares;delta.methodissign_flip_inversionunderdatain--json): it is every shift theta at which the test on the per-task deltas minus theta does not reject at the uncorrected two-sided 5% level, each end found by bisection between the mean and a far bound. It excludes 0 exactly when p is below 0.05: the row's own p places 0, and above 16 changed tasks the interval's Monte Carlo draws are those of p, drawn once from the seed and reused at every theta, so the ends do not move between runs. Under a shift every task counts, the tied ones included (their delta becomes -theta), and the smallest p over n tasks is2 / 2^n, so both ends are bounded from 6 tasks on, whatever the ties, and open (nullunderdatain--json,-inf/+infin the text) at 5 or fewer, one task included. The test stays exact, with no mid-p: p(theta) is a step function and the ends are its step points, so an end can be a delta itself, or 0. The text prints an end, the delta mean (repo compareand the rule ledger) and an arm mean at 3 decimals, and a non-zero one that would print as0.000at 2 significant digits (+0.0002,1e-12), so it keeps its side of 0. The ends anddelta.meanare printed at 4 places, or at 2 significant digits where 4 places would give 0, so a non-zero one is never0.0: six deltas of4e-5give4e-05for the mean and both ends.delta.meanstays inside those ends.mde, the per-taskbaseline,treatmentanddeltaand the arm meansbaseline_meanandtreatment_meanare at 6 places, or at 2 significant digits where 6 places would give 0. Aprocesscount,first_prompt_tokensorfirst_useful_*only one arm reports for the shared tasks of a (treatment, model) is not compared; a warning names it. When neither arm reports it (a batch run beforerepo runrecorded it), the row is absent. Holm's correction runs over the gate and score comparisons of one call that can reach p < 0.05; the rest are descriptive. A gate or score row whose changed tasks give a p floor (2 / 2^k) of 0.05 or more can never be significant, so it stays out of the multiplier: itsp_holmandp_holm_floorarenull, and the other rows are corrected as if it were not there. Three notes under a comparison keep a row from being misread, and change no delta, interval or p. A gate or score row of 2+ tasks whose interval includes 0 is inconclusive, not evidence of no effect: the note givesmde, a planning figure: an approximate, uncorrected t-based estimate,(t(0.975, n-1) + t(0.80, n-1)) * sd / sqrt(n)over the per-task deltas, of the mean delta a one-sample t test at the uncorrected two-sided 5% level detects with 80% power at that spread, the t quantiles atn-1degrees of freedom (the note prints it at 3 decimals, and in scientific notation at 2 significant digits below 0.0005, as2.6e-12, and from 1e6; every row hasmdeunderdatain--json;nullfor one task, for deltas with no spread (then no note), or for a figure that leaves the float range (the note then names the changed-task or Holm floor where one keeps p above 0.05, and says nothing otherwise). It is not the power of the sign-flip test nor of the Holm-corrected decision; a Holm-calibrated figure would depend on the other rows' observed p, which a figure for planning the next run's task count cannot know. The sign-flip p over k changed (non-tied) tasks cannot go below2 / 2^k, so with 5 or fewer no effect of any size reaches p < 0.05:mdeisnullthere too, and the note says how low p can go instead (with 3 changed tasks the sign-flip p cannot go below 0.25: no effect can reach p < 0.05 here). Holm's correction can lift that floor: a gate or score row'sp_holm_flooris itsp_holmwith its p put at that floor and the other p of the family as observed (in every--jsonrow underdata;nullon a descriptive row, one with every task tied or one under the floor rule), and where it is not below 0.05,mdeisnulland the note names Holm instead (with Holm over 2 rows that can reach p < 0.05, p_holm cannot go below 0.0625 here: no effect can reach p_holm < 0.05); a family of one row is the raw rule.p_holm_floordecides only whethermdeis given, not its size. A gate or score row whose interval excludes 0 while itsp_holmis 0.05 or more (Holm's correction lifted its p across 0.05; the interval agrees with the raw p, and Holm's step-down has no interval to match) hasinterval_p_disagreetrueand a note: the interval is uncorrected;p_holmdecides this row. The inconclusive note gives way to it. Descriptive rows with p below 0.05 are named on one line: their p is uncorrected and outside Holm's family.--task ID(repeatable) compares only those tasks: an id no finished cell of the batches has is refused, the tasks left out are not listed as unpaired nor their cells as missing (a missing cell's task is the one itsmeta.jsonrecords, else, for a cell onlyplan.jsonnames, the longest task id of the batch's finished cells that its name starts with followed by__; a cell of neither is missing only without--task), the--jsonsummary, underdata, records the selection astask_filter(tasks, andof, the number of tasks of the batches that have a finished cell, the ids--taskcan name, anddropped_arms: without--arm, the arms with no finished cell among the selection, which drop out of the comparison,[]with--arm;nullwithout--task), and the text header saystasks: N of M (--task)and, under it,not compared, no finished cell among the --task selection: <arms>. A gate or score comparison carriesheadroom:ceiling(both arms at 1.0 or the task'sscore.maxon every paired task),floor(both at 0 on every one),near_ceiling(the baseline at the top on all but at most one of 2+ tasks and the treatment nowhere below it), elsenull; a grader failure in either arm also givesnull, as does an agent outage (an error result with no turn count or at most one turn, or a harness that exited non-zero without reporting a turn and was not killed at its timeout): neither is a measurement. A pair is at the top only when both arms reach it and tie: a score pastscore.maxis an effect, not a top. The text prints a note under a flagged comparison. A zero delta there means no room to move, not no effect. Cost, turns and metric rows haveheadroomnull. The top of a score task is thescore.maxthatrepo runrecords inresult.jsonasscore_max: a batch run before that has no known top, so its score rows are neverceiling, and arms whose tops differ are on two scales and getnull.BATCH/ARMtakes an arm from one batch only, so two batches of the same arm (for example two revisions of the guidance) compare too; two selectors of the same cells are refused. A--metricno finished cell reports as a number or boolean is refused.--metric judge:recall_judgedreads each cell'shits_judged.json(repo hits judge, above) instead ofgrade.json; any otherjudge:name is refused with exit 2. A cell reports it only when the file is arepo_hits_judged.v1JSON object whosecell,task,armandmodelare the cell's own, whoserecall,n_threadsand credited (thread, finding) pairs, with thecommentandmessagecuts each pair records, equal the cell'sgrade.jsonones now (else the cell was regraded since judging, even to the same recall or with a thread or finding reworded within the 200 characters ofcommentandmessagethe grade keeps (a later change, or one to a finding's rule or evidence, is not seen): the file is stale, andrepo hits judgeremoves such files only when it runs again; a file written before the pairs recorded the cuts is checked on (thread, finding) only), and whoserecall_judgedis a finite number. Any other cell (no file, a stale file, another cell's file, a nullrecall_judgedfrom an unjudged pair or a cell with no gold thread, a file that cannot be read, is not JSON or is notrepo_hits_judged.v1) does not report it, as a cell lacking agrade.jsonmetric does: it is left out of its task's mean andn, and a null is never read as 0.--jsongives, underdata,judged_cells(nullwithout ajudge:metric):metrics, thejudge:names asked for, andarms, per compared arm itscells(of the compared models) and the countsread,no_file,not_judged(no file, and a cellrepo hits judgenever judges: a grader failure, a grade withoutmatches, or another grader),stale,other_cell,no_threads,unjudgedandunreadable, andjudges, per compared arm the judges (provider/model) of its cells read; when the compared cells read name more than one judge, compare warns, as it does when the arms differ in another stamp. The text prints one line per arm with a cell not read (judge:recall_judged, guidance:none: 18 of 26 cells read (5 no hits_judged.json, 2 stale: regraded since judging, 1 with an unjudged pair); run repo hits judge again; the hint is left off when every cell not read has no gold thread, whose null a rerun writes again, or isnot_judged, which a rerun leaves without a file). When no selected cell reports it, the refusal (exit 2) gives those counts and, unless every cell is one of those two, says to runrepo hits judge <batch> --judge PROVIDER/MODELfirst.hits_judged.jsoncarries no calibration, so compare cannot tell whether a person's labels backed the judge: the text adds one note, that the figure is a judge's labels of the credited pairs, at most each read cell'srecall(therecallrow also averages the cells not read, so the two rows cover different cells when a per-arm line is printed), and uncalibrated unlessrepo hits judge --labelsreported agreement for these arms.--ledgerpasses no--metricto its rule verdicts. Tasks left out are listed as unpaired with the reason: no cells in one arm, a task that is gated in one arm and score-only in the other, or a measure (such as a metric) one arm lacks. A metric'sn_baseline/n_treatmentcount the cells that report it. With repeated cells per task (fromrepo run --reps N), two descriptive measures read the repetitions themselves:--pass-k Kaddspass^K, the chance K of a task's cells all pass its gate (C(c,K)/C(n,K); a task with fewer than K cells has none), so an arm that moves a task from 2/3 to 3/3 is told apart from one that moves the rate without making any task reliable;--path-stabilityaddspath_distance, the mean order distance of the cells' tool paths fromevents.jsonl(0 same steps in the same order, 1 nothing in common; see run-consistency.md). A steadier path is not a better one: read it beside the gate. The output names the batches behind each selector and each batch's pin (tree,eval_dir,image,gradersfrom_eval/batch.json) with its cells' harness versions, and warns when a bareARMpools several batches, when a batch of a comparison has no pin, or when the two arms ran from differenteval_dir,imageorgraderspins or harness versions. An imagerepo runtagged from the tree (dokimi/<id>:<sha>) follows the tree, so two revisions are not warned about it; an--imageof its own is compared.repo reportwarns (model_mismatchin its summary) when a cell'smodel_resolvedis another model than the one requested; a snapshot of the requested id (-20250929,@20250929) or its provider-prefixed form is the same model,-v2against-v3is not.repo comparewarns the same way when the two arms of a comparison were answered by different models. Aguidance:rev:arm may have seen a replay task: guidance written after the task's review can encode it (issue #290).repo comparechecks every compared arm, baseline or treatment, whose cells'meta.jsonhasarm_rev(or whose name starts withguidance:rev:), over its tasks whose celltask.jsonhaspublic_atorsource_pr(§4.6; a task none of whose cells has atask.json, which a host error before the trace is parsed leaves out, is unknown), and--tasknarrows it as it does the comparison. A task is flagged by date when a guidance file that applies to it has itsguidance_latestcommitcommittedafter the task'spublic_at, compared as times. A file namedAGENTS.md,CLAUDE.md,CLAUDE.local.mdorGEMINI.mdbelow the root applies to a task whosepatch_fileshas a path under its directory (one in a.claude/directory counts for that directory's parent); any other guidance path (.claude/rules/*whatever its name,.github/copilot-instructions.md, a skill) applies to every task, which errs on the strict side, and so does every file to a task with nopatch_files(its entry saysscoped: false). A file also applies where a file whose@import chain reaches it (guidance_imported_by, §3) applies: one the chain of a root file (CLAUDE.md,.claude/CLAUDE.md,AGENTS.md, ...) reaches applies to every task, and one only nested files import applies under their directories as well as its own; the entry'svianames the importer that made it apply. Anarm_revwithguidance_latestand noguidance_imported_by(a batch from before it was recorded) is read by directory alone, so a nested file another one imports can be missed there; the arm'simports_unrecordedistrueand the text says so. A task is flagged by name when aguidance_commitssubject names its PR:#<source_pr>, or<source_pr>afterPR,PR#,PR #orGH-(any case:pr#3103,PR 3103), not preceded by a word character,/,.or-,<owner>/<repo>#<source_pr>of the task's ownsource_url, or that PR's URL (its host not glued to a longer name), none followed by a digit (#31030,other/repo#3103,other/repo-#3103andnotgithub.com/<owner>/<repo>/pull/3103do not name#3103); no other text is compared, and a task with nosource_prhas no PR to be named. Withguidance_commits_truncatedthe name check covered only the newest 200 commits, and the output says so; as the list is newest first by committer date, a task none of them names is unknown by name when itspublic_atis missing or earlier than the oldest kept commit'scommitted, and clean otherwise. A task is unknown when a flag cannot be read: nopublic_at(unknown by date, still checked by name), apatch:arm (it has no history), anarm_revwith noguidance_latest(a batch from before it was recorded), or ameta.jsonortask.jsonof the wrong shape; the reason is given. Cells of one task may differ (pooled batches): a flag any cell sets counts, and a cell with notask.jsonwhosearm_revno checked cell of the task has leaves the task unknown, as its history was not read. The--jsonsummary'sleak, underdata, holds one entry per checked arm ([]when none is):arm,kind(guidance:revorpatch),revisions(eachrevandsha),checked,not_checked(the arm's other tasks, whosetask.jsonis not replay-style),by_date(task → the latest applicable commit that tripped it:path,sha,committed,public_at,scoped, andviawhen an import made the file apply),by_name(task → the commit shas),unknown(task → reason),clean(flagged by neither and not unknown),names_truncatedandimports_unrecorded. The text prints per checked arm a line of the counts, the tasks flagged by name with their commits, the tasks flagged by date through an import with the file and its importer (sub/CLAUDE.md via CLAUDE.md), and, when some tasks are flagged and some are not, the clean ones and thenot_checkedones as--taskoptions, to compare without the flagged tasks; a task another arm flags or reports unknown is left out of them. The flags change no delta, interval, p or exit code.
CI for a repository: .github/workflows/repo-eval.yml is a reusable workflow
that runs the no-LLM checks on the caller's checkout and needs no secret.
validaterunseval check --schema-onlyand gates the other two jobs;scanrunsrepo scan(report only: the claim counts and failing claims go to the job summary, therepo_readiness.v1report to an artifact);tasks-checkrunseval checkfor each selected task in a job of its own (docker; the image is built from the manifest's Dockerfile), and uploadscheck.jsonand the grade logs. If the job is cancelled by itstimeout-minutesbefore the check finishes, the Summary step writes acheck.jsonwith the verdicttimeoutfor the task.tasks: changed(the default, also for an empty value) checks, on a pull request, the tasks whose directories it touches, plussmoke-tasks(empty: every task) when it changes the eval directory outside its tasks (Markdown there is excepted, unless it is the manifest, the calling workflow file or under asmoke-pathsentry), the manifest, the calling workflow file or a path undersmoke-paths(entries are space- or comma-separated prefixes, normalised like the manifest path; keep the trailing slash for a directory). A file in the tasks directory that is not under an existing task (a shared helper, or the files of a deleted task) does too. On a push it diffs against the previous tip, on any other event it checks every task.allor a list of task ids selects directly;exclude-tasksalways drops tasks.- Pin dokimi once, in
uses:, by a commit SHA or a release tag.dokimi-refis empty by default, which means the commit of the called workflow (job.workflow_sha), so a bot that bumps theuses:line, such as Dependabot (which names a reusable workflow by its path,intel/dokimi/.github/workflows/repo-eval.yml), bumps dokimi whole. An explicitdokimi-ref(a SHA or a tag; a branch is refused) is still taken; it is required on GitHub Enterprise Server, which has no called-workflow commit. The workflow installsdokimi @ git+https://github.com/intel/dokimi@<sha>#subdirectory=dokimiwith that commit'srequirements.lock.txtas constraints, so a rerun checks with the same framework and dependencies. Moving the pin is a change to the calling workflow, so it runs the smoke set. The ref must containactions/setup: a ref from before that action fails at "Set up dokimi". actionlint 1.7.12 reportsjob.workflow_shaandjob.workflow_repositoryas not defined, which matters only to a repository that lints a copy of this workflow. - Other inputs:
manifest,max-parallel(4),warm(--warm, for a cache that starts empty on every runner),runs-on(ubuntu-latest),timeout-minutes(180, per task),dokimi-repository(the package installed) anddokimi-action-repository(where the setup action is checked out, atdokimi-ref). Both default to the called workflow's repository (job.workflow_repository), so a caller of a fork's workflow gets the fork's action and package without setting either; an explicit value wins. Where the context has no workflow repository (GitHub Enterprise Server), both default tointel/dokimi, as before.
# .github/workflows/agent-evals.yml in the repository
name: Agent evals
on:
pull_request:
paths: ['dev/agent_evals/**', '**/AGENTS.md', '.github/workflows/agent-evals.yml']
schedule:
- cron: '0 3 * * 0'
workflow_dispatch:
permissions: {}
jobs:
evals:
permissions:
contents: read
uses: intel/dokimi/.github/workflows/repo-eval.yml@<sha> # vX.Y.Z
with:
manifest: dev/agent_evals/repo-eval.yaml
smoke-tasks: build_kmeans_host fix_finiteness_mut review_seeded_fc
max-parallel: 4
warm: true
dokimi runs the workflow on its own .agent-eval/ (repo-eval-self.yml), with
the commit under test as dokimi-ref, and its own repository for both repository inputs.