Commit Graph
2741 Commits
Author SHA1 Message Date
cato ae38232fa1 style: format 2026-09-25 10:46:54 +02:00
cato a5c0ffa299 wip: parallel lanes for Implement 2026-09-25 10:46:54 +02:00
CatoandClaude Opus 5.5 0b05ebb74b fix(ai): no box timer or background path spends the shared free AI tier (#897)
* fix(ai): no box timer or background path spends the shared free AI tier

Removes the frontier-digest, feedback-digest and scout-events cron routes and
timers; the digest email is built without a model; check-model-ids no longer
sends a one-token completion per pinned model; the DoD model judge on run
close (page poll / runner push / cron sweep) is gone - precheck only; the
Today Watch nudge composes on click, rate-limited, not on mount; the loki-e2e
check (a real chat turn 4x/day) is on demand only; standing-rule calendar
bookings never call the model to recover a date.

scripts/test/no-free-background-ai.ts walks the call graph from every cron
route and close path and fails if any reaches a model endpoint.

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

* fix(ai): delete the scout and feedback-digest producers the removed crons left dead

Also lowers the telemetry monitored-path floor to 2: frontier_digests was
demoted on purpose with its cron.

Co-Authored-By: Claude Opus 5.5 (1M context) <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 (1M context) <noreply@anthropic.com>
2026-09-25 01:19:03 -07:00
CatoandClaude Opus 5.5 98efc47dfe feat(composer): the composer is @bitbaum/chatkit (#899)
* feat(composer): the composer is @bitbaum/chatkit

Every Loki composer (chat, the terminal's Ask/Inject rail and Prompt box,
Control's quick send) now renders chatkit's Composer through one adapter that
keeps this app's API: the model picker sits in chatkit's tools slot, the mic's
server leg is /api/control/transcribe (prefer server: dictation here is often
mixed German/English). New for every composer: mic failures shown in words and
a browser-recogniser fallback when the server leg cannot work.

globals.css imports chatkit's stylesheet and maps our OKLCH tokens onto --ck-*
once in :root; 22 composer/voice rules and two keyframes the old composer alone
used are deleted. one-composer.ts now asserts chatkit's class names — same
guarantee: the chat and the rail render the same input.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* style(test): prettier on one-composer.ts

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 01:17:45 -07:00
CatoandClaude Opus 5.5 49553dadec fix(runner): stop killing working agents — quota NACK read our own prompt, drain waited on idle CLIs (#898)
Two defects hit one Skif dispatch on 2026-09-25, and either alone loses work.

1. The dispatch was NACKed "claude cannot generate because its usage limit
   is exhausted" 14s in, while Claude was visibly working on the brief. The
   capacity check scanned the WHOLE PTY buffer with a topic-word regex
   ("rate limit", "credit", "context window"), so the echoed prompt, the boot
   banner or a file the agent printed read as a quota wall. Now it reads only
   what the CLI printed after the injection, ignores lines that are just the
   prompt echoed back, and for Claude defers to its own session status: a
   session still generating has not hit a wall.

2. Two minutes later the box runner restarted and killed every session. The
   post-deploy drain waited for agent processes to EXIT, and interactive CLIs
   never exit, so it always ran to its 30-minute cap and then killed whatever
   had started most recently. It now counts agents that are WORKING: an idle
   Claude does not hold the restart; generating, waiting mid-task, or any
   status it cannot read does.

Fleet Runner 0.8.32 (desktop/ changed, so it ships as a release).
Tests: terminal-run-view (echo vs real wall, mutation-checked) and a new
test-drain-and-restart-runner.sh (18 checks, four mutations each caught).

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
fleet-runner-v0.8.32
2026-09-25 01:14:22 -07:00
Cato 064cad655d fix(runs): one clock for the lane and the reaper — no second prompt into a live session (#896)
* wip: one clock for the lane and the reaper

* wip: database test for the lane and the reaper, wired into CI
2026-09-25 00:09:11 -07:00
CatoandClaude Opus 5.5 c96516dffa fix(schema): default privileges so an app's role can use the tables its migrations create (#895)
apply-schema.sh runs migrations as the postgres superuser, so every table
belongs to postgres and the app's own role can read none of them. skif's
first deploy printed "schema applied ✓" over 14 tables its role could not
SELECT.

Before the batch, set ALTER DEFAULT PRIVILEGES (plain DML, sequences,
functions) for the role named after the database. After it, report any
EXISTING table the role still cannot read, with the GRANT to run. Existing
tables are never re-granted, so a deliberate REVOKE (kivvi's append-only
audit log) survives deploys. Identifiers are validated, not quoted.

Mutation-tested: re-granting existing tables, GRANT ALL, defaults after the
batch, and a missing identifier guard each fail the suite.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 23:17:43 -07:00
CatoandClaude Opus 5.5 26fc4e28d6 fix(deps): pin six server-side transitives to their patched versions (#894)
Seven advisories on the root pnpm-lock.yaml (hono, qs x2, baseline-browser-
mapping, @humanfs/node, postcss-selector-parser, esbuild), none with a direct
dependency to bump, so Dependabot never proposes a fix.

Five overrides in the existing pnpm-workspace.yaml block, each the advisory's
own first_patched_version and bounded to ONE major. Nothing else moves: two
files, no package.json. Resolved clean under the minimum-release-age guard.

esbuild is deliberately left out: 0.18.20 -> 0.25.0 is a minor bump on a 0.x
package, which is a breaking one, on dev-only build tooling. That needs its own
change with the build read, not a pin.

Verified against every advisory on the file: 6 of 7 cleared, esbuild left.


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

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 22:54:11 -07:00
CatoandClaude Opus 5.5 9c94a0f20c fix(desktop): ship 0.8.31 with the vulnerable transitives pinned to patched versions (#893)
All of desktop's advisories sit in desktop/package-lock.json with no direct
dependency to bump, so Dependabot never proposes a fix. desktop is NOT part of
the pnpm workspace (that covers packages/* and bridge), so it takes npm
`overrides` in its own package.json.

Five pins, each the advisory's own first_patched_version and bounded to one
major (^0.8.15 on @xmldom/xmldom stays inside 0.8.x). nanoid is not in GitHub's
alert list -- `npm audit` finds it locally -- so the dashboard count understates
the exposure. `npm audit`: 0 vulnerabilities.

The bump to 0.8.31 is required, not cosmetic: desktop code reaches a machine
only when a fleet-runner-v* tag is minted from this version, so pins without a
bump would stay on the server and on no machine. desktop-release-drift.ts
enforces that and the matching FLEET_RUNNER_RELEASES entry.

Redo of loki#803, closed 2026-09-23 as a stale draft. Main moved to 0.8.30 in
the meantime without these pins.


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

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
fleet-runner-v0.8.31
2026-09-24 22:50:34 -07:00
CatoandClaude Opus 5.5 2a5aa32b36 chore(crons): substrata auto-updates timer (readers' own keys only) (#892)
Hourly /api/cron/auto-updates drafts new leads only for readers who opted
in, on their stored key and daily cap. Nobody opted in = no model call; the
site's free AI is never spent in the background (substrata ratchet test).

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 22:42:28 -07:00
CatoandClaude Opus 5.5 c140429090 chore(crons): drop surf-your-life ai-digest timer (#891)
No background job may spend the shared free AI pool (George 2026-09-25).
The surf-your-life digest becomes an on-demand staff action; its route is
removed in that repo. Timer was already stopped and disabled on the box.

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 22:41:10 -07:00
CatoandClaude Opus 5.5 fb39e5bb96 chore(crons): drop substrata's AI drafts timer (#890)
No background job may spend free-tier AI (George, 2026-09-25): it used up the
shared free credits. The unit is already disabled on the box.

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 22:13:18 -07:00
CatoandClaude Opus 5.5 c63ae4ef61 fix(register): Skif has a database, and it is our product (#889)
skif's row said db=- and kind=client-site.

db=- makes every deploy skip the schema step, so drizzle/0000_init.sql
would never be applied: the signed-in pages would serve against a
database with no tables (the exact botsmann shape the format note
records). The database now exists on the box: role and db `skif`,
pg_hba rules inserted above the reject block, public schema owned by
the role, verified by connecting and creating a table.

kind=client-site was wrong on its face: Skif is bitbaum's own product,
owner=bitbaum, federating to OrangeCat. And bitbaum has no clients.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 21:51:40 -07:00
CatoandClaude Opus 5.5 b45d03cd12 chore(crons): schedule substrata producer sourcing every 6h (#888)
Its route and tables existed but nothing called it, so /data/freshness showed
it as never run.

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 16:29:30 -07:00
CatoandClaude Opus 5.5 75c870da2d fix(terminal): PTY follows the grid, expandable full-width pane, one composer (#887)
* fix(terminal): resize the PTY to the grid on screen, not only when typing

The resize was published only from an interactive (Type + live keys) view,
so Prompt mode, Voice mode and every phone fitted xterm locally and never
told the PTY. Measured: 79-col grid drawing a 120-col PTY on desktop Prompt
mode, 86 vs 120 on a 390px phone — torn words and stray columns at the
right edge. Fit + publish now run on mount, on every host resize, on a font
step, and re-assert on window focus.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(terminal): one composer for chat and inject; expandable, full-width pane

- components/composer/Composer is THE composer (text, attach, voice, model,
  Send/Stop, optional modes). Loki chat (LokiComposer), the terminal's
  Ask/Inject rail, the Prompt-mode box / phone dock and Control's quick send
  all render it. TerminalLokiComposer (bare textarea, no attach/voice) is
  deleted; Control's one-line ⌘Enter input is gone.
- The rail's Inject is the prompt composer while the rail is beside the
  session, so the page no longer shows two inject boxes at once.
- Terminal pane: rail is a fixed width (lg+) instead of 40% of the row, can be
  closed (remembered), is a sheet below lg; Expand works at every width and
  Esc leaves it, except when typed into the xterm or handled by a dialog.
- Tests: one-composer (logic, per-call-site render, no private textareas),
  terminal-expand (Esc rules).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 15:55:43 -07:00
CatoandClaude Opus 5.5 972fc95c11 feat(orangecat): signed actor-status read for Cat (#886)
OrangeCat's Cat could hand work to Loki (build intent, site commission) but
never see what became of it. POST /api/orangecat/actor-status lets OrangeCat
ask, on the existing ORANGECAT_WEBHOOK_SECRET rail, what is happening to the
projects of the Loki account signed in with a given OrangeCat actor.

- Body { actorId, issuedAt }; readSignedOrangeCatBody (503/401/400), plus a
  5-minute freshness window — the body has no nonce, so a captured request
  would otherwise replay forever.
- Unknown actor → { ok, linked: false, projects: [] }.
- Otherwise the fleet-status queries + listFeedbackSummary +
  getOrangeCatLinksForUser, shaped by a pure function: status
  (working/blocked/idle), live URL (http only), queue, current work, last 5
  outcomes, feedback new/open (matched by entity id), OrangeCat links. Max 25.
  No prompts, dirs or tokens cross the boundary.
- Caller: orangecat src/services/loki/actor-status.ts (live, reads "unknown"
  until this deploys).

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 15:28:22 -07:00
CatoandClaude Opus 5.5 68883b344f fix(widget-chat): what the first live answers got wrong (#885)
Seen on production right after #879:
- a reasoning model spent the 700-token budget and the Cat stopped mid-clause
  ('…which is running, in') — budget 1600, and trimToLastSentence drops a
  trailing half sentence rather than show it;
- the speaker label 'Loki:' counted as a mention, so a Loki chip led an answer
  recommending Heidi — labels are stripped before links are found;
- 'running, in beta' was copied verbatim — the stage word is now 'in beta';
- Loki described itself in the third person and sent a self-serve need to the
  closed studio waitlist — an agent that fits recommends itself in the first
  person, and a product that fits always beats the waitlist.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 15:07:47 -07:00
CatoandClaude Opus 5.5 1aefed1688 chore(crons): register substrata's daily job-board fetch (#884)
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 14:56:14 -07:00
CatoandClaude Opus 5.5 40a8f3d94f fix(projects): the interview says its limit instead of cutting mid-sentence (#883)
Found by dogfooding: Skif's project interview on 2026-09-24. All five real
answers ran 522-631 characters. The textarea's maxLength silently stopped
typing at 500, and the API (which accepts up to 2000) clamped each stored
answer to exactly 500 characters mid-sentence, e.g. "...Protectors are
chosen for judgment, calm and communication," and nothing more. Those
clipped fields are what brief the build agent, so an owner who wrote a
careful answer briefed the agent with half-sentences and was never told.

Clamping rather than rejecting stays: that was deliberate in #799 ("no
dead ends"), and its test still holds. What changes is that the cut is
never silent:

- The textarea shows a counter once an answer passes 60% of the limit,
  and says plainly at the cap that this is the limit and the agent reads
  the field whole. Short answers still look like a quiet form.
- The API response names the fields it cut (`clamped: [...]`), so a
  direct caller can shorten and re-save. Empty in the normal case, since
  maxLength means only an API caller can send more.

Tests: clampedAnswerFields names exactly the cut field, and does not
false-alarm on an answer that is at the limit only once trimmed. Proven
by mutation (reporting nothing; counting untrimmed length).

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 14:54:10 -07:00
CatoandClaude Opus 5.5 9b893bbe61 fix(widget): never sit on the host page's own controls at desktop width (#882)
The interactive-control hit-test only ran at <=480px. On OrangeCat /messages
the launcher stepped over the Cat FAB (a fixed element, correctly avoided) and
landed exactly on the composer's Send button: clicking Send opened the
feedback panel and no message went out, from Sep 6 until now.

- stepOffControls: pure, bounded, tested; runs at every viewport width.
- Re-run placement after client-side navigation (URL poll), since SPA route
  changes emit neither load nor resize.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 14:48:37 -07:00
CatoandClaude Opus 5.5 59ad5bc471 chore(crons): register substrata's daily BLS series fetch (#881)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 14:35:25 -07:00
CatoandClaude Opus 5.5 715ed7a3d9 docs(architecture): builders and booking — anyone can build here, without org peering (#880)
The studio is at capacity; builders should still be able to join, be booked and
work on one project. Records where each part lives (Loki / OrangeCat / the site
as a door), the slices in order, the decisions taken, and the trap: org
membership grants visibility AND dispatch over every peer's projects
(getOrgProjects feeds control, inject and orchestration), so a booked builder
is a project editor (#872), never an org peer.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 14:06:25 -07:00
CatoandClaude Opus 5.5 6ee4cbb858 feat(widget): Chat mode — a chat the Cat and Loki both live in (#879)
The widget's Chat tab ships. A visitor on an embedding site asks; whichever of
the Cat (earning, getting paid) and Loki (getting things built) the question
belongs to answers as itself — both when both have something useful — from the
public fleet map, and is sent to the project that fits.

- POST /api/widget/chat: fcw_* token + origin allowlist + per-IP/per-token
  limits, charged to the token owner's fair share of the free AI pool. Links are
  attached from the map, never typed by the model. When the budget or every
  vendor refuses it still routes by keyword match (degraded: true).
- src/lib/widget-chat/concierge.ts: pure facts/prompt/links/fallback. Retired
  projects, throwaway names (same pattern as the litter gate, pinned equal) and
  unwritten not-running projects are not offered; stage words say beta/pilot,
  never live/client; facts are budgeted to survive free-tier limits.
- Chat is OPT-IN per embed (data-fc-modes="chat,report"); the default is now
  Report alone, because the same bundle runs on pilot sites. The first listed
  mode opens first. window.Loki.ask(question) lets a host page hand a question
  over (bitbaum's homepage does).

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 13:58:52 -07:00
CatoandClaude Opus 5.5 b5367efe74 chore(crons): register substrata's science-pipeline timer (#877)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 13:56:26 -07:00
CatoandCato 13e433c4dd chore(register): add skif (4027) (#878)
Co-authored-by: Cato <catomean@users.noreply.github.com>
2026-09-24 13:24:11 -07:00
CatoandClaude Opus 5.5 1fb5076765 chore(cron): schedule substrata's event drafter hourly at :32 (#876)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 13:17:36 -07:00
CatoandClaude Opus 5.5 cf0a944107 chore(crons): register substrata's sweep and EDGAR filings timers (#875)
Both were hand-made on the box (the sweep) or not yet made (filings), so a
rebuild would have lost them and neither had OnFailure alerting.

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 11:49:27 -07:00
CatoandClaude Opus 5.5 5f1e283117 fix(scripts): grep -q is never the reader of a pipe under pipefail (#874)
`echo "$x" | grep -q PAT` under `set -o pipefail` can report "not found"
for text that IS there: grep -q exits on its first match and closes the
pipe, the writer takes SIGPIPE (141), and pipefail makes the pipeline
status 141. An `if` then takes the else branch on a successful match.

#587 found this in one file and noted it "only fires when the payload
exceeds the ~4KB pipe buffer". That is not so, and the belief is why
82 copies in 22 scripts survived. Measured today on retire-site's real
1,158-byte plan output with has()'s exact pattern, 3,000 calls each:

  'DRY RUN'        line 3 of 20    echo|grep -q   2/3000 false misses
  'apps.conf row'  line 11 of 20   echo|grep -q   2/3000 false misses
  last phrase      line 20 of 20   echo|grep -q   0/3000
  'DRY RUN'                        here-string    0/3000

Rare per call, but verify makes hundreds of these calls, and the
retire-site suite went red on those two exact phrases twice this week,
passing every rerun. It is worse in a NEGATIVE check - hasnt() read a
false miss as a PASS. And several copies are not tests: deploy-hetzner.sh
exits 1 on a false miss, and the sshd drift watch would raise a false
security alert.

All 82 rewritten to `grep -q PAT <<<"$x"` (a here-string is not a
pipeline, so there is no writer to signal) by a script that only touched
the simple quoted-variable form and reported anything else. Checked: all
22 files pass `bash -n`, every file is a 1:1 line swap (82 lines), and
the 20 line-continuation sites keep the here-string before the trailing
backslash (the first draft of the rewrite got those wrong; caught in a
dry-run diff before anything was written).

#587's comment is corrected so it stops teaching the wrong threshold.

Gate: scripts/test/no-grep-q-in-a-pipe.ts ratchets it repo-wide,
including forms the rewrite skipped (e.g. "$(cmd)" | grep -q), and
self-tests that its detector still fires. Proven by restoring the
original deploy-hetzner.sh line.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 02:57:19 -07:00
CatoandClaude Opus 5.5 bec2a9d67c perf(runs): fetch the latest run per path, not every run ever made (#873)
getLatestRunsByProjectPaths selected every run for every path and kept
the first per path in JS. Measured on production today for the busiest
user: 699 rows at ~1.26 KB each (~880 KB, mostly `summary` JSON) fetched
and parsed to keep 32. Control paid that on every poll; since #863 the
/today front door pays it on every load, and it grows with every run.

Postgres time was ~2 ms either way, so the cost was transfer and parsing.
DISTINCT ON (project_path) returns only the 32 rows the caller keeps.
The repo already uses selectDistinctOn on this table (register/load-map).

Equivalence checked against production data before changing it: the old
and new selection pick the same run for all 36 (user, path) pairs, with
0 mismatches; there are 0 ties on the latest started_at and 0 NULL
started_at values, so neither tie-breaking nor NULL ordering can differ.
The drizzle-generated SQL (via .toSQL()) was run read-only on prod and
returned 32 rows.

Gate: latest-run-is-one-row-per-path.ts pins both halves. The ORDER BY
must lead with the DISTINCT ON column or Postgres rejects the query at
runtime, which tsc cannot see and both callers would swallow into an
empty map, so run health would silently stop reporting. Proven by
mutation both ways.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 02:34:52 -07:00
CatoandClaude Opus 5.5 ef96be9b91 feat(projects): invite anyone into a project by email, account or not (#872)
Inviting a collaborator required them to already have a Loki account.
The members route answered "No Loki account uses that email. Ask them to
register first." — a dead end with no way to ask. The only other invite
path creates a LOCAL-PASSWORD account and adds it to the inviter's whole
org: broader than one project, and a second identity path beside
OrangeCat, which fleet STACK.md says our own products must not grow.

Now any email works:

- Has an account: added at once, as before.
- No account: a one-time invite is created, emailed when mail is
  configured, and ALWAYS returned as a link to copy — an email that was
  sent is not an email that was received. They open it, sign in with
  OrangeCat (creating that account on the way), and join exactly this
  project with exactly the role chosen. No Loki password anywhere.

The link is bound to the invited email. A token is a bearer secret that
gets forwarded; on its own it would let whoever holds the link in. The
wrong account is told which address it was for, masked (ge•••@gmail.com)
because the link may be in the wrong hands.

Only a sha-256 of the token is stored, so a leaked backup cannot be
replayed as working links. Acceptance spends the invite and grants the
membership in one transaction guarded on accepted_at/revoked_at IS NULL,
so a double click or two tabs grants once. Re-inviting the same email
revokes the old link rather than leaving two live ones.

"emailed" is only reported when mail is configured AND the send
succeeded: sendEmail returns quietly when mail is off, so trusting the
call alone would have claimed an email nobody sent.

The panel moved from a collapsed "Editors" disclosure inside the
Feedback tab to the top of the project's Settings tab — where every other
product keeps "people with access", and where George looked for it. It
now offers Editor or Viewer, lists pending invites, and lets the owner
withdraw one. Editors do not see pending invitees' emails.

The accept API lives under /api/invitations/project/ so it inherits the
existing public-route exclusion instead of widening the proxy allow-list.

Migration 0080 is hand-written, like 0073-0079: drizzle/meta's snapshot
stops at 0072, so `drizzle-kit generate` diffs against a stale picture —
it believes beacon_sessions still exists and calendar_busy does not, and
would have emitted a DROP and a duplicate CREATE alongside this table.

Tests: 14 checks on the acceptance rule, proved by mutation — removing
the email binding turns the suite red. tsc clean, lint 0 errors,
check:design ok, format ok, test:unit 260/260, test:home 130/130.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 02:34:14 -07:00
CatoandClaude Opus 5.5 9dfe6e6b11 fix(control): the hero says whose need it counts (#871)
Control's hero counted ONLY agent attention (session or last-run health)
but claimed the whole phrase: "1 project needs you - loki". /today's
verdict counts raised flags too, and named evig. Same three words, two
populations, one click apart.

/today is now the complete answer (#863). Control is the fleet page, so
it keeps its scope and says it: "1 project's agent needs you".

Gate: one-meaning-of-needs-you.ts gains a check; proven by restoring the
unqualified phrase.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 01:18:46 -07:00
CatoandClaude Opus 5.5 1462286a1e fix(public): show who is signed in, and let them sign out, on public pages (#870)
Signed in on loki.orangecat.ch, the public header offered "Open Loki ->"
and nothing else: no avatar, no name, no way to sign out. The account
menu that does all three already exists — AppTopBar renders it — but only
inside the app, so from the landing page the only route to signing out
was to enter the app first. George could not find it at all.

This reuses that AccountMenu rather than drawing a second one, so the
public header and the app header give the same answer about identity:
same avatar, same Settings / Appearance / Sign out.

Signed in, the standalone theme toggle goes away, because the menu
already carries Appearance — the same move the app made when it put the
theme inside the account menu. Signed out, nothing changes.

Phones: the header fits three controls (the comment above records that
a fourth pushed the CTA off the edge). Signed in, the three are now
brand, avatar, drawer; "Open app" moves off the phone header because the
drawer already leads with it. Desktop keeps "Open Loki ->" beside the
avatar.

tsc clean, eslint clean, check:design ok, test:unit 259/259.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 01:13:40 -07:00
Catoandfleet-reconciler f80d778b54 chore(deps): raise shared package floors to published versions (#869)
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-09-23 17:02:40 -07:00
Cato f02a96218f docs(ci): recommend post-CI deploy handoff (#868) 2026-09-23 13:59:59 -07:00
Cato d58cead44f feat(ci): allow exact SHA for workflow-run deploys (#867) 2026-09-23 13:51:52 -07:00
Cato fcd38cb463 fix(loki): clarify terminal and retire stale guidance (#866) 2026-09-23 07:58:21 -07:00
Cato 4b9542c14e feat(loki): deepen investigations without repeating tool actions (#865) 2026-09-22 14:04:50 -07:00
CatoandClaude Opus 5 d2ac85ec21 fix(projects): a health signal has one name, and it is not "Broken" (#864)
Seen on production today, evig's health panel, three headings stacked:

  x Security risk   Email verification bypass: anyone can register...
  x Broken          Marketplace, Repairers, IT-Hilfe (API returns HTML)...
  x Deploy issue    CMS backend (Express port 3001) not deployed...

"Broken" is not a thing. It read as an unfinished string between two
real labels - and four inches away on the same page, the same signal
was writing itself out as "4 broken features".

The cause was two fields for one concept. Every signal carried BOTH a
`label` and a `cardLabel`, drifted in wording AND in casing:

  label             cardLabel
  "Security risk"   "Security Risk"
  "Broken"          "Broken Features"
  "Deploy issue"    "Deployment Issue"

Nothing distinguished them. No surface needed a different word - they
were written twice and maintained once, so the badge said one thing and
the raise-a-flag sheet another about the same flag, and the copy that
got left short is the one at the top of the panel.

One name per signal, sentence case, and `cardLabel` is gone. The one
surface that wanted it lowercase calls .toLowerCase() instead of
keeping its own copy. The "4 broken features" row is unaffected - that
label is a runtime count, not this field.

Also repoints an existing gate. a-flag-can-be-raised-and-cleared.ts
required a `cardLabel` specifically, which pinned the IMPLEMENTATION
(two label fields) rather than the rule (a signal the operator can
raise must have a name) - so collapsing the two fields failed a gate
even though it fixed the defect. It now asserts the rule.

Gate: scripts/test/one-name-per-signal.ts, 5 checks. Proven by mutation
- restoring the "Broken" stub, letting Title Case back in, and
reintroducing a second name field each fail on the matching check.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 13:16:30 -07:00
CatoandClaude Opus 5 ed49fd6e0e fix(today): "needs you" means one thing, and the front door knows all of it (#863)
Measured on production today, same login, minutes apart:

  /control hero    "1 project needs you - loki"
  /today verdict   "7 things need you", and the project it names is evig
  /projects chip   "Site issues 1" - evig

/projects and /today agree since #857. Control overlapped with NEITHER:
it counts projects whose agent SESSION or last RUN is unhealthy, the
other two count raised flags (security / broken features / deploy issue
/ site down). Same three words, three different populations.

So the front door said seven things needed me, and Control - one click
away - named a project that was in none of the seven. Trust /today and
you miss a blocked agent; trust /control and you miss an authentication
bypass. A front door that is incomplete teaches you to check everything
anyway, which is the whole thing it exists to stop.

ONE DEFINITION. The scoring moved out of control-presenter into
src/lib/project-attention.ts, taking two health strings and nothing
else - so a client component holding live SSE state and a server
component holding two DB reads can both ask it. Control is now a
four-line adapter. The scoring, including the `score <` guards that
stop one trouble seen in two places counting twice, is preserved
exactly, and the reason strings are unchanged so both surfaces name the
same trouble with the same words.

THE FRONT DOOR ASKS IT. /today derives blocked projects server-side
from the same two sources Control reads (project_states.session_health,
orchestration_runs.summary.health), joined on the same keys Control
joins on (normalized tab name, dirPath), and merges them with the
flagged list - deduped, with the flag winning, because a flag says what
is wrong in the operator's own words where a health word does not.

NO ROW LINKS TO A 404. /projects/[id] resolves by ENTITY id, and a
catalog project need not have an entity row. Those are still NAMED and
simply are not links; dropping them would make the verdict quietly
incomplete again.

Gate: scripts/test/one-meaning-of-needs-you.ts, 8 checks. Proven by
mutation - deleting the /today call, double-counting one trouble,
treating missing health data as a problem, and restoring Control's own
scoring each fail on the matching check.

Two of those mutations initially passed. `src.includes("symbol")`
survives a rename (the original stays a substring) AND survives
deleting the call (the import still matches). The gate now asserts the
symbol is CALLED, with import lines stripped first.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 13:03:16 -07:00
CatoandClaude Opus 5 0c126182c5 fix(projects): a 404 is only "gone" if the token could see private repos (#862)
Caught before this shipped, not after it paged someone.

Without the `repo` scope, GitHub answers 404 for a PRIVATE repository —
byte for byte the same response as a deleted one. The checker would have
read that as "your repo is gone" and raised an alert for every private
project of any user whose GitHub link is sign-in-only. An alarm that
fires on healthy projects is worse than no alarm: it teaches the operator
to dismiss the surface, and the real 404 goes with it.

So ask once per user what the token is actually allowed to see —
`x-oauth-scopes`, which GitHub sets on every API response — and let that
decide what a 404 is permitted to mean. No scope, no verdict: it
downgrades to `unchecked`, which already exists and is already excluded
from auto-resolve.

Absence of the header, or a failed call, counts as "cannot see private" —
the pessimistic read is the only safe one here, because the cost of
guessing wrong is a false alarm about a repo that is fine.

Proven by mutation: trust the 404 regardless of scope → the test fails
with expected 'unchecked'.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 12:57:29 -07:00
CatoandClaude Opus 5 f12b60931a fix(projects): a project page leads with what is wrong, not what the machine is doing (#861)
Measured on production today, evig's Now tab, top of the viewport:

  BUILD
  * Nothing is being built right now          [ Make it happen ]
  Last attempt finished partially 24d ago after 16m
  --------------------------------------------------------------
  Security risk  Email verification bypass: anyone can register
                 @revamp-it.ch and get Staff role with admin
                 access to 14 areas                      [Fix]
  4 broken features  ...
  Deploy issue       ...

The page's largest type and its only orange button went to "nothing
is happening". A live authentication bypass was plain grey text
underneath it.

That is the same fault /today had and #855 fixed: the surface reported
the MACHINE'S STATUS where the reader was asking what needs them. Idle
is not news; a security hole is.

So the flags lead WHEN THERE ARE FLAGS, and the build status leads when
there are none - at which point "nothing is being built right now" is
genuinely the most useful thing the tab can say. Need above status, but
only when there is need. The block carries one warning rule and no tint
(principles 2 and 3), and the heading names the count in words rather
than showing a bare number.

Raising, editing and clearing still live in ProjectFlags further down,
which is always rendered.

Gate: scripts/test/project-leads-with-need.ts, 5 checks, picked up by
the test-unit glob. Proven by mutation - restoring build-above-flags,
rendering the alarm unconditionally, and tinting it instead of ruling
it each fail, on the matching check.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 12:38:37 -07:00
CatoandClaude Opus 5 264101889b feat(projects): notice when a repo moves, and fix it without asking (#860)
`git_url` was written once, when a project was registered, and trusted
forever. Nothing ever asked GitHub whether it was still true.

Measured against production on 2026-09-22: eight of thirty-three stored
repos were wrong. Four point at repositories that no longer exist (three
are abandoned factory experiments), two at a retired personal account
that has since been renamed, two at deleted scratch repos.

That is not cosmetic. git_url is the address every agent dispatch, clone
and CI lookup starts from, so a stale one surfaces as a confusing build
error inside a run the operator already paid for, rather than as "this
project points at nothing".

THE DISTINCTION THIS IS BUILT ON

GitHub already knows the difference between a repo that MOVED and one
that is GONE, and Loki was throwing it away. A rename answers with a
redirect and the new full_name — so Loki can simply fix it, which is the
automatic repair that being connected to GitHub is supposed to buy. A 404
cannot be repaired by a machine: deleted, or made private, or renamed
away without a redirect, and the only honest response is to say so once.

  moved     → healed silently, logged
  gone      → one alert, refreshed not duplicated
  unchecked → neither, and explicitly NOT counted as healthy

That third state is load-bearing. A dead token or a network blip must
never read as "all repos fine" — the auto-resolve is gated on it, so a
tick that could not look can never clear a real alert.

- src/lib/github-repo-ref.ts — parsing and one lookup, kept apart from
  the route so both are testable with no network and no database
- src/app/api/crons/check-project-repos/route.ts — daily 06:20 UTC
- project_repo_missing registered in config/alert-types.ts, whose own
  gate checks the producer file really raises it

scripts/test/github-repo-ref.ts covers 15 stored URL forms (ssh remotes,
trailing .git, deep links, a dot in the repo name, non-GitHub hosts) and
pins all three verdicts across 9 responses. Case alone is not a move —
GitHub is case-insensitive here, and healing on case would rewrite rows
forever without changing anything.

Proven by mutation: treat 401/403 as healthy → "HTTP 401 must be
unchecked, got ok"; stop detecting renames → the moved assertion fails.

tsc caught a real bug pre-commit: the summary's `ok` count would have
overwritten the response's boolean `ok`, so every caller checking it
would have read a number. Renamed to `healthy`.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 12:32:06 -07:00
CatoandClaude Opus 5 923f0bf4ef fix(feedback): one declaration of the summary shape, and a legible assertion (#859)
Two follow-ons found by the gate from the previous commit.

1. The summary SHAPE was declared three times. NotificationPanel and
   NotificationsPill each carried a structural copy of
   ProjectFeedbackSummary. A second declaration never breaks at runtime,
   which is why it survives - it just quietly stops seeing any field the
   real type gains. Both now import it, and the gate has an eighth check
   that refuses a re-declaration. I only spotted the panel by hand; the
   gate found the pill.

2. scripts/hetzner/test-retire-site.sh failed once inside a full verify
   ("expected output to mention 'DRY RUN'") and then passed 25/25
   standalone. The cause is still unknown - it only misses under
   concurrent load - and it was undiagnosable after the fact because the
   assertion prints what it WANTED and never what it GOT. has() now dumps
   the first 400 chars of the actual output on a miss, in the three
   hetzner suites that share the idiom. Proven by mutating an assertion to
   look for a string that is not there.

Not claiming the flake is fixed. Claiming the next occurrence will say
what happened instead of costing an hour of guessing.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 12:21:35 -07:00
CatoandClaude Opus 5 ce7ecd3e91 chore(account): deleting an account cannot silently stop working (#858)
`deleteUserAccount` hand-clears every table whose user FK is not
onDelete:"cascade", because the users row cannot go while such a row
points at it. That was seventeen `tx.delete(...)` calls in a fixed order
with a comment asking the next person to remember, and nothing checked it.

So adding a table with a plain `references(() => users.id)` broke account
deletion silently. tsc is happy — the new table is simply not mentioned.
Every test is happy — nothing exercised the path, in either direction:
`deleteUserAccount` had exactly two references in the repo, its route and
itself. The failure surfaces only when a real person opens Settings →
Danger zone, types their email to confirm, and gets a 500 on the one
action they cannot retry their way out of.

Measured against production first: seventeen tables need clearing and all
seventeen were already handled, so this goes in green. It is here to keep
that true, not to fix a present break. (The FK violation seen earlier in
this session came from a raw SQL DELETE that bypassed this function —
the app's own path was already correct.)

- the list moves to src/db/queries/user-purge-tables.ts and becomes data
  the function iterates, so the code and the declaration cannot disagree
- it lives apart from users.ts because users.ts imports `@/db`, which
  opens a client at module load; the gate has to run in CI, where there
  is no database (same reasoning as the deferred import in lib/email.ts)
- scripts/test/account-deletion-covers-every-table.ts derives the truth
  from drizzle's own table metadata, never by parsing source — a regex
  over `.references(` would be a second, weaker description of the same
  fact. It checks BOTH directions, so an entry left behind after a table
  gains onDelete:"cascade" is reported too, rather than sitting there as
  a no-op that reads like protection.

Proven by mutation, three ways: drop a table from the list → names
goals.user_id as blocking; give a listed table onDelete:"cascade" → names
it as a stale entry; add a new table with a plain user FK → names
gate_probe.user_id. scripts/test-unit.ts globs the directory, so the gate
is wired into `verify` by existing, and it ran green there.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 12:11:11 -07:00
CatoandClaude Opus 5 15977ee864 fix(feedback): one derivation of "N needs you", and it counts the right things (#857)
Measured on production today, on a single screen: the sidebar badged
Feedback 4 while /today's front-door verdict — shipped an hour earlier to
end exactly this — said "5 feedback reports to triage" four inches away.

Four derivations of one number existed, in three spellings:

  use-control-inbox    sum of (s.newCount || s.openCount)
  NotificationsPill    sum of (s.newCount || s.openCount)   hand copy
  ControlInbox         s.newCount > 0 ? s.newCount : s.openCount
  FeedbackNavCount     sum of s.newCount

The majority formula is not merely duplicated, it is backwards. openCount is
new + dispatched, so a project with 1 new and 4 dispatched contributes 1,
and one with 0 new and 4 dispatched contributes 4: the further along a
project gets, the MORE it inflates a number captioned "to triage".
Dispatched means an agent already has it - the opposite of waiting on you.

The fallback was added so a project chip would not vanish mid-watch when its
last NEW row flipped to dispatched. It never did that job:
listFeedbackSummary already filters status IN (NEW, DISPATCHED), so every row
it returns has openCount > 0 and the chip stays listed on its own. The
fallback only ever leaked in-progress work into a count of pending judgement.

So: triage is the count, presence is the list, and they are different
questions - asked by name in src/lib/feedback/queue-counts.ts. Removing the
fallback re-created the mid-watch bug for real (the group was gated on the
count), so the group is now gated on presence and counted on pressure, and a
project with nothing new says "in progress" instead of showing a number that
reads as work you owe.

Gate: scripts/test/one-number-for-feedback.ts, 8 checks, picked up by the
test-unit glob. Proven by mutation - restoring the fallback, re-deriving the
count in the sidebar, counting openCount in the owner, and re-gating the
group on the count each fail, on the matching check.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 11:48:48 -07:00
CatoandClaude Opus 5 8c9faf2a44 fix(crons): the backfill starved every project past the first few (#856)
The tick walked the projects in order and stopped at its budget, from the top,
every time. So a project far enough down the list was never reached — not
"eventually", never.

Measured on prod while catching up the five-day outage: three consecutive
ticks each reported `posted: 30, capped: true`, and across all three Heidi's
wall went 0 → 0 → 0 correct links while the head of the list was re-sent its
same thirty moments. The janitor looked busy and was starving its own tail,
and the counters could not tell the difference: thirty posts is thirty posts
whether they are thirty projects moving forward or one project repeating.

Round-robin makes the budget a SHARE rather than a race — every project's
queue is built first, then one moment is taken from each in turn. Every wall
moves every tick, a project with a large backlog cannot hold the others
hostage, and an empty queue simply stops being asked, so unused turns are
reclaimed rather than reserved.

verify: tsc, lint (0 errors), test:unit 252/252.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 11:10:56 -07:00
CatoandClaude Opus 5 230000cb4d feat(today): the front door says what needs you (#855)
Measured on production with /today fully expanded: the page mentioned
"feedback" ZERO times, "failed" ZERO times and flagged projects ZERO times.
What it showed was a greeting, the weather, an empty sticky note, and "92 runs
this week" — while the sidebar three inches to the left badged "Feedback 4".

So the front door reported VOLUME. The one question it exists to answer —
"what needs me?" — was answered three clicks away on Control, and answered
DIFFERENTLY again on Activity (Control's 7 was 5 feedback + 2 widget;
Activity's 7 was attention events).

The verdict now renders first, above the weather and the note.

ONE OWNER, NOT A THIRD COUNT. It reads `useControlInbox` — the same hook
Control's own inbox uses — so the two surfaces cannot disagree about the
number. A third derivation of "needs you" is precisely how there came to be two
different sevens. Flagged projects come through `hasProjectAttention`, the same
predicate the projects list sorts by, and honour `valid_until` the same way, so
a project cannot be flagged on one page and calm on another.

A FAILED FETCH IS NOT "NOTHING". On a page whose whole job is to be trusted
when it says you are free, a request that errored must never render as the
confident answer "no" — it says "could not check", disclaims itself, and offers
a retry. The hook already modelled this; nothing had been reading it.

An empty queue is SAID, not left blank: a page that shows nothing when nothing
is wrong teaches you to distrust its silence.

Flags are NAMED with their own words ("evig — Email verification bypass…"), not
counted. A count is a number to go and decode; the sentence is already in the
database.

Styling follows the principles added in #848: no box and no colour in the calm
state, a single warning rule in the alarm state, and nothing tinted but the
alarm.

Guarded by scripts/test/today-answers-the-question.ts (7 checks), which pins
the two honesty rules — one owner, and a failed fetch is never an all-clear —
as hard as the ordering.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 11:05:52 -07:00
CatoandClaude Opus 5 d90d180a07 fix(crons): the backfill spent a third of every tick being refused (#854)
OrangeCat allows 30 writes per minute per user (rateLimitWriteAsync, sliding
60s window). This janitor fired its whole tick as fast as the event loop
allowed, so the first tick after the five-day publishing outage reported
exactly what the arithmetic predicts:

    {"projects":9,"attempted":50,"posted":30,"skipped":0,"failed":20}

The first thirty landed, the bucket emptied, and the remaining twenty came
back 429 and were counted as failures. Not a flake to retry past — ANY backlog
over thirty burned the rest of its budget on refusals, every tick, and the
deterministic external ids meant the next day re-sent the same doomed twenty.

Paced at the neighbour's published limit with headroom (60000/30 = 2000ms →
2100ms), nothing is refused and nothing is wasted. The number comes from their
limiter, not from tuning until the errors stopped.

With a pace comes a clock, so the tick now also stops at 90s — under the
systemd timer's `curl -m 120`. A tick killed mid-flight reports nothing at
all: no counts, no debug_logs row, just a dead curl. Ending early and saying
`capped` keeps its account of itself intact, and the rest is picked up next
tick.

verify: tsc, lint (0 errors), test:unit 252/252 — the new test derives its
floor from the neighbour's documented limit rather than restating a constant.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 11:00:08 -07:00
CatoandClaude Opus 5 7b12766a2f fix(settings): three more claims that did not survive being checked (#853)
Swept the remaining tabs after the Account fixes. Most held up — Billing is
honest about Stripe being gone, Profile's "2-40 characters, lowercase letters,
numbers and hyphens" matches the zod rule exactly, the digest's "cron tick at
07:00 UTC" matches the timer on the box (last run 07:00:04), "Unlimited
projects" is true (pro and team are Infinity), and the PIN-gated export
correctly refuses with "Private zone locked" rather than failing silently.

Three did not.

APPEARANCE — pointed at a control that is not there
  "Tap the sun/moon icon in the top bar or sidebar to cycle modes quickly."
  ThemeToggle renders in AccountMenu, the settings page and the public nav.
  There are ZERO occurrences in Sidebar.tsx, and the top bar shows a panel
  icon, a bell and the avatar — no sun/moon. The instruction sent the operator
  hunting for something that does not exist. It now names the account menu,
  which is where the control actually is.

AI — said one source when there are three
  "Counters are recorded from the rate-limit headers on answers already served,
  so a provider only appears once it has served one."

  Not true, and the exception matters: recordPreflightSkip() writes a row with
  source: "preflight" for a link that was skipped BEFORE being called, so a
  vendor can appear here having served nothing — the precise thing the sentence
  ruled out. The third source is readingFromRefusalBody(), which exists because
  Groq publishes a daily token pool only in the body of its 429 and never in a
  header. The copy now names all three and keeps the part that was always true:
  none of it costs a request to measure.

PROJECTS — an instruction with no path
  At the project limit the Add button is disabled with the tooltip "Upgrade
  your plan to add more than N projects" — an imperative with nothing to act
  on. There IS a banner below carrying a "See plans" link, so it is not a dead
  end, but the tooltip now states the limit rather than issuing an order.

  Worth noting: that banner links to /settings#billing, and until the hash fix
  in the previous commit it did nothing at all — a hash change on the page you
  are already on was ignored, so the one route out of the limit was broken from
  the only screen that shows it.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 10:52:24 -07:00
CatoandClaude Opus 5 9cf022af46 fix(auth): the credential write no longer rides on unrelated bookkeeping (#851)
#849 put the token persist inside the sign-in event's existing try block,
behind the onboarding heal and in front of the org bootstrap — all three
sharing one catch that swallows what it catches. So a failure in work the
write does not depend on would silently cost the write, and the whole point of
that call is that it is the only way a broken link can be repaired at all.

Its own try, first, with its own debug_logs line naming the provider. Nothing
else changes: the same account object, the same conditions, the same
best-effort contract that sign-in must never fail because bookkeeping did.

verify: tsc, lint (0 errors), test:unit 251/251.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 10:38:38 -07:00