← Model losses

Head-to-head comparison

openai / gpt-6-astra / max / max 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 runtime compatibility and error containment for persisted dashboard layouts after the shared parseLayout envelope guard. Trace accepted-but-malformed nested title, config/localFilters, and query payloads, plus finite but grid-invalid positions, through DashboardPage and its grid/per-widget boundary and through DashboardBuilderPage, BuilderCanvas, WidgetRenderer, and WidgetConfigEditor/DataSourcePicker. Check how unknown or legacy custom widget types and extra fields behave. Determine whether the dashboard Reset to default and builder Start fresh recovery flows change only selection/draft state or can overwrite persisted layouts. Report only source-proven crashes, misleading recovery behavior, or destructive overwrite paths, with exact file/line evidence and the smallest safe mitigation. Do not claim that database records are malformed, do not broaden the parser contract or reject custom types without proof, and state clearly if no remaining defect is established.

openai / gpt-6-astra / max / max effort answer

## Conclusion

Independent source-only review: **remaining defects are established**, including uncontained builder failures, lossy saves, and misleading recovery. These are conditional input paths—not claims about existing database records.

Paths below are relative to `[REDACTED: private project name]/frontend/src/`.

## Established findings

### 1. Accepted nested payloads can crash the builder

`lib/parseLayout.ts:21–27` validates only the widget envelope and finite coordinates.

- **Object-valued title:** `{ title: { text: "T" } }` passes parsing but becomes an invalid React child in `components/dashboard/BuilderCanvas.tsx:138–143` and `WidgetRenderer.tsx:119–121`.
- **Non-array metrics:** `WidgetConfigEditor.tsx:32–34` preserves an object-valued `query.metrics` and passes it through at `108–116`. Once a matching dataset with available metrics loads, `DataSourcePicker.tsx:64–78` calls `metrics.includes`, causing a render exception. String-valued metrics can instead fail on the checkbox’s `metrics.filter` event path.

The builder mounts these components without a local error boundary (`pages/DashboardBuilderPage.tsx:485–505`). Successful parsing clears `layoutError` (`65–71`, `138–144`), so these failures do not activate **Start fresh**.

**Smallest safe mitigation:** guard title rendering and editor array operations locally, preserving the original payload and showing a widget/editor-level error. A builder boundary should cover both the tile header and preview; an editor boundary alone cannot contain event-handler errors.

### 2. Builder saves can discard existing payload fields

There are explicit lossy-update paths:

- `WidgetConfigEditor.tsx:37–45` rebuilds `query` using only dataset, metrics, dimensions, and fixed pagination. Even a title-only edit drops existing `sort`, `filters`, `time_range`, and custom query fields, and resets `limit`/`offset`.
- The same code preserves ordinary object-config keys through spreading, but does not preserve accepted scalar configs: a string becomes indexed properties; numeric/boolean values disappear into the new object.
- `BuilderCanvas.tsx:58–63` replaces `position` with only `{x,y,w,h}` whenever its layout callback supplies a matching item, dropping position extensions.

`DashboardBuilderPage.tsx:121–124` installs those replacements. A subsequent Save serializes them and takes the existing-config update branch (`168–181`), which submits `PUT /dashboards/{id}` (`api/dashboards.ts:100–105`).

**Smallest safe mitigation:** preserve unedited query/config payloads, merge supported edits into existing objects, apply pagination defaults only to new queries, and merge coordinates into the original position object.

### 3. Dashboard “Reset to default” can leave the same failure selected

The action only calls:

```ts
updatePrefs.mutate({ default_dashboard_id: null })
```

at `pages/DashboardPage.tsx:427–433`.

It cannot resolve either source-selection case:

- An explicit dashboard URL continues to win (`145–152`).
- A failing saved persona clone continues to win over the persona pack (`170–185`), including when clearing the default merely falls back to that same clone.

The description nevertheless promises “Reset to default to recover” (`419–424`).

**Smallest safe mitigation:** make recovery source-aware: leave an explicit URL selection and provide a fallback that bypasses the failing persona clone. The recovery should select another source without rewriting its saved layout.

### 4. Dashboard failure state can survive corrected inputs

Two independent state-lifetime issues are visible:

