Commit Graph
2 Commits
Author SHA1 Message Date
CatoandClaude Fable 5.1 95c40a9cd8 refactor: rename the product from FleetCrown to Loki (#695)
The product, its assistant, the repo, the host and every unit on the box now
share one name. 638 files, ~3,000 mentions: UI copy, config, env keys
(FLEETCROWN_* -> LOKI_*), systemd units (fleetcrown-* -> loki-*), docs,
articles, the deploy workflow other repos reuse, and nine file names.

- Three article slugs carried the old name and had been shared; permanent
  redirects keep those links alive (next.config.ts).
- test-no-retired-name.sh now also forbids the old product name across the
  whole repo, so the rename cannot creep back through templates and examples.
- ASSISTANT_STACK collapses the product and the assistant into one entry,
  because they are now the same name.

Infra was cut over ahead of this merge: /opt/loki, loki-* units, the `loki`
database and role, loki.orangecat.ch (old host 308s to it; /api, /widget,
/embed keep proxying), GitHub repos bitbaum/loki and bitbaum/loki-releases.
The Resend sending domain stays fleetcrown.orangecat.ch until the new domain
is verified in DNS.


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

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 16:13:10 -07:00
c8415a348b fix(loki,deploy): the approval queue survives a Groq outage; deploys can't ship off-main (#262)
* fix(loki,deploy): the approval queue survives a Groq outage; deploys can't ship off-main

"What is pending for approval?" answered "Not in your data." in production while
drafts were waiting. Two independent causes, both fixed here.

1. A hand-run deploy shipped a feature branch to the box — twice, minutes
   apart — rotating the correct CI build out through app.prev and reverting
   three merged PRs. Prod served a Loki with no approval-queue tool while main
   had shipped it hours earlier. The symptom was indistinguishable from an
   application bug and was chased through the app first.

   scripts/ci/check-deploy-ref.sh now refuses any deploy whose commit is not
   contained in origin/main, naming both the unreviewed commits and the ones it
   would roll back. Override is explicit and announces itself. deploy-hetzner.sh
   calls it before the schema step, so a refusal leaves the box untouched.
   The existing --ref guard only ever covered HEAD drift DURING a build; this is
   the invariant that was missing. Second occurrence of this class — see the
   comment it replaces.

2. Even on the right build the answer was wrong, because the queue was reachable
   ONLY by tool call. Groq's org-wide TPM window is exhausted: both the 70B and
   the 8B step-down 429 on every call, the bounded retry expires, the tool loop
   dies, and Loki answers from seed facts on a TOOLLESS fallback model — which
   cannot see a tool-only table, so it truthfully reports nothing.

   pendingApprovalFacts() moves to sources.ts and is seeded into the grounded
   context on an approval cue, so the question is answerable with the tool loop
   entirely unavailable. The tool now calls the same function: one definition,
   both paths. Approvals lead the fact list — the seed is head-sliced, so the
   subject of the turn must not sit in the tail.

Tests: deploy-ref-gate.sh (7) covers the incident shape directly — an off-main
branch is refused, an ancestor of main is not. approval-cues.ts (24) pins the
cue against the operator's real phrasings, including the typo from the report,
because a missed cue is silent and reads as a truthful "nothing is pending".

Also folds the duplicated dateLabel (handlers.ts + an inline copy in sources.ts)
into one exported helper.

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

* fix(loki): drop the now-unused getPendingActions import

The tool handler delegates to pendingApprovalFacts, so the direct query import
is dead. tsc does not flag unused imports; eslint does.

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

---------

Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 03:30:31 +02:00