← Model losses

Head-to-head comparison

openai / gpt-6.1-sol / low / low effort preferred over xai / grok-4.7-efficient / 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

Audit [REDACTED: private project name]'s lazy-video saved-position restore and editor-return seek lifecycle. Trace cold resume, target outside new native duration, metadata/seek stalls, unmount/inspection switch, and editor cancellation; identify only reproducible correctness defects, specify the smallest safe implementation and 0-3 targeted regression tests, preserving server watched-proof/certification boundaries.

openai / gpt-6.1-sol / low / low effort answer

## Findings

Independent, read-only assessment of the supplied snapshot.

### 1. Impossible bookmarks repeatedly seek an unreachable position
**Confidence: high.** `useReviewResumePlayback.ts:55–60` checks native duration but never reconciles it with the requested target.

Reproduction: begin at `900`; metadata subsequently reports duration `600`; native seeking clamps to `600`. Each settled poll requests `900` again until the 15-second timeout. The request then remains pending, with its original target, and cannot complete (`:50–54`). This is particularly relevant when a saved bookmark belongs to an older, longer video.

**Smallest safe fix:** once valid metadata exists, explicitly handle `targetS > video.duration`. Fail closed immediately with an actionable notice, pause, and stop retrying that impossible seek. Retain the pending hold if it protects scanner ownership; allow explicit retry/cancellation. Do not silently resume at a different position without a defined product policy. If endpoint clamping is intended, normalize the request target and require **both** native and React cursors to reach that normalized target.

### 2. `begin()` accepts invalid targets and can report successful restoration
**Confidence: high for the hook API; caller reachability outside this packet is unknown.**

`begin()` stores any number without validation (`:32–39`). With `NaN`, both distance comparisons evaluate false (`:58,63`); with valid metadata, `seeking === false`, and `canResume() === true`, the hook calls `onReady()` despite no meaningful target being restored.

**Smallest safe fix:** reject nonfinite or negative targets before setting pending state or invoking preparation/seeking. The editor-return hook already performs this validation (`useReviewReturnSeek.ts:32–33`), but other callers are not shown.

## Lifecycle conclusions—not additional defects

- **Cold resume:** metadata, settled native seek, React cursor, and `canResume()` are all required before ownership transfers. The existing test covers this.
- **Metadata/seek stalls:** after 15 seconds, playback is paused and restoration stays held with a retry notice. This is explicitly tested behavior, not evidence of unintended failure.
- **Unmount/inspection switch:** interval cleanup clears the request and pending flag (`:69–70`); notice handling prevents A→B→A resurrection.
- **Editor cancellation:** the next poll pauses and cancels before readiness checks (`:48`). Existing coverage confirms no later playback revival. Immediate cancellation between polls is not established as necessary by this snapshot.
- **Editor-return consumption:** marking the key before navigation/state updates prevents repeated consumption during deferred router commits. A subsequent parameter-free render permits a genuine same-bookmark return.

## Targeted regression tests—3 maximum

1. Bookmark exceeds newly loaded duration: assert the chosen fail-closed policy, no repeated impossible seeks, and no `onReady()`.
2. Parameterized `begin(NaN)`, `begin(Infinity)`, and `begin(-1)`: assert no preparation, seek, or readiness callback.
3. Unmount while seeking, then advance timers: assert no further seeks or readiness callback.

These fixes should affect only positioning and ownership. A restored or clamped cursor must never manufacture watched coverage or certification eligibility.

**Uncertainty:** `coverageRecovery` and implementations of `seek`, `canResume`, and `onReady` are outside the packet. Recovery-parameter parsing, native seek behavior in the application, and server watched-proof enforcement cannot be verified here.

**Next action:** establish the out-of-duration policy, then implement target validation and the two core regression cases above.

xai / grok-4.7-efficient / high / high effort answer

The cold-resume hold, the inspection-switch cleanup, and the unmount cleanup are correct. Two defects in the resume poller are reproducible, and one in the return-seek consumption is reproducible. The success gate must stay unchanged so a clamped or unmatched position cannot certify a watched resume.

## Defects

**1. A bookmark outside the current native duration seek-livelocks.** High confidence. In `useReviewResumePlayback.ts:55-60`, once `readyState >= 1` and `duration` is finite, any `|currentTime - target| > 0.1` calls `seek(target)` again. The media element clamps `currentTime` to `duration` and then clears `seeking`. If `target > duration + 0.1`, the difference never closes, so the poller seeks every 100 ms until the 15-second watchdog. That storm can interrupt lazy duration growth. `onReady` is not called, which is the right certification outcome, but only because the mismatch never clears.

**2. The 15-second failure is not terminal.** High confidence. `useReviewResumePlayback.ts:50-53` pauses and calls `setMessage`, then returns without clearing or flagging the request. `setMessage` always does `setNotice({...})` with a new object (`useReviewResumePlayback.ts:24-26`), so every later tick re-renders and calls `pause()` again for the rest of the inspection. The existing timeout test requires `pendingRef` to stay true and `onReady` not to run. Those must be preserved. What is wrong is the non-idempotent pause and notice rewrite, including after an unreachable target finally times out.

