xai / grok-4.7-efficient / high / high 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
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.
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.openai / gpt-6-luna / low / low effort answer
## Finding
**Reproducible defect:** a saved target beyond the newly loaded video’s native duration can leave resume pending forever. In `useReviewResumePlayback.ts:55–63`, once metadata is valid, the hook repeatedly seeks to the original target when the video’s current time differs, and only completes when native and React times both match it. There is no check that `targetS` is within `video.duration`, nor a timeout outcome that clears the request; after 15 seconds it only pauses and displays a message (`:50–53`). If the browser clamps or rejects the seek, the request remains pending and `onReady` never fires. **Smallest safe fix:** validate the target against the loaded duration and settle to a defined safe position (or cancel with a retryable failure) instead of repeatedly seeking an unreachable target. Do not call `onReady` unless the existing native-time, React-cursor, and `canResume()` gates pass (`:62–67`).
**Other requested lifecycle cases:**
- **Cold resume:** the supplied test exercises native seek plus React cursor gating and shows readiness waits for both (`useReviewResumePlayback.test.tsx:23–46`).
- **Metadata/seek stalls:** missing metadata remains visibly pending after 15 seconds by design, and inspection change cancels it (`test:48–58`). A seek stall is not independently tested; the duration-out-of-range case is the concrete liveness defect identified above.
- **Unmount/inspection switch:** the effect cleanup clears the interval and request (`useReviewResumePlayback.ts:41–45, 69–70`); inspection changes also clear old notices rather than reviving them (`:19–23`; test:74–86). No reproducible defect shown.
- **Editor cancellation:** `shouldCancel` pauses and cancels pending resume (`:47–48`); the test verifies editing prevents later readiness (`test:60–72`). No reproducible defect shown.
- **Editor return seek:** consumed parameters are marked before navigation and resume work, preventing repeat consumption while the old route remains rendered (`useReviewReturnSeek.ts:23–35`; test:88–110). The imported coverage-recovery parser is outside the packet, so behavior for its exclusion cannot be independently assessed.
## Tests
Add one targeted regression test: load metadata with a finite duration shorter than the saved target, simulate native clamping/rejection, advance timers beyond the retry window, and assert the hook settles safely or exposes a retryable failure without repeatedly seeking or calling `onReady` for an unachieved target.
No server watched-proof or certification behavior is evidenced in this snapshot; preserve the current client-side readiness gates and do not infer or alter server proof semantics. **Confidence: medium-high** for the out-of-range liveness defect; lower for return-seek interactions dependent on omitted code.
Primary judge's stated reason
A receives a weak, forced preference for a more implementation-ready duration/timeout repair and targeted assertions that preserve the existing hold contract. This is not an established material quality gap: B's stronger evidentiary restraint is substantial counterevidence, and an independent review could reasonably reject the tradeoff.
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_a1923c7ebaf371f059b3d3e266a0e969443571f0488a241fee85e9b3de755831. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.