- **Sticky widget boundary:** `WidgetErrorBoundary` sets `hasError` permanently and has no reset mechanism (`DashboardPage.tsx:47–81`). Grid children are keyed only by widget ID (`533–537`, `565–574`). Replacing a failed widget with a valid payload under the same ID in a retained grid instance therefore continues showing “Widget failed to render.”  
  **Mitigation:** reset the boundary when dashboard/layout identity or the widget revision changes.

- **Stale URL resolution:** `resolvedDashboard` reads `urlConfigId` (`145–146`) but omits it from its memo dependencies (`191`). In a retained page instance, a URL-only change can update `activeConfig` (`119–130`) while retaining the previous widgets or parse error.  
  **Mitigation:** include `urlConfigId` in the dependency array. Whether particular route transitions remount the page is outside this packet.

### 5. Builder “Start fresh” has misleading destructive wording

The confirmation says “This will discard your saved layout” (`DashboardBuilderPage.tsx:432–435`), but `startNew` changes draft/UI state and clears `configId` (`154–166`). A subsequent Save takes the create branch (`177–181`; `api/dashboards.ts:87–93`).

**No persisted-layout overwrite is established for Start fresh.** Likewise, the dashboard Reset handler submits only a preference change.

**Smallest safe mitigation:** change the builder confirmation to accurately describe starting a new draft.

## Containment and compatibility findings

- **Dashboard nested failures are contained per widget.** Object titles reach `WidgetCard.tsx:179`. With a truthy query, non-iterable `config.localFilters` throws during spreading (`40–46`); non-iterable query filter conditions throw when additional conditions are merged (`48–56`). These operations are inside the dashboard’s widget boundaries (`DashboardPage.tsx:535–537`, `572–574`), outside the grid’s positioning calculations.

- **Malformed queries are not uniformly crashes.** `api/dashboardData.ts:55–62` forwards the effective query; request errors have a “Failed to load data” surface (`WidgetCard.tsx:192–196`). If nonempty results exist, additional metric assumptions can throw (`285–306`, `317–319`); malformed dimensions can reach `humanize` (`15–16`, `103–105`). Those failures remain inside the widget boundary. Server acceptance of such queries is not established.

- **Unknown/custom types are intentionally retained.** The parser preserves them and extra fields (`parseLayout.test.ts:41–49`); `WidgetRenderer.tsx:102–103,317–321` supplies a placeholder. The canvas allowlist restricts external drops (`BuilderCanvas.tsx:69–74`), not loaded layouts. The editor omits unknown types from its options, but retains the original type state unless changed (`WidgetConfigEditor.tsx:31,37–40,48,95–103`). No automatic custom-type replacement is proven.

- **Finite grid-invalid positions do not establish a crash here.** Dashboard positioning performs numeric calculations and constructs CSS (`DashboardPage.tsx:514–570`). Builder coordinates enter React Grid Layout directly (`BuilderCanvas.tsx:40–52,98–118`). Its normalization/throw behavior is outside the packet; neither a grid crash nor automatic persisted-coordinate corruption should be asserted.

Imported widget implementations, filter hooks, server behavior, and grid internals limit further conclusions. The draft tests mock the real canvas/editor (`__tests__/DashboardBuilderDraft.test.tsx:24–25`), so they do not disprove the consumer failures above.

**Next useful action:** add focused regressions for these concrete consumer, field-preservation, and recovery paths, then apply the local fixes without expanding the parser’s envelope contract.

openai / gpt-6-luna / max / max effort answer

**Direct, read-only source analysis:** remaining crashes and data-loss paths are established. No database contents are inferred.

### Findings

1. **An object-valued title can crash the builder.** `parseLayout` checks `id`, `type`, and position, but not `title` (`parseLayout.ts:21–27`). `BuilderCanvas` renders `widget.title` directly (`BuilderCanvas.tsx:139–142`), and `WidgetRenderer` does too (`WidgetRenderer.tsx:119–121`). A JSON object title is therefore accepted but is not a valid React child. The dashboard wraps each `WidgetCard` in `WidgetErrorBoundary` (`DashboardPage.tsx:572–574`), so the failure is contained to that widget there; the supplied builder code has no corresponding boundary around its canvas or editor. **Mitigation:** render a safe fallback string at these display sites; do not reject custom widget types in the parser.

