Files
CatoandClaude Opus 5 291fec94ac A website with an evidence base, and the app behind /app (#76)
* feat(site): a website with an evidence base, and the app behind /app

The repository was one route: `app/page.tsx` rendered `<ReportFlow />` and
that was the whole product. There was nothing to send anyone — no explanation
of what the thing is, no argument for why it should exist, and no way to look
at the reasoning without reading the source.

This adds the website, and puts the evidence under it rather than beside it.

WHAT THE SITE ARGUES, AND WHY IT CHANGED

The pitch used to be "report within 30 minutes and recovery jumps above 70%".
That number could not be sourced anywhere, and two findings contradict the
story it tells. The incumbent (RUBICON Nova Find, in service since 2004)
re-matches open loss reports against later finds continuously, so a report
filed on day three is not penalised — "report fast or lose it forever" was
never true. And the operator's own figures show roughly 180,000 loss reports
chasing roughly 120,000 handed-in items: the shortfall is not a matching
failure, it is items that never reach the operator at all.

So matching is the part that already works, and speed is not the constraint.

Cohn et al. (Science, 2019) turned in over 17,000 wallets across 355 cities in
40 countries. Return rates ROSE with the money inside — 40% empty, 51% with
money, 72% with a large sum — the opposite of what self-interest predicts. The
detail that is almost always dropped when that study is cited is the one that
matters here: every wallet contained a business card with the owner's email
address. It measures what people do WHEN A CHANNEL TO THE OWNER EXISTS.

A jacket on a seat has no business card. That is the gap — not honesty, not
matching speed — and it is a claim the literature actually supports.

STRUCTURE

- `(site)` and `(app)` route groups. The app keeps its 430px phone frame; the
  website gets a full-width shell. Both draw from the same tokens. The root
  layout no longer imposes `.mobile-container` on everything.
- `/` landing, `/how-it-works`, `/research`; the report flow moves to `/app`,
  the crew board stays at `/staff`.
- 45 message keys across all four catalogues. de/fr/it/en, no exceptions —
  a missing key is a compile error here by design.

THE CLAIMS ARE DATA, NOT COPY

`lib/research.ts` holds every empirical claim as a typed entry that carries
its own source or is typed `assumption`. The pages map over it; no figure is
typed into a paragraph. AGENTS.md rule 1 says never state a number without a
citable source — that rule now fails the build (`research.test.ts`, 20 tests),
including a guard that the 30-minute claim stays OUT of the citable set and
that the wallet study's contact channel stays on the record.

`lib/capabilities.ts` does the same for rule 2. Each capability names the file
that would have to exist for its built/designed label to be true, and the test
checks the filesystem in both directions: relabelling passenger notification
"built" fails, and so does shipping it while the page still says "designed".
Both proven by mutation.

THREE THINGS THE GATES CAUGHT

The contrast test rejected the step numeral at 1.17:1 — doing its job. But it
also revealed that its own premise had expired: it checks every text token
against white and milk, because those were the only surfaces text sat on until
this commit added a charcoal band. A grey chosen there would have been checked
against the wrong background. So the dark surface and its permitted
foregrounds are declared together in globals.css and a third property reads
them back out; a fourth modifier added later is covered automatically.

The tenant guard rejected two operator names in `lib/research.ts` — inside
published article titles. A citation title is a quotation, and paraphrasing it
to satisfy the guard would make the reference not match the article it points
at, which breaks rule 1 to satisfy rule 7. The exemption is scoped to one file
AND one field; a claim, a comment or a publisher naming an operator still
fails, and so does the same title in any other file. Five tests prove both
edges by running the real script against a fixture tree.

Those fixtures then tripped the guard themselves — a directory-scanning check
reading its own test data. They live under `test-fixtures/` now, outside the
scanned tree, rather than exempting `__tests__` and putting a real hole in the
guard to accommodate a test.

`pnpm run verify` green: 274 tests, 19 suites. Production build green.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HVudRzEmLqLHvGNqFSpJq6

* fix(site): the evidence speaks German, and the logo stops disagreeing with the page

Three defects, all of which only a browser could find. The build was green for
every one of them.

THE EVIDENCE RENDERED IN ENGLISH

`lib/research.ts` stored its claims as English sentences, and the German page
rendered them verbatim: "Share of handed-in items reunited with their owner"
under "Das Problem ist nicht das Zuordnen." Nothing failed, because nothing
was watching — the repository's rule that no string lives outside a catalogue
had never been applied to the evidence module.

`claim` and `limit` are `MessageKey` now. `MessageKey` is derived from the
German catalogue, so an evidence entry whose claim has not been translated
into all four languages does not compile. 72 keys added; the claims render in
de/fr/it/en, checked live.

`value` was carrying English too — "~180,000 reported / ~120,000 found" is a
sentence fragment inside a field the type system treats as language-neutral,
and no catalogue can reach it. Values are digits and units only now, with a
test that rejects any word of two letters or more.

The content guards moved with them. They used to read one English field;
they now resolve every claim through all four catalogues, because the banned
"30 minutes / 70%" number could return through the French copy — the one
nobody rereads — and the old guard would not have looked.

THE LOGO SAID ONE OPERATOR, THE PAGE TITLE SAID ANOTHER

`SiteHeader` is a client component and read `tenant.wordmark` directly. On a
build made without `NEXT_PUBLIC_TENANT` and then RUN with it set, the header
rendered the neutral house wordmark while the title, footer and palette all
named the livery tenant.

`NEXT_PUBLIC_*` has two origins: Next inlines it into the client bundle at
BUILD time, and a server component reads it from the process at REQUEST time.
They agree only when build and runtime were handed the same value — which a
deploy that configures the unit rather than the build step does not
guarantee. No error, no warning, two operators on one screen. And of all the
values to get this wrong on, the tenant is the worst: failing open to someone
else's brand is the one failure mode that carries real cost.

The tenant is resolved on the server and passed down. A component handed a
value cannot disagree with the server about it, whatever the bundler inlined.
`tenant-client-boundary.test.ts` scans for the import rather than the symptom,
because the symptom needs a build/runtime combination that `pnpm run dev`
never produces. Proven by mutation: restoring the import fails the test.

Verified under the exact condition that broke it — built with no tenant set,
served with one. The wordmark now matches the title, and the house wordmark
appears in no client chunk at all.

THE HEADER FELL OFF THE PHONE

At 390px the two nav links shredded into three lines and the action button was
pushed past the right edge. The header wraps now: wordmark and action on the
first row, nav full-width below, one row again from `sm` up. One markup, no
duplicated nav, no JavaScript. No horizontal overflow at 320px on any page.

Also: the back-link out of `/app` was rendering in the gap between the form
and its sticky action bar, reading as a stray link inside the form. It sits at
the top now, where it reads as a way out.

`pnpm run verify` green: 279 tests, 20 suites.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HVudRzEmLqLHvGNqFSpJq6

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-11 08:42:00 -07:00
..