← Model losses

Head-to-head comparison

openai / gpt-6.1-sol / max / max effort preferred over openai / gpt-6-astra / medium / medium 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.1-sol / max / max effort answer

## Conclusion

**Modern parsing can silently accept duplicate, conflicting, or partially truncated envelopes.** Add a modern-only strict parser, retain historical parsing explicitly, and make validation failures non-executable without losing evidence.

Independent static review of the supplied frozen packet; no tests executed or files changed.

### Source-grounded findings

- **First envelope wins:** `handoff.js:32–39` selects the first opening marker and subsequent closing marker. The modern check at `138–141` verifies only that both marker strings occur somewhere. Additional envelopes or markers can therefore be ignored.
- **Modern roster completeness already exists:** `judge-contract.js:264–292` rejects missing, duplicate, and unknown aliases, missing bindings, malformed rows, and missing/object-invalid `evaluationSummary`. Preserve this enforcement; accepting a partial roster is not a solution.
- **Modern schema enforcement is conditional:** `handoff.js:142–144,186–242` permits the old route/numeric-quality branch whenever `schemaVersion !== JUDGE_SCHEMA_VERSION`, even without `historical:true`. Strict modern judgment should not silently enter that branch.
- **The compact failure receipt is only partly sufficient:** `handoff.js:391–398` provides `ready:false`, `calls:0`, and no scoring reference/input. However, it drops `scoring.reason`, unlike the successful branch. It also trusts any existing truthy `scoring.input` (`299,378`).
- **Evidence persistence is not established by compaction:** the compact result retains judge and worker references and packet digests (`264–294,358–367`), but not their full text or source bodies. Those must remain unchanged in durable run/diagnostic evidence.
- **Non-synthesized failures need separate coverage:** `handoff.js:298` returns them unchanged. A failed completion must not be relabeled “synthesized” merely to obtain the scoring failure receipt.

## Minimal patch plan

### 1. Add a strict modern envelope parser

Leave `markedScoreRows`, `scoreRecommendations`, and explicit historical parsing compatible. For `!historical`, use a new helper that:

1. Counts **all exact literal opening and closing markers** in the response.
2. Requires exactly one of each.
3. Requires the trimmed response to start with the opening marker and end with the closing marker.
4. Parses only that body with ordinary `JSON.parse`.
5. Requires an array, then applies existing binding and schema checks.

Whitespace and ordinary JSON formatting remain valid. Prose, code fences, extra markers, and literal marker strings inside JSON strings are rejected under this textual framing contract. Do not require sorted JSON keys or reconstruct JSON.

Use distinct diagnostic categories:

| Failure | Reason/code |
|---|---|
| Marker counts other than `1/1` | `JUDGE_ENVELOPE_CARDINALITY`, with actual counts |
| Reversed markers or content outside the envelope | `JUDGE_ENVELOPE_FRAMING` |
| Unique envelope, malformed JSON body | `JUDGE_JSON_SYNTAX`, retaining the actual parse error |
| Valid JSON, non-array body | `JUDGE_JSON_SHAPE` |
| Alias coverage or row-schema failure | Roster/schema failure, retaining the precise existing message |

A missing closing marker is a framing/cardinality failure—not proof that JSON parsing failed. Duplicate valid envelopes are cardinality failures—not JSON syntax failures.

### 2. Require explicit modern schema and bindings

For non-historical judgment, require `schemaVersion === JUDGE_SCHEMA_VERSION` and valid bindings. Do not fall through to lane spelling normalization or the legacy 1–5 quality branch.

Retain:

- Complete alias coverage.
- Identity/authority-field rejection.
- Required evaluation summary.
- Integer findings counts and provenance validation.
- Trusted metric-to-quality derivation.

The modern metric contract is exactly four integers, each `1–10`: `correctness`, `taskCoverage`, `evidentialSupport`, and `actionability`. `parseMetrics` is outside this packet; tests must establish its exact-key/type/range enforcement before assuming it satisfies that contract.

### 3. Make failure propagation atomic and evidence-preserving

At validation failure:

- Preserve actual judge execution state, text, result reference, and any original execution error.
- Preserve admitted source packets and all worker answers, references, and observed completion identities.
- Publish no scoring input, payload digest, or executable scoring reference.
- Publish `ready:false`, `calls:0`, the precise reason, and structured error details.
- Carry `scoring.reason` through `compactRootResult`’s failure branch.
- Reject reference-based scoring before any outcome/recorder-journal mutation.

Keep raw evidence in durable diagnostics; it need not all be duplicated in the compact receipt. Never substitute empty judge text, synthesis text, or a fabricated reference.

`admitScoreWrite` is **not** a validation gate: it admits a first write when no receipt exists (`judge-contract.js:245–255`). Malformed judgment must be rejected before reaching recording, not stored as `ScoreToolUnavailable`.

Do not retry failed FAST, substitute another judge, or rerun workers. A failed execution and a completed execution with invalid syntax are separate failure categories.

### 4. Clarify the prompt’s omission instruction

`judge-contract.js:108,219` tells an unverifiable judge to omit a contestant, while `226` requires every contestant. Clarify that inability to score safely makes scoring unavailable; omission never authorizes a partial scoring payload. Do not resolve this tension by fabricating metrics.

## Proposed regression tests — not executed

Let `S`/`E` denote the exact markers, `J` an otherwise valid complete modern roster, and `J′` another valid roster with different metrics.

| Response | Current parser prediction | Strict modern expectation |
|---|---|---|
| `S J E S J E` | Accepts first `J` | Cardinality: `2/2` |
| `S J E S J′ E` | Accepts first; ignores conflict | Cardinality: `2/2` |
| `S S J E E` | JSON syntax exception | Cardinality: `2/2` |
| `S J E S unfinished-body` | Accepts first `J` | Cardinality: `2/1` |
| `S J E E` | Accepts `J` | Cardinality: `1/2` |
| `E S J` | Modern binder receives `null`; array error | Framing/order failure |
| `S J` | Generic missing-markers error | Cardinality: `1/0` |
| `S malformed-json E` | JSON syntax exception | JSON syntax failure |
| `S {} E` | Array-required error | JSON shape failure |
| `prose S J E` | Accepts `J` | Framing failure |
| Whitespace + `S J E` + whitespace | Accepts | Accepts |

Also test:

- Missing, duplicate, and unknown aliases; absent/duplicate bindings.
- Null, primitive, and array-valued rows.
- Missing/null/array-valued `evaluationSummary`.
- Every missing metric; extra metric keys; strings, fractions, null, `0`, and `11`.
- Forbidden identity/authority fields.
- Modern missing/unsupported schema cannot enter legacy scoring.
- Explicit historical mode retains first-envelope selection and Markdown-table behavior.
- A modern own `judge` field—including `judge:null`—prevents synthesis-score fallback (`handoff.js:304–310`).

### Failed-completion handoff tests

Extend the fake-completion pattern in `writer-handoff.test.mjs:12–22`, without assuming undocumented helper options:

1. Inject each malformed response as the **actual judge completion**.
2. Save worker/source/judge evidence before collection.
3. Assert durable evidence remains byte-for-byte/reference-identical afterward.
4. Assert the compact failure receipt contains:
   ```js
   assert.equal(handoff.scoring.ready, false)
   assert.equal(handoff.scoring.calls, 0)
   assert.equal(handoff.scoring.reason, expectedReason)

   for (const key of ["reference", "input", "payloadDigest"]) {
     assert.equal(Object.hasOwn(handoff.scoring, key), false)
   }
   ```
5. Put valid legacy score markers in synthesis text and confirm they cannot rescue failed modern judgment.
6. Assert zero scoring invocations and unchanged outcome-journal contents.
7. Recollect/status-check the same terminal run and assert prompt counts remain unchanged—the existing tests use this technique at `95–99,117–120`.
8. Separately inject a failed FAST completion with its original error and any actual partial text. Preserve the true phase/state; do not retry, fabricate text, or misreport an execution failure as JSON syntax.

**Limits:** `native-run.js`, recording behavior, fake-helper completion controls, metric validation, and evaluation-summary processing are outside the packet. Their persistence, journal, and FAST guarantees remain unverified. No commit SHA or actual failed-completion transcript was supplied.

