Commit Graph
1237 Commits
Author SHA1 Message Date
CatoandClaude 882016e080 fix(terminal): a command is typed then entered, one Loki sheet on the phone, Keys keeps the terminal (#1316)
From a phone the owner switched the model and the session answered
"Model 'opusWhy is the name of the repo…' not found": the command and
its Enter went in one write, Claude Code read it as a paste, the Enter
became a newline, and the next message was typed after it. Then
"What's going on?" opened a sheet with a second composer and a second
model picker, which led to Loki chat and its own "Choose a model".

- Every command button types its words, then Enter as its own
  keystroke after a beat (lib/session-keystrokes typeCommand), and
  commands queue behind each other so two quick taps never interleave.
  Covers the model sheet, the commands sheet, the screen's action chips,
  the rail's "Type it" steps and a "/model opus" typed in the box.
- On a phone, "What's going on?" opens the answer: TerminalLokiRail in
  sheet form has no composer, no model picker, no run-status filler, a
  visible question button and one link to continue in Loki chat.
- Keys open hides the next-step row, so the terminal keeps its lines.
- Loki's model picker is named as Loki's ("Loki answers with"), and on
  a phone its button shows the model's name beside the count instead of
  "your key" alone.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 11:19:23 +02:00
CatoandClaude Opus 5.5 f568852158 feat(studio): approved partners keep their profile with OrangeCat (#1315)
* feat(studio): approved partners keep their profile with OrangeCat

The owner chose: applying stays link-only, no account; once approved, a
partner connects their OrangeCat account so a lost link is not a lost
profile.

- studio_requests.orangecat_actor_id (migration 0117), set only on an
  approved, open partner application, never to a second identity.
- POST /api/studio-portal/[id]/connect checks the private key once and
  returns a fifteen-minute signed link to /studio/connect; the key never
  travels to Loki's sign-in pages.
- /studio/connect signs the partner in with OrangeCat (one button) and
  ties the application to that identity, then sends them back to the
  portal. /studio/partner lists a signed-in partner's connected
  applications and reopens one with a fresh private link (the old one
  stops working, as with email recovery).
- The portal view says whether OrangeCat is connected.
- Also: an approved partner who skipped the course now sees their
  assigned briefs; the portal still asked for a course pass there.

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

* style(drizzle): format the generated migration meta

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

* test(responsive): measure the studio partner's OrangeCat pages

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 11:15:23 +02:00
CatoandClaude 9e5319a9f8 fix(terminal): model chip in both views, commands as a sheet, nothing jumps when you type (#1314)
From a phone the owner could not switch models in the Terminal view, and
the screen jumped around whenever the keyboard came up.

- The model chip is in the Terminal view too. TerminalSessionInfo reads
  Claude Code's log itself, because the terminal view has no
  conversation loaded. The box's row is now identical in both views:
  attach, commands, model, microphone, send. The chip names only the
  model, so it fits.
- Keys moved onto the terminal's bottom corner. It acts on the screen,
  and in the row it squeezed the model's name to "Op…".
- The slash button opens a bottom sheet instead of a panel pinned above
  the box. The pinned panel ran over the header with the commands
  clipped. Its search no longer grabs the keyboard on a touch screen.
- While the phone keyboard is up, the app bar and the Chat/Terminal
  switch step aside, and the next steps go to one sideways row, so the
  terminal keeps its height.
- The conversation tab reads "Claude" from the first frame instead of
  "Chat" turning into "Claude".


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 06:28:15 +02:00
CatoandClaude 27eb8f1e24 feat(studio): partners are approved on their work; the course is optional (#1313)
The owner asked for qualified builders not to be forced through the
systems design course, while still offering it, with its exam, to anyone
who wants to learn or earn a credential.

- approve_partner no longer requires a course pass; approval is a person's
  decision on the applicant's work. The directory, availability and
  delivery no longer require it either. The directory returns
  coursePassed, so a profile can show the credential.
- Course evidence can be submitted at any stage, an approved partner
  included; it never resets approval or a published profile. A course
  review checks the evidence that exists, not a live fetch of today's
  course, which used to block every review when the site was slow or the
  course moved on.
- A new partner application starts "applied" (old rows keep their status,
  with words that now say the same). The intake no longer fails when the
  course is unavailable.
- The applicant is emailed when the studio says something they can see
  (decision, review, note), if they gave an address. The private key is
  never in the mail; it points at the first mail and at recovery.
- /feedback/studio opens the request a notification links to, offers
  approve or decline without a course gate, the course review only when
  there is evidence, and publishing only for an approved profile.
- The concierge states the new terms.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 06:14:17 +02:00
CatoandClaude 071ef57447 fix(session): switch to Fable or Opus from the phone, see it confirmed; the terminal says it is opening (#1312)
From a phone the owner could not switch a session from Fable to Opus, and
opening the terminal showed a black pane before the screen appeared.

- The model sheet offers each family by Claude Code's own alias: Fable,
  Opus, Sonnet, Haiku. Fable was missing. Versions are never written
  down, because the aliases resolve to the newest model in each family.
- Claude Code's own "Set model to Opus 5.5", "Set effort level to high"
  and refusals ("Model 'x' isn't available for your account") are read
  from the session log as setting items. The sheet settles on them at
  once and shows a refusal in Claude Code's words. The conversation
  gets a quiet line where the change happened. A runner too old to send
  these items still settles on the next answer.
- The chip reads "Model · Auto" instead of "Model? · Auto".
- The box's book button is now a slash button labelled "Commands and
  prompts". It always opened the agent's commands above the library.
- The terminal pane says "Opening the screen…" until the first frame.
  The server remembers each session's last screen, and a new viewer sees
  it at once, marked "Last screen · updating", until the runner's live
  replay lands. A remembered screen never counts as proof of life for
  the stall watchdog, and closing a session forgets it.
- The conversation view's wait reads "Opening the conversation…".
- Fleet Runner 0.8.46 carries the log reader.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 20:09:04 +02:00
CatoandClaude 07f182edfd fix(watch): a preview's run ends "Live on <address>", not "Nothing reached GitHub" (#1311)
A preview is a folder Loki serves as it is saved: no repository, so no pull
request, merge or deploy follows a run. The delivery track still looked for
one, and Center SOM's redesign — which finished well, 41 pages screenshotted
and checked — read "Nothing reached GitHub · failed" on Watch and in the chat
card. A run on a preview folder (isPreviewDir) now tracks asked → builder →
working → live, and settles when it finishes.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 19:11:29 +02:00
CatoandClaude Opus 5.5 071e0ddbe9 fix(runner): a day-old Claude with no status file no longer holds every runner update (#1310)
* feat(previews): a status mode that says where a change sent with `ask` is

An ask to a preview's builder answers with a runId and a commandId, and
nothing could read them back from Actions: a change that had not landed after
half an hour was waiting, running or failed, and there was no way to tell.
`status` reads the run (and the queued command) through the deployed app as
the operator, the same way the other modes act.

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

* feat(previews): status also says whether the cloud builder is running and what its update drain last did

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

* feat(previews): status shows the runner restart's state and each agent the drain waits on

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

* fix(runner): a day-old Claude with no status file no longer holds every runner update

The drain restarts the box runner only when no agent is working, and a Claude
with no status file counts as working ("unknown is not idle"). Two such
processes, 6 days and 1.8 days old, held the drain open while all six other
agents sat idle: the runner stayed on 12 October's code, and since the
commands route holds new work for a builder that is behind
(src/lib/runner-update-hold.ts), no new task started on the cloud builder
at all. Center SOM's change sat "Waiting for a builder" for over half an hour,
and so did everything else.

Every current Claude writes its status file for as long as it runs, so one
that has written none for a day (LOKI_RUNNER_LEFTOVER_SECS, default 86400) is a
leftover — a session from a CLI that predates the file, or a helper — and no
longer holds the restart. A young one with no file, a Claude whose file says it
is working, and every other agent CLI are still busy. Pinned in
test-drain-and-restart-runner.sh.

Also on this branch: previews.yml `status` (a run's state, the queued command,
the runner, its drain and each agent's status — names and states only), which
is how this was found.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 18:27:22 +02:00
CatoandClaude 48dbead196 feat(previews): built to a design standard, looked at before done; chat screenshots reach the builder as images (#1309)
Center SOM's preview passed every rule in the build brief and its owner still
called it cramped and not beautiful: the text ran to the screen's edge and the
headline was a five-line search-engine title. The brief said what a preview
must get RIGHT and nothing about what makes it GOOD, and nothing ever looked
at the result.

- The brief now carries a design standard (page gutter and a readable measure,
  type sizes and line height, short headlines, one spacing scale, one primary
  button, real photos cropped to consistent shapes) and a last step: screenshot
  every page at 390 and 1440 px with the box's headless Chromium, judge it as
  the owner would, fix and look again.
- A screenshot sent in the Loki chat about a project now reaches its builder
  as the image itself (staged like the session box's: the runner writes the
  file, the prompt names its path). Before, the builder got only a vision
  model's paraphrase, and "the text is cramped" did not survive it. The
  description still serves the chat itself (choosing the project, the reply).
  injectPrompt and the queue carry `attachments`; a prompt with images is
  always queued for a runner (a live PTY would get unresolved placeholders),
  and the hosted builder, which has no runner to write files, is told plainly
  that the screenshot could not be delivered.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 17:48:22 +02:00
CatoandClaude 80deb99c5d fix(chat): no invented sign-ups or advice, no bold, no dead addresses (#1308)
Seen live 2026-10-18 on bitbaum.orangecat.ch: the concierge told a visitor
to "sign up" for Diplodoctor (it needs no account), said Causius would
"advise" them (it gives no legal advice), and printed **bold** as asterisks.

- Two rules: never tell a visitor to sign up, register or install anything;
  no product gives medical, legal or financial advice — say what it reads,
  explains or drafts, and that a professional decides.
- stripEmphasis removes markdown emphasis the widget would print literally.
- reachableLinks asks each project link a reply attaches whether its address
  answers (cached ten minutes, a slow wake counts as up) and falls back to
  the public profile when it does not. Only attached links are asked, never
  the whole map, so sleeping sites are not kept awake.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 17:30:27 +02:00
CatoandClaude b617187cfe fix(chat): a Builder who owns nothing is never told to install the desktop app (#1307)
Re-walking as a new Builder after #1304, live: Today, Control and the ask box
on the project worked, but the chat still answered "requires the Loki desktop
app ... the only way" — its "can work start" line said exactly that for an
account with no builder, and outweighed the shared-project facts. And a build
that could not start handed the Builder the owner's chore ("add a Git URL,
then Implement").

- builderStatusLine takes the account's shared projects: they build on their
  owner's computers, nothing to install, ask on the project's page — said
  first, before the line about a project of their own. The fleet fact and
  the brief both pass it.
- askReply tells a Builder whose build could not start that the owner has
  been told and will start it, never the owner's own instructions.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 14:13:47 +02:00
CatoandClaude 5359720879 fix(register): a project says what it is from its README, and Diplodoctor and Causius are live (#1306)
Found 2026-10-18: diplodoctor.orangecat.ch and causius.orangecat.ch have
been running since 2026-09-10 (health green, changelogs moving), but the
fleet map — and so bitbaum.orangecat.ch and the public chat — still said
"prospect" / "validating", and Diplodoctor's description and identity still
told its first idea: cross-border healthcare and medical tourism.

- The map's `what` reads the README's opening paragraph first, the way the
  roadmap and changelog already come from ROADMAP.md and CHANGELOG.md
  (repo-records.ts: readmeLead). Headings, badges, lists, code, generator
  boilerplate and sentences meant for contributors ("defined in HEIDI.md",
  "Built with Next.js") are skipped; the stored description is the fallback.
  Audited against the fifteen shown projects: the README was right in every
  case where the two disagreed (evig, Hirnli, Diplodoctor, Causius).
- Migration 0116: Diplodoctor's project gets its repository link (it had
  none, so Loki never read its README, roadmap or changelog) and its public
  identity is rewritten from its README. The replaced texts are kept in the
  migration's comment.
- apps.conf: diplodoctor prospect → live, causius validating → live. Both
  are served products in beta ("live" means served, not released). They
  stop sleeping when idle, like Heidi. fleet-sites.ts regenerated; the
  public footer gets their names and a line each from their own headlines.

Tests: repo-records covers the lead (heading glued to its paragraph, badges,
contributor sentences, boilerplate, the length cut) and the third fetch.
tsc, eslint, prettier, fleet-map, fleet-register, fleet-sites-derived and
widget-chat-concierge pass.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 13:41:15 +02:00
CatoandClaude adfbdcfe07 fix(session): the builder updates, the sheet changes things, one box, a preview is the site (#1305)
The owner used Loki from a phone (2026-10-18) and could not tell whether
anything worked. Four separate faults, each passing every check:

The cloud builder ran code days behind the app. Its restart waits for
every agent to be idle, and autopilot refilled the queue the instant one
finished: ten consecutive deploys (23:38 → 09:12) found "2 agent(s)
working — deferring restart". Hence "Model: not known yet" of an answer
the screen was showing. Now, while the cloud runner's heartbeat version is
behind the deploy's, the commands route hands it no work-starting
commands (dispatch, launch_agent, auto_continue, browser_task) — a
person's own words into a session still go through — so the idle moment
comes, the restart lands, the queue resumes on the new code. Server-side
on purpose: a runner-side rule would have waited for the very restart it
was meant to allow. Control's builder line says "a newer version waits
for its agents to finish" meanwhile.

An agent renamed a preview site, committed, and reported "the work lives
only on this machine — tell Loki where this preview's remote should
live". The box contract says push or fail loudly; a preview folder is
served from disk and has no remote by design, so the change had been live
since the save and the owner read a failure and a chore. Every dispatch
to a preview folder now carries "Where this goes" (lib/previews/
delivery-note), and the contract has the same section.

The session sheet's Change and Set typed /model and /effort into the
terminal and closed; Claude Code drew its picker behind the conversation
and nothing on screen moved. Each row now lists its choices; a tap sends
the command with the choice named (/model sonnet, /effort high), the
sheet stays open and says what is changing, and settles when the log
names it. The sheet is built like the Settings sheet.

The session box had a 26px library button beside 44px round ones, a 36px
chip and a 34px Keys pill, the microphone second from the left in one
view and beside Send in the other, and "claude" on the tab beside
"Message Claude…". One row, one size, one order in both views; the
agent's name everywhere (terminal-strip-tabs badgeNames).

Widget: the owner's change list reads what needs them first (the line
counted nine, the list showed none); "9 needs you" → "9 need you"; a
failed call is named ("my call to Loki to save your note failed… Your
words are still here — press it again") instead of "one of my calls to
Loki failed — nothing for you to do".

Tests: runner-update-hold, preview-delivery-note, owner-changes-order,
session-sheet-browser (new); builder-presence, widget-changes,
widget-self-report, inject-context-boundaries extended.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 13:37:05 +02:00
CatoandClaude 2ff657ecf8 feat(projects): a Builder asks for a change from Loki, not only from the site (#1304)
Walking the loop as a new Builder on a shared project (live, 2026-10-18):
the project's orange "Ask Loki" opened the chat in the member's own
account, which has no builder for the project, and it answered "edit the
site's HTML/CSS ... requires the Loki desktop app". Today said "Add a
project" and Control said "Connect a builder ... install the desktop app".

- The project page has the box to ask in (#ask, THE composer, voice on).
  POST /api/projects/[id]/ask files the same row the widget would: built
  at once on the owner's builder for a Builder (owner told), waiting for
  the owner for anyone else. The reply says which, with a link to follow.
- The header sends members to that box ("Ask for a change"), and a tab
  can own in-page anchors so #ask opens Overview from any section.
- Today and Control show the projects shared with you instead of the
  first-run "Add a project" and the desktop-app pitch.
- The chat's facts name each shared project and where it is changed.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 13:28:33 +02:00
Catoandgithub-actions[bot] 1329638563 chore(starter): sync scripts/site-template to bitbaum/fleet@b350be9d69 (#1303)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-18 11:09:14 +02:00
CatoandClaude Opus 5.5 44def109a9 feat(widget): a spoken walk read as a list, whole sentences, talk from the launcher, per-page builds (#1302)
* feat(widget): one Talk bar, status header, read-back, per-page builds

- One Talk to Loki bar above a one-line message box; the box shows its
  tools only once used. The second Talk button in the thread is gone.
- The owner's header is the status (Watching / 2 to look at), Pause, close:
  no second logo, no page line. Opening on a phone no longer raises the
  keyboard.
- A spoken note is read back as a list per part of the page, with Read it
  back (speech) and Edit.
- Build all starts saved notes as one build per page (dispatchFeedbackBatch,
  shared with the project batch route).
- Regex literals use \u escapes; a test fails on non-ASCII in the bundle.

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

* feat(widget): a walk read as a list, whole sentences, talk from the launcher

- Loki's read of a spoken note is a list: one change or question per line,
  with where it applies, editable, ✕ to drop. The part on screen is
  background; a line names a part only when it was pointed at.
- Save files each change as its own note, with only the moments it came
  from, on the page it was said on. Questions stay on the card for Ask.
- Whisper's segments are joined into whole sentences before they are placed
  under a heading, so a sentence is never cut across two parts.
- The owner can start talking from a microphone beside the launcher without
  opening the panel (widget/quick-talk.ts).

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 10:34:38 +02:00
CatoandClaude 27edda407a fix(previews): the owner's check prints what the page calls itself (#1301)
`check` proved the site, the tour and its pictures answer, but not what the
page says, so a preview renamed to fix a misspelt store name (Центр СОМ, not
center-com) could not be confirmed without opening it. It now prints the
home page's <title> and first heading.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 09:00:43 +02:00
CatoandClaude Opus 5.5 da75cbd356 fix(phone): one row of widget header, room to type, the tab not the pill, one menu (#1297)
* fix(phone): one row of widget header, room to type, the tab not the pill, one menu

The owner on a phone, on Loki's own Control (2026-10-18): "this looks
disgusting… why is it so crowded?"

Widget panel (owner):
- The status line IS the header: the brand row and the page name above it
  are gone for the owner (a visitor keeps them). Close sits at its end.
- The line carries one number of one named thing: "11 changes need you",
  "2 being built", "noticed 2 things" — not "4 to look at · 11 needs you".
  It wraps to a second line on a narrow phone instead of cutting the noun.
- Typing is one state however the keyboard is drawn. Loki's pages shrink
  for the keyboard (interactive-widget=resizes-content), so the inset check
  never fired, the sheet stayed at 68% of a halved viewport and the thread
  was a one-pixel sliver. A focused box now fills what is visible and steps
  the extras aside; the sheet resets on close.

Launcher: the phone bottom bar asks for the edge tab (data-fc-place="tab"),
so the "Watching" pill no longer floats over Control's cards. An open dialog
still wins over a later region's tab (resolvePlaceDirective).

One menu on a phone: the Profile/Chat/Control/Terminal strip no longer
renders below md (the bottom bar is the menu there), nor on /control, where
it named one remembered project above a page about all of them.

Control: "Default agent and model" moved into the Settings sheet the foot
already opens, and the foot is the page's last line (shown with no projects
too). The sort and Select row of the project list is desk-only.

Tests: new widget-owner-phone-browser (fails on the old header and on the
old sheet); nav-surfaces and phone-chrome guards updated to the new rules.

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

* fix(widget): keep buildShadowCSS within the function-length limit

The owner-header rules took buildShadowCSS to 516 lines (limit 510); the
same rules, compacted onto two lines in the file's own one-line style.

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

* test(widget): wait for each state, not a clock, in the owner phone test

CI runs it beside every other unit test on two cores, where the owner's
changes arrive late; fixed half-second sleeps failed there (its own output
showed only a closing brace). It now waits for the status line, the typing
state and the edge tab, and prints a one-line reason last if it fails.

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

* fix(widget): the keyboard, not the focus, decides the typing layout

CI's fonts left the thread 44px at 320px with the keyboard up: the composer's
"This page / Point to area" row cost the room. It steps aside while the
keyboard is up, with the starters. And the typing layout now follows the
keyboard (the visible area well below its tallest), not focus alone:
Android's back key drops the keyboard but keeps focus in the box, and the
extras then come back. The phone test checks both.

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

* test(widget): the thread must show what it holds, not be 60px tall

CI's thread held 44px of text and showed all 44px — content-sized, not
squeezed. The check is now what the bug was: a thread showing less than
min(60px, what it holds). The original sliver (1px of 64px) still fails it.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 08:48:33 +02:00
CatoandClaude d22f176f01 fix(widget): the spoken-note read names the pages and finds the asides (#1300)
Checked live with the owner's own Petvity walk the minute #1299 deployed:
the read came back as their last sentence copied verbatim — "look at all
these things and let me know what you think" — with no pages, without
"the design is inconsistent", and no asides, though "No, no, I'm just
making a coffee" was said twice to someone in the room. Right kind
(question), useless ask.

- The strong model (gpt-oss-120b, medium reasoning): one call per spoken
  note, read by the person before anything is built.
- The instructions say what the grouping means ("On /path — heading")
  and that the ask must stand on its own for someone who never heard
  the recording: this / here / these things become the pages and parts
  by name, the observation stays in the ask, a sentence that only makes
  sense with the recording is never copied. Asides name the kinds that
  were missed: answering someone else, narrating where one goes.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 08:44:36 +02:00
CatoandClaude 09e04ab4ed feat(widget): Loki reads a spoken note before it is saved (#1299)
The owner walked Petvity for 43 seconds on 2026-10-18 — the home page,
Features, the dashboard, Settings — saying the design was inconsistent
and asking Loki to look at it all and say what it thought, then asked
whether Loki had heard them at all. It had, and it had watched: every
page and part was noted. But the card was every word verbatim under each
part of the page, including "No, no, I'm just making a coffee", said
twice to someone in the room; it led with Save and Fix it now for what
was a question; it sat under three "Loki noticed" cards, one of them
repeating the same finding; and replaying the walk showed every sentence
filed one page early.

Loki reads it first (widget/walk-read.ts, POST /api/widget/understand,
guarded like /api/widget/advise):
- The card says what it heard: "Loki heard you · 0:43 across 4 pages".
- The box leads with the ask, editable; what was not meant for Loki is
  named as "Left out"; the words as spoken stay under "Word for word"
  with "Use my exact words instead". Whatever is saved, the words as
  spoken still travel with it in each moment's `said`.
- A question leads with Ask Loki, answered about every page of the walk
  (the walk is sent as the review session); a change leads with Save
  (owner, then Fix it now) or Save feedback (visitor).
- Nothing waits on the read: while it comes and when it fails, the card
  is the words as spoken with the buttons as before; words edited before
  it arrives are never replaced.
- The card is brought into view from its top when it appears and when
  the read redraws it, without throwing the phone keyboard up again.

Walk alignment: a page change is noted the moment the address changes
(a site's own links change it without an event; polled every 250 ms
while recording, popstate too). It used to wait for scrolling to settle,
so the first words on each new page landed under the page before.

A site-wide finding (the page's language) is said on the first page of a
visit, not on every page (onceSiteWide in watch-trail.ts).

Tests: widget-walk-read (rules, prompt, wiring), widget-walk-read-browser
(the owner's walk replayed at 390 and 320: question, change, and words
edited before the read), widget-browse-voice-browser updated for the new
header and the read-fails path.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 08:28:26 +02:00
CatoandClaude fd5164981b feat(previews): private tiles get real pictures; a preview can move to its right name (#1298)
Private tiles on bitbaum.orangecat.ch/private/ now render through the same
tile as the public work grid (bitbaum PR #136). This adds the picture they
show: GET /api/fleet/private/shot/<slug>, owner only, a 1280x800 picture of
the project's site (a preview through Loki's own route with the owner's
cookie, its widget left out), kept for twelve hours. A site behind its own
access-code page is not photographed, so its tile is text, not a code page.
takePagePicture takes a viewport; wider than a phone is a desktop browser.
The owner check is one helper (studioOwnerCheck) shared by the list and its
pictures.

A preview can now move: POST /api/previews/<slug>/move { to, name } attaches
the new address, renames the folder, moves the project row and its name in
one transaction (the folder moves back if that fails), points the widget at
the new address and detaches the old one. Center SOM was born center-com-3
from a domain spelled in look-alike Latin letters; this is how it becomes
tsentr-som. previews.yml gains `move` and `ask` (send the builder a change).

A website preview's one line names the site by host ("center-com.ru"), not
by its URL.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 08:21:56 +02:00
CatoandClaude ee54011517 feat(widget): plain words, and talking as the way in (#1296)
The owner (2026-10-18): make it easy to understand, easy to use,
pleasant and exciting.

- What Loki notices is said in plain words. "2 tap target(s) are under
  24px and crowded… at 7×48" reads "2 buttons are small and close to
  others, so a thumb easily hits the wrong one"; "<html lang>" reads "the
  page does not say which language it is in". The exact finding stays
  the fix request a builder gets and the key a finding is recognised by
  (plain-checks.ts; widget-plain-checks pins both, and that every
  template page-checks writes has a rule).
- Before anything is said, the panel opens with one big, friendly
  "Talk to Loki" card: scroll around and say what you'd change. Talking
  was a small mic among the composer's tools.
- The owner's greeting is one short sentence; a change going live is
  announced with "Done —".


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 07:52:05 +02:00
CatoandClaude d079f972ab feat(widget): one widget everywhere, the state in every shape, record now and build later (#1295)
The owner (2026-10-18): the widget looked different on different pages
and sites, it should always be clear when Loki is watching, and they want
to record comments while it watches and implement them afterwards.

One widget, everywhere
- Loki's own site draws the same panel every customer site gets, not the
  chatkit view (data-fc-chat="kit" stays an opt-in).
- No Loki page hides the launcher any more: the project workspace, the
  agent conversation, inspection, the project loading state and an open
  /loki conversation were "hidden" — no launcher, or the watch top bar
  instead. They show the edge tab. feedback-widget-reach fails on any
  page that hides it, in either the literal or the expression form;
  only an open dialog and the sign-in wall may.

The state in every shape
- The owner's edge tab carries the same live dot and ring as the corner
  pill, at full weight.
- The owner's pill sits in a bottom corner or becomes the tab; it no
  longer climbs to the middle or top of the screen (Heidi at 390px).

Record now, build later
- After a voice note the owner's card leads with Save (then Fix it now,
  Ask). Saved notes lead the status line ("Watching · 3 notes saved"),
  and "Build all 3 saved notes" starts each as its own build, oldest
  first: POST /api/widget/owner/build, rule in lib/feedback/saved-notes.ts.
- The owner check for the widget's owner routes is one helper,
  lib/widget/owner-request.ts, used by owner/changes and owner/build.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 06:08:34 +02:00
CatoandClaude Opus 5.5 925ab930be feat(ai-budget): newcomer reserve in the free pool + fix(billing): payments stay off until switched on (#1294)
* feat(ai-budget): keep a fifth of each day's free pool for people on their first week

Pacing keeps the day from being spent before lunch, but not by evening:
there is no clawback, so whoever signs up at 21:00 can meet a pool the
vendors have already refused — a first answer that never comes, which is
the moment a person decides Loki is broken.

lib/ai-budget/newcomer-reserve.ts: returning accounts together stop at 80%
of the day's capacity; an account under seven days old may draw on the
rest, still under its own fair share. getDayUsage now also returns the
day's total (same query as the active count). The gate reads the
account's age only once the total reaches the held part, and fails open
if it cannot; a paid plan with allowance left is not held back. The
refusal says what the held part is for, when the day starts over, and the
ways past it; the budget screen reads the same rule, so it never shows
"12 left" to someone the gate will refuse.

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

* fix(billing): payments stay off until switched on, whatever pay URLs are set

Live after #1293: every paid plan's button on /pricing read "Pay in
Bitcoin" and went to an OrangeCat product page that answers 404. The
three ORANGECAT_PAY_URL_* were set on the box before the passes existed;
while the tiers had no price that was invisible, and setting the prices
turned the dead links on — skipping the reservation flow they were meant
to fall back to, and showing "Buy" in Settings → Billing too.

orangeCatPayUrl now also requires LOKI_PAYMENTS_OPEN=1. Opening payments
is a decision (the company registered, the passes live), so it is a
switch, not an inference from a URL. Until then every paid plan's button
reserves, as designed.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 01:35:23 +02:00
CatoandClaude Opus 5.5 95ec4a8375 feat(plans): CHF 15 / 40 / 90 with a monthly AI allowance, reservable until payments open (#1293)
* feat(plans): CHF 15 / 40 / 90 with a monthly AI allowance, reservable until payments open

The founder set the prices on 2026-10-17. Payments stay off until Loki's
company is registered, so everything up to the moment of paying works and
nothing is charged:

- config/plans.ts: Personal 15, Pro 40, Team 90 a month; each states its
  monthly allowance. The billing note says payments are not open and that a
  plan can be reserved with nothing charged.
- lib/plan.ts: PLAN_LIMITS.aiAnswersMonthly (1,000 / 3,000 / 8,000 at
  8,000 tokens an answer — about $0.002 each on a paid open model, a
  fraction of the price).
- lib/ai-budget/plan-allowance.ts + gate: past the daily free share, a paid
  plan's month still admits the turn. Read only after the share refused, so
  a free turn never pays for it; a failed read leaves the refusal standing;
  a lapsed or past-due plan has none.
- /pricing: four priced cards. A paid plan's button opens /pricing/<plan>,
  which reserves it (plan_reservations, one row per person, grants
  nothing) — and reads "Pay in Bitcoin" the day its OrangeCat pass exists.
- The out-of-answers refusal and the budget screen offer the plans beside
  the person's own key; Settings shows a plan's allowance left this month.
- Settings → Billing links each plan's reserve page; System → Revenue shows
  who is waiting on which plan, and counts only plans a settled pass pays
  for (a hand grant is "granted", not revenue).
- docs/architecture/models-and-money.md follows the decision.

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

* test(ai-budget-gate): answer the plan read without a database

The gate now asks a paid plan's allowance after the share refuses. The
existing gate tests did not inject it, so where CI has a real Postgres the
default read opened a pool that kept the process alive and the runner
timed the file out. Every call now passes `planAllowance`, as the file
already does for the ledger and the capacity.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 01:08:13 +02:00
CatoandClaude 59c9b9d46c feat(ai-budget): size the free pool from what the vendors say, not only the config (#1292)
The fair share divides `dayCapacityTokens()` — Groq 100k, Google 50k,
OpenRouter 100k, figures set before any vendor had been heard from. On
2026-10-17 the platform keys had served 357,184 tokens by the evening
against that configured 250,000 (Google alone 96,206 of its "50,000"),
while people were being told the pool was nearly spent.

lib/ai/observed-capacity.ts (pure) reads three witnesses, each a floor:
- a daily TOKEN ceiling the vendor stated, summed per model (Groq meters
  each model separately);
- a daily REQUEST ceiling, counted once per vendor (OpenRouter's is
  account-wide), at what a call costs there today; where both are known
  the smaller binds;
- what the vendor already served today.
The configured figure stays the floor; an operator's explicit
LOKI_<VENDOR>_DAILY_TOKENS still wins outright.

lib/ai/free-capacity.ts caches it for five minutes and falls back to the
configured figure on any error; the gate, the budget screen and the
visitor chat all divide the same number.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 00:37:03 +02:00
CatoandClaude f90724d3bf feat(ai): show what is left on your own key, in your vendor's numbers (#1291)
Loki puts no cap on a key the person brought, so "how much do I have
left?" is a question about their account at the vendor — a Groq free-tier
key stops at Groq's own daily ceiling whatever Loki does. The vendor
already says how much is left on every answer, in the same rate-limit
headers the free pool is read from; own-key calls simply skipped
recording them.

They are now recorded under the person's id (provider_quota.key_owner,
which was built for this and never written), never into the pool's rows,
and Settings → AI and the model picker say it:

  On your Groq account: 840 of 1,000 requests left today · refills in 9 hours.

A spent counter leads whatever its window (it is the one refusing); stale
readings say nothing, rather than an invented number.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 00:03:27 +02:00
CatoandClaude Fable 5.1 c7e66e5bf9 fix(widget-chat): a project page answers about its project, and a served prospect is not "not built" (#1289)
* fix(widget-chat): a visitor's brief is client work, and the chat never names one

Seen live on bitbaum.orangecat.ch, 2026-10-17: with no model available the
site chat answered "look at Loki, derhochhinhousepartyrenner-ch-refresh-
68e1f49… or revamp-info". That slug is a stranger's website request that
startBriefProject turned into a project with no client flag, so it reached
the public fleet map and the concierge's keyword fallback.

- startBriefProject marks every brief project client_work = true: it is
  someone else's site on the studio's account, off every public surface
  until they agree (src/lib/register/client-work.ts).
- Migration 0113 backfills the flag on rows a brief already created
  (briefKind metadata, or a `<host>-refresh-<32 hex>` name) where no
  explicit answer was recorded.
- The concierge holds the same line itself: no unconsented client work, no
  project still named by its request id, no purpose that is the kickoff
  prompt — in the facts, the links and the fallback.
- The fallback no longer announces itself as broken ("A full answer isn't
  available right now"); it names the closest fit and says to ask again.

Tests: scripts/test/widget-chat-concierge.ts covers the brief, the
unconsented client and the wording.

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

* fix(widget-chat): a project page answers about its project, and a served prospect is not "not built"

Tested live on bitbaum.orangecat.ch, 2026-10-17: on /diplodoctor/ "What does
this do?" was answered with a question back, and on /heidi/ "Is it free?"
sent the visitor to build something of their own. The model had no rule for
the page it was told the visitor was on.

- On a project's own page (bitbaum.orangecat.ch/<slug>/, not a site section)
  the system prompt adds: a question like "what does this do" or "is it free"
  is about THAT project; answer from its facts first, name it for the link,
  never ask what they want to do, never redirect to self-build. Nothing on
  the site is sold.
- A "prospect" that answers at an address is "named, with only an early
  version to look at", not "named but not built": Diplodoctor runs at
  diplodoctor.orangecat.ch and the chat refused to send anyone there.

scripts/test/widget-chat-concierge.ts covers both.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 22:41:32 +02:00
CatoandClaude 5d3e7c7f87 fix(widget-chat): a visitor's brief is client work, and the chat never names one (#1283)
Seen live on bitbaum.orangecat.ch, 2026-10-17: with no model available the
site chat answered "look at Loki, derhochhinhousepartyrenner-ch-refresh-
68e1f49… or revamp-info". That slug is a stranger's website request that
startBriefProject turned into a project with no client flag, so it reached
the public fleet map and the concierge's keyword fallback.

- startBriefProject marks every brief project client_work = true: it is
  someone else's site on the studio's account, off every public surface
  until they agree (src/lib/register/client-work.ts).
- Migration 0113 backfills the flag on rows a brief already created
  (briefKind metadata, or a `<host>-refresh-<32 hex>` name) where no
  explicit answer was recorded.
- The concierge holds the same line itself: no unconsented client work, no
  project still named by its request id, no purpose that is the kickoff
  prompt — in the facts, the links and the fallback.
- The fallback no longer announces itself as broken ("A full answer isn't
  available right now"); it names the closest fit and says to ask again.

Tests: scripts/test/widget-chat-concierge.ts covers the brief, the
unconsented client and the wording.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 22:02:45 +02:00
CatoandClaude Fable 5.1 0193617710 fix(build): the standalone carries Playwright, so the box can take pictures at all (#1286)
* fix(deploy): install Chromium with the app's own Playwright; /api/health says whether pictures work

Every picture on the box answered no-browser. The deploy installed Chromium
with the runner's Playwright, which npm resolves from package.json's ranges
(there is no package-lock.json), while the app is built from pnpm's lockfile:
two versions, two Chromium revisions, and the app never found the one that
was installed. The install now runs the Playwright the standalone ships, as
the app user, and a failure's output stays in the deploy log.

/api/health carries `pictures` (Playwright present, the browser path, ok), so
a server that cannot photograph a page says so on the one line everyone
reads. A missing Playwright is its own reason (no-playwright); the two places
that word a missing browser treat it the same.

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

* fix(build): the standalone carries Playwright, so the box can take pictures at all

/api/health read pictures.playwright=false after #1285: the standalone build
never contained Playwright. Being in serverExternalPackages makes the bundler
leave it alone; it does not make the tracer copy it. outputFileTracingIncludes
now names it (and pnpm's real files under node_modules/.pnpm) for every route,
and playwright moves from devDependencies to dependencies, which is what it
is: a runtime need of the server.

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

* chore(control): regenerate control-states.generated.sh (awaiting_you was added to the source, not the output)

The build's prebuild regenerates this file from the TypeScript states; main's
copy lacked the awaiting_you state, so every local build left the tree dirty.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 21:34:42 +02:00
CatoandClaude f80a315212 feat(control): the top of Control is the work being done for you, each job a tap from watching it (#1275)
The owner, on his phone (2026-10-17): "I see Building, I tap it, and I
expect to see how it's building — the chat or the terminal. Here there is
just so much… scary to non-technical users." The hero said "Building · 1
agent working" and could not be tapped; under it sat a builder sync line,
three counters, a Workspaces list and a "Recent activity" log of the raw
prompts sent to agents, safety fences included.

- ControlNow: one card per job being built — what it is, what the agent
  is doing right now, how long — and the whole card opens the live
  session as a conversation (/terminal?project=…&view=chat&run=…). A job
  waiting for your answer leads with the question and says "Answer it".
- ControlDone: the last day's results, what came of each (merged and
  deployed, partly done, stopped) and where to look: the site, the change,
  the conversation. Replaces "Recent activity".
- ControlFoot: builder state, New project and Settings in one quiet line.
  The hero now speaks only for alarms or when someone is needed;
  Workspaces is desktop-only.
- Titles (lib/task-title): a run named from its prompt the way a person
  would — a feedback fix is the report, an owner's decision is THE ASK, a
  site brief is its first line with the link as a domain. Never the prompt.
- Live step without a viewer (lib/run-step): the runner's progress beat
  reads the tail of the agent's own session log and sends "Editing
  Header.tsx"; the server keeps it on the run (payload.lastStep) and
  /api/control returns it with the run's id, outcome, title and last beat.
  Fleet Runner 0.8.44.
- The project the page auto-selects no longer becomes "your project" in
  the Profile · Chat · Control · Terminal strip; only one you open does.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 21:21:56 +02:00
CatoandClaude 33ca923cad fix(deploy): install Chromium with the app's own Playwright; /api/health says whether pictures work (#1285)
Every picture on the box answered no-browser. The deploy installed Chromium
with the runner's Playwright, which npm resolves from package.json's ranges
(there is no package-lock.json), while the app is built from pnpm's lockfile:
two versions, two Chromium revisions, and the app never found the one that
was installed. The install now runs the Playwright the standalone ships, as
the app user, and a failure's output stays in the deploy log.

/api/health carries `pictures` (Playwright present, the browser path, ok), so
a server that cannot photograph a page says so on the one line everyone
reads. A missing Playwright is its own reason (no-playwright); the two places
that word a missing browser treat it the same.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 21:17:22 +02:00
CatoandClaude e8de30489d fix(widget-chat): a door the answer names gets its button (#1282)
Live, the bakery answer said 'use the "Build something of your own"
option' and showed no button: doors were linked only by their keys, never
by their own label. And 'what is bitbaum?' named four projects before
'See all projects', which the four-link cap then dropped. Doors now match
by label, and a named door is never pushed off the end by named projects.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 20:53:28 +02:00
CatoandClaude 0944fc41e6 fix(previews): a picture is taken once the page has loaded, and a missing one says why (#1281)
The tour's pictures came back 404 on center-com-3 with no way to tell a
server without a browser from a page that never went network-idle. The page
picture now waits for load, then for idleness only up to eight seconds, and
photographs what is there — a shop page with beacons that never go quiet
still gets its picture. A picture that cannot be taken answers with
x-loki-picture-reason, and the owner-side check prints it, together with the
tour's headline and first rows.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 20:51:40 +02:00
CatoandClaude 5e7f1c1924 feat(projects): a Builder changes the site without the owner, and the invite says so (#1280)
The owner's words, 2026-10-17: Manu is a doctor; joining should take no
explaining, and when he is a Builder his feedback should go to Loki, not
to George. The machinery existed — a pass on the site's feedback button
makes a note build at once — but Loki handed the pass only to the owner,
recorded nobody as the reporter, told the owner nothing, and the invite
page named a role without explaining it.

- The invite page is the manual: what the project is (its description and
  site), how you change it in three lines, what happens to what you ask
  for, one button. The owner opening their own link reads the same page
  with "This is what the person you send it to will read".
- After joining, the project leads with the same three lines (MemberGuide)
  and an "Open <site>" button. For a Builder that link carries the pass.
- Who gets a pass is one rule, mayHoldPass (owner and every Builder); the
  project page issues it by that rule. A viewer's or a client's note, like
  a stranger's, waits for the owner.
- Ingest records the pass holder as the reporter, so the owner's inbox
  reads "Manu Rigner asked for this on your site" with "Manu Rigner ·
  Builder", and Manu's own list knows his notes. The owner is told by push
  and Telegram when a Builder's note starts (notifyBuilderAsked) — told,
  not asked.
- The site's sign-in door reads "I own or build this site", and ROLE_LABELS
  says in plain words what each role means for what you ask for.

Walked at 320, 390 and 1440 on a local stack with a stand-in Petvity site
carrying the widget: George makes a Builder link; Manu reads it signed
out, joins, lands on the guide, opens the site from Loki, asks for a change
in the widget — the row is his, source owner, and the build is attempted
at once; George's inbox names him. Eve joins as a Viewer, her note from
the site is a visitor's and waits for George. No overflow, no page errors.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 20:48:50 +02:00
CatoandClaude 8749efd100 feat(widget): say the state on screen, one button to open, a calmer panel (#1279)
The owner on their phone (2026-10-17): it should be clear on screen when
Loki is watching and when it is recording, opening it should be easy, and
the panel was too crowded and intimidating to use.

Watching
- The owner's launcher is ONE button that says its state in a word at
  every width: "● Watching" with a live dot and a ring, or "Paused". A
  tap opens Loki. Its second half, "Point", was the labelled, bigger part
  on a phone, so the obvious tap pointed instead of opening; pointing is
  "Point to area" in the composer.

Recording
- A red edge round the whole screen while Loki listens (it takes no
  taps; grey while it writes it down), a red-bordered dock that says
  "Recording 0:12", and a one-line hint instead of four.

The panel
- One status line instead of two rows: "Watching · 2 to look at · 4 live
  › Pause"; opening it shows what Loki noted and where each change is.
- One microphone: the header's "Voice note" and the composer's "Record"
  did nearly the same thing. "Talk" in the composer is talk-while-
  scrolling, which also covers plain dictation; in chatkit it takes the
  tool row in place of chatkit's own mic.
- "Fix it" and "Ask" instead of "Request a fix" and "Chat with Loki".
- "Continue in Loki" appears once something has been said.
- The visitor's phone launcher is 44px, the minimum tap target.

Docs (widget/README.md, docs/architecture/feedback-widget.md,
docs/development/contextual-voice-feedback.md) and the browser tests
follow the new controls; new pure helpers watchHeadline and
changesHeadline are unit-tested.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 20:44:42 +02:00
CatoandClaude Opus 5.5 dc1e7ef1a7 feat(terminal): every tab says what its session is doing, and news from the others (#1278)
* feat(terminal): every tab says what its session is doing, and news from the others

Several sessions at once only works if you can tell, without opening each,
which one is busy, which one is waiting on you and which one is done.

- Each tab, on the phone's row and the desktop strip, carries a status dot:
  a breathing accent while it works, amber when it needs you, green when it
  finished, grey when it is just open; the words go to screen readers and
  tooltips. Read from the same /api/control/stream Control uses, with the
  presenter's precedence (a running turn outranks a stale "blocked" handoff),
  so the terminal and Control never disagree (lib/terminal-session-status.ts).
- When a session you are not looking at finishes or starts waiting on you,
  one line says so with Open (TerminalSessionNotice). One at a time, gone
  after ten seconds, on opening that session, or with ×.

Tests: terminal-session-status (rules, precedence, what counts as news);
terminal-tabs-browser now checks the dots and the notice at 320/390px.

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

* chore(design): dead ui-* rule baseline 34 → 33

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 20:40:41 +02:00
CatoandClaude bdd513f7c4 fix(previews): the owner-side check reads the cookie correctly and prints no body on failure (#1277)
The first run against the deployed route showed the parsing one-liner had a
quoting error, and the failure path printed the app's answer — which carries
the cookie — into a public Actions log (run deleted). The cookie is now read
from a file by a heredoc script, and a refusal prints only the HTTP status and
the app's error sentence. test-preview-host.sh pins that no echo, cat or head
of the answer exists in the script.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 20:32:45 +02:00
CatoandClaude fa7939bac6 fix(widget-chat): answer visitors with a model, never offer client jobs, help in German (#1276)
The bitbaum chat answered every live question by keyword fallback: visitor
turns were charged to the widget owner's personal fair share, which the
owner's own Loki use had spent by midday. Visitors now draw from their own
slice of the day (12%, in memory, rate limits unchanged), and a degraded
reply says why (budget | model).

- Website jobs for somebody else's site are never offered (legacy
  <host>-refresh-<hex> names and build-brief descriptions); migration 0113
  marks the unmarked ones client work, so the public map drops them too.
- The fallback no longer opens with an apology; it recognises research,
  website/shop and getting-paid requests, answers in German when asked in
  German, ignores German function words, needs two matching words before
  recommending a product, offers only running products, and ends a no-match
  with a person to ask instead of the waitlist.
- The prompt: everyday words, one concrete next step, one clarifying
  question for vague asks, what bitbaum is, and websites go to Loki /build.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 20:28:33 +02:00
CatoandClaude Opus 5.5 ab85172dda feat(terminal): sessions as tabs on the phone, and a second session per project (#1270)
* feat(terminal): sessions as tabs on the phone, and a second session per project

Asked for from a phone: several terminal sessions open at once, the way a
terminal has tabs, without clutter. Loki already ran several sessions and the
desktop strip showed them, but below md the strip and its "+" were hidden, so
a phone could neither see the other sessions at a glance nor start one while
another was running.

- Phone header: with more than one session the name becomes a sideways-
  scrolling row of them. The current one keeps its dot and chevron (and still
  opens the settings sheet); the others switch in one tap. One session looks
  as before, plus a "+".
- "+" opens TerminalNewSessionSheet, the same start form as the desktop "+".
- A project that already has a session now says so and offers "Start another
  session" or "Go to its session". Launching the same project used to target
  the same tab, which replaces the running agent. The second session is a lane
  tab (<project>~<id8>, run-tab.ts), named "project 2".
- The runner gives a hand-started lane its own git worktree, as parallel
  dispatch already does, and refuses rather than share one checkout
  (desktop/src/main/lane-workspace.ts). The lane limit moved to run-tab.ts so
  dispatch and the "+" share it.
- Close a session from the phone's session list (tap twice).
- /api/agent/launch refuses a tab carrying "~" that is not a lane Loki minted.

Tests: terminal-session-lanes (lane rules, refusal, numbering) and
terminal-tabs-browser (320/390px: no sideways scroll, 44px targets, switch,
sheet, second session beside a busy one).

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

* chore(desktop): Fleet Runner 0.8.43 — a hand-started second session gets its own worktree

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 20:22:12 +02:00
CatoandClaude 39fd13be34 feat(previews): the owner's door — the deployed app hands out a preview's access cookie (#1274)
GET /api/previews/<slug>/cookie, owner only: the cookie minted from the code
they set, set for Loki's /p/ path and named in the body. The owner-side check
(preview-check-on-box.sh) now mints the operator's session on the box, as the
create does, and asks the deployed app for the cookie — so it no longer
depends on how far behind main the box's Loki checkout is, which is what made
it fail twice today. The Set-Cookie attributes have one producer
(previewAccessSetCookie), shared with the gate.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 20:12:19 +02:00
CatoandClaude Opus 5.5 0e03b1f537 feat(packages): paste one npm key, Loki puts every package on npm (#1269)
* feat(packages): paste one npm key, Loki puts every package on npm

From a phone, the owner could not get four packages onto npm without being
walked through an npm form and a GitHub form by hand (2026-10-17), and
Loki's form filler only runs where extensions do — not Chrome or Brave on
Android.

Now /packages has an npm panel: the owner makes ONE key on npmjs.com (the
panel lists the exact settings and opens the page) and pastes it. Loki:
- checks it with npm (whoami) and keeps it sealed: AES-256-GCM under a key
  derived from AUTH_SECRET (lib/secret-box.ts), table npm_publish_keys,
  never returned to a browser, deletable, expiring;
- for every catalogue package the owner can push to whose package.json name
  npm does not know yet, writes the key into the repo as the Actions secret
  NPM_BOOTSTRAP_TOKEN (GitHub's sealed-box format, libsodium) and starts its
  publish.yml, which publishes the first version and links itself as
  trusted publisher; later releases need no key;
- does the same from the 15-minute package cron for packages registered
  later, leaving a started publish alone for six hours.

The demo account can never hold a key (config/demo.ts).

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

* style: prettier on the regenerated migration snapshot

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 20:07:56 +02:00
CatoandClaude 9cd2a5d21a fix(ai-budget, previews): admit against each person's measured cost; no dead-end preview button (#1273)
- The gate reserved a flat 20,000 tokens for every next answer while the
  'answers left' count already used the person's own measured cost — so with
  12,000 tokens of share left and answers costing 9,000 the screen said one
  left and the gate refused, and the end of every share went unused. Admission
  now reserves the person's measured mean + 25% (floor 5,000, never above the
  old 20,000), the same reserve the count uses: more answers from the same
  free pool, and the screen and the gate agree.
- /projects offered "Build a preview" to every account; for any account
  without Loki's own computers it was a whole form that ended in a refusal.
  Shown only where it works.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 20:03:43 +02:00
CatoandClaude 112b8988b9 fix(previews): a missing project is not memoized, and the owner-side check ships its own cookie script (#1272)
The preview route kept a null project for five seconds, so the address a
creation had just proved reachable answered 404 to the first visitor
(center-com-3, 2026-10-17): createPreview asks the host whether it answers
before the project row exists. Null is no longer kept.

preview-check-on-box.sh minted its cookie with a script the box's Loki
checkout did not have yet (it is often behind main). ensure-preview.sh now
ships that script into the checkout's git-ignored .tmp/ before every check,
and the check prefers the shipped copy.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 19:51:00 +02:00
CatoandClaude Fable 5.1 38a5b5654d feat(previews): before and after, photographed — the tour of what Loki changed on a live site (#1271)
* feat(previews): before and after, photographed — the tour of what Loki changed on a live site

A preview made from a live site (/change "Improve this site") used to end in
improvements.html, a page the build agent styled freehand that Loki could
neither check nor illustrate, and the owner still compared two sites from
memory. Now the build leaves improvements.json (one entry per change naming
the live page and the new file, plus the engineer's account under the
pull-request walkthrough's keys), and Loki shows it:

- `/p/<slug>/_loki/before-after`, behind the preview's own code: each change
  as the live page and the new page photographed on a phone, side by side,
  with the build's words, what was not brought over, the questions for the
  owner, and the account. Pictures are taken by lib/feedback/page-picture on
  first ask and kept in the folder's `.loki/pictures/`; "before" pictures are
  taken the moment the preview starts, while they still are the before; an
  "after" is Loki opening its own preview with the access cookie
  (`x-loki-picture: 1` keeps the widget out of the shot), keyed by content.
- Watch it work links the tour and shows the Walkthrough from the folder.
- The brief says a preview is a first impression, not a migration: the
  homepage and the pages a visitor uses, at the live site's own paths.

The consultation's tour now reads the pages a buyer reads: navigation before
footer, the biggest section (a shop's catalogue) first, one page per section
before the second, accounts and small print left out. center-com.ru's tour had
been the login page, the privacy policy and the bank details.

From the review of this flow: the consultation cache is keyed by the
normalized address (every "Build" click had re-read the whole site inside the
request); a create saves the access code and attaches a host only after every
check has passed; name and folder agree (a leftover folder no longer serves
<name> at <name>-2); the gate no longer names the client; the chat's
read_website reuses the crawl; one in-flight helper; the shared escaper; the
preview route memoizes its project lookup for a page load; stale comments.

Dogfood without a browser: the Previews workflow gets `website` (the exact
/change path, as the operator, on the deployed app) and `check` (open a
preview as its owner and report the site, the tour and its pictures — the
cookie is minted on the box and never printed).

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

* fix(watch): the preview walkthrough reads from a lib the shared-access test can bind

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 19:30:21 +02:00
CatoandClaude Opus 5.5 d37efc4a87 fix(projects): /projects/go uses the public origin; the demo cannot invite or join (#1268)
* fix(projects): /projects/go redirects to the public origin

Signed in, /projects/go/<name> redirected to req.nextUrl.origin. Behind
Caddy that is the standalone server's own localhost:PORT, so on the live
site the browser was sent to a refused connection. Every local walk
passed because there the two origins are the same.

Redirect to appUrl() like the other route handlers, and add a check that
no route handler redirects to the request's own origin. It fails on the
old line.

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

* fix(projects): the shared demo account cannot invite or join

The demo account is every visitor at once. Checking #1265 live, the demo
created a working invite link: anyone could have seated themselves on the
demo's projects, with their name in front of the next visitor, and the
demo accepting someone's link would hand their project to every visitor.

createProjectInvitation and acceptProjectInvitation refuse the demo at the
effect ("tenancy", the copy the sandbox already uses for team settings),
and both routes answer it as a 403 with that sentence.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 19:08:19 +02:00
CatoandClaude afaf8c9b43 fix(widget): no dead-end notes, no "LOKI / Loki", no stacked assistants (#1266)
Three things the widget did wrong on production, found by using it:

- A visitor's note about Loki itself got a receipt with no link: only the
  owner's build had a way to follow. Self-reported notes now carry the same
  claim link api/feedback hands out, so the person can follow it in their
  own My feedback. The claim path has one spelling (feedbackClaimPath).
- On Loki's own site the header read "LOKI / Loki": the brand line, then
  document.title. pageLabel drops the brand segment and keeps the page's
  name, falling back to the path, then Home.
- A corner holding the host's own floating button (substrata's ASK,
  Heidi's pill) was climbed: two assistants stacked as one tower at 390px,
  and ours floated 300px up the edge at 1280px. That corner is now the
  host's: the launcher takes the other corner if it is clear, else the
  edge tab. Tab bars and composers are not floats and are stepped around
  as before; a side named by the host or the visitor is kept. The install
  prompt no longer tells builders to add data-fc-bottom to stack them.

Browser fixtures 4/4b fail against the current production bundle and pass
with this one.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 18:54:12 +02:00
CatoandClaude fae80d11f0 fix(fleet): private client work opens for the studio owner's session only (#1267)
The private list opened with the preview access code, but that code is the
one each client is given for their own preview — so any client could read
every other client's project. Now only the studio owner, signed in to Loki,
gets it: bitbaum.orangecat.ch and loki.orangecat.ch are the same site, so
the studio page's credentialed fetch carries the Loki session. /studio-private
is the sign-in door that lands back on the studio page.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 18:50:47 +02:00
CatoandClaude e06a424916 feat(projects): invite someone by a link you send on WhatsApp (#1265)
Asked 2026-10-17: "how do I add Manu to Petvity? I'm talking to him on
WhatsApp." The only way in was an email invite tucked under Settings, and
the owner did not know which address Manu signs in with.

- People tab on the project (owner only) and an Invite button in the
  header. Choose Viewer / Builder / Client, "Create invite link", then
  Send on WhatsApp, Copy link or the phone's share sheet. Email is still
  one tap away.
- Open links: project_invitations.email is nullable (0111). A link with
  no email works once, for whoever signs in first, for 7 days.
- Opening your own link does not spend it; a member tapping it again
  later is told they are in and gets an Open button, never "already
  used".
- /projects/go/<name>?tab=people resolves a project by name, so a link
  can be given in a message without knowing its id.
- The header of a shared project names the viewer's role ("Shared with
  you · Builder") instead of calling every collaborator "View only".
- Builder's description now says what a Builder can actually do.

Walked end to end at 390px on a local stack: owner makes a Builder link,
stranger signed out sees how to join, Manu joins and lands in the
project, a third person gets "already been used", Manu re-opening it gets
"Open Petvity", owner sees "Manu Rigner · Builder".


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 18:45:00 +02:00
CatoandClaude Opus 5.5 afb39da877 fix(agents): each project is offered what its own builder has, and a missing CLI is said, not launched (#1262)
* fix(agents): each project is offered what its own builder has, and a missing CLI is said, not launched

- Control offered one agent list for the whole panel, read from the
  computer's report first, so a cloud project was offered Codex because the
  laptop had it. Each card now gets the list of the builder that will run
  that project (the same answer dispatch gives: locus lock, builder_pref,
  cloud), and an agent that builder lacks reads "not on the cloud builder".
  A builder that has not reported changes nothing (unknown, not none).
- A builder about to launch a CLI it does not have used to open a terminal
  on "command not found", and the run read as an agent that never answered.
  launchAgentPty now refuses first: "Codex is not installed on the cloud
  builder, so nothing was started. Switch this project to an agent installed
  there, or install Codex on the cloud builder, then try again."
- The next-step suggestions told the model the agent was "Claude Code" in
  every session. They now name the agent actually running (looked up from
  its adapter id; no free text reaches the system prompt).

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

* chore(desktop): Fleet Runner 0.8.43 — the launch check reaches computers

The launch check lives in desktop/src/main/pty-runtime.ts, so it reaches a
computer only with a release; desktop-release-drift (new on main) is right to
refuse it at 0.8.42. Bump and record the release.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 18:41:08 +02:00
CatoandClaude 2c63cca69f fix(loki): judge a scoped chat by the person's words, not the project wrapper (#1264)
Live after #1261: "What year was the Eiffel Tower built?" was answered but
flagged as unbacked, and the GmbH question still came back "Not in your
data." Every chat on a one-project account is scoped, so the loop received
"[Scoped to project: …] <project details> [User message] <question>" — and
the wrapper's own word "project" made every question one about the
person's projects. The general-question classifier, its hint, its retry and
the retrieval planner now read the person's own words (lib/loki/chat-scope.ts);
sources still get the full prompt so the scoped project ranks first.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 18:37:04 +02:00