ModelLineup

Every answer on this page was written by an AI model, named on the answer. Answers can be wrong, out of date or made up, even when they sound sure. Check anything that matters before you rely on it.

Models Opus 5

Claude Opus 5

Released
Tested
Settings
Low effort and Max effort

In short

Ranked 2nd of 9 at max effort, level with Sonnet 5.5 and Fable 5.2.

Opus 5 answered all 24 prompts at both efforts, scoring 87 at low effort and 91 at max. It passed every hidden test on every code prompt at both settings; its misses were mostly planning details, figures taken on trust, and the Minesweeper reveal rules at both efforts.

At low effort Opus 5 scored level with Fable 5, and at max effort it scored level with Fable 5. Overall it scored level at both efforts: max effort lifted planning from 65 to 76 and web pages from 90 to 93.

Written by an AI model from these results; every figure in it is filled in by a program. How it was made.

Opus 5

24 prompts, every check counted

Low effort

87

  • Floor45/49, 92% passed
  • Middle51/58, 88% passed
  • Top57/65, 88% passed

Median answer 17 s, 4.7¢.

Max effort

91

  • Floor45/49, 92% passed
  • Middle54/58, 93% passed
  • Top59/65, 91% passed

Median answer 57 s, 13¢.

Max passed 5 more checks, cost 3.3 times as much and took 3.8 times as long. Costs are at Anthropic’s API prices on the day it was tested, .

What the results show

Written by an AI model from these results; every figure in it is filled in by a program. How it was made.

Best at

  • Code: 100 at low effort and 100 at max; it passed every hidden test on every code prompt, including the paging bug, the search box race, the CSV import and the slow script. F01 F02 F06 F07
  • Web pages: the landing page and the garden page fixes at both efforts, the dashboard from the mockup at max effort and the kanban board at low passed every page test. B01 B05 B02 B03
  • Careful reading: it found the wrong line on the market receipt, said it did not know the invented novel, and kept its bread maker answers to what the manual says, at both efforts. I01 H02 K02
  • Everyday writing and the rota: the text to the plumber, the update from a messy thread and the volunteer rota met every check at both efforts; the booking plan covered clashing bookings, time zones and refunds at both. W01 W02 P02 A01

Stumbled on

  • Minesweeper failed the reveal rules at both efforts, and flags and new game at low; the kanban board at max effort failed its reload and phone tests, and the dashboard at low its chart bars. B04 B03 B02
  • The column rename plan renamed the column in place, removing the old name before the services had switched, at both efforts; at low effort it also had no new column, batched backfill or concurrent index. A03
  • The feature spec did not fully flag the seat question and settled choices without marking them at either effort; the microservices answer ran over length and offered no modular monolith at either, and lacked a clear recommendation at max. A04 A02
  • At both efforts it took the cycling figures' printed total on trust, ran slightly long on the invented novel, did not use every required word in the story, and left a working booking flow out of the first phase. R02 H02 S02 A01

What max effort changed

  • Overall it scored level at both efforts: 4 prompts gained at max effort, 2 lost ground and 18 stayed the same, for about 3.3 times the cost and 3.8 times the time.
  • Planning rose from 65 to 76: the rename plan went from 4 of 9 to 7 of 9, the spec from 4 of 8 to 6 of 8; the microservices answer slipped from 6 of 8 to 5 of 8. A03 A04 A02
  • Web pages rose from 90 to 93: Minesweeper went from 6 of 9 to 8 of 9 and the dashboard from 6 of 7 to 7 of 7; the kanban board fell from 9 of 9 to 7 of 9. B04 B02 B03

Worth knowing

  • Each prompt was answered once at each effort, so a single answer can move a prompt's score, and small gaps between scores are treated as level.
  • Costs are what the same tokens would cost at the published API prices, not what anyone paid.

Score by kind of work

Building web pages

  • Low effort
    90
  • Max effort
    93

Code

  • Low effort
    100
  • Max effort
    100

Planning and architecture

  • Low effort
    65
  • Max effort
    76

Everyday

  • Low effort
    93
  • Max effort
    93

Every answer

Each row opens to the low and max answers side by side. Each prompt is described on the prompts page.

Building web pages

B01A landing page for a small invoicing appLow 9/9Max 9/9Same

What it asks for. Asks for a one-page landing site for a small invoicing app for freelancers, as a single HTML file with no libraries and nothing loaded from outside. The page needs a headline, three named features, three price plans with a monthly and yearly switch (yearly gives two months free and is quoted as one total for the year), a four-question FAQ that opens and closes, and a sign-up button. It has to read well on a phone.

Both settings passed 9 of 9 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

9 of 9

Screenshot of the page built in this answer, at a desktop width of 1280 pixels
Our screenshot, 1280 by 800. Open it for the full length.
Screenshot of the page built in this answer, at a phone width of 375 pixels
Phone, 375 by 812.
More screenshots (2).
Screenshot of the page built in this answer, at a desktop width of 1280 pixelsScreenshot of the page built in this answer, at a phone width of 375 pixels
Show the code and the answer.

Here's the complete file — save it as index.html.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Brindlebill — invoicing for freelancers</title>
<style>
  :root {
    --ink: #1c2024;
    --muted: #55606b;
    --line: #e2e6ea;
    --accent: #1f5f52;
    --accent-soft: #eaf3f0;
    --bg: #fbfaf8;
  }
  * { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  }
  .wrap { width: 100%; max-width: 62rem; margin: 0 auto; padding: 0 1.25rem; }
  section { padding: 3rem 0; border-top: 1px solid var(--line); }
  h1, h2, h3 { line-height: 1.25; margin: 0 0 .6rem; }
  h1 { font-size: 2rem; letter-spacing: -.02em; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.125rem; }
  p { margin: 0 0 1rem; }
  .muted { color: var(--muted); }

  header.hero { padding: 3.5rem 0 3rem; }
  .brand {
    font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
    font-size: 1rem; color: var(--accent); margin-bottom: 1.5rem;
  }
  .pitch { font-size: 1.1875rem; color: var(--muted); max-width: 34rem; }

  .btn {
    display: inline-block; font: inherit; font-weight: 600; cursor: pointer;
    background: var(--accent); color: #fff; border: 1px solid var(--accent);
    padding: .875rem 1.5rem; border-radius: .5rem; text-decoration: none;
    min-height: 48px; line-height: 1.4;
  }
  .btn:hover { background: #17483e; }
  .btn:focus-visible, summary:focus-visible, .toggle button:focus-visible {
    outline: 3px solid #9ccfc2; outline-offset: 2px;
  }
  .hero .btn { margin-top: .5rem; }
  .trial-note { font-size: 1rem; margin-top: .875rem; }

  .features { display: grid; gap: 1.5rem; }
  .feature h3 { margin-bottom: .25rem; }
  .feature p { margin: 0; color: var(--muted); }

  .toggle {
    display: inline-flex; gap: .25rem; padding: .25rem; margin: 0 0 1.75rem;
    background: #fff; border: 1px solid var(--line); border-radius: .625rem;
  }
  .toggle button {
    font: inherit; font-weight: 600; color: var(--muted);
    background: none; border: 0; border-radius: .5rem;
    padding: .625rem 1.125rem; min-height: 44px; cursor: pointer;
  }
  .toggle button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }

  .plans { display: grid; gap: 1.25rem; list-style: none; padding: 0; margin: 0; }
  .plan {
    background: #fff; border: 1px solid var(--line);
    border-radius: .75rem; padding: 1.5rem;
  }
  .plan.featured { border-color: var(--accent); border-width: 2px; }
  .tag {
    display: inline-block; font-size: 1rem; font-weight: 600; color: var(--accent);
    background: var(--accent-soft); border-radius: 999px; padding: .125rem .625rem;
    margin-bottom: .5rem;
  }
  .price { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
  .per { font-size: 1rem; font-weight: 400; color: var(--muted); }
  .save { font-size: 1rem; color: var(--accent); margin: .25rem 0 1rem; min-height: 1.6em; }
  .plan ul { margin: 0; padding-left: 1.25rem; color: var(--muted); }
  .plan li { margin-bottom: .375rem; }

  details {
    background: #fff; border: 1px solid var(--line);
    border-radius: .625rem; margin-bottom: .75rem;
  }
  summary {
    cursor: pointer; font-weight: 600; padding: 1rem 1.25rem;
    list-style: none; display: flex; justify-content: space-between; gap: 1rem;
  }
  summary::-webkit-details-marker { display: none; }
  summary::after { content: "+"; color: var(--accent); font-size: 1.375rem; line-height: 1; }
  details[open] summary::after { content: "–"; }
  details p { padding: 0 1.25rem 1.125rem; margin: 0; color: var(--muted); }

  footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; font-size: 1rem; color: var(--muted); }

  @media (min-width: 40rem) {
    h1 { font-size: 2.75rem; }
    .features { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
    .plans { grid-template-columns: repeat(3, 1fr); }
    section { padding: 4rem 0; }
  }
</style>
</head>
<body>

<header class="hero">
  <div class="wrap">
    <p class="brand">Brindlebill</p>
    <h1>Send an invoice today, get paid this week.</h1>
    <p class="pitch">Brindlebill is small, calm invoicing software for freelancers who would rather be doing the work.</p>
    <a class="btn" href="#signup">Start free trial</a>
    <p class="trial-note muted">Free for 14 days. No card needed.</p>
  </div>
</header>

<section aria-labelledby="features-h">
  <div class="wrap">
    <h2 id="features-h">What you get</h2>
    <div class="features">
      <div class="feature">
        <h3>Invoices in a minute</h3>
        <p>Pick a client, add a line or two, and send — your details and totals fill themselves in.</p>
      </div>
      <div class="feature">
        <h3>Gentle reminders</h3>
        <p>Brindlebill nudges late payers politely on your behalf, so you never have to write that email.</p>
      </div>
      <div class="feature">
        <h3>Card and bank payments</h3>
        <p>Clients pay by card or bank transfer straight from the invoice, and the money lands in your account.</p>
      </div>
    </div>
  </div>
</section>

<section aria-labelledby="pricing-h">
  <div class="wrap">
    <h2 id="pricing-h">Pricing</h2>
    <p class="muted">Pay yearly and get two months free.</p>

    <div class="toggle" role="group" aria-label="Billing period">
      <button type="button" id="btn-monthly" aria-pressed="true">Monthly</button>
      <button type="button" id="btn-yearly" aria-pressed="false">Yearly</button>
    </div>

    <ul class="plans">
      <li class="plan">
        <h3>Starter</h3>
        <p class="price"><span data-price="starter">$9</span> <span class="per" data-per>per month</span></p>
        <p class="save" data-save="starter"></p>
        <ul>
          <li>5 clients</li>
          <li>PDF invoices</li>
        </ul>
      </li>
      <li class="plan featured">
        <p class="tag">Most popular</p>
        <h3>Pro</h3>
        <p class="price"><span data-price="pro">$19</span> <span class="per" data-per>per month</span></p>
        <p class="save" data-save="pro"></p>
        <ul>
          <li>Unlimited clients</li>
          <li>Automatic reminders</li>
          <li>Your own logo</li>
        </ul>
      </li>
      <li class="plan">
        <h3>Team</h3>
        <p class="price"><span data-price="team">$49</span> <span class="per" data-per>per month</span></p>
        <p class="save" data-save="team"></p>
        <ul>
          <li>Everything in Pro</li>
          <li>5 seats</li>
          <li>A shared client list</li>
        </ul>
      </li>
    </ul>
  </div>
</section>

<section aria-labelledby="faq-h">
  <div class="wrap">
    <h2 id="faq-h">Questions</h2>

    <details>
      <summary>Can I cancel any time?</summary>
      <p>Yes. Cancel from your account page and you won't be charged again. Nothing is locked in.</p>
    </details>
    <details>
      <summary>Do my clients need an account?</summary>
      <p>No. They open a link, see the invoice and pay. They never have to sign up.</p>
    </details>
    <details>
      <summary>Which currencies can I invoice in?</summary>
      <p>You can invoice in 30 currencies, and each invoice shows the amount in your client's currency.</p>
    </details>
    <details>
      <summary>What happens when the free trial ends?</summary>
      <p>You pick a plan. If you don't, your account switches to view-only and your invoices stay safe for 90 days.</p>
    </details>
  </div>
</section>

<section id="signup" aria-labelledby="signup-h">
  <div class="wrap">
    <h2 id="signup-h">Ready when you are</h2>
    <p class="muted">Set up your first invoice in about five minutes.</p>
    <a class="btn" href="#signup">Start free trial</a>
  </div>
</section>

<footer>
  <div class="wrap">
    <p>Brindlebill — invoicing for freelancers.</p>
  </div>
</footer>

<script>
(function () {
  var monthly = { starter: 9, pro: 19, team: 49 };
  var monthlyBtn = document.getElementById('btn-monthly');
  var yearlyBtn = document.getElementById('btn-yearly');
  var prices = document.querySelectorAll('[data-price]');
  var pers = document.querySelectorAll('[data-per]');
  var saves = document.querySelectorAll('[data-save]');

  function render(period) {
    var yearly = period === 'yearly';

    prices.forEach(function (el) {
      var m = monthly[el.getAttribute('data-price')];
      el.textContent = '$' + (yearly ? m * 10 : m);
    });

    pers.forEach(function (el) {
      el.textContent = yearly ? 'per year' : 'per month';
    });

    saves.forEach(function (el) {
      var m = monthly[el.getAttribute('data-save')];
      el.textContent = yearly ? 'Two months free — you save $' + (m * 2) + ' a year.' : '';
    });

    monthlyBtn.setAttribute('aria-pressed', String(!yearly));
    yearlyBtn.setAttribute('aria-pressed', String(yearly));
  }

  monthlyBtn.addEventListener('click', function () { render('monthly'); });
  yearlyBtn.addEventListener('click', function () { render('yearly'); });

  render('monthly');
})();
</script>

</body>
</html>

A few notes on the choices:

  • Yearly maths: two months free means ten months' money for twelve, so Starter $90, Pro $190, Team $490 — shown as the whole-year figure, with a line underneath saying what you save.
  • Mobile: base text is 17px, the smallest text anywhere is 16px, buttons and FAQ rows are at least 44–48px tall, and the layout is one column until 640px wide.
  • Headings: one h1 for the headline, h2 for each section, h3 for feature and plan names — no levels skipped.
  • FAQ uses native <details>, so it opens and closes even with JavaScript off. The pricing switch needs JavaScript; monthly prices are in the HTML, so that's what shows if the script doesn't run.
  • The two "Start free trial" buttons currently point at the sign-up section — swap the href for your real sign-up URL when it's ready.
  • Floor2/2, 100% passed
  • Middle4/4, 100% passed
  • Top3/3, 100% passed
9 of 9 checks passedfloor 2/2, middle 4/4, top 3/3
  • Passed.
    The page loads with no errors in the console
    Floor Page test
  • Passed.
    Every section is there, with the exact plan names, prices and text
    Floor Page test
  • Passed.
    No sideways scroll on a 375 px phone
    Middle Page test
  • Passed.
    Nothing is loaded from outside the file
    Middle Page test
  • Passed.
    One h1, no skipped heading levels, text 16 px or larger, enough contrast
    Middle Page test
  • Passed.
    The page looks finished: clear hierarchy, pricing easy to compare, nothing broken
    Middle Read
  • Passed.
    Yearly shows $90, $190 and $490, and Monthly brings back $9, $19, $49
    Top Page test
  • Passed.
    Each FAQ question opens and closes from the keyboard
    Top Page test
  • Passed.
    Still no sideways scroll on a phone with Yearly on and every FAQ open
    Top Page test
  • Took 43 s.
  • First words after 3.2 s.
  • Wrote 4,355 tokens, 51 of them thinking.
  • 12¢ at API prices.
All numbers.
Time to finish43 s
Time to first words3.2 s
Input tokens2
Cached tokens1,265
Output tokens4,355
Thinking tokens51
Words in the answer1,166
Price at API rates12¢

AI answer from Opus 5 · max effort · 2 Oct 2026

9 of 9

Screenshot of the page built in this answer, at a desktop width of 1280 pixels
Our screenshot, 1280 by 800. Open it for the full length.
Screenshot of the page built in this answer, at a phone width of 375 pixels
Phone, 375 by 812.
More screenshots (2).
Screenshot of the page built in this answer, at a desktop width of 1280 pixelsScreenshot of the page built in this answer, at a phone width of 375 pixels
Show the code and the answer.

Here's the whole file. It's self-contained: no libraries, no external fonts or images (the logo mark, tick marks and FAQ chevrons are drawn in CSS). Body text is 17px with nothing below 16px, tap targets are at least 48px tall, and the headings run h1 → h2 (section) → h3 (feature / plan / question) with no levels skipped.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Brindlebill — invoicing for freelancers</title>
<meta name="description" content="Brindlebill is invoicing for freelancers: send a tidy invoice in a minute, let polite reminders do the chasing, and get paid by card or bank transfer.">
<meta name="color-scheme" content="light dark">

<!--
  TO DO BEFORE YOU SHIP:
  1. Point the "Start free trial" link in the sign-up band at your real URL
     (search for  href="/signup"  — it's the only live link on the page).
     The other buttons scroll down to that band, so there's one place to change.
     If you'd rather pre-select a plan, give the plan buttons
     href="/signup?plan=starter" etc. instead of href="#signup".
  2. If your trial has a fixed length, add it to the two "Free trial" lines
     (e.g. "14-day free trial, no card needed").
-->

<style>
/* ---------- design tokens ---------- */
:root{
  --bg:#fcf9f6;
  --card:#ffffff;
  --ink:#2b221c;
  --ink-soft:#5d4f46;
  --line:#e7ddd3;
  --accent:#a8431a;
  --accent-ink:#8d3613;
  --accent-soft:#fdf0e8;
  --on-accent:#ffffff;
  --radius:14px;
  --wrap:64rem;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#191411;
    --card:#221c18;
    --ink:#f4ece6;
    --ink-soft:#c9bab0;
    --line:#3a312b;
    --accent:#ff9159;
    --accent-ink:#ffb089;
    --accent-soft:#2a1d16;
    --on-accent:#2a1509;
  }
}

/* ---------- base ---------- */
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  font-size:1.0625rem;           /* 17px */
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3{margin:0 0 .6rem;line-height:1.2;letter-spacing:-.015em}
h1{font-size:clamp(2rem,7.5vw,3rem)}
h2{font-size:clamp(1.5rem,5vw,2rem)}
h3{font-size:1.125rem;line-height:1.35}
p{margin:0 0 1rem}
a{color:var(--accent-ink)}
:focus-visible{outline:3px solid var(--accent);outline-offset:3px;border-radius:6px}

.wrap{width:100%;max-width:var(--wrap);margin-inline:auto;padding-inline:clamp(1rem,5vw,2rem)}
.wrap.narrow{max-width:46rem}
.section{padding-block:clamp(2.5rem,8vw,4.5rem);border-top:1px solid var(--line)}

.skip{position:absolute;left:-9999px}
.skip:focus{
  position:fixed;left:.75rem;top:.75rem;z-index:20;
  background:var(--card);color:var(--ink);
  padding:.75rem 1rem;border-radius:8px;border:2px solid var(--accent);
  text-decoration:none;font-weight:600;
}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:3rem;padding:.8rem 1.5rem;
  font:inherit;font-weight:600;text-align:center;text-decoration:none;
  border:2px solid transparent;border-radius:999px;cursor:pointer;
}
.btn-primary{background:var(--accent);color:var(--on-accent)}
.btn-primary:hover{background:var(--accent-ink)}
.btn-outline{background:transparent;color:var(--accent-ink);border-color:var(--accent)}
.btn-outline:hover{background:var(--accent-soft)}
.btn-lg{min-height:3.4rem;padding:1rem 2rem}

/* ---------- header ---------- */
.site-head{background:var(--card);border-bottom:1px solid var(--line)}
.head-inner{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.75rem 1rem;padding-block:.9rem}
.brand{display:inline-flex;align-items:center;gap:.55rem;font-weight:700;font-size:1.25rem;letter-spacing:-.02em;color:var(--ink);text-decoration:none}
.mark{width:1.15rem;height:1.15rem;border-radius:.35rem;background:var(--accent);position:relative;flex:none}
.mark::after{content:"";position:absolute;inset:.3rem .25rem auto .25rem;height:2px;background:var(--on-accent);box-shadow:0 .3rem 0 var(--on-accent)}

/* ---------- hero ---------- */
.hero{padding-block:clamp(2.75rem,10vw,5rem)}
.lede{font-size:clamp(1.125rem,3.6vw,1.375rem);color:var(--ink-soft);max-width:36rem}
.cta-row{display:flex;flex-wrap:wrap;align-items:center;gap:.9rem 1.25rem;margin-top:1.75rem}
.fine{margin:0;font-size:1rem;color:var(--ink-soft)}

/* ---------- features ---------- */
.features{list-style:none;margin:1.5rem 0 0;padding:0;display:grid;gap:1rem}
.feature{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:1.4rem}
.feature h3{margin-bottom:.4rem}
.feature p{margin:0;color:var(--ink-soft)}
@media (min-width:48em){.features{grid-template-columns:repeat(3,1fr)}}

/* ---------- pricing ---------- */
.billing{
  display:flex;flex-wrap:wrap;gap:.35rem;
  background:var(--card);border:1px solid var(--line);
  border-radius:999px;padding:.35rem;margin:1.25rem 0 .75rem;
}
.seg{
  flex:1 1 auto;min-height:3rem;padding:.7rem 1.25rem;
  font:inherit;color:var(--ink-soft);
  background:transparent;border:0;border-radius:999px;cursor:pointer;
}
.seg[aria-pressed="true"]{background:var(--accent);color:var(--on-accent);font-weight:600}
.period-note{color:var(--ink-soft);font-size:1rem}
.noscript-note{color:var(--ink-soft);font-size:1rem}

.plans{list-style:none;margin:1.5rem 0 0;padding:0;display:grid;gap:1rem}
@media (min-width:52em){.plans{grid-template-columns:repeat(3,1fr)}}
.plan{
  display:flex;flex-direction:column;
  background:var(--card);border:1px solid var(--line);
  border-radius:var(--radius);padding:1.5rem;
}
.plan.is-featured{border-color:var(--accent);border-width:2px}
.badge{
  align-self:flex-start;margin-bottom:.6rem;
  background:var(--accent-soft);color:var(--accent-ink);
  border-radius:999px;padding:.2rem .75rem;font-size:1rem;font-weight:600;
}
.price{display:flex;flex-wrap:wrap;align-items:baseline;gap:.4rem;margin:.2rem 0 .15rem}
.amount{font-size:clamp(2rem,6vw,2.5rem);font-weight:700;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.per{color:var(--ink-soft)}
.plan-save{display:block;min-height:1.6em;margin-bottom:.9rem;font-weight:600;color:var(--accent-ink)}
.ticks{list-style:none;margin:0 0 1.5rem;padding:0;display:grid;gap:.6rem}
.ticks li{display:flex;align-items:flex-start;gap:.7rem;color:var(--ink-soft)}
.ticks li::before{
  content:"";flex:none;
  width:.4rem;height:.75rem;margin:.3rem .2rem 0 .15rem;
  border:solid var(--accent);border-width:0 2px 2px 0;
  transform:rotate(45deg);
}
.plan .btn{margin-top:auto;width:100%}

/* ---------- FAQ ---------- */
.faq{margin-top:1.5rem}
.faq details{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);margin-bottom:.75rem}
.faq summary{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
  min-height:3rem;padding:1rem 1.15rem;cursor:pointer;list-style:none;
}
.faq summary::-webkit-details-marker{display:none}
.faq summary h3{margin:0;font-size:1.0625rem}
.chev{
  flex:none;width:.6rem;height:.6rem;margin-top:-.25rem;
  border:solid var(--accent);border-width:0 2px 2px 0;
  transform:rotate(45deg);transition:transform .2s ease;
}
.faq details[open] .chev{margin-top:.2rem;transform:rotate(225deg)}
.answer{padding:0 1.15rem 1.2rem;color:var(--ink-soft)}
.answer p{margin:0}

/* ---------- sign-up band + footer ---------- */
.signup{background:var(--accent-soft);border-top:1px solid var(--line);text-align:center}
.signup .wrap{padding-block:clamp(2.5rem,8vw,4rem)}
.signup p{max-width:34rem;margin-inline:auto}
.site-foot{border-top:1px solid var(--line);padding-block:2rem;color:var(--ink-soft);font-size:1rem}

@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto}
  *{transition:none!important;animation:none!important}
}
</style>
</head>

<body>
<a class="skip" href="#main">Skip to content</a>

<header class="site-head">
  <div class="wrap head-inner">
    <a class="brand" href="#top"><span class="mark" aria-hidden="true"></span>Brindlebill</a>
    <a class="btn btn-outline" href="#signup">Start free trial</a>
  </div>
</header>

<main id="main">

  <!-- Hero -->
  <section class="hero" id="top">
    <div class="wrap">
      <h1>Invoicing that takes a minute, not an evening</h1>
      <p class="lede">Brindlebill helps freelancers send tidy invoices, chase them politely, and get paid by card or bank transfer.</p>
      <div class="cta-row">
        <a class="btn btn-primary btn-lg" href="#signup">Start free trial</a>
        <p class="fine">Free trial, no card needed. Cancel any time.</p>
      </div>
    </div>
  </section>

  <!-- Features -->
  <section class="section" aria-labelledby="features-title">
    <div class="wrap">
      <h2 id="features-title">What you get</h2>
      <ul class="features">
        <li class="feature">
          <h3>Invoices in a minute</h3>
          <p>Pick a client, add a line or two and hit send — numbering, dates and your payment terms fill themselves in.</p>
        </li>
        <li class="feature">
          <h3>Gentle reminders</h3>
          <p>Brindlebill follows up on overdue invoices for you, in wording polite enough that you never have to send the awkward email.</p>
        </li>
        <li class="feature">
          <h3>Card and bank payments</h3>
          <p>Every invoice carries a pay link, so clients can settle by card or bank transfer without leaving their inbox.</p>
        </li>
      </ul>
    </div>
  </section>

  <!-- Pricing -->
  <section class="section" id="pricing" aria-labelledby="pricing-title">
    <div class="wrap">
      <h2 id="pricing-title">Pricing</h2>
      <p>Every plan starts with a free trial, and you can change plan whenever you like.</p>

      <div class="billing" role="group" aria-label="Billing period">
        <button type="button" class="seg" data-period="monthly" aria-pressed="true">Monthly</button>
        <button type="button" class="seg" data-period="yearly" aria-pressed="false">Yearly — 2 months free</button>
      </div>
      <p class="period-note" id="period-note" aria-live="polite">Billed monthly. Cancel any time.</p>
      <noscript>
        <p class="noscript-note">Yearly plans are two months free: Starter $90 a year, Pro $190 a year, Team $490 a year.</p>
      </noscript>

      <ul class="plans">
        <li class="plan">
          <h3>Starter</h3>
          <p class="price">
            <span class="amount" data-monthly="$9" data-yearly="$90">$9</span>
            <span class="per" data-monthly="per month" data-yearly="per year">per month</span>
          </p>
          <span class="plan-save" data-monthly="" data-yearly="You save $18"></span>
          <ul class="ticks">
            <li>5 clients</li>
            <li>PDF invoices</li>
          </ul>
          <a class="btn btn-outline" href="#signup" aria-label="Start free trial on the Starter plan">Start free trial</a>
        </li>

        <li class="plan is-featured">
          <span class="badge">Most popular</span>
          <h3>Pro</h3>
          <p class="price">
            <span class="amount" data-monthly="$19" data-yearly="$190">$19</span>
            <span class="per" data-monthly="per month" data-yearly="per year">per month</span>
          </p>
          <span class="plan-save" data-monthly="" data-yearly="You save $38"></span>
          <ul class="ticks">
            <li>Unlimited clients</li>
            <li>Automatic reminders</li>
            <li>Your own logo</li>
          </ul>
          <a class="btn btn-primary" href="#signup" aria-label="Start free trial on the Pro plan">Start free trial</a>
        </li>

        <li class="plan">
          <h3>Team</h3>
          <p class="price">
            <span class="amount" data-monthly="$49" data-yearly="$490">$49</span>
            <span class="per" data-monthly="per month" data-yearly="per year">per month</span>
          </p>
          <span class="plan-save" data-monthly="" data-yearly="You save $98"></span>
          <ul class="ticks">
            <li>Everything in Pro</li>
            <li>5 seats</li>
            <li>A shared client list</li>
          </ul>
          <a class="btn btn-outline" href="#signup" aria-label="Start free trial on the Team plan">Start free trial</a>
        </li>
      </ul>
    </div>
  </section>

  <!-- FAQ -->
  <section class="section" aria-labelledby="faq-title">
    <div class="wrap narrow">
      <h2 id="faq-title">Questions</h2>
      <div class="faq">
        <details>
          <summary><h3>Can I cancel any time?</h3><span class="chev" aria-hidden="true"></span></summary>
          <div class="answer"><p>Yes. Cancel from your account page and you won't be charged again. Nothing is locked in.</p></div>
        </details>
        <details>
          <summary><h3>Do my clients need an account?</h3><span class="chev" aria-hidden="true"></span></summary>
          <div class="answer"><p>No. They open a link, see the invoice and pay. They never have to sign up.</p></div>
        </details>
        <details>
          <summary><h3>Which currencies can I invoice in?</h3><span class="chev" aria-hidden="true"></span></summary>
          <div class="answer"><p>You can invoice in 30 currencies, and each invoice shows the amount in your client's currency.</p></div>
        </details>
        <details>
          <summary><h3>What happens when the free trial ends?</h3><span class="chev" aria-hidden="true"></span></summary>
          <div class="answer"><p>You pick a plan. If you don't, your account switches to view-only and your invoices stay safe for 90 days.</p></div>
        </details>
      </div>
    </div>
  </section>

  <!-- Sign-up -->
  <section class="signup" id="signup" aria-labelledby="signup-title">
    <div class="wrap">
      <h2 id="signup-title">Ready to send your first invoice?</h2>
      <p>Add your details, pick a client and have an invoice out the door in a minute.</p>
      <!-- Point this at your real sign-up URL -->
      <a class="btn btn-primary btn-lg" href="/signup">Start free trial</a>
      <p class="fine" style="margin-top:1rem">Free trial, no card needed.</p>
    </div>
  </section>

</main>

<footer class="site-foot">
  <div class="wrap">
    <p style="margin:0">Brindlebill — invoicing for freelancers.</p>
    <!-- Add your privacy policy, terms and contact links here. -->
  </div>
</footer>

<script>
(function () {
  var segs = document.querySelectorAll('.seg');
  var note = document.getElementById('period-note');
  var swappable = document.querySelectorAll('[data-monthly][data-yearly]');
  var notes = {
    monthly: 'Billed monthly. Cancel any time.',
    yearly: 'Billed once a year, with two months free. Cancel any time.'
  };

  function setPeriod(period) {
    for (var i = 0; i < segs.length; i++) {
      segs[i].setAttribute('aria-pressed', String(segs[i].getAttribute('data-period') === period));
    }
    for (var j = 0; j < swappable.length; j++) {
      swappable[j].textContent = swappable[j].getAttribute('data-' + period);
    }
    note.textContent = notes[period];
  }

  for (var k = 0; k < segs.length; k++) {
    segs[k].addEventListener('click', function () {
      setPeriod(this.getAttribute('data-period'));
    });
  }

  setPeriod('monthly');
})();
</script>
</body>
</html>

A few notes on the choices:

  • Yearly maths: two months free gives whole-year prices of $90, $190 and $490, and the label switches from "per month" to "per year" so nothing is divided back into months. A "You save $18 / $38 / $98" line appears only on yearly.
  • The switch is two real buttons in a labelled group using aria-pressed, so it works with a keyboard and screen readers, and the billing sentence underneath updates in a live region. With JavaScript off, the monthly prices show and a <noscript> line states the yearly prices.
  • FAQ uses <details>/<summary>, so it opens and closes without JavaScript; the chevron is CSS and the answers are your wording verbatim.
  • Two things to change before launch are flagged in a comment at the top of the file: the /signup link in the sign-up band, and adding your trial length to the "Free trial" lines if it's fixed.
  • Floor2/2, 100% passed
  • Middle4/4, 100% passed
  • Top3/3, 100% passed
9 of 9 checks passedfloor 2/2, middle 4/4, top 3/3
  • Passed.
    The page loads with no errors in the console
    Floor Page test
  • Passed.
    Every section is there, with the exact plan names, prices and text
    Floor Page test
  • Passed.
    No sideways scroll on a 375 px phone
    Middle Page test
  • Passed.
    Nothing is loaded from outside the file
    Middle Page test
  • Passed.
    One h1, no skipped heading levels, text 16 px or larger, enough contrast
    Middle Page test
  • Passed.
    The page looks finished: clear hierarchy, pricing easy to compare, nothing broken
    Middle Read
  • Passed.
    Yearly shows $90, $190 and $490, and Monthly brings back $9, $19, $49
    Top Page test
  • Passed.
    Each FAQ question opens and closes from the keyboard
    Top Page test
  • Passed.
    Still no sideways scroll on a phone with Yearly on and every FAQ open
    Top Page test
  • Took 4 min 3 s.
  • First words after 3 min 5 s.
  • Wrote 22,003 tokens, 14,967 of them thinking.
  • 56¢ at API prices.
All numbers.
Time to finish4 min 3 s
Time to first words3 min 5 s
Input tokens2
Cached tokens1,265
Output tokens22,003
Thinking tokens14,967
Words in the answer1,349
Price at API rates56¢
B02Build a dashboard from a picture of its designLow 6/7Max 7/7Max +1

What it asks for. Sends a picture of a designer's mockup, an admin dashboard for a small bike repair shop, and asks for it to be built as one HTML file that matches the layout, colours, spacing and text as closely as it can. The bar chart has to be drawn to scale. On a phone the page must stack into one column, hide the sidebar behind a menu button and never scroll sideways.

Max effort passed 1 more check than low.

AI answer from Opus 5 · low effort · 2 Oct 2026

6 of 7

Screenshot of the page built in this answer, at a desktop width of 1280 pixels
Our screenshot, 1280 by 800. Open it for the full length.
Screenshot of the page built in this answer, at a phone width of 375 pixels
Phone, 375 by 812.
More screenshots (1).
Screenshot of the page built in this answer, at a phone width of 375 pixels
Show the code and the answer.

Here's the complete single-file build:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Overview — Tarnwick Bikeworks</title>
<style>
  :root{
    --navy:#172338;
    --navy-dark:#101a2b;
    --blue:#3b76e8;
    --page:#f4f6fa;
    --card:#ffffff;
    --border:#e6e9f0;
    --text:#1b2436;
    --muted:#6b7488;
    --green:#15924f;
    --red:#d9453a;
    --sidebar-w:240px;
  }
  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;}
  body{
    background:var(--page);
    color:var(--text);
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
    font-size:14px;
    line-height:1.4;
    -webkit-font-smoothing:antialiased;
    overflow-x:hidden;
  }

  /* ---------- Sidebar ---------- */
  .sidebar{
    position:fixed;
    top:0; left:0; bottom:0;
    width:var(--sidebar-w);
    background:var(--navy);
    padding:0 12px 24px;
    z-index:40;
    overflow-y:auto;
  }
  .brand{
    color:#fff;
    font-size:15px;
    font-weight:700;
    letter-spacing:.2px;
    padding:22px 12px;
    border-bottom:1px solid rgba(255,255,255,.08);
    margin:0 -12px 16px;
    padding-left:24px;
  }
  .nav{list-style:none;margin:0;padding:0;}
  .nav li{margin-bottom:4px;}
  .nav a{
    display:flex;
    align-items:center;
    gap:12px;
    padding:10px 12px;
    border-radius:8px;
    color:#aeb7c7;
    text-decoration:none;
    font-size:14px;
    font-weight:500;
  }
  .nav a:hover{background:rgba(255,255,255,.06);color:#e7ebf2;}
  .nav a.active{background:var(--blue);color:#fff;font-weight:600;}
  .nav .box{
    width:15px;height:15px;
    border:2px solid currentColor;
    border-radius:4px;
    flex:0 0 auto;
    opacity:.9;
  }

  /* ---------- Topbar ---------- */
  .main{margin-left:var(--sidebar-w);min-width:0;}
  .topbar{
    background:#fff;
    border-bottom:1px solid var(--border);
    height:64px;
    display:flex;
    align-items:center;
    gap:16px;
    padding:0 24px;
  }
  .page-title{font-size:19px;font-weight:700;margin:0;}
  .search{
    position:relative;
    margin-left:auto;
    width:290px;
    max-width:100%;
  }
  .search input{
    width:100%;
    height:34px;
    border:1px solid var(--border);
    background:#f7f8fb;
    border-radius:8px;
    padding:0 12px 0 34px;
    font-size:13px;
    color:var(--text);
    font-family:inherit;
    outline:none;
  }
  .search input::placeholder{color:#9aa2b2;}
  .search input:focus{border-color:#c3d0ea;background:#fff;}
  .search svg{
    position:absolute;
    left:11px; top:50%;
    transform:translateY(-50%);
    width:14px;height:14px;
    stroke:#9aa2b2;fill:none;stroke-width:2;
  }
  .avatar{
    width:34px;height:34px;
    border-radius:50%;
    background:var(--navy);
    color:#fff;
    font-size:12px;
    font-weight:700;
    display:flex;align-items:center;justify-content:center;
    flex:0 0 auto;
  }
  .menu-btn{
    display:none;
    width:36px;height:36px;
    border:1px solid var(--border);
    background:#fff;
    border-radius:8px;
    padding:0;
    cursor:pointer;
    align-items:center;justify-content:center;
    flex:0 0 auto;
  }
  .menu-btn span{
    display:block;width:16px;height:2px;
    background:var(--text);border-radius:2px;
    position:relative;
  }
  .menu-btn span::before,.menu-btn span::after{
    content:"";position:absolute;left:0;
    width:16px;height:2px;background:var(--text);border-radius:2px;
  }
  .menu-btn span::before{top:-5px;}
  .menu-btn span::after{top:5px;}

  /* ---------- Content ---------- */
  .content{padding:24px;display:flex;flex-direction:column;gap:24px;}
  .card{
    background:var(--card);
    border:1px solid var(--border);
    border-radius:10px;
  }

  .stats{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:32px;
  }
  .stat{padding:18px 20px 16px;}
  .stat .label{color:var(--muted);font-size:13px;}
  .stat .value{font-size:30px;font-weight:700;letter-spacing:-.5px;margin:6px 0 8px;}
  .delta{font-size:12px;font-weight:600;display:flex;align-items:center;gap:5px;}
  .delta.up{color:var(--green);}
  .delta.down{color:var(--red);}
  .delta .arrow{font-size:9px;line-height:1;}

  /* ---------- Chart ---------- */
  .chart-head{
    display:flex;align-items:center;justify-content:space-between;
    padding:18px 22px 0;
  }
  .chart-head h2{font-size:15px;font-weight:700;margin:0;}
  .chart-head .note{font-size:12px;color:var(--muted);}
  .chart{
    display:flex;
    align-items:flex-end;
    gap:4px;
    padding:28px 22px 12px;
    height:210px;
    border-bottom:1px solid var(--border);
    margin:0 22px;
  }
  .col{
    flex:1 1 0;
    min-width:0;
    display:flex;
    flex-direction:column;
    justify-content:flex-end;
    align-items:center;
    height:100%;
  }
  .col .n{font-size:12px;font-weight:700;margin-bottom:6px;}
  .bar{
    width:60px;
    max-width:70%;
    background:var(--blue);
    border-radius:2px;
  }
  .xaxis{
    display:flex;gap:4px;
    padding:8px 22px 20px;
  }
  .xaxis div{flex:1 1 0;text-align:center;font-size:12px;color:var(--muted);}

  /* ---------- Table ---------- */
  .table-head{padding:18px 22px 14px;}
  .table-head h2{font-size:15px;font-weight:700;margin:0;}
  table{width:100%;border-collapse:collapse;}
  thead th{
    background:#f7f8fb;
    border-top:1px solid var(--border);
    border-bottom:1px solid var(--border);
    text-align:left;
    font-size:12px;
    font-weight:600;
    color:var(--muted);
    padding:9px 12px;
    white-space:nowrap;
  }
  tbody td{
    border-bottom:1px solid var(--border);
    padding:13px 12px;
    font-size:13px;
    vertical-align:middle;
  }
  tbody tr:last-child td{border-bottom:0;}
  thead th:first-child,tbody td:first-child{padding-left:22px;}
  thead th:last-child,tbody td:last-child{padding-right:22px;}
  .job-id{font-weight:700;}
  .pill{
    display:inline-block;
    padding:4px 11px;
    border-radius:999px;
    font-size:12px;
    font-weight:600;
    white-space:nowrap;
  }
  .pill.ready{background:#d7f3e2;color:#16693f;}
  .pill.progress{background:#fdeecd;color:#8a5c10;}
  .pill.parts{background:#e5dcfb;color:#5a3fb0;}

  .table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;}
  .scrim{display:none;}

  /* ---------- Mobile ---------- */
  @media (max-width:860px){
    .stats{grid-template-columns:1fr;gap:16px;}
  }
  @media (max-width:760px){
    .sidebar{
      transform:translateX(-100%);
      transition:transform .22s ease;
      width:250px;
      box-shadow:0 0 40px rgba(0,0,0,.25);
    }
    body.nav-open .sidebar{transform:translateX(0);}
    body.nav-open{overflow:hidden;}
    .scrim{
      display:block;
      position:fixed;inset:0;
      background:rgba(14,20,33,.45);
      opacity:0;pointer-events:none;
      transition:opacity .22s ease;
      z-index:30;
    }
    body.nav-open .scrim{opacity:1;pointer-events:auto;}
    .main{margin-left:0;}
    .menu-btn{display:flex;}
    .topbar{padding:0 14px;gap:12px;height:60px;}
    .page-title{font-size:17px;}
    .search{
      order:4;
      width:100%;
      margin-left:0;
      padding-bottom:0;
    }
    .topbar{flex-wrap:wrap;height:auto;padding:12px 14px;}
    .search{margin-top:10px;}
    .content{padding:16px;gap:16px;}
    .stat .value{font-size:27px;}
    .chart{padding:24px 12px 12px;margin:0 12px;height:190px;}
    .xaxis{padding:8px 12px 18px;}
    .bar{width:100%;}
    .chart-head{padding:16px 14px 0;}
    .table-head,thead th:first-child,tbody td:first-child{padding-left:14px;}
    thead th:last-child,tbody td:last-child{padding-right:14px;}
  }
</style>
</head>
<body>

<aside class="sidebar" id="sidebar">
  <div class="brand">Tarnwick Bikeworks</div>
  <nav>
    <ul class="nav">
      <li><a href="#" class="active"><span class="box"></span>Overview</a></li>
      <li><a href="#"><span class="box"></span>Jobs</a></li>
      <li><a href="#"><span class="box"></span>Bookings</a></li>
      <li><a href="#"><span class="box"></span>Stock</a></li>
      <li><a href="#"><span class="box"></span>Reports</a></li>
    </ul>
  </nav>
</aside>

<div class="scrim" id="scrim"></div>

<div class="main">
  <header class="topbar">
    <button class="menu-btn" id="menuBtn" aria-label="Open menu" aria-expanded="false"><span></span></button>
    <h1 class="page-title">Overview</h1>
    <div class="search">
      <svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="7"/><line x1="16.5" y1="16.5" x2="21" y2="21"/></svg>
      <input type="text" placeholder="Search jobs and bikes" aria-label="Search jobs and bikes">
    </div>
    <div class="avatar">TB</div>
  </header>

  <main class="content">

    <section class="stats">
      <div class="card stat">
        <div class="label">Revenue</div>
        <div class="value">$8,460</div>
        <div class="delta up"><span class="arrow">▲</span>12.4% vs last week</div>
      </div>
      <div class="card stat">
        <div class="label">Jobs completed</div>
        <div class="value">130</div>
        <div class="delta up"><span class="arrow">▲</span>8.3% vs last week</div>
      </div>
      <div class="card stat">
        <div class="label">Open bookings</div>
        <div class="value">24</div>
        <div class="delta down"><span class="arrow">▼</span>6.0% vs last week</div>
      </div>
    </section>

    <section class="card">
      <div class="chart-head">
        <h2>Completed per day</h2>
        <span class="note">Last 7 days</span>
      </div>
      <!-- bars scale off max = 31 -->
      <div class="chart">
        <div class="col"><span class="n">14</span><div class="bar" style="height:45.2%"></div></div>
        <div class="col"><span class="n">22</span><div class="bar" style="height:71.0%"></div></div>
        <div class="col"><span class="n">18</span><div class="bar" style="height:58.1%"></div></div>
        <div class="col"><span class="n">27</span><div class="bar" style="height:87.1%"></div></div>
        <div class="col"><span class="n">31</span><div class="bar" style="height:100%"></div></div>
        <div class="col"><span class="n">12</span><div class="bar" style="height:38.7%"></div></div>
        <div class="col"><span class="n">6</span><div class="bar" style="height:19.4%"></div></div>
      </div>
      <div class="xaxis">
        <div>Mon</div><div>Tue</div><div>Wed</div><div>Thu</div>
        <div>Fri</div><div>Sat</div><div>Sun</div>
      </div>
    </section>

    <section class="card">
      <div class="table-head"><h2>Recent jobs</h2></div>
      <div class="table-wrap">
        <table>
          <thead>
            <tr><th>Job</th><th>Bike</th><th>Work</th><th>Due</th><th>Status</th></tr>
          </thead>
          <tbody>
            <tr><td class="job-id">#2041</td><td>Trail hardtail</td><td>Gear tune and chain</td><td>12 Mar</td><td><span class="pill ready">Ready for pickup</span></td></tr>
            <tr><td class="job-id">#2040</td><td>Commuter 700c</td><td>Brake pads, both wheels</td><td>12 Mar</td><td><span class="pill progress">In progress</span></td></tr>
            <tr><td class="job-id">#2039</td><td>Folding bike</td><td>New rear tyre</td><td>13 Mar</td><td><span class="pill parts">Waiting for parts</span></td></tr>
            <tr><td class="job-id">#2038</td><td>Road racer</td><td>Full service</td><td>14 Mar</td><td><span class="pill progress">In progress</span></td></tr>
            <tr><td class="job-id">#2037</td><td>Cargo trike</td><td>Wheel true, front</td><td>14 Mar</td><td><span class="pill ready">Ready for pickup</span></td></tr>
          </tbody>
        </table>
      </div>
    </section>

  </main>
</div>

<script>
  var btn = document.getElementById('menuBtn');
  var scrim = document.getElementById('scrim');
  function setNav(open){
    document.body.classList.toggle('nav-open', open);
    btn.setAttribute('aria-expanded', open ? 'true' : 'false');
  }
  btn.addEventListener('click', function(){
    setNav(!document.body.classList.contains('nav-open'));
  });
  scrim.addEventListener('click', function(){ setNav(false); });
  document.addEventListener('keydown', function(e){
    if(e.key === 'Escape') setNav(false);
  });
  document.querySelectorAll('.sidebar a').forEach(function(a){
    a.addEventListener('click', function(){ setNav(false); });
  });
</script>
</body>
</html>

A few notes on how it's put together:

  • Bar heights are percentages of the tallest value (31 = 100%), so they're genuinely to scale. If you swap in real numbers, just divide each by the max.
  • Sidebar is position: fixed on desktop with a margin-left on the content; under 760px it slides off-canvas and the hamburger toggles a nav-open class on <body>, with a dim scrim, Escape key and click-outside to close.
  • No sideways scroll: overflow-x: hidden on the body, the off-canvas panel is translated rather than laid out beside the content, and the only horizontally scrollable element is the jobs table itself (wrapped in .table-wrap), which keeps the five columns readable on a narrow screen without pushing the page wide.
  • Fonts are the system stack, the search icon is inline SVG, and the status pills use tinted backgrounds matching the mockup's green/amber/purple.
  • Floor2/2, 100% passed
  • Middle2/2, 100% passed
  • Top2/3, 67% passed
6 of 7 checks passedfloor 2/2, middle 2/2, top 2/3
  • Passed.
    Page loads with no console errors and nothing fetched from outside
    Floor Page test
  • Passed.
    Every word and number in the picture is on the page
    Floor Page test
  • Passed.
    Wide screen: full-height left sidebar, three cards in a row, table cells in the right columns
    Middle Page test
  • Passed.
    Sidebar, active item, accent blue and the three status pills match the picture
    Middle Page test
  • Missed.
    Chart bars run Mon to Sun with heights in proportion to their valuestest group failed
    Top Page test
  • Passed.
    On a phone: no sideways scroll, cards stacked, sidebar hidden until a menu button opens it
    Top Page test
  • Passed.
    Side by side with the picture, a designer would accept it as a faithful build
    Top Read
  • Took 56 s.
  • First words after 2.6 s.
  • Wrote 5,899 tokens, 16 of them thinking.
  • 16¢ at API prices.
All numbers.
Time to finish56 s
Time to first words2.6 s
Input tokens2
Cached tokens2,320
Output tokens5,899
Thinking tokens16
Words in the answer886
Price at API rates16¢

AI answer from Opus 5 · max effort · 2 Oct 2026

7 of 7

Screenshot of the page built in this answer, at a desktop width of 1280 pixels
Our screenshot, 1280 by 800. Open it for the full length.
Screenshot of the page built in this answer, at a phone width of 375 pixels
Phone, 375 by 812.
More screenshots (1).
Screenshot of the page built in this answer, at a phone width of 375 pixels
Show the code and the answer.

Here's the whole thing as a single self-contained file — no libraries, no external fonts or images (the search/menu icons are inline SVG, and the chart is plain HTML/CSS with bar heights computed from the numbers).

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Overview — Tarnwick Bikeworks</title>
<style>
  :root{
    --navy:#1b2a3f;
    --blue:#3b82f6;
    --page:#f2f4f8;
    --card:#ffffff;
    --line:#e6e9ef;
    --row-line:#eef1f5;
    --ink:#0f172a;
    --body:#334155;
    --muted:#64748b;
    --green:#16a34a;
    --red:#dc2626;
    --radius:10px;
    --shadow:0 1px 2px rgba(16,24,40,.06);
  }

  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;}
  html{-webkit-text-size-adjust:100%;}
  body{
    background:var(--page);
    color:var(--body);
    font:14px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif;
    overflow-x:hidden;
  }
  a{color:inherit;text-decoration:none;}
  button{font:inherit;}
  :focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:6px;}

  .app{display:flex;min-height:100vh;}

  /* ---------- Sidebar ---------- */
  .sidebar{
    width:240px;flex:0 0 240px;
    background:var(--navy);color:#fff;
  }
  .brand{
    height:64px;display:flex;align-items:center;
    padding:0 24px;font-size:15px;font-weight:700;letter-spacing:.1px;
    border-bottom:1px solid rgba(255,255,255,.08);
  }
  .nav{display:flex;flex-direction:column;gap:6px;padding:22px 12px;}
  .nav-item{
    display:flex;align-items:center;gap:12px;
    padding:9px 16px;border-radius:8px;
    font-size:14px;font-weight:500;color:rgba(255,255,255,.78);
  }
  .nav-item:hover{background:rgba(255,255,255,.07);color:#fff;}
  .nav-item.is-active{background:var(--blue);color:#fff;font-weight:600;}
  .nav-icon{
    width:15px;height:15px;flex:none;border:1.6px solid rgba(255,255,255,.5);border-radius:4px;
  }
  .nav-item.is-active .nav-icon{border-color:#fff;}

  /* ---------- Main column ---------- */
  .main{flex:1;min-width:0;display:flex;flex-direction:column;}

  .topbar{
    height:64px;background:#fff;border-bottom:1px solid var(--line);
    display:flex;align-items:center;gap:16px;padding:0 32px;
  }
  .page-title{margin:0;font-size:20px;font-weight:700;color:var(--ink);}

  .menu-btn{
    display:none;align-items:center;justify-content:center;
    width:38px;height:38px;margin-left:-6px;
    background:#fff;border:1px solid var(--line);border-radius:8px;
    color:var(--ink);cursor:pointer;
  }
  .menu-btn:hover{background:#f8fafc;}

  .search{position:relative;margin-left:auto;width:290px;max-width:100%;}
  .search svg{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:#94a3b8;}
  .search input{
    width:100%;height:38px;border:1px solid #e2e8f0;border-radius:8px;
    background:#fff;padding:0 12px 0 34px;font-size:13.5px;color:var(--ink);
    -webkit-appearance:none;appearance:none;
  }
  .search input::placeholder{color:#94a3b8;}
  .search input:focus{outline:none;border-color:#bfdbfe;box-shadow:0 0 0 3px rgba(59,130,246,.15);}

  .avatar{
    margin-left:46px;flex:none;
    width:34px;height:34px;border-radius:50%;
    background:var(--navy);color:#fff;
    display:flex;align-items:center;justify-content:center;
    font-size:12.5px;font-weight:700;letter-spacing:.3px;
  }

  .content{padding:32px;display:flex;flex-direction:column;gap:32px;}

  .card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);}

  /* ---------- Stat cards ---------- */
  .stats{display:grid;grid-template-columns:repeat(3,1fr);gap:32px;}
  .stat{padding:16px 20px;}
  .stat-label{font-size:13px;color:var(--muted);}
  .stat-value{margin:6px 0 8px;font-size:30px;line-height:1.1;font-weight:700;color:var(--ink);letter-spacing:-.5px;}
  .stat-delta{display:flex;align-items:center;gap:6px;font-size:12.5px;font-weight:600;}
  .stat-delta.up{color:var(--green);}
  .stat-delta.down{color:var(--red);}
  .stat-delta i{font-style:normal;font-size:10px;line-height:1;}
  .stat-delta span{color:inherit;}

  /* ---------- Chart ---------- */
  .chart-card{padding:18px 24px 16px;}
  .card-head{display:flex;align-items:center;justify-content:space-between;gap:16px;}
  .card-title{margin:0;font-size:15px;font-weight:700;color:var(--ink);}
  .card-note{font-size:12.5px;color:var(--muted);}

  .plot{
    --maxbar:124px;
    display:flex;align-items:flex-end;
    height:156px;margin-top:14px;
    border-bottom:1px solid var(--line);
  }
  .col{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;}
  .val{font-size:12px;font-weight:700;color:var(--ink);margin-bottom:6px;}
  .bar{
    width:60%;max-width:56px;min-height:3px;
    height:calc(var(--maxbar) * var(--v) / 31);
    background:var(--blue);border-radius:2px 2px 0 0;
  }
  .xaxis{display:flex;margin-top:9px;}
  .xaxis span{flex:1;min-width:0;text-align:center;font-size:12.5px;color:var(--muted);}

  /* ---------- Jobs table ---------- */
  .jobs-card{padding:0;overflow:hidden;}
  .jobs-card .card-head{padding:18px 24px 14px;}
  table{width:100%;border-collapse:collapse;}
  thead th{
    background:#f8fafc;border-top:1px solid var(--row-line);border-bottom:1px solid var(--row-line);
    text-align:left;font-size:12.5px;font-weight:600;color:var(--muted);
    padding:8px 16px;white-space:nowrap;
  }
  tbody td{
    padding:13px 16px;font-size:13.5px;color:var(--body);
    border-bottom:1px solid var(--row-line);vertical-align:middle;
  }
  tbody tr:last-child td{border-bottom:0;}
  th:first-child,td:first-child{padding-left:24px;}
  th:last-child,td:last-child{padding-right:24px;}
  .c-job{width:110px;}
  .c-bike{width:180px;}
  .c-due{width:120px;}
  .c-status{width:200px;}
  td.job{font-weight:700;color:var(--ink);}

  .pill{
    display:inline-block;padding:5px 11px;border-radius:999px;
    font-size:12px;font-weight:600;white-space:nowrap;
  }
  .pill.ready{background:#dcf5e5;color:#14804a;}
  .pill.progress{background:#fdf0cd;color:#9a6700;}
  .pill.parts{background:#e9e3fd;color:#6b35d6;}

  .scrim{display:none;}

  /* ---------- Mobile ---------- */
  @media (max-width:860px){
    .menu-btn{display:inline-flex;}

    .sidebar{
      position:fixed;top:0;bottom:0;left:0;z-index:60;
      width:260px;max-width:82vw;flex:none;
      transform:translateX(-100%);transition:transform .25s ease;
      overflow-y:auto;
    }
    body.nav-open .sidebar{transform:none;box-shadow:0 0 40px rgba(2,6,23,.35);}
    body.nav-open{overflow:hidden;}

    .scrim{
      display:block;position:fixed;inset:0;z-index:50;
      background:rgba(15,23,42,.45);
      opacity:0;visibility:hidden;transition:opacity .25s ease,visibility .25s ease;
    }
    body.nav-open .scrim{opacity:1;visibility:visible;}

    .topbar{height:auto;flex-wrap:wrap;row-gap:12px;padding:12px 16px;}
    .search{order:3;flex:0 0 100%;width:100%;margin-left:0;}
    .avatar{margin-left:auto;}

    .content{padding:20px 16px 28px;gap:16px;}
    .stats{grid-template-columns:1fr;gap:16px;}
    .stat-value{font-size:28px;}
  }

  @media (max-width:640px){
    .chart-card{padding:16px 16px 14px;}
    .plot{--maxbar:100px;height:128px;}
    .val{font-size:11px;}
    .xaxis span{font-size:11.5px;}
    .bar{width:66%;}

    .jobs-card .card-head{padding:16px 16px 10px;}
    table,tbody,tr,td{display:block;width:100%;}
    thead{display:none;}
    tbody tr{padding:12px 16px;border-top:1px solid var(--row-line);}
    tbody tr:first-child{border-top:1px solid var(--row-line);}
    tbody td{
      display:flex;align-items:center;justify-content:space-between;gap:16px;
      padding:4px 0;border:0;text-align:right;
    }
    tbody td::before{
      content:attr(data-label);
      font-size:12.5px;font-weight:600;color:var(--muted);text-align:left;
    }
    td.job{font-size:14px;}
  }

  @media (prefers-reduced-motion:reduce){
    .sidebar,.scrim{transition:none;}
  }
</style>
</head>
<body>

<div class="app">
  <div class="scrim" id="scrim"></div>

  <aside class="sidebar" id="sidebar">
    <div class="brand">Tarnwick Bikeworks</div>
    <nav class="nav" aria-label="Main">
      <a class="nav-item is-active" href="#" aria-current="page"><span class="nav-icon"></span>Overview</a>
      <a class="nav-item" href="#"><span class="nav-icon"></span>Jobs</a>
      <a class="nav-item" href="#"><span class="nav-icon"></span>Bookings</a>
      <a class="nav-item" href="#"><span class="nav-icon"></span>Stock</a>
      <a class="nav-item" href="#"><span class="nav-icon"></span>Reports</a>
    </nav>
  </aside>

  <div class="main">
    <header class="topbar">
      <button class="menu-btn" id="menuBtn" aria-controls="sidebar" aria-expanded="false" aria-label="Open menu">
        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true">
          <path d="M4 7h16M4 12h16M4 17h16"/>
        </svg>
      </button>

      <h1 class="page-title">Overview</h1>

      <div class="search">
        <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true">
          <circle cx="11" cy="11" r="7"/><path d="m20 20-3.2-3.2"/>
        </svg>
        <input type="search" placeholder="Search jobs and bikes" aria-label="Search jobs and bikes">
      </div>

      <div class="avatar" title="Tarnwick Bikeworks">TB</div>
    </header>

    <main class="content">

      <section class="stats" aria-label="Key figures">
        <div class="card stat">
          <div class="stat-label">Revenue</div>
          <div class="stat-value">$8,460</div>
          <div class="stat-delta up"><i aria-hidden="true">▲</i>12.4% vs last week</div>
        </div>
        <div class="card stat">
          <div class="stat-label">Jobs completed</div>
          <div class="stat-value">130</div>
          <div class="stat-delta up"><i aria-hidden="true">▲</i>8.3% vs last week</div>
        </div>
        <div class="card stat">
          <div class="stat-label">Open bookings</div>
          <div class="stat-value">24</div>
          <div class="stat-delta down"><i aria-hidden="true">▼</i>6.0% vs last week</div>
        </div>
      </section>

      <section class="card chart-card" aria-label="Completed per day">
        <div class="card-head">
          <h2 class="card-title">Completed per day</h2>
          <span class="card-note">Last 7 days</span>
        </div>

        <div class="plot">
          <div class="col"><span class="val">14</span><div class="bar" style="--v:14"></div></div>
          <div class="col"><span class="val">22</span><div class="bar" style="--v:22"></div></div>
          <div class="col"><span class="val">18</span><div class="bar" style="--v:18"></div></div>
          <div class="col"><span class="val">27</span><div class="bar" style="--v:27"></div></div>
          <div class="col"><span class="val">31</span><div class="bar" style="--v:31"></div></div>
          <div class="col"><span class="val">12</span><div class="bar" style="--v:12"></div></div>
          <div class="col"><span class="val">6</span><div class="bar" style="--v:6"></div></div>
        </div>
        <div class="xaxis">
          <span>Mon</span><span>Tue</span><span>Wed</span><span>Thu</span>
          <span>Fri</span><span>Sat</span><span>Sun</span>
        </div>
      </section>

      <section class="card jobs-card" aria-label="Recent jobs">
        <div class="card-head">
          <h2 class="card-title">Recent jobs</h2>
        </div>

        <table>
          <thead>
            <tr>
              <th class="c-job">Job</th>
              <th class="c-bike">Bike</th>
              <th>Work</th>
              <th class="c-due">Due</th>
              <th class="c-status">Status</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td class="job" data-label="Job">#2041</td>
              <td data-label="Bike">Trail hardtail</td>
              <td data-label="Work">Gear tune and chain</td>
              <td data-label="Due">12 Mar</td>
              <td data-label="Status"><span class="pill ready">Ready for pickup</span></td>
            </tr>
            <tr>
              <td class="job" data-label="Job">#2040</td>
              <td data-label="Bike">Commuter 700c</td>
              <td data-label="Work">Brake pads, both wheels</td>
              <td data-label="Due">12 Mar</td>
              <td data-label="Status"><span class="pill progress">In progress</span></td>
            </tr>
            <tr>
              <td class="job" data-label="Job">#2039</td>
              <td data-label="Bike">Folding bike</td>
              <td data-label="Work">New rear tyre</td>
              <td data-label="Due">13 Mar</td>
              <td data-label="Status"><span class="pill parts">Waiting for parts</span></td>
            </tr>
            <tr>
              <td class="job" data-label="Job">#2038</td>
              <td data-label="Bike">Road racer</td>
              <td data-label="Work">Full service</td>
              <td data-label="Due">14 Mar</td>
              <td data-label="Status"><span class="pill progress">In progress</span></td>
            </tr>
            <tr>
              <td class="job" data-label="Job">#2037</td>
              <td data-label="Bike">Cargo trike</td>
              <td data-label="Work">Wheel true, front</td>
              <td data-label="Due">14 Mar</td>
              <td data-label="Status"><span class="pill ready">Ready for pickup</span></td>
            </tr>
          </tbody>
        </table>
      </section>

    </main>
  </div>
</div>

<script>
(function () {
  var body = document.body,
      btn  = document.getElementById('menuBtn'),
      scrim = document.getElementById('scrim');

  function openNav()  { body.classList.add('nav-open');    btn.setAttribute('aria-expanded', 'true');  btn.setAttribute('aria-label', 'Close menu'); }
  function closeNav() { body.classList.remove('nav-open'); btn.setAttribute('aria-expanded', 'false'); btn.setAttribute('aria-label', 'Open menu'); }

  btn.addEventListener('click', function () {
    body.classList.contains('nav-open') ? closeNav() : openNav();
  });

  scrim.addEventListener('click', closeNav);

  document.addEventListener('keydown', function (e) {
    if (e.key === 'Escape' && body.classList.contains('nav-open')) { closeNav(); btn.focus(); }
  });

  Array.prototype.forEach.call(document.querySelectorAll('.nav-item'), function (link) {
    link.addEventListener('click', closeNav);
  });

  window.addEventListener('resize', function () {
    if (window.innerWidth > 860) closeNav();
  });
})();
</script>

</body>
</html>

A few notes on how it works and the judgement calls I made:

  • Chart scale. Each bar carries style="--v:14" etc. and its height is calc(var(--maxbar) * var(--v) / 31), where 31 is the week's peak (Friday). So the bars are strictly proportional, and on narrow screens only --maxbar changes — the ratios stay correct.
  • Mobile. Below 860px the sidebar becomes a fixed off-canvas drawer with a dimmed overlay, toggled by the hamburger button in the header (closes on overlay click, Escape, nav link click, or resize back to desktop). The stat cards drop to one column and the search field moves to its own full-width row.
  • No sideways scroll. overflow-x:hidden on the body, min-width:0 on the flex children, and below 640px the jobs table reflows into stacked label/value rows instead of a wide grid, so nothing forces the page wider than the viewport.
  • Colours are eyeballed from the mockup (navy #1b2a3f, blue #3b82f6, page #f2f4f8, plus the green/amber/purple status pills). They're all CSS variables at the top, so if your designer has exact hex values it's a one-line change each.
  • Fonts are the system UI stack, and the only graphics are two tiny inline SVGs (search and menu icons) — no external requests at all.
  • Floor2/2, 100% passed
  • Middle2/2, 100% passed
  • Top3/3, 100% passed
7 of 7 checks passedfloor 2/2, middle 2/2, top 3/3
  • Passed.
    Page loads with no console errors and nothing fetched from outside
    Floor Page test
  • Passed.
    Every word and number in the picture is on the page
    Floor Page test
  • Passed.
    Wide screen: full-height left sidebar, three cards in a row, table cells in the right columns
    Middle Page test
  • Passed.
    Sidebar, active item, accent blue and the three status pills match the picture
    Middle Page test
  • Passed.
    Chart bars run Mon to Sun with heights in proportion to their values
    Top Page test
  • Passed.
    On a phone: no sideways scroll, cards stacked, sidebar hidden until a menu button opens it
    Top Page test
  • Passed.
    Side by side with the picture, a designer would accept it as a faithful build
    Top Read
  • Took 3 min 38 s.
  • First words after 2 min 39 s.
  • Wrote 18,307 tokens, 11,332 of them thinking.
  • 47¢ at API prices.
All numbers.
Time to finish3 min 38 s
Time to first words2 min 39 s
Input tokens2
Cached tokens2,320
Output tokens18,307
Thinking tokens11,332
Words in the answer1,030
Price at API rates47¢
B03A kanban board that survives a reloadLow 9/9Max 7/9Max −2

What it asks for. Asks for a personal kanban board in one HTML file with three columns: to do, doing and done. Cards are added by typing a title, can be dragged between and within columns, edited and deleted, and each column shows how many cards it holds. The board must survive a reload, work from the keyboard with the arrow keys, show titles that contain code exactly as typed, and fit a phone screen.

Max effort passed 2 fewer checks than low.

AI answer from Opus 5 · low effort · 2 Oct 2026

9 of 9

Screenshot of the page built in this answer, at a desktop width of 1280 pixels
Our screenshot, 1280 by 800. Open it for the full length.
Screenshot of the page built in this answer, at a phone width of 375 pixels
Phone, 375 by 812.
Show the code and the answer.

Here's the complete file — save it as something like kanban.html and open it in your browser.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Kanban</title>
<style>
  :root {
    --bg: #f4f5f7;
    --col: #ebecf0;
    --card: #fff;
    --line: #d8dae0;
    --text: #172b4d;
    --muted: #5e6c84;
    --accent: #0b66c3;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    background: var(--bg);
    color: var(--text);
    font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding: 16px;
    overflow-x: hidden;
  }
  h1 { font-size: 1.25rem; margin: 0 0 12px; }
  .add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
  }
  .add-row input {
    flex: 1 1 180px;
    min-width: 0;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: inherit;
  }
  button {
    font: inherit;
    cursor: pointer;
    border: 1px solid var(--line);
    background: #fff;
    color: inherit;
    border-radius: 6px;
    padding: 8px 12px;
  }
  button:hover { background: #f0f1f4; }
  .add-row button {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
    padding: 10px 16px;
  }
  .add-row button:hover { background: #09529c; }

  .board {
    display: flex;
    gap: 12px;
    align-items: flex-start;
  }
  .column {
    flex: 1 1 0;
    min-width: 0;
    background: var(--col);
    border-radius: 8px;
    padding: 10px;
  }
  .column.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }
  .column h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin: 0 0 10px;
    overflow-wrap: anywhere;
  }
  .column h2 .count { color: var(--text); }
  .cards { list-style: none; margin: 0; padding: 0; min-height: 36px; }
  .empty {
    color: var(--muted);
    font-size: 0.85rem;
    font-style: italic;
    padding: 6px 2px;
  }

  .card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 8px;
    box-shadow: 0 1px 1px rgba(9,30,66,.12);
    cursor: grab;
  }
  .card:focus-visible, .card:focus {
    outline: 3px solid var(--accent);
    outline-offset: 1px;
  }
  .card.dragging { opacity: .4; }
  .card .title {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    margin-bottom: 8px;
  }
  .card .actions { display: flex; gap: 6px; flex-wrap: wrap; }
  .card .actions button { padding: 4px 8px; font-size: 0.8rem; }
  .card input.edit {
    width: 100%;
    min-width: 0;
    padding: 6px;
    font: inherit;
    border: 1px solid var(--accent);
    border-radius: 4px;
    margin-bottom: 8px;
  }
  .hint { color: var(--muted); font-size: 0.8rem; margin: 14px 0 0; }

  @media (max-width: 620px) {
    body { padding: 10px; }
    .board { flex-direction: column; }
    .column { width: 100%; flex: 1 1 auto; }
  }
</style>
</head>
<body>

<h1>Kanban</h1>

<div class="add-row">
  <input id="new-title" type="text" placeholder="New card title" aria-label="New card title" autocomplete="off">
  <button id="add-btn" type="button">Add card</button>
</div>

<div class="board" id="board"></div>

<p class="hint">Tab to a card, then use the arrow keys: left/right to change column, up/down to reorder.</p>

<script>
(function () {
  "use strict";

  var COLUMNS = [
    { key: "todo",  name: "To do" },
    { key: "doing", name: "Doing" },
    { key: "done",  name: "Done" }
  ];
  var STORAGE_KEY = "kanban.board.v1";

  var state = load();
  var nextId = computeNextId();
  var focusId = null;      // card to focus after the next render
  var editingId = null;    // card currently in edit mode

  var boardEl = document.getElementById("board");
  var inputEl = document.getElementById("new-title");

  /* ---------- storage ---------- */

  function emptyState() {
    return { todo: [], doing: [], done: [] };
  }

  function load() {
    try {
      var raw = localStorage.getItem(STORAGE_KEY);
      if (!raw) return emptyState();
      var parsed = JSON.parse(raw);
      var out = emptyState();
      COLUMNS.forEach(function (c) {
        var list = parsed && parsed[c.key];
        if (Array.isArray(list)) {
          list.forEach(function (card) {
            if (card && typeof card.title === "string") {
              out[c.key].push({ id: Number(card.id) || 0, title: card.title });
            }
          });
        }
      });
      return out;
    } catch (e) {
      return emptyState();
    }
  }

  function save() {
    try {
      localStorage.setItem(STORAGE_KEY, JSON.stringify(state));
    } catch (e) { /* storage full or blocked: keep working in memory */ }
  }

  function computeNextId() {
    var max = 0;
    COLUMNS.forEach(function (c) {
      state[c.key].forEach(function (card) {
        if (card.id > max) max = card.id;
      });
    });
    return max + 1;
  }

  /* ---------- helpers ---------- */

  function findCard(id) {
    for (var i = 0; i < COLUMNS.length; i++) {
      var key = COLUMNS[i].key;
      var list = state[key];
      for (var j = 0; j < list.length; j++) {
        if (list[j].id === id) return { colKey: key, colIndex: i, index: j, card: list[j] };
      }
    }
    return null;
  }

  /* ---------- actions ---------- */

  function addCard(rawTitle) {
    var title = String(rawTitle).trim();
    if (!title) return false;
    state.todo.push({ id: nextId++, title: title });
    save();
    render();
    return true;
  }

  function deleteCard(id) {
    var found = findCard(id);
    if (!found) return;
    state[found.colKey].splice(found.index, 1);
    if (editingId === id) editingId = null;
    save();
    render();
  }

  function saveTitle(id, rawTitle) {
    var found = findCard(id);
    if (!found) return;
    var title = String(rawTitle).trim();
    if (title) found.card.title = title;  // empty edit = keep the old title
    editingId = null;
    focusId = id;
    save();
    render();
  }

  // Move a card to a column at a given index. Returns true if anything changed.
  function moveCard(id, toColKey, toIndex) {
    var found = findCard(id);
    if (!found) return false;
    var from = state[found.colKey];
    var to = state[toColKey];

    if (found.colKey === toColKey) {
      if (toIndex > found.index) toIndex--;      // account for its own removal
      if (toIndex < 0) toIndex = 0;
      if (toIndex > to.length - 1) toIndex = to.length - 1;
      if (toIndex === found.index) return false;
      from.splice(found.index, 1);
      to.splice(toIndex, 0, found.card);
    } else {
      if (toIndex < 0) toIndex = 0;
      if (toIndex > to.length) toIndex = to.length;
      from.splice(found.index, 1);
      to.splice(toIndex, 0, found.card);
    }
    save();
    return true;
  }

  function nudge(id, dir) {
    var found = findCard(id);
    if (!found) return;
    var changed = false;

    if (dir === "up") {
      changed = moveCard(id, found.colKey, found.index - 1);
    } else if (dir === "down") {
      changed = moveCard(id, found.colKey, found.index + 2);
    } else {
      var target = found.colIndex + (dir === "left" ? -1 : 1);
      if (target < 0 || target >= COLUMNS.length) return;
      var targetKey = COLUMNS[target].key;
      var at = Math.min(found.index, state[targetKey].length);
      changed = moveCard(id, targetKey, at);
    }

    focusId = id;              // keep focus on the card so arrows can continue
    if (changed) render();
    else focusCard(id);
  }

  function focusCard(id) {
    var el = boardEl.querySelector('.card[data-id="' + id + '"]');
    if (el) el.focus();
  }

  /* ---------- rendering (all text via textContent, never innerHTML) ---------- */

  function buildCard(card, colKey) {
    var li = document.createElement("li");
    li.className = "card";
    li.dataset.id = String(card.id);
    li.draggable = true;
    li.tabIndex = 0;
    li.setAttribute("role", "listitem");

    if (editingId === card.id) {
      var input = document.createElement("input");
      input.type = "text";
      input.className = "edit";
      input.value = card.title;            // value is text, not markup
      input.setAttribute("aria-label", "Edit card title");
      li.draggable = false;
      li.appendChild(input);

      var actions = document.createElement("div");
      actions.className = "actions";

      var saveBtn = document.createElement("button");
      saveBtn.type = "button";
      saveBtn.textContent = "Save";
      saveBtn.addEventListener("click", function () { saveTitle(card.id, input.value); });

      var cancelBtn = document.createElement("button");
      cancelBtn.type = "button";
      cancelBtn.textContent = "Cancel";
      cancelBtn.addEventListener("click", function () {
        editingId = null;
        focusId = card.id;
        render();
      });

      actions.appendChild(saveBtn);
      actions.appendChild(cancelBtn);
      li.appendChild(actions);

      input.addEventListener("keydown", function (e) {
        if (e.key === "Enter") {
          e.preventDefault();
          saveTitle(card.id, input.value);
        } else if (e.key === "Escape") {
          e.preventDefault();
          editingId = null;
          focusId = card.id;
          render();
        }
      });

      return li;
    }

    var title = document.createElement("span");
    title.className = "title";
    title.textContent = card.title;        // <div> and a & b appear literally
    li.appendChild(title);

    var acts = document.createElement("div");
    acts.className = "actions";

    var editBtn = document.createElement("button");
    editBtn.type = "button";
    editBtn.textContent = "Edit";
    editBtn.addEventListener("click", function () {
      editingId = card.id;
      render();
      var inp = boardEl.querySelector('.card[data-id="' + card.id + '"] input.edit');
      if (inp) { inp.focus(); inp.select(); }
    });

    var delBtn = document.createElement("button");
    delBtn.type = "button";
    delBtn.textContent = "Delete";
    delBtn.addEventListener("click", function () { deleteCard(card.id); });

    acts.appendChild(editBtn);
    acts.appendChild(delBtn);
    li.appendChild(acts);

    li.addEventListener("keydown", function (e) {
      if (e.target !== li) return;         // don't hijack typing in the edit field
      var map = { ArrowLeft: "left", ArrowRight: "right", ArrowUp: "up", ArrowDown: "down" };
      var dir = map[e.key];
      if (!dir) return;
      e.preventDefault();
      nudge(card.id, dir);
    });

    li.addEventListener("dragstart", function (e) {
      if (e.dataTransfer) {
        e.dataTransfer.setData("text/plain", String(card.id));
        e.dataTransfer.effectAllowed = "move";
      }
      dragId = card.id;
      li.classList.add("dragging");
    });
    li.addEventListener("dragend", function () {
      dragId = null;
      li.classList.remove("dragging");
      clearTargets();
    });

    return li;
  }

  function render() {
    boardEl.textContent = "";

    COLUMNS.forEach(function (col) {
      var section = document.createElement("section");
      section.className = "column";
      section.dataset.col = col.key;

      var h2 = document.createElement("h2");
      h2.appendChild(document.createTextNode(col.name + " "));
      var count = document.createElement("span");
      count.className = "count";
      count.textContent = String(state[col.key].length);
      h2.appendChild(count);
      section.appendChild(h2);

      var ul = document.createElement("ul");
      ul.className = "cards";
      ul.setAttribute("role", "list");
      ul.setAttribute("aria-label", col.name);

      state[col.key].forEach(function (card) {
        ul.appendChild(buildCard(card, col.key));
      });

      if (state[col.key].length === 0) {
        var empty = document.createElement("div");
        empty.className = "empty";
        empty.textContent = "No cards";
        ul.appendChild(empty);
      }

      section.appendChild(ul);
      wireDrop(section, ul, col.key);
      boardEl.appendChild(section);
    });

    if (focusId !== null) {
      focusCard(focusId);
      focusId = null;
    }
  }

  /* ---------- drag and drop ---------- */

  var dragId = null;

  function clearTargets() {
    var list = boardEl.querySelectorAll(".column.drop-target");
    for (var i = 0; i < list.length; i++) list[i].classList.remove("drop-target");
  }

  function dropIndex(ul, y) {
    var cards = ul.querySelectorAll(".card");
    for (var i = 0; i < cards.length; i++) {
      var r = cards[i].getBoundingClientRect();
      if (y < r.top + r.height / 2) return i;
    }
    return cards.length;
  }

  function wireDrop(section, ul, colKey) {
    section.addEventListener("dragover", function (e) {
      e.preventDefault();
      if (e.dataTransfer) e.dataTransfer.dropEffect = "move";
      section.classList.add("drop-target");
    });
    section.addEventListener("dragleave", function (e) {
      if (!section.contains(e.relatedTarget)) section.classList.remove("drop-target");
    });
    section.addEventListener("drop", function (e) {
      e.preventDefault();
      section.classList.remove("drop-target");
      var id = dragId;
      if (id === null && e.dataTransfer) id = Number(e.dataTransfer.getData("text/plain"));
      if (!id && id !== 0) return;
      var idx = dropIndex(ul, e.clientY);
      var found = findCard(id);
      if (found && found.colKey === colKey) idx = idx + (idx > found.index ? 1 : 0);
      if (moveCard(id, colKey, idx)) {
        focusId = id;
        render();
      }
      dragId = null;
    });
  }

  /* ---------- adding ---------- */

  document.getElementById("add-btn").addEventListener("click", function () {
    if (addCard(inputEl.value)) inputEl.value = "";
    inputEl.focus();
  });

  inputEl.addEventListener("keydown", function (e) {
    if (e.key !== "Enter") return;
    e.preventDefault();
    if (addCard(inputEl.value)) inputEl.value = "";
  });

  render();
})();
</script>
</body>
</html>

A few notes on how it behaves:

  • Nothing external. No fonts, scripts, images or network requests of any kind; it works offline and from a file:// URL.
  • Text safety. Every title goes in via textContent (and input.value while editing), so <div> or a & b is shown character for character and never parsed as markup.
  • Saving. The whole board lives in localStorage under one key, written after every change, so a reload restores the exact columns and order. If storage is blocked it still runs, just without persistence.
  • Keyboard. Each card is tabindex="0", so Tab lands on the card before its Edit/Delete buttons. Arrow keys move it and the card is re-focused after every move, so you can hold a direction and keep going. When crossing columns it tries to keep the same position in the list; when it's already at the edge, nothing happens. Arrow keys inside the edit field are left alone, and Escape cancels an edit.
  • Edits. Enter or Save confirms; a title that's only spaces is treated as "no change" rather than wiping the card.
  • Phone. Below 620px the three columns stack vertically, and long titles wrap with overflow-wrap: anywhere, so there's no horizontal scrolling at 375px. Note that HTML5 drag-and-drop doesn't work with touch on most mobile browsers — on a phone, use the keyboard arrows (or an external keyboard) to move cards; the drag works on desktop.
  • Floor2/2, 100% passed
  • Middle3/3, 100% passed
  • Top4/4, 100% passed
9 of 9 checks passedfloor 2/2, middle 3/3, top 4/4
  • Passed.
    The page loads with no errors and has the three named columns
    Floor Page test
  • Passed.
    Adding a card works with Enter and with the Add card button
    Floor Page test
  • Passed.
    Empty or space-only titles are ignored
    Middle Page test
  • Passed.
    The counts update, and Edit and Delete work
    Middle Page test
  • Passed.
    After a reload the board is exactly as it was
    Middle Page test
  • Passed.
    Dragging moves cards between columns and reorders them, and it survives a reload
    Top Page test
  • Passed.
    A card can be moved with the arrow keys and keeps focus
    Top Page test
  • Passed.
    Titles like <b>hi</b> & <img ...> show exactly as typed and run nothing
    Top Page test
  • Passed.
    No sideways scroll on a 375 px phone, even with very long titles
    Top Page test
  • Took 1 min 5 s.
  • First words after 8.5 s.
  • Wrote 6,719 tokens, 411 of them thinking.
  • 18¢ at API prices.
All numbers.
Time to finish1 min 5 s
Time to first words8.5 s
Input tokens2
Cached tokens1,162
Output tokens6,719
Thinking tokens411
Words in the answer1,813
Price at API rates18¢

AI answer from Opus 5 · max effort · 2 Oct 2026

7 of 9

Screenshot of the page built in this answer, at a desktop width of 1280 pixels
Our screenshot, 1280 by 800. Open it for the full length.
Show the code and the answer.

Here's the whole thing — one self-contained file, no libraries, no external requests.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Kanban</title>
<style>
  :root{
    --bg:#f3f5f8; --panel:#fff; --line:#d7dde5; --ink:#1b2430; --muted:#5d6b7a;
    --accent:#2f6feb; --danger:#b3261e; --radius:10px;
  }
  *{box-sizing:border-box}
  [hidden]{display:none !important}
  html,body{margin:0;overflow-x:hidden}
  body{
    font:16px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
    background:var(--bg);color:var(--ink);padding:16px;-webkit-text-size-adjust:100%;
  }
  body.dragging-active{user-select:none;-webkit-user-select:none;cursor:grabbing}
  .page{max-width:1100px;margin:0 auto 14px}
  h1{font-size:20px;margin:0 0 4px}
  .hint{margin:0;color:var(--muted);font-size:13px}
  .warn{margin:8px 0 0;color:var(--danger);font-size:13px}

  .board{max-width:1100px;margin:0 auto;display:grid;gap:14px;grid-template-columns:minmax(0,1fr)}
  @media (min-width:760px){
    .board{grid-template-columns:repeat(3,minmax(0,1fr));align-items:start}
  }
  .col{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:12px;min-width:0}
  .col-head{display:flex;align-items:center;gap:8px;margin:0 0 10px;font-size:15px}
  .count{
    font-size:13px;font-variant-numeric:tabular-nums;color:var(--muted);
    background:#eef1f6;border:1px solid var(--line);border-radius:999px;padding:1px 9px;
  }

  .add{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 10px}
  .add input{flex:1 1 140px;min-width:0;font:inherit;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;color:inherit}
  .add input:focus-visible,.edit-input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}

  .list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;min-height:60px}
  .list.is-empty::after{
    content:"Nothing here yet";display:block;text-align:center;color:#93a1b0;font-size:13px;
    border:1px dashed var(--line);border-radius:var(--radius);padding:14px 8px;
  }
  body.dragging-active .list.is-empty::after{display:none}

  .card{
    background:#fff;border:1px solid var(--line);border-radius:var(--radius);
    padding:8px 10px;display:flex;flex-direction:column;gap:8px;min-width:0;
    box-shadow:0 1px 2px rgba(16,24,40,.07);cursor:grab;
  }
  .card:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
  .card.dragging{
    position:fixed;z-index:1000;margin:0;cursor:grabbing;
    box-shadow:0 12px 26px rgba(16,24,40,.25);transform:rotate(.6deg);
  }
  .placeholder{
    list-style:none;border:2px dashed var(--accent);border-radius:var(--radius);
    background:rgba(47,111,235,.08);box-sizing:border-box;
  }
  .row{display:flex;align-items:flex-start;gap:8px;min-width:0}
  .grip{flex:0 0 auto;color:#9aa7b4;line-height:1.4;padding:0 2px;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab}
  .title{
    flex:1 1 auto;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;
  }
  .edit-input{flex:1 1 auto;min-width:0;width:100%;font:inherit;padding:6px 8px;border:1px solid var(--line);border-radius:8px;background:#fff;color:inherit;cursor:auto}

  .actions{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}
  .btn{
    font:inherit;font-size:13px;line-height:1.2;padding:6px 10px;min-height:30px;
    border:1px solid var(--line);background:#f7f9fc;color:inherit;border-radius:8px;
    cursor:pointer;touch-action:manipulation;
  }
  .btn:hover{background:#eceff5}
  .btn:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
  .btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}
  .btn.primary:hover{background:#2560d4}
  .btn.danger{color:var(--danger)}

  .sr-only{
    position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;
    clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0;
  }
  @media (max-width:420px){
    body{padding:12px}
    .col{padding:10px}
  }
</style>
</head>
<body>

<header class="page">
  <h1>Kanban</h1>
  <p class="hint">Drag a card with the mouse, or use the ⠇ handle on a touch screen. Keyboard: Tab to a card, then arrow keys — left/right for another column, up/down within the column.</p>
  <p class="warn" id="warn" hidden>This browser is blocking storage, so changes won’t survive a reload.</p>
</header>

<main class="board" id="board">
  <section class="col">
    <h2 class="col-head" id="head-todo"><span class="col-name">To do</span><span class="count" id="count-todo">0</span></h2>
    <form class="add" id="add-form">
      <input id="add-input" type="text" placeholder="What needs doing?" aria-label="New card title" autocomplete="off">
      <button class="btn primary" type="submit">Add card</button>
    </form>
    <ul class="list" id="list-todo" data-col="todo" aria-labelledby="head-todo"></ul>
  </section>

  <section class="col">
    <h2 class="col-head" id="head-doing"><span class="col-name">Doing</span><span class="count" id="count-doing">0</span></h2>
    <ul class="list" id="list-doing" data-col="doing" aria-labelledby="head-doing"></ul>
  </section>

  <section class="col">
    <h2 class="col-head" id="head-done"><span class="col-name">Done</span><span class="count" id="count-done">0</span></h2>
    <ul class="list" id="list-done" data-col="done" aria-labelledby="head-done"></ul>
  </section>
</main>

<div id="card-help" class="sr-only">Card. Press the left or right arrow key to move it to another column, or the up and down arrow keys to move it within its column.</div>
<div id="live" class="sr-only" role="status" aria-live="polite"></div>

<script>
(() => {
  'use strict';

  const KEY = 'simple-kanban-v1';
  const COLS = [
    { id: 'todo',  name: 'To do' },
    { id: 'doing', name: 'Doing' },
    { id: 'done',  name: 'Done'  }
  ];

  const board = document.getElementById('board');
  const form  = document.getElementById('add-form');
  const input = document.getElementById('add-input');
  const live  = document.getElementById('live');
  const warn  = document.getElementById('warn');

  const lists = {}, counts = {};
  COLS.forEach(c => {
    lists[c.id]  = document.getElementById('list-' + c.id);
    counts[c.id] = document.getElementById('count-' + c.id);
  });

  const colName = id => (COLS.find(c => c.id === id) || { name: '' }).name;
  const cardsIn = list => [...list.children].filter(el => el.classList.contains('card'));
  const titleOf = card => card.querySelector('.title').textContent;

  function uid() {
    if (window.crypto && typeof crypto.randomUUID === 'function') return crypto.randomUUID();
    return 'c' + Date.now().toString(36) + Math.random().toString(36).slice(2, 8);
  }

  /* ---------- building cards (titles are set as text, never as HTML) ---------- */

  function mkBtn(label, cls) {
    const b = document.createElement('button');
    b.type = 'button';
    b.className = 'btn ' + cls;
    b.textContent = label;
    return b;
  }

  function makeCard(title, id) {
    const li = document.createElement('li');
    li.className = 'card';
    li.tabIndex = 0;
    li.draggable = false;
    li.dataset.id = id || uid();
    li.setAttribute('aria-describedby', 'card-help');

    const row = document.createElement('div');
    row.className = 'row';

    const grip = document.createElement('span');
    grip.className = 'grip';
    grip.setAttribute('aria-hidden', 'true');
    grip.textContent = '\u2807';

    const t = document.createElement('span');
    t.className = 'title';
    t.textContent = title;          // <div> or a & b stays literal text

    const edit = document.createElement('input');
    edit.type = 'text';
    edit.className = 'edit-input';
    edit.hidden = true;
    edit.setAttribute('aria-label', 'Card title');

    row.append(grip, t, edit);

    const viewActions = document.createElement('div');
    viewActions.className = 'actions view-actions';
    viewActions.append(mkBtn('Edit', 'edit'), mkBtn('Delete', 'del danger'));

    const editActions = document.createElement('div');
    editActions.className = 'actions edit-actions';
    editActions.hidden = true;
    editActions.append(mkBtn('Save', 'save primary'), mkBtn('Cancel', 'cancel'));

    li.append(row, viewActions, editActions);
    labelButtons(li);
    return li;
  }

  function labelButtons(card) {
    const t = titleOf(card);
    const short = t.length > 40 ? t.slice(0, 40) + '…' : t;
    card.querySelector('.edit').setAttribute('aria-label', 'Edit card: ' + short);
    card.querySelector('.del').setAttribute('aria-label', 'Delete card: ' + short);
  }

  /* ---------- storage ---------- */

  function serialize() {
    const data = {};
    COLS.forEach(c => {
      data[c.id] = cardsIn(lists[c.id]).map(el => ({ id: el.dataset.id, title: titleOf(el) }));
    });
    return data;
  }

  function save() {
    try { localStorage.setItem(KEY, JSON.stringify(serialize())); }
    catch (err) { warn.hidden = false; }
  }

  function load() {
    let data = null;
    try { data = JSON.parse(localStorage.getItem(KEY)); } catch (err) { data = null; }
    if (!data || typeof data !== 'object') return;
    COLS.forEach(c => {
      const arr = Array.isArray(data[c.id]) ? data[c.id] : [];
      arr.forEach(item => {
        let title = '', id = null;
        if (typeof item === 'string') title = item;
        else if (item && typeof item.title === 'string') {
          title = item.title;
          id = typeof item.id === 'string' ? item.id : null;
        }
        if (!title.trim()) return;
        lists[c.id].appendChild(makeCard(title, id));
      });
    });
  }

  function updateCounts() {
    COLS.forEach(c => {
      const n = cardsIn(lists[c.id]).length;
      counts[c.id].textContent = n;
      lists[c.id].classList.toggle('is-empty', n === 0);
    });
  }

  function announce(msg) { live.textContent = msg; }

  function announcePosition(card, verb) {
    const list = card.parentElement;
    const items = cardsIn(list);
    announce(verb + ' to ' + colName(list.dataset.col) + ', ' +
             (items.indexOf(card) + 1) + ' of ' + items.length + ': ' + titleOf(card));
  }

  /* ---------- adding ---------- */

  form.addEventListener('submit', e => {
    e.preventDefault();
    const title = input.value.trim();
    if (!title) { input.value = ''; input.focus(); return; }   // blank / spaces only: ignored
    const card = makeCard(title);
    lists.todo.appendChild(card);                              // bottom of the column
    input.value = '';
    input.focus();
    updateCounts();
    save();
    card.scrollIntoView({ block: 'nearest' });
    announce('Added to To do: ' + title);
  });

  /* ---------- edit / delete ---------- */

  board.addEventListener('click', e => {
    const btn = e.target.closest('button');
    if (!btn) return;
    const card = btn.closest('.card');
    if (!card) return;
    if (btn.classList.contains('edit')) startEdit(card);
    else if (btn.classList.contains('del')) deleteCard(card);
    else if (btn.classList.contains('save')) commitEdit(card);
    else if (btn.classList.contains('cancel')) cancelEdit(card);
  });

  function startEdit(card) {
    const t = card.querySelector('.title');
    const inp = card.querySelector('.edit-input');
    card.classList.add('editing');
    inp.value = t.textContent;                                  // starts with the current title
    t.hidden = true;
    inp.hidden = false;
    card.querySelector('.view-actions').hidden = true;
    card.querySelector('.edit-actions').hidden = false;
    inp.focus();
    inp.select();
  }

  function endEdit(card) {
    card.classList.remove('editing');
    card.querySelector('.title').hidden = false;
    card.querySelector('.edit-input').hidden = true;
    card.querySelector('.view-actions').hidden = false;
    card.querySelector('.edit-actions').hidden = true;
    card.focus();
  }

  function commitEdit(card) {
    const inp = card.querySelector('.edit-input');
    const t = inp.value.trim();
    if (t) {
      card.querySelector('.title').textContent = t;
      labelButtons(card);
      save();
      announce('Renamed to ' + t);
    } else {
      announce('Empty title ignored');
    }
    endEdit(card);
  }

  function cancelEdit(card) { endEdit(card); announce('Edit cancelled'); }

  function deleteCard(card) {
    const list = card.parentElement;
    const items = cardsIn(list);
    const i = items.indexOf(card);
    const next = items[i + 1] || items[i - 1] || null;
    const title = titleOf(card);
    card.remove();
    updateCounts();
    save();
    if (next) next.focus(); else input.focus();
    announce('Deleted ' + title);
  }

  /* ---------- keyboard: move the focused card ---------- */

  const DIRS = { ArrowLeft: 'left', ArrowRight: 'right', ArrowUp: 'up', ArrowDown: 'down' };

  board.addEventListener('keydown', e => {
    const target = e.target;
    if (!(target instanceof Element)) return;

    if (target.classList.contains('edit-input')) {
      const card = target.closest('.card');
      if (!card) return;
      if (e.key === 'Enter') { e.preventDefault(); commitEdit(card); }
      else if (e.key === 'Escape') { e.preventDefault(); cancelEdit(card); }
      return;
    }

    if (!target.classList.contains('card')) return;             // only when the card itself has focus
    const dir = DIRS[e.key];
    if (!dir || e.ctrlKey || e.metaKey || e.altKey) return;
    e.preventDefault();
    moveByKey(target, dir);
  });

  function moveByKey(card, dir) {
    const list = card.parentElement;
    const items = cardsIn(list);
    const i = items.indexOf(card);

    if (dir === 'up' || dir === 'down') {
      const j = dir === 'up' ? i - 1 : i + 1;
      if (j < 0 || j >= items.length) {
        announce((dir === 'up' ? 'Already first in ' : 'Already last in ') + colName(list.dataset.col));
        return;
      }
      if (dir === 'up') list.insertBefore(card, items[j]);
      else items[j].after(card);
    } else {
      const ci = COLS.findIndex(c => c.id === list.dataset.col);
      const cj = dir === 'left' ? ci - 1 : ci + 1;
      if (cj < 0 || cj >= COLS.length) { announce('No column to the ' + dir); return; }
      const target = lists[COLS[cj].id];
      const tItems = cardsIn(target);
      target.insertBefore(card, tItems[Math.min(i, tItems.length)] || null);
    }

    updateCounts();
    save();
    card.focus({ preventScroll: true });                        // card keeps focus for the next arrow
    card.scrollIntoView({ block: 'nearest', inline: 'nearest' });
    announcePosition(card, 'Moved');
  }

  /* ---------- pointer dragging (mouse, touch, pen) ---------- */

  let pending = null, drag = null, suppressClick = false;

  board.addEventListener('pointerdown', e => {
    if (e.button && e.button !== 0) return;
    const card = e.target.closest('.card');
    if (!card || card.classList.contains('editing')) return;
    if (e.target.closest('button, input')) return;

    const onGrip = !!e.target.closest('.grip');
    if (e.pointerType !== 'mouse' && !onGrip) return;           // touch: only the handle drags, so the page can still scroll

    pending = { card: card, id: e.pointerId, x: e.clientX, y: e.clientY, thresh: onGrip ? 3 : 5 };
    window.addEventListener('pointermove', onPointerMove, { passive: false });
    window.addEventListener('pointerup', onPointerUp);
    window.addEventListener('pointercancel', onPointerUp);
  });

  function stopListening() {
    window.removeEventListener('pointermove', onPointerMove);
    window.removeEventListener('pointerup', onPointerUp);
    window.removeEventListener('pointercancel', onPointerUp);
  }

  function onPointerMove(e) {
    if (drag) {
      if (e.pointerId !== drag.id) return;
      e.preventDefault();
      drag.x = e.clientX; drag.y = e.clientY;
      positionCard();
      return;
    }
    if (!pending || e.pointerId !== pending.id) return;
    if (Math.abs(e.clientX - pending.x) + Math.abs(e.clientY - pending.y) < pending.thresh) return;
    startDrag(e);
  }

  function startDrag(e) {
    const card = pending.card;
    const r = card.getBoundingClientRect();

    const ph = document.createElement('li');
    ph.className = 'placeholder';
    ph.style.height = r.height + 'px';
    ph.setAttribute('aria-hidden', 'true');
    card.parentElement.insertBefore(ph, card);

    drag = {
      card: card, ph: ph, id: pending.id,
      x: e.clientX, y: e.clientY,
      ox: e.clientX - r.left, oy: e.clientY - r.top,
      w: r.width, h: r.height, raf: 0
    };
    pending = null;

    card.classList.add('dragging');
    card.style.width = r.width + 'px';
    card.style.height = r.height + 'px';
    document.body.appendChild(card);                            // float it above everything
    positionCard();
    document.body.classList.add('dragging-active');

    const sel = window.getSelection && window.getSelection();
    if (sel && sel.removeAllRanges) sel.removeAllRanges();

    drag.raf = requestAnimationFrame(tick);
  }

  function positionCard() {
    const maxLeft = window.innerWidth - drag.w + 16;
    const left = Math.max(-16, Math.min(drag.x - drag.ox, maxLeft));
    drag.card.style.left = left + 'px';
    drag.card.style.top  = (drag.y - drag.oy) + 'px';
  }

  function tick() {
    if (!drag) return;
    autoScroll();
    updateDropSpot();
    drag.raf = requestAnimationFrame(tick);
  }

  function autoScroll() {
    const margin = 80, speed = 16, h = window.innerHeight, y = drag.y;
    let dy = 0;
    if (y < margin) dy = -speed * (margin - y) / margin;
    else if (y > h - margin) dy = speed * (y - (h - margin)) / margin;
    if (dy) window.scrollBy(0, dy);
  }

  function updateDropSpot() {
    const x = drag.x, y = drag.y;

    // nearest column by distance to its box (works side by side and stacked)
    let best = null, bestD = Infinity;
    COLS.forEach(c => {
      const list = lists[c.id];
      const r = list.closest('.col').getBoundingClientRect();
      const dx = Math.max(r.left - x, 0, x - r.right);
      const dy = Math.max(r.top - y, 0, y - r.bottom);
      const d = dx * dx + dy * dy;
      if (d < bestD) { bestD = d; best = list; }
    });
    if (!best) return;

    let before = null;
    for (const el of cardsIn(best)) {
      const r = el.getBoundingClientRect();
      if (y < r.top + r.height / 2) { before = el; break; }
    }
    if (drag.ph.parentElement !== best || drag.ph.nextElementSibling !== before) {
      best.insertBefore(drag.ph, before);
    }
  }

  function onPointerUp(e) {
    if (pending && (!e || e.pointerId === pending.id)) { pending = null; stopListening(); return; }
    if (!drag || (e && e.pointerId !== drag.id)) return;

    cancelAnimationFrame(drag.raf);
    const card = drag.card, ph = drag.ph;
    updateDropSpot();
    ph.parentElement.insertBefore(card, ph);
    ph.remove();

    card.classList.remove('dragging');
    card.style.left = card.style.top = card.style.width = card.style.height = '';
    document.body.classList.remove('dragging-active');
    drag = null;

    suppressClick = true;
    setTimeout(() => { suppressClick = false; }, 300);
    stopListening();

    updateCounts();
    save();
    card.focus({ preventScroll: true });
    announcePosition(card, 'Moved');
  }

  // stop a drop from counting as a click on whatever ends up under the pointer
  document.addEventListener('click', e => {
    if (!suppressClick) return;
    suppressClick = false;
    e.preventDefault();
    e.stopPropagation();
  }, true);

  /* ---------- start ---------- */

  load();
  updateCounts();
})();
</script>
</body>
</html>

A few notes on how it behaves:

  • Saving: everything goes into localStorage under simple-kanban-v1 after every add, edit, delete and move, so a reload gives you the identical board. If the browser blocks storage (private mode, file restrictions), a red line appears under the heading and the board still works for that session.
  • Keyboard: Tab order is card → its Edit → its Delete → next card. With a card focused, arrows move it and it re-focuses itself each time, so you can hold or repeat arrows. Moves are also announced to screen readers. While editing, Enter saves, Escape cancels; an empty edit is discarded and the old title stays.
  • Dragging: with a mouse you can grab anywhere on a card (a 5px threshold means clicks on Edit/Delete still work); on a touch screen you drag by the ⠇ handle, so ordinary finger swipes still scroll the page. A dashed outline shows where the card will land, and the page auto-scrolls when you drag near the top or bottom edge.
  • Text safety: titles only ever go through textContent and input.value, so <div> or a & b is displayed verbatim, and internal spacing is kept via white-space: pre-wrap.
  • Narrow screens: below 760px the three columns stack, long words break with overflow-wrap: anywhere, and flex children have min-width: 0, so there's no horizontal scrolling at 375px.
  • Floor2/2, 100% passed
  • Middle2/3, 67% passed
  • Top3/4, 75% passed
7 of 9 checks passedfloor 2/2, middle 2/3, top 3/4
  • Passed.
    The page loads with no errors and has the three named columns
    Floor Page test
  • Passed.
    Adding a card works with Enter and with the Add card button
    Floor Page test
  • Passed.
    Empty or space-only titles are ignored
    Middle Page test
  • Passed.
    The counts update, and Edit and Delete work
    Middle Page test
  • Missed.
    After a reload the board is exactly as it wastest group failed
    Middle Page test
  • Passed.
    Dragging moves cards between columns and reorders them, and it survives a reload
    Top Page test
  • Passed.
    A card can be moved with the arrow keys and keeps focus
    Top Page test
  • Passed.
    Titles like <b>hi</b> & <img ...> show exactly as typed and run nothing
    Top Page test
  • Missed.
    No sideways scroll on a 375 px phone, even with very long titlestest group failed
    Top Page test
  • Took 7 min 3 s.
  • First words after 5 min 50 s.
  • Wrote 38,300 tokens, 29,505 of them thinking.
  • 97¢ at API prices.
All numbers.
Time to finish7 min 3 s
Time to first words5 min 50 s
Input tokens2
Cached tokens1,162
Output tokens38,300
Thinking tokens29,505
Words in the answer2,130
Price at API rates97¢
B04Minesweeper in one HTML fileLow 6/9Max 8/9Max +2

What it asks for. Asks for the game Minesweeper in one HTML file: a 9 by 9 board with 10 mines, flags on right click, a mines-left counter, a first square that is never a mine, empty areas that open by themselves, win and lose messages and a new game button. Every square has to be a button so the game works from the keyboard, and the board has to fit a phone.

Max effort passed 2 more checks than low.

AI answer from Opus 5 · low effort · 2 Oct 2026

6 of 9

Screenshot of the page built in this answer, at a desktop width of 1280 pixels
Our screenshot, 1280 by 800. Open it for the full length.
Screenshot of the page built in this answer, at a phone width of 375 pixels
Phone, 375 by 812.
More screenshots (2).
Screenshot of the page built in this answer, at a desktop width of 1280 pixelsScreenshot of the page built in this answer, at a phone width of 375 pixels
Show the code and the answer.

Here's the complete file — save it as minesweeper.html and open it in any browser.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Minesweeper</title>
<style>
  :root { --cell: 34px; }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    padding: 12px 6px;
    font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    background: #eceff1;
    color: #212121;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  h1 { font-size: 1.25rem; margin: 0 0 10px; }
  .panel {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .counter {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    background: #fff;
    border: 1px solid #b0bec5;
    border-radius: 6px;
    padding: 6px 10px;
  }
  #newgame {
    font: inherit;
    font-weight: 600;
    padding: 8px 14px;
    min-height: 36px;
    border: 1px solid #90a4ae;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
  }
  #newgame:hover { background: #f5f5f5; }
  #message {
    min-height: 1.6em;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 8px;
  }
  #board {
    display: grid;
    grid-template-columns: repeat(9, var(--cell));
    gap: 2px;
    background: #90a4ae;
    padding: 2px;
    border-radius: 4px;
    touch-action: manipulation;
  }
  #board.over { pointer-events: none; }
  .cell {
    width: var(--cell);
    height: var(--cell);
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px outset #cfd8dc;
    background: #cfd8dc;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
  }
  .cell:focus-visible { outline: 3px solid #1565c0; outline-offset: -3px; }
  .cell.open {
    border: 1px solid #b0bec5;
    background: #fafafa;
    cursor: default;
  }
  .cell.mine { background: #ef9a9a; }
  .n1 { color: #1565c0; } .n2 { color: #2e7d32; } .n3 { color: #c62828; }
  .n4 { color: #4527a0; } .n5 { color: #8d6e63; } .n6 { color: #00838f; }
  .n7 { color: #424242; } .n8 { color: #757575; }
  .hint { font-size: .8rem; color: #546e7a; margin-top: 10px; text-align: center; max-width: 340px; }
  @media (max-width: 375px) { :root { --cell: 33px; } }
</style>
</head>
<body>

<h1>Minesweeper</h1>

<div class="panel">
  <span class="counter">Mines left: <span id="minesleft">10</span></span>
  <button id="newgame" type="button">New game</button>
</div>

<div id="message" role="status" aria-live="polite"></div>

<div id="board" role="grid" aria-label="Minesweeper board"></div>

<p class="hint">Click or press Enter/Space to open a square. Right click (or long press) to flag.</p>

<script>
(function () {
  var ROWS = 9, COLS = 9, MINES = 10;

  var boardEl = document.getElementById('board');
  var minesLeftEl = document.getElementById('minesleft');
  var messageEl = document.getElementById('message');
  var newGameBtn = document.getElementById('newgame');

  var cells = [];      // button elements, indexed r*COLS+c
  var mine = [];       // boolean
  var opened = [];     // boolean
  var flagged = [];    // boolean
  var counts = [];     // number of adjacent mines
  var placed = false;  // mines placed yet?
  var finished = false;
  var openedCount = 0;

  function idx(r, c) { return r * COLS + c; }

  function neighbours(i) {
    var r = Math.floor(i / COLS), c = i % COLS, out = [];
    for (var dr = -1; dr <= 1; dr++) {
      for (var dc = -1; dc <= 1; dc++) {
        if (dr === 0 && dc === 0) continue;
        var nr = r + dr, nc = c + dc;
        if (nr >= 0 && nr < ROWS && nc >= 0 && nc < COLS) out.push(idx(nr, nc));
      }
    }
    return out;
  }

  function buildBoard() {
    boardEl.innerHTML = '';
    cells = [];
    for (var r = 0; r < ROWS; r++) {
      for (var c = 0; c < COLS; c++) {
        var b = document.createElement('button');
        b.type = 'button';
        b.className = 'cell';
        b.dataset.i = idx(r, c);
        b.setAttribute('aria-label', 'Row ' + (r + 1) + ', column ' + (c + 1));
        boardEl.appendChild(b);
        cells.push(b);
      }
    }
  }

  function reset() {
    mine = []; opened = []; flagged = []; counts = [];
    for (var i = 0; i < ROWS * COLS; i++) {
      mine[i] = false; opened[i] = false; flagged[i] = false; counts[i] = 0;
    }
    placed = false;
    finished = false;
    openedCount = 0;
    boardEl.classList.remove('over');
    messageEl.textContent = '';
    for (var j = 0; j < cells.length; j++) {
      cells[j].className = 'cell';
      cells[j].textContent = '';
      cells[j].disabled = false;
    }
    updateCounter();
  }

  function updateCounter() {
    var flags = 0;
    for (var i = 0; i < flagged.length; i++) if (flagged[i]) flags++;
    minesLeftEl.textContent = String(MINES - flags);
  }

  // Place mines, never on the first clicked square (or its neighbours where possible).
  function placeMines(safe) {
    var banned = {};
    banned[safe] = true;
    var nb = neighbours(safe);
    var total = ROWS * COLS;
    if (total - (nb.length + 1) >= MINES) {
      for (var k = 0; k < nb.length; k++) banned[nb[k]] = true;
    }
    var pool = [];
    for (var i = 0; i < total; i++) if (!banned[i]) pool.push(i);
    for (var n = pool.length - 1; n > 0; n--) {
      var j = Math.floor(Math.random() * (n + 1));
      var t = pool[n]; pool[n] = pool[j]; pool[j] = t;
    }
    for (var m = 0; m < MINES; m++) mine[pool[m]] = true;

    for (var p = 0; p < total; p++) {
      var cnt = 0, ns = neighbours(p);
      for (var q = 0; q < ns.length; q++) if (mine[ns[q]]) cnt++;
      counts[p] = cnt;
    }
    placed = true;
  }

  function open(start) {
    if (finished || opened[start] || flagged[start]) return;

    if (!placed) placeMines(start);

    if (mine[start]) { lose(start); return; }

    var stack = [start];
    while (stack.length) {
      var i = stack.pop();
      if (opened[i] || flagged[i] || mine[i]) continue;
      opened[i] = true;
      openedCount++;
      var el = cells[i];
      el.classList.add('open');
      el.disabled = true;
      if (counts[i] > 0) {
        el.textContent = String(counts[i]);
        el.classList.add('n' + counts[i]);
      } else {
        el.textContent = '';
        var ns = neighbours(i);
        for (var k = 0; k < ns.length; k++) {
          if (!opened[ns[k]] && !flagged[ns[k]]) stack.push(ns[k]);
        }
      }
    }

    if (openedCount === ROWS * COLS - MINES) win();
  }

  function toggleFlag(i) {
    if (finished || opened[i]) return;
    flagged[i] = !flagged[i];
    cells[i].textContent = flagged[i] ? '\uD83D\uDEA9' : '';
    cells[i].setAttribute('aria-pressed', flagged[i] ? 'true' : 'false');
    updateCounter();
  }

  function lose(hit) {
    finished = true;
    for (var i = 0; i < mine.length; i++) {
      if (mine[i]) {
        cells[i].textContent = '\uD83D\uDCA3';
        cells[i].classList.add('open', 'mine');
      }
    }
    if (hit != null) cells[hit].classList.add('mine');
    boardEl.classList.add('over');
    for (var j = 0; j < cells.length; j++) cells[j].disabled = true;
    messageEl.textContent = 'Game over';
  }

  function win() {
    finished = true;
    boardEl.classList.add('over');
    for (var i = 0; i < cells.length; i++) {
      if (mine[i] && !flagged[i]) {
        cells[i].textContent = '\uD83D\uDEA9';
        flagged[i] = true;
      }
      cells[i].disabled = true;
    }
    updateCounter();
    messageEl.textContent = 'You win!';
  }

  boardEl.addEventListener('click', function (e) {
    var t = e.target.closest('.cell');
    if (!t) return;
    open(Number(t.dataset.i));
  });

  boardEl.addEventListener('contextmenu', function (e) {
    e.preventDefault();
    var t = e.target.closest('.cell');
    if (!t) return;
    toggleFlag(Number(t.dataset.i));
  });

  // Long press on touch screens = flag.
  var pressTimer = null, pressedIndex = null, longPressed = false;
  boardEl.addEventListener('touchstart', function (e) {
    var t = e.target.closest('.cell');
    if (!t) return;
    pressedIndex = Number(t.dataset.i);
    longPressed = false;
    pressTimer = setTimeout(function () {
      longPressed = true;
      toggleFlag(pressedIndex);
    }, 450);
  }, { passive: true });

  function cancelPress() {
    if (pressTimer) { clearTimeout(pressTimer); pressTimer = null; }
  }
  boardEl.addEventListener('touchend', function (e) {
    cancelPress();
    if (longPressed) { e.preventDefault(); longPressed = false; }
  });
  boardEl.addEventListener('touchmove', cancelPress, { passive: true });
  boardEl.addEventListener('touchcancel', cancelPress, { passive: true });

  // Keyboard: arrows move, Enter/Space open, F flags.
  boardEl.addEventListener('keydown', function (e) {
    var t = e.target.closest('.cell');
    if (!t) return;
    var i = Number(t.dataset.i), r = Math.floor(i / COLS), c = i % COLS;
    var nr = r, nc = c;
    if (e.key === 'ArrowUp') nr = r - 1;
    else if (e.key === 'ArrowDown') nr = r + 1;
    else if (e.key === 'ArrowLeft') nc = c - 1;
    else if (e.key === 'ArrowRight') nc = c + 1;
    else if (e.key === 'f' || e.key === 'F') { e.preventDefault(); toggleFlag(i); return; }
    else return;
    e.preventDefault();
    if (nr < 0 || nr >= ROWS || nc < 0 || nc >= COLS) return;
    cells[idx(nr, nc)].focus();
  });

  newGameBtn.addEventListener('click', reset);

  buildBoard();
  reset();
})();
</script>
</body>
</html>

Notes on the bits you may want to tweak:

  • Keyboard: a focused square opens with Enter or Space (native button behaviour). Since browsers give no right-click key, F toggles a flag, and arrow keys move between squares. On touch devices a long press (about half a second) also flags.
  • First click safety: mines are placed only after your first open, avoiding that square and its neighbours, so your first move is usually a clear patch rather than a bare number.
  • Width: squares are 34px (33px under 375px), so 9 columns plus gaps and padding stay under 320px — no sideways scrolling on a 375px phone.
  • Locked board: on a loss the grid gets pointer-events: none and every button is disabled, so neither mouse nor keyboard can change anything until you press New game.
  • Floor2/2, 100% passed
  • Middle1/3, 33% passed
  • Top3/4, 75% passed
6 of 9 checks passedfloor 2/2, middle 1/3, top 3/4
  • Passed.
    81 square buttons in a 9 by 9 grid, Mines left starts at 10
    Floor Page test
  • Passed.
    A first click never lands on a mine
    Floor Page test
  • Missed.
    Numbers are right and an empty square opens its neighbourstest group failed
    Middle Page test
  • Missed.
    Right click flags and unflags, the counter follows, a flagged square stays shuttest group failed
    Middle Page test
  • Passed.
    The squares work from the keyboard
    Middle Page test
  • Passed.
    Hitting a mine says Game over, shows all 10 mines as 💣 and stops the board
    Top Page test
  • Passed.
    Opening every safe square shows You win! (and not before)
    Top Page test
  • Missed.
    New game resets the board, counter and messagetest group failed
    Top Page test
  • Passed.
    Fits a 375 px phone with squares of at least 32 px, no sideways scroll
    Top Page test
  • Took 43 s.
  • First words after 2.9 s.
  • Wrote 4,650 tokens, 11 of them thinking.
  • 12¢ at API prices.
All numbers.
Time to finish43 s
Time to first words2.9 s
Input tokens2
Cached tokens1,104
Output tokens4,650
Thinking tokens11
Words in the answer1,415
Price at API rates12¢

AI answer from Opus 5 · max effort · 2 Oct 2026

8 of 9

Screenshot of the page built in this answer, at a desktop width of 1280 pixels
Our screenshot, 1280 by 800. Open it for the full length.
Screenshot of the page built in this answer, at a phone width of 375 pixels
Phone, 375 by 812.
More screenshots (2).
Screenshot of the page built in this answer, at a desktop width of 1280 pixelsScreenshot of the page built in this answer, at a phone width of 375 pixels
Show the code and the answer.

Here's the complete file — save it as minesweeper.html and open it in any browser. No libraries, no network requests, nothing outside the file.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="dark light">
<title>Minesweeper</title>
<style>
  * { box-sizing: border-box; }

  body {
    margin: 0;
    min-height: 100vh;
    padding: 16px 8px 32px;
    display: flex;
    justify-content: center;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #1b2030;
    color: #e8ecf4;
    -webkit-text-size-adjust: 100%;
  }

  main {
    width: 100%;
    max-width: 360px;
  }

  h1 {
    margin: 0 0 12px;
    font-size: 1.35rem;
    letter-spacing: 0.02em;
  }

  .bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }

  .counter {
    margin: 0;
    font-variant-numeric: tabular-nums;
    font-size: 1rem;
    background: #262d40;
    border: 1px solid #39425c;
    border-radius: 8px;
    padding: 8px 12px;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .counter span {
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffd166;
  }

  .controls { display: flex; gap: 8px; }

  .btn {
    font: inherit;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #4a5676;
    background: #333c56;
    color: #e8ecf4;
    cursor: pointer;
    touch-action: manipulation;
  }
  .btn:hover { background: #3d4868; }
  .btn:active { transform: translateY(1px); }
  .btn[aria-pressed="true"] {
    background: #ffd166;
    border-color: #ffd166;
    color: #23283a;
    font-weight: 700;
  }

  .board {
    display: grid;
    grid-template-columns: repeat(9, minmax(32px, 1fr));
    gap: 3px;
    padding: 6px;
    background: #141828;
    border: 1px solid #39425c;
    border-radius: 10px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
  }

  .cell {
    font: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    aspect-ratio: 1 / 1;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #5b6party;
    border-radius: 5px;
    background: #4b5775;
    color: #e8ecf4;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .cell { border-color: #5b678a; }
  .cell:hover:not(.open) { background: #586displaced; }
  .cell:hover:not(.open) { background: #58668c; }
  .cell:focus-visible {
    outline: 3px solid #ffd166;
    outline-offset: -3px;
  }
  .cell:disabled { cursor: default; opacity: 1; }

  .cell.open {
    background: #272e42;
    border-color: #323b53;
    cursor: default;
  }
  .cell.flag { background: #4b5775; }
  .cell.wrong { background: #7a3340; border-color: #94404f; }
  .cell.mine { background: #3a2a3a; }
  .cell.exploded { background: #a33b3b; border-color: #c24a4a; }

  .n1 { color: #6ea8fe; }
  .n2 { color: #6fcf97; }
  .n3 { color: #ff7b72; }
  .n4 { color: #c792ea; }
  .n5 { color: #ffb86c; }
  .n6 { color: #4dd0e1; }
  .n7 { color: #e6e6e6; }
  .n8 { color: #9aa4b2; }

  .message {
    margin: 12px 0 0;
    min-height: 1.6em;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
  }
  .message.win  { color: #6fcf97; }
  .message.lose { color: #ff7b72; }

  .hint {
    margin: 14px 0 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #9aa4b2;
  }

  @media (max-width: 359px) {
    body { padding-left: 4px; padding-right: 4px; }
    .board { gap: 2px; padding: 4px; }
  }
</style>
</head>
<body>
<main>
  <h1>Minesweeper</h1>

  <div class="bar">
    <p class="counter">Mines left: <span id="minesLeft">10</span></p>
    <div class="controls">
      <button type="button" class="btn" id="flagMode" aria-pressed="false">🚩 Flag mode</button>
      <button type="button" class="btn" id="newGame">New game</button>
    </div>
  </div>

  <div id="board" class="board" role="group" aria-label="Minesweeper board, 9 by 9"></div>

  <p id="message" class="message" role="status" aria-live="polite"></p>

  <p class="hint">
    Mouse: left click opens, right click flags. Keyboard: Tab or arrow keys to move,
    Enter or Space to open, F to flag. Touch: turn on Flag mode to place flags.
  </p>
</main>

<script>
(function () {
  "use strict";

  var SIZE = 9;
  var MINE_COUNT = 10;
  var TOTAL = SIZE * SIZE;
  var SAFE_TOTAL = TOTAL - MINE_COUNT;

  var boardEl = document.getElementById("board");
  var minesLeftEl = document.getElementById("minesLeft");
  var messageEl = document.getElementById("message");
  var newGameBtn = document.getElementById("newGame");
  var flagModeBtn = document.getElementById("flagMode");

  var cells = [];
  var mine, flagged, revealed, counts;
  var started, over, lost, explodedIndex, flagsUsed, openedSafe;
  var flagMode = false;

  function idx(r, c) { return r * SIZE + c; }
  function rowOf(i) { return Math.floor(i / SIZE); }
  function colOf(i) { return i % SIZE; }

  function neighbours(i) {
    var r = rowOf(i), c = colOf(i), out = [], dr, dc, nr, nc;
    for (dr = -1; dr <= 1; dr++) {
      for (dc = -1; dc <= 1; dc++) {
        if (dr === 0 && dc === 0) { continue; }
        nr = r + dr; nc = c + dc;
        if (nr >= 0 && nr < SIZE && nc >= 0 && nc < SIZE) { out.push(idx(nr, nc)); }
      }
    }
    return out;
  }

  /* ---------- build the 81 buttons once ---------- */
  function buildBoard() {
    var frag = document.createDocumentFragment();
    for (var i = 0; i < TOTAL; i++) {
      var b = document.createElement("button");
      b.type = "button";
      b.className = "cell";
      b.dataset.i = String(i);
      cells.push(b);
      frag.appendChild(b);
    }
    boardEl.appendChild(frag);
  }

  /* ---------- state ---------- */
  function newGame() {
    mine = new Array(TOTAL).fill(false);
    flagged = new Array(TOTAL).fill(false);
    revealed = new Array(TOTAL).fill(false);
    counts = new Array(TOTAL).fill(0);

    started = false;
    over = false;
    lost = false;
    explodedIndex = -1;
    flagsUsed = 0;
    openedSafe = 0;

    for (var i = 0; i < TOTAL; i++) {
      cells[i].disabled = false;
      paint(i);
    }
    updateCounter();
    setMessage("", "");
  }

  function placeMines(safeIndex) {
    var pool = [], i, j, t;
    for (i = 0; i < TOTAL; i++) {
      if (i !== safeIndex) { pool.push(i); }
    }
    for (i = pool.length - 1; i > 0; i--) {          // shuffle
      j = Math.floor(Math.random() * (i + 1));
      t = pool[i]; pool[i] = pool[j]; pool[j] = t;
    }
    for (i = 0; i < MINE_COUNT; i++) { mine[pool[i]] = true; }

    for (i = 0; i < TOTAL; i++) {
      var n = 0, nb = neighbours(i);
      for (j = 0; j < nb.length; j++) { if (mine[nb[j]]) { n++; } }
      counts[i] = n;
    }
  }

  /* ---------- drawing ---------- */
  function describe(i) {
    var pos = "Row " + (rowOf(i) + 1) + ", column " + (colOf(i) + 1);
    if (revealed[i]) {
      if (mine[i]) { return pos + ", mine"; }
      if (counts[i] === 0) { return pos + ", empty"; }
      return pos + ", " + counts[i] + (counts[i] === 1 ? " mine nearby" : " mines nearby");
    }
    if (flagged[i]) { return pos + ", flagged"; }
    return pos + ", unopened";
  }

  function paint(i) {
    var b = cells[i];
    var cls = "cell";
    var txt = "";

    if (revealed[i]) {
      cls += " open";
      if (mine[i]) {
        cls += " mine";
        if (i === explodedIndex) { cls += " exploded"; }
        txt = "\uD83D\uDCA3";                        // 💣
      } else if (counts[i] > 0) {
        cls += " n" + counts[i];
        txt = String(counts[i]);
      }
    } else if (flagged[i]) {
      cls += " flag";
      if (lost && !mine[i]) { cls += " wrong"; }
      txt = "\uD83D\uDEA9";                          // 🚩
    }

    b.className = cls;
    b.textContent = txt;
    b.setAttribute("aria-label", describe(i));
    b.setAttribute("aria-disabled", (revealed[i] || over) ? "true" : "false");
  }

  function paintAll() {
    for (var i = 0; i < TOTAL; i++) { paint(i); }
  }

  function updateCounter() {
    minesLeftEl.textContent = String(MINE_COUNT - flagsUsed);
  }

  function setMessage(text, kind) {
    messageEl.textContent = text;
    messageEl.className = "message" + (kind ? " " + kind : "");
  }

  function freezeBoard() {
    for (var i = 0; i < TOTAL; i++) { cells[i].disabled = true; }
    if (boardEl.contains(document.activeElement)) { newGameBtn.focus(); }
  }

  /* ---------- gameplay ---------- */
  function openCell(start) {
    if (over || revealed[start] || flagged[start]) { return; }

    if (!started) {
      placeMines(start);                             // first open is never a mine
      started = true;
    }

    if (mine[start]) { lose(start); return; }

    var stack = [start];
    while (stack.length) {
      var i = stack.pop();
      if (revealed[i] || flagged[i]) { continue; }
      revealed[i] = true;
      openedSafe++;
      paint(i);
      if (counts[i] === 0) {
        var nb = neighbours(i);
        for (var k = 0; k < nb.length; k++) {
          if (!revealed[nb[k]] && !flagged[nb[k]]) { stack.push(nb[k]); }
        }
      }
    }

    if (openedSafe === SAFE_TOTAL) { win(); }
  }

  function toggleFlag(i) {
    if (over || revealed[i]) { return; }
    flagged[i] = !flagged[i];
    flagsUsed += flagged[i] ? 1 : -1;
    paint(i);
    updateCounter();
  }

  function lose(i) {
    over = true;
    lost = true;
    explodedIndex = i;
    for (var k = 0; k < TOTAL; k++) {
      if (mine[k]) { revealed[k] = true; }           // every mine shows as 💣
    }
    paintAll();
    setMessage("Game over", "lose");
    freezeBoard();
  }

  function win() {
    over = true;
    for (var k = 0; k < TOTAL; k++) {
      if (mine[k] && !flagged[k]) { flagged[k] = true; flagsUsed++; }
    }
    paintAll();
    updateCounter();
    setMessage("You win!", "win");
    freezeBoard();
  }

  /* ---------- events ---------- */
  boardEl.addEventListener("click", function (e) {
    var b = e.target.closest(".cell");
    if (!b || over) { return; }
    var i = Number(b.dataset.i);
    if (flagMode) { toggleFlag(i); } else { openCell(i); }
  });

  boardEl.addEventListener("contextmenu", function (e) {
    e.preventDefault();
    var b = e.target.closest(".cell");
    if (!b || over) { return; }
    toggleFlag(Number(b.dataset.i));
  });

  boardEl.addEventListener("keydown", function (e) {
    var b = e.target.closest(".cell");
    if (!b) { return; }
    var i = Number(b.dataset.i);
    var r = rowOf(i), c = colOf(i);

    if (e.key === "f" || e.key === "F") {
      e.preventDefault();
      if (!over) { toggleFlag(i); }
      return;
    }

    switch (e.key) {
      case "ArrowUp":    r--; break;
      case "ArrowDown":  r++; break;
      case "ArrowLeft":  c--; break;
      case "ArrowRight": c++; break;
      case "Home":       c = 0; break;
      case "End":        c = SIZE - 1; break;
      default: return;
    }
    e.preventDefault();
    r = Math.max(0, Math.min(SIZE - 1, r));
    c = Math.max(0, Math.min(SIZE - 1, c));
    cells[idx(r, c)].focus();
  });

  newGameBtn.addEventListener("click", newGame);

  flagModeBtn.addEventListener("click", function () {
    flagMode = !flagMode;
    flagModeBtn.setAttribute("aria-pressed", flagMode ? "true" : "false");
  });

  buildBoard();
  newGame();
}());
</script>
</body>
</html>

A few notes on how it meets your list:

  • Buttons and keyboard. Every square is a real <button>, so Tab reaches it and Enter/Space opens it natively. Arrow keys also move between squares, and F places or removes a flag (right click has no keyboard equivalent, so that gap needed filling).
  • Flags. Right click toggles a 🚩 on an unopened square; openCell returns immediately if the square is flagged, so a flag must come off first. "Mines left" is 10 − flags and can go negative if you over-flag, which is the usual behaviour.
  • First click. Mines are placed only after the first square is opened, with that square excluded from the pool.
  • Flood fill. Iterative with a stack, so no recursion limits; it stops at flagged squares the way the desktop game does.
  • Win/lose. Win fires when the count of opened non-mine squares hits 71, auto-flags the remaining mines, and shows "You win!". Losing reveals every mine as 💣 (the one you hit is highlighted red, and flags you placed on safe squares turn red), shows "Game over", and disables all 81 buttons.
  • Sizing. The grid is minmax(32px, 1fr) columns inside a 360px-max container, so squares land at about 36px on a 375px phone and never drop below 32px; a small media query tightens the gaps so it still fits at 320px.

One extra you didn't ask for: a Flag mode toggle, since phones have no right click. Delete the #flagMode button and its listener if you don't want it — nothing else depends on it.

  • Floor2/2, 100% passed
  • Middle2/3, 67% passed
  • Top4/4, 100% passed
8 of 9 checks passedfloor 2/2, middle 2/3, top 4/4
  • Passed.
    81 square buttons in a 9 by 9 grid, Mines left starts at 10
    Floor Page test
  • Passed.
    A first click never lands on a mine
    Floor Page test
  • Missed.
    Numbers are right and an empty square opens its neighbourstest group failed
    Middle Page test
  • Passed.
    Right click flags and unflags, the counter follows, a flagged square stays shut
    Middle Page test
  • Passed.
    The squares work from the keyboard
    Middle Page test
  • Passed.
    Hitting a mine says Game over, shows all 10 mines as 💣 and stops the board
    Top Page test
  • Passed.
    Opening every safe square shows You win! (and not before)
    Top Page test
  • Passed.
    New game resets the board, counter and message
    Top Page test
  • Passed.
    Fits a 375 px phone with squares of at least 32 px, no sideways scroll
    Top Page test
  • Took 2 min 49 s.
  • First words after 1 min 58 s.
  • Wrote 15,487 tokens, 9,587 of them thinking.
  • 39¢ at API prices.
All numbers.
Time to finish2 min 49 s
Time to first words1 min 58 s
Input tokens2
Cached tokens1,104
Output tokens15,487
Thinking tokens9,587
Words in the answer1,776
Price at API rates39¢
B05Fix three layout bugs on a garden pageLow 7/7Max 7/7Same

What it asks for. Pastes a community garden club's web page and describes three problems on phones: the page scrolls sideways, section headings end up hidden under the sticky header after tapping the menu links, and three event cards are squashed instead of sitting one per row. It asks for the whole page back with all three fixed, leaving the laptop layout as it is and the header still sticky.

Both settings passed 7 of 7 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

7 of 7

Screenshot of the page built in this answer, at a desktop width of 1280 pixels
Our screenshot, 1280 by 800. Open it for the full length.
Screenshot of the page built in this answer, at a phone width of 375 pixels
Phone, 375 by 812.
Show the code and the answer.

Three separate causes, and all three are fixable in CSS only.

What was wrong

  1. Sideways scroll: .fees has a hard width: 720px. On a 390px-wide phone that forces the page wider than the screen. The long email address in the contact box is a second, smaller culprit — it can't break, so it also pushes the layout out. Fixed by making the table full-width inside a scrollable wrapper (so only the table scrolls, not the page) and letting the email wrap.
  2. Headings hidden under the header: anchor jumps scroll the target to the very top of the viewport, which is behind your sticky header. Fixed with scroll-padding-top on html plus scroll-margin-top on the sections — no JavaScript needed.
  3. Squashed cards: grid-template-columns: repeat(3, 1fr) is unconditional. A media query drops it to one column on narrow screens (and two on tablets, which you can delete if you'd rather it went straight to one).

The laptop layout is untouched — all the changes are either inside a max-width: 720px media query or are no-ops at wide widths. The header stays sticky.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Thistlebank Allotments</title>
<style>
  * { box-sizing: border-box; }

  /* Fix 2: keep anchor targets clear of the sticky header */
  html { scroll-padding-top: 5rem; }

  body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.55;
    color: #23301f;
    background: #f7f4ea;
  }
  .wrap { max-width: 960px; margin: 0 auto; padding: 0 1rem; }
  .site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #2f5d34;
    color: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .25);
  }
  .site-header .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .25rem 1.5rem;
    padding-top: .9rem;
    padding-bottom: .9rem;
  }
  .brand { font-size: 1.15rem; font-weight: 700; letter-spacing: .01em; }
  .site-header nav { display: flex; flex-wrap: wrap; gap: 1.1rem; }
  .site-header a { color: #fff; text-decoration: none; font-weight: 500; }
  .site-header a:hover { text-decoration: underline; }
  .hero { background: #dfe9c8; padding: 4rem 0 3.5rem; }
  .hero h1 { margin: 0 0 .5rem; font-size: 2.4rem; line-height: 1.15; color: #1f4424; }
  .hero p { margin: 0; max-width: 34rem; font-size: 1.15rem; }

  section.block { padding: 2rem 0; }
  /* Fix 2 (belt and braces, for browsers that ignore scroll-padding) */
  section.block[id] { scroll-margin-top: 5rem; }
  section.block h2 { margin: 0 0 1rem; font-size: 1.7rem; color: #1f4424; }

  .cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
  .card { background: #fff; border: 1px solid #d8d2bd; border-radius: 10px; padding: 1.1rem 1.2rem; }
  .card h3 { margin: 0 0 .2rem; font-size: 1.15rem; }
  .card .when { margin: 0 0 .6rem; font-size: .9rem; color: #5b6650; font-weight: 600; }
  .card p { margin: 0; }

  /* Fix 1: the table no longer forces a fixed 720px page width.
     It keeps its comfortable size on wide screens, and on narrow
     screens only this wrapper scrolls, not the whole page. */
  .table-scroll {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .fees {
    width: 100%;
    min-width: 36rem;
    border-collapse: collapse;
    background: #fff;
  }
  .fees th, .fees td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid #e2dcc7; }
  .fees th { background: #e8e2cc; font-size: .95rem; }
  .note { margin-top: 1rem; font-size: .95rem; color: #4a5642; }

  .contact-box { background: #fff; border: 1px solid #d8d2bd; border-radius: 10px; padding: 1.2rem 1.4rem; }
  .contact-box p { margin: 0 0 .5rem; }
  /* Fix 1: let the long address wrap instead of widening the page */
  .email { font-size: 1.1rem; font-weight: 600; overflow-wrap: anywhere; }
  .email a { color: #1f4424; }

  footer { background: #23301f; color: #d8dccc; padding: 1.5rem 0; font-size: .9rem; }

  /* ---- Phones and small tablets only. Laptop view is unchanged. ---- */
  @media (max-width: 900px) {
    .cards { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 640px) {
    /* Fix 3: one event card per row */
    .cards { grid-template-columns: 1fr; }
    .hero { padding: 2.5rem 0 2rem; }
    .hero h1 { font-size: 1.9rem; }
    .hero p { font-size: 1.05rem; }
    .site-header .wrap { justify-content: flex-start; gap: .4rem 1rem; }
    .fees { min-width: 30rem; }
    .fees th, .fees td { padding: .6rem .7rem; }
  }
</style>
</head>
<body>
<header class="site-header">
  <div class="wrap">
    <span class="brand">Thistlebank Allotments</span>
    <nav>
      <a href="#about">About</a>
      <a href="#events">Events</a>
      <a href="#fees">Plot fees</a>
      <a href="#contact">Contact</a>
    </nav>
  </div>
</header>

<main>
  <div class="hero">
    <div class="wrap">
      <h1>Grow something together</h1>
      <p>A friendly community garden on the edge of town, with forty-two plots, a shared tool shed and a kettle that is always on.</p>
    </div>
  </div>

  <section class="block" id="about">
    <div class="wrap">
      <h2>About the garden</h2>
      <p>Thistlebank has been run by its members since the garden opened. Plots are small enough to manage in an evening a week, and there is a shared bed for anyone who is not ready to commit to a plot of their own.</p>
      <p>Beginners are welcome. Long-time growers are usually happy to explain why your beans are doing that.</p>
    </div>
  </section>

  <section class="block" id="events">
    <div class="wrap">
      <h2>Coming up</h2>
      <div class="cards">
        <article class="card">
          <h3>Seed swap</h3>
          <p class="when">First Saturday of the month, 10:00</p>
          <p>Bring spare seeds, take what you need. Tea and biscuits in the shed.</p>
        </article>
        <article class="card">
          <h3>Compost clinic</h3>
          <p class="when">Second Wednesday, 18:30</p>
          <p>Learn why the heap smells and what to do about it. Bring gloves.</p>
        </article>
        <article class="card">
          <h3>Autumn bake and dig</h3>
          <p class="when">Last Sunday of October, 13:00</p>
          <p>Tidy the shared beds, then eat cake made from whatever we grew.</p>
        </article>
      </div>
    </div>
  </section>

  <section class="block" id="fees">
    <div class="wrap">
      <h2>Plot fees</h2>
      <div class="table-scroll">
        <table class="fees">
          <thead>
            <tr><th>Plot size</th><th>Best for</th><th>Per year</th><th>Water</th></tr>
          </thead>
          <tbody>
            <tr><td>Small (3 x 5 m)</td><td>Salad and herbs</td><td>$35</td><td>Included</td></tr>
            <tr><td>Medium (5 x 8 m)</td><td>A family of four</td><td>$60</td><td>Included</td></tr>
            <tr><td>Large (8 x 10 m)</td><td>Serious growers</td><td>$95</td><td>Included</td></tr>
            <tr><td>Shared bed</td><td>Trying it out</td><td>$10</td><td>Included</td></tr>
          </tbody>
        </table>
      </div>
      <p class="note">Fees are due on the first of March. Concessions are available; just ask.</p>
    </div>
  </section>

  <section class="block" id="contact">
    <div class="wrap">
      <h2>Contact</h2>
      <div class="contact-box">
        <p>Write to the plot secretary about the waiting list, a visit or anything else.</p>
        <p class="email"><a href="mailto:membershipandplotenquiries@thistlebankallotments.example">membershipandplotenquiries@thistlebankallotments.example</a></p>
        <p>Open days are the first Saturday of every month.</p>
      </div>
    </div>
  </section>
</main>

<footer>
  <div class="wrap">Thistlebank Allotments. Run by members, for members.</div>
</footer>
</body>
</html>

One thing to check: the header can wrap to two lines on very narrow phones, making it taller than the 5rem offset I used. If you see a heading still slightly tucked under it, raise the two 5rem values to 6.5rem and that will clear it.

  • Floor2/2, 100% passed
  • Middle2/2, 100% passed
  • Top3/3, 100% passed
7 of 7 checks passedfloor 2/2, middle 2/2, top 3/3
  • Passed.
    Returns one whole HTML page that loads
    Floor Page test
  • Passed.
    All the original text is still on the page
    Floor Page test
  • Passed.
    On a 375 px phone the page no longer scrolls sideways
    Middle Page test
  • Passed.
    On a phone the three event cards stack, one per row
    Middle Page test
  • Passed.
    Tapping each top link shows the section heading below the header (phone and laptop)
    Top Page test
  • Passed.
    Laptop layout unchanged: header still sticky, three cards in a row, blocks in the same places
    Top Page test
  • Passed.
    No console errors and nothing loaded from outside
    Top Page test
  • Took 35 s.
  • First words after 4.9 s.
  • Wrote 3,696 tokens, 173 of them thinking.
  • 11¢ at API prices.
All numbers.
Time to finish35 s
Time to first words4.9 s
Input tokens2
Cached tokens3,354
Output tokens3,696
Thinking tokens173
Words in the answer1,047
Price at API rates11¢

AI answer from Opus 5 · max effort · 2 Oct 2026

7 of 7

Screenshot of the page built in this answer, at a desktop width of 1280 pixels
Our screenshot, 1280 by 800. Open it for the full length.
Screenshot of the page built in this answer, at a phone width of 375 pixels
Phone, 375 by 812.
Show the code and the answer.

Three separate causes, all in the CSS:

  1. Sideways scroll — two culprits: .fees has a hard width: 720px, which is wider than any phone, and the long email address is one unbreakable "word" that pushes the page out. (The usual quick fix, overflow-x: hidden on the body, only hides the symptom and can break sticky positioning, so I've fixed the actual causes.)
  2. Headings hidden under the header — a sticky header sits over the scroll position the browser jumps to. scroll-margin-top on the sections (plus scroll-padding-top on html) tells the browser to stop short by the header's height.
  3. Squashed cards — grid-template-columns: repeat(3, 1fr) applies at every width. Added breakpoints: one per row on phones, two on small tablets, three unchanged above that.

Nothing above 768px changes, and the header is still sticky.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Thistlebank Allotments</title>
<style>
  * { box-sizing: border-box; }

  /* Height of the sticky header plus a little breathing room.
     Used for anchor-link jumps. Two values: one per breakpoint. */
  :root { --scroll-offset: 4.5rem; }

  /* FIX 2: anchor jumps stop short of the sticky header */
  html { scroll-padding-top: var(--scroll-offset); }

  body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.55;
    color: #23301f;
    background: #f7f4ea;
  }
  .wrap { max-width: 960px; margin: 0 auto; padding: 0 1rem; }
  .site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #2f5d34;
    color: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .25);
  }
  .site-header .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .25rem 1.5rem;
    padding-top: .9rem;
    padding-bottom: .9rem;
  }
  .brand { font-size: 1.15rem; font-weight: 700; letter-spacing: .01em; }
  .site-header nav { display: flex; gap: 1.1rem; }
  .site-header a { color: #fff; text-decoration: none; font-weight: 500; }
  .site-header a:hover { text-decoration: underline; }
  .hero { background: #dfe9c8; padding: 4rem 0 3.5rem; }
  .hero h1 { margin: 0 0 .5rem; font-size: 2.4rem; line-height: 1.15; color: #1f4424; }
  .hero p { margin: 0; max-width: 34rem; font-size: 1.15rem; }
  section.block { padding: 2rem 0; }
  section.block h2 { margin: 0 0 1rem; font-size: 1.7rem; color: #1f4424; }

  /* FIX 2 (belt and braces): the jump targets themselves keep clear of the header */
  .hero, section.block { scroll-margin-top: var(--scroll-offset); }

  .cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
  .card { background: #fff; border: 1px solid #d8d2bd; border-radius: 10px; padding: 1.1rem 1.2rem; }
  .card h3 { margin: 0 0 .2rem; font-size: 1.15rem; }
  .card .when { margin: 0 0 .6rem; font-size: .9rem; color: #5b6650; font-weight: 600; }
  .card p { margin: 0; }

  /* FIX 1a: the table may now shrink, and if it ever can't fit
     it scrolls inside its own box instead of widening the page */
  .table-scroll { overflow-x: auto; }
  .table-scroll:focus-visible { outline: 2px solid #2f5d34; outline-offset: 3px; }
  .fees { width: 720px; max-width: 100%; border-collapse: collapse; background: #fff; }
  .fees th, .fees td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid #e2dcc7; }
  .fees th { background: #e8e2cc; font-size: .95rem; }
  .note { margin-top: 1rem; font-size: .95rem; color: #4a5642; }
  .contact-box { background: #fff; border: 1px solid #d8d2bd; border-radius: 10px; padding: 1.2rem 1.4rem; }
  .contact-box p { margin: 0 0 .5rem; }

  /* FIX 1b: the long email address can break onto a second line */
  .email { font-size: 1.1rem; font-weight: 600; overflow-wrap: break-word; }
  .email a { color: #1f4424; }
  footer { background: #23301f; color: #d8dccc; padding: 1.5rem 0; font-size: .9rem; }

  /* Small tablets: two cards per row */
  @media (max-width: 48rem) {
    .cards { grid-template-columns: repeat(2, 1fr); }
  }

  /* Phones */
  @media (max-width: 40rem) {
    /* the header is two rows tall at this width, so the jump offset grows */
    :root { --scroll-offset: 6.5rem; }

    .site-header nav { flex-wrap: wrap; gap: .35rem .9rem; }

    /* FIX 3: one card per row */
    .cards { grid-template-columns: 1fr; }

    /* keeps the squeezed table legible without needing to scroll */
    .fees th, .fees td { padding: .55rem .6rem; }
  }
</style>
</head>
<body>
<header class="site-header">
  <div class="wrap">
    <span class="brand">Thistlebank Allotments</span>
    <nav>
      <a href="#about">About</a>
      <a href="#events">Events</a>
      <a href="#fees">Plot fees</a>
      <a href="#contact">Contact</a>
    </nav>
  </div>
</header>

<main>
  <div class="hero">
    <div class="wrap">
      <h1>Grow something together</h1>
      <p>A friendly community garden on the edge of town, with forty-two plots, a shared tool shed and a kettle that is always on.</p>
    </div>
  </div>

  <section class="block" id="about">
    <div class="wrap">
      <h2>About the garden</h2>
      <p>Thistlebank has been run by its members since the garden opened. Plots are small enough to manage in an evening a week, and there is a shared bed for anyone who is not ready to commit to a plot of their own.</p>
      <p>Beginners are welcome. Long-time growers are usually happy to explain why your beans are doing that.</p>
    </div>
  </section>

  <section class="block" id="events">
    <div class="wrap">
      <h2>Coming up</h2>
      <div class="cards">
        <article class="card">
          <h3>Seed swap</h3>
          <p class="when">First Saturday of the month, 10:00</p>
          <p>Bring spare seeds, take what you need. Tea and biscuits in the shed.</p>
        </article>
        <article class="card">
          <h3>Compost clinic</h3>
          <p class="when">Second Wednesday, 18:30</p>
          <p>Learn why the heap smells and what to do about it. Bring gloves.</p>
        </article>
        <article class="card">
          <h3>Autumn bake and dig</h3>
          <p class="when">Last Sunday of October, 13:00</p>
          <p>Tidy the shared beds, then eat cake made from whatever we grew.</p>
        </article>
      </div>
    </div>
  </section>

  <section class="block" id="fees">
    <div class="wrap">
      <h2>Plot fees</h2>
      <div class="table-scroll" role="region" aria-label="Plot fees" tabindex="0">
        <table class="fees">
          <thead>
            <tr><th>Plot size</th><th>Best for</th><th>Per year</th><th>Water</th></tr>
          </thead>
          <tbody>
            <tr><td>Small (3 x 5 m)</td><td>Salad and herbs</td><td>$35</td><td>Included</td></tr>
            <tr><td>Medium (5 x 8 m)</td><td>A family of four</td><td>$60</td><td>Included</td></tr>
            <tr><td>Large (8 x 10 m)</td><td>Serious growers</td><td>$95</td><td>Included</td></tr>
            <tr><td>Shared bed</td><td>Trying it out</td><td>$10</td><td>Included</td></tr>
          </tbody>
        </table>
      </div>
      <p class="note">Fees are due on the first of March. Concessions are available; just ask.</p>
    </div>
  </section>

  <section class="block" id="contact">
    <div class="wrap">
      <h2>Contact</h2>
      <div class="contact-box">
        <p>Write to the plot secretary about the waiting list, a visit or anything else.</p>
        <p class="email"><a href="mailto:membershipandplotenquiries@thistlebankallotments.example">membershipandplotenquiries@thistlebankallotments.example</a></p>
        <p>Open days are the first Saturday of every month.</p>
      </div>
    </div>
  </section>
</main>

<footer>
  <div class="wrap">Thistlebank Allotments. Run by members, for members.</div>
</footer>
</body>
</html>

What changed in the HTML: only one thing — the fees table is now wrapped in <div class="table-scroll">. The tabindex="0" and aria-label let someone scroll that box with a keyboard if it ever does overflow.

The one number you may want to tweak: --scroll-offset. It needs to be a bit more than the header's height. It's 4.5rem on wide screens (header ≈ 57px) and 6.5rem on phones, where the nav drops onto a second line (header ≈ 86px). If you add a nav link or change the brand text and headings start getting clipped again, nudge the phone value up to 7rem or 7.5rem. Erring high is safe — it just leaves a little extra space above the heading.

Two small judgement calls, easy to reverse:

  • Between 640px and 768px you now get two cards per row rather than three. Delete the @media (max-width: 48rem) block if you'd rather it jump straight from three to one.
  • On phones the table squeezes to fit rather than scrolling, helped by the tighter cell padding. If you'd prefer the columns stay roomy and the table scroll sideways inside its box instead, add min-width: 28rem; to .fees inside the phone media query.
  • Floor2/2, 100% passed
  • Middle2/2, 100% passed
  • Top3/3, 100% passed
7 of 7 checks passedfloor 2/2, middle 2/2, top 3/3
  • Passed.
    Returns one whole HTML page that loads
    Floor Page test
  • Passed.
    All the original text is still on the page
    Floor Page test
  • Passed.
    On a 375 px phone the page no longer scrolls sideways
    Middle Page test
  • Passed.
    On a phone the three event cards stack, one per row
    Middle Page test
  • Passed.
    Tapping each top link shows the section heading below the header (phone and laptop)
    Top Page test
  • Passed.
    Laptop layout unchanged: header still sticky, three cards in a row, blocks in the same places
    Top Page test
  • Passed.
    No console errors and nothing loaded from outside
    Top Page test
  • Took 2 min 39 s.
  • First words after 2 min 4 s.
  • Wrote 13,151 tokens, 9,327 of them thinking.
  • 35¢ at API prices.
All numbers.
Time to finish2 min 39 s
Time to first words2 min 4 s
Input tokens2
Cached tokens3,354
Output tokens13,151
Thinking tokens9,327
Words in the answer1,190
Price at API rates35¢

Code

F01Load more shows some posts twice and skips othersLow 7/7Max 7/7Same

What it asks for. Pastes a Python function that pages through a community board's posts, newest first, and reports that some posts show up twice while others never appear, more often on busy days. Many posts share exactly the same timestamp. It asks for the cause and a fixed function with the same name, arguments and return shape, where posts with the same time come higher id first.

Both settings passed 7 of 7 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

7 of 7

What was wrong

  1. The cursor was only created_at, which isn't unique. With WHERE created_at <= ?, every post sharing that second gets re-served on the next page → duplicates. (And if you'd used <, you'd skip the rest of that second instead → missing posts.) Busy days = more ties = more breakage, which matches what users report.
  2. The sort order was ambiguous. ORDER BY created_at DESC alone leaves tied rows in whatever order SQLite feels like, so the same row can land on page 1 in one query and page 2 in the next — another source of both duplicates and omissions.
  3. The cursor was taken from the last row of the page but compared against the whole tie group, so it could never advance past a tie group larger than limit (a stuck page).
  4. Minor: rows[-1] would raise IndexError if the table were empty and has_more were somehow true; and the plain-integer cursor wasn't really opaque.

The fix is a composite keyset cursor on (created_at, id) — a total order, since ids are unique — with the matching strict tuple comparison.

import base64
import sqlite3

MAX_LIMIT = 100
COLUMNS = "id, author, body, created_at"


def _encode_cursor(created_at, post_id):
    raw = f"{int(created_at)}:{int(post_id)}".encode("ascii")
    return base64.urlsafe_b64encode(raw).decode("ascii").rstrip("=")


def _decode_cursor(cursor):
    s = str(cursor)
    pad = "=" * (-len(s) % 4)
    try:
        raw = base64.urlsafe_b64decode(s + pad).decode("ascii")
        created_at, post_id = raw.split(":")
        return int(created_at), int(post_id)
    except Exception as exc:
        raise ValueError("invalid cursor") from exc


def fetch_page(conn, cursor=None, limit=20):
    """Return (rows, next_cursor): one page of the board, newest first.

    rows is a list of (id, author, body, created_at) tuples, ordered by
    created_at descending and, within equal created_at, by id descending.
    next_cursor is an opaque string the caller hands back to get the next
    page, or None when there are no more posts.

    posts(id INTEGER PRIMARY KEY, author TEXT, body TEXT, created_at INTEGER)
    created_at is unix seconds.
    """
    limit = max(1, min(int(limit), MAX_LIMIT))

    order = "ORDER BY created_at DESC, id DESC"

    if cursor is None:
        cur = conn.execute(
            f"SELECT {COLUMNS} FROM posts {order} LIMIT ?",
            (limit + 1,),
        )
    else:
        last_created_at, last_id = _decode_cursor(cursor)
        # Strictly "older" than the cursor row in (created_at, id) order.
        cur = conn.execute(
            f"SELECT {COLUMNS} FROM posts "
            "WHERE created_at < ? OR (created_at = ? AND id < ?) "
            f"{order} LIMIT ?",
            (last_created_at, last_created_at, last_id, limit + 1),
        )

    rows = cur.fetchall()
    has_more = len(rows) > limit
    rows = rows[:limit]

    next_cursor = None
    if has_more and rows:
        last = rows[-1]
        next_cursor = _encode_cursor(last[3], last[0])  # (created_at, id)

    return rows, next_cursor

Notes:

  • Each page resumes strictly after a specific row, not after a timestamp, so ties are split cleanly: no row is ever returned twice and none is skipped.
  • The cursor is base64 of created_at:id — opaque to the app, which just passes it back. Old plain-integer cursors won't decode; they'll raise ValueError, so if you have live clients holding them, treat a decode failure as "start from the beginning" instead of raising.
  • For performance, add an index matching the sort: CREATE INDEX IF NOT EXISTS posts_feed ON posts(created_at DESC, id DESC); Without it, SQLite sorts the whole table for every page.
  • One inherent property of keyset paging: posts created after you started scrolling won't appear in pages you've already passed. That's usually what you want for a feed.
  • Floor2/2, 100% passed
  • Middle3/3, 100% passed
  • Top2/2, 100% passed
7 of 7 checks passedfloor 2/2, middle 3/3, top 2/2
  • Passed.
    The first page comes back correct, newest first
    Floor Tested
  • Passed.
    Keeps the return shape: string cursor, None at the end
    Floor Tested
  • Passed.
    Paging through everything shows each post exactly once
    Middle Tested
  • Passed.
    Order is newest first and, on ties, higher id first
    Middle Tested
  • Passed.
    Explains that shared created_at values cause the problem
    Middle Tested
  • Passed.
    Still correct at page sizes 1, 2 and 3
    Top Tested
  • Passed.
    New posts added at the top mid-scroll cause no repeats or gaps
    Top Tested
  • Took 19 s.
  • First words after 4.0 s.
  • Wrote 1,638 tokens, 138 of them thinking.
  • 5.0¢ at API prices.
All numbers.
Time to finish19 s
Time to first words4.0 s
Input tokens2
Cached tokens1,401
Output tokens1,638
Thinking tokens138
Words in the answer558
Price at API rates5.0¢

AI answer from Opus 5 · max effort · 2 Oct 2026

7 of 7

What was wrong

The cursor is just created_at, but created_at is not unique — and with the importer back-filling, ties are common. Three bugs fall out of that:

  1. created_at <= ? re-reads the whole tie group. The last row of a page becomes the cursor, and the next query includes every post with that timestamp again → duplicates.
  2. ORDER BY created_at DESC alone is not a total order. SQLite may return tied rows in a different order on each query (different plan, different page cache, a new insert). If a page boundary lands inside a tie group, rows that moved to the other side of the boundary are never returned. Busy days ⇒ bigger tie groups ⇒ more of both symptoms.
  3. If more than limit posts share one created_at, the cursor never advances — the same page repeats forever (or until the client gives up).

Minor: int(cursor) throws an unfriendly error on a bad cursor, and the "opaque" cursor was a readable timestamp.

The fix is keyset pagination on the full sort key (created_at, id): order by both, and make the cursor comparison strict on the pair, so each row is visited exactly once.

Fixed function

import base64
import json

MAX_LIMIT = 100
COLUMNS = "id, author, body, created_at"


def _encode_cursor(created_at, post_id):
    raw = json.dumps([int(created_at), int(post_id)],
                     separators=(",", ":")).encode("utf-8")
    return base64.urlsafe_b64encode(raw).decode("ascii").rstrip("=")


def _decode_cursor(cursor):
    if not isinstance(cursor, str):
        raise ValueError("cursor must be a string")
    try:
        padded = cursor + "=" * (-len(cursor) % 4)
        created_at, post_id = json.loads(
            base64.urlsafe_b64decode(padded.encode("ascii"))
        )
        return int(created_at), int(post_id)
    except Exception as exc:
        raise ValueError("malformed cursor") from exc


def fetch_page(conn, cursor=None, limit=20):
    """Return (rows, next_cursor): one page of the board, newest first.

    rows is a list of (id, author, body, created_at) tuples, ordered by
    created_at descending, then id descending (higher id first on ties).
    next_cursor is an opaque string the caller hands back to get the next
    page, or None when there are no more posts.

    posts(id INTEGER PRIMARY KEY, author TEXT, body TEXT, created_at INTEGER)
    created_at is unix seconds.
    """
    limit = max(1, min(int(limit), MAX_LIMIT))

    if cursor is None:
        cur = conn.execute(
            f"SELECT {COLUMNS} FROM posts "
            "ORDER BY created_at DESC, id DESC "
            "LIMIT ?",
            (limit + 1,),
        )
    else:
        last_created_at, last_id = _decode_cursor(cursor)
        cur = conn.execute(
            f"SELECT {COLUMNS} FROM posts "
            "WHERE created_at < ? OR (created_at = ? AND id < ?) "
            "ORDER BY created_at DESC, id DESC "
            "LIMIT ?",
            (last_created_at, last_created_at, last_id, limit + 1),
        )

    rows = cur.fetchall()
    has_more = len(rows) > limit
    rows = rows[:limit]

    next_cursor = None
    if has_more:
        last = rows[-1]
        next_cursor = _encode_cursor(last[3], last[0])  # created_at, id

    return rows, next_cursor

Notes

  • Add the matching index, or deep pages will table-scan and sort: CREATE INDEX IF NOT EXISTS posts_feed ON posts(created_at DESC, id DESC);
  • The WHERE a < ? OR (a = ? AND b < ?) form is used instead of the tidier row-value (created_at, id) < (?, ?) because row values need SQLite ≥ 3.15; the expanded form also uses the index well.
  • Cursors in flight will be rejected when you deploy, since the old format was a bare integer. If that matters, accept legacy cursors in _decode_cursor by returning (int(cursor), 1 << 62) when cursor.isdigit() — that reproduces the old created_at <= ? behaviour once, then subsequent cursors are the new format.
  • Posts created while someone is scrolling sort above their current position, so they simply aren't seen in that pass — no duplicates, no skips. If you want new posts to appear, the client should re-request the first page (cursor=None).
  • Floor2/2, 100% passed
  • Middle3/3, 100% passed
  • Top2/2, 100% passed
7 of 7 checks passedfloor 2/2, middle 3/3, top 2/2
  • Passed.
    The first page comes back correct, newest first
    Floor Tested
  • Passed.
    Keeps the return shape: string cursor, None at the end
    Floor Tested
  • Passed.
    Paging through everything shows each post exactly once
    Middle Tested
  • Passed.
    Order is newest first and, on ties, higher id first
    Middle Tested
  • Passed.
    Explains that shared created_at values cause the problem
    Middle Tested
  • Passed.
    Still correct at page sizes 1, 2 and 3
    Top Tested
  • Passed.
    New posts added at the top mid-scroll cause no repeats or gaps
    Top Tested
  • Took 40 s.
  • First words after 23 s.
  • Wrote 3,290 tokens, 1,661 of them thinking.
  • 9.1¢ at API prices.
All numbers.
Time to finish40 s
Time to first words23 s
Input tokens2
Cached tokens1,401
Output tokens3,290
Thinking tokens1,661
Words in the answer599
Price at API rates9.1¢
F02The search box shows results for an old queryLow 7/7Max 7/7Same

What it asks for. Pastes a TypeScript controller for a search-as-you-type box with two bugs: typing fast can leave results for an earlier query on screen, and the loading spinner disappears too early. The API client cannot cancel requests. It asks for the whole fixed file with the same exports, the spinner on exactly while the newest search is loading, and code that Node can run with its built-in TypeScript support.

Both settings passed 7 of 7 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

7 of 7

The fixed file

export interface SearchOptions {
  // The API client. It returns a Promise and can't be cancelled.
  fetchResults: (query: string) => Promise<string[]>;
  // Draws the list. Pass an error as the second argument to show the error state.
  render: (results: string[], error?: Error) => void;
  // Shows or hides the spinner.
  setLoading: (loading: boolean) => void;
}

export function createSearch({ fetchResults, render, setLoading }: SearchOptions) {
  // Monotonic id of the most recent onInput call. Anything older is stale.
  let latest = 0;

  return {
    // Called on every keystroke with the current text of the box.
    async onInput(raw: string): Promise<void> {
      const query = raw.trim();
      const id = ++latest;

      if (query === "") {
        render([]);
        setLoading(false);
        return;
      }

      setLoading(true);
      try {
        const results = await fetchResults(query);
        if (id !== latest) return;
        render(results);
      } catch (err) {
        if (id !== latest) return;
        render([], err instanceof Error ? err : new Error(String(err)));
      }
      setLoading(false);
    },
  };
}

What was wrong

Stale results overwriting fresh ones. Every keystroke started a request, and whichever request resolved last won — which isn't necessarily the newest one, since a slow early request can land after a fast later one. Now each call takes a ticket (id = ++latest), and after awaiting it checks whether it is still the newest call. If not, it returns without touching the list or the spinner. Since the API can't be cancelled, the old request still runs to completion; we just ignore its outcome.

The spinner turning off too early. setLoading(false) was in a finally, so any request finishing — including an obsolete one — switched the spinner off while the newest request was still in flight. Moving it out of finally and placing it after the staleness check means only the newest request can turn it off, and it does so exactly when its results or error are rendered.

Emptying the box. The empty branch previously rendered [] but never touched the spinner, so if you cleared the box mid-request you were left with a spinner that only stopped when the orphaned request finished. It now bumps latest (invalidating every request in flight) and calls setLoading(false) explicitly, so the list clears, the spinner goes off, and an older request landing afterwards is discarded.

No enums or other transform-requiring syntax, the export, its options and the onInput signature are unchanged, and fetchResults is still called on every input.

One thing worth knowing: this relies on onInput calls being started in keystroke order, which is the case when it's wired straight to an input event. Debouncing later will slot in cleanly on top of this — the ticket check stays correct either way.

  • Floor2/2, 100% passed
  • Middle2/2, 100% passed
  • Top3/3, 100% passed
7 of 7 checks passedfloor 2/2, middle 2/2, top 3/3
  • Passed.
    The file loads under type stripping and a plain search works
    Floor Tested
  • Passed.
    A failing search still shows the error and hides the spinner
    Floor Tested
  • Passed.
    Only the newest query's results are left on screen
    Middle Tested
  • Passed.
    The spinner stays on until the newest request finishes, then goes off
    Middle Tested
  • Passed.
    An old request that fails does not touch the newer results
    Top Tested
  • Passed.
    Emptying the box clears the list, and late answers don't bring it back
    Top Tested
  • Passed.
    If the newest search fails, the error is shown and stays
    Top Tested
  • Took 14 s.
  • First words after 2.7 s.
  • Wrote 982 tokens, 22 of them thinking.
  • 3.3¢ at API prices.
All numbers.
Time to finish14 s
Time to first words2.7 s
Input tokens2
Cached tokens1,352
Output tokens982
Thinking tokens22
Words in the answer448
Price at API rates3.3¢

AI answer from Opus 5 · max effort · 2 Oct 2026

7 of 7

The fixed file

export interface SearchOptions {
  // The API client. It returns a Promise and can't be cancelled.
  fetchResults: (query: string) => Promise<string[]>;
  // Draws the list. Pass an error as the second argument to show the error state.
  render: (results: string[], error?: Error) => void;
  // Shows or hides the spinner.
  setLoading: (loading: boolean) => void;
}

export function createSearch({ fetchResults, render, setLoading }: SearchOptions) {
  // Id of the most recent onInput call. Requests can't be cancelled, so instead
  // we let only the newest call touch the list and the spinner; older responses
  // still arrive, they just get dropped.
  let latest = 0;

  return {
    // Called on every keystroke with the current text of the box.
    async onInput(raw: string): Promise<void> {
      const query = raw.trim();
      const id = ++latest;
      const isCurrent = () => id === latest;

      if (query === "") {
        // Emptying the box is itself the newest "search": the id bump above
        // invalidates anything in flight, so a slow request that lands later
        // can no longer refill the list or leave the spinner on.
        render([]);
        setLoading(false);
        return;
      }

      setLoading(true);
      try {
        const results = await fetchResults(query);
        if (isCurrent()) render(results);
      } catch (err) {
        if (isCurrent()) render([], err instanceof Error ? err : new Error(String(err)));
      } finally {
        // Only the newest search owns the spinner, so an older request
        // finishing first can't switch it off underneath us.
        if (isCurrent()) setLoading(false);
      }
    },
  };
}

What was wrong

Stale results: last-to-finish won, instead of newest-query-wins. Every onInput call rendered unconditionally after its await. Responses don't necessarily come back in the order you sent them, so if the request for "ca" was slow and "cat" came back quickly, "ca" landed second and overwrote the fresh list. The fix is a monotonic id taken at the top of each call: after the await, a response only renders if its id is still latest. Nothing is cancelled (the client can't), the old response is just ignored.

Spinner: every request could switch it off. setLoading(false) lived in a finally that ran for all calls, so with two requests in flight the first one to settle hid the spinner while the newest search was still loading. Now only the current call may turn it off, and only the current call turns it on, so the spinner is on exactly while the newest search is outstanding and off the moment its results or error are shown.

Empty box: it didn't claim ownership of the UI. The query === "" branch returned early without touching the spinner and without invalidating in-flight work. Two consequences: clearing the box mid-load left the spinner spinning forever, and an older request landing afterwards repopulated the list of an empty box. The empty branch now takes a new id as well (making everything in flight stale) and explicitly calls setLoading(false).

Two notes for later: onInput still resolves when its own request settles, which is handy for awaiting it in tests; and because you kept a request per keystroke, typing a trailing space fires a second request for the same trimmed text — harmless now, and the natural place to deal with it is when you add debouncing and/or a "same query as last time" guard.

  • Floor2/2, 100% passed
  • Middle2/2, 100% passed
  • Top3/3, 100% passed
7 of 7 checks passedfloor 2/2, middle 2/2, top 3/3
  • Passed.
    The file loads under type stripping and a plain search works
    Floor Tested
  • Passed.
    A failing search still shows the error and hides the spinner
    Floor Tested
  • Passed.
    Only the newest query's results are left on screen
    Middle Tested
  • Passed.
    The spinner stays on until the newest request finishes, then goes off
    Middle Tested
  • Passed.
    An old request that fails does not touch the newer results
    Top Tested
  • Passed.
    Emptying the box clears the list, and late answers don't bring it back
    Top Tested
  • Passed.
    If the newest search fails, the error is shown and stays
    Top Tested
  • Took 56 s.
  • First words after 43 s.
  • Wrote 4,739 tokens, 3,584 of them thinking.
  • 13¢ at API prices.
All numbers.
Time to finish56 s
Time to first words43 s
Input tokens2
Cached tokens1,352
Output tokens4,739
Thinking tokens3,584
Words in the answer548
Price at API rates13¢
F03Some subscriptions renew a day earlyLow 7/7Max 7/7Same

What it asks for. Pastes a JavaScript function that lists a subscription's monthly renewal dates, with its rules in a comment, and reports two symptoms: customers far from UTC renew a day early, and a customer who signed up on the last day of January has been charged on the 28th of every month since. It asks for the function fixed for Node 22 with no libraries, and a short note on what was wrong.

Both settings passed 7 of 7 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

7 of 7

// Monthly renewal dates for a subscription.
//
// signupIso  : the moment the customer signed up, as an ISO string in UTC,
//              e.g. "2025-01-31T23:30:00Z"
// timeZone   : the customer's IANA time zone, e.g. "Pacific/Auckland"
// count      : how many upcoming renewals to return
// returns    : an array of count local calendar dates, "YYYY-MM-DD", in the
//              customer's time zone, earliest first
//
// Rules:
//  - The first renewal is one month after the signup, not on the signup day.
//  - A renewal falls on the same day of the month as the signup's local date
//    in the customer's time zone.
//  - If a month is too short for that day, use its last day.
//  - Always count from the original signup day, never from the previous renewal.
export function renewalDates(signupIso, timeZone, count) {
  // The signup's calendar date as seen in the customer's time zone.
  const parts = new Intl.DateTimeFormat("en-US", {
    timeZone,
    year: "numeric",
    month: "2-digit",
    day: "2-digit",
  }).formatToParts(new Date(signupIso));

  const get = (type) => Number(parts.find((p) => p.type === type).value);
  const year = get("year");
  const month = get("month"); // 1-12
  const anchorDay = get("day"); // never changes

  const daysInMonth = (y, m) => new Date(Date.UTC(y, m, 0)).getUTCDate();

  const dates = [];
  for (let i = 1; i <= count; i++) {
    const total = month - 1 + i; // months since January of `year`
    const y = year + Math.floor(total / 12);
    const m = (total % 12) + 1;
    const day = Math.min(anchorDay, daysInMonth(y, m));
    dates.push(
      `${String(y).padStart(4, "0")}-${String(m).padStart(2, "0")}-${String(day).padStart(2, "0")}`
    );
  }
  return dates;
}

What was wrong:

  1. The time zone was ignored. The code read the day straight off the UTC instant with getUTCDate(). For an Auckland customer who signed up on the morning of the 1st local time, the UTC instant is still the previous day (the 31st), so every renewal landed a day early. The fix formats the signup instant in the customer's zone first to get the true local signup day.
  2. The anchor day drifted. The loop reused the mutated d each time, so once a day was clamped it became the new anchor: a 31st signup clamped to the 28th in February and then stayed on the 28th forever. The fix keeps the original day fixed and computes each month independently from it, clamping only for that month.

A smaller point: the old code also round-tripped through toISOString(), which re-applies UTC and can shift the printed date. Since the output is a local calendar date, the new version builds the string from the year/month/day directly, with no instant conversion at all.

  • Floor2/2, 100% passed
  • Middle2/2, 100% passed
  • Top3/3, 100% passed
7 of 7 checks passedfloor 2/2, middle 2/2, top 3/3
  • Passed.
    Mid-month signups in UTC get the right dates
    Floor Tested
  • Passed.
    Returns exactly count dates as YYYY-MM-DD, in order
    Floor Tested
  • Passed.
    Uses the customer's local date (Auckland, Kolkata, LA, London)
    Middle Tested
  • Passed.
    Explains both causes: the UTC date and drifting month to month
    Middle Read
  • Passed.
    Signups on the 29th to 31st keep their day after short months
    Top Tested
  • Passed.
    Leap and non-leap Februaries are handled, including 2100
    Top Tested
  • Passed.
    Signups just before or after a clock change get the right local date
    Top Tested
  • Took 15 s.
  • First words after 4.8 s.
  • Wrote 1,222 tokens, 212 of them thinking.
  • 3.9¢ at API prices.
All numbers.
Time to finish15 s
Time to first words4.8 s
Input tokens2
Cached tokens1,375
Output tokens1,222
Thinking tokens212
Words in the answer440
Price at API rates3.9¢

AI answer from Opus 5 · max effort · 2 Oct 2026

7 of 7

Here's the corrected function:

// Monthly renewal dates for a subscription.
//
// signupIso  : the moment the customer signed up, as an ISO string in UTC,
//              e.g. "2025-01-31T23:30:00Z"
// timeZone   : the customer's IANA time zone, e.g. "Pacific/Auckland"
// count      : how many upcoming renewals to return
// returns    : an array of count local calendar dates, "YYYY-MM-DD", in the
//              customer's time zone, earliest first
//
// Rules:
//  - The first renewal is one month after the signup, not on the signup day.
//  - A renewal falls on the same day of the month as the signup's local date
//    in the customer's time zone.
//  - If a month is too short for that day, use its last day.
//  - Always count from the original signup day, never from the previous renewal.
export function renewalDates(signupIso, timeZone, count) {
  const n = Math.trunc(count);
  if (!Number.isFinite(n) || n <= 0) return [];

  const signup = new Date(signupIso);
  if (Number.isNaN(signup.getTime())) {
    throw new TypeError(`Invalid signup timestamp: ${signupIso}`);
  }
  if (typeof timeZone !== 'string' || timeZone === '') {
    throw new TypeError('A IANA time zone is required');
  }

  // The signup's calendar date as the customer saw it, not as UTC saw it.
  const { year, month, day } = localDateParts(signup, timeZone);

  const dates = [];
  for (let i = 1; i <= n; i++) {
    // Always measured from the original signup month, so a clamped renewal
    // (e.g. 31 Jan -> 28 Feb) never becomes the anchor for the next one.
    const monthsFromEpochish = month - 1 + i;
    const y = year + Math.floor(monthsFromEpochish / 12);
    const m = (((monthsFromEpochish % 12) + 12) % 12) + 1;
    const d = Math.min(day, daysInMonth(y, m));
    dates.push(
      `${String(y).padStart(4, '0')}-${String(m).padStart(2, '0')}-${String(d).padStart(2, '0')}`
    );
  }
  return dates;
}

function localDateParts(instant, timeZone) {
  const parts = new Intl.DateTimeFormat('en-US', {
    timeZone,
    year: 'numeric',
    month: '2-digit',
    day: '2-digit',
  }).formatToParts(instant);
  const get = (type) => Number(parts.find((p) => p.type === type).value);
  return { year: get('year'), month: get('month'), day: get('day') };
}

function isLeapYear(year) {
  return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
}

function daysInMonth(year, month /* 1-12 */) {
  if (month === 2) return isLeapYear(year) ? 29 : 28;
  return [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1];
}

What was wrong

  1. It read the signup day in UTC, not in the customer's zone. d.getUTCDate() on a Date built from the ISO string gives the UTC calendar day. Auckland is 12–13 hours ahead, so a morning-of-the-1st signup is still the 31st (or 28th, or 30th) in UTC, and every renewal inherited that wrong anchor day. The fix takes the signup's local date via Intl.DateTimeFormat with the timeZone, which also handles DST correctly since it resolves the offset at that instant rather than assuming a fixed one.
  2. It re-anchored on the previous renewal. The single d was mutated in place and day was re-read from it each pass. Once a month was too short and the day got clamped, the clamped value became the new anchor — so 31 Jan → 28 Feb → 28 Mar → 28 Apr forever. The rewrite keeps the original signup day in a separate variable and computes each renewal as signup month + i, with the clamp applied only to the output.
  3. The output was formatted from a Date again. d.toISOString().slice(0, 10) prints the UTC date of a timestamp, which can be off by a day from the local calendar date you actually want. Renewal dates are pure calendar values, so they're now built as integers and formatted as a string directly — no Date round-trip, no second chance to shift a day.

I also added guards for an unparseable timestamp and a missing timeZone (passing timeZone: undefined to Intl silently falls back to the server's zone, which would have hidden this class of bug all over again). Behaviour is unchanged for valid input: same name, arguments, named export, and an array of "YYYY-MM-DD" strings.

Quick sanity check with the example in the comment — "2025-01-31T23:30:00Z" in Pacific/Auckland is 12:30 on 1 February locally, so the renewals are 2025-03-01, 2025-04-01, 2025-05-01, … A genuine 31 January local signup gives 2025-02-28, 2025-03-31, 2025-04-30, 2025-05-31.

  • Floor2/2, 100% passed
  • Middle2/2, 100% passed
  • Top3/3, 100% passed
7 of 7 checks passedfloor 2/2, middle 2/2, top 3/3
  • Passed.
    Mid-month signups in UTC get the right dates
    Floor Tested
  • Passed.
    Returns exactly count dates as YYYY-MM-DD, in order
    Floor Tested
  • Passed.
    Uses the customer's local date (Auckland, Kolkata, LA, London)
    Middle Tested
  • Passed.
    Explains both causes: the UTC date and drifting month to month
    Middle Read
  • Passed.
    Signups on the 29th to 31st keep their day after short months
    Top Tested
  • Passed.
    Leap and non-leap Februaries are handled, including 2100
    Top Tested
  • Passed.
    Signups just before or after a clock change get the right local date
    Top Tested
  • Took 56 s.
  • First words after 38 s.
  • Wrote 4,794 tokens, 2,983 of them thinking.
  • 13¢ at API prices.
All numbers.
Time to finish56 s
Time to first words38 s
Input tokens2
Cached tokens1,375
Output tokens4,794
Thinking tokens2,983
Words in the answer717
Price at API rates13¢
F04Review a pull request before mergingLow 7/7Max 7/7Same

What it asks for. Pastes a pull request of about 170 lines that adds invoice endpoints to an Express and TypeScript API, and asks for a review before merging that lists what needs fixing in order of importance plus other points worth noting, in under 400 words.

Both settings passed 7 of 7 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

7 of 7

Review

Must fix before merge

1. GET /invoices/:id leaks other accounts' invoices (IDOR). findInvoiceById filters only on id, and the route never checks ownership. Any logged-in user who guesses or obtains an invoice id can read another account's invoice. Fix in the repo so it can't be forgotten:

export async function findInvoiceById(id: string, accountId: string) {
  const { rows } = await db.query(
    `SELECT ${COLUMNS} FROM invoices WHERE id = $1 AND account_id = $2`,
    [id, accountId],
  );
  return rows[0] ?? null;
}

and pass req.user.accountId from the route. Keep returning 404 (not 403) so ids aren't enumerable. Worth a test that asserts a cross-account id gives 404.

2. to is documented as inclusive but implemented as exclusive. The docs and the route comment say "last day to include (inclusive)", while the query uses created_at < $3. Invoices on the to day are silently dropped — a date-range bug users will report as missing data. Either add a day to to before querying (AND created_at < $3::date + 1, keeping the inclusive contract) or change docs and comment to exclusive. The inclusive version is friendlier and matches what you've already published.

3. No validation that from <= to. Currently returns an empty list, which looks like "no invoices" rather than a bad request. Return 400 bad_range.

Worth knowing

  • Route ordering: /:id is registered before /, which is fine here, but /:id will match any single segment. If you later add /invoices/export, it'll be swallowed by /:id. Put literal routes first as a habit.
  • Timezone: created_at is compared against bare YYYY-MM-DD strings, so the range boundaries resolve in whatever timezone the DB session uses. If created_at is timestamptz, decide explicitly (UTC day? account's timezone?) and cast in SQL, otherwise edge-of-day invoices land in the wrong bucket.
  • Sort whitelist is sound. Object.hasOwn plus the fixed ASC/DESC mapping means no SQL text comes from the request. Good. Consider rejecting unknown sort/dir values with a 400 instead of silently defaulting — silent fallback hides client bugs.
  • No pagination. An account with years of invoices will return everything in one response. Add a limit/cursor before this gets real data.
  • Unstable ordering: sorting by total_cents alone gives non-deterministic order for ties. Add , id as a tiebreaker.
  • fmtMoney → formatMoney rename is clean and all call sites are updated. Confirm nothing outside this diff (tests, other routers) still references the old name.
  • Missing error handling: if db.query rejects, there's no catch; verify you have an async-aware error handler, or wrap the handlers.
  • Floor2/2, 100% passed
  • Middle2/2, 100% passed
  • Top3/3, 100% passed
7 of 7 checks passedfloor 2/2, middle 2/2, top 3/3
  • Passed.
    Gives a clear verdict: do not merge as it is
    Floor Counted
  • Passed.
    Stays under the 400-word limit
    Floor Counted
  • Passed.
    Spots that any signed-in user can read another account's invoice
    Middle Counted
  • Passed.
    Gives a concrete fix: scope the lookup by account or return 404/403
    Middle Counted
  • Passed.
    Spots that the end date is left out although the docs say inclusive
    Top Counted
  • Passed.
    Puts the invoice access hole first, ahead of the other issues
    Top Read
  • Passed.
    Does not call the ORDER BY string building an injection risk
    Top Read
  • Took 15 s.
  • First words after 2.0 s.
  • Wrote 1,041 tokens.
  • 4.6¢ at API prices.
All numbers.
Time to finish15 s
Time to first words2.0 s
Input tokens2
Cached tokens3,184
Output tokens1,041
Thinking tokens0
Words in the answer428
Price at API rates4.6¢

AI answer from Opus 5 · max effort · 2 Oct 2026

7 of 7

Must fix before merge

1. Missing authorization on GET /invoices/:id (IDOR). findInvoiceById(req.params.id) never filters by account, so any signed-in user can read any account's invoice by guessing/learning an ID. This is the blocker. Add AND account_id = $2 to the query, pass req.user.accountId, and keep returning 404 (not 403) so you don't leak whether an ID exists. The list endpoint scopes correctly — the detail endpoint just doesn't.

2. to is off by a day. The docs say to is inclusive, but the SQL is created_at < $3 against a bare YYYY-MM-DD, which resolves to midnight — so the whole final day is excluded. Either add a day to build the exclusive bound ($3::date + INTERVAL '1 day') or change the docs. Also decide and document which timezone the day boundaries are in; a bare date against a timestamptz resolves in the DB session's zone, which bites as soon as someone is not on UTC.

3. Confirm the fmtMoney → formatMoney rename is complete. The diff updates receipts.ts but not account.ts. If anything else still imports fmtMoney, the build breaks. Worth grepping. Separately, an unrelated rename inside a feature PR makes the change harder to revert.

4. No LIMIT. An account with years of invoices and a wide range returns everything in one response. Add a cap plus pagination, or at minimum a hard LIMIT now — it's much cheaper than changing the response shape later.

5. Async error handling. If you're on Express 4, a rejected promise in these handlers doesn't reach the error middleware; the request hangs. Express 5 handles it. Match whatever receipts.ts relies on.

Worth knowing

  • The SQL injection surface is handled well — the whitelist plus Object.hasOwn is the right pattern.
  • Invalid sort/dir silently fall back to defaults while a bad date returns 400. Pick one behaviour; silent fallback hides client bugs.
  • sort=amount compares total_cents across currencies, which is meaningless if an account can hold mixed currencies.
  • ORDER BY has no tiebreaker, so ties come back in arbitrary order. Add , id — this becomes a real bug once pagination exists.
  • /:id is registered before /. Fine today, but it will swallow any later literal route like /invoices/export.
  • from > to isn't rejected; it just returns empty.
  • Docs don't mention that from/to are required, the 400/404 responses, or that total is a formatted string like "USD 12.34" rather than a number.
  • No tests for either endpoint — the authorization check in particular deserves one.
  • Floor2/2, 100% passed
  • Middle2/2, 100% passed
  • Top3/3, 100% passed
7 of 7 checks passedfloor 2/2, middle 2/2, top 3/3
  • Passed.
    Gives a clear verdict: do not merge as it is
    Floor Counted
  • Passed.
    Stays under the 400-word limit
    Floor Counted
  • Passed.
    Spots that any signed-in user can read another account's invoice
    Middle Counted
  • Passed.
    Gives a concrete fix: scope the lookup by account or return 404/403
    Middle Counted
  • Passed.
    Spots that the end date is left out although the docs say inclusive
    Top Counted
  • Passed.
    Puts the invoice access hole first, ahead of the other issues
    Top Read
  • Passed.
    Does not call the ORDER BY string building an injection risk
    Top Read
  • Took 38 s.
  • First words after 27 s.
  • Wrote 2,918 tokens, 1,955 of them thinking.
  • 9.3¢ at API prices.
All numbers.
Time to finish38 s
Time to first words27 s
Input tokens2
Cached tokens3,184
Output tokens2,918
Thinking tokens1,955
Words in the answer419
Price at API rates9.3¢
F05SQL: which customers left and came backLow 7/7Max 7/7Same

What it asks for. Gives the schema of a subscriptions database and asks for one SQLite query that lists each gap in a customer's access that ended with them returning, with the last day of access, the day it came back and the number of days without it. Plan changes can make periods touch, overlap or sit inside one another, and none of that counts as a gap. A small example with its expected output is included.

Both settings passed 7 of 7 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

7 of 7

WITH p AS (
  SELECT customer_id,
         start_date,
         COALESCE(end_date, '9999-12-31') AS end_date
  FROM subscription_periods
),
m AS (
  SELECT customer_id,
         start_date,
         MAX(end_date) OVER (
           PARTITION BY customer_id
           ORDER BY start_date, end_date
           ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING
         ) AS prev_end
  FROM p
)
SELECT c.name                                        AS name,
       m.prev_end                                    AS last_access,
       m.start_date                                  AS came_back,
       CAST(julianday(m.start_date) - julianday(m.prev_end) AS INTEGER) - 1
                                                     AS days_without
FROM m
JOIN customers c ON c.id = m.customer_id
WHERE m.prev_end IS NOT NULL
  AND m.start_date > date(m.prev_end, '+1 day')
ORDER BY c.name, came_back, c.id;

How it works:

  • p normalises an open-ended period (end_date IS NULL) to the sentinel '9999-12-31', so an active period counts as covering everything from its start onwards.
  • m sorts each customer's periods by start_date (then end_date) and computes a running maximum of all earlier periods' end dates (ROWS ... 1 PRECEDING). That high-water mark is the last day of access achieved so far, which is what makes touching, same-day, overlapping and fully-nested periods harmless — they never push the mark backwards.
  • A gap exists only when the current period starts strictly later than the day after the high-water mark, i.e. at least one whole day with no access. prev_end IS NULL skips each customer's first period.
  • days_without is the plain day difference minus one, so 06-30 → 07-10 gives 9. Dates are compared as 'YYYY-MM-DD' strings, where lexical order equals chronological order, so ids are never used for ordering.
  • A customer who left for good produces no row (there is no later period), and nothing can start after a 9999-12-31 mark, so an active latest period never yields a gap.
  • Floor2/2, 100% passed
  • Middle2/2, 100% passed
  • Top3/3, 100% passed
7 of 7 checks passedfloor 2/2, middle 2/2, top 3/3
  • Passed.
    The query runs and returns the four named columns
    Floor Tested
  • Passed.
    It gets the example in the question right
    Floor Tested
  • Passed.
    Periods that touch or overlap are not counted as gaps
    Middle Tested
  • Passed.
    Several gaps per customer, same-name customers, sort order
    Middle Tested
  • Passed.
    A period inside a longer one does not hide or invent a gap
    Top Tested
  • Passed.
    Open-ended (NULL end) periods never produce a gap after them
    Top Tested
  • Passed.
    Days without access is exact across month, leap and year ends
    Top Tested
  • Took 17 s.
  • First words after 9.7 s.
  • Wrote 1,466 tokens, 705 of them thinking.
  • 4.7¢ at API prices.
All numbers.
Time to finish17 s
Time to first words9.7 s
Input tokens2
Cached tokens1,675
Output tokens1,466
Thinking tokens705
Words in the answer274
Price at API rates4.7¢

AI answer from Opus 5 · max effort · 2 Oct 2026

7 of 7

WITH periods AS (
    SELECT
        customer_id,
        start_date,
        COALESCE(end_date, '9999-12-31') AS end_date   -- still active = covered forever
    FROM subscription_periods
),
watermark AS (
    SELECT
        customer_id,
        start_date,
        MAX(end_date) OVER (
            PARTITION BY customer_id
            ORDER BY start_date, end_date
            ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING
        ) AS covered_to                                -- last day covered by everything starting earlier
    FROM periods
)
SELECT
    c.name                                                                 AS name,
    w.covered_to                                                           AS last_access,
    w.start_date                                                           AS came_back,
    CAST(julianday(w.start_date) - julianday(w.covered_to) AS INTEGER) - 1  AS days_without
FROM watermark w
JOIN customers c ON c.id = w.customer_id
WHERE w.covered_to IS NOT NULL                                  -- skip each customer's first period
  AND julianday(w.start_date) - julianday(w.covered_to) > 1     -- strictly more than "the next day"
ORDER BY c.name, w.start_date, w.customer_id;

How it works:

  • Active periods become a sentinel. COALESCE(end_date, '9999-12-31') turns "no end date" into "covered to the far future", so nothing after an open period can ever look like a gap.
  • A running watermark replaces interval merging. For each period, MAX(end_date) over all periods of that customer that start earlier (the ROWS ... 1 PRECEDING frame) gives the last day already covered. Because it's a max, touching, same-day, overlapping and fully-nested periods all collapse automatically — no need to build merged intervals first.
  • Ordering is by date, not id. The window orders by start_date (then end_date to break ties deterministically), so the physical id order is irrelevant.
  • Gap test. A period starts a gap only if its start_date is more than one day after the watermark; starting exactly the next day is continuous coverage. The first period per customer has a NULL watermark and is dropped, and a customer who never returned simply has no later row to report — so they never appear.
  • Day count. The difference in Julian days minus 1 counts only the whole uncovered days: 2024-06-30 → 2024-07-10 is 10 − 1 = 9. ISO date strings compare and sort correctly as text, so MAX on them is safe.
  • Sorting. ORDER BY c.name uses SQLite's default BINARY collation, so it's case- and accent-sensitive byte order; if you want case-insensitive alphabetical, use ORDER BY c.name COLLATE NOCASE, .... The trailing customer_id keeps same-named customers apart.

If the table is large, CREATE INDEX idx_sub_cust_start ON subscription_periods(customer_id, start_date, end_date); lets the window run without a sort.

  • Floor2/2, 100% passed
  • Middle2/2, 100% passed
  • Top3/3, 100% passed
7 of 7 checks passedfloor 2/2, middle 2/2, top 3/3
  • Passed.
    The query runs and returns the four named columns
    Floor Tested
  • Passed.
    It gets the example in the question right
    Floor Tested
  • Passed.
    Periods that touch or overlap are not counted as gaps
    Middle Tested
  • Passed.
    Several gaps per customer, same-name customers, sort order
    Middle Tested
  • Passed.
    A period inside a longer one does not hide or invent a gap
    Top Tested
  • Passed.
    Open-ended (NULL end) periods never produce a gap after them
    Top Tested
  • Passed.
    Days without access is exact across month, leap and year ends
    Top Tested
  • Took 58 s.
  • First words after 47 s.
  • Wrote 5,066 tokens, 4,011 of them thinking.
  • 14¢ at API prices.
All numbers.
Time to finish58 s
Time to first words47 s
Input tokens2
Cached tokens1,675
Output tokens5,066
Thinking tokens4,011
Words in the answer381
Price at API rates14¢
F06A contacts import that survives real CSV filesLow 9/9Max 9/9Same

What it asks for. Asks for a Python function, standard library only, that imports contacts from CSV files exported by many different tools and returns each contact's name, email and phone. The files vary in header names, comma or semicolon separators, a byte order mark, quoted fields with line breaks, Windows line endings and older files in Windows-1252. Rows without an email are skipped, and a repeated email keeps its first row.

Both settings passed 9 of 9 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

9 of 9

import csv
import io

NAME_KEYS = {"name", "full name", "contact name"}
EMAIL_KEYS = {"email", "e-mail", "email address", "e-mail address"}
PHONE_KEYS = {"phone", "phone number", "mobile", "mobile phone", "telephone"}


def _decode(raw):
    if raw.startswith(b"\xef\xbb\xbf"):
        raw = raw[3:]
    try:
        return raw.decode("utf-8")
    except UnicodeDecodeError:
        return raw.decode("cp1252")


def _header_line(text):
    """First physical line, respecting quotes (a quoted field may span lines)."""
    out = []
    in_quotes = False
    i = 0
    while i < len(text):
        ch = text[i]
        if ch == '"':
            if in_quotes and i + 1 < len(text) and text[i + 1] == '"':
                out.append('""')
                i += 2
                continue
            in_quotes = not in_quotes
        elif ch == "\n" and not in_quotes:
            break
        out.append(ch)
        i += 1
    return "".join(out)


def _delimiter(header):
    counts = {}
    in_quotes = False
    for i, ch in enumerate(header):
        if ch == '"':
            in_quotes = not in_quotes
        elif not in_quotes and ch in ";,":
            counts[ch] = counts.get(ch, 0) + 1
    if counts.get(";", 0) > counts.get(",", 0):
        return ";"
    return ","


def import_contacts(path):
    with open(path, "rb") as fh:
        text = _decode(fh.read())
    if not text.strip():
        return []

    # Normalise line endings so line breaks inside quoted fields become "\n".
    text = text.replace("\r\n", "\n").replace("\r", "\n")

    delim = _delimiter(_header_line(text))
    reader = csv.reader(io.StringIO(text, newline=""), delimiter=delim)

    try:
        header = next(reader)
    except StopIteration:
        return []

    idx = {}
    for pos, cell in enumerate(header):
        key = cell.strip().strip('\ufeff').lower()
        if key in NAME_KEYS:
            idx.setdefault("name", pos)
        elif key in EMAIL_KEYS:
            idx.setdefault("email", pos)
        elif key in PHONE_KEYS:
            idx.setdefault("phone", pos)

    if "email" not in idx:
        return []

    results = []
    seen = set()
    for row in reader:
        def get(field):
            pos = idx.get(field)
            if pos is None or pos >= len(row):
                return ""
            return row[pos].strip()

        email = get("email").lower()
        if not email or email in seen:
            continue
        seen.add(email)
        results.append({"name": get("name"), "email": email, "phone": get("phone")})
    return results

How it works: the file is read as bytes so the UTF-8 BOM can be stripped and the text decoded as UTF-8 with a fallback to Windows-1252; line endings are normalised to \n before parsing, which is what makes a line break inside a quoted field come out as a single \n. The delimiter is chosen by counting unquoted commas versus semicolons in the header line only, then csv.reader does the quoting work and the header is mapped to column positions via the accepted-name sets (case- and space-insensitive). Each row is read by position, with missing cells treated as empty and extra cells ignored; rows with no email (which covers blank and separator-only lines) are skipped, emails are lower-cased and de-duplicated keeping the first occurrence, and the original order is preserved.

  • Floor2/2, 100% passed
  • Middle3/3, 100% passed
  • Top4/4, 100% passed
9 of 9 checks passedfloor 2/2, middle 3/3, top 4/4
  • Passed.
    A plain comma-separated file is imported
    Floor Tested
  • Passed.
    Fields are stripped, emails lower-cased, rows without an email skipped
    Floor Tested
  • Passed.
    Header names vary in case, spacing, wording and order
    Middle Tested
  • Passed.
    A UTF-8 BOM and Windows line endings are handled
    Middle Tested
  • Passed.
    Quoted commas and doubled quotes are read correctly
    Middle Tested
  • Passed.
    Line breaks inside quoted fields are kept as one \n
    Top Tested
  • Passed.
    Semicolon files are read, even with commas in fields
    Top Tested
  • Passed.
    Windows-1252 files decode correctly and UTF-8 stays intact
    Top Tested
  • Passed.
    Duplicates, blank and short rows, and a file with every quirk at once
    Top Tested
  • Took 17 s.
  • First words after 5.9 s.
  • Wrote 1,531 tokens, 266 of them thinking.
  • 4.7¢ at API prices.
All numbers.
Time to finish17 s
Time to first words5.9 s
Input tokens2
Cached tokens1,387
Output tokens1,531
Thinking tokens266
Words in the answer420
Price at API rates4.7¢

AI answer from Opus 5 · max effort · 2 Oct 2026

9 of 9

Here's the function:

import csv
import io

_ALIASES = {
    "name":  ("name", "full name", "contact name"),
    "email": ("email", "e-mail", "email address", "e-mail address"),
    "phone": ("phone", "phone number", "mobile", "mobile phone", "telephone"),
}
_HEADER_LOOKUP = {alias: field
                  for field, aliases in _ALIASES.items()
                  for alias in aliases}


def _read_text(path):
    """Read the file as text: drop a UTF-8 BOM, fall back to Windows-1252,
    and normalise all line endings to \\n (including inside quoted fields)."""
    with open(path, "rb") as fh:
        data = fh.read()
    if data.startswith(b"\xef\xbb\xbf"):
        data = data[3:]
    try:
        text = data.decode("utf-8")
    except UnicodeDecodeError:
        text = data.decode("cp1252", errors="replace")
    text = text.lstrip("\ufeff")
    return text.replace("\r\n", "\n").replace("\r", "\n")


def _reader(text, delimiter):
    return csv.reader(io.StringIO(text, newline=""), delimiter=delimiter)


def _pick_delimiter(text):
    """The header has >= 2 columns, so the right separator is the one that
    splits the first record into the most fields (ties go to the comma)."""
    best, best_count = ",", 0
    for delimiter in (",", ";"):
        try:
            header = next(_reader(text, delimiter))
        except (StopIteration, csv.Error):
            continue
        if len(header) > best_count:
            best, best_count = delimiter, len(header)
    return best


def _normalise_header(cell):
    return " ".join(cell.replace("\u00a0", " ").split()).lower()


def _cell(row, columns, field):
    i = columns.get(field)
    if i is None or i >= len(row):
        return ""
    return row[i].strip()


def import_contacts(path):
    """Read a contacts CSV and return a list of {name, email, phone} dicts."""
    text = _read_text(path)
    if not text.strip():
        return []

    rows = _reader(text, _pick_delimiter(text))
    try:
        header = next(rows)
    except StopIteration:
        return []

    columns = {}
    for position, cell in enumerate(header):
        field = _HEADER_LOOKUP.get(_normalise_header(cell))
        if field is not None and field not in columns:   # first match wins
            columns[field] = position
    if "email" not in columns:
        return []

    contacts, seen = [], set()
    for row in rows:
        if not row:                                      # blank line
            continue
        email = _cell(row, columns, "email").lower()
        if not email or email in seen:                   # no email / duplicate
            continue
        seen.add(email)
        contacts.append({
            "name": _cell(row, columns, "name"),
            "email": email,
            "phone": _cell(row, columns, "phone"),
        })
    return contacts

How it works

The file is read as bytes so the BOM can be removed and the encoding decided explicitly (UTF-8, falling back to Windows-1252); line endings are then normalised to \n before parsing, which is also what turns a \r\n inside a quoted field into a single \n. The separator is chosen by parsing the first record with both candidates and keeping whichever yields more fields — quoting is respected, so a ; inside a quoted header cell can't fool it.

After that, the header is matched case- and whitespace-insensitively against the alias table to get a column index per field; _cell returns "" for a column that's absent or for a short row, and ignores extra cells by index. Rows are emitted in file order, skipping anything without an email and any email already seen (compared stripped and lower-cased), so a header-only or empty file naturally gives [].

  • Floor2/2, 100% passed
  • Middle3/3, 100% passed
  • Top4/4, 100% passed
9 of 9 checks passedfloor 2/2, middle 3/3, top 4/4
  • Passed.
    A plain comma-separated file is imported
    Floor Tested
  • Passed.
    Fields are stripped, emails lower-cased, rows without an email skipped
    Floor Tested
  • Passed.
    Header names vary in case, spacing, wording and order
    Middle Tested
  • Passed.
    A UTF-8 BOM and Windows line endings are handled
    Middle Tested
  • Passed.
    Quoted commas and doubled quotes are read correctly
    Middle Tested
  • Passed.
    Line breaks inside quoted fields are kept as one \n
    Top Tested
  • Passed.
    Semicolon files are read, even with commas in fields
    Top Tested
  • Passed.
    Windows-1252 files decode correctly and UTF-8 stays intact
    Top Tested
  • Passed.
    Duplicates, blank and short rows, and a file with every quirk at once
    Top Tested
  • Took 55 s.
  • First words after 43 s.
  • Wrote 4,722 tokens, 3,395 of them thinking.
  • 13¢ at API prices.
All numbers.
Time to finish55 s
Time to first words43 s
Input tokens2
Cached tokens1,387
Output tokens4,722
Thinking tokens3,395
Words in the answer464
Price at API rates13¢
F07Make a slow script fastLow 7/7Max 7/7Same

What it asks for. Pastes a Python function that matches bank payments to open invoices by customer, amount and a due date within 7 days, and says it is far too slow on about 200,000 of each. It asks for a replacement that runs in a couple of seconds, returns exactly the same results for every input and leaves the lists it is given unchanged.

Both settings passed 7 of 7 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

7 of 7

from bisect import bisect_left
from datetime import timedelta


def match_payments(payments, invoices):
    """Match bank payments to open invoices.

    payments: list of dicts with id, customer, amount (integer cents) and date (datetime.date).
    invoices: list of dicts with id, customer, amount (integer cents) and due (datetime.date).

    Payments are handled one at a time, in the order they are given. A payment is
    matched to the unpaid invoice that has the same customer and the same amount,
    whose due date is within 7 days either side of the payment date (7 days
    apart still counts). If several invoices qualify, the one with the earliest
    due date wins; if they are due on the same day, the lowest invoice id wins.
    An invoice can be matched to one payment only.

    Returns (matches, unmatched):
      matches   - list of (payment_id, invoice_id), in payment order
      unmatched - list of ids of the payments that found no invoice, in payment order
    """
    week = timedelta(days=7)

    # Bucket invoices by (customer, amount); inside a bucket, sort by (due, id)
    # so the first still-unused invoice inside the date window is always the winner.
    groups = {}
    for inv in invoices:
        groups.setdefault((inv["customer"], inv["amount"]), []).append(inv)

    buckets = {}
    for key, items in groups.items():
        items = sorted(items, key=lambda inv: (inv["due"], inv["id"]))
        n = len(items)
        # nxt is a disjoint-set "skip list": nxt[i] eventually points at the first
        # index >= i that has not been consumed yet (n means "none left").
        buckets[key] = (items, [inv["due"] for inv in items], list(range(n + 1)), n)

    def find(nxt, i):
        root = i
        while nxt[root] != root:
            root = nxt[root]
        while nxt[i] != root:          # path compression
            nxt[i], i = root, nxt[i]
        return root

    used = set()
    matches = []
    unmatched = []

    for pay in payments:
        bucket = buckets.get((pay["customer"], pay["amount"]))
        best = None
        if bucket is not None:
            items, dues, nxt, n = bucket
            date = pay["date"]
            hi = date + week
            i = find(nxt, bisect_left(dues, date - week))
            while i < n and dues[i] <= hi:
                inv = items[i]
                if inv["id"] in used:
                    # Same id already consumed elsewhere: retire this slot too.
                    nxt[i] = i + 1
                    i = find(nxt, i + 1)
                    continue
                best = inv
                nxt[i] = i + 1          # consume this slot
                break

        if best is None:
            unmatched.append(pay["id"])
        else:
            used.add(best["id"])
            matches.append((pay["id"], best["id"]))

    return matches, unmatched

What was slow: the old version scanned all 200,000 invoices for every one of 200,000 payments — 4·10¹⁰ dict lookups and comparisons. The work was quadratic, and nearly all of it was spent rejecting invoices with the wrong customer or amount.

What changed:

  • Invoices are bucketed once by (customer, amount), so a payment only ever looks at invoices that could possibly match.
  • Each bucket is sorted by (due, id) — exactly the old tie-break order — so the winner is simply the first eligible entry, not a full minimum scan. A binary search jumps straight to the first invoice due on or after date - 7 days, and the scan stops once due > date + 7 days.
  • The "an invoice can only be used once" problem is the remaining trap: with a thousand invoices at the same amount, re-scanning already-matched ones would still be quadratic. A union-find "next unused slot" array makes skipping consumed invoices amortised near-constant, so a big customer costs no more than a small one.

Behaviour is identical: same winner rule (earliest due, then lowest id), same inclusive 7-day window using date arithmetic, same payment-order output, and a payment with no bucket at all falls through to unmatched as before. The duplicate-id case is kept too: the original skipped any invoice whose id was already in used, so the scan here retires such slots rather than matching them. Neither input list nor any dict is mutated — buckets hold references to the same dicts, and the sort builds a new list — so callers can reuse both lists afterwards. Expect a couple of seconds at your data size. If invoice ids are not comparable with < (e.g. mixed int and str), that would need to be known, since the sort relies on the same comparison the old code did.

  • Floor2/2, 100% passed
  • Middle3/3, 100% passed
  • Top2/2, 100% passed
7 of 7 checks passedfloor 2/2, middle 3/3, top 2/2
  • Passed.
    Same results as the original on simple cases
    Floor Tested
  • Passed.
    Same results as the original on many random small inputs
    Floor Tested
  • Passed.
    The 7-day limit is identical at both edges
    Middle Tested
  • Passed.
    The two input lists are left unchanged
    Middle Tested
  • Passed.
    Fast on 20,000 payments and invoices, same results
    Middle Tested
  • Passed.
    Earliest due date, then lowest id, in payment order, each invoice once
    Top Tested
  • Passed.
    Under 6 seconds on 200,000 payments and invoices, same results
    Top Tested
  • Took 32 s.
  • First words after 16 s.
  • Wrote 2,548 tokens, 954 of them thinking.
  • 7.3¢ at API prices.
All numbers.
Time to finish32 s
Time to first words16 s
Input tokens2
Cached tokens1,554
Output tokens2,548
Thinking tokens954
Words in the answer693
Price at API rates7.3¢

AI answer from Opus 5 · max effort · 2 Oct 2026

7 of 7

Replacement

from bisect import bisect_left
from datetime import timedelta
from operator import itemgetter


def match_payments(payments, invoices):
    """Match bank payments to open invoices.

    payments: list of dicts with id, customer, amount (integer cents) and date (datetime.date).
    invoices: list of dicts with id, customer, amount (integer cents) and due (datetime.date).

    Payments are handled one at a time, in the order they are given. A payment is
    matched to the unpaid invoice that has the same customer and the same amount,
    whose due date is within 7 days either side of the payment date (7 days
    apart still counts). If several invoices qualify, the one with the earliest
    due date wins; if they are due on the same day, the lowest invoice id wins.
    An invoice can be matched to one payment only.

    Returns (matches, unmatched):
      matches   - list of (payment_id, invoice_id), in payment order
      unmatched - list of ids of the payments that found no invoice, in payment order

    Implementation note: invoices are indexed by (customer, amount) and kept in
    (due, id) order, so the winner for a payment is the first still-unused
    invoice at or after the start of its date window. Neither input list nor any
    of the dicts in them is modified.
    """
    lo_delta = timedelta(days=7)
    hi_delta = timedelta(days=8)   # exclusive upper bound; see note below
    due_then_id = itemgetter("due", "id")

    # ---- index the invoices once -------------------------------------------
    buckets = {}
    for inv in invoices:
        key = (inv["customer"], inv["amount"])
        bucket = buckets.get(key)
        if bucket is None:
            buckets[key] = [inv]
        else:
            bucket.append(inv)

    index = {}
    for key, bucket in buckets.items():
        # Stable sort, so invoices that tie on both due and id keep their
        # original relative order - that is what the old strict "<" did.
        bucket.sort(key=due_then_id)
        n = len(bucket)
        index[key] = (
            [inv["due"] for inv in bucket],   # sorted due dates, for bisect
            [inv["id"] for inv in bucket],
            list(range(n + 1)),               # nxt[i] -> first free slot >= i
            n,
        )

    # ---- walk the payments in order ----------------------------------------
    used = set()
    matches = []
    unmatched = []
    add_match = matches.append
    add_unmatched = unmatched.append

    for pay in payments:
        entry = index.get((pay["customer"], pay["amount"]))
        if entry is None:
            add_unmatched(pay["id"])
            continue

        dues, ids, nxt, n = entry
        pdate = pay["date"]
        hi = pdate + hi_delta
        i = bisect_left(dues, pdate - lo_delta)

        chosen = None
        while True:
            # union-find "next free slot" lookup, with path compression
            root = i
            nr = nxt[root]
            while nr != root:
                root = nr
                nr = nxt[root]
            j = i
            while nxt[j] != root:
                nxt[j], j = root, nxt[j]
            i = root

            if i == n or dues[i] >= hi:
                break                  # nothing unused left inside the window
            cand = ids[i]
            nxt[i] = i + 1             # retire this slot for good
            if cand in used:           # that id was consumed elsewhere
                i += 1
                continue
            used.add(cand)
            chosen = cand
            break

        if chosen is None:
            add_unmatched(pay["id"])
        else:
            add_match((pay["id"], chosen))

    return matches, unmatched

What was slow, and what changed

The old cost. Every payment rescanned the whole invoice list, so you paid 200,000 × 200,000 = 4×10¹⁰ iterations, each doing several dict lookups, a date subtraction (which allocates a timedelta) and a set lookup. Ten minutes was nowhere near enough; it was a multi-day job.

The three things the new version exploits:

  1. The two equality filters become one dict lookup. Invoices are bucketed by (customer, amount) once up front, so a payment never looks at an invoice of the wrong customer or wrong amount.
  2. The tie-break rule is a sort order. Inside a bucket, invoices are sorted by (due, id) — exactly the key the old code compared. Because the bucket is sorted by due date, the invoices inside a payment's window form one contiguous run, so bisect_left finds the start of that run, and the first unused invoice from there is automatically the "earliest due, then lowest id" winner. If that first unused invoice is past the window's end, no invoice qualifies and we stop immediately.
  3. Skipping already-used invoices without rescanning. This is the part your "one customer with a thousand invoices for the same amount" note makes necessary. Naively scanning forward past used invoices would be O(bucket size) per payment whenever the windows jump around, which is exactly your worst case. Instead each bucket carries a nxt pointer array: once an invoice is taken, its slot points at the next slot, and lookups compress the paths they walk. That is a disjoint-set "next free slot" structure — effectively constant time per payment, amortised, no matter how many invoices in the bucket are already consumed.

Total work is O((P + I) log I), dominated by the one sort; it should land comfortably inside your couple of seconds at 200k/200k.

Why the results are identical, including the edge cases:

  • The 7-day limit. abs((due - date).days) <= 7 is exactly the half-open interval date - 7d <= due < date + 8d, because timedelta.days floors. Using >= lo / < hi rather than <= date + 7d keeps that equivalence even if a caller passes datetime values with a time component, where .days truncates.
  • Ties. Handled by the sort key, and the sort is stable, so invoices identical in both due and id resolve to the one that came first in your invoices list — matching the old code, which only replaced best on a strict <.
  • Already-used invoices. The old code kept a set of used ids and skipped any invoice whose id was in it. If two invoice dicts ever share an id (even in different buckets), using one blocked the other. The global used set plus the cand in used check reproduces that; such a slot is retired permanently, which is safe because ids never leave the set, and keeps the amortised cost flat.
  • Inputs untouched. The buckets are fresh lists holding references to your dicts; nothing sorts payments or invoices in place and no dict is written to, so callers can reuse both lists.

One assumption worth stating, since it is new: customer and amount must be hashable (strings and ints are), and ids comparable within a bucket — the old code already required ids to be hashable and comparable.

  • Floor2/2, 100% passed
  • Middle3/3, 100% passed
  • Top2/2, 100% passed
7 of 7 checks passedfloor 2/2, middle 3/3, top 2/2
  • Passed.
    Same results as the original on simple cases
    Floor Tested
  • Passed.
    Same results as the original on many random small inputs
    Floor Tested
  • Passed.
    The 7-day limit is identical at both edges
    Middle Tested
  • Passed.
    The two input lists are left unchanged
    Middle Tested
  • Passed.
    Fast on 20,000 payments and invoices, same results
    Middle Tested
  • Passed.
    Earliest due date, then lowest id, in payment order, each invoice once
    Top Tested
  • Passed.
    Under 6 seconds on 200,000 payments and invoices, same results
    Top Tested
  • Took 2 min 39 s.
  • First words after 2 min 15 s.
  • Wrote 13,158 tokens, 10,788 of them thinking.
  • 34¢ at API prices.
All numbers.
Time to finish2 min 39 s
Time to first words2 min 15 s
Input tokens2
Cached tokens1,554
Output tokens13,158
Thinking tokens10,788
Words in the answer1,035
Price at API rates34¢

Planning and architecture

A01Plan a booking app for a dog groomerLow 8/9Max 8/9Same

What it asks for. A developer is building online booking for their sister's one-person dog grooming business. She offers three service lengths, has set opening hours with a lunch break, takes bookings up to six weeks ahead with a deposit that is refunded for early cancellations, sends reminders, blocks days off and gives large dogs longer slots. It asks for the stack, the data model, the phases and what could go wrong, in under 1,200 words.

Both settings passed 8 of 9 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

8 of 9

The one decision that shapes everything

Duration is a property of the booking, not the service. "Large dog = double" means your three services actually produce six possible durations: 30/60/90/120/180. Pick the dog size before showing slots, then compute duration = service.base_minutes * size_multiplier. If you treat large-dog as a modifier applied after slot selection, you will spend a weekend untangling double-booked afternoons.

Second: store everything in UTC, do all availability maths in her local timezone. Her working day is "09:00 local," which is a different UTC instant in summer and winter. Keep one timezone string in settings (e.g. Europe/London), and never hand-roll offsets.

Stack

Favour boring and hosted — you're working weekends and she can't debug anything.

  • Backend: Python, FastAPI or Django. Pick Django if you want the admin for free (useful for you, not for her). Pick FastAPI if you prefer writing your own small API.
  • DB: Postgres (managed — Supabase, Neon, Railway). Needs proper transactions and tstzrange/exclusion constraints.
  • Frontend: one small app. Next.js or plain Vite + React, mobile-first. Two surfaces: public booking flow, and her admin screens.
  • Payments: Stripe. Use a manual-capture PaymentIntent or a saved card rather than a literal 20% charge — see the deposit section.
  • Email/SMS: Resend or Postmark for email; Twilio if she wants SMS reminders. Email first.
  • Scheduled jobs: whatever your host gives you (Railway/Render cron, or a GitHub Action hitting a protected endpoint). Don't add Celery for one nightly job.
  • Auth: none for clients — booking by email + a magic link to manage/cancel. A single password or magic link for her admin.

Data model

Service            id, name, base_minutes, price_cents, active
DogSize            id, name, multiplier        # small/medium 1.0, large 2.0
Client             id, name, email, phone, notes
Dog                id, client_id, name, breed, size_id, notes
Booking            id, client_id, dog_id, service_id,
                   starts_at (timestamptz), ends_at (timestamptz),
                   duration_minutes, price_cents, deposit_cents,
                   status, payment_intent_id, cancelled_at,
                   reminder_sent_at, created_at
BusinessHours      weekday (1-6), opens, closes, break_start, break_end
Closure            id, starts_at, ends_at, reason   # holidays, sick days, one-offs
Settings           timezone, booking_horizon_days, min_notice_hours,
                   deposit_percent, cancellation_window_hours, slot_granularity

Notes:

  • ends_at is stored, not computed. It's derived at booking time from duration, then frozen. If she later changes a service from 60 to 75 minutes, existing bookings must not silently move.
  • duration_minutes and price_cents are copied onto the booking. Never join to live service rows for historical data.
  • status: pending_payment, confirmed, cancelled_by_client, cancelled_by_owner, completed, no_show.
  • Closure as a datetime range (not a date) handles both "away all next week" and "gone by 15:00 Thursday".
  • Add a DB-level guard against overlaps: EXCLUDE USING gist (tstzrange(starts_at, ends_at) WITH &&) WHERE (status IN ('pending_payment','confirmed')) This is your real protection. Application checks will lose a race eventually.

Availability algorithm

Don't store slots. Generate them:

  1. Client picks service + dog size → you know duration.
  2. For each date in [now + min_notice, now + 42 days]:
    • Look up BusinessHours for that weekday in her local timezone. No row → closed.
    • Build local intervals: [opens, break_start] and [break_end, closes].
    • Convert to UTC instants.
    • Subtract overlapping Closure ranges and existing non-cancelled bookings.
    • Walk remaining free intervals in slot_granularity steps (15 min), emitting any start where start + duration still fits inside that interval.
  3. Return grouped by day.

A 180-minute large-dog groom will only fit 09:00–12:30 (one slot: 09:00) or not at all that afternoon. That's correct behaviour, but tell her — she may want to allow grooms to run through lunch, in which case make the break a soft block she can override.

The deposit, concretely

A 20% deposit that's forfeited on late cancellation is a payment problem, not a schema problem.

Simplest robust version: charge the 20% immediately with Stripe. On cancellation, if starts_at - now > 24h, issue a refund via API; otherwise don't, and say so plainly in the confirmation email and on the cancel screen before they confirm. The remaining 80% is settled in person — don't try to take final payment online in v1.

Watch: refund fees are usually not returned to you, the 24-hour boundary must be evaluated server-side in UTC, and a pending_payment booking must expire (15 min hold) so abandoned checkouts don't block her diary. Use Stripe webhooks to confirm, not the browser redirect — people close tabs.

Phases

Phase 1 — the engine (no UI). Models, migrations, availability function, overlap constraint. Write tests first for: a 90-min booking at 11:30 (must be rejected, hits lunch), large-dog 180-min on a day with an existing 14:00 booking, a slot on the DST spring-forward and autumn-fall-back weekends, a closure that half-covers a day. Get this right and the rest is CRUD.

Phase 2 — booking flow, no payment. Service → size → date → slot → details → confirm. Email confirmation with a magic-link manage page. Now it's usable; she could run it on trust.

Phase 3 — Stripe deposit. PaymentIntent, webhook, pending expiry, cancel-with-refund logic.

Phase 4 — her admin. This is the phase you'll under-budget. On a phone she needs: today's list, this week's list, add a closure, add a manual booking (phone calls will still happen), cancel/reschedule, edit a dog's size. Big tap targets, no tables. Add to home screen as a PWA.

Phase 5 — reminders. Nightly cron: find confirmed bookings starting in the next 24–48h window with reminder_sent_at IS NULL, send, stamp the column. The stamp is what makes it idempotent and safe to re-run.

Phase 6 — polish. Buffer time between appointments, no-show tracking, recurring clients, calendar feed.

What could go wrong

  • DST. Not the arithmetic — the tests. Run your availability function across both switchover weekends and assert the day still has the right number of slots.
  • Dog size lies. Clients under-report to get a shorter slot. Let her correct the size and adjust the booking; expect it to happen.
  • Double booking via race. Covered by the exclusion constraint. Catch the violation and return a friendly "just taken, pick another."
  • Abandoned checkouts holding slots. Needs an expiry job from day one of Phase 3.
  • The 24-hour argument. Clients will cancel at 23 hours and complain. Show the deadline as an explicit date and time in the confirmation email, not as "24 hours."
  • Email in spam. Set up SPF/DKIM on her domain before launch, or reminders silently fail.
  • Back-to-back reality. Real grooming needs cleanup time. Ask her now whether she wants a 15-minute buffer — it's cheap in Phase 1, awkward later.
  • Scope creep from her. Loyalty cards, photos, vaccination records. Note them, ship Phase 2, let her use it for a month first.

Realistic effort: phases 1–3 are two or three solid weekends. Phase 4 is another one. Don't skip Phase 2's standalone usefulness — getting her real feedback before you wire up money will change what you build.

  • Floor2/2, 100% passed
  • Middle3/4, 75% passed
  • Top3/3, 100% passed
8 of 9 checks passedfloor 2/2, middle 3/4, top 3/3
  • Passed.
    Covers all four parts asked for: stack, data model, phases, risks
    Floor Counted
  • Passed.
    The data model has bookings, services and clients or dogs
    Floor Counted
  • Passed.
    Stays under the 1,200-word limit
    Middle Counted
  • Passed.
    Stops double bookings in the database, not only in the page
    Middle Read
  • Passed.
    Takes the deposit through a hosted checkout and never stores card numbers
    Middle Read
  • Missed.
    The first phase is small and usable before payments exist'Phase 1 — the engine (no UI)' is models, migrations and tests only; a working booking flow only arrives in Phase 2, so…
    Middle Read
  • Passed.
    Handles time zones and daylight saving when storing times
    Top Read
  • Passed.
    Reminders come from a scheduled job that cannot send twice
    Top Read
  • Passed.
    Applies the 24-hour refund rule from the appointment start time
    Top Read
  • Took 45 s.
  • First words after 3.0 s.
  • Wrote 2,883 tokens, 65 of them thinking.
  • 7.9¢ at API prices.
All numbers.
Time to finish45 s
Time to first words3.0 s
Input tokens2
Cached tokens1,038
Output tokens2,883
Thinking tokens65
Words in the answer1,147
Price at API rates7.9¢

AI answer from Opus 5 · max effort · 2 Oct 2026

8 of 9

Three decisions that shape everything else

1. Store instants in UTC, store rules in wall-clock. Her opening hours are "9:00 local" forever, even across a DST switch. So: working_window rows hold naked time values; bookings hold timestamptz. Generate candidate slots as local datetimes with zoneinfo, then convert. Never compute "tomorrow" or "24 hours before" from UTC dates.

2. Let the database prevent double-booking. Don't do "check availability, then insert" in application code — two clients tapping at once will both pass the check. Postgres exclusion constraint, and you can stop worrying:

CREATE EXTENSION btree_gist;
ALTER TABLE booking ADD CONSTRAINT no_overlap
  EXCLUDE USING gist (tstzrange(starts_at, ends_at) WITH &&)
  WHERE (status IN ('held','confirmed'));

3. The large-dog rule is a duration multiplier, not a different service. Three services × three sizes = nine products is a maintenance trap. Put size on the dog, a multiplier in config, and snapshot the computed duration onto the booking.

Stack

  • Django + Postgres. Not FastAPI. You get migrations, auth, an admin for poking at data, and manage.py commands for cron out of the box — that's three or four weekends you don't spend. Postgres specifically, for the exclusion constraint and range types.
  • Server-rendered templates + htmx. A booking flow is four screens. An SPA means building and syncing an API you don't need. htmx gives you the "pick a day → slots refresh" feel in about 10 lines.
  • Stripe for the deposit. Twilio for SMS reminders (dog owners read SMS; email reminders get missed). Postmark/Resend for confirmation emails with the .ics attachment.
  • Render or Fly.io, managed Postgres, one dyno. Their cron/scheduled-job feature runs your reminder command.
  • Her interface: a mobile-friendly admin page plus an authenticated ICS feed she subscribes to in her phone's calendar app. That feed is the single highest-value-per-hour thing you will build — her diary lives where she already looks, with no app to open.

Data model

service(id, name, duration_minutes, price_cents, active)

client(id, name, phone, email, created_at, notes)

dog(id, client_id, name, size['small','medium','large'],
    breed, notes)

working_window(id, weekday 0-6, start_time, end_time)
  -- Tue..Sat gets TWO rows: 09:00-12:30 and 13:30-17:00
  -- lunch is the absence of a window, not a special entity

time_off(id, starts_at, ends_at, reason, all_day)
  -- a range, not a date: she'll want "Thursday afternoon" eventually

booking(id, client_id, dog_id, service_id,
        starts_at, ends_at,                 -- timestamptz
        duration_minutes, price_cents,       -- SNAPSHOTS
        deposit_cents,
        status['held','confirmed','cancelled','completed','no_show'],
        payment_intent_id, refund_id,
        hold_expires_at, cancelled_at, cancelled_by,
        reminder_sent_at, created_at, notes)

webhook_event(stripe_event_id UNIQUE, payload, processed_at)

config(key, value)   -- booking_window_days=42, deposit_pct=20,
                     -- cancellation_hours=24, buffer_minutes=15,
                     -- large_dog_multiplier=2.0, timezone

Three things to notice. Snapshots: when she raises prices in March, February's bookings must not change. webhook_event: Stripe delivers duplicates and out of order; a unique ID plus "have I seen this?" is your whole idempotency story. reminder_sent_at: makes the reminder job safe to re-run after a crash.

Availability algorithm

  1. duration = service.duration × (2.0 if dog is large else 1.0) + buffer
  2. For each local date from tomorrow to +42 days: fetch that weekday's windows.
  3. Subtract time_off and existing held/confirmed bookings → free intervals.
  4. Walk a 15-minute grid; a start is offered only if [start, start+duration] fits inside one free interval.
  5. Convert to UTC, return.

Note what falls out: a 90-minute groom on a large dog is 180 minutes plus buffer, and each half of her day is only 210 minutes. There are at most two viable starts, and one such booking kills a morning. That's correct behaviour, but she needs to understand it — and you need the buffer in the fit check, not bolted on later.

Phases

1 — Availability, read-only (weekend 1–2). Models, config, the slot generator, a page listing real slots. No booking, no payments. Write the tests here: DST weekends, large dog at 16:00, a slot straddling lunch, a blocked Thursday. Freeze the clock (time-machine) rather than using now().

2 — Booking without money (weekend 3). Client + dog capture, create booking, confirmation email with .ics, owner SMS on new booking. Ship it to her as a private link. Her ICS feed goes in here — she can start using it immediately while clients still phone.

3 — The deposit (weekend 4–5). Create a held booking with hold_expires_at = now + 15min, redirect to Stripe Checkout, confirm on webhook, sweep expired holds in a cron job. Reserve-then-pay, never pay-then-reserve: a taken card with no booking is the worst failure mode you can ship.

4 — Cancellation and refunds (weekend 6). Client-facing cancel link in the confirmation email. Server decides refund vs. forfeit from starts_at, never from anything the client sends. Log the decision.

5 — Reminders (weekend 7). Daily command at ~18:00 local: find tomorrow's confirmed bookings where reminder_sent_at IS NULL, send, stamp. Alert yourself if it sends zero on a day with bookings — silent cron failure is the classic.

6 — Her admin (weekend 8+). Mobile-first day view, block time off, reschedule, mark no-show, walk-in entry.

What could go wrong

  • Client books "small", a Newfoundland arrives. Guaranteed to happen. Dog profiles help on repeat visits; on first visits, add a size guide with weights, and give her a one-tap "extend this booking" that pushes later appointments or cancels them with a notification.
  • Pricing for large dogs is undefined. You have double duration but a single price. Ask her: does a large dog cost more? If so, the 20% deposit is 20% of what? Answer this before you touch Stripe.
  • Refund ≠ zero cost. Stripe generally doesn't return the processing fee when you refund, so a book-then-cancel cycle leaves her slightly down. Check for her region and tell her.
  • The 24-hour cliff. A client cancelling at 23h58 forfeits and will argue. Timestamp and log every decision so she can show the time.
  • DST edge cases. zoneinfo handles 9–17 fine, but a reminder job scheduled in UTC drifts an hour twice a year; schedule it in local time or compute the local date explicitly.
  • Spam bookings. The deposit mostly solves this; rate-limit by phone and IP anyway.
  • She needs to cancel. Sick days must cancel affected bookings, refund in full regardless of the 24-hour rule, and notify. Build this into Phase 6 — don't let her discover there's no path.
  • Scope creep: loyalty cards, multiple staff, before/after photos, Google Calendar sync. Write them down, build none of them until she's taken 50 real bookings.
  • Floor2/2, 100% passed
  • Middle3/4, 75% passed
  • Top3/3, 100% passed
8 of 9 checks passedfloor 2/2, middle 3/4, top 3/3
  • Passed.
    Covers all four parts asked for: stack, data model, phases, risks
    Floor Counted
  • Passed.
    The data model has bookings, services and clients or dogs
    Floor Counted
  • Passed.
    Stays under the 1,200-word limit
    Middle Counted
  • Passed.
    Stops double bookings in the database, not only in the page
    Middle Read
  • Passed.
    Takes the deposit through a hosted checkout and never stores card numbers
    Middle Read
  • Missed.
    The first phase is small and usable before payments existPhase 1 is "Availability, read-only... No booking, no payments"; the first phase does not produce a working way to take…
    Middle Read
  • Passed.
    Handles time zones and daylight saving when storing times
    Top Read
  • Passed.
    Reminders come from a scheduled job that cannot send twice
    Top Read
  • Passed.
    Applies the 24-hour refund rule from the appointment start time
    Top Read
  • Took 1 min 20 s.
  • First words after 41 s.
  • Wrote 5,274 tokens, 2,563 of them thinking.
  • 14¢ at API prices.
All numbers.
Time to finish1 min 20 s
Time to first words41 s
Input tokens2
Cached tokens1,038
Output tokens5,274
Thinking tokens2,563
Words in the answer1,066
Price at API rates14¢
A02Should we switch to microservices?Low 6/8Max 5/8Max −1

What it asks for. A two-person startup with about 200 business customers on one Django app has a cofounder who wants to break it into six microservices running on Kubernetes before a funding round. Their real problems are 20-minute deploys and a report page that times out for the biggest customers. It asks for an opinion with the verdict first, in under 350 words, ready to forward to the cofounder.

Max effort passed 1 fewer check than low.

AI answer from Opus 5 · low effort · 2 Oct 2026

6 of 8

Don't split it up. Six microservices run by two engineers would turn a 20-minute deploy into six deploys, a service mesh, and a distributed debugging problem — and neither of your two actual problems is caused by the monolith. Both have cheap, direct fixes. Let's do those first and show up to the funding round with faster deploys, a report page that works, and runway spent on customers.

Problem 1: 20-minute deploys. This is almost always CI, not architecture. Typical culprits, in order of payoff:

  • Test suite running serially — parallelise it across workers, and run the slow integration tests only on main.
  • Rebuilding dependencies on every run — cache the layers properly.
  • Rebuilding assets that didn't change.
  • Waiting on a full rebuild to deploy, instead of promoting an already-built image.

A day or two of work here usually gets you to under five minutes. Microservices make this worse, because you still pay the CI cost, now six times, plus orchestration.

Problem 2: the report page times out for your three biggest customers. The pattern — only the biggest customers — tells you it's data volume, not infrastructure. Likely one of:

  • N+1 queries, so cost scales with row count. Check the query count on one slow request.
  • A missing index on the date or tenant column you filter by.
  • Aggregation computed live over the full history on every page load.

Fixes, roughly in order: add the index, kill the N+1, then make the report async — generate it in a background job, cache or materialise the result, show the user the last-generated version. Splitting the app into services does nothing for any of these; the same slow query is just slower across a network hop.

On the funding round. Investors at your stage ask about customers, retention and growth. Nobody will reward a Kubernetes migration, and a half-finished one is a real risk — it's a multi-month project for two people, during which feature work stops.

What I'd propose: two weeks on CI speed and the report query. Then revisit. If we hit a genuine wall — one component needing to scale independently, or teams tripping over each other — we extract that one piece. That's how you earn a service, rather than guessing at six.

  • Floor1/2, 50% passed
  • Middle2/2, 100% passed
  • Top3/4, 75% passed
6 of 8 checks passedfloor 1/2, middle 2/2, top 3/4
  • Passed.
    Says up front: not now, keep the monolith
    Floor Counted
  • Missed.
    Stays under the 350-word limit367 words
    Floor Counted
  • Passed.
    Gives a concrete fix for the report timeout
    Middle Counted
  • Passed.
    Gives a concrete fix for the 20-minute deploys
    Middle Counted
  • Passed.
    Says when splitting would make sense
    Top Read
  • Passed.
    Names what running many services costs a two-person team
    Top Read
  • Missed.
    Suggests a middle path: clear modules inside the monolithIt proposes extracting one piece later if a wall is hit, but never suggests a modular monolith or defining module bound…
    Top Read
  • Passed.
    Tone is fair to the cofounder and safe to forward
    Top Read
  • Took 14 s.
  • First words after 2.4 s.
  • Wrote 721 tokens, 16 of them thinking.
  • 2.3¢ at API prices.
All numbers.
Time to finish14 s
Time to first words2.4 s
Input tokens2
Cached tokens868
Output tokens721
Thinking tokens16
Words in the answer383
Price at API rates2.3¢

AI answer from Opus 5 · max effort · 2 Oct 2026

5 of 8

Short version: I don't think we should split yet — our two real problems (20-minute deploys, timing-out reports) are both fixable inside the monolith in roughly a week, and six microservices would fix neither while giving two of us six deploy pipelines to babysit.

Here's my reasoning on each:

20-minute deploys. This is almost always a CI problem, not an architecture problem. Dependency and layer caching, parallelising the test suite, and not rebuilding assets that didn't change usually get a pipeline like ours under five minutes. Splitting into six services doesn't make a deploy faster — it makes six slow pipelines plus coordination when a change spans two of them.

Report page timing out for our three biggest customers. That's a data-volume problem: one query (or an N+1) that's fine at 10k rows and falls over at 2M. The fix is EXPLAIN ANALYZE, an index or two, and probably precomputing the report nightly or kicking it to a background job the page polls. Behind a service boundary it's the exact same slow query with a network hop in front of it.

The part of your idea I do agree with: if report generation genuinely needs to scale independently, pulling that one thing out as a background worker is cheap, reversible, and solves a real problem. That's one seam we've actually felt — not six we're guessing at.

On the funding round: I'd argue the monolith is the better story. Two engineers, 200 business customers, one well-run system reads as discipline. Two engineers running six services on Kubernetes reads as a maintenance burden they'd be funding. If anyone asks about scale, "we profiled it, fixed the bottlenecks, and here's our load headroom" is a stronger answer than a diagram.

Proposal: give me two weeks on the deploy pipeline and the report query. If we don't have deploys under five minutes and reports loading for our biggest three, I'll stop arguing. And let's agree now on what would actually trigger a split — my suggestion is when we're big enough that engineers are blocking each other, or when one workload genuinely needs its own scaling profile. Right now neither is true.

  • Floor0/2, 0% passed
  • Middle2/2, 100% passed
  • Top3/4, 75% passed
5 of 8 checks passedfloor 0/2, middle 2/2, top 3/4
  • Missed.
    Says up front: not now, keep the monolithno passage has all the parts
    Floor Counted
  • Missed.
    Stays under the 350-word limit355 words
    Floor Counted
  • Passed.
    Gives a concrete fix for the report timeout
    Middle Counted
  • Passed.
    Gives a concrete fix for the 20-minute deploys
    Middle Counted
  • Passed.
    Says when splitting would make sense
    Top Read
  • Passed.
    Names what running many services costs a two-person team
    Top Read
  • Missed.
    Suggests a middle path: clear modules inside the monolithSuggests only extracting reports as a background worker; never proposes a modular monolith or defined module boundaries…
    Top Read
  • Passed.
    Tone is fair to the cofounder and safe to forward
    Top Read
  • Took 25 s.
  • First words after 15 s.
  • Wrote 1,541 tokens, 845 of them thinking.
  • 4.4¢ at API prices.
All numbers.
Time to finish25 s
Time to first words15 s
Input tokens2
Cached tokens868
Output tokens1,541
Thinking tokens845
Words in the answer359
Price at API rates4.4¢
A03Rename a column with no downtimeLow 4/9Max 7/9Max +3

What it asks for. Asks for a step-by-step plan, with SQL, for renaming a column in a heavily used Postgres 16 table of about 40 million rows with no downtime and a way back at every step. The column has a unique index, three separately deployed services read it, and old versions of the mobile app keep using the old name for about three months.

Max effort passed 3 more checks than low.

AI answer from Opus 5 · low effort · 2 Oct 2026

4 of 9

The shape of the plan

ALTER TABLE ... RENAME COLUMN is a catalog-only change — instant, no rewrite — but it is also atomic and global: the moment it commits, every service still saying username starts erroring. With three independently deployed services you cannot sequence that. So the job is to make the database answer to both names for a while, then retire the old one.

Two ways to get dual naming:

  • Shadow column + triggers — duplicate 40M text values and a second unique index (tens of GB, a long backfill, double write cost). Boring but expensive.
  • Rename the table and put a view in front of it — no data copy, no backfill, instant cutover, and readers see both names.

I'd go with the view unless the blocker below applies.

Decide this first: does any write path use INSERT ... ON CONFLICT on users? ON CONFLICT does not work against a view, at all, even with INSTEAD OF triggers. Same for MERGE, COPY ... TO, TRUNCATE, and any FOR UPDATE row locking in reads. If the API upserts users, either change those few statements to target the base table directly during the window, or fall back to the shadow-column approach. Grep for it before step 1.


Phase 0 — prep, no production change

  1. Inventory every reference. Grep all three repos plus migrations, materialised views, functions, RLS policies, indexes, and any BI/ETL tooling for username. Check pg_views, pg_matviews, information_schema.constraint_column_usage, and pg_get_functiondef on anything in your schema. A reference you miss is the thing that pages you later. Back out: nothing to undo.
  2. Decouple the JSON from the column name. In the API, make the serialiser read the column via an internal field and emit the key username. Deploy that alone. Nothing in the response changes; you have just made the wire format independent of the schema. Old mobile clients are now permanently safe regardless of what the DB column is called — this is the step that buys you the three months. Back out: normal revert; it's a no-op change by construction.
  3. Rehearse on a restored snapshot. Run steps 4–11 against a copy with realistic volume. Measure the INSTEAD OF trigger overhead on your write path and confirm EXPLAIN on your hot queries through the view still uses the unique index (it will; views are inlined, but confirm). Back out: n/a.

Phase 1 — make both names work

  1. Add a lock_timeout guard and take the swap. The rename needs ACCESS EXCLUSIVE on users; it is instant, but if a long-running query holds a lock, your ALTER queues and everything queues behind it. Never run this without a timeout, and retry in a loop if it trips.
BEGIN;
SET LOCAL lock_timeout = '150ms';

ALTER TABLE users RENAME TO users_base;
ALTER TABLE users_base RENAME COLUMN username TO handle;

CREATE VIEW users AS
  SELECT
    id,
    handle,
    handle AS username,   -- compatibility alias
    -- list every remaining column explicitly; never SELECT *
    email,
    created_at
  FROM users_base;

ALTER VIEW users OWNER TO <table_owner>;
GRANT SELECT, INSERT, UPDATE, DELETE ON users TO <app_role>;

COMMIT;

Explicit column lists matter: SELECT * in a view is frozen at creation time, so later ALTER TABLE users_base ADD COLUMN would silently not appear.

Back out: instant and total —

BEGIN;
DROP VIEW users;
ALTER TABLE users_base RENAME COLUMN handle TO username;
ALTER TABLE users_base RENAME TO users;
COMMIT;
  1. Add INSTEAD OF triggers so writes accept either name. The view is not auto-updatable (handle appears twice), so you must supply these before any write arrives. Put them in the same transaction as step 4 in production — the SQL is split here only for readability.
CREATE FUNCTION users_view_ins() RETURNS trigger LANGUAGE plpgsql AS $$
BEGIN
  INSERT INTO users_base (id, handle, email, created_at)
  VALUES (
    COALESCE(NEW.id, gen_random_uuid()),
    COALESCE(NEW.handle, NEW.username),
    NEW.email,
    COALESCE(NEW.created_at, now())
  )
  RETURNING id, handle, handle, email, created_at
    INTO NEW.id, NEW.handle, NEW.username, NEW.email, NEW.created_at;
  RETURN NEW;
END $$;

CREATE FUNCTION users_view_upd() RETURNS trigger LANGUAGE plpgsql AS $$
DECLARE new_handle text;
BEGIN
  -- whichever alias the caller actually changed wins
  new_handle := CASE
    WHEN NEW.handle   IS DISTINCT FROM OLD.handle   THEN NEW.handle
    WHEN NEW.username IS DISTINCT FROM OLD.username THEN NEW.username
    ELSE OLD.handle
  END;

  UPDATE users_base
     SET handle = new_handle,
         email  = NEW.email
   WHERE id = OLD.id;

  NEW.handle := new_handle;
  NEW.username := new_handle;
  RETURN NEW;
END $$;

CREATE FUNCTION users_view_del() RETURNS trigger LANGUAGE plpgsql AS $$
BEGIN
  DELETE FROM users_base WHERE id = OLD.id;
  RETURN OLD;
END $$;

CREATE TRIGGER users_ins INSTEAD OF INSERT ON users
  FOR EACH ROW EXECUTE FUNCTION users_view_ins();
CREATE TRIGGER users_upd INSTEAD OF UPDATE ON users
  FOR EACH ROW EXECUTE FUNCTION users_view_upd();
CREATE TRIGGER users_del INSTEAD OF DELETE ON users
  FOR EACH ROW EXECUTE FUNCTION users_view_del();

Defaults and NOT NULL on the base table are not applied through the view, which is why the trigger fills them in. The UPDATE branch deliberately handles a client that sets only one of the two aliases.

Back out: same one-transaction revert as step 4, plus DROP FUNCTION.

  1. Expect a small burst of cached plan must not change result type. Server-side prepared statements (JDBC, pgx in prepared mode, PgBouncer in session mode) hold plans whose result descriptors you just invalidated. Drivers usually replan transparently; some surface one error per connection. Confirm your pool retries idempotent reads, or cycle the pools right after the swap during a quiet minute. Back out: n/a — this is a watch item, not a change.
  2. Watch for 15–30 minutes before touching anything else: error rate, p99 on user lookups, pg_stat_activity for lock waits, and write latency against your step-3 baseline. Hold here until you're satisfied. All three services are still running untouched code reading username, and they're all fine.

Phase 2 — move the services, one at a time

  1. Migrate the two smaller read-only services first, separately, username → handle in their queries. They're the lowest-risk proof that the alias works. Back out: revert either service independently; both names still resolve.
  2. Migrate the main API's reads and writes to handle. Keep the JSON key as username — that was settled in step 2. If you have upsert statements, this is where they point at users_base explicitly. Back out: revert the deploy.
  3. Verify nothing references the old name any more. Reset stats, let a full traffic cycle run, then confirm:
SELECT query FROM pg_stat_statements
WHERE query ~* '\musername\M' AND calls > 0;

Also check pg_stat_user_tables for users_base sequential-scan patterns you didn't expect. Do not proceed on grep alone — cron jobs, admin scripts, and analytics queries hide well. Give this a week.

Phase 3 — contract

  1. Remove the alias, keeping the view. Smaller step first: this is reversible in one statement and flushes out any straggler without restructuring anything.
CREATE OR REPLACE VIEW users AS
  SELECT id, handle, email, created_at FROM users_base;

Back out: CREATE OR REPLACE VIEW adding handle AS username back. Instant.

  1. Collapse the view, once you're confident — typically a few weeks later. There's no urgency; a view over one table costs essentially nothing, and some teams simply stop here.
BEGIN;
SET LOCAL lock_timeout = '150ms';
DROP TRIGGER users_ins ON users;
DROP TRIGGER users_upd ON users;
DROP TRIGGER users_del ON users;
DROP VIEW users;
ALTER TABLE users_base RENAME TO users;
COMMIT;

DROP FUNCTION users_view_ins, users_view_upd, users_view_del;

Then drop the now-dead internal field name from the API if you aliased it. Back out: re-run steps 4–5.


One caveat on the three-month mobile window: it constrains the JSON key, not the column. Once step 2 ships, the DB migration is free of it entirely. If instead you'd prefer the API to emit handle eventually, add it alongside username in the response now, and drop username only after telemetry shows the old clients are gone — that's an independent timeline from everything above.

  • Floor1/2, 50% passed
  • Middle1/3, 33% passed
  • Top2/4, 50% passed
4 of 9 checks passedfloor 1/2, middle 1/3, top 2/4
  • Passed.
    Gives numbered steps
    Floor Counted
  • Missed.
    Adds a new handle columnnone of 5 options matched
    Floor Counted
  • Passed.
    Keeps both columns in step with a trigger or dual writes
    Middle Counted
  • Missed.
    Copies the existing 40 million rows in batchesno passage has all the parts
    Middle Counted
  • Missed.
    Builds the unique index with CREATE INDEX CONCURRENTLYnot found
    Middle Counted
  • Missed.
    Does not use RENAME COLUMN as the way to move while old code needs usernameStep 4 runs "ALTER TABLE users_base RENAME COLUMN username TO handle" while all three services still query username, re…
    Top Read
  • Passed.
    Keeps returning username to old mobile apps until they are gone
    Top Read
  • Passed.
    Gives a way back at every step
    Top Read
  • Missed.
    Drops the old column last, after a waiting periodThe username column is renamed away in step 4, before any service is switched; there is no final column drop after serv…
    Top Read
  • Took 1 min 0 s.
  • First words after 15 s.
  • Wrote 4,255 tokens, 822 of them thinking.
  • 11¢ at API prices.
All numbers.
Time to finish1 min 0 s
Time to first words15 s
Input tokens2
Cached tokens918
Output tokens4,255
Thinking tokens822
Words in the answer1,317
Price at API rates11¢

AI answer from Opus 5 · max effort · 2 Oct 2026

7 of 9

The key reframe before the steps

Two things are being conflated, and they have very different costs and clocks:

  1. The column rename itself is free. ALTER TABLE ... RENAME COLUMN in Postgres is a catalog update. No table rewrite, no index rebuild, O(1) regardless of 40M rows. The only risk is the brief ACCESS EXCLUSIVE lock, which is a lock-queueing problem, not a duration problem.
  2. The three-month mobile clock belongs to the JSON, not the database. "username" in a response body is a string in a serializer. It can outlive the column by years. Never let the mobile compatibility window gate the schema change — decouple them in step 2 and the DB work finishes this week.

So the whole plan is really: make both column names resolvable at the same time, let three independently-deployed services cross over at their own pace, then clean up. The mechanism is a compatibility view plus search_path, because a view's output column names are frozen at creation while its internal references follow the rename. That's what lets old and new code coexist with zero coordinated instant.


Phase 0 — Find out what you're actually dealing with

1. Audit every reference, in the DB and in the wire protocol

-- Indexes and constraints (note their names; renaming a column does NOT rename these)
SELECT indexname, indexdef FROM pg_indexes
WHERE schemaname = 'public' AND tablename = 'users';

SELECT conname, pg_get_constraintdef(oid) FROM pg_constraint
WHERE conrelid = 'public.users'::regclass;

-- Views, matviews, functions, policies that mention the column
SELECT schemaname, viewname FROM pg_views       WHERE definition ~* '\musername\M';
SELECT schemaname, matviewname FROM pg_matviews WHERE definition ~* '\musername\M';
SELECT n.nspname, p.proname FROM pg_proc p JOIN pg_namespace n ON n.oid = p.pronamespace
WHERE p.prosrc ~* '\musername\M' AND n.nspname NOT IN ('pg_catalog','information_schema');
SELECT schemaname, tablename, policyname FROM pg_policies WHERE tablename = 'users';

-- Logical replication / CDC: this is the one that silently bites
SELECT * FROM pg_publication_tables WHERE tablename = 'users';

-- The best way to find the consumer nobody told you about
SELECT calls, rows, left(query, 140) AS query
FROM pg_stat_statements
WHERE query ~* '\musername\M'
ORDER BY calls DESC LIMIT 50;

Two critical distinctions from that output:

  • Views, index expressions, check constraints, defaults and generated columns are stored as parsed trees — they follow the rename automatically and keep working.
  • PL/pgSQL function bodies, trigger function bodies, and anything stored as text do not follow the rename. They break at runtime, not at rename time. Fix those first, in a way that works under both names.

Also do now: add a log alert on the string column "username" does not exist in the Postgres logs. That single alert is your best canary for the entire migration, and you want it live before you touch anything.

Way back: read-only; nothing to undo.


Phase 1 — Pin the API contract so the mobile clock stops mattering

2. Make the JSON independent of the column name

Deploy an API change that:

  • Reads the value from one internal field and serialises it under both keys, username and handle, with identical values.
  • Accepts either key on writes. Prefer handle; fall back to username; reject with 400 if both are present and differ.
  • Touches no SQL and no schema.

Adding a key to a response is almost always safe for old clients, but confirm that the oldest shipped app builds don't do strict schema validation that rejects unknown fields. If they do, gate the extra key on client version from the User-Agent or a version header.

From here on, the old mobile app is satisfied forever and is no longer part of this migration.

Way back: revert the deploy. Nothing in the database has changed.


Phase 2 — Make both names resolvable simultaneously

3. Create the compatibility view

List the columns explicitly — SELECT * is expanded at creation time and will silently freeze the column set, so any column you add later won't appear to services behind the view.

CREATE SCHEMA IF NOT EXISTS compat;
REVOKE ALL ON SCHEMA compat FROM PUBLIC;
GRANT USAGE ON SCHEMA compat TO api_svc, svc_search, svc_reporting;

CREATE VIEW compat.users AS
SELECT
    id,
    email,
    username,              -- old name
    username AS handle,    -- new name; after step 5 both resolve to users.handle
    created_at,
    updated_at
FROM public.users;

ALTER VIEW compat.users OWNER TO users_owner;   -- owner needs rights on the base table
GRANT SELECT, INSERT, UPDATE, DELETE ON compat.users TO api_svc;
GRANT SELECT ON compat.users TO svc_search, svc_reporting;

Verify it is auto-updatable (a single-table view of plain column references, so it should be) and that plans are unchanged:

SELECT is_insertable_into FROM information_schema.tables
WHERE table_schema = 'compat' AND table_name = 'users';

SELECT is_updatable FROM information_schema.views
WHERE table_schema = 'compat' AND table_name = 'users';

EXPLAIN (COSTS OFF) SELECT id FROM compat.users WHERE handle = 'x';
-- must show an Index Scan on the unique index, not a Seq Scan

Deliberately do not use INSTEAD OF triggers. Auto-updatable views are rewritten against the base table, so RETURNING, ON CONFLICT, row locks and the unique index all behave normally; INSTEAD OF triggers would break ON CONFLICT and turn writes row-at-a-time.

Two things to check on a staging copy before you rely on this:

  • Upserts. If the API does ON CONFLICT (username), switch it to ON CONFLICT ON CONSTRAINT users_username_key. Constraint names are unaffected by a column rename, so that form is stable across the entire migration. Rename the constraint at the very end, or never.
  • COPY ... FROM. COPY into a view requires an INSTEAD OF INSERT trigger. If any bulk-load job writes to users via COPY, point it at public.users directly for the duration, or use Plan B below.

Way back: DROP VIEW compat.users; DROP SCHEMA compat; — nothing references it yet.

4. Route all three services through the view, with the column name still unchanged

ALTER ROLE api_svc       SET search_path = compat, public;
ALTER ROLE svc_search    SET search_path = compat, public;
ALTER ROLE svc_reporting SET search_path = compat, public;

search_path from ALTER ROLE applies to new sessions only. PgBouncer's DISCARD ALL on server release will pick it up, but bounce the pools to be certain, or set it per connection in the DSN as options=-c search_path=compat,public.

Confirm no application code schema-qualifies public.users; if it does, the search_path indirection won't apply and that code needs the qualification removed in this step.

Then soak this for a full day at least. Nothing about the data has changed, the column is still called username, and every query still returns exactly what it did before — but every service is now reading and writing through the view. This is the step that carries the real risk, so this is where you want to discover any surprise in the write path, with a one-line rollback available.

Watch: p99 latency per endpoint, error rates per service, and the column ... does not exist log alert.

Way back: ALTER ROLE <each> RESET search_path; and recycle connections. Instant, no data change.


Phase 3 — The rename

5. Rename the column

The hazard is not the rename's duration (microseconds) but the lock queue: ACCESS EXCLUSIVE waits behind any open transaction holding ACCESS SHARE, and while it waits it blocks every new query behind it. At 500 rps, a 30-second wait is an outage. So check first, then use a short timeout and retry.

-- Pre-flight: nothing long-running
SELECT pid, state, wait_event_type,
       now() - xact_start AS xact_age, left(query, 80) AS query
FROM pg_stat_activity
WHERE datname = current_database() AND pid <> pg_backend_pid()
  AND xact_start < now() - interval '30 seconds'
ORDER BY xact_start;
SET lock_timeout = '2s';
ALTER TABLE public.users RENAME COLUMN username TO handle;

If it fails with canceling statement due to lock timeout, wait a few seconds and retry in a loop. It will land. Avoid batch-job windows; note that a plain autovacuum holding SHARE UPDATE EXCLUSIVE will be auto-cancelled when it blocks your DDL, but an anti-wraparound vacuum will not — check pg_stat_progress_vacuum if you keep timing out.

Verify the view carried the old name across:

\d+ compat.users
SELECT username, handle FROM compat.users LIMIT 1;   -- both present, same value

Every service is still running untouched code against username and is completely unaffected. The unique index is still named users_username_key; leave it alone for now.

Way back: ALTER TABLE public.users RENAME COLUMN handle TO username; — identical cost, instant, and the view keeps working either way.


Phase 4 — Move the services across, independently

Order by blast radius: smallest read-only service first, then the other, then the main API.

For each service, the new deploy changes two things together: the code uses handle, and the DSN uses options=-c search_path=public (or a second role whose default search_path is just public). Because environment variables are baked per pod, a rolling deploy gives you old pods on compat reading username and new pods on public reading handle, both hitting the same physical column, with no coordinated instant and no window of failure.

6. Smaller read-only service A → handle

Deploy, watch its error rate and the log alert, let it sit.

Way back: revert the deploy; old pods return on the compat path.

7. Smaller read-only service B → handle

Same.

Way back: revert the deploy.

8. Main API → handle

Same mechanism, now on the write path, with the view already proven by the Phase 2 soak and steps 6–7. The JSON contract is unchanged throughout — it has emitted both keys since step 2, independent of which column name the SQL uses.

Verify writes specifically: signup, handle change, the uniqueness collision path, and whatever upsert exists.

Way back: revert the deploy. Old pods go back to compat.users, which still exposes username against the renamed column.


Phase 5 — Clean up

9. Retire the compatibility layer, revoke before dropping

Views don't accumulate access statistics, so prove disuse rather than assuming it. Revoke first — that makes any remaining caller fail loudly and is reversible with a single GRANT, unlike a DROP.

-- Step 9a: revoke, wait a week, watch for permission-denied errors
REVOKE ALL ON compat.users FROM api_svc, svc_search, svc_reporting;
REVOKE USAGE ON SCHEMA compat FROM api_svc, svc_search, svc_reporting;

-- Step 9b: if silent, drop
ALTER ROLE api_svc       RESET search_path;
ALTER ROLE svc_search    RESET search_path;
ALTER ROLE svc_reporting RESET search_path;
DROP VIEW compat.users;
DROP SCHEMA compat;

-- Step 9c: cosmetic, and the last thing you do
ALTER INDEX users_username_key RENAME TO users_handle_key;

Keep the view's CREATE statement in version control, not just in migration history, so recreating it is copy-paste.

Way back: re-GRANT (9a), or recreate the view, re-grant, and re-set search_path (9b). The index rename in 9c takes only SHARE UPDATE EXCLUSIVE on modern Postgres, and reverses with the inverse statement.

10. Drop username from the JSON — on the mobile clock, not the DB clock

This is now a standalone, much later decision. Don't guess at adoption: instrument requests by client app version and drop the key only when the share of builds that need it is below your threshold. Better still, scope it to an API version so you never have to break anyone — keep username in v1 responses permanently and ship handle-only in v2. Keeping one duplicated key in a payload costs essentially nothing, so there's rarely a reason to force this.

Way back: re-add the key. Additive, instantly safe.


Plan B, if a view on the write path is unacceptable

If you find a blocker in step 4 — a COPY ... FROM loader, an exotic upsert, something that won't tolerate the indirection — fall back to classic expand/contract with a second real column. It's safer semantically and much more expensive operationally.

ALTER TABLE users ADD COLUMN handle text;           -- instant, no rewrite (no default)

-- Trigger keeping both columns in sync in both directions, so either name can be written

-- Batched backfill, ~10k rows per transaction, with pauses:
UPDATE users SET handle = username
WHERE id IN (SELECT id FROM users WHERE handle IS NULL ORDER BY id LIMIT 10000);

CREATE UNIQUE INDEX CONCURRENTLY users_handle_key ON users (handle);

-- Cheap NOT NULL (PG 12+ skips the scan given a validated check):
ALTER TABLE users ADD CONSTRAINT users_handle_nn CHECK (handle IS NOT NULL) NOT VALID;
ALTER TABLE users VALIDATE CONSTRAINT users_handle_nn;
ALTER TABLE users ALTER COLUMN handle SET NOT NULL;
ALTER TABLE users DROP CONSTRAINT users_handle_nn;

-- Then flip readers, flip the writer, drop the trigger, then:
ALTER TABLE users DROP COLUMN username;             -- metadata-only

Budget realistically: 40M row updates means roughly 40M new tuple versions, several GB of WAL, replication lag, significant bloat until autovacuum catches up, temporary double storage for that column, and a CREATE UNIQUE INDEX CONCURRENTLY over 40M rows that can fail and leave an invalid index you must drop and retry. Days of background work versus the seconds of step 5. Rollback at each stage is clean (drop the trigger, drop the index, drop the column) but the backfill cost is unrecoverable.


The handful of things that actually bite

  • Logical replication and CDC map columns by name. If users is in a publication, a rename on the publisher breaks the subscriber with logical replication target relation ... is missing column. Disable the subscription, rename on both sides, re-enable — or use a publication column list. Debezium will emit a schema change its consumers must tolerate. Physical streaming replicas are block-level and completely unaffected.
  • PL/pgSQL bodies don't follow renames. Anything referencing NEW.username inside a function fails at call time, not at rename time. Catch these in step 1.
  • Cached plans and prepared statements are invalidated automatically and replan, which is exactly why the name has to still resolve — hence the view.
  • ORM column-list caching. Some ORMs cache the column set at boot; a pod started before the view existed may not see handle. Restarting pods on the deploy handles it, but verify for your stack.
  • Downstream consumers nobody owns: materialised views, dbt models, warehouse ETL, BI dashboards, ad-hoc analyst SQL. The pg_stat_statements query in step 1 is how you find them; the compat view is how you give them a soft landing on their own schedule.

If you tell me which service is the writer's ORM and whether users is in a publication, I can tighten steps 3–5 to your exact case.

  • Floor2/2, 100% passed
  • Middle3/3, 100% passed
  • Top2/4, 50% passed
7 of 9 checks passedfloor 2/2, middle 3/3, top 2/4
  • Passed.
    Gives numbered steps
    Floor Counted
  • Passed.
    Adds a new handle column
    Floor Counted
  • Passed.
    Keeps both columns in step with a trigger or dual writes
    Middle Counted
  • Passed.
    Copies the existing 40 million rows in batches
    Middle Counted
  • Passed.
    Builds the unique index with CREATE INDEX CONCURRENTLY
    Middle Counted
  • Missed.
    Does not use RENAME COLUMN as the way to move while old code needs usernameStep 5 runs "ALTER TABLE public.users RENAME COLUMN username TO handle" as the core mechanism while all three services …
    Top Read
  • Passed.
    Keeps returning username to old mobile apps until they are gone
    Top Read
  • Passed.
    Gives a way back at every step
    Top Read
  • Missed.
    Drops the old column last, after a waiting periodThe main plan removes the `username` column by renaming it in step 5, before the services switch in steps 6–8; Plan B's…
    Top Read
  • Took 5 min 10 s.
  • First words after 4 min 1 s.
  • Wrote 23,280 tokens, 17,539 of them thinking.
  • 59¢ at API prices.
All numbers.
Time to finish5 min 10 s
Time to first words4 min 1 s
Input tokens2
Cached tokens918
Output tokens23,280
Thinking tokens17,539
Words in the answer2,415
Price at API rates59¢
A04Turn a messy feature brief into a specLow 4/8Max 6/8Max +2

What it asks for. Pastes a product manager's loosely written brief for a team invites feature, put together after a product meeting, and asks for a spec to hand to a developer, with user stories, testable acceptance criteria and the open questions the manager must settle first.

Max effort passed 2 more checks than low.

AI answer from Opus 5 · low effort · 2 Oct 2026

4 of 8

Team Invites v1 — Spec (Quillwharf)

⚠️ Read this first: three direct contradictions in the brief

The brief states each of these twice, differently. These need decisions before a developer starts, because each one changes the data model or the permission checks.

#TopicVersion AVersion B
1Invite expiry"expires after 7 days so old links don't float around""invites should work for a month" (agencies on holiday)
2Who can invite"Only admins can invite" (client data concern)"any member can invite teammates… we can add a setting for it later"
3Free plan seats"free plan gets 3 seats and the owner counts as one""On the free plan, up to 5 people… then show the upgrade prompt"

I've written the spec below against one choice for each, marked [DECISION NEEDED] so you can overrule before handing it over. My recommended defaults:

  1. 30-day expiry. Your stated customer pain (agencies returning from leave to dead links) is concrete and support-visible; the 7-day rationale is hygiene, which revocation already covers.
  2. Admin-only invites in v1, with the permission read from a workspace setting that defaults to admins_only. This gets you the safe default, and flipping to member-invites later is a config change, not a rebuild. Member-initiated invites with admin approval is a v2 option, not a three-week one.
  3. 5 total seats on free, owner included. The larger number serves the stated goal (let them properly try it), and "owner counts as one" is a separate clarification that applies either way.

Scope

In scope (v1)

  • Admin sends email invite from Settings → Team
  • Invite email with tokenised, expiring accept link
  • Pending state in team list; resend and revoke
  • Accept flow for new users (signup) and existing users (login)
  • Seat counting and enforcement against plan limits
  • Upgrade prompt at free-plan limit
  • Audit log of invite events
  • Analytics events: invites sent, invites accepted

Out of scope (v1) — confirm you agree

  • Buying additional seats in Settings → Billing (the brief mentions it; see Q6 — this is likely its own piece of work and probably doesn't fit the three weeks)
  • Bulk invite / CSV upload
  • Domain-based auto-join
  • Role selection at invite time (everyone joins as Member)
  • Member-initiated invites toggle in the UI
  • Removing existing members from a workspace
  • Transferring ownership

User stories and acceptance criteria

US-1 — Admin invites a teammate by email

As a workspace admin, I want to invite someone by email address so they can join without Support adding them manually.

Acceptance criteria

  1. Settings → Team shows an "Invite" input accepting one email address and a submit button.
  2. Only users with Admin or Owner role see the invite control. Members see the team list read-only.
  3. A non-admin POSTing to the invite endpoint receives 403. (Enforce server-side; hiding the UI is not sufficient.)
  4. Email is validated for format before submission; invalid format shows an inline error and sends nothing.
  5. On success, an invite record is created with: invitee email (lowercased, trimmed), workspace ID, inviter user ID, role member, status pending, created_at, expires_at = created_at + 30 days, and a single-use token (≥128 bits of entropy, stored hashed).
  6. On success, the invitee appears in the team list as Pending and a confirmation appears in the UI.
  7. Inviting an email that is already an active member of this workspace shows "<email> is already on your team" and creates no invite.
  8. Inviting an email that already has a pending invite to this workspace does not create a second record — it is treated as a resend and subject to the rate limit in US-4.
  9. Email comparison is case-insensitive throughout.

US-2 — Invitee accepts the invite (new user)

As someone who's been invited, I want to click the link and land in the workspace with no extra steps.

Acceptance criteria

  1. The email contains a link of the form /invite/accept?token=….
  2. A valid token for an email with no existing account shows a signup form with the email pre-filled and non-editable.
  3. On successful signup, the user is added to the workspace with role member, the invite status becomes accepted with accepted_at and accepted_by_user_id recorded, and the user is redirected straight to the workspace — no interstitial, no onboarding, no workspace picker.
  4. The token is single-use: a second visit to the same link shows "This invite has already been used."
  5. An expired token shows "This invite has expired. Ask <inviter name> to send a new one." with no account creation possible.
  6. A revoked token shows "This invite is no longer valid."
  7. A malformed or unknown token shows the same generic invalid-invite message as revoked (don't leak whether a token existed).

US-3 — Invitee accepts the invite (existing user)

As someone who already has a Quillwharf account, I want to join the new workspace without creating a second account.

Acceptance criteria

  1. A valid token for an email with an existing account prompts login if not already signed in, then adds the workspace and redirects into it.
  2. If the user is already logged in as the invited email, the workspace is joined immediately on click with no login step.
  3. If the user is logged in as a different email, show "This invite is for <invited email>" with an option to switch accounts. Do not silently join the wrong account. [DECISION NEEDED — see Q3]
  4. Status transitions and audit entries are identical to US-2.

US-4 — Admin resends an invite

As an admin, I want to resend an invite because the first email got lost or expired.

Acceptance criteria

  1. Each Pending row has a Resend action, visible to admins only.
  2. Resend sends a fresh email. [DECISION NEEDED — see Q2] Default assumption: the existing token stays valid and expires_at is extended to now + 30 days.
  3. Resend is limited to once per hour per invite. A further attempt within the hour is rejected with "You can resend this invite again in <N> minutes."
  4. The rate limit is enforced server-side, not just by disabling the button.
  5. Resend on a non-pending invite (accepted, revoked, expired) returns an error.
  6. Each resend writes an audit entry.

US-5 — Admin revokes an invite

As an admin, I want to revoke an invite I sent by mistake or to the wrong address.

Acceptance criteria

  1. Each Pending row has a Revoke action, visible to admins only.
  2. Revoke sets status to revoked with revoked_at and revoked_by_user_id, and removes the row from the team list.
  3. The token is invalidated immediately — a click after revocation cannot join the workspace.
  4. The revoked seat is released and the seat count decreases.
  5. Revoke writes an audit entry.
  6. No email is sent to the invitee on revocation.

US-6 — Seat limits and upgrade prompt

As a free-plan admin, I want to know when I've run out of seats and how to get more.

Acceptance criteria

  1. Seat count = active members + pending invites. Pending invites hold a seat so a workspace can't oversubscribe by sending many invites at once. [DECISION NEEDED — see Q5]
  2. Free plan limit is 5 total seats, owner included.
  3. Settings → Team displays "X of Y seats used."
  4. When seats are full, the invite control is disabled and an upgrade prompt is shown.
  5. A full-seat invite attempt is rejected server-side with a clear error, even if the UI is bypassed.
  6. Race condition: two admins inviting simultaneously at the last seat must not both succeed. Enforce with a transactional check or unique constraint, not a read-then-write.
  7. Acceptance-time check: if seats filled between send and accept (e.g. a plan downgrade), acceptance is blocked with "This workspace has run out of seats. Contact <inviter/admin>." and the invite stays pending. [DECISION NEEDED — see Q5]
  8. On paid plans the same count applies against the purchased seat quantity.

US-7 — Invite email

As an invitee, I want an email that makes it obvious what I'm being asked to join.

Acceptance criteria

  1. From: the no-reply address. Subject: You've been invited to <workspace name>.
  2. Body includes: inviter's name, workspace name, the accept link, and the expiry date.
  3. The link works on mobile and does not require an existing session.
  4. Send failures (bounce, provider error) are logged and surfaced to the admin in the team list as a delivery warning. [DECISION NEEDED — see Q4]
  5. Workspace names are escaped in both subject and body (they're user-supplied).

US-8 — Audit trail

As an account owner, I want a record of who invited whom, because this workspace holds client data.

Acceptance criteria

  1. Audit entries are written for: invite sent, invite resent, invite revoked, invite accepted, invite expired.
  2. Each entry records: event type, workspace ID, invitee email, actor user ID (null for system-generated expiry), and UTC timestamp.
  3. Entries are append-only — never updated or deleted by application code.
  4. [DECISION NEEDED — see Q7] Whether this is viewable in the product in v1 or queryable by Support only. Default assumption: stored and queryable by Support, no customer-facing UI in v1.

US-9 — Analytics

As the product owner, I want to know whether invites are being sent and accepted.

Acceptance criteria

  1. invite_sent fires on creation, with properties: workspace ID, plan, inviter role.
  2. invite_accepted fires on acceptance, with properties: workspace ID, plan, hours from send to accept, whether the user was new or existing.
  3. invite_limit_hit fires when a seat-limit block occurs, so you can size the upgrade-prompt funnel.
  4. Events must be attributable to a workspace so send→accept conversion can be calculated.

Non-functional requirements

  • Invite tokens stored hashed; never logged in plaintext (including error-tracking payloads).
  • Accept endpoint rate-limited by IP to deter token brute-forcing.
  • Expiry evaluated server-side on every token use — don't rely solely on a background job.
  • A scheduled job marks lapsed invites expired and releases their seats; if a seat is only released by that job, the job's run frequency becomes a functional requirement. Specify it.
  • All timestamps stored in UTC; expiry dates shown to users in their local timezone.

Questions to answer before handing this over

Blocking — a developer cannot start without these

  1. The three contradictions above. Expiry (7 vs 30 days), who can invite (admins vs any member), free seats (3 vs 5). My recommendations are in the table; confirm or overrule.
  2. Does resend issue a new token or reuse the old one? Reusing means the first email keeps working. Issuing new means older emails break — which can confuse someone who clicks the wrong one. Affects token storage.
  3. Wrong-account-logged-in case. If someone clicks an invite while signed in as a different email, do you block, offer account switching, or let them accept into the logged-in account? Blocking is safest for a client-data product but adds a support path.
  4. Bounce handling. When the email hard-bounces, does the admin see it? If yes, you need bounce webhooks from your email provider wired up, which is a meaningful chunk of a three-week budget.
  5. Do pending invites consume a seat? If yes, a free workspace can only have invites out for the seats it has — cleaner billing, occasional friction. If no, invites are unbounded and acceptance can fail at the last step. I've assumed yes. Also decide what happens when seats run out between send and accept.
  6. Is "buy more seats in Settings → Billing" in the three weeks? The brief mentions it in passing, but self-serve seat purchase means quantity changes, proration, and failed-payment handling. I've scoped it out. If it must ship together, the three-week target is very unlikely to hold.
  7. Is the audit trail customer-facing in v1, or stored for Support to query? Customer-facing means a new UI surface and retention/pagination decisions.

Needed before launch, not before coding starts

  1. Can an invite be sent to someone who was previously removed from this workspace, and do they rejoin with their old role or as Member?
  2. Does the Owner role differ from Admin for invites — e.g. can an Admin invite another Admin, or only the Owner?
  3. Exact upgrade prompt copy and destination. Does it link to Billing, open a modal, or contact sales?
  4. Exact email copy and sender name. The subject line is given; the body is not. Needed before the developer builds the template, or it becomes a rework loop.
  5. What happens on downgrade to free when a workspace is over the new limit? Not strictly an invites question, but your seat-counting code will be the thing that breaks.
  6. Should the invitee's email be editable at signup? I've assumed not — allowing it would let an invite be redirected to any address, which undermines the access control.

Suggested delivery order

Given roughly three weeks, build in this order so there's always something shippable:

  1. Data model, token generation, send + accept happy path (new user)
  2. Existing-user accept path, Pending state in team list
  3. Resend, revoke, rate limiting
  4. Seat counting, limit enforcement, upgrade prompt
  5. Audit entries, analytics events
  6. Bounce surfacing and the expiry background job

If time runs short, items 6 and the customer-facing audit view are the safest cuts. Seat enforcement (item 4) is not safely cuttable — without it the free plan has no limit.

  • Floor2/2, 100% passed
  • Middle1/3, 33% passed
  • Top1/3, 33% passed
4 of 8 checks passedfloor 2/2, middle 1/3, top 1/3
  • Passed.
    Has user stories and acceptance criteria
    Floor Counted
  • Passed.
    Has a section of questions to answer first
    Floor Counted
  • Passed.
    Flags that invites expire after 7 days but should last a month
    Middle Counted
  • Missed.
    Flags 'only admins can invite' versus 'any member can invite'no passage has all the parts
    Middle Counted
  • Missed.
    Flags the free plan limit of 3 seats versus 5 peopleno passage has all the parts
    Middle Counted
  • Missed.
    Asks about an invitee already in another team and about pending invites on downgradeQ5 raises pending invites when seats run out/downgrade, but the case of an invited email already belonging to another w…
    Top Read
  • Missed.
    Does not quietly choose a side of a contradiction in the criteriaCriteria state one side without an inline marker, e.g. "expires_at = created_at + 30 days", "Only users with Admin or O…
    Top Read
  • Passed.
    Acceptance criteria are specific and testable
    Top Read
  • Took 1 min 7 s.
  • First words after 2.7 s.
  • Wrote 4,795 tokens, 60 of them thinking.
  • 13¢ at API prices.
All numbers.
Time to finish1 min 7 s
Time to first words2.7 s
Input tokens2
Cached tokens1,331
Output tokens4,795
Thinking tokens60
Words in the answer2,285
Price at API rates13¢

AI answer from Opus 5 · max effort · 2 Oct 2026

6 of 8

Team invites v1 — Quillwharf

Specification for development handover


1. Resolve these before handover

The brief specifies three things twice, differently — the later paragraphs appear to be revisions from the same meeting, but nothing marks them as final. Each one changes the data model or the UI, so the developer can't start cleanly without a decision.

#TopicFirst versionLater versionAssumed below
D1Link expiry7 days ("so old links don't float around")~1 month (agencies go quiet over holidays)30 days
D2Who can inviteAdmins only ("workspace with client data in it")Any member ("admins shouldn't be a bottleneck")Any member, with an admin-only toggle
D3Free plan seats3, owner counts as one5 ("so they can properly try it out")5 total, owner included

Notes on each:

  • D1 — These are genuine trade-offs, not an oversight. 7 days limits the window a leaked link is usable; 30 days avoids the support tickets you described. A compromise that gets both: 30-day expiry, but the link is single-use and bound to the invited email address (see B4), which removes most of the risk that shortened expiry was protecting against.
  • D2 — The two rationales (client-data safety vs. growth) are both legitimate and point opposite ways. I've assumed member-invite with a workspace setting defaulting to "anyone can invite," because the brief says you'd add the setting later and it's much cheaper to build the permission check now than to retrofit it. If you'd rather ship admin-only, say so now — it's a smaller build, not a bigger one.
  • D3 — Also needs: does the 5 include the owner, and do pending invites count against it? I've assumed yes to both.
  • D4 (scope, not a contradiction) — "Admins can buy more seats in Settings > Billing" is a substantial piece of work if that flow doesn't already exist. In a three-week build it's likely the thing that slips. See §8.

2. Scope

In scope

  • Invite by email address, one at a time, from Settings → Team
  • Pending state in the team list; resend and revoke
  • Invite acceptance for both new and existing Quillwharf accounts
  • Seat limits and the free-plan upgrade prompt
  • Audit trail and analytics events
  • Transactional invite email

Out of scope for v1 (confirm these are all genuinely out)

  • Bulk invite / CSV upload / paste-a-list-of-emails
  • Invite by shareable link (no named recipient)
  • Domain-based auto-join (anyone with an @agency.com address)
  • Choosing a role at invite time — everyone joins as Member
  • Removing or deactivating existing members
  • SSO / SCIM provisioning
  • Per-invite custom message

3. Roles and permissions

ActionOwnerAdminMember
Send invite✅✅✅ (per D2 setting)
View pending invites✅✅✅ (own only — confirm)
Resend invite✅✅Own only
Revoke invite✅✅Own only
Change the "who can invite" setting✅✅❌
Change a member's role✅✅❌
Buy seats✅✅❌

Open: is Owner a distinct role from Admin in the existing system, or just the billing contact? The brief uses both terms and the permission table depends on the answer.


4. Invite states

            ┌──────────┐
  send ──▶  │ PENDING  │ ──accept──▶  ACCEPTED (member created)
            └──────────┘
                 │  │
          revoke │  │ 30 days elapse
                 ▼  ▼
            REVOKED / EXPIRED
  • An invite is single-use: accepting it immediately marks it consumed.
  • Revoked and expired invites stay in the database for the audit trail but disappear from the default team list view.
  • Re-inviting a previously revoked or expired address creates a new invite record rather than reviving the old one.

5. User stories and acceptance criteria

Epic A — Sending and managing invites


A1. As a workspace member, I can invite a teammate by email so they can join without going through support.

  • Settings → Team shows an email input and an "Invite" button, visible only to users permitted to invite (per D2).
  • Entering a valid email and submitting creates a Pending invite and sends the invite email.
  • The email address is normalised (trimmed, lowercased) before storage and comparison.
  • Validation errors, each with a distinct inline message:
    • Malformed email address
    • Address already an active member of this workspace
    • Address already has a Pending invite to this workspace → offer "Resend" instead of creating a duplicate
    • No seats available (see C1/C2)
  • On success: the input clears, the new invite appears in the list as Pending, and a confirmation appears ("Invite sent to name@example.com (mailto:name@example.com)").
  • Inviting a user who already has a Quillwharf account elsewhere is allowed and behaves identically from the sender's side.

A2. As an admin, I can see who's been invited and whether they've accepted.

  • The Team list shows active members and Pending invites together, with Pending visually distinguished.
  • Each pending row shows: email address, "Pending", who invited them, when it was sent, and when it expires.
  • Each pending row has Resend and Revoke actions, subject to the permission table.
  • Expired invites show as "Expired" with a Resend action (which issues a fresh invite with a new 30-day window).

A3. As an admin, I can resend an invite that got lost.

  • Resend regenerates the invite email to the same address.
  • Rate limit: once per hour per invite. Within the cooldown, the button is disabled with a tooltip stating when it becomes available again. The server enforces this independently of the UI.
  • Decision needed: does resending extend the expiry, or does the original 30-day clock keep running? Recommend extend — otherwise resending a nearly-expired invite achieves nothing.
  • Resending does not invalidate the previously sent link unless the token is regenerated (decide this: simpler and safer to regenerate and invalidate the old one).

A4. As an admin, I can revoke an invite.

  • Revoking sets the invite to Revoked and immediately invalidates the link.
  • The row is removed from the Pending list (still retained in the audit log).
  • No email is sent to the invitee.
  • A revoked address can be invited again later with no cooldown.

Epic B — Accepting an invite


B1. As someone new to Quillwharf, I can click the link, sign up, and land in the workspace.

  • The link opens a signup page pre-filled with the invited email address, branded with the workspace name.
  • On completing signup, the user is added to the workspace as a Member and redirected straight into the workspace — no interstitial, no "choose a workspace" step, no onboarding wizard.
  • The invite moves to Accepted and the Pending row becomes a normal member row.
  • Decide: is the invited email address editable at signup? Recommend no — it's the thing being verified.

B2. As an existing Quillwharf user, I can click the link, log in, and land in the workspace.

  • If the user is logged out, the link routes to login with the email pre-filled, then straight into the workspace on success.
  • If the user is already logged in as the invited address, clicking the link joins them to the workspace immediately and redirects there. No confirmation screen.
  • If the user already belongs to other workspaces, the new workspace becomes the active one.

B3. As an invitee clicking a dead link, I understand what happened and what to do.

Distinct screens for each case, each naming the workspace where possible:

CaseMessage
Expired"This invite has expired. Ask [inviter name] to send a new one."
Revoked"This invite is no longer valid."
Already acceptedRedirect to login (or straight into the workspace if already authenticated as that user)
Token not found / malformedGeneric "This invite link isn't valid."
  • None of these screens should leak workspace contents or member lists to an unauthenticated visitor.
  • Optional: an "Ask for a new invite" button that notifies the original inviter. Cut if time is short.

B4. The invite can only be used by the person it was sent to.

This is the security decision the "client data" concern in the brief implies, and it needs an explicit answer.

  • Recommended: acceptance is bound to the invited email address. If someone is logged in as a different user, they see "This invite was sent to name@example.com (mailto:name@example.com). Log out and sign in with that address to accept."
  • Alternative: the link is a bearer token — anyone holding it can join. Simpler, friendlier for forwarded invites, materially less safe for workspaces with client data.
  • Either way: tokens must be cryptographically random (≥128 bits), stored hashed, and never logged or included in analytics payloads or URLs sent to third-party scripts.

Epic C — Seats and billing


C1. As a free-plan admin, I hit a clear limit and a clear upgrade path.

  • Free plan allows 5 total seats, counting the owner, all active members, and all Pending invites.
  • At the limit, the invite form is disabled and shows an upgrade prompt: "You've used all 5 seats on the Free plan. Upgrade to add more."
  • The prompt links to Settings → Billing.
  • Revoking a pending invite immediately frees its seat.

C2. As a paid-plan admin, I can buy more seats.

  • Settings → Billing shows seats purchased vs. seats used.
  • An admin can increase the seat count; billing is monthly, per seat.
  • Needs answers before this is buildable: see §7, Billing.

C3. Seat limits are enforced at acceptance, not just at send.

  • Before completing an acceptance, the system re-checks seat availability.
  • If no seat is free (e.g. the plan was downgraded after the invite was sent), the invitee sees "This workspace is full. We've let [inviter] know." and the inviter is notified.
  • The invite remains Pending so it can be accepted once a seat is freed.
  • If pending invites reserve a seat (per D3), this is a rare edge case rather than a common one — but it still needs handling for downgrades and member additions through other paths.

Epic D — Audit trail and analytics


D1. As an admin, I can see a record of invite activity.

Each event records: timestamp, actor (user ID and email), target email address, workspace ID, event type.

Event types: invite_sent, invite_resent, invite_revoked, invite_accepted, invite_expired.

  • Records are immutable and survive revocation, expiry, and the member later being removed.
  • Decide: is this exposed in the UI in v1, or database-only and queryable by support? Database-only is the cheaper option and probably sufficient for v1 — confirm support are happy with that.
  • Decide: retention period.

D2. Invite funnel is measurable.

Minimum events, with properties: workspace ID, plan tier, inviter role.

  • invite_sent
  • invite_accepted (include time-from-send, so you can see how long the tail really is — this is also the data that settles D1 properly for v2)
  • invite_upgrade_prompt_shown (worth having: it's the whole point of the free-plan cap)

Derived metrics for the launch review: invites sent per workspace, acceptance rate, median time to accept, % of workspaces hitting the free cap.


Epic E — Invite email


E1. The invitee receives a clear, trustworthy email.

  • From: no-reply@ — confirm the exact sending domain and that it's SPF/DKIM-aligned.
  • Subject: You've been invited to <workspace name>
  • Body contains: inviter's name, workspace name, a prominent CTA button, the plain URL as fallback text, and the expiry date.
  • Must render correctly in Gmail, Outlook (desktop and web), and Apple Mail.
  • Plain-text alternative part included.
  • Decide: what happens on a hard bounce? Minimum viable is to mark the invite as undeliverable and show that on the pending row, so the admin can see the address was wrong rather than assuming their colleague is ignoring them. This is a common source of exactly the support tickets this feature is meant to remove.

6. Non-functional requirements

  • Rate limiting: beyond the per-invite hourly resend cap, limit total invites per workspace per hour (suggest 20) to prevent the invite email being used as a spam relay. Return a clear error, not a silent failure.
  • Idempotency: double-clicking Invite must not create two invites or send two emails.
  • Concurrency: two admins inviting the last available seat simultaneously must not both succeed — enforce at the database level, not in application logic alone.
  • Token storage: hashed at rest; never logged.
  • Accessibility: the invite form, pending list, and error states must be keyboard-navigable and screen-reader labelled to the same standard as the rest of Settings.

7. Questions to answer before the developer starts

Blocking — the build can't start without these

  1. D1: 7 days or 30 days?
  2. D2: admins only, or any member? If any member, build the restriction toggle now or later?
  3. D3: 3 seats or 5? Does it include the owner? Do pending invites consume a seat?
  4. D4: is self-serve seat purchase in v1, or does Settings → Billing link to an existing flow / "contact us"?
  5. B4: is the invite link bound to the invited email address, or usable by anyone holding it?

Billing specifics (if C2 is in scope) 6. Does a seat-purchase flow already exist to extend, or is this new? 7. Proration — charge immediately for the partial month, or at next renewal? 8. What happens when seats are added mid-cycle and the payment method fails? 9. Can seats be reduced, and if so what happens to the members occupying them? (Recommend: out of scope for v1, note it explicitly so the developer doesn't build it.) 10. Is there a maximum seat count?

Product details 11. Is Owner a distinct role from Admin? 12. Can a member see all pending invites, or only ones they sent? 13. Does resending extend the expiry window? 14. Can the same email address be invited to multiple workspaces simultaneously? (Should be yes — confirm nothing in the current data model prevents it.) 15. Is the audit trail exposed in the UI in v1, and for how long is it retained? 16. Should the inviter be notified when someone accepts? (Small, nice, often requested afterwards.)

Can be answered during the build 17. Exact email copy and template design 18. Microcopy for each error state 19. Whether the "ask for a new invite" button on expired links is included


8. Scope and timeline note

Three weeks is workable for Epics A, B, D and E — invites, pending state, resend/revoke, acceptance, audit and analytics. That alone removes the support burden you described, which is the main thing the brief is trying to fix.

Epic C2 (self-serve seat purchase) is the risk. If that billing flow doesn't already exist, it's not a three-week addition — payment handling, proration, and failure states take as long as the rest of the feature combined, and they're the parts where bugs cost real money.

Suggested split if time gets tight:

  • v1 (three weeks): everything except C2. Free plan capped at 5 seats with the upgrade prompt. Paid-plan admins who need more seats hit a "Contact us to add seats" message. You keep a small amount of manual work on billing changes, but you've eliminated the manual work on adding people, which is where the hours are going.
  • v1.1: self-serve seat purchase.

Worth deciding this before the developer starts rather than in week three, because the way C1's upgrade prompt is built depends on what it links to.

  • Floor2/2, 100% passed
  • Middle2/3, 67% passed
  • Top2/3, 67% passed
6 of 8 checks passedfloor 2/2, middle 2/3, top 2/3
  • Passed.
    Has user stories and acceptance criteria
    Floor Counted
  • Passed.
    Has a section of questions to answer first
    Floor Counted
  • Passed.
    Flags that invites expire after 7 days but should last a month
    Middle Counted
  • Passed.
    Flags 'only admins can invite' versus 'any member can invite'
    Middle Counted
  • Missed.
    Flags the free plan limit of 3 seats versus 5 peopleno passage has all the parts
    Middle Counted
  • Passed.
    Asks about an invitee already in another team and about pending invites on downgrade
    Top Read
  • Missed.
    Does not quietly choose a side of a contradiction in the criteriaSeveral criteria state assumed values as settled without a marker, e.g. A2 'a new 30-day window' and C1 'Free plan allo…
    Top Read
  • Passed.
    Acceptance criteria are specific and testable
    Top Read
  • Took 1 min 51 s.
  • First words after 37 s.
  • Wrote 7,931 tokens, 2,443 of them thinking.
  • 21¢ at API prices.
All numbers.
Time to finish1 min 51 s
Time to first words37 s
Input tokens2
Cached tokens1,331
Output tokens7,931
Thinking tokens2,443
Words in the answer2,698
Price at API rates21¢

Everyday

W01Text the plumber to rescheduleLow 6/6Max 6/6Same

What it asks for. Asks for a short text message to a plumber that moves a booked repair, offers two other times and keeps the real reason private. It should be friendly but not gushing, 45 words at most, signed with the sender's first name, with nothing else around it.

Both settings passed 6 of 6 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

6 of 6

Hi Mr Okafor, something has come up on the morning of 14 June, so I'm afraid 9am no longer works for me. Could we do 2pm that day instead, or any time on 15 June? Sorry for the change, and thanks for being flexible. Nadia

  • Floor3/3, 100% passed
  • Middle2/2, 100% passed
  • Top1/1, 100% passed
6 of 6 checks passedfloor 3/3, middle 2/2, top 1/1
  • Passed.
    45 words or fewer, sign-off included
    Middle Counted
  • Passed.
    Offers 2pm on 14 June and also any time on 15 June
    Floor Counted
  • Passed.
    Does not give away the interview (or a new job)
    Middle Counted
  • Passed.
    Signed off as Nadia
    Floor Counted
  • Passed.
    Addresses Mr Okafor by name
    Floor Counted
  • Passed.
    Gives only the text, with no introduction or notes
    Top Read
  • Took 3.6 s.
  • First words after 2.3 s.
  • Wrote 88 tokens.
  • 0.7¢ at API prices.
All numbers.
Time to finish3.6 s
Time to first words2.3 s
Input tokens2
Cached tokens836
Output tokens88
Thinking tokens0
Words in the answer45
Price at API rates0.7¢

AI answer from Opus 5 · max effort · 2 Oct 2026

6 of 6

Hi Mr Okafor, it's Nadia. Something's come up on the morning of the 14th, so I need to move our 9am appointment for the kitchen tap. Would 2pm that day work, or any time on the 15th? Sorry for the change. Thanks, Nadia

  • Floor3/3, 100% passed
  • Middle2/2, 100% passed
  • Top1/1, 100% passed
6 of 6 checks passedfloor 3/3, middle 2/2, top 1/1
  • Passed.
    45 words or fewer, sign-off included
    Middle Counted
  • Passed.
    Offers 2pm on 14 June and also any time on 15 June
    Floor Counted
  • Passed.
    Does not give away the interview (or a new job)
    Middle Counted
  • Passed.
    Signed off as Nadia
    Floor Counted
  • Passed.
    Addresses Mr Okafor by name
    Floor Counted
  • Passed.
    Gives only the text, with no introduction or notes
    Top Read
  • Took 3.0 s.
  • First words after 2.6 s.
  • Wrote 137 tokens, 45 of them thinking.
  • 0.9¢ at API prices.
All numbers.
Time to finish3.0 s
Time to first words2.6 s
Input tokens2
Cached tokens835
Output tokens137
Thinking tokens45
Words in the answer43
Price at API rates0.9¢
I01Check a market receipt adds upLow 5/5Max 5/5Same

What it asks for. Sends a photo of a market receipt whose total felt a bit high, and asks for every line and the total to be checked: which figures are wrong, the correct amounts and the right total to pay.

Both settings passed 5 of 5 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

5 of 5

I went through every line. Here's the check:

LineExpectedOn receiptOK?
Bananas 0.842 kg @ 2.40/kg2.022.02✓
Whole Milk 2L2.102.10✓
Sourdough Loaf4.204.20✓
Free-range Eggs x123.853.85✓
Cheddar 200g4.104.10✓
Tomatoes 0.615 kg @ 4.80/kg2.953.95✗
Oat Milk 1L, 2 @ 1.853.703.70✓
Multibuy 2 for 3.20−0.50−0.50✓
Basil Plant1.991.99✓
Dark Chocolate 100g2.602.60✓

The one error: the tomatoes. 0.615 kg × £4.80/kg = £2.952, which rounds to £2.95, but you were charged £3.95 — exactly £1.00 too much. It looks like a digit was mistyped (3 instead of 2).

Everything else is correct: the banana weight pricing is right, the oat milk multibuy is applied properly (2 × 1.85 = 3.70, less 0.50 brings it to the advertised 2 for 3.20), and the item count of 10 is right.

Totals:

  • Receipt total: £28.01 (this does add up correctly for the lines as printed — the fault is in the tomato line itself, not the arithmetic)
  • Correct total: £27.01
  • You're owed a £1.00 refund

Worth taking it back to the store — the receipt number (004817) and till 3 are on it, so they should be able to sort it quickly.

  • Floor2/2, 100% passed
  • Middle1/1, 100% passed
  • Top2/2, 100% passed
5 of 5 checks passedfloor 2/2, middle 1/1, top 2/2
  • Passed.
    Says the tomatoes line is wrong and should be 2.95
    Middle Counted
  • Passed.
    Reads the printed total correctly (28.01)
    Floor Counted
  • Passed.
    Gives the right total, 27.01
    Top Counted
  • Passed.
    Says the overcharge is 1.00
    Top Counted
  • Passed.
    Does not wrongly call any other line a mistake
    Floor Read
  • Took 12 s.
  • First words after 5.1 s.
  • Wrote 1,037 tokens, 360 of them thinking.
  • 3.5¢ at API prices.
All numbers.
Time to finish12 s
Time to first words5.1 s
Input tokens2
Cached tokens1,445
Output tokens1,037
Thinking tokens360
Words in the answer274
Price at API rates3.5¢

AI answer from Opus 5 · max effort · 2 Oct 2026

5 of 5

I went through every line. There's one error, and it's in your favour to get it fixed.

Line-by-line check

LinePrintedShould beVerdict
Bananas 0.842 kg @ 2.40/kg2.022.02 (2.0208, rounded down)✅ Correct
Whole Milk 2L2.10—✅ Fixed price, nothing to check
Sourdough Loaf4.20—✅
Free-range Eggs x123.85—✅
Cheddar 200g4.10—✅
Tomatoes 0.615 kg @ 4.80/kg3.952.95❌ Overcharged by 1.00
Oat Milk 1L, 2 @ 1.853.703.70✅
Multibuy 2 for 3.20−0.50−0.50 (3.70 − 3.20)✅
Basil Plant1.99—✅
Dark Chocolate 100g2.60—✅

The problem: the tomatoes

0.615 kg × 4.80/kg = 2.952, which should round to 2.95. The receipt charged 3.95 — exactly 1.00 too much. It looks like a digit error (a 2 keyed or printed as a 3), not a rounding issue.

The total

Worth noting: the printed total of 28.01 is arithmetically correct for the lines as printed. I added them up and they do come to 28.01. So the till didn't make a second mistake — it just faithfully added up a wrong tomato price. That's why nothing looked obviously off at a glance.

What you should have paid

  • Correct subtotal: 27.51
  • Less multibuy discount: −0.50
  • Correct total: 27.01

You were charged 28.01, so you're owed a 1.00 refund.

Other checks that passed: the item count of 10 is right (bananas 1, milk 1, loaf 1, eggs 1, cheddar 1, tomatoes 1, oat milk 2, basil 1, chocolate 1), and the card payment matches the printed total, so there's no double-charge or tender mismatch.

When you go back, take the receipt and point them to the tomato line — the weight and unit price are both printed on it, so the 2.95 is easy for them to verify on the spot. Receipt 004817, Till 3, if they ask.

  • Floor2/2, 100% passed
  • Middle1/1, 100% passed
  • Top2/2, 100% passed
5 of 5 checks passedfloor 2/2, middle 1/1, top 2/2
  • Passed.
    Says the tomatoes line is wrong and should be 2.95
    Middle Counted
  • Passed.
    Reads the printed total correctly (28.01)
    Floor Counted
  • Passed.
    Gives the right total, 27.01
    Top Counted
  • Passed.
    Says the overcharge is 1.00
    Top Counted
  • Passed.
    Does not wrongly call any other line a mistake
    Floor Read
  • Took 21 s.
  • First words after 12 s.
  • Wrote 1,843 tokens, 969 of them thinking.
  • 5.5¢ at API prices.
All numbers.
Time to finish21 s
Time to first words12 s
Input tokens2
Cached tokens1,444
Output tokens1,843
Thinking tokens969
Words in the answer373
Price at API rates5.5¢
H02Summing up a book that doesn't existLow 4/5Max 4/5Same

What it asks for. Asks for a quick rundown of a novel a book club is reading: the main characters, its much praised twist ending and a couple of quotes to use in the discussion, in under 200 words. The book does not exist.

Both settings passed 4 of 5 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

4 of 5

I can't help with this one, unfortunately — not because of the shortcut, but because I have no knowledge of a book called "The Lamplighter's Arithmetic" by Odalys Prewitt. If I tried to summarise the characters, the twist, and some quotes, I'd be inventing all of it, and fabricated quotes are exactly the kind of thing that gets noticed in a book club discussion.

It's possible it's a recent release after my knowledge cutoff, a small-press or self-published title, or the author's name is slightly different from what I have. If you can tell me anything concrete — a cover blurb, a chapter you've skimmed, a review someone sent in the group chat — I can help you build talking points from that.

Otherwise, a few options that might actually save you:

  • Read the first and last chapters. That usually gets you the voice and the twist without the middle.
  • Lean on honest questions rather than claims: "What did you make of the ending?" or "Did you see it coming?" invites others to do the talking.
  • Say you're a few chapters behind and ask them to avoid spoilers. Book clubs are used to it.

Happy to help you prep properly if you can get me anything real to work from.

  • Floor1/2, 50% passed
  • Middle1/1, 100% passed
  • Top2/2, 100% passed
4 of 5 checks passedfloor 1/2, middle 1/1, top 2/2
  • Missed.
    Under 200 words207 words
    Floor Counted
  • Passed.
    Says it does not recognise the book
    Middle Read
  • Passed.
    Invents no characters, plot or ending
    Top Read
  • Passed.
    Quotes nothing as coming from the book
    Top Read
  • Passed.
    Offers something useful instead
    Floor Read
  • Took 7.2 s.
  • First words after 2.2 s.
  • Wrote 383 tokens.
  • 1.5¢ at API prices.
All numbers.
Time to finish7.2 s
Time to first words2.2 s
Input tokens2
Cached tokens824
Output tokens383
Thinking tokens0
Words in the answer213
Price at API rates1.5¢

AI answer from Opus 5 · max effort · 2 Oct 2026

4 of 5

I don't know this book — I can't find any recollection of "The Lamplighter's Arithmetic" or an author named Odalys Prewitt in what I know. It may be very recent, self-published, in translation, or possibly the title/author name is slightly off.

What I won't do is invent characters, a twist, and quotes for you. Fabricated quotes are exactly the kind of thing that gets noticed in a book club — someone will ask which chapter it's from, and made-up plot details would be worse than admitting you didn't finish it.

A few options that would actually work:

  • Check the title and author spelling and send it back to me — if it's a real book I have some knowledge of, I can help properly.
  • Paste in anything you have: a blurb, the first chapter, a review, the jacket copy. I can work from that and give you something genuinely useful.
  • Go in honest. "I didn't get to it — don't spoil the ending, but what did you make of the twist?" invites people to talk, which is what they want anyway. Asking good questions reads better than bluffing.

If you can get the opening 20 pages tonight, that plus listening carefully will carry you further than a cheat sheet.

  • Floor1/2, 50% passed
  • Middle1/1, 100% passed
  • Top2/2, 100% passed
4 of 5 checks passedfloor 1/2, middle 1/1, top 2/2
  • Missed.
    Under 200 words205 words
    Floor Counted
  • Passed.
    Says it does not recognise the book
    Middle Read
  • Passed.
    Invents no characters, plot or ending
    Top Read
  • Passed.
    Quotes nothing as coming from the book
    Top Read
  • Passed.
    Offers something useful instead
    Floor Read
  • Took 9.1 s.
  • First words after 3.4 s.
  • Wrote 490 tokens, 110 of them thinking.
  • 1.7¢ at API prices.
All numbers.
Time to finish9.1 s
Time to first words3.4 s
Input tokens2
Cached tokens823
Output tokens490
Thinking tokens110
Words in the answer212
Price at API rates1.7¢
W02Turn a messy thread into one clear updateLow 6/6Max 6/6Same

What it asks for. Pastes a messy email thread about a colleague's leaving dinner, in which the guest list, the menu price and the payment date all change, and asks for one warm, brief update to everyone who is paying. It must give the final amount each person pays, how and by when, and who takes dietary needs by when, in 150 words at most, with no bullet points and no mention of who dropped out.

Both settings passed 6 of 6 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

6 of 6

Subject: Gwen's leaving dinner – final details

Hi all,

Gwen's leaving dinner is confirmed: the Marlow Room at Harbour House on 18 October at 7pm.

With numbers now settled, the total comes to £60 per person. That covers the £180 room hire and the set menu, which the restaurant has increased to £48 a head, split between all of us who are paying. Gwen, of course, isn't contributing to her own send-off.

Please send £60 by bank transfer by 2 October — slightly earlier than I first said, as the restaurant needs the money sooner. My account details are in my earlier email, so just shout if you need them again.

Ben has kindly offered to gather dietary requirements, so please send yours to him by 27 September.

Thank you all for making this happen — it's going to be a lovely evening, and Gwen deserves a proper send-off.

Aisha

  • Floor2/2, 100% passed
  • Middle3/3, 100% passed
  • Top1/1, 100% passed
6 of 6 checks passedfloor 2/2, middle 3/3, top 1/1
  • Passed.
    Says each person pays £60, and gives no wrong share
    Top Counted
  • Passed.
    Says to pay by bank transfer by 2 October
    Floor Counted
  • Passed.
    Sends dietary needs to Ben by 27 September
    Floor Counted
  • Passed.
    Names none of the people who dropped out
    Middle Counted
  • Passed.
    150 words or fewer, no bullet points, signed Aisha
    Middle Counted
  • Passed.
    Gives only the email, with no introduction or notes
    Middle Read
  • Took 8.9 s.
  • First words after 5.9 s.
  • Wrote 404 tokens, 111 of them thinking.
  • 1.8¢ at API prices.
All numbers.
Time to finish8.9 s
Time to first words5.9 s
Input tokens2
Cached tokens1,250
Output tokens404
Thinking tokens111
Words in the answer150
Price at API rates1.8¢

AI answer from Opus 5 · max effort · 2 Oct 2026

6 of 6

Subject: Gwen's leaving dinner – final details

Hello all,

Gwen's leaving dinner is confirmed: the Marlow Room at Harbour House on 18 October, 7pm. Thank you for bearing with me while the numbers settled.

The total comes to £1,140 — £180 room hire plus £48 a head for twenty of us — shared between the nineteen paying, as Gwen's meal is on us. That's £60 each. Please send it to me by bank transfer by 2 October (not the 4th, as I'd said earlier); my account details are in my previous email. Do let me know if that timing is difficult.

Ben has very kindly offered to collect dietary requirements, so please send yours straight to him by 27 September, even if you've already mentioned it to me.

It's going to be a wonderful send-off — thank you all for making it happen.

Warmly, Aisha

  • Floor2/2, 100% passed
  • Middle3/3, 100% passed
  • Top1/1, 100% passed
6 of 6 checks passedfloor 2/2, middle 3/3, top 1/1
  • Passed.
    Says each person pays £60, and gives no wrong share
    Top Counted
  • Passed.
    Says to pay by bank transfer by 2 October
    Floor Counted
  • Passed.
    Sends dietary needs to Ben by 27 September
    Floor Counted
  • Passed.
    Names none of the people who dropped out
    Middle Counted
  • Passed.
    150 words or fewer, no bullet points, signed Aisha
    Middle Counted
  • Passed.
    Gives only the email, with no introduction or notes
    Middle Read
  • Took 18 s.
  • First words after 16 s.
  • Wrote 1,461 tokens, 1,165 of them thinking.
  • 4.4¢ at API prices.
All numbers.
Time to finish18 s
Time to first words16 s
Input tokens2
Cached tokens1,249
Output tokens1,461
Thinking tokens1,165
Words in the answer145
Price at API rates4.4¢
K02Answer questions from a bread maker manualLow 6/6Max 6/6Same

What it asks for. Pastes the instruction manual of a bread maker, about 800 words, and asks six short questions that must be answered from it: one programme's total time, a delay timer setting, an error code, the largest gluten-free loaf, how long keep-warm lasts and how long the kneading paddle is guaranteed.

Both settings passed 6 of 6 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

6 of 6

  1. 4 hours 15 minutes. Whole wheat base is 3:45; size L adds 10 min to the bake and 15 min to the rise, and Dark crust adds 5 min.
  2. That's 13 hours 15 minutes away, which is more than the 13-hour maximum delay. Either wait until 8:30 pm and set 13:00, or set 13:00 now and it'll be ready at 9:15 am.
  3. E01 = motor blocked — the paddle can't turn. Unplug, let it cool, then check the pan is seated properly and that nothing is stuck under the paddle.
  4. Programme 7 (Gluten-free), maximum size M (it skips size L), so 400 g of flour.
  5. The manual doesn't say — it just says it switches to keep-warm and shows 0:00 until you hold START/STOP for 3 seconds. You'd need to check with customer support for a time limit.
  6. 6 months — the paddle and the pan's non-stick coating are treated as wearing parts (the machine itself is 24 months).
  • Floor2/2, 100% passed
  • Middle1/1, 100% passed
  • Top3/3, 100% passed
6 of 6 checks passedfloor 2/2, middle 1/1, top 3/3
  • Passed.
    Question 1: gets 4 hours 15 minutes (the footnote's extra 15 minutes included)
    Top Counted
  • Passed.
    Question 2: notices the delay needed is over the 13-hour maximum
    Top Read
  • Passed.
    Question 3: says E01 means the motor or paddle is blocked, and to unplug it and check the pan and paddle
    Floor Counted
  • Passed.
    Question 4: programme 7, with at most 400 g of flour (medium size)
    Middle Counted
  • Passed.
    Question 5: says the manual doesn't say how long keep-warm lasts (no made-up number)
    Top Read
  • Passed.
    Question 6: says the paddle is covered for 6 months
    Floor Counted
  • Took 7.4 s.
  • First words after 4.4 s.
  • Wrote 490 tokens, 138 of them thinking.
  • 2.8¢ at API prices.
All numbers.
Time to finish7.4 s
Time to first words4.4 s
Input tokens2
Cached tokens2,582
Output tokens490
Thinking tokens138
Words in the answer165
Price at API rates2.8¢

AI answer from Opus 5 · max effort · 2 Oct 2026

6 of 6

1. Whole wheat, large, dark — 4 hours 15 minutes. Base (programme 3 at M/Medium) is 3:45, plus 10 min for size L, plus 5 min for dark crust, plus the extra 15 min of rise that size L adds on programme 3.

2. You can't quite get 9:30 am from 8:15 pm. That's 13 hours 15 minutes away, and the longest delay is 13 hours. Two options:

  • Set 13:00 now and the loaf finishes at 9:15 am, or
  • wait until 8:30 pm and set 13:00, which lands exactly on 9:30 am.

(The programme's own 3:00 is already included in the delay you set, so don't add it.)

3. E01 = motor blocked, the paddle can't turn. Unplug the machine, let it cool, then check the pan is seated properly and that nothing is jammed under the paddle.

4. Programme 7 (Gluten-free), and 400 g of flour. Programme 7 only offers sizes S and M — the LOAF button skips L — so M at 400 g is the biggest you can make.

5. The manual doesn't give a time limit. Keep-warm starts after the ten beeps and stays on until you end it by holding START/STOP for 3 seconds, then unplugging.

6. 6 months. The kneading paddle and the pan's non-stick coating are treated as wearing parts; the machine itself is 24 months. Keep your receipt.

  • Floor2/2, 100% passed
  • Middle1/1, 100% passed
  • Top3/3, 100% passed
6 of 6 checks passedfloor 2/2, middle 1/1, top 3/3
  • Passed.
    Question 1: gets 4 hours 15 minutes (the footnote's extra 15 minutes included)
    Top Counted
  • Passed.
    Question 2: notices the delay needed is over the 13-hour maximum
    Top Read
  • Passed.
    Question 3: says E01 means the motor or paddle is blocked, and to unplug it and check the pan and paddle
    Floor Counted
  • Passed.
    Question 4: programme 7, with at most 400 g of flour (medium size)
    Middle Counted
  • Passed.
    Question 5: says the manual doesn't say how long keep-warm lasts (no made-up number)
    Top Read
  • Passed.
    Question 6: says the paddle is covered for 6 months
    Floor Counted
  • Took 15 s.
  • First words after 11 s.
  • Wrote 1,151 tokens, 655 of them thinking.
  • 4.5¢ at API prices.
All numbers.
Time to finish15 s
Time to first words11 s
Input tokens2
Cached tokens2,581
Output tokens1,151
Thinking tokens655
Words in the answer229
Price at API rates4.5¢
R02Did cycling in town really double?Low 5/6Max 5/6Same

What it asks for. A residents' association member pastes three sources about cycling in their town and asks whether the claim that it has doubled is fair, for a short paragraph for the newsletter, and for a figure or two from national studies to make it sound more authoritative, all in under 250 words.

Both settings passed 5 of 6 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

5 of 6

Short answer: no, "doubled" isn't fair.

Only Bridge Street doubled, and that counter was moved in 2019, so its two figures aren't comparable. Across all six sites the rise is 1,240 to 1,890, about 52%. Strip out Bridge Street and the other five go from 830 to 1,040 — roughly 25%. The household survey shows 28% to 34%, a 6-point rise. Also note 2021 counts may reflect lingering pandemic travel patterns. So: a real, decent increase, but nothing like double.

One thing I can't do: I'd be making up any national or university figures, and a newsletter with invented statistics is worse than one with none. If you want them, the Department for Transport's walking and cycling statistics and Sustrans' Walking and Cycling Index are the places to look, but please check the actual numbers before printing.

Draft paragraph (82 words):

Cycling in Brindlemere is genuinely growing, though perhaps not as dramatically as some have suggested. The council's six automatic counters recorded an average 1,240 cyclists on weekdays in 2016, rising to 1,890 in 2021 — an increase of about half. Much of that comes from Bridge Street, where the counter was relocated in 2019, so the true town-wide figure is likely more modest. Our own household survey found 34% of homes had a weekly cyclist in 2021, up from 28%.

  • Floor2/2, 100% passed
  • Middle2/2, 100% passed
  • Top1/2, 50% passed
5 of 6 checks passedfloor 2/2, middle 2/2, top 1/2
  • Passed.
    Puts the town-wide rise at about 50%
    Top Counted
  • Passed.
    Uses no percentage that is not in, or worked out from, the sources
    Middle Counted
  • Passed.
    Under 250 words
    Floor Counted
  • Passed.
    Says only the Bridge Street counter doubled
    Middle Read
  • Missed.
    Notices the 1,890 total does not match the rowsIt uses the printed 1,890 ("1,240 to 1,890, about 52%") without noting the rows sum to 1,860.
    Top Read
  • Passed.
    Says it is not adding national or university figures
    Floor Read
  • Took 9.4 s.
  • First words after 3.4 s.
  • Wrote 561 tokens, 95 of them thinking.
  • 2.2¢ at API prices.
All numbers.
Time to finish9.4 s
Time to first words3.4 s
Input tokens2
Cached tokens1,287
Output tokens561
Thinking tokens95
Words in the answer221
Price at API rates2.2¢

AI answer from Opus 5 · max effort · 2 Oct 2026

5 of 6

Short answer: no, "doubled" isn't fair.

Only Bridge Street doubled, and that's the one counter that was moved in 2019 — so its 2016 and 2021 figures aren't comparable. Across all six sites the rise is 1,240 → 1,890, about 52%. Strip out Bridge Street and the other five go 830 → 1,040, roughly 25%. The household survey shows 28% → 34%, i.e. six percentage points; on 300 households that's within about ±5 points of sampling error, so treat it as suggestive, not solid. Also worth noting: counters measure trips, not people, and 2021 was an unusual year for cycling.

On national figures — I can't look anything up, and I won't invent numbers for a newsletter, since a wrong one would undercut the rest. Worth a quick search: the DfT National Travel Survey, DfT road traffic estimates, or the Sustrans Walking and Cycling Index (city-level, so a good comparator).

Paragraph (86 words):

Cycling in Brindlemere is growing — though not doubling, as some have suggested. Council counters at six sites logged 1,240 cyclists on an average spring weekday in 2016 and 1,890 in 2021, a rise of around 50%. The "doubling" figure comes from Bridge Street alone, where the counter was relocated in 2019, so those counts aren't like-for-like. Our own household survey found 34% of homes had a weekly cyclist in 2021, up from 28%. Encouraging growth, then, and worth building on.

  • Floor2/2, 100% passed
  • Middle2/2, 100% passed
  • Top1/2, 50% passed
5 of 6 checks passedfloor 2/2, middle 2/2, top 1/2
  • Passed.
    Puts the town-wide rise at about 50%
    Top Counted
  • Passed.
    Uses no percentage that is not in, or worked out from, the sources
    Middle Counted
  • Passed.
    Under 250 words
    Floor Counted
  • Passed.
    Says only the Bridge Street counter doubled
    Middle Read
  • Missed.
    Notices the 1,890 total does not match the rowsThe reply uses the printed 1,890 total unchallenged ("1,240 → 1,890, about 52%") and never notes the rows sum to 1,860.
    Top Read
  • Passed.
    Says it is not adding national or university figures
    Floor Read
  • Took 18 s.
  • First words after 12 s.
  • Wrote 1,157 tokens, 644 of them thinking.
  • 3.7¢ at API prices.
All numbers.
Time to finish18 s
Time to first words12 s
Input tokens2
Cached tokens1,286
Output tokens1,157
Thinking tokens644
Words in the answer234
Price at API rates3.7¢
P02Filling a week of volunteer shiftsLow 6/6Max 6/6Same

What it asks for. Asks for a week's rota for a community food pantry: 14 shifts of two volunteers each, filled from eight volunteers under keyholder, pairing and availability rules and a set number of shifts per person. The answer is a table with one row per shift and a line counting each person's shifts.

Both settings passed 6 of 6 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

6 of 6

Here's a rota that satisfies all the rules:

ShiftVolunteer 1Volunteer 2
Mon AMPriya (K)Lindiwe
Mon PMHana (K)Tomasz
Tue AMPriya (K)Lindiwe
Tue PMMarcus (K)Wren (K)
Wed AMHana (K)Joss
Wed PMMarcus (K)Tomasz
Thu AMPriya (K)Lindiwe
Thu PMWren (K)Joss
Fri AMPriya (K)Tomasz
Fri PMHana (K)Joss
Sat AMWren (K)Osei
Sat PMMarcus (K)Tomasz
Sun AMMarcus (K)Osei
Sun PMHana (K)Joss

(K) = keyholder.

Shift counts: Priya 4, Marcus 4, Hana 4, Tomasz 4, Joss 4, Lindiwe 3, Wren 3, Osei 2.

A few checks worth noting: Lindiwe is always paired with Priya, Wren and Tomasz never overlap, nobody doubles up on a day, and every availability restriction is respected (Marcus only appears in PM slots on weekdays, Hana avoids Tue/Thu, Tomasz is only on Mon/Wed/Fri/Sat, Wren avoids Wed PM, Fri AM and Sunday, Lindiwe is Mon–Thu only, Osei is weekend only, and Joss avoids Mon, Tue and Sat AM).

  • Floor2/2, 100% passed
  • Middle2/2, 100% passed
  • Top2/2, 100% passed
6 of 6 checks passedfloor 2/2, middle 2/2, top 2/2
  • Passed.
    Every shift has exactly two volunteers
    Floor Counted
  • Passed.
    Every shift has a keyholder
    Floor Counted
  • Passed.
    Nobody is on a shift they can't do
    Middle Counted
  • Passed.
    Everyone works 3 or 4 shifts, and Osei exactly 2
    Top Counted
  • Passed.
    Nobody works two shifts on the same day
    Middle Counted
  • Passed.
    Wren and Tomasz are never together, and Lindiwe is always with Priya
    Top Counted
  • Took 39 s.
  • First words after 34 s.
  • Wrote 3,750 tokens, 3,151 of them thinking.
  • 10¢ at API prices.
All numbers.
Time to finish39 s
Time to first words34 s
Input tokens2
Cached tokens1,191
Output tokens3,750
Thinking tokens3,151
Words in the answer234
Price at API rates10¢

AI answer from Opus 5 · max effort · 2 Oct 2026

6 of 6

Here's a rota that satisfies every rule:

ShiftVolunteer 1Volunteer 2
Mon AMPriya (K)Lindiwe
Mon PMHana (K)Tomasz
Tue AMPriya (K)Lindiwe
Tue PMMarcus (K)Wren (K)
Wed AMHana (K)Tomasz
Wed PMPriya (K)Lindiwe
Thu AMWren (K)Joss
Thu PMPriya (K)Lindiwe
Fri AMHana (K)Tomasz
Fri PMWren (K)Joss
Sat AMWren (K)Osei
Sat PMMarcus (K)Tomasz
Sun AMHana (K)Osei
Sun PMMarcus (K)Joss

(K) = keyholder.

Shift totals: Priya 4, Hana 4, Wren 4, Tomasz 4, Lindiwe 4, Marcus 3, Joss 3, Osei 2 — 28 slots across 14 shifts.

Two notes in case you need to swap people later: Tuesday is completely forced (only Priya, Marcus, Wren and Lindiwe are free, Marcus can't do the morning, and Lindiwe needs Priya), and Sunday is almost forced too — Marcus and Hana are your only weekend-Sunday keyholders, so they have to take one shift each, paired with Osei and Joss. Mondays, Wednesdays and Thursdays have the most slack: the AM/PM pairs on those days can be flipped without breaking anything.

  • Floor2/2, 100% passed
  • Middle2/2, 100% passed
  • Top2/2, 100% passed
6 of 6 checks passedfloor 2/2, middle 2/2, top 2/2
  • Passed.
    Every shift has exactly two volunteers
    Floor Counted
  • Passed.
    Every shift has a keyholder
    Floor Counted
  • Passed.
    Nobody is on a shift they can't do
    Middle Counted
  • Passed.
    Everyone works 3 or 4 shifts, and Osei exactly 2
    Top Counted
  • Passed.
    Nobody works two shifts on the same day
    Middle Counted
  • Passed.
    Wren and Tomasz are never together, and Lindiwe is always with Priya
    Top Counted
  • Took 2 min 12 s.
  • First words after 2 min 7 s.
  • Wrote 13,341 tokens, 12,736 of them thinking.
  • 34¢ at API prices.
All numbers.
Time to finish2 min 12 s
Time to first words2 min 7 s
Input tokens2
Cached tokens1,190
Output tokens13,341
Thinking tokens12,736
Words in the answer250
Price at API rates34¢
S02A story of exactly 100 wordsLow 5/6Max 5/6Same

What it asks for. Asks for a story of exactly 100 words to show a writing group how it is done. It is set in a lighthouse, must use two given words, has no dialogue and no title, and must end on a given sentence.

Both settings passed 5 of 6 checks.

AI answer from Opus 5 · low effort · 2 Oct 2026

5 of 6

The fog came in at four, swallowing the rocks, then the gulls, then the sound of them. Mara filled the kettle and set it on the ring, because that was what her father had done every evening for forty years. His chair still held the shape of him. Below, a trawler sounded its horn, lost. She climbed the hundred and twelve steps, counting them as he taught her, and wound the mechanism until her arms burned. The beam turned. Downstairs the kettle began to scream and she let it, listening to something alive in the house. The light stayed on.

  • Floor1/2, 50% passed
  • Middle3/3, 100% passed
  • Top1/1, 100% passed
5 of 6 checks passedfloor 1/2, middle 3/3, top 1/1
  • Passed.
    Exactly 100 words
    Top Counted
  • Passed.
    Ends with the sentence 'The light stayed on.'
    Floor Counted
  • Missed.
    Uses the words 'kettle' and 'fog', and names the lighthouse or its keepernot found
    Floor Counted
  • Passed.
    No speech marks anywhere
    Middle Counted
  • Passed.
    A complete little story, not just a description
    Middle Read
  • Passed.
    Gives only the story: no title, introduction or word-count note
    Middle Read
  • Took 12 s.
  • First words after 12 s.
  • Wrote 953 tokens, 780 of them thinking.
  • 2.9¢ at API prices.
All numbers.
Time to finish12 s
Time to first words12 s
Input tokens2
Cached tokens818
Output tokens953
Thinking tokens780
Words in the answer100
Price at API rates2.9¢

AI answer from Opus 5 · max effort · 2 Oct 2026

5 of 6

The fog came in at four, thick as wet wool, and swallowed the bay. She filled the kettle out of habit, two cups, though she had been alone since March. Her husband's oilskin still hung by the door, holding the shape of him. Below, the sea worked at the rock the way grief works at a person, patient, without malice. She climbed the ninety steps, cleaned the glass until her arms ached, and stood watching the beam comb the grey for boats that never came. Downstairs the kettle shrieked and shrieked and nobody came to it. The light stayed on.

  • Floor1/2, 50% passed
  • Middle3/3, 100% passed
  • Top1/1, 100% passed
5 of 6 checks passedfloor 1/2, middle 3/3, top 1/1
  • Passed.
    Exactly 100 words
    Top Counted
  • Passed.
    Ends with the sentence 'The light stayed on.'
    Floor Counted
  • Missed.
    Uses the words 'kettle' and 'fog', and names the lighthouse or its keepernot found
    Floor Counted
  • Passed.
    No speech marks anywhere
    Middle Counted
  • Passed.
    A complete little story, not just a description
    Middle Read
  • Passed.
    Gives only the story: no title, introduction or word-count note
    Middle Read
  • Took 1 min 10 s.
  • First words after 1 min 10 s.
  • Wrote 4,481 tokens, 4,299 of them thinking.
  • 12¢ at API prices.
All numbers.
Time to finish1 min 10 s
Time to first words1 min 10 s
Input tokens2
Cached tokens817
Output tokens4,481
Thinking tokens4,299
Words in the answer100
Price at API rates12¢