Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
04ef31e
feat(eval): expected_outcome: ask, graded by its own rubric
napetrov Nov 26, 2026
553d69a
fix(eval): refuse an ask record in eval score reference; review nits
napetrov Nov 26, 2026
0e3c6be
feat(eval): ask rows stay out of the arm headline; own count, mean an…
napetrov Nov 26, 2026
7830a59
fix(arms): ask rows stay out of every reader's statistics, and show t…
napetrov Nov 29, 2026
0bda291
fix(ask): ask rows stay out of every reader's statistics
napetrov Nov 29, 2026
d8987b6
fix(ask): baseline compare and its regression gate leave ask rows out
napetrov Nov 29, 2026
72809cd
fix(ask): cross-judge stored measure, panel ask seed status, plugin w…
napetrov Nov 29, 2026
1c2b1cf
fix(ask): SPDX header on test_ask_readers; questions.v2 accepts null …
napetrov Nov 29, 2026
d00fe79
refactor(judge): one send and redraw helper for the answer and ask paths
napetrov Nov 29, 2026
73fd8ab
Merge commit 'a79ce3d9f1e3f16947ac082839d17d1e42ef8498' into HEAD
napetrov Nov 30, 2026
336d3f7
fix(report): retain ask scores and questions
napetrov Nov 30, 2026
d3d98bf
fix(evaluate): name ask questions in the pipeline summary
napetrov Nov 30, 2026
b307826
fix(judges): skip ask rows in agreement
napetrov Nov 30, 2026
acf1fa8
docs(artifacts): describe ask fields in answers and arms
napetrov Nov 30, 2026
dbcbc33
test(eval): cover a partial ask pair and original refusal index
napetrov Nov 30, 2026
c0ecc74
docs(artifacts): keep arms row schemas open
napetrov Nov 30, 2026
a1c8769
Merge commit 'cd992fb5b2bbecea3aacbcc50d17cad8d04387ea' into HEAD
napetrov Nov 30, 2026
c032a9d
Merge commit 'a352f467926ac49ed33b6016d46ad24ccb724051' into HEAD
napetrov Nov 30, 2026
5e667da
refactor(eval): keep summary and judge changes within growth limits
napetrov Nov 30, 2026
c093068
test(judges): cover agreement with only ask questions
napetrov Nov 30, 2026
54ce315
Merge commit '53953514bc71e28d0cce5b1f61e27886a326da32' into HEAD
napetrov Nov 30, 2026
c3c9725
Merge commit 'e1f774049b300d23ef0565f625248076c301e47b' into HEAD
napetrov Nov 30, 2026
c6704d1
fix(ragas): surface ask input refusals in the CLI
napetrov Nov 30, 2026
f00f70e
fix(report): exclude legacy ask scores from model comparison
napetrov Nov 30, 2026
17af3f9
Merge remote-tracking branch 'origin/main' into HEAD
napetrov Dec 1, 2026
1356e33
Detect golden question sources across both rubrics
napetrov Dec 1, 2026
8990d92
Check when ask counts appear in judge and export output
napetrov Dec 1, 2026
e99e891
Exercise persisted ask failures and subsequent answer grading
napetrov Dec 1, 2026
2e21823
Validate all agreement judges before paid scoring starts
napetrov Dec 1, 2026
42dd600
Pin the ask rubric when the answer template is customized
napetrov Dec 1, 2026
3909d8e
Preserve the answer prefix when ask questions come from another library
napetrov Dec 1, 2026
aeeebb9
Merge remote-tracking branch 'origin/main' into HEAD
napetrov Dec 1, 2026
6fef134
Address review: refuse a question-set ask in reference scoring
napetrov Dec 1, 2026
177cbc3
Address review: join keeps the evaluation's ask for an unstamped answer
napetrov Dec 1, 2026
9460ff7
Address review: document RecordError in require_judgeable_outcome
napetrov Dec 1, 2026
43fbd43
Address review: changelog names the question-set ask in reference sco…
napetrov Dec 1, 2026
3e79314
fix(eval): checklist refuses a question the question set marks ask
xaleryb Dec 2, 2026
bc0aa3d
fix(eval): ask refusal names rubric judges that exist
xaleryb Dec 2, 2026
3c4a0d6
docs(changelog): ask fragment names commands that exist
xaleryb Dec 2, 2026
f3d6c6d
test(eval): ask rows change neither the trust verdict nor interactions
xaleryb Dec 2, 2026
061d565
Merge remote-tracking branch 'origin/main' into HEAD
napetrov Dec 2, 2026
82f58be
Address review: join keeps the evaluation's ask over a null answers o…
napetrov Dec 2, 2026
78fae0f
Address review: judges validation and fragment check already fixed
napetrov Dec 2, 2026
866de18
Address review: reviewer-pushed fixes verified on the merged tree
napetrov Dec 2, 2026
0288384
fix(eval): ask rubric scores 0 for a reply that asks nothing
vlad-perevezentsev Dec 2, 2026
bfd48ca
docs(changelog): ask fragment says a reply that asks nothing scores 0
vlad-perevezentsev Dec 2, 2026
78c0748
Merge intel/dokimi main
napetrov Dec 2, 2026
e19e693
Align ask agreement tests with repeatable judge flag
napetrov Dec 2, 2026
9483688
Merge commit 'refs/pr-address/fallback-a/main' into HEAD
napetrov Dec 2, 2026
1788b05
test(cli): supply an agent run fault fixture
napetrov Dec 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!--
Copyright (C) 2026 Intel Corporation
SPDX-License-Identifier: Apache-2.0
-->

