diff --git a/dokimi/README.md b/dokimi/README.md index c6da170d2..415209c0c 100644 --- a/dokimi/README.md +++ b/dokimi/README.md @@ -226,7 +226,7 @@ For fair multi-model comparisons, generate one question set and reuse it: ```bash python cli.py benchmark run --target onedal --out-dir results/onedal_seed python cli.py benchmark run --target onedal --questions-from results/onedal_seed --model gpt-6-astra -python cli.py benchmark run --target onedal --questions-from results/onedal_seed --model claude-opus-5-5 --provider anthropic +python cli.py benchmark run --target onedal --questions-from results/onedal_seed --model anthropic/claude-opus-5-5 ``` Generated artifacts — answer runs, judge scores and benchmark snapshots — go under `results/`, `reports/`, `answers/`, `eval/` or `baselines/`; those paths are git-ignored and no captured run is committed. Curated, version-controlled *inputs* live under `data/` (`data/skills/fastcontext/`, `data/agent_profiles/`, `data/explore_tasks/`) — see [`data/README.md`](https://github.com/intel/dokimi/blob/main/dokimi/data/README.md). Product skills, question sets and personas are evaluation content: they come from a separate content repository and are passed in by path (`skill:`, `--questions `, `--questions-root `). diff --git a/dokimi/changelog.d/20261112_120000_vlad-perevezentsev_llm-off-table-provider-key.md b/dokimi/changelog.d/20261112_120000_vlad-perevezentsev_llm-off-table-provider-key.md index 131d5b23d..f8e0d82f0 100644 --- a/dokimi/changelog.d/20261112_120000_vlad-perevezentsev_llm-off-table-provider-key.md +++ b/dokimi/changelog.d/20261112_120000_vlad-perevezentsev_llm-off-table-provider-key.md @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 - **A provider outside dokimi's key table is no longer sent `OPENAI_API_KEY`** — a litellm route such as `azure` or `mistral` was sent the OpenAI key from `eval score panel --judge-configs`, - `eval triggers generate --rewrite --provider`, an `LLM` built directly and a `QuestionValidator` + `eval triggers generate --rewrite --model`, an `LLM` built directly and a `QuestionValidator` from Python. Without an explicit `api_key` it now sends none, and litellm reads the vendor's own variable (`AZURE_API_KEY`, `MISTRAL_API_KEY`). `llm.credential_env_var` returns `None` for such a provider. `openai` and the other providers in `llm.PROVIDERS` are unchanged. diff --git a/dokimi/changelog.d/20261124_120000_napetrov_f1b-model-judge.md b/dokimi/changelog.d/20261124_120000_napetrov_f1b-model-judge.md new file mode 100644 index 000000000..a9a89206e --- /dev/null +++ b/dokimi/changelog.d/20261124_120000_napetrov_f1b-model-judge.md @@ -0,0 +1,24 @@ + + +### Changed + +- **Pass the model and its provider together as `--model PROVIDER/MODEL`.** + `--provider X --model M` becomes `--model X/M`. On commands that migrated their judge + flags, `--judge-provider X --judge-model M` becomes `--judge X/M`. `arms run`, + `arms matrix-run`, and `subjects run` keep the separate flags and the `--judge` switch. + Novelty commands keep the separate flags as an alternative to `--judge PROVIDER/MODEL` + panel entries. `--extract-model` takes `PROVIDER/MODEL` too (`--extract-provider` is gone), + and `eval judge agreement --judges a,b` becomes `--judge a --judge b`. A bare model still + uses the command's default provider. Moved flag spellings print migration guidance and exit 2. + With an explicit OpenRouter judge, a qualified `--extract-model anthropic/MODEL` now selects + Anthropic and prints a warning. Use `--extract-model openrouter/anthropic/MODEL` to keep + the OpenRouter endpoint. The same applies to an `openai/` extractor prefix. + For an OpenAI model value that already names an external LiteLLM route, such as + `deepseek/deepseek-chat`, migration guidance keeps that route as the model value. + On commands that default to another provider, the route stays the same and the + recorded provider can differ. Use `openai/deepseek/deepseek-chat` to select the + OpenAI-compatible endpoint explicitly. + Part of #94 (F1b). diff --git a/dokimi/docs/answer-formats.md b/dokimi/docs/answer-formats.md index 413985503..b91844128 100644 --- a/dokimi/docs/answer-formats.md +++ b/dokimi/docs/answer-formats.md @@ -22,7 +22,7 @@ against those checks. ```bash python cli.py eval import evals/born_first.jsonl --grader registry/evals/born-first.yaml -o q.json python cli.py answers generate --product born-first --questions q.json --doc-source none \ - --model claude-haiku-5-5 --provider amazon-bedrock --out answers.json + --model amazon-bedrock/claude-haiku-5-5 --out answers.json python cli.py eval score reference --answers answers.json --questions q.json -o eval.json ``` diff --git a/dokimi/docs/architecture.md b/dokimi/docs/architecture.md index 0fdf3961f..5b6f37d97 100644 --- a/dokimi/docs/architecture.md +++ b/dokimi/docs/architecture.md @@ -73,7 +73,7 @@ points up: | 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` | +| foundation | `__init__` (the `dokimi` package itself), `_version`, `artifacts`, `records`, `llm`, `llm_providers`, `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. diff --git a/dokimi/docs/benchmarking-and-comparison.md b/dokimi/docs/benchmarking-and-comparison.md index 0d08bb7bc..fc6412dc0 100644 --- a/dokimi/docs/benchmarking-and-comparison.md +++ b/dokimi/docs/benchmarking-and-comparison.md @@ -92,25 +92,26 @@ warning stays quiet on default flags; answering with `claude-sonnet-5-5` moves t novelty judge to `openai/gpt-6.1-sol`, and a judging run that answers with it on the default judge's provider is refused (see below). Escalation judges (`--escalate-model`) have no default; `claude-opus-5-5` ($4 / $20) is the -natural tie-break above the Sonnet judge. On `--provider amazon-bedrock` the bare +natural tie-break above the Sonnet judge. On `--model amazon-bedrock/...` or `--judge amazon-bedrock/...` the bare names `claude-sonnet-5-5`, `claude-opus-5-5` and `claude-haiku-5-5` resolve to the `us.anthropic.*` inference profiles of the same name; outside the US, set `ANTHROPIC_DEFAULT_SONNET_MODEL` (or `_OPUS_`/`_HAIKU_`) to the regional profile of the same model (`eu.anthropic.claude-sonnet-5-5`), or pass the full profile id or ARN. A variable naming another model is ignored for these names. The `novelty` judge no -longer follows `--provider`: with no judge flags it runs on `anthropic`, so a +longer follows `--model`: with no judge flags it runs on `anthropic`, so a Bedrock-only run passes `--judge-provider amazon-bedrock` (and `atoms`/`shorten` -`--provider amazon-bedrock`). `--judge-provider` alone takes the default judge that -runs on that provider, the same on every surface: `claude-sonnet-5-5` on `anthropic` -and `amazon-bedrock`, `opus` on `claude-cli` (`sonnet` when the answerer is `opus`), -`gpt-6.1-sol` on `openai`. When that judge is the model under measurement (`gpt-6.1-sol` -on `openai`, the default answer model) a judging run exits before its first answer -and asks for `--judge-model`; so does `--model claude-sonnet-5-5` with the default -`--judge-provider anthropic`. `eval score` and `eval judge` have no answerer and judge -with `gpt-6.1-sol` on `openai`. On any other provider (`google`, `google-vertex`, -`openrouter`) the run exits before the first call and asks for `--judge-model`. A -matrix (`arms matrix-run --matrix-cells`) has one judge for all its cells; a cell -whose model is that judge is warned about, not refused. +`--model amazon-bedrock/`). On `arms run`, `arms matrix-run` and `subjects run`, +`--judge-provider` alone takes the default judge that runs on that provider, the same +on every surface: `claude-sonnet-5-5` on `anthropic` and `amazon-bedrock`, `opus` on +`claude-cli` (`sonnet` when the answerer is `opus`), `gpt-6.1-sol` on `openai`. The +other commands name the judge as `--judge PROVIDER/MODEL`, model included. When that +judge is the model under measurement (`gpt-6.1-sol` on `openai`, the default answer +model) a judging run exits before its first answer and asks for a judge model; so does +`--model anthropic/claude-sonnet-5-5` with `--judge-provider anthropic`. `eval score` +and `eval judge` have no answerer and judge with `gpt-6.1-sol` on `openai`. On any +other provider (`google`, `google-vertex`, `openrouter`) the run exits before the first +call and asks for a judge model. A matrix (`arms matrix-run --matrix-cells`) has one +judge for all its cells; a cell whose model is that judge is warned about, not refused. **Defaults changed on 2026-10-13: results are not comparable with older baselines; re-baseline.** Before, `benchmark`/`answers`/`eval` answered with `gpt-5.5` and @@ -119,18 +120,21 @@ judged with `claude-sonnet-4-5-20250929`, while `arms`, `subjects`, `evaluate`, obsolete small OpenAI model. A score, delta or cost produced with default flags before that date is not comparable with one produced after: re-run the baseline (the same question set via `--questions-from`, the same arms) under the new defaults, or pin the old -models with `--model`/`--judge-model` to extend an old series. On the surfaces -that used the small model, a default-flag run now costs roughly 13-17x more per token. +models to extend the series. Use `--model PROVIDER/MODEL` for the answerer and +`--judge PROVIDER/MODEL` on commands with a qualified judge flag. For `arms run`, +`arms matrix-run`, and `subjects run`, enable judging with `--judge` and pin it +with `--judge-provider PROVIDER --judge-model MODEL`. Novelty supports the same +separate model and provider flags or a qualified `--judge PROVIDER/MODEL` panel entry. +On the surfaces that used the small model, a default-flag run now costs roughly +13-17x more per token. For registered libraries, prefer the one-command wrapper: ```bash python cli.py benchmark run \ --library onetbb \ - --model gpt-6.1-sol \ - --provider openai \ - --judge-model claude-sonnet-5-5 \ - --judge-provider anthropic \ + --model openai/gpt-6.1-sol \ + --judge anthropic/claude-sonnet-5-5 \ --out-dir results/onetbb_sol ``` @@ -158,8 +162,7 @@ For stability-sensitive claims, run the same configuration several times: python cli.py benchmark run \ --library onetbb \ --model gpt-6.1-sol \ - --judge-model claude-sonnet-5-5 \ - --judge-provider anthropic \ + --judge anthropic/claude-sonnet-5-5 \ --reps 3 \ --out-dir results/onetbb_sol ``` @@ -176,8 +179,7 @@ create or choose a seed run: python cli.py benchmark run \ --library onedal \ --model gpt-6.1-sol \ - --judge-model claude-sonnet-5-5 \ - --judge-provider anthropic \ + --judge anthropic/claude-sonnet-5-5 \ --out-dir results/onedal_seed ``` @@ -187,19 +189,15 @@ Then reuse that question set for each model: python cli.py benchmark run \ --library onedal \ --questions-from results/onedal_seed \ - --model gpt-6-astra \ - --provider openai \ - --judge-model claude-sonnet-5-5 \ - --judge-provider anthropic \ + --model openai/gpt-6-astra \ + --judge anthropic/claude-sonnet-5-5 \ --out-dir results/onedal_astra python cli.py benchmark run \ --library onedal \ --questions-from results/onedal_seed \ - --model claude-opus-5-5 \ - --provider anthropic \ - --judge-model claude-sonnet-5-5 \ - --judge-provider anthropic \ + --model anthropic/claude-opus-5-5 \ + --judge anthropic/claude-sonnet-5-5 \ --out-dir results/onedal_opus55 ``` @@ -233,16 +231,14 @@ python cli.py answers generate \ --product oneTBB \ --questions /questions/onetbb_golden.json \ --out results/onetbb_golden/answers/onetbb.json \ - --model gpt-6.1-sol \ - --provider openai \ + --model openai/gpt-6.1-sol \ --debug-retrieval python cli.py eval score pointwise \ --product oneTBB \ --answers results/onetbb_golden/answers/onetbb.json \ --out results/onetbb_golden/eval/onetbb.json \ - --judge-model claude-sonnet-5-5 \ - --judge-provider anthropic + --judge anthropic/claude-sonnet-5-5 python cli.py report eval \ --product oneTBB \ @@ -492,7 +488,7 @@ pinned, only measured: run the same configuration several times score panel` (every panel judge) and `evaluate` take the same flag and record it as `judge_temperature` in their output. So do `eval score pairwise` (and its escalation judge), `eval score checklist`, `eval judge wording`, `eval judge agreement` - (every `--judges` entry) and `eval judge validate --mode pairwise`; each + (every `--judge` entry) and `eval judge validate --mode pairwise`; each probes every judge model with the setting first, before any judgement: a judge the provider table refuses exits 2 with no call made, and a probe call that the judge rejects exits 1, as `arms run` does. @@ -584,7 +580,7 @@ pair, which counts as a miss, so lower it when the summary shows errors. ```bash python cli.py eval judge validate --answers run.json --sequential \ - --judge-provider amazon-bedrock --judge-model openai.gpt-oss-120b-1:0 \ + --judge amazon-bedrock/openai.gpt-oss-120b-1:0 \ --mode pairwise --out validity_pairwise.json ``` @@ -620,7 +616,7 @@ measures, and labels each arm `CONSISTENT ±`, `LEANING ±`, `JUDGE-DEPENDENT` o `NO DETECTABLE EFFECT`, on Holm-adjusted p over the measures that vote, or `NOT MEASURED` when no voting measure compared a single question (every call errored, or every judge was gated out); `--strict` exits 3 on that, and 4 on a `JUDGE-DEPENDENT` arm. A -`--judges` judge that leaves answers unscored prints how many and its first +A `--judge` that leaves answers unscored prints how many and its first error, which the report keeps under `unscored`; one that scored none of its answers exits 1 once the report is written, with or without `--strict`, as `eval score pairwise` does when every comparison fails (a run failure, not bad input). With @@ -633,9 +629,9 @@ the same context: a `--context stored` report for measures scored with material, a `--context none` report (or one without `context`) for the rest. A stored file whose scores all fell back to snippets counts as `none`; one that mixes stored and snippet scores counts as `mixed`, which no PASS validates (a FAIL still reaches it). Re-scoring resolves each arm's -context the way the arms run does, from the file's `judge_materials`, so a `--judges` +context the way the arms run does, from the file's `judge_materials`, so a `--judge` judge sees what the stored judge saw. A file written before `judge_materials` has -only the report snippets; with stored scores on such material, `--judges` refuses +only the report snippets; with stored scores on such material, `--judge` refuses (exit 2), and `--pairwise` or `--checklist` always do, since those judges see only the answers. `--no-stored` compares those judges with each other. The gate itself passes no context by default (`eval score pairwise` and `eval score checklist` never pass @@ -652,7 +648,7 @@ measured on another model's answers. ```bash python cli.py eval judge agreement --answers run.json --questions golden.json --grounded --both \ - --judges amazon-bedrock/us.anthropic.claude-haiku-5-5,amazon-bedrock/openai.gpt-oss-120b-1:0 \ + --judge amazon-bedrock/us.anthropic.claude-haiku-5-5 --judge amazon-bedrock/openai.gpt-oss-120b-1:0 \ --pairwise run_pairwise.json --validity validity_haiku.json --validity validity_pairwise.json ``` diff --git a/dokimi/docs/delivery.md b/dokimi/docs/delivery.md index 1bcda255b..43bc59096 100644 --- a/dokimi/docs/delivery.md +++ b/dokimi/docs/delivery.md @@ -30,7 +30,7 @@ python cli.py delivery report "$pack/scan.json" For a live one-turn Claude Code answer, install and authenticate the supported `claude-cli` provider, then run the following with a model ID available to your account. Record the CLI package version in the deployment lock. The CLI receives the instruction, starter project and source text with tools disabled. Dokimi executes its proposed shell consumer separately. OpenAI, Anthropic and Amazon Bedrock API providers also support this protocol. Each applicable scenario plans two model calls per repeat, one per arm. Live scans record reported usage after each call and have no CLI dollar cap. ```bash -python cli.py delivery scan --manifest "$pack/good.json" --corpus "$pack/corpus.json" --tasks "$pack/tasks.json" --provider claude-cli --model "$MODEL_ID" --out "$pack/live.json" --json +python cli.py delivery scan --manifest "$pack/good.json" --corpus "$pack/corpus.json" --tasks "$pack/tasks.json" --model "claude-cli/$MODEL_ID" --out "$pack/live.json" --json ``` ## Authoring the contract @@ -89,7 +89,7 @@ jobs: ax-scan: runs-on: [self-hosted, product-eval] steps: - - run: dokimi delivery scan --manifest "$PACK/rc.json" --tasks "$PACK/tasks.json" --corpus "$PACK/corpus.json" --provider claude-cli --model "$MODEL_ID" --out scan.json --json + - run: dokimi delivery scan --manifest "$PACK/rc.json" --tasks "$PACK/tasks.json" --corpus "$PACK/corpus.json" --model "claude-cli/$MODEL_ID" --out scan.json --json - uses: actions/upload-artifact@v4 if: always() with: {name: ax-scan, path: scan.json} diff --git a/dokimi/docs/documentation-index.md b/dokimi/docs/documentation-index.md index e241083de..7f2a76d27 100644 --- a/dokimi/docs/documentation-index.md +++ b/dokimi/docs/documentation-index.md @@ -102,7 +102,7 @@ The [feature tree](features/README.md) links to all 39 cards, grouped by the que - [answer-formats.md](answer-formats.md) — run Inspect AI, OpenAI evals, skill-creator and promptfoo answer-only sets on the answers track - [subscription-backends.md](subscription-backends.md) — run the Q&A track through a - logged-in coding-agent CLI (`--provider claude-cli`) instead of an API key + logged-in coding-agent CLI (`--model claude-cli/`) instead of an API key - [context-window.md](context-window.md) — read a run's context window from its Claude Code trace with `cli.py trace inspect`: start-up load, growth, compactions, tool-result weight. No LLM call. diff --git a/dokimi/docs/evaluating-treatments.md b/dokimi/docs/evaluating-treatments.md index 97166ea78..0347b5703 100644 --- a/dokimi/docs/evaluating-treatments.md +++ b/dokimi/docs/evaluating-treatments.md @@ -63,7 +63,7 @@ given `--judge`. For docs arms, the material is the retrieved chunks, rarely identical across questions, so each question adds its own copy (up to the 15,000-char cut); on a synthetic 20-question docs run the artifact grew from 93,209 to 392,852 bytes (4.2x). Sharing an arms artifact shares the skill or doc -text it contains. With `eval judge agreement --judges`, the judge is given the same text +text it contains. With `eval judge agreement` and a repeated `--judge`, the judge is given the same text through `JudgeContextStore.from_artifact`, which skips any text that does not match its digest. Question ids must be unique for this (a question with no id is given a positional one; duplicated ids are refused). @@ -754,8 +754,8 @@ python scripts/check_treatment_batch.py results/arms/persona-batch \ --judge-provider amazon-bedrock --judge-model global.anthropic.claude-sonnet-4-6 ``` -It checks schema, exactly two arms, the baseline arm, the treatment-arm pattern, a pinned -`--judge-model`/`--judge-provider`, that the judge is not the answering model +It checks schema, exactly two arms, the baseline arm, the treatment-arm pattern, a pinned judge +(`--judge-model` and `--judge-provider`), that the judge is not the answering model (self-judging), question and per-arm answer counts, and — for `profile:` arms — that the system prompt reached every treatment answer and no baseline answer. With `--profile` it compares each cell's stamped digest against the file's current text and reports diff --git a/dokimi/docs/how-evaluation-works.md b/dokimi/docs/how-evaluation-works.md index 45828bc43..f1913ed50 100644 --- a/dokimi/docs/how-evaluation-works.md +++ b/dokimi/docs/how-evaluation-works.md @@ -64,7 +64,7 @@ How an author uses it: ```bash python cli.py skill novelty analyze --artifact skill:path/to/skill \ - --model --judge-model \ + --model openai/gpt-6.1-sol --judge anthropic/claude-sonnet-5-5 \ --token-budgets 0.75 0.5 ``` diff --git a/dokimi/docs/judge-panel-study.md b/dokimi/docs/judge-panel-study.md index d34acca97..9db82a6a8 100644 --- a/dokimi/docs/judge-panel-study.md +++ b/dokimi/docs/judge-panel-study.md @@ -278,7 +278,7 @@ What exists: - **Mixed models, one per role.** `eval score panel --judge-configs role:model:provider,...` is the only place where one panel mixes models, and each model is tied to a role. - **Post-hoc judge robustness.** `eval judge agreement` (`commands/judge_reliability.py`, - `eval/cross_judge.py`) re-scores an answers file with `--judges provider/model,...`. It + `eval/cross_judge.py`) re-scores an answers file with `--judge provider/model --judge ...`. It computes each judge's per-arm delta as a separate measure with a sign test and Holm correction, and labels the arm `CONSISTENT`, `LEANING`, `JUDGE-DEPENDENT`, `NO DETECTABLE EFFECT` or `NOT MEASURED`. Judges that fail `--validity` do not vote. `--strict` makes @@ -307,7 +307,7 @@ What is missing (each item was needed to produce this note): ## 5. Proposal -The proposal for `--judges` and `--aggregate` on `arms run` was removed from this page: AGENTS.md +The proposal for a judge list and `--aggregate` on `arms run` was removed from this page: AGENTS.md keeps design plans out of the tree, so the text is not kept here. ## 6. Old and new judge generations diff --git a/dokimi/docs/knowledge-runs.md b/dokimi/docs/knowledge-runs.md index 9e3967c01..c025ed39e 100644 --- a/dokimi/docs/knowledge-runs.md +++ b/dokimi/docs/knowledge-runs.md @@ -34,7 +34,7 @@ repository guidance or a task's pass rate; for those see [coding-harnesses.md](c | A. plain answers file | `answers generate --doc-source none` | `answers.v1` with `without_docs` only | `eval score reference` (grading checks), `eval score pointwise` (judge) | | B. one-arm comparison | `arms run --arm baseline` | `arms.v1` with one arm, `baseline` | `--judge` on the run, or `eval score reference` on its output | -Both take `--model`/`--provider`, and both accept a CLI answerer (below). Use route B +Both take `--model PROVIDER/MODEL`, and both accept a CLI answerer (below). Use route B when the same run should later sit next to a `docs` or `skill:` arm: the arm file already has the shape `arms run` writes for a comparison. @@ -42,7 +42,7 @@ has the shape `arms run` writes for a comparison. ```bash python cli.py answers generate --product demo --questions questions/demo.json \ - --doc-source none --provider amazon-bedrock --model claude-haiku-5-5 \ + --doc-source none --model amazon-bedrock/claude-haiku-5-5 \ --out knowledge/demo-answers.json python cli.py eval score reference --answers knowledge/demo-answers.json \ --questions questions/demo.json -o knowledge/demo-eval.json --no-judge @@ -69,7 +69,7 @@ knowledge/demo-answers.json --out knowledge/demo-judged.json`. Its per-question ```bash python cli.py arms run --product demo --questions questions/demo.json \ - --arm baseline --provider amazon-bedrock --model claude-haiku-5-5 \ + --arm baseline --model amazon-bedrock/claude-haiku-5-5 \ --judge --judge-model claude-sonnet-5-5 --judge-provider amazon-bedrock \ --out knowledge/demo-arms.json --out-md knowledge/demo-arms.md ``` @@ -81,7 +81,7 @@ delta is `null`. Without `--judge` the run only answers, which is cheap, and ## Answering through an agent CLI -An answerer does not have to be an API. `--provider claude-cli` answers through the Claude +An answerer does not have to be an API. `--model claude-cli/` answers through the Claude Code CLI the machine is signed in to. The CLI runs with no tools, no settings files and no MCP servers, and the call's system prompt is the plain one dokimi sends. What the CLI still adds to each call is covered in [subscription-backends.md](subscription-backends.md), which @@ -89,9 +89,9 @@ also covers the login. It works on both routes: ```bash python cli.py answers generate --product demo --questions questions/demo.json \ - --doc-source none --provider claude-cli --model sonnet --out knowledge/demo-cli.json + --doc-source none --model claude-cli/sonnet --out knowledge/demo-cli.json python cli.py arms run --product demo --questions questions/demo.json --arm baseline \ - --provider claude-cli --model sonnet --out knowledge/demo-cli-arms.json + --model claude-cli/sonnet --out knowledge/demo-cli-arms.json ``` Two limits apply. `claude-cli` takes no temperature or seed, so `arms run` refuses either @@ -99,8 +99,8 @@ flag before it starts. An agentic arm (`agent:`, `skill-agent:`, `skill-catalog: refused on it too, because the CLI runs one prompt with no tools. A knowledge run has neither, so that refusal does not affect this page. -`--provider copilot-cli` answers through the GitHub Copilot CLI the same way, on both routes. -`--provider codex-cli` answers through the OpenAI Codex CLI on a comparison, but not on a +`--model copilot-cli/` answers through the GitHub Copilot CLI the same way, on both routes. +`--model codex-cli/` answers through the OpenAI Codex CLI on a comparison, but not on a knowledge run: Codex has no switch that turns its own tools off, so `--doc-source none` and `arms run --arm baseline` refuse it before any call (exit 2). Use `copilot-cli` or `claude-cli` for a knowledge run. Each CLI must be installed and signed in (`codex login`, or Copilot's own @@ -108,13 +108,13 @@ login). `python cli.py backends` lists what dokimi can see, with no model call: ```bash python cli.py answers generate --product demo --questions questions/demo.json \ - --doc-source none --provider copilot-cli --model claude-sonnet-4.5 --out knowledge/demo-copilot.json + --doc-source none --model copilot-cli/claude-sonnet-4.5 --out knowledge/demo-copilot.json ``` The model name is passed to the CLI as given; dokimi does not check it against the CLI's catalogue. Both are answering-only: no conversation. `copilot-cli` runs with no tools (`--available-tools __none__`). `codex-cli` has no switch for its tools, so it is refused on a knowledge -run. Pass `--judge-model` and `--judge-provider` for an API judge, as the judge runs on an API +run. Pass `--judge PROVIDER/MODEL` for an API judge (`--judge-model` and `--judge-provider` on `arms run`), as the judge runs on an API provider. See [subscription-backends.md](subscription-backends.md) for the login and the per-call costs. @@ -153,8 +153,8 @@ does for `claude-cli`. An agentic arm is refused on all three, for the same reas `command:*`, `terminal-bench:*`, `benchflow*` and `docker-*` name agent-CLI harnesses (`tasks run`, `repo run`; see [coding-harnesses.md](coding-harnesses.md)): they run an agent in a sandbox against executable tasks. `arms run --harness codex` is refused for that reason, because the -label would stamp answers that the model behind `--provider` produced. Use `--provider -codex-cli` (or `claude-cli`, `copilot-cli`) to answer through a CLI, or leave `--harness` out. +label would stamp answers that the model behind `--model` produced. Use `--model +codex-cli/` (or `claude-cli/`, `copilot-cli/`) to answer through a CLI, or leave `--harness` out. ## Questions with grading checks @@ -184,7 +184,7 @@ Route B's `--judge` needs no checks: the judge scores each answer on its own. keeps the paired report. On a binary knowledge run each question's diagnosis is `⚪ One condition (no delta)`, not insufficient data, and `eval score pointwise` gives the per-condition score the same way. - Keep the answerer fixed across the knowledge run and the with-docs run that follows: - the same `--provider`, `--model`, questions file and judge. A knowledge run made with + the same `--model` (provider included), questions file and judge. A knowledge run made with `arms run --arm baseline` sends the same prompt as the `baseline` arm of the comparison, so the two line up question by question. The answers are sampled again, so they will not match word for word. A knowledge run made with `answers generate --doc-source none` uses a @@ -192,7 +192,7 @@ Route B's `--judge` needs no checks: the judge scores each answer on its own. ```bash python cli.py arms run --product demo --questions questions/demo.json \ - --arm "baseline,docs" --provider amazon-bedrock --model claude-haiku-5-5 \ + --arm "baseline,docs" --model amazon-bedrock/claude-haiku-5-5 \ --judge --judge-model claude-sonnet-5-5 --judge-provider amazon-bedrock \ --out results/arms/demo-with-docs.json ``` diff --git a/dokimi/docs/methodology.md b/dokimi/docs/methodology.md index c4fb4dd97..46d95d164 100644 --- a/dokimi/docs/methodology.md +++ b/dokimi/docs/methodology.md @@ -50,8 +50,7 @@ Use `benchmark run` for registered libraries: python cli.py benchmark run \ --library onetbb \ --model gpt-6.1-sol \ - --judge-model claude-sonnet-5-5 \ - --judge-provider anthropic \ + --judge anthropic/claude-sonnet-5-5 \ --reps 3 ``` diff --git a/dokimi/docs/quickstart.md b/dokimi/docs/quickstart.md index 6ec142f31..12e743e5c 100644 --- a/dokimi/docs/quickstart.md +++ b/dokimi/docs/quickstart.md @@ -120,8 +120,7 @@ dokimi answers generate \ --product oneTBB \ --questions questions/oneTBB.json \ --out answers/oneTBB.json \ - --model gpt-6.1-sol \ - --provider openai \ + --model openai/gpt-6.1-sol \ --top-k 3 \ --rerank-threshold 0.3 \ --debug-retrieval @@ -139,8 +138,7 @@ dokimi eval score pointwise \ --product oneTBB \ --answers answers/oneTBB.json \ --out eval/oneTBB.json \ - --judge-model claude-sonnet-5-5 \ - --judge-provider anthropic + --judge anthropic/claude-sonnet-5-5 ``` LLM-as-judge scores each answer on five 0–100 dimensions @@ -197,7 +195,7 @@ dokimi eval personas discover --product $PRODUCT --repo $REPO --count 5 && \ dokimi eval personas validate --file personas/$PRODUCT.json && \ dokimi eval questions generate --product $PRODUCT --personas personas/$PRODUCT.json --validate && \ dokimi answers generate --product $PRODUCT --questions questions/$PRODUCT.json --model gpt-6.1-sol && \ -dokimi eval score pointwise --product $PRODUCT --answers answers/$PRODUCT.json --judge-model claude-sonnet-5-5 --judge-provider anthropic && \ +dokimi eval score pointwise --product $PRODUCT --answers answers/$PRODUCT.json --judge anthropic/claude-sonnet-5-5 && \ dokimi report generate --product $PRODUCT --eval eval/$PRODUCT.json --questions questions/$PRODUCT.json --out reports/$PRODUCT.md ``` @@ -281,7 +279,7 @@ the budget or an unpriced call stops them and they keep a partial file, and 1 wh nothing (`skill shorten`, and a stop that leaves no partial file: "nothing was written") or a permanent provider error stopped them (`catalog novelty` exits 1 too, once it has written its rows, when any skill it took on is `partial`, `error` or not run). -`eval judge agreement --judges` and `eval score pairwise` exit 1, not 2, when +`eval judge agreement` with a repeated `--judge` and `eval score pairwise` exit 1, not 2, when every judge call fails, a missing provider credential included. `trace inspect`, `trace consistency` and `trace prefilter` exit 2 when no trace or session reads. @@ -290,7 +288,7 @@ every judge call fails, a missing provider credential included. | Symptom | Fix | | --- | --- | -| LLM calls fail / wrong provider | All providers go through LiteLLM (`dokimi/llm.py`); set the matching `*_API_KEY` and pass `--provider`/`--model`. LangChain is used only by `eval score ragas`, which wraps its judge in `ChatOpenAI`/`ChatAnthropic`; it and ragas come with the `ragas` extra (`pip install 'dokimi[ragas]'`). | +| LLM calls fail / wrong provider | All providers go through LiteLLM (`dokimi/llm.py`); set the matching `*_API_KEY` and pass `--model PROVIDER/MODEL`. LangChain is used only by `eval score ragas`, which wraps its judge in `ChatOpenAI`/`ChatAnthropic`; it and ragas come with the `ragas` extra (`pip install 'dokimi[ragas]'`). | | `No module named numpy` | Pipeline falls back to exact-text dedup; install numpy for embedding-based dedup | | `GitHub client not available` | Pipeline uses `gh` CLI fallback; `pip install PyGithub` to silence | | Context7 timeout | Raise `context7.timeout` in `dokimi/config/products.yaml` (or in a config/products.yaml of your own in the working directory) | diff --git a/dokimi/docs/reference/cli-interface.json b/dokimi/docs/reference/cli-interface.json index 61dac17ee..805bd8e19 100644 --- a/dokimi/docs/reference/cli-interface.json +++ b/dokimi/docs/reference/cli-interface.json @@ -23,11 +23,10 @@ {"key": "--debug-retrieval", "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": "--doc-source", "action": "_StoreAction", "choices": null, "const": null, "default": "context7", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"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": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--name", "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}, {"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": null}, {"key": "--product", "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": null}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--questions", "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": null}, {"key": "--ragas", "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": "--ragas-model", "action": "_StoreAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, @@ -70,14 +69,13 @@ {"key": "--matrix-cells", "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": null}, {"key": "--max-iterations", "action": "_StoreAction", "choices": null, "const": null, "default": 6, "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": "--max-output-tokens", "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": "dokimi.cli_types.positive_int#96184e0d3f3b"}, - {"key": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--no-plugin-deltas", "action": "_StoreFalseAction", "choices": null, "const": false, "default": true, "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": null}, {"key": "--out-dir", "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}, {"key": "--out-md", "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}, {"key": "--plugins", "action": "_StoreAction", "choices": null, "const": null, "default": "", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--product", "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": null}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--questions", "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": null}, {"key": "--rerank-threshold", "action": "_StoreAction", "choices": null, "const": null, "default": 0.3, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": "float"}, {"key": "--seed", "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": "int"}, @@ -122,12 +120,11 @@ {"key": "--matrix-cells", "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}, {"key": "--max-iterations", "action": "_StoreAction", "choices": null, "const": null, "default": 6, "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": "--max-output-tokens", "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": "dokimi.cli_types.positive_int#96184e0d3f3b"}, - {"key": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "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": null}, {"key": "--out-md", "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}, {"key": "--plugins", "action": "_StoreAction", "choices": null, "const": null, "default": "", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--product", "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": null}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--questions", "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": null}, {"key": "--rerank-threshold", "action": "_StoreAction", "choices": null, "const": null, "default": 0.3, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": "float"}, {"key": "--seed", "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": "int"}, @@ -215,12 +212,10 @@ {"key": "--fail-fast", "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": "--force", "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": "--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": "--judge-model", "action": "_StoreAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, - {"key": "--judge-provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "anthropic", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--judge", "action": "ProviderModelAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--libraries", "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}, - {"key": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--out-dir", "action": "_StoreAction", "choices": null, "const": null, "default": "results", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--questions-root", "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}, {"key": "--registry", "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}, {"key": "--retrieval-tokens", "action": "_StoreAction", "choices": null, "const": null, "default": 4000, "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"} @@ -235,12 +230,10 @@ {"key": "--concurrency", "action": "_StoreAction", "choices": null, "const": null, "default": 5, "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": "--doc-source", "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}, {"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": "--judge-model", "action": "_StoreAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, - {"key": "--judge-provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "anthropic", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--judge", "action": "ProviderModelAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--library/--target", "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": null}, - {"key": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--out-dir", "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}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--questions-from", "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}, {"key": "--questions-root", "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}, {"key": "--registry", "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}, @@ -257,14 +250,12 @@ {"key": "--doc-source", "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}, {"key": "--force", "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": "--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": "--judge-model", "action": "_StoreAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--judge", "action": "ProviderModelAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--judge-placeholder", "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-provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "anthropic", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--judge-temperature", "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": "float"}, {"key": "--library/--target", "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": null}, - {"key": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--out-dir", "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}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--questions-from", "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}, {"key": "--questions-root", "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}, {"key": "--registry", "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}, @@ -370,8 +361,7 @@ {"key": "--cache-dir", "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}, {"key": "--concurrency", "action": "_StoreAction", "choices": null, "const": null, "default": 5, "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": "--context-framing", "action": "_StoreAction", "choices": ["'neutral'", "'reference'"], "const": null, "default": "reference", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, - {"key": "--extract-model", "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}, - {"key": "--extract-provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "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": "--extract-model", "action": "ProviderModelAction", "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}, {"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": "--include-resources", "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": "--jobs", "action": "_StoreAction", "choices": null, "const": null, "default": 1, "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"}, @@ -390,12 +380,11 @@ {"key": "--max-resource-words", "action": "_StoreAction", "choices": null, "const": null, "default": 20000, "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": "--max-usd", "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": "dokimi.cli_types.positive_usd#3f7e5c8902a3"}, {"key": "--max-usd-per-skill", "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": "dokimi.cli_types.positive_usd#3f7e5c8902a3"}, - {"key": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--no-paraphrase", "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": "--no-reversal", "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-dir", "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": null}, {"key": "--placebo-text", "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}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--rerun-changed", "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": "--resource-roles", "action": "_StoreAction", "choices": ["'data'", "'eval'", "'other'", "'pattern'", "'reference'", "'script'", "'template'", "'top'", "'trigger'"], "const": null, "default": null, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": "+", "position": null, "required": false, "type": null}, {"key": "--resume", "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}, @@ -449,9 +438,8 @@ {"key": "--keep-copies-under", "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}, {"key": "--max-output-tokens", "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": "dokimi.cli_types.positive_int#96184e0d3f3b"}, {"key": "--max-usd", "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": "dokimi.cli_types.positive_usd#3f7e5c8902a3"}, - {"key": "--model", "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}, + {"key": "--model", "action": "ProviderModelAction", "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}, {"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": null}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--queries", "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}, {"key": "--queries-by-skill", "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}, {"key": "--queries-from-headings", "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}, @@ -652,9 +640,8 @@ {"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": "--manifest", "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": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": null, "group_key": "--fixture|--model", "group_required": true, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": null, "group_key": "--fixture|--model", "group_required": true, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "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": true, "type": "pathlib._local.Path#661d9498960e"}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--tasks", "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"} ], "path": "dokimi delivery scan", @@ -840,8 +827,8 @@ {"key": "--concurrency", "action": "_StoreAction", "choices": null, "const": null, "default": 5, "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": "--grounded", "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": "--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": "--judge", "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": null}, {"key": "--judge-temperature", "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": "float"}, - {"key": "--judges", "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}, {"key": "--no-stored", "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": null}, {"key": "--pairwise", "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": null}, @@ -866,8 +853,7 @@ {"key": "--escalate-provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google'", "'google-vertex'", "'openai'", "'openrouter'"], "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": "--escalate-ties", "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": "--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": "--judge-model", "action": "_StoreAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, - {"key": "--judge-provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "anthropic", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--judge", "action": "ProviderModelAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--judge-temperature", "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": "float"}, {"key": "--max-bases", "action": "_StoreAction", "choices": null, "const": null, "default": 120, "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": "--min-accuracy", "action": "_StoreAction", "choices": null, "const": null, "default": 0.8, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": "float"}, @@ -893,8 +879,7 @@ {"key": "--bases", "action": "_StoreAction", "choices": null, "const": null, "default": 20, "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": "--concurrency", "action": "_StoreAction", "choices": null, "const": null, "default": 5, "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": "--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": "--judge-model", "action": "_StoreAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, - {"key": "--judge-provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "anthropic", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--judge", "action": "ProviderModelAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--judge-temperature", "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": "float"}, {"key": "--min-accuracy", "action": "_StoreAction", "choices": null, "const": null, "default": 0.8, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": "float"}, {"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": null}, @@ -960,10 +945,9 @@ {"key": "--github-token", "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}, {"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": "--max-usd", "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": "dokimi.cli_types.positive_usd#3f7e5c8902a3"}, - {"key": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "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": null}, {"key": "--product", "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": null}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--repo", "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}, {"key": "--save-analysis", "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} ], @@ -996,10 +980,9 @@ "params": [ {"key": "--concurrency", "action": "_StoreAction", "choices": null, "const": null, "default": 5, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": "int"}, {"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": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "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": null}, {"key": "--product", "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": null}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--questions", "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": null} ], "path": "dokimi eval questions analyze", @@ -1014,11 +997,10 @@ {"key": "--doc-source", "action": "_StoreAction", "choices": null, "const": null, "default": "context7", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--embeddings", "action": "_StoreAction", "choices": ["'auto'", "'local'", "'openai'"], "const": null, "default": "auto", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"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": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "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": null}, {"key": "--personas", "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": null}, {"key": "--product", "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": null}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--top-k", "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": "int"}, {"key": "--topics", "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}, {"key": "--validate", "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} @@ -1053,10 +1035,9 @@ {"key": "--concurrency", "action": "_StoreAction", "choices": null, "const": null, "default": 6, "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": "--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": "--limit", "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": "dokimi.cli_types.positive_int#96184e0d3f3b"}, - {"key": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "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": null}, {"key": "--product", "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": null}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--questions", "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": null}, {"key": "--reviewers", "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} ], @@ -1094,8 +1075,7 @@ {"key": "--baseline-arm", "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}, {"key": "--concurrency", "action": "_StoreAction", "choices": null, "const": null, "default": 5, "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": "--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": "--judge-model", "action": "_StoreAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, - {"key": "--judge-provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "anthropic", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--judge", "action": "ProviderModelAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--judge-temperature", "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": "float"}, {"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": null}, {"key": "--questions", "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": null} @@ -1127,8 +1107,7 @@ {"key": "--escalate-provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google'", "'google-vertex'", "'openai'", "'openrouter'"], "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": "--escalate-ties", "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": "--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": "--judge-model", "action": "_StoreAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, - {"key": "--judge-provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "anthropic", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--judge", "action": "ProviderModelAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--judge-temperature", "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": "float"}, {"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": null}, {"key": "--product", "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} @@ -1146,10 +1125,9 @@ {"key": "--judge-configs", "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}, {"key": "--judge-temperature", "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": "float"}, {"key": "--limit", "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": "dokimi.cli_types.positive_int#96184e0d3f3b"}, - {"key": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "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": null}, {"key": "--product", "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": null}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "const": null, "default": "anthropic", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--roles", "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 eval score panel", @@ -1162,9 +1140,8 @@ {"key": "--answers", "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": null}, {"key": "--concurrency", "action": "_StoreAction", "choices": null, "const": null, "default": 5, "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": "--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": "--judge-model", "action": "_StoreAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--judge", "action": "ProviderModelAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--judge-placeholder", "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-provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "anthropic", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--judge-temperature", "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": "float"}, {"key": "--name", "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}, {"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": null}, @@ -1192,8 +1169,7 @@ {"key": "--answers", "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": null}, {"key": "--concurrency", "action": "_StoreAction", "choices": null, "const": null, "default": 4, "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": "--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": "--judge-model", "action": "_StoreAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, - {"key": "--judge-provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "anthropic", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--judge", "action": "ProviderModelAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--no-judge", "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/-o", "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": null}, {"key": "--questions", "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": null} @@ -1284,9 +1260,8 @@ {"key": "--fail-on", "action": "_StoreAction", "choices": ["'warn'"], "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": "--format", "action": "_StoreAction", "choices": ["'questions'", "'reach'", "'skill-creator'"], "const": null, "default": "reach", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"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": "--model", "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}, + {"key": "--model", "action": "ProviderModelAction", "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}, {"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": true, "type": null}, - {"key": "--provider", "action": "_StoreAction", "choices": null, "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--questions", "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": null}, {"key": "--rewrite", "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": "--target", "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}, @@ -1308,15 +1283,13 @@ {"key": "--description", "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}, {"key": "--doc-source", "action": "_StoreAction", "choices": null, "const": null, "default": "context7", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"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": "--judge-model", "action": "_StoreAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--judge", "action": "ProviderModelAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--judge-placeholder", "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-provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "anthropic", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--judge-temperature", "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": "float"}, - {"key": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--out-dir", "action": "_StoreAction", "choices": null, "const": null, "default": ".", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--personas-count", "action": "_StoreAction", "choices": null, "const": null, "default": 5, "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": "--product", "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": null}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--questions", "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}, {"key": "--questions-per-topic", "action": "_StoreAction", "choices": null, "const": null, "default": 2, "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": "--questions-root", "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}, @@ -1851,8 +1824,7 @@ {"key": "--concurrency", "action": "_StoreAction", "choices": null, "const": null, "default": 5, "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": "--context-framing", "action": "_StoreAction", "choices": ["'neutral'", "'reference'"], "const": null, "default": "reference", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--dry-run", "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": "--extract-model", "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}, - {"key": "--extract-provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "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": "--extract-model", "action": "ProviderModelAction", "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}, {"key": "--format", "action": "_StoreAction", "choices": ["'html'", "'md'"], "const": null, "default": "html", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"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": "--include-resources", "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}, @@ -1868,7 +1840,7 @@ {"key": "--max-output-tokens", "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": "dokimi.cli_types.positive_int#96184e0d3f3b"}, {"key": "--max-resource-words", "action": "_StoreAction", "choices": null, "const": null, "default": 20000, "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": "--max-usd", "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": "dokimi.cli_types.positive_usd#3f7e5c8902a3"}, - {"key": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--no-classify", "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": "--no-confirm-carriers", "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": "--no-paraphrase", "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}, @@ -1878,7 +1850,6 @@ {"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": null}, {"key": "--out-dir", "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}, {"key": "--placebo-text", "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}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--resource-roles", "action": "_StoreAction", "choices": ["'data'", "'eval'", "'other'", "'pattern'", "'reference'", "'script'", "'template'", "'top'", "'trigger'"], "const": null, "default": null, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": "+", "position": null, "required": false, "type": null}, {"key": "--seed", "action": "_StoreAction", "choices": null, "const": null, "default": 0, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": "int"}, {"key": "--tier", "action": "_StoreAction", "choices": ["'standard'", "'study'", "'triage'"], "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}, @@ -1893,7 +1864,7 @@ "params": [ {"key": "--all-atoms", "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": "--artifact", "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": null}, - {"key": "--extract-model", "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}, + {"key": "--extract-model", "action": "ProviderModelAction", "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}, {"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": "--include-resources", "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": "--max-atoms", "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": "dokimi.cli_types.positive_int#96184e0d3f3b"}, @@ -1901,10 +1872,9 @@ {"key": "--max-output-tokens", "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": "dokimi.cli_types.positive_int#96184e0d3f3b"}, {"key": "--max-resource-words", "action": "_StoreAction", "choices": null, "const": null, "default": 20000, "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": "--max-usd", "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": "dokimi.cli_types.positive_usd#3f7e5c8902a3"}, - {"key": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--no-verify", "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": null}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "const": null, "default": "anthropic", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--resource-roles", "action": "_StoreAction", "choices": ["'data'", "'eval'", "'other'", "'pattern'", "'reference'", "'script'", "'template'", "'top'", "'trigger'"], "const": null, "default": null, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": "+", "position": null, "required": false, "type": null}, {"key": "--seed", "action": "_StoreAction", "choices": null, "const": null, "default": 0, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": "int"}, {"key": "--token-budgets", "action": "_StoreAction", "choices": null, "const": null, "default": [0.75, 0.5], "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": "+", "position": null, "required": false, "type": "dokimi.cli_types.unit_interval#3988979284cb"} @@ -1951,8 +1921,7 @@ {"key": "--atoms", "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": null}, {"key": "--concurrency", "action": "_StoreAction", "choices": null, "const": null, "default": 5, "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": "--context-framing", "action": "_StoreAction", "choices": ["'neutral'", "'reference'"], "const": null, "default": "reference", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, - {"key": "--extract-model", "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}, - {"key": "--extract-provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "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": "--extract-model", "action": "ProviderModelAction", "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}, {"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": "--judge", "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": null}, {"key": "--judge-aggregate", "action": "_StoreAction", "choices": ["'majority'", "'median'", "'unanimous'"], "const": null, "default": "median", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, @@ -1964,12 +1933,11 @@ {"key": "--max-atoms", "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": "dokimi.cli_types.positive_int#96184e0d3f3b"}, {"key": "--max-output-tokens", "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": "dokimi.cli_types.positive_int#96184e0d3f3b"}, {"key": "--max-usd", "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": "dokimi.cli_types.positive_usd#3f7e5c8902a3"}, - {"key": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--no-paraphrase", "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": "--no-reversal", "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": null}, {"key": "--placebo-text", "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}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--seed", "action": "_StoreAction", "choices": null, "const": null, "default": 0, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": "int"}, {"key": "--token-budgets", "action": "_StoreAction", "choices": null, "const": null, "default": [0.75, 0.5], "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": "+", "position": null, "required": false, "type": "dokimi.cli_types.unit_interval#3988979284cb"} ], @@ -2021,9 +1989,8 @@ {"key": "--keep-copies-under", "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}, {"key": "--max-output-tokens", "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": "dokimi.cli_types.positive_int#96184e0d3f3b"}, {"key": "--max-usd", "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": "dokimi.cli_types.positive_usd#3f7e5c8902a3"}, - {"key": "--model", "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}, + {"key": "--model", "action": "ProviderModelAction", "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}, {"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": null}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--queries", "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}, {"key": "--queries-from-headings", "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": "--reps", "action": "_StoreAction", "choices": null, "const": null, "default": 1, "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"}, @@ -2046,9 +2013,8 @@ {"key": "--keep-copies-under", "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}, {"key": "--max-output-tokens", "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": "dokimi.cli_types.positive_int#96184e0d3f3b"}, {"key": "--max-usd", "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": "dokimi.cli_types.positive_usd#3f7e5c8902a3"}, - {"key": "--model", "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": null}, + {"key": "--model", "action": "ProviderModelAction", "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": 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": null}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--queries", "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": null}, {"key": "--reps", "action": "_StoreAction", "choices": null, "const": null, "default": 1, "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": "--seed", "action": "_StoreAction", "choices": null, "const": null, "default": 0, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": "int"} @@ -2065,15 +2031,14 @@ {"key": "--artifact", "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": null}, {"key": "--atoms", "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": null}, {"key": "--cache-dir", "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}, - {"key": "--extract-model", "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}, + {"key": "--extract-model", "action": "ProviderModelAction", "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}, {"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": "--lexical-only", "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": "--max-atoms", "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": "dokimi.cli_types.positive_int#96184e0d3f3b"}, {"key": "--max-output-tokens", "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": "dokimi.cli_types.positive_int#96184e0d3f3b"}, {"key": "--max-usd", "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": "dokimi.cli_types.positive_usd#3f7e5c8902a3"}, - {"key": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "claude-sonnet-5-5", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "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": null}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "const": null, "default": "anthropic", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--seed", "action": "_StoreAction", "choices": null, "const": null, "default": 0, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": "int"}, {"key": "--token-budgets", "action": "_StoreAction", "choices": null, "const": null, "default": [0.75, 0.5], "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": "+", "position": null, "required": false, "type": "dokimi.cli_types.unit_interval#3988979284cb"} ], @@ -2116,13 +2081,12 @@ {"key": "--judge-provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google'", "'google-vertex'", "'openai'", "'openrouter'"], "const": null, "default": "anthropic", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--max-iterations", "action": "_StoreAction", "choices": null, "const": null, "default": 6, "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": "--max-output-tokens", "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": "dokimi.cli_types.positive_int#96184e0d3f3b"}, - {"key": "--model", "action": "_StoreAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": true, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, + {"key": "--model", "action": "ProviderModelAction", "choices": null, "const": null, "default": "gpt-6.1-sol", "group_key": null, "group_required": null, "hidden": true, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--no-plugin-deltas", "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": "--novelty-artifact", "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": 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": null}, {"key": "--out-dir", "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}, {"key": "--out-md", "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}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'claude-cli'", "'codex-cli'", "'copilot-cli'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"key": "--reps", "action": "_StoreAction", "choices": null, "const": null, "default": 1, "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": "--rerank-threshold", "action": "_StoreAction", "choices": null, "const": null, "default": 0.3, "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": "float"}, {"key": "--skip-work", "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}, @@ -2202,9 +2166,8 @@ {"key": "--items-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": null}, {"key": "--max-output-tokens", "action": "_StoreAction", "choices": null, "const": null, "default": 2048, "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": "--max-usd", "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": "dokimi.cli_types.positive_usd#3f7e5c8902a3"}, - {"key": "--model", "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}, + {"key": "--model", "action": "ProviderModelAction", "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}, {"key": "--out", "action": "_StoreAction", "choices": null, "const": null, "default": "tool_preference.json", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, - {"key": "--provider", "action": "_StoreAction", "choices": ["'amazon-bedrock'", "'anthropic'", "'google-vertex'", "'openai'", "'openai-codex'", "'openrouter'"], "const": null, "default": "openai", "group_key": null, "group_required": null, "hidden": false, "is_flag": false, "kind": "option", "nargs": null, "position": null, "required": false, "type": null}, {"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"} ], "path": "dokimi tools preference", diff --git a/dokimi/docs/reviewing.md b/dokimi/docs/reviewing.md index cf95dde85..9e98da977 100644 --- a/dokimi/docs/reviewing.md +++ b/dokimi/docs/reviewing.md @@ -17,8 +17,8 @@ cd dokimi pip install -e . # installs the `dokimi` command ``` -The `novelty` and `arms` steps take `--model` and `--provider`; `arms run` also -needs `--judge-provider` (it does not fall back to `--provider` for the judge); +The `novelty` and `arms` steps take `--model PROVIDER/MODEL`; `arms run` also +needs `--judge-provider` (it does not fall back to the answerer's provider for the judge); `tasks run` and `repo` take `--model` only. The provider is one of `openai`, `anthropic`, `amazon-bedrock`, `google-vertex`, `openrouter`, `openai-codex` or `claude-cli` (a logged-in Claude Code CLI, no key; see @@ -33,7 +33,7 @@ credentials (`GOOGLE_APPLICATION_CREDENTIALS`, with `VERTEXAI_PROJECT` and gateway), use provider `openai` with `OPENAI_API_BASE` (or `OPENAI_BASE_URL`) set to its `/v1` URL. A model name that litellm does not take for OpenAI's own goes to that server, such as `glm-5.3` or `meta-llama/Llama-3.1-8B` -(`--judges openai/glm-5.3` in `eval judge agreement`); so does a bare `claude-*`, +(`--judge openai/glm-5.3` in `eval judge agreement`); so does a bare `claude-*`, Bedrock or Vertex id, which needs its cloud's provider to reach that cloud. A name that starts with a litellm provider prefix (`deepseek/`, `groq/`, `ollama/`) keeps that provider's route: write it as `openai/` to send it @@ -44,8 +44,9 @@ litellm has no price for such a model, so cost is reported as unknown and The judge must be a different model from the one under measurement, because a model that grades its own answers inflates the scores. `novelty`, `arms run` and `subjects run` refuse a judged run whose default judge is the model under measurement: -the command exits 2 with `pass --judge-model as well`, so name -`--judge --judge-model --judge-provider ` yourself. +the command exits 2 with `pass --judge-model as well`. Select a different model with +`--judge-model ` and set `--judge-provider` if needed. On `arms run` and +`subjects run`, also pass `--judge` to enable grading. For `arms run` and `subjects run`, an explicit `--judge-model` equal to the answerer only warns on stderr. `novelty` does not: it refuses that judge unless you also pass `--allow-self-judge`. @@ -56,8 +57,8 @@ For `arms run` and `subjects run`, an explicit `--judge-model` equal to the answ | 1. Does it load? | `dokimi catalog check --root --kind skills [--strict]` | free | | 2. Is it ever picked? | `dokimi skill routing skill: --against --queries queries.json [--model …]` | free without `--model` | | 3. What will step 4 cost? | `dokimi skill novelty analyze --artifact skill: --tier triage --include-resources --dry-run` | free | -| 4. What does it add? | the same command without `--dry-run`, plus `--model`, `--provider`, `--judge-model` and `--max-usd` | ~100 calls | -| 5a. Do answers improve? | `dokimi arms run --product

--questions --arm baseline,skill:

--model --provider --judge --judge-model --judge-provider ` | one answer and one grade per question and arm | +| 4. What does it add? | the same command without `--dry-run`, plus `--model PROVIDER/MODEL`, `--judge-model` and `--max-usd` | ~100 calls | +| 5a. Do answers improve? | `dokimi arms run --product

--questions --arm baseline,skill:

--model / --judge --judge-model --judge-provider ` | one answer and one grade per question and arm | | 5b. Does code improve? | `dokimi tasks run --tasks-root /evaluation/harbor/tasks --all --harness docker-claude,docker-claude-skill: --baseline-harness docker-claude` ([coding-harnesses.md](coding-harnesses.md)) | one agent run per task and harness; needs Docker and Claude credentials (`AWS_BEARER_TOKEN_BEDROCK`, `ANTHROPIC_API_KEY` or `CLAUDE_CODE_OAUTH_TOKEN`), not the provider keys above; run with `--dry-run` first | - **Competitors** are the other skills an agent sees next to this one when it diff --git a/dokimi/docs/skill-novelty-walkthrough.md b/dokimi/docs/skill-novelty-walkthrough.md index a09336f42..7967d1e86 100644 --- a/dokimi/docs/skill-novelty-walkthrough.md +++ b/dokimi/docs/skill-novelty-walkthrough.md @@ -121,7 +121,7 @@ What a stopped run leaves behind depends on the step: ```bash python cli.py skill novelty analyze --artifact skill:skills/my-skill \ - --tier triage --model --judge-model + --tier triage --model openai/gpt-6.1-sol --judge anthropic/claude-sonnet-5-5 ``` Read in this order: `harmful_conflicting` (the only category that can make an artifact @@ -146,15 +146,15 @@ python cli.py skill novelty atoms --artifact skill:skills/my-skill \ --extract-model --include-resources --out atoms.json python cli.py skill novelty probe --artifact skill:skills/my-skill --atoms atoms.json \ - --model model-a --judge-model --out model-a.json + --model model-a --judge anthropic/claude-sonnet-5-5 --out model-a.json python cli.py skill novelty probe --artifact skill:skills/my-skill --atoms atoms.json \ - --model model-b --judge-model --out model-b.json + --model model-b --judge anthropic/claude-sonnet-5-5 --out model-b.json ``` The extractor must not be the model under measurement, or the model writes its own answer key — `probe` warns when it detects that. Without `--extract-model`/`--model`, `atoms` (and the `shorten` adjudicator) use the default judge, `anthropic/claude-sonnet-5-5`, the same -model `analyze` extracts with; an extractor from another provider needs `--provider`. `probe` +model `analyze` extracts with; an extractor from another provider needs `--extract-model PROVIDER/MODEL`. `probe` and `analyze` measure `openai/gpt-6.1-sol` unless given `--model`. On `atoms` and `shorten`, `--model` is the extractor or the adjudicator, not the answerer; see [Choosing the extractor and the judge](skill-novelty.md#choosing-the-extractor-and-the-judge). `atoms.json` records which diff --git a/dokimi/docs/skill-novelty.md b/dokimi/docs/skill-novelty.md index 15d4825c1..de8a8d0f7 100644 --- a/dokimi/docs/skill-novelty.md +++ b/dokimi/docs/skill-novelty.md @@ -277,9 +277,13 @@ then is the judge. With no judge flags and the default answerer, that is `atoms` and the `shorten` adjudicator differ: there `--model` is the extractor (or the retention adjudicator), not the model under measurement, and it defaults to the judge model, `anthropic/claude-sonnet-5-5`. A plain `atoms` run therefore has the extractor and the judge on -one model: pass `--extract-model` of another family there (with `--provider` when it is not +one model: pass `--extract-model` of another family there (`PROVIDER/MODEL` when it is not Anthropic's). +With an explicit OpenRouter judge, use `--extract-model openrouter/anthropic/MODEL` +for an Anthropic model served by OpenRouter. The shorter `anthropic/MODEL` selects +Anthropic directly and prints a warning. The same applies to `openai/MODEL`. + `analyze` checks the extractor against the judge before it spends anything; `probe` checks the model that wrote the saved answer key (the atoms file's `extractor`) against the judge. The same model, or two models of one vendor family (the vendor is read off the model id: `claude`, `sonnet`, @@ -292,14 +296,14 @@ prints the warning only. The warning does not refuse the run. To clear the warning, give the extractor a different family from the judge. `probe` reads the key from the saved atoms file, so its own `--extract-model` does not clear it: pick another judge, or -write the atoms file again with another `atoms --extract-model` (and `--provider`). Here the +write the atoms file again with another `atoms --extract-model PROVIDER/MODEL`. Here the extractor is Anthropic's, the judge OpenAI's: ```bash python cli.py skill novelty analyze --artifact skill:path/to/skill \ - --model claude-opus-5-5 --provider anthropic \ - --judge-model gpt-6.1-sol --judge-provider openai \ - --extract-model claude-haiku-5-5 --extract-provider anthropic + --model anthropic/claude-opus-5-5 \ + --judge openai/gpt-6.1-sol \ + --extract-model anthropic/claude-haiku-5-5 ``` With two vendors available, one role must share a family with another. Keep the judge and the @@ -316,7 +320,7 @@ original single judge was the most lenient of all, so its added shares sat at or bottom of the panel's range. `analyze` and `probe` take a panel: ```bash -python cli.py skill novelty probe --artifact skill:path/to/skill --atoms atoms.json --model grok-4.6 --provider openrouter --judge openrouter/openai/gpt-6-luna --judge openrouter/anthropic/claude-sonnet-5 --judge openrouter/moonshotai/kimi-k3 --judge-aggregate median +python cli.py skill novelty probe --artifact skill:path/to/skill --atoms atoms.json --model openrouter/grok-4.6 --judge openrouter/openai/gpt-6-luna --judge openrouter/anthropic/claude-sonnet-5 --judge openrouter/moonshotai/kimi-k3 --judge-aggregate median ``` - `--judge PROVIDER/MODEL`, repeated, is the panel. It replaces `--judge-model` and @@ -362,12 +366,12 @@ for what each output means. ```bash python cli.py skill novelty analyze --artifact skill:path/to/skill \ - --model claude-opus-5-5 --provider anthropic \ - --judge-model gpt-6.1-sol --judge-provider openai [--include-resources] + --model anthropic/claude-opus-5-5 \ + --judge openai/gpt-6.1-sol [--include-resources] ``` With no `--judge-model`/`--judge-provider`, the judge is `anthropic/claude-sonnet-5-5` -whatever `--provider` is; a Bedrock-only run adds `--judge-provider amazon-bedrock`. +whatever the answerer's provider is; a Bedrock-only run adds `--judge-provider amazon-bedrock`. `--judge-provider` alone takes the default judge that runs on that provider; when none does (measuring `claude-sonnet-5-5` with `--judge-provider amazon-bedrock`, or the default `gpt-6.1-sol` with `--judge-provider openai`) the run exits and asks for @@ -631,7 +635,7 @@ entry point alone would judge that skill on 1.2% of itself, and its "dead tokens would be dominated by spans whose only job is to name a file nobody read. ```bash -python cli.py skill novelty analyze --artifact skill:path/to/skill --model M --judge-model J \ +python cli.py skill novelty analyze --artifact skill:path/to/skill --model openai/gpt-6.1-sol --judge anthropic/claude-sonnet-5-5 \ --include-resources # measure the bundle # --resource-roles reference pattern # or only some of it # --max-file-words 4000 --max-resource-words 20000 @@ -1393,7 +1397,7 @@ each finishes, so a killed sweep keeps what it paid for. An `ok` skill also gets ```bash dokimi catalog novelty skills/ --out-dir out/sweep --max-usd 20 --max-usd-per-skill 1 \ - --jobs 4 --model --judge-model --strata strata.csv + --jobs 4 --model openai/gpt-6.1-sol --judge anthropic/claude-sonnet-5-5 --strata strata.csv dokimi catalog novelty skills/ --out-dir out/sweep --summary-only ``` diff --git a/dokimi/docs/skill-sensitivity.md b/dokimi/docs/skill-sensitivity.md index 82aef308d..0e0d3c5d0 100644 --- a/dokimi/docs/skill-sensitivity.md +++ b/dokimi/docs/skill-sensitivity.md @@ -14,7 +14,7 @@ with a paired interval over the queries, says how much each sentence carries. ```bash python cli.py skill sensitivity skill:skills/vllm-xpu-run \ --against skills --queries queries.json \ - --model claude-haiku-5-5 --provider amazon-bedrock --reps 2 --out sensitivity.json + --model amazon-bedrock/claude-haiku-5-5 --reps 2 --out sensitivity.json ``` `queries.json` holds requests a user would write for this skill, written without looking at its diff --git a/dokimi/docs/subscription-backends.md b/dokimi/docs/subscription-backends.md index 265306a83..9fc050476 100644 --- a/dokimi/docs/subscription-backends.md +++ b/dokimi/docs/subscription-backends.md @@ -14,8 +14,8 @@ The Q&A track (answers, judging, question generation, personas, novelty) can cal a model through a coding-agent CLI the machine is already signed in to, instead of an API key. Three backends exist: `claude-cli` (Claude Code's `claude -p`), `codex-cli` (`codex exec`) and `copilot-cli` (`copilot -p`). The Codex and Copilot ones are answering routes only: they take no judge -default, so `arms run` or `eval` on them needs `--judge-model` and `--judge-provider` named. -Pass it wherever a command takes `--provider` or `--judge-provider`, except `tools` (it needs tool calling) and the arms that `arms run` and `arms matrix-run` refuse for a CLI provider (see the table). +default, so `arms run` or `eval` on them needs a judge named: `--judge-model` and `--judge-provider` on `arms run`, `--judge PROVIDER/MODEL` on `eval`. +Pass it wherever a command takes a `PROVIDER/MODEL` value (`--model`, `--judge`) or `--judge-provider`, except `tools` (it needs tool calling) and the arms that `arms run` and `arms matrix-run` refuse for a CLI provider (see the table). ## Check what this machine can use @@ -36,16 +36,16 @@ exits 2 for a backend that is not installed or not signed in, as for a missing k ```bash python cli.py answers generate --product oneTBB --questions questions/oneTBB.json \ - --out answers/oneTBB.json --provider claude-cli --model haiku + --out answers/oneTBB.json --model claude-cli/haiku python cli.py eval score pointwise --product oneTBB --answers answers/oneTBB.json \ - --out eval/oneTBB.json --judge-provider claude-cli --judge-model sonnet + --out eval/oneTBB.json --judge claude-cli/sonnet ``` `--model` takes what `claude --model` takes: an alias (`haiku`, `sonnet`, -`opus`) or a full id (`claude-sonnet-5-5`). With no `--judge-model`, the judge on +`opus`) or a full id (`claude-sonnet-5-5`). With no judge model named, the judge on `claude-cli` is the first of `opus`, `sonnet`, `haiku` not of the answerer's family. When the answerer would be the judge, a judging run exits before any answer and -asks for `--judge-model`. With `--provider claude-cli`, a +asks for a judge model. With `--model claude-cli/`, a model that is not a Claude alias or id is refused at parse time. ## How it differs from an API provider diff --git a/dokimi/docs/tool-preference.md b/dokimi/docs/tool-preference.md index a017d8a0f..b1feb4a3f 100644 --- a/dokimi/docs/tool-preference.md +++ b/dokimi/docs/tool-preference.md @@ -78,7 +78,7 @@ spread is measured with `--reps` rather than pinned away. ```bash python cli.py tools preference --groups groups.json --dry-run # count items and calls python cli.py tools preference --groups groups.json \ - --model claude-haiku-5-5 --provider anthropic --reps 3 --out pref.json + --model anthropic/claude-haiku-5-5 --reps 3 --out pref.json ``` `--max-usd` caps the spend: once the priced calls have spent it, no new diff --git a/dokimi/docs/user-flow.md b/dokimi/docs/user-flow.md index 541607dee..8b73ef8dc 100644 --- a/dokimi/docs/user-flow.md +++ b/dokimi/docs/user-flow.md @@ -90,7 +90,7 @@ results/_final/ ```bash python cli.py benchmark run --target onetbb --questions-root "/questions" --out-dir results/onetbb_seed python cli.py benchmark run --target onetbb --questions-from results/onetbb_seed --model gpt-6-astra --out-dir results/onetbb_gpt-6-astra -python cli.py benchmark run --target onetbb --questions-from results/onetbb_seed --model claude-opus-5-5 --provider anthropic --out-dir results/onetbb_claude-opus-5-5 +python cli.py benchmark run --target onetbb --questions-from results/onetbb_seed --model anthropic/claude-opus-5-5 --out-dir results/onetbb_claude-opus-5-5 ``` Each comparison run has its own `--out-dir`, so its answers, scores and report do not overwrite another model's. diff --git a/dokimi/dokimi/cli.py b/dokimi/dokimi/cli.py index 0bb691d2b..ff0d5ff65 100755 --- a/dokimi/dokimi/cli.py +++ b/dokimi/dokimi/cli.py @@ -45,7 +45,7 @@ from dokimi.console import tolerate_console_encoding from dokimi.defaults import JUDGE_MODEL_FOR_PROVIDER from dokimi.exit_codes import EXIT_INFRA -from dokimi.judge_rule import apply_default_judge, follow_answerer_cli, refuse_judge_model +from dokimi.judge_rule import JudgeIsAnswerer, apply_default_judge, follow_answerer_cli, refuse_judge_model def _subparsers(parser: argparse.ArgumentParser) -> argparse._SubParsersAction | None: @@ -327,6 +327,20 @@ def _names_judge_provider(token: str) -> bool: return flag.startswith("--judge-p") and "--judge-provider".startswith(flag) +def _fill_default_judge(parser: argparse.ArgumentParser, args: argparse.Namespace, *, separate_flags: bool) -> None: + if (getattr(args, "judge_model", None) is not JUDGE_MODEL_FOR_PROVIDER + or getattr(args, "defer_judge_default", False)): + return + matrix = getattr(args, "matrix_cells", None) or getattr(args, "matrix_cell", None) + try: + apply_default_judge(args, matrix=bool(matrix), named=args.judge_provider_named) + except ValueError as e: + if isinstance(e, JudgeIsAnswerer) and not separate_flags: + parser.error(f"the default judge is the model under measurement ({args.model}); " + "pass --judge PROVIDER/MODEL to choose another model") + parser.error(str(e)) + + def _repo_scan_compat(argv: list[str]) -> list[str]: """Accept the old gate spelling for one release, keeping stdout available for JSON.""" if argv[:2] == ["repo", "scan"]: @@ -357,16 +371,13 @@ def parse_args(argv: Sequence[str] | None = None) -> argparse.Namespace: _moved_exit(parser, moved_flags, cli_routes.moved_text(moved_flags)) args = parser.parse_args(_repo_scan_compat(raw)) # argparse fills --judge-provider with its default (anthropic), so the rule needs to know whether one was named. - args.judge_provider_named = any(_names_judge_provider(t) for t in raw) + # ``--judge PROVIDER/MODEL`` sets it too (ProviderModelAction), so keep what the parser stored. + args.judge_provider_named = bool(getattr(args, "judge_provider_named", False)) or any( + _names_judge_provider(t) for t in raw) args.model_named = any(_names_model(t) for t in raw) + separate_judge_flags = args.cmd in {"arms", "subjects", "skill", "catalog"} # A command that reads its answerer from a descriptor (subjects run) resolves the judge itself, once it is loaded. - if getattr(args, "judge_model", None) is JUDGE_MODEL_FOR_PROVIDER and not getattr(args, "defer_judge_default", False): - # With --matrix-cells / --matrix-cell every cell sets its own model, so the top-level one is no answerer. - matrix = getattr(args, "matrix_cells", None) or getattr(args, "matrix_cell", None) - try: - apply_default_judge(args, matrix=bool(matrix), named=args.judge_provider_named) - except ValueError as e: - parser.error(str(e)) + _fill_default_judge(parser, args, separate_flags=separate_judge_flags) # An explicit --judge-model on a CLI answerer judges on its CLI too, unless --judge-provider names one. # A command that defers its judge (subjects run) follows its answerer once the descriptor is loaded. if not getattr(args, "defer_judge_default", False): @@ -377,23 +388,36 @@ def parse_args(argv: Sequence[str] | None = None) -> argparse.Namespace: and not llm_cli.accepts_model(cur_judge_provider, cur_judge_model): # Checked here, before any persona or answer is generated for the run. parser.error(refuse_judge_model(cur_judge_provider, cur_judge_model, named=args.judge_provider_named, - answerer_provider=getattr(args, "provider", None))) + answerer_provider=getattr(args, "provider", None), + separate_flags=separate_judge_flags)) provider, model = getattr(args, "provider", None), getattr(args, "model", None) # With --matrix-cells every cell sets its own provider and model (checked when applied), so the # top-level model is not the one that runs. if provider in llm_cli.BACKENDS and model is not None and not llm_cli.accepts_model(provider, model) \ and not getattr(args, "matrix_cells", None): # The default answer model is not a Claude model: left out, every call would fail. - parser.error(f"--provider {provider} takes a Claude model (sonnet, haiku, opus or a claude-* id), " - f"not {model!r}: pass --model") + parser.error(f"--model {provider}/ takes a Claude model (sonnet, haiku, opus or a claude-* id), " + f"not {model!r}: pass --model {provider}/") # A CLI that takes any model name would be sent the default (an API model name) when --model is left out. if provider in llm_cli.BACKENDS and llm_cli.BACKENDS[provider].any_model and model is not None \ and not getattr(args, "model_named", True) and not getattr(args, "matrix_cells", None): - parser.error(f"--provider {provider} needs --model: it takes any model name, and the default {model!r} " - "is an API model") + parser.error(f"pass --model {provider}/: the default {model!r} is an API model") + _warn_extractor_provider(args) return args +def _warn_extractor_provider(args: argparse.Namespace) -> None: + provider = getattr(args, "extract_provider", None) + judges = getattr(args, "judges", None) + judge_provider = judges[0].partition("/")[0] if judges else getattr(args, "judge_provider", None) + if (judges or args.judge_provider_named) and judge_provider == "openrouter" and provider in ("anthropic", "openai"): + ref = args.extract_model + if not ref.startswith(f"{provider}/"): + ref = f"{provider}/{ref}" + print(f"WARNING: --extract-model {ref} selects {provider}. To keep the extractor on OpenRouter, " + f"pass --extract-model openrouter/{ref}", file=sys.stderr) + + def _emits_cli_output(args: argparse.Namespace) -> bool: """True for a leaf that opted in (``emits_cli_output``) and was run with ``--json``.""" return bool(getattr(args, "emits_cli_output", False) and getattr(args, "json", False)) diff --git a/dokimi/dokimi/cli_flags.py b/dokimi/dokimi/cli_flags.py index fa2762805..a50a16f16 100644 --- a/dokimi/dokimi/cli_flags.py +++ b/dokimi/dokimi/cli_flags.py @@ -87,7 +87,8 @@ class Concept: help="the model a role runs on: judge, extractor, escalation, fill, RAGAS", canonical=( Flag("--judge", "PROVIDER/MODEL", _MODEL_REF, repeatable=True, - meaning="the judge; repeated, it is a panel"), + meaning="the judge; repeated, it is a panel on the commands that take several (novelty, catalog, " + "eval judge agreement); elsewhere a repeat replaces the earlier one"), Flag("--judge-aggregate", "{median,majority,unanimous}", "choice", meaning="how a judge panel's verdicts become one"), Flag("--extract-model", "PROVIDER/MODEL", _MODEL_REF), @@ -449,6 +450,56 @@ class FlagMove: new: str leaves: tuple[tuple[str, ...], ...] = () prefix: str = "" + split: str = "" # a value that held several items (``--judges a,b``) becomes one ``new`` per item + + +@dataclass(frozen=True) +class FlagJoin: + """Two old flags that became one value: ``provider`` and ``model`` are now ``new PROVIDER/MODEL``. + + A provider with no model gets the placeholder ```` in the printed argv. ``leaves`` limits + the join as in ``FlagMove``; the empty tuple means every leaf. + """ + + provider: str + model: str + new: str + leaves: tuple[tuple[str, ...], ...] = () + + +# Leaves whose --provider moved into --model. Harness model strings keep their prior interface. +MODEL_MOVED_LEAVES: tuple[tuple[str, ...], ...] = ( + ("answers", "generate"), ("arms", "run"), ("arms", "matrix-run"), + ("benchmark", "batch"), ("benchmark", "preflight"), ("benchmark", "run"), + ("catalog", "novelty"), ("catalog", "routing"), ("delivery", "scan"), + ("eval", "personas", "discover"), ("eval", "questions", "analyze"), + ("eval", "questions", "generate"), ("eval", "questions", "review"), + ("eval", "score", "panel"), ("eval", "triggers", "generate"), ("evaluate",), + ("skill", "novelty", "analyze"), ("skill", "novelty", "atoms"), ("skill", "novelty", "probe"), + ("skill", "routing"), ("skill", "shorten"), ("skill", "sensitivity"), + ("subjects", "run"), ("tools", "preference"), +) + + +# Leaves whose judge was ``--judge-model``/``--judge-provider``; now ``--judge PROVIDER/MODEL`` (issue #94 F1b). +# arms run, arms matrix-run, subjects run and novelty keep both spellings: there ``--judge`` is a switch or a panel. +JUDGE_MOVED_LEAVES: tuple[tuple[str, ...], ...] = ( + ("benchmark", "run"), ("benchmark", "preflight"), ("benchmark", "batch"), + ("eval", "judge", "validate"), ("eval", "judge", "wording"), + ("eval", "score", "checklist"), ("eval", "score", "pairwise"), + ("eval", "score", "pointwise"), ("eval", "score", "reference"), + ("evaluate",), +) + + +FLAG_JOINS: tuple[FlagJoin, ...] = ( + # Model concept (F1b): the provider moved into the model value, `--model PROVIDER/MODEL`. + FlagJoin("--provider", "--model", "--model", leaves=MODEL_MOVED_LEAVES), + FlagJoin("--judge-provider", "--judge-model", "--judge", leaves=JUDGE_MOVED_LEAVES), + FlagJoin("--extract-provider", "--extract-model", "--extract-model", leaves=( + ("catalog", "novelty"), ("skill", "novelty", "analyze"), ("skill", "novelty", "probe"), + )), +) FLAG_MOVES: tuple[FlagMove, ...] = ( @@ -517,6 +568,9 @@ class FlagMove: FlagMove("--budget", "--max-usd-per-cell", leaves=( ("repo", "run"), ("repo", "reach"), ("repo", "skill-reach"), )), + # Model concept (F1b): a bare judge model moves to `--judge` (the provider is in the value). + FlagMove("--judge-model", "--judge", leaves=JUDGE_MOVED_LEAVES), + FlagMove("--judges", "--judge", leaves=(("eval", "judge", "agreement"),), split=","), # Dry-run concept (F1b): estimate, make no paid call. `subjects run --work-dry-run` is not moved: # it gates only executable-task agents, so it has no matching canonical meaning (see the allowlist). FlagMove("--estimate-only", "--dry-run", leaves=( diff --git a/dokimi/dokimi/cli_model_ref.py b/dokimi/dokimi/cli_model_ref.py new file mode 100644 index 000000000..7593540ff --- /dev/null +++ b/dokimi/dokimi/cli_model_ref.py @@ -0,0 +1,75 @@ +# Copyright (C) 2026 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +"""``--model P/M`` and ``--judge P/M``: one flag for a model and its provider (issue #94 §2.4, F1b model concept). + +The old ``--provider`` and ``--judge-provider`` flags are gone; their value moved into the front of the model flag. +A value whose part before the first slash is a provider on the leaf sets the provider too. A bare model name +(``haiku``, or ``meta-llama/x`` where ``meta-llama`` is no provider) leaves the provider at the leaf's default, as +``--model`` alone always did. +""" + +from __future__ import annotations + +import argparse +from collections.abc import Iterable + +from dokimi.llm import ANSWER_PROVIDERS, PROVIDER_ALIASES, is_litellm_route + +_KNOWN_PROVIDERS = frozenset((*ANSWER_PROVIDERS, *PROVIDER_ALIASES)) + + +class ProviderModelAction(argparse.Action): + """Store the model; when the value names a provider, store that provider in ``provider_dest`` too. + + A prefix that names a provider dokimi knows, but not one this command takes, is refused: the value + was meant as a provider, and running it as a model name on the default provider would hide the mistake. + Any other prefix (``meta-llama/x`` on openrouter) is a model name. + """ + + def __init__(self, option_strings, dest, *, provider_dest: str, providers: Iterable[str], + known: Iterable[str] = (), named_dest: str | None = None, **kwargs): + self.provider_dest = provider_dest + self.providers = tuple(providers) + self.known = frozenset(known) + self.named_dest = named_dest + super().__init__(option_strings, dest, **kwargs) + + def __call__(self, parser, namespace, values, option_string=None): + provider, sep, model = str(values).partition("/") + if sep and provider in self.providers: + if not model.strip(): + parser.error(f"{option_string} {provider}/ has no model: pass {option_string} {provider}/") + setattr(namespace, self.provider_dest, provider) + if self.named_dest: + setattr(namespace, self.named_dest, True) + prefix, nested, _ = model.partition("/") + # Preserve explicit OpenAI routing only when a bare nested name would redirect. + keeps_openai = provider == "openai" and nested and prefix not in self.known and is_litellm_route(prefix) + setattr(namespace, self.dest, values if keeps_openai else model) + elif sep and provider in self.known: + parser.error(f"{option_string}: `{provider}` is not a provider for this command; " + f"use one of {', '.join(sorted(self.providers))}") + else: + if not str(values).strip(): + parser.error(f"{option_string} has no model: pass {option_string} ") + setattr(namespace, self.provider_dest, parser.get_default(self.provider_dest)) + if self.named_dest: + setattr(namespace, self.named_dest, False) + setattr(namespace, self.dest, values) + + +def add_model_flag(parser: argparse._ActionsContainer, option: str, *, dest: str, provider_dest: str, + providers: Iterable[str], default_model: object, default_provider: str | None, + named_dest: str | None = None, help: str | None = None, required: bool = False) -> argparse.Action: + """Add ``option PROVIDER/MODEL`` storing the model in ``dest`` and the provider in ``provider_dest``. + + ``default_provider`` is the provider a bare model (or no model) runs on, the default ``--provider`` used to be. + """ + action = parser.add_argument( + option, dest=dest, action=ProviderModelAction, provider_dest=provider_dest, providers=tuple(providers), + known=_KNOWN_PROVIDERS, named_dest=named_dest, + default=default_model, metavar="PROVIDER/MODEL", help=help, required=required, + ) + parser.set_defaults(**{provider_dest: default_provider}) + return action diff --git a/dokimi/dokimi/cli_routes.py b/dokimi/dokimi/cli_routes.py index 66f5bdb28..44184f11d 100644 --- a/dokimi/dokimi/cli_routes.py +++ b/dokimi/dokimi/cli_routes.py @@ -21,7 +21,11 @@ from collections.abc import Callable, Sequence from dataclasses import dataclass, field -from dokimi.cli_flags import FLAG_MOVES, FlagMove +from dokimi.cli_flags import FLAG_JOINS, FLAG_MOVES, FlagJoin, FlagMove +from dokimi.llm import is_litellm_route +from dokimi.llm_providers import ANSWER_PROVIDERS, PROVIDER_ALIASES + +_MODEL_PROVIDERS = frozenset((*ANSWER_PROVIDERS, *PROVIDER_ALIASES)) SECTIONS: tuple[str, ...] = ("The loop", "Subjects", "Evals", "Analysis and data") @@ -559,24 +563,102 @@ def moved_argv( return None -def _rewrite_moved_token(rewritten: list[str], index: int, move: FlagMove, equals: str, value: str) -> None: - """Rewrite the token at ``index`` to ``move.new``; a ``prefix`` goes in front of the value (F1b).""" - if not move.prefix: - # a new spelling that carries its value (--fail-on=warn) takes no stray value from the old one - rewritten[index] = move.new if "=" in move.new else f"{move.new}{equals}{value}" - elif equals: - rewritten[index] = f"{move.new}={move.prefix}{value}" - else: # the value is the next token: --build-timeout 5 is --timeout build=5 - rewritten[index] = move.new - if index + 1 < len(rewritten) and not rewritten[index + 1].startswith("-"): - rewritten[index + 1] = move.prefix + rewritten[index + 1] +def _joined_flag_spans(tokens: list[str], join: FlagJoin) -> list[tuple[int, int, str, str]]: + spans: list[tuple[int, int, str, str]] = [] # (index, width, flag, value) for each flag with a value + i = 0 + while i < len(tokens) and tokens[i] != "--": + name, equals, value = tokens[i].partition("=") + if name in (join.provider, join.model, join.new): + if equals: + spans.append((i, 1, name, value)) + i += 1 + elif i + 1 < len(tokens) and _is_plain(tokens[i + 1]): + spans.append((i, 2, name, tokens[i + 1])) + i += 2 + else: + i += 1 # no value: argparse reports it else: - rewritten.insert(index + 1, move.prefix) + i += 1 + return spans + + +def _joined_model(provider: str, model: str, *, replacement: bool) -> str: + prefix, slash, _ = model.partition("/") + if not provider or (replacement and slash and prefix in _MODEL_PROVIDERS): + return model + if provider == "openai" and slash and prefix not in _MODEL_PROVIDERS and is_litellm_route(prefix): + return model + return f"{provider}/{model}" + + +def _fold_provider(tokens: list[str], join: FlagJoin) -> list[str] | None: + """Fold a retired provider and the last old or new model flag into one model reference.""" + spans = _joined_flag_spans(tokens, join) + providers = [span for span in spans if span[2] == join.provider] + if not providers: + return None + models = [span for span in spans if span[2] != join.provider] + at, _, flag, model = models[-1] if models else (providers[-1][0], 0, join.model, "") + replacement = flag == join.new != join.model + ref = _joined_model(providers[-1][3], model, replacement=replacement) + drop: set[int] = set() + for index, width, _, _ in spans: + drop.update(range(index, index + width)) + out: list[str] = [] + for index, token in enumerate(tokens): + if index == at: + out.extend([join.new, ref]) + if index not in drop: + out.append(token) + return out + + +def _split_flag(tokens: list[str], i: int, equals: str, value: str, move: FlagMove) -> tuple[list[str], int]: + """The new flag repeated once per item of a split old flag's value, and the index after it.""" + if equals: + raw, nxt = value, i + 1 + elif i + 1 < len(tokens): + raw, nxt = tokens[i + 1], i + 2 + else: + raw, nxt = "", i + 1 + out: list[str] = [] + for item in (part.strip() for part in raw.split(move.split)): + if item: + out.extend([move.new, item]) + return out, nxt + + +def _last_split_flags(tokens: Sequence[str], moves: Sequence[FlagMove]) -> dict[str, int]: + """Find the final occurrence of each retired list flag before the positional separator.""" + split = {move.old for move in moves if move.split} + last: dict[str, int] = {} + for index, token in enumerate(tokens): + if token == "--": + break + name = token.partition("=")[0] + if name in split: + last[name] = index + return last + + +def _rewrite_moved_flag(tokens: list[str], index: int, move: FlagMove, equals: str, value: str) -> tuple[list[str], int]: + """Rewrite a moved flag and consume its following value when a prefix requires it.""" + if not move.prefix: + return [move.new if "=" in move.new else f"{move.new}{equals}{value}"], index + 1 + if equals: + return [f"{move.new}={move.prefix}{value}"], index + 1 + if index + 1 < len(tokens) and not tokens[index + 1].startswith("-"): + return [move.new, move.prefix + tokens[index + 1]], index + 2 + return [move.new, move.prefix], index + 1 def moved_flags_argv(argv: Sequence[str]) -> list[str] | None: """``argv`` with each moved spelling rewritten to its new one, or None when none moved. + A provider and a model that moved together (``--provider X --model M``) fold into one + ``--model X/M`` first; a flag that moved alone is renamed; the final value of a split + flag (``--judges a,b``) becomes one flag per item. + A move can land on a spelling that moves again (``--out-json`` -> ``--out`` -> ``--out-dir`` on a directory leaf), so the rewrite repeats. A cycle in FLAG_MOVES would repeat forever: the loop stops after one step per move. """ @@ -595,18 +677,39 @@ def _move_once(argv: list[str]) -> list[str] | None: canon = _canonical(tuple(argv)) leaf = max((leaf.path for leaf in LEAVES if canon[: len(leaf.path)] == leaf.path), key=len, default=()) - rewritten = list(argv) changed = False - for index, token in enumerate(rewritten): + tokens = list(argv) + for join in FLAG_JOINS: + if join.leaves and leaf not in join.leaves: + continue + folded = _fold_provider(tokens, join) + if folded is not None: + tokens, changed = folded, True + moves = [move for move in FLAG_MOVES if not move.leaves or leaf in move.leaves] + last_split = _last_split_flags(tokens, moves) + out: list[str] = [] + i = 0 + while i < len(tokens): + token = tokens[i] if token == "--": # the end of options: what follows is positional + out.extend(tokens[i:]) break name, equals, value = token.partition("=") - for move in FLAG_MOVES: - if name == move.old and (not move.leaves or leaf in move.leaves): - _rewrite_moved_token(rewritten, index, move, equals, value) - changed = True - break - return rewritten if changed else None + move = next((m for m in moves if name == m.old), None) + if move is None: + out.append(token) + i += 1 + continue + changed = True + if move.split: + original = i + items, i = _split_flag(tokens, i, equals, value, move) + if original == last_split[name]: + out.extend(items) + continue + items, i = _rewrite_moved_flag(tokens, i, move, equals, value) + out.extend(items) + return out if changed else None def moved_text(argv: list[str]) -> str: diff --git a/dokimi/dokimi/commands/answer_formats.py b/dokimi/dokimi/commands/answer_formats.py index 71f543aef..53a17b7af 100644 --- a/dokimi/dokimi/commands/answer_formats.py +++ b/dokimi/dokimi/commands/answer_formats.py @@ -15,6 +15,7 @@ import json from pathlib import Path from dokimi import cli_flags +from dokimi.cli_model_ref import add_model_flag from dokimi.utils import InputError, read_json_input @@ -116,8 +117,12 @@ def register_eval(score_sub, eval_sub, positive_int) -> None: r.add_argument("--answers", required=True, help="answers.v1 or arms output JSON") r.add_argument("--questions", required=True, help="Questions JSON from `eval import`") cli_flags.add(r, "output", "-o", "--out", dest="output", required=True, help="eval.v1 (answers) or arms (arms run) JSON to write") - r.add_argument("--judge-model", default=JUDGE_MODEL_FOR_PROVIDER, help=JUDGE_MODEL_HELP) - r.add_argument("--judge-provider", default=DEFAULT_JUDGE_PROVIDER, choices=JUDGE_PROVIDERS) + add_model_flag( + r, "--judge", dest="judge_model", provider_dest="judge_provider", + providers=JUDGE_PROVIDERS, default_model=JUDGE_MODEL_FOR_PROVIDER, default_provider=DEFAULT_JUDGE_PROVIDER, + help=JUDGE_MODEL_HELP, + named_dest="judge_provider_named", + ) r.add_argument("--no-judge", action="store_true", help="Leave judge checks unscored (no model calls)") r.add_argument("--concurrency", type=positive_int, default=4) r.set_defaults(func=cmd_eval_reference) diff --git a/dokimi/dokimi/commands/answers.py b/dokimi/dokimi/commands/answers.py index e5dd5cfc7..0609aca81 100644 --- a/dokimi/dokimi/commands/answers.py +++ b/dokimi/dokimi/commands/answers.py @@ -9,6 +9,7 @@ import sys from pathlib import Path +from dokimi.cli_model_ref import add_model_flag from dokimi import cli_flags from dokimi.llm import CALLER_CHOICES from dokimi.commands.evaluate import _require_ragas, _run_ragas_eval @@ -166,8 +167,11 @@ def register(sub, positive_int) -> None: help="Run name for multi-model comparison (e.g. gpt4o). " "Sets output to results/{product}_{name}/answers/{product}.json") cli_flags.add(gen_a_p, "output", "--out", dest="output", default=None, help="Output file (default: answers/{product}.json)") - gen_a_p.add_argument("--model", default=DEFAULT_ANSWER_MODEL, help="LLM model for answering") - gen_a_p.add_argument("--provider", default=DEFAULT_ANSWER_PROVIDER, choices=CALLER_CHOICES) + add_model_flag( + gen_a_p, "--model", dest="model", provider_dest="provider", + providers=CALLER_CHOICES, default_model=DEFAULT_ANSWER_MODEL, default_provider=DEFAULT_ANSWER_PROVIDER, + help="LLM model for answering", + ) cli_flags.add(gen_a_p, "tokens", "--retrieval-tokens", metavar="N", type=positive_int, default=DEFAULT_MAX_TOKENS_PER_QUESTION, dest="max_tokens", help="Max tokens to retrieve per question") gen_a_p.add_argument("--top-k", type=positive_int, default=None, help=f"Number of docs to retrieve before reranking (default from config/products.yaml retrieval.top_k or {DEFAULT_RETRIEVAL_TOP_K})") diff --git a/dokimi/dokimi/commands/arms.py b/dokimi/dokimi/commands/arms.py index 93b77bee2..0d816d2f1 100644 --- a/dokimi/dokimi/commands/arms.py +++ b/dokimi/dokimi/commands/arms.py @@ -12,6 +12,7 @@ from pathlib import Path from typing import TYPE_CHECKING +from dokimi.cli_model_ref import add_model_flag from dokimi import cli_flags from dokimi.commands.novelty_budget import fresh_partial_destination from dokimi.exit_codes import EXIT_FAILURE, EXIT_USAGE @@ -320,9 +321,11 @@ def register(sub, positive_int) -> None: arms_run_p.add_argument("--questions", required=True, help="Path to questions JSON file") cli_flags.add(arms_run_p, "arm", "--arm", required=True, dest="arms", action=cli_flags.JoinedValues, metavar="SPEC", help=_ARM_HELP) - arms_run_p.add_argument("--model", default=DEFAULT_ANSWER_MODEL, help="LLM for answering") - arms_run_p.add_argument("--provider", default=DEFAULT_ANSWER_PROVIDER, - choices=ANSWER_PROVIDERS) + add_model_flag( + arms_run_p, "--model", dest="model", provider_dest="provider", + providers=ANSWER_PROVIDERS, default_model=DEFAULT_ANSWER_MODEL, default_provider=DEFAULT_ANSWER_PROVIDER, + help="LLM for answering", + ) arms_run_p.add_argument("--harness", default="arms-runner", help="Execution harness label stamped into output (default: arms-runner)") arms_run_p.add_argument("--plugins", default="", @@ -438,9 +441,11 @@ def _add_common_run_args(parser, positive_int, *, matrix_required: bool = False) parser.add_argument("--questions", required=True, help="Path to questions JSON file") cli_flags.add(parser, "arm", "--arm", required=True, dest="arms", action=cli_flags.JoinedValues, metavar="SPEC", help=_ARM_HELP) - parser.add_argument("--model", default=DEFAULT_ANSWER_MODEL, help="LLM for answering") - parser.add_argument("--provider", default=DEFAULT_ANSWER_PROVIDER, - choices=ANSWER_PROVIDERS) + add_model_flag( + parser, "--model", dest="model", provider_dest="provider", + providers=ANSWER_PROVIDERS, default_model=DEFAULT_ANSWER_MODEL, default_provider=DEFAULT_ANSWER_PROVIDER, + help="LLM for answering", + ) parser.add_argument("--harness", default="arms-runner", help="Execution harness label stamped into output (default: arms-runner)") parser.add_argument("--plugins", default="", diff --git a/dokimi/dokimi/commands/backends.py b/dokimi/dokimi/commands/backends.py index e9104bab6..cf3125475 100644 --- a/dokimi/dokimi/commands/backends.py +++ b/dokimi/dokimi/commands/backends.py @@ -42,7 +42,7 @@ def register(sub, positive_int) -> None: """Add the `backends` command.""" p = sub.add_parser( "backends", - help="Coding-agent CLIs usable as --provider (claude-cli, codex-cli, copilot-cli): installed, version, signed " + help="Coding-agent CLIs usable with --model PROVIDER/MODEL (claude-cli, codex-cli, copilot-cli): installed, version, signed " "in. No model call.", ) p.add_argument("--json", action="store_true", help="Print cli_output.v1 on stdout (rows under data)") diff --git a/dokimi/dokimi/commands/benchmark.py b/dokimi/dokimi/commands/benchmark.py index 721658b40..a78d61a0e 100644 --- a/dokimi/dokimi/commands/benchmark.py +++ b/dokimi/dokimi/commands/benchmark.py @@ -13,6 +13,7 @@ from typing import Any, Callable, List, cast from dokimi import cli_flags +from dokimi.cli_model_ref import add_model_flag from dokimi.eval.judge_sampling import check_judge_sampling from dokimi.llm import CALLER_CHOICES, PROVIDER_ALIASES, PROVIDERS, credential_env_var, resolve_api_key, resolve_model from dokimi.utils import warn_judge_independence as _warn_judge_independence @@ -585,12 +586,12 @@ def register(sub, positive_int) -> None: help="Override doc/context source (default: first in registry entry)") cli_flags.add(bench_run_p, "output", "--out-dir", default=None, dest="output_dir", help="Output directory (default: results/{target}_final)") - bench_run_p.add_argument("--model", default=DEFAULT_ANSWER_MODEL) - bench_run_p.add_argument("--provider", default=DEFAULT_ANSWER_PROVIDER, choices=CALLER_CHOICES) - bench_run_p.add_argument("--judge-model", default=JUDGE_MODEL_FOR_PROVIDER, dest="judge_model", - help=JUDGE_MODEL_HELP) - bench_run_p.add_argument("--judge-provider", default=DEFAULT_JUDGE_PROVIDER, dest="judge_provider", - choices=JUDGE_PROVIDERS) + add_model_flag(bench_run_p, "--model", dest="model", provider_dest="provider", providers=CALLER_CHOICES, + default_model=DEFAULT_ANSWER_MODEL, default_provider=DEFAULT_ANSWER_PROVIDER) + add_model_flag(bench_run_p, "--judge", dest="judge_model", provider_dest="judge_provider", + providers=JUDGE_PROVIDERS, default_model=JUDGE_MODEL_FOR_PROVIDER, + default_provider=DEFAULT_JUDGE_PROVIDER, named_dest="judge_provider_named", + help=JUDGE_MODEL_HELP) bench_run_p.add_argument("--judge-temperature", type=float, default=None, dest="judge_temperature", help="Judge sampling temperature, recorded as judge_temperature in the eval output (default: provider default)") bench_run_p.add_argument("--judge-placeholder", action="store_true", dest="judge_placeholder", @@ -626,11 +627,12 @@ def register(sub, positive_int) -> None: bench_pre_p.add_argument("--library", "--target", required=True, dest="library", help="Target key from registry (e.g., onetbb)") bench_pre_p.add_argument("--doc-source", default=None, dest="doc_source", help="Override doc/context source") cli_flags.add(bench_pre_p, "output", "--out-dir", default=None, dest="output_dir", help="Output directory (default: results/{target}_final)") - bench_pre_p.add_argument("--model", default=DEFAULT_ANSWER_MODEL) - bench_pre_p.add_argument("--provider", default=DEFAULT_ANSWER_PROVIDER, choices=CALLER_CHOICES) - bench_pre_p.add_argument("--judge-model", default=JUDGE_MODEL_FOR_PROVIDER, dest="judge_model", - help=JUDGE_MODEL_HELP) - bench_pre_p.add_argument("--judge-provider", default=DEFAULT_JUDGE_PROVIDER, dest="judge_provider", choices=JUDGE_PROVIDERS) + add_model_flag(bench_pre_p, "--model", dest="model", provider_dest="provider", providers=CALLER_CHOICES, + default_model=DEFAULT_ANSWER_MODEL, default_provider=DEFAULT_ANSWER_PROVIDER) + add_model_flag(bench_pre_p, "--judge", dest="judge_model", provider_dest="judge_provider", + providers=JUDGE_PROVIDERS, default_model=JUDGE_MODEL_FOR_PROVIDER, + default_provider=DEFAULT_JUDGE_PROVIDER, named_dest="judge_provider_named", + help=JUDGE_MODEL_HELP) # Preflight makes no LLM call, but it plans the run that `benchmark run` makes, so it refuses the judge that run refuses. bench_pre_p.set_defaults(judge=True) bench_pre_p.add_argument("--registry", default=None, help="Path to custom products.yaml") @@ -651,12 +653,12 @@ def register(sub, positive_int) -> None: bench_batch_p.add_argument("--all", action="store_true", dest="all_libraries", help="Run for all libraries in registry") cli_flags.add(bench_batch_p, "output", "--out-dir", default="results", dest="output_dir") - bench_batch_p.add_argument("--model", default=DEFAULT_ANSWER_MODEL) - bench_batch_p.add_argument("--provider", default=DEFAULT_ANSWER_PROVIDER, choices=CALLER_CHOICES) - bench_batch_p.add_argument("--judge-model", default=JUDGE_MODEL_FOR_PROVIDER, dest="judge_model", - help=JUDGE_MODEL_HELP) - bench_batch_p.add_argument("--judge-provider", default=DEFAULT_JUDGE_PROVIDER, dest="judge_provider", - choices=JUDGE_PROVIDERS) + add_model_flag(bench_batch_p, "--model", dest="model", provider_dest="provider", providers=CALLER_CHOICES, + default_model=DEFAULT_ANSWER_MODEL, default_provider=DEFAULT_ANSWER_PROVIDER) + add_model_flag(bench_batch_p, "--judge", dest="judge_model", provider_dest="judge_provider", + providers=JUDGE_PROVIDERS, default_model=JUDGE_MODEL_FOR_PROVIDER, + default_provider=DEFAULT_JUDGE_PROVIDER, named_dest="judge_provider_named", + help=JUDGE_MODEL_HELP) cli_flags.add(bench_batch_p, "tokens", "--retrieval-tokens", metavar="N", type=positive_int, default=DEFAULT_MAX_TOKENS_PER_QUESTION, dest="max_tokens", help="Max tokens to retrieve per question from doc source (default: 4000)") diff --git a/dokimi/dokimi/commands/catalog.py b/dokimi/dokimi/commands/catalog.py index 8614e6f1e..e4c51be3a 100644 --- a/dokimi/dokimi/commands/catalog.py +++ b/dokimi/dokimi/commands/catalog.py @@ -17,13 +17,17 @@ import argparse import json import sys +from collections.abc import Callable +from functools import cache from pathlib import Path +from dokimi.cli_model_ref import add_model_flag from dokimi.commands.catalog_scan import ( ROW_STATES, fail_on_reason, fails_on_finding, is_plain_markdown, listing_failed, listing_message, listing_tally, not_checked, row_ignore, ok_text, plain_note, print_skill_row, skill_row, skipped_note, unrestricted_and_risky, ) from dokimi.external.catalog_rates import RateTally, text_lines +from dokimi.llm import ANSWER_PROVIDERS, PROVIDER_ALIASES, is_litellm_route from dokimi.utils import InputError @@ -400,6 +404,35 @@ def _discover_catalog_skills(catalog_root: Path) -> list: raise InputError(f"--catalog {catalog_root}: {exc}") from exc +def _trigger_rewrite_model(model: str, provider: str, *, named: bool) -> tuple[str, str]: + """Resolve external providers after input validation, without importing LiteLLM at parse time.""" + prefix, slash, name = model.partition("/") + if not named and slash and is_litellm_route(prefix): + if not name.strip(): + raise InputError(f"--model {prefix}/ has no model: pass --model {prefix}/") + # LiteLLM needs its provider prefix on model names that already contain a slash. + return (model if "/" in name else name), prefix + return model, provider + + +def _trigger_rewriter(args: argparse.Namespace, prompt: str) -> Callable[[str], str] | None: + if not args.rewrite: + return None + if not args.model: + raise InputError("--rewrite needs --model") + from dokimi.llm import llm_call + + @cache + def rewrite_model() -> tuple[str, str]: + return _trigger_rewrite_model(args.model, args.provider, named=args.rewrite_provider_named) + + def rewrite(text: str) -> str: + model, provider = rewrite_model() + return llm_call(prompt + text, model=model, provider=provider) + + return rewrite + + def cmd_catalog_trigger_set(args: argparse.Namespace) -> None: import json @@ -425,18 +458,11 @@ def cmd_catalog_trigger_set(args: argparse.Namespace) -> None: specs = list(args.questions or []) + [ None if args.format == "questions" else spec for spec in (args.trigger_set or [])] - rewrite = None - if args.rewrite: - if not args.model: - raise InputError("--rewrite needs --model") - from dokimi.llm import llm_call - - def rewrite(text: str) -> str: - return llm_call(ts.REWRITE_PROMPT + text, model=args.model, provider=args.provider) + rewrite = _trigger_rewriter(args, ts.REWRITE_PROMPT) try: queries = ts.build_trigger_set(sources, catalog, rewrite=rewrite, specs=specs) - except ts.TriggerSetInputError as exc: + except (ts.TriggerSetInputError, InputError) as exc: raise InputError(str(exc)) from exc except ValueError as exc: # A --rewrite that returned nothing: a runtime failure, not a bad invocation. @@ -751,8 +777,12 @@ def register(sub, positive_int, eval_sub) -> None: ts_p.add_argument("--target", help="Target skill for --format skill-creator") ts_p.add_argument("--rewrite", action="store_true", help="Rewrite each question into first-person user voice (model sees only the question)") - ts_p.add_argument("--model", help="Model for --rewrite") - ts_p.add_argument("--provider", default="openai", help="Provider for --rewrite (default: openai)") + add_model_flag( + ts_p, "--model", dest="model", provider_dest="provider", + providers=(*ANSWER_PROVIDERS, *PROVIDER_ALIASES), named_dest="rewrite_provider_named", + default_model=None, default_provider="openai", + help="Model for --rewrite (PROVIDER/MODEL or MODEL; default provider openai)", + ) cli_flags.add(ts_p, "fail_on", "--fail-on", choices=("warn",), default=None, help="warn: exit 1 if any query names a skill, keeps exam framing, or has an unresolved @field label") ts_p.add_argument("--out", required=True, help="Output JSON path") diff --git a/dokimi/dokimi/commands/delivery.py b/dokimi/dokimi/commands/delivery.py index 8dba91e17..15aff0514 100644 --- a/dokimi/dokimi/commands/delivery.py +++ b/dokimi/dokimi/commands/delivery.py @@ -7,6 +7,7 @@ from pathlib import Path from dokimi import artifacts, cli_output +from dokimi.cli_model_ref import add_model_flag from dokimi.gate.delivery import evaluate from dokimi.llm import ANSWER_PROVIDERS from dokimi.harnesses.delivery import run @@ -94,12 +95,11 @@ def register(sub: argparse._SubParsersAction) -> None: parser.add_argument("--" + flag, required=True, type=Path) if mode == "scan": adapter = parser.add_mutually_exclusive_group(required=True) - adapter.add_argument("--model", help="Pinned model for a one-turn shell consumer") + add_model_flag(adapter, "--model", dest="model", provider_dest="provider", + providers=ANSWER_PROVIDERS, default_model=None, default_provider="openai", + help="Pinned model for a one-turn shell consumer") adapter.add_argument( "--fixture", action="store_true", help="Use recorded responses from the task catalog", ) - parser.add_argument( - "--provider", choices=ANSWER_PROVIDERS, default="openai" - ) diff --git a/dokimi/dokimi/commands/evaluate.py b/dokimi/dokimi/commands/evaluate.py index 0ced83126..c7748ba7f 100644 --- a/dokimi/dokimi/commands/evaluate.py +++ b/dokimi/dokimi/commands/evaluate.py @@ -11,6 +11,7 @@ import sys from pathlib import Path +from dokimi.cli_model_ref import add_model_flag from dokimi.commands import eval_coverage, eval_graph from dokimi.llm import ANSWER_PROVIDERS from dokimi.cli_types import non_negative_int @@ -94,7 +95,7 @@ def cmd_eval_panel_score(args: argparse.Namespace) -> None: """Score answers using a multi-judge panel (parallel, role-diverse judges).""" from dokimi.eval.panel import JudgePanel, JudgeConfig, DEFAULT_PANEL, JUDGE_ROLES - # --judge-configs takes priority over --model/--provider/--roles + # --judge-configs takes priority over --model/--roles # Format: "technical_expert:claude-sonnet-5-5:anthropic,developer_advocate:claude-opus-5-5:anthropic,doc_reviewer:gemini-2.0-flash:google" if getattr(args, "judge_configs", None): judges = [] @@ -502,8 +503,12 @@ def register(sub, positive_int): cli_flags.add(score_p, "run_name", "--name", default=None, dest="run_id", metavar="NAME", help="Run name (e.g. gpt4o). Sets output to results/{product}_{name}/eval/{product}.json") cli_flags.add(score_p, "output", "--out", dest="output", default=None, help="Output file (default: eval/{product}.json)") - score_p.add_argument("--judge-model", default=JUDGE_MODEL_FOR_PROVIDER, help=JUDGE_MODEL_HELP) - score_p.add_argument("--judge-provider", default=DEFAULT_JUDGE_PROVIDER, choices=JUDGE_PROVIDERS) + add_model_flag( + score_p, "--judge", dest="judge_model", provider_dest="judge_provider", + providers=JUDGE_PROVIDERS, default_model=JUDGE_MODEL_FOR_PROVIDER, default_provider=DEFAULT_JUDGE_PROVIDER, + help=JUDGE_MODEL_HELP, + named_dest="judge_provider_named", + ) score_p.add_argument("--concurrency", type=positive_int, default=DEFAULT_CONCURRENCY, help="Parallel judge calls (default: 5)") score_p.add_argument("--judge-temperature", type=float, default=None, dest="judge_temperature", help="Judge sampling temperature, recorded as judge_temperature in the output") @@ -568,13 +573,17 @@ def register(sub, positive_int): validity_p.add_argument("--escalate-model", default=None, dest="escalate_model", help="With --mode pairwise: re-ask pairs the judge answered inconsistently across the two orders with this model") validity_p.add_argument("--escalate-provider", default=None, dest="escalate_provider", choices=JUDGE_PROVIDERS, - help="Provider for --escalate-model (default: --judge-provider)") + help="Provider for --escalate-model (defaults to the provider from --judge)") validity_p.add_argument("--escalate-ties", action="store_true", dest="escalate_ties", help="Also escalate pairs called TIE in both orders (default: only order-inconsistent)") validity_p.add_argument("--concurrency", type=positive_int, default=DEFAULT_CONCURRENCY, help=f"Parallel judge calls (default: {DEFAULT_CONCURRENCY})") - validity_p.add_argument("--judge-model", default=JUDGE_MODEL_FOR_PROVIDER, help=JUDGE_MODEL_HELP) - validity_p.add_argument("--judge-provider", default=DEFAULT_JUDGE_PROVIDER, choices=JUDGE_PROVIDERS) + add_model_flag( + validity_p, "--judge", dest="judge_model", provider_dest="judge_provider", + providers=JUDGE_PROVIDERS, default_model=JUDGE_MODEL_FOR_PROVIDER, default_provider=DEFAULT_JUDGE_PROVIDER, + help=JUDGE_MODEL_HELP, + named_dest="judge_provider_named", + ) validity_p.add_argument("--judge-temperature", type=float, default=None, dest="judge_temperature", help="Judge sampling temperature; match arms run --judge-temperature to certify the same judge") validity_p.add_argument("--scorer", default="judge", @@ -618,14 +627,17 @@ def register(sub, positive_int): panel_p.add_argument("--answers", required=True, help="Path to answers JSON file") panel_p.add_argument("--product", required=True, help="Product name (e.g., oneTBB)") cli_flags.add(panel_p, "output", "--out", dest="output", default=None, help="Output file (default: eval/{product}_panel.json)") - panel_p.add_argument("--model", default=DEFAULT_JUDGE_MODEL, help="Default LLM model for all judges") - panel_p.add_argument("--provider", default=DEFAULT_JUDGE_PROVIDER, choices=ANSWER_PROVIDERS) + add_model_flag( + panel_p, "--model", dest="model", provider_dest="provider", + providers=ANSWER_PROVIDERS, default_model=DEFAULT_JUDGE_MODEL, default_provider=DEFAULT_JUDGE_PROVIDER, + help="Default LLM model for all judges", + ) panel_p.add_argument("--roles", default=None, help="Comma-separated judge roles (default: technical_expert,developer_advocate,doc_reviewer)") panel_p.add_argument( "--judge-configs", default=None, dest="judge_configs", help=( - "Per-role model config (overrides --model/--provider/--roles). " + "Per-role model config (overrides --model/--roles). " "Format: 'role:model:provider,...' " "e.g. 'technical_expert:claude-sonnet-5-5:anthropic," "developer_advocate:claude-opus-5-5:anthropic," diff --git a/dokimi/dokimi/commands/judge_reliability.py b/dokimi/dokimi/commands/judge_reliability.py index e23fc4f37..8048e3510 100644 --- a/dokimi/dokimi/commands/judge_reliability.py +++ b/dokimi/dokimi/commands/judge_reliability.py @@ -11,6 +11,7 @@ from typing import TYPE_CHECKING, Any, Optional, Sequence from dokimi import cli_flags +from dokimi.cli_model_ref import add_model_flag from dokimi.defaults import ( DEFAULT_CONCURRENCY, DEFAULT_JUDGE_PROVIDER, @@ -389,16 +390,16 @@ def score(library, question, answer, ground_truth, context): for p in args.pairwise or []] from_files += [_result_measure(p, "questions", list, coverage_measure) for p in args.checklist or []] validity = [_load_json_object(v, "summary")["summary"] for v in args.validity or []] - specs = [j.strip() for j in (args.judges or "").split(",") if j.strip()] + specs = [j.strip() for raw in (args.judges or []) for j in raw.split(",") if j.strip()] if specs: - _require_arms(args.answers, records, "eval judge agreement --judges") + _require_arms(args.answers, records, "eval judge agreement --judge") scored_answers(records) # refuse a blank question before the probe call _check_judge_temperature([(m, p) for p, _, m in (s.partition("/") for s in specs) if m and p in JUDGE_PROVIDERS], args.judge_temperature) for spec in dict.fromkeys(specs): provider, _, model = spec.partition("/") if not model or provider not in JUDGE_PROVIDERS: - raise InputError(f"--judges entry '{spec}' must be provider/model, provider in {JUDGE_PROVIDERS}") + raise InputError(f"--judge entry '{spec}' must be provider/model, provider in {JUDGE_PROVIDERS}") warn_recorded_self_judge(data, [(model, provider)], "eval judge agreement") print(f"Scoring with {spec} ...", flush=True) judge = Judge(model=model, provider=provider, temperature=args.judge_temperature) @@ -417,7 +418,7 @@ def score(library, question, answer, ground_truth, context): for missed in report.apply_validity(validity): print(f"⚠️ --validity for `{missed}` matches no measure (compare the judge labels and contexts)", file=sys.stderr) if not report.measures: - raise InputError("nothing to compare — give --judges, --checklist, or an answers file with evaluations") + raise InputError("nothing to compare — give --judge, --checklist, or an answers file with evaluations") md = report.format_markdown() out = Path(args.output or Path(args.answers).with_name(Path(args.answers).stem + "_crossjudge.json")) save_artifact_or_exit("cross_judge", {**report.to_dict(), "judge_temperature": args.judge_temperature}, out, @@ -475,8 +476,12 @@ def register(score_sub, judge_sub, positive_int) -> None: ck.add_argument("--baseline-arm", default=None, dest="baseline_arm", help="Arm the others are compared to (default: the run's baseline_arm)") ck.add_argument("--arms", default=None, help="Comma-separated arms to check (default: all)") - ck.add_argument("--judge-model", default=JUDGE_MODEL_FOR_PROVIDER, help=JUDGE_MODEL_HELP) - ck.add_argument("--judge-provider", default=DEFAULT_JUDGE_PROVIDER, choices=JUDGE_PROVIDERS) + add_model_flag( + ck, "--judge", dest="judge_model", provider_dest="judge_provider", + providers=JUDGE_PROVIDERS, default_model=JUDGE_MODEL_FOR_PROVIDER, default_provider=DEFAULT_JUDGE_PROVIDER, + help=JUDGE_MODEL_HELP, + named_dest="judge_provider_named", + ) ck.add_argument("--judge-temperature", type=float, default=None, dest="judge_temperature", help="Judge sampling temperature, recorded as judge_temperature in the output") ck.add_argument("--concurrency", type=positive_int, default=DEFAULT_CONCURRENCY) @@ -500,8 +505,12 @@ def register(score_sub, judge_sub, positive_int) -> None: jw.add_argument("--min-accuracy", type=float, default=DEFAULT_MIN_ACCURACY, dest="min_accuracy") jw.add_argument("--strict", action="store_true", help="Exit 1 when any variant is FRAGILE or a condition has no scored pair") - jw.add_argument("--judge-model", default=JUDGE_MODEL_FOR_PROVIDER, help=JUDGE_MODEL_HELP) - jw.add_argument("--judge-provider", default=DEFAULT_JUDGE_PROVIDER, choices=JUDGE_PROVIDERS) + add_model_flag( + jw, "--judge", dest="judge_model", provider_dest="judge_provider", + providers=JUDGE_PROVIDERS, default_model=JUDGE_MODEL_FOR_PROVIDER, default_provider=DEFAULT_JUDGE_PROVIDER, + help=JUDGE_MODEL_HELP, + named_dest="judge_provider_named", + ) jw.add_argument("--judge-temperature", type=float, default=None, dest="judge_temperature", help="Judge sampling temperature, recorded as judge_temperature in the output") jw.add_argument("--concurrency", type=positive_int, default=DEFAULT_CONCURRENCY) @@ -513,9 +522,10 @@ def register(score_sub, judge_sub, positive_int) -> None: help="Each arm's delta under several judges and axes, labelled CONSISTENT / JUDGE-DEPENDENT / ...", ) cj.add_argument("--answers", required=True, help="Arms output JSON (arms run --out)") - cj.add_argument("--judges", default=None, - help="Comma-separated provider/model judges to re-score with, e.g. " - "amazon-bedrock/us.anthropic.claude-haiku-5-5,amazon-bedrock/openai.gpt-oss-120b-1:0") + cj.add_argument("--judge", dest="judges", action="append", default=None, metavar="PROVIDER/MODEL", + help="A judge to re-score with, provider/model (repeatable), e.g. " + "--judge amazon-bedrock/us.anthropic.claude-haiku-5-5 " + "--judge amazon-bedrock/openai.gpt-oss-120b-1:0") cj.add_argument("--checklist", action="append", default=None, help="An `eval score checklist` JSON to include as a coverage measure (repeatable)") cj.add_argument("--pairwise", action="append", default=None, @@ -551,8 +561,12 @@ def register(score_sub, judge_sub, positive_int) -> None: pw.add_argument("--product", default=None, help="Library name (default: read from answers file)") pw.add_argument("--baseline-arm", default=None, dest="baseline_arm") pw.add_argument("--arms", default=None, help="Comma-separated arms to compare (default: all)") - pw.add_argument("--judge-model", default=JUDGE_MODEL_FOR_PROVIDER, help=JUDGE_MODEL_HELP) - pw.add_argument("--judge-provider", default=DEFAULT_JUDGE_PROVIDER, choices=JUDGE_PROVIDERS) + add_model_flag( + pw, "--judge", dest="judge_model", provider_dest="judge_provider", + providers=JUDGE_PROVIDERS, default_model=JUDGE_MODEL_FOR_PROVIDER, default_provider=DEFAULT_JUDGE_PROVIDER, + help=JUDGE_MODEL_HELP, + named_dest="judge_provider_named", + ) pw.add_argument("--judge-temperature", type=float, default=None, dest="judge_temperature", help="Judge sampling temperature, recorded as judge_temperature in the output") pw.add_argument("--escalate-model", default=None, dest="escalate_model", diff --git a/dokimi/dokimi/commands/novelty.py b/dokimi/dokimi/commands/novelty.py index e50379631..f2a0cfa48 100644 --- a/dokimi/dokimi/commands/novelty.py +++ b/dokimi/dokimi/commands/novelty.py @@ -130,7 +130,7 @@ def cmd_novelty_atoms(args: argparse.Namespace) -> None: artifact_bundle = _bundle_from_args(args) settings = _settings(args) - extractor = cost.client(args.extract_model or args.model, args.provider, "extractor", args) + extractor = cost.client(args.extract_model or args.model, args.extract_provider or args.provider, "extractor", args) spans = segment(artifact_bundle.text) cap = settings.values["max_atoms"] extraction = ExtractionReport() diff --git a/dokimi/dokimi/commands/novelty_atoms_file.py b/dokimi/dokimi/commands/novelty_atoms_file.py index 1ccc7eed1..e3936f5b8 100644 --- a/dokimi/dokimi/commands/novelty_atoms_file.py +++ b/dokimi/dokimi/commands/novelty_atoms_file.py @@ -188,7 +188,7 @@ def score_candidates(args: argparse.Namespace, spans: list, atoms: list, scored: from dokimi.novelty.shorten import build_candidates cache_dir = usable_cache_dir(args.cache_dir) - client = cost.client(args.extract_model or args.model, args.provider, "oracle", args) \ + client = cost.client(args.extract_model or args.model, args.extract_provider or args.provider, "oracle", args) \ if not args.lexical_only else None oracle = RetentionOracle(client=client, cache_dir=cache_dir) try: diff --git a/dokimi/dokimi/commands/novelty_flags.py b/dokimi/dokimi/commands/novelty_flags.py index 3f70303e6..5550331f9 100644 --- a/dokimi/dokimi/commands/novelty_flags.py +++ b/dokimi/dokimi/commands/novelty_flags.py @@ -11,6 +11,7 @@ import argparse +from dokimi.cli_model_ref import add_model_flag from dokimi import cli_flags from dokimi.cli_types import unit_interval from dokimi.commands.novelty_run import add_judge2_args, add_panel_args, add_spend_cap @@ -72,6 +73,13 @@ def _add_common(parser: argparse.ArgumentParser, positive_int) -> None: "are reproducible across runs") +def _add_extractor_arg(parser: argparse.ArgumentParser, help: str) -> None: + add_model_flag( + parser, "--extract-model", dest="extract_model", provider_dest="extract_provider", + providers=PROVIDERS, default_model=None, default_provider=None, help=help, + ) + + def _add_cache_dir(parser: argparse.ArgumentParser, *, reruns_pay_for: str) -> None: """The retention memo: read by the commands that adjudicate retention (analyze, shorten).""" parser.add_argument("--cache-dir", default=None, dest="cache_dir", @@ -82,26 +90,25 @@ def _add_cache_dir(parser: argparse.ArgumentParser, *, reruns_pay_for: str) -> N def _add_model_args(parser: argparse.ArgumentParser, positive_int) -> None: - parser.add_argument("--model", default=DEFAULT_ANSWER_MODEL, - help="The model under measurement — novelty is a property of the " - "(artifact, model) pair, not of the file") - parser.add_argument("--provider", default=DEFAULT_ANSWER_PROVIDER, choices=PROVIDERS) + add_model_flag( + parser, "--model", dest="model", provider_dest="provider", + providers=PROVIDERS, default_model=DEFAULT_ANSWER_MODEL, default_provider=DEFAULT_ANSWER_PROVIDER, + help="The model under measurement — novelty is a property of the " + "(artifact, model) pair, not of the file", + ) parser.add_argument("--judge-model", default=None, dest="judge_model", help="Grading model; must differ from --model (default: " f"{DEFAULT_JUDGE_PROVIDER}/{DEFAULT_JUDGE_MODEL}, or " f"{DEFAULT_GENERATOR_PROVIDER}/{DEFAULT_GENERATOR_MODEL} when " "--model is that judge). A --judge-model without " - "--judge-provider runs on --provider") + "--judge-provider runs on the provider from --model") parser.add_argument("--judge-provider", default=None, dest="judge_provider", choices=PROVIDERS, help="Provider for the judge. Without --judge-model, the default judge " "that runs on this provider; if none does, the run exits asking " "for --judge-model") add_panel_args(parser) - parser.add_argument("--extract-model", default=None, dest="extract_model", - help="Extractor/adjudicator model (defaults to --judge-model, so the " - "answering model never writes its own answer key)") - parser.add_argument("--extract-provider", default=None, dest="extract_provider", - choices=PROVIDERS) + _add_extractor_arg(parser, "Extractor/adjudicator model (defaults to --judge-model, " + "so the answering model never writes its own answer key)") cli_flags.add(parser, "tokens", "--max-output-tokens", metavar="N", type=positive_int, default=None, dest="max_tokens", help="Output-token ceiling. Raise for reasoning models, which can " "spend the provider default on reasoning and return empty text") diff --git a/dokimi/dokimi/commands/orchestrate.py b/dokimi/dokimi/commands/orchestrate.py index 64a9d358b..32f1bda30 100644 --- a/dokimi/dokimi/commands/orchestrate.py +++ b/dokimi/dokimi/commands/orchestrate.py @@ -9,6 +9,7 @@ import sys from pathlib import Path +from dokimi.cli_model_ref import add_model_flag from dokimi import cli_flags from dokimi.eval.judge_sampling import check_judge_sampling from dokimi.llm import CALLER_CHOICES @@ -135,10 +136,17 @@ def register(sub, positive_int) -> None: help="Directory where the golden question set _golden.json " "is looked up, for example a checkout of the evaluation-content " "repository: --questions-root /path/to/content-repo/questions") - eval_p.add_argument("--model", default=DEFAULT_ANSWER_MODEL, help="LLM model for generation/answering") - eval_p.add_argument("--provider", default=DEFAULT_ANSWER_PROVIDER, choices=CALLER_CHOICES) - eval_p.add_argument("--judge-model", default=JUDGE_MODEL_FOR_PROVIDER, help=JUDGE_MODEL_HELP) - eval_p.add_argument("--judge-provider", default=DEFAULT_JUDGE_PROVIDER, choices=JUDGE_PROVIDERS) + add_model_flag( + eval_p, "--model", dest="model", provider_dest="provider", + providers=CALLER_CHOICES, default_model=DEFAULT_ANSWER_MODEL, default_provider=DEFAULT_ANSWER_PROVIDER, + help="LLM model for generation/answering", + ) + add_model_flag( + eval_p, "--judge", dest="judge_model", provider_dest="judge_provider", + providers=JUDGE_PROVIDERS, default_model=JUDGE_MODEL_FOR_PROVIDER, default_provider=DEFAULT_JUDGE_PROVIDER, + help=JUDGE_MODEL_HELP, + named_dest="judge_provider_named", + ) eval_p.add_argument("--judge-temperature", type=float, default=None, dest="judge_temperature", help="Judge sampling temperature, recorded as judge_temperature in the eval output") eval_p.add_argument("--judge-placeholder", action="store_true", dest="judge_placeholder", diff --git a/dokimi/dokimi/commands/personas.py b/dokimi/dokimi/commands/personas.py index 9b7096138..b65981f0e 100644 --- a/dokimi/dokimi/commands/personas.py +++ b/dokimi/dokimi/commands/personas.py @@ -10,6 +10,7 @@ from pathlib import Path from dokimi import cli_flags +from dokimi.cli_model_ref import add_model_flag from dokimi.cli_types import positive_usd from dokimi.llm import CALLER_CHOICES from dokimi.commands._output import exit_on_rejected, exit_on_unwritable @@ -177,8 +178,11 @@ def register(eval_sub, positive_int) -> None: discover_p.add_argument("--description", default=None, help="Plain-text product description (used when --repo is not available).") cli_flags.add(discover_p, "output", "--out", dest="output", default=None, help="Output file (default: personas/{product}.json)") discover_p.add_argument("--count", type=int, default=5, help="Target number of personas (5-8)") - discover_p.add_argument("--model", default=DEFAULT_GENERATOR_MODEL, help="LLM model for generation") - discover_p.add_argument("--provider", default=DEFAULT_GENERATOR_PROVIDER, choices=CALLER_CHOICES) + add_model_flag( + discover_p, "--model", dest="model", provider_dest="provider", + providers=CALLER_CHOICES, default_model=DEFAULT_GENERATOR_MODEL, default_provider=DEFAULT_GENERATOR_PROVIDER, + help="LLM model for generation", + ) discover_p.add_argument("--github-token", default=None, help="GitHub token (or set GITHUB_TOKEN env)") discover_p.add_argument("--save-analysis", action="store_true", help="Save intermediate analysis JSON") cli_flags.add(discover_p, "dry_run", "--dry-run", action="store_true", dest="dry_run", diff --git a/dokimi/dokimi/commands/questions.py b/dokimi/dokimi/commands/questions.py index 5ec995699..8320a1b35 100644 --- a/dokimi/dokimi/commands/questions.py +++ b/dokimi/dokimi/commands/questions.py @@ -12,6 +12,7 @@ from typing import Any, Dict from dokimi import cli_flags +from dokimi.cli_model_ref import add_model_flag from dokimi.llm import ANSWER_PROVIDERS, CALLER_CHOICES from dokimi.commands._output import exit_on_rejected, exit_on_unwritable from dokimi.defaults import DEFAULT_GENERATOR_MODEL, DEFAULT_GENERATOR_PROVIDER @@ -380,8 +381,11 @@ def register(eval_sub, positive_int) -> None: help="Embedding backend for deduplication: openai, local " "(sentence-transformers, no API key), or auto " "(openai when a key is set, else local)") - gen_q_p.add_argument("--model", default=DEFAULT_GENERATOR_MODEL, help="LLM model for generation") - gen_q_p.add_argument("--provider", default=DEFAULT_GENERATOR_PROVIDER, choices=CALLER_CHOICES) + add_model_flag( + gen_q_p, "--model", dest="model", provider_dest="provider", + providers=CALLER_CHOICES, default_model=DEFAULT_GENERATOR_MODEL, default_provider=DEFAULT_GENERATOR_PROVIDER, + help="LLM model for generation", + ) gen_q_p.add_argument("--doc-source", default="context7", help="Documentation source for topic extraction: 'context7', 'local:', 'url:'") gen_q_p.add_argument("--context7-id", default=None, dest="context7_id", @@ -393,8 +397,11 @@ def register(eval_sub, positive_int) -> None: analyze_q_p.add_argument("--questions", required=True, help="Path to questions JSON file") analyze_q_p.add_argument("--product", required=True, help="Product name (e.g., oneTBB)") cli_flags.add(analyze_q_p, "output", "--out", dest="output", default=None, help="Output report JSON (default: reports/{product}_question_quality.json)") - analyze_q_p.add_argument("--model", default=DEFAULT_GENERATOR_MODEL, help="LLM model for classification") - analyze_q_p.add_argument("--provider", default=DEFAULT_GENERATOR_PROVIDER, choices=ANSWER_PROVIDERS) + add_model_flag( + analyze_q_p, "--model", dest="model", provider_dest="provider", + providers=ANSWER_PROVIDERS, default_model=DEFAULT_GENERATOR_MODEL, default_provider=DEFAULT_GENERATOR_PROVIDER, + help="LLM model for classification", + ) analyze_q_p.add_argument("--concurrency", type=int, default=5, help="Parallel classification requests") analyze_q_p.set_defaults(func=cmd_questions_analyze) @@ -424,8 +431,10 @@ def register(eval_sub, positive_int) -> None: panel_q_p.add_argument("--product", required=True, help="Product name (e.g., oneDAL)") cli_flags.add(panel_q_p, "output", "--out", dest="output", default=None, help="Output report JSON (default: reports/{product}_question_panel.json)") - panel_q_p.add_argument("--model", default=DEFAULT_GENERATOR_MODEL) - panel_q_p.add_argument("--provider", default=DEFAULT_GENERATOR_PROVIDER, choices=ANSWER_PROVIDERS) + add_model_flag( + panel_q_p, "--model", dest="model", provider_dest="provider", + providers=ANSWER_PROVIDERS, default_model=DEFAULT_GENERATOR_MODEL, default_provider=DEFAULT_GENERATOR_PROVIDER, + ) panel_q_p.add_argument("--reviewers", default=None, help="Comma-separated reviewers (default: domain_expert,user_advocate,qa_engineer)") panel_q_p.add_argument("--concurrency", type=positive_int, default=6) diff --git a/dokimi/dokimi/commands/routing_parser.py b/dokimi/dokimi/commands/routing_parser.py index ed1ef7f00..0291276ab 100644 --- a/dokimi/dokimi/commands/routing_parser.py +++ b/dokimi/dokimi/commands/routing_parser.py @@ -8,6 +8,7 @@ from __future__ import annotations +from dokimi.cli_model_ref import add_model_flag from dokimi import cli_flags from dokimi.commands.novelty_routing import cmd_routing, cmd_skill_routing from dokimi.commands.skill_sensitivity import cmd_skill_sensitivity @@ -66,10 +67,11 @@ def add_skill_sensitivity(skill_sub, positive_int) -> None: help="JSON list (or one per line) of user-shaped requests that should select this " "skill, written independently of it. Headings are not offered: they would set " "the skill's own relevance") - sens_p.add_argument("--model", default=None, required=True, - help="The model that picks from the cards (required: the sentence effect is measured " - "through its choice)") - sens_p.add_argument("--provider", default=DEFAULT_ANSWER_PROVIDER, choices=PROVIDERS) + add_model_flag( + sens_p, "--model", dest="model", provider_dest="provider", providers=PROVIDERS, + default_model=None, default_provider=DEFAULT_ANSWER_PROVIDER, required=True, + help="The model that picks from the cards (required: the sentence effect is measured through its choice)", + ) cli_flags.add(sens_p, "tokens", "--max-output-tokens", metavar="N", type=positive_int, default=None, dest="max_tokens") sens_p.add_argument("--seed", type=int, default=0, @@ -132,10 +134,12 @@ def _add_routing_options(routing_p, positive_int, refused: bool = False) -> None "Derive queries from the artifact's headings. Triage only: the " "artifact then sets its own problem scope and relevance, and " "the result is stamped as such") - routing_p.add_argument("--model", default=None, - help="Also ask this model to pick from the same cards. Optional: " - "without it only the free lexical floor is computed") - routing_p.add_argument("--provider", default=DEFAULT_ANSWER_PROVIDER, choices=PROVIDERS) + add_model_flag( + routing_p, "--model", dest="model", provider_dest="provider", + providers=PROVIDERS, default_model=None, default_provider=DEFAULT_ANSWER_PROVIDER, + help="Also ask this model to pick from the same cards. Optional: " + "without it only the free lexical floor is computed", + ) cli_flags.add(routing_p, "tokens", "--max-output-tokens", metavar="N", type=positive_int, default=None, dest="max_tokens") routing_p.add_argument("--seed", type=int, default=0, help="Seeds only the card order (a seeded permutation per query, so " diff --git a/dokimi/dokimi/commands/skill.py b/dokimi/dokimi/commands/skill.py index 644262dc2..031684ad2 100644 --- a/dokimi/dokimi/commands/skill.py +++ b/dokimi/dokimi/commands/skill.py @@ -10,6 +10,7 @@ from __future__ import annotations +from dokimi.cli_model_ref import add_model_flag from dokimi import cli_flags import argparse @@ -59,7 +60,9 @@ def register_check(skill_sub) -> None: def register_skill(skill_sub, positive_int) -> None: """Add `skill novelty` (analyze, atoms, probe, ground, items, view) and `skill shorten` (#94 M2).""" - from dokimi.commands.novelty_flags import _add_bundle_args, _add_cache_dir, _add_common, _add_model_args + from dokimi.commands.novelty_flags import ( + _add_bundle_args, _add_cache_dir, _add_common, _add_extractor_arg, _add_model_args, + ) from dokimi.commands.novelty import ( cmd_novelty_analyze, cmd_novelty_atoms, @@ -118,11 +121,13 @@ def register_skill(skill_sub, positive_int) -> None: _add_common(atoms_p, positive_int) # The extractor writes the answer key; `analyze` gives that role to the judge, so the # two paths default to the same model and a saved atom set matches an analyze run. - atoms_p.add_argument("--model", default=DEFAULT_JUDGE_MODEL, - help="Extractor model when --extract-model is not given " - f"(default: {DEFAULT_JUDGE_MODEL}, the default judge)") - atoms_p.add_argument("--extract-model", default=None, dest="extract_model") - atoms_p.add_argument("--provider", default=DEFAULT_JUDGE_PROVIDER, choices=PROVIDERS) + add_model_flag( + atoms_p, "--model", dest="model", provider_dest="provider", + providers=PROVIDERS, default_model=DEFAULT_JUDGE_MODEL, default_provider=DEFAULT_JUDGE_PROVIDER, + help="Extractor model when --extract-model is not given " + f"(default: {DEFAULT_JUDGE_MODEL}, the default judge)", + ) + _add_extractor_arg(atoms_p, "Extractor model override (a bare model uses the --model provider)") cli_flags.add(atoms_p, "tokens", "--max-output-tokens", metavar="N", type=positive_int, default=None, dest="max_tokens") atoms_p.add_argument("--no-verify", action="store_true", dest="no_verify") atoms_p.add_argument("--out", default=None) @@ -217,11 +222,13 @@ def register_skill(skill_sub, positive_int) -> None: shorten_p.add_argument("--atoms", required=True, help="atoms.json from `skill novelty atoms`") # Same model as the retention oracle inside `analyze` (its extractor, i.e. the judge): # adjudications are cached per model, and a different one would score other verdicts. - shorten_p.add_argument("--model", default=DEFAULT_JUDGE_MODEL, - help="Retention adjudicator model " - f"(default: {DEFAULT_JUDGE_MODEL}, the default judge)") - shorten_p.add_argument("--extract-model", default=None, dest="extract_model") - shorten_p.add_argument("--provider", default=DEFAULT_JUDGE_PROVIDER, choices=PROVIDERS) + add_model_flag( + shorten_p, "--model", dest="model", provider_dest="provider", + providers=PROVIDERS, default_model=DEFAULT_JUDGE_MODEL, default_provider=DEFAULT_JUDGE_PROVIDER, + help="Retention adjudicator model " + f"(default: {DEFAULT_JUDGE_MODEL}, the default judge)", + ) + _add_extractor_arg(shorten_p, "Retention adjudicator override (a bare model uses the --model provider)") cli_flags.add(shorten_p, "tokens", "--max-output-tokens", metavar="N", type=positive_int, default=None, dest="max_tokens") shorten_p.add_argument("--lexical-only", action="store_true", dest="lexical_only", help="Run the retention oracle without an LLM adjudicator. Cheap and " diff --git a/dokimi/dokimi/commands/subjects.py b/dokimi/dokimi/commands/subjects.py index 778b63f1e..aa165ee7f 100644 --- a/dokimi/dokimi/commands/subjects.py +++ b/dokimi/dokimi/commands/subjects.py @@ -11,6 +11,7 @@ import sys from pathlib import Path +from dokimi.cli_model_ref import add_model_flag from dokimi import cli_flags, llm_cli from dokimi.llm import ANSWER_PROVIDERS from dokimi.commands._output import exit_on_unwritable, write_report_text @@ -108,7 +109,7 @@ def resolve_judge(args, descriptor) -> None: """Settle the judge of a ``subjects run`` once its descriptor is loaded (parse_args leaves it to this). The answerer is the descriptor's cells when it has explicit ones; the top-level --model is only the implicit - cell, so a CLI --provider is not an answerer then. A judge model the chosen judge provider cannot take is refused + cell, so its model provider does not apply then. A judge model the chosen judge provider cannot take is refused here, before any cell runs (parse_args checked it before the follow moved the judge). """ matrix = descriptor.matrix_cells_explicit @@ -122,7 +123,8 @@ def resolve_judge(args, descriptor) -> None: provider, model = args.judge_provider, args.judge_model if provider in llm_cli.BACKENDS and model is not None and not llm_cli.accepts_model(provider, model): raise InputError(refuse_judge_model(provider, model, named=named, - answerer_provider=None if matrix else getattr(args, "provider", None))) + answerer_provider=None if matrix else getattr(args, "provider", None), + separate_flags=True)) def cmd_subjects_run(args: argparse.Namespace) -> None: @@ -426,9 +428,11 @@ def register(sub, positive_int) -> None: run_p.add_argument("--out-dir", default=None, dest="out_dir") cli_flags.add(run_p, "output", "--out", default=None, dest="out_json") run_p.add_argument("--out-md", default=None, dest="out_md") - run_p.add_argument("--model", default=DEFAULT_ANSWER_MODEL, help=argparse.SUPPRESS) - run_p.add_argument("--provider", default=DEFAULT_ANSWER_PROVIDER, - choices=ANSWER_PROVIDERS) + add_model_flag( + run_p, "--model", dest="model", provider_dest="provider", + providers=ANSWER_PROVIDERS, default_model=DEFAULT_ANSWER_MODEL, default_provider=DEFAULT_ANSWER_PROVIDER, + help=argparse.SUPPRESS, + ) run_p.add_argument("--harness", default="arms-runner", help=argparse.SUPPRESS) run_p.add_argument("--context7-id", default=None, dest="context7_id") run_p.add_argument("--judge", action="store_true") diff --git a/dokimi/dokimi/commands/tools.py b/dokimi/dokimi/commands/tools.py index 3c1bf17ca..ba453ff89 100644 --- a/dokimi/dokimi/commands/tools.py +++ b/dokimi/dokimi/commands/tools.py @@ -13,6 +13,7 @@ import time from pathlib import Path +from dokimi.cli_model_ref import add_model_flag from dokimi import cli_flags from dokimi.llm import PROVIDERS as API_PROVIDERS from dokimi.cli_types import positive_usd @@ -210,8 +211,11 @@ def register(sub: argparse._SubParsersAction, positive_int) -> None: ) pref_p.add_argument("--groups", required=True, help="tool_preference_groups.v1 JSON: requests with twin tools and distractors") - pref_p.add_argument("--model", help="Model under test") - pref_p.add_argument("--provider", default=DEFAULT_ANSWER_PROVIDER, choices=PROVIDERS) + add_model_flag( + pref_p, "--model", dest="model", provider_dest="provider", + providers=PROVIDERS, default_model=None, default_provider=DEFAULT_ANSWER_PROVIDER, + help="Model under test", + ) pref_p.add_argument("--factors", default=None, help="Comma list of factors (default: vendor_name,assertive,social_proof,long_desc,exclusion)") pref_p.add_argument("--reps", type=positive_int, default=3, diff --git a/dokimi/dokimi/defaults.py b/dokimi/dokimi/defaults.py index 27b1ed22c..2a8d1f05a 100644 --- a/dokimi/dokimi/defaults.py +++ b/dokimi/dokimi/defaults.py @@ -67,7 +67,7 @@ class _JudgeModelForProvider(str): #: (``novelty`` picks its own). Code that builds its arguments without #: ``dokimi.cli.parse_args`` reads it as ``DEFAULT_JUDGE_MODEL``. JUDGE_MODEL_FOR_PROVIDER = _JudgeModelForProvider(DEFAULT_JUDGE_MODEL) -JUDGE_MODEL_HELP = (f"Judge model (default: the default judge for --judge-provider that is not the " +JUDGE_MODEL_HELP = (f"Judge model (default: the default judge for the judge provider that is not the " f"answerer's family: {DEFAULT_JUDGE_MODEL} on {DEFAULT_JUDGE_PROVIDER} and amazon-bedrock, " f"opus on claude-cli (sonnet when the answerer is opus), " f"{DEFAULT_GENERATOR_MODEL} on {DEFAULT_GENERATOR_PROVIDER}; " diff --git a/dokimi/dokimi/eval/arms_refusals.py b/dokimi/dokimi/eval/arms_refusals.py index 8992d9090..d0a7c799c 100644 --- a/dokimi/dokimi/eval/arms_refusals.py +++ b/dokimi/dokimi/eval/arms_refusals.py @@ -44,8 +44,8 @@ def _is_agentic_arm(treatment) -> bool: def refuse_knowledge_provider(provider: str) -> None: """Refused before any answer: a knowledge run has no tools, and this provider cannot be told to have none.""" if provider in NO_TOOL_OFF_PROVIDERS: - raise InputError(f"--provider {provider} has no switch that turns its tools off, so it cannot answer " - "a knowledge run (no docs): use --provider claude-cli or copilot-cli") + raise InputError(f"--model {provider}/ has no switch that turns its tools off, so it cannot answer " + "a knowledge run (no docs): use --model claude-cli/ or --model copilot-cli/") def refuse_cli_arms(config: ArmsRunConfig, treatments: list) -> None: @@ -58,10 +58,10 @@ def refuse_cli_arms(config: ArmsRunConfig, treatments: list) -> None: refuse_knowledge_provider(config.provider) agentic = [t.name for t in treatments if _is_agentic_arm(t)] if agentic: - raise InputError(f"--provider {config.provider} runs one prompt with no tools, so it cannot run " + raise InputError(f"--model {config.provider}/ runs one prompt with no tools, so it cannot run " f"the agentic arm(s) {', '.join(agentic)}: use an API provider for them") if config.session_turns is not None: - raise InputError(f"--session-turns needs a conversation, which --provider {config.provider} " + raise InputError(f"--session-turns needs a conversation, which --model {config.provider}/ " "does not have: use an API provider for a session") @@ -71,14 +71,14 @@ def refuse_cli_arms(config: ArmsRunConfig, treatments: list) -> None: def refuse_task_harness(config: ArmsRunConfig) -> None: - """A task harness label is refused before any answer: arms runs answer through ``--provider``, so the label + """A task harness label is refused before any answer: arms runs answer through ``--model``, so the label would stamp answers that no such harness produced. Asks for a Claude CLI answerer instead (docs/knowledge-runs.md). """ name = config.harness.split(":", 1)[0] if name in _TASK_HARNESS_NAMES or name.startswith(_TASK_HARNESS_PREFIXES): raise InputError(f"--harness {config.harness} names a task harness (an agent CLI that runs executable tasks), " - "but arms run answers through --provider. To answer through Claude Code's CLI use " - "--provider claude-cli --model sonnet (or codex-cli, copilot-cli); otherwise drop --harness") + "but arms run answers through --model PROVIDER/MODEL. To answer through Claude Code use " + "--model claude-cli/sonnet; otherwise drop --harness") def refuse_cli_cell_model(matrix_cell) -> None: diff --git a/dokimi/dokimi/harnesses/delivery.py b/dokimi/dokimi/harnesses/delivery.py index 6d44db7b7..6789b4261 100644 --- a/dokimi/dokimi/harnesses/delivery.py +++ b/dokimi/dokimi/harnesses/delivery.py @@ -21,6 +21,7 @@ from dokimi.container_policy import ContainerPolicy from dokimi.gate.delivery import compare_pairs, evaluate, score from dokimi.llm_json import extract_json_object +from dokimi.llm_providers import ANSWER_PROVIDERS, PROVIDER_ALIASES from dokimi.utils import InputError, read_json_input_bytes @@ -347,6 +348,13 @@ def _scan_weights(catalog: dict, profile: str, tasks: dict, repeats: int) -> dic return weights +def _scan_model_ref(model: str, provider: str | None) -> str: + prefix, slash, _ = model.partition("/") + if provider is None or (provider == "openai" and not (slash and prefix in (*ANSWER_PROVIDERS, *PROVIDER_ALIASES))): + return model # OpenAI is the default and preserves bare LiteLLM routes such as deepseek/x. + return f"{provider}/{model}" + + def run(args: argparse.Namespace) -> dict: manifest, manifest_id = document(args.manifest) catalog, catalog_id = document(args.tasks) @@ -432,7 +440,7 @@ def run(args: argparse.Namespace) -> dict: argv += ["--policy", str(args.policy)] if release else ["--corpus", str(args.corpus)] if not release: argv += ( - ["--model", args.model, "--provider", args.provider] if args.model else ["--fixture"] + [f"--model={_scan_model_ref(args.model, args.provider)}"] if args.model else ["--fixture"] ) return { "required": required if release else [], diff --git a/dokimi/dokimi/judge_rule.py b/dokimi/dokimi/judge_rule.py index 817567698..38410de37 100644 --- a/dokimi/dokimi/judge_rule.py +++ b/dokimi/dokimi/judge_rule.py @@ -108,17 +108,22 @@ def apply_default_judge(args, *, matrix: bool, named: bool) -> None: args.judge_provider = picked -def refuse_judge_model(provider: str, model: str, *, named: bool, answerer_provider: str | None) -> str: +def refuse_judge_model(provider: str, model: str, *, named: bool, answerer_provider: str | None, + separate_flags: bool = False) -> str: """The refusal for a judge *model* the CLI judge *provider* cannot take. A judge provider that was not named was moved there by the answerer's CLI: say so, and ask for the flag that picks another family, not for a flag the user did not pass. """ if not named and provider == answerer_provider: - return (f"--judge-model {model!r} is not a Claude model (sonnet, haiku, opus or a claude-* id), and the judge " - f"follows --provider {provider}: pass --judge-provider (e.g. openai) for a non-Claude judge") - return (f"--judge-provider {provider} takes a Claude model (sonnet, haiku, opus or a claude-* id), " - f"not {model!r}: pass --judge-model") + flags = "--judge-provider PROVIDER --judge-model MODEL" if separate_flags else "--judge PROVIDER/MODEL" + return (f"judge {model!r} is not a Claude model (sonnet, haiku, opus or a claude-* id), and the judge " + f"follows --model {provider}: pass a judge from another family, {flags}") + if separate_flags: + return (f"judge provider {provider} takes a Claude model (sonnet, haiku, opus or a claude-* id), " + f"not {model!r}: pass --judge-model ") + return (f"--judge {provider}/ takes a Claude model (sonnet, haiku, opus or a claude-* id), " + f"not {model!r}: pass --judge {provider}/") def follow_answerer_cli(args, *, matrix: bool, named: bool) -> None: diff --git a/dokimi/dokimi/llm.py b/dokimi/dokimi/llm.py index ccafdf109..b97c73bda 100644 --- a/dokimi/dokimi/llm.py +++ b/dokimi/dokimi/llm.py @@ -74,6 +74,16 @@ from dokimi.defaults import bedrock_profile from dokimi.llm_json import extract_json_array as extract_json_array from dokimi.llm_json import extract_json_object as extract_json_object +from dokimi.llm_providers import ( + ANSWER_PROVIDERS as ANSWER_PROVIDERS, + CALLER_CHOICES as CALLER_CHOICES, + CALLER_PROVIDERS as CALLER_PROVIDERS, + PROVIDER_ALIASES as PROVIDER_ALIASES, + PROVIDERS as PROVIDERS, + canonical_provider, + check_caller_provider as check_caller_provider, + credential_env_var as credential_env_var, +) from dokimi.llm_turn import _TRUNCATED, ToolCall, parse_turn from dokimi.metrics.usage import UsageRecord @@ -81,53 +91,6 @@ T = TypeVar("T") -# ── Providers ───────────────────────────────────────────────────────────────── - -#: Canonical provider names, as the CLI offers them, and the variable each key is read from. -PROVIDERS: Dict[str, str] = { - "openai": "OPENAI_API_KEY", - "openai-codex": "OPENAI_API_KEY", - "anthropic": "ANTHROPIC_API_KEY", - "amazon-bedrock": "AWS_BEARER_TOKEN_BEDROCK", - "google-vertex": "GEMINI_API_KEY", - "openrouter": "OPENROUTER_API_KEY", -} - -#: ``--provider`` choices: the API providers, then the CLI backends. -ANSWER_PROVIDERS: Tuple[str, ...] = (*PROVIDERS, *llm_cli.BACKENDS) - -#: ``--provider`` choices of the commands that build the answerer or generators: not openai-codex. -CALLER_CHOICES: Tuple[str, ...] = tuple(p for p in ANSWER_PROVIDERS if p != "openai-codex") - -#: Providers the answerer, judge and generators take: those, and google, gemini and vertex_ai. -CALLER_PROVIDERS: Tuple[str, ...] = (*CALLER_CHOICES, "google", "gemini", "vertex_ai") - - -def check_caller_provider(provider: str) -> None: - """Raise ``ValueError`` for a provider the answerer, judge and generators do not take.""" - if provider not in CALLER_PROVIDERS: - raise ValueError( - f"Unsupported provider: '{provider}'. " - "Use 'openai', 'anthropic', 'google', 'openrouter', 'amazon-bedrock' or 'claude-cli'." - ) - -#: Other spellings of a canonical provider. -PROVIDER_ALIASES: Dict[str, str] = { - "google": "google-vertex", - "gemini": "google-vertex", - "vertex_ai": "google-vertex", -} - - -def _canonical(provider: str) -> str: - return PROVIDER_ALIASES.get(provider, provider) - - -def credential_env_var(provider: str) -> Optional[str]: - """The environment variable holding *provider*'s key; ``None`` off the table (litellm reads it).""" - return PROVIDERS.get(_canonical(provider)) - - def resolve_api_key(provider: str, api_key: Optional[str] = None) -> Optional[str]: """*api_key*, else the provider's environment variable; a ``file:`` value is read. @@ -155,24 +118,31 @@ def _litellm() -> Any: return litellm +def is_litellm_route(provider: str) -> bool: + """Whether LiteLLM recognizes a provider prefix.""" + litellm = _litellm() + return provider in litellm.provider_list or litellm.JSONProviderRegistry.exists(provider) + + def resolve_model(model: str, provider: str) -> str: """The litellm model string for *model* at *provider*. A name with a ``/`` passes through, except on OpenRouter and openai-codex, which add their own prefix, on openai and Vertex, where only a litellm route counts, and on Bedrock. """ - name = _canonical(provider) + name = canonical_provider(provider) if name == "openrouter": return model if model.startswith("openrouter/") else f"openrouter/{model}" if name == "openai-codex": return f"openai/{model}" if name == "openai": # A name litellm does not take for OpenAI's (glm-5.3, meta-llama/x, claude-*) gets openai/. + if "/" in model: + return model if is_litellm_route(model.split("/", 1)[0]) else f"openai/{model}" litellm = _litellm() known = litellm.open_ai_chat_completion_models | litellm.open_ai_text_completion_models ours = model in known or "ft:gpt-3.5-turbo" in model or "ft:gpt-4" in model # as litellm - routed = (p := model.split("/", 1)[0]) in litellm.provider_list or litellm.JSONProviderRegistry.exists(p) if "/" in model else ours - return model if routed else f"openai/{model}" + return model if ours else f"openai/{model}" if name == "google-vertex": # a Model Garden name (meta/llama-...) has a "/" but no route return model if model.startswith(("gemini/", "vertex_ai/")) else f"vertex_ai/{model}" if "/" in model and (name != "amazon-bedrock" or model.startswith("bedrock/")): @@ -231,7 +201,7 @@ def sampling_refusals( """Return the reason for each refused sampling option.""" return llm_sampling.refusals_for_route( _sampling_kwargs(temperature=temperature, seed=seed), provider, - cli=llm_cli.backend(_canonical(provider)), + cli=llm_cli.backend(canonical_provider(provider)), load=_litellm, resolve=lambda: resolve_model(model, provider)) @@ -727,7 +697,7 @@ def complete( model=self.model, provider=self.provider, ) key = caching.response_cache_key( - litellm_model=self.model if _canonical(self.provider) == "openai" else self.litellm_model, + litellm_model=self.model if canonical_provider(self.provider) == "openai" else self.litellm_model, messages=messages, extra=caching.draw_extra(self._cache_extra(stream, max_tokens), draw), ) hit = caching.load_response(key) diff --git a/dokimi/dokimi/llm_providers.py b/dokimi/dokimi/llm_providers.py new file mode 100644 index 000000000..b25e92f1e --- /dev/null +++ b/dokimi/dokimi/llm_providers.py @@ -0,0 +1,51 @@ +# Copyright (C) 2026 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +"""Provider names, aliases and credential environment variables.""" + +from dokimi import llm_cli + + +#: Canonical provider names, as the CLI offers them, and the variable each key is read from. +PROVIDERS: dict[str, str] = { + "openai": "OPENAI_API_KEY", + "openai-codex": "OPENAI_API_KEY", + "anthropic": "ANTHROPIC_API_KEY", + "amazon-bedrock": "AWS_BEARER_TOKEN_BEDROCK", + "google-vertex": "GEMINI_API_KEY", + "openrouter": "OPENROUTER_API_KEY", +} + +#: Model provider choices: the API providers, then the CLI backends. +ANSWER_PROVIDERS: tuple[str, ...] = (*PROVIDERS, *llm_cli.BACKENDS) + +#: Model provider choices for answerers and generators, excluding openai-codex. +CALLER_CHOICES: tuple[str, ...] = tuple(p for p in ANSWER_PROVIDERS if p != "openai-codex") + +#: Providers the answerer, judge and generators take: those, and google, gemini and vertex_ai. +CALLER_PROVIDERS: tuple[str, ...] = (*CALLER_CHOICES, "google", "gemini", "vertex_ai") + + +def check_caller_provider(provider: str) -> None: + """Raise ``ValueError`` for a provider the answerer, judge and generators do not take.""" + if provider not in CALLER_PROVIDERS: + raise ValueError( + f"Unsupported provider: '{provider}'. " + "Use 'openai', 'anthropic', 'google', 'openrouter', 'amazon-bedrock' or 'claude-cli'." + ) + +#: Other spellings of a canonical provider. +PROVIDER_ALIASES: dict[str, str] = { + "google": "google-vertex", + "gemini": "google-vertex", + "vertex_ai": "google-vertex", +} + + +def canonical_provider(provider: str) -> str: + return PROVIDER_ALIASES.get(provider, provider) + + +def credential_env_var(provider: str) -> str | None: + """The environment variable holding *provider*'s key; ``None`` off the table (litellm reads it).""" + return PROVIDERS.get(canonical_provider(provider)) diff --git a/dokimi/dokimi/novelty/client.py b/dokimi/dokimi/novelty/client.py index c53278680..3cd2f048a 100644 --- a/dokimi/dokimi/novelty/client.py +++ b/dokimi/dokimi/novelty/client.py @@ -322,10 +322,10 @@ def extractor_judge_relation(extractor_model: str, judge: LLMClient, # analyze writes its own answer key in the run, so re-running it with another extractor helps. _REMEDY_ANALYZE = ("Use a judge from another family, or write the answer key again with another extractor " - "(analyze --extract-model, with --extract-provider when it is not the judge's)") + "(analyze --extract-model PROVIDER/MODEL)") # probe reads a saved atoms file: only atoms can write that key again; probe's flags do not change it. _REMEDY_PROBE = ("Use a judge from another family, or write the atoms file again with another extractor " - "(atoms --extract-model with --provider; probe's --extract-model does not change a saved key)") + "(atoms --extract-model PROVIDER/MODEL; probe's --extract-model does not change a saved key)") def warn_extractor_judge(extractor_model: str, judge: LLMClient, diff --git a/dokimi/scripts/growth_baseline.json b/dokimi/scripts/growth_baseline.json index 57132eca7..91843c532 100644 --- a/dokimi/scripts/growth_baseline.json +++ b/dokimi/scripts/growth_baseline.json @@ -1,22 +1,21 @@ { "files": { "dokimi/harnesses/benchflow.py": {"lines": 873, "rationale": "#1389: the pack check refuses a skills root it cannot list, in 7 lines; the file is split in its own PR"}, - "dokimi/llm.py": {"lines": 1007, "rationale": "grew on main in #180 (replay a stored retry) after #93 seeded this baseline; split it in its own PR"}, + "dokimi/llm.py": {"lines": 977, "rationale": "grew on main in #180 (replay a stored retry) after #93 seeded this baseline; split it in its own PR"}, "dokimi/report/model_compare.py": {"lines": 1106, "rationale": "grew on main in #73 (judge-validity --context stored) before the ratchet landed; split it in its own PR"}, "tests/test_arm_runner.py": {"lines": 1175, "rationale": "pre-existing when the gate was introduced"}, "tests/test_benchflow_harness.py": {"lines": 1716, "rationale": "pre-existing when the gate was introduced"}, "tests/test_container_agent.py": {"lines": 1233, "rationale": "pre-existing when the gate was introduced"}, "tests/test_judge_reliability.py": {"lines": 1680, "rationale": "grew on main in #73 (judge-validity --context stored), 1505 -> 1695, before the ratchet landed; split it in its own PR"}, - "tests/test_judge_validity.py": {"lines": 2234, "rationale": "grew on main in #73 (judge-validity --context stored), 1423 -> 2235, before the ratchet landed; split it in its own PR"}, + "tests/test_judge_validity.py": {"lines": 2233, "rationale": "grew on main in #73 (judge-validity --context stored), 1423 -> 2235, before the ratchet landed; split it in its own PR"}, "tests/test_pipeline_question_set.py": {"lines": 1223}, "tests/test_repo_environment.py": {"lines": 1271, "rationale": "grew on main in #147 before the ratchet landed; +2 for the instructions assert of two crash tests (#103 review); split it in its own PR"}, - "tests/test_subjects.py": {"lines": 1002}, "tests/test_task_formats.py": {"lines": 1003} }, "functions": { "dokimi/commands/benchmark.py::cmd_benchmark_batch": {"complexity": 11}, "dokimi/commands/benchmark.py::cmd_benchmark_preflight": {"complexity": 12}, - "dokimi/commands/catalog.py::cmd_catalog_trigger_set": {"complexity": 14}, + "dokimi/commands/catalog.py::cmd_catalog_trigger_set": {"complexity": 11}, "dokimi/commands/evaluate.py::cmd_eval_judge_validity": {"complexity": 13}, "dokimi/commands/judge_reliability.py::cmd_eval_cross_judge": {"complexity": 29, "rationale": "pre-existing when the gate was introduced"}, "dokimi/commands/report.py::cmd_report_model_compare": {"complexity": 12}, diff --git a/dokimi/tests/data/cli_flags_allowlist.txt b/dokimi/tests/data/cli_flags_allowlist.txt index 23328e430..a651d60fd 100644 --- a/dokimi/tests/data/cli_flags_allowlist.txt +++ b/dokimi/tests/data/cli_flags_allowlist.txt @@ -51,7 +51,6 @@ --escalate-ties --eval --eval-out ---extract-provider --factors --fail-fast --file @@ -82,7 +81,6 @@ --judge2 # novelty second judge (#429): a regrade sample, not a panel member; no registry concept yet --judge2-frac # novelty second judge (#429): a regrade sample, not a panel member; no registry concept yet --judge2-provider # novelty second judge (#429): a regrade sample, not a panel member; no registry concept yet ---judges --keep --keep-copies-under # novelty routing: keeps only the copies under a directory of a same-name catalog skill; no registry concept yet --kind @@ -143,7 +141,6 @@ --probes --product # the subject name label on most leaves; the inputs concept makes the subject a positional, a shape change not a spelling move (a later F1b migration) --prompt-file # repo tasks replay (#265) adds it: no registry concept yet; a F1b migration names it ---provider --prs # eval tasks generate --from prs (#294) adds it: no registry concept yet; a F1b migration names it --python-env # repo scan --typecheck: the interpreter whose site-packages the fences resolve against; no registry concept yet --queries diff --git a/dokimi/tests/test_answer_imports.py b/dokimi/tests/test_answer_imports.py index 77c5acd2d..2fb64dc9b 100644 --- a/dokimi/tests/test_answer_imports.py +++ b/dokimi/tests/test_answer_imports.py @@ -754,7 +754,6 @@ def save_evaluations(self, *args, **kwargs): answers = tmp_path / "answers.json" answers.write_text(json.dumps({"run_intent": "paired", "answers": [ {"id": "q1", "question": "What?", "answer": "x", "with_docs": None}]}), encoding="utf-8") - args = build_parser().parse_args(["eval", "score", "pointwise", "--product", "oneTBB", "--answers", str(answers), "--judge-provider", - "openai", "--judge-model", "gpt-5.1", "--out", str(tmp_path / "eval.json")]) + args = build_parser().parse_args(["eval", "score", "pointwise", "--product", "oneTBB", "--answers", str(answers), "--judge", "openai/gpt-5.1", "--out", str(tmp_path / "eval.json")]) args.func(args) assert seen["run_intent"] == "paired" diff --git a/dokimi/tests/test_arms_run_config_parity.py b/dokimi/tests/test_arms_run_config_parity.py index e25b5ce65..add5ede55 100644 --- a/dokimi/tests/test_arms_run_config_parity.py +++ b/dokimi/tests/test_arms_run_config_parity.py @@ -181,7 +181,7 @@ def _run(argv: list[str]) -> None: #: Every flag the three entry points share (``subjects run`` takes only these), away from its #: default. ``--judge-model`` is left to ``--judge-provider`` in the panel case below. _SHARED_FLAGS = ( - "--model", "answer-model", "--provider", "openrouter", "--context7-id", "/demo/docs", + "--model", "openrouter/answer-model", "--context7-id", "/demo/docs", "--judge", "--judge-model", "judge-model", "--judge-provider", "openai", "--top-k", "7", "--rerank-threshold", "0.55", "--max-iterations", "3", "--max-output-tokens", "32000", "--grounded-from-topics", "--concurrency", "2", @@ -293,7 +293,7 @@ def test_arms_run_hands_the_session_fields_to_the_runner(runner_calls, io): def test_arms_run_with_a_named_cell_takes_the_cell_over_the_flags(runner_calls, io): - _run(_arms_run(io, "--judge", "--model", "flag-model", "--provider", "openai", + _run(_arms_run(io, "--judge", "--model", "openai/flag-model", "--plugins", "plugin:truncate:400", "--matrix-cells", str(io["cells"]), "--matrix-cell", "cell-b")) diff --git a/dokimi/tests/test_benchmark_command_question_set.py b/dokimi/tests/test_benchmark_command_question_set.py index a2dd7ad45..5033d2486 100644 --- a/dokimi/tests/test_benchmark_command_question_set.py +++ b/dokimi/tests/test_benchmark_command_question_set.py @@ -203,7 +203,7 @@ def test_preflight_reports_the_questions_root(monkeypatch, tmp_path, capsys): "--doc-source", "local:docs", "--out-dir", str(tmp_path / "out"), "--questions-root", str(questions_root), - "--provider", "openai", "--judge-provider", "openai", + "--model", "openai/gpt-6.1-sol", "--judge", "openai/gpt-5.5", ]) args.func(args) @@ -259,7 +259,7 @@ def _preflight(monkeypatch, tmp_path, *extra, env=("OPENAI_API_KEY",)): args = build_parser().parse_args([ "benchmark", "preflight", "--library", "onetbb", "--doc-source", "local:docs", - "--provider", "openai", "--judge-provider", "openai", + "--model", "openai/gpt-6.1-sol", "--judge", "openai/gpt-5.5", *extra, ]) if "--out-dir" not in extra: @@ -357,7 +357,7 @@ def broken_client(doc_source): args = build_parser().parse_args([ "benchmark", "preflight", "--library", "onetbb", "--doc-source", "local:docs", - "--provider", "openai", "--judge-provider", "openai", + "--model", "openai/gpt-6.1-sol", "--judge", "openai/gpt-5.5", "--out-dir", str(tmp_path / "out"), *extra, ]) args.func(args) @@ -430,7 +430,7 @@ def test_preflight_questions_from_skips_root_check(monkeypatch, tmp_path, capsys "--out-dir", str(tmp_path / "out"), "--questions-from", str(questions_dir / "onetbb.json"), "--questions-root", str(empty_root), - "--provider", "openai", "--judge-provider", "openai", + "--model", "openai/gpt-6.1-sol", "--judge", "openai/gpt-5.5", ]) args.func(args) diff --git a/dokimi/tests/test_caller_provider_choices.py b/dokimi/tests/test_caller_provider_choices.py index 9bd8e16ba..7d7f65526 100644 --- a/dokimi/tests/test_caller_provider_choices.py +++ b/dokimi/tests/test_caller_provider_choices.py @@ -37,17 +37,21 @@ "eval questions analyze", "eval questions review", "eval score panel", "arms run", "arms matrix-run", "subjects run", "skill novelty analyze", "skill novelty atoms", "skill novelty probe", "skill shorten", "skill routing", "skill sensitivity", "catalog routing", "catalog novelty", - "tools preference", + "tools preference", "eval triggers generate", ] +def _offered(action): + return tuple(getattr(action, "providers", None) or action.choices or ()) + + def _provider_choices(parser, path=()): for action in parser._actions: if isinstance(action, argparse._SubParsersAction): for name, sub in action.choices.items(): yield from _provider_choices(sub, path + (name,)) - elif action.dest == "provider" and action.choices: - yield " ".join(path), tuple(action.choices) + elif getattr(action, "provider_dest", action.dest) == "provider" and _offered(action): + yield " ".join(path), _offered(action) def test_every_provider_flag_is_one_of_the_two_kinds(): @@ -77,9 +81,9 @@ def test_the_commands_that_call_dokimi_llm_keep_openai_codex(): ]) def test_openai_codex_is_refused_before_the_run(argv, capsys): with pytest.raises(SystemExit) as exc: - build_parser().parse_args([*argv, "--provider", "openai-codex"]) + build_parser().parse_args([*argv, "--model", "openai-codex/m"]) assert exc.value.code == 2 - assert "invalid choice: 'openai-codex'" in capsys.readouterr().err + assert "is not a provider for this command" in capsys.readouterr().err CALLERS = { diff --git a/dokimi/tests/test_cli_flag_moves.py b/dokimi/tests/test_cli_flag_moves.py index b9f407f41..b76aac974 100644 --- a/dokimi/tests/test_cli_flag_moves.py +++ b/dokimi/tests/test_cli_flag_moves.py @@ -27,6 +27,66 @@ def _tombstone(argv: list[str], capsys) -> str: return capsys.readouterr().err +@pytest.mark.parametrize("leaf", cli_flags.JUDGE_MOVED_LEAVES) +@pytest.mark.parametrize(("options", "ref"), [ + (["--judge-provider", "openai", "--judge", "gpt-4o"], "openai/gpt-4o"), + (["--judge=gpt-4o", "--judge-provider=openai"], "openai/gpt-4o"), + (["--judge-provider", "openai", "--judge", "anthropic/claude-sonnet-5-5"], "anthropic/claude-sonnet-5-5"), + (["--judge", "anthropic/claude-sonnet-5-5", "--judge-provider", "openai"], "anthropic/claude-sonnet-5-5"), + (["--judge-provider", "openai", "--judge", "gpt-4o", "--judge-model", "gpt-4o-mini"], "openai/gpt-4o-mini"), +]) +def test_a_retired_judge_provider_combines_with_the_last_judge_model(leaf, options, ref): + assert cli_routes.moved_flags_argv([*leaf, *options]) == [*leaf, "--judge", ref] + + +def test_the_mixed_judge_tombstone_prints_a_command_that_uses_the_named_provider(capsys): + required = ["benchmark", "run", "--library", "onetbb"] + text = _tombstone([*required, "--judge-provider", "openai", "--judge", "gpt-4o"], capsys) + suggested = shlex.split(text.split("moved: ", 1)[1].strip()) + assert suggested == ["dokimi", *required, "--judge", "openai/gpt-4o"] + args = cli.parse_args(suggested[1:]) + assert (args.judge_provider, args.judge_model) == ("openai", "gpt-4o") + + +def test_the_retired_answer_provider_joins_a_model_with_a_slash(): + base = ["benchmark", "run", "--library", "onetbb"] + old = [*base, "--provider", "openrouter", "--model", "anthropic/claude-sonnet-5-5"] + assert cli_routes.moved_flags_argv(old) == [ + *base, "--model", "openrouter/anthropic/claude-sonnet-5-5", + ] + + +@pytest.mark.parametrize("provider", [["--provider", ""], ["--provider="]]) +def test_an_empty_retired_provider_suggests_the_bare_model(provider, capsys): + required = ["benchmark", "run", "--library", "onetbb"] + text = _tombstone([*required, *provider, "--model", "gpt-4o"], capsys) + suggested = shlex.split(text.split("moved: ", 1)[1].strip()) + assert suggested == ["dokimi", *required, "--model", "gpt-4o"] + args = cli.parse_args(suggested[1:]) + assert (args.provider, args.model) == ("openai", "gpt-4o") + + +@pytest.mark.parametrize(("first", "last"), [ + (["--judges", "openai/a,openai/b"], ["--judges", "anthropic/c,anthropic/d"]), + (["--judges=openai/a,openai/b"], ["--judges=anthropic/c,anthropic/d"]), + (["--judges", "openai/a,openai/b"], ["--judges=anthropic/c,anthropic/d"]), + (["--judges=openai/a,openai/b"], ["--judges", "anthropic/c,anthropic/d"]), +]) +def test_repeated_retired_judges_split_only_the_last_value(first, last, capsys): + base = ["eval", "judge", "agreement", "--answers", "a.json"] + text = _tombstone([*base, *first, "--no-stored", *last], capsys) + suggested = shlex.split(text.split("moved: ", 1)[1].strip()) + assert suggested == ["dokimi", *base, "--no-stored", "--judge", "anthropic/c", "--judge", "anthropic/d"] + assert cli.parse_args(suggested[1:]).judges == ["anthropic/c", "anthropic/d"] + + +def test_retired_judge_panel_scan_stops_at_the_end_of_options(): + argv = ["eval", "judge", "agreement", "--judges=openai/a,openai/b", "--", "--judges", "anthropic/c"] + assert cli_routes.moved_flags_argv(argv) == [ + "eval", "judge", "agreement", "--judge", "openai/a", "--judge", "openai/b", "--", "--judges", "anthropic/c", + ] + + @pytest.mark.parametrize(("old", "new"), [ (["benchmark", "run", "--library", "x", "--output-dir", "d"], ["benchmark", "run", "--library", "x", "--out-dir", "d"]), @@ -465,3 +525,47 @@ def test_view_format_is_not_moved_on_a_leaf_that_has_no_view_file(): def test_the_format_of_the_view_parses_as_the_registry_spelling(): args = cli.build_parser().parse_args(["skill", "novelty", "analyze", "--artifact", "skill:s", "--format", "md"]) assert args.view_format == "md" + + +@pytest.mark.parametrize("route", ["deepseek/deepseek-chat", "groq/llama-3.3-70b-versatile"]) +def test_openai_migration_hint_preserves_nested_litellm_routes(route, capsys): + from dokimi.llm import resolve_model + + leaf = ["answers", "generate", "--product", "p", "--questions", "q.json"] + text = _tombstone([*leaf, "--provider", "openai", "--model", route], capsys) + suggested = shlex.split(text.split("moved: ", 1)[1].strip()) + args = cli.parse_args(suggested[1:]) + assert args.provider == "openai" + assert resolve_model(args.model, args.provider) == resolve_model(route, "openai") == route + + +@pytest.mark.parametrize("argv", [ + ["tasks", "run", "--harness", "codex", "--all"], + ["explore", "run", "--all"], + ["repo", "run", "repo", "--arm", "guidance:none", "--name", "example"], +]) +def test_a_leaf_without_a_migrated_provider_has_no_model_hint(argv, capsys): + text = _tombstone([*argv, "--provider", "anthropic", "--model", "sonnet"], capsys) + assert "unrecognized arguments: --provider" in text + assert "moved:" not in text + + +def test_migrated_answer_provider_hints_cover_the_model_reference_leaves(): + from dokimi.cli_model_ref import ProviderModelAction + + def model_ref_leaves(parser, path=()): + model = parser._option_string_actions.get("--model") + if isinstance(model, ProviderModelAction) and model.provider_dest == "provider": + yield path + for action in parser._actions: + if isinstance(action, argparse._SubParsersAction): + for name, child in action.choices.items(): + yield from model_ref_leaves(child, (*path, name)) + + assert set(cli_flags.MODEL_MOVED_LEAVES) == set(model_ref_leaves(cli.build_parser())) + + +@pytest.mark.parametrize("next_option", ["--model", "--", "-h"]) +def test_a_provider_without_a_value_does_not_absorb_the_next_option(next_option): + argv = ["answers", "generate", "--provider", next_option, "gpt-4o"] + assert cli_routes.moved_flags_argv(argv) is None diff --git a/dokimi/tests/test_cli_model_ref.py b/dokimi/tests/test_cli_model_ref.py new file mode 100644 index 000000000..8440b6d0a --- /dev/null +++ b/dokimi/tests/test_cli_model_ref.py @@ -0,0 +1,115 @@ +# Copyright (C) 2026 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +import pytest + +from dokimi.cli import parse_args + + +@pytest.mark.parametrize(("argv", "option", "first", "last", "dests"), [ + (["eval", "score", "pointwise", "--answers", "a.json", "--product", "p"], + "--judge", "openai/gpt-4o", "claude-sonnet-5-5", ("judge_model", "judge_provider", "judge_provider_named")), + (["eval", "score", "pairwise", "--answers", "a.json"], + "--judge", "openai/gpt-4o", "claude-sonnet-5-5", ("judge_model", "judge_provider", "judge_provider_named")), + (["benchmark", "run", "--library", "onetbb"], + "--model", "anthropic/claude-opus-5-5", "gpt-6.1-sol", ("model", "provider")), + (["tools", "preference", "--groups", "groups.json"], + "--model", "anthropic/claude-haiku-5-5", "gpt-6.1-sol", ("model", "provider")), + (["skill", "novelty", "analyze", "--artifact", "skill:s"], + "--model", "anthropic/claude-haiku-5-5", "gpt-4o", ("model", "provider")), + (["skill", "novelty", "analyze", "--artifact", "skill:s"], + "--extract-model", "openai/gpt-4o", "claude-haiku-5-5", ("extract_model", "extract_provider")), +]) +def test_a_later_bare_reference_uses_the_leaf_defaults(argv, option, first, last, dests): + only = parse_args([*argv, option, last]) + repeated = parse_args([*argv, option, first, option, last]) + assert tuple(getattr(repeated, dest) for dest in dests) == tuple(getattr(only, dest) for dest in dests) + + +@pytest.mark.parametrize(("argv", "option", "ref", "message"), [ + (["answers", "generate", "--product", "p", "--questions", "q.json"], + "--model", "google/gemini-2.5-pro", "`google` is not a provider for this command"), + (["tools", "preference", "--groups", "groups.json"], + "--model", "claude-cli/", "`claude-cli` is not a provider for this command"), + (["tools", "preference", "--groups", "groups.json"], + "--model", "openai/ ", "--model openai/ has no model"), + (["eval", "score", "pointwise", "--answers", "a.json", "--product", "p"], + "--judge", "openai/ ", "--judge openai/ has no model"), + (["skill", "novelty", "analyze", "--artifact", "skill:s"], + "--extract-model", "anthropic/", "--extract-model anthropic/ has no model"), + (["skill", "novelty", "probe", "--artifact", "skill:s", "--atoms", "atoms.json"], + "--extract-model", "openai/ ", "--extract-model openai/ has no model"), + (["catalog", "novelty", "catalog", "--out-dir", "out/sweep"], + "--extract-model", "openai/", "--extract-model openai/ has no model"), +]) +def test_malformed_qualified_references_fail_at_parse(argv, option, ref, message, capsys): + with pytest.raises(SystemExit) as exc: + parse_args([*argv, option, ref]) + assert exc.value.code == 2 + assert message in capsys.readouterr().err + + +@pytest.mark.parametrize(("ref", "model", "provider"), [ + ("google/gemini-2.5-pro", "gemini-2.5-pro", "google"), + ("gemini/gemini-2.5-pro", "gemini-2.5-pro", "gemini"), + ("vertex_ai/gemini-2.5-pro", "gemini-2.5-pro", "vertex_ai"), + ("groq/llama-3.3-70b-versatile", "groq/llama-3.3-70b-versatile", "openai"), + ("meta-llama/llama", "meta-llama/llama", "openai"), +]) +def test_trigger_rewrites_recognize_legacy_providers_and_keep_bare_names(ref, model, provider): + args = parse_args(["eval", "triggers", "generate", "--catalog", "c", "--out", "o.json", + "--rewrite", "--model", ref]) + assert (args.model, args.provider) == (model, provider) + + +@pytest.mark.parametrize(("adapter", "model", "provider", "fixture"), [ + (["--model", "claude-cli/sonnet"], "sonnet", "claude-cli", False), + (["--model", "gpt-4o"], "gpt-4o", "openai", False), + (["--fixture"], None, "openai", True), +]) +def test_delivery_scan_keeps_its_adapter_choices(adapter, model, provider, fixture): + args = parse_args(["delivery", "scan", "--manifest", "m.json", "--tasks", "t.json", + "--corpus", "c.json", "--out", "out.json", *adapter]) + assert (args.model, args.provider, args.fixture) == (model, provider, fixture) + + +@pytest.mark.parametrize(("ref", "model", "provider", "warning"), [ + ("anthropic/claude-haiku-4", "claude-haiku-4", "anthropic", True), + ("openrouter/anthropic/claude-haiku-4", "anthropic/claude-haiku-4", "openrouter", False), +]) +@pytest.mark.parametrize("judge_args", [ + ["--judge-provider", "openrouter", "--judge-model", "anthropic/claude-sonnet-4"], + ["--judge", "openrouter/anthropic/claude-sonnet-4"], +]) +def test_openrouter_judge_warns_about_an_ambiguous_extractor_ref(ref, model, provider, warning, judge_args, capsys): + from dokimi.novelty.cost import role_models + + args = parse_args(["skill", "novelty", "analyze", "--artifact", "skill:x", + *judge_args, "--extract-model", ref]) + assert role_models(args)["extractor"] == (model, provider) + stderr = capsys.readouterr().err + if warning: + assert "selects anthropic" in stderr + assert "--extract-model openrouter/anthropic/claude-haiku-4" in stderr + else: + assert "--extract-model" not in stderr + + +def test_skill_sensitivity_requires_a_model_and_keeps_its_named_provider(capsys): + argv = ["skill", "sensitivity", "skill:s", "--queries", "q.json"] + with pytest.raises(SystemExit) as exc: + parse_args(argv) + assert exc.value.code == 2 + assert "required: --model" in capsys.readouterr().err + args = parse_args([*argv, "--model", "amazon-bedrock/claude-haiku-5-5"]) + assert (args.model, args.provider) == ("claude-haiku-5-5", "amazon-bedrock") + + +@pytest.mark.parametrize("reverse", [False, True]) +def test_only_the_first_panel_judge_controls_the_extractor_warning(reverse, capsys): + judges = ["anthropic/claude-sonnet-4", "openrouter/anthropic/claude-sonnet-4"] + if reverse: + judges.reverse() + parse_args(["skill", "novelty", "analyze", "--artifact", "skill:x", "--judge", judges[0], + "--judge", judges[1], "--extract-model", "anthropic/claude-haiku-4"]) + assert ("selects anthropic" in capsys.readouterr().err) == reverse diff --git a/dokimi/tests/test_cross_judge_judge_errors.py b/dokimi/tests/test_cross_judge_judge_errors.py index 350944622..cbcf6eebd 100644 --- a/dokimi/tests/test_cross_judge_judge_errors.py +++ b/dokimi/tests/test_cross_judge_judge_errors.py @@ -103,7 +103,7 @@ def score_answer(self, *, answer, **_): answers = tmp_path / "run.json" answers.write_text(json.dumps(data or {"library_name": "L", "answers": _records()}), encoding="utf-8") out = tmp_path / "cj.json" - args = build_parser().parse_args(["eval", "judge", "agreement", "--answers", str(answers), "--judges", "anthropic/m", + args = build_parser().parse_args(["eval", "judge", "agreement", "--answers", str(answers), "--judge", "anthropic/m", "--out", str(out), *extra]) code = 0 try: diff --git a/dokimi/tests/test_delivery.py b/dokimi/tests/test_delivery.py index b887e93f6..11e0e5cb0 100644 --- a/dokimi/tests/test_delivery.py +++ b/dokimi/tests/test_delivery.py @@ -752,3 +752,20 @@ def test_truncated_model_output_is_inconclusive(pack, monkeypatch): assert "model reply was truncated" in row["reason"] assert row["cost_usd"] == 0.01 assert row["evidence"] is None + + +@pytest.mark.parametrize("ref", [None, "anthropic/claude-sonnet-4", "openai/deepseek/deepseek-chat", + "deepseek/deepseek-chat", "openai/anthropic/claude-sonnet-4", + "openai/meta-llama/model", "openai/openai/gpt-4o", "openai/-local-model"]) +def test_scan_reproduction_parses_to_the_same_model(pack, monkeypatch, ref): + import shlex + from dokimi.cli import parse_args + + monkeypatch.setattr(delivery, "collect", lambda *args: []) + adapter = ["--model", ref] if ref else ["--fixture"] + args = parse_args(["delivery", "scan", "--manifest", str(pack.manifest), "--tasks", str(pack.tasks), + "--corpus", str(pack.corpus), "--out", "scan.json", *adapter]) + command = shlex.split(delivery.run(args)["reproduce"]) + assert command[0] == "dokimi" + replay = parse_args(command[1:]) + assert (replay.model, replay.provider, replay.fixture) == (args.model, args.provider, args.fixture) diff --git a/dokimi/tests/test_empty_question_rule.py b/dokimi/tests/test_empty_question_rule.py index f114d565b..0c090ded1 100644 --- a/dokimi/tests/test_empty_question_rule.py +++ b/dokimi/tests/test_empty_question_rule.py @@ -337,7 +337,7 @@ def evaluate(self, answers, include_without_docs=True): @pytest.mark.parametrize("cmd", [ ["eval", "score", "pairwise"], ["eval", "score", "checklist", "--questions", "{questions}"], - ["eval", "judge", "agreement", "--no-stored", "--judges", "anthropic/claude-haiku-4-5"], + ["eval", "judge", "agreement", "--no-stored", "--judge", "anthropic/claude-haiku-4-5"], ]) def test_no_probe_call_before_the_refusal(cmd, tmp_path, monkeypatch, capsys): from dokimi import cli diff --git a/dokimi/tests/test_eval_output_write_errors.py b/dokimi/tests/test_eval_output_write_errors.py index 3542b332a..78e9e26a8 100644 --- a/dokimi/tests/test_eval_output_write_errors.py +++ b/dokimi/tests/test_eval_output_write_errors.py @@ -88,7 +88,7 @@ def _stub_judge_commands(monkeypatch): "pairwise": ["eval", "score", "pairwise"], "checklist": ["eval", "score", "checklist", "--questions", "q.json"], "judge-wording": ["eval", "judge", "wording"], - "cross-judge": ["eval", "judge", "agreement", "--judges", "openai/m", "--no-stored"], + "cross-judge": ["eval", "judge", "agreement", "--judge", "openai/m", "--no-stored"], } _WRITES_MD = ["pairwise", "checklist", "cross-judge"] diff --git a/dokimi/tests/test_eval_score_method_version.py b/dokimi/tests/test_eval_score_method_version.py index 646a8b35e..936e9cd79 100644 --- a/dokimi/tests/test_eval_score_method_version.py +++ b/dokimi/tests/test_eval_score_method_version.py @@ -18,7 +18,7 @@ "with_docs": {"answer": "an answer", "doc_source": "x", "retrieved_docs": ["d"]}, "without_docs": {"answer": "without docs"}}] -JUDGE = ["--judge-provider", "amazon-bedrock", "--judge-model", "us.anthropic.x"] +JUDGE = ["--judge", "amazon-bedrock/us.anthropic.x"] @pytest.fixture diff --git a/dokimi/tests/test_exit_codes_boundaries.py b/dokimi/tests/test_exit_codes_boundaries.py index efd1fd140..626ae9280 100644 --- a/dokimi/tests/test_exit_codes_boundaries.py +++ b/dokimi/tests/test_exit_codes_boundaries.py @@ -556,7 +556,7 @@ def test_preflight_unknown_doc_source_format_exits_2(tmp_path, monkeypatch, caps monkeypatch.setattr(benchmark, "_load_registry", lambda args: _OneLibrary()) _argv(monkeypatch, "benchmark", "preflight", "--library", "onetbb", "--doc-source", "bogus:docs", "--out-dir", str(tmp_path / "out"), - "--provider", "openai", "--judge-provider", "openai", "--judge-model", "judge-x") + "--model", "openai/gpt-6.1-sol", "--judge", "openai/judge-x") with refusal() as exc: cli.main() assert exc.code == 2 @@ -574,7 +574,7 @@ def test_preflight_refuses_a_local_doc_source_path_that_does_not_exist(tmp_path, monkeypatch.setenv("OPENAI_API_KEY", "test") monkeypatch.setattr(benchmark, "_load_registry", lambda args: _OneLibrary()) _argv(monkeypatch, "benchmark", "preflight", "--library", "onetbb", "--doc-source", f"{prefix}{docs}", - "--out-dir", str(tmp_path / "out"), "--provider", "openai", "--judge-provider", "openai", "--judge-model", "judge-x") + "--out-dir", str(tmp_path / "out"), "--model", "openai/gpt-6.1-sol", "--judge", "openai/judge-x") if exists: cli.main() assert "Preflight OK" in capsys.readouterr().out @@ -593,7 +593,7 @@ def test_external_content_walkthrough_states_the_exit_of_a_preflight_without_key monkeypatch.delenv("OPENAI_API_KEY", raising=False) monkeypatch.setattr(benchmark, "_load_registry", lambda args: _OneLibrary()) _argv(monkeypatch, "benchmark", "preflight", "--library", "onetbb", "--out-dir", str(tmp_path / "out"), - "--provider", "openai", "--judge-provider", "openai", "--judge-model", "judge-x") + "--model", "openai/gpt-6.1-sol", "--judge", "openai/judge-x") with refusal() as exc: cli.main() assert exc.code == stated @@ -653,12 +653,13 @@ def test_trigger_set_no_text_refused_before_any_rewrite_call(tmp_path, monkeypat # The set is refused on its second question; the first must not have been sent to the rewrite model. rewrite_calls = [] monkeypatch.setattr("dokimi.llm.llm_call", lambda *args, **kwargs: rewrite_calls.append(1) or "rewritten") + monkeypatch.setattr("dokimi.commands.catalog.is_litellm_route", lambda _: pytest.fail("looked up a provider")) spec = _trigger_questions(tmp_path, [ {"id": "1", "text": "perf shows low IPC", "metadata": {"skill_under_test": "linux-perf"}}, {"id": "2", "metadata": {"skill_under_test": "linux-perf"}}, ]) _argv(monkeypatch, "eval", "triggers", "generate", "--catalog", str(_skill_root(tmp_path)), - "--questions", spec, "--rewrite", "--model", "m", "--out", str(tmp_path / "o.json")) + "--questions", spec, "--rewrite", "--model", "groq/llama", "--out", str(tmp_path / "o.json")) with refusal() as exc: cli.main() assert exc.code == 2 @@ -667,6 +668,36 @@ def test_trigger_set_no_text_refused_before_any_rewrite_call(tmp_path, monkeypat assert not (tmp_path / "o.json").exists() +@pytest.mark.parametrize(("model_ref", "model", "provider", "routes"), [ + ("groq/llama-3.3-70b-versatile", "llama-3.3-70b-versatile", "groq", ["groq"]), + ("huggingface/org/model", "huggingface/org/model", "huggingface", ["huggingface"]), + ("meta-llama/llama", "meta-llama/llama", "openai", ["meta-llama"]), + ("openai/org/model", "org/model", "openai", []), +]) +def test_trigger_rewrite_resolves_the_model_once_after_validation(model_ref, model, provider, routes, tmp_path, monkeypatch): + calls = [] + lookups = [] + monkeypatch.setattr("dokimi.llm.llm_call", lambda *a, **kwargs: calls.append(kwargs) or "I see low IPC") + + def is_route(prefix): + lookups.append(prefix) + return prefix in {"groq", "huggingface"} + + monkeypatch.setattr("dokimi.commands.catalog.is_litellm_route", is_route) + spec = _trigger_questions(tmp_path, [ + {"id": str(i), "text": "perf shows low IPC", "metadata": {"skill_under_test": "linux-perf"}} for i in range(2) + ]) + _argv(monkeypatch, "eval", "triggers", "generate", "--catalog", str(_skill_root(tmp_path)), + "--questions", spec, "--rewrite", "--model", model_ref, "--out", str(tmp_path / "o.json")) + cli.main() + assert lookups == routes + assert calls == [{"model": model, "provider": provider}] * 2 + if model_ref == "openai/org/model": + from dokimi.llm import resolve_model + + assert resolve_model(**calls[0]) == resolve_model("org/model", "openai") == model_ref + + def test_trigger_set_file_without_labels_is_valid_and_its_questions_stay_unlabelled(tmp_path, monkeypatch, capsys): # A --trigger-set file whose questions carry no expected_skill is valid: they are read unlabelled. path = tmp_path / "unlabelled.json" diff --git a/dokimi/tests/test_exit_codes_input_errors.py b/dokimi/tests/test_exit_codes_input_errors.py index ad5a80442..a13d7bafe 100644 --- a/dokimi/tests/test_exit_codes_input_errors.py +++ b/dokimi/tests/test_exit_codes_input_errors.py @@ -97,8 +97,8 @@ def test_benchmark_preflight_missing_credential_exits_2(tmp_path, monkeypatch, c monkeypatch.delenv(var, raising=False) monkeypatch.setattr( "sys.argv", - ["dokimi", "benchmark", "preflight", "--library", "onetbb", "--provider", "openai", - "--judge-provider", "openai", "--judge-model", "judge-x", "--out-dir", str(tmp_path / "out")], + ["dokimi", "benchmark", "preflight", "--library", "onetbb", "--model", "openai/gpt-6.1-sol", + "--judge", "openai/judge-x", "--out-dir", str(tmp_path / "out")], ) with pytest.raises(SystemExit) as exc: cli.main() @@ -157,10 +157,10 @@ def run(self, concurrency): @pytest.mark.parametrize( - "flag, vertex", [("--provider", "google-vertex"), ("--judge-provider", "google-vertex"), - ("--judge-provider", "google")], + "flag, spec", [("--model", "google-vertex/gemini-2.5-pro"), ("--judge", "google-vertex/gemini-2.5-pro"), + ("--judge", "google/gemini-2.5-pro")], ) -def test_benchmark_run_vertex_adc_needs_no_gemini_key(flag, vertex, tmp_path, monkeypatch): +def test_benchmark_run_vertex_adc_needs_no_gemini_key(flag, spec, tmp_path, monkeypatch): """#967: Vertex reads application-default credentials (docs/reviewing.md), so no `GEMINI_API_KEY`.""" monkeypatch.delenv("GEMINI_API_KEY", raising=False) monkeypatch.setenv("OPENAI_API_KEY", "k") @@ -177,11 +177,7 @@ def run(self, concurrency): monkeypatch.setattr("dokimi.orchestrator.EvaluationPipeline", _Pipeline) argv = ["dokimi", "benchmark", "run", "--library", "onetbb", "--out-dir", str(tmp_path / "out"), - flag, vertex] - if flag == "--provider": - argv += ["--model", "gemini-2.5-pro"] - else: - argv += ["--judge-model", "gemini-2.5-pro"] + flag, spec] monkeypatch.setattr("sys.argv", argv) cli.main() assert len(built) == 1 @@ -213,8 +209,7 @@ def test_benchmark_run_bedrock_iam_credentials_need_no_bearer_token(tmp_path, mo monkeypatch.setenv("AWS_REGION", "us-east-1") built, _ = _run_with_fake_pipeline( monkeypatch, tmp_path, - ["--provider", "amazon-bedrock", "--model", "us.anthropic.claude-sonnet-4-6", - "--judge-provider", "amazon-bedrock", "--judge-model", "us.anthropic.claude-haiku-4-5"], + ["--model", "amazon-bedrock/us.anthropic.claude-sonnet-4-6", "--judge", "amazon-bedrock/us.anthropic.claude-haiku-4-5"], ) cli.main() assert len(built) == 1 @@ -226,8 +221,7 @@ def test_benchmark_run_unreadable_bedrock_token_file_exits_2(tmp_path, monkeypat monkeypatch.setenv("OPENAI_API_KEY", "k") built, out = _run_with_fake_pipeline( monkeypatch, tmp_path, - ["--provider", "openai", "--model", "gpt-4o", - "--judge-provider", "amazon-bedrock", "--judge-model", "us.anthropic.claude-haiku-4-5"], + ["--model", "openai/gpt-4o", "--judge", "amazon-bedrock/us.anthropic.claude-haiku-4-5"], ) with pytest.raises(SystemExit) as exc: cli.main() @@ -243,8 +237,7 @@ def test_benchmark_run_unreadable_bedrock_token_file_on_bedrock_route_exits_2(tm monkeypatch.delenv("ANTHROPIC_API_KEY", raising=False) built, _ = _run_with_fake_pipeline( monkeypatch, tmp_path, - ["--provider", "openai", "--model", "gpt-4o", - "--judge-provider", "anthropic", "--judge-model", "bedrock/us.anthropic.claude-haiku-4-5"], + ["--model", "openai/gpt-4o", "--judge", "anthropic/bedrock/us.anthropic.claude-haiku-4-5"], ) with pytest.raises(SystemExit) as exc: cli.main() @@ -259,8 +252,7 @@ def test_benchmark_run_bedrock_route_with_configured_key_ignores_unreadable_aws_ monkeypatch.setenv("OPENAI_API_KEY", "k") built, _ = _run_with_fake_pipeline( monkeypatch, tmp_path, - ["--provider", "anthropic", "--model", "bedrock/us.anthropic.claude-sonnet-4-6", - "--judge-provider", "openai", "--judge-model", "gpt-4o"], + ["--model", "anthropic/bedrock/us.anthropic.claude-sonnet-4-6", "--judge", "openai/gpt-4o"], ) cli.main() assert len(built) == 1 @@ -273,8 +265,7 @@ def test_benchmark_run_gemini_route_without_a_gemini_key_exits_2(tmp_path, monke monkeypatch.setenv("OPENAI_API_KEY", "k") built, out = _run_with_fake_pipeline( monkeypatch, tmp_path, - ["--provider", "google-vertex", "--model", "gemini/gemini-2.5-pro", - "--judge-provider", "openai", "--judge-model", "gpt-4o"], + ["--model", "google-vertex/gemini/gemini-2.5-pro", "--judge", "openai/gpt-4o"], ) with pytest.raises(SystemExit) as exc: cli.main() @@ -290,8 +281,7 @@ def test_benchmark_run_gemini_route_takes_google_api_key(tmp_path, monkeypatch): monkeypatch.setenv("OPENAI_API_KEY", "k") built, _ = _run_with_fake_pipeline( monkeypatch, tmp_path, - ["--provider", "google-vertex", "--model", "gemini/gemini-2.5-pro", - "--judge-provider", "openai", "--judge-model", "gpt-4o"], + ["--model", "google-vertex/gemini/gemini-2.5-pro", "--judge", "openai/gpt-4o"], ) cli.main() assert len(built) == 1 @@ -304,8 +294,7 @@ def test_benchmark_run_gemini_route_takes_gemini_api_key(tmp_path, monkeypatch): monkeypatch.setenv("OPENAI_API_KEY", "k") built, _ = _run_with_fake_pipeline( monkeypatch, tmp_path, - ["--provider", "openai", "--model", "gpt-4o", - "--judge-provider", "google", "--judge-model", "gemini/gemini-2.5-pro"], + ["--model", "openai/gpt-4o", "--judge", "google/gemini/gemini-2.5-pro"], ) cli.main() assert len(built) == 1 @@ -316,8 +305,7 @@ def test_benchmark_run_explicit_vertex_route_needs_no_provider_key(tmp_path, mon monkeypatch.delenv("ANTHROPIC_API_KEY", raising=False) built, _ = _run_with_fake_pipeline( monkeypatch, tmp_path, - ["--provider", "anthropic", "--model", "vertex_ai/gemini-2.5-pro", - "--judge-provider", "google-vertex", "--judge-model", "gemini-2.5-pro"], + ["--model", "anthropic/vertex_ai/gemini-2.5-pro", "--judge", "google-vertex/gemini-2.5-pro"], ) cli.main() assert len(built) == 1 @@ -329,8 +317,7 @@ def test_benchmark_run_explicit_gemini_route_needs_no_provider_key(tmp_path, mon monkeypatch.delenv("GOOGLE_API_KEY", raising=False) monkeypatch.setenv("GEMINI_API_KEY", "k") monkeypatch.setenv("OPENAI_API_KEY", "k") - argv = ["--provider", "anthropic", "--model", "gemini/gemini-2.5-pro", - "--judge-provider", "openai", "--judge-model", "gpt-4o"] + argv = ["--model", "anthropic/gemini/gemini-2.5-pro", "--judge", "openai/gpt-4o"] built, _ = _run_with_fake_pipeline(monkeypatch, tmp_path, argv) cli.main() assert len(built) == 1 @@ -349,8 +336,7 @@ def test_benchmark_run_off_table_route_needs_no_provider_key(tmp_path, monkeypat monkeypatch.setenv("OPENAI_API_KEY", "k") built, _ = _run_with_fake_pipeline( monkeypatch, tmp_path, - ["--provider", "anthropic", "--model", "azure/my-deployment", - "--judge-provider", "openai", "--judge-model", "gpt-4o"], + ["--model", "anthropic/azure/my-deployment", "--judge", "openai/gpt-4o"], ) cli.main() assert len(built) == 1 @@ -372,8 +358,7 @@ def test_benchmark_run_cli_provider_with_a_cloud_route_model_still_needs_its_log _no_codex(monkeypatch) built, out = _run_with_fake_pipeline( monkeypatch, tmp_path, - ["--provider", "codex-cli", "--model", "vertex_ai/gemini-2.5-pro", - "--judge-provider", "openai", "--judge-model", "gpt-4o"], + ["--model", "codex-cli/vertex_ai/gemini-2.5-pro", "--judge", "openai/gpt-4o"], ) with pytest.raises(SystemExit) as exc: cli.main() @@ -389,7 +374,7 @@ def test_benchmark_run_unreadable_gemini_key_file_is_not_rescued_by_google_api_k monkeypatch.setenv("GEMINI_API_KEY", f"file:{tmp_path / 'nope'}") built, out = _run_with_fake_pipeline( monkeypatch, tmp_path, - ["--judge-provider", "google-vertex", "--judge-model", "gemini/gemini-2.5-pro"], + ["--judge", "google-vertex/gemini/gemini-2.5-pro"], ) with pytest.raises(SystemExit) as exc: cli.main() @@ -409,8 +394,8 @@ def test_benchmark_run_cross_provider_route_checks_the_route_key(provider, model monkeypatch.delenv(var, raising=False) monkeypatch.setenv(route_key, "k") judge = "anthropic" if route_key == "ANTHROPIC_API_KEY" else "openai" - argv = ["--provider", provider, "--model", model, "--judge-provider", judge, - "--judge-model", "claude-haiku-4-5" if judge == "anthropic" else "gpt-4o"] + argv = ["--model", f"{provider}/{model}", + "--judge", f"{judge}/" + ("claude-haiku-4-5" if judge == "anthropic" else "gpt-4o")] built, _ = _run_with_fake_pipeline(monkeypatch, tmp_path, argv) cli.main() assert len(built) == 1 @@ -427,7 +412,7 @@ def test_benchmark_run_warns_when_the_login_cannot_be_checked(tmp_path, monkeypa _no_codex(monkeypatch, authenticated=None, installed=True) built, _ = _run_with_fake_pipeline( monkeypatch, tmp_path, - ["--provider", "codex-cli", "--model", "gpt-5", "--judge-provider", "openai", "--judge-model", "gpt-4o"], + ["--model", "codex-cli/gpt-5", "--judge", "openai/gpt-4o"], ) cli.main() assert len(built) == 1 @@ -442,8 +427,7 @@ def test_benchmark_run_unreadable_key_file_of_the_configured_provider_is_refused monkeypatch.setenv("ANTHROPIC_API_KEY", "k") built, out = _run_with_fake_pipeline( monkeypatch, tmp_path, - ["--provider", "openai", "--model", "anthropic/claude-sonnet-4-5", - "--judge-provider", "anthropic", "--judge-model", "claude-haiku-4-5"], + ["--model", "openai/anthropic/claude-sonnet-4-5", "--judge", "anthropic/claude-haiku-4-5"], ) with pytest.raises(SystemExit) as exc: cli.main() @@ -461,8 +445,7 @@ def test_benchmark_run_unreadable_key_file_of_the_configured_provider_is_refused monkeypatch.setenv("OPENAI_API_KEY", "k") built, out = _run_with_fake_pipeline( monkeypatch, tmp_path, - ["--provider", "anthropic", "--model", "gemini/gemini-2.5-pro", - "--judge-provider", "openai", "--judge-model", "gpt-4o"], + ["--model", "anthropic/gemini/gemini-2.5-pro", "--judge", "openai/gpt-4o"], ) with pytest.raises(SystemExit) as exc: cli.main() @@ -473,8 +456,8 @@ def test_benchmark_run_unreadable_key_file_of_the_configured_provider_is_refused @pytest.mark.parametrize( "argv_tail", - [["--provider", "anthropic", "--model", "vertex_ai/gemini-2.5-pro"], - ["--provider", "google-vertex", "--model", "gemini-2.5-pro"]], + [["--model", "anthropic/vertex_ai/gemini-2.5-pro"], + ["--model", "google-vertex/gemini-2.5-pro"]], ) def test_benchmark_preflight_skips_the_credentials_run_skips(argv_tail, tmp_path, monkeypatch, capsys): """#967: `preflight` and `run` share the route rule, so ADC and `vertex_ai/` routes need no key in either.""" @@ -491,7 +474,7 @@ def _checks(providers, notes=None, refusals=None): monkeypatch.setattr( "sys.argv", ["dokimi", "benchmark", "preflight", "--library", "onetbb", *argv_tail, - "--judge-provider", "openai", "--judge-model", "gpt-4o", "--out-dir", str(tmp_path / "out")], + "--judge", "openai/gpt-4o", "--out-dir", str(tmp_path / "out")], ) try: cli.main() diff --git a/dokimi/tests/test_import_architecture.py b/dokimi/tests/test_import_architecture.py index 563270dae..6602c3701 100644 --- a/dokimi/tests/test_import_architecture.py +++ b/dokimi/tests/test_import_architecture.py @@ -75,10 +75,10 @@ # process chokepoints, console output. ("foundation", ( "dokimi", "dokimi._version", "dokimi.artifacts", "dokimi.caching", "dokimi.cli_flags", - "dokimi.cli_output", "dokimi.cli_types", "dokimi.exit_codes", "dokimi.config", "dokimi.console", + "dokimi.cli_model_ref", "dokimi.cli_output", "dokimi.cli_types", "dokimi.exit_codes", "dokimi.config", "dokimi.console", "dokimi.container_policy", "dokimi.defaults", "dokimi.docker_cmd", "dokimi.intents", "dokimi.judged", "dokimi.llm", "dokimi.llm_cli", "dokimi.llm_json", - "dokimi.llm_sampling", "dokimi.llm_turn", + "dokimi.llm_providers", "dokimi.llm_sampling", "dokimi.llm_turn", "dokimi.llm_pricing", "dokimi.measure", "dokimi.process", "dokimi.process_hooks", "dokimi.process_io", "dokimi.atomic_write", "dokimi.provenance", "dokimi.records", "dokimi.registry", "dokimi.utils", "dokimi.write_probe", "dokimi.yaml_unique", "dokimi.pattern_glob", diff --git a/dokimi/tests/test_input_devices.py b/dokimi/tests/test_input_devices.py index c91d6bbc0..8591e017c 100644 --- a/dokimi/tests/test_input_devices.py +++ b/dokimi/tests/test_input_devices.py @@ -141,7 +141,7 @@ def test_benchmark_refuses_a_device_as_questions_from_with_its_own_message(monke monkeypatch.setattr("dokimi.mcp.factory.create_doc_source_client", lambda doc_source: object()) monkeypatch.setattr(benchmark, "_run_single_library", lambda *a, **k: pytest.fail("the run started")) assert _main(monkeypatch, "benchmark", command, "--library", "onetbb", "--doc-source", "local:docs", - "--provider", "openai", "--judge-provider", "openai", "--model", "gpt-5.5", "--out-dir", str(tmp_path / "out"), + "--judge", "openai/gpt-5.5", "--model", "openai/gpt-5.5", "--out-dir", str(tmp_path / "out"), "--questions-from", DEVICE) == 2 err = capsys.readouterr().err assert "--questions-from /dev/null: not a file" in err diff --git a/dokimi/tests/test_input_refusal_pins.py b/dokimi/tests/test_input_refusal_pins.py index c6fd0e91b..d927c6a34 100644 --- a/dokimi/tests/test_input_refusal_pins.py +++ b/dokimi/tests/test_input_refusal_pins.py @@ -86,7 +86,7 @@ def test_cross_judge_refuses_an_unreadable_questions_file(tmp_path, no_judge): def test_cross_judge_refuses_a_judge_spec_without_a_model(tmp_path, no_judge): - out = _run(["eval", "judge", "agreement", "--answers", str(_arms(tmp_path)), "--judges", "amazon-bedrock"]) + out = _run(["eval", "judge", "agreement", "--answers", str(_arms(tmp_path)), "--judge", "amazon-bedrock"]) assert "must be provider/model" in out.err diff --git a/dokimi/tests/test_judge_context_mode.py b/dokimi/tests/test_judge_context_mode.py index adcfdd61c..4f0bcb56f 100644 --- a/dokimi/tests/test_judge_context_mode.py +++ b/dokimi/tests/test_judge_context_mode.py @@ -173,7 +173,7 @@ def test_missing_withheld_material_never_feeds_treatment_snippets_to_the_judge(f assert output["judge_context_sources"] == {"stored": 1, "withheld": 1} -@pytest.mark.parametrize("measure_flag", ["--pairwise", "--checklist", "--judges"]) +@pytest.mark.parametrize("measure_flag", ["--pairwise", "--checklist", "--judge"]) @pytest.mark.parametrize("contradiction", [False, True]) def test_withheld_scores_can_be_compared_with_answers_only_results( fake_answers, demo_skill, tmp_path, monkeypatch, measure_flag, contradiction): @@ -193,11 +193,11 @@ def test_withheld_scores_can_be_compared_with_answers_only_results( other = tmp_path / "other.json" other.write_text(json.dumps(result), encoding="utf-8") out = tmp_path / "agreement.json" - if measure_flag == "--judges": + if measure_flag == "--judge": from dokimi.eval import judge as judge_module monkeypatch.setattr(judge_module, "Judge", lambda **kwargs: judge) - value = "amazon-bedrock/m" if measure_flag == "--judges" else str(other) + value = "amazon-bedrock/m" if measure_flag == "--judge" else str(other) args = build_parser().parse_args(["eval", "judge", "agreement", "--answers", str(answers), measure_flag, value, "--out", str(out)]) @@ -235,7 +235,7 @@ def test_a_withheld_run_without_answer_digests_is_rescored_by_another_judge( out = tmp_path / "agreement.json" monkeypatch.setattr(judge_module, "Judge", lambda **kwargs: judge) args = build_parser().parse_args(["eval", "judge", "agreement", "--answers", str(answers), - "--judges", "amazon-bedrock/m", "--out", str(out)]) + "--judge", "amazon-bedrock/m", "--out", str(out)]) with refusal() as response: args.func(args) diff --git a/dokimi/tests/test_judge_not_measured.py b/dokimi/tests/test_judge_not_measured.py index 3034127d8..8399b2394 100644 --- a/dokimi/tests/test_judge_not_measured.py +++ b/dokimi/tests/test_judge_not_measured.py @@ -52,7 +52,7 @@ def score_answer(self, **_): empty.write_text(json.dumps(unpaired), encoding="utf-8") # A judge that errored on every call is a failed run (exit 1: a runtime failure), not only an incomplete verdict. for argv, arms, exit_code, why in ( - (["--answers", str(errored), "--no-stored", "--judges", "amazon-bedrock/m"], {"skill": "NOT MEASURED"}, + (["--answers", str(errored), "--no-stored", "--judge", "amazon-bedrock/m"], {"skill": "NOT MEASURED"}, 1, "Error: amazon-bedrock/m (aggregate) scored none of its 16 answers"), (["--answers", str(empty)], {}, 3, "✗ incomplete"), # inconclusive (§2.6) ): @@ -85,7 +85,7 @@ def score_answer(self, *, answer, **_): "metadata": {"arm_kind": "skill"}} path = tmp_path / "answers.json" path.write_text(json.dumps(data), encoding="utf-8") - code = _strict_exit(["eval", "judge", "agreement", "--answers", str(path), "--no-stored", "--judges", + code = _strict_exit(["eval", "judge", "agreement", "--answers", str(path), "--no-stored", "--judge", "amazon-bedrock/m", "--out", str(tmp_path / "cj.json"), "--strict"]) summary = json.loads((tmp_path / "cj.json").read_text())["summary"] assert summary["arms"]["skill"]["label"] != "NOT MEASURED" @@ -113,7 +113,7 @@ def rows(**kw): answers.write_text(json.dumps(validity_answers()), encoding="utf-8") monkeypatch.setattr(judge_wording, "run_wording", lambda *a, **k: report) code = _strict_exit(["eval", "judge", "wording", "--answers", str(answers), "--bases", "2", - "--judge-provider", "amazon-bedrock", "--judge-model", "m", "--strict"]) + "--judge", "amazon-bedrock/m", "--strict"]) out = capsys.readouterr() assert report.summary()["unmeasured_conditions"] == ["persona"] assert code == 1 @@ -124,7 +124,7 @@ def rows(**kw): assert all(not r["fragile"] for r in report.summary()["per_variant"].values()) # Report-only without --strict: the same run prints NOT MEASURED and exits 0. code = _strict_exit(["eval", "judge", "wording", "--answers", str(answers), "--bases", "2", - "--judge-provider", "amazon-bedrock", "--judge-model", "m"]) + "--judge", "amazon-bedrock/m"]) assert code == 0 assert "NOT MEASURED" in capsys.readouterr().out @@ -149,7 +149,7 @@ def errored(n): report = WordingReport(judge="fake", reports={c: errored(n) for c in ("original", "persona")}) monkeypatch.setattr(judge_wording, "run_wording", lambda *a, _r=report, **k: _r) code = _strict_exit(["eval", "judge", "wording", "--answers", str(answers), "--bases", "2", - "--judge-provider", "amazon-bedrock", "--judge-model", "m", "--strict"]) + "--judge", "amazon-bedrock/m", "--strict"]) assert code == 1 out = capsys.readouterr() assert "NOT MEASURED — no pair scored under: original, persona" in out.out @@ -192,7 +192,7 @@ def score_answer(self, *, answer, **_): # prefers the baseline, the stored judg monkeypatch.setattr(judge_mod, "Judge", OppositeJudge) path = tmp_path / "run.json" path.write_text(json.dumps(_material_run()), encoding="utf-8") - argv = ["eval", "judge", "agreement", "--answers", str(path), "--judges", "amazon-bedrock/m", + argv = ["eval", "judge", "agreement", "--answers", str(path), "--judge", "amazon-bedrock/m", "--out", str(tmp_path / "cj.json")] assert _strict_exit(argv) == 0 capsys.readouterr() @@ -221,7 +221,7 @@ def score_answer(self, *, answer, **_): # the baseline beats skill, and skill2 ev["scores"]["skill2"] = dict(ev["scores"]["skill"]) path = tmp_path / "run.json" path.write_text(json.dumps(data), encoding="utf-8") - argv = ["eval", "judge", "agreement", "--answers", str(path), "--judges", "amazon-bedrock/m", + argv = ["eval", "judge", "agreement", "--answers", str(path), "--judge", "amazon-bedrock/m", "--out", str(tmp_path / "cj.json")] assert _strict_exit(argv) == 0 capsys.readouterr() @@ -246,7 +246,7 @@ def score_answer(self, *, answer, **_): # prefers the skill, as the stored judg monkeypatch.setattr(judge_mod, "Judge", AgreeingJudge) path = tmp_path / "run.json" path.write_text(json.dumps(_material_run()), encoding="utf-8") - argv = ["eval", "judge", "agreement", "--answers", str(path), "--judges", "amazon-bedrock/m", + argv = ["eval", "judge", "agreement", "--answers", str(path), "--judge", "amazon-bedrock/m", "--out", str(tmp_path / "cj.json")] assert _strict_exit([*argv, "--strict"]) == 0 assert "incomplete" not in capsys.readouterr().err @@ -274,7 +274,21 @@ def rows(degraded): answers.write_text(json.dumps(validity_answers()), encoding="utf-8") monkeypatch.setattr(judge_wording, "run_wording", lambda *a, **k: report) argv = ["eval", "judge", "wording", "--answers", str(answers), "--bases", "2", - "--judge-provider", "amazon-bedrock", "--judge-model", "m"] + "--judge", "amazon-bedrock/m"] assert _strict_exit(argv) == 0 assert "FRAGILE" in capsys.readouterr().out assert _strict_exit([*argv, "--strict"]) == 1 + + +def test_agreement_without_any_scores_names_the_live_judge_flag(tmp_path): + import pytest + + from dokimi.commands.judge_reliability import cmd_eval_cross_judge + from dokimi.cli import parse_args + from dokimi.utils import InputError + + path = tmp_path / "answers.json" + path.write_text("[]") + args = parse_args(["eval", "judge", "agreement", "--answers", str(path), "--no-stored"]) + with pytest.raises(InputError, match="give --judge,"): + cmd_eval_cross_judge(args) diff --git a/dokimi/tests/test_judge_placeholder_entry_points.py b/dokimi/tests/test_judge_placeholder_entry_points.py index 06fc91770..c8e6884dc 100644 --- a/dokimi/tests/test_judge_placeholder_entry_points.py +++ b/dokimi/tests/test_judge_placeholder_entry_points.py @@ -19,7 +19,7 @@ "doc_source": "fallback_none", "retrieved_docs": []}, "without_docs": {"answer": "without docs"}}] -JUDGE = ["--judge-provider", "amazon-bedrock", "--judge-model", "us.anthropic.x"] +JUDGE = ["--judge", "amazon-bedrock/us.anthropic.x"] @pytest.fixture diff --git a/dokimi/tests/test_judge_provider_choices.py b/dokimi/tests/test_judge_provider_choices.py index a7432ee25..12bdc8572 100644 --- a/dokimi/tests/test_judge_provider_choices.py +++ b/dokimi/tests/test_judge_provider_choices.py @@ -18,13 +18,17 @@ from dokimi.eval.judge import JUDGE_PROVIDERS, Judge +def _offered(action): + return tuple(getattr(action, "providers", None) or action.choices or ()) + + def _judge_provider_actions(parser, path=()): for action in parser._actions: if isinstance(action, argparse._SubParsersAction): for name, sub in action.choices.items(): yield from _judge_provider_actions(sub, path + (name,)) - elif action.dest in ("judge_provider", "escalate_provider") and action.choices: - yield " ".join(path) + " " + action.option_strings[0], action.choices + elif getattr(action, "provider_dest", action.dest) in ("judge_provider", "escalate_provider") and _offered(action): + yield " ".join(path) + " " + action.option_strings[0], _offered(action) #: Judge-role flags whose value never reaches ``Judge``: the novelty commands call @@ -38,9 +42,9 @@ def test_every_judge_provider_flag_offers_exactly_judge_providers(): # Equality, not subset: a hardcoded list that merely omits a rejected # provider (as ``eval score`` had) still drifts from what Judge accepts. actions = dict(_judge_provider_actions(build_parser())) - for flag in ("benchmark run --judge-provider", "arms run --judge-provider", + for flag in ("benchmark run --judge", "arms run --judge-provider", "arms matrix-run --judge-provider", "subjects run --judge-provider", - "evaluate --judge-provider", "eval score pointwise --judge-provider", + "evaluate --judge", "eval score pointwise --judge", "eval judge validate --escalate-provider"): assert flag in actions assert NOT_THE_JUDGE_CLASS <= actions.keys() @@ -57,10 +61,10 @@ def test_every_judge_provider_flag_offers_exactly_judge_providers(): def test_benchmark_run_rejects_openai_codex_judge_at_parse_time(capsys): with pytest.raises(SystemExit) as exc: build_parser().parse_args( - ["benchmark", "run", "--library", "x", "--judge-provider", "openai-codex"] + ["benchmark", "run", "--library", "x", "--judge", "openai-codex/m"] ) assert exc.value.code == 2 - assert "invalid choice: 'openai-codex'" in capsys.readouterr().err + assert "is not a provider for this command" in capsys.readouterr().err # Together with the equality test above this covers `eval score` and every other flag. diff --git a/dokimi/tests/test_judge_provider_default.py b/dokimi/tests/test_judge_provider_default.py index 691c5d0ca..a3e983cba 100644 --- a/dokimi/tests/test_judge_provider_default.py +++ b/dokimi/tests/test_judge_provider_default.py @@ -26,7 +26,7 @@ def _judge_commands() -> dict[str, list[str]]: found: dict[str, list[str]] = {} def walk(parser: argparse.ArgumentParser, path: list[str]) -> None: - dests = {a.dest for a in parser._actions} + dests = {a.dest for a in parser._actions} | set(parser._defaults) # add_model_flag sets judge_provider as a default if ("judge_provider" in dests and path[0] != "novelty" and path[:2] != ["skill", "novelty"] and path[:2] != ["catalog", "novelty"]): argv = list(path) @@ -50,6 +50,8 @@ def walk(parser: argparse.ArgumentParser, path: list[str]) -> None: #: The commands that answer a question (have ``--model``); the ``eval score``/``eval judge`` ones only grade. ANSWERED_COMMANDS = {"arms run", "arms matrix-run", "benchmark run", "benchmark preflight", "benchmark batch", "evaluate", "subjects run"} +#: The commands that keep ``--judge-provider`` (arms, subjects); the others take ``--judge PROVIDER/MODEL``. +KEPT_SPELLING = {"arms run", "arms matrix-run", "subjects run"} def test_the_commands_that_take_a_judge_provider_are_all_covered(): @@ -61,9 +63,13 @@ def test_the_commands_that_take_a_judge_provider_are_all_covered(): @pytest.mark.parametrize("command", sorted(COMMANDS)) -def test_every_judge_command_defaults_the_model_to_its_provider(command): +def test_every_judge_command_takes_the_placeholder_judge_model(command): + assert build_parser().parse_args(COMMANDS[command]).judge_model is JUDGE_MODEL_FOR_PROVIDER + + +@pytest.mark.parametrize("command", sorted(KEPT_SPELLING)) +def test_a_judge_provider_switch_defaults_the_model_to_its_provider(command): argv = COMMANDS[command] - assert build_parser().parse_args(argv).judge_model is JUDGE_MODEL_FOR_PROVIDER # The answerer is the default gpt-6.1-sol; a command with no answerer (eval score/judge) judges it. if command in ANSWERED_COMMANDS: argv = [*argv, "--model", DEFAULT_JUDGE_MODEL] @@ -78,7 +84,7 @@ def test_every_judge_command_defaults_the_model_to_its_provider(command): ("amazon-bedrock", DEFAULT_JUDGE_MODEL), ]) def test_a_provider_alone_takes_the_default_judge_that_runs_there(provider, model): - args = parse_args([*COMMANDS["eval score pointwise"], "--judge-provider", provider]) + args = parse_args([*COMMANDS["arms run"], "--judge-provider", provider]) assert (args.judge_provider, args.judge_model) == (provider, model) assert type(args.judge_model) is str @@ -86,9 +92,23 @@ def test_a_provider_alone_takes_the_default_judge_that_runs_there(provider, mode def test_a_provider_alone_whose_default_judge_is_the_answerer_exits(capsys): # The default answerer gpt-6.1-sol is the only default on openai: the shared rule refuses it. with pytest.raises(SystemExit) as exc: - parse_args([*COMMANDS["benchmark run"], "--judge-provider", "openai"]) + parse_args([*COMMANDS["arms run"], "--judge", "--judge-provider", "openai"]) + assert exc.value.code == 2 + assert "the default judge there is the model under measurement" in capsys.readouterr().err + + +@pytest.mark.parametrize("command", ["evaluate", "benchmark run"]) +def test_default_self_judge_refusal_names_the_qualified_option(command, capsys): + argv = [*COMMANDS[command], "--model", f"anthropic/{DEFAULT_JUDGE_MODEL}"] + with pytest.raises(SystemExit) as exc: + parse_args(argv) assert exc.value.code == 2 - assert "--judge-provider openai: the default judge there is the model under measurement" in capsys.readouterr().err + message = capsys.readouterr().err + assert "the default judge is the model under measurement" in message + assert "pass --judge PROVIDER/MODEL" in message + assert "--judge-model" not in message + args = parse_args([*argv, "--judge", f"openai/{DEFAULT_GENERATOR_MODEL}"]) + assert (args.judge_provider, args.judge_model) == ("openai", DEFAULT_GENERATOR_MODEL) def test_a_claude_cli_judge_is_an_alias_of_another_family(): @@ -162,8 +182,7 @@ def test_a_library_matrix_judge_is_not_moved_by_an_unused_claude_cli_top_level_p def test_a_library_matrix_judge_left_out_is_the_cli_matrix_judge_with_a_claude_cli_top_level_provider(tmp_path): args = parse_args(["arms", "matrix-run", "--product", "p", "--questions", "q.jsonl", "--arm", "a.json", - "--matrix-cells", str(tmp_path / "cells.json"), "--judge", "--provider", "claude-cli", - "--model", "sonnet"]) + "--matrix-cells", str(tmp_path / "cells.json"), "--judge", "--model", "claude-cli/sonnet"]) assert (args.judge_provider, args.judge_model) == ("anthropic", "claude-sonnet-5-5") config = ArmsRunConfig(product="demo", judge=True, model="sonnet", provider="claude-cli") assert (config.judge_provider, config.judge_model) == ("claude-cli", "opus") # a single run follows its CLI @@ -175,7 +194,7 @@ def test_a_library_matrix_judge_left_out_is_the_cli_matrix_judge_with_a_claude_c def test_a_claude_cli_answerer_judges_on_its_cli_when_no_judge_provider_is_named(): # The CLI's argparse default (anthropic) must not stop the rule from taking the answerer's provider. - args = parse_args([*COMMANDS["arms run"], "--provider", "claude-cli", "--model", "sonnet", "--judge"]) + args = parse_args([*COMMANDS["arms run"], "--model", "claude-cli/sonnet", "--judge"]) assert (args.judge_provider, args.judge_model) == ("claude-cli", "opus") @@ -208,13 +227,13 @@ def test_an_explicit_judge_model_wins_in_either_order(order): flags = ["--judge-model", "gpt-6.1-sol", "--judge-provider", "anthropic"] if order == "provider-first": flags = flags[2:] + flags[:2] - args = parse_args([*COMMANDS["benchmark run"], *flags]) + args = parse_args([*COMMANDS["arms run"], *flags]) assert (args.judge_provider, args.judge_model) == ("anthropic", "gpt-6.1-sol") def test_an_explicit_default_name_is_kept_on_another_provider(): # Naming the default judge yourself is a choice, not a left-out flag. - args = parse_args([*COMMANDS["eval score pointwise"], "--judge-provider", "openai", + args = parse_args([*COMMANDS["arms run"], "--judge-provider", "openai", "--judge-model", DEFAULT_JUDGE_MODEL]) assert args.judge_model == DEFAULT_JUDGE_MODEL @@ -251,16 +270,27 @@ def test_the_legacy_cli_shim_exports_the_resolving_parse_args(): spec.loader.exec_module(shim) assert "parse_args" in shim.__all__ assert shim.parse_args is parse_args - args = shim.parse_args([*COMMANDS["eval score pointwise"], "--judge-provider", "openai"]) + args = shim.parse_args([*COMMANDS["arms run"], "--judge-provider", "openai"]) assert args.judge_model == DEFAULT_GENERATOR_MODEL def test_preflight_refuses_the_judge_that_run_refuses(capsys): # preflight shows the plan the run will take: the same flags that `benchmark run` refuses are refused here + for argv in (["benchmark", "run", "--library", "onetbb"], ["benchmark", "preflight", "--library", "onetbb"]): + for flag in ("--judge", "--model"): + with pytest.raises(SystemExit) as exc: + parse_args([*argv, flag, "openai/"]) + assert exc.value.code == 2 + assert f"{flag} openai/ has no model" in capsys.readouterr().err + + +@pytest.mark.parametrize("command", sorted(set(COMMANDS) - KEPT_SPELLING)) +def test_judge_provider_is_moved_on_the_commands_that_no_longer_take_it(command, capsys): + # The switch is gone there: the tombstone points at `--judge PROVIDER/MODEL` and exits 2. with pytest.raises(SystemExit) as exc: - parse_args(["benchmark", "preflight", "--library", "onetbb", "--judge-provider", "openai"]) + parse_args([*COMMANDS[command], "--judge-provider", "openai"]) assert exc.value.code == 2 - assert "the default judge there is the model under measurement" in capsys.readouterr().err + assert "moved:" in capsys.readouterr().err def test_a_matrix_run_takes_no_top_level_model_as_its_answerer(tmp_path): @@ -308,7 +338,7 @@ def test_a_library_refused_default_self_judge_stops_before_the_probe_or_the_libr def test_an_explicit_alias_judge_model_on_a_claude_cli_answerer_judges_on_its_cli(): # the left-out judge model follows the CLI answerer onto claude-cli; an explicit alias must too, or the run # sends `haiku` to the Anthropic API and fails at the first judge call, after the answers are paid for - args = parse_args([*COMMANDS["arms run"], "--provider", "claude-cli", "--model", "sonnet", "--judge", + args = parse_args([*COMMANDS["arms run"], "--model", "claude-cli/sonnet", "--judge", "--judge-model", "haiku"]) assert (args.judge_provider, args.judge_model) == ("claude-cli", "haiku") config = ArmsRunConfig(product="demo", model="sonnet", provider="claude-cli", judge=True, judge_model="haiku") @@ -316,7 +346,7 @@ def test_an_explicit_alias_judge_model_on_a_claude_cli_answerer_judges_on_its_cl def test_a_named_judge_provider_is_kept_for_an_explicit_judge_model_on_a_claude_cli_answerer(): - args = parse_args([*COMMANDS["arms run"], "--provider", "claude-cli", "--model", "sonnet", "--judge", + args = parse_args([*COMMANDS["arms run"], "--model", "claude-cli/sonnet", "--judge", "--judge-model", "haiku", "--judge-provider", "anthropic"]) assert (args.judge_provider, args.judge_model) == ("anthropic", "haiku") @@ -327,11 +357,10 @@ def test_subjects_run_does_not_move_the_judge_to_a_cli_answerer_before_the_descr # parse_args leaves the judge to the descriptor, which picks it once loaded (resolve_judge). # With or without an explicit --judge-model. for extra in ([], ["--judge-model", "haiku"]): - args = parse_args([*COMMANDS["subjects run"], "--judge", "--provider", "claude-cli", "--model", "sonnet", - *extra]) + args = parse_args([*COMMANDS["subjects run"], "--judge", "--model", "claude-cli/sonnet", *extra]) assert args.judge_provider == "anthropic" # Implicit cells: the top-level CLI answerer is the answerer, so the left-out judge follows it onto its CLI. - args = parse_args([*COMMANDS["subjects run"], "--judge", "--provider", "claude-cli", "--model", "sonnet"]) + args = parse_args([*COMMANDS["subjects run"], "--judge", "--model", "claude-cli/sonnet"]) resolve_judge(args, SimpleNamespace(matrix_cells_explicit=False)) assert (args.judge_provider, args.judge_model) == ("claude-cli", "opus") @@ -343,8 +372,7 @@ def test_subjects_run_does_not_move_the_judge_to_a_cli_answerer_before_the_descr def test_subjects_run_resolves_an_explicit_judge_model_once_the_descriptor_is_loaded(explicit_cells, expected): from dokimi.commands.subjects import resolve_judge - args = parse_args([*COMMANDS["subjects run"], "--judge", "--provider", "claude-cli", "--model", "sonnet", - "--judge-model", "haiku"]) + args = parse_args([*COMMANDS["subjects run"], "--judge", "--model", "claude-cli/sonnet", "--judge-model", "haiku"]) resolve_judge(args, SimpleNamespace(matrix_cells_explicit=explicit_cells)) assert (args.judge_provider, args.judge_model) == expected @@ -354,23 +382,40 @@ def test_subjects_run_refuses_a_judge_model_the_cli_judge_it_moves_to_cannot_tak from dokimi.commands.subjects import resolve_judge from dokimi.utils import InputError - args = parse_args([*COMMANDS["subjects run"], "--judge", "--provider", "claude-cli", "--model", "sonnet", - "--judge-model", "gpt-4o"]) - with pytest.raises(InputError, match="judge follows --provider claude-cli: pass --judge-provider"): + args = parse_args([*COMMANDS["subjects run"], "--judge", "--model", "claude-cli/sonnet", "--judge-model", "gpt-4o"]) + with pytest.raises(InputError, match="the judge follows --model claude-cli: pass a judge from another family") as exc: resolve_judge(args, SimpleNamespace(matrix_cells_explicit=False)) + assert "--judge-provider PROVIDER --judge-model MODEL" in str(exc.value) def test_a_judge_model_refusal_does_not_name_a_judge_provider_that_was_not_passed(capsys): - argv = [*COMMANDS["arms run"], "--provider", "claude-cli", "--model", "sonnet", "--judge", + argv = [*COMMANDS["arms run"], "--model", "claude-cli/sonnet", "--judge", "--judge-model", "gpt-6.1-sol"] with pytest.raises(SystemExit): parse_args(argv) err = capsys.readouterr().err - assert "the judge follows --provider claude-cli: pass --judge-provider" in err + assert "the judge follows --model claude-cli: pass a judge from another family" in err assert "--judge-provider claude-cli takes" not in err - with pytest.raises(SystemExit): - parse_args([*argv, "--judge-provider", "claude-cli"]) - assert "--judge-provider claude-cli takes a Claude model" in capsys.readouterr().err + assert "--judge-provider PROVIDER --judge-model MODEL" in err + + +@pytest.mark.parametrize("command", sorted(KEPT_SPELLING)) +def test_a_named_cli_judge_refusal_uses_the_separate_flags(command, capsys): + with pytest.raises(SystemExit) as exc: + parse_args([*COMMANDS[command], "--judge", "--judge-provider", "claude-cli", "--judge-model", "gpt-4o"]) + assert exc.value.code == 2 + assert "pass --judge-model " in capsys.readouterr().err + + +@pytest.mark.parametrize("command", [ + ["skill", "novelty", "analyze", "--artifact", "skill:x"], + ["catalog", "novelty", "x", "--out-dir", "out"], +]) +def test_novelty_cli_judge_refusal_uses_the_separate_flags(command, capsys): + with pytest.raises(SystemExit) as exc: + parse_args([*command, "--judge-provider", "claude-cli", "--judge-model", "gpt-4o"]) + assert exc.value.code == 2 + assert "pass --judge-model " in capsys.readouterr().err def test_subjects_run_refuses_a_default_judge_that_is_the_implicit_cell_answerer(): @@ -386,14 +431,20 @@ def test_subjects_run_refuses_a_default_judge_that_is_the_implicit_cell_answerer assert (args.judge_provider, args.judge_model) == ("anthropic", "claude-sonnet-5-5") -@pytest.mark.parametrize("command", ["arms run", "benchmark run", "benchmark preflight", "benchmark batch", "evaluate"]) +@pytest.mark.parametrize("command", ["arms run"]) def test_a_named_judge_provider_is_kept_for_a_claude_cli_answerer_when_the_judge_model_is_left_out(command): judge = ["--judge"] if command.startswith("arms") else [] - args = parse_args([*COMMANDS[command], "--provider", "claude-cli", "--model", "haiku", *judge, + args = parse_args([*COMMANDS[command], "--model", "claude-cli/haiku", *judge, "--judge-provider", "anthropic"]) assert (args.judge_provider, args.judge_model) == ("anthropic", "claude-sonnet-5-5") +@pytest.mark.parametrize("command", sorted(ANSWERED_COMMANDS - KEPT_SPELLING)) +def test_a_qualified_judge_provider_is_kept_for_a_claude_cli_answerer(command): + args = parse_args([*COMMANDS[command], "--model", "claude-cli/haiku", "--judge", "anthropic/claude-sonnet-5-5"]) + assert (args.judge_provider, args.judge_model) == ("anthropic", "claude-sonnet-5-5") + + def test_a_copilot_or_codex_answerer_keeps_the_api_default_judge(): from dokimi.judge_rule import default_judge @@ -412,3 +463,14 @@ def test_apply_default_judge_on_a_copilot_answerer_keeps_the_judge_provider(): apply_default_judge(args, matrix=False, named=False) assert args.judge_provider == "openai" + + +@pytest.mark.parametrize("named, answerer", [(True, None), (False, "codex-cli")]) +def test_judge_model_refusal_names_only_the_canonical_judge_flag(named, answerer): + # The hint must not point at a retired spelling (--judge-model, --judge-provider): on every command it is stale. + from dokimi.judge_rule import refuse_judge_model + + message = refuse_judge_model("codex-cli", "gpt-x", named=named, answerer_provider=answerer) + assert "--judge PROVIDER/MODEL" in message or "--judge codex-cli/" in message + for retired in ("--judge-model", "--judge-provider", "arms run"): + assert retired not in message, message diff --git a/dokimi/tests/test_judge_reliability.py b/dokimi/tests/test_judge_reliability.py index bc7e167e0..f597a1fb5 100644 --- a/dokimi/tests/test_judge_reliability.py +++ b/dokimi/tests/test_judge_reliability.py @@ -421,7 +421,7 @@ def score_answer(self, *, answer, context="", **_): "context_chunks": [{"snippet": "first"}, {"snippet": "second"}]}, }}]}), encoding="utf-8") args = build_parser().parse_args(["eval", "judge", "agreement", "--answers", str(answers), "--no-stored", - "--judges", "amazon-bedrock/m", "--out", str(tmp_path / "cj.json")]) + "--judge", "amazon-bedrock/m", "--out", str(tmp_path / "cj.json")]) args.func(args) assert seen == {"skill answer": "first\nsecond", "base answer": "(No documentation retrieved)"} @@ -485,7 +485,7 @@ def score_answer(self, **kw): path.write_text(json.dumps(data), encoding="utf-8") argv = ["eval", "judge", "agreement", "--answers", str(path), "--out", str(tmp_path / "cj.json")] if judges: - argv += ["--judges", "amazon-bedrock/m"] + argv += ["--judge", "amazon-bedrock/m"] args = build_parser().parse_args(argv + list(extra)) with refusal() as outcome: args.func(args) @@ -603,7 +603,7 @@ def score_answer(self, **_): monkeypatch.setattr(judge_mod, "Judge", FakeJudge) answers = tmp_path / "run.json" answers.write_text(json.dumps(_stamped_run()), encoding="utf-8") - argv = ["eval", "judge", "agreement", "--answers", str(answers), "--judges", "amazon-bedrock/m", + argv = ["eval", "judge", "agreement", "--answers", str(answers), "--judge", "amazon-bedrock/m", "--out", str(tmp_path / "cj.json")] args = build_parser().parse_args(argv) with refusal() as exc: @@ -645,7 +645,7 @@ def score_answer(self, **kw): data["judge_materials"] = {digest: skill_body} answers = tmp_path / "run.json" answers.write_text(json.dumps(data), encoding="utf-8") - argv = ["eval", "judge", "agreement", "--answers", str(answers), "--judges", "amazon-bedrock/m", + argv = ["eval", "judge", "agreement", "--answers", str(answers), "--judge", "amazon-bedrock/m", "--out", str(tmp_path / "cj.json")] args = build_parser().parse_args(argv) # Should not raise SystemExit; gate should pass because materials are intact. @@ -682,7 +682,7 @@ def score_answer(self, **_): # No judge_materials, but scores claim to be stored (no file before judge_context exists). answers = tmp_path / "run.json" answers.write_text(json.dumps(data), encoding="utf-8") - argv = ["eval", "judge", "agreement", "--answers", str(answers), "--judges", "amazon-bedrock/m", + argv = ["eval", "judge", "agreement", "--answers", str(answers), "--judge", "amazon-bedrock/m", "--out", str(tmp_path / "cj.json")] args = build_parser().parse_args(argv) with refusal() as exc: @@ -722,7 +722,7 @@ def score_answer(self, **kw): data["judge_materials"] = {digest: skill_body} answers = tmp_path / "run.json" answers.write_text(json.dumps(data), encoding="utf-8") - argv = ["eval", "judge", "agreement", "--answers", str(answers), "--judges", "amazon-bedrock/m", + argv = ["eval", "judge", "agreement", "--answers", str(answers), "--judge", "amazon-bedrock/m", "--out", str(tmp_path / "cj.json")] args = build_parser().parse_args(argv) args.func(args) @@ -761,7 +761,7 @@ def score_answer(self, **_): pairwise.write_text(json.dumps({"verdicts": {"baseline": {}, "skill": {}}, "summary": {"judge": "p/m"}}), encoding="utf-8") answers = tmp_path / "run.json" answers.write_text(json.dumps(data), encoding="utf-8") - argv = ["eval", "judge", "agreement", "--answers", str(answers), "--judges", "amazon-bedrock/m", + argv = ["eval", "judge", "agreement", "--answers", str(answers), "--judge", "amazon-bedrock/m", "--pairwise", str(pairwise), "--out", str(tmp_path / "cj.json")] args = build_parser().parse_args(argv) with refusal() as exc: @@ -796,7 +796,7 @@ def score_answer(self, **_): data["judge_materials"] = {digest: "ALTERED TEXT"} answers = tmp_path / "run.json" answers.write_text(json.dumps(data), encoding="utf-8") - argv = ["eval", "judge", "agreement", "--answers", str(answers), "--judges", "amazon-bedrock/m", + argv = ["eval", "judge", "agreement", "--answers", str(answers), "--judge", "amazon-bedrock/m", "--out", str(tmp_path / "cj.json")] args = build_parser().parse_args(argv) with refusal() as exc: @@ -834,7 +834,7 @@ def score_answer(self, **_): del ans["arms"]["skill"]["judge_context_sha256"] answers = tmp_path / "run.json" answers.write_text(json.dumps(data), encoding="utf-8") - argv = ["eval", "judge", "agreement", "--answers", str(answers), "--judges", "amazon-bedrock/m", + argv = ["eval", "judge", "agreement", "--answers", str(answers), "--judge", "amazon-bedrock/m", "--out", str(tmp_path / "cj.json")] args = build_parser().parse_args(argv) with refusal() as exc: @@ -870,7 +870,7 @@ def score_answer(self, **_): data["judge_materials"] = {digest1: skill_body} answers = tmp_path / "run.json" answers.write_text(json.dumps(data), encoding="utf-8") - argv = ["eval", "judge", "agreement", "--answers", str(answers), "--judges", "amazon-bedrock/m", + argv = ["eval", "judge", "agreement", "--answers", str(answers), "--judge", "amazon-bedrock/m", "--out", str(tmp_path / "cj.json")] args = build_parser().parse_args(argv) with refusal() as exc: @@ -1624,7 +1624,7 @@ def score_answer(self, *, answer, context="", **_): def test_cross_judge_judges_hands_the_arms_material_to_the_rescored_judge(tmp_path, monkeypatch): seen = {} _recording_judge(monkeypatch, seen) - args = _cross_judge_args(tmp_path, _material_arms_run(), "--judges", "amazon-bedrock/m") + args = _cross_judge_args(tmp_path, _material_arms_run(), "--judge", "amazon-bedrock/m") args.func(args) assert seen["skill 0"] == "FULL SKILL BODY" @@ -1635,7 +1635,7 @@ def test_cross_judge_judges_refuses_edited_material(tmp_path, monkeypatch, capsy data = _material_arms_run() digest = next(iter(data["judge_materials"])) data["judge_materials"][digest] = "EDITED" - args = _cross_judge_args(tmp_path, data, "--judges", "amazon-bedrock/m") + args = _cross_judge_args(tmp_path, data, "--judge", "amazon-bedrock/m") with refusal() as exc: args.func(args) assert exc.code == 2 and "skill" in exc.err @@ -1645,7 +1645,7 @@ def test_cross_judge_judges_refuses_edited_material(tmp_path, monkeypatch, capsy def test_cross_judge_judges_with_pairwise_refuses_stored_scores(tmp_path, monkeypatch, capsys): seen = {} _recording_judge(monkeypatch, seen) - args = _cross_judge_args(tmp_path, _material_arms_run(), "--judges", "amazon-bedrock/m", + args = _cross_judge_args(tmp_path, _material_arms_run(), "--judge", "amazon-bedrock/m", "--pairwise", str(tmp_path / "pw.json")) with refusal() as exc: args.func(args) diff --git a/dokimi/tests/test_judge_temperature_entry_points.py b/dokimi/tests/test_judge_temperature_entry_points.py index d7865a075..2ff9a8789 100644 --- a/dokimi/tests/test_judge_temperature_entry_points.py +++ b/dokimi/tests/test_judge_temperature_entry_points.py @@ -55,8 +55,7 @@ def _exit_code(argv): def test_eval_score_forwards_and_records_judge_temperature(tmp_path, requests, flag, expected): out = tmp_path / "eval.json" _run(["eval", "score", "pointwise", "--product", "L", "--answers", _answers(tmp_path), "--out", str(out), - "--judge-provider", "amazon-bedrock", "--judge-model", "us.anthropic.x", - "--concurrency", "1", *flag]) + "--judge", "amazon-bedrock/us.anthropic.x", "--concurrency", "1", *flag]) assert len(requests) == 2 assert [r.get("temperature") for r in requests] == [expected, expected] assert ("temperature" in requests[0]) is (expected is not None) @@ -66,8 +65,7 @@ def test_eval_score_forwards_and_records_judge_temperature(tmp_path, requests, f def test_eval_panel_score_forwards_judge_temperature_to_every_judge(tmp_path, requests): out = tmp_path / "panel.json" _run(["eval", "score", "panel", "--product", "L", "--answers", _answers(tmp_path), - "--out", str(out), "--provider", "amazon-bedrock", "--model", "us.anthropic.x", - "--roles", "technical_expert,doc_reviewer", "--concurrency", "1", + "--out", str(out), "--model", "amazon-bedrock/us.anthropic.x", "--roles", "technical_expert,doc_reviewer", "--concurrency", "1", "--judge-temperature", "0"]) assert len(requests) == 4 assert all(r["temperature"] == 0.0 for r in requests) @@ -93,8 +91,7 @@ def run(self, **kw): monkeypatch.setattr(EvaluationPipeline, "run", run) with pytest.raises(SystemExit): _run(["evaluate", "--product", "L", "--description", "d", "--out-dir", str(tmp_path), - "--judge-provider", "amazon-bedrock", "--judge-model", "us.anthropic.x", - "--judge-temperature", "0"]) + "--judge", "amazon-bedrock/us.anthropic.x", "--judge-temperature", "0"]) assert len(requests) == 2 and all(r["temperature"] == 0.0 for r in requests) assert json.loads((tmp_path / "eval" / "L.json").read_text())["judge_temperature"] == 0.0 @@ -141,7 +138,7 @@ def _reliability_argv(command, tmp_path, out): arms = tmp_path / "run.json" arms.write_text(json.dumps(ARMS), encoding="utf-8") - judge = ["--judge-provider", "amazon-bedrock", "--judge-model", "us.anthropic.x"] + judge = ["--judge", "amazon-bedrock/us.anthropic.x"] if command == "pairwise": return ["eval", "score", "pairwise", "--answers", str(arms), *judge, "--concurrency", "1", "--out", str(out)] @@ -164,7 +161,7 @@ def _reliability_argv(command, tmp_path, out): "--variants", "truncate_20", "--mode", "pairwise", *judge, "--concurrency", "1", "--out", str(out)] return ["eval", "judge", "agreement", "--answers", str(arms), "--no-stored", - "--judges", "amazon-bedrock/us.anthropic.x", "--concurrency", "1", "--out", str(out)] + "--judge", "amazon-bedrock/us.anthropic.x", "--concurrency", "1", "--out", str(out)] RELIABILITY_COMMANDS = ["pairwise", "checklist", "judge-wording", "cross-judge", "judge-validity-pairwise"] @@ -191,14 +188,14 @@ def test_judge_reliability_commands_send_no_sampling_without_the_flag(tmp_path, @pytest.mark.parametrize("extra", [ ["--escalate-model", "us.anthropic.only-t1"], - ["--judges", "amazon-bedrock/us.anthropic.x,amazon-bedrock/us.anthropic.only-t1"], + ["--judge", "amazon-bedrock/us.anthropic.x", "--judge", "amazon-bedrock/us.anthropic.only-t1"], ], ids=["pairwise-escalation", "cross-judge"]) def test_a_judge_whose_sampling_probe_fails_exits_1_before_any_judgement(tmp_path, routed, capsys, extra): # The probe is one real call; its failure is a run failure (1), the same code arms run gives. command = "pairwise" if extra[0] == "--escalate-model" else "cross-judge" argv = _reliability_argv(command, tmp_path, tmp_path / "out.json") if command == "cross-judge": - argv = argv[:argv.index("--judges")] + argv[argv.index("--judges") + 2:] + argv = argv[:argv.index("--judge")] + argv[argv.index("--judge") + 2:] with refusal() as exc: _run([*argv, *extra, "--judge-temperature", "0"]) assert exc.code == 1 @@ -259,7 +256,7 @@ def completion(**kw): def test_a_judge_temperature_litellm_refuses_before_any_call_exits_2(tmp_path, client_refused, capsys): # litellm's own parameter table refuses the value without sending a request: an input refusal. argv = _reliability_argv("pairwise", tmp_path, tmp_path / "out.json") - argv = argv[:argv.index("--judge-model") + 1] + ["us.anthropic.temp1-only"] + argv[argv.index("--judge-model") + 2:] + argv = argv[:argv.index("--judge") + 1] + ["amazon-bedrock/us.anthropic.temp1-only"] + argv[argv.index("--judge") + 2:] assert _exit_code([*argv, "--judge-temperature", "0"]) == 2 assert client_refused == [] assert not (tmp_path / "out.json").exists() # refused before judging, not after every judgement failed @@ -268,7 +265,7 @@ def test_a_judge_temperature_litellm_refuses_before_any_call_exits_2(tmp_path, c @pytest.mark.parametrize("flags", [ ["--judge", "--judge-provider", "anthropic", "--judge-model", "temp1-only", "--judge-temperature", "0"], - ["--provider", "anthropic", "--model", "temp1-only", "--temperature", "0"], + ["--model", "anthropic/temp1-only", "--temperature", "0"], ], ids=["judge", "answer"]) def test_arms_run_sampling_litellm_refuses_before_any_call_exits_2(tmp_path, client_refused, capsys, flags): from tests.test_exit_codes_boundaries import _questions @@ -326,16 +323,14 @@ def test_evaluate_refuses_a_judge_temperature_the_route_refuses_before_any_call( ["evaluate", "--product", "onedal", "--description", "x"], ["benchmark", "run", "--library", "onedal"], ]) -def test_an_empty_bedrock_judge_model_is_reported_before_sampling(monkeypatch, argv): +def test_an_empty_bedrock_judge_model_is_reported_before_sampling(monkeypatch, argv, capsys): import litellm - from dokimi.utils import InputError - - monkeypatch.setattr(litellm, "get_supported_openai_params", lambda **_: ["max_tokens"]) - args = build_parser().parse_args([*argv, "--judge-provider", "amazon-bedrock", "--judge-model", "", - "--judge-temperature", "1"]) - with pytest.raises(InputError, match="Bedrock has no model ''"): - args.func(args) + monkeypatch.setattr(litellm, "get_supported_openai_params", lambda **_: pytest.fail("checked sampling")) + with refusal() as exc: + _run([*argv, "--judge", "amazon-bedrock/", "--judge-temperature", "1"]) + assert exc.code == 2 + assert "--judge amazon-bedrock/ has no model" in capsys.readouterr().err def test_a_judge_constructed_with_a_refused_temperature_fails_before_any_call(haiku_requests): diff --git a/dokimi/tests/test_judge_validity.py b/dokimi/tests/test_judge_validity.py index bedf904c6..6734bfb2f 100644 --- a/dokimi/tests/test_judge_validity.py +++ b/dokimi/tests/test_judge_validity.py @@ -524,16 +524,16 @@ def test_no_usable_answers_raises(self): def test_judge_validity_accepts_every_judge_provider(provider): from dokimi.cli import build_parser - args = build_parser().parse_args(["eval", "judge", "validate", "--answers", "a.json", "--judge-provider", provider]) + args = build_parser().parse_args(["eval", "judge", "validate", "--answers", "a.json", "--judge", provider + "/judge-m"]) assert args.judge_provider == provider -@pytest.mark.parametrize("provider", ["azure", "bedrock"]) +@pytest.mark.parametrize("provider", ["openai-codex"]) def test_judge_validity_rejects_providers_judge_rejects(provider): from dokimi.cli import build_parser with pytest.raises(SystemExit): - build_parser().parse_args(["eval", "judge", "validate", "--answers", "a.json", "--judge-provider", provider]) + build_parser().parse_args(["eval", "judge", "validate", "--answers", "a.json", "--judge", provider + "/judge-m"]) def test_noop_degradation_is_dropped_and_counted(): @@ -1678,8 +1678,7 @@ def score_answer(self, library_name, question, answer, context="(none passed)", answers.write_text(json.dumps(data if data is not None else _with_materials())) out = tmp_path / "v.json" args = build_parser().parse_args(["eval", "judge", "validate", "--answers", str(answers), - "--judge-provider", "amazon-bedrock", "--judge-model", "m", - "--variants", "truncate_20", "--out", str(out), *argv]) + "--judge", "amazon-bedrock/m", "--variants", "truncate_20", "--out", str(out), *argv]) code = None try: args.func(args) @@ -1707,7 +1706,7 @@ def test_cli_judge_validity_exits_2_when_no_answer_is_long_enough(tmp_path, monk answers.write_text(json.dumps({"answers": [{"question_id": "Q1", "question_text": "q", "arms": {"baseline": {"answer": "short"}}}]})) args = build_parser().parse_args(["eval", "judge", "validate", "--answers", str(answers), - "--judge-provider", "amazon-bedrock"]) + "--judge", "amazon-bedrock/claude-sonnet-5-5"]) with refusal() as exc: args.func(args) assert exc.code == 2 and "Error:" in exc.err @@ -1769,7 +1768,7 @@ def gates(report_path): run_path.write_text(json.dumps(run)) out = tmp_path / "cj.json" args = build_parser().parse_args(["eval", "judge", "agreement", "--answers", str(run_path), "--no-stored", - "--judges", "amazon-bedrock/m", "--validity", str(report_path), + "--judge", "amazon-bedrock/m", "--validity", str(report_path), "--out", str(out)]) args.func(args) rows = json.loads(out.read_text())["summary"]["arms"]["skill"]["rows"] diff --git a/dokimi/tests/test_key_files.py b/dokimi/tests/test_key_files.py index e24b5fd6b..8d3d297ba 100644 --- a/dokimi/tests/test_key_files.py +++ b/dokimi/tests/test_key_files.py @@ -29,8 +29,8 @@ def _preflight(tmp_path, monkeypatch, capsys): monkeypatch.setattr( "sys.argv", - ["dokimi", "benchmark", "preflight", "--library", "onetbb", "--provider", "anthropic", - "--judge-provider", "anthropic", "--out-dir", str(tmp_path / "out")], + ["dokimi", "benchmark", "preflight", "--library", "onetbb", "--model", "anthropic/gpt-6.1-sol", + "--judge", "anthropic/claude-sonnet-5-5", "--out-dir", str(tmp_path / "out")], ) with pytest.raises(SystemExit) as exc: cli.main() @@ -291,8 +291,7 @@ def test_a_key_file_that_is_not_utf8_is_named_in_the_refusal(tmp_path, monkeypat def _preflight_on(tmp_path, monkeypatch, capsys, provider, model): monkeypatch.setattr( "sys.argv", - ["dokimi", "benchmark", "preflight", "--library", "onetbb", "--provider", provider, "--model", model, - "--judge-provider", "openai", "--judge-model", "gpt-4o", "--out-dir", str(tmp_path / "out")], + ["dokimi", "benchmark", "preflight", "--library", "onetbb", "--model", f"{provider}/{model}", "--judge", "openai/gpt-4o", "--out-dir", str(tmp_path / "out")], ) with pytest.raises(SystemExit) as exc: cli.main() @@ -323,8 +322,7 @@ def test_run_and_batch_refuse_an_unreadable_key_file_on_a_vertex_route(command, monkeypatch.setenv("GEMINI_API_KEY", f"file:{tmp_path / 'no-such-key'}") monkeypatch.setenv("OPENAI_API_KEY", "sk-judge") args = cli.build_parser().parse_args( - ["benchmark", command, "--libraries" if command == "batch" else "--library", "onetbb", "--provider", "google-vertex", "--model", "gemini-2.5-pro", - "--judge-provider", "openai", "--judge-model", "gpt-4o", "--out-dir", str(tmp_path / "out")]) + ["benchmark", command, "--libraries" if command == "batch" else "--library", "onetbb", "--model", "google-vertex/gemini-2.5-pro", "--judge", "openai/gpt-4o", "--out-dir", str(tmp_path / "out")]) with pytest.raises(InputError, match="no-such-key"): _refuse_missing_credentials(args) diff --git a/dokimi/tests/test_knowledge_cli_answerers.py b/dokimi/tests/test_knowledge_cli_answerers.py index c5c4781d3..259f1836b 100644 --- a/dokimi/tests/test_knowledge_cli_answerers.py +++ b/dokimi/tests/test_knowledge_cli_answerers.py @@ -449,8 +449,7 @@ def test_an_answers_file_of_a_knowledge_run_stamps_its_run_intent(tmp_path): questions.write_text(json.dumps({"questions": [{"id": "q1", "question": "What?"}]}), encoding="utf-8") out = tmp_path / "answers.json" args = build_parser().parse_args(["answers", "generate", "--product", "oneTBB", "--questions", - str(questions), "--doc-source", "none", "--provider", "amazon-bedrock", - "--model", "claude-haiku-5-5", "--out", str(out)]) + str(questions), "--doc-source", "none", "--model", "amazon-bedrock/claude-haiku-5-5", "--out", str(out)]) with mock.patch("dokimi.eval.answerer.Answerer.generate_answers", return_value=[]): args.func(args) assert json.loads(out.read_text(encoding="utf-8"))["run_intent"] == "knowledge" diff --git a/dokimi/tests/test_knowledge_run.py b/dokimi/tests/test_knowledge_run.py index 4bcd10be4..6fecaf015 100644 --- a/dokimi/tests/test_knowledge_run.py +++ b/dokimi/tests/test_knowledge_run.py @@ -178,13 +178,12 @@ def test_the_default_harness_is_accepted(): def test_the_harness_refusal_reaches_the_cli_with_exit_2(tmp_path, fake_llm): args = build_parser().parse_args(["arms", "run", "--product", "oneTBB", "--questions", str(_write_questions(tmp_path)), "--arm", "baseline", - "--provider", "amazon-bedrock", "--model", "claude-haiku-5-5", - "--harness", "codex"]) + "--model", "amazon-bedrock/claude-haiku-5-5", "--harness", "codex"]) with refusal() as outcome: args.func(args) assert outcome.code == 2 assert "task harness" in outcome.err - assert "--provider claude-cli --model sonnet" in outcome.err + assert "--model claude-cli/sonnet" in outcome.err assert fake_llm.requests == [] @@ -213,8 +212,7 @@ def test_codex_cli_answers_an_arms_run_with_a_docs_arm(cli_runner): def test_codex_cli_refuses_an_answers_knowledge_run_with_exit_2(tmp_path, cli_runner): args = build_parser().parse_args(["answers", "generate", "--product", "oneTBB", "--questions", str(_write_questions(tmp_path)), "--doc-source", "none", - "--provider", "codex-cli", "--model", "gpt-5.5", - "--out", str(tmp_path / "answers.json")]) + "--model", "codex-cli/gpt-5.5", "--out", str(tmp_path / "answers.json")]) with refusal() as outcome: args.func(args) assert outcome.code == 2 diff --git a/dokimi/tests/test_llm_callers.py b/dokimi/tests/test_llm_callers.py index b0ef5e1a6..75e2fa3d9 100644 --- a/dokimi/tests/test_llm_callers.py +++ b/dokimi/tests/test_llm_callers.py @@ -159,7 +159,7 @@ def test_arms_run_refuses_it_before_any_answer(sonnet_box): ]) def test_the_pipeline_commands_refuse_it_before_any_answer(argv, sonnet_box, tmp_path, monkeypatch): monkeypatch.chdir(tmp_path) - args = parse_args([*argv, "--judge-provider", "amazon-bedrock", "--judge-model", BARE]) + args = parse_args([*argv, "--judge", f"amazon-bedrock/{BARE}"]) with pytest.raises(InputError, match=f"Bedrock has no model '{BARE}'"): args.func(args) assert list(tmp_path.iterdir()) == [] diff --git a/dokimi/tests/test_llm_cli.py b/dokimi/tests/test_llm_cli.py index 09d9316d2..f32a85274 100644 --- a/dokimi/tests/test_llm_cli.py +++ b/dokimi/tests/test_llm_cli.py @@ -310,7 +310,7 @@ def test_the_backend_doc_names_tools_as_the_command_that_refuses_a_cli_provider( text = (Path(__file__).resolve().parents[1] / "docs" / "subscription-backends.md").read_text(encoding="utf-8") assert "claude-cli" not in tools.PROVIDERS - assert "`--provider` or `--judge-provider`, except `tools`" in text + assert "`--model`, `--judge`) or `--judge-provider`, except `tools`" in text def test_the_reviewing_guide_lists_every_answer_provider(): @@ -440,8 +440,8 @@ def test_the_preflight_probes_a_cli_provider_once_for_its_error_and_its_warning( @pytest.mark.parametrize("argv", [ - ["eval", "score", "pointwise", "--judge-provider", "claude-cli", "--judge-temperature", "0"], - ["eval", "score", "panel", "--provider", "claude-cli", "--judge-temperature", "0"], + ["eval", "score", "pointwise", "--judge", "claude-cli/opus", "--judge-temperature", "0"], + ["eval", "score", "panel", "--model", "claude-cli/sonnet", "--judge-temperature", "0"], ]) def test_a_cli_judge_given_a_temperature_is_an_error_line_and_exit_2(argv, tmp_path, monkeypatch, capsys): from dokimi import cli @@ -485,7 +485,7 @@ def test_the_default_judge_runs_on_the_cli(): def test_a_cli_provider_needs_a_claude_model_on_the_command_line(): from dokimi.cli import parse_args - base = ["answers", "generate", "--product", "p", "--questions", "q.json", "--provider", "claude-cli"] + base = ["answers", "generate", "--product", "p", "--questions", "q.json", "--model", "claude-cli/gpt-6.1-sol"] with pytest.raises(SystemExit): parse_args(base) # the default answer model is not a Claude model assert parse_args([*base, "--model", "haiku"]).model == "haiku" @@ -499,12 +499,13 @@ def test_a_cli_provider_needs_a_claude_model_on_the_command_line(): def test_a_cli_judge_given_a_non_claude_model_is_refused_at_parse_time(command): from dokimi.cli import parse_args - base = [*command, "--judge-provider", "claude-cli"] with refusal() as out: - parse_args([*base, "--judge-model", "gpt-6.1-sol"]) # refused before persona or answer work + parse_args([*command, "--judge", "claude-cli/gpt-6.1-sol"]) assert out.code == 2 - assert parse_args([*base, "--judge-model", "claude-sonnet-5-5"]).judge_model == "claude-sonnet-5-5" - assert parse_args(base).judge_model # left out, the default judge is a Claude model and parses + explicit = parse_args([*command, "--judge", "claude-cli/claude-sonnet-5-5"]) + assert (explicit.judge_model, explicit.judge_provider) == ("claude-sonnet-5-5", "claude-cli") + implicit = parse_args([*command, "--model", "claude-cli/haiku"]) + assert (implicit.judge_model, implicit.judge_provider) == ("opus", "claude-cli") def test_answerer_and_generators_accept_the_cli_provider(runner): @@ -661,20 +662,19 @@ def test_every_command_with_a_hidden_or_default_model_refuses_the_cli_without_a_ from dokimi.cli import parse_args cases = [ - ["answers", "generate", "--product", "p", "--questions", "q.json", "--provider", "claude-cli"], - ["eval", "questions", "generate", "--product", "p", "--personas", "p.json", "--provider", "claude-cli"], - ["eval", "questions", "analyze", "--questions", "q.json", "--product", "p", "--provider", "claude-cli"], - ["eval", "questions", "review", "--questions", "q.json", "--product", "p", "--provider", "claude-cli"], - ["eval", "personas", "discover", "--product", "p", "--provider", "claude-cli"], - ["subjects", "run", "subject.toml", "--provider", "claude-cli"], + ["answers", "generate", "--product", "p", "--questions", "q.json", "--model", "claude-cli/gpt-6.1-sol"], + ["eval", "questions", "generate", "--product", "p", "--personas", "p.json", "--model", "claude-cli/gpt-6.1-sol"], + ["eval", "questions", "analyze", "--questions", "q.json", "--product", "p", "--model", "claude-cli/gpt-6.1-sol"], + ["eval", "questions", "review", "--questions", "q.json", "--product", "p", "--model", "claude-cli/gpt-6.1-sol"], + ["eval", "personas", "discover", "--product", "p", "--model", "claude-cli/gpt-6.1-sol"], + ["subjects", "run", "subject.toml", "--model", "claude-cli/gpt-6.1-sol"], ] for argv in cases: with pytest.raises(SystemExit): parse_args(argv) # the refusal is the model gate, not an unrelated argparse error assert "takes a Claude model" in capsys.readouterr().err, argv - assert parse_args(["subjects", "run", "subject.toml", "--provider", "claude-cli", - "--model", "haiku"]).model == "haiku" + assert parse_args(["subjects", "run", "subject.toml", "--model", "claude-cli/haiku"]).model == "haiku" def test_every_agentic_arm_kind_is_refused_on_the_cli_including_wrapped_and_combined(demo_skill): @@ -823,7 +823,7 @@ def test_matrix_cells_that_name_a_cli_model_pass_the_parse_gate_whatever_the_top questions = tmp_path / "q.json" questions.write_text(json.dumps([{"id": "q1", "question": "Q?"}]), encoding="utf-8") args = cli.parse_args(["arms", "matrix-run", "--product", "p", "--questions", str(questions), - "--arm", "baseline", "--matrix-cells", str(cells), "--provider", "claude-cli", + "--arm", "baseline", "--matrix-cells", str(cells), "--model", "claude-cli/gpt-6.1-sol", "--out-dir", str(tmp_path / "out")]) assert args.provider == "claude-cli" @@ -833,7 +833,7 @@ def test_evaluate_with_a_cli_judge_given_a_temperature_exits_2_like_the_other_ju from dokimi import cli monkeypatch.setattr("sys.argv", ["dokimi", "evaluate", "--product", "demo", "--description", "demo", - "--judge-provider", "claude-cli", "--judge-temperature", "0"]) + "--judge", "claude-cli/opus", "--judge-temperature", "0"]) with refusal() as out: cli.main() err = capsys.readouterr().err @@ -848,7 +848,7 @@ def test_benchmark_run_with_a_cli_judge_given_a_temperature_refuses_before_any_a built = [] monkeypatch.setattr(orchestrator, "EvaluationPipeline", lambda **kwargs: built.append(kwargs)) monkeypatch.setattr("sys.argv", ["dokimi", "benchmark", "run", "--library", "onetbb", - "--judge-provider", "claude-cli", "--judge-temperature", "0"]) + "--judge", "claude-cli/opus", "--judge-temperature", "0"]) with refusal() as out: cli.main() err = capsys.readouterr().err @@ -874,7 +874,7 @@ def test_the_session_turns_flag_defaults_to_none(): from dokimi.cli import parse_args args = parse_args(["arms", "run", "--product", "p", "--questions", "q.json", "--arm", "baseline", - "--provider", "claude-cli", "--model", "sonnet"]) + "--model", "claude-cli/sonnet"]) assert args.session_turns is None @@ -984,9 +984,7 @@ def get(self, key): monkeypatch.setattr(process, "run", _auth_runner(status)) args = build_parser().parse_args([ "benchmark", "preflight", "--library", "onetbb", "--doc-source", "local:docs", - "--provider", answer, "--model", "sonnet" if answer == "claude-cli" else "gpt-4o", - "--judge-provider", "claude-cli", "--judge-model", "opus", - "--out-dir", str(tmp_path / "out"), + "--model", f"{answer}/" + ("sonnet" if answer == "claude-cli" else "gpt-4o"), "--judge", "claude-cli/opus", "--out-dir", str(tmp_path / "out"), ]) if exits: with refusal() as out: diff --git a/dokimi/tests/test_llm_cli_replies.py b/dokimi/tests/test_llm_cli_replies.py index 001936c20..e26d93ab6 100644 --- a/dokimi/tests/test_llm_cli_replies.py +++ b/dokimi/tests/test_llm_cli_replies.py @@ -61,8 +61,10 @@ def test_a_usage_limit_error_is_run_wide_and_not_retried_though_it_names_a_rate_ def test_a_cli_answerer_left_without_model_is_refused_at_parse(provider, capsys): from dokimi import cli + argv = ["answers", "generate", "--product", "p", "--questions", "q.json", "--model"] with pytest.raises(SystemExit) as exc: - cli.parse_args(["answers", "generate", "--product", "p", "--questions", "q.json", "--provider", provider]) - assert exc.value.code == 2 and "needs --model" in capsys.readouterr().err - assert cli.parse_args(["answers", "generate", "--product", "p", "--questions", "q.json", "--provider", provider, - "--model", "gpt-5"]).model == "gpt-5" + cli.parse_args([*argv, f"{provider}/"]) + assert exc.value.code == 2 + assert f"--model {provider}/ has no model" in capsys.readouterr().err + args = cli.parse_args([*argv, f"{provider}/gpt-5"]) + assert (args.provider, args.model) == (provider, "gpt-5") diff --git a/dokimi/tests/test_novelty_answer_key_wiring.py b/dokimi/tests/test_novelty_answer_key_wiring.py index a3f536ddc..175c2ecc8 100644 --- a/dokimi/tests/test_novelty_answer_key_wiring.py +++ b/dokimi/tests/test_novelty_answer_key_wiring.py @@ -74,3 +74,30 @@ def entry_spy(record, *args, **kwargs): "--lexical-only") shorten.func(shorten) assert seen == [AnswerKeyRecord] + + +@pytest.mark.parametrize("role,command", [("extractor", ["novelty", "atoms"]), ("oracle", ["shorten"])]) +@pytest.mark.parametrize(("ref", "model", "provider"), [ + ("openai/gpt-4o", "gpt-4o", "openai"), + ("gpt-4o", "gpt-4o", "anthropic"), +]) +def test_atoms_and_shorten_route_the_extractor_override(tmp_path, monkeypatch, role, command, ref, model, provider): + class ClientCreated(Exception): + pass + + def expect_client(model_arg, provider_arg, role_arg, _args): + assert (model_arg, provider_arg, role_arg) == (model, provider, role) + raise ClientCreated + + monkeypatch.setattr("dokimi.novelty.cost.client", expect_client) + root = _bundle_skill(tmp_path) + artifact = f"skill:{root}" + argv = ["skill", *command, "--artifact", artifact, "--extract-model", ref] + if role == "oracle": + bundle = load_bundle(artifact) + atoms = tmp_path / "atoms.json" + save_atoms([], segment(bundle.text), atoms, extractor="e", cap=None, bundle=bundle.summary()) + argv += ["--atoms", str(atoms)] + args = _parse(*argv) + with pytest.raises(ClientCreated): + args.func(args) diff --git a/dokimi/tests/test_novelty_cli.py b/dokimi/tests/test_novelty_cli.py index 155a69fcb..766b6fed9 100644 --- a/dokimi/tests/test_novelty_cli.py +++ b/dokimi/tests/test_novelty_cli.py @@ -59,8 +59,7 @@ def test_the_judge_defaults_to_a_different_model_than_the_answerer(): @pytest.mark.parametrize("model", [DEFAULT_JUDGE_MODEL, f"us.anthropic.{DEFAULT_JUDGE_MODEL}"]) def test_measuring_the_default_judge_moves_the_judge_to_the_other_family(model): - args = _parse("skill", "novelty", "analyze", "--artifact", "skill:x", "--model", model, - "--provider", "amazon-bedrock") + args = _parse("skill", "novelty", "analyze", "--artifact", "skill:x", "--model", f"amazon-bedrock/{model}") _extractor, answerer, judge = novelty_cost.clients(args) assert answerer.model == model assert (judge.model, judge.provider) == (DEFAULT_GENERATOR_MODEL, DEFAULT_GENERATOR_PROVIDER) @@ -74,8 +73,7 @@ def test_a_judge_provider_alone_picks_the_default_judge_that_runs_there(): def test_a_judge_provider_alone_takes_the_generator_when_the_judge_is_measured(): - args = _parse("skill", "novelty", "analyze", "--artifact", "skill:x", "--model", DEFAULT_JUDGE_MODEL, - "--provider", "anthropic", "--judge-provider", DEFAULT_GENERATOR_PROVIDER) + args = _parse("skill", "novelty", "analyze", "--artifact", "skill:x", "--model", f"anthropic/{DEFAULT_JUDGE_MODEL}", "--judge-provider", DEFAULT_GENERATOR_PROVIDER) _extractor, _answerer, judge = novelty_cost.clients(args) assert (judge.model, judge.provider) == (DEFAULT_GENERATOR_MODEL, DEFAULT_GENERATOR_PROVIDER) @@ -83,12 +81,12 @@ def test_a_judge_provider_alone_takes_the_generator_when_the_judge_is_measured() @pytest.mark.parametrize("argv", [ # Measuring the default judge leaves only the generator, which Bedrock and anthropic # do not serve: the swap must not build bedrock/gpt-6.1-sol or anthropic/gpt-6.1-sol. - ("--model", f"us.anthropic.{DEFAULT_JUDGE_MODEL}", "--provider", "amazon-bedrock", + ("--model", f"amazon-bedrock/us.anthropic.{DEFAULT_JUDGE_MODEL}", "--judge-provider", "amazon-bedrock"), - ("--model", DEFAULT_JUDGE_MODEL, "--provider", "anthropic", "--judge-provider", "anthropic"), + ("--model", f"anthropic/{DEFAULT_JUDGE_MODEL}", "--judge-provider", "anthropic"), # A CLI alias is its family's full id: refused here, not after the paid extraction. - ("--model", "sonnet", "--provider", "claude-cli", "--judge-provider", "anthropic"), - ("--model", "sonnet", "--provider", "claude-cli", "--judge-provider", "amazon-bedrock"), + ("--model", "claude-cli/sonnet", "--judge-provider", "anthropic"), + ("--model", "claude-cli/sonnet", "--judge-provider", "amazon-bedrock"), # The default answerer is the generator, so openai has no default judge left either. ("--judge-provider", "openai"), ]) @@ -102,15 +100,14 @@ def test_a_judge_provider_with_no_default_judge_there_exits(argv): def test_a_cli_answerer_with_no_judge_flags_is_judged_on_the_cli_by_another_family(model): from dokimi.utils import same_model - args = _parse("skill", "novelty", "analyze", "--artifact", "skill:x", "--model", model, - "--provider", "claude-cli") + args = _parse("skill", "novelty", "analyze", "--artifact", "skill:x", "--model", f"claude-cli/{model}") _extractor, _answerer, judge = novelty_cost.clients(args) assert judge.provider == "claude-cli" assert not same_model(judge.model, model) def test_a_named_judge_without_a_provider_runs_on_the_answer_provider(): - args = _parse("skill", "novelty", "analyze", "--artifact", "skill:x", "--provider", "openrouter", + args = _parse("skill", "novelty", "analyze", "--artifact", "skill:x", "--model", "openrouter/answerer", "--judge-model", "j") _extractor, _answerer, judge = novelty_cost.clients(args) assert (judge.model, judge.provider) == ("j", "openrouter") @@ -353,7 +350,7 @@ def transport(prompt, system=None): assert "own answer key" not in capsys.readouterr().err # Measuring the model that extracted the atoms means it wrote its own answer key. - args = _parse(*probe, "--model", DEFAULT_JUDGE_MODEL, "--provider", DEFAULT_JUDGE_PROVIDER) + args = _parse(*probe, "--model", f"{DEFAULT_JUDGE_PROVIDER}/{DEFAULT_JUDGE_MODEL}") args.func(args) assert "own answer key" in capsys.readouterr().err diff --git a/dokimi/tests/test_novelty_estimate_roles.py b/dokimi/tests/test_novelty_estimate_roles.py index d3716a3a0..5720ac1f1 100644 --- a/dokimi/tests/test_novelty_estimate_roles.py +++ b/dokimi/tests/test_novelty_estimate_roles.py @@ -88,8 +88,7 @@ def test_panel_judges_after_the_first_count_under_judge(tmp_path, capsys): def test_an_unpriced_model_gives_null_role_dollars_and_no_least_sure_role(tmp_path, capsys): - _, payload, err = _estimate(tmp_path, capsys, "--tier", "standard", "--model", "foo-bar-9", - "--provider", "openai") + _, payload, err = _estimate(tmp_path, capsys, "--tier", "standard", "--model", "openai/foo-bar-9") assert payload["expected_usd"] is None assert payload["usd_by_role"] is None assert payload["least_sure_role"] is None @@ -97,8 +96,7 @@ def test_an_unpriced_model_gives_null_role_dollars_and_no_least_sure_role(tmp_pa def test_role_usd_is_none_for_an_unpriced_role(tmp_path, capsys): - args, payload, _ = _estimate(tmp_path, capsys, "--tier", "standard", "--model", "foo-bar-9", - "--provider", "openai") + args, payload, _ = _estimate(tmp_path, capsys, "--tier", "standard", "--model", "openai/foo-bar-9") assert role_usd(args, payload["tokens"], payload["estimate"]["by_role"], "standard") is None diff --git a/dokimi/tests/test_novelty_routing_cli_gaps.py b/dokimi/tests/test_novelty_routing_cli_gaps.py index 0df39e6aa..a1126d584 100644 --- a/dokimi/tests/test_novelty_routing_cli_gaps.py +++ b/dokimi/tests/test_novelty_routing_cli_gaps.py @@ -162,7 +162,7 @@ def test_estimate_only_gives_a_null_dollar_figure_for_a_routing_model_with_no_pr args = _parse("skill", "routing", _skill(tmp_path, "perf", "profile a binary with perf record"), "--competitors", _skill(tmp_path, "tbb", "parallelize loops"), "--queries", - str(queries), "--model", "foo-bar-9", "--provider", "openai", "--dry-run") + str(queries), "--model", "openai/foo-bar-9", "--dry-run") args.func(args) captured = capsys.readouterr() estimate = json.loads(captured.out) diff --git a/dokimi/tests/test_novelty_spend_cap.py b/dokimi/tests/test_novelty_spend_cap.py index 73ba4e435..94837b94d 100644 --- a/dokimi/tests/test_novelty_spend_cap.py +++ b/dokimi/tests/test_novelty_spend_cap.py @@ -80,9 +80,8 @@ def test_without_the_flag_there_is_no_cap(): def test_the_extractor_runs_on_the_named_provider_and_every_role_gets_max_tokens(): args = _parse("skill", "novelty", "analyze", "--artifact", "skill:x", - "--model", "claude-haiku-4-5", "--provider", "anthropic", - "--judge-model", "claude-sonnet-5-5", "--extract-model", "gpt-4o", - "--extract-provider", "openai", "--max-output-tokens", "777") + "--model", "anthropic/claude-haiku-4-5", + "--judge-model", "claude-sonnet-5-5", "--extract-model", "openai/gpt-4o", "--max-output-tokens", "777") extractor, answerer, judge = novelty_cost.clients(args) assert (extractor.model, extractor.provider) == ("gpt-4o", "openai") assert (judge.model, judge.provider) == ("claude-sonnet-5-5", "anthropic") diff --git a/dokimi/tests/test_novelty_tiers.py b/dokimi/tests/test_novelty_tiers.py index 830e27711..3cbb7a1c5 100644 --- a/dokimi/tests/test_novelty_tiers.py +++ b/dokimi/tests/test_novelty_tiers.py @@ -571,7 +571,7 @@ def test_the_cli_prices_a_triage_estimate_with_the_triage_extractor_profile(tmp_ def test_the_extractor_defaults_to_the_judge_provider_not_the_answerer(tmp_path): from dokimi.novelty.cost import role_models - args = _parse("skill", "novelty", "analyze", "--artifact", f"skill:{tmp_path}", "--provider", "anthropic", + args = _parse("skill", "novelty", "analyze", "--artifact", f"skill:{tmp_path}", "--model", "anthropic/claude-haiku-4-5", "--judge-model", "judge-m", "--judge-provider", "openai", "--dry-run") models = role_models(args) assert models["judge"] == ("judge-m", "openai") @@ -599,7 +599,7 @@ def test_estimate_only_stdout_stays_json_for_a_model_litellm_cannot_route(tmp_pa (root / "SKILL.md").write_text("---\nname: s\ndescription: d\n---\n\n# S\n\nText.\n", encoding="utf-8") args = _parse("skill", "novelty", "analyze", "--artifact", f"skill:{root}", "--tier", "standard", - "--dry-run", "--model", "foo-bar-9", "--provider", "openai") + "--dry-run", "--model", "openai/foo-bar-9") args.func(args) payload = json.loads(capsys.readouterr().out) assert payload["expected_usd"] is None diff --git a/dokimi/tests/test_openai_compatible_route.py b/dokimi/tests/test_openai_compatible_route.py index 5069b7ec2..049bb167b 100644 --- a/dokimi/tests/test_openai_compatible_route.py +++ b/dokimi/tests/test_openai_compatible_route.py @@ -52,6 +52,23 @@ def test_a_name_litellm_takes_for_openais_goes_out_bare_and_still_routes(litellm assert litellm_routes == [model] +@pytest.mark.parametrize(("ref", "route"), [ + ("openai/deepseek/deepseek-chat", "openai/deepseek/deepseek-chat"), + ("deepseek/deepseek-chat", "deepseek/deepseek-chat"), + ("openai/anthropic/claude-sonnet-4-5", "anthropic/claude-sonnet-4-5"), + ("openai/meta-llama/Llama-3.1-8B", "openai/meta-llama/Llama-3.1-8B"), + ("openai/gpt-4o", "gpt-4o"), +]) +def test_explicit_openai_model_keeps_nested_routes_on_the_endpoint(litellm_routes, ref, route): + from dokimi.cli import parse_args + + args = parse_args(["answers", "generate", "--product", "p", "--questions", "q.json", "--model", ref]) + # The recorded provider is the configured adapter, including when a nested model routes natively. + assert args.provider == "openai" + assert LLM(args.model, args.provider).ask("Reply with OK.") == JUDGE_REPLY + assert litellm_routes == [route] + + def test_a_reply_cached_under_one_litellm_price_map_replays_under_the_other(litellm_routes, monkeypatch, tmp_path): """A new model is on litellm's remote price map but not on its installed backup (``LITELLM_LOCAL_MODEL_COST_MAP``): the route is bare under one and ``openai/`` under the @@ -82,7 +99,21 @@ def test_cross_judge_scores_with_an_openai_compatible_judge(litellm_routes, tmp_ encoding="utf-8") out = tmp_path / "cj.json" args = build_parser().parse_args(["eval", "judge", "agreement", "--answers", str(answers), "--no-stored", - "--judges", "openai/glm-5.3", "--out", str(out)]) + "--judge", "openai/glm-5.3", "--out", str(out)]) args.func(args) assert litellm_routes == ["openai/glm-5.3"] * 6 # three questions, two arms assert json.loads(out.read_text(encoding="utf-8"))["summary"]["arms"]["skill"]["label"] != "NOT MEASURED" + + +def test_explicit_openai_namespace_keeps_legacy_artifact_model_and_cache_key(litellm_routes, monkeypatch, tmp_path): + from dokimi import caching + from dokimi.cli import parse_args + + monkeypatch.setenv(caching.RESPONSE_CACHE_ENV, str(tmp_path)) + model = "meta-llama/Llama-3.1-8B" + args = parse_args(["answers", "generate", "--product", "p", "--questions", "q.json", + "--model", f"openai/{model}"]) + assert (args.model, args.provider) == (model, "openai") + assert LLM(model, "openai").ask("Reply with OK.") == JUDGE_REPLY + assert LLM(args.model, args.provider).ask("Reply with OK.") == JUDGE_REPLY + assert litellm_routes == [f"openai/{model}"] diff --git a/dokimi/tests/test_panel_quorum_identity.py b/dokimi/tests/test_panel_quorum_identity.py index 63c86631a..2d618c214 100644 --- a/dokimi/tests/test_panel_quorum_identity.py +++ b/dokimi/tests/test_panel_quorum_identity.py @@ -299,8 +299,7 @@ def completion(**kwargs): out = tmp_path / "panel.json" args = build_parser().parse_args([ "eval", "score", "panel", "--product", "L", "--answers", str(answers), - "--out", str(out), "--provider", "amazon-bedrock", "--model", "us.anthropic.x", - "--roles", "technical_expert", "--concurrency", "1"]) + "--out", str(out), "--model", "amazon-bedrock/us.anthropic.x", "--roles", "technical_expert", "--concurrency", "1"]) args.func(args) assert "Mean agreement score: n/a" in capsys.readouterr().out assert json.loads(out.read_text())["evaluations"][0]["with_docs"]["std"] is None @@ -332,8 +331,7 @@ def completion(**kwargs): out = tmp_path / "panel.json" args = build_parser().parse_args([ "eval", "score", "panel", "--product", "L", "--answers", str(answers), - "--out", str(out), "--provider", "amazon-bedrock", "--model", "us.anthropic.x", - "--roles", "technical_expert,developer_advocate,doc_reviewer", "--concurrency", "1"]) + "--out", str(out), "--model", "amazon-bedrock/us.anthropic.x", "--roles", "technical_expert,developer_advocate,doc_reviewer", "--concurrency", "1"]) args.func(args) printed = capsys.readouterr().out assert "Questions left out (no quorum or no answer): 1/2" in printed @@ -346,8 +344,7 @@ def completion(**kwargs): for q in ("Q1", "Q2")]), encoding="utf-8") args = build_parser().parse_args([ "eval", "score", "panel", "--product", "L", "--answers", str(all_bad), - "--out", str(tmp_path / "panel_all_bad.json"), "--provider", "amazon-bedrock", - "--model", "us.anthropic.x", "--roles", "technical_expert,developer_advocate,doc_reviewer", + "--out", str(tmp_path / "panel_all_bad.json"), "--model", "amazon-bedrock/us.anthropic.x", "--roles", "technical_expert,developer_advocate,doc_reviewer", "--concurrency", "1"]) args.func(args) assert "Questions left out (no quorum or no answer): 2/2" in capsys.readouterr().out diff --git a/dokimi/tests/test_personas_dry_run_and_cap.py b/dokimi/tests/test_personas_dry_run_and_cap.py index e11c6443a..27e53c319 100644 --- a/dokimi/tests/test_personas_dry_run_and_cap.py +++ b/dokimi/tests/test_personas_dry_run_and_cap.py @@ -17,6 +17,7 @@ from dokimi import cli, llm_pricing from dokimi.commands import personas as personas_cmd from dokimi.exit_codes import EXIT_INCONCLUSIVE +from dokimi.defaults import DEFAULT_GENERATOR_MODEL from dokimi.personas import generator as generator_mod from dokimi.personas.analyzer import PersonaAnalyzer @@ -35,7 +36,7 @@ def _cli(monkeypatch, *argv: str) -> int: def _discover(monkeypatch, out, *extra: str) -> int: return _cli(monkeypatch, "eval", "personas", "discover", "--product", "lib", "--out", str(out), - "--provider", "openai", "--description", "A library", *extra) + "--model", f"openai/{DEFAULT_GENERATOR_MODEL}", "--description", "A library", *extra) @pytest.fixture diff --git a/dokimi/tests/test_pipeline_empty_question_set.py b/dokimi/tests/test_pipeline_empty_question_set.py index 7caafa6f2..62c435d53 100644 --- a/dokimi/tests/test_pipeline_empty_question_set.py +++ b/dokimi/tests/test_pipeline_empty_question_set.py @@ -74,8 +74,8 @@ def no_personas(self): monkeypatch.setattr(EvaluationPipeline, "_discover_personas", no_personas) monkeypatch.setattr(benchmark, "_load_registry", lambda args: _Registry()) args = build_parser().parse_args([ - "benchmark", "run", "--library", "onetbb", "--out-dir", str(out), "--provider", "openai", - "--judge-provider", "openai", "--judge-model", "judge-x", + "benchmark", "run", "--library", "onetbb", "--out-dir", str(out), "--model", "openai/gpt-6.1-sol", + "--judge", "openai/judge-x", ]) with refusal() as outcome: diff --git a/dokimi/tests/test_provider_call_budgets.py b/dokimi/tests/test_provider_call_budgets.py index 5ed3f51d1..f471eb8a9 100644 --- a/dokimi/tests/test_provider_call_budgets.py +++ b/dokimi/tests/test_provider_call_budgets.py @@ -289,10 +289,7 @@ def test_eval_score_of_2_records_makes_4_provider_calls(provider_calls, tmp_path _answers_file(tmp_path, 2), "--out", str(out), - "--judge-provider", - "openai", - "--judge-model", - "gpt-x", + "--judge", "openai/gpt-x", ] ) assert provider_calls.by_purpose() == Counter(judge=4) @@ -312,10 +309,7 @@ def test_eval_panel_score_of_1_record_with_3_judges_makes_6_provider_calls( _answers_file(tmp_path, 1), "--out", str(out), - "--provider", - "openai", - "--model", - "gpt-x", + "--model", "openai/gpt-x", ] ) assert provider_calls.by_purpose() == Counter({f"panel:{r}": 2 for r in DEFAULT_PANEL}) @@ -357,10 +351,7 @@ def _answers_generate(tmp_path, monkeypatch, out): "org/lib", "--out", str(out), - "--provider", - "openai", - "--model", - "gpt-x", + "--model", "openai/gpt-x", "--rerank-threshold", "0", "--concurrency", diff --git a/dokimi/tests/test_record_readers.py b/dokimi/tests/test_record_readers.py index d322804eb..969262997 100644 --- a/dokimi/tests/test_record_readers.py +++ b/dokimi/tests/test_record_readers.py @@ -460,7 +460,7 @@ def test_the_arm_judges_send_no_binary_answer_to_a_judge(): @pytest.mark.parametrize("command", [ ["score", "pairwise", "--baseline-arm", "without_docs"], ["score", "checklist", "--baseline-arm", "without_docs"], - ["judge", "agreement", "--judges", "amazon-bedrock/m", "--baseline-arm", "without_docs"], + ["judge", "agreement", "--judge", "amazon-bedrock/m", "--baseline-arm", "without_docs"], ]) def test_the_arm_judges_refuse_a_binary_answers_file_before_any_call(tmp_path, monkeypatch, capsys, command): """Base: no judge call and exit 2 (pairwise, checklist) or an empty table; never paid calls.""" @@ -601,7 +601,7 @@ def test_cross_judge_refuses_a_missing_result_file_before_any_judge_call(tmp_pat seen: dict = {} _recording_judge(monkeypatch, seen) missing = tmp_path / "missing.json" - args = _cross_judge_args(tmp_path, _material_arms_run(), "--no-stored", "--judges", "amazon-bedrock/m", + args = _cross_judge_args(tmp_path, _material_arms_run(), "--no-stored", "--judge", "amazon-bedrock/m", flag, str(missing)) with pytest.raises(InputError) as exc: args.func(args) @@ -742,7 +742,7 @@ def test_cross_judge_names_a_result_entry_of_the_wrong_shape_before_any_judge_ca _recording_judge(monkeypatch, seen) wrong = tmp_path / "wrong.json" wrong.write_text(json.dumps(content), encoding="utf-8") - args = _cross_judge_args(tmp_path, _material_arms_run(), "--no-stored", "--judges", "amazon-bedrock/m", + args = _cross_judge_args(tmp_path, _material_arms_run(), "--no-stored", "--judge", "amazon-bedrock/m", flag, str(wrong)) with pytest.raises(InputError) as exc: args.func(args) diff --git a/dokimi/tests/test_report_stop_note.py b/dokimi/tests/test_report_stop_note.py index 3481c4543..291e1af6f 100644 --- a/dokimi/tests/test_report_stop_note.py +++ b/dokimi/tests/test_report_stop_note.py @@ -200,8 +200,8 @@ def judge_replies(monkeypatch): @pytest.mark.parametrize("argv", [ - ["pointwise", "--judge-provider", "amazon-bedrock", "--judge-model", "us.anthropic.x"], - ["panel", "--provider", "amazon-bedrock", "--model", "us.anthropic.x", "--roles", "technical_expert"], + ["pointwise", "--judge", "amazon-bedrock/us.anthropic.x"], + ["panel", "--model", "amazon-bedrock/us.anthropic.x", "--roles", "technical_expert"], ]) def test_a_judged_eval_of_a_stopped_answers_file_keeps_its_terminated_block(tmp_path, judge_replies, argv): out = tmp_path / "eval.json" diff --git a/dokimi/tests/test_saved_self_judge_warning.py b/dokimi/tests/test_saved_self_judge_warning.py index 25d5278b9..24710b263 100644 --- a/dokimi/tests/test_saved_self_judge_warning.py +++ b/dokimi/tests/test_saved_self_judge_warning.py @@ -74,13 +74,13 @@ def _questions_file(tmp_path): def _judge_argv(tmp_path): a, q, out = str(_arms_file(tmp_path)), str(_questions_file(tmp_path)), str(tmp_path / "o.json") - j = ["--judge-provider", "openai"] + j = ["--judge", "openai/gpt-6.1-sol"] return { "dokimi.commands.judge_reliability": [ ["eval", "score", "pairwise", "--answers", a, "--out", out, *j], ["eval", "score", "checklist", "--answers", a, "--questions", q, "--out", out, *j], ["eval", "judge", "wording", "--answers", a, "--out", out, *j], - ["eval", "judge", "agreement", "--answers", a, "--no-stored", "--judges", "openai/gpt-6.1-sol", + ["eval", "judge", "agreement", "--answers", a, "--no-stored", "--judge", "openai/gpt-6.1-sol", "--out", out], ], "dokimi.commands.evaluate": [ @@ -156,7 +156,7 @@ def test_validate_pairwise_checks_the_escalation_judge(tmp_path, monkeypatch): seen = [] monkeypatch.setattr(evaluate, "warn_recorded_self_judge", _stop_recording(seen)) args = parse_args(["eval", "judge", "validate", "--answers", str(_arms_file(tmp_path)), - "--mode", "pairwise", "--judge-provider", "anthropic", "--escalate-model", "gpt-6.1-sol", + "--mode", "pairwise", "--judge", "anthropic/claude-sonnet-5-5", "--escalate-model", "gpt-6.1-sol", "--escalate-provider", "openai", "--out", str(tmp_path / "o.json")]) with pytest.raises(Stop): args.func(args) @@ -169,7 +169,7 @@ def test_pairwise_checks_the_escalation_judge_too(tmp_path, monkeypatch): seen = [] monkeypatch.setattr(judge_reliability, "warn_recorded_self_judge", _stop_recording(seen)) args = parse_args(["eval", "score", "pairwise", "--answers", str(_arms_file(tmp_path)), - "--judge-provider", "anthropic", "--escalate-model", "gpt-6.1-sol", + "--judge", "anthropic/claude-sonnet-5-5", "--escalate-model", "gpt-6.1-sol", "--escalate-provider", "openai", "--out", str(tmp_path / "o.json")]) with pytest.raises(Stop): args.func(args) @@ -188,7 +188,7 @@ def __init__(self, model, provider, temperature=None): monkeypatch.setattr("dokimi.eval.judge.Judge", FakeJudge) args = parse_args(["eval", "score", "pairwise", "--answers", str(_arms_file(tmp_path)), - "--judge-provider", "anthropic", "--escalate-model", "claude-opus-5-5"]) + "--judge", "anthropic/claude-sonnet-5-5", "--escalate-model", "claude-opus-5-5"]) assert _pairwise_judges(args)[1] == ("claude-opus-5-5", "anthropic") _, label = pairwise_judge(args) assert label.endswith(" pairwise → anthropic/claude-opus-5-5") # stored as the measure name @@ -206,7 +206,7 @@ def test_validate_with_a_typed_scorer_does_not_warn(tmp_path, monkeypatch): lambda *a, **k: SimpleNamespace(name="typed", effective_max_len=None)) monkeypatch.setattr(evaluate, "warn_recorded_self_judge", _stop_recording(seen)) args = parse_args(["eval", "judge", "validate", "--answers", str(_arms_file(tmp_path)), - "--scorer", "typed:laya", "--judge-provider", "openai", + "--scorer", "typed:laya", "--judge", "openai/gpt-6.1-sol", "--out", str(tmp_path / "o.json")]) with pytest.raises(Stop): args.func(args) @@ -250,7 +250,7 @@ def test_checklist_on_a_binary_answers_file_refuses_without_warning(tmp_path, ca p.write_text(json.dumps({**SELF, "answers": [{"question_id": "Q1", "question_text": "q", "answer": "a" + LONG}]}), encoding="utf-8") args = parse_args(["eval", "score", "checklist", "--answers", str(p), "--questions", - str(_questions_file(tmp_path)), "--judge-provider", "openai", + str(_questions_file(tmp_path)), "--judge", "openai/gpt-6.1-sol", "--out", str(tmp_path / "o.json")]) with pytest.raises((SystemExit, ValueError)): # InputError is a ValueError; main turns it into exit 2 args.func(args) diff --git a/dokimi/tests/test_session_runner.py b/dokimi/tests/test_session_runner.py index 68e3c3ea2..53702bf0e 100644 --- a/dokimi/tests/test_session_runner.py +++ b/dokimi/tests/test_session_runner.py @@ -489,7 +489,7 @@ def test_a_whitespace_reply_ends_the_session_as_an_empty_one(fake_llm): @pytest.mark.parametrize("cmd", [ ["eval", "score", "pairwise"], ["eval", "score", "checklist", "--questions", "{questions}"], - ["eval", "judge", "agreement", "--no-stored", "--judges", "anthropic/claude-haiku-4-5"], + ["eval", "judge", "agreement", "--no-stored", "--judge", "anthropic/claude-haiku-4-5"], ]) def test_a_session_artifact_is_refused_by_every_judge_command(cmd, fake_llm, tmp_path, monkeypatch, capsys): diff --git a/dokimi/tests/test_subjects.py b/dokimi/tests/test_subjects.py index 592e2977b..436bddcb4 100644 --- a/dokimi/tests/test_subjects.py +++ b/dokimi/tests/test_subjects.py @@ -136,10 +136,7 @@ def test_subject_run_default_cell_honors_cli_model_provider(tmp_path: Path): "subjects", "run", str(descriptor_path), - "--model", - "custom-model", - "--provider", - "openrouter", + "--model", "openrouter/custom-model", ]) cell = _matrix_config_for_run(descriptor, args)["matrix"]["cells"][0] diff --git a/dokimi/tests/test_writers_save_artifact.py b/dokimi/tests/test_writers_save_artifact.py index 8ebfb4f8c..cfd0ccda9 100644 --- a/dokimi/tests/test_writers_save_artifact.py +++ b/dokimi/tests/test_writers_save_artifact.py @@ -84,7 +84,7 @@ def persona_reply(monkeypatch): def _discover(monkeypatch, out: Path, *extra: str) -> int: return _cli(monkeypatch, "eval", "personas", "discover", "--product", "lib", "--out", str(out), - "--provider", "openai", *extra) + "--model", "openai/gpt-6.1-sol", *extra) def test_discovered_personas_are_a_personas_artifact_that_readers_still_read(