← Model losses

Head-to-head comparison

openai / gpt-6.1-sol / low / low effort preferred over xai / grok-4.7-efficient / 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] QA/QC flag review and correction flow for data-loss, stale-state, and invalid-transition defects across queue selection, edit/save, and refresh. Report only defects demonstrable from supplied code, with exact trigger and state transition, smallest safe fix, and targeted regression scenarios.

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

## Findings

Independent, read-only analysis of the supplied snapshot.

### 1. In-progress QA reviews have no completion-refresh mechanism
**Evidence:** `[REDACTED: private project name]/frontend/src/api/qaReview.ts:39–47,57–59`; `[REDACTED: private project name]/frontend/src/components/qa-review/QAReviewPanel.tsx:66–75`.

- **Trigger / transition:** A GET returns `pending` or `running`. The server subsequently completes the review while the page remains mounted.
- **Defect:** The query has no polling, and the in-progress panel provides no refresh action. Trigger success invalidates only once; if that fetch still returns `running`, completion does not itself cause another fetch. The panel can remain on “in progress” until an unrelated refetch occurs.
- **Smallest safe fix:** Poll only while the cached review is `pending` or `running`; stop on terminal status.
- **Regression:** Return `pending → running → completed` across successive GETs without focus changes or remounting. Verify completed results appear and polling stops. Repeat with `failed`.
- **Confidence:** High. External query-client defaults could mitigate this; they are outside the packet.

### 2. Queue filter/page changes preserve an out-of-scope inspection and editor focus
**Evidence:** `[REDACTED: private project name]/frontend/src/pages/QAQCPage.tsx:59–61,69–70,205–218,222–237`.

- **Trigger / transition:** Select inspection A and open one of its errors. Change status or page to a queue that excludes A.
- **Defect:** Only URL parameters change. `selectedInspectionId` and `focusedField` remain A, so validation and editor props continue targeting A despite the newly displayed queue. Project/system URL changes have the same state-retention problem.
- **Smallest safe fix:** On queue-scope changes, explicitly clear selection, error index, focus, and focus URL parameters—or deliberately reconcile selection against the newly loaded queue. Coordinate clearing with any dirty-editor confirmation.
- **Regression:** Select/open A, then change each queue scope parameter. Verify no old inspection remains silently actionable when excluded.
- **Confidence:** High for stale parent state. Whether changing focus discards unsaved edits depends on the unprovided editor.

### 3. Validation refresh does not reconcile the focused error
**Evidence:** `[REDACTED: private project name]/frontend/src/pages/QAQCPage.tsx:73,82–92,115–119,234–235`.

- **Trigger / transition:** Open error E, then receive refreshed validation results that remove or replace E.
- **Defect:** The effect only bounds `selectedErrorIdx`. `focusedField` and its URL parameters still identify E. If errors shrink, the highlighted index can now identify a different error while the editor continues receiving E’s target; with zero errors, the obsolete target remains.
- **Smallest safe fix:** Reconcile focus by stable error identity after validation changes. Clear obsolete focus and URL parameters; do not automatically switch a dirty editor to another error.
- **Regression:** Open the last error, refresh with fewer errors; also refresh with zero errors and with an equal-length replacement list. Verify obsolete focus is cleared or explicitly retained as an acknowledged editing target.
- **Confidence:** High for inconsistent parent state; actual editor behavior is outside the packet.

### 4. Dismissing every flag is presented as passing QA
**Evidence:** `[REDACTED: private project name]/frontend/src/components/qa-review/QAReviewPanel.tsx:15–21,83,142–145`.

- **Trigger / transition:** A completed review contains flags, including RED flags. After dismissal/refetch, every flag ID appears in `dismissed_flags`, while the review retains its original health band.
- **Defect:** `activeFlags.length` becomes zero, causing “No issues found. This inspection passed QA.” This conflates dismissal with absence of findings and can contradict the displayed RED health badge.
- **Smallest safe fix:** Distinguish “no flags found” from “all flags dismissed.” Do not infer a passing result from the active-flag count.
- **Regression:** Test a completed RED review with every flag dismissed, a partially dismissed review, and a genuinely flag-free completed review.
- **Confidence:** High.

## Evidence limits and next action

No save implementation is supplied. **Actual unsaved-edit loss, save races, backend transition acceptance, and correction-cache invalidation cannot be established** from this packet. `QaQcEditPanel`, `api/qaqc`, `FlagCard`, and query-client configuration are outside the evidence.

Likewise, concurrent rerun/dismiss actions are visible, but backend semantics are needed before claiming they corrupt data.

Next useful action: add the targeted parent-state and review-refresh regressions above, then examine the editor’s dirty-state/save contract before implementing selection or focus clearing.

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

The supplied files contain six demonstrable defects. The edit/save persistence and query invalidation inside `useRevalidate`, `useQaqcQueue`, and `useInspectionValidation` are outside the packet, so those paths are not treated as proven.

## Defects

1. **QA review `pending`/`running` is a sink (stale state).**  
   Trigger: `useQAReview` returns `status: 'pending' | 'running'`, including after `useTriggerQAReview` succeeds and invalidates once (`qaReview.ts` 57–59).  
   Transition: any review → `QAReviewPanel.tsx` 67–75 spinner. That branch has no poll, no error, and no re-run control. Nothing in these files schedules another fetch.  
   Fix: while status is `pending` or `running`, set `refetchInterval` (about 2s) and a timeout/failure exit that restores re-run. Do not early-return without a refresh path.  
   Regression: POST/GET returns `running`, then a later GET returns `completed` with flags; UI must leave the spinner without a remount. A still-`running` result after the timeout must show failure + re-run, not spin forever.

