Commit Graph
4 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
GandClaude Opus 5 caa0e41c3b chore: add a formatter (#449)
* chore: add a formatter, matching the style this repo already writes

singleQuote=false was chosen by counting this repo's own
imports, not by fleet decree. The fleet is genuinely split and the two repos
that already had a .prettierrc disagreed with each other, so there was no
standard to restore. Quote style does not cross repo boundaries; having a
gate does.

Markdown is ignored for now — prettier rewraps prose, which would bury the
real diff.

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

* style: format with prettier (1062 files)

Mechanical. No behaviour change. This SHA is listed in
.git-blame-ignore-revs so `git blame` skips it.

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

* chore: teach git blame to skip the reformat

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

* fix(lint): reattach two guards the reformat detached

Both effects were one-liners, so a trailing eslint-disable-line covered the
setState call:

  useEffect(() => { setSelected(new Set()); }, [q.length]); // eslint-disable-line ...

prettier expanded the block. The comment stayed on the closing line while the
call moved above it, so the guard protected nothing and the rule its author had
deliberately silenced failed the build.

This is the second shape of the same defect — hirnli had the eslint-disable-NEXT-line
variant. Both come from the same fact: an eslint directive binds to a line
number, so reformatting can silently unbind it, which makes 'mechanical, no
behaviour change' false for any bulk reformat.

* chore(desktop): bump the runner version the reformat requires

desktop-release-drift enforces that anything built into Fleet Runner which
differs from the last released tag must carry a version ahead of that tag —
main read 0.8.15 and fleet-runner-v0.8.15 already shipped.

A whole-repo reformat changes bytes under desktop/, so the gate fires. The
alternative was adding desktop/ to .prettierignore, which would buy a quiet PR
by carving a permanent hole in the formatter's coverage — the precise shape of
silent drift this test was written to catch. Bumping is what the rule asks for
and costs one patch release whose only content is whitespace.

* chore: merge main and re-format

A whole-repo reformat conflicts with any concurrent commit, and a conflicting PR
runs no checks at all while reporting nothing. Conflicts resolved to main,
which is correct because this branch changes formatting and nothing else.

* chore: leave desktop/ out of this reformat

desktop-release-drift is right to refuse this. Everything under desktop/ is
built into Fleet Runner, so changing it means shipping: bump the version AND add
a FLEET_RUNNER_RELEASES entry, whose stated audience is 'person who installed
Fleet Runner and wants to know what changed'. For a whitespace-only build the
honest answer is 'nothing', so that release should not exist — and I should not
write release notes claiming otherwise.

I had bumped to 0.8.16 to get the gate green. That was the wrong direction:
publishing a build to three OS runners to keep a formatting PR quiet. Reverted.

desktop/ is excluded in .prettierignore with the reasoning recorded there, to be
formatted alongside the next real runner change, where the bump and the notes are
true anyway.

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 09:23:30 +00:00
20fb952ef1 fix(system): give the runner-version check a path that actually runs (#389)
#388 put the comparison in Fleet Doctor. Probing the live authenticated
endpoint afterwards returned HTTP 200 with exactly ONE check:

  {"runtime": false, "checks": [{"id": "runtime", ...
    "Fleet Doctor runs full checks only on the local install."}]}

On the hosted box `isRuntimeAvailable()` is false, so the route
short-circuits and executes none of its checks. A check that lives only in
Doctor never runs in production — present, plausible, and incapable of
firing where it matters. Exactly the shape of bug this check was written to
catch, one level up.

So the live path is a clock: /api/crons/check-runner-version, daily 06:50
UTC, mirroring the telemetry freshness cron proved this morning. Deduped
alert, Telegram once per episode rather than per tick, auto-resolve when
every runner is accounted for — and never auto-resolve while one is UNKNOWN,
which would turn "we cannot tell" into "fixed".

`ahead` stays a pass: the box builds from main and reaches a version before
that version is tagged, so alerting on it would fire every merge and train
the surface out.

Two new assertions keep the live path alive: the cron must CALL the checker,
and it must appear in the SCHED table. The first version of the call
assertion used .includes(), which the surviving import line satisfied while
the call site was gutted — a mention is not a use. Comments are stripped
before matching, for the same reason.

Mutation-proven nine ways now, each red then green.

Fleet Doctor keeps the check for local installs; it is no longer the only
place it exists.

Co-authored-by: t <t@t.t>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-26 13:38:11 +00:00
970578f090 feat(system): notice when a machine is running a Fleet Runner we replaced (#388)
* fix(orchestration): narrow a claim I overshot — `undelivered` becomes `unconfirmed`

Yesterday's #383 added an outcome asserting the prompt "never reached an
agent". Reading the runner's actual acks afterwards does not support it:

  {"ok": true, "text": "injected to running claude (pty)",
   "verified": false,
   "warning": "... isn't generating yet — may still be booting or already idle"}

The runner INJECTED. What it could not establish is whether the agent picked
the prompt up. Both readings stay open — the pane may have been idle with the
agent gone, or the agent may have been wedged — so the outcome must name the
observation and not pick a conclusion.

`undelivered` was also already taken. closeRunUndelivered handles a runner
NACK (ok:false, the prompt provably never landed) and closes as `error`.
Overloading that word with a weaker signal put two confidences behind one
name, which is the defect #383 existed to remove.

Nothing about behaviour changes. `unconfirmed` is still a failing outcome,
the brake still stops, the ladder still advances, and the ladder still
declines to tell an agent to re-plan work it never received. Only the claim
narrows — and the operator-facing copy now ends with the useful part:
nothing ran, so a retry is free.

Migration 0059 relabels the 29 rows and rewrites the explanation 0058 wrote
into them. Dry-run against prod inside a rolled-back transaction: 29
undelivered → 29 unconfirmed, timeouts untouched at 129.

A new assertion keeps the two words apart: `undelivered` must never appear in
ORCHESTRATION_OUTCOMES, so the stronger signal cannot be re-borrowed.

Root cause of the underlying dispatches, for the record: the laptop runner is
on 0.8.12, and the inject-hardening that retries a stuck paste and hard-fails
instead of acking softly landed 2026-08-23 in c350623c — one of the seven
files stranded by the broken release pipeline, shipped this morning as
v0.8.13. Same chain as #370, #374, #381 and #383.

Mutation-proven nine ways, each red then green.

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

* feat(system): notice when a machine is running a Fleet Runner we replaced

FleetCrown published desktop releases and had no idea whether any machine
ever installed one. Both halves mattered today: releases had not been cut at
all for twelve days (#370/#374), and even after v0.8.13 shipped, the laptop
kept reporting 0.8.12 while the box ran box-0.8.13.

That gap is what produced the last two days of work. 0.8.12 predates the
inject-hardening from 2026-08-23 (c350623c) — the change that retries a stuck
paste and then HARD-FAILS instead of acking ok:true — so that runner kept
accepting unverified injects and leaving the runs to be reaped an hour later.
29 runs died that way and were billed to the projects whose prompts went
unanswered, which climbed escalation ladders that could not clear.

Nothing was missing except the subtraction. FLEET_RUNNER_RELEASES is already
the SSOT for what shipped; every runner reports its version on every
heartbeat. runnerVersionStatus() compares them — no network, no new data —
and Fleet Doctor now fails when a runner is behind.

Four states, and two of them are the point:
  behind  — FAIL. Merged desktop work is inert on that machine.
  unknown — WARN. "We could not tell" is not "it is current"; a runner that
            has never reported a parsable version must never read as fine.
  ahead   — PASS. The box builds from main, so it legitimately runs ahead of
            the newest tag. Reporting that as a fault would cry wolf on every
            merge, and a check that cries wolf is one nobody reads.
  current — PASS.

`box-` is stripped before comparing: without that the fleet's MOST current
runner was the one that read as unparsable.

Mutation-proven seven ways, each red then green — including unknown read as
current, the helper left uncalled by Doctor, and the default release list
forked from the changelog SSOT.

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

---------

Co-authored-by: t <t@t.t>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-26 13:08:12 +00:00