mirror of
https://github.com/bitbaum/heidi.git
synced 2026-12-04 08:57:34 +01:00
operator-2
14
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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> |
||
|
|
070d317c88 |
Exercises: reviews in another form; situations ask the word that matters (#382)
* 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 --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
37edcd8b99 |
Round two: situations, reading, dialects map, photographs, R2-ready media (#364)
* feat(dialects): one sourced register of dialect forms, and the language map's data The same twelve everyday items in seven Swiss German dialects, each form with the atlas map or article section it was read in (accessed 2026-11-26), Zurich's column read from the pack, and a cell nobody could read safely left «nicht belegt». The register lives with the pack (`family.register`), so the leak gate holds; `lib/dialects/` only resolves, compares and narrows. Re-reading the Kleiner Sprachatlas maps at full resolution corrected five cells: Basel and Chur say «eppis», Lucerne «mier», St. Gallen «hend» and «Chend»; Chur's butter shows Schmaalz beside Butter. The language map: swissBOUNDARIES3D (©swisstopo) coloured by the BFS typology «Sprachgebiete 2020»; the language figures moved to `lib/config/languages.ts`, with the Italian region counted correctly (121 municipalities, not 114). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * feat(dialects): an interactive language map opens the area, with profiles, comparison and a helper /dialect opens with one map of Switzerland: every Swiss German dialect area links to its page, the Romandie, Italian Switzerland and the Romansh region to a new language page each (/languages/fr, /it, /rm, one template: where, in BFS figures, what Heidi offers today, what is planned without a date, and the interest form). Under the map: the seven dialects a learner meets (where, three forms to recognise by ear against Zurich, what that means for following), the same words side by side, «which dialect am I hearing?», the message reader and every area by branch. Each area page opens with the same map, its area in red, and for the seven compared dialects the profile and the comparison with Zurich. The home page shows the map instead of the town dots and links it from its ways in; the languages page opens the language pages; both new kinds of page are in the sitemap and the responsive audit. Dictionary text was checked against the sources: claims without one («Lucerne sounds between Bern and Zurich», «asking again is normal») are gone, the superlative about Valais German is softened to what Wikipedia says. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * fix(practice): the stretch in a sitting stays a stretch A new question may be one band above the learner's level, and which kinds take the first seats is luck. With more kinds that have nothing on level 1 than kinds that do, luck alone could deal a beginner a sitting that was mostly one band too high: seventeen new situations moved the scene items around and one seed of the "fit" setting came out 3 of 8 on the level. While a kind still has a question on the nearest level, at most half of what one deal seats is above it. Seats are never left empty for it: once the nearest level runs out, the next band is the nearest. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * feat(situations): a purity gate over every line, and seventeen new situations THE GATE. `lib/variety/purity.ts` holds what we publish in the taught variety to three things the chat gate does not check, all read out of the pack: no Standard German word where the pack gives the Zurich form (leaks, correspondences, every one-word pair of the word list); no marked form of another dialect (the regional rules, each with a source); one spelling per word, the pack's. A test runs it over every scene line, the template validator over every hand-written sentence, and a third test holds the pack to its own spelling. What it finds in the 412 lines of 2026-11-25: 37 lines — 29 spellings («gschlaafe», «sii», «staa», «umstiege», «laufed», «nüüt» …), 5 Standard German words («Hauswart» twice, «Nachbar», «redet», «weg»), 4 Weinland «üs» — four words spelled two ways across scenes, and the pack itself writing seven words two ways (nüt/nüüt, gä/gää, lüted/lüüted, Aabig/Abig, blibe/bliibe, blibed/bliibed, gärn/gern) plus «do» for «hier» where every line says «da». Fixed at the cause: the pack's examples and leak suggestions, then the lines, then 29 hand-written question sentences. «gäng» was a Zurich word in the list; German Wikipedia names it a Bernese speciality and it is now a regional rule. «schwierig» is «schwirig» in the line and wherever the copy quotes it. THE SCENES, all `reviewed: false` with the pack: relative on the phone, pain in more detail, medication round, a new resident's first day, washing and dressing, the night round, the doctor's round and — new in this commit — a resident at the front door who wants to go home (care); pharmacy, post office, a repair with the Abwart, bank, Coiffeur, bakery, asking the way, Badi, a first evening at a Verein (everyday). The municipality scene gains a second beat, the permit renewal. Every beat now falls between two exchanges, not inside one. Words outside the pack were looked up in the Idiotikon register; the at-the-door scene records the columns. THE ORDER. The care list runs the way a day runs (handover, morning care, washing, meals, medication, pain, the doctor, visitors, the phone, the new resident, the evening, the door, the night); everyday runs the way settling in does, so a learner who says "I have just moved" is handed the way to the station, the municipality and the bank first. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * feat(reading): texts to read in Zurich German, held to one purity gate - /reading: a shelf of texts, easiest first. The course's own situation lines composed into short exchanges, and passages from the Alemannic Wikipedia's Zurich German pages, verbatim, each with page, revision, history link and licence (CC BY-SA 4.0). No text claims a review. - One gate for reading texts, purityProblems(text, pack): standard forms derived from the pack (paradigm rows, cognate headwords, correspondences, the article mapping, small leaks with a dialect ending, st where the course writes scht); other dialects' marked forms, each sourced; one spelling (house rules, shapes of other conventions, letters the course never writes, and words that fold onto the course's own written another way). A shelf-wide check keeps every word to one spelling across texts. - scripts/reading-harvest.ts lists and fetches all 375 pages of «Artikel uf Züritüütsch», gates every sentence and prints the counts the page shows; --verify checks each shipped passage verbatim against the revision it names. - A text is read in large type with pressable words (meanings only from the vocabulary, none guessed), then three to five questions, then the shared ending. Reachable from the menu, home, Mein Bereich and the end of a situation with a text of its own. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * fix(dialects): area pages lead with where the dialect is spoken; a thinner, legible map The map draws thin muted borders instead of white gaps, so its areas read in the dark theme too; a hovered area gets a red edge, a focused one a thick one; on the dialects page it is no wider than 56rem. An area page states where the dialect is spoken under its name rather than repeating the name in a profile below. «Not attested» is a quiet status rather than a form, and the Russian label is «нет данных»: the long one ran out of its column at 320 and 390px on the Basel and Graubünden pages (responsive audit). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * feat(glosses): every new scene line in English, French, Italian and Russian HEIDI.md says these four exist for every word, scene line and hand-written question text. The new situations arrived without theirs: 381 lines, 54% coverage of the phrases. All four are now at 792 of 792, drafted from the Zurich line and its German together, unreviewed like the rest of the set — and a test now fails the day a line is added without them, so the sentence in HEIDI.md is a gate rather than a hope. «Und wie chume ich dänn an See?» was answered «Nei, nur über d Brugg» — a no to a how. It is «Eifach über d Brugg». Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * fix(reading): the opener names the texts, and a number keeps its unit The /reading opener said «Alle Situationen», borrowed from the situations page; it now says «Alle Texte». In a text, «8 km» no longer breaks between the number and its unit; the words themselves are untouched. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * feat(design): legible in both themes, sharper openers, and a list of 37 situations that reads THE LIST. The short list of a learner's own situations (practice, Mein Bereich) printed every one a reason gives — fourteen for somebody in care — above the rest of the page. It shows five, from where the learner is (`previewOf`): finished ones drop off the front, the order never reshuffles, the one recommended next is always there. The full list opens with one line of links to its two domains, so the ward is not twenty-three rows down. THE OPENERS. A 16:9 photograph covering a phone screen is drawn about 1500 pixels wide; `sizes` said 150vw, so a DPR-2 phone was served 1200 pixels at quality 75 and it looked soft. It says 200vw and the quality is 85, one step each (`images.qualities` allows it). Bytes at 390px, DPR 2 / DPR 3: home 130 KB / 225 KB → 272 KB / 272 KB, practice 127 / 215 → 257 / 257, listen 99 / 194 → 240 / 240 — the whole 1600-pixel file at DPR 2 now. LIGHT AND DARK, measured at 390px over sixteen pages (solid text against its real background, focus on the first tab stops): every token pair passes. What did not: controls that cannot be used yet were drawn at 40–60% opacity — «Leichter» 2.7:1, a disabled «Prüfen» 2.7:1 in dark — and an answer that is out of the running was muted ink at 60%, grey on grey. They are muted ink at full strength now (4.5:1 or more on every surface). A wrong answer's words were flag red on its own tint, 4.4:1; they take the deep red ink (`--color-incorrect-ink`, 7.1:1; dark keeps its lifted red, 5.8:1). ALSO. The listening opener's button said «Zwanzig Minuten»; it says what it leads to, «Drei für heute», in seven languages. The six sectors on /organisations were a ragged stack of chips on a phone; they are a list there, chips from `sm`, in their own component. The Badi opens on the Strandbad picture already in the register. The responsive audit measures two of the new scenes. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * docs(situations): the short list and the domain links in HEIDI.md, and where each new word was looked up HEIDI.md §4 says how the list of situations reads with thirty-seven of them. The new scenes now name, beside the lines, the Idiotikon register entries their words outside the pack were checked against (volume, column), the way the at-the-door scene already did. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * merge: dictionaries keep the dialects and the reading namespaces; one entry per source Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * refactor(purity): one gate for every line the course prints The reading gate and the situations' gate become one module, lib/variety/purity.ts, with one API used by the situations, the reading shelf and the authored questions. It keeps the stronger checks of each: paradigm, cognate and inflection-derived standard forms, the scht rule, letters and diacritics the course never writes, the shelf-wide one-spelling check, the leaks, correspondences and word pairs, and the sourced regional rules. - The other-dialect list is one list in the pack's rules: the Bern and Basel forms the reading pack carried move there, deduplicated; the shapes of the standard language and of another spelling convention are the pack's houseMarks; the distinct spellings are one list. - The pack gave «Aache» as Wallis/Fribourg butter citing SDS 5/179. Kleiner Sprachatlas map 28 (SDS 5/179), opened today, prints no such form: Wallis «Aichu», «Aihu», «Öi(c)hu»; Sense «Ou(c)he»; «Aahe» in the south-west Bernese Oberland. The rule now says so. - The pack wrote «gsee» and «gseh» for one word; it now writes «gseh». - Reading: one situation text per scene from the current lines (36; the post-office scene has no word to ask about and waits); the harvest was run again against the one gate; «Villa Liebegg» lost one sentence («nachhär»), and --verify found all eight passages verbatim. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * fix(dialects): a readable map in dark, the map on the first screen, a row of sections that says it scrolls - The language map has its own colour roles (land, edge, hatch, water, hover) in globals.css; in dark the land is lifted off the page and the edges and hatches are light enough to count twenty areas. - From lg the dialect area's map sits beside its title (PageHeader `aside`), so 1280×900 opens on it; the area rows follow (MapAreaList). - The section rail fades the end that has more behind it and keeps the current chip in view, so a cut-off chip no longer looks like the last. - «Welche Mundart?»: on a phone the verdict rides along the bottom of the clues once one is ticked, with a way down to the reasoning (reduced motion respected). - Mein Bereich offers reading from the start, not only after a text. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * feat(photos): stronger openers, places for everyday scenes, and photographs ready for object storage Every photograph was rendered where it is used, at 390 and 1280, light and dark. Replaced: - station (practice, asking the way): the front was crossed by tram wires and parked cars; now the main hall (Dining Car from Wien, CC BY-SA 2.0). - the lake (reading, Mein Bereich, care): a strip of hills and grey water on a phone; now the Glarus Alps over Lake Zurich (Roland zh, CC BY-SA 3.0). - the dawn lake (dark of the same pages): an empty orange gradient on a phone; those pages now use the city at night already on the site. - the night sky on Über Heidi: haze over a dark strip; now the Blüemlisalp glacier under stars (Deralpinbergsteiger, CC BY-SA 4.0). New places: the Seebad Utoquai for the Badi, Butterzöpfe for the bakery, the Fraumünsterpost for the post office, the Erismannhof courtyard for neighbours, the laundry room and the Bünzli. Author and licence from each file's record at Wikimedia Commons; alt text in all seven languages. Served bytes: next/image now prefers AVIF; every opener at 390px DPR 2 is 58-162 KB (WebP at the same quality was up to 272 KB). A test holds each registered width and height to the file's own header. Object storage: NEXT_PUBLIC_MEDIA_BASE (lib/config/media.ts) makes every photo resolve to <base>/photos/<file> and gives next/image the host; unset, nothing changes. scripts/media/upload-photos.mjs uploads public/photos to an S3-compatible bucket with PHOTOS_S3_* settings named like Solon's: dry run by default, skips objects already there, SigV4 signed with node:crypto (checked against AWS's published example). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
110f6e5ab3 |
feat(progress): progress on every device (opt-in), and a certificate per situation (#131)
Sync: signed in, off by default. Each device stores only what it observed; the server keeps each device's records apart (progress_devices) and pages show the sum, so nothing is counted twice however often devices sync. Model: sum; history: union; streak: newest record, best of all; saved words: the newest list is adopted, so deletions stay deleted. Server-side, every value goes through the browser's own decoder and is stored normalised. Off removes this device's copy; 'delete everything synced' removes all. Certificates: issued by the server from synced progress with the same strengthOf the situation page uses, only at 'sure'. A public, noindex page per certificate shows the situation, date and what was measured; no name (one can be typed for printing and is not stored). The scope line says it is listening comprehension in one situation, not a language diploma. Migration 0004 (progress_devices, certificates); both in APP_TABLES. Privacy flows declared; the practice note now says 'unless you switch sync on'. Roadmap items move to the changelog. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
8e2455cea6 |
feat(situations): "I understand Swiss German at the doctor's" — per-situation strength (#111)
THE SENTENCE THIS EXISTS TO LET SOMEBODY SAY. Not a level, not a score out of
a hundred, not a streak: a bounded claim about a moment they will really be
in, checkable line by line, that they are free to disagree with.
Someone can be solid in a care handover and lost ordering lunch. That is not a
contradiction to be averaged away — it is the truth about them and the most
useful thing the product knows, because it says where to go next. A single
figure for "your Swiss German" would destroy exactly that.
AND IT FOUND A BUG THAT MADE THE WHOLE LEARNER MODEL A NO-OP.
`decodeModel` declared `raw: unknown`, and `Decode<T>` is `(raw: string) =>
T | null` — `createBrowserStore` passes `localStorage.getItem(key)` straight
in, unparsed. A function taking `unknown` structurally satisfies one taking
`string`, so it type-checked perfectly; then `typeof "{...}" !== "object"` was
true of every value ever stored and it returned `EMPTY_MODEL` on EVERY READ.
The learner model has never once survived a page load. Everything built on it
read an empty one: the focus panel, whose entire job is "what you keep getting
wrong", had nothing to be wrong about; the mastered panel could never say what
you can do now that you could not before. The dashboard was reported as
useless — "Heute nichts fällig. Kommen Sie morgen wieder … what am i supposed
to do wuith this infop" — and it was, structurally, because the record it
reads from was discarded between every render.
Nothing failed. `decodeHistory` next door takes a string and parses it
correctly, so sessions genuinely varied day to day and the one visible symptom
of a dead model looked like the feature working. The existing test passed
decodeModel OBJECTS — a contract the product does not use — so it was green
throughout.
`lib/browser/store-contract.test.ts` now round-trips EVERY store through
`JSON.stringify`, which is what the writer does. Mutation-tested: restoring the
old decoder turns it red.
WHAT WAS BUILT
`ItemSource` carries `line` — which sentence of the scene, not just which
scene. Without it the model knows only that twelve questions about the
handover were answered, which is equally true of twelve askings of one line
and one asking each of twelve. Only the second is understanding a situation.
Optional, because a `gaptext` passage spans several lines and is about none
of them; those count toward the scene and not toward coverage.
A fifth axis, `lines`, keyed `scene:index`. Absent from anything stored
before it existed, which decodes as `{}` — an existing learner keeps their
topic history and starts with no coverage.
`situation-strength.ts`: a line holds at two clean askings, has stuck at
three. Four standings — new, met, steady, sure. `sure` needs every askable
line holding AND two thirds of them stuck, so it cannot be earned in one
sitting with the answers fresh.
WHY A DENOMINATOR IS ALLOWED HERE, when `mastered.ts` refuses percentages
everywhere else. Its argument is exact: "there is no denominator that means
anything — the pack is not the language." True of Zurich German and false of
one situation, which is a closed set somebody authored. Ten lines, and we know
which ten. "You can follow nine of the eleven things said here" is checkable
because we print the nine and the two.
THE DENOMINATOR IS WHAT WE CAN ASK, derived from the generated items rather
than `phrases.length`. Counting lines that never become a question would put a
ceiling under 100% on every scene and quietly call it the learner's fault.
Measured: 14 situations, 10 phrases each, all 10 askable, 13–21 items apiece.
NO DATES ANYWHERE. `history.ts` states the rule — "no answers, no scores, no
timestamps. There is nothing here to reconstruct a study history from" — and a
per-situation practice calendar is exactly that. Durability is read from depth
instead: the session builder asks least-recently-seen first, so a third asking
is one the learner came back to. The spacing signal without the surveillance.
NOTHING IS FRAMED AS LOSS. §3's distinction is what is COUNTED (capability,
not consumption) and how it is FRAMED. No total, no average, no rank, and no
previous value stored — "down from nine" cannot be rendered from this data by
anybody, including us.
IT WAITS FOR STORAGE BEFORE CLAIMING ANYTHING. The server cannot see this
browser, so the first pass would tell someone who has mastered a situation
that they have not started it, then correct itself. Measured with a 60ms
sampler across a reload: two states, a neutral line then the truth, and the
words "Noch nicht begonnen" never appear for a learner who has.
Verified: verify exit 0 — 880 tests, 76 suites; audit:language 20 pages / 0
English; audit:responsive 58 renders / 0 overflow; all four standings and the
board driven in a real browser and screenshotted.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
c67d7596e0 |
fix(contact): publish an address that receives mail, and end 8 duplications (#103)
THE LIVE BUG. `CONTACT_EMAIL` was `heidi@fleetcrown.orangecat.ch`. `dig +short MX fleetcrown.orangecat.ch` returns NOTHING — it is the fleet's verified SENDER domain and accepts no mail — and that address was published on the legal notice, the privacy page, the contribute page and the data room: the four pages whose whole purpose is being reachable. Every message sent to it bounced, silently, for months. Nothing in the repository could see it: a send-only domain reads exactly like a working one from the inside. `lib/config/site.test.ts` now guards the domain against a hand-checked allow-list (with the `dig` command in the comment) rather than resolving DNS, because a contact test that fails on a plane is a test somebody deletes. It also refuses any `@*orangecat.ch` literal written outside `site.ts` — two pages had their own copy, so the site published TWO addresses and `site.ts` was authoritative for neither. The rest is the same fault in other clothes — one concept, several implementations, at least one of which had already rotted: - `_components/source-list.tsx` replaces SIX copies of the references footer. The paper's copy had lost `text-link`, so on one page in six the citations rendered a different colour, and no one could notice without two tabs open. `lang="en"` now travels with the component: a bibliography without it is an English leak that `audit:language` reports. - `lib/browser/download.ts` replaces two hand-rolled blob downloads. The second copy revoked the object URL synchronously — the exact Safari race the FIRST copy's comment describes and avoids with a timeout. A duplicate that had already drifted into the bug the original learned about. - `Section` (page-shell) gained `id`, `lead` and `border`, which is what ~22 hand-rolled `<section>` blocks were working around. `/method` was the THIRD hand-rolled section rail and now uses the shared `SectionNav`, making the comment in that file ("it was two") true again. `/privacy` had a LOCAL component named `Section` shadowing the import; `/technology`'s `Panel` was the same thing under another name. - `focus-panel.tsx` returned `null` when empty while being the FIRST entry in the dashboard's jump strip — a link to nothing. It renders an empty state. - `lib/browser/stores.ts` exports one `STORAGE_KEY_PATTERN`; the privacy test imported its own copy, which is why a renamed dictation key could match the code and fail the test. The key itself was `heidi:dictation:...`, invisible to the privacy contract's `heidi.` namespace. - `lang` attributes on the chat's dialect line and all three gloss columns, and `lang="en"` around `/investors`, which is `indexed: false` and so was never visited by `audit:language`. Verified: 839 tests, lint and typecheck clean, `audit:language` 20 pages / 0 English leaks, `audit:responsive` 58 renders / 0 overflow, `/de/method` screenshotted at 1280×900. Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
5e09a7ba5c |
Learning surfaces: navigable reference, scoped practice, two new exercise kinds, a learner model — and 3× the content (#90)
* feat(practice): scoped sessions, two new exercise kinds, a learner model, and enough material to stop repeating The complaint was that the questions repeat, the system is not smart, and the exercise code is one file doing four jobs. All three were true. REPETITION WAS ARITHMETIC, not scheduling: eight questions a sitting out of sixty-seven items means meeting the same ones within the week, and no shuffle fixes that. So: a second situations domain (`everyday` — the shop, the tram, the stairwell, the telephone, the lunch table), the short words no correspondence rescues (`grad`, `äbe`, `gäng`, `aalüte`), and paradigms for `si`, `gah` and `cho` built only from forms the packs already publish, so each table is a reorganisation rather than a new claim. `gsi` is in it because it carries every past tense in a variety with no preterite. practice items 67 → 136 scenes 6 → 11 lines 60 → 110 vocabulary 48 → 61 and the pool is no longer 76% one kind SCOPE is the spine. `/practice?topic=…&scene=…&group=…` filters the existing pool, so every reference surface now opens a sitting about ITSELF. It works because `ItemSource` already recorded where each question came from — the field built to make a wrong answer traceable turned out to make a pool addressable. A topic scope unions the topic's own examples with the real scene lines that turn on the same rule. NAVIGATION. `/grammar` was four screens with every topic expanded; it is now an index in two bands — the topics a sentence does not survive, and the ones it survives while you do not — with a page per topic carrying practice, previous and next, and the scenes where the rule actually occurs. `/vocabulary` gained a filter over both languages, jump links, a session per group, and the scenes each word is said in. TWO NEW KINDS, both objective, neither inventing language. `match` is four words and four meanings; `gaptext` is a four-line passage from a scene with three words lifted out and offered back — the word bank is what makes a passage markable in a variety with no settled spelling. A word-order exercise was considered and refused: this variety tolerates more than one order. SMARTER. A learner model in the browser, beside the kept words and for the same reason: it keeps Heidi from holding a record of what a person cannot understand. It reorders every sitting so the weak half leads and names the two or three areas worth going back to. No number is shown anywhere — the diagnosis points at the material, never at the person. Declared on /privacy and deletable from /settings, along with the seen-history, which had been undeclared since the exercises shipped. ENGINEERING. `lib/domain/practice/kinds/` — one module per kind plus a registry. Adding `match` had touched five places, one of them a bug shipped in the same commit as the feature. Four defects found by the new tests rather than by review: - two cloze items from one topic could share an id, so answering one marked the other asked and one of the two was never served again - the model's first smoothing let one wrong answer out of one outrank a topic missed nine times in twenty - the pack spelled `Chunnsch` in its showcase and `Chunsch` in a grammar example, against its own orthography note - four places still linked `/grammar#<topic>` after topics became pages, including the chat's grammar button — the product's main loop verify green (797 tests); responsive audit 522 renders, 0 overflow. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * feat(learn): three new grammar topics, 35 more words, three more scenes — and the renderers become modules Content, design and engineering, in one pass over the learning surfaces. CONTENT. Practice items 136 → 195 (67 at the start of this work), scenes 11 → 14, lines 110 → 140, vocabulary 61 → 83, grammar topics 8 → 11. - `question-words`, `indefinite-article` and `imperative` — each names something the packs had been teaching by example without ever saying it. `wänn` heard as German `wenn` turns a question into a condition; the article `es` is identical to the pronoun `es`; the polite imperative ends `-ed`, not `-en`. Every example is a line the packs already publish. - Twenty-two nouns WITH their articles, which took the article drill from 3 questions to 24. Gender is the error a German reader is least able to avoid, because it is carried by a word they never had to learn. Every row differs from German in the word too — the vocabulary test refuses a row whose halves match, so `Zimmer`, `Tür` and `Bahnhof` are deliberately absent. `s Tram` is the sharpest: Germany says `die Straßenbahn`. - `restaurant`, `at-work` and `school-parents`. The last aims at PARENTS, because kindergarten in the canton of Zurich is conducted in dialect — the electorate decided that in 2011 — so the people who cannot follow it are the adults. ENGINEERING. The renderers followed the generators into modules: `_components/exercises/` is one view per shape plus a registry, and `practice-session.tsx` went 1123 → 390 lines. A view now owns its whole question — prompt, controls, keyboard, verdict — which removes the last shared `item.kind ===` chain. That chain is not a style complaint: its fallthrough was the self-marked branch, where Enter means "I knew it", so adding `match` shipped a grid a single keypress answered correctly. Two registries now meet at the kind id, with a test in both directions, plus one asserting the session component binds no `keydown` at all — the structural form of "no shared handler to fall through". DESIGN. The matching grid was collapsing to ONE column on a phone, which put the four dialect words above the four German ones and made a matching exercise impossible to do — fixed to two columns at every width. And the situations lead and the grammar "where this comes up" line both described a care SHIFT, which stopped being true the day `everyday` became the first domain. verify green (800 tests); build 413 static pages; responsive audit 522 renders, 0 overflow. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
5f525eff9e |
feat(speech): evaluation that measures what it can and refuses what it cannot (#78)
* feat(speech): the rule that decides what a transcript may be evidence of
`lib/voice/correction.ts` arrived at the Swiss German case first and stated it
exactly: dialect recognition transcribes INTO Standard German, so a learner who
says a flawless Zurich sentence gets back `ist` and `nicht` and possibly a `ß`,
none of which they said. Judging their grammar from that bills the recogniser's
output to the learner.
What this adds is that the rule is not about Swiss German. It is about a
property that differs per variety:
A transcript is evidence about the speaker's WORDS only when the recogniser
returns the variety that was SPOKEN.
Stating it that way is what makes the surface safe to switch ON where the
property holds. Standard German recognition returns Standard German; the
transcript is then the learner's own words and grammar, vocabulary and speech
rate become measurable rather than invented. `evidenceFrom` answers `none`,
`meaning-only` or `words`, and a test asserts that a dialect recogniser at 0%
WER still answers `meaning-only` — accuracy was never the objection.
Three measures that need a transcript, and could not exist before it:
syllables.ts counts vowel groups. It was written with a digraph table —
au, ei, ie, äu — and the tests showed every entry was a no-op,
because German writes its diphthongs as adjacent vowels and the
group scan had already merged them. The list was machinery that
looked like knowledge, and it is gone. Its two real errors,
`Familie` and `Bayern`, are pinned AS TESTS so nobody reads the
measure as exact.
fluency.ts speech rate, articulation rate, mean length of run, silent and
filled pauses. The two rates together say what neither says
alone: equal articulation with unequal speech rate is somebody
who has the words and is hunting for them.
pause.ts one definition of a pause, imported by both halves. Two
thresholds would have the signal half and the transcript half
report different pause counts for one recording, with nothing
failing.
NO NORMS, and there will not be any. No table of what a B1 speaker's syllables
per second should be: applying one to an adult talking about a topic they chose,
on a phone, in a language nobody normed for this, is the false precision §8
forbids wearing scholarship. Every number is reported as itself and compared
only against the same learner's own earlier takes — which is also what makes the
syllable rule's consistent bias harmless.
Nothing here names a language and nothing here calls a vendor.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(speech): grammar findings, and the filter that keeps them the speaker's
LanguageTool rather than a model, for three reasons and the third decides it:
it runs on our own box (LGPL-2.1, a Java REST server, no vendor, no per-call
cost, nothing leaving the machine); it costs nothing per call, so grammar is
not rationed the way a model answer is; and it is the same KIND of thing as the
variety gate — a rule with an id, the same input giving the same output, and a
finding somebody can argue with. §6 exists because a model must not be the sole
judge of language the learner cannot audit, and that argument does not stop
being true for grammar.
THE FILTER IS THE FEATURE, not tidying.
The text came from a recogniser, so parts of it were never the speaker's.
Punctuation, capitalisation and spelling are the MACHINE's decisions — nobody
pronounces a comma and there is no way to hear a capital letter. A checker run
over the transcript flags all three happily, and every one of those findings
bills the recogniser's choices to the learner: the exact failure
`voice/correction.ts` names for dialect forms, arriving by a different road.
So TYPOS, CASING, PUNCTUATION and TYPOGRAPHY are dropped, and a test asserts
none of them can ever appear. STYLE and REDUNDANCY are dropped too — they are
opinions rather than errors, and redundancy is doubly wrong for speech, where
repetition is how people buy thinking time. What remains is what a listener
would actually notice: agreement, case, verb placement, confused words.
A second list excludes by rule id the rules that are right about writing and
wrong about speech, starting with the one that wants a capital at the start of
a sentence nobody capitalised. It is deliberately three entries long and is
meant to grow from watching real transcripts — a long list written up front is
guesses wearing the authority of a constant, and the fleet's own rule is that a
capability is observed, not declared.
Three findings maximum, in reading order. Somebody who has just recorded
themselves speaking a language they are bad at needs the few that matter and
the willingness to press record again tomorrow, not a marked-up essay.
Pure: the HTTP call belongs in a route; this file maps and filters. Proved by
mutation — admitting TYPOS to the allowlist fails the two tests that exist to
stop exactly that.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(pitch): task repetition, and a unit-economics model that admits what it is
TWO THINGS, and they are the same argument in different currencies: say what
is measured, label what is assumed, and never let the second wear the clothes
of the first.
TASK REPETITION (lib/speech/repetition.ts)
Nation's 4/3/2: tell the same thing three times, to a fresh listener each
time, in four minutes, then three, then two. Speaking rate rises across the
deliveries and hesitations fall — consistently, and replicated.
It is the right exercise for THIS product rather than merely a good one,
because the outcome the research measures IS `fluency.ts`. Speech rate and
hesitation count are not a proxy we invented for something we cannot see; they
are the published dependent variables, and we compute them from the learner's
own recording. There are very few closed loops like that in language learning.
What the evidence supports is kept apart from what it does not, per §3: the
rise WITHIN a session is the FACT and is what a learner will see here; that it
transfers to a task they have never told is the HYPOTHESIS, and it is the one
that would matter most. So the copy can say "you got faster at saying this"
and must never say "you got more fluent" — the first is measured, the second
is a claim about a person.
The clock is a parameter, with Nation's original and a phone-sized ladder both
named, because "we used 4/3/2" and "we used a scaled version of it" are
different sentences and only one is true here. And the ingredient a phone
cannot reproduce is stated rather than quietly dropped: the third is a NEW
LISTENER, which a speaking round has and a solo take does not.
UNIT ECONOMICS (lib/config/economics.ts)
`investors.ts` holds things true today that a reader can check. This is the
opposite kind of number — nothing here has happened — so it is a separate file
that says so, and every input carries where it came from.
CAC is not estimated. We have never spent a franc, so any figure would be
invented; what is computable is the CEILING it must come in under, which is a
testable target rather than a hopeful one. At the modelled inputs: CHF 10.20
contribution a month, CHF 127.50 LTV, CHF 42.50 CAC ceiling, payback just over
four months.
The headline is published beside its range rather than alone, because the
business turns on churn — LTV moves from 85 to 204 across plausible values —
and one figure invites belief where three invite the question worth having.
The sensitivity table and the headline call the same function; two
implementations of one formula is how a deck contradicts its own appendix.
`NOT_MODELLED` names the holes, which is where a model's credibility actually
lives.
The market is anchored on a published count and its sharpest fact is
composition, not size: the largest single foreign nationality in Zurich is
German — people who arrive with the bridge variety fluent, cannot follow the
lunch table, and are precisely who a German-teaching app cannot help.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(mobile): the chat void, 125 off-scale type sizes, and a voice that was never German
THE VOICE, reported by a listener: "it sounds like an English person speaks.
definitely not Swiss German."
`variety.ts` was right and the code ignored it. `pickVoice` returns null when
the device has no German voice, and `use-speech` then assigned that null and
spoke anyway — which makes every engine substitute the SYSTEM DEFAULT. On a
device configured in English that is an English voice reading Zurich German.
The comment two lines above the bug described the bug exactly.
It refuses now, with `no-voice` as a real state the control can show. Refusing
outright would have overridden a judgement that is the learner's to make —
"better than nothing" is a reasonable thing to decide about getting the WORDS —
so `speakWithoutGermanVoice` is an informed opt-in, off by default. The product
may not make that trade silently; that is what it was doing.
MOBILE, audited rather than eyeballed: every page, at 390px and 1280px, asked
for sideways overflow, elements past the viewport, tap targets under 44px and
text under 12px. Good news first — nothing scrolls sideways anywhere.
THE CHAT VOID. /chat was a desktop layout stretched: roughly six hundred
pixels of white between the greeting and the text box, which reads as a page
that has not finished loading and asks the least confident visitor to do the
hardest thing in the product first. The home page already had tappable
example prompts and the full-screen chat did not, so `Examples` moved into
its own module and both surfaces render the same one. Copying it would have
let the first thing a new visitor sees drift into two versions.
125 OFF-SCALE TYPE SIZES in 43 files — `text-[11px]`, `text-[10px]`, and a
`text-[9px]` nobody could read. Every one was a reasonable local decision and
together they were a type scale nobody owned. Swept onto `--text-caption` at
12px, the floor that survives a phone at arm's length on a tram.
A RATCHET, because the sweep alone buys a clean tree and the same problem in
six weeks: `tokens.design.test.ts` fails the build on any arbitrary font size
or hex colour in a className. It found the 9px and two 13px the sweep missed
on its first run.
The composer clears the home indicator via `env(safe-area-inset-bottom)`.
SECTORS, as data with its own honesty test. Care homes, hospitals, schools,
language schools, relocation and employers — the places where this is somebody
else's operating risk rather than their own problem, and where the person who
suffers it cannot buy the fix.
Every row is a MOMENT rather than a benefit, because a reader who has stood in
the room recognises the room and nobody recognises "improved communication".
Every row also carries `unknown`: the thing we would have to learn from them.
That is not modesty, it is what turns a page into a meeting — and a product
with no customers writing as though it has them is the most expensive mistake
available to it. A test asserts the copy never says customers, case study,
trusted by or proven, in either language.
The schools case rests on a fact worth having: Zurich voters made dialect the
kindergarten language of instruction in 2011, so expat parents are locked out
of their child's first school years by law. Cited to the canton.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(speech): the pack owns the language, and a vendor claim stays a claim
CONFIG-DRIVEN, which it was not.
`lib/speech/` measures syllables, counts hesitations and asks a grammar service
for findings, and §4's house rule is that nothing outside `lib/variety/packs/`
may name a language fact. Three were doing exactly that:
- the German syllable rule existed only inside a test
- the filler words existed only inside a test
- `SPEECH_LANG = "de-CH"` was a constant in the voice module, so a Lesya
build would have gone on asking the synthesiser for Swiss German
They are a `SpeechProfile` on the pack now — synthesiser tag, vowels, fillers,
grammar code — and the engine reads it. Swapping the pack swaps the behaviour,
which is the property the whole variety layer exists for.
`capabilities.asr: boolean` became `recognition: Recognition`, because the
boolean could not express the fact the entire speaking surface turns on: a
recogniser may exist, work well, and still answer in a DIFFERENT variety from
the one spoken. With one flag, "no ASR" and "ASR that translates the dialect
away" were indistinguishable, and the safe reading was to call it unavailable —
wrong in the other direction, since Heidi can understand dialect speech
perfectly well. She simply cannot write it down faithfully.
The bridge is declared separately and is why a speaking surface can exist at
all today: Standard German recognition returns Standard German, so a learner
practising the German they need at a doctor's desk CAN be told about their own
words. Zurich is diglossic and §9 already makes producing that half a product
output.
THE SECOND PACK EARNED ITS KEEP AGAIN. `дякую` is дя-ку-ю, and the syllable
rule said two: German writes diphthongs as adjacent vowels so merging them is
right, and Ukrainian has no diphthongs so merging is wrong by a third. That is
now `adjacentVowelsMerge`, declared per pack — a property of a writing system,
not a thing to infer per word. Nothing would have failed; the rate would just
have been wrong in a language nobody here reads.
A contract test runs the profile over EVERY pack, and asserts the two disagree:
same engine, different answers.
THE VENDOR CLAIM, recorded as a claim.
Swiss specialist vendors now sell dialect STT and TTS together, hosted here,
and at least one advertises transcription that keeps DIALECT TEXT rather than
translating into Standard German. If that holds it is not an improvement in
degree — it is precisely what `evidence.ts` says would make a transcript
evidence about a speaker's own forms.
It has not changed the pack, and a test stops it changing the pack. The figure
advertised is "97.4% dialect accuracy" with no test set named and no
independent evaluation, against a published honest baseline of 25.6% WER for
the entire field: a tenfold claim, unaudited, on a sales page. §7 already
records that most "Swiss German" speech technology is Standard German in a
Swiss accent, and §2 explains why a vendor's own label is the one thing that
cannot settle it — the learner is buying the variety because they cannot tell.
So `SpeechSystem` gained `verified`, claimed nowhere, enforced by a test. The
experiment that would settle it is cheap and nobody has run it: take the free
trial credits, feed it real Zurich speech, compare against a transcript a
Zurich speaker wrote. Then flip the vendor row, then the pack, then the test.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(speech): the experiment that settles the dialect claim, minus the key
"Do it for me" — so here is the instrument, and an honest account of the half
of it I cannot run.
THE CLAIM SPLITS IN TWO, and only one half is decidable by machine:
"returns dialect text" DECIDABLE. Feed it dialect speech and read which
variety came back. No ground truth needed, because
the question is about the VARIETY of the output and
not its correctness.
"97.4% accuracy" NOT DECIDABLE HERE, and nothing pretends otherwise.
A word error rate needs a transcript a Zurich
speaker wrote. Nobody here has one, and a WER
measured against a guess is a number with nothing
underneath it.
The first is the one that decides the product anyway: `evidence.ts` turns
exactly one boolean into the whole speaking surface. Accuracy decides how far
to trust the findings; variety decides whether there may be findings at all.
`dialect-marker.ts` settles it from the text. Not the §6 gate, which hunts
forms from the wrong DIALECT and would wave a Standard German transcript
through clean — but the commonest function words, isch/ist, nöd/nicht,
gaat/geht, which appear in almost any sentence either variety produces and
therefore make ten seconds of audio enough. They live in the pack, so the
instrument knows no language of its own; a test inverts them and watches the
same sentence read the other way round.
`unclear` is a real verdict. A clip with no markers gets `null` rather than
`false`, because "we could not tell" and "it translated" are different answers
and only one of them is about the vendor.
Checked against sentences written for the PRODUCT rather than for the test —
the pack's showcase line and the real chat prompts — since an instrument that
could not see those as dialect would not have seen a transcript either.
WHAT I COULD NOT DO, plainly:
- I cannot listen. §7's test is "listen before believing a label" and I have
no audio perception at all. Judging whether the VOICE is really dialect is
thirty seconds for a person and impossible for me.
- I could not complete a signup needing email verification, and did not put
payment details anywhere.
- The vendor's sandbox is synthetic, so it cannot answer a question about
real dialect. The runner refuses an `sv_test_` key rather than producing a
confident worthless result.
So `scripts/verify-dialect-asr.mjs` takes a live key and a real Zurich clip and
prints the verdict, naming the three files an affirmative answer would
authorise editing — pack, register row, and the test that currently forbids
both. The claim stays a claim until somebody runs it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(organisations): the page for people whose problem this is on somebody else's behalf
Care homes, hospitals, schools, language schools, relocation firms and
employers with international teams — the settings where dialect is an
operating risk, a training budget or a legal duty rather than one person's
difficulty, and where the person who suffers it cannot buy the fix. A care
assistant does not procure software; a Heimleitung does.
The page does the one honest thing available to a product with no customers,
which is also what actually opens a conversation with an institution: describe
the MOMENT the problem happens, in enough detail that a reader who has stood in
the room recognises the room, and then ask whether we have it right. `unknown`
on every row is the question that turns a page into a meeting, and the "no
customers" paragraph is FIRST rather than buried — a reader who discovers that
on the way down has been managed; one told at the top is being levelled with,
and everything below reads differently.
The schools case rests on a fact worth having: Zurich voters made dialect the
kindergarten language of instruction in 2011, so expat parents are locked out
of their child's first school years by law. Cited to the canton.
TWO RESPONSIVE BUGS, one mine and one not.
MINE: added under `project`, it made an eleventh nav item and the French header
overflowed at 1024px — every page scrolled sideways. That is the exact
headroom `routes.ts` predicted would go. It has no `group` now, so it stays out
of the learner nav and sits in the footer row beside privacy and the Impressum,
which is where an institution already looks. My own comment had made that
argument and I put it in the nav anyway.
NOT MINE: with my item removed the French header STILL overflowed, on pages I
never touched — the `use` group grew to five items across #71–#73 and spent the
rest of the margin. `min-w-0` on the row and `flex-wrap` on the nav: without
`min-w-0` a flex child refuses to shrink below its content and pushes the row
wider instead. It wraps to two lines at 1024 and stays one line at 1280.
And the reason neither was caught: my audit ran 390 and 1280, and this breaks
between them. It now runs 1024 in French — the longest labels, at the width
where the flat nav has appeared and has least room — and it has moved out of a
scratch directory into `scripts/responsive-audit.mjs`, having found real bugs
twice.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(mobile): footer links a thumb can hit, and an audit that stops crying wolf
TAP TARGETS. The footer's page list and language list were 16px-tall text
links in a column — a finger is 44px, and this is the one part of the site
somebody reaches for one-handed on a tram. The same file already had the right
pattern two blocks further down, on the privacy and Impressum row; the lists
just never used it.
THE AUDIT'S OWN FALSE POSITIVE, which matters more than the finding.
It reported GUTTER on every page in the site, because it read `main`'s own
padding while the padding lives on a wrapper inside it. A check that fires
everywhere is a check nobody reads — and this one nearly sent me looking for a
layout bug that did not exist, on a site whose gutters were fine all along.
It measures the first piece of real TEXT now: what a reader actually sees
touching the edge, rather than a box that happens to be full-bleed by design.
And the tool no longer lies about its own dependency. It said "Playwright is
deliberately not a dependency" in a comment and then imported `playwright` as
though it were installed, so it died on its first run for anybody but the
author. It imports at run time and prints how to point it at a browser.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(mobile): the language switcher, and the fourth thing the audit was wrong about
The footer's language links were still 16px tall. The previous commit fixed the
page list beside them and missed this one, which is the ordinary way a
"sweep" leaves half a job: the two lists look identical on screen and are two
separate blocks in the file.
STRUCTURALLY THE SITE IS NOW CLEAN: across seventeen routes at 390, 1024 and
1280, zero overflow, zero elements past the viewport, zero gutter failures.
That is the real result of the nav fix, and it is worth stating because the
report that produced it was until recently mostly noise.
Which is the other half of this commit. The audit reported the SKIP LINK as a
failed tap target on every page — it is a 1×1 until focused, which is the
entire point of it. Reporting an accessibility feature as an accessibility
failure is the fourth false-positive class removed from this tool:
gutter on `main` fired on every page in the site
tap targets at 1280 a mouse pointer is not a finger
links inside prose cannot be 44px without wrecking the line
the skip link invisible by design
Each removal made the report smaller and more trustworthy, and the third and
fourth would each have had me change working code. A check that cries wolf is
worse than no check, because it trains the person reading it to skip the line
where it is finally right.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(settings): what this device is holding, and the button that ends it
The data section said, in a paragraph, that saved words and the signed-out
conversation live in this browser — and then linked away. It is the one claim
in the privacy section that the architecture lets us simply SHOW: every device
store is four localStorage reads, so "what do you have on me, and delete it" is
a list with buttons rather than a subject-access request.
The list is DERIVED, not written twice. `lib/browser/stores.ts` takes its keys
from the same `FLOWS` the privacy page renders, and reuses that page's own
translated labels — so both pages name the same four things the same way in all
seven languages, and a fifth store cannot be added to one and forgotten by the
other. A settings page with its own list is a settings page that will one day
leave data behind while promising it is gone; a test asserts the join.
Sizes, not contents. "337 B" needs no knowledge of any store's shape and cannot
go stale; "11 saved words" needs four decoders that rot one at a time. And
export sits to the left of delete: somebody who wants to leave should meet the
way to keep their things before the way to destroy them.
Storage is subscribed to, not mirrored into state. `store.ts` next door already
models a single key as an external store, and this follows it: a delete here
announces itself, a delete in a second tab arrives on the `storage` event, and
the component needs no effect — which is the hydration mismatch this codebase
has been bitten by twice. The snapshot cache that `useSyncExternalStore`
requires is the one piece that can fail silently, so all three of its failures
are pinned by tests proven by mutation: never invalidating, never announcing,
and never caching each fail the test that names them.
Verified at 390px and 1280px on /de/settings with four stores seeded: rows wrap,
the delete targets are thumb-sized, and deleting one removes the row and
recomputes the total without a reload.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(technology): what the speaking evaluation measures, computed rather than claimed
The technology page described what the FIELD can do — corpora, error rates,
which vendors actually produce dialect — and then stopped short of the thing a
reader is there to judge: what this product does with any of it. That was the
explicit gap. It is now a panel, and the interesting part is that nobody wrote
its claims.
`lib/speech/capability.ts` declares five measures and the least evidence each
needs; the pack declares what recognition exists; the verdict falls out. So the
page renders "on the dialect" for delivery and "on Swiss Standard German" for
grammar because `evidence.ts` says dialect recognition translates rather than
transcribes — not because a copywriter decided that was a fair way to put it.
When Zurich German recognition improves past FORM_JUDGEMENT_MAX_WER, one number
in one pack changes and the page starts saying grammar is checkable on the
dialect, in seven languages, with no copy edit. Until then it cannot overclaim
even if somebody wants it to.
The refusal is a row, not a silence. Pronunciation is listed and marked refused,
because the measure every competitor advertises being deliberately absent is
the most informative thing on the page — and a flag beats a comment at stopping
a future contributor from reading the other verdicts as a roadmap. The word
error rates sit underneath, so a reader can disagree with our threshold instead
of being asked to trust a verdict.
Two things that were true and are no longer:
"Heidi does not speak" — she does, since the de-CH voice. The line now says
what actually happens: Heidi reads aloud, never claims to be speaking
dialect, and stays silent rather than hand you an English voice reading
Züritüütsch. Corrected in all seven languages.
The overclaim register lived only in comments. §8 names the claims this
product does not make, every engine file obeys it, and nothing stopped the
sentence appearing in a dictionary — the one place a reader would see it.
`lib/i18n/overclaim.test.ts` scans all seven for claim SHAPES rather than
vocabulary, so "adults rarely reach native pronunciation" still passes while
"93% native pronunciation" fails the build. Proven both ways: honest lines
that must keep passing, forbidden lines that must fail, and an injected
overclaim in real copy that the scan located by file and key.
Verified at 390px and 1280px on /de/technology: rows wrap, no overflow, the
refusal row reads as a decision.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(speaking): days spoken, counted — a number that cannot be lost
Stickiness, without becoming the thing this codebase already refused three
times. `saved/review.ts`, `practice/types.ts` and the practice session each
decline streaks, points and days-active, and they give the test they applied:
the product's success is how much of an unfamiliar Zurich speaker you
understand, and a streak measures how much Heidi you CONSUMED while looking
like it measures learning. That reasoning is not weakened here. It is applied
to the one surface it was not written about.
Speaking is production, not consumption. Everything else in the product is
something shown to the learner — a card, a clip, an answer — and a counter over
any of it is vanity. A take is the learner making speech in a second language,
which is the skill itself being exercised rather than evidence of having opened
an app. Counting the days somebody did that is measurement.
WHAT MAKES IT HONEST IS THAT IT CANNOT BE LOST. A streak is a count plus a
punishment, and all of its pressure comes from the reset — which is why streak
products send the notifications they send. Nothing here resets. `daysSpoken` is
the number of distinct local days with a take; it rises or holds, and a
fortnight away costs exactly nothing. Somebody returning after a month is told
they have spoken on eleven days, not that they have lost eleven. The test that
pins this is named for it, so anyone turning the count into a streak has to
delete a test that says what they are doing.
The design test for anything added here, written into the module header: would
a learner who stops for three weeks see a WORSE number than before they
stopped? If yes, it is a streak wearing a different name.
Details that keep the numbers true: several takes in one sitting are one day of
speaking, so re-recording is not rewarded over returning; time is phonation
rather than wall clock, so sitting with the recorder open deciding what to say
is not counted as practice; minutes round down, so a first thirty-second take
is thirty seconds and not "1 min"; days are LOCAL days in the browser's own
zone, which is a parameter rather than the runtime's, because a take at half
past midnight belongs to the day the speaker was living in.
Visually deliberate: the same figure grid as the per-take measurements directly
above, because these are the same kind of thing, and a louder treatment would
be the visual version of the claim the module refuses to make.
Verified at 390px with five takes across four days: 4 days, 5 recordings,
3 min — three columns, no dead cell, no overflow.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(mobile): every tap target on every page, and the fifth thing the audit was wrong about
Thirty-three findings to zero, across sixteen pages at three widths.
Half of them were one bug. The header's link back to the start page was the
height of the mark inside it — thirty pixels — so the most-repeated control on
the site was also the most-missed, once per page. `min-h-11` on the anchor
fixes all sixteen and changes no layout, because the header's own padding
already exceeds it; only the hit area grows.
THE AUDIT WAS WRONG ABOUT THE CHECKBOXES, and that mattered more than the
checkboxes. A checkbox or radio wrapped in a label is tapped by the label — the
radio rows here are padded bordered blocks the width of the column, which is a
comfortable target reported as the worst one on the page. Acting on that
finding would have meant inflating a control nobody aims at while leaving the
actual target untouched. So the detector now measures the wrapping label for
those two input types, and only a WRAPPING label: a `for=`-linked label
elsewhere in the DOM is clickable too but need not be adjacent, and crediting a
control with the area of something across the page would hide a real problem.
This is the fifth false-positive class this report has lost, and the reason to
keep spending on it is that a finding a reader learns to skip past is worse
than no finding — it teaches them to skip the real one beside it. The change
proved itself immediately: the settings checkbox came BACK as 350x24, because
its label genuinely was one line tall, and only went away when the label was
fixed.
The rest were real, and each is a control somebody actually has to hit on a
phone: the conversation-list button in chat, the table of contents on /method,
the way back into reading from /practice, the source titles on /listen, the two
links on /impressum, and the two 28px icon buttons on every saved word — those
get 44px on phones only, which is not a compromise between devices: on a phone
they are always visible and are the only way to act on a word, while on a
desktop they appear on hover beside a pointer that can hit 28px.
One genuine ergonomic fix rather than a measurement one: the speech-rate slider
was a sixteen-pixel-tall track, every pixel of which was somewhere a thumb had
to land precisely to start a drag. It now has a 44px grab area with the track
still drawn at its natural height.
Audit: 33 findings → 0. Verified by watching it fall as each fix landed, which
is also the evidence the detector still fires.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
||
|
|
f34cf3f409 |
feat: Heidi on every page, an account menu, learnable reference pages, and what the field can actually do (#66)
* feat(chat): Heidi on every page, and an account menu instead of two boxes Chat is how people use this product and it existed on two surfaces out of eleven. A reader on /grammar had to notice the nav, work out which of eight links was the chat, and lose the page they were reading. Signed in it was worse: the locale root is the dashboard, so the landing page had no composer anywhere on it. The dock is the same conversation as the home fold and /chat, because all three now read one store through use-draft-chat.ts. Pages that already hold a conversation mark themselves with data-chat="surface" and globals.css hides the dock over them — CSS rather than a pathname list, because whether the locale root holds a chat depends on whether the visitor is signed in, which a route table cannot know and the rendering page always does. The header carried a gear icon beside a pill with a green dot that nothing measured. One avatar menu replaces both; what is in it comes from ACCOUNT_MENU_KEYS in routes.ts, so an entry naming a page the site does not have is a build error. Three things found on the way, each a defect nobody had reported: - Escape-to-close was written twice and the copies disagreed — one returned focus to its trigger, one dropped it to the top of the document. A third copy was in model-sheet.tsx. One implementation now, in use-dismiss.ts. - The mobile menu had aria-expanded and no dismissal at all: Escape did nothing, an outside tap did nothing, and a browser Back left it open over the new page. Found by the test that asserts every aria-expanded control uses the hook. - /api/chat carried a second copy of the turn wiring that respond.ts exists to own — including an `as unknown as` cast that ai-kit 1.x had already made unnecessary, which is the copies having drifted. The route is ~45 lines shorter and every surface now shares one turn. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(chat): the dock panel sat on top of its own launcher Measured on screen at 1280px, not reasoned about: at `bottom-4` the card covered the button that opened it, so on a laptop the control that closes the dock was underneath the dock. `sm:bottom-20` clears it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * feat(settings): a theme control, for the palette that was already written globals.css has carried a full dark palette since the cow retheme, in blocks guarded on `data-theme` — and nothing in the product ever set that attribute. The palette was unreachable: a reader whose device is light could not ask for dark, and one whose device is dark could not ask for light. Three states, not two. "System" is the default and follows the device, including when the device changes at dusk; a two-state toggle has to pick a side at first paint and is then wrong for half the readers until somebody touches it. The choice is stamped by an inline script before first paint. An effect would run after it, so a reader who chose dark would watch a white page flash to black on every navigation — worse than having no toggle. Two things that cost a debugging cycle each are pinned by tests: - `createBrowserStore` writes through JSON.stringify, so the stored value is `"dark"` WITH quotes. Comparing it to `dark` fails silently and the only symptom is the flash the script exists to prevent. The test runs the script for real against both encodings rather than grepping it for `setAttribute`. - localStorage THROWS in a private window and where site data is blocked. This runs before React, so an uncaught throw would take the page down. `suppressHydrationWarning` on <html> is the documented fix for an attribute a pre-paint script sets deliberately, and it covers that element only — a real mismatch inside the page still fails loudly. Verified in the browser: the warning was there, and is gone. Also: limitkit moves from `github:bitbaum/limitkit#v0.2.0` to `^0.2.0` on npm, same version. Under pnpm 11 a git-hosted dependency's prepare build is refused without an allowBuilds entry, so the install resolves to a package with no dist and CI fails on an import resolving to nothing. fleet/SHARED.md names heidi specifically for this. Confirmed after reinstall: node_modules/limitkit now has dist. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(chat): a letter pasted into a GROUP got none of the message handling `pastedContext` tested `authorId === LEARNER_ID`, which is the id the SOLO thread stamps on the reader's turns. In a group every human carries their own OrangeCat actor id and none of them is LEARNER_ID, so the loop walked every message, matched nothing, and returned "". Pasting a landlord's letter into a study group quietly got no structure, no header parsing and no guaranteed reply offer — and looked exactly like a letter that had been handled. "Not Heidi" is the test that is true on both thread shapes. Pinned, along with the latest-turn-only rule and the two cases that must stay silent. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(chat): seven defects from review, one of them mine and critical The critical one was introduced by the dismiss consolidation. `useDismiss`'s navigation effect fired on the INITIAL commit as well as on changes, and the model sheet passes `open: true` because it exists only while open — so pressing "connect your own model" opened a sheet that closed in the same tick. BYOK, and with it every picture, was unreachable. No test could catch it. The first repair was a "skip the first run" ref, and it was wrong: `reactStrictMode` is on, React invokes each effect twice in development, and the ref persists across both — the guard was spent on the first invocation and the second closed the sheet anyway. Measured in the browser, the sheet still refused to open. Comparing the stored pathname asks what the effect actually means — "have we navigated?" rather than "is this the first run?" — and is correct under both. Verified in the browser: the sheet opens, Escape closes it, and the nav panel still closes on a real navigation. The rest: - French and Italian envelopes were mis-parsed. `À :` and `A:` are one letter and the pattern demanded two, so the recipient line ended the header block: a French message lost its subject and leaked `À : … / Objet : …` into the body, and an Italian one fell below the two-header floor and was not recognised as a message at all. The earlier tests passed only because they omitted the recipient line, which no real mail client does. - The pasted body was being concatenated into the SYSTEM prompt — up to 4,000 characters written by whoever wrote to the reader, given the authority of our own rules. It is not repeated at all now: the paste is already in the conversation as the reader's own turn, in the user role, which is the privilege level it should have. The envelope fields stay, capped and fenced as data, and the model is told to report an instruction aimed at it rather than act on it. - Asking the same word twice did nothing the second time, then replayed it later: the dedupe key was the text, so the effect returned early without clearing the pending ask. It is a monotonic id now. Verified: two presses, two turns. - Navigating closed the dock and discarded an in-flight answer, because `useConversation` has no abort handling. The dock lives in the layout to outlive the page under it, and following a grammar link from an answer is a move this product encourages — so it opts out of navigation dismissal. - Signed in, Settings and Sign out moved inside a client-component menu, so a reader with JavaScript off lost the only route to their own settings. The footer carries a plain link now, for signed-in and signed-out alike. - Closing the panel on a phone dropped focus to <body>: the launcher is `display:none` there, so `.focus()` was a silent no-op. - The account menu pointed `aria-controls` at an element that does not exist while it is closed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * feat(technology): what a computer can and cannot do with Swiss German §8 is an overclaim register — a list of things this product must not say, the largest of which is that it transcribes dialect. The strongest form of that discipline is not a promise to be careful; it is publishing what the field can actually do, with the numbers, so a reader can hold our claims against it. Five public speech corpora with hours, speakers, regions and licences; three ASR results as word error rate on one test set so they can be compared; four speech-synthesis systems; three language models. Thirteen new sources, each opened and checked against the claim it supports. The central fact needs no argument once the table is on screen: almost every Swiss German speech corpus pairs dialect SPEECH with STANDARD GERMAN text, because in a diglossic country writing down what was said is a translation task, not a transcription one. That is why Heidi's dictation produces Standard German, and the page now shows why rather than asserting it. Three things a product page would not say: the best verifiable Swiss German WER is 12.1% and those weights are unpublished; most voices sold as "Swiss German" are Swiss STANDARD German read aloud; and Apertus carries 6,000 Swiss German post-training examples while publishing no dialect evaluation at all — marked `dialect not evaluated`, which is the difference between a claim and a result. Positioned beside /method rather than inside it: /method argues how Heidi teaches and rests on acquisition research; this rests on language-technology research and argues nothing about teaching. Indexed, because someone searching for "Swiss German speech recognition" is looking for exactly this and will otherwise find a vendor selling them Swiss Standard German. The numbers live in lib/research/language-tech.ts, not the dictionaries — a figure is not translatable and seven copies of "343 hours" are seven chances for one to become 340. The English `note` on each row is maintainer copy and is NOT rendered: providers.ts already records what happens when an English source-copy field reaches a component, and the first draft of this page repeated that mistake in four tables before it was caught on screen. Every label a reader sees is localised, verified in German and French. The article-URL rule widened to admit ACL Anthology and CEUR records. That is not a loosening: this literature publishes at ACL, where the Anthology record IS the permanent identifier. An arXiv preprint still enters through a DOI and says "preprint" in its venue, so a reader is told what they are looking at. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
ca52f77cbd |
feat(portal): the words you looked up, kept (#25)
The portal promised "your words — what you looked up comes back later" and then showed a roadmap. This is that, delivered, and the roadmap item is removed rather than left promising a thing that now exists. WHY THERE IS NO DATABASE Heidi has no persistence of any kind today — no DB client, no ORM, and threadkit is pure per-request logic. So "personalized learning" looked like it needed infrastructure. It does not, for this half. Heidi keeps no users table on purpose: identity is federated and the `sub` claim is all we hold. Storing vocabulary server-side would mean Heidi starts holding a record of what a particular person cannot understand, which is a genuinely sensitive thing to hold, and it would buy sync across devices and nothing else. On-device costs nothing, works signed out, and cannot leak. Groups will need a server for a real reason — two people must see one thread — and that is the moment to pay for it. The page says so, in every language, rather than letting anyone assume their words are following them to a second device. Export is offered because "we hold nothing about you" and "you could lose this by clearing site data" are the same fact, and the file is what makes the first half honest. ONE STORE, NOT TWO `use-byok` had already worked out the four non-obvious things about browser storage — localStorage not a cookie, the cached snapshot, the self-announcing write, the guard around a localStorage that throws. Saved words needed all four, so the pattern moved to `lib/browser/store.ts` and BYOK now sits on it. Second use, so it gets extracted, not copied. The domain is pure and tested: re-saving a word keeps ONE copy and the ORIGINAL date (they pressed save because they were unsure it worked, not to reset the clock); case folds, accents do not (in a variety whose whole lesson is that one vowel became another, folding them would collapse what is being taught); an unknown schema version reads as ABSENT rather than being coerced, because old data lives in browsers no migration can reach and an empty list is recoverable while a half-parsed one is not. Also corrects a wrong diagnosis from earlier today. The microphone button that "only" went missing on the dev server was not a dev quirk of `useSyncExternalStore`: the sandboxed dev server never hydrates at all — its HMR socket fails — so every client component is inert there. Verified against a real production build, where the mic, the saved list and BYOK all work. The note in `lib/browser/store.ts` says to check that the menu opens before blaming a hook. Claude-Session: https://claude.ai/code/session_01FzYBD3sZroCAYeRgTYrpfT Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |