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
CatoandClaude Opus 5 9ffb4f160b feat(scaffold): the day-zero page, in a colour we own, behind gates that can fail (#587)
Rebuilt on main after #583/#585 landed the install fixes independently. Those
commits and mine overlapped almost exactly — pnpm-workspace.yaml, .nvmrc 22,
--frozen-lockfile — so replaying my versions would have duplicated theirs in the
same files. Their work stands; this carries only what is not in it.

THE COLOUR BELONGED TO NOBODY

The day-zero button was #4a6fa5, invented by this template, matching neither
FleetCrown nor OrangeCat. A site sitting in it did not read as "new", it read as
GENERATED — on a client's own domain.

FleetCrown already had the answer, in the exact shape I had just reinvented
badly: --accent-primary / --accent-text / --on-accent. The template now mirrors
that palette in oklch. Monochrome action that inverts by scheme, one warm accent
used sparingly. Until its owner builds it the site IS a FleetCrown surface and
should look like one; the header says so, and says louder that it must change
once it is theirs.

THE PAGE

Proves the host is live, gives ONE primary action into FleetCrown, links
OrangeCat SECONDARILY, and shows receipts — host, repository, pipeline,
certificate — that a client can click and read rather than take on faith.
Neither link is invented: each renders only when its id is set, so a missing one
produces no link rather than /projects/undefined. provision-widget.ts emits the
env fragment (token AND project id) so new-site.sh appends instead of
reformatting one named variable, which is how the id would have gone missing in
silence.

A CLAIM OUTLIVED ITS FEATURE

The page said "point at anything here and it becomes a pull request".
Diplodoctor shipped that sentence with NO widget: provisioning is non-fatal, it
failed, and the warning scrolled off the top of a run that went on to build a
repo, a box and a deploy. layout.tsx gated the widget SCRIPT on
NEXT_PUBLIC_FC_WIDGET_TOKEN; nothing gated the SENTENCE. Both now are, the
failure is carried into the closing summary, and the printed repair had to
change: appending to .env.selfhost.local works only BEFORE the first deploy,
because deploy.sh seeds the box's .env only when it has none and NEXT_PUBLIC_*
is inlined at BUILD time. The old advice was a no-op that looked like a fix.

THREE GATES THAT COULD NOT HAVE CAUGHT ANYTHING

1. Contrast was a grep asserting one palette's SHAPE — "dark must not override
   --color-accent". True of the blue; wrong the moment the action became
   monochrome and inverting. check-template-contrast.mjs computes the real WCAG
   ratio instead (oklch -> OKLab -> linear sRGB, 7 pairs, both schemes, with a
   self-check on known answers). It failed muted text at 4.45:1 on first run,
   against my own estimate of "~4.8, fine".

2. `printf '%s\n' "$x" | grep -q` is a RACE under pipefail: grep -q exits at the
   first match, printf takes SIGPIPE, and the pipeline reports failure although
   the match SUCCEEDED. It fires only when the payload passes the ~4KB pipe
   buffer and the box is loaded — so it presents as a gate that fails once and
   passes on retry, the worst shape a check can have. It bit twice here, both
   times on the 7.7KB page. Ten pipelines are now here-strings.

3. The comment stripper ATE THE EVIDENCE. It was
     sed 's|/\*|\n&|g' | sed '/\/\*/,/\*\//d'
   and a sed range never matches its end address on the start line, so a
   one-line comment opens a range running to the NEXT comment — deleting every
   declaration between them, including the primitive holding the blue. Run
   against the very template it was written to catch, the gate PASSED. It only
   ever worked on files with no blue in them. perl strips comments as comments,
   and the stripper now proves itself in both directions, because "did not find
   the blue" is satisfied equally well by having deleted the file.

Mutation-proven against main's real template, not a fixture: reverting page.tsx
and globals.css to what main ships fails five assertions, including the blue the
broken stripper had been hiding. 28/28 restored, three consecutive clean runs.


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 16:24:22 -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
84706fb9c1 feat(infra): the site scaffold — register, new-site.sh, widget provisioning (#395)
#394 auto-merged on its first commit, so the rest of this work landed on a
branch that was already closed. This is that remainder, rebuilt on main.

**apps.conf becomes the register.** It knew port, domain, repo and database; it
did not know who anything belongs to or whether they pay, so "what am I owed
this month" was unanswerable and the answers lived as prose in bitbaum Status
lines — "first client in progress", "city relationship unverified", "one real
clinic". Six fields added: owner, kind, status, plan, price, since. plan and
price are '-' everywhere on purpose; the gaps are the point.

lib.sh needed its parser widened first — `read -r ... DB` lets bash's last
variable swallow every extra field, so appending columns would have silently
turned DB into "petvity|bitbaum|product|live|-|-". A 6-field line still parses
exactly as before.

**new-site.sh** does repo → register → box → deploy in one command. Substrata
took nine manual steps today; Camille took the same route a week ago and skipped
two of them — creating the repository and registering it — then ran in
production for eight days with no version control, which made the studio's
central claim untestable for the site built to demonstrate it. Those two steps
have no visible payoff on the day, which is exactly why a machine should do them.

Guards, because a slug becomes a DNS label, a certificate subject, a directory
and a systemd unit: non-DNS-safe slugs, slugs already registered, hostnames
already served, and reserved names — infrastructure like supabase, and
impersonation like security, where a valid certificate on our own domain is a
phish rather than a website. Ports come from the register, not ss -ltnp: a port
free on the box but claimed here belongs to something not currently running.

**provision-widget.ts** creates the FleetCrown project and mints a token bound
to that site's origin. The widget is why this is not a dev shop — the owner
points at their own page and an agent changes it — so it is provisioned at birth
rather than later. Idempotent and deliberately non-rotating: rotating would
silently invalidate a snippet already live on a customer's site. Non-fatal in
the scaffold, because a missing widget is a minute's work while a half-finished
scaffold is a mess.

**The template ships tokens that say in the file that leaving them unchanged is
a bug.** Twenty-four identical sites would destroy the thing being sold.

Verified: guards refuse five bad inputs, dry-run allocates the next port and
prints every step, template installs and builds static pages clean, and the
widget provisioner was proved against the live database by giving Substrata its
project and token — now serving in production.

Co-authored-by: Mao Nakamoto <georgy.butaev@revamp-it.ch>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-27 13:47:30 +00:00