3517 Commits
Author SHA1 Message Date
CatoandClaude 0281dce5cb fix(privacy): signed-out fleet register and health show only what /fleet shows (#1780)
* fix(privacy): signed-out fleet register and health show only what /fleet shows

/api/fleet/register returned the owner's whole register (hidden rows, internal
descriptions) to anyone. Signed out it now returns /fleet's listed rows with
/fleet's fields only and no description, via one loader shared with the page.
The full register needs the owner's session/token or the control bearer.
/api/health answers ok/status/app to strangers; detail needs the bearer. The
live-commit readers (auto-merge, deploy check, ship-report) move to the
public release receipt.

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

* test(unit): quarantine the 12 browser tests an agent sandbox cannot run

Explicit tracked list (scripts/test/quarantine-browser.json), skipped off CI
only and printed as QUARANTINED (no Chromium in sandbox). CI runs all of them.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-02 07:45:38 +01:00
CatoandClaude Opus 5.5 fde52d9276 fix(rag): the embed server drops work nobody is waiting for, so one slow page cannot fail the reindex (#1605)
The 2026-11-07 03:30 loki-reindex ran 15 minutes of "[embeddings] failed: The
operation was aborted due to timeout" and was killed by TimeoutStartSec. The
first user got 384/637 chunks, the second 0/632, with 3.9s of client CPU.

#1594 serialized inference behind one lock. The client aborts a page after
30s, but the server kept computing the abandoned page under the lock, so the
next page queued behind dead work, timed out too and left its own behind.
After the first slow page every page failed.

- embed-server.py checks whether the caller is still connected when it takes
  the lock and between batches, drops the work if not, and logs the drop.
- embeddings.ts pages at 16, the server's own batch, instead of 48: a third
  of the time per request against the same 30s timeout, and a third of the
  wait for a live caller queued behind the reindex.
- scripts/test/embed-server-drops-abandoned.ts runs the real server.py on a
  slow stub model. Against the old server the next caller waited 1761ms
  behind abandoned work; now it does not.

Every deploy syncs server.py and restarts loki-embed when it changed (#1595).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 12:25:55 +01:00
CatoandClaude 320ace54ae feat(crons): heidi's hourly reminder sweep (#1613)
Registers /api/cron/reminders for heidi (hourly, :41, POST). Heidi's opt-in
"questions are due" email is sent at 18:00 in each learner's own time zone,
so the route is called every hour; its policy sends at most one per person
every other day.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-01 09:35:52 +01:00
Catoandfleet-reconciler f1954f7e0d chore(deps): raise shared package floors to published versions (#1736)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-12-01 00:57:37 +01:00
CatoandClaude 1236487dd8 feat(site-cd): name the first admin when a site is created (#1779)
When Loki registers a new site for a person, their OrangeCat subject is
written to the site's runtime env as OWNER_ACTOR_IDS (fleet AGENTS.md,
"The back office", rule 2). Only in the run that creates the env, never
over a line already there, and only when the subject is a plain account
id. No linked OrangeCat account: skipped with one log line.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-30 22:23:20 +01:00
CatoandClaude Opus 5.5 b53e721fb9 refactor(voice): retire own mic hooks for chatkit; chatkit ^0.45.0 (#1739)
* refactor(voice): retire own mic hooks for chatkit Composer and DictationField

The project card's box is chatkit's Composer (through Loki's wrapper); the
project brief and the command palette are DictationField. The microphone
is now the fleet's: retry of a failed take, browser fallback, problems in
words. Deletes use-whisper-mic, use-mic-composer and use-voice-input, and
the dead transcription-polling branch (the route only returns { text }).

use-voice-conversation stays until chatkit's useVoiceMode can end a turn
on a pause with the server leg, speak unasked lines, barge in by voice,
re-arm on silence and expose the input level.

Site template synced from fleet templates/app main (chatkit ^0.44.0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(deps): raise @bitbaum/chatkit to ^0.45.0

DictationField fits any form from 0.45 (controlled, uncontrolled,
react-hook-form). Loki's fields stay controlled; typecheck, lint, the
design check and the composer tests pass unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(widget): chat chunk budget 43 KB for chatkit 0.45

Measured: 42.01 KB gzipped on chatkit 0.42, 42.55 KB on 0.45. The
budget already sat at the old size, so the bump rounded over it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-30 19:41:39 +01:00
Cato 964777b7ac Make Memory explain projects, next actions and the research behind them (#1740)
* feat: connect project purpose, next actions and research in Memory

* test: resolve superseding essays through the real dynamic route
2026-11-30 05:51:51 +01:00
CatoandClaude Opus 5.5 5fed6408e7 kickoff: every new site starts with the bitbaum-design skill (#1742)
* kickoff: every new site starts with the bitbaum-design skill

The builder copies the skill into the repo before any token swap (so client
sites keep the method after removing our tokens), picks one direction, and
screenshots and critiques every page before the handoff.

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

* kickoff: frontier is the default direction for our public pages

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-30 03:31:07 +01:00
Cato 1d5f99987e fix(sleep): a wake proxy brings its own socket up before it starts (#1747)
keller-wake.service failed twice with "Didn't get any sockets passed in":
the proxy was started (an app restart pulls it up through BindsTo) while
keller-wake.socket was not listening, so systemd-socket-proxyd had no
listener to forward and exited 1. The generated proxy unit now Requires and
is ordered After its socket, so any start of the proxy starts the socket and
receives its listener; a socket that cannot bind fails as itself.
2026-11-30 01:16:29 +01:00
Cato b131dccafa fix(backups): the nightly config snapshot keeps host-check's drop-in (#1748)
The host-check.* glob also matched the host-check.service.d directory, so
every pg-backup run printed "install: omitting directory" and the drop-in
never reached the snapshot. Stage plain files only, and stage the .conf
files in host-check's and hcloud-availability's drop-in directories the
same way the apps' drop-ins already are.
2026-11-29 23:06:21 +01:00
CatoandClaude 7540760d62 fix(box): the disk GC never deletes the release a site runs from (#1778)
solon, 2026-11-29 15:59 UTC, from the unit's own journal:
  Unable to locate executable '/opt/solon/app/launch.sh': No such file
  Main process exited, code=exited, status=203/EXEC   (restart counter 570)
The site answered 502 until the next good deploy at 16:56.

What happened: a deploy failed its health check and deploy.sh pointed app
back at the previous release. That release was now OLDER than the failed
ones left beside it. disk-gc.sh (hourly, and the disk is at 95 %) keeps the
newest two releases by date and removed the rest without asking which one is
live. disk-cleanup.sh, the manual script, has always protected the live
pointer; the automatic one did not.

- install-disk-gc.sh: tier 3 skips the release app resolves to.
- deploy.sh: after a rollback, remove the failed release and touch the one
  the site is back on, so it is the newest by date. deploy.sh is fetched
  fresh for every deploy, so this protects the box before the new disk-gc.sh
  is installed there, and frees the failed release's space.

test-disk-gc.sh: a new case fails on the old code (live release deleted)
and passes now; a stale release beside it is still removed. 24 passed.
test:ops passes.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-29 21:02:12 +01:00
Cato c0ab1f8644 fix(runs): a run with no agent is never Working or Needs you (#1749)
Run status now reconciles with the runner (lib/run-status), once, in the
run-track loader that /api/control/sessions, Watch and the run and command
routes all read:

- an open run whose agent the runner no longer has (a fresh snapshot taken
  after delivery does not list its tab, or the runner reported the agent
  exited) is Failed, cause agent_gone, "Agent exited without answering;
  Retry" (botsmann 51bbcc27 and loki 3a5a7c2b read Needs you with nothing
  listening);
- a finished run is Done or Failed, keeping what is left to do with its
  change in nextAction (six sessions read working weeks after their agents
  finished);
- the run and command routes take the run's status over the track's live
  word, so they cannot disagree with the session list.

A pull request the agent named in its handoff and opened during the run is
the run's even on a branch the runner never saw: an agent working in its own
worktree pushes from another branch than the session's checkout, and run
57632eae's track said "Nothing reached GitHub" beside loki#1747. Loki still
acts only on pull requests from the run's own branches.
2026-11-29 19:54:25 +01:00
Cato 0e2db3e4b8 fix(ops): a wake proxy left failed after a site goes offline is not an incident (#1753)
Taking a site offline stops its wake socket and proxy and keeps both unit
files. A proxy that was already failed stays in systemd's failed set, the
not-found sweep does not see it, and nothing will start it again. keller-wake
was that record: offline since 2026-11-01, then dispatched with an empty
journal. Offline now clears the failed state, and the sweep clears a wake
proxy whose socket is not enabled. A proxy whose socket is still enabled
still pages.
2026-11-29 17:42:23 +01:00
Cato 5e199ec89a fix(provision): a 422 'name already exists' links the repo Loki itself made (#1761)
Hendlar's provision created bitbaum/hendlar on 2026-11-19 (starter commit
and all), then Loki stopped before writing the link. Every retry since asked
GitHub to create it again and got 422, so the project could never start.

On that 422, read the repo back and adopt it only when it is ours: in the
fleet org, under the slug this project would get, carrying the exact
'Started from Loki · <name>' stamp, and linked by no other project. A
hand-made repo of the same name still fails as before.
2026-11-29 15:41:54 +01:00
CatoandClaude ecc3b4a2a9 fix(box): Node's heap follows the unit's memory; launch.sh follows its template (#1777)
Why apps hang while systemd calls them active. Every app unit has
MemoryHigh=768M (MemoryMax=1G): above 768M the kernel slows the process
instead of stopping it. Node does not read that. It sizes its heap from the
whole machine and lets garbage pile up past the mark before it collects.

Measured on Solon's production build (a database with no law acts), 930
requests eight at a time:
  no limit          775 MB peak (855 and 990 on other runs), 364 MB idle
  512 MB heap       585 MB peak, same answers, same speed

On 2026-11-28 solon stopped answering three times while "active", a favicon
took 4 s, and Loki, OrangeCat and Substrata on the same box were fine; the
reconciler also caught substrata, heidi and sites not answering within the
same day. Not proven from the box (no session can read it; forge-ops#29
prints memory.events), but it is the mechanism the unit file itself sets up.

launch.sh.tmpl: start node with --max-old-space-size at 65 % of the lower of
the unit's memory.high and memory.max (768M -> 499). NODE_HEAP_MB or an own
--max-old-space-size in the app's .env wins; a unit with no limit gets no
flag. Setting it from inside the app does not work (v8.setFlagsFromString
after start: 849 MB peak, no better than none).

deploy.sh: launch.sh was written once by sync-infra and never again, so a
template change reached no running app. Each deploy now renders it again
with the generator's own function (lib.sh render_launch, which sync-infra
uses too), keeping the box copy's port, checked with bash -n before it
replaces the old file. The old file is kept and put back on a rollback.

test-launch-template.sh: 8 new behavioural checks. test:ops passes.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-29 11:43:34 +01:00
CatoandClaude 47d6ad4ebb fix(schema): the destructive guard reads statements, not comments (#1776)
No loki deploy has shipped since 2026-11-26: apply-schema.sh refused
0140_pictures_in_the_bucket.sql as destructive. Its SQL is additive (two
ADD COLUMNs and a DROP NOT NULL); the hit was its own header comment,
"apply-schema.sh refuses DROP COLUMN, on purpose". strip_bodies now blanks
`--` comments as it already blanks dollar-quoted bodies, line numbers kept.
A statement before a trailing comment still blocks.

test-apply-schema.sh: 55 passed (2 new). 0138-0140 pass the guard; the old
genuinely destructive migrations (0002, 0006, ...) still hit.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-29 11:09:46 +01:00
CatoandClaude 11d49dd560 docs(infra): verified server facts in hetzner-migration box layout (#1768)
* docs(infra): verified server facts in hetzner-migration box layout

Put the gitea and bitbaum server facts, each dated with how it was
verified, in the existing box-layout section and drop the stale bitbaum
spec text they replace (2026-09-04 measurement, historical disk caveat;
git history keeps both). Add `Last verified: 2026-11-23` at the top.

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

* docs(infra): delete servers.md; README points at hetzner-migration.md

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-29 10:41:34 +01:00
CatoandClaude 0aadc7d940 feat(telegram): the linked notification chat talks to the owner's Cat (#1769)
A message (text and/or photo) from a linked chat that is not /start or
/stop is acknowledged at once and handed, after the response, to
OrangeCat signed with x-loki-signature + issuedAt on the shared
ORANGECAT_WEBHOOK_SECRET rail. OrangeCat stores it in the person's
conversation with the Cat. The Cat's answer comes back through the new
signed POST /api/orangecat/telegram-reply and is sent to that person's
own linked chat with an "Open in OrangeCat" button (the no-button rule
is unchanged). A message that cannot reach the Cat always gets a
one-line reason. The new senders are registered in
docs/telegram-notifications.md.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-29 08:59:43 +01:00
CatoandClaude Opus 5.5 ff2d7cb6b7 Pictures out of Postgres and off the disk, into a private R2 bucket (#1771)
* feat(media): keep pictures in the private R2 bucket, drain them out of Postgres

The owner's rule: pictures live in Cloudflare R2, not in Postgres or on the
box's disk, and the database gets cleaned up.

- src/lib/media/r2.ts: a small S3 client for R2, SigV4 by hand (node:crypto
  + fetch, no SDK), on the fleet's PHOTOS_S3_* names. Everything is private:
  MEDIA_PRIVATE_S3_BUCKET, or private/loki/ in the photos bucket. Unset means
  behaviour exactly as before.
- Chat pictures and report screenshots are written to the bucket when it is
  configured; the row keeps the key (additive migration 0140: nullable
  object_key and screenshot_keys). Reads try the bucket, then the old column.
  A write the bucket refuses stays in Postgres, so nothing is lost.
- A throttled drain started from instrumentation moves what Postgres still
  holds (chat images, report screenshots, executed commands' attachments):
  small batches under a transaction-scoped advisory lock, upload, HEAD to
  verify length/type/MD5, then key-and-null in one statement; error backoff,
  IMAGE_DRAIN=0 kill switch, progress on /api/health under `media`.
- Commands that have not run keep their base64: runners hold no bucket
  credentials. Retry puts moved bytes back before re-sending.
- Bot shots, private tile shots and preview pictures go to the bucket when
  configured, the temp folder otherwise; bucket caches keep their age limits.
- Deleting a chat or an account deletes its objects by prefix.
- Dropping the emptied columns stays a manual step (apply-schema.sh refuses
  DROP COLUMN): docs/infrastructure/media-storage.md.

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

* fix(media): private pictures only in MEDIA_PRIVATE_S3_BUCKET, never the photos bucket

The photos bucket (fleet-media) gets a public domain, so a private Loki
picture must never fall back into it. The private store now needs
MEDIA_PRIVATE_S3_BUCKET; unset, or equal to PHOTOS_S3_BUCKET, counts as
unconfigured: pictures stay in Postgres as today, the drain does not run,
and the env check warns in one line.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-29 07:21:50 +01:00
CatoandClaude 39b4c1a20c feat(watchdog): a hung app is restarted, not only reported (#1775)
Solon stopped answering twice on 2026-11-28 (from 09:15 for ~2 h, and
from ~18:05) while systemd still called solon-app active; the watchdog
paged and nothing else happened until a redeploy. check() now counts
misses per target. After RESTART_AFTER (2, i.e. 10 min) in a row with no
answer or a 502/503/504, it restarts <label>-app if that unit exists, at
most once per RESTART_GAP_S (30 min) so a release that cannot start is not
restarted in a loop, and says RESTARTED (or RESTART FAILED). A 4xx or 500
means the app answered: no restart.

test-watchdog-check.sh: 17 passed (6 new).


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-29 05:01:20 +01:00
CatoandClaude Opus 5.5 2c80d266c0 fix(deps): next 16.4.6 — the build refuses 16.4.2 (#1750)
The production build stops with SecurityFatalError on 16.4.2, so no loki
deploy can be built until this lands. Same bump as orangecat#1850.

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 02:30:05 +01:00
CatoandClaude Opus 5.5 01e49100ca feat(sites): register the sites engine and its Caddy wiring (#1758)
ADR-0001 build steps 3 and 5 (infrastructure half). apps.conf gains the
`sites` row (port 4042, no domains: Caddy routes to it), so the forge-ops
reconciler deploys bitbaum/sites like any app and the name `sites` is
reserved. sites.caddy holds the preview host, the *.orangecat.ch wildcard and
the customer-domain catch-all, all on-demand TLS behind the engine's ask;
install-sites-caddy.sh installs it only after the engine answers and gives
the same ask answer as hirnli's check for every hirnli host, validates, and
can --undo. Validated against the box's full Caddy config on 2026-11-20.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 00:12:45 +01:00
CatoandClaude Opus 5.5 29bfe8012a feat(browser): Terminal → Browser — watch a bot's browser live and take it over (#1772)
The browser Loki's agents and Cat Bot already drive (lib/bot-browser) gets
a screen: a third view of a session beside Chat and Terminal, beside the
conversation on a wide screen and in its place on a phone, with the agent
box under it.

- CDP screencast while someone watches (6 fps, newest wins), drawn by the
  existing RobotBrowser, which gains onTap
- one wheel: a person's step takes it; every bot step (a look too) answers
  TAKEN_OVER until hand-back, and the bot's next look carries handedBack
- the password/code/card refusal shows as "<bot> needs you" with Take over
- caption, pointer on the bot's target, "What happened" timeline (never
  typed text); native <select> offered as a picker; dialogs said in words
- memory: every browser's process tree measured (PSS), closed over 700 MB
- doors: /api/browser/live + /input (a signed-in person, own browsers only),
  /api/browser/step (the account's ck_ token, for Terminal agents),
  /api/browser/sessions; cloud-builder accounts only; demo denied
- /screen redirects to /terminal?view=browser
- scripts/test/screen-browser.ts: end to end at 390px and wide

Measured on the laptop: one live browser 229–236 MB PSS.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 22:11:03 +01:00
CatoandClaude Opus 5.5 b63e3f6877 fix(backups): de-duplicable dumps, skip Solon's photo cache, back up Supabase files (#1752)
The off-site store (Backblaze B2, 10 GB cap) filled on 2026-11-16 and every
night failed after: pg_dump -Fc compresses, so restic saw each night's dumps
as all-new data (Solon alone ~2.3 GB/night).

- pg_dump -Z0: uncompressed; restic de-duplicates and compresses itself.
- Solon: --exclude-table-data=place_photo_bytes (a cache of public Wikimedia
  Commons images the app re-reads on demand; moving to R2).
- Off-site paths now include /opt/supabase/docker/volumes/storage
  (OrangeCat/Botsmann/Printcraft uploaded files had no off-site copy).
- KEEP_DAYS 14 -> 3 locally (history is off-site); freed ~9 GB on the box.

Already applied on the box (backup of the old script kept); this makes the
installer match it so a reinstall does not bring the old one back.

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 21:11:36 +01:00
CatoandClaude Opus 5.5 d469218621 Unblock loki main: refresh the fleet brief snapshot; plain-shell made hermetic (#1773)
* chore(fleet-brief): refresh the fallback snapshot; kit plan uses the scoped package names

fleet-brief-snapshot-fresh fails every verify from 2026-11-28: the snapshot
reached its 45-day limit. Regenerated with `pnpm run generate:fleet-brief
--from` a copy of bitbaum/fleet main (b91715cc7, 2026-11-26) read from the
Gitea mirror, because raw.githubusercontent.com answers 404 for bitbaum/fleet.

The fresh register exposes drift the old snapshot hid:
- listkit, threadkit, limitkit, ai-forms and bip-kit are now published as
  @bitbaum/*. The kit plan matched none of them, so a bakery brief no longer
  planned a list. Config keys and test expectations now use the scoped names.
- 18 packages instead of 16: the rendered brief is 4 570 chars. The test's
  bound moves from 4 500 to 4 800, still below the renderer's 5 000 cut.

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

* test(plain-shell): hermetic — an empty home and the default shell switches

plain-shell failed on the laptop verify runner for every PR from 2026-11-26
while passing elsewhere. The shell is a bash login shell, so it reads the
host user's ~/.bash_profile, and the runner reads LOKI_SHELL / LOKI_EXECUTOR
from the environment. Reproduced: on main, LOKI_SHELL=off fails it with the
'sealed builds only' refusal, and a ~/.bash_profile that exits fails the
echo round-trip. With this change both pass. waitFor also allows 20 s on a
loaded runner (it returns as soon as the text arrives).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz
(cherry picked from commit b7ab9487ba)

* fix(widget-advise): a site on a package's bare name still reads what it does

The kit plan now keys on @bitbaum/ai-forms (and the other four renamed
packages), but a site installed before the rename depends on "ai-forms".
build-facts looked the description up by the exact name, so it lost it and
counted a planned package as missing. kitKey() maps the bare name to its key.
Found by the laptop verify of this PR (widget-advise).

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-28 20:10:19 +01:00
CatoandClaude Opus 5.5 8caeb30021 fix(approvals): an approved build says where it went (#1763)
* fix(approvals): an approved build says where it went

The card only said "Building at <url> · code" — a link that is blank until
the agent finishes, with no way back to the project. It now links to the
project's watch page and its people, and says the requester already has a
seat as client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>

* chore: re-run verify — widget-launcher-talk-browser timed out on a loaded runner (passes 3/3 alone)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>

---------

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 20:32:38 +01:00
CatoandClaude Sonnet 5.5 52a9c5e039 fix(laptop-security-check): key ephemeral ports by program, not number (#1770)
kdeconnectd re-rolls its UDP ports on every restart; each one paged as a
NEW PORT (16 Telegram alerts in a day). Ports >= 32768 are now keyed by the
owning program, so a re-roll is silent and a new program still alerts.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-26 16:06:38 +01:00
CatoandClaude 8c5033baef docs(infrastructure): servers.md is the one place for server facts (#1767)
Owner's standing instruction (2026-11-23): stale documents keep misleading
agents. Applies the fleet AGENTS.md rule "Documents go stale" to loki:

- docs/infrastructure/servers.md holds the dated facts for gitea and bitbaum
- hetzner-migration.md's Box layout spec is marked SUPERSEDED and points there
- docs/README.md states the Last verified convention and points at the rule

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-23 20:54:56 +01:00
345f63b099 fix(telegram): a chat that stops receiving is an alert, and a picture never vanishes silently (#1765)
* fix(telegram): a chat that stops receiving is an alert, and a picture never vanishes silently

On 2026-11-23 a screenshot of an event sent on Telegram reached nothing: no
agent turn, no booking, no alert, no error. The owner's chat bot is collected
by the OpenClaw gateway (long polling), and the only health check asked
whether the gateway answered HTTP, which it can do while its Telegram channel
collects nothing.

- check-gateway also asks Telegram for the chat bot's inbox (getWebhookInfo,
  read-only, lib/telegram/inbox.ts): a webhook set on the polled bot, or
  updates waiting on two ticks in a row, raises telegram_inbox_stuck once and
  says so in the chat (outbound still works when inbound is dead); it clears
  on recovery. Skipped while the gateway itself is down.
- Loki's notification bot can no longer take over the chat bot: the same
  token in TELEGRAM_NOTIFY_BOT_TOKEN is ignored (env.ts warns), since its
  setWebhook would cut the gateway off from every owner message.
- ensureWebhook re-registers when Telegram reports 401/403 (a rotated
  AUTH_SECRET left the URL matching and every update refused), keeping the
  queued updates; the route logs refused calls (throttled).
- A photo or image file sent to the notification bot gets a reply saying it
  was not read or booked and where to send it, and is recorded; a failed
  reply is logged instead of swallowed.

Test: scripts/test/telegram-inbound.ts with a Telegram photo-update fixture.

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

* docs(telegram): register the chat-bot inbox probe (src/lib/telegram/inbox.ts)

check-telegram-registry failed on #1765: inbox.ts calls api.telegram.org
but had no row in docs/telegram-notifications.md.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: catomean <catomean@users.noreply.github.com>
2026-11-23 20:54:54 +01:00
CatoandClaude 986131a2ca docs(handoffs): record phone-first ops breakage of 2026-11-23 and plan (#1766)
Co-authored-by: Claude <noreply@anthropic.com>
2026-11-23 20:54:51 +01:00
CatoandClaude Opus 5.5 e2cb3a2718 test(dispatch): a laptop path that exists on no machine (#1756)
LAPTOP_DIR was /home/g/dev/orangecat, which exists on the laptop. Since
GitHub stopped running Actions for the org, the laptop runs the merge
check, and the test refused to run there ("exists here; this test needs
it absent"), failing every loki PR. The case under test is "a directory
from another machine"; a home that exists nowhere keeps it true wherever
the suite runs.

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 15:17:32 +01:00
CatoandClaude 626290a9dd feat: microphone in the remaining prose fields (#1738)
Every remaining hand-made prose box (goals, events, assignments, project
notes, briefs, flags, prompts, studio replies, sign-up names) is now
chatkit's DictationField with Loki's voice, or the visitor's on public
pages. The Ask Loki drawer, a box that sends a message in a conversation,
is now Loki's Composer.

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-15 19:12:36 +01:00
Cato b1a8ab38b8 fix(deploy): establish receipt visibility from the workflow event (#1737) 2026-11-15 17:38:15 +01:00
Cato 85192684b9 feat(memory): explore project connections and export agent handoffs (#1735)
* feat(memory): explore project connections and export portable agent handoffs

* fix(memory): use the last report when development log dates tie
2026-11-15 17:00:52 +01:00
Catoandfleet-reconciler bc4926946a chore(deps): raise shared package floors to published versions (#1734)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-15 16:41:10 +01:00
CatoandClaude 7d8e94b7c2 fix(ai): a cost under a hundredth of a cent reads "under $0.0001", not "$0.0000" (#1733)
Live on 2026-11-15 the AI card said "about $0.0000 by estimate" for 66 priced
OpenAI embedding calls: a real cost shown as nothing. Below $0.0001 the card
now says "under $0.0001".


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-15 15:46:19 +01:00
Catoandfleet-reconciler 46e601f350 chore(deps): raise shared package floors to published versions (#1730)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-15 15:38:11 +01:00
CatoandClaude 672c84141e feat(ai): the fleet AI card says what the paid calls cost (#1732)
ai-kit 1.30 prices each paid answered call from its tokens and the vendor's
published price. The card now shows, per vendor and per app, "Cost: ≈ $X
(estimate)" and how many paid calls could not be priced (never counted as
$0); the headline adds "about $X by estimate". A note says the vendor's bill
is the final word and where its link is.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-15 14:32:14 +01:00
Cato 247fa9d9b3 fix(crons): a job cut off by a deploy waits for the new app before giving up (#1731)
sync-package-updates paged on 15 Nov with 'Connection reset by peer'
during a Loki deploy, although the runner reruns a converging job when
loki-app restarts mid-request. It checked loki-app's start time the
instant curl failed, but a reset or empty reply is the old process going
down: the new one starts only after that stop finishes (up to ~13 s).
So it never saw the restart. Wait up to 60 s for the start time to move
before deciding; send-once jobs are still never repeated, and a cut with
no restart still fails (after the wait).

The test now also covers the production order (restart lands after the
cut); it fails on the old runner.
2026-11-15 14:26:16 +01:00
Catoandgithub-actions[bot] 2b95afa78f chore(starter): sync scripts/site-template to bitbaum/fleet@a7ed7f39f5 (#1729)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-15 13:29:17 +01:00
CatoandClaude 52b554ced6 fix(ai): the AI card says how to lift OpenRouter's 50-a-day free tier, and stops contradicting its own figures (#1728)
Live: 'Free models: 30 of 50 requests used today'. OpenRouter's rule (its
limits page, read 2026-11-15): under $10 of credits bought in all, 50 free
requests a day; from $10, 1,000. The card now says so on the low tier. And
under OpenRouter's real balance it no longer says 'a free vendor does not
publish what is left'.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-15 12:29:09 +01:00
Catoandfleet-reconciler 5732f8ead6 chore(deps): raise shared package floors to published versions (#1727)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-15 12:16:48 +01:00
CatoandClaude c4aac59675 feat(ai): the fleet AI card shows what OpenRouter says is left (#1726)
OpenRouter publishes the server key's figures (GET /api/v1/key): free-model
requests used and left today, credits spent today/this week/this month,
credits left on the key, and whether the account ever bought credits. The
card now shows them under OpenRouter, asked at most every five minutes; when
OpenRouter does not answer, no figure is drawn.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-15 11:31:57 +01:00
CatoandClaude 0f62a33cff feat(ai): the fleet AI card covers today, 7 or 30 days, and every vendor says where to pay or stop (#1725)
The owner, 2026-11-15: one place to see every AI provider, how much was used,
and an easy way to upgrade or add credits. The card showed today only, named
OpenAI as the bare id 'openai' with no link, and offered one console link per
vendor. Now a Today / 7 days / 30 days switch reads that many days of the log,
the wording follows the period, OpenAI and Anthropic are named vendors, and
each vendor has direct links: usage, limits, upgrade or add credits, billing,
and for Google 'Turn billing off'.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-15 11:06:37 +01:00
Catoandfleet-reconciler daa95f0702 chore(deps): raise shared package floors to published versions (#1724)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-15 04:07:32 +01:00
Catoandfleet-reconciler 7b3874850b chore(deps): raise shared package floors to published versions (#1723)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-15 02:15:59 +01:00
Cato e599c83fde Measure agent cost per verified outcome on 50 development cases (#1721)
* feat(evals): account for verified outcomes across fifty development cases

* test(evals): align spoken-walk replay with its recording clock

* fix(dev): preserve check status during push watchdog cleanup
2026-11-14 15:09:08 +01:00
Catoandfleet-reconciler 82c9fdc812 chore(deps): raise shared package floors to published versions (#1720)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-14 13:52:05 +01:00
CatoandClaude e974d4ecd9 feat(ai): the fleet AI card says what each app's calls were for (#1718)
ai-kit 1.29 lets a call name its feature; each app row now reads "Used for:
law translate: 40 answered · 200 failed · law ask: …". The owner asked to
know what the AI was used up for; on 14 Nov Solon spent Groq's free day before
09:10 UTC and the card could only say "Solon". An app that names nothing
shows no line. ai-kit floor raised to 1.29.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-14 12:13:39 +01:00
Catoandfleet-reconciler 653fbbbb32 chore(deps): raise shared package floors to published versions (#1717)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-14 11:46:57 +01:00