83 Commits
Author SHA1 Message Date
6c14797cd6 Culture: what a line means, native recordings by link, and one page for what is usual here (#460)
* feat(situations): a line may name a convention, held to a source

What a line does beyond its words, as an id on the line whose sentence is in
the seven dictionaries: shown after a heard line is answered, above a line the
learner builds, and on the scene's list of lines with its sources linked.

Two conventions on four lines: a polite question from whoever hands out the
work is the assignment; an order is put as a wish. Each names sources opened
for it. The contract suite refuses an unknown id, a convention on a line of
the other direction, one without a source and one no line carries.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* wip(review): a native speaker says a line and sends it

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* feat(review): a native speaker says a line and sends it; approved voices play on the list of lines

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* fix(review): say that a recording was taken back; audit reads the declared upload size

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* test(audit): the recording walk measures the uploaded audio in the page

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* test(course): line_recordings is not a course table

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* feat(culture): one page for what is usual here, in the menu after the situations

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* test(audit): the layout walk covers /culture, a scene's lines and the review page

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Co-authored-by: forge merge bridge <forge@git.orangecat.ch>
2026-12-03 18:39:07 +01:00
CatoandClaude Opus 5.5 42d8e6a19c Heidi Max next to Heidi Plus; owner payment settings and «Stripe einrichten» (#456)
* CTAs speak as a command to the learner: «Frag Heidi»

Buttons and links that start an action are imperatives addressed to the
learner (owner's decision), so the brand phrase, the domain and the buttons
say the same thing: «Frag Heidi» (was «Heidi fragen»), «Frag Heidi, warum»,
«Entdecke die Situationen», «Fang an», «Probier es aus», «Erstell dein
Gratis-Konto», and the home, chat, plans, warm-up, practice, play, groups,
languages and organisations doors alike. du-form in German (Sie kept on the
organisations page, which addresses organisations as Sie), tu in fr/it,
ti in rm, ты in ru; English only «Create your free account».

Swiss German changes only where the imperative has a source: «Frag d Heidi»
(verb «frage» in the gsw-zh pack; imperative «frag» in Wiktionary's Zurich
conjugation table), «Lueg … aa» and «Mach …» (the pack's imperative topic).
Other gsw labels keep their infinitives.

Single-word tab-like labels («Üben», «Starten») and status texts unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* gsw: «Frög d Heidi» (Zurich imperative of fröge)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Heidi Max next to Heidi Plus; owner payment settings and «Stripe einrichten»

- paykit 0.7.0. One tier answer (lib/pay/tier.ts: free | plus | max from the
  entitlement's plan id; the one-time pass counts as plus), read by the caps
  (capsFor, HEIDI_CAP_MAX_*; Max defaults to 3x Plus), the model route
  (chainFor: HEIDI_MAX_MODELS first, else exactly the Plus route) and the
  Rückblick (REVIEW_EVERY_DAYS_BY_TIER: max 7, plus/free 30).
- /plans: Free | Plus | Max | own key | Organisations on PlanPicker, Max
  priced from HEIDI_MAX_* (no price in code); review step per plan; without
  payment switched on the review says so instead of a pay button; a Stripe
  TEST key shows «Testmodus».
- Back office Geld -> «Zahlungen» (/manage/money/payments): eight prices,
  sales, Stripe key and webhook secret in pay_settings (migration 0035),
  secrets sealed and never sent to the page; stored value over env over off.
- «Stripe einrichten»: makes or finds Products/Prices, the customer-portal
  configuration (cancel, card, switch Plus/Max) and the webhook endpoint,
  storing its signing secret; idempotent, one result per step.
- Webhook reads the plan from the subscription's Price, so portal switches
  move the tier.
- Words in all seven dictionaries; changelog 2026-12-03.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Paid allowances never below the tier below; Plus and Max cards list them

- caps.ts: every paid allowance is at least the tier below (daily with 0 as
  no count; Plus dictation per 30 days at least free's daily x 30). Plus daily
  defaults to 3x free (300), Max to 3x Plus (900); voice 1200/3600 s.
- plan-cards.ts: one paidBenefits shape for Plus and Max from capsFor:
  questions a day, Heidi's voice minutes, dictations per 30 days, the
  Rückblick rhythm, then Max's two «bald» lines, then «Alles aus …».
  The free card says Heidi's own voice comes with Plus and Max.
- All seven dictionaries; changelog lines for the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-03 16:02:41 +01:00
CatoandClaude Opus 5.5 c7d91ffe23 Exercise revamp: questions that teach, time to read, tap the words, choose what to practise, play together, plans (#452)
* Practice: choose or type, one switch above every question

A remembered habit (heidi.practice.habit.v2) decides, for each word that
has both, whether its meaning is chosen or its sentence typed. A flip
swaps the questions still ahead one for one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Practice: a word typed right comes back later than one chosen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Practice: one hardness number for every question

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Plans: your own AI key is offered, and the pass card says what a pass is

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Knowledge map: a deterministic layout, and every node's state from the ledger

lib/visual/knowledge-map is the first knowledge-map layout in the fleet,
written to be extracted: plain data in, coordinates out, no app imports.
Clusters packed into columns, nodes in rows under each cluster's name,
labels wrapped with the real font's widths; no two cells meet, so no two
labels can, at 320px as at 1280px. Same input, same picture.

lib/domain/progress reads where a learner stands on every situation, grammar
topic and word group (not started / started / shaky / solid / mastered) from
the learner model, the review memory and the situation readings the
situation pages already use, and orders the few lines worth acting on:
the learner's own situations first, then new ones in their areas, then what
wobbles, then the words that keep slipping. Nothing is counted in advance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* «Was du kannst»: the map page, the weak-spots card, and the ways to it

/[locale]/progress draws the whole course as a map coloured by the
learner's own answers, with a legend and one motion (what is known fills
in, off under reduced motion). Tapping a node opens a sheet with what it
is, the numbers (asked, right, last seen, due) and «Üben», «Bis es sitzt»
(goal=nail), and for a situation «Situation starten»; an area's name opens
its situations and practises the whole area (module=…). Works signed out
from this device and signed in with the synced views; with no data it is
the course, not started, and where to begin.

The card «Was sitzt, was fehlt» is on the personal page and above the
map; /practice links to the map; the avatar menu lists it. Personal and
noindex like settings, so not in the sitemap. Strings in all seven
dictionaries; the responsive audit measures /progress.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Practice: an area scope, «Nail it», hardest first, and nothing right today asked again

- module=<area>: every scene of one situation area (care, hospitals, ...) and the words said in them; subjects=<list>: named words and lines, for the weak spots.
- goal=nail (nail.ts): a drill over a scope until each question is right twice in a row, the second at least three questions later and in the typed form where a word has one; a miss comes back after two to four others; at most 30 subjects, hardest not-known first.
- order=hard: hardest first by hardness(); «Harder» prefers the harder question inside its band.
- A sitting's order is shuffled (order.ts), never the same subject back to back and the same kind only where unavoidable; cards keep their most-heard-first order.
- Answered right today and not wrong today, on any screen (stats now date every wrong answer): not new again today in a sitting; read instead of asked in a situation run (withKnownRead), unless its review is due.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Play together: a challenge link and a live round

A challenge is ten fixed questions behind a link (/play/c/<id>): the same
questions in the same order with the same option order for everyone, a
nickname and no account, marked on the server, and a board of names, right
answers and times. It is kept 30 days, and expired ones are removed when
somebody next touches the table.

A live round is a host screen (/play/host) with a six-digit code and a QR
code, players on their phones (/play?code=), 20 seconds a question, points
for right plus speed, counts per option on the host's screen, a short board
on the phones and a podium. Realtime is short polling against Postgres: one
primary-key read with a version, 204 when nothing moved. At most 50 players
per room; a room is gone two hours after its last move, checked on access.
Host actions need the host secret kept on the host's device; creating rooms
and joining are limited with limitkit; nicknames are cleaned, capped at 24
and only ever rendered as text.

Five new tables (migration 0033), two privacy flows, the strings in all
seven languages, one section on /practice and one button at the end of a
sitting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Practice: wrong answers a German reader cannot see through, and «Find the German word»

A harness (scripts/audit/options.ts, not shipped) measures how often a
reader who knows no Zurich German answers each chosen-answer question by
looks alone: most like the prompt, least like it, odd shape, longest.
options.test.ts holds the rates near chance.

- «Say it in Zurich German» (run): the wrong lines are the right line with
  one word changed: a Standard German word from the pack's leaks or the
  course's own cognate pairs, a form the pack places elsewhere, or an
  article the noun never takes. By looks: 99% -> 32%. Other lines only
  where a line has fewer than two such changes.
- Look-alikes skip Zurich words that stand for two standard words (bi:
  bin/bei, wänn: wann/wenn) and course pairs that are not cognates, so a
  planted word is certainly not Zurich German.
- «Stimmt das?»: a false claim is a near miss of the line's meaning
  (near-miss.ts), never another line; no near miss, no false claim.
  By resemblance: 96% -> 64%.
- «What is meant?»: more near-miss meanings (modals, Herr/Frau, times,
  places, colours...), the closest first. Lines with one: 21% -> 42%.
- Cognates («gah», gehen) are asked from German with real course words
  as the other options; the rest by meaning, with distractors as alike
  as the answer (resembles: letters and consonant skeleton).
- Options, banks and columns are laid out from a seed per sitting and
  the question id (present.ts), one helper for practice and the runs.
- hardness.ts counts giveaways, confusable options and odds; a cognate
  asked from Zurich rates easier than the same word asked from German.
- New kind «Find the German word» (spot): a course line with one word in
  Standard German, tap the word; the answer shows the Zurich word and the
  line. Strings in all seven languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Questions: «Tschüss» is never offered as the certainly-wrong German word

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Exercises: read before moving on, and tap the words instead of typing

The moment after an answer (exercises/chrome.tsx, useMoveOn):
- a right answer shows the whole line where the question showed part of it,
  its meaning and the reason, then moves on after a beat as long as that
  text: 1.3 s + 45 ms a character, at most 6 s (move-on.ts);
- a touch, wheel or focus on the session screen, or «Anhalten» beside
  «Weiter», holds it: the bar fades and the control reads «Angehalten» in
  the same box, so nothing moves; Enter or Space continues;
- a wrong answer or a skip never moves on;
- «Von selbst weiter: An | Aus» in the sitting's sheet, remembered on the
  device (heidi.practice.move-on.v1, person-level, on the privacy page);
- reduced motion: no draining bar, the seconds are counted on «Weiter».
The situation run's follow steps use the same hook and controls, and the
run now has the same sheet behind the sliders.

Tap instead of type (tiles.ts, exercises/tiles.tsx, answer-how.tsx):
- every translate question can be built from tiles: its own words plus two
  or three real course words from the same scene, topic or word group,
  look-alikes first; marked against the course line (case and punctuation
  ignored), typed answers stay self-marked;
- the build kind's tile UI is now TileAnswer, shared by both;
- the habit is «Wählen | Antippen | Tippen»; old stored values stay valid;
  on a typed question it is that question's switch, and «Wählen» is not
  offered where there is no meaning question;
- the run's «Lieber schreiben» link is the same «Wörter antippen | Tippen»
  switch, above the question;
- tiles are recorded as mode "tap": not typed, not scheduled as recalled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Heidi Plus: a subscription that renews, monthly or yearly, with an intro price

The one-time pass becomes «Heidi Plus»: a monthly plan that renews until
cancelled, a yearly one at a saving, and an optional lower price for the
first months, through Stripe (paykit 0.6 `stripeBilling`). The pass stays,
offered below as «Lieber einmal zahlen?».

- /plans is paykit's PlanPicker: Free | Heidi Plus (recommended) | Eigener
  KI-Schlüssel | Organisationen. The own-key tier is CHF 0 to Heidi, names
  the providers from ai-kit's BYOK_VENDORS and leads to /settings#model; the
  old own-key section is gone. Without prices, Plus is «Bald verfügbar» with
  the notify form.
- A review step before Stripe (paykit's PlanReview): summary, notes, the
  account, the renewal box that must be ticked (Heidi has no terms page, so
  no terms box), the practice reminders as an optional box, and an active
  pass or subscription shown with «Abo verwalten» instead of a second one.
- Prices only from HEIDI_PLUS_MONTH_CHF, HEIDI_PLUS_YEAR_CHF,
  HEIDI_PLUS_INTRO_CHF, HEIDI_PLUS_INTRO_MONTHS; the proposal is on
  /owner/payments and in .env.example, marked as one.
- Stripe webhook: subscription events verified, handled once by event id
  (pay_events), the record in pay_subscriptions (migration 0034). A paid
  period moves the same entitlements row a pass uses, never back.
- Settings: «Abo verwalten» opens Stripe's portal, with the status line
  (renews / ends / payment failed / ended).
- Deleting the account cancels the subscription at Stripe first.
- Privacy: the passPayments flow names the subscription, its tables and the
  email Stripe receives; the flows have anchors.
- Strings in all seven languages.

package.json asks for @bitbaum/paykit ^0.6.0; the lockfile follows once it
is published.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Play together: «Find the German word» can be played; the said-too list lives in the packs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Practice: «Was willst du üben?» on /practice and the personal page; «Bis es sitzt» drills

- The builder: what (everything, words, forms and grammar, a situation, an area, my weak spots), which (a searchable list, each row with the learner's state: not started, in progress, strong), how (quick round, Nail it, test; hardest first). It opens a URL of the sitting contract.
- A «Nail it» sitting shows «12 of 20 nailed», says when the drill took only the hardest 30, and ends with a short summary; it resumes where it was left.
- A situation run shows a line answered right today as a line to read.
- «Bis es sitzt üben» on every situation page and grammar topic page with questions.
- Strings in all seven dictionaries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* «Which one is Zurich German?»: a wrong article names its noun; a form Zurich speakers use is never planted as wrong (tested)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Session bar: progress keeps its room, repeats shorten below 380px; audit measures the new answer moment

The top bar's progress bar keeps a minimum width, and the «+1 repeat» note
collapses to «+1 ↻» on the narrowest phones so 2/8 never pushes it off.
The responsive audit gains ONLY= to narrow to changed pages, measures a held
run step, measures a typed question as tiles before switching to typing,
and answers the meaning gate (after hydration) where a language shows it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Situation run: the reason for each wrong line is shown once, with the article's noun

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Situation run: what a step asks is the sitting's own small line above the question (one shape with practice)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Changelog 2026-12-03: the exercise revamp

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Plan test: new questions per sitting checked over 40 learners, not one lucky seed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* /practice: one picker — the quick round's mix sits under «Was willst du üben?» without a second «what / test» row

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Changelog 2026-12-03: plans (Free, Heidi Plus, own AI key, Organisations)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Lockfile: @bitbaum/paykit 0.6.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Heidi: «Was du kannst» answers next step, standing per area, what to do inside

The knowledge map (unlabelled dots in rows, lines that meant nothing) is
replaced by a page that answers, in order: one next step with its reason
and one black button; per area a segmented bar of lines that sit, wobble
and were never asked, with untouched areas collapsed to one line; inside
an area every situation, topic or word group with its bar, status word
and the action that fits it, sorted by what to do next.

The step comes from a pure planOf (lib/domain/progress/plan.ts) that the
personal page's card uses too, so the two never disagree. The map layout
module, its tests and the weak-spots card are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Questions: one standard for practice, runs and play

Every question now passes the same five rules, written down in code in
lib/domain/questions/standard.ts and checked by tests:

1. Ask only what a German reader doesn't get for free. A line that can be
   read straight off its German is read, not asked. «Chasch mer schnäll
   hälfe?» is now a line to read.
2. Wrong options are the same kind of thing as the answer. «mir» is offered
   with «wir», «uns» and «euch», never with «nirgends» or «übermorgen». The
   reading shelf no longer fills a short list with words of another kind.
3. A question must not be solvable without knowing Zurich German. Seven
   solvers that don't know the language (look-alike, longest, odd one out
   and others) may beat chance by at most 15 points per kind; balance()
   drops the questions that let them do better.
4. Feedback gives the rule, other lines with the same word, and a line
   where the word means something else. A later line of the run asks the
   word again (transfer).
5. Hardness is real: it is measured from the options.

Homographs: a word whose meaning depends on the line is asked only when
the line's German proves the taught meaning (provesMeaning). The «wo» cue
", wo" matched «Ah, wo denn?», where «wo» is the question word. That cue
is gone, and comma cues now end at a word boundary. This removes 5 false
proofs, including «wohin». The sourced Einsiedeln text now asks «cho».

Close is not wrong: choosing a look-alike that differs only by a form said
in another Swiss region («geit», Bern) gets «Fast», with where that form
is said. It is scheduled as FSRS «hard», not as a lapse. One rule,
lookalikeVerdict, decides this. A Standard German word stays wrong.

Questions are now chosen from ASKED_ITEMS, the items that meet the
standard. PACK_ITEMS still holds everything, so stored progress, glosses
and reminders keep working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Questions: rules that are rules, fair German-first words, spot, transfer

- A rule line appears only where there is a rule. The line «Merk es dir im
  Satz…» shown under every plain word is gone (ruleOf in
  questions/standard.ts). «mir» and «si» now carry how their line tells the
  two meanings apart (homograph-role, homograph-modal), with examples taken
  from course lines, in all seven languages. The pack names which rule
  applies to which homograph.
- Asked from German: wrong options come from the word's own group, are
  never rude, and look as much like the German word as the answer does. If
  the answer is the only word that looks like the German one, the word is
  not asked. Balance no longer keeps a kind's last question when a solver
  wins it.
- Spot never plants a mere spelling of the Zurich word («bestelle» for
  «bstelle», «gehört» for «ghört»). It never plants a lone word ending in
  «-en» either, since that can be found by its ending alone. The word is
  quoted without its punctuation.
- Transfer: a run asks a word at most twice. A homograph's second question
  goes to a later line that uses the other meaning, when the part has one
  («bi mir» after «Mir händ…»). A contrast question is never the first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-03 13:12:38 +01:00
CatoandClaude Fable 5.2 a7e1ee51e8 Heidis Rückblick: a review the learner asks for, once a week at most (#448)
* feat(coach): «Heidis Rückblick», a review the learner asks for, once a week at most

A review of the learner's own practice record, on the personal page. It runs
only on its button and not again for seven days: no timer, no page load and
no end of a sitting starts it.

- Facts are counted by plain code from the learner model (topics and
  situations missed most, what is due, how hard the questions were).
- Proposals are a closed list built from those facts: a grammar topic by
  itself, a situation again, the due reviews, one step easier or harder.
- One model call (`/api/coach`, free models or the learner's own key) gets
  counts and names and returns two or three sentences and an order; an id it
  made up is dropped. In gsw the sentences pass the variety check or are not
  shown.
- An account is counted per week in `usage_meter` (kind `coach-reviews`);
  without one the learner's record holds the date and a caller gets two a day.
- Without a model the same proposals show with a dictionary sentence.
- Declared on the privacy page (`pathReview`).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* fix(coach): the variety's name comes from the pack, not from the prompt

lib/variety/leak.test.ts refused the review prompt naming the variety and the
route comparing against its locale code. Both read the pack now.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-03 10:59:57 +01:00
CatoandClaude ffc2596393 Heidi: plans page, sign-up CTA, privacy choice to Settings (#440)
- /[locale]/plans: Free, Heidi Pass (highlighted), Organisations; 30 days | 1 year
  toggle with a saving badge computed from the env prices; questions a day read
  from lib/config/caps.ts; no price while sales are off, "Coming soon, get
  notified" keeps an address in the new pass_interest table (migration 0032).
- /pass redirects to /plans; the code field is under "Have a code?".
- Four first-party counts in usage_counts: plans views, sign-ups started,
  checkouts started, passes paid.
- Signed-out home: one primary "See plans".
- "Keep on this device only" moves from My space to Settings > Privacy.
- Header, phone menu and footer link "Plans".

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-02 22:40:05 +01:00
CatoandClaude e3d4c82f0b Heidi: pay QA follow-ups (checkout gate first, pass copy, redeem 404) (#438)
- POST /api/pay/checkout: 503 off right after sign-in while sales are off or no price is set, before the rate limit and any body validation
- pass lead split into lead / leadVoice / leadSame / leadModel; the voice sentence shows only when serverVoiceConfigured()
- POST /api/pay/redeem: unknown code answers 200 {ok:false,error:'unknown-code'} instead of 404; same UI message

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-02 21:20:38 +01:00
CatoandClaude 49222a3f84 Heidi: Bitcoin pass for individuals + AI usage caps (#436)
- paykit ^0.4.0 -> ^0.5.0 (the local Stripe copy was already gone); Stripe stays off
- HEIDI_SALES_ENABLED master switch, default off: not-on-sale state, checkout 503, no invoice; an invoice made while on still settles
- usage caps per person in Postgres: shared chat+speaking daily count, pass-period server voice seconds and dictation clips, free daily dictation (migration 0031_usage_meter, additive)
- separate pass model route by env (HEIDI_PASS_GROQ_API_KEY/_MODELS), default = free chain
- one primary button on /pass; pass copy no longer promises triple allowance
- docs/payments.md, .env.example, owner checklist updated

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-02 20:20:29 +01:00
CatoandClaude e7b6c27a20 Heidi: server read-aloud behind AI_PAID_DISABLED and caps (#434)
Gemini TTS is a paid call: refused unless AI_PAID_DISABLED=0 and
HEIDI_AI_PAID_OK=1, counted in ai-kit's spend ledger and usage log, and
/api/speak answers 503 with fallback so the page uses the browser voice.

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-02 18:59:42 +01:00
ce15bea20e Interests lead to practice and to texts written on request (#425)
The profile offers five more interests (food and cooking, family, work,
nature and weather, games and anime). Each interest has a field of the
course's own words and scenes, a hand list in the pack held by a test to
the vocabulary and the situations; a field under twelve words says so.

The reading page's «Zu deinen Themen» shows the field, links a practice
run of it, and on a press asks /api/reading/write for 5-8 sentences on
the topic or retelling the news of the day from SRF's public RSS feed
(headline and link shown, the article never copied). Every text goes
through the chat's gate (purified, doubtOf, one retry with
doubtCorrection) and is refused if it still fails; it is labelled as
written by Heidi and not read by a person, and counts against the chat's
daily allowance. Passed and refused texts are counted in usage_counts and
shown on the back office's visitor path. Nothing runs on a timer.


Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: forge merge bridge <forge@git.orangecat.ch>
2026-12-02 07:18:06 +01:00
CatoandClaude 48bb056e94 Every practice answer recorded per word and line (#422)
Per subject: how often asked, right, typed, time spent, last answered, and
the last wrong answer. Written in the one recorder (record.ts rule 5),
stored in the browser, synced as a summed progress key, shown on a word's
page in all seven languages, declared on the privacy page.


Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-02 00:56:33 +01:00
CatoandClaude 6c3e489161 The model sheet offers the pass as the third way, and says so to a pass holder (#415)
Beside the free models and the reader's own key, chatkit's sheet now shows
the pass with the pass page's own words (three times as much, a stronger
model whenever one is available) and leads to /pass. A reader who holds a
pass is told so instead (GET /api/pay/state, which reads nothing without a
session cookie). Every place the sheet opens passes the link.


Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-01 13:19:46 +01:00
CatoandClaude Opus 5.5 34973593ea Chat follows «auf Hochdeutsch, bitte»; mode divider; «Ich chunnsch» caught; pitch in the back office (#412)
* Catch «Ich chunnsch»; pitch materials in the back office; investor figures re-counted

- The check now flags the variety's own «du» form after «ich» (seen live:
  «Ich chunnsch leider nöd»), from the pack's verb tables, and the repair
  puts the «ich» form in. Narrow on purpose: a wider rule was wrong on
  Heidi's own texts (participles, prepositions, «Du» as a word).
- Overview lists the deck, the YC application draft, the financial model
  and cost per user (lib/config/pitch.ts); private until shared, and the
  OrangeCat room takes the deck only once it is marked shared.
- Investor figures as of 30 Nov 2026: 387 merged PRs, 2462 tests in 270
  files, the 29 Nov benchmark.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Chat follows instructions about what it just did; the transcript shows the mode

Seen 2026-12-01 in Translate: «shd bitte» came back as «Bitte schauen», and in
Talk a translated text was read as a request and declined.

- follow-up.ts: a short message made only of instruction words
  (dictionaries/retarget.ts) or a chip's own message is an instruction
  about the previous text: translated again into Swiss Standard German
  (repairBridge applies the bridge's certain fixes), another language, or
  said differently. A chip's question in Translate is answered as Talk.
- thread.ts: a translated text is marked as a text in the model's history
  (TEXT_MARK), and Talk after Translate is told what that means.
- Answer.intent / Answer.sentIn; the transcript draws «Ab hier: Gespräch»
  where the switch changed, and at once when it is flipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-01 09:17:12 +01:00
CatoandClaude Fable 5.2 9169618d3f Back office, second batch: German texts for every screen, access history, a weekly mail to admins (#410)
* WIP: access history, weekly digest and remaining back-office texts (helpers still working; not for review)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* WIP: German and English texts for Team, Geld, Qualität and the invitation page

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Access history on Team; the weekly mail reaches OrangeCat admins through the owner mailbox

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-30 20:47:20 +01:00
CatoandClaude da9d9560ec Back office, made safe: a link grants nothing until a button is pressed; removal sticks; invitations die with their inviter (#408)
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-30 08:32:56 +01:00
CatoandClaude Opus 5.5 c89a240672 Owner: one button mails a link to the owner address; no file to edit on the server (#405)
* Owner: one button mails a link to the owner address; no file to edit on the server

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Health: the schema check covers the tables added this month

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-29 21:21:48 +01:00
CatoandClaude 304338c617 Benchmark on request only: no background job spends the free AI allowance (#401)
Each run is about thirteen calls of the free model allowance the chat lives
on, and the fleet's rule forbids background AI spend. It runs from a button
on /owner; /models says so. The hourly call keeps the reminders.


Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-29 17:17:44 +01:00
CatoandClaude ec296f7e32 Cron: the hourly call the box makes now runs reminders and the benchmark (#399)
The box calls only /api/cron/channels for heidi. Reminders and the nightly
benchmark rode on /api/cron/reminders, which nothing calls, so neither ever
ran. Both now run after the channels sweep; the first benchmark runs at once.


Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-29 10:55:32 +01:00
CatoandClaude Opus 5.5 3879d58823 Owner door, team QR poster, the visitor's path counted, counts from the pack (#397)
* Owner: one page that always says the next step; counts come from the pack

/owner never answers 404: it says whether you are signed out, signed in
with another address, unconfirmed, or the owner, and what to do. The check
asks whether the address is the owner's before asking if it is confirmed.
The investor room's question and review counts and the warm-up's promised
length are tied to the content.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Team QR poster, the visitor's path counted, care page follows the pack

The team invite shows a QR code and opens a printable poster for the staff
room. Anonymous totals now count the visitor's path from home page to
answer, and from organisations page to pilot request; /owner lists them.
The care page lists every care scene the pack has.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-28 16:15:01 +01:00
CatoandClaude 87ce804fe3 A landing page for every business type, with a pilot request form (#396)
One template for all six sectors: the moment, the cost, what exists today,
the situations from the pack that fit, a pilot for that sector and a form
that is kept and mailed to the owner. The home page names more of what the
product covers and opens a door for organisations.


Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-28 15:35:31 +01:00
CatoandClaude b52d8073e7 Owner: a page that sends the confirmation mail for the owner address (#395)
The owner pages need a confirmed owner address and nothing could confirm
one. /owner/confirm sends the mail, to an OWNER_EMAILS address only.


Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-28 14:54:51 +01:00
CatoandClaude Opus 5.5 cb94dcbaaa Daily chat benchmark on /models; home page second pass (#392)
* Daily chat benchmark, and what the check is worth, on /models

Eight fixed messages through the real chat every night, and the texts to
be said in Zurich German also through the same models without Heidi; both
face the same rule check. The last seven nights are public on /models.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Changelog: the benchmark entry, above the pages entry

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Changelog: the home page's second pass

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Home, second pass: show the message in the hero, name the reader, shorten

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-28 12:02:17 +01:00
CatoandClaude 5c6e1dd1a5 Review: a welcome, a fourth answer, invitations and standings (#389)
A reader who was sent the link is told why, is not asked about themselves
before the lines, and can say 'fine, but I say it differently' without
calling a line wrong. Several readers of one line give it a standing for
the owner; ?via= tells one invitation's readers from another's.


Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-28 09:54:06 +01:00
CatoandClaude 7a7d9317f5 Native speakers check the situations line by line (#388)
None of the 793 scene lines had been read by a native speaker. A reader now
goes through a scene with three buttons per line and an optional better
wording, without an account; the owner reads the verdicts and corrects the
pack. Linked from the organisations page and from each scene's line list.


Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-28 05:54:32 +01:00
CatoandClaude Fable 5.2 d2c9559ef5 Which one is Zurich German? Look-alikes with the reason; anonymous totals (#387)
* Owner check: why the owner pages do not open, for the person asking

The owner was named on the server and still got 404 on the numbers, with nothing to tell a missing sign-in from an unconfirmed address from a different address. /api/owner/check answers that about the caller only, and never says who the owner is.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Exercises: a review comes back in another form

Simulated over twelve daily sittings, a learner who got everything right met 52 different questions in 96: half of every sitting was the identical question on its review day. What is due is the subject, so where the scope has a never-answered question about the same subject in a different form, that one takes the review's seat (Plan.reviewOf) and its answer moves the card that was due (recordAnswer, siblings), so a subject keeps one schedule. New questions also prefer subjects not met yet. After: 83 different questions in 96; with half the answers wrong, 48 subjects instead of 30.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Situations: ask the word that matters, near-miss options, claims last

Reported from a phone on 2026-11-28 as useless: a heard line asked as a whole is read off its German cognates, with wrong options that are unrelated lines, or as a claim that is the German read back. Now the line is asked through its least German-looking pack word, in its sentence, with the pack's own four meanings (WordAsk; once per run; no cognates), else as three meanings whose wrong ones are near misses (negation out, day moved, number changed; German word tables with the packs), and as a claim only when neither is possible. Recorded against the line's own item, as pickOf is. Also: pagesFor for chat wayfinding, and no second printing of the German after a true claim.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Situations: a right answer moves on by itself, as in a sitting

Reported from a phone: the situation run waited for «Wiiter» after a right answer while a sitting moved on by itself. The pulse and the beat lived inside Verdict; they are now useAnswered, used by both. Touching the answer holds it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* wip: build your own sentence in the chat

* Chat: build your own sentence; a link to the page a question asks for

The moment a learner cares most about a Zurich sentence is when they asked for it, and the chat let them copy it without one act of recall. «Selber bauen» hides the line, deals its words out of order and has them rebuild it by tapping (build-own.ts; only lines the check passed; nothing stored). And a question that is really asking for a page gets a link to it under the answer (pagesFor, drawn; answers to questions only). Measured on a Pixel 7 viewport in de and ru: the line is hidden while building, no overflow.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Situations: take your turn by tapping or by writing, your choice

How much effort is the learner's choice: the turn opens on the word tiles, and «Lieber schreiben» swaps in the same line as the pack's typed, self-marked exercise (BuildStep.write). Recorded against the built item either way; kept for the run. Played through on a Pixel 7 viewport: toggle present, field shown, no overflow.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Near misses: read all of them, keep the safe kinds, add the ones care lines need

Measured: 57 of 156 heard lines in the care scenes fell back to unrelated wrong options. Added guarded swaps (noch nicht/schon, nicht mehr/noch, zweimal/dreimal, Nachmittag/Vormittag, gut before a participle, colours and heiss/kalt with their endings). Then read all 235 generated options: about a third were broken German or gave themselves away, so kein→ein, heute/morgen/gestern, früher/später and einmal are gone and the negation, schon and gut are guarded. 128 remain; a test pins nineteen rejects and checks every option in the pack is tidy.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Anonymous totals: what is started, finished and answered wrong

Practice lives in the browser, so nobody could say whether people finish a situation or which question everybody gets wrong. Decided by the owner on 2026-11-28: count it, anonymously. usage_counts holds a day, a key and a count; a key is built from a closed vocabulary and checked on the server against the scenes and questions that exist (usage/keys.ts), so nothing a client types is stored. /api/usage always answers 204. Runs, sittings, each first answer and the chat's own-sentence exercise report; the owner's numbers show 28 days and the hardest questions. The privacy page declares the flow in seven languages.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* One care word that cannot be guessed, and why four others were not added

The care scenes were mined for opaque words. «Strähl» (Kamm) is one; «Dokter», «Hämp», «Rugge» and «parat» are read off their German, and asking about them made the runs measurably worse. Recorded in the pack so the next attempt starts from the measurement.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Situations: which one is the variety? The line among its look-alikes, with the reason

The promise is the right dialect, and no exercise trained telling it from what is almost it. A look-alike is the line with one word changed, made only from a pack rule read backwards (a leak for the written standard, a regional or house rule for elsewhere), and kept only if the gate refuses it. The German is the question; after the answer the screen says why each wrong option is wrong (Which.notes). 312 of 491 heard lines have one; unrelated-option questions fall from 96 to 56 (everyday) and 41 to 23 (care). Recorded against the line's own item. Checked on a Pixel 7 viewport in de and ru.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-28 05:05:01 +01:00
CatoandClaude d462e1c800 Owner check: why the owner pages do not open, for the person asking (#381)
The owner was named on the server and still got 404 on the numbers, with nothing to tell a missing sign-in from an unconfirmed address from a different address. /api/owner/check answers that about the caller only, and never says who the owner is.


Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-28 03:21:17 +01:00
CatoandClaude Fable 5.2 30ff73da06 Translate on a quarter of the prompt; keep-the-conversation line; one «Nur übersetzen» (#379)
* A capped paid fallback when every free model is busy; turn outcomes in health

HEIDI_FALLBACK_MODELS names models on the OpenRouter key that answer for everybody after the named free models and before the weak routed one. Off until named; then under ai-kit's kill switch, Heidi's opt-in and the daily paid caps, like the pass model. Its own provider id, because ai-kit drops a vendor's remaining links after a daily refusal, which is exactly when this row is needed. Never pickable or preferred. /api/health adds ai.turns: answered and failed since restart.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Dock: offer to keep the conversation after three messages

A dock conversation lives only in the browser, and the open chat stores nothing, so a learner who returns cannot be told from a new one and loses the thread on another device. After three learner messages one line says so and links to the full chat, which already adopts a draft into the account or offers sign-in. Measured on a Pixel 7 viewport in de, fr, ru: no overflow.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Translate: a compact prompt and a smaller reply budget

A free model accepts ~8,000 tokens a minute and a request counts its prompt plus the reply it reserves. With the full 16,700-character prompt and 2,400 reply tokens that is one request per model per minute. translatePrompt keeps the forms never to mix in, the spelling convention, the auxiliaries and the same JSON envelope, and drops what a translation never offers (grammar topics, next moves, tones, the written standard as a second variety): 2,767 characters plus the 1,345-character instruction, with a 1,400-token reply.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* «Nur übersetzen» under the newest answer only

Seen on a phone-sized screenshot: the button repeated under every earlier answer of the dock, each one resending an old line.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-28 01:14:23 +01:00
CatoandClaude Opus 5.5 6a32d7b76d Health: whether the OpenRouter key is free tier, and whether an owner is named (#376)
The owner opened /owner/models signed in and got 404: the server does not recognise the account as owner (OWNER_EMAILS / OWNER_ACTOR_IDS unset, or the address unverified). /api/health now answers the two bits needed without that page: ai.openrouter (unset / free-tier / credit / unknown; no amount, no key; asked every 10 minutes, 3 s cap) and owner.configured (a boolean, never who).


Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 21:53:56 +01:00
CatoandClaude Opus 5.5 e8018631cb Chat: translate or talk in one tap, a model you can see and pick, /models (#363)
- Two pills in the composer, «Übersetzen» and «Gespräch» (chatkit's
  `modes`), remembered in `heidi.chat.prefs.v1` and sent with every message.
  On Translate the turn gets an instruction that the text is to be carried
  across, never answered, and never declined for its topic
  (lib/domain/chat/intent.ts). Reported from a phone: four sentences about
  tariffs, pasted to be translated, were declined as political analysis.
- Under an answer in mode "answer": «Nur übersetzen» resends the line as a
  translation and leaves the composer on Translate.
- The dock gets the model chip (it mounted the sheet with no button). The
  chip names the model: own key, the free one picked, or the one that wrote
  the last answer.
- The sheet's free-model list is a picker; the pick only reorders the chain
  (`preferred`), and an id the deployment does not run is ignored.
- /models: each free model with what it did here, from every turn since the
  restart (lib/domain/model/stats.ts) and stored answers of 30 days.
- Privacy page declares the new store; /models in the layout audit,
  noindex and out of the sitemap.


Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 09:52:45 +01:00
CatoandClaude d4e9a58580 Pay in francs (card, TWINT), visible models, a daily limit with a way on (#362)
- A second way to pay for a pass: Swiss francs on Stripe's hosted page,
  where the Stripe account's methods (card, TWINT, wallets) are offered.
  Off until STRIPE_SECRET_KEY and a CHF price are set; each rail is on or
  off by itself. Stripe is told nothing about the Heidi account. Own
  webhook path, /api/pay/webhook/stripe. The provider is paykit's (PR
  bitbaum/paykit#19), copied in lib/pay/stripe-provider.ts until 0.4.0 is
  released, with a test that fails the day the package has it.
- /pass: one card per pass, a price and button per rail; buying is the one
  filled action. A failed checkout no longer prints "fetch failed".
- /owner/payments: each rail, what is set (names only), what is missing,
  and the webhook addresses to paste.
- Chat: a Model button for everyone; the sheet names the free models.
- A daily allowance of free turns (100, HEIDI_FREE_TURNS_PER_DAY), three
  times with a pass, none with an own key; the chat says so and links /pass.
- /pass added to the layout audit.


Claude-Session: https://claude.ai/code/session_019MDtmteJuDGFouA1itJ5tM

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-26 07:13:14 +01:00
CatoandClaude 59419a1063 release: places on every page, situations as guided runs, profile and Mein Bereich, modular code (#361)
* feat(profile): a learner profile, and a personal page that answers three questions

One profile model as a view over the stores that already hold each answer;
the setup «Dein Profil einrichten», one question per screen; the profile
card on the personal page; «Wo stehe ich?» and «Nutze ich Heidi gut?»;
progress kept with the account by default; reminders only when behind the
learner's own weekly goal.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* docs(profile): record the new sync default and the profile; audit the setup screen

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(profile): interests lead the listening

One more profile question, «Was interessiert dich?»: nine choices that name
the topics every row of the listening register already carries. The
listening page opens with the rows that fit, each saying which choice it is
there for and how much can be asked about it; «Nutze ich Heidi gut?» names
one of them when the thing to do is listen. Chosen in the browser, so the
page stays cached; stored as a field of the profile record.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix: an eight-character password floor, a localised investors door, page titles and four layout leftovers

- A new password needs eight characters (sign-up, change, reset), through a
  plugin the account package accepts; signing in with an older, shorter
  password still works. The message is in all seven languages.
- The investors door says «Passwort / Öffnen» in the reader's language.
- A failed sign-in, the unsubscribe page and the signed-in personal page
  have their own titles; a test holds every page to one.
- The kept sentence under a saved word is no longer hyphenated
  («Schlüs- / sel» at 320px).
- «Warum die Übungen so gebaut sind» is a closed row with a chevron.
- The account forms' primary button is black, like every other.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor(sync): the merge policy is a tested function; the profile says when sync failed

What one pull changes in this browser moved out of a useEffect into
lib/domain/progress/merge.ts (planMerge, decodeDevices, statusAfter), with
tests for every rule. The runner only fetches and writes.

A failed request and a 401 used to be swallowed; the personal page went on
saying progress was stored with the account. They are now reported through an
in-memory status, and the sync line shows when it last got through, that it
did not (with a retry), or that this browser is signed out (with the way in).

One deliberate difference: a device that holds no bridge/difficulty choice
no longer hides an older device's choice from a third one.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor(practice): one recordAnswer, a tested and resumable test run, exercise words by context

Items 2, 3, 7, 13, 16 and the practice and test screens of 12, which share files.

recordAnswer (lib/domain/practice/record.ts) is the one place an answer is
written into history, model, memory and the day. The sitting and the warm-up
wrote it out twice with different rules and the test a third time. Decided:
the first answer teaches (the sitting's rule); the day counts from the first
answer, so a warm-up left half way now counts (the sitting's rule won); a
test answer counts for the day only, kept on purpose and said why.

The test's draw and its stored shape are lib/domain/practice/test-run.ts,
tested. A run survives a reload (heidi.practice.test.v2, per course, on the
privacy page), keyed by sitting, with the clock held as a deadline.

practice-session.tsx 620 -> 217 and test-session.tsx 427 -> 146: state and
rules to use-sitting.ts, use-test-run.ts and lib/domain/practice/sitting-run.ts
(tested); LevelRow, UsedUp, the test's start and result screens, and the
warm-up's result are their own files.

The six dictionary slices every exercise read as props come from one
provider (exercises/words.tsx); the pages build them with exerciseWords().

heidi.voice.v1 is on the privacy page, so 'delete everything on this device'
removes it; privacy.test.ts now checks both directions.

The warm-up and the home page's speech bubble take the variety from the pack
instead of writing 'gsw', and the leak ratchet covers app/.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* revert(auth): accounts stay the package's; no password rule of Heidi's own

Sign-up and sign-in behave exactly as @bitbaum/accountkit defines them. The
eight-character floor added here as a local plugin is removed, with its
message and note; a rule about passwords belongs in the package, for every
app at once, or nowhere.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor(model): one chain, a tested judgeTake, and the speaking check says why it has nothing

Items 4 and 8.

lib/domain/model/chain.ts: modelChain() and ownChain() replace four copies of
usableChain(freeChain("HEIDI")), and hold the health tracker three routes
imported from the chat's route file. A test fails on a fifth copy.

lib/domain/speaking/judge.ts: the take's judgement (request reading, the
bridge/target gate, the model call, the gate on the suggestion) with tests
and an injectable model. api/speaking/take/route.ts 222 -> 45 lines.

The route's answer now says which kind of nothing it is (opinion), and the
screen reads the status too: a rate limit, a model that could not be reached
and a model with nothing to add each have their own sentence, in seven
languages. Before, all three printed 'Heidi has nothing to add right now'.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(shell): an error screen inside the site, and loading states where they cannot change a status code

Item 5.

app/[locale]/error.tsx: a page that throws keeps the header, footer and chat,
says so in the reader's language, and offers retry and the way home. Its five
words come from the layout through a small context, so the dictionaries are
not shipped to the browser.

loading.tsx is NOT at app/[locale]/, on purpose. It was added and measured: a
loading file starts the response before the page runs, so 9 of 22 probed
addresses changed status (every unknown page 404 -> 200, /account and /portal
307 -> 200). The same screen is instead the loading state of the six routes
that can only answer 200 (vocabulary, speaking, listen, profile, settings,
warmup), and a test fails if a loading file is put above a page that calls
notFound() or redirect().

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(a11y): the two modal sheets are real modals, and an accessibility pass over existing screens

Item 6.

The sitting's settings and the model connection claimed aria-modal on a plain
div with no focus trap. Both are now chatkit's Sheet (a native dialog opened
with showModal): focus stays inside, the page behind is inert, Escape closes,
and the opener gets focus back. A test fails on aria-modal anywhere else.

The pass, in code:
- the model sheet's close button was labelled with a multiplication sign; it
  is the package's labelled 44px button now (model.close, 7 languages)
- tap targets under 44px raised: the settings chip, saved words' export and
  clear, a take's delete, a failed chat bubble's retry, the word popover's
  button, the invite link's rotate
- a listening question marked the right option by outline colour alone; it
  carries the drill's tick and cross
- seven error lines appeared without role=alert (topics, rounds, recorder)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor(chat): one way to follow a conversation, and the dock in three files

Items 10 and 12 (dock).

chat.tsx, the dock and the group chat each scrolled a marker into view on
every change of the messages. That is now chatkit's useStickToBottom behind
one small hook (chat/use-follow.ts): the thread is followed until the reader
scrolls up, so a token or a message from someone else no longer pulls them
away from an older answer.

chat/dock.tsx 577 -> 235: the panel is chat/dock-panel.tsx (242), and the two
facts only a browser knows about the launcher (is it lying on a control, how
tall is it) are chat/use-dock-launcher.ts.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor: answer view, round list and chat workspace under 300 lines, with their logic in lib

Item 12, the remaining three.

chat/answer-view.tsx 421 -> 185: the glosses, the suggestions and the row of
buttons are their own files; what the row holds (ownRowItems) moved to
lib/domain/chat/row.ts with tests.

round-list.tsx 415 -> 216: the form to open a round is round-open.tsx; what a
viewer may do with a round (roundChoices) and the request a host's form
becomes (newRoundBody) are lib/domain/speaking/round-view.ts with tests.

chat/workspace.tsx 415 -> 263: the transport is a hook, the words handed to
chatkit's ChatApp are workspace-words.ts (tested in all seven languages), and
the offer to keep a browser conversation is adopt-prompt.tsx.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor(http): one id pattern, one organiser check, one audio-upload guard

Item 11.

The UUID pattern was defined in eleven files; it is lib/http/ids.ts.
organiserGroup was written out in the invite and the team route; it is in
lib/domain/groups/store.ts beside groupById. The bounded read of an uploaded
recording, copied between the two transcription routes, is
lib/http/audio-upload.ts with tests. A test fails on a second definition of
any of the three.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* chore: remove dead code and dictionary keys nothing reads

Item 15.

scripts/responsive-audit.mjs is superseded by scripts/audit/responsive.mjs,
which package.json's audit:responsive runs; nothing referenced the old one.

Exports with no reader anywhere (code, tests or scripts), found with knip and
confirmed by search: draftTransport, CowLockup, useHistoryView, recordFor,
Prose, countNewSince, isChannelId, isVideoId, lastChanged, moveId,
forgetInterest (account deletion removes those rows in erase.ts),
isObjective, stretchOf, essaysAbout. useTheme is used only in its own file
and is no longer exported.

36 dictionary keys whose name appears nowhere outside the dictionaries, in
all seven languages: home.{trustTitle,trustBody,trustLink,pillarsTitle,
methodLink,researchLink,contributeTitle,contributeCta}, pillars,
check.{failShort,noteTitle}, technology.directionLabel, privacy.updatedLabel,
contribute.{needTitle,needList}, auth.{portalLead,notSignedIn},
streak.goalLabel, practice.{correctIs,buildPrompt,verifyPrompt,typeLabel,
testAnswer,testDone}, essays.notTranslated, review.noneHint,
organisations.momentLabel, shell.{wordsTitle,wordsDue,wordsNone,wordsOpen,
courseSteady,resumeTitle,resumeProgress,resumeNone,resumeStart}.
Keys read by id (privacy.flows.*, chat.learn.*Label, feedback reasons) were
checked and kept.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(a11y): the modal sheet gives focus back to what opened it

Found in the browser: closing the model sheet with its close button left
focus on <body>. The opener was read in an effect, which runs after the
sheet's own effect has already moved focus into the dialog. It is read while
rendering now.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(shell): no focus ring round the error screen's heading

It is focused by the page so a screen reader starts there; the ring drawn
round it read as a text field.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor(components): one folder per feature under _components

The flat folder of 131 files is sorted the way chat/, exercises/, profile/,
session/ and speaking/ already were: shell, shared, home, languages, dialect,
dashboard, vocabulary, listening, channels, groups, rounds, sync, practice,
situations, warmup, voice, byok, auth, essays. Files moved with git mv; no
barrel files, as before.

The stores that are storage and nothing else (practice, focus, streak, warm-up,
video), the one write path for an answer and the API error wording moved to
lib/browser and lib/http. Tests that scanned or named the old paths follow, and
the two that read 'this folder' still read every component.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(listen): «Für dich» is the first thing under the title

The rows that fit a learner's interests, or the one card that asks for them,
sat below the diglossia warning. They now come straight after the title and its
lead; the warning, the day's picks and the whole register stay below.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* chore(i18n): drop footer.varietyName, which nothing reads

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* chore: remove four exports and three types nothing references

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(listen, profile): the interest tiles stay under the finger; the sync choice is one column on a phone

Found walking the release at 390px.

/listen: the first tile tapped in the invite card already makes a pick, and the
card turned into the list at that moment, with the tiles pushed below three
rows. The card now stays a card until «Fertig», and then the list is brought to
the top of the screen.

Mein Bereich, signed in: the two answers to the sync notice sat side by side
inside the profile card, some 130px each, and «Nur auf diesem Gerät behalten»
stood four lines tall. One column below sm.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(situations): the logic of a guided run through one situation

A situation was a reference list, and practising it was a random draw of
eight questions. This adds what a guided five-minute run needs, as pure
functions with typed results and no screens.

lib/domain/situations:
- planRun: every heard line in pack order with one question about its
  meaning, then up to two lines built from their words and said aloud,
  then the whole exchange again. Deterministic for a seed; a stored run is
  rebuilt from its step ids (heidi.situation.run.v2, per course, declared
  on the privacy page).
- situationProgress: followed x of y and new / started / followed / due,
  read from the learner model's line traces and the memory's due dates.
  A run's answers are recorded by recordAnswer; nothing else is stored.
- nextSituation, orderSituations: one recommendation with its reason, and
  the list with the learner's own situations first.

lib/situations: optional speaker, addressee, register, answers, reviewed
on a line and beats on a scene, with a validator test. Read from what the
packs and the reply questions already state (lines.ts); beats are written
for the fourteen scenes that were deepened by ten appended lines.

Fixes at the cause:
- a sitting on a scene no longer takes a quarter of its questions from
  the neighbouring scenes, and no longer asks a word inside a line of
  another scene;
- a wrong meaning in «Stimmt das?» is the same sentence type as the right
  one wherever the scene has such a line;
- the speaking task list can be held to one scene.

Strings for the future screens are under situationRun in all seven
dictionaries.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(design): every main page opens with a place, lists are rows, and a sitting ends as a moment

Shared primitives in _components/shared: Scene (a full-height photograph
with the page's one headline, one line and one action on it, white on a
shade in both themes), RowList/RowLink (lists as rows with hairlines, no
cards), SectionHeading, and Ending (one full-screen ending for practice,
the warm-up, the test and a used-up scope). The type scale is three roles
in globals.css: headline, subhead, kicker.

Home, practice, listening, speaking, the situations list, languages, about
and Mein Bereich each open with their own Swiss place, by day and by
night: 16 photographs from Wikimedia Commons, author and licence read on
each file's page and listed in lib/config/photos.ts (credits on the
Impressum). During an exercise the question stands alone, without a box.
Motion is CSS only and off under prefers-reduced-motion.

Removes hero-photo.tsx and the card boxes around lists on these pages.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(situations): a situation is a guided run, and every ending hands on to one

A situation page was a reference list with «Üben» at the bottom. It is now
the opener of a five-minute run, one thing per screen:

- /situations/<id>: a photograph of the place, one sentence, lines and
  minutes, one button (start, or pick up at the step it was left on); the
  review state said once; the old list one quiet link away (./lines).
- /situations/<id>/run: each heard line alone with its one question, then the
  German; two lines to build and to say aloud with the speaking recorder held
  to this scene (played back, never marked); the whole exchange again without
  German, by speaker and paced; the shared ending with ONE next situation and
  its reason. Every answer goes through the one ledger; the place is kept.
- /situations: a run left half way pinned on top, the learner's own
  situations, then each domain, as rows with their state. The twenty-chip
  picker on /practice and the board of figures are this list now.
- The endings of practice, the test and the warm-up offer a situation when
  one is the learner's next step; the home page leads a new visitor to the
  warm-up; «Weiter: <situation>» on the home card and the personal page.
- The warm-up's pointer now holds: its own answers made the scene it points
  at read "started", so it was never recommended.

Design: during an exercise only close, progress and the question remain (the
sitting's name and choices are behind one button in the bar); kickers and
actions on one line at 390px; rows instead of boxes on listening, speaking,
grammar and vocabulary; on a wide screen the shade is only where the words
are. Openers with a crane, a scaffold or a flat sky are replaced, and the
situations open with their own places (Wikimedia Commons, credited in
lib/config/photos.ts).

The responsive audit walks a run through every kind of step to its ending.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(photos): the care briefs open on the lake, and the night opener has no cranes

The two pictures of the hospital were a dark office front behind a parked
car, and they opened every care situation. No better licensed picture of the
place was found, so the care scenes open on the lake by day and at dawn,
both already in the register. The blue-hour picture on the home page, the
practice page and the tram brief is replaced by one without building cranes
(Dark Blue Zurich, kuhnmi, CC BY 2.0, read on the file's page at Wikimedia
Commons). The tram brief keeps the tram's front on a phone and leaves the
car beside it out. The three unused files and their entries are removed.

The alt texts of the removed pictures go with the next commit, which
touches the same dictionaries.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(situations): a run is one part of a situation, about five minutes

A run through a whole situation was twenty-two steps, seventeen of them the
same «Stimmt das?». A run now takes one part: a beat where the scene has
one, about eight heard lines otherwise, with up to two lines to build, one
to say aloud and the replay of that part. The next run goes on with the next
part, read from the ledger (no second record); once every part has been gone
through, a run revisits the part with the most lines missed or due.

The brief says what the next run is (heard lines, minutes, part n of m), the
ending counts the part and, while a part is ahead, its one next step is that
part. Progress on the list still reads across the whole situation.

Questions vary: a «Stimmt das?» can be asked the other way round as three
meanings of the same scene, recorded against the same item, so one shape
does not come three times running where the line can be asked another way,
and the claims put to the learner are wrong about as often as right. The
claim is drawn as a claim, in its own labelled frame, not as the line's
translation.

Stored runs keep their shape; the replay's step id now names its part, so a
run stored before this is planned afresh.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(model): the free chain is built in one place, pass model included

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-26 03:58:15 +01:00
CatoandClaude 28e9950014 Pass codes, a pass that buys a stronger model, and passes for organisations (#360)
A pass changed one number nobody reaches, was sold only for Bitcoin, and
was switched off. This makes a pass worth having and gives an organisation
a way to get one for each of its people.

- Pass codes (lib/pay/codes.ts, drizzle/0020_pass_codes.sql): the owner
  issues one code per person at /owner/pass-codes, each person redeems
  theirs on /pass. A code grants once, through paykit's extendEntitlement,
  and only its hash is stored. Needs no price and no OrangeCat.
- /pass takes a code whether or not passes are sold for Bitcoin; a pass is
  a pass without a price being set (hasPass no longer depends on one).
- The model a pass buys (lib/domain/model/pass-model.ts): one paid row in
  front of the free chain, named by HEIDI_PASS_MODELS, gated by ai-kit's
  spend rules. Off until configured; /pass promises it only then.
- Fixed: a pass tripled the allowance only in /api/chat. Saved
  conversations, where a pass holder writes, counted at the open rate.
- /organisations: a card for passes for a team, with a mail link.
- Wording in all seven interface languages; privacy page names pass_codes;
  account deletion keeps a redeemed code used and unattributed.


Claude-Session: https://claude.ai/code/session_019MDtmteJuDGFouA1itJ5tM

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-26 00:31:37 +01:00
CatoandClaude edf2cd32c5 release: informal address everywhere, engine clean-up, account limits, owner numbers (#358)
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-25 18:07:34 +01:00
CatoandClaude 38efcba8ed release: calmer shell, exercises that stay fresh, and the languages of Switzerland (#357)
* feat(practice): sittings that stay fresh, a level the learner moves, and a summary worth reading

Half of every sitting is new while the scope has anything new; reviews
that find no seat lead the next one. A question answered and not yet due
is not asked again, and a used-up scope says so and offers the wider
sitting. One question per word or line per sitting. The level of new
questions follows the learner's own setting (easier, just right, harder)
and moves by itself on a run of right answers or repeated misses, said in
a line with the way back. Five named modes over the existing kinds. The
end of a round names what was new, one thing to take away, tomorrow's
reviews and how far through the course.

Also: «Pack» is gone from what a learner reads, a typed answer is told
whether it counts with only the differing words marked, picked tiles are
outlined instead of filled, and the session screen cannot be double-tap
zoomed.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(shell): a calmer header, menu, footer and personal page; the languages of Switzerland; du in Swiss German

Header: on a phone the bar is the brand, the account and one menu control,
as plain glyphs. Language and light/dark moved into the menu sheet (and stay
in the settings and the footer); from 1024px the language stays in the bar
and its panel carries the appearance. site-header.tsx is 166 lines; the wide
bar is header-nav.tsx.

Menu sheet: rows with a line saying what is behind each page, one filled
action, language and theme at the foot. Footer: the menu's groups, said once.

Personal page: one action that names what it starts, one due line, three
facts (where you left off, course progress, your words) and everything else
behind one disclosure. Situations show their name, started ones only;
channels are grouped with dates as people write them; no filled status pills.

Languages: /languages and a home section from lib/config/languages.ts — one
available, the rest planned, no dates. A 'tell me' form stores address,
language, optional region, locale and time in language_interest (migration
0016, additive), rate-limited, listed on the privacy page, erased with the
account whose address it is. No confirmation mail is sent, and the form says so.

Feedback widget: drawn by the page (footer and menu entry, the widget's
data-fc-place=host contract) instead of a tab floating over the text.

Copy: Swiss German says du throughout; the German white paper and changelog
too. 'Pack' is gone from learner-facing text in all seven dictionaries.
French, Italian, Romansh and Russian still address the reader formally.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(practice): a takeaway that is true on its own, the answered states in the responsive audit

The summary's takeaway and its list of new things read a pair that holds
by itself (a gap's word is no longer shown beside its whole sentence's
meaning) and prefer the line furthest from German. A wrong answer keeps
one short part in sight (the reason, else the rule, else the word) and
folds the rest under «more on this». «Stimmt» is outlined like every
other picked answer. The responsive audit now opens a typed answer, its
comparison and a revealed gap, the states a phone reported cut off.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-25 16:53:18 +01:00
CatoandClaude 083dd52f0d feat(engine): courses in data, pack-declared forms, level sources, and meanings in the learner's language (#355)
* feat(course): every stored record names its course, and today's progress is the Zurich course's

A course registry (lib/course/registry.ts) lists the one course there is;
lib/variety/active.ts resolves its pack. Browser stores that hold course
progress move to an envelope keyed by course under .v2 keys, and a value
under the old .v1 key is read as the default course without being rewritten.
progress_devices, certificates and entitlements gain a course column that
defaults to the Zurich course. Item ids are unique across courses, and the
default course's ids are unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor(variety): the pack declares its articles, persons, respellings, voices and prompt lines

Article, FormLabel and VocabularyGroup were closed unions of the Zurich
values, the answer comparison folded Zurich respellings for every language,
word distance lower-cased as German, the voice ranking named two German tags
and the prompt builder carried Swiss spelling advice. Each is now a field of
the pack, read by the engine; a contract test over every pack refuses a value
the pack did not declare, and the leak test also looks for the taught
language's own words in engine code. The Ukrainian pack gains one verb with
its own pronouns and no articles. The 2,956 published items and the system
prompt are byte-identical.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor(practice): an item's level comes from a source the course chooses

A course entered from a sibling language measures each item's distance from
that language, exactly as before; a course entered from zero reads a declared
CEFR band on the word, the line or the topic. levels.ts exposes both as
LevelSource and picks by Course.entry. Every published item keeps its level.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(meaning): a meaning can be shown in the learner's language

A meaning is the bridge form plus an optional gloss in the interface
language. One pure rule (lib/domain/meaning/meaning.ts) decides what is
printed from the learner's answer to «Wie gut ist dein Deutsch?»: good shows
German only, as before and by default; some shows German and the gloss; none
shows the gloss; without a gloss German is always shown. Every exercise, the
word list and the scene pages print meanings through one component. The
answer is a course store, set in the settings and asked once after the start
card, only in an interface language that has glosses. Gloss sets are one
file per course and language, loaded on demand.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* content(glosses): English and Russian meanings for every word and scene line; French and Italian for every word

Machine drafts from the Zurich form and its German meaning together, marked
unreviewed in the data. One file per language beside the pack, keyed by the
German the course gives. Tests refuse a key no entry carries, an empty gloss
and two glosses for one German form; pnpm run glosses:coverage prints what
is covered.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* content(glosses): French and Italian meanings for every scene line

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* docs: courses, pack-declared forms, level sources and glosses, as they now are

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor(variety): the pack says which grammatical person each of its labels is

The gloss check and the prompt's auxiliary table, both new on main, matched
the Zurich labels «ich» and «er» by name. The forms pass of the leak test
caught it on rebase. The pack now declares personOf, and both read it; the
system prompt and the published items are unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-25 14:17:35 +01:00
CatoandClaude 300f598b05 feat(speaking): tasks, playback with pauses, did it get across, and the repetition ladder (#356)
* fix(speaking): a Standard German take is not corrected as dialect

The take route received no variety, so a Standard German sentence spoken
in the Standard German mode went through the dialect gate and the dialect
rewrite: "nicht" came back as a foreign form to replace with "nöd".

The client now sends the variety, the route stops before the gate and the
model for a bridge take, and the check button is offered in the dialect
mode only. Dialect mode is unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(speaking): a take stops by itself after two minutes, and the recorder reads what the browser did

lib/domain/speaking/recording.ts holds the capture constraints, the limit
and the stop decision. Noise suppression and echo cancellation are asked
off; automatic gain stays on because, measured, speech 40 dB down reads
-52.8 dBFS with gain off against the -45 floor and would be refused. The
take is kept as an in-memory object URL for the learner's own playback,
never stored or sent, and revoked on the next take, reset and unmount.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(speaking): the pure halves of playback, tasks, the meaning check, the ladder and the one next step

timeline.ts turns pause spans into bar segments and a tap into a time.
tasks.ts builds tasks from the situation packs' "say" lines, shown as their
meaning. meaning.ts reads a yes/partly/no verdict and holds its missing
points to the task's own. ladder.ts adapts a signal measurement to
speechkit's attempt and reports a rate trend only when there are words.
advice.ts picks one next action. A take's limit may be shorter than the
ceiling. No pronunciation score anywhere.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(speaking): hear your own take again, with your pauses drawn on the bar

take-playback.tsx plays the take from the page's memory in both varieties,
draws the measured pause spans as lighter stretches and seeks on a tap or
an arrow key. Nothing is sent, stored or rated.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor(speaking): the practice screen is a composition of pieces under 300 lines; an engine nothing called is removed

No behaviour change. speaking-practice.tsx (995 lines) becomes a 130-line
composition over _components/speaking/*: use-take, use-heard and seven
views, moved with their comments. The wired tests read the pieces as one
text. Deleted, unused outside tests: feedbackFor and Feedback, and the
typed-text mapping in lib/voice/correction.ts (corrections,
canCorrectVariety, Origin, Silence, CorrectionResult) with its test.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(speaking): a take can answer a task, is told whether the meaning got across, and gets one next step

Tasks come from the situation packs' "say" lines, shown as their Standard
German meaning. The verdict (yes, partly, no, and the first missing point)
rides in the dialect take's existing model call on the typed sentence; in
Standard German it is one call on request, about the meaning only. The
route finds the task by id, so no task text arrives from the browser.
advice.ts picks one next action; "Nochmal, kürzer" climbs speechkit's
pocket ladder and the recorder stops at the step's limit. The task's own
line is shown after the attempt: a labelled machine voice in Standard
German, text only in the dialect, where the pack has no voice. Takes gain
optional variety, taskId, ladder and meaning. No pronunciation score.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-25 14:09:27 +01:00
CatoandClaude e1e36ac0e0 feat(listening): a lesson is one clip, asked in one order, with questions that cannot be answered by matching words (#354)
* feat(listening): machine text of dialect speech gets one question about the whole

A detail question is keyed to one transcript line. Where that line was
written by a recogniser that does not return the spoken variety (the pack
records 25.6% word error rate, and the text comes out in the bridge), the
key can be wrong. lib/channels/policy.ts decides the scope; the questions
route, the stored shape and the lesson honour it. Stored sets gain version,
scope and variety; older ones are written again on the next open.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(listening): options may not copy the transcript, and questions are written about one clip

A right option sharing four consecutive words with its evidence line, or a
wrong option that stands in the transcript word for word, turns listening
into matching strings: such a question is refused, generation is tried once
more, and what is left of the fuller attempt is kept. lib/channels/clip.ts
picks one contiguous 30 to 90 second stretch after the opening 20 seconds;
the model reads that stretch only and cites the transcript's own line
numbers.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(listening): both players are held to the clip, and the audio controls no longer wait for an event that already fired

The players gain bounds and a replay from the clip's start; playback stops
once, on the way through the clip's end, so a later line tapped on purpose
still plays. The audio hook reads readiness from the element: its metadata
can arrive before React attaches a listener, which left the controls
disabled.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(listening): the lesson follows one order, names key words first, and shows the transcript after the attempt

lib/channels/lesson.ts is the stage reducer: gist question before the first
listen, a second listen with detail questions where the scope is full, a
replay of the line after each answer, then a count and the lines to hear
again. The transcript opens by itself only at the end and on request at any
time. lib/channels/keywords.ts names up to three pack words whose Standard
German form stands in the clip, without a model call. video-lesson.tsx is
split into wiring plus lesson-before, lesson-question and lesson-summary.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-25 13:25:57 +01:00
CatoandClaude 2991a50ca4 feat(listening): machine text of dialect speech gets one question about the whole (#351)
A detail question is keyed to one transcript line. Where that line was
written by a recogniser that does not return the spoken variety (the pack
records 25.6% word error rate, and the text comes out in the bridge), the
key can be wrong. lib/channels/policy.ts decides the scope; the questions
route, the stored shape and the lesson honour it. Stored sets gain version,
scope and variety; older ones are written again on the next open.


Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-25 13:05:12 +01:00
CatoandClaude 28d5e9f214 feat(pay): a time-boxed pass, paid in Bitcoin to Heidi's OrangeCat project through @bitbaum/paykit (off until configured) (#294)
* fix(privacy): never show an email address as a person's public name

Sign-up asks for no name, so requireActor's `name || email` made the email
the display name of nearly every account. It was stored on speaking topics,
rounds, attendance and group members, and the topics board is readable signed
out: GET /api/speaking/topics returned the proposer's address.

- publicName(): the chosen name, else a stable '#XXXX' handle from the actor id
- migration 0011 writes the same handle over stored addresses (UPDATE only)
- public topic/round lists return an account id only to its owner

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(auth): account mail in the reader's language

The shared template is English only. Through accountkit's render slot, the
verify / sign-in link / reset mails are written in the language of the page
the link lands on (its callbackURL); locales without copy use German.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* fix(header): render the account control at request time in every build

authEnabled is read at module load, so a build without BETTER_AUTH_SECRET
prerendered every page with no sign-in control, and CI's layout audit
measured a header narrower than production's. connection() + authStatus()
make the header the same in every build; CI now starts with a throwaway
secret so the audits see the real header.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* fix(ui): one primary action on the home fold; dock off phone auth forms

- 'Jetzt testen' jumps to the chat, which on desktop is the column beside it:
  shown on phones only, leaving one primary button in the desktop fold
- the floating dock launcher covered the sign-in form's buttons at 390px;
  hidden on phone-sized account forms only (guarded list updated)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* fix(security): outbound fetches, feed parsing and upload limits

- channels: every feed/redirect/audio/transcript fetch goes through
  publicFetch (ai-kit validateFetchTarget per hop, 8 MB body ceiling); a
  signed-in user could previously make the box fetch internal addresses
- push: subscribe only accepts real browser push service endpoints
- sweep: one channel that throws is recorded as failed instead of failing
  the whole hourly sweep forever; entity decoder no longer throws or emits NUL
- a pasted transcript never replaces the publisher's/platform's
- feeds write at most 200 newest items (Postgres parameter limit)
- synced progress kept for at most 10 devices per learner
- transcribe routes refuse a declared oversize body before parsing it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* chore(packages): chatkit 0.23, plan bindings, experience ceiling, proxy.ts

- @bitbaum/chatkit ^0.23.0 (the registered release)
- package-plan: bindings matched to the code (createAuthMailer in mail.ts,
  ChatApp in workspace.tsx); experience ceiling set at zero
- the five dialect/transcript text boxes carry experience-exempt reasons:
  dictation would turn dialect into Standard German (HEIDI.md §6) or compete
  with the page's own recorder
- middleware.ts -> proxy.ts (Next 16 deprecation)
- drop the dead limitkit git allowBuilds entry (limitkit is on npm)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* docs(changelog): 2026-11-09

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(design): adopt @bitbaum/design-tokens faces and composition grammar

The type stack asked for Helvetica Neue, which only Apple ships: Windows drew
Arial and Android Roboto. Inter and IBM Plex Mono are now self-hosted from
the package (app/fonts.ts, generated by design-tokens-next-fonts, latin,
latin-ext and cyrillic), and composition.css is loaded. Heidi keeps its own
palette, as the package README asks of a product with its own brand. Also
the keyframes for the sitting celebration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(practice): ask what the learner needs Swiss German for

'Meine Situationen': a learner picks the situations they actually face, and
every practise button (Today, the dock, the welcome-back card) draws from
them through a new multi-scene scope (?scenes=a,b). One choice is the
ordinary scene scope; none is everything. Device-only, declared on the
privacy page. The signed-in home leads with it; the warm-up invite is a
quieter line under it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(home): shorter first screen, welcome back, a finish worth reaching

- home at 390px: 10,415px -> 7,270px; the personal moments stay without
  their paragraphs, society's moments move to /organisations
- a returning signed-out learner gets their next step above the intro
- the end of a sitting shows the day earned and the week filling (no score)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(voice): server voice when the device has no German voice

Read-aloud only used the browser synthesiser, so most Windows/Linux machines
said 'no voice'. /api/speak reads the line with a German Gemini voice
(GEMINI_API_KEY, already on the box): generateContent on
gemini-2.5-flash-preview-tts, then the interactions route on
gemini-3.8-flash-lite-tts; PCM wrapped as WAV; rate-limited, 600 chars,
small cache. The device's own voice is still tried first, the label stays
'german', and a failed server call reads exactly as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* fix(chat): 'sign in to keep it' keeps it without asking twice

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* docs(changelog): situations, voice, home

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(practice): choose your situations on /practice too

A signed-out learner has no signed-in home, so /practice is where they say
what they need Swiss German for. The tiles drop their decorative checkbox:
at 390px it left 94px for «Treppenhaus» and «Вечернее беспокойство»; the
fill and aria-pressed carry the state. responsive audit: 1386 renders, 0
overflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(practice): instant, unmistakable feedback on every answer

The right answer used to turn black whether or not it was picked, and
'wrong' had no colour, so a learner had to read the bar to know. Now:
the tapped option turns green with a tick or red with a cross (pop/shake,
off with reduced motion), the right one is outlined green, and the verdict
is a tinted strip with a varied word of encouragement. A right answer moves
on by itself after 1.3s (countdown on 'Weiter'; 'Warum?' holds it); a wrong
one keeps its explanation. A short vibration on phones. '3 in Folge' when
true. New correct/incorrect colour roles in light and dark.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(practice): no two sittings alike

orderSession takes a seeded random and uses it only where the order was
arbitrary (the alphabetical tie-break between equally due, equally weak,
equally fresh questions and kinds); every new sitting gets a fresh seed.
Options, word banks and matching columns are laid out afresh each time a
question is shown (present.ts), answers remapped. Same seed = same sitting,
no seed = the old order; due and weak items still come first (tested).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(practice): build the sentence, 'Stimmt das?', and a recognise-then-produce ladder

- build: the Zurich words of a line the learner says (3-9 words), shuffled
  with one stranger from the same scene, tapped into order, marked by the
  app (134 items). Production that is objectively checkable.
- verify: a heard line with a meaning beside it, true or not, one tap; false
  meanings come from the same scene (275 items).
- ladderOf: until a line is recognised reliably, recognition forms come
  first; afterwards production forms. A tie-break after schedule and
  pressure, never before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* docs(changelog): practice rebuilt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* style(practice): answer feedback in Heidi's own colours

No green: it belonged to no other screen. The feedback roles now alias the
palette: right is ink (the action colour, black / white in dark) with a
tick; wrong is the flag red the theme reserves for errors, as an outline on
the existing pale red tint rather than a red slab; the revealed answer is
outlined in ink. The verdict strip is neutral grey or pale red; the end-of-
sitting check and week cells are ink.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(practice): one measure of distance from German, and a level on every exercise

lib/domain/vocabulary/distance.ts classifies a Zurich word against its German
as same/close (incl. a dropped -ch/-n: au, no), rule (free once one of the
pack's sound correspondences is applied: Chind, chaufe), far (nöd, öppis) or
trap (the pack's mistakenFor: Estrich). The vocabulary page's 'guessable'
now delegates to it. levels.ts gives every generated item a level (1 like
German, 2 by a rule, 3 different) on source.level, server-side: 400 / 593 /
1964 of 2957.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(practice): skills and levels tracked; sittings move up a level as it holds

- kinds/meta.ts: what each kind tests (understand, words, sounds, forms,
  articles, produce) and its rung, in one Record typed against the kinds;
  the ladder's private list of kind names is gone.
- the learner model gains skills and levels axes (old records load); its
  axes are one MODEL_AXES list that observing, decoding and device sums read.
- frontierOf: level 1 until it holds (>=12 answers, <=20% missed), then 2,
  then 3; stretch ranks after schedule, pressure and ladder. Skills and
  levels report; they do not add pressure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(home): 'Was sitzt' — answers by skill and by distance from German

Right/missed counts per skill and per level, 'holds' on the same bar as the
level frontier, and the level the learner is working at. Counts, not a
score. Seven languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(listening): dialect podcasts get a labelled German rendering and questions

Measured 2026-11-09: no product or public model writes spoken Zurich German
in dialect spelling reliably (best ~46% words right); Whisper renders it into
Standard German at ~23% WER, mostly rewordings. So a dialect episode with no
publisher transcript is no longer refused: the opening minutes are rendered
by the existing recogniser and stored as transcript.source 'rendering',
labelled on every screen as German 'sinngemäss — nicht der Dialekt, wie er
klingt' (lang=de); questions are asked about content only. Nothing reads a
dialect form from it (HEIDI.md updated).

- channels followed by feed/app are matched to the register by name on the
  publisher's domain (lib/channels/spoken.ts), also at request time for
  channels followed before
- migration 0012 re-offers episodes stored as 'none' (UPDATE only)
- question prompt stays variety-neutral (leak test)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* fix(practice): what a walkthrough of every exercise found

Played a sitting end to end in a browser at 390px and fixed what read wrong:

- Self-check cloze said "which word is missing?" with nowhere to answer;
  it now says to answer aloud or in your head, then reveal.
- A word's "Why?" was the same advice for every word. It now follows the
  distance classification: close to German, a named sound rule with the
  pack's example (ruleBehind), or a word to learn.
- Match grids could be solved by shape (four "add an n" verbs) and could
  offer one meaning twice (Hoi/Salü = Hallo). Grids now mix closeness and
  hold at least two words German does not give away; tests pin both.
- A checked sentence build kept tile padding, scattering the words; it is
  now one line with misplaced words marked.
- Writing "nid" now notes the pack's house form "nöd" (preferredForms on
  the display projection; no component imports the full pack).
- The finish recap printed the German answer as the missed dialect word;
  recapOf gives both sides. "1 kommen nochmals" is pluralised in 7 languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(account): ask once about progress sync; finish the walkthrough fixes

Signed up and used a new account on two browsers:

- A new account synced nothing and said nothing; the switch lived only in
  settings. The signed-in home asks once (SyncOffer), either answer is
  kept; sync stays off until chosen. turnSyncOn/keepSyncOff are shared with
  the settings switch.
- «Meine Situationen» joins synced progress as the `focus` key, decoded on
  the server like every other key, and adopted on a device only where
  nothing is chosen. Privacy register and sync copy say so in 7 languages.
  Two-device check: device two shows the situations, is not asked again.
- Verification mail no longer says it "finishes" sign-up for an account
  that already works. The OrangeCat one-click sentence shows only where
  the button is (methods.signin).
- Chat footer shows the model's name (modelLabel), not the route id; a
  German reader's gloss is not repeated; chat asks ai-kit for light
  reasoning so the first words come sooner.
- compareWords no longer offers a typed word that matches one pack word
  as another's near miss.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(mail): account mail as laid-out HTML through mail-kit 0.3.0

The verify, sign-in-link and reset mails were plain text. They now carry the
fleet's one layout (@bitbaum/mail-kit renderMail): Heidi's red and cow mark,
a heading, one button, the sign-in code to type on another device, a note,
and a footer that says why the mail arrived. Dark mode follows the reader's
client. The plain-text version is unchanged and still sent alongside.
Security mail carries no unsubscribe (footer.unsubscribe: null), by design.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(mail): an opt-in evening reminder that is quiet by construction

One email when questions are due, off until the learner switches it on in
the settings (offered with progress sync on, since the server reads what is
due only from a syncing device).

- lib/mail/reminder-policy.ts decides, and errs toward silence: opted in,
  verified address, not on day one, 18:00 in their own zone, at most every
  other day, five or more due, not if they practised today, and none after
  three in a row went unanswered. Pure, with tests.
- The mail uses the fleet layout (@bitbaum/mail-kit renderMail): count, the
  streak only from two days, one real due line from the pack, one button,
  the reason it came, preferences and unsubscribe. Six languages; worded as
  a good moment, never as loss (HEIDI.md §3), with a test on loss words.
- One-click unsubscribe: List-Unsubscribe + -Post headers (RFC 8058) and a
  footer link to a page with one button (a GET changes nothing, so a link
  scanner cannot unsubscribe anyone). Signed, non-expiring token.
- mail_preferences (migration 0013), /api/mail/preferences,
  /api/mail/unsubscribe, /api/cron/reminders (hourly, CRON_SECRET).
- Privacy register: the preference row and the mail vendor.
- Checked end to end against local Postgres: sends once at 18:00, refuses a
  duplicate hour, refuses the next day, counts an unanswered one, unsubscribes
  from the page and from the one-click POST, rejects forged tokens.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* fix(account): deleting an account deletes the person; 404s lead home

Found by using Heidi as its users do (64-scenario run, then deleting a test
account and counting rows):

- Deleting an account removed the login but left the person's synced
  progress, reminder setting, language, conversations, group memberships,
  follows, push subscriptions and certificates in the database, attached to
  nobody. lib/domain/account/erase.ts now removes them in one transaction
  after the deletion succeeded (a wrong password erases nothing). A group
  they made passes to its longest-standing member; their group messages stay
  for the others, unattributed. erase.test.ts walks the schema and fails when
  a table with a person column is not handled. Verified against Postgres:
  wrong password 400 and nothing erased; right password, every row gone.
- Most unknown URLs (a typo, a removed page, /xx/…) showed Next's bare English
  "404" with no header and no way home, because the root layout lives under
  [locale]. app/global-not-found.tsx answers in the URL's or the browser's
  language and links home (experimental.globalNotFound).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* fix(settings): no reminder switch for accounts that share no address

A person who signs in with Google or GitHub through the shared sign-in shares
no email address with Heidi by design, so a reminder could never reach them,
yet Settings offered the switch and it did nothing. It is not offered now.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* wip: automated passes through paykit

* fix(dock): the bar never lies on a control, and the page ends clear of it

The Practise / Ask Heidi pill covered Start on /practice at 390px, the
password field on sign-in and the warm-up's Try it at 768px. It now checks
what is under its resting place and slides away while that is a control, at
every width. The footer ends one pill, its offset and the safe-area inset
higher, so the last row of links is never under it.

The lists the feedback widget's button sat on are marked data-fc-avoid,
which the widget honours.

Claude-Session: https://claude.ai/code/session_019MDtmsubNtjznXC5pMf4fD

* fix(mail): send as Heidi's own domain once it is verified, and say which sender is in use

Account mail carried the retired FleetCrown name in its From line. A sender
cannot be renamed on faith: mail from a domain the key has not verified is
refused. Heidi now asks the mail service which domains this deployment's key
may send from and uses heidi.orangecat.ch, then orangecat.ch, as soon as one
is verified; until then the shared sender stays. /api/health reports the
From line in use and the domains the key knows.

Claude-Session: https://claude.ai/code/session_019MDtmsubNtjznXC5pMf4fD

* fix(legal): the Impressum names the Heidi project, privacy gives each vendor's company and country, and the offer to care homes says where it stops

- Impressum: operated by the Heidi project (bitbaum), with the contact
  address; no person, no postal address, and no promise of one.
- Privacy: each company that answers messages is listed with its legal
  entity and country, linked to the page that states it; no row names a
  company twice.
- Organisations: a paragraph beside the offer says Heidi is for practising,
  not for the bedside, and that no personal or health details belong in it.

Claude-Session: https://claude.ai/code/session_019MDtmsubNtjznXC5pMf4fD

* docs(changelog): keep main's 10 November entries beside this branch's

Claude-Session: https://claude.ai/code/session_019MDtmsubNtjznXC5pMf4fD

* docs: the recipe for cloning Heidi into a sibling language app, and one source for the product name

docs/clone-a-language-app.md: what is config, what is content and what stays
in packages, in the order the steps happen.

The product name was written in five places; the share card, the title
template, the landing config, the manifest and the account mail now read
ASSISTANT_NAME, so a clone changes it once.

Claude-Session: https://claude.ai/code/session_019MDtmsubNtjznXC5pMf4fD

* fix(mail): the reminder carries the same verified sender as account mail

Claude-Session: https://claude.ai/code/session_019MDtmsubNtjznXC5pMf4fD

* wip: privacy row for passes

* wip: service test for the whole payment path

* feat(pay): a time-boxed pass, paid in Bitcoin to Heidi's OrangeCat project through @bitbaum/paykit

Off until a price is configured. When on: a signed-in learner gets an invoice
from OrangeCat through paykit, Heidi stores which learner it was for, and the
pass is granted once when OrangeCat's payment.settled webhook arrives or the
open checkout page's poll sees it paid. A pass triples the chat allowance.

Claude-Session: https://claude.ai/code/session_019MDtmsubNtjznXC5pMf4fD

* chore: keep package-plan.json's formatting

Claude-Session: https://claude.ai/code/session_019MDtmsubNtjznXC5pMf4fD

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-11 17:11:30 +01:00
CatoandClaude a3f1255010 Commercial readiness: accounts and sync, practice rebuilt with levels, walkthrough fixes (#282)
* fix(privacy): never show an email address as a person's public name

Sign-up asks for no name, so requireActor's `name || email` made the email
the display name of nearly every account. It was stored on speaking topics,
rounds, attendance and group members, and the topics board is readable signed
out: GET /api/speaking/topics returned the proposer's address.

- publicName(): the chosen name, else a stable '#XXXX' handle from the actor id
- migration 0011 writes the same handle over stored addresses (UPDATE only)
- public topic/round lists return an account id only to its owner

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(auth): account mail in the reader's language

The shared template is English only. Through accountkit's render slot, the
verify / sign-in link / reset mails are written in the language of the page
the link lands on (its callbackURL); locales without copy use German.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* fix(header): render the account control at request time in every build

authEnabled is read at module load, so a build without BETTER_AUTH_SECRET
prerendered every page with no sign-in control, and CI's layout audit
measured a header narrower than production's. connection() + authStatus()
make the header the same in every build; CI now starts with a throwaway
secret so the audits see the real header.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* fix(ui): one primary action on the home fold; dock off phone auth forms

- 'Jetzt testen' jumps to the chat, which on desktop is the column beside it:
  shown on phones only, leaving one primary button in the desktop fold
- the floating dock launcher covered the sign-in form's buttons at 390px;
  hidden on phone-sized account forms only (guarded list updated)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* fix(security): outbound fetches, feed parsing and upload limits

- channels: every feed/redirect/audio/transcript fetch goes through
  publicFetch (ai-kit validateFetchTarget per hop, 8 MB body ceiling); a
  signed-in user could previously make the box fetch internal addresses
- push: subscribe only accepts real browser push service endpoints
- sweep: one channel that throws is recorded as failed instead of failing
  the whole hourly sweep forever; entity decoder no longer throws or emits NUL
- a pasted transcript never replaces the publisher's/platform's
- feeds write at most 200 newest items (Postgres parameter limit)
- synced progress kept for at most 10 devices per learner
- transcribe routes refuse a declared oversize body before parsing it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* chore(packages): chatkit 0.23, plan bindings, experience ceiling, proxy.ts

- @bitbaum/chatkit ^0.23.0 (the registered release)
- package-plan: bindings matched to the code (createAuthMailer in mail.ts,
  ChatApp in workspace.tsx); experience ceiling set at zero
- the five dialect/transcript text boxes carry experience-exempt reasons:
  dictation would turn dialect into Standard German (HEIDI.md §6) or compete
  with the page's own recorder
- middleware.ts -> proxy.ts (Next 16 deprecation)
- drop the dead limitkit git allowBuilds entry (limitkit is on npm)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* docs(changelog): 2026-11-09

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(design): adopt @bitbaum/design-tokens faces and composition grammar

The type stack asked for Helvetica Neue, which only Apple ships: Windows drew
Arial and Android Roboto. Inter and IBM Plex Mono are now self-hosted from
the package (app/fonts.ts, generated by design-tokens-next-fonts, latin,
latin-ext and cyrillic), and composition.css is loaded. Heidi keeps its own
palette, as the package README asks of a product with its own brand. Also
the keyframes for the sitting celebration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(practice): ask what the learner needs Swiss German for

'Meine Situationen': a learner picks the situations they actually face, and
every practise button (Today, the dock, the welcome-back card) draws from
them through a new multi-scene scope (?scenes=a,b). One choice is the
ordinary scene scope; none is everything. Device-only, declared on the
privacy page. The signed-in home leads with it; the warm-up invite is a
quieter line under it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(home): shorter first screen, welcome back, a finish worth reaching

- home at 390px: 10,415px -> 7,270px; the personal moments stay without
  their paragraphs, society's moments move to /organisations
- a returning signed-out learner gets their next step above the intro
- the end of a sitting shows the day earned and the week filling (no score)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(voice): server voice when the device has no German voice

Read-aloud only used the browser synthesiser, so most Windows/Linux machines
said 'no voice'. /api/speak reads the line with a German Gemini voice
(GEMINI_API_KEY, already on the box): generateContent on
gemini-2.5-flash-preview-tts, then the interactions route on
gemini-3.8-flash-lite-tts; PCM wrapped as WAV; rate-limited, 600 chars,
small cache. The device's own voice is still tried first, the label stays
'german', and a failed server call reads exactly as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* fix(chat): 'sign in to keep it' keeps it without asking twice

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* docs(changelog): situations, voice, home

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(practice): choose your situations on /practice too

A signed-out learner has no signed-in home, so /practice is where they say
what they need Swiss German for. The tiles drop their decorative checkbox:
at 390px it left 94px for «Treppenhaus» and «Вечернее беспокойство»; the
fill and aria-pressed carry the state. responsive audit: 1386 renders, 0
overflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(practice): instant, unmistakable feedback on every answer

The right answer used to turn black whether or not it was picked, and
'wrong' had no colour, so a learner had to read the bar to know. Now:
the tapped option turns green with a tick or red with a cross (pop/shake,
off with reduced motion), the right one is outlined green, and the verdict
is a tinted strip with a varied word of encouragement. A right answer moves
on by itself after 1.3s (countdown on 'Weiter'; 'Warum?' holds it); a wrong
one keeps its explanation. A short vibration on phones. '3 in Folge' when
true. New correct/incorrect colour roles in light and dark.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(practice): no two sittings alike

orderSession takes a seeded random and uses it only where the order was
arbitrary (the alphabetical tie-break between equally due, equally weak,
equally fresh questions and kinds); every new sitting gets a fresh seed.
Options, word banks and matching columns are laid out afresh each time a
question is shown (present.ts), answers remapped. Same seed = same sitting,
no seed = the old order; due and weak items still come first (tested).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(practice): build the sentence, 'Stimmt das?', and a recognise-then-produce ladder

- build: the Zurich words of a line the learner says (3-9 words), shuffled
  with one stranger from the same scene, tapped into order, marked by the
  app (134 items). Production that is objectively checkable.
- verify: a heard line with a meaning beside it, true or not, one tap; false
  meanings come from the same scene (275 items).
- ladderOf: until a line is recognised reliably, recognition forms come
  first; afterwards production forms. A tie-break after schedule and
  pressure, never before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* docs(changelog): practice rebuilt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* style(practice): answer feedback in Heidi's own colours

No green: it belonged to no other screen. The feedback roles now alias the
palette: right is ink (the action colour, black / white in dark) with a
tick; wrong is the flag red the theme reserves for errors, as an outline on
the existing pale red tint rather than a red slab; the revealed answer is
outlined in ink. The verdict strip is neutral grey or pale red; the end-of-
sitting check and week cells are ink.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(practice): one measure of distance from German, and a level on every exercise

lib/domain/vocabulary/distance.ts classifies a Zurich word against its German
as same/close (incl. a dropped -ch/-n: au, no), rule (free once one of the
pack's sound correspondences is applied: Chind, chaufe), far (nöd, öppis) or
trap (the pack's mistakenFor: Estrich). The vocabulary page's 'guessable'
now delegates to it. levels.ts gives every generated item a level (1 like
German, 2 by a rule, 3 different) on source.level, server-side: 400 / 593 /
1964 of 2957.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(practice): skills and levels tracked; sittings move up a level as it holds

- kinds/meta.ts: what each kind tests (understand, words, sounds, forms,
  articles, produce) and its rung, in one Record typed against the kinds;
  the ladder's private list of kind names is gone.
- the learner model gains skills and levels axes (old records load); its
  axes are one MODEL_AXES list that observing, decoding and device sums read.
- frontierOf: level 1 until it holds (>=12 answers, <=20% missed), then 2,
  then 3; stretch ranks after schedule, pressure and ladder. Skills and
  levels report; they do not add pressure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(home): 'Was sitzt' — answers by skill and by distance from German

Right/missed counts per skill and per level, 'holds' on the same bar as the
level frontier, and the level the learner is working at. Counts, not a
score. Seven languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(listening): dialect podcasts get a labelled German rendering and questions

Measured 2026-11-09: no product or public model writes spoken Zurich German
in dialect spelling reliably (best ~46% words right); Whisper renders it into
Standard German at ~23% WER, mostly rewordings. So a dialect episode with no
publisher transcript is no longer refused: the opening minutes are rendered
by the existing recogniser and stored as transcript.source 'rendering',
labelled on every screen as German 'sinngemäss — nicht der Dialekt, wie er
klingt' (lang=de); questions are asked about content only. Nothing reads a
dialect form from it (HEIDI.md updated).

- channels followed by feed/app are matched to the register by name on the
  publisher's domain (lib/channels/spoken.ts), also at request time for
  channels followed before
- migration 0012 re-offers episodes stored as 'none' (UPDATE only)
- question prompt stays variety-neutral (leak test)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* fix(practice): what a walkthrough of every exercise found

Played a sitting end to end in a browser at 390px and fixed what read wrong:

- Self-check cloze said "which word is missing?" with nowhere to answer;
  it now says to answer aloud or in your head, then reveal.
- A word's "Why?" was the same advice for every word. It now follows the
  distance classification: close to German, a named sound rule with the
  pack's example (ruleBehind), or a word to learn.
- Match grids could be solved by shape (four "add an n" verbs) and could
  offer one meaning twice (Hoi/Salü = Hallo). Grids now mix closeness and
  hold at least two words German does not give away; tests pin both.
- A checked sentence build kept tile padding, scattering the words; it is
  now one line with misplaced words marked.
- Writing "nid" now notes the pack's house form "nöd" (preferredForms on
  the display projection; no component imports the full pack).
- The finish recap printed the German answer as the missed dialect word;
  recapOf gives both sides. "1 kommen nochmals" is pluralised in 7 languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(account): ask once about progress sync; finish the walkthrough fixes

Signed up and used a new account on two browsers:

- A new account synced nothing and said nothing; the switch lived only in
  settings. The signed-in home asks once (SyncOffer), either answer is
  kept; sync stays off until chosen. turnSyncOn/keepSyncOff are shared with
  the settings switch.
- «Meine Situationen» joins synced progress as the `focus` key, decoded on
  the server like every other key, and adopted on a device only where
  nothing is chosen. Privacy register and sync copy say so in 7 languages.
  Two-device check: device two shows the situations, is not asked again.
- Verification mail no longer says it "finishes" sign-up for an account
  that already works. The OrangeCat one-click sentence shows only where
  the button is (methods.signin).
- Chat footer shows the model's name (modelLabel), not the route id; a
  German reader's gloss is not repeated; chat asks ai-kit for light
  reasoning so the first words come sooner.
- compareWords no longer offers a typed word that matches one pack word
  as another's near miss.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(mail): account mail as laid-out HTML through mail-kit 0.3.0

The verify, sign-in-link and reset mails were plain text. They now carry the
fleet's one layout (@bitbaum/mail-kit renderMail): Heidi's red and cow mark,
a heading, one button, the sign-in code to type on another device, a note,
and a footer that says why the mail arrived. Dark mode follows the reader's
client. The plain-text version is unchanged and still sent alongside.
Security mail carries no unsubscribe (footer.unsubscribe: null), by design.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* feat(mail): an opt-in evening reminder that is quiet by construction

One email when questions are due, off until the learner switches it on in
the settings (offered with progress sync on, since the server reads what is
due only from a syncing device).

- lib/mail/reminder-policy.ts decides, and errs toward silence: opted in,
  verified address, not on day one, 18:00 in their own zone, at most every
  other day, five or more due, not if they practised today, and none after
  three in a row went unanswered. Pure, with tests.
- The mail uses the fleet layout (@bitbaum/mail-kit renderMail): count, the
  streak only from two days, one real due line from the pack, one button,
  the reason it came, preferences and unsubscribe. Six languages; worded as
  a good moment, never as loss (HEIDI.md §3), with a test on loss words.
- One-click unsubscribe: List-Unsubscribe + -Post headers (RFC 8058) and a
  footer link to a page with one button (a GET changes nothing, so a link
  scanner cannot unsubscribe anyone). Signed, non-expiring token.
- mail_preferences (migration 0013), /api/mail/preferences,
  /api/mail/unsubscribe, /api/cron/reminders (hourly, CRON_SECRET).
- Privacy register: the preference row and the mail vendor.
- Checked end to end against local Postgres: sends once at 18:00, refuses a
  duplicate hour, refuses the next day, counts an unanswered one, unsubscribes
  from the page and from the one-click POST, rejects forged tokens.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* fix(account): deleting an account deletes the person; 404s lead home

Found by using Heidi as its users do (64-scenario run, then deleting a test
account and counting rows):

- Deleting an account removed the login but left the person's synced
  progress, reminder setting, language, conversations, group memberships,
  follows, push subscriptions and certificates in the database, attached to
  nobody. lib/domain/account/erase.ts now removes them in one transaction
  after the deletion succeeded (a wrong password erases nothing). A group
  they made passes to its longest-standing member; their group messages stay
  for the others, unattributed. erase.test.ts walks the schema and fails when
  a table with a person column is not handled. Verified against Postgres:
  wrong password 400 and nothing erased; right password, every row gone.
- Most unknown URLs (a typo, a removed page, /xx/…) showed Next's bare English
  "404" with no header and no way home, because the root layout lives under
  [locale]. app/global-not-found.tsx answers in the URL's or the browser's
  language and links home (experimental.globalNotFound).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* fix(settings): no reminder switch for accounts that share no address

A person who signs in with Google or GitHub through the shared sign-in shares
no email address with Heidi by design, so a reminder could never reach them,
yet Settings offered the switch and it did nothing. It is not offered now.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12

* fix(dock): the bar never lies on a control, and the page ends clear of it

The Practise / Ask Heidi pill covered Start on /practice at 390px, the
password field on sign-in and the warm-up's Try it at 768px. It now checks
what is under its resting place and slides away while that is a control, at
every width. The footer ends one pill, its offset and the safe-area inset
higher, so the last row of links is never under it.

The lists the feedback widget's button sat on are marked data-fc-avoid,
which the widget honours.

Claude-Session: https://claude.ai/code/session_019MDtmsubNtjznXC5pMf4fD

* fix(mail): send as Heidi's own domain once it is verified, and say which sender is in use

Account mail carried the retired FleetCrown name in its From line. A sender
cannot be renamed on faith: mail from a domain the key has not verified is
refused. Heidi now asks the mail service which domains this deployment's key
may send from and uses heidi.orangecat.ch, then orangecat.ch, as soon as one
is verified; until then the shared sender stays. /api/health reports the
From line in use and the domains the key knows.

Claude-Session: https://claude.ai/code/session_019MDtmsubNtjznXC5pMf4fD

* fix(legal): the Impressum names the Heidi project, privacy gives each vendor's company and country, and the offer to care homes says where it stops

- Impressum: operated by the Heidi project (bitbaum), with the contact
  address; no person, no postal address, and no promise of one.
- Privacy: each company that answers messages is listed with its legal
  entity and country, linked to the page that states it; no row names a
  company twice.
- Organisations: a paragraph beside the offer says Heidi is for practising,
  not for the bedside, and that no personal or health details belong in it.

Claude-Session: https://claude.ai/code/session_019MDtmsubNtjznXC5pMf4fD

* docs(changelog): keep main's 10 November entries beside this branch's

Claude-Session: https://claude.ai/code/session_019MDtmsubNtjznXC5pMf4fD

* docs: the recipe for cloning Heidi into a sibling language app, and one source for the product name

docs/clone-a-language-app.md: what is config, what is content and what stays
in packages, in the order the steps happen.

The product name was written in five places; the share card, the title
template, the landing config, the manifest and the account mail now read
ASSISTANT_NAME, so a clone changes it once.

Claude-Session: https://claude.ai/code/session_019MDtmsubNtjznXC5pMf4fD

* fix(mail): the reminder carries the same verified sender as account mail

Claude-Session: https://claude.ai/code/session_019MDtmsubNtjznXC5pMf4fD

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 13:15:50 +01:00
Cato 00cdb3bb99 fix(mail): send as Heidi's own domain once it is verified, and say which sender is in use (#290)
Account mail carried the retired FleetCrown name in its From line. A sender
cannot be renamed on faith: mail from a domain the key has not verified is
refused. Heidi now asks the mail service which domains this deployment's key
may send from and uses heidi.orangecat.ch, then orangecat.ch, as soon as one
is verified; until then the shared sender stays. /api/health reports the
From line in use and the domains the key knows.

Claude-Session: https://claude.ai/code/session_019MDtmsubNtjznXC5pMf4fD
2026-11-10 13:02:09 +01:00
CatoandClaude 9b48fab680 chore(deps): bip-kit, limitkit, ai-forms and threadkit from the @bitbaum scope (#286)
Owner, 2026-11-06: the fleet's packages belong under the @bitbaum npm
organization (fleet docs/package-scope-migration-plan.md). Same code and
versions; dependency keys and import specifiers moved with
scripts/packages/rename-package.mjs from fleet.


Claude-Session: https://claude.ai/code/session_019MDtmvpWNTLxXNfwUHS7MD

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 11:46:47 +01:00
CatoandClaude a1e72bff25 feat(chat): /chat on chatkit's ChatApp (#226)
The full chat is now the fleet's chat app (@bitbaum/chatkit 0.18 ChatApp):
header, list as a drawer on a phone and a rail from 64rem with search and
Today/Yesterday/Earlier, rename and delete, New chat, Temporary chat, the
queue, Stop and the open conversation back after a reload. Heidi keeps its
transport, routes, words and answer view.

- transport: savedConversationTransport (signed in) or the streamed
  stateless /api/chat (signed out, temporary), mapped onto ChatTurn; Stop
  clears the unchecked half answer; a failure keeps its own sentence
- stores: httpConversationStore over /api/conversations with
  serverWritesTurns, rows mapped by fromRows; signed out, chatkit's device
  store under heidi.chats (declared in privacy.ts; delete-everything now
  removes a key's whole family)
- answer view under chatkit's answer (AnswerFooter in transcript.tsx)
- POST /api/conversations takes the title ChatApp derives
- the home box's or dock's thread is carried into the list (still going)
  or offered (older); signed in, device writing is offered to the account
- deleted: conversation-list.tsx, the hand-built header, drawer, sidebar,
  new-chat and restore wiring in workspace.tsx, conversationTransport,
  MenuIcon, the heidi-chat-scroll CSS


Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-27 12:35:57 +01:00
CatoandClaude 8a6f7a9a8a fix(chat): a sent message is shown once, and a turn with no answer says so (#225)
The solo and group routes return the reader's own stored row as well as
Heidi's reply; run() had already drawn the message optimistically and
appended the server copy too, so it showed twice, and with no reply it was
the only thing on screen. The stored row now replaces the optimistic one.
The solo route says answered:false when it made no reply and the transport
maps it to the failure bubble with Retry (groups keep silence). A ref gates
double submits.


Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-27 08:36:50 +01:00
CatoandClaude Fable 5.1 fb10722852 feat(chat): the answer feedback loop — thumbs, transcript export, nightly review (#205)
* feat(chat): the answer feedback loop — thumbs, transcript export, nightly review

Every answer in Heidi's chat now carries chatkit 0.14's thumbs. A thumb down
asks why in one tap (the reasons in all seven site languages) and the thumb
is kept in a new `chat_feedback` table through `POST /api/chat/feedback`
(zod, chat-rate limited, same-origin; a saved conversation's thumb needs its
owner, the browser-only draft's needs nobody). `GET /api/chat/review-export`
hands the fleet's nightly reviewer the saved conversations of the last day —
bearer `CHAT_REVIEW_TOKEN` compared in constant time, 401/503 as the spec
says, at most 50 conversations of 30 turns, no deleted ones, the gate's
verdicts as steps, the thumbs beside them, never an actor id, a name or an
address — with Heidi's scope read from her own system prompt rather than
typed twice.

The fleet's one row under an answer (Copy · Listen · thumbs) replaces the
second Speak Heidi drew on the explanation; her own Speak and its caveat stay
on the dialect lines, where which voice the device has is a claim worth
making. Migration 0009 via drizzle-kit; the export is tested against an
in-memory Postgres with Heidi's migrations applied.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

* test(chat): the no-database cases take DATABASE_URL away, not assume it

CI runs the unit tests against a Postgres service with every migration
applied, so the two "no database on this deployment" cases met a database
and got the 201 and the 200 they guard against. Each now removes
DATABASE_URL for its own duration and restores it; the routes read it at
call time, so the 503 path is what runs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-23 14:33:53 +02:00
CatoandClaude Fable 5.1 0bbab8b516 feat(channels): podcasts in the follow loop, a leak gate for the packs, French recorded as the next product (#204)
* feat(channels): podcasts in the follow loop, a leak gate for the packs, and French recorded as the next product

Podcasts. A podcast is RSS with an audio enclosure per episode — the same
shape as a channel's Atom feed — so the same sweep reads it
(lib/channels/rss.ts, source.ts: one Source/Item shape both platforms
project onto). A pasted publisher page resolves to its feed through the
page's autodiscovery link, an Apple Podcasts link through Apple's keyless
lookup; Spotify publishes no feed and the form says so. Every podcast and
YouTube row on /listen carries «Folgen», and the channels page suggests
the register's podcasts first. An episode plays in the browser's own
<audio> element (seek, back five seconds, 0.75× with pitch kept). Its
transcript is the publisher's where the feed links one (SRT, WebVTT, the
namespace's JSON); otherwise Heidi transcribes the opening minutes herself
with the bridge recogniser — the first six megabytes of the enclosure by a
Range request, once per episode, shared, labelled as automatic with how far
it reaches — and only when the pack trusts a recogniser for the bridge and
the register does not call the source dialect, where the recogniser would
translate rather than transcribe (§8). Migration 0009 adds kind, feed_url,
spoken and image_url to channels and the enclosure columns to items.

The leak gate. HEIDI.md's house rule — nothing outside the packs names the
variety — now has lib/variety/leak.test.ts behind it: every string literal
in lib/ outside the packs, the seams, the dictionaries, the register and
the deployment's own config is checked, and the count per file is pinned
to a baseline that may only fall. The baseline is the to-do list for the
next product.

French next. HEIDI.md §4 records the decision (French for Romandie first,
Ukrainian after, the French product not named Heidi) and the six-step
recipe that makes "now build it" a command: a pack, two seams, the UI
languages, the deployment's own facts, the leak baseline, a repo. The
roadmap carries it in both languages and ROADMAP.md.

Checked signed in, on a 390px viewport, against a local Postgres: sign-up,
follow a podcast (Echo der Zeit, page → feed) and a channel (@srfnews),
the lists, an episode, a video, settings. No overflow, no console errors.
1207 tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKRxpcVWoZwtg6Gfr9m6Rb

* fix(listen): two rows that clipped at 320px in Russian

The layout audit (`pnpm run audit:responsive`, de/fr/ru × 320/360/390 ×
light/dark, 594 renders) found two, both on /listen in Russian at 320px,
both the same shape: a word wider than the column the button beside it
left.

- The «Follow channels» card put its title and «To your channels →» in one
  row; «Подписаться» alone was wider than the 90px the arrow left. The card
  stacks below `sm` and goes back to one row from there.
- A source row's name sits in a two-column header beside «Folgen»; with the
  Russian button the name's column is 142px and «Wissenschaftsmagazin» is
  177px. The name may now break inside a word, but only when the word alone
  is wider than the column (`wrap-anywhere`; `break-words` leaves a flex
  item's minimum at the whole word).

After the change the same 594 renders measure 0 with overflow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKRxpcVWoZwtg6Gfr9m6Rb

* fix(auth): take accountkit 0.5.2, so signed-in pages see who is signed in

The signed-in walkthrough found every server component drawing the
signed-out state: accountkit's getSession() returned better-auth's raw
user, without the actorId Heidi's pages key on, while the API routes,
going through requireUser(), had it. The dashboard and «Your channels»
asked you to sign in while the follow itself worked.

bitbaum/accountkit#11 (v0.5.2) gives both readers one path. This pins it
and records the fix in the changelog.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKRxpcVWoZwtg6Gfr9m6Rb

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-22 19:31:29 +02:00
CatoandClaude 266e536b69 feat(channels): follow YouTube channels, get told about new videos, answer questions about them (#202)
The listening lab, built on the media that already exist. A learner follows
YouTube channels they watch anyway (a link, a video link or the @handle, or
one of the register's rows with what is spoken beside it); Heidi reads each
channel's public Atom feed — no API key — hourly on the box and inline when
the page opens, lists what is new since the last visit, and sends a Web Push
to the browsers that asked. Following rings for the next video, never the
back catalogue, and nothing here reminds anyone to practise.

One video is the lab's exercise in HEIDI.md's order: a gist question before
the first listen, three to five detail questions in the bridge after it,
each wrong answer answered with the line that was said and a button that
plays that second (IFrame API seek), then the transcript, tap a line to hear
it. A count with its denominator, no score. What was answered stays in the
browser (heidi.videos.v1) and feeds the streak.

The transcript is the platform's captions, in a language the pack accepts
(lib/channels/accepted.ts: the target, then sibling/roof bridges; never a
gloss language; automatic captions only where the pack trusts the
recogniser), and its source is printed every time: the publisher's,
automatic («bei Mundart oft falsch») or pasted. YouTube refuses data-centre
addresses the caption tracks often enough that the refusal is a first-class
state: the screen then shows the three steps to copy the transcript from
YouTube's own panel, and parsePasted reads that format, SRT and WebVTT.

Questions are written by the model from the transcript once per video, on
the first follower's request (never in the sweep — no background job spends
the free pool), refused unless every detail question cites a real line, and
shared with every follower.

Schema: channels, channel_videos, channel_follows, push_subscriptions
(drizzle/0008). Routes: /api/channels, /api/videos/[id]/{transcript,
questions}, /api/cron/channels (bearer CRON_SECRET), /api/push/*. Pages:
/channels, /channels/[video], a dashboard panel, a settings section, an
invitation on /listen. Seven dictionaries, privacy flows, HEIDI.md,
CHANGELOG. The box's hourly timer row is in loki's install-app-crons.sh;
CRON_SECRET and VAPID_* in .env.example.


Claude-Session: https://claude.ai/code/session_01RKRxpcVWoZwtg6Gfr9m6Rb

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-22 11:26:06 +02:00
CatoandClaude Opus 5.5 2093dd401a feat(accounts): Heidi has its own accounts; OrangeCat is one way in, not the only one (#191)
* wip(accounts): Heidi on @bitbaum/accountkit/auth (accountkit pin pending)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3

* feat(accounts): Heidi has its own accounts; OrangeCat is one way in, not the only one

Email and password, passkeys and two-step codes from @bitbaum/accountkit/auth,
with the shared screens in Heidi's seven languages. People whose first way in
was OrangeCat keep their actor id, so no row moves. next-auth removed; the
session secret falls back to the existing AUTH_SECRET.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-15 10:08:54 -07:00
CatoandClaude 5d5a9dff68 feat(chat): suggested replies — one tap sends the likely next message (#185)
After an answer that asks something back, or whose next step is obvious,
two to four replies sit under the LATEST answer, written by the model in the
reader's language; one tap sends it through the same `send` the composer
uses. From @bitbaum/chatkit 0.6 (bitbaum/chatkit#13).

- package.json / pnpm-lock.yaml: chatkit repinned 0.4.1 → 0.6.0
  (163c879, chatkit#13 merged). 0.5 and 0.6 are additive (heldAttachments,
  replies); nothing Heidi uses changed.
- respond.ts: REPLIES_PROMPT = chatkit's REPLIES_INSTRUCTION verbatim, plus
  two Heidi lines — the block goes after the JSON object, and never restates
  a `next` move. Off for groups (`suggestReplies: false`): a reply "in the
  person's voice" has no one person in a room, and groups render no chips.
- parse.ts: `extractReplies` takes the block out of the raw answer BEFORE the
  JSON is read, so it never reaches `text`, storage, history, copy or speech.
  On the variety's own site a reply faces the explanation's gate; a refused
  one is dropped. The streamed preview reads only `text` (test added).
- answer.ts: stored replies re-bounded by chatkit's own rule.
- answer-view.tsx / transcript.tsx: chatkit's <ChatReplies>, under the last
  answer only, never while a turn runs, never on a surface that cannot send.
- i18n: `chat.replies`, the row's accessible name, in all seven locales.

Fixed on the way:
- use-conversation.ts cleared the composer on EVERY send, so tapping a chip
  (and now a reply) threw away a half-typed message. chatkit's Composer
  already clears its own draft after a send, and only what it sent.
- chat.tsx subscribed to `useCompact()` and never read it (lint warning).


Claude-Session: https://claude.ai/code/session_01Mg5wrkfw95JWfmAz8yRT1j

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-09 05:58:01 -07:00
CatoandCursor 1bf6bd3c31 feat(practice): questions come back before they are forgotten (#153)
* fix(practice): no two-question tests, no giveaway wrong answers

- A scope offers a test only with TEST_MIN (10) markable questions;
  a test link below that opens practice of the same scope.
- Possession and wo-relative transform questions: wrong answers keep
  the same people and things, so only the dialect form decides.
- Split the whose lesson: possession only; new relative lesson for wo.
- Template docs: the no-giveaway rule.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(practice): questions come back before they are forgotten

- memory.ts: per-question schedule (REVIEW_STEPS 1/3/7/16/35 days),
  miss back to start, first answer per sitting only.
- orderSession seats due questions first (all of them, across kinds),
  then new, then resting.
- Practice and warm-up record; the test does not.
- Due today on /practice, due tomorrow at the end of a sitting.
- Stored as heidi.practice.memory.v1, declared on /privacy, synced
  (newest answer per question wins).

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 12:44:34 -07:00
CatoandCursor 25d45963c2 Heidi answers what you wrote last, Swiss German all the way through, and starting again is one tap (#146)
* fix(chat): Heidi answers the newest message, and starting again is one tap

- Render the model prompt ourselves: earlier turns marked as answered
  context, the newest message set apart. threadkit's flat transcript made
  «Pire» after three «Le Bilan» turns get a fourth «Le Bilan» sentence in
  4 of 6 live runs; none after.
- Heidi's past turns carry the dialect line she wrote; the draft route
  accepts it in history. Context capped at 20 turns on every surface.
- Prompt: answer only the newest message; a lone word asks about that word.
- decodeAnswer keeps mode 'answer' instead of collapsing it to 'understand'.
- One NewChatButton: phone toolbar above the chat, dock header icon, sidebar.
- Chats fit above the phone keyboard (interactive-widget + visualViewport).
- /chat gets a fresh key per request so the header's Chat link never
  re-renders the conversation just left; sidebar closes on Escape.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(i18n): Swiss German first, and Heidi explains in it in every conversation

- Language menu, footer and settings share MENU_ORDER: dialect first.
- A saved conversation follows the page's locale on every message instead
  of the one it was created in (stored locale is the fallback).
- Suggestion labels come from a closed list and render via the dictionary;
  tones are translated; 'bridge' is no longer printed as a label.
- Prompt: every 'english' field is written in the explanation language.
- forReader strips translations of dialect suggestions for readers whose
  locale is the taught variety.
- lang on explanation text is the reader's locale, not 'en'.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(i18n): a signed-in learner's language follows them to every device

Picking a language in the header, footer or settings saves it to the
account (new additive table `preferences`, migration 0006). Every sign-in
returns through /api/account/language, which puts the saved language into
the page the learner lands on. German stays the default; signed out,
nothing is stored.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(chat): the phone toolbar fits 320px in every language

«Nouvelle conversation» beside «Conversations» overflowed a 320px phone by
17px (layout audit, fr/chat). Both buttons now shrink to an ellipsis.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 07:13:08 -07:00