← Model losses

Head-to-head comparison

openai / gpt-6-luna / medium / medium 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

Review this proposed BattleRanks results-UI contract against the shared checkout evidence and return an implementation-ready correction list. Do not write code. Do not recommend deploy, merge, scoring writes, publisher changes, or runtime/settings changes.

Style files were left out of the evidence packet because src/page.js plus src/page-styles.js plus src/site-styles.js exceed the route input budget. Use these extracted CSS facts, not guesses: home h1 uses --hero-title-size (74px default, 58px at max-width 1240, 52px at 1000, 46px at 767) and line-height 1.01. Site-kit shell is width:min(1344px, calc(100% - 96px)). page-styles shell uses --gutter 28px, and 16px under 800px. At 320px the site-kit copy column is about 224px wide. A 46px nowrap line “earns its rank.” will overflow unless the home headline font is scaled down for that line only.

User-authorized behavior:
- Category buttons, search, filters, reset, pagination, and same-surface results navigation must update results in place on Rankings, Models, and Battles. Audit Compare, History, and Updates and include them only when the same reusable path is safe.
- Preserve scroll position, URL and back/forward, focus, and exact compare selections.
- Results must stay server-authoritative. Progressive enhancement must keep working with JavaScript disabled. In-flight responses must not overwrite a newer request. Failed updates need an inline error and retry without destroying the current results. Empty states stay the server-rendered ones.
- Homepage banner headline must be exactly two lines: “Where AI” then “earns its rank.” with a controlled break. It must remain two lines tall, not one or three, at viewport widths 320, 390, 834, and 1440. Homepage and methodology stay scriptless.
- No backend scoring or data writes. No wrangler/env/publisher/runtime settings changes. No paid battle. No record/merge/deploy.

Proposed contract to confirm or correct:
1. Add public/assets/battleranks/js/results-nav.js and load it only on rankings, models, battles, and any audited same-surface pages that already can run self scripts or that must gain the existing BATTLE_CSP path. Homepage, methodology, model profiles, and battle detail pages stay scriptless. index.js kitPage detection may recognize the new script tag so script-src 'self' applies; do not loosen CSP for other pages. Update tests that currently require /rankings HTML to contain no script.
2. Keep real href/action/method=get. Intercept only unmodified primary clicks and GET submits whose destination is the same results surface: /rankings and /rankings/:board, /models, /battles, and if safe /compare, /history, /updates. Do not intercept model profiles, battle details, methodology, RSS, theme changes, primary nav to a different surface, modified clicks, or non-GET.
3. Fetch the existing HTML URL with Accept: text/html and same-origin credentials. Parse it. Swap the view-specific children of main#content (banner plus results), not the header or footer. Update document.title from the response. Do not follow the hash or scroll the page. Restore window.scrollY. Set history.scrollRestoration = 'manual' while enhanced and store scroll in history.state. pushState on new navigations; popstate refetches that URL and restores its stored scroll.
4. Stale protection: one AbortController plus a monotonic generation. Ignore aborted and older responses. On network/non-HTML/unexpected-view failure, leave current results, show a polite live error with Retry and a normal full-page link. Do not location.assign on failure. Successful empty/invalid server pages may be swapped when they are the same surface.
5. Focus: after a successful swap, focus the same control in the new DOM (same id, otherwise same href path+search, otherwise the submitting control’s name). Restore text-input caret. Do not move focus to the top. aria-busy on the surface during fetch; aria-live status for updating, updated, and error. Do not clear results before success.
6. Compare selections: before a models/compare filter, search, reset, or pagination request, merge the live selection from checked compare inputs, hidden compare inputs, and the existing sessionStorage keys (battleranks.compare.configurations.v1 and battleranks.compare.v1) into the request URL unless the control explicitly clears compare. After swap, remount selected-directory.js and model-compare.js idempotently via one battleranks:results-mounted event. Document listeners must be registered once. Do not change selection limits or scoring. A navigation to /compare from the tray may remain a full navigation if in-place would drop the tray contract.
7. Banner: in both home heroes (src/page.js homeView and src/combined-approved-presentation.js combinedArenaHero), replace the single-line h1 with a controlled two-line headline whose accessible text remains “Where AI earns its rank.” Use CSS so each line cannot wrap internally and the block’s height is exactly two line boxes at 320, 390, 834, and 1440. Scale the home headline only, not other h1s. “earns its rank.” must fit the home copy column at those widths without a third line or overflow.
8. Tests: update the contiguous-headline assertion to require the controlled break and no homepage script. Add a node:test for the results-nav generation/abort/same-surface rules using vm, plus render assertions that rankings/models/battles include the enhancer and homepage/methodology do not. Do not add a browser harness.

