Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
checks `tests/outcomes/`, including enforced journey criteria that require
passing `cjm-*` evidence. See [CONTRIBUTING.md](dokimi/CONTRIBUTING.md).

Use `dokimi scan choice --help` for training-only and web-search visibility scans.

## Before changing a subsystem, read its doc

- Any module, or where new code goes: `dokimi/docs/architecture.md`.
Expand Down Expand Up @@ -117,9 +119,9 @@

## What goes in the tree

- Runs write to git-ignored output dirs under `dokimi/`: `results/`,

Check notice on line 122 in AGENTS.md

View workflow job for this annotation

GitHub Actions / self / repo scan

repo scan unresolved

AGENTS.md: path: `results/`: tried results
`reports/`, `answers/`, `eval/` (not the `dokimi/dokimi/eval/` package),

Check notice on line 123 in AGENTS.md

View workflow job for this annotation

GitHub Actions / self / repo scan

repo scan unresolved

AGENTS.md: path: `answers/`: tried answers

Check notice on line 123 in AGENTS.md

View workflow job for this annotation

GitHub Actions / self / repo scan

repo scan unresolved

AGENTS.md: path: `reports/`: tried reports
`baselines/`. Logs, coverage files and tarballs stay local too.

Check notice on line 124 in AGENTS.md

View workflow job for this annotation

GitHub Actions / self / repo scan

repo scan unresolved

AGENTS.md: path: `baselines/`: tried baselines
- `dokimi/data/` holds only the fixtures this repo's own tests and
examples read: `data/skills/fastcontext/`, `data/agent_profiles/`,
`data/explore_tasks/`. The other skills there, `data/skills/dokimi-design-evals/`
Expand Down Expand Up @@ -151,7 +153,7 @@
`gh repo fork --remote --remote-name fork`, then `git push -u fork <branch>`
and `gh pr create -R intel/dokimi --base main --head <you>:<branch>`. Push
branches only to the fork, even with write access to `intel/dokimi` (bot
branches, `dependabot/*` and `renovate/*`, are the exception).

Check notice on line 156 in AGENTS.md

View workflow job for this annotation

GitHub Actions / self / repo scan

repo scan unresolved