MATERIAL_EVIDENCE_CONFLICT: `judge-contract.js:108,219` instruct contestant omission when scoring cannot be verified; `judge-contract.js:226` requires every contestant, enforced by missing-alias rejection at `290–291`.

openai / gpt-6-astra / medium / medium effort answer

## Conclusion

**Modern scoring must validate the entire response before parsing any scores.** The current first-pair parser can silently accept conflicting or truncated extra envelopes. Preserve it only for explicitly historical parsing.

Direct, independent review of packet `sha256:1f6dfd09c82afe8048c1b64b81266e0bc1fe0bb1cb0009a0d2743b96cd56c9f4`; no edits or tests executed. No commit SHA was supplied, so commit identity is not independently established.

## Findings

1. **Envelope ambiguity is currently accepted — high confidence.**  
   `handoff.js:32–39` selects the first opening marker and following closing marker. The modern guard at `138–141` checks only marker presence.

   Let `S`/`E` denote the exact markers and `A`/`B` valid, complete score arrays:

   | Response | Current behavior |
   |---|---|
   | `S A E S A E` | Accepts first array; ignores duplicate |
   | `S A E S B E` | Accepts first array; ignores conflict |
   | `S A E S B` | Accepts first array; ignores truncated second envelope |
   | `E S A E` | Ignores orphan closing marker |
   | `S S A E E` | Attempts JSON parsing; ordinarily throws syntax error |
   | `S A` | Modern guard reports missing markers |
   | `E S A` | Presence guard passes; parser returns `null`, producing a downstream shape/iteration error rather than an envelope-order error |

   Acceptance assumes the selected array passes subsequent roster/schema validation. No score comparison can resolve these cases safely.

2. **Complete-roster enforcement largely already exists — high confidence.**  
   `judge-contract.js:264–292` rejects unknown, duplicate, and missing aliases and invalid summary containers. `handoff.js:145–153,184–209` rejects duplicate/unexpected/missing quality lanes and validates modern metrics. Retain these checks; do not weaken them to accept partial cohorts.

   Binding aliases are unique, but the binding-to-quality-lane bijection is not explicitly validated before processing rows. Modern aliases are also trimmed (`judge-contract.js:280`), permitting noncanonical identifiers.

3. **Failure handoff is partly protected but insufficiently precise — high confidence.**  
   A present `judge` field prevents synthesis fallback (`handoff.js:304–309`). Without scoring input, the compact receipt emits `calls: 0` and no executable `reference` (`391–398`). However:
   - It drops `scoring.reason` on this branch.
   - It exposes the judge reference/error, not actual judge text (`358–367`).
   - Any truthy existing `scoring.input` wins, even alongside a scoring error (`299–300,378`).

   The packet does **not** establish whether failed native completion preserves judge text/source packets, clears stale input, or prevents recorder/journal writes.

## Minimal patch plan

### `handoff.js`

Add a separate strict modern parser; leave `markedScoreRows` and explicitly historical behavior intact.

Validation order:

1. Scan the **whole response** for exact reserved markers.
2. Require exactly one opening and one closing marker. Return a stable envelope-cardinality error with observed counts for missing, duplicate, nested, or extra truncated envelopes.
3. Require opening-before-closing; return a distinct envelope-order error otherwise.
4. Require only whitespace outside the envelope, matching the existing “Return only” contract.
5. Parse the enclosed body once with `JSON.parse`. Classify an actual parse failure as JSON syntax.
6. Require an array, then run existing complete-roster/schema validation.

Do not balance delimiters, remove fences, select a preferred envelope, retry parsing another candidate, or repair JSON. Reserve literal marker strings even inside JSON strings; state that restriction in the prompt.

Use structured errors, for example:

```js
{
  name: "JudgeResponseValidationError",
  code: "JUDGE_ENVELOPE_CARDINALITY",
  stage: "envelope",
  message: "Expected one opening and one closing score marker.",
  details: { openingCount: 2, closingCount: 1 }
}
```

Keep distinct codes for envelope order, exterior content, JSON syntax, array/schema shape, and alias-roster mismatch. A syntactically valid partial roster is **not** JSON syntax failure.