2. **Malformed nested filters and query metrics can crash a widget—or the builder editor.** `WidgetCard` spreads `config.localFilters` as an iterable without checking it (`WidgetCard.tsx:44–47`); an object value throws during render. With non-empty query results, missing/null `query.metrics` can throw in the `progress_bullet`/`coverage_meter` transforms, and non-iterable metrics can throw in `stacked_bar` (`WidgetCard.tsx:245–246, 281–295, 297–320`). A non-iterable `query.filters.conditions` can also throw when filters are merged (`WidgetCard.tsx:50–58`). Dashboard widget boundaries contain these render failures; query-result behavior depends on the API response, which is outside this packet. Separately, the editor seeds `metrics` from the saved query (`WidgetConfigEditor.tsx:32–34`), and `DataSourcePicker` calls `metrics.includes` (`DataSourcePicker.tsx:63–75`); an object-valued `metrics` crashes when a matching dataset is selected. No builder-local boundary is shown around the editor (`DashboardBuilderPage.tsx:496–505`). **Mitigation:** validate these shapes at their consumers and show a widget/editor-level configuration error rather than allowing the render to throw or silently dropping filters.

3. **Editing can discard persisted query and position extras.** `WidgetConfigEditor` rebuilds the query with only dataset, metrics, dimensions, limit, and offset (`WidgetConfigEditor.tsx:37–45`). The builder replaces the widget’s query with that result (`DashboardBuilderPage.tsx:121–124`); saving an existing dashboard then sends the whole layout through the update path (`DashboardBuilderPage.tsx:171–178`). Thus query fields such as filters, sort, or custom extras can be lost after editing and saving. Also, the parser test explicitly accepts and preserves `position.extra` (`parseLayout.test.ts:41–49`), but `BuilderCanvas` rebuilds position with only `x`, `y`, `w`, and `h` when its layout-change callback runs (`BuilderCanvas.tsx:56–63`). **Mitigation:** merge edited query fields into the existing query, and merge changed coordinates into the existing position.

4. **Dashboard “Reset to default” can leave the displayed error in place.** The action says it recovers the invalid layout, but only mutates `default_dashboard_id` (`DashboardPage.tsx:417–433`). A URL-addressed dashboard takes precedence over preferences (`DashboardPage.tsx:144–153`), so clearing the preference does not change the currently displayed invalid dashboard. If the selected default is also the matching persona clone, clearing the default can select that same config again (`DashboardPage.tsx:158–179`). **Mitigation:** make this action selection-aware—leave a URL-addressed dashboard or avoid presenting the same broken persona clone as the fallback; otherwise label it as clearing the saved selection, not repairing the layout.

### Recovery and boundaries

Builder **Start fresh** itself does not overwrite the saved layout: for parser errors, Save is blocked (`DashboardBuilderPage.tsx:58–60, 306–309`), and Start fresh clears local draft state and `configId` without calling a mutation (`DashboardBuilderPage.tsx:154–166, 431–435`). A subsequent save follows the create path, not the update path (`DashboardBuilderPage.tsx:177–183`). However, nested malformed values that pass `parseLayout` do not set `layoutError`; in particular, an object title can prevent the builder from rendering before its Start fresh UI is usable.

Finite but grid-invalid positions are accepted (the tests include negative, fractional, zero, and negative-size values: `parseLayout.test.ts:41–49`). The dashboard uses them in grid calculations and CSS placement (`DashboardPage.tsx:514–520, 523–538, 556–574`), and the builder passes them to `GridLayout` with size constraints but no explicit normalization (`BuilderCanvas.tsx:40–52`). **No additional crash or destructive overwrite from these positions is established by this snapshot**; the grid-library behavior is not included.

Unknown widget types alone are not shown to crash: the renderer uses a placeholder (`WidgetRenderer.tsx:102–104`), and the parser does not apply the editor/drop allowlist. Extra top-level widget fields survive the builder’s object spreads; the query and position losses above are the demonstrated exceptions.

**Next useful action:** add focused tests for object titles, non-array filters/metrics, editor round-tripping of query extras, position extras after layout changes, and reset behavior on URL-addressed and persona-cloned dashboards.

Primary judge's stated reason

A offers slightly more complete guidance for preserving accepted nested payloads during editing, including scalar configs. This is a weak, forced preference between substantially equivalent reviews, not an established material quality gap; an independent review could reasonably reject the weighting.

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

Battle wave: fd07e73c-9cd1-42ac-ae73-7a3724f34d1c. Pair: brp1_e2f4f2948c087530c699bfdaed79053bdac17a1f8bbda50dd1c2cff90178a67b. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.