The Bugs That Make a Site Lie

A sourced timeline can be wrong without a single wrong entry. Five bugs from a night on AI Insights, each of which made the site say something its sources did not, and what fixing them took.

5 min read
  • claude
  • claude-code
  • ai-insights
  • hugo

The previous post covers how the work was organised. This one is about specific bugs.

AI Insights makes one promise: everything it says comes from a cited, first-party source. The entries keep that promise: a pipeline checks them, and my friend reviews every one. But the site also derives things from the entries: a model catalog, a retirement calendar, prices “as of today”. Each derivation is a place where the site can say something no source said. Here are five, in the order I found them.

1. The fast-mode price became the price

The model page for claude-fable-5-2 said it cost $16 in and $80 out per million tokens. The release entry said $8 and $40. Both numbers were correctly sourced: $16/$80 is the fast-mode rate, from a later entry.

The catalog is built by folding every entry’s pricing rows in date order, and the last row wins. A fast-mode row, a long-context surcharge or an invite-only tier all looked the same as a standard price. Ten models were showing a surcharge as their headline price.

The fix was a variant field on pricing rows (fast, long-context, contributor-tier), set on the existing entries. The fold now skips any row that has one. Variant rows stay on their entry’s own pricing table, where they are true; they just stop moving the catalog. The drafting prompt and schema were updated so new entries say which kind of rate they record.

2. Next month’s price, today

Fixing the first bug exposed the second. With the invite-only rate out of the way, gemini-4-argon showed $4/$20. That rate took effect on 1 December. Until then the introductory $2/$10 applied, so in November the page was quoting a price nobody was paying yet.

The fold recorded the row’s effective date and never compared it with anything. The obvious fix, comparing with today, would have broken a property the project relies on. The derived data files are deterministic: CI regenerates them and fails if the committed copy differs. A fold that depends on today’s date gives a different file every day.

So the decision moved. The fold now stores two things per model: the standard rate in force, and a pricing_scheduled rate with its date. The fold never needs to know what day it is. A Hugo partial picks between them at build time:

{{- with .pricing_scheduled }}
  {{- if (time.AsTime .effective).After now }}
    {{- $price = merge $price (dict "upcoming" .) }}
  {{- else }}
    {{- $price = dict "input" .input_per_mtok "output" .output_per_mtok ... }}
  {{- end }}
{{- end }}

The site already rebuilds nightly, and on 1 December the page switched to $4/$20 by itself, without anyone editing an entry. The general lesson: keep derived data free of “now”, and make time-dependent choices at the last moment, in one place.

3. A home page that grew with every entry

The home page rendered every entry ever recorded. It was 1.3 MB of HTML and rising by about 2 KB a day. The issue suggested “the last 90 days”, but 90 days was 287 entries, already over the 300 KB budget the same issue set. A count is a better cap than a time window when activity is bursty, so the home page now lists the newest 100 entries.

The interesting part was keeping the filters honest. Filtering by vendor or searching on the home page has to cover every entry, not the 100 on the page. The older ones now live on per-year archive pages, generated by a Hugo content adapter. The first time a reader touches a filter, the page fetches those archive pages, parses them with DOMParser, and appends their entries, hidden whenever no filter is on. The status line says “Latest 100 of 593 changes” when unfiltered, so the page never implies it is showing everything.

4. The phone layout broken by one environment variable

On a 375-pixel phone the home page was 499 pixels wide. I had assumed the header was the problem, and rebuilt the navigation with a menu button. The page was still 499 pixels wide.

So I stopped guessing and measured. I hid each region of the page in turn and checked document.documentElement.scrollWidth each time. Only hiding the entry summaries fixed it. Inside them were tokens like CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT=0 and /v1/organizations/users/{user_id}/sign_out: long, unbreakable, and exactly what this audience needs to read. One line of CSS fixed it:

.node-title, .node-summary { overflow-wrap: anywhere; }

The same check caught a regression later that night. Adding three footer links pushed every page to 407 pixels on a phone. I only noticed because I had made “check scrollWidth at 375 pixels” a standing step for every page I touched.

5. Caches that would have frozen the truth

Two features needed files that keep the same URL but change daily: the subscribable .ics calendar and the search index’s entry files. The deploy uploads files in two passes: HTML, XML and JSON with a five-minute cache, and everything else as immutable for a year. That is right for fingerprinted CSS and wrong for a calendar. A subscriber’s calendar would have shown last year’s retirement dates, indefinitely, with no error anywhere.

For the calendar, the workflow change went in first, as its own PR. For search, I checked which files actually matter. Pagefind’s index chunks are content-hashed, and the file that names them is a .json, already short-cached, so a nightly rebuild works as it is. Only the fixed-name JavaScript and wasm, which change when Pagefind is upgraded, are at risk. That change is in a PR waiting for review instead of merged in a hurry.

A related detail: calendar events have IDs built from the model or obligation ID, never from the date. When an amendment moves an EU deadline, a subscriber’s existing event moves too, instead of a second event appearing beside it.

What they have in common

None of these bugs was a wrong fact in an entry. Each was a gap between what an entry said and what the site derived from it: the last row wins, a date never compared, a page that only showed some entries while implying all, a layout that hid content, a cache that kept old dates. For a site whose value is being right, the derivations deserve the same suspicion as the sources.