Offline criterion calibration on composition pilot outputs (#4240)
Owner: eval-maintainers (roctinam). The existing owners are tools/eval/datasets/contracts.v1.schema.json, src/contracts.ts, src/pilot-files.ts, src/pilot.ts and
Offline criterion calibration on composition pilot outputs (#4240)
Prompt-first procedure: Describe the outcome you want in your agent conversation. The agent should select and load the appropriate AIWG assets, explain material changes, request any needed approval, and report verification evidence. Exact commands and flags appear only in the CLI reference.
Owner: `eval-maintainers` (roctinam). The existing owners are `tools/eval/datasets/contracts.v1.schema.json`, `src/contracts.ts`, `src/pilot-files.ts`, `src/pilot.ts` and `src/pilot-report.ts` beneath `tools/eval/`. The existing `eval.contracts` catalog entry owns the additive study/report projections. There is no new schema family, top-level CLI command or production gate.
The frozen fixture is `test/fixtures/eval-pilot/calibration.v1.json`. Its criterion registry adapts section9/research-papers signed commit `7f92a62b99d62d14b9c3a4fe499087d654cf6234`, `documentation/references/REF-3175-autorubric-criterion-evaluation.md` and `documentation/analysis/projectfit-2026-11-16/REF-3175-autorubric-criterion-evaluation.md`. These supplied analyses describe proposed protocols; they supply no AIWG model experiment or human judgments. Their reported research results are not AIWG measurements.
The initial regression run failed all six tests, first because the canonical contract lacked `CalibrationStudy`, then because the calibration API was absent. The implemented tests use synthetic votes and labels solely to verify arithmetic and retention. They do not count as human annotation or reliability evidence.
Authority and constructs
The existing hidden executable checker retains authority for corpus source/value matching, coding behavior on edge cases, functional security results, permissions, effects and transitions. Schema, content commitments, budgets and failed/partial run status also remain executable. Nothing in the qualitative score changes their verdicts or the #3315 blocked claim gate.
The existing pilot's asserted success criteria are executable; none is reclassified as a qualitative judgment. The checks that keep authority are the pinned hidden checker in `tools/eval/src/pilot-checks.ts`:
| Check | What it decides | Authority |
|---|---|---|
| `corpus` | Source and value match the hidden vector. | Retains authority. |
| `coding` | Hidden functional cases pass in the bounded VM. | Retains authority. |
| `security` | Functional result, permissions, one effect and the start/verified/complete path match the hidden vector. | Retains authority. |
Run status (`completed`, `partial`, `failed`), schema and content commitments, and budgets stay executable as well. The executable reference archived by the collector is `hidden-executable-artifact-correctness`. It is not a Q1–Q6 label and it never enters `humans`, adjudications, or qualitative denominators.
Q1–Q6 are the non-executable criteria. None is decidable from those checks. They are explanation support (Q1), faithful policy explanation (Q2), qualitative scope coverage against an explicit checklist (Q3), uncertainty communication (Q4), permitted recovery actionability (Q5) and defect routing (Q6). Executable artifact correctness is excluded from their weights. Q1 may cite the `checks` span, but that citation does not turn the executable pass bit into the Q1 judgment. The frozen definitions record type, version, evidence, applicability, anchors, weight and missing-evidence handling. Q1/Q2 are binary; Q3–Q5 use ZERO/HALF/ONE mapped to 0/0.5/1; Q6 is nominal, weight zero, with no numeric category values. Only Q5 permits N/A, when a trusted receipt explicitly states recovery is unneeded. Fabricated evidence remains a separate critical flag.
The pilot's 48 tasks and eight arms yield 384 fixed output bundles, including failed/partial outputs. They contain artifact responses, not qualitative explanations. Policy receipts, explicit qualitative checklists, uncertainty inventories and recovery alternatives are unavailable and recorded as null. Missing evidence means CANNOT_ASSESS; no labels are fabricated from artifact success, fluent prose or implicit satisfaction.
Freeze and blinding
The study commitment covers definitions, prompt, source provenance, dataset commitment, task contexts, family split and the complete saved-output bundle hash. Hashes use the existing canonical JSON SHA-256 helper (not file-byte hashes). Runtime validation rejects changed, duplicate, incomplete or mismatched outputs. The original H1/H2 task split remains intact: four development and twelve held-out tasks in each family. The qualitative estimate uses a stricter family freeze. Calibration uses corpus-verification only for development (16 tasks, 128 outputs), including corpus tasks whose pilot task split is held-out. Coding-repair and security-testing are locked held-out families (32 tasks, 256 outputs). Related variants never cross this boundary. Rubric-design and training examples must remain development-only episode IDs. `calibrate` drops every design-example episode from held-out scores, agreement, comparisons and SKIP denominators, and validation rejects a held-out or unknown example ID. Held-out examples in evaluator prompts are rejected, including unknown IDs. This small, heterogeneous split cannot establish generalization to unseen families.
`blindedPacket(bundle)` exports only an opaque episode ID, evidence digest and approved evidence. It excludes arm, task/family decoding and model identity. Two domain-qualified humans must label independently without rubric judgments, confidence or each other's labels; retain both raw labels. A distinct third reviewer adjudicates with evidence and rationale. Annotation is NOT RUN here; software cannot establish that a submitted annotator was human or truly blinded.
Receipts and statistics
`calibrate(study, fixedRecords)` accepts archived inputs; it never invokes a provider. The ordinary offline pilot also emits the empty calibration report. Each evaluator retains observed model/vendor/family/revision, full prompt, configuration/version, settings, prompt/configuration hashes and development example IDs. Record the complete provider payload and resolved defaults in settings; unavailable observations must say unknown. Each vote binds the same immutable bundle and criterion version and preserves raw response/hash, evidence IDs, rationale, secondary/critical flags, option order, execution/retry lineage, tokens, latency and cost. Configuration hashes cover every recorded setting. Hashes bind data; they do not authenticate a provider identity or a human.
Completed negative labels, NOT_APPLICABLE, CANNOT_ASSESS, provider errors, partial responses and missing responses stay distinct. Partial/error responses cannot supply a label. The last attempt in a validated retry chain is selected, and retrying a completed judgment is forbidden; separately declared configurations represent repeated-vote treatments. All attempts, including development, calibration and discarded attempts, remain in raw evidence and total cost. Never submit an unknown cost as zero. A known paid component does not replace an unknown component: if any attempt is `unknown`, the total stays `unknown`. Incomplete cost accounting prevents a cost recommendation. Failed, partial, missing and provider-error votes stay in the raw archive and in that total.
SKIP scores show original count/weight and retained numeric count/weight; nominal Q6 never contributes. Empty retained weight yields null. Candidate tables expose all held-out episodes, coverage, missing episodes, abstentions, all provider-error and partial attempt counts, and paired reference-label denominators separately. Known human applicability governs coverage; otherwise predicted applicability is explicitly provisional. Incorrect N/A, unsupported abstention and missed insufficient-evidence cases are counted separately. Confidence, if supplied for binary criteria, is the probability of MET; report Brier score and its own n.
Binary metrics include confusion, sensitivity, specificity, precision, exact agreement and unweighted kappa. Ordinal metrics include the full matrix, exact and adjacent agreement, quadratic kappa and signed numeric bias. Nominal metrics include per-class recall and macro-F1 over represented classes. Undefined rates and degenerate kappa are null. Human agreement is pre-adjudication; raw uncertain labels remain archived even when excluded from a type-specific confusion matrix.
Paired comparisons use identical saved bundles and report conditional shared errors. Seeded 2,000-resample 95% percentile intervals resample entire scenario families, preserving all nested task/arm observations. Two held-out clusters are too few: intervals are descriptive and explicitly flagged. Separate configuration IDs identify single-judge, calibration, shuffling, repeated and ensemble treatments; never infer component effects from a combined treatment. The standalone majority helper requires an absolute panel majority, counts abstaining members in the denominator and returns CANNOT_ASSESS on ties. Raw panel-member votes and membership/rule must be archived in a declared ensemble configuration; there is no automatic cross-vendor panel or independence assumption.
Evidence packet eligibility
Every judge receives the same complete blinded evidence packet. The collector records `evidence_packet_digest = digest(blindedPacket(bundle))` per attempt, separately from `bundle_digest` (the evidence body) and `prompt_digest` (the whole prompt, including criterion and option order). These use the existing eval canonical JSON digest, so unrelated prompt ordering does not split a panel.
The calibration report's `evidence_packets` records eligibility, flags, expected packet digest and execution IDs per episode/criterion. Missing historical receipts, different packets (even identical partial packets), or a prompt whose packet disagrees with its receipt exclude the entire panel from model agreement, paired comparisons, error intervals and Brier estimates. Raw votes gain explicit packet flags; costs and raw labels remain visible. Coverage and individual scores still describe supplied labels, not consensus; human agreement retains its existing frozen-bundle protocol. Retries stay archived and cannot hide a bad packet. Matching digests check equality, not completeness or correctness. See `$AIWG_ROOT/docs/decision/evaluator-calibration.md` for REF-3292 and its limits.
Measurement recommendation
For the narrow claim “judge substitutes for a typical annotator within tolerance,” #4557 permits criterion-level substitution evidence from varying human panels. See `$AIWG_ROOT/docs/decision/evaluator-calibration.md`, “Alternative annotator substitution,” for predeclaration, archived-vote analysis and claim-gate limits. Supported substitution is relative to the observed pool; not ground truth. It does not satisfy a ground-truth accuracy claim or unblock the production gate.
Insufficient evidence; #3315's claim gate stays blocked. No candidate is recommended. The report refuses a reliability claim while two blinded human annotators and an independent adjudicator are absent. The same refusal holds when synthetic labels are imported, because acceptance thresholds are `not-predeclared: insufficient-evidence` in the versioned study `test/fixtures/eval-pilot/calibration.v1.json`. This version does not invent numeric thresholds. The offline fixture has no observed evaluators, judge votes, human labels or adjudications; its total evaluation cost is $0 because no calls ran. No sensitivity, agreement or reliability estimate from synthetic tests is empirical evidence. A future version must preregister criterion-specific sensitivity, false-positive, coverage and cost/latency bounds before examining locked human labels, and collect enough independent families. Preserve failed calibration and unresolved disagreements. Vendor diversity alone cannot qualify an evaluator.
Limits of the recommendation: the held-out set has two scenario families, so clustered intervals stay descriptive; the frozen outputs have null policy, checklist, uncertainty and recovery evidence, so CANNOT_ASSESS is the honest qualitative label for those missing spans; inter-judge agreement, if later computed, is not calibration against a reference; and subscription cost that the transport does not report stays unknown.
Reported dev-slice accounting (2026-11-25)
These figures are operator-reported. This tree did not re-read the local titan archives and did not call a judge. They are not inputs to `calibrate` and they are not a reliability result.
| Judge | Calls | Valid votes | Not counted as valid | Cost |
|---|---|---|---|---|
| Codex `workers`, observed model `gpt-6-luna` | 48 | 46 | 2 missing final output | subscription, unknown USD |
| Cursor `cursor`, observed model `grok-4.7-low` | 48 | 48 | 0 | subscription, unknown USD |
| OpenRouter `openai/gpt-4.1-mini` | 48 | 38 | 10 judgments cited an absent evidence span | included in the paid component below |
| Paid component | USD 0.027 | |||
| CLI subscription component | unknown | |||
| Total evaluation cost | unknown |
The issue progress note itemizes the paid component as USD 0.022 on the 48-call OpenRouter slice plus USD 0.0047 on earlier calls. Those earlier calls are excluded from the valid-vote counts because the prompt digest changed. This note does not re-sum invoices. USD 0.027 is the stated paid component only. Because the CLI subscription component is unknown, the total evaluation cost is unknown. Unknown is not zero, and the paid component does not fill it in.
Collecting judge votes
The collector extends the existing eval CLI. It replays the committed pilot locally, verifies the frozen rubric and output commitments, and sends only `blindedPacket(bundle)` plus one versioned criterion. Each configuration gets one completed judgment per packet/criterion. Repeated-vote experiments require separate configuration IDs. This command plans 768 calls per configuration on `dev`, or 1,536 on `heldout`; retry limits increase the maximum attempt count.
CLI judges require a dedicated AIWG project, separate from the source tree and all run archives. Prepare two declared native inputs: an `aiwg.config` with `parallelism.worker_dispatch: true`, CLI installation/account/quota bindings and the judge groups; and `models.json` with `defaults.workerSelection.roleGuidance.efficiency.groups` naming those groups. Choose model IDs, tiers, efforts and permissions supported by your installed CLIs. The synthetic examples `test/fixtures/eval-pilot/judge-project.config.json` and `judge-project.models.json` show the shape; replace their synthetic models and scopes before using them with installed CLIs. See worker dispatch configuration.
The setup subcommand validates these inputs against existing AIWG owners, then copies them byte-for-byte into a fresh project. It refuses an existing directory and never qualifies or launches a model. From the repository root:
npx tsx tools/eval/src/index.ts judge-setup the judge-project option /tmp/pilot-judge-project the config option /tmp/judge-inputs/aiwg.config the models option /tmp/judge-inputs/models.json the evaluators option test/fixtures/eval-pilot/judges.cli.json
# One-time operator qualification, from the exact judge project workspace.
(cd /tmp/pilot-judge-project && the agent-owned effect operation keys init && the agent-owned doctor operation the probe-workers option the qualify option the yes option)
Configure the existing effect-ledger key provider in the declared config as needed by `effect keys init`. Qualification binds the installed CLIs to this workspace; repeat it after changes that invalidate the binding. Offline tests exercise both setup commands with a fake resolver and synthetic markers only.
# Offline planning: no judge launches, HTTP requests or run-directory writes.
npx tsx tools/eval/src/index.ts judge-collect the judge-project option /tmp/pilot-judge-project the evaluators option test/fixtures/eval-pilot/judges.cli.json the run-dir option /tmp/pilot-judge-dev the tranche option dev the seed option 4240 the max-calls option 24 the dry-run option
# Live collection (conductor only); rerun identically to resume.
npx tsx tools/eval/src/index.ts judge-collect the judge-project option /tmp/pilot-judge-project the evaluators option test/fixtures/eval-pilot/judges.cli.json the run-dir option /tmp/pilot-judge-dev the tranche option dev the seed option 4240 the max-calls option 24
# Raise the cumulative call cap to continue; the frozen configuration stays fixed.
npx tsx tools/eval/src/index.ts judge-collect the judge-project option /tmp/pilot-judge-project the evaluators option test/fixtures/eval-pilot/judges.cli.json the run-dir option /tmp/pilot-judge-dev the tranche option dev the seed option 4240 the max-calls option 48
# Held-out collection uses its own directory, never development prompt examples.
npx tsx tools/eval/src/index.ts judge-collect the judge-project option /tmp/pilot-judge-project the evaluators option test/fixtures/eval-pilot/judges.cli.json the run-dir option /tmp/pilot-judge-heldout the tranche option heldout the seed option 4240 the max-calls option 24
# Optional paid HTTP judge: configure the desired model in a copy of this JSON.
# OPENROUTER_API_KEY must already be exported by the operator; do not put it in JSON.
npx tsx tools/eval/src/index.ts judge-collect the evaluators option test/fixtures/eval-pilot/judges.http.json the run-dir option /tmp/pilot-judge-http the tranche option dev the seed option 4240 the max-calls option 12 the max-usd option 0.50
Choose a fresh run directory and keep archives private. CLI declarations accept an optional `task`. Its default is `inventory`, the resolver's read-only bounded assessment class mapped to `efficiency`. The other built-ins are `implementation` (coding), `architecture` and `review` (reasoning). Project classes come from `models.json` at `defaults.workerSelection.taskClasses`, for example `"assessment": "efficiency"`. Unknown classes and role conflicts fail before collection. A reasoning judge must explicitly select a compatible task and role guidance; collection never authorizes premium escalation.
For every CLI attempt the collector runs the resolver from the judge project, then executes its stdout unchanged from that same directory:
Use AIWG to complete this documented outcome: For every CLI attempt the collector runs the resolver from the judge project, then executes its stdout unchanged from that same directory
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.
`src/models/worker-installation.mjs` compares the real workdir with the exact qualified workspace; subtrees are rejected. Briefs and finals must also stay within the qualified input/output roots. Each attempt therefore stages its absolute brief and final paths under `<judge-project>/.judge-attempts/<execution>`. Only one attempt occupies this workspace: after execution, all staged files are copied to the archive and removed before another judge starts. A project lock prevents concurrent collectors, including collectors using different archives. Run directories must be outside the judge project and cannot contain it, including through symlinks. Judges receive no archive path in their brief. Previous attempt outputs are absent from the working tree; filesystem read confinement outside that tree remains the configured CLI's responsibility. Use appropriate native or external isolation for CLIs that can read outside their workdir.
The brief asks for a JSON judgment with `label`, `evidence` (approved span IDs), `rationale`, `critical_flags`, `secondary_flags` and optional `confidence` (MET probability). If a CLI enforces the workerClaims wrapper, put this JSON as the JSON-encoded `summary`.
Each brief lists the exact citable span IDs: the bundle's non-null top-level evidence keys in sorted order. Missing evidence is expressed by `CANNOT_ASSESS` and the rationale, never by citing an absent or null span. The `CalibrationStudy` schema permits empty citation arrays; the validator permits them only for `CANNOT_ASSESS` and permitted `NOT_APPLICABLE` judgments. Assessed labels require at least one present span. Null fields remain visible in the packet as missing evidence, but are excluded from the citable list.
Brief changes alter each vote's `prompt_digest`. Resume compares archived prompts against the current rendered brief and refuses prompt drift. After updating the brief, use a fresh run directory; preserve existing archives with their original prompts and hashes rather than editing them to resume.
A resolver `blocked` response stops collection after its first receipt, with `stop_reason: resolver-blocked`; the CLI prints its diagnostics and the archive retains the exact argv, cwd, rendered command and raw resolver streams. It consumes one attempt with unknown cost. Resuming that archive preserves the stop, avoiding repeated configuration failures. After correcting the project/qualification, resume with the retry-blocked option to explicitly recheck it. Cumulative call and retry caps still apply; another block stops immediately again. Ordinary transport failures retain bounded retry/resume behavior. After interruption, reconcile any staged attempt before removing `.judge-attempts` or `.judge-collector.lock`; never remove them while a collector is active.
`study.json` is both the atomic resume state and a `CalibrationStudy` archive accepted directly by `calibrate(archive, fixedRecords)`. Each attempt directory also retains the prompt, resolver output, stdout, stderr, final and normalized vote. Observed identities unavailable through the transport say `unknown`; requested model names never count as observations. Exact prompts, settings and raw payloads have canonical JSON SHA-256 hashes in each vote. CLI resource accounting is unknown unless supplied by a supported transport; zero is never substituted. A missing final, malformed/partial final, provider error and completed abstention remain different statuses. All attempts count against the max-calls option. the max-attempts option defaults to two; completed judgments are never retried.
For HTTP, `max_call_usd` is the operator's conservative per-attempt reservation, not a provider-enforced price guarantee. Before each call the remaining budget must cover it. Reported cost replaces the reservation; unknown cost consumes the whole reservation. An unexpectedly higher invoice can exceed the requested cap by the last call; set a provider account spending limit for a hard monetary ceiling. Unknown accounting blocks any cost recommendation. Neither authorization headers nor environment credentials enter the archive. Tests override HTTP only with a loopback fixture server.
The collector checkpoints before dispatch. After an interrupted process it recovers a committed `vote.json`; without one it stops with `in-flight` for operator reconciliation, avoiding a duplicate paid judgment. A leftover `collector.lock` also requires operator review before removing it. Do not remove it while the collector is active.
The pilot's executable artifact correctness labels are archived separately as `executable-reference`, with pinned check references, outcome hash and output status. They never enter `humans`, adjudications, or Q1–Q6 reference denominators. None of the frozen qualitative criteria is decidable from those checks; all six are listed as needing human labels. No human labels are generated, and the original insufficient-evidence claim gate remains blocked.