### Added

- **`expected_outcome: ask`: a question that expects the assistant to ask back is judged by its own rubric.**
A question record may carry `expected_outcome` (`answer`, the default, or `ask`). An `ask` record is graded
by the ask rubric (clarifying question, targets the ambiguity, avoids guessing) with its own prompt hash
(`ASK_JUDGE_PROMPT_SHA256`); `JUDGE_PROMPT_SHA256` is unchanged. A reply that asks nothing
scores 0 on the ask rubric, so a refusal does not outscore a guess. The value is stored on answers records
and on every eval row. An arm summary's headline (means, deltas, significance) covers answer rows only; ask
rows report their count and means in an `ask` block, and a run with ask rows stamps `ask_judge_prompt_sha256`.
Every reader that pools evaluations leaves ask rows out of its statistics: the `arms run` console and
Markdown report (`--out-md`), `report eval` (paired and knowledge pages), the `eval score pointwise` and
`eval score panel` consoles, the plugin delta, the
arms-to-binary bridge, `report model-compare`, the pipeline's step-5 summary, `baseline save` and the dashboard. The readers that print a
count say how many ask rows were left out (`arms run`, `report eval`, `eval score pointwise`,
`eval score panel`, the pipeline summary, `eval judge agreement --judge`, and the plugin delta, which warns); `report generate`, `baseline save`, `baseline compare`
(its regression gate included) and the dashboard leave them out silently. The paths with no ask rubric (pairwise, checklist, degradation pairs,
RAGAS, `eval score reference`; checklist and reference scoring also read the outcome from the matched question) refuse an `ask` record that has
an answer to judge, before any judge call. See
`docs/methodology.md` (questions that expect an ask). The eval report includes separate ask scores and
preserves ask rows in its Q&A JSON sidecar.
20 changes: 20 additions & 0 deletions dokimi/docs/methodology.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ Question records preserve source fields such as `source_type`, `question_source`

Each question may carry `version` (the author's revision, a non-empty string or an integer; a float such as `1.0` is malformed) and `provenance` (`source`, `reviewed_by`, `status` as `candidate`, `validated` or `frozen`). Every key is optional and an absent one is unknown. `eval questions generate` writes `source` as `generated:dokimi-questions-persona@<dokimi version>`, and the pipeline's chunk-grounded questions carry `generated:dokimi-questions-chunk@<dokimi version>`; a hand-written set is `hand-written` by convention. Both shapes are checked when the set is read: a malformed one is a warning, never a refusal, so files written before the key existed still load.

`expected_outcome` is `answer` (the default, absent when unset) or `ask`, which says a correct reply asks the user back instead of answering; see [Questions that expect an ask](#questions-that-expect-an-ask).

A question set is a JSON object with a `questions` list. The framework writes it as `questions.v2` (`dokimi/schemas/questions.v2.json`, where every field is documented); `questions.v1` files are still read.

- **v2 (written):** each record needs `id` and a non-empty `question`. A v2 record may not also carry `text`, so no record holds two question texts that readers could disagree on.
Expand Down Expand Up @@ -201,6 +203,24 @@ RAGAS meta-evaluation (`eval score ragas`, or `answers generate --ragas`) can be
- `context_precision`: whether the retrieved documents were useful in reaching the `with_docs` answer, with the useful ones ranked first. It is ragas's reference-free `LLMContextPrecisionWithoutReference`: the judge compares the documents with the answer, not with a reference answer.
- `context_recall`, which the commands leave out and `RagasEvaluator(metrics=[...])` computes on request: how much of the question's `ground_truth_chunk` the retrieved documents cover; answers without one get no `context_recall` score.

### Questions that expect an ask

A question with `expected_outcome: ask` is one a good assistant answers by asking back, because a detail the answer depends on is missing: a version, a target, or which of two meanings is meant. The answer rubric scores such a reply as a poor answer, so these records are judged by a separate ask rubric:

- **Clarifying question**: does the reply ask the user for information before it answers.
- **Targets the ambiguity** (weight 2): is the question the one that resolves the missing detail.
- **Avoids guessing** (weight 2): does the reply leave the detail open, rather than pick a value and do the work on it.

The aggregate is the weighted mean of the three, except that a reply that asks nothing (clarifying question 0) scores 0: otherwise a refusal, or an answer on a stated assumption, would outscore a silent guess. The dimension scores are kept as the judge gave them.

The ask rubric has its own prompt identity (`ASK_JUDGE_PROMPT_SHA256`). `JUDGE_PROMPT_SHA256` does not change, so answer-mode results keep their stamp. A judged ask row carries `expected_outcome: ask` and the ask rubric's hash; the rubric judges (the single judge, the panel, `arms run --judge`) route on the value.

The paths that compare answers with each other or with expected points (pairwise, checklist, degradation pairs, which judge validity also reads, RAGAS, and `eval score reference`) have no ask rubric. They refuse an ask record that has an answer to judge, naming its question id, before any judge call; checklist and `eval score reference` also take the ask from the matched question in the question set. A record the path would skip anyway is not refused. Drop such records from those paths, or judge them with a rubric judge. `eval judge agreement --judge` counts and skips ask rows so its stored and rescored measures cover answer rows.

**Reporting.** The arm headline (per-arm means, paired deltas, significance and interactions) is computed over answer rows only. Ask rows are reported apart in the arm summary's `ask` block: `cells` (how many ask questions the run has, errored ones included) and each arm's `avg_aggregate`, `n` and `errors` over them. Their means are never pooled into the headline and are not tested against it; the `arms run` console and its Markdown report (`--out-md`) print the block apart. The paired and knowledge eval reports give ask grades their own section and retain them in the Q&A sidecar. The binary payloads (`to_binary`, which feed `answers.v1`/`eval.v1`) and the plugin delta leave ask questions out, and warn when they do. A run with ask rows carries `ask_judge_prompt_sha256` next to `judge_prompt_sha256`; a run without them has neither change.

**Panel agreement.** Every panel role gets the same ask prompt, so agreement between roles on ask rows measures sampling noise on one prompt, not independent judgement. Read it as a noise floor, not as evidence that the ask rubric is reliable.

## Trust And Reproducibility

Every serious run should answer "Can we trust this run?" before interpreting deltas. The trust gate checks:
Expand Down
8 changes: 8 additions & 0 deletions dokimi/dokimi/commands/arms.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from dokimi import cli_flags
from dokimi.commands.novelty_budget import fresh_partial_destination
from dokimi.exit_codes import EXIT_FAILURE, EXIT_USAGE
from dokimi.report.arms_report import ask_summary_lines
from dokimi.llm import ANSWER_PROVIDERS
from dokimi.utils import InputError, question_id, read_json_input
from dokimi.write_probe import can_write
Expand Down Expand Up @@ -75,6 +76,12 @@
sys.exit(EXIT_FAILURE)


def _print_ask_block(output: dict) -> None:
"""The ask questions' own count and means, printed apart from the summary above."""
if output.get("summary", {}).get("ask"):
print("\n" + "\n".join(ask_summary_lines(output["summary"]["ask"], output["arms"])))


def cmd_arms_run(args: argparse.Namespace) -> None:
"""Run an N-arm treatment comparison and optionally judge it."""
from dokimi.eval.arms_run import LibraryIdError, ProbeError, prepare_arms, run_prepared
Expand Down Expand Up @@ -120,6 +127,7 @@
delta_s = f" (delta not computed: {stats['delta_error']})"
err_s = f" ({stats['errors']} errors)" if stats.get("errors") else ""
print(f" {arm:<24} {avg_s}{delta_s}{err_s}")
_print_ask_block(output)

Check warning on line 130 in dokimi/dokimi/commands/arms.py

View workflow job for this annotation

GitHub Actions / Mutation of changed lines

mutant inconclusive: a candidate test file for it did not run
_exit_if_terminated(output)


Expand Down
15 changes: 9 additions & 6 deletions dokimi/dokimi/commands/baseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@

def _compute_summary(eval_data: Dict[str, Any]) -> Dict[str, Any]:
"""Extract key stats from an eval file."""
from dokimi.records import BASELINE, CONTEXT, records
from dokimi.records import ASK, BASELINE, CONTEXT, records

evals = records(eval_data.get("evaluations", []), source="evaluations", kind="evaluations")
# Unscored arms stay out of the means, as in the trust gate.
valid = [e for e in evals if e.delta is not None
# Unscored arms stay out of the means, as in the trust gate; ask questions are graded by their own rubric.
valid = [e for e in evals if e.expected_outcome != ASK and e.delta is not None

Check warning on line 81 in dokimi/dokimi/commands/baseline.py

View workflow job for this annotation

GitHub Actions / Mutation of changed lines

mutant inconclusive: a candidate test file for it did not run
and e.score(CONTEXT) is not None and e.score(BASELINE) is not None]
if not valid:
return {}
Expand Down Expand Up @@ -352,12 +352,15 @@
entry = _pick_entry(args, baselines, eval_data)
baseline_data = _read_json_object(Path(entry["path"]))

from dokimi.records import records
from dokimi.records import ASK, records

# Read both record lists before the model checks: a malformed file is an InputError (exit 2), not the --strict verdict.
baseline_records = records(baseline_data.get("evaluations", []), source=entry["path"], kind="evaluations")
# Ask questions are graded by their own rubric: the compare and the regression gate see the answer rows only.
baseline_records = [e for e in records(baseline_data.get("evaluations", []), source=entry["path"], kind="evaluations")
if e.expected_outcome != ASK]

Check warning on line 360 in dokimi/dokimi/commands/baseline.py

View workflow job for this annotation

GitHub Actions / Mutation of changed lines

mutant inconclusive: a candidate test file for it did not run
baseline_evals = {e.key: e for e in baseline_records}
current_evals = records(eval_data.get("evaluations", []), source=str(eval_path), kind="evaluations")
current_evals = [e for e in records(eval_data.get("evaluations", []), source=str(eval_path), kind="evaluations")
if e.expected_outcome != ASK]

Check warning on line 363 in dokimi/dokimi/commands/baseline.py

View workflow job for this annotation

GitHub Actions / Mutation of changed lines

mutant inconclusive: a candidate test file for it did not run

_report_model_checks(args, entry, baseline_data, eval_data)

Expand Down
42 changes: 25 additions & 17 deletions dokimi/dokimi/commands/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"""Run RAGAS meta-evaluation and save results alongside answers."""
from dokimi.eval.question_text import EmptyQuestionError
from dokimi.eval.ragas_eval import RagasEvaluator
from dokimi.records import AskOutcomeError

ragas_model = getattr(args, "ragas_model", DEFAULT_JUDGE_MODEL)
ragas_provider = getattr(args, "ragas_provider", DEFAULT_JUDGE_PROVIDER)
Expand All @@ -71,7 +72,7 @@
print(result.format_summary())
print(f"✅ Saved RAGAS results to {ragas_path}")

except EmptyQuestionError:
except (AskOutcomeError, EmptyQuestionError):
raise # a bad input record is a refusal, not a RAGAS failure: cli.main reports it (exit 2)
except ImportError as exc:
sys.exit(f"RAGAS meta-evaluation was requested but cannot run: {exc}")
Expand All @@ -91,6 +92,28 @@
return {"terminated": answers_meta["terminated"]} if answers_meta.get("terminated") else {}


def _print_panel_summary(results: list) -> None:
"""The context arm's own quality, not a comparison. Ask questions have their own rubric: counted, not averaged."""
from dokimi.records import ASK, CONTEXT, records

all_rows = list(records(results, kind="evaluations"))
rows = [r for r in all_rows if r.expected_outcome != ASK]

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

View workflow job for this annotation

GitHub Actions / Mutation of changed lines

mutant inconclusive: a candidate test file for it did not run
if len(rows) != len(all_rows):

Check warning on line 101 in dokimi/dokimi/commands/evaluate.py

View workflow job for this annotation

GitHub Actions / Mutation of changed lines

mutant inconclusive: a candidate test file for it did not run
print(f"Ask questions left out (graded by the ask rubric): {len(all_rows) - len(rows)}")
valid = [r.scores[CONTEXT] for r in rows if r.score(CONTEXT) is not None]
if valid:
mean_score = sum(s.aggregate or 0 for s in valid) / len(valid)
# A question judged by one panelist has no spread, so no agreement score.
agreed = [s.agreement for s in valid if s.agreement is not None]
flagged = sum(1 for s in valid if s.raw.get("disagreement_flag", False))

Check warning on line 108 in dokimi/dokimi/commands/evaluate.py

View workflow job for this annotation

GitHub Actions / Mutation of changed lines

mutant inconclusive: a candidate test file for it did not run
print(f"\n{'─'*50}")

Check warning on line 109 in dokimi/dokimi/commands/evaluate.py

View workflow job for this annotation

GitHub Actions / Mutation of changed lines

mutant inconclusive: a candidate test file for it did not run
print(f"Panel score (context arm): {mean_score:.1f}/100")
print("Mean agreement score: " + (f"{sum(agreed) / len(agreed):.3f} (1.0 = perfect)"

Check warning on line 111 in dokimi/dokimi/commands/evaluate.py

View workflow job for this annotation

GitHub Actions / Mutation of changed lines

mutant inconclusive: a candidate test file for it did not run
if agreed else "n/a"))
print(f"Disagreement flags: {flagged}/{len(valid)} questions")
_print_left_out(rows, valid)


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
Expand Down Expand Up @@ -149,22 +172,7 @@
except OSError as exc:
raise InputError(f"cannot write {output_path}: {exc.strerror or exc}") from exc

# Summary: the context arm's own quality, not a comparison.
from dokimi.records import CONTEXT, records

rows = list(records(results, kind="evaluations"))
valid = [r.scores[CONTEXT] for r in rows if r.score(CONTEXT) is not None]
if valid:
mean_score = sum(s.aggregate or 0 for s in valid) / len(valid)
# A question judged by one panelist has no spread, so no agreement score.
agreed = [s.agreement for s in valid if s.agreement is not None]
flagged = sum(1 for s in valid if s.raw.get("disagreement_flag", False))
print(f"\n{'─'*50}")
print(f"Panel score (context arm): {mean_score:.1f}/100")
print("Mean agreement score: " + (f"{sum(agreed) / len(agreed):.3f} (1.0 = perfect)"
if agreed else "n/a"))
print(f"Disagreement flags: {flagged}/{len(valid)} questions")
_print_left_out(rows, valid)
_print_panel_summary(results)

print(f"\n✅ Saved to {output_path}")

Expand Down
Loading
Loading