AGENTS.md: path: `dependabot/*`: glob dependabot/* matches nothing in the tree; a build may create it
- 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.

Expand All @@ -159,7 +161,7 @@

Review your diff against [REVIEW.md](REVIEW.md). For the commands below, set
`base_ref` to the upstream `main` ref named by `make ci-local`, for example
`intel/main` or `origin/main`.

Check notice on line 164 in AGENTS.md

View workflow job for this annotation

GitHub Actions / self / repo scan

repo scan unresolved

AGENTS.md: path: `origin/main`: tried origin/main

Check notice on line 164 in AGENTS.md

View workflow job for this annotation

GitHub Actions / self / repo scan

repo scan unresolved

AGENTS.md: path: `intel/main`: tried intel/main

- 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.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Then follow [reviewing a skill or repository](dokimi/docs/reviewing.md) for the

For scored coding-agent sessions and offline pilot replay, use `dokimi agent run` and `dokimi agent replay`. Use `dokimi eval check --controls` to verify the correct and look-alike wrong solutions. See [AI-Ready coding-agent tests](dokimi/docs/coding-harnesses.md#ai-ready-coding-agent-test).

For AI recommendation scans and offline Choice replay, see [AI-Ready visibility scans](dokimi/docs/start/experiments.md#ai-ready-visibility-scans).

## Read the evidence

A skill can teach something new without improving a task, and an instruction can exist without being loaded. Dokimi separates these questions. Knowledge novelty suggests edits to test; it does not mean familiar content is safe to delete. Grader controls help expose blind spots; they do not prove a verifier is infallible.
Expand Down
8 changes: 8 additions & 0 deletions dokimi/changelog.d/20261124_050000_choice-scan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!--
Copyright (C) 2026 Intel Corporation
SPDX-License-Identifier: Apache-2.0
-->

### Added

- Scan training-only and web-assisted model recommendations with the AI-Ready Choice rubric, or replay the November pilot offline.
45 changes: 44 additions & 1 deletion dokimi/docs/reference/cli-interface.json
Original file line number Diff line number Diff line change
Expand Up @@ -1869,7 +1869,7 @@
"params": [
{"key": "--help/-h", "action": "_HelpAction", "choices": null, "const": null, "default": "==SUPPRESS==", "group_key": null, "group_required": null, "hidden": false, "is_flag": true, "kind": "option", "nargs": 0, "position": null, "required": false, "type": null},
{"key": "--json", "action": "_StoreTrueAction", "choices": null, "const": true, "default": false, "group_key": null, "group_required": null, "hidden": false, "is_flag": true, "kind": "option", "nargs": 0, "position": null, "required": false, "type": null},
{"key": "--kind", "action": "_AppendAction", "choices": ["'agent_run'", "'answer_key'", "'answers'", "'arms'", "'arms_reps'", "'baseline_manifest'", "'catalog_eval'", "'checklist'", "'cli_routes'", "'cross_judge'", "'dashboard'", "'delivery'", "'docling_sources'", "'docs_run'", "'dokimi_config'", "'effective_instructions'", "'eval'", "'eval_controls'", "'eval_coverage'", "'explore_runs'", "'grounding'", "'guidance_reach'", "'headroom'", "'judge_validity'", "'judge_wording'", "'leak'", "'matrix_rollup'", "'need_graph'", "'novelty'", "'novelty_atoms'", "'novelty_retest'", "'opportunities'", "'pairwise'", "'persona_analysis'", "'personas'", "'plan'", "'plugin_delta'", "'question_panel'", "'question_quality'", "'questions'", "'ragas'", "'reach_matrix'", "'redteam'", "'repo_budget'", "'repo_environment'", "'repo_hits_judged'", "'repo_ledger'", "'repo_readiness'", "'report_qa'", "'report_summary'", "'result'", "'run'", "'run_context'", "'security_report'", "'skill_coverage'", "'skill_discovery'", "'skill_evidence'", "'subject_scorecard'", "'task_inspect'", "'task_runs'", "'tool_preference'"], "const": null, "default": null, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null},
{"key": "--kind", "action": "_AppendAction", "choices": ["'agent_run'", "'answer_key'", "'answers'", "'arms'", "'arms_reps'", "'baseline_manifest'", "'catalog_eval'", "'checklist'", "'choice_scan'", "'cli_routes'", "'cross_judge'", "'dashboard'", "'delivery'", "'docling_sources'", "'docs_run'", "'dokimi_config'", "'effective_instructions'", "'eval'", "'eval_controls'", "'eval_coverage'", "'explore_runs'", "'grounding'", "'guidance_reach'", "'headroom'", "'judge_validity'", "'judge_wording'", "'leak'", "'matrix_rollup'", "'need_graph'", "'novelty'", "'novelty_atoms'", "'novelty_retest'", "'opportunities'", "'pairwise'", "'persona_analysis'", "'personas'", "'plan'", "'plugin_delta'", "'question_panel'", "'question_quality'", "'questions'", "'ragas'", "'reach_matrix'", "'redteam'", "'repo_budget'", "'repo_environment'", "'repo_hits_judged'", "'repo_ledger'", "'repo_readiness'", "'report_qa'", "'report_summary'", "'result'", "'run'", "'run_context'", "'security_report'", "'skill_coverage'", "'skill_discovery'", "'skill_evidence'", "'subject_scorecard'", "'task_inspect'", "'task_runs'", "'tool_preference'"], "const": null, "default": null, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null},
{"key": "--subject", "action": "_StoreAction", "choices": null, "const": null, "default": null, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}
],
"path": "dokimi runs list",
Expand Down Expand Up @@ -1901,6 +1901,49 @@
}
}
},
"scan": {
"allow_abbrev": true,
"params": [
{"key": "--help/-h", "action": "_HelpAction", "choices": null, "const": null, "default": "==SUPPRESS==", "group_key": null, "group_required": null, "hidden": false, "is_flag": true, "kind": "option", "nargs": 0, "position": null, "required": false, "type": null}
],
"path": "dokimi scan",
"subcommand_required": true,
"subcommands": {
"choice": {
"allow_abbrev": true,
"params": [
{"key": "--answer-key", "action": "_StoreAction", "choices": null, "const": null, "default": null, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": true, "type": "pathlib._local.Path#661d9498960e"},
{"key": "--help/-h", "action": "_HelpAction", "choices": null, "const": null, "default": "==SUPPRESS==", "group_key": null, "group_required": null, "hidden": false, "is_flag": true, "kind": "option", "nargs": 0, "position": null, "required": false, "type": null},
{"key": "--human-sample", "action": "_StoreAction", "choices": null, "const": null, "default": 10, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": "dokimi.cli_types.positive_int#96184e0d3f3b"},
{"key": "--json", "action": "_StoreTrueAction", "choices": null, "const": true, "default": false, "group_key": null, "group_required": null, "hidden": false, "is_flag": true, "kind": "option", "nargs": 0, "position": null, "required": false, "type": null},
{"key": "--judge", "action": "_StoreAction", "choices": null, "const": null, "default": null, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": true, "type": "dokimi.commands.scan_choice.register.<locals>.<lambda>#bfb42946c0ab"},
{"key": "--mode", "action": "_AppendAction", "choices": ["'training'", "'web'"], "const": null, "default": null, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null},
{"key": "--model", "action": "_AppendAction", "choices": null, "const": null, "default": null, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": true, "type": "dokimi.commands.scan_choice.register.<locals>.<lambda>#323b00e620e9"},
{"key": "--notes", "action": "_StoreAction", "choices": null, "const": null, "default": null, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": "pathlib._local.Path#661d9498960e"},
{"key": "--out", "action": "_StoreAction", "choices": null, "const": null, "default": null, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": "pathlib._local.Path#661d9498960e"},
{"key": "--reps", "action": "_StoreAction", "choices": null, "const": null, "default": 3, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": "dokimi.cli_types.positive_int#96184e0d3f3b"},
{"key": "--web-key-env", "action": "_StoreAction", "choices": null, "const": null, "default": "OPENAI_API_KEY", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null},
{"key": "--web-route", "action": "_AppendAction", "choices": null, "const": null, "default": null, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": "dokimi.commands.scan_choice.register.<locals>.<lambda>#211d7995fecd"}
],
"path": "dokimi scan choice",
"subcommand_required": null,
"subcommands": {}
},
"replay": {
"allow_abbrev": true,
"params": [
{"key": "archive", "action": "_StoreAction", "choices": null, "const": null, "default": null, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "argument", "nargs": null, "position": 0, "required": true, "type": "pathlib._local.Path#661d9498960e"},
{"key": "--help/-h", "action": "_HelpAction", "choices": null, "const": null, "default": "==SUPPRESS==", "group_key": null, "group_required": null, "hidden": false, "is_flag": true, "kind": "option", "nargs": 0, "position": null, "required": false, "type": null},
{"key": "--json", "action": "_StoreTrueAction", "choices": null, "const": true, "default": false, "group_key": null, "group_required": null, "hidden": false, "is_flag": true, "kind": "option", "nargs": 0, "position": null, "required": false, "type": null},
{"key": "--out", "action": "_StoreAction", "choices": null, "const": null, "default": null, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": "pathlib._local.Path#661d9498960e"},
{"key": "--profile", "action": "_StoreAction", "choices": ["'sklearnex'", "'toolkit-manager'"], "const": null, "default": null, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": true, "type": null}
],
"path": "dokimi scan replay",
"subcommand_required": null,
"subcommands": {}
}
}
},
"skill": {
"allow_abbrev": true,
"params": [
Expand Down
38 changes: 38 additions & 0 deletions dokimi/docs/start/experiments.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,41 @@ Read [results and next steps](results.md) and [comparison statistics](../benchma
[Experiment features](../features/experiments.md) · [Grader checks](../features/judging.md) · [Methodology](../methodology.md)

[Coverage development](../development/README.md#coverage-and-relevance) · [Grading development](../development/README.md#grading-evidence)

## AI-Ready visibility scans

`dokimi scan choice` [paid] asks each versioned answer-key phrasing three
times per model by default. Training-only and web-search results are reported
independently. A web route must support the Responses API's `web_search` tool
and return its trace. Dokimi marks this mode `NOT RUN` for routes without it.
The judge must use a different provider/model pair from each answering model.

```bash
dokimi scan choice --answer-key answer-key.json --model openai/gpt-example \
--judge anthropic/claude-example --mode web \
--web-route openai=https://api.openai.com/v1/responses \
--out results/choice.json --json
```

Choice weights Recall 30%, Rank 20%, Current-Path 30% and No-Retired 20%.
Name the product aliases, competitors, and retired names in the key. The
judge measures the current path, whether the answer recommends the product
first, and whether it recommends retired items without a caveat. Current-Path
also checks any `expected_terms`. Put migration prompts under `migration` for
`CUDA`, `ROCm` and `Arm`. Migration prompts appear in the per-question report.
Product and component Choice use the core questions. Give each core or
migration question a unique ID.

The JSON records answers, citations, returned search-source order and
competitor mentions. Associate an answer-key `page` with a question to check
whether it is both among the first 10 sources returned and cited. The report
selects stable answer IDs for human review. Supply `--notes` with
`human_reviews` keyed by ID and a boolean Current-Path verdict to apply the
review. The same notes can supply `page_fixes` keyed by URL, `content_plans`
keyed by question ID, and `freshness` entries for Context7 and DeepWiki with
`updated` dates and source `record` URLs.

Exit 0 means the requested modes have usable results, 2 means invalid input,
and 3 means a requested mode is inconclusive or was not run. `dokimi scan replay`
[free] recalculates the November pilot using its historical Choice rules.
Run `pytest tests/test_choice_scan.py` after changing the scan or its grading.
1 change: 1 addition & 0 deletions dokimi/dokimi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- [`memory`][dokimi.memory] reads an agent's memory store and lints it.
- [`runs`][dokimi.runs] lists what the runs wrote: the artifacts under the runs
root (`results/`, or `DOKIMI_RUNS_DIR`).
- [`scorecard`][dokimi.scorecard] measures evidence for the AI-Ready checklist.
- Content novelty: [`novelty`][dokimi.novelty]. Repositories as subjects:
[`repos`][dokimi.repos]. Subject scorecards, one per run:
[`subjects`][dokimi.subjects].
Expand Down
1 change: 1 addition & 0 deletions dokimi/dokimi/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"agent_run": "agent_run.v1",
"eval_controls": "eval_controls.v1",
"answer_key": "answer_key.v1",
"choice_scan": "choice_scan.v1",
"explore_runs": "explore_runs.v1",
"guidance_reach": "guidance_reach.v1",
"skill_discovery": "skill_discovery.v1",
Expand Down
2 changes: 2 additions & 0 deletions dokimi/dokimi/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
report,
run,
runs,
scan_choice,
skill,
subjects,
tasks,
Expand Down Expand Up @@ -306,6 +307,7 @@ def build_parser() -> argparse.ArgumentParser:
catalog.register(sub, positive_int, eval_sub) # catalog; eval triggers generate; catalog intents
explore.register(sub, positive_int) # explore (ExploreBench)
skill.register(sub, positive_int) # skill: novelty, shorten (#94 M2)
scan_choice.register(sub, positive_int)
repo.register(sub, positive_int, eval_sub) # repo; eval check
tools.register(sub, positive_int) # tools (tool-choice probes)
memory.register(sub, positive_int) # memory: lint (#728)
Expand Down
11 changes: 11 additions & 0 deletions dokimi/dokimi/cli_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@
Flag("--group", "GROUP", "choice", meaning="the checklist Usage group of proposed tasks"),
),
),
Concept(
name="visibility",
help="AI-Ready visibility inputs, web search routes and human sample",
canonical=(
Flag("--answer-key", "PATH", "path"),
Flag("--web-route", "PROVIDER=URL", repeatable=True),

Check warning on line 111 in dokimi/dokimi/cli_flags.py

View workflow job for this annotation

GitHub Actions / Mutation of changed lines

mutant inconclusive: a candidate test file for it did not run
Flag("--web-key-env", "ENV_VAR"),
Flag("--human-sample", "N", "int"),
Flag("--notes", "PATH", "path"),
),
),
Concept(
name="role_models",
help="the model a role runs on: judge, extractor, escalation, fill, RAGAS",
Expand Down
3 changes: 3 additions & 0 deletions dokimi/dokimi/cli_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class Tombstone:
Root("docs", "Subjects"),
Root("skill", "Subjects"),
Root("repo", "Subjects"),
Root("scan", "Subjects"),
Root("memory", "Subjects"),
Root("eval", "Evals"),
Root("tools", "Analysis and data"),
Expand Down Expand Up @@ -150,6 +151,8 @@ class Tombstone:
Leaf(("catalog", "routing-compare"), FREE),
Leaf(("catalog", "repair-receipt"), FREE),
Leaf(("repo", "scan"), FREE),
Leaf(("scan", "choice"), PAID),
Leaf(("scan", "replay"), FREE),
Leaf(("repo", "inspect"), FREE),
Leaf(("repo", "fetch"), FREE),
Leaf(("repo", "reach"), PAID),
Expand Down
27 changes: 27 additions & 0 deletions dokimi/dokimi/commands/_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
from __future__ import annotations

import contextlib
import errno
import os
import sys
from pathlib import Path

from dokimi.artifacts import ArtifactValidationError
from dokimi.atomic_write import write_bytes_in_place_or_atomic
from dokimi.exit_codes import EXIT_FAILURE, EXIT_USAGE
from dokimi.files import InputError
from dokimi.process_io import text_file_bytes


Expand Down Expand Up @@ -73,3 +76,27 @@
where ``Path.write_text`` raises ``UnicodeEncodeError``; other text is written byte for byte as it does.
"""
write_bytes_in_place_or_atomic(path, text_file_bytes(text))


def check_artifact_output(path: str) -> None:
"""Exit 2 before any probe call when a save to ``path`` would fail, probed with a temp file that is removed."""
from dokimi.artifacts import _write_target
from dokimi.atomic_write import publishes_by_rename, tmp_sibling

target = Path(path)
try:
target.parent.mkdir(parents=True, exist_ok=True)

Check warning on line 88 in dokimi/dokimi/commands/_output.py

View workflow job for this annotation

GitHub Actions / Mutation of changed lines

mutant inconclusive: a candidate test file for it did not run
resolved = _write_target(target)
if resolved.is_dir():
raise IsADirectoryError(errno.EISDIR, "Is a directory", path)
if not publishes_by_rename(resolved, replace_read_only=True):
# The save writes this file in place, as it writes a file in a read-only directory: the file must take a write.
if not os.access(resolved, os.W_OK):
raise PermissionError(errno.EACCES, "Permission denied", path)
return
tmp = tmp_sibling(resolved) # the save's tmp name
with tmp.open("xb"):
pass
tmp.unlink()

Check warning on line 100 in dokimi/dokimi/commands/_output.py

View workflow job for this annotation

GitHub Actions / Mutation of changed lines

mutant inconclusive: a candidate test file for it did not run
except (OSError, ValueError) as exc:
raise InputError(f"cannot write {path}: {exc}") from exc
Loading
Loading