2. **Initial QA fetch failure is shown as “no review” (invalid transition).**  
   Trigger: `useQAReview` errors (`isLoading === false`, `data` undefined). `isError` is never read (`QAReviewPanel.tsx` 32–41).  
   Transition: fetch error → “No QA review has been run” + Run.  
   Fix: if `isError`, render the error and retry; only the success-null case may show “no review”.  
   Regression: 404/null still shows Run; 500 does not, and Run is not offered as if no review exists.

3. **Failed QA run is rendered as a normal completed review.**  
   Trigger: `review.status === 'failed'` after the `pending`/`running` check (`QAReviewPanel.tsx` 78–146).  
   Transition: `failed` → health badge, summary, and flags, with no failed banner. Empty flags do not show the pass line (that requires `completed`), but the layout is still the success layout.  
   Fix: explicit `failed` branch with the server summary and re-run; do not render health/flags as a finished pass.  
   Regression: `failed` with leftover flags must not look like a completed review; `completed` + no active flags still shows the pass line.

4. **Keyboard revalidate allows overlapping runs (invalid transition).**  
   Trigger: `r` calls `runRevalidate` (`QAQCPage.tsx` 106–109, 164–166) with a new `crypto.randomUUID()` and no `revalidate.isPending` check. The pending flag is only passed to the child button (230).  
   Transition: in-flight revalidate → second mutate for the same inspection, different idempotency key. Completion order is unconstrained here.  
   Fix: return immediately in `runRevalidate` when `selectedInspectionId === null` or `revalidate.isPending`.  
   Regression: double `r` and button + `r` send one request; a new `r` after settle sends one new request.

5. **Error index survives a same-length validation refresh (stale selection).**  
   Trigger: `errors` is replaced (revalidate/refetch) with the same length. The only resync is the shrink clamp (`QAQCPage.tsx` 115–119). `Enter` then uses that index (`88–92`, `161–163`).  
   Transition: selected error A at index i → list replaced, index i still selected → `Enter` focuses a different error.  
   Fix: when the validation result identity changes (`dataUpdatedAt` or an error-id fingerprint), reset `selectedErrorIdx` to 0 and clear `focusedField` unless the focused error id is still present.  
   Regression: length shrink still clamps; same-length reorder does not `Enter` into the old index’s new row; switching inspection still starts at 0.

6. **Refresh drops the correction position; `n` / `gg` do not move through the queue (data-loss + invalid transition).**  
   Trigger A: open an error (`applyFocusedParams` writes `tab`/`obs`/`focus` only, `QAQCPage.tsx` 36–48), then reload. Init state is `selectedInspectionId === null` and `focusedField === null` (59–61). No effect reads those params, and inspection id is never written.  
   Transition A: focused correction → refresh → empty error list and editor.  
   Trigger B: `n` uses only `queueQuery.data.items` and `items[currentIdx + 1] ?? items[0]` (94–98). Missing id (`findIndex === -1`) or last row selects `items[0]` on this page. `gg` selects `items[0]` of the current page (101–104), not page 1.  
   Transition B: last row or page > 1 → first row of the same page, not the next unresolved inspection or the top of the queue.  
   Fix: persist `inspection_id` in the query string; hydrate selection and focus from the URL when the queue/validation data contains that id. For `n`, if the current id is last or absent, request the next page instead of wrapping; for `gg`, set `page=1` and select the first item of that result.  
   Regression: reload restores the same inspection and field; `n` on the last row of page 1 loads page 2 rather than row 0; `gg` on page 3 lands on page 1 row 0.

## Discarded

- The default React Query behavior does not prove that the validation `data` from inspection A is shown after selecting B. These files never check `data.inspection_id === selectedInspectionId`, but the mismatch is not established without `qaqc.js`.
- Unsaved editor loss on `selectInspection` is not established; `QaQcEditPanel` is outside the packet. The page does clear `focusedField` with no dirty check.
- Flag-id reuse across QA runs hiding new flags is not established; only client filtering is visible (`QAReviewPanel.tsx` 15–19).
- Dismiss/trigger `onSuccess` invalidates the mutated `inspectionId`, not a stale prop. That part is correct.

## Missing evidence

`client.js`, `qaqc.js`, `QaQcEditPanel`, `QaQcErrorList`, `QaQcQueueList`, and `FlagCard` are outside the packet. Whether revalidate or dismiss actually refreshes server state, and whether the editor saves, cannot be judged here. The defects above are client state-machine bugs visible without those files.

## Next action

Add regression tests for the six transitions above, then apply the four local guards: poll/exit for `pending`/`running`, separate `isError` and `failed`, single-flight `runRevalidate`, and URL hydration plus non-wrapping `n`/`gg`.

Primary judge's stated reason

B receives a weak preference for more conservative fixes and stronger separation of observable parent-state defects from unproven downstream consequences. Its dismissal finding also provides a concrete correction to misleading QA status. A offers useful additional error-state coverage, so this is not an established material quality gap; an independent review could reasonably prefer that coverage.

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

Battle wave: 73088e6c-242b-4408-960f-d09feaae160d. Pair: brp1_4f9c80d6d963c182bbbf511e1890066303449e591df2129a945d72066c3ebe02. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.