Return: agreed contract, corrections, files to touch, files not to touch, and test expectations. Flag any part of this contract that would violate CSP, compare-selection, or scroll requirements.

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

## Agreed contract, with corrections

Use progressive enhancement over the existing server-rendered GET pages. Keep ordinary links and forms functional without JavaScript; never compute results client-side, clear current results before a response succeeds, or let an older response replace a newer one. On update failure, retain the current view and offer an inline error, Retry, and a normal full-page link. Accept same-surface server responses even when they render an empty or invalid state.

1. **Script loading and CSP:** Add `public/assets/battleranks/js/results-nav.js` only to eligible results surfaces. `src/index.js` may recognize its exact emitted script tag when choosing `BATTLE_CSP`; do not broaden CSP. The worker already selects that policy from emitted script tags (lines 29–35, 451–460). Keep home and methodology scriptless as authorized. Rankings, models, and battles are authorized; audit Compare, History, and Updates separately. The shared path is plausible for History and Updates, but Compare’s tray and selection behavior make in-place navigation unsafe without preserving its contract. Keep tray navigation to `/compare` as a full navigation.
2. **Interception:** Retain real `href`, `action`, and `method=get`; intercept only unmodified primary same-origin GET navigation/submission on the same results surface. Do not capture anchor-only links, theme links, RSS, model profiles, battle details, methodology, or primary navigation to another surface. Preserve native modified clicks and non-GET behavior. The route allowlist must distinguish `/rankings` and board routes from unrelated paths; use the actual route family, not a loose prefix.
3. **Swap and scroll:** Replacing the children of `main#content` is a reasonable boundary: the banner and results are inside it, while header/footer are outside (`src/page.js:108–112`). Require a valid parsed response and the expected same surface before swapping. Update the title, but do not navigate to the response hash or scroll to an anchor. Preserve the current scroll position. Set manual restoration while enhanced; save outgoing scroll into the current history entry before `pushState`, associate the target URL with its own scroll, and refetch on `popstate` without pushing another entry. Merge, rather than overwrite, existing `history.state`.
4. **Focus and status:** Preserve focus by a stable identity, but do not treat same `id` alone as sufficient if it identifies a different control; verify control type/name where relevant. Fall back to destination path+search, then the submitting control’s name. Restore caret only for compatible text inputs. Keep focus from jumping to the top. Expose updating/updated/error status and `aria-busy` on a stable results surface; ensure the error controls are reachable without replacing results.
5. **Compare selection:** Correct the proposed “merge … live selection … and existing sessionStorage keys” rule. Blindly unioning both storage keys can resurrect removed selections or mix two distinct selection systems. The packet shows a three-model comparison flow (`model-compare.js:11–15, 159–170`) and a separate ten-configuration directory flow (`selected-directory.js:29–47, 50–67`); they have different keys, limits, and restore rules. For each eligible request, identify the active surface/system, treat an explicit URL selection—including an explicit clear—as authoritative, and preserve the exact ordered selections and repeated query parameters. Reconcile live checked/hidden inputs with only the matching system’s state; do not apply one system’s limit or storage to the other. The current scripts initialize once and install document listeners (`model-compare.js:173–213`, `selected-directory.js:148–215`); a mount event alone will not remount them. Refactor initialization to be explicitly idempotent, with listeners registered once and page-specific state refreshed after a successful swap.
6. **Banner:** Use a controlled break in both home renderers (`src/page.js:978`; `src/combined-approved-presentation.js:11–12`) and preserve the accessible text exactly as “Where AI earns its rank.” The supplied CSS facts rule out keeping the home headline at 46px on a 320px viewport: the ~224px copy column cannot fit “earns its rank.” on one nowrap line at that size. Scale only the home headline’s second line as needed, while keeping both lines non-wrapping and the heading exactly two line boxes at 320, 390, 834, and 1440. Do not scale other h1s. Verify layout behavior at all four widths; source-only render assertions cannot establish it.
7. **Tests:** Update the contiguous headline assertion to verify the controlled break and exact accessible text, and assert home remains scriptless. Replace the blanket `/rankings`-is-scriptless expectation with explicit assertions: rankings/models/battles include the enhancer; home/methodology do not. Add the proposed `node:test`/`vm` coverage for generation, abort, and same-surface filtering. Also test request selection preservation/explicit clear, success and failure retaining the view, popstate scroll restoration, and idempotent remount behavior. No browser harness is authorized.

