Skip to content

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.

  1. ingest/ walks the configured root, loads Markdown files (ingest/loader.py), and produces per-file text. ingest/docling_loader.py is the optional loader that turns PDF, Office and HTML documents into Markdown first (ingestion-docling.md).
  2. 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 holds exploration.py, the ExploreBench scoring (see Exploration quality), and usage.py, the per-call LLM token, cost and latency record (see Shared building blocks).
  3. runner/run.py reads benchmarks/spec.v1.yaml, runs the enabled metrics, normalizes weights, and writes a snapshot JSON.
  4. gate/ applies soft gates, hard gates, critical bands, and regression thresholds (runner/compare.py powers cli.py docs compare).
  5. report/ turns snapshots and comparisons into Markdown (markdown_report.py, json_report.py). It also renders the other tracks' artifacts: eval_report.py and generator.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}.

  1. personas/ discovers and validates target user personas from GitHub activity.
  2. questions/ generates, dedupes, and validates persona-driven questions, plus document-grounded questions ("hybrid generation").
  3. mcp/ retrieves documentation chunks for each question. The default client is Context7 over HTTP (mcp/context7.py); mcp/factory.py dispatches --doc-source to alternative clients (local:, url:, or a custom registered client — see adding-doc-source.md).
  4. eval/ runs answer generation (llm.py), single-judge scoring, the multi-judge panel, and RAGAS meta-evaluation. Every consumer of an answers.v1/eval.v1/arms.v1 record (judge, panel, RAGAS, grounding, reports, gates) reads it through dokimi/records.py, the one module that knows the binary (with_docs/without_docs) and N-arm (arms/scores) shapes.
  5. report/eval_report.py produces the per-product Markdown analysis; report/generator.py builds the analysis report, with the verdict of gate/trust_gate.py on whether the run can be trusted.
  6. dashboard/ aggregates per-library results into a cross-library view (DASHBOARD.md, dashboard.json).
  7. orchestrator/ wires steps 1–5 together for the evaluate one-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.

  1. dokimi/novelty/spans.py segments the artifact; dokimi/novelty/atoms.py extracts atoms and verifies each one against the span cited for it.
  2. dokimi/novelty/needs.py builds a need graph from the artifact's name and description only — never from its body — so relevance has a scope the artifact cannot define for itself.
  3. dokimi/novelty/probes.py builds the paired probes; dokimi/novelty/measure.py runs them over the configured arms (no_artifact, full, and the optional placebo and shuffled controls) and raises rather than let a model grade itself.
  4. dokimi/novelty/classify.py judges content categories; dokimi/novelty/attribute.py maps outcomes back to spans, topics, and terms.
  5. dokimi/novelty/shorten.py scores shortening candidates on five separate axes (tokens, knowledge, value, protection, routing), with a cache-backed retention oracle in dokimi/novelty/retention.py.
  6. dokimi/novelty/report.py writes the scorecard block and an annotated HTML view of the artifact; dokimi/gate/novelty_gate.py turns the numbers into soft gates (the novelty track's use of gate/).

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.py runs the agent in the task container, on an internal network.
  • harnesses/egress_proxy.py is the allowlisting proxy that container's only way out goes through.
  • harnesses/agent_sandbox.py is the host launch for the -host variants, and holds the docker-probe isolation probe that measures both launches.
  • harnesses/skill_treatment.py installs the docker-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.py runs the solver and records that stream.
  • harnesses/benchflow.py hands a cell to BenchFlow's bench eval run (the benchflow*:<agent> harnesses, the only ones that run task.md tasks) and folds the rollout's result.json into 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 validates repo-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-shaped task.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 back loaded, truncated (one token — the file was cut), fetched (seen only after the agent read it), not_loaded, or error (no usable answer). Harness behaviour is data, not code: dokimi/repos/profiles/ holds harness_profile.v1 files for Claude Code, the Codex CLI (codex, and its native review mode codex-review) and the Copilot CLI (copilot, and copilot-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 marked disable-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.md or CLAUDE.local.md at 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 sets guidance.claude_displaces_agents, as claude-code does. Imports are followed only with a profile that declares guidance.imports (claude-code; it is null for codex and copilot). 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/rules to a directory or out of the tree, or a root .claude link to a directory with rules/ or out of the tree, or a git submodule at .claude or 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 with guidance.claude_rules (Claude Code), .claude/rules/**/*.md files are rule entries: start in the root .claude/rules/ when paths names no pattern, lazy when it does or in a subdirectory's .claude/rules/, but start whatever its paths when 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. start is not an upper bound: it is too low by what it does not count (only @path.md imports are followed, so @notes.txt adds nothing; skills are read only from real .claude/skills/*/SKILL.md directories 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 .claude link to a directory with rules/ 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's guidance.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. --out writes the inventory as a repo_budget.v1 artifact; --json prints cli_output.v1 with the artifact under data.
  • dokimi/repos/static.py — the repo_static.v1 schema: what the repository's own static entry point writes, so its checks can be merged into L0.
  • dokimi/repos/bases.py — checks that need every task base: each base must resolve, and the guidance globs are evaluated at each base.
  • dokimi/repos/run_context.py — builds the run_context.v1 record (run_context.json beside events.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; see docs/repo-evaluation-contract.md §4.9.
  • dokimi/repos/events.py — converts a harness trace to the events.jsonl run trace; dokimi/repos/cli_traces.py holds the Codex and Copilot JSON converters, and dokimi/repos/shell_walk.py the walker of the files a shell command prints, which they call (dokimi/repos/shell_split.py splits the command into its parts, and dokimi/repos/shell_words.py finds a part's command word and the directory builtins it runs, and dokimi/repos/shell_functions.py the shell functions whose call may move the shell), and dokimi/repos/answers.py the answer_format conversions 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.py adds the modules section from a SCIP index (--index).
  • dokimi/repos/workspace.py — loads task.json files, exports the eval dir and the image build context (tasks removed), and prepares a cell's workspace: snapshot at base, 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 the grade and oracle entry points in their own container, reads grade.json (repo_grade.v1) without following links, and turns it into the framework's verdict and gate. For dokimi:hidden_tests (dokimi/repos/graders/hidden_tests.py) it first copies the hidden files into the workspace and runs the manifest's test entry point.
  • dokimi/repos/runner.py + dokimi/repos/report.py — repo run (one agent per task × arm × model × rep cell, then grade, one result.json per cell) and repo 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 gets hits_judged.json (repo_hits_judged.v1, recall_judged); repo hits sheet samples 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, chosen grade.json metrics, result.json process counts), with a sign-flip permutation p, an interval over tasks that inverts it (dokimi/eval/sign_flip.py, shared with the arms track's dokimi/eval/stats.py; dokimi/repos/compare_interval.py prints it) and Holm's correction. dokimi/repos/compare_tasks.py holds what its --task selection keeps; dokimi/repos/compare_reach.py how small an effect a row can find (mde, an uncorrected t-based estimate, and the lowest p_holm Holm's family leaves it); dokimi/repos/compare_judged.py reads --metric judge:recall_judged from each cell's hits_judged.json; dokimi/repos/compare_leak.py which replay tasks a guidance:rev: arm may have seen.
  • dokimi/repos/ledger.py — repo compare --ledger: loads a repo_ledger.v1 file (rules with their hypothesis, arm, linked cases and review date) and gives each rule a verdict from repo compare over its own cases, Holm-corrected across the rules. rule-ledger.md.
  • dokimi/repos/selfcheck.py — eval check: on each task grade must fail the untouched workspace and pass it after oracle, 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: one dokimi:review_replay task per merged pull request of a threads file gh api graphql wrote (the change as reviewed, gold from the reviewers' threads on its lines, and addressed from 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): one dokimi:hidden_tests task 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.py holds what the two kinds share.
  • dokimi/repos/graph_tasks.py — eval tasks generate --from graph: dokimi:graph_enum tasks (references to a function, direct subclasses of a class) with gold from a SCIP index of a pinned revision, read with dokimi/repos/code_index/. eval tasks generate --from graph|replay|prs|history is 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, the command:, Harbor, BenchFlow and docker-* harnesses with their docker and claude calls, the explorer and the repository-mode docker runner). A timeout, an interrupt or the command's exit kills its whole process group / job object (with term_grace, as for bench and docker run, a timeout or an interrupt sends the group SIGTERM first and kills it after the grace); so does a SIGTERM/SIGHUP to the dokimi CLI, which installs install_signal_handlers() at start-up (importing the module installs nothing; a library caller opts in). A timeout is a result (returncode 124, 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, truncated set; stdout_to/stderr_to write a whole stream to a file; git output is kept whole), and every call states its environment policy (Env.inherit or an Env.only allow-list). Limits the platform cannot apply raise ValueError before the child starts (any limit on Windows, a memory limit on macOS), a setrlimit the kernel rejects raises subprocess.SubprocessError before the command runs, and a hard limit the process inherited that is lower than the request stays in force. dokimi/process_io.py decides who owns each pipe, so an interrupted launch closes its streams exactly once and Windows reader threads close theirs at EOF. dokimi/process_hooks.py holds what the signal handler runs before the kill (notices) and after it (hooks): a run directory records its stop there. FakeRunner is its test adapter: code that spawns takes a runner argument.
  • Bad input: a library loader raises dokimi.utils.InputError, naming the file, and never ends the process. cli.main prints Error: <message> and exits 2; exit 1 stays the verdict of a gate. tests/test_import_architecture.py allows 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 of trace prefilter, skill novelty ground --header and --shared-lib). It matches as glob.glob(pattern, recursive=True) does, sorted, but a directory the pattern has to list and cannot raises its OSError where glob skips it; the commands turn that into an InputError.
  • 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: LiteLLMAdapter in production, FakeAdapter in tests (the fake_llm fixture). ask_parsed is the redraw-until-it-parses loop. llm_call, chat_completion, the judge, the persona and question generators and the question validator go through LLM and its one provider table (resolve_model, credential_env_var). dokimi/llm_cli.py serves the CLI providers (claude-cli): LiteLLMAdapter hands their requests to it, and it runs the logged-in CLI through process.run (subscription-backends.md). dokimi/llm_json.py holds the JSON extraction helpers llm.py re-exports.
  • dokimi/caching.py — the two caches that hang off llm.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 in metrics/ 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 from products.yaml; powers cli.py catalog list|show --kind product and cli.py benchmark.
  • dokimi/intents.py — intent registry loaded from intents.yaml: the problem/intent space mapping domains (data science, debugging, optimization, …) to the products that serve them. Consistency with products.yaml is enforced by python -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:

  1. 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_check validates benchmarks/spec.v1.yaml; config_check checks products.yaml/intents.yaml/ dokimi/config/products.yaml drift. The guidance self-scan (L0) step runs repo scan as a gate (--fail-on fail).
  2. mypy — type check of the whole package.
  3. 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 to main, scheduled and manually dispatched runs cover the full supported Python matrix.
  4. 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:

  1. external-catalog-smoke — clones a pinned external content catalog, runs catalog check over it, then drives one of its real tasks through the docker-oracle harness (build + solve + verify, with the task's own network_mode, bridge for this public task) and the docker-probe isolation 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.
  2. benchmark — runs the static agent-quality benchmark with --strict, so a gate or band failure fails the job, and uploads current.json / current.md artifacts.

docs.yml — the documentation site:

  1. build — mkdocs build --strict of mkdocs.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 to main, deploy publishes the build to GitHub Pages.