openai / gpt-6-astra / medium / medium effort preferred over openai / gpt-6-luna / max / max 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-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.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.
Primary judge's stated reason
B receives a slight forced preference because its concrete current-parser examples and failure-handoff assertions make the requested regression work easier to implement accurately. This is not an established material quality gap: both designs address the core failure, and an independent review could reasonably favor A's smaller scope.
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_234634bc2b110ad4ff955d448794122c0cf89b606a84457ef606137c775dd9dd. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.