This repo is dokimi, A/B testing for agent context: it measures whether documentation, a
skill, an MCP doc source, or an agent persona prompt improves a coding agent's
answers and task outcomes. The content it measures (skills, executable tasks,
golden question sets) lives in content repositories and is passed in by path:
skill:<path>, --tasks-root, --questions.
All code, tests and CI live in the dokimi/ project directory; run commands
from there. The importable package is dokimi (dokimi/dokimi/); the CLI is
python cli.py --help.
make dev # once, repo root: .venv with CI's Python, the lock, every CI tool
make ci-local # every PR CI step, read from .github/workflows/; pass/fail/skip table
make ci-local CI_LOCAL_ARGS='--offline --jobs static,typecheck' # fast inner loopA change is ready for a PR when no row of the make ci-local table is FAIL.
ci-local diffs against the remote whose URL is intel/dokimi, whatever it is
called (CI_LOCAL_ARGS='--remote <name>' overrides). The full pytest run takes
2–3 minutes, longer than a default 2-minute command timeout: give it a 10-minute
timeout, and run the test files you touched first. Beyond lint and tests, CI
also holds a PR to:
- 80% coverage of changed lines (when 20+ are measurable): add tests with the change.
- mypy on the whole package, no module exempt: fix a type error rather than
adding an
ignore_errorsoverride topyproject.toml. - Imports follow the layers in
dokimi/tests/test_import_architecture.py: no upward import, no new cycle, LLM SDKs only indokimi.llm, spawns only indokimi.process. Its baselines only shrink. - No growth: a file over 800 lines (tests 1000) or a function over complexity 10
fails unless
scripts/growth_baseline.jsonholds it, and then it may only shrink. Split instead; after shrinking,python scripts/check_growth.py --update. - No new clones: a block of 40+ AST nodes copied elsewhere in
dokimi/,scripts/orcli.py(locals renamed or not) failsscripts/check_duplicates.pyunlessscripts/duplicates_baseline.jsonholds it. Extract the shared code instead. - Tests that check behaviour:
tests/test_audit_test_quality.pyfails a test that only checks types, echoes its input, only checks a mock was called, asserts nothing or repeats another (python scripts/audit_test_quality.pylists them). - No silent test narrowing (
scripts/check_test_narrowing.py): removing a test, dropping a check, adding skip/xfail, droppingmatch=or wideningpytest.raises, loosening a tolerance or cuttingparametrizecases fails unless a commit message or a comment in the test saysTest-narrowed: <reason>. So does a skip at the top of a module, and acollect_ignore*orpytest_ignore_collectaconftest.pygains (waived by a commit line). - Docs that name a command, flag, path or module must match the tree
(
tests/test_docs_code_refs.py): rename in code, rename in docs. - Tests run offline: a connection off loopback fails the test, so mock LLM and network calls.
- Tests wait on a condition, not on time: a test that waits for a thread, process
or timer uses
tests/waiting.py, nevertime.sleeporthreading.Timer.scripts/check_test_timing.pyfails a new one unless its baseline holds it (it only shrinks) or the line says# timing-ok: <reason>. A complexity test counts work or usestests/growth_timing.py, never an elapsed-time assertion. - Comments of at most two lines (
scripts/check_comment_blocks.py): say the constraint or the reason, and end with an issue or PR URL when a reader needs the backstory. A block of three or more#lines fails once the PR adds or edits a line in it, so shorten an old block when you touch it. - No silent
except(ruff BLE001, S110, S112): catch the exception you expect, or log it with its traceback, or re-raise. A site that must catch everything says what happens to the failure in# noqa: BLE001 - <reason>(tests/test_noqa_reasons.pyfails a bare code). - User outcomes (
tests/outcomes/*.json, checked bypytest --outcomes): a test marked@pytest.mark.outcome(...)is evidence for a promise in the docs; weaken or drop it only together with the doc and the contract. The same session checks the journey trace (tests/outcomes/journeys.yamlagainstdocs/user-journeys/journeys.md) and writesjourneys-result.json; removing a markedcjm-*test fails it, even whenoutcomes-result.jsonsays pass, if the criterion it evidences hasenforce: true.
- Any module, or where new code goes:
dokimi/docs/architecture.md. - A static metric:
dokimi/docs/contributing-metric.md. - A doc source:
dokimi/docs/adding-doc-source.md. - Repository evaluation (
dokimi/dokimi/repos/,cli.py repo …):dokimi/docs/repo-evaluation-contract.md. - Skill novelty (
dokimi/dokimi/novelty/,cli.py novelty …):dokimi/docs/skill-novelty.md. - Executable tasks (Docker + oracle solution + pytest verifier) or harnesses:
dokimi/docs/contributing-terminal-bench-task.md. Tasks live in a content repository; the framework reads a checkout via--tasks-root. - Anything else: the index,
dokimi/docs/documentation-index.md. A new page at any depth underdokimi/docs/goes in that index (dokimi/tests/test_docs_links.pychecks it) and in thenav:ofdokimi/mkdocs.yml, the published site.
Registries, bundled in the package (dokimi/dokimi/) so they ship in the wheel:
dokimi/dokimi/products.yaml: product identity and doc sources.dokimi/dokimi/intents.yaml: problem/intent domains, and the only domain→product mapping.dokimi/dokimi/config/products.yaml: LLM/runtime config for the eval track; its product identity followsproducts.yaml(config_checkfails on drift).
- Every artifact format is a versioned JSON Schema in
dokimi/dokimi/schemas/(<kind>.vN.json). Edit a version in place only to widen it. A change that would reject an artifact already written under it is a new version: add<kind>.v<N+1>.json, pointartifacts.SCHEMA_VERSIONSat it, list the old one inSUPERSEDED_VERSIONS. CI'sschema_compatstep (ci.yml,static) checks this against the PR base. - Answer and eval JSON name the two answer conditions
with_docsandwithout_docs, and every stored run uses them: writers, readers, schemas and data files keep those keys. Text people read (report headings, console output) may label the conditions however it reads best. - Code that reads answers, eval or arms records goes through
dokimi/dokimi/records.py(read/load/records), not.get("with_docs")on the dict: it is the one place that knows the keys the writers write.dokimi/tests/test_records_guard.pyfails a new such read and lists the exceptions, which only shrink.
- Runs write to git-ignored output dirs under
dokimi/:results/,reports/,answers/,eval/(not thedokimi/dokimi/eval/package),baselines/. Logs, coverage files and tarballs stay local too. dokimi/data/holds only the fixtures this repo's own tests and examples read:data/skills/fastcontext/,data/agent_profiles/,data/explore_tasks/. The one other skill there,data/skills/dokimi-design-evals/, is guidance for using dokimi itself, not a product skill; its links and commands are checked bytests/test_bundled_skills.py. Question sets, product skills and tasks belong in their content repository.- A file the package reads at run time goes inside
dokimi/dokimi/and into[tool.setuptools.package-data], or the installed wheel goes without it. - Design rationale, status and plans go in the PR description or an issue;
the tree has no ADRs or status reports. The one exception is the research
register,
dokimi/research/records/: one record per idea, experiment, finding, decision or implementation link, negative results included (dokimi/docs/research-register.md). - A new file starts with the SPDX header (
Copyright (C) <year> Intel Corporation/SPDX-License-Identifier: Apache-2.0) in its comment syntax. CI's license header step (static job) checks it andmake ci-localdoes not: exemptions and the local command are indokimi/CONTRIBUTING.md.
- Commit with
git commit -s: the repo is public and takes DCO sign-off (CONTRIBUTING.mdat the root). - A PR that changes
dokimi/dokimi/,dokimi/data/or the[project](barproject.version) /[tool.setuptools]tables ofdokimi/pyproject.tomladds a changelog fragment underdokimi/changelog.d/(scriv create), never an edit toCHANGELOG.md; theFragment for package changesstep inci.yml'sstaticjob enforces it. Versioning and releases:dokimi/docs/releasing.md. - Every change to
mainis a PR opened from a fork, based onmain. Add the fork as its own remote sooriginkeeps pointing atintel/dokimi:gh repo fork --remote --remote-name fork, thengit push -u fork <branch>andgh pr create -R intel/dokimi --base main --head <you>:<branch>. Push branches only to the fork, even with write access tointel/dokimi(bot branches,dependabot/*andrenovate/*, are the exception). - When a change depends on an open PR, wait for it to merge or put both in one PR; PRs are not stacked on each other's branches.
Review it yourself the way REVIEW.md asks a reviewer to, so the first round
finds little:
- For each test of changed behaviour, break the code it covers (flip a
condition, drop a branch), confirm the test fails, then revert the break.
CI's
Mutation of changed linesjob (dokimi/scripts/mutate_changed.py) does this for the package lines a PR changes, up to 40 mutants, and lists each surviving mutant in its step summary. A survivor whose module has a candidate test file that did not run isinconclusive, not a gap. It warns, it does not fail: kill a survivor with an assertion, or say in the description why it is equivalent. Run it locally withpython scripts/mutate_changed.py --base origin/mainfromdokimi/. - For a bug fix, find every other site with the same bug class. Fix the ones within this PR's scope; list the rest in the description or an issue.
- Where it applies, run the changed command on a bad input: missing file,
empty file, wrong shape,
Nonewhere a value is expected, a Windows path. Say in the description what you could not run. - Trace new error paths and tests to the contract: a new
raise,sys.exitor refusal names, in its message, docstring or the PR, the doc, contract or issue that asks for it; a test of new behaviour cites the doc line it checks.python scripts/list_new_error_paths.py --base origin/main(fromdokimi/) lists the sites of araise, asys.exitorSystemExitcall, or a literalexit_code=N; refusals throughparser.errororreturn Nare not listed. - An unclear requirement goes in the PR description's "Open questions", not into code that guesses: no error path or test the spec cannot be quoted for.
- Check that the PR title, description, docstrings and changelog fragment say what the code does (exit codes especially).
- Re-review your own fix commits during review with the same care.