For malformed judgments, the stored and compact scoring receipt must have:

```js
{
  ready: false,
  operation: "record_agent_outcomes",
  calls: 0,
  reason: "judge-response-invalid",
  error: /* structured validation error */
}
```

Omit executable `input`, `reference`, and payload digest. Preserve the observed judge reference separately—it is evidence, not scoring authorization. Ensure validation failure cannot expose stale scoring input.

### `judge-contract.js`

- Clarify: exactly one envelope, no exterior commentary/fences, no literal reserved markers in payload strings.
- Require exact alias strings without normalization for modern rows.
- Validate binding alias/lane uniqueness and correspondence to the complete quality-eligible cohort.
- Retain existing metrics, summary, provenance, and forbidden-field checks. Verify that `parseMetrics` enforces precisely the four required integer metrics, each `1–10`; its implementation is outside this packet.
- Clarify the omission instructions at `108,219`: inability to score responsibly makes the **whole scoring batch unavailable**. Never fabricate missing scores to satisfy the roster.

### Failed-completion persistence boundary

The necessary native completion changes cannot be located from this packet. At that boundary:

- Save actual judge text and its observed reference unchanged, including malformed text.
- Preserve source packet/digest, alias bindings, worker evidence/results, and observed completion identities.
- Save the validation error without generating executable scoring authorization.
- Make no scoring-tool call or scoring-journal write.
- Do not retry failed FAST or rerun workers/judges.

`admitScoreWrite` (`judge-contract.js:245–255`) controls write admission/idempotence; it does not prove malformed judgments never reach the recorder.

## Tests to add, without executing them

### Parser and contract tests

Use complete valid modern fixtures so envelope failures cannot be masked by unrelated schema errors.

- One canonical envelope succeeds.
- Identical duplicate, conflicting duplicate, valid-first/truncated-second, nested, orphan-closing, missing-opening, and missing-closing cases fail with exact cardinality diagnostics.
- One reversed marker pair fails with an order error.
- One properly bounded malformed JSON body fails with JSON-syntax error.
- A truncated JSON array with both markers fails syntax; a missing closing marker fails envelope cardinality.
- Exterior prose/fences fail exterior-content validation.
- Non-array JSON fails shape validation.
- Missing, duplicate, unknown, or whitespace-modified aliases fail roster/schema validation.
- Invalid binding roster fails independently.
- Missing metrics, fractional/string/out-of-range metrics, missing summary, and forbidden score/identity fields fail without producing input.
- Explicit historical Markdown and historical first-pair behavior remain unchanged; modern Markdown-only responses fail.

Characterization assertions should demonstrate that the current parser accepts first-valid duplicate/conflicting/truncated-tail examples; replacement assertions should require rejection.

### Failed completion and handoff tests

Extend the frozen-writer review flow established in `writer-handoff.test.mjs:34–58`, injecting malformed judge completion through the test harness:

- Assert exact judge text/ref, source packet, frozen review target, and worker evidence survive collection and reload.
- Assert structured failure reason survives `compactRootResult`.
- Assert `calls === 0`, `ready === false`, and no scoring input/reference/digest.
- Include valid score markers in synthesis to prove no fallback.
- Include stale scoring input alongside validation failure to prove fail-closed handoff.
- Assert no recorder call and no scoring-journal mutation.
- Collect/status again and assert worker/judge prompt counts remain unchanged, following the no-replay assertion pattern at `84–100,102–121`.
- Add failed FAST coverage preserving the actual observed error and evidence, with no retry.

**Uncertainty:** native completion, recorder/journal, fake-session injection, metric parsing, and evaluation-summary validation implementations are outside the supplied packet. These integration assertions are required acceptance criteria, not verified current behavior.

Primary judge's stated reason

A receives a slight forced preference because its explicit schema gate makes the requested modern-versus-historical boundary more directly implementable. The answers are otherwise near-equivalent, and this is not an established material quality gap. An independent review could reasonably favor B's more explicit binding and stale-input tests.

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_22b1333341fd3e76c7cc550c174921f6bb9e5ad0f7e4502f41ac4e8d05af2f1f. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.