## Files to touch

- `public/assets/battleranks/js/results-nav.js` (new)
- `src/index.js` for exact-tag CSP detection
- `src/page.js` for conditional script emission and the legacy home headline
- `src/combined-approved-presentation.js` for the combined home headline
- Relevant render/test files, notably `test/present.test.mjs`, `test/site-visual.test.mjs`, `test/worker.test.mjs`, plus a new enhancer test
- `public/assets/battleranks/js/model-compare.js` and `selected-directory.js` only as needed to provide safe idempotent remounts and correct per-system selection handling

## Do not touch

Scoring/data-write paths, publisher behavior, runtime/environment/Wrangler settings, backend result computation, battle-detail/profile/methodology behavior, or deploy/merge configuration. Do not add a browser harness.

**CSP:** Exact-tag recognition is compatible with the existing policy; broadening it or emitting the enhancer on scriptless pages is not.  
**Scroll:** Ignoring hashes while keeping their URL is compatible with the request, provided scroll is explicitly preserved for push and pop navigation.  
**Compare:** The proposed union of both session-storage keys is not safe; it can alter exact selections. Use the active comparison system and explicit URL state as described above.

**Uncertainty:** The packet omits `src/page-styles.js` and `src/site-styles.js`; rely on the supplied CSS facts for the banner, and validate the final layout at the specified widths. The packet also identifies direct dependencies outside its scope, so details of those dependencies are not established here.

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

## Conclusion

The broad contract is sound, but **do not adopt it verbatim**. The key corrections are to define route boundaries and swap boundaries explicitly, preserve compare selections without allowing stale storage to override the live URL, and save scroll state at the right history transitions. Progressive enhancement must retain the existing normal links/forms.

## Agreed contract and corrections

1. **Enhancer scope and CSP:** Add `results-nav.js` and emit it only for approved results pages. `index.js` can include its exact emitted tag in `kitPage` detection so those pages receive the existing `BATTLE_CSP`; do not broaden CSP globally. Homepage and methodology remain scriptless. Rankings currently appear scriptless in the rendering evidence, so update tests that enforce that. Include Models and Battles; Compare, History, and Updates are reasonable only after verifying their server-rendered view and existing scripts are compatible with remounting.

2. **Same-surface navigation:** Keep real `href`, `action`, and GET methods. Intercept only unmodified primary clicks and same-surface GET submits. Treat `/rankings` and `/rankings/:board` as one surface; `/models` and `/battles` likewise. Profiles and battle details are distinct routes and must not be intercepted. Exclude theme links/forms, RSS, methodology, and navigation to another surface. Category links, filters, reset, and pagination remain eligible when they stay within their surface.

3. **Swap boundary:** `buildPage` places route content inside `main#content`, while the shared chrome and footer are outside it (`src/page.js:108–131`). Replace only a well-defined route-content container inside `main`, not the entire `main` wholesale: header/footer stay fixed, and replacement must not duplicate page-level scripts or controls. The evidence shows variable route layouts, including separate hero/banner and results containers; validate the response’s surface before swapping. Update `document.title` from the response. Do not follow the response hash or scroll to it.

4. **Scroll and history:** Save the outgoing entry’s current `scrollY` **before** `pushState`; push the new URL and its scroll state, then fetch. Set `scrollRestoration = "manual"` while enhanced. On `popstate`, refetch the active URL and restore that entry’s stored scroll only after a successful swap. Preserve the current scroll during ordinary in-place navigation. Hashes may remain in the URL, but must not trigger native scrolling during the swap. Avoid `location.assign` on failure.

5. **Staleness and failures:** Use a generation counter plus aborting the prior request; check the generation after fetch and parsing, not just whether the request was aborted. Reject non-HTML, unexpected-view, or cross-surface responses before modifying the DOM. On failure, keep current results and show an inline polite error with Retry and a normal full-page link. Do not replace server-rendered empty states with client-generated ones. Server-rendered error/empty pages are still valid when they match the requested surface.

