Architecture overview¶
dokimi ships two parallel evaluation tracks, an optional
executable-task suite, and two tracks that change the question rather than the
pipeline: content novelty (what does an artifact add to a model?) and
repositories as evaluation subjects (can a repo supply its own tasks?). They
share configuration (dokimi/config/products.yaml, products.yaml, intents.yaml)
and a single CLI entry point (cli.py) but otherwise operate independently.
Two smaller probes sit beside them: ExploreBench (can an agent locate the right
files?) and the tool-preference probe (what moves a model's choice between two
equal tools?).
┌──────────────┐
│ cli.py │ single argparse front-end
└──┬────────┬──┘
│ │
┌──────────────────┘ └────────────────────┐
▼ ▼
┌────────────────┐ ┌──────────────────────────┐
│ Static track │ │ LLM evaluation track │
│ │ │ │
│ ingest/ │ Markdown files │ personas/ │
│ └─ chunking │ │ questions/ │
│ metrics/ │ coverage, freshness, │ mcp/ (context fetch) │
│ └─ scoring │ readability, examples │ eval/ (judges, RAGAS)│
│ gate/ │ soft/hard/critical gates │ report/ (analysis) │
│ runner/ │ orchestration + compare │ dashboard/(aggregation) │
│ report/ │ JSON + Markdown out │ │
└──────┬─────────┘ └──────────┬───────────────┘
│ │
└───────────────► baselines/ reports/ ◄───────┘
(JSON / Markdown artifacts)
┌─────────────────────────────────┐
│ external tasks root │
│ (--tasks-root <checkout>) │
│ Docker + oracle + pytest │
│ exercised by GitHub Actions │
└─────────────────────────────────┘
┌───────────────────────────────┐ ┌───────────────────────────────┐
│ Content novelty │ │ Repository as subject │
│ │ │ │
│ novelty/ atoms → paired │ │ repos/ repo-eval.yaml + │
│ probes → 2×2 │ │ task.json from the │
│ gate/ novelty gates │ │ scanned repo │
│ │ │ profiles/ one YAML per agent │
│ asks: what does this artifact │ │ asks: does the repo's own │
│ add to *this* model? │ │ guidance reach the agent? │
└───────────────────────────────┘ └───────────────────────────────┘
Layers¶
Every module sits in one layer and imports only from its own layer or the
layers below it. The layers, top first, are the LAYERS table in
tests/test_import_architecture.py, which fails the build on an import that
points up:
| Layer | Modules |
|---|---|
| front end | cli, commands, __main__ (the argparse front end; no layer below imports it) |
| tracks | runner, runs, report, subjects, novelty, harnesses, context, repos, explore, tool_preference, external, dashboard, orchestrator, datasets_export, coverage, task_formats, and the checkers config_check, schema_check, schema_compat |
| evaluation | eval, personas, questions, treatments, plugins |
| components | ingest, metrics, gate, mcp, skills, agent_profiles |
| foundation | __init__ (the dokimi package itself), _version, artifacts, records, llm, process, container_policy, docker_cmd, caching, config, registry, intents, defaults, console, utils, metrics/usage.py |
So report (a track) can call gate (a component), and gate cannot import
report. The sections below follow the tracks, not the layers.
Static documentation track¶
Lives under dokimi/{ingest,metrics,gate,runner,report}. gate/ and
report/ also serve the other tracks, as the steps below say.
ingest/walks the configured root, loads Markdown files (ingest/loader.py), and produces per-file text.ingest/docling_loader.pyis the optional loader that turns PDF, Office and HTML documents into Markdown first (ingestion-docling.md).metrics/scores each file. Each metric is a small pure module:coverage,freshness_lite,readability,example_pass_rate. See contributing-metric.md for how to add one. The package also holdsexploration.py, the ExploreBench scoring (see Exploration quality), andusage.py, the per-call LLM token, cost and latency record (see Shared building blocks).runner/run.pyreadsbenchmarks/spec.v1.yaml, runs the enabled metrics, normalizes weights, and writes a snapshot JSON.gate/applies soft gates, hard gates, critical bands, and regression thresholds (runner/compare.pypowerscli.py docs compare).report/turns snapshots and comparisons into Markdown (markdown_report.py,json_report.py). It also renders the other tracks' artifacts:eval_report.pyandgenerator.py(LLM track),arms_report.py(treatment arms),task_runs_report.py(executable tasks),subject_report.py(subject scorecards),exploration_report.py(ExploreBench), and the model, matrix-rollup and plugin-delta comparisons.
Entry points: python cli.py docs check, python cli.py docs compare, python cli.py
report.
LLM evaluation track¶
Lives under dokimi/{personas,questions,mcp,eval,report,gate,dashboard,orchestrator}.
personas/discovers and validates target user personas from GitHub activity.questions/generates, dedupes, and validates persona-driven questions, plus document-grounded questions ("hybrid generation").mcp/retrieves documentation chunks for each question. The default client is Context7 over HTTP (mcp/context7.py);mcp/factory.pydispatches--doc-sourceto alternative clients (local:,url:, or a custom registered client — see adding-doc-source.md).eval/runs answer generation (llm.py), single-judge scoring, the multi-judge panel, and RAGAS meta-evaluation. Every consumer of ananswers.v1/eval.v1/arms.v1record (judge, panel, RAGAS, grounding, reports, gates) reads it throughdokimi/records.py, the one module that knows the binary (with_docs/without_docs) and N-arm (arms/scores) shapes.report/eval_report.pyproduces the per-product Markdown analysis;report/generator.pybuilds the analysis report, with the verdict ofgate/trust_gate.pyon whether the run can be trusted.dashboard/aggregates per-library results into a cross-library view (DASHBOARD.md,dashboard.json).orchestrator/wires steps 1–5 together for theevaluateone-command pipeline.
Entry points: python cli.py {personas,questions,answers,eval,report,
dashboard,evaluate}.
The full step-by-step recipe is in quickstart.md.
Treatment-arm comparison¶
The two-arm with_docs/without_docs answerer is generalized by
dokimi/treatments/ into an N-way comparison of
context-augmentation treatments. A Treatment produces an AgentConfig
(system prompt + injected context) per question; arms cover documentation
injection (docs/mcp:), agent persona prompts (profile:, loaded from
agent_profiles/), skills (skill:, loaded from skills/), and agentic use
where the model decides to call a doc-search or skill tool (agent:,
skill-agent:, skill-catalog:) via the tool-calling loop in eval/agent_runner.py.
The spec grammar — what an --arm entry means, where + splits a combined
spec, and what each arm is named — is treatments/specs.py.
eval/arm_runner.py generates and judges answers for every arm and reports
per-arm deltas vs a baseline. eval/arms_run.py runs it from an ArmsRunConfig,
the one typed run configuration arms run, arms matrix-run (one per cell) and
subjects run build from their flags. eval/arms_adapter.py reads a single-turn run of a
baseline arm and at most one docs arm (docs/mcp:) as the answers.v1/eval.v1 files of
the pipeline, so their readers take it unchanged (#228 step 4); it refuses other arms (a run
stopped before its other arm answered cannot tell) and session runs. dokimi/plugins.py adds runtime plugins that
modify every arm inside one run (plugin:caveman): a plugin changes the system
prompt before the model runs or reshapes the answer after it. Entry point:
python cli.py arms run. Details in
evaluating-treatments.md.
Content-novelty track¶
An arm comparison produces one number for a whole artifact: it helps, or it does
not. That is enough to ship or cut a skill and not enough to edit one, because
a skill is not homogeneous — part of it teaches the model something, part of it
is the model's own prior knowledge written down, and part of it can make the
model worse. dokimi/novelty/ splits that single delta per sentence.
The mechanism is a paired probe. The artifact is cut into spans, checkable
knowledge atoms are extracted from those spans, and every atom is asked of the
same model twice — once with no artifact in context, once with it. A different
model grades both answers, so the four outcomes (added, redundant,
degraded, still_missing) are exhaustive and the comparison survives a judge
whose absolute calibration is poor.
dokimi/novelty/spans.pysegments the artifact;dokimi/novelty/atoms.pyextracts atoms and verifies each one against the span cited for it.dokimi/novelty/needs.pybuilds a need graph from the artifact'snameanddescriptiononly — never from its body — so relevance has a scope the artifact cannot define for itself.dokimi/novelty/probes.pybuilds the paired probes;dokimi/novelty/measure.pyruns them over the configured arms (no_artifact,full, and the optionalplaceboandshuffledcontrols) and raises rather than let a model grade itself.dokimi/novelty/classify.pyjudges content categories;dokimi/novelty/attribute.pymaps outcomes back to spans, topics, and terms.dokimi/novelty/shorten.pyscores shortening candidates on five separate axes (tokens, knowledge, value, protection, routing), with a cache-backed retention oracle indokimi/novelty/retention.py.dokimi/novelty/report.pywrites the scorecard block and an annotated HTML view of the artifact;dokimi/gate/novelty_gate.pyturns the numbers into soft gates (the novelty track's use ofgate/).
Entry points: python cli.py skill novelty {analyze,atoms,probe,items,view}, python cli.py skill shorten, and python cli.py subjects run to attach the result to the subject scorecard it builds for that run.
Novelty is a property of the (artifact, model) pair, not of the file — the same
skill is worth very different amounts to a frontier and to a small model, so the
model under measurement is always recorded with the result. --model defaults to
gpt-6.1-sol (the default answer model); pass it explicitly, or the run measures that model instead of the
one you meant.
skill-novelty.md is the authoring guide;
skill-novelty-evidence.md is the study the default
thresholds come from, with the caveat attached to each number.
Executable task track¶
Tasks are Terminal-Bench / Harbor-format
directories — Docker environment, instruction.md, oracle solution, and pytest
verifier — or BenchFlow task.md directories (SkillsBench), supplied from an
external content checkout named with --tasks-root (format spec:
contributing-terminal-bench-task.md;
layouts and which harnesses run each:
coding-harnesses.md). CI
builds a container from a pinned external catalog and runs its oracle and the
isolation probe, to make sure the harness, the task format, the verifier path
and the agent's sandbox all still work.
dokimi/harnesses/ turns those task directories into measured
task_runs.v1 artifacts. Built-in harness aliases include codex,
claude-code, and terminal-bench:<agent>; each runs a Harbor-compatible agent,
records operation telemetry (harness, loop, tool, subagent, ...), and
summarizes pass-rate deltas against a baseline harness. Entry point:
python cli.py tasks run. These modules own the solver's launch:
harnesses/container_agent.pyruns the agent in the task container, on an internal network.harnesses/egress_proxy.pyis the allowlisting proxy that container's only way out goes through.harnesses/agent_sandbox.pyis the host launch for the-hostvariants, and holds thedocker-probeisolation probe that measures both launches.harnesses/skill_treatment.pyinstalls thedocker-claude-skill:arm's skill as a plugin (the-skill-discover:arm's too, without the notice) and reads skill reach from the agent's stream;harnesses/solver_stream.pyruns the solver and records that stream.harnesses/benchflow.pyhands a cell to BenchFlow'sbench eval run(thebenchflow*:<agent>harnesses, the only ones that runtask.mdtasks) and folds the rollout'sresult.jsoninto the row under the cell rule in coding-harnesses.md.
See contributing-terminal-bench-task.md to add a task and coding-harnesses.md to run harness comparisons.
Skills and tasks don't have to live in this repo: dokimi/external/
reads another checkout's own manifests (skills.yaml,
evaluation/harbor/suites.json — the uxlfoundation/skills convention) and
reports what loads via python cli.py catalog check --root <path>; loaded
entries then plug into the same --tasks-root / docker-claude-skill:<path>
flags as local ones. external-content.md is the
end-to-end walkthrough of that; the "External Sources" section of
coding-harnesses.md covers the harness-specific part.
Repositories as evaluation subjects¶
The tracks above measure an artifact the framework is handed. This one turns the
question around: a repository declares what evaluating it means, and the
framework runs that. The subject is no longer a skill but the repo's own agent
guidance — CLAUDE.md, AGENTS.md, .github/copilot-instructions.md,
contributor docs — and the question is whether that guidance reaches an agent
and changes what it produces.
The split is deliberate: tasks, graders, and the manifest live in the scanned
repository, not here (dokimi/repos/ only reads them). A repo
evolves with its own tasks; a copy of them in this tree would be stale by the
next release.
dokimi/repos/manifest.py— loads and validatesrepo-eval.yaml(repo_manifest.v1) in two passes: the manifest's own shape, then the manifest against one snapshot (declared paths exist, guidance globs match, every task directory carries a contract-shapedtask.json).dokimi/repos/source.py— resolves<dir>,<dir>@<rev>or<url>@<rev>to a pinned snapshot, cached per URL as a blob-less clone, so a run names an exact commit.dokimi/repos/reach.py+dokimi/repos/harness_profile.py— the reach probe. It does not trust a harness's documented loading rules: it builds a skeleton workspace with the repo's guidance files at their real paths, plants a head and a tail token in each, and asks the agent which tokens it can see. A file comes backloaded,truncated(one token — the file was cut),fetched(seen only after the agent read it),not_loaded, orerror(no usable answer). Harness behaviour is data, not code:dokimi/repos/profiles/holdsharness_profile.v1files for Claude Code, the Codex CLI (codex, and its native review modecodex-review) and the Copilot CLI (copilot, andcopilot-review, a/review-prefixed prompt variant of it); any other harness is another YAML.dokimi/repos/budget.py—repo budget: what the tree puts into an agent's context when it starts at the root, in characters, with no LLM call. Root CLAUDE.md files and their@imports, the root AGENTS.md files and their@imports, and the skill listing (without skills markeddisable-model-invocation: true) load at start; nested guidance and what nested CLAUDE.md and AGENTS.md files import load lazily; skill bodies on demand; with a CLAUDE.md,.claude/CLAUDE.mdorCLAUDE.local.mdat the root, an AGENTS.md no CLAUDE.md imports is reported off, and so is a nested one no CLAUDE.md imports whose own directory holds one of those files (one in a parent below the root does not count). Both rules hold only with a profile that setsguidance.claude_displaces_agents, asclaude-codedoes. Imports are followed only with a profile that declaresguidance.imports(claude-code; it is null forcodexandcopilot). A skill with no description is listed by its first non-empty body line, as Claude Code does. It warns on skills with no description or body text, skills with near-duplicate descriptions (identical descriptions, or Jaccard index >= 0.5 after stop-word removal when both have 3+ words left), on AGENTS.md files turned off, on unreadable files (non-UTF-8, dangling or out-of-tree link), on imports past the harness's hop limit, and on a link at or below.claude/rulesto a directory or out of the tree, or a root.claudelink to a directory withrules/or out of the tree, or a git submodule at.claudeor at or below.claude/rules(the rules behind it are not counted at start), each of which also trips--fail-on warn. For a profile withguidance.claude_rules(Claude Code),.claude/rules/**/*.mdfiles areruleentries:startin the root.claude/rules/whenpathsnames no pattern,lazywhen it does or in a subdirectory's.claude/rules/, butstartwhatever itspathswhen a root CLAUDE.md or AGENTS.md imports it, the frontmatter not counted. 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.startis not an upper bound: it is too low by what it does not count (only@path.mdimports are followed, so@notes.txtadds nothing; skills are read only from real.claude/skills/*/SKILL.mddirectories at the root, so a skill behind a linked directory is not seen, nor are the rules behind a link at or below.claude/rules(a warning names it, as it does a root.claudelink to a directory withrules/or out of the tree, and such a git submodule), and a nested<subdir>/.claude/skills/skill, which Claude Code loads on the first read in that subdirectory, is not counted; and imports past the profile'sguidance.import_max_depth, four hops for Claude Code, which warn naming what was skipped). It is too high by whatever the harness cuts from the skill listing: the listing is charged in full, and the harness cuts it past its listing budget.--outwrites the inventory as arepo_budget.v1artifact;--jsonprintscli_output.v1with the artifact underdata.dokimi/repos/static.py— therepo_static.v1schema: what the repository's ownstaticentry point writes, so its checks can be merged into L0.dokimi/repos/bases.py— checks that need every task base: eachbasemust resolve, and the guidance globs are evaluated at each base.dokimi/repos/run_context.py— builds therun_context.v1record (run_context.jsonbesideevents.jsonl) from the start-up and closing records the converters keep on the transcript, the command line, and config digests taken before the agent starts; seedocs/repo-evaluation-contract.md§4.9.dokimi/repos/events.py— converts a harness trace to theevents.jsonlrun trace;dokimi/repos/cli_traces.pyholds the Codex and Copilot JSON converters, anddokimi/repos/shell_walk.pythe walker of the files a shell command prints, which they call (dokimi/repos/shell_split.pysplits the command into its parts, anddokimi/repos/shell_words.pyfinds a part's command word and the directory builtins it runs, anddokimi/repos/shell_functions.pythe shell functions whose call may move the shell), anddokimi/repos/answers.pytheanswer_formatconversions that turn a native review answer into a findings block.dokimi/repos/l0/—repo scan(L0): checks the links, paths, identifiers, commands and build labels the guidance names against the same tree (repo_readiness.v1), with no LLM call.dokimi/repos/environment/—repo inspect: instruction files and their scope, check surfaces per project root, launch risks (hooks, MCP, risky scripts) and the file inventory (repo_environment.v1), read from the tree alone;structure.pyadds the modules section from a SCIP index (--index).dokimi/repos/workspace.py— loadstask.jsonfiles, exports the eval dir and the image build context (tasks removed), and prepares a cell's workspace: snapshot atbase, setup patches, the guidance arm, and no history or unreachable objects left behind.dokimi/repos/container.py— how every container starts (fixed paths, bind mounts only, the caller's uid, env by name, no new privileges) and the docker CLI runner; tests swap in a fake runner.dokimi/repos/grading.py— runs thegradeandoracleentry points in their own container, readsgrade.json(repo_grade.v1) without following links, and turns it into the framework's verdict and gate. Fordokimi:hidden_tests(dokimi/repos/graders/hidden_tests.py) it first copies the hidden files into the workspace and runs the manifest'stestentry point.dokimi/repos/runner.py+dokimi/repos/report.py—repo run(one agent per task × arm × model × rep cell, thengrade, oneresult.jsonper cell) andrepo report(gated success with a Wilson interval, grader failures, missing cells, cost).dokimi/repos/hits_judge.py+dokimi/repos/hits_calibration.py—repo hits judge: a judge model labels each credited pair of the replay cells with their full texts, and each cell getshits_judged.json(repo_hits_judged.v1,recall_judged);repo hits sheetsamples pairs for a person, and the labels give agreement and Cohen's kappa per arm and answer model.dokimi/repos/compare.py—repo compare: treatment arms against a baseline arm over one or more batches, one value per task and arm (gate share, score, cost, turns, chosengrade.jsonmetrics,result.jsonprocesscounts), with a sign-flip permutation p, an interval over tasks that inverts it (dokimi/eval/sign_flip.py, shared with the arms track'sdokimi/eval/stats.py;dokimi/repos/compare_interval.pyprints it) and Holm's correction.dokimi/repos/compare_tasks.pyholds what its--taskselection keeps;dokimi/repos/compare_reach.pyhow small an effect a row can find (mde, an uncorrected t-based estimate, and the lowestp_holmHolm's family leaves it);dokimi/repos/compare_judged.pyreads--metric judge:recall_judgedfrom each cell'shits_judged.json;dokimi/repos/compare_leak.pywhich replay tasks aguidance:rev:arm may have seen.dokimi/repos/ledger.py—repo compare --ledger: loads arepo_ledger.v1file (rules with their hypothesis, arm, linked cases and review date) and gives each rule a verdict fromrepo compareover its own cases, Holm-corrected across the rules. rule-ledger.md.dokimi/repos/selfcheck.py—eval check: on each taskgrademust fail the untouched workspace and pass it afteroracle, and an isolation probe must not see the tasks or the source from the agent's container.dokimi/repos/replay/—eval tasks generate --from replay: onedokimi:review_replaytask per merged pull request of a threads filegh api graphqlwrote (the change as reviewed, gold from the reviewers' threads on its lines, andaddressedfrom the PR's own later commits), read with git and no GitHub call.eval tasks generate --from prs(authoring.py,authoring_prs.py,authoring_prompt.py): onedokimi:hidden_teststask per merged pull request, its description as the prompt, its tests hidden until the grade and the rest of its diff as the oracle (contract §4.8);eval tasks generate --from history(authoring_commits.py) writes the same tasks from bug-fix commits, with no pull request file;merged.pyholds what the two kinds share.dokimi/repos/graph_tasks.py—eval tasks generate --from graph:dokimi:graph_enumtasks (references to a function, direct subclasses of a class) with gold from a SCIP index of a pinned revision, read withdokimi/repos/code_index/.eval tasks generate --from graph|replay|prs|historyis the command that writes into a repository's tasks directory.
Entry points: python cli.py repo {validate,scan,fetch,reach,budget,run,report} (replay and authoring tasks: eval tasks generate --from replay|prs|history)
(python cli.py repo --help is the current list). The interface a repository
codes against is repo-evaluation-contract.md.
Its core is implemented, but the per-host egress proxy (§2) is not, so
repo run needs --agent-network for an agent that must reach its model.
Exploration quality¶
dokimi/explore/ is ExploreBench, a track that asks only whether an agent can
locate the right files and line ranges for a task, not whether it can then
answer or solve. A task (explore/tasks.py) is a query over a tree plus
reference locations. explore/runner.py runs each task through explorer arms
(explore/explorer.py) and scores their file:line citations against the
references with dokimi/metrics/exploration.py, into an explore_runs.v1
artifact with per-arm rollups and baseline deltas;
report/exploration_report.py renders it. Entry points:
python cli.py explore {list,run}.
Tool choice¶
dokimi/tool_preference.py is the tool-preference probe. A group is one user
request with two tools that do the job equally well, plus distractors; the probe
changes one thing about one of the two (its name, one added sentence, its place
in the list) and measures how much the model's first-turn choice moves,
into a tool_preference.v1 artifact. Entry point:
python cli.py tools preference. Guide: tool-preference.md.
Context window¶
dokimi/context/trace.py reads a Claude Code stream-json trace into the
prompt size of every model call (input + cache_creation + cache_read
tokens, one call per message id), the compaction events, tool-result sizes and
failures per tool, and repeated tool calls. python cli.py trace inspect
prints one or more traces as a comparison table; it calls no model. Guide:
context-window.md.
dokimi/context/consistency.py reads repeated runs of one task into three
separate profiles: result (pass@k, pass^k), path (tool-mix JSD, edit
distance of tool and action sequences, resource spread, strategy groups) and
conformance to a YAML process contract; python cli.py trace consistency.
Guide: run-consistency.md.
dokimi/context/session_log.py reads a Claude Code session log into prompt and
tool events; dokimi/context/prefilter.py matches a guidance file's rules
against them (trigger, acted, corrected) and ranks candidates for ablation.
Both are deterministic; python cli.py trace prefilter. Guide:
session-prefilter.md.
Agent memory¶
dokimi/memory/store.py reads a Claude Code auto-memory directory (MEMORY.md,
topic files with YAML frontmatter, archive/); dokimi/memory/lint.py runs
deterministic checks on it; dokimi memory lint. Guide: memory.md.
Shared building blocks¶
dokimi/process.py— the one place in the package that spawns a process (git,gh, doc snippets, harness profiles, thecommand:, Harbor, BenchFlow anddocker-*harnesses with theirdockerandclaudecalls, the explorer and the repository-mode docker runner). A timeout, an interrupt or the command's exit kills its whole process group / job object (withterm_grace, as forbenchanddocker run, a timeout or an interrupt sends the group SIGTERM first and kills it after the grace); so does a SIGTERM/SIGHUP to thedokimiCLI, which installsinstall_signal_handlers()at start-up (importing the module installs nothing; a library caller opts in). A timeout is a result (returncode124, partial output kept) not an exception, output is read as UTF-8, a captured stream keeps at most 1 MiB in memory (its first and last half,truncatedset;stdout_to/stderr_towrite a whole stream to a file; git output is kept whole), and every call states its environment policy (Env.inheritor anEnv.onlyallow-list).Limitsthe platform cannot apply raiseValueErrorbefore the child starts (any limit on Windows, a memory limit on macOS), asetrlimitthe kernel rejects raisessubprocess.SubprocessErrorbefore the command runs, and a hard limit the process inherited that is lower than the request stays in force.dokimi/process_io.pydecides who owns each pipe, so an interrupted launch closes its streams exactly once and Windows reader threads close theirs at EOF.dokimi/process_hooks.pyholds what the signal handler runs before the kill (notices) and after it (hooks): a run directory records its stop there.FakeRunneris its test adapter: code that spawns takes arunnerargument.- Bad input: a library loader raises
dokimi.utils.InputError, naming the file, and never ends the process.cli.mainprintsError: <message>and exits 2; exit 1 stays the verdict of a gate.tests/test_import_architecture.pyallows an exit only in the frontend. dokimi/pattern_glob.py—expand(pattern), the one expansion of a path pattern the user gives (trace consistency --arm, the session paths oftrace prefilter,skill novelty ground --headerand--shared-lib). It matches asglob.glob(pattern, recursive=True)does, sorted, but a directory the pattern has to list and cannot raises itsOSErrorwhereglobskips it; the commands turn that into anInputError.dokimi/llm.py— the entry point for LLM calls.LLM(one model at one provider:complete/ask/chat, retry, the response cache, usage) sits on one adapter seam:LiteLLMAdapterin production,FakeAdapterin tests (thefake_llmfixture).ask_parsedis the redraw-until-it-parses loop.llm_call,chat_completion, the judge, the persona and question generators and the question validator go throughLLMand its one provider table (resolve_model,credential_env_var).dokimi/llm_cli.pyserves the CLI providers (claude-cli):LiteLLMAdapterhands their requests to it, and it runs the logged-in CLI throughprocess.run(subscription-backends.md).dokimi/llm_json.pyholds the JSON extraction helpersllm.pyre-exports.dokimi/caching.py— the two caches that hang offllm.py: provider prompt caching (the stable part of a prompt goes first, so the provider can reuse it) and an opt-in response cache for byte-identical single-shot requests (DOKIMI_RESPONSE_CACHE).dokimi/metrics/usage.py—UsageRecord, the tokens, cache, cost and latency of one LLM call. It sits inmetrics/but depends on nothing, and every LLM caller reads it.dokimi/datasets_export.py—python cli.py data export: questions, answers, eval, arms and task-run artifacts to JSONL, Parquet or a Hugging Face dataset, with a dataset card.dokimi/registry.py— product registry loaded fromproducts.yaml; powerscli.py catalog list|show --kind productandcli.py benchmark.dokimi/intents.py— intent registry loaded fromintents.yaml: the problem/intent space mapping domains (data science, debugging, optimization, …) to the products that serve them. Consistency withproducts.yamlis enforced bypython -m dokimi.config_check.dokimi/config/products.yaml— per-product config: GitHub repo, Context7 ID, retrieval defaults, judge model, persona count.benchmarks/spec.v1.yaml+dokimi/runner/spec.schema.json— declarative static-benchmark configuration.
CI¶
These GitHub Actions workflows run on PRs (see .github/workflows/):
ci.yml, agent-quality.yml and docs.yml, described below. ci.yml's
static job runs python -m dokimi.schema_compat, which fails an in-place edit that narrows
an existing schema version, unless a reviewer applies the schema-break-ok
label (it exits 1 for a narrowing, which the label overrides only when the run printed a
BREAKING finding, and 2 when git cannot read the base; any other exit fails the step
whatever the label). conda-forge.yml runs only when a PR or a push to main changes
pyproject.toml, one of the two scripts it runs or the workflow file (also weekly, and by
hand, workflow_dispatch): it solves the runtime dependencies from conda-forge
alone (scripts/conda_forge_specs.py turns them into match specs), installs the
wheel into that environment with --no-deps, and runs pip check and
scripts/smoke_installed.py. PRs use the newest supported Python. Pushes to
main, the weekly run and manual dispatch also exercise the supported floor.
ci.yml — fast code checks:
- static — the checks that need no lock install, as steps of one job:
ruff check ., zizmor on the workflows and actions, the license headers, the pre-commit hooks and bandit (pip-audit is its own workflow,pip-audit.yml). Schema checks:schema_checkvalidatesbenchmarks/spec.v1.yaml;config_checkchecksproducts.yaml/intents.yaml/dokimi/config/products.yamldrift. Theguidance self-scan (L0)step runsrepo scanas a gate (--fail-on fail). - mypy — type check of the whole package.
- test — pytest from
requirements.lock.txt, offline, in parallel (pytest-xdist). PRs run the 3.14 coverage leg, which checks outcomes, journey evidence and changed-line coverage (80% when at least 20 changed lines are measurable). Pushes tomain, scheduled and manually dispatched runs cover the full supported Python matrix. - package-smoke — builds/installs the package with a fresh resolve of its dependency ranges and exercises the console and module entry points. PRs exercise the supported floor. Other runs also exercise Python 3.13.
windows-smoke (a PR check on windows-latest) builds the wheel, installs
it, runs the installed-package smoke test and a few fast tests.
agent-quality.yml — task and benchmark checks:
- external-catalog-smoke — clones a pinned external content catalog, runs
catalog checkover it, then drives one of its real tasks through thedocker-oracleharness (build + solve + verify, with the task's ownnetwork_mode, bridge for this public task) and thedocker-probeisolation probe. It asserts both pass rates, so a launch change that lets an in-container agent reach the grader, the skills or the network fails CI. Task definitions are not in this repository, so this job proves the harness and the task format rather than any particular task. - benchmark — runs the static agent-quality benchmark with
--strict, so a gate or band failure fails the job, and uploadscurrent.json/current.mdartifacts.
docs.yml — the documentation site:
- build —
mkdocs build --strictofmkdocs.yml:docs/plus the CLI and API reference generated from the code. A link or anchor between pages that does not resolve, a link to a source file that does not exist, or a list that nests differently on the site than on GitHub fails it. On a push tomain, deploy publishes the build to GitHub Pages.