← Model losses

Head-to-head comparison

openai / gpt-6-luna / max / max effort preferred over openai / gpt-6-luna / high / high effort · close win.

Primary judge: Sol 6.1, requested Low. Effective provider effort and internal attempts were not verified. A close win is still a scored preference; it does not establish a material defect.

Reviewed public evidence

Task goal

Review and design a minimal strict modern judge-response envelope validator and precise failure receipt. Current parser selects the first score marker pair; demonstrate and resolve duplicated/conflicting/nested/truncated envelopes without guessing or repairing scores. Require exactly one canonical envelope for modern judgment and complete bound alias roster/schema metrics; preserve explicitly requested legacy historical behavior. On malformed output preserve actual judge text/ref, source packet and worker evidence, executable scoring calls0/no ref, no journal write, and truthful syntax-vs-cardinality failure reason. Do not retry failed FAST or rerun workers/judges; do not propose heuristic JSON repair or accepting a partial roster. Return minimal patch/test plan and tests against current parser plus failed completion handoff.

Source evidence: harness/opencode2/agent-teams/src/handoff.js, harness/opencode2/agent-teams/src/judge-contract.js, harness/opencode2/agent-teams/tests/writer-handoff.test.mjs. Review the exact frozen commit and return source-grounded reasoning. Do not execute tests or make source changes.

openai / gpt-6-luna / max / max effort answer

Reviewed the supplied frozen source snapshot (`sha256:1f6dfd09c82afe8048c1b64b81266e0bc1fe0bb1cb0009a0d2743b96cd56c9f4`) directly; no tests or source changes. The packet gives a digest, not a Git commit SHA, so I can identify the reviewed snapshot only by that digest.

### Finding and minimal parser change

`markedScoreRows` takes the first start marker and the first end marker after it, parses that slice, and ignores any later markers (`handoff.js:32–40`). Thus a valid envelope followed by a conflicting one is accepted as the first; nested markers are not explicitly diagnosed. Missing markers return `null`, while malformed JSON throws. `exactScoreInput` checks only that both marker strings occur somewhere before calling this parser (`handoff.js:136–143`). A reversed pair can therefore reach a later, misleading array error.

Add a strict parser for the **modern** path only:

1. Require exactly one start and one end marker. Report missing, duplicate, or nested markers as a cardinality failure; a truncated response missing its end marker belongs here.
2. Require start before end and, consistent with the prompt’s “return only” instruction, no non-whitespace text outside the pair. Treat violations as envelope syntax/canonicality failures.
3. Parse the enclosed text with `JSON.parse` and require an array. Do not repair or reinterpret it. If markers are complete but the JSON is truncated or invalid, report syntax.
4. Only after parsing, apply the existing alias binding and row validation. Keep schema/roster errors distinct from envelope syntax/cardinality errors.

A minimal structured error could use separate codes such as `JUDGE_ENVELOPE_CARDINALITY` and `JUDGE_ENVELOPE_SYNTAX`, with a specific reason for the marker/count or parse failure. The existing `bindAnonymousJudgeRows` checks duplicate/unknown/missing aliases and `exactScoreInput` performs further row and metrics checks (`judge-contract.js:264–293`; `handoff.js:184–227`). Keep those checks; do not accept a partial roster. Use the strict parser only when the modern schema is explicitly selected. Preserve the explicitly requested historical path, including `compactRootResult`’s legacy fallback only for runs without a `judge` field (`handoff.js:304–309`).

### Failed-completion handoff

When no scoring input exists, `compactRootResult` already emits `ready:false`, `calls:0`, no `reference`, and an instruction not to score (`handoff.js:391–398`). But it trusts `result.scoring.input` if present, even if an error is also present (`handoff.js:298–300`, `378–398`); make rejection atomic so malformed judgment cannot produce an executable scoring input or reference.

The compact result preserves `judge.resultRef` and `scoring.error`, but not the actual judge text (`handoff.js:358–367`, `394–398`). Its contributor projection keeps evidence status, packet digest, and result reference, but not worker result text; the compact object also has no source packet body or reference (`handoff.js:264–295`, `377–411`). Preserve the exact judge text and ref plus immutable source-packet and worker-evidence references (and retain the underlying evidence in the run/diagnostics record). Do not substitute the synthesis brief for the judge response. A malformed judgment should yield calls `0`, no scoring reference or write, and a truthful validation reason; no retry or worker/judge rerun.

### Tests to add

