← Model losses

Head-to-head comparison

openai / gpt-6.1-sol / high / high 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 / high / high effort answer

## Findings

### 1. Saved targets beyond native duration can never finish restoring
**High confidence.** In `useReviewResumePlayback.ts:55–63`, native duration is checked for validity but never bounds `request.targetS`. For example, restoring `900` into a video whose duration is `600` repeatedly seeks to `900`; a browser-clamped cursor at `600` cannot satisfy either completion check. After 15 seconds, restoration remains pending with the failure notice (`50–53`). Retrying the same bookmark repeats the failure.

**Smallest safe fix:** Once valid metadata exists, bound the request target to native duration before comparing or seeking. Use that effective target consistently for native completion, React-cursor completion, and `getTarget()`. Keep `canResume()` gating intact. Clamping a navigation cursor must not create watched coverage or certification evidence.

### 2. Brief editor ownership does not cancel a pending resume
**High confidence.** Cancellation is checked only by the 100-ms interval (`48`). An editor can open and close in separate committed renders between ticks. `latest.current` then contains the closed-editor state, so the pending request survives and can subsequently call `onReady()`.

The existing cancellation test waits a full polling interval while editing (`useReviewResumePlayback.test.tsx:63–65`), so it misses this case.

**Smallest safe fix:** Also check cancellation in an effect after committed options update. When a same-inspection request exists and `shouldCancel()` is true, pause and cancel immediately. Retain the polling check as a backstop.

## Lifecycle assessment

- **Cold resume:** Correctly waits for valid metadata, native seek completion, the matching React cursor, and `canResume()` (`55–67`). The existing cold-resume test exercises these gates.
- **Metadata/seek stalls:** After 15 seconds, the hook pauses, shows a failure notice, and retains pending ownership. A fresh `begin()` resets the deadline. This is deliberate, fail-closed behavior—not independently a defect.
- **Unmount/inspection switch:** Cleanup clears the interval and request (`69`); inspection changes also reset pending state. Notice invalidation prevents A→B→A resurrection (`20–23`). No ordinary post-unmount playback defect is established.
- **Editor-return consumption:** Marking the key before navigation/playback (`useReviewReturnSeek.ts:21–35`) prevents repeated consumption while Router still renders the old parameters. The supplied test covers this.

### Conditional lifecycle issue: StrictMode effect replay
With React StrictMode’s initial effect replay, the return effect can consume the URL and start restoration; the playback effect’s cleanup then clears that request. On replay, `consumedRef` suppresses another start. The result is a “Returning…” notice with no pending request.

This is reproducible from these hooks under StrictMode, but the packet does **not** establish whether [REDACTED: private project name] enables it. If applicable, make playback effect re-setup rearm an interrupted same-inspection request without repeating URL consumption; preserve real unmount timer cancellation and inspection/editor cancellation.

## Targeted regressions — at most three

1. **Shortened video:** Bookmark exceeds duration; restoration uses the bounded target and calls `onReady()` only after both cursors match and `canResume()` permits it.
2. **Brief editor session:** Commit editor-open and editor-closed renders without advancing timers; subsequently satisfy both cursors and verify `onReady()` never fires.
3. **If StrictMode is supported:** Mount the integrated guided-return harness under StrictMode; verify restoration survives replay without duplicate URL consumption.

## Limits and next action

`coverageRecovery` is outside this packet, so recovery-parameter precedence cannot be validated. The implementations of `seek`, `onReady`, and server watched-proof/certification are also not supplied. Do not weaken those boundaries or treat restored position as watched evidence.

Next: implement the two confirmed fixes and their focused tests; validate StrictMode applicability before expanding the lifecycle change. Analysis was direct and limited to the supplied snapshot.

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

B receives a slight forced preference because its brief-editor-session finding directly addresses a requested lifecycle with a concrete missed interleaving, minimal fix, and targeted test. This is not an established material quality gap: A offers stronger timeout-idempotence analysis, while the appropriate out-of-duration policy remains uncertain. An independent review could reasonably reject this preference.

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