**3. A lingering return token is applied again when `inspectionId` changes.** Medium-high confidence. `useReviewReturnSeek.ts:21-34` consumes `` `${inspectionId}:${pendingSeekS}:${resume}` ``. The file’s own comment says the old route can still render after `setSearchParams`. An inspection switch in that window produces a new key, so `beginResume` runs for the new inspection at the previous bookmark. That can start a certified resume on the wrong asset. The same-inspection re-render guard does not cover this.

Editor cancellation after a resume has already started is correct: `shouldCancel` is checked before `onReady`, and the existing test holds. Two adjacent holes should be closed in the same patch, not treated as separate lifecycle bugs. `begin` (`useReviewResumePlayback.ts:32-39`) does not consult `shouldCancel`, and the cancel branch at line 48 pauses media the editor now owns.

## Smallest safe implementation

Keep the initial `begin()` seek. Do not treat a clamped time as success. Do not call `onReady` unless both cursors are within 0.1 seconds of the original finite target, `canResume()` is true, and `shouldCancel` is false. Do not clear `pendingRef` on failure.

In `begin`, return immediately when `shouldCancel()` is true, or when `targetS` is non-finite or negative. Do not arm, pause, prepare, or seek. Store `failed: false` on the request.

In the interval:

- On `shouldCancel`, call `cancel()` only. Do not pause.
- On timeout, if `failed` is not already set, pause once, set the existing failure string once, and set `failed`. Then return. Leave `pendingRef` true and do not call `onReady`.
- After `readyState >= 1`, if `duration` is finite and `target > duration + 0.1`, return without seeking and without `onReady`. A later larger duration can still complete through the existing success path. If `duration` is not yet finite, keep waiting as today.
- Leave the success block at `useReviewResumePlayback.ts:62-67` unchanged.

In `useReviewReturnSeek.ts:21`, consume `` `${pendingSeekS}:${resume}` `` only. Still clear `consumedRef` when `seek_s` is empty, so a later real edit of the same bookmark works.

## Regression tests

Add these three tests next to the existing ones. Do not change the current assertions.

1. **Outside duration, then growth.** `begin(900)` with `duration` 100, `readyState` 2, and `currentTime` 100. Advance several ticks. `seek` must not be called again, and `onReady` must not run. Then set `duration` to 1600 and advance one tick. `seek(900)` must run once. After native and React times match, `onReady` runs once. This proves a clamped playhead is not certified and a provisional short duration can still recover.
2. **Timeout is idempotent.** With no metadata, advance past 15 seconds. The failure notice appears, `pendingRef` stays true, and `onReady` does not run. Advance another second. `pause` call count and the notice string must stay unchanged. `pendingRef` must stay true.
3. **Lingering token, other inspection.** Render the guided-return harness with `seek_s` and `resume_scan=1`, then render again with another `inspectionId` and the same params. `prepareVideo` and `begin`/`seek` must run only for the first inspection. Clearing the params and returning the same token later must still run a second time.

## Discarded

- The cold-resume dual cursor hold, the re-seek when a competing zone moves an in-range playhead, the unmount interval cleanup, and the A-to-B-to-A notice drop all match the tests. No change is needed.
- Clearing the request in the interval effect setup is required on inspection change and does not wipe `begin()` in production effect order. A Strict Mode double-invoke can drop an already-consumed resume in development only. That is not a production defect.
- Updating `latest` in an effect is safe for this composition: the resume hook is declared first, so `begin()` sees the current options.
- A `NaN` target would skip both `>` checks and reach `onReady`. The return-seek caller already rejects non-finite times. The `begin` guard above closes the public entry without a separate scenario.
- Clamping and then calling `onReady` would violate watched-proof and certification. It was rejected.
- Clearing `pendingRef` on timeout would contradict the existing hold-visibly test and could release the scanner. It was rejected.
- The non-resume `seek(time)` path ignores `ready`. Whether that drops the seek depends on the injected `seek`, which is not in the packet.

## Missing evidence

`coverageRecovery.js` is outside the packet. If `parseCoverageRecoveryParams` stays non-null while `seek_s` is present, the return effect never consumes that token. Do not change that deferral until that helper is read. The parent that honors `pendingRef` and `onReady` is also outside the packet, so this patch must keep failure as pending, not ready.

## Next action

Patch only those two hooks as above, add the three tests, and re-run the existing resume and return-seek tests. Do not certify a position the native and React cursors did not both reach.

Primary judge's stated reason

A earns a weak, forced preference for more reliably separating demonstrated positioning defects from unverified application and certification consequences, reducing the risk of an unnecessary return-token policy change. B offers useful additional timeout analysis and a duration-growth alternative. The tradeoff does not establish a material overall quality gap; an independent review could reasonably prefer B.

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

Battle wave: e8b943ba-5475-4c9f-82d2-c82f9157debd. Pair: brp1_5e81ed114e0a56c13a4b08b081628d072981e1fd2236d771db7d54d794259607. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.