/api/example was fired as a side effect of tapping keep: the learner asked
to save a word, and a second, unasked model call went to the free tier every
app on the box shares. Standing rule (2026-09-25): free-tier keys are spent
only when a person deliberately asks.
The route no longer builds the free chain; without a BYOK key it returns no
examples (the card shows the source sentence, as before the feature), and
the keep button no longer posts without a key.
Regression test app/api/example/route.test.ts, proven by mutation: re-adding
the freeChain import, dropping the no-key guard, or dropping the client skip
each fails it.
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A learner who met "gäll" once has met it once. The review card showed the
sentence the word came from — the same sentence every time — so the word got
learned attached to that context rather than learned. One or two further
sentences, in different situations, is the cheapest version of the varied
input that actually builds recognition.
**This is free for everyone, and that was a measurement not a concession.** I
flagged it as needing a pricing decision because it costs a model call. Having
measured the call — about 174 tokens in and 60 out against the chat prompt's
2,234 — it is roughly five hundredths of a rappen, ONCE, for the lifetime of
that word. A learner who fills the entire 500-word cap costs about a quarter of
a franc. Gating that would be arbitrary, and people can feel arbitrary.
**Its own route, not a mode of /api/chat.** A different shape of request: no
history, no pictures, no thread, and an answer that is two strings rather than
a turn. Folding it in would send the whole mode/gloss/suggestion contract to
ask for a sentence — roughly ten times the cost for a fraction of the work.
**Saving never waits for it.** The word is written first and the call fires
after, unawaited. Someone on a tram taps keep, the word is theirs immediately,
and the examples either arrive a second later or never — in which case the card
shows the sentence it came from, exactly as before. Every failure path returns
an empty list with a 200, because nothing the learner did is lost by this
route doing nothing.
Two rejections matter more than the happy path, and both are tested:
- A sentence that does not contain the word. Asked for one using "Chind" a
model writes one using "Chinder" — a fine sentence and a useless example,
because the learner is reviewing the form they saved. Matched on a word
boundary, case-folded the way the saved list folds its own identity.
- A sentence in the wrong variety. The same gate every other generated line
faces. A wrong form shown as an example teaches the wrong form, which is
worse than showing no example — so an empty list is a normal outcome and
the bar never drops to fill the space.
The card rotates through examples by review count rather than at random: a word
met four times has been met in more than one place, and a card that reshuffles
on every render changes while you are reading it.
Also removes a duplicate `siblingOf` I introduced in `lib/variety/bridge.ts` —
it already existed in `pack.ts`, where the prompt imports it from. Two answers
to "which bridge do we mean" that could have drifted apart.
353 tests.
Claude-Session: https://claude.ai/code/session_01FzYBD3sZroCAYeRgTYrpfT
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>