openai / gpt-6-luna / max / max effort preferred over openai / gpt-6-luna / low / low 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 / low / low effort answer
**Conclusion:** `handoff.js` selects the first start marker and the first end marker after it (`markedScoreRows`, lines 32–40). It never checks for a second envelope, nested markers, or stray closing markers. Thus duplicated or conflicting judgments can be silently ignored, while nesting can make the selected slice fail JSON parsing. Modern scoring does require an array and, via `bindAnonymousJudgeRows`, rejects unknown/duplicate aliases and missing aliases, but it does not enforce a unique canonical envelope.
**Minimal patch plan:**
- Replace `markedScoreRows`’ first-pair extraction with a strict modern-envelope parser that counts marker occurrences and validates their order before parsing. Require exactly one start and one end, with no nesting or unmatched markers. Parse only the enclosed JSON; do not extract or repair JSON heuristically.
- Return distinct, stable failure reasons for malformed syntax/envelope structure versus marker cardinality (missing, duplicate, or unmatched markers). Keep legacy parsing behind the explicit `historical` path in `exactScoreInput` (lines 136–144); do not tighten historical behavior.
- Keep alias binding, but make the modern schema contract explicit: require exactly one row per bound alias and all required row fields, including all four metrics. `bindAnonymousJudgeRows` currently checks alias uniqueness/completeness and `evaluationSummary` presence (lines 264–292); `parseMetrics` is called later in `handoff.js` (lines 207–210), but its implementation is outside this packet, so metric-key completeness cannot be confirmed here.
**Failure receipt and handoff:** `compactRootResult` already emits `ready: false`, `calls: 0`, the scoring error, and an instruction not to call scoring when no input is produced (lines 297–310, 391–398). Preserve the actual judge text and its result reference, source packet, and worker evidence in the run’s failure record; do not synthesize a scoring input, reference, or journal write. The compact receipt currently exposes only judge result metadata, not judge text (lines 358–367), so the precise location and persistence path for retaining full text and packet evidence cannot be established from this snapshot. Avoid retries or rerunning work.
**Tests to add (without executing):**
- Modern envelope cases: valid single envelope; duplicate identical and conflicting envelopes; nested starts/ends; unmatched start/end; malformed JSON; valid JSON with a non-array value. Assert syntax versus cardinality failure reason and that no second envelope is selected.
- Schema cases: missing, duplicate, unknown, and extra aliases; missing each required metric and evaluation summary; valid complete roster. Assert no partial roster is accepted.
- Failed completion handoff: malformed judge output preserves actual text/reference, source packet, and worker evidence; reports the correct failure reason; exposes `calls: 0` with no scoring reference/input; and creates no journal write. Also verify explicit historical mode retains legacy score-table behavior.
The writer-handoff tests supplied exercise frozen writer completion, command evidence, and review-target stability (lines 34–137), not judge parsing or failed judge completion. Their fixture and the omitted runtime dependencies are not available in the packet, so integration-test setup and exact persistence assertions remain uncertain.
Primary judge's stated reason
A offers a slightly more determinate canonical-envelope acceptance rule and corresponding test, reducing interpretation needed during the patch. This is a forced weak preference between substantially equivalent plans, not an established material quality gap; an independent review could reasonably prefer B's historical-boundary clarity.
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_3beebde07e55768fed910f4b30a2d7f9bc0292a7f0ce3b739c99a6153ef382c6. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.