Commit Graph
19 Commits
Author SHA1 Message Date
CatoandClaude Opus 5.5 6a3be90d97 chore(ci): one check per change — remove the merge sweep, check on PRs only (#336)
Removes the fleet auto-merge sweep caller (and wake chain where present);
checks run on pull requests only, not again after merging; a deploy that
waited for CI on main now deploys on push. The forge merge check
(forge/verify) verifies each PR on its merge result and merges it.

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 05:13:43 +01:00
Cato 4b90f0be5b ci: install Chromium through the shared fleet step (survives an unreachable Ubuntu archive) (#298) 2026-11-11 16:39:44 +01:00
Cato f1fd5a812a ci: actions/checkout 7, actions/cache 6, pnpm/action-setup 6 (#295)
The three Dependabot bumps (#176, #177, #178) in one change. Each was green
on its own run; checkout 7 is what fleet's workflows already use.

Claude-Session: https://claude.ai/code/session_019MDtmsubNtjznXC5pMf4fD
2026-11-10 15:07:51 +01:00
CatoandClaude a3f1255010 Commercial readiness: accounts and sync, practice rebuilt with levels, walkthrough fixes (#282)
* fix(privacy): never show an email address as a person's public name

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* docs(changelog): 2026-11-09

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* docs(changelog): situations, voice, home

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

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

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

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

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

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

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

* feat(practice): no two sittings alike

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

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

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

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

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

* docs(changelog): practice rebuilt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed up and used a new account on two browsers:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 13:15:50 +01:00
CatoandClaude 1517340bfd feat(auth): prove email recovery in both mail states (#252)
Heidi already had AccountKit's shared mailer wired, but nothing held what
it should do, and the env that turns it on was undocumented, so it never
got set and live sign-in offers no way back from a forgotten password.

- lib/auth/mail.ts: Heidi's account mailer (createAuthMailer over
  @bitbaum/mail-kit) as one factory, so tests exercise the real adapter.
- lib/auth/recovery.test.ts: with no mail env (or a placeholder key, or a
  sandbox sender) no reset, link or address check is offered and a reset
  request sends nothing; with it, a reset email goes to Heidi's origin and
  its link sets a new password once.
- scripts/audit/account-recovery.mjs, run by the shared account journey:
  in a real browser, "Forgot your password?" and the sign-in link are shown
  in de, fr and ru at 320 and 390px and the forgot form ends in its notice;
  the same build started without mail env shows neither.
- .env.example: BETTER_AUTH_SECRET, RESEND_API_KEY, RESEND_FROM.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 18:12:25 +01:00
Cato 56a80e6603 ci: fast gate on main after a PR merge, per-commit concurrency (#230)
A squash merge onto main already passed the full verify on its pull request. Main now runs verify:main for a tip whose subject contains (#N) and keeps the full verify for pull requests and for main pushes without (#N).
2026-10-27 23:51:14 +01:00
Cato 2c7ecd401f fix(deps): prevent AccountKit updates below supported floor (#219) 2026-10-26 16:46:32 +01:00
Cato d353aa3b9f fix(auth): wire shared mail and password recovery (#213)
* fix(auth): wire shared mail and password recovery

* fix(auth): use released all-method second-factor protection
2026-10-26 05:34:51 +01:00
Catoandcatomean b256d19b6a ci: cut scheduled CI minutes (CI audit) (#197)
Co-authored-by: catomean <catomean@users.noreply.github.com>
2026-10-21 20:38:32 +02:00
CatoandClaude 38d299ff59 fix(chat): Camera / Photos / Files on a phone — chatkit 0.4.1 (#175)
Heidi pinned chatkit v0.2.0, so its paperclip still opened Android's
capture-app chooser (Camera, Recorder) with no file browser, days after the
fix shipped in chatkit. This moves to the 0.4.1 commit:

- the paperclip opens a Camera / Photos / Files sheet on touch screens;
- the sheet's words are in all seven languages (attachMenu labels);
- `check:file-inputs` (chatkit-check-file-inputs) joins `verify`, failing any
  file input whose accept mixes image and document families;
- Dependabot groups @bitbaum/* releases into one PR.

Pinned to the merged commit until 0.4.1 is on npm (the package's trusted
publisher is not configured yet); then it becomes ^0.4.1.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-07 05:12:38 -07:00
CatoandCursor b6a81848c1 fix(ui): header menus on top everywhere; «Mein Bereich» leads with today (#154)
- /chat unpositioned the header (position: static), so its z-index was off
  and its menus hung off the page, below the screen and behind the
  conversation list. Header is positioned again and on its own layer (45).
- One layer scale held by lib/config/layers.test.ts; scripts/audit/overlays.mjs
  opens every disclosure in light and dark and runs in CI.
- Language switcher left of the account; its panel anchors to the header row.
- Dashboard: «Heute» panel (streak, due questions and words, two actions,
  weekly goal); empty progress panels render nothing; jump strip and
  duplicate CTAs removed; words one section; conversations and groups side
  by side.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 13:18:11 -07:00
Cato 453c4325fc perf(ci): deploy Heidi after CI completes (#100) 2026-09-23 13:54:24 -07:00
CatoandClaude Opus 5 e227509827 Mobile layout, the personal page, dialect depth, essays and practice (#87)
* fix(chat): stop the transcript scrolling the page sideways; open on the chat

Two things, both about what the app shows first on a phone.

OVERFLOW. A long link in an answer — an ordinary zuerich.ch URL, pasted by a
learner asking what it said — has no break opportunity in it, so the line ran
past the edge of the card. A block does not grow to fit its overflow, but the
DOCUMENT does: at 320, 360 and 390 the page became 710px wide and scrolled
sideways, and the reader had to drag it back and forth to read one reply. The
same defect hit the flex rows (a gloss, a suggestion's label beside its Speak
and Copy buttons), which size themselves from min-content and pushed their
neighbours off the edge.

One declaration fixes all of it, because `overflow-wrap` inherits: the
transcript's root wraps anywhere, and every descendant gets it — including
ones added later by somebody who never reads the note. `anywhere` rather than
`break-word` is the load-bearing half, since only `anywhere` shrinks the
min-content contribution that the flex rows measure.

That holds only while the transcript is the one gate, so `transcript.test.ts`
pins it: the root carries the class, and `AnswerView` and the bubbles are
rendered there and nowhere else. It covers all four chats — home, dock, full
screen and a group — because all four already share this component.

The composer got the same treatment one element down: a textarea is a flex
item that refuses to shrink below its `cols`, which on a 320px phone plus
three 44px buttons is wider than the row.

Verified in headless Chromium at 320/360/390 with a hostile answer (a long
URL, a 48-letter compound, a flag list): document width was 710px before and
equals the viewport after, on the home page and the full-screen chat.

DEFAULT SCREEN. Signed in, the locale root rendered the dashboard — a list to
look at, when what someone with an account opened it for is the conversation.
It now renders the full-screen chat, sidebar and all. The dashboard is not
gone: `/portal` is still its address and the account control is still the door
to it. Signed out is unchanged, so the indexed landing page and its pitch stay
exactly where a crawler and a first-time visitor find them.

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

* fix(mobile): every page measured for overflow; align the read/copy pair

The last fix went on the transcript and stopped there, so three reported
pages stayed broken. This one starts from a measurement instead of a
screenshot.

WHAT WAS ACTUALLY WRONG. A grid track defaults to `auto`, whose automatic
minimum is min-content — it will not go narrower than the widest unbreakable
thing inside it. One `truncate` line is `white-space: nowrap`, so its
min-content is the whole sentence. `/portal` with eleven ordinary kept words
was therefore 516px wide in a 360px viewport, and 912px once one word had
been kept from a link. Nothing on that page was doing anything unusual, which
is why nobody caught it by reading the code.

`grid-cols-safe` is that missing `minmax(0, 1fr)`, named once in globals.css
with the reason beside it, and applied to every grid whose base layout is one
column. Kept words and the vocabulary list also hyphenate now: a German
compound longer than a phone column is the whole subject of this product.

`overflow-x: clip` on the body is the backstop and explicitly NOT the fix —
it turns the next mistake into a clipped card instead of a site that scrolls
sideways. `clip` rather than `hidden` because `hidden` makes the body a
scroll container and silently kills the composer's `position: sticky`.

MEASURED, NOT INSPECTED. `pnpm run audit:responsive` drives every page in
every language at 320/360/390/414 in both themes, with a browser that has
been used — a dozen kept words in three scripts, one of them kept from a
100-character URL — and fails on two things: an element whose box leaves the
viewport, and an element whose content is wider than itself and cannot
scroll. The second is the one no amount of reading finds. 532 renders, zero
overflow. Not in `verify`: it needs a server and a browser binary.

THE READ/COPY PAIR. They were two halves of different components bolted
together, and looked it: Speak is a 44px control, Copy was 36px, so
"Kopieren" rode eight pixels above "Vorlesen". Equal heights now, because the
alignment IS the two numbers being equal. Their row also stopped being rigid:
in Russian the label wrapped to four lines beside them, and the moment Speak
opened its caveat — two sentences about which voice the device really has —
the cluster pushed the whole card off the right of the screen.

YOUR OWN MESSAGES, FROM A STRANGER. Sending a line in a signed-in
conversation returned the stored ROW, whose author is the OIDC `sub`. The
transcript is built on `LEARNER_ID`, so it rendered the reader's own sentence
in the shell reserved for a third person, left-aligned, with their raw actor
UUID printed above it as that person's name. The conversation GET had it too,
and was handing the `sub` back over the wire besides. One mapping now, shared
by all three boundaries, pinned by a test.

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

* feat(dialect): the three branches, and where each dialect can be heard

"Swiss German is not one language" was the third fact the page led with, and
then it illustrated the claim with eleven names in a flat grid — which reads
as eleven flavours of one thing, the opposite of what it says. The structure
is the interesting part, and it is not ours to invent: the Alemannic dialects
divide into Low, High and Highest, and the divisions are drawn by sound
changes that stopped in different places.

So the atlas now carries that structure. `DialectGroup` is generic — nothing
in the pack type says Alemannic — and each group holds the pair of FORMS that
draws its line rather than a sentence about them: `Kind` inside Low Alemannic,
`Chind` outside it, `Kind` in the standard both are versions of. A reader sees
the line instead of being told about it, and a pair of forms is the same in
all seven languages.

ABSENT IS AN ANSWER. Innerschwyzertütsch spans Lucerne, which is High, and
Uri and Unterwalden, which are Highest; Bündnerdütsch covers Chur and the
Walser settlements, likewise on two sides. Both carry no branch and the page
says the area straddles the line, because the tidier page would be the false
one.

WHERE YOU CAN HEAR IT. Every row in the listening register has carried an
atlas `area` id since the first commit and no page ever followed the join, so
the one question a dialect page could not answer — "where do I actually hear
this?" — was already answered in the data. The area pages now list the
programmes recorded in that dialect, sharing `/listen`'s own row component
rather than growing a second copy of it.

STILL NO PER-AREA PROSE, and the page got substantially longer anyway. That
is the part worth keeping: three branch explanations, translated once, serve
all eleven areas, where eleven descriptions would have been seventy-seven
blocks nobody here can check. Everything else added is data.

What is deliberately NOT here: invented dialect forms. Seven of the eleven
areas still say Heidi cannot tell them apart by form, because that is true.
The container for per-area vocabulary and grammar contrasts is what this
commit builds; filling it needs rows somebody can cite, not rows that look
plausible.

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

* feat(essays): somewhere for the long answer, and the first one

The dialect pages answer "which forms" and "where", and they are made of data
on purpose — eleven areas of translated description would be seventy-seven
blocks nobody here can check. But the question a visitor actually arrives
with is not a form and not a map: why does a country this small have this
many dialects, and why did the big neighbour lose its own? That is an
argument with sources, and it had nowhere to live.

TYPED BLOCKS, NOT MARKDOWN. A parser is a dependency this repo has spent real
effort avoiding, and Markdown would let a page render anything at all — the
design system would be one stray element away from not applying. Blocks
render through components that already know the type scale, the measure and
the one accent, and a block kind nobody implemented is a build error instead
of a paragraph that looks wrong in production. `inline.ts` gives prose the
three things it needs inside a sentence — a link, emphasis, and a language
form set in the dialect face — in forty lines of pure, tested code, so
writing an essay is writing sentences.

TRANSLATION IS NOT REQUIRED, and that is the whole reason essays are not
dictionary entries. A dictionary must have every key in all seven languages
or the build fails, which is right for interface copy and impossible for two
thousand words of argued history: machine-translating that into Romansh and
publishing it under our own name is exactly the overclaiming `/method`
exists to refuse. An essay exists in the languages somebody wrote it in, a
reader in another gets the version that does exist, and the page says which
language it is in rather than letting the site look broken. The sitemap
follows the same rule — hreflang names only real translations.

THE FIRST PIECE argues that it is not the mountains. Austria is as
mountainous and kept a spoken norm, because Vienna was a court and a capital;
the Confederation had neither, and until 1848 not even a capital, so there
was no place whose pronunciation anyone was supposed to imitate. Where it
reaches the causal story it marks it as a conjecture, because the sources
under it — Ferguson on diglossia, the HLS on multilingualism and on the
Geistige Landesverteidigung — describe the language situation and not why it
arose. Every URL was resolved before it was cited, per this registry's own
standing rule.

`sources.test.ts` now counts essays and dialect branches as citers, and
refuses an essay that names no source at all — the reverse check, and the one
that matters more on the pages that make the strongest claims.

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

* feat(practice): a second attempt before the sitting ends, and the papers on the page

Practice is the half of this product that decides whether anybody comes back,
and it is the half where guessing is least excusable. Two changes, both
argued.

A MISSED QUESTION COMES BACK. It used to reveal its answer and move on, which
makes a sitting a test with feedback and never a second chance to produce the
thing. Rawson & Dunlosky (2011): the durable gain comes from retrieving
something correctly more than once, spaced — not from having seen it. Butler
& Roediger (2008) is the sharper case here, because three of the five item
kinds are multiple choice and choosing a lure can leave the learner holding
the lure unless something corrects them. So a missed item returns three
questions later, once, labelled as the second attempt rather than appearing
again unexplained.

The gap of three is OURS and says so. The literature gives the direction and
not the number, and a cited estimate presented as a finding is an uncited
claim one step better disguised.

THE SCHEDULE HEARS THE FIRST ANSWER ONLY. A word got right a minute after
being revealed has not been retrieved; grading it twice would advance the very
interval the spacing exists to protect, which is the same inflation
`review.ts` already refuses when it sends a missed word to the start rather
than back one step.

MY FIRST GUARD WAS WRONG, and reading it did not show it. It refused to
requeue an item already in the QUEUE — but a requeued item leaves the queue to
become the current question, so a second miss put it back again. Found by
driving a whole session wrong on purpose: eight questions became thirteen and
would have kept going, which punishes exactly the learner who is finding it
hard. The rule is now stated on what decides it — an item already answered
this sitting has had its go — and a test pins the worst case at exactly twice
the session size.

THE PAGE ARGUES FOR ITSELF. Seven claims on `/practice`, each linking to the
study behind it, on the page the design belongs to rather than on `/method`:
the person reading has just been told they got something wrong and is entitled
to know whether the thing telling them knows anything. The interleaving row
states the meta-analysis's moderator — the benefit depends on how similar the
material is, and on very similar material blocking can win — instead of
quoting the headline and hoping. Every row carries the guarantee the research
page already had: a test refuses a row citing nothing, and refuses a locale
citing something different for the same sentence.

Four sources added, each resolved through Crossref before being written down.

HEIDI.md §9 now carries the exercise track in order, including what is
deliberately refused: streaks, points, levels, percentages, a daily goal. If
that ever costs retention against a competitor with a flame icon, we lose that
comparison on purpose.

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

* fix(portal): a way around your own page, and the account where people look

THE DASHBOARD HAD NO NAVIGATION. Five sections stacked down roughly two
thousand pixels of phone with nothing to steer by — no index, no counts, no
sign that anything existed below the fold. Somebody wanting their groups
scrolled past everything else to find out whether they had any.

`DashboardNav` is one component in two shapes, because a phone and a laptop
want different things from the same list: a strip that sticks under the header
below `lg`, the sidebar this page always needed above it. A second component
for the second shape would be two lists that disagree about what sections
exist. It wraps rather than scrolling sideways — a strip that scrolls hides
its own last item, on the exact class of page this repo has shipped scrolling
sideways by accident. The counts are the point: "Groups" says a section
exists, "Groups · 1" answers the question a personal page is being asked.

THE ACCOUNT IS IN THE CORNER NOW, at every width. It used to appear there only
from `lg` up and hide inside the mobile menu sheet below that. "Log out" is
the one control people look for without being told where it is, and on a phone
there was nothing in the corner at all. Signed OUT it stays in the sheet, and
that is not inconsistency: a signed-out bar needs a gear and a full-width
sign-in button beside the wordmark, the language switcher and the menu, and
five controls do not fit in 320px. An avatar is 44px and does.

The right-hand rail is gone. It held the account (now in the header), the
roadmap (the project talking about itself on a page about the reader) and the
way back into the product — which is now at the END of the page, where you are
when you have finished reading your own words.

TWO DEFECTS THE CHANGE CAUSED, both caught before shipping and both worth
recording because they are the same shape as each other:

The account dropdown is `absolute right-0`, which hangs from the nearest
positioned ancestor. That was its own button — correct only while the avatar
was the LAST control in the bar. It no longer is, so at 360px the 328px panel
ran from x = −78 with its labels cut in half. The anchor belongs on the
control row, whose right edge is the page gutter.

And the bar stopped fitting: 342px inside 320 in Russian, once the avatar was
paid for. The wordmark stands down under 380px and the cow stays. That needed
a breakpoint Tailwind does not have — every real decision in this product is
between a 320px phone and a 390px one, and `sm` at 640 is a tablet.

THE AUDIT NOW OPENS THINGS. It found neither of the above, because it measured
pages at rest and every dropdown on them was shut. It opens the header's
disclosures one at a time on two representative pages and measures each state
— which immediately found a third: the theme row inside the dropdown is 328px
of Russian in a 302px panel, cut off at the panel edge.

AND IT RUNS IN CI. An opt-in script nobody remembers to run would have caught
none of the three overflow defects reported from a phone this month. It needs
a browser and a built server, which is why it cannot live in `verify` — so it
is its own step, against the real build.

`AGENTS.md` now opens with the four rules behind every one of these, because
they are not obvious and this repo has now made all four.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-20 07:52:58 -07:00
CatoandClaude Opus 5 2d2357ebe0 fix(middleware): a rewrite behind Caddy dialled TLS at an http socket (#55)
* fix(middleware): a rewrite behind Caddy dialled TLS at an http socket

Production 500'd for every signed-in visitor on the locale root. Signed-out
visitors were fine, which is why it shipped.

    Failed to proxy https://localhost:4025/de/portal
    EPROTO ... tls_validate_record_header: wrong version number

`request.nextUrl.clone()` inherits the EXTERNAL protocol behind the reverse
proxy, so the cloned URL reads `https://localhost:4025/...` while the app
itself listens on plain http at that port. Next does not recognise that origin
as its own, treats the rewrite as an external proxy target, and opens a TLS
connection to an http socket.

Nothing in the test suite could have caught it, and that is the part worth
recording rather than the one-line cause. The DECISION was extracted into a
pure, tested function precisely so it could be covered — and it was, including
the self-rewrite loop — but the decision was never wrong. The MECHANISM was,
and the mechanism only misbehaves with a real reverse proxy in front of it.
Neither CI nor `pnpm start` has one, and the branch only ran when a session
cookie was present, so a production build exercised in a browser was green too.

The rewrite goes. "Show a different page at the same address" is still the
right idea — it is a decision for the PAGE to make, where no URL is
reconstructed and no protocol is guessed. `lib/i18n/landing.ts` goes with it
rather than sitting unwired, which is the same defect as a health check nobody
calls.

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

* test(deploy): smoke the live site, signed in and signed out

A green deploy is not a working site, and this outage proved it in the most
expensive way available: 339 tests, lint, typecheck and a production build
exercised in a browser, all green, while the locale root returned 500 to every
signed-in visitor.

The thing that would have caught it takes one second:

    curl -H "Cookie: __Secure-authjs.session-token=x" /de   → 500

A cookie being PRESENT is enough. That is the whole trick, because the code
paths this class of bug lives in — routing, rewrites, redirects — branch on
the cookie long before anyone validates it.

So `scripts/smoke.sh` requests every page a visitor can reach by name, twice,
once each way round, and runs as a job after the deploy. A release that cannot
serve its own home page now turns the Deploy run red instead of waiting to be
noticed.

What the cookie does NOT prove, stated in the script so nobody mistakes it for
more than it is: it is not a real session. `auth()` rejects it and the page
renders signed-out. It exercises "is a session cookie present", not "is this
person authenticated". A genuinely authenticated end-to-end test needs a test
account and a real login flow, and is worth doing separately.

Also checks that `/` stays a 307 and not a 308 — caching the locale
negotiation as permanent would pin every later visitor to whoever asked first —
and reads `/api/health`'s schema verdict rather than its status code, since a
deploy that cannot use its own tables still answers 200 by design.

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 05:56:14 -07:00
CatoandClaude Fable 5.1 845ae0e87b chore: rename FleetCrown to Loki (#35)
The product was renamed on 2026-09-14: bitbaum/loki, loki.orangecat.ch,
LOKI_* env keys, loki-* units. This repo referenced the old name in
9 files changed, 12 insertions(+), 12 deletions(-).
Email addresses at the old sending domain stay until the new domain is
verified in Resend.


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

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 16:27:20 -07:00
CatoandClaude Opus 5 f317425ec8 feat(groups): humans and Heidi in one thread, on a real database (#29)
* feat(db): heidi gets a database, the way the fleet already does it

Study groups need two people to see one thread, which is the first thing in
this app that cannot live in a browser tab. So: Postgres — and following
the fleet's existing pattern rather than inventing a ninth one.

WHAT WAS ALREADY DECIDED, AND REUSED

fleetcrown's `apply-schema.sh` is a guarded, forward-only applier for
DRIZZLE apps: it applies only migrations absent from the app's
`_deploy_schema_history` ledger, refuses any migration carrying a
destructive statement, and runs the batch in one transaction. It resolves
the target database from apps.conf's `db` column — heidi's read `-`, which
is why botsmann and printcraft shipped green for months while the pipeline
never saw a migration file. That row is fixed in fleetcrown#682.

So the layout is not a preference: `drizzle.config.ts` writes to
`<app_dir>/drizzle` because that is one of the five paths the applier
probes, and heidi's app_dir is the repo root. The client is vitareba's
lazy-singleton-behind-a-Proxy, for its reason: `next build` imports every
module and the build environment has no DATABASE_URL.

PROVISIONING, AND THE BUG IT AVOIDS

The box now has a heidi role, database, pg_hba rules and credentials. The
schema step runs as the `postgres` superuser, so a table a migration
creates is OWNED by postgres and the app role is granted nothing on it —
the table exists, the connection works, every query says permission denied,
and CI cannot see it because CI's test user owns everything. vitareba has
26 tables, 10 of them postgres-owned, and an empty `pg_default_acl`: those
grants were repaired by hand afterwards.

heidi sets ALTER DEFAULT PRIVILEGES FOR ROLE postgres before the first
table exists. Verified on the box: the app role reads and writes a
postgres-owned table. `lib/db/usable.ts` asserts the same property at
runtime as the belt to that braces, since the deploy waits on health.

NO USERS TABLE

Identity stays federated; the OIDC `sub` is the actor id, stored as text
with no foreign key, because the row it would point at lives in OrangeCat.
The cost is a denormalised display name on the membership row — there is
nothing to join to — which is accepted knowingly and is cheaper than
mirroring an identity provider.

Heidi is not a member row. She is in every group by construction, so a row
for her could only ever say the same thing; she is composed into the
threadkit participant list at read time.

The rules are pure and tested without a database: a late joiner cannot read
the back catalogue (threadkit's safe default, asserted), a departed member
keeps their history and loses their voice, only the organiser hands out the
link, and the invite token is 192 CSPRNG bits kept separate from the id
because ids travel in URLs and logs.

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

* feat(groups): the queries, and a CI that actually runs the tests

The store is separate from the rules on purpose. The rules are decisions
and are tested with no database at all; this is plumbing and is tested by
using it, against a real Postgres — because every bug it can have is one
the database has an opinion about. An upsert that would violate a primary
key, a cascade that has to actually cascade, jsonb that must come back an
object and not a string: a mocked `db` asserts only that the mock agrees
with itself.

CI DID NOT RUN THE TESTS

Found while wiring the service container: the verify job ran type-check and
lint as separate steps and never ran `pnpm run test`. Every unit test in
this repository passed only on the machine of whoever remembered to run it
— 200 of them, including the dialect gate over the Swiss German copy and
the whole variety-pack suite.

That is the single failure a CI floor exists to prevent, and it is why the
house rule says CI calls the repo's own `verify` script verbatim instead of
a hand-maintained list of what it is assumed to contain. The two had
drifted, silently, in the direction that looks green.

Now: postgres:17 as a service (matching the box), the deploy's own
migrations applied to it rather than a schema written out by hand in the
workflow, and one `Verify` step.

WHAT THE STORE TESTS PIN

- Re-joining does NOT reset `joinedAt`. threadkit gates visibility on it, so
  refreshing it would hand a returning member a blank thread.
- Following an invite twice is an upsert, not a 500. (group, actor) is the
  primary key and a plain insert would break a thing that should just work.
- The group list never carries the invite token. It renders for every
  member; only the organiser holds the key to the room.
- Rotating the link kills the old one — the only way to un-invite a link
  already sitting in somebody's WhatsApp.
- The app can use its own tables, which is the postgres-owns-the-table
  failure asserted directly rather than hoped about.

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

* feat(groups): humans and Heidi in one thread

The product ask was "invite humans, and humans and AI can be talked to
together — a group chat with Heidi in it". This is that.

WHAT THREADKIT ALREADY DECIDED

Heidi does NOT answer every message in a group. With two participants she
answers every turn because she IS the conversation; with three or more she
waits to be addressed by name, because two humans talking to each other is
not an invitation. That rule was already written months ago in
`lib/domain/chat/thread.ts` for exactly this feature and needed no change —
a group is the same object with a longer participant list, which is why the
thread was modelled with threadkit rather than an array in the first place.

The composer says so under the box, because a bot that silently declines to
answer reads as broken rather than as polite.

THE LINK IS THE CREDENTIAL

A self-organised group has no approval step, so the invite token is treated
as what it is: 192 CSPRNG bits, separate from the group id (ids travel in
URLs and logs), shape-checked before any query so a hostile string never
reaches Postgres, and rotatable — the only way to un-invite a link already
sitting in somebody's WhatsApp.

Only the organiser may see or rotate it. Narrow on purpose: if every member
can re-share the key then "who can get in" is unknowable to the person
responsible for the room. A non-organiser gets 404, and so does a stranger
asking about a group — whether an id is real is not theirs to learn.

WHAT THE ROUTE TESTS BUY

The rules are pure and the queries hit real Postgres, but neither covers
whether a route CALLS the right rule with the right arguments — which is
exactly where an authorisation check goes missing. A route that forgets to
ask `mayPost` passes every other test here. `caller()` is the seam, so the
real handlers now run against the real database as any actor, including a
stranger and a signed-out visitor.

Three components were rewritten on the way. The React Compiler lint refused
fetch-on-mount, and it was right to: the group thread, the group list and
the invite token are all things the SERVER already has a session to query.
Rendering them server-side removed three effects, three loading states and
the empty flash before data arrives. The invite panel's own comment claimed
a prop would leak the token into the page source — overstated, and now
corrected: the page is dynamic, noindex, membership-checked and shows the
token in an input on that very page.

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-13 05:38:54 -07:00
CatoandClaude Opus 5 f2781fdfa8 fix(ci): never cancel CI on main — the deploy gate reads it (#10)
Second time this blocked a deploy, so this fixes the class rather than
the instance.

Deploy waits for "CI green on this commit" and reads the LATEST CI run
for the SHA. CI's concurrency group cancelled in-progress runs on every
ref, and the auto-merge sweep re-arms ci.yml on a cadence — so a merge
to main reliably produced a green CI run immediately followed by a
cancelled one, and the deploy then refused a commit whose CI had
actually passed. Both times the fix was to re-run CI by hand and
re-dispatch the deploy, which is a human doing what the pipeline should
have gotten right.

Superseding is still correct on a branch nobody gates on: a PR pushed
three times in a minute should not run CI three times. It is only wrong
where a later job reads the result.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-11 09:25:39 -07:00
CatoandClaude Fable 5.1 2c8ddce8a6 fix: the scaffold could not install as shipped (#1)
* fix: the scaffold could not install as shipped

Same two template defects diplodoctor hit today, applied before the first
deploy instead of after a 502: pnpm 11 exits non-zero on unapproved build
scripts (sharp, unrs-resolver) unless pnpm-workspace.yaml allows them, and
pnpm 11 imports node:sqlite, which needs Node >= 22.13 (.nvmrc was 20).
CI moved from the npm shape to the fleet's pnpm floor; lockfile committed
(the deploy workflow refuses a repo without one); auto-merge registered.

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

* chore: commit the tsconfig rewrite next build applies

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

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-10 12:05:01 -07:00
Cato 678bc15b1f feat: scaffold Heidi 2026-09-10 20:45:39 +02:00