Repository navigation
Description
Context
model-prompts §8.1 judges a policy text by comparing two arms on the same cases, model, settings and budget, with one fixed judge. The rule itself is sound. The measuring instrument has a weakness that decides which runs can be judged at all, and it surfaced as #2256.
The problem
The view is mostly scaffolding. judge_view renders the run's export, and rendered_request folds only the fields that repeated: the first request's system prompt and every tool definition appear in full. A scenario whose only text is a 56-byte summary reports a 23 817-token view against a 24 000-token window. So the budget is consumed by the same constant text in every run, not by what the run did, and the headroom left for the transcript is small.
The estimate is a byte heuristic with an asymmetric error. count_tokens is serialized_bytes / 4, not the judge model's tokenizer. Overestimating pushes a run to unjudged: it enters no probe rate, and the unjudged-run rate is a row with low power at 20 runs. Underestimating turns into a provider refusal, which §8.1 records as a failed run — charged to that arm's failed-run rate. The candidate text is usually the longer one, so both directions lean against the candidate.
"The view does not fit" reads as a run defect, not a measurement defect. §8.1 refuses to split a view (a probe about a whole run cannot be answered from a part) and records the run as unjudged with the estimate and the budget. That is defensible per run. What is missing is the evaluation-level signal: a scenario whose view cannot fit, or sits within a hair of the budget, produces inconclusive rather than a loud error, and can silently shrink the judged sample (the floor counts judged runs only).
Environment decides the outcome. Because paths are part of the view and the estimate is byte-based, the same fixture is judged on one host and unjudged on another (#2256: 17 tokens, /tmp versus /var/folders/…). "Same cases, same budget" does not hold across machines.
Options to settle
- State the constant part once per evaluation instead of per run (or replace it with a digest plus names) as long as every probe §8.1 needs can still be answered; otherwise record that limitation in the rule.
- Give the judge its own declared window, independent of the model under test, so the judge's budget is not a side effect of the arm's window.
- Normalize paths (relative to the run's roots) so a view does not depend on the host's temp directory.
- Calibrate the estimate against the judge's tokenizer, or record its measured error and direction beside each report.
- Fail the evaluation, rather than the run, when a scenario's view does not fit the budget. Same for a fixture whose margin is under some stated fraction.
The owner document is docs/design/model-prompts.md §8.1 and §9.8, so a rule change updates it first. #2139 and #635 are the earlier judge-view size changes.
Acceptance
- A stated decision on each option above, recorded in §8.1/§9.8 or in a follow-up issue.
- A fixture whose view lands near the budget is rejected by the harness with its measurement, not by a test flipping on the host.
- The judged/unjudged outcome for a given scenario, model and budget no longer depends on the machine's paths.
Activity
eric8810 commentedon Nov 27, 2026
Provenance
937883252ace088c65model-prompts§8.1, "Failed and unjudged runs")3a875e0265,6fe98868be,98f53eaa43count_tokens= bytes / 4278e257e75742a16c3--modeland--judgeare both required (scenario_eval.rs:1634-1650), and the judge window is read from the judge's own selection (judge_window,scenario_eval.rs:8953), so the two windows are chosen independently — an earlier version of this comment said the judge defaulted to the run model; it does not.What still holds: whatever window the judge declares, the view carries the run's system prompt and tool definitions in full, so the content the probes ask about competes with constant scaffolding for the judge's budget. A judge window that is comfortably larger than the run model's hides that; a judge window near the run's does not.
Fixturealready ships a second, 128 000-token provider for this case; using it for the behavioural tests is #2256's fix.eric8810 commentedon Nov 27, 2026
Landed in #2261 (stacked on #2260): every run's record now states
judgeEstimateandjudgeBudget(optional on the wire, so olderruns.jsonlstill reads), the fit flow asserts both margins instead of sitting on the line, and §8.1 records the fact.Deliberately not adopted here, because each changes the rule rather than its observability:
If the maintainers want the last item to be a hard failure, it is a §8.1 change and belongs in its own decision.
eric8810 commentedon Nov 27, 2026
One decision remains: should an unfittable judge view fail the evaluation, or stay an unjudged run? The last comment records that as a §8.1 rule change. Please decide which it is; if it is a hard failure, update §8.1 and add the flow test rather than treating it as an implementation detail.
eric8810 commentedon Nov 27, 2026
Proposal
What landed already (no rule change): every run's record states
judgeEstimateandjudgeBudget, the fit flow asserts its margin, and §8.1 records that fact (#2261).The three open questions are one decision each. My recommendation, with the reasoning, is below; @yyhhyyyyyy owns §8.1 and should accept or reject.
1. Do not drop the system prompt and tool definitions from the view
The view's fixed part dominates: a scenario whose only text is a 56-byte summary produced a 23 817-token view against a 24 000-token window, because the first request's system prompt and tool definitions are carried in full. Tempting, but wrong to cut: the view is the record of what the run was given, and a probe may ask about it ("the run must not show the operator's instruction", "the tool was offered"). Dropping it would also make the judged text depend on which policy text is under test, which is exactly what the comparison holds fixed.
The consequence to state instead: a judge's declared window must hold the run's fixed request plus the run itself, so
--judgenames a model with a wide window, not the model under test.2. Keep
bytes / 4, and stop calling it a measurementcount_tokensis a pre-call upper-bound heuristic, not the judge's tokenizer. Calibrating it means shipping a tokenizer per judge model and making the fit check depend on which provider is configured — a new coupling for little value, since the check's job is only to avoid an overflow refusal.What it costs is already visible: the pair is recorded per run, and its error direction is knowable (an overestimate turns a run unjudged, an underestimate turns a provider refusal into a failed run). §8.1 should say that the estimate is the runner's bound, and that the report's margin is read with that bound, not as the judge's own count.
3. Make a scenario's margin a precondition, not a run outcome
Today a view that does not fit leaves the run unjudged, and the run enters no probe rate. That is right for a genuinely long run. It is wrong for a scenario that sits on the line: #2260 fixed eight flows that flipped between judged and unjudged on 17 tokens, and
#2214grew the fixed request enough to cross it.Adopted rule, one sentence in §8.1:
That keeps
unjudgedfor runs that outgrow the judge at runtime (still a compared rate) and stops a fixture from depending on the host's path length or on a text change elsewhere.Not recommended: making every unfit view a hard evaluation failure. It would remove the unjudged-run rate as a signal and turn a legitimately long run into an error the operator cannot override.
Cost
Item 3 is small:
judge_exportalready computes the pair, so the check is a comparison before the call, one carried reason, and one report row; the existing fit flow gains a case for the band. Items 1 and 2 are wording in §8.1.If this reads right, I will draft the §8.1 text and the check together for review.
feat(xtask): record each run's judge view against the judge's budget
yyhhyyyyyy commentedon Nov 29, 2026
Decision on the proposal, item by item, then the path question from the issue body.
Accepted: the view keeps the system prompt and the tool definitions in full. §8.1 will state that the model
--judgeselects must declare a window that holds the run's fixed request plus the run itself, since the same budget feeds the candidate text's own cost and the transcript. Separately, we will open a PR that folds losslessly injudge_viewwhat is byte-identical to what came before:prompt/changed,context/configured, and thesystemandtoolsof a child line's first request when they are identical to the earlier value. The unchanged-marker collapse loses nothing: the view still rebuilds every request field, asthe_judge_view_keeps_every_request_field(xtask/src/scenario_eval.rs:14620) andassert_view_rebuilds(xtask/src/scenario_eval.rs:17150) require, and a 1-turn fixture view stops carrying the same fixed text two to four times.Accepted with one correction to the wording:
bytes / 4stays, and §8.1 will describe it as an estimate taken before the call from serialized UTF-8 bytes at four bytes per token (crates/dim-agent-capabilities/src/context_model.rs:23), which can miss in either direction, not as a bound or upper bound. It is not one: code, diffs and dense punctuation pack real tokens into one or two bytes each, so the estimate runs low there; multi-byte UTF-8 text counts three bytes per character while tokenizers vary widely per character, so it can run either way; and the JSONL view is measured after its quotes and backslashes are escaped again, which inflates the byte count the tokens never pay. An underestimate ends in a provider refusal and stays a failed run, which a true upper bound could never produce. This is a documentation change only; the usage's real input tokens are not recorded.Not adopted; the behavior as of feat(xtask): record each run's judge view against the judge's budget #2261 stays, with no hard failure. The rule and its cost note disagree on when the check could even run: before the first run there is no view to measure, since the pre-run probe only lists tool names and the estimate and budget pair exists only after a run is exported, and checking in
judge_exportwould hard-fail a run that grew honestly into the band while a still larger run is only unjudged. The comparison already carries the signal: the unjudged-run rate compares such runs between the arms, and a probe whose arm has no judged run already makes the verdict inconclusive, so no pass rests on unjudged data. And because the byte estimate is no bound, a tenth of the budget cannot promise to catch what it misses, so the rule would not deliver the guarantee it states. Two follow-ups we do want go into a separate PR: thescenario.mdreport gains a line with the judged runs' peak estimate and smallest margin, and the test fixture'sFixture::optionsdefault judge moves to the wide-windowjudge/mock(a 128,000-token window instead of the run model's 24,000), so a fixture sits on the line only when a test means it to.Path normalization is not adopted either. The host-path difference inside a view,
/tmpagainst/var/folders/..., is on the order of 70 to 100 tokens for the working-directory and home paths the startup repeats, well inside the margin a wide-window judge carries. Rewriting paths relative to the run's roots would break the view's lossless-rebuild contract, whichthe_judge_view_keeps_every_request_fieldandassert_view_rebuildspin down, and the hosts differ anyway in ways no path rewrite removes: the sandbox declaration text (macOS adds$TMPDIRto what a process may write), the platform and architecture line, the shell, and the timezone. Windows does not come into it: the harness refuses to start off unix, since a run's endpoint, sandbox backend and file-tool boundary are unix-only.One bookkeeping item while §8.1 is edited: #2261 updated the English
docs/design/model-prompts.mdbut missed the Chinese mirror, which still lacks its two added sentences, the one stating that every run's record carries the estimate the fit check took and the judge's budget it compared, and the one stating that a run whose judging ended on a timeout keeps the pair when it reached the check.Since you offered to draft the §8.1 text and the check together: please go ahead with the §8.1 text for items 1 and 2, along the wording above, in both the English file and its Chinese mirror, which also brings in the two sentences the mirror is missing. Item 3 was not adopted, so the check itself is dropped; the report margin line and the fixture's default judge move are ours, in the follow-up PR named there.
eric8810 commentedon Nov 29, 2026
Accepted P2 now that the §8.1 decision is recorded: items 1–2 are documentation wording in the English file and its Chinese mirror; items 3–4 are not adopted. The report margin line and the fixture's default judge stay in the separate follow-up PR named above. Removing P3 because the blocking decision is resolved.
eric8810 commentedon Nov 29, 2026
The §8.1 text for items 1 and 2 is in #2334, English and the Chinese mirror, including the two sentences the mirror was missing from #2261. Items 3 and 4 stay as you decided; the report margin line, the fixture's default judge and the folding change are yours in the follow-up PR.
fix(xtask): fold the judge view's repeated fields byte for byte
fix(xtask): judge each saved view in the view format it declares
fix(xtask): scope legacy view upgrading to what the legacy renderer f…
fix(xtask): stamp the pooled test's run numbers onto the shared recor…