- Demonstrate current first-pair behavior with two complete, conflicting envelopes; demonstrate that current nested and truncated cases lack reliable cardinality-versus-syntax classification.
- Verify the strict modern path rejects duplicate/missing/nested markers, reversed markers, invalid/truncated JSON, extra text, and non-array JSON; verify one valid envelope succeeds without changing its scores.
- Verify exact bound alias coverage and existing schema/metrics checks reject duplicate, unknown, and missing aliases and invalid metrics. Keep these failures distinct from envelope syntax/cardinality.
- Verify explicitly historical table behavior remains unchanged and a run with a `judge` field cannot fall back to synthesis text.
- Extend the completion-handoff coverage to assert malformed judge output retains its exact text/ref and source/worker evidence, emits calls `0` with no reference, produces no scoring-journal write, and does not trigger another judge or worker invocation.

`writer-handoff.test.mjs:34–137` currently covers writer commands and frozen targets, not malformed judge parsing or this failed-completion handoff.

**Dependency uncertainty:** `metrics.js`, `evaluation-rationale.js`, and `runtime-identity.js` are outside the supplied snapshot, so the exact metric and summary validation rules and schema-version value cannot be independently confirmed here. The scoring producer and journal-write path are also not in the admitted files, so their current retry/write behavior is unverified.

openai / gpt-6-luna / high / high effort answer

## Finding

**The modern parser accepts ambiguous output.** In `handoff.js`, `markedScoreRows` selects the first start marker and the first end marker after it, then parses only that slice (lines 32–40). It does not check for additional markers. Consequently, two valid envelopes—including conflicting scores—can silently yield the first envelope’s scores. Nested or truncated markers may instead cause JSON parsing to fail, but the parser does not classify envelope cardinality separately.

`exactScoreInput` checks only that the text includes both marker strings before calling that parser (lines 136–143). Thus, marker presence is not proof of exactly one complete envelope. `scoreRecommendations` also falls back to legacy table parsing when no marked envelope is found (lines 67–69); that behavior should remain available only on the explicitly historical path.

The downstream schema checks are substantially present: `bindAnonymousJudgeRows` rejects unknown and duplicate aliases, requires every bound alias, and requires an evaluation summary (lines 264–293). `exactScoreInput` requires a recommendation for every quality lane and parses modern metrics (lines 151–153, 184–209). Those checks do not repair the envelope-selection flaw.

## Minimal patch and test plan

- Make modern parsing validate the whole envelope before parsing: require **exactly one** start marker and **exactly one** end marker, in the proper order, with one JSON array between them. Do not select a “best” or first candidate, recover JSON, or accept a partial roster.
- Return a stable, truthful failure classification: marker count/duplication is a **cardinality** failure; an incorrectly ordered pair or invalid/truncated JSON is a **syntax** failure. Carry that classification in the scoring error rather than inferring it from message text.
- Keep legacy table parsing available only when `historical: true`; malformed modern output must not fall back to legacy parsing.
- Test current-parser regressions with: two valid envelopes with conflicting scores; duplicate start/end markers; nested markers; missing, reversed, and truncated markers; invalid JSON; and a single valid envelope with complete versus missing, duplicate, or unknown aliases and invalid metrics. Assert no score is selected from ambiguous output and legacy historical behavior remains unchanged.
- Test the failed-completion handoff using `compactRootResult`: on malformed modern judgment, preserve the actual judge text and result reference, source packet and worker evidence; report `ready: false`, `calls: 0`, no scoring reference, and the syntax-versus-cardinality reason. Verify the failure path does not invoke scoring or write a journal entry. Do not retry FAST or rerun workers or judges.

## Handoff limitation in the supplied evidence

`compactRootResult` emits `calls: 0` and an error when no scoring input exists (lines 391–398), and includes a judge `resultRef` and error in the judge summary (lines 358–367). It does **not** include actual judge text in that summary; its decision brief comes from `result.result`, the synthesis result (lines 347–349). The shown contributor references retain worker `resultRef`s and metadata (lines 264–295), but this snapshot does not establish source-packet retention or whether the failure path avoids a journal write. The handoff test file covers writer completion and frozen review targets, not judge failure. Add the failed-completion test at the integration point that owns those behaviors; the dependencies needed to verify that point are outside this evidence packet.

Primary judge's stated reason

A slightly reduces the chance that an implementer handles only missing-input failures while overlooking an input-bearing rejected result. This is a forced, weak preference between substantially equivalent plans, not an established material quality difference; an independent review could reasonably reject it.

This reason is the judge's assessment. No independent factual-defect finding is asserted by this record.

Battle wave: c61dd416-917b-43ea-8a5f-09fc44aa567f. Pair: brp1_c7af594fa5524a111dbe4943a508b852df89b4b11370d7d5b6bbdad93ee4c1d2. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.