6. **Focus and status:** Preserve the active control using a stable identity, but avoid an ambiguous same-`href` match (many controls can share a destination); prefer a unique id, then a more specific control identity, with submitting-control name as fallback. Restore text selection/caret where supported. Do not focus the top of the page. Apply `aria-busy` to the results surface and announce updating, updated, and error states. Keep results in place until a validated response succeeds.

7. **Compare selection:** This part needs correction. Before Models filter/search/reset/pagination requests, merge **live checked controls and hidden compare inputs** with the applicable session selections, then preserve the exact IDs in the request URL. Do not let session storage blindly override an explicit URL selection: `model-compare.js:159–170` and `selected-directory.js:50–67` use URL presence to distinguish explicit selection, while storage is fallback when URL selection is absent. Preserve the existing three-model limit for model comparison and ten-configuration limit for the selected-directory flow; the contract must not impose a shared limit. Explicit clear must send the clear representation and clear both relevant stored selections after success. `/compare` is not necessarily safe to enhance: the selected-directory tray submits to `/compare` (`src/combined-approved-presentation.js:43`), while its behavior and shared-battle controls differ from Models. Keeping tray navigation as a full navigation is the safer default.

   A `battleranks:results-mounted` event alone does **not** make existing scripts idempotent: both scripts are IIFEs that capture DOM nodes and register document/window handlers on load (`model-compare.js:2–6, 173–213`; `selected-directory.js:1–6, 152–215`). They need an explicit mount/remount design with one-time global listeners and refreshed view references; otherwise old detached nodes/listeners can retain stale selection. Fire the event after a successful eligible swap, but specify how those scripts consume it.

8. **Banner:** The two-line headline must use an explicit controlled break in both home heroes, with accessible text remaining exactly “Where AI earns its rank.” Use non-wrapping line spans and size/line-height rules scoped only to the home headline. The supplied CSS facts rule out leaving the default 46px size at narrow widths: the site-kit copy column is about 224px at 320px, so “earns its rank.” will overflow unless that line alone is scaled down. Test two-line height and no overflow at 320, 390, 834, and 1440px. Touch both hero renderers (`src/page.js:978`, `src/combined-approved-presentation.js:12`); do not scale other h1s.

## Files implicated

**Likely touch:** `public/assets/battleranks/js/results-nav.js` (new); `src/page.js` (conditional script emission and home markup); `src/combined-approved-presentation.js` (combined home markup); `src/index.js` (exact script-tag CSP detection); relevant rendering/CSP tests in `test/present.test.mjs`, `test/site-visual.test.mjs`, and `test/worker.test.mjs`; new `node:test` coverage for navigation generations, aborts, and same-surface rules.

**Do not touch:** scoring/data-write paths, publisher/runtime/environment settings, theme behavior, backend route/read behavior, model profiles, battle-detail pages, methodology script behavior, or unrelated styles. CSS files were omitted from the packet; use the supplied extracted measurements and keep any new styling narrowly scoped.

## Test expectations

- Rankings, Models, and Battles render the enhancer; homepage and methodology do not. Profiles and battle details remain scriptless.
- CSP permits same-origin scripts only on intended enhanced pages; reflected script-path query text does not activate the tag or change CSP.
- Node tests cover same-surface allow/deny cases, modified clicks/non-GET submits, generation ordering, abort races, invalid HTML/view rejection, and failure retaining the current view.
- Verify compare IDs survive Models requests from both selection mechanisms, explicit clear works, URL state wins when explicit, limits remain unchanged, and remounts do not accumulate listeners.
- Verify scroll preservation on push and restoration on Back/Forward, including hashes; focus/caret restoration; inline retry/error behavior; server-rendered empty states remain intact.
- Replace contiguous-headline assertion with controlled-break/accessibility assertions; assert homepage remains scriptless and the headline stays exactly two lines without overflow at the four required widths.

**Uncertainty:** CSS source files and the page-specific render/test setup are outside the supplied snapshot; no conclusions about their existing selectors or test harness beyond the provided extracted CSS facts.

Primary judge's stated reason

B earns a weak, forced preference because its active-system selection rule better protects exact comparison state without affecting unrelated saved selections. A’s stronger stale-response guidance makes this a close tradeoff, not an established material quality difference; an independent review could reasonably reject the preference.

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

Battle wave: 339f1ec8-d5e7-4c36-9326-ba2e557e062b. Pair: brp1_bb5b9c3414f2cf6e7e75a83960e4ad772c897955db749fe87405531fcd6effa2. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.