Commit Graph
1386 Commits
Author SHA1 Message Date
CatoandClaude 6afc4d1fb8 fix(day-plan): the installer's report never fails the install (#1547)
Run 4 on 2026-11-02 applied every change (day plan, contract on 8 jobs and
on the heartbeat) and then exited 1 in the read-only report: under
set -o pipefail, a grep with no match (no health-guardian crontab line) ended
the script. The report section now runs without errexit/pipefail and the
script ends 0.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 09:22:12 +01:00
CatoandClaude 0bdf3d79b4 feat(ops): prove a real password reset, and Loki's OrangeCat token (#1546)
prove now also runs a real password reset on every switched product: the
product's own forgot-password page, the mail in a real inbox (a
throwaway mail.tm address), its link, a new password set on the
product's reset page, and that password signing in. On Loki, after the
real OrangeCat sign-in, the token it left in Loki's accounts is checked
against OrangeCat's userinfo, as publish needs. Nothing printed names an
address, a link, a password or a token.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 09:21:56 +01:00
CatoandClaude 21e10a42ff feat(review): watch Loki use your site — the pointer, the press, an ending (#1544)
The first look at someone else's version of this (a live picture of a
bot's browser on a phone, 2026-11-02) showed what not to do: a desktop
page shrunk to unreadable text, a dark void above it, and no sense of
what the bot meant to do. Loki's browser is now watched the way you'd
watch a friend use a page — on the workbench and on Review alike.

- The worker records where each press lands (ReviewFrame.target: the
  element's box in viewport pixels, optional so older frames still play).
- RobotBrowser draws Loki's pointer there and lights the pressed thing
  with a ring that arrives like a tap; the pointer glides between
  presses, rests dimmed when Loki only looks, and no ring is lit at rest.
- One pure rule places the picture (lib/inspection/robot-view viewOf,
  tested): a tall column is filled to its height with a desktop page
  cropped at the sides, a phone page stands like a phone, a page too
  small to read leans in, and it slides so the press sits as near the
  middle as the edges allow. No void, no squinting.
- RobotEnding: a walk that finishes while you watch says so — a check
  that draws itself, "All done. Loki looked at 3 pages and found 2 things
  worth fixing.", one button to see them; nothing found is good news.
- The workbench follows the project's latest review (5 s while walking,
  20 s at rest), so a walk started after the page opened appears too.
- Every glide, ring and breath stops under prefers-reduced-motion.

Checked in a browser against a staged walk: live on the workbench at
1440, the ending arriving mid-view, and Review on a 390px phone.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 09:11:22 +01:00
CatoandClaude Opus 5.5 b912cb4d91 feat(notify): every person chooses what reaches their own Telegram (#1543)
* feat(notify): every person chooses what reaches their own Telegram

Loki is multi-tenant, but Telegram was one hard-wired chat (the operator's)
on a bot whose incoming messages belong to OpenClaw. Now each account sets
it up in Settings → Notifications → Telegram:

- Connect Telegram opens Loki's notification bot with a one-time code;
  pressing Start links that chat (POST /api/telegram/webhook, verified by
  Telegram's secret-token header). No chat ids, nothing to type. /stop or
  blocking the bot unlinks. The webhook registers itself on first use.
- Six kinds of message (config/notify-categories.ts), each on/off per
  person; "servers" is shown to the operator only.
- Every app sender now goes through the gateway as that person
  (lib/notify/person.ts → deliverNotice): approvals, feedback, fixes, runs,
  studio, build requests, sign-ups, autopilot, site live, gateway down. The
  gateway applies the person's choices, sends to their own linked chat, and
  falls back to the operator's old chat for the operator only.
  scripts/test/one-telegram-door.ts fails the build on a direct send.
- Buttons Loki composes from its own records (a customer's own site) are
  trusted; links from outside still meet the host allowlist.
- Migration 0132 adds the link and choices to notification_preferences.
- New env: TELEGRAM_NOTIFY_BOT_TOKEN, TELEGRAM_NOTIFY_BOT_USERNAME (checked as
  a pair at boot). Until set, Settings says Telegram is not set up and the
  operator's existing chat keeps working.

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

* fix(openclaw): the heartbeat follows the same one-tap contract

The box audit (openclaw-day-plan run 3) found the sender of "Gateway was
not running. Restarted automatically. All good now.": the OpenClaw
workspace's tools/health-guardian.sh, not in any repo, whose status lines the
agent relays. The contract now goes on HEARTBEAT.md too (between markers,
backed up, idempotent), and the installer prints how health-guardian is
started and its speaking lines, numbers and secrets redacted.

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

* style(drizzle): format the generated 0132 snapshot and journal

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 09:05:10 +01:00
CatoandClaude Opus 5.5 18d34dff0a fix(notify): OpenClaw jobs send only what has one tap; close the review's critical/high findings (#1542)
* fix(openclaw): every scheduled job sends only what has one tap, else NO_REPLY

On 2026-11-02 the chat still carried OpenClaw's own messages that fail the
owner's test: "Invoice / Payment Alert … if credit card is on file, no
action needed", "Gateway was not running. Restarted automatically. All good
now." The scheduled jobs' prompts live only on the box, so:

- contract.md: one short block appended (between markers, replaced on each
  install) to every enabled job except the day plan: send only what needs
  him, each item with the ONE link that does it, never status or counts, and
  reply exactly NO_REPLY when nothing passes — OpenClaw's documented silent
  token, which suppresses delivery.
- The installer lists, by path only, every file on the box that calls the
  Telegram API or says "restarted automatically", so the remaining sender is
  found from the public log without printing anything private.
- Notices carry no machine name ("orangecat-cat · …"); the source stays on
  the list row.

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

* docs(telegram): register the day-plan installer (it only searches for senders)

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

* fix(notify): close the review's critical and high findings

An independent review of the messaging system found real defects; these
are the ones that lose an urgent message, send a wrong one, or wake him:

- Intrusions could be dropped: the caps held urgent notices, every SSH
  password login shared one dedupe key, and /api/notify/box answered 200
  when nothing was recorded, so the box never used its direct fallback.
  Urgent notices skip the caps, intrusion lines are keyed on the whole line,
  and the route answers 503 when an urgent line was not delivered.
- A link chosen by an email could become a trusted one-tap button. Buttons
  now open only own domains, Gmail, Google Calendar, GitHub or Hetzner.
- Long titles/labels or a fourth button dropped real notices into the list;
  they are clipped instead. Only a missing or unsafe action refuses.
- SSH login from a new address and edits to authorized_keys/sudoers/shadow/
  PAM/ld.so.preload are intrusion signs (both lists, kept equal by test);
  the button opens /today, where the notice is listed; the title names the box.
- Customers' escalations and capped goals reached the owner's chat
  (selfTelegramTarget); they now use telegramTargetFor. The gateway-down
  message went once per fleet account; it is sent once.
- The notify routes accept bearer tokens only (no browser session/CSRF).
- countDeliveries ignored rows older than a week; it no longer does.
- Night silence (22:00–07:00 Zurich) for the direct senders too: lib-alert's
  fallback, ivy-health, fleet-uptime, deploy-hetzner. ivy-health names what
  broke and offers Redeploy only when Loki's app is the failure, Box doctor
  otherwise, and reads the chat id from the box's telegram.env.
- Prompts: the day plan no longer asks for approve links it cannot get or a
  page it cannot open, never uses links found inside emails, and says when a
  source failed. The summaries he asked for (reflection, digests, scorecard,
  evening wrap) get a digest contract instead of being silenced; jobs with no
  text prompt are left untouched.

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

* feat(day-plan): one morning message; the email scanner twice a day

Approved by the owner 2026-11-02. The day plan now carries a half-line on
each person he meets today, and the separate 07:30 "Meeting People Brief"
is switched off. The email deadline scanner runs at 08:00 and 17:00 instead
of four times a day.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 08:46:52 +01:00
CatoandClaude f0b44b89c9 fix(day-plan): match the box's brief job, "Daily God Brief" (#1541)
The first install found no job named like 'morning brief': on the box the
06:00 brief is "Daily God Brief (calendar + inbox + priorities)". Matching
it by that name; "Meeting People Brief" still does not match.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 07:20:44 +01:00
CatoandClaude Opus 5.5 f8da012c95 feat(notify): Telegram only with a one-tap action — one gateway for every bot (#1540)
* fix(alerts): stop paging on transient systemd-run units; send digests silently

The 5-minute host sweep announced every failed one-off systemd-run unit
(run-p<pid>-i<id>) as its own incident. Each has a fresh name, so no
per-unit cooldown held and the phone rang every five minutes.

The sweep now resets those units and never announces them, and the
STILL FAILING / RECOVERED digests are delivered with disable_notification.

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

* fix(alerts): quiet by default, ring only for down/intrusion; stop deploy and cron echoes

- lib-alert: all box alerts deliver silently except DOWN/deploy failure/
  intrusion-class messages (_alert_silent)
- host sweep: failed appcron oneshots are the OnFailure notifier's, not repeated
- security check: files a deploy rewrites by design are journal-only

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

* ci(box): install the alerting scripts on the box when they change

The alert fixes only take effect once install-host-alerts.sh and
install-security-watch.sh run on the box, and nothing ran them.

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

* feat(notify): one tap or not at all — every bot reaches the owner through one gateway

The owner's Telegram held ~1,200 unread messages and rang every five minutes
with lines he could do nothing with ("STILL FAILING: run-p…", "SENSITIVE
FILE(S) CHANGED … if this was a deploy, ignore", "built nothing"). New rule,
enforced in code: a message reaches the phone only with a button that does
the thing; everything else is recorded on /today or /system.

- telegram-send: refuses a message without a URL button (NOT_ACTIONABLE);
  adds silent delivery and sendTelegramVoice.
- lib/notify: one gateway (deliverNotice) with the policy — at most 3
  buttons, one incident one message with backed-off reminders, 3/source/hour
  and 12/day caps, sound only for "now" and never 22:00–07:00 Zurich. Voice
  notes for paid plans; a monthly "voice notes come with Personal" notice
  with its pay button for free accounts.
- Routes: /api/notify (token holders, `loki.sh notify`), /api/notify/box
  (the box's lib-alert), /api/orangecat/notify (OrangeCat's bots, signed).
- Box: lib-alert posts every line to Loki's list instead of Telegram; only an
  intrusion goes straight to the phone when Loki is unreachable, with a Box
  doctor button. ivy-health pages only "down and restart failed" with
  Redeploy; clean deploy rollbacks are not paged; fleet-uptime pages only for
  Loki or 3+ apps down; sleeping apps are no longer conformance findings.
- App senders: each kept one now carries its button (Triage it, Review it,
  Watch the fix, Write to them, Restart the gateway, Decide on Control …);
  telemetry/runner/model-id pings and run successes leave Telegram.
- Day plan: the morning brief's prompt is in the repo
  (scripts/openclaw/day-plan) and installed on merge, which also switches off
  jobs that only post swap/memory warnings.
- Workflows install the box alerting, ivy-health, the day plan and OpenClaw's
  photo/video understanding on merge instead of by hand.

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

* feat(telegram): every sender is silent between 22:00 and 07:00 unless it says otherwise

Feedback, studio briefs and the other direct senders skipped the notify
gateway's quiet hours. A send that does not ask for sound now arrives
silently at night in the owner's zone.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 07:04:45 +01:00
CatoandClaude 33e6a4b8dc fix(app-secrets): restart an app only when it is running (#1538)
On 2026-11-01 an `ensure` for keller wrote its OrangeCat client and then
failed the run: keller-app exists (registered 2026-10-29) but keller has
never been deployed, so there is no release to start, and the restart
exited 1. apps.conf lists keller as a prospect; it is meant to stay off.

The restart now asks `systemctl is-active` instead of `systemctl cat`. A
unit that is not running is left alone and the run reports that its next
start reads the new values, the same promise as for an app with no unit.
A running app is restarted exactly as before. test-app-secrets.sh pins
the stopped-unit case (26 pass).


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 23:39:49 +01:00
CatoandClaude 929e22a423 feat(auth): passkeys, the second factor and the sign-in link on Loki's AccountKit runtime (#1539)
Since the switch to AccountKit, Loki offered OrangeCat, email + password and
its own recovery. The runtime serves passkeys, the second factor and the
sign-in link, but the compat layer answered 404 for all of them, and Loki's
screens had no way to use them.

- src/lib/auth/shared/open-paths.ts lists the AccountKit endpoints Loki's
  screens reach directly: passkeys, the second factor and the sign-in link.
  src/auth.ts routes them past the compat layer. None of them writes a
  password. Sign-up, reset, password, profile and deletion stay closed, so
  Loki's users table remains the one credential writer.
- The sign-in card, on this runtime, adds "Sign in with a passkey", "Email me
  a sign-in link instead" (with account mail), and the code step after a
  password when the account has the second factor. The password goes straight
  to AccountKit for that; the demo still uses compat. Sign-up offers the
  link too. The words are AccountKit's labels.
- Settings → Account adds passkeys (add, remove) and the second factor (set
  up with the password, confirm with the first code, backup codes, turn off).
- A runtime plugin (sign-in-hook.ts) runs after every new session, whatever
  the way in. It gives a person AccountKit has but Loki does not (a link to a
  new address) their users row, then runs bootstrapAfterSignIn. The compat
  layer no longer runs it a second time.
- accountkit-journeys (test:db) adds three cases: the second factor (a
  password alone gets the code step, the TOTP code makes the session), the
  hook making the Loki row and workspace, and which paths are open.
- The migration doc says what is open and why.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 23:00:54 +01:00
CatoandClaude d719ff00ca fix(app-secrets): no fixed switch-on of the shared sign-in; only signin-on (#1537)
#1531 added SIGNIN_ISSUER/SIGNIN_CLIENT_ID literal rows for petvity and
surf-your-life, and #1533's merge of main carried them in. Any `ensure` for
those apps would show the Morulia button while Morulia lists no provider.
The rows go (the pairs stay), and a test now fails on any registry row that
sets either name: signin-on, which refuses without a provider, is the only
writer. Same intent as #1536, which no longer applies cleanly after #1533.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 22:35:08 +01:00
CatoandClaude f6954978d7 fix(box): accountkit-switch rollback refuses to empty the only copy of a credential (#1535)
rollback empties the shared auth_* tables, which was safe while they held
only copies of the product's own rows. Once a product renders AccountKit's
own screens (petvity and surf-your-life now do), those tables hold the only
copy of every password set through AccountKit, every passkey and every second
factor. rollback now counts those first and refuses on any, naming the safe
path: revert the product's screens pull request.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 22:14:32 +01:00
CatoandClaude 2c0d8b737d feat(app-secrets): every sign-in page is a Morulia and an OrangeCat client (#1533)
Three things, all in the one registry that writes secrets nobody holds:

- morulia pair rows for the 13 apps bitbaum/morulia#21 adds (every fleet app
  with a sign-in page, fleet docs/auth-parity-2026-11-01.md), so `ensure
  morulia` gives each its SIGNIN_CLIENT_SECRET.
- a new kind, oc-client:<id>, for "Sign in with OrangeCat" in the ten apps
  that had no OrangeCat client. It writes ORANGECAT_OAUTH_CLIENT_ID/_SECRET
  into the app's env first, then the secret's sha256 into OrangeCat's
  oauth_clients row (created switched off by orangecat's deploy) and switches
  it on. A row holding a secret the app lacks is reported, never replaced.
  Nothing is printed but names and states.
- an action, signin-on <app|all>: adds SIGNIN_ISSUER and SIGNIN_CLIENT_ID
  beside the paired secret and restarts the app. It refuses while Morulia's
  /api/health lists no provider, so the button can never lead to an empty
  page. Ready for when the provider keys are in.

test-app-secrets.sh: 25 checks (11 new), including that neither a secret nor
its hash is printed.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 22:13:30 +01:00
CatoandClaude 410f6ffd74 feat(auth): the shared sign-in button on AccountKit, and a deploy check that follows the box's OIDC env (#1534)
Loki has run on AccountKit since 2026-11-01. The runtime mounts the shared
sign-in (`bitbaum-signin`, SIGNIN_*) from env, and the compat layer can start
it, but Loki's sign-in and sign-up pages had no button for it. The deploy
check also expected only "email-password" on this runtime, so OrangeCat could
vanish from /api/auth/providers without failing a deploy.

- getEnabledAuthProviders().signin is AccountKit's signinBroker(env), on the
  AccountKit runtime only. Sign-in and sign-up show "Continue with Google,
  Apple, GitHub, X or Facebook" (AccountKit's own label) next to OrangeCat,
  started through next-auth/react like OrangeCat.
- scripts/expected-auth-providers.ts expects, on AccountKit, the password
  form plus every OIDC client AccountKit mounts (oidcClients): orangecat with
  ORANGECAT_OAUTH_*, bitbaum-signin with SIGNIN_*. On Auth.js it behaves as
  before.
- deploy-hetzner.sh reads the box's OIDC env for it from /opt/fleet/env and
  the app .env, a non-empty app line winning as in launch.sh. The issuers and
  client ids are passed as they are; each secret is passed only as "set".
- scripts/test/deploy-expected-providers.ts covers both runtimes and the
  button.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 22:07:31 +01:00
CatoandClaude Opus 5.5 f07165a356 Loki first: the chat opens, three words in the sidebar, a one-screen workbench, and a voice on your side (#1506)
* feat(workbench): one project side by side, on one screen or two

A project's session and Loki as columns of one window, and its site in a
window of its own — beside this one or on the other screen. Nothing in it
is new UI: the columns are TerminalSurface and LokiWorkspace mounted as
they are; the site is the live page with the owner's pass, where pointing
and "Fix it now" already live. What the workbench adds is the arrangement.

- /projects/[id]/workbench, a Workbench row on the project page, and the
  pane SSOT in config/workbench.ts (session, loki).
- The site is a window, not a pane, on purpose: every fleet site sends
  frame-ancestors 'none' and Cross-Origin-Opener-Policy same-origin, so it
  can be neither framed nor reached as an opener. The workbench says only
  what it knows. docs/architecture/workbench.md.
- Windows open the best way the platform offers: Fleet Runner places them
  from the real display list (new IPC open-workbench-window, v0.8.60,
  caller tiled left / new window right, or the other display whole, an
  open window brought forward); a Chromium browser places a popup on the
  other screen once allowed; any browser gets a half-screen popup.
- Any pane in its own window (?pane=): a solo window hides the shell
  chrome at every width; the windows of one project on one machine keep
  each other honest over a BroadcastChannel (a popped-out pane leaves its
  window and returns when that window closes).
- Which panes a window shows is device-local (localStorage per project),
  never a column on the project. Two columns from xl; below that one pane
  at a time and the strip chooses; below md the phone's rows.
- Each column's side rail (the session's Loki rail, the chat's history) is
  remembered for the workbench apart from its own page and starts closed
  in a column: TerminalSurface gets `rail`, LokiWorkspace gets `basePath`,
  `project` and `history`.
- Full screen is the browser's own, on the workbench root.
- Pure parts tested: scripts/test/workbench-layout.ts, workbench-windows.ts,
  workbench-placement.ts. Checked by hand at 390, 720, 1000, 1440 and
  1920px and as a one-pane window at 900px, no horizontal scroll.

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

* refactor(workbench): one placement rule, a window's own layout, honest re-opens

A second pass over the workbench after an independent review of the diff.

- One placement module for both sides: src/lib/workbench/placement.ts is
  the pure rule the browser popup and Fleet Runner's real windows share
  (the desktop copy is gone). Tiling respects the caller's minimum width,
  so the 800px shell and the new window meet on a 1440px display instead
  of overlapping; only a display too small for both overlaps.
- The layout is the window's: sessionStorage per project, kept across the
  window's reloads and never shared. Two full workbench windows of one
  project each keep their own arrangement; localStorage's cross-window
  storage event clobbered them. useLocalStorageState takes the area.
- A popped-out pane announces itself closed on every way out — pagehide
  and a soft navigation away — and open again from the back-forward cache.
- A window already open is brought forward, never navigated again: the
  site's address carries a pass minted per visit, and a second navigation
  left it unread in the address bar. Fleet Runner keys windows by the URL
  without its fragment, restores a minimized one and places it where the
  person now asks.
- The screen-management prompt is raised when "On the other screen" is
  chosen, not on the open that follows: a click that waits for a prompt
  goes stale and the browser refuses the window.
- Close in a solo window leads somewhere even when window.close() is a
  no-op (a typed address): it falls through to the whole workbench.
- The dock click on macOS asks whether the SHELL window exists, not any
  window, so a site window open with the shell closed no longer hides it.
- Which panes are on screen (columns, or one of them) is a pure, tested
  rule; window opening lives in one hook (use-workbench-windows) instead of
  two states; the phone's rows read each pane's surface from the registry;
  useBodyClass serves both the immersive chat and the solo window.

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

* feat(workbench): one box — Session and Watch, not Session and Loki

The first cut put Loki's chat in the second column. Beside the session's
box that was a second place to type on one screen, and a person had to
work out which box did what ("I see two chats, and it just gets
confusing"). The session's box already does the one thing the screen is
for — it types into the live agent, or starts one — and the session
already offers Loki about itself ("What's going on?").

- The second column is Watch: the project's run as a live thread (what you
  asked, Loki narrating, the agent's screen, and where the change is —
  pull request, tested and merged, live), mounted from ProjectWatch as it
  is. It has no box. Loki's chat stays its own page.
- The pane registry carries where each pane's own page is (`pageHref`),
  so the phone's rows and the columns read one list.
- A pane body can be a scrolling thread (Watch) or a surface that fills
  the pane (the session).
- LokiWorkspace is back to what it was: the host-path, project and history
  props it only grew for the workbench are gone with their only caller.
- The project row says what the screen is for: "Say what to change and
  watch it happen, with the site beside".

Checked by hand at 390, 720, 1000, 1440 and 1920px and in both solo
windows: no horizontal scroll, no console errors.

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

* feat(workbench): one screen, one box — the site as Loki sees it, the robot, one line of state

"If a user sees tons of options, they can feel a paralysis" (owner,
2026-10-31). The screen showed about twenty controls: the Sessions page's
builder picker, tab strip, agent and view switches, Watch's card with its
own buttons, pane toggles, a window-placement menu. One thing to do, a
few things to see — so:

- The site, left, as Loki's own browser sees it (WorkbenchSiteView): the
  review worker already walks the site in a headless Chromium on the box
  and keeps one frame per action with the action named. While it walks,
  this shows the robot using the site, frame by frame — the one thing no
  window of yours can show; at rest, the last look. A tap opens the real
  site in its own window, where the person uses it and the widget does
  the watching. Fleet sites forbid framing and sever window.opener, so a
  picture of Loki's browser is what can honestly be shown inside Loki.
- The robot, right: TerminalSurface in a new quiet shape (`quiet`) — no
  builder picker (which builder runs a project is a stored decision), no
  tab strip of other projects, no shell rows; the chat | terminal switch
  and the agent stay. Its box is the ONE box on the screen.
- One line of state over the robot (WorkbenchStateLine): the sentence the
  Watch track composes, a dot for its tone, "Watch it work" for the whole
  story. Pure stateLine() in lib/workbench/state-line.ts, tested. The
  Watch column is gone from the screen.
- One "⋯" for the rest: the robot in its own window / on the other
  screen, the site on the other screen, full screen. The pane toggles and
  the placement menu are gone; a placement named for one opening wins and
  becomes the remembered one.
- The pane registry is the robot alone; the site is a region. Below xl the
  robot alone (the site is in its own window anyway). On a phone: the
  site, the robot, Watch it work, as rows.
- TerminalSurface stayed under the function-size ceiling by lifting the
  builder-picker wrapper and the resume filter out of it.

Checked by hand at 390, 720, 1440 and 1920px and in the solo window: no
horizontal scroll, no console errors.

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

* feat(workbench): a focus screen — the app's chrome leaves while you build

Three layers of navigation sat around two columns: the sidebar's twenty
destinations, the project strip ("Profile · Chat · Home · Sessions"),
then the workbench's own header and the robot's bar with the Sessions
page's agent menu — "Frankenstein elements just thrown together" (owner,
2026-11-01).

- While the workbench is open, the sidebar, top bar, bottom tabs, footer
  and project strip are gone (body.fc-workbench-focus, the former solo
  rule applied to the whole screen from md up). They are for moving
  between pages, and a person here is not moving. The one back link in
  the header is the way out. A phone keeps its own bars: the rows need
  them.
- The robot's bar is the chat | terminal switch alone (TerminalSessionBar
  `agentSwitch`, off in the quiet shape): the session's own chip names the
  agent and its box changes it.

What is on the screen now, left to right: back, Open the site, "⋯"; the
site as Loki sees it; the robot with one line of state, the view switch
and the one box.

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

* feat(workbench): two windows of one desk — one frame, a title bar each

The site sat in a card and the robot stood bare beside it, with a line
of state floating above and a caption floating below: two different
things on one screen. Now both regions, and a solo window, are one
frame (WorkbenchFrame): a title bar — a dot for its tone, one sentence,
one link — over a body.

- The site's bar is its address and what Loki is doing there ("Live",
  "Loki is using it: …", "Loki's last look: …"), like a browser's own
  tab; its body the page, top-aligned; before any look, the address alone
  and "Tap to open" — never a sentence apologising for an empty box.
- The robot's bar is the build's state (hooks/use-run-state, the Watch
  track's sentence) with "Watch it work"; its body the session with the
  one box. WorkbenchStateLine is folded into it.
- The floating Ask Loki button leaves in focus: its panel is the second
  chat this screen deliberately has not, and it sat on the send arrow.

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

* feat(nav): Loki first — the chat is the default screen, three words then folds

The owner's philosophy, 2026-11-01, now in AGENTS.md ("Why Loki exists,
and for whom"): a good Loki chat, reachable in one step, is the screen
that opens; the rest of the app one tap away; a friend on your side, not
a staff; never a screen that makes a person feel stupid; measure by
effort, not features.

- APP_HOME and RUNNER_HOME are /loki: signing in, and Fleet Runner
  starting with the computer, land on the chat. They landed on Today, a
  page to read before a person could say anything.
- The sidebar is three bare words — Loki, Home, Projects — the same three
  as the phone's bottom bar (Loki first there too), then folded groups
  that each say the question they answer: Waiting for you (Approvals,
  Feedback), Your day (Today, Suggestions, Voice), Across your projects
  (Sessions, Missions, Activity, Prompts), Under the hood (Packages,
  System), and Private behind the PIN. Not a drawer called More: the
  navigation test records why a "More" section rots, and still forbids
  it; the phone's More is the folded groups as a sheet.
- Every sidebar line says what it is for on hover (the item's own
  description), so nothing has to be guessed.
- SidebarSection gains `bare` (no header, never folded) and
  `foldedByDefault`; the tests that pinned the old Build / Loki / To
  review / The fleet placement now pin the new homes.

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

* feat(voice): Loki speaks as someone on your side

The owner's philosophy (AGENTS.md, "Why Loki exists"): a friend on your
side, not a staff you direct; never a word that makes a person feel
stupid. The public pages still said the opposite.

- Hero: "Say what you want. Loki builds it with you." (was "Describe it.
  Agents build it."). The lede, APP_DESCRIPTION, the social-card tagline
  and the how-it-works steps follow. Every factual claim is one the
  product keeps: it builds with AI agents, puts it online, changes it on
  ask.
- /why's principles open with two new ones from the owner's words: "On
  your side" and "Life is short". Commitments about how Loki is made, not
  claims about what it does.
- The new-project card says "Say what you want. Loki sets it up and
  starts building." instead of repos and agents; the sidebar's Loki line
  drops "dispatch" for "Loki answers, or builds it with you".
- The hero's two sentences are separate balanced blocks: on a phone each
  breaks as an even pair, never one word alone.

The mission headline on /why ("Direct the creation of …") is left for
the owner to decide.

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

* feat(voice): the mission reads "with someone on your side"

/why's headline was "Direct the creation of everything you can
imagine." — the staff-you-manage voice the owner set aside. It now reads
"Make everything you can imagine, with someone on your side.", the
owner's own call (2026-11-01).

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 21:35:13 +01:00
CatoandClaude 24e27d25fa feat(box): the shared sign-in for petvity and surf-your-life (#1531)
Both apps move onto AccountKit's own sign-in screens, which offer Morulia once
SIGNIN_ISSUER, SIGNIN_CLIENT_ID and SIGNIN_CLIENT_SECRET are set. The client
secret is a pair with Morulia's SIGNIN_CLIENT_SECRET_<ID> (bitbaum/morulia
lib/clients.ts rows); the issuer and id are literals.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 21:21:26 +01:00
CatoandClaude Opus 5.5 e2915bf6dd fix(auth): OrangeCat sign-in on AccountKit works, and keeps its tokens (#1528)
* fix(auth): OrangeCat sign-in on AccountKit works, and keeps its tokens

AccountKit 0.19.0 fixes a first OrangeCat sign-in failing with
unable_to_create_user (Loki's mirror recorded the link before
better-auth stored its own) and hands the provider's tokens to
onAccountCreated. ensureLokiUser now keeps OrangeCat's token set in
Loki's accounts, where publish, promote and the wallet read it; on
AccountKit nothing reached them before, because AccountKit stores no
provider token. Migration 0131 drops the trigger that was meant to copy
them out of auth_accounts.

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

* style: format the generated migration meta

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 20:18:45 +01:00
CatoandClaude 133831e60e fix(deploy): expect the providers the box's auth runtime mounts (#1527)
Every Loki deploy since the AccountKit switch (#1513, AUTH_RUNTIME=
accountkit on the box) failed post-deploy verification with 'auth
provider missing: github' and rolled back. On that runtime GitHub,
Google and X are not mounted by design (getEnabledAuthProviders), and
the live build already served only orangecat, email-password and
user-password, but expected-auth-providers.ts still listed github.

deploy-hetzner.sh now reads AUTH_RUNTIME from the box's .env (a mode
name, lowercase letters only) and the script drops the social
providers when sharedRuntimeEnabled() says the shared runtime answers.
A rollback to Auth.js (AUTH_RUNTIME unset) expects github again.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:53:53 +01:00
CatoandClaude Opus 5.5 bf448e39f2 ops(register): follow main from a shallow checkout (#1526)
* ops(register): a refused follow says where the two histories meet

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

* ops(register): follow main from a shallow checkout

The box's loki checkout is a shallow clone (52 grafts). A fetch into it
stops at the old boundary, so HEAD (c65ead0f6, 2026-10-07, an ancestor
of main) and main shared no history there and the follow refused with
335 'local' commits. Deepen the fetch past HEAD's date, then judge.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:38:01 +01:00
CatoandClaude a85a2d15ee fix(ops): show every refusal code the OrangeCat proof lands on (#1525)
Claude-Session: https://claude.ai/code/session_019MDtmud6zcK4rStBGmYSML

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:32:54 +01:00
CatoandClaude 72bdf94c18 fix(enrich): read AGENTS.md first and follow CLAUDE.md pointers (#1524)
Every fleet repo's CLAUDE.md is now a pointer, in several shapes:
"Read [AGENTS.md](AGENTS.md)", "Read and follow [AGENTS.md](AGENTS.md).",
"@AGENTS.md", or a root file that imports .claude/CLAUDE.md (Solon,
DataCat). The old check knew two of them, so "Read and follow" pointers
were fed to the model as notes and the real notes in .claude/CLAUDE.md
were never read.

readAgentDocs() reads AGENTS.md first, then CLAUDE.md; a pointer is
followed to the files it names (resolved inside the repo, each read once),
real CLAUDE.md notes in a repo without AGENTS.md are kept, and
.claude/CLAUDE.md is the fallback when neither root file exists. Both the
enrich route (GitHub contents API) and scripts/enrich-prod-profiles.ts
(local checkout) go through it.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:31:34 +01:00
CatoandClaude 81f920a108 chore(register): the leftover signin database is gone (#1523)
Dropped with drop-db.yml (run 41335134500): 0 users, 0 sessions; its
rows were one schema-history row and the 7 OIDC client registrations
morulia holds for itself. The role went with it. The morulia row's
comment no longer says the database is on the box.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:26:33 +01:00
CatoandClaude Opus 5.5 cc8672d665 ops(db): drop-db counts the rows before it drops (#1522)
* ops(db): drop-db counts the rows before it drops

The dry run said tables and size, not whether anything is in them.
signin has 13 tables and 8 MB; 'it holds no users' is now a count in
the log (exact, one count(*) per table, summed), not an assumption.

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

* ops(db): name the tables that hold rows, with their counts

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:25:16 +01:00
CatoandClaude ddbd95303d ops(register): bring the box's register to main; retire a site main already removed (#1520)
register-drift reported orangecat-2 only in the box's register, and six
rows main had since corrected: the box's loki checkout sat on a
2026-10-07 commit, because only register-site.sh ever fast-forwards it.

- box-register.yml + box-register-follow.sh: the same adoption, on its
  own. Fast-forward only, from the public repository URL; refuses while
  the box holds a row main lacks, a local commit, or a change beyond
  apps.conf. Plan by default; keeps the old register in the home dir.
- retire-site.sh, delete: also removes the row from the box's register.
  Run from the workflow it removed it from the runner's copy only, which
  is how orangecat-2 (retired 2026-10-17) stayed on the box.
- retire-site.sh, offline and delete: stop the wake socket too. A site
  that sleeps when idle kept its socket listening on its port, and any
  local request woke the app again.
- retire-site.sh: --no-github (no repository, workflow or secret step)
  and --keep-data (delete keeps /opt and the checkout); RETIRE_LOOK=1
  prints what is on the box before the plan.
- retire-site.yml: github and keep_data inputs, the look, and a site
  that only the box's register still has is judged by that row.

Tests: test-box-register-follow.sh (new, in test:ops) and
test-retire-site.sh (12 more checks).


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:19:15 +01:00
CatoandClaude 169f920055 fix(desktop): Linux AppImage keeps the Chromium sandbox on (#1521)
Every Linux launch passed --no-sandbox. afterPack.cjs wrapped the
Electron binary in a stub that added it unconditionally, the .desktop
Exec= line carried it (electron-builder's AppImage default), and the
systemd unit from install-fleet-runner.sh passed it again. The reason
was real but narrow: inside an AppImage the setuid chrome-sandbox can
never work (the FUSE mount is nosuid), so where unprivileged user
namespaces are also blocked Chromium aborts at FATAL. Everywhere else
the namespace sandbox works without any setuid helper, and the flag
switched off the renderer sandbox #1479 had turned on.

- desktop/scripts/linux-launcher.sh replaces the stub. It runs
  Chromium's own probe (create a userns, write its maps, nest another)
  and the setuid-helper check for .deb installs, and passes
  --no-sandbox only when neither is available (or as root). It then
  prints why and how to fix it, and sets FLEET_RUNNER_SANDBOX_OFF.
  It also reports a --no-sandbox that arrives on argv, including the
  one electron-builder's AppRun appends silently.
- The main process shows that reason as a notification.
- linux.executableArgs is [] so the .desktop entry stops passing it.
- The systemd unit no longer passes --no-sandbox.
- The stale-instance pgrep no longer requires --no-sandbox in argv.
- Packaged-build test: test-linux-sandbox.sh starts the real AppImage
  under Xvfb and checks the live process tree (main argv; renderer
  seccomp-bpf and its own user namespace). ci-linux-sandbox.sh runs it
  with Ubuntu's userns restriction off (must be sandboxed) and on (must
  still start, with the notice). New PR workflow
  desktop-linux-sandbox.yml, and a step on the Linux release build.
- Version 0.8.62 with its changelog entry.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:18:22 +01:00
CatoandClaude c84a57a62e fix(ops): name the product's refusal code when the OrangeCat proof is refused (#1519)
Claude-Session: https://claude.ai/code/session_019MDtmud6zcK4rStBGmYSML

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:13:06 +01:00
CatoandClaude f4418172a8 ops(register): name the columns a drifted row differs in (#1518)
register-drift.sh said only port and status for a differing row, so
biaslens, kivvi and vitareba (same port, same status on both sides) were
reported with nothing to go on. It now names every column that differs,
with both values. The workflow also prints the box checkout's branch,
distance from main and changed paths, as context for a red run.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:08:12 +01:00
CatoandClaude Opus 5.5 089235bb46 fix(register): biaslens has a host database (#1517)
* fix(register): biaslens has a host database

The box's register says biaslens's db column is biaslens; main said '-'.
The box is right: register-site.sh provisioned the database there, and
biaslens.orangecat.ch/api/health reports its accounts ready, which needs
DATABASE_URL. With '-' every deploy skipped the app's schema step. Found
by register-drift (only biaslens's db column differed).

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

* docs(register): say which deploys read main's biaslens row

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:07:01 +01:00
CatoandClaude 9597e1f75d ops(db): a dispatch-only workflow that drops one leftover host database (#1516)
Nothing dropped a host database: retire-site.sh keeps a site's data by
design, so signin, renamed to morulia, left its empty database behind.
drop-db.yml drops exactly one, and refuses unless the register and the
box both say nothing can still mean it:

- droppable-db.sh, against main's register and the box's checkout of it:
  not a system database, no row named after it, no row's db column
  using it;
- drop-db-on-box.sh, on the box: not a template, no env file under /opt
  naming it in DATABASE_URL, no open connection. Then the database, and
  the role of the same name if Postgres lets it go.

An empty confirm is a dry run; confirm must repeat the name to drop.
Names, counts and sizes only in the log. Tested in test:ops
(test-drop-db.sh).


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:05:50 +01:00
CatoandClaude 5a1c34981d feat(ops): prove the account journeys live on a switched product (#1515)
A prove action for accountkit-switch.yml, with throwaway accounts deleted
again: two sessions, a row change read on the next request, a password
write ending every session (old refused, new accepted), sign-out and
deletion. Where the product offers OrangeCat, a real browser sign-in
with a throwaway OrangeCat account through OrangeCat's sign-in and
consent and back. This replaces the approved test identity the switch
docs waited on.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 18:56:01 +01:00
CatoandClaude 281540c4bf feat(ops): an AccountKit switch per product, with a live proof and rollback (#1510)
Five products stage AccountKit beside Auth.js behind AUTH_RUNTIME. This is
the switch, from GitHub over the deploy's SSH, one product per run:

- survey: counts only, including people whose only way in is a social
  provider AccountKit cannot reach yet (they would be locked out);
- switch: refuses while that count is above zero; imports under locks with
  the product's own accountkit-import.sql, ensures a 32-character
  BETTER_AUTH_SECRET, sets AUTH_RUNTIME=accountkit, restarts, then proves
  on the public site that AccountKit answers and a throwaway account signs
  in, reads its session and signs out (deleted after); any failure rolls
  back;
- rollback: AUTH_RUNTIME off, restart on Auth.js, mirrors dropped, shared
  tables emptied.

The log is public: counts and verdicts only. test-accountkit-switch.sh joins
test:ops.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 17:15:29 +01:00
CatoandClaude f82e076fc6 refactor(auth): use AccountKit's compat layer instead of a local copy (#1508)
The next-auth/react bridge, its call helper, the session plumbing, the
AUTH_RUNTIME switch, the import rehearsal script and the journey-test cookie
client were copies of code five products each carried. They now come from
AccountKit 0.18.0:

- @bitbaum/accountkit/auth/nextauth-compat answers next-auth/react. The
  product's compat.ts holds only what is its own: the session shape, how each
  password form signs in, its login codes and hooks.
- @bitbaum/accountkit/auth/switch: sharedRuntimeEnabled().
- `pnpm run db:rehearse-import` runs AccountKit's accountkit-rehearse-import
  on this product's import SQL.
- The journeys use @bitbaum/accountkit/auth/compat-testing.

Behaviour is unchanged with the switch off. With it on, a signed-out session
reads as null, and a resolver or hook failure is a readable refusal rather
than a 500. The real-database journeys pass unchanged.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 11:56:28 +01:00
CatoandClaude 6628a951d4 ops(register): remove the retired signin row (#1505)
retire-site.sh --mode delete cleared signin from the box on 2026-11-01
(run 41293394217): unit, vhost, /opt/signin, checkout and watchdog
target. The rename guard skipped every GitHub step, so bitbaum/morulia
kept its workflows and deploy key. Port 4040 is free again. The host
database `signin` is still there; the morulia comment says so.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 10:42:34 +01:00
CatoandClaude 6859c7271e ops(register): the shared sign-in is morulia; signin is archived (#1504)
bitbaum/signin was renamed to bitbaum/morulia (fleet #413) before any app
used it. The service moves to morulia.orangecat.ch:

- apps.conf: a morulia row (port 4041, db morulia, live). The signin row
  is archived so no sync regenerates it; it goes once retire-site --mode
  delete has cleared the box.
- app-secrets.sh: the registry entry is morulia, SIGNIN_URL is
  https://morulia.orangecat.ch, same seven pair lines. With morulia's
  side empty and each app holding its SIGNIN_CLIENT_SECRET, ensure copies
  the app's value over; nothing is regenerated.
- retire-site.sh: a renamed repository still answers under its old name,
  so retiring signin would have disabled morulia's workflows, removed its
  deploy key and, with --repo archive, archived it. Every GitHub step is
  now skipped when the repository belongs to another name. Tested.
- provision-db tests and examples name morulia.

The SIGNIN_* env names stay: they are generic.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 10:21:06 +01:00
CatoandClaude 0adea245cc feat(auth): stage AccountKit beside Auth.js, switch off (#1503)
Loki moves from Auth.js to @bitbaum/accountkit one reversible step at a
time, as evig, kivvi, petvity and surf-your-life do. Nothing changes while
AUTH_RUNTIME is unset.

- Migration 0130: AccountKit's tables under `auth_`, and the mirror
  functions: users <-> auth_users, and AccountKit's OrangeCat token set into
  Loki's `accounts`, where publish, promote and the wallet read it.
- scripts/db/accountkit-import.sql + a rollback-only rehearsal: ids, Loki's
  own scrypt hashes (read through AccountKit 0.17.0's legacyPassword),
  verification, OrangeCat links, a placeholder address for people with none;
  collisions, drift and a live shared runtime refused.
- src/lib/auth/shared/: the runtime, the session re-read from `users` on
  every request, and a bridge for next-auth/react: email, the invite's
  user-password and the owner key (stored hash only), OrangeCat sign-in or
  link, and the studio's server signIn by redirect. GitHub, Google and X are
  not offered on this runtime (getEnabledAuthProviders knows it).
- src/lib/auth/bootstrap.ts: onboarding heal and personal org, now one
  function both runtimes call.
- The proxy reads the shared session and asks the same authorized().
- /api/me/password keeps the caller's shared session.
- scripts/test/accountkit-journeys.ts joins `test:db` (16 journeys and the
  rehearsal on CI's Postgres).

docs/architecture/accountkit-migration.md records what blocks the switch,
chiefly GitHub/Google sign-in and the GitHub repository token.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 09:36:49 +01:00
CatoandClaude df7f84f36b feat(orangecat): a bot can ask Loki, as the person (#1499)
POST /api/orangecat/ask on the signed OrangeCat rail: one of the person's
OrangeCat bots asks Loki a question and the turn runs as the Loki user
linked to that actor, read-only, so a relayed question can never dispatch,
approve or spend. An unlinked actor is told the one step that links it.
Door test: no secret, no signature, a tampered or oversize body are all
refused before a database or a model is reached.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 07:19:05 +01:00
CatoandClaude 38b0fa78df fix(ci-gate): a run started by hand or by a clock is not CI (#1498)
A nightly or dispatched data load runs on main's SHA. When solon's law-text
load could not read a few scanned PDFs it failed, and the gate read that as
red CI and blocked four deploys of a commit whose verify was green. Only runs
a push or a pull request started now count; a dispatched run can neither
block nor outvote the push run's verdict. Pinned in test-ci-gate.sh.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 06:51:56 +01:00
CatoandClaude 2f479ea6da feat(nav): Bots beside Loki and Voice, opening the one list on OrangeCat (#1495)
The person's bots live on OrangeCat (the Cat, the fleet's specialists, the
ones they made, their group chats), and that list is where a bot's face,
price and purse are. Loki opens that one list from its own sidebar rather
than growing a second one; a bot's work, when it has hands, runs here. The
navigation test pins the entry in the Loki section.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 05:42:11 +01:00
CatoandClaude 49f0771666 ops(register): a daily check that the box's register matches main (#1493)
register-site.sh writes a new row into the box's checkout first and
opens a PR to carry it to main. When that PR stalls, the two registers
disagree without anyone being told, and main hands the port out again:
biaslens and signin both on 4038 (#1404, #1492). register-drift.yml
reads the box's apps.conf over the deploy SSH each day and fails on a
box-only or differing row (names and ports only); a main-only row is
reported as the box checkout lagging.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 20:46:03 +01:00
CatoandClaude 8b40759825 fix(register): signin moves to 4040; biaslens and keller rows reach main (#1492)
signin was registered on 4038, which biaslens already held on the box:
register-site.sh wrote biaslens's row (4038) and keller's (4039) into
the box's checkout on 2026-10-22 and 2026-10-29, and the PRs that carry
them to main (#1404, #1469) never merged. The upstream register did not
know either port, so #1481 handed 4038 out again. Caddy now sends
signin.orangecat.ch to biaslens, and signin's own wake socket could not
bind.

Both rows are added exactly as the box wrote them, so the register's
unique-port check covers them, and signin takes 4040, the next port no
row holds.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 20:29:22 +01:00
CatoandClaude 40b98c00ab ops(register): signin goes live (always on) (#1490)
signin is the shared sign-in issuer every consuming app redirects to; a
sleeping issuer makes each first sign-in wait for a cold start. Live also
skips the wake socket, whose first sync collided with the units a deploy
had already started (see PR body).


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 20:07:51 +01:00
CatoandClaude f57234b40a fix(hetzner): a first switch to sleep stops a leftover wake proxy (#1491)
A deploy that runs before a new sleeping site's first sync completes
starts the app, which pulls in <app>-wake.service, and its proxy keeps the
inherited listener on the public port. The socket sync-infra then enables
cannot bind it (signin, 2026-10-31: Result: resources on every sync). When
the socket is not active, stop the proxy with the app and clear the
socket's failed state before enable --now.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 20:03:10 +01:00
CatoandClaude 757af003a7 fix(hetzner): sync-infra says why a wake socket did not start (#1489)
sync-sites apps=signin exited 1 with no output right after
"sleeps when idle": the activation's last command is
`systemctl enable --now <app>-wake.socket >/dev/null 2>&1`, so its
failure was the box call's exit status and its reason was discarded.
On failure it now prints the socket's status and what is listening on
the public port (unit names, ports, process names; no values), then
exits 1. The test pins the message and that the generated activation
script parses.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 19:49:13 +01:00
CatoandClaude 9ad520a6cd fix(ops): an empty app .env line no longer erases a fleet key (#1488)
Every app template ships `RESEND_API_KEY=`. launch.sh sourced
/opt/fleet/env and then the app's .env, so that blank line overrode the
fleet's mail key with nothing, and password recovery stayed hidden on
diplodoctor, solon and heidi while the fleet held the key.

Now, at runtime (launch.sh.tmpl) and at build (load-build-env.sh):
- an empty app line keeps the fleet value;
- a non-empty app value still wins;
- FLEET_KEYS_OFF="KEY ..." in an app's .env switches named fleet keys
  off, the explicit replacement for "blank means off".

No app documents a blank line as its way to switch a fleet key off: the
empty lines come from the fleet and loki app templates, and aoz-begleitung
and hirnli, whose examples say "leave empty", describe the fleet key as
their production transport.

test-fleet-env-merge.sh runs the rendered template and the build loader
against one fixture, with a negative control for the old order.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 19:43:49 +01:00
CatoandClaude 847be47b64 ops(hetzner): provision-db workflow — a host database without a laptop (#1487)
provision-db-on-box.sh was only ever run from a laptop, so a registered
app with no box env (signin) failed every deploy until someone did. The
new dispatch-only workflow runs the same script on the runner over the
deploy's SSH key, in its own concurrency group. provisionable-db.sh
gates the input on the register: only a host database under the name
the script derives from the slug. Names only in the log; the script
never overwrites a key, so a re-run is a no-op.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 19:26:13 +01:00
Catoandgithub-actions[bot] 879ee9de87 chore(starter): sync scripts/site-template to bitbaum/fleet@60691c621e (#1485)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-31 11:44:30 +01:00
CatoandClaude 9a2f8d0b00 feat(loki): the three Ask Loki changes two companions agreed on (#1484)
Two OrangeCat companions (Loki Architect, Loki Critic), briefed with Ask
Loki's real prompts, route and panel, argued to an agreed list of three
improvements; this implements them as agreed.

- Mechanical next-build guard (lib/loki/build-line.ts): the bold
  **<project>: <task>** line stays only when the person's message asked
  for direction; otherwise it comes off the answer and travels apart as
  `buildLine`. Applied in /api/loki and in the main chat route (stored in
  meta); the floating panel offers a held line as "Next build, if you
  want it" instead of printing it as the answer's last word.
- Scoped persistence for the floating panel (lib/loki/panel-thread.ts):
  one localStorage thread per viewer and per project (or fleet-wide),
  so project B never sees project A's turns and A's come back on return
  and are sent as history. Clear forgets the thread on the device. The
  viewer id comes from the (app) layout's session.
- Advisor identity boundary (lib/loki/advisor-boundary.ts): one sentence
  — advisory surface, not executor; no Calendar, no email, no direct
  change to the fleet; proposals for the approval queue only — opens the
  role in both system prompts, from one constant.

Tests: scripts/test/loki-build-line-guard.ts, loki-panel-thread-scope.ts,
loki-advisor-boundary.ts. CHANGELOG entry for 2026-10-31.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 06:41:52 +01:00
CatoandClaude Opus 5.5 9d01c68ceb fix(build): regenerate control-states.generated.sh after the runner rename (#1483)
* fix(build): regenerate control-states.generated.sh after the runner rename

#1482 changed a description in src/lib/control-states.ts but not the
shell vocabulary generated from it. The deploy's prebuild regenerates the
file, the checkout is then dirty, and "Stage verified public package
receipt" refuses it, so #1482 never shipped (runs 41132450661,
41132869424, 41133549171).

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

* test(build): fail CI when the generated shell vocabulary is stale

generate-bash-state-vocab.ts gains --check, and scripts/test/
control-states-vocab.ts runs it in the unit suite. A change to
control-states.ts without the regenerated file now fails CI before
merge, instead of every deploy after it (#1482).

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 23:18:08 +01:00
CatoandClaude 5b0f93f117 feat(copy): the machine that runs the work is a runner, not a builder (#1482)
"Builder" meant three things on Loki's screens: the machine that runs
agent work ("Cloud builder", "Waiting for a builder"), the role on a
project, and the approved builder a customer books through Bitbaum. The
person keeps the word; the machine becomes a runner, the word the code
and the desktop app already use (box-runner, Fleet Runner, "Hosted
runner"). Not "engine": on screen that is already the model and
subscription a change is built with.

- every user-facing string where "builder" meant the machine, with
  EXECUTOR_COPY as the source, plus docs, quickstart, pricing and voice
- unchanged: the Builder role, "a builder or owner can start work",
  people who build ("App builders", "for one builder running Loki"),
  the site widget's "Send to builder" (the site's maker), stored
  transcript parsing, and internal codes and paths (needs-builder,
  cloud-builder-private, /api/builder/presence)
- tests that pin the wording follow it


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 22:30:16 +01:00
CatoandClaude f76ffe4e29 feat(box): register signin (shared sign-in) and its paired client secrets (#1481)
- apps.conf: signin on 4038, signin.orangecat.ch, its own host database
  `signin`, kind infra, status prospect until it serves.
- app-secrets.sh: signin's SIGNIN_URL, BETTER_AUTH_SECRET and
  SIGNIN_PAIRWISE_SECRET, and a `pair:<app>:<VAR>` kind: one value in two
  apps' env files, generated once, copied on the box when one side has it,
  reported (never fixed) when both differ, never printed. Restart is skipped
  when the app has no unit yet.
- test-app-secrets.sh runs the remote half locally; wired into test:ops.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 22:26:27 +01:00
CatoandClaude Opus 5.5 536fcaa3f1 feat(studio): call approved partners builders (#1477)
* feat(studio): call approved partners builders

Settles the first word of master plan 3.4: the person the studio approves
and a customer books is a builder ("approved builder" beside "build it
yourself"); "builders in the loop" is the line around it. Bitbaum moved
/partners/ to /builders/ (the old address forwards).

- build paths, /build, the chat's links, terms and rules, the intake
  prompt, the /studio/partner page, the reply email and the studio
  console now say builder
- the chat still recognises "partner" as a way people ask
- identifiers other systems read (kind "partner", /api/studio-partners,
  /studio/partner) are unchanged

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

* docs(plan): 3.4 — Owner and Builder already name the other two

The seat an approved builder gets is an editor seat, which the roster
already calls Builder, so the person keeps one word from Bitbaum to the
project. What stays open is "builder" for the machine that runs the work.

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

* docs(plan): 3.4 — the machine's word is runner, not engine

Engine already names the model and subscription a change is built with.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 22:01:41 +01:00