mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 08:47:02 +01:00
register/probe-loop
178
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f76e6bf212 |
chore(infra): register aoz-demo, a no-account AOZ demo that never takes aoz-wohnen's push hook (#922)
- apps.conf: aoz-demo|4028|demo.aoz.orangecat.ch, kind demo, owner bitbaum (same aoz-begleitung checkout as aoz-wohnen; not a client app). - install-push-deploy: a demo sharing its repo with a real app is skipped. install_hook REPLACES the marked block, so the last row sharing a repo won; appended after aoz-wohnen, the demo would have made every push to aoz-begleitung deploy the demo instead of the app. - install-app-crons: nightly /api/cron/reset-demo for aoz-demo ONLY (the route truncates the database). - test-demo-instance.sh (in test:ops): the push-hook guard, and reset-demo registered only on a kind=demo app, never aoz-wohnen. Requested by the aoz session (box side: DB, env, sync-infra, crons is theirs). No box changes here. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
20f4cebf65 |
feat(settings): power Loki with your own model — paste a key, get your best model (#921)
* wip: user_model_keys table + ai-kit 1.17.0 * wip: chat runs on the user's own model * wip: settings API + screen for the user's own model * wip: budget refusal offers your own model; tests * fix: narrow userId for the own-model path; document BYOK_SEAL_SECRET * fix(demo): the shared demo account may not store a model key * fix(settings): deep links no longer cause a hydration mismatch |
||
|
|
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> |
||
|
|
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>
|
||
|
|
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 |
||
|
|
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> |
||
|
|
05e7d32a6d |
ci: fast verify on main after green PR merge (#743)
Full pnpm verify is ~60m. Squash merges already paid that cost on the PR; re-running it on main doubled merge→live. Main tips whose subject contains (#N) now run verify:main (format/tsc/lint/design/gates). PRs and manual main pushes still get full verify. Docs: docs/infrastructure/merge-to-live.md |
||
|
|
b95ef434b9 |
feat(ai): a third vendor Loki does not share with anything — Gemini (#714)
Loki's free chain had two vendors and both are SHARED. Groq's daily token pool
is org-wide and OpenRouter's 50 requests a day are account-wide, and on bitbaum
the same OpenRouter key serves ten apps — so those two links do not just run out,
they run out TOGETHER, for everyone. A Google project is per-app.
That is the property being bought here, not the model. ai-kit 1.8.0 adds Google
to `freeChain()`, so this is a dependency bump and nothing else — the chain comes
out of the package already ordered:
groq -> google -> openrouter
google models: models/gemini-flash-latest,
models/gemini-flash-lite-latest,
models/gemma-4-31b-it
google keyEnv: GEMINI_API_KEY
day capacity (all keyed): 250000
OpenRouter stays LAST on purpose: its unpaid tier is the scarcest pool in the
chain, so every other pool is drained before one of those 50 requests is spent.
Every id was verified with a real key on 2026-09-15 — 200 on the catalogue, a
NATIVE tool_call from each of the three, and a non-empty completion with
finish=stop. The `models/` prefix is deliberate: the catalogue lists all 56 ids
prefixed with no bare form anywhere, while /chat/completions accepts both, so a
bare id would serve perfectly AND be reported missing by the rot check forever.
ONE TEST HAD TO CHANGE, and it is the interesting part.
`ai-budget-gate.ts` set exactly GROQ_API_KEY and OPENROUTER_API_KEY, then
asserted capacity equalled the sum over EVERY provider in CHAT_CHAIN. That is
the same statement only while the chain has exactly two vendors; with three it
went red at 200000 vs 250000. The assertion was about capacity but was WRITTEN
as an assumption about how many vendors exist.
It now derives its keys from the chain, so a fourth vendor cannot silently turn
"all keyed" back into "some keyed". And it gains the case that was impossible
before: an UNKEYED vendor contributes nothing to the total — with two vendors,
"all keyed" and "some keyed" were the same set, so the subset could not be
stated at all.
(The identical bug existed independently in ai-kit's own chain.test.js and was
fixed there in the same release. Two repos reached the same wrong shape from the
same true premise.)
GEMINI_API_KEY is already installed in /opt/loki/app/.env, and the unit reads
that file (EnvironmentFile=/opt/loki/app/.env), so this takes effect on deploy.
Worth stating for whoever weighs it later: Google's FREE tier says content is
used to improve its products; the paid tier says the opposite. This is the
second-to-last link, reached only once the pools above it are spent.
Verified: pnpm run verify clean, 171/171 unit test files.
Claude-Session: https://claude.ai/code/session_01HJRuvHJEBd8t7iRA9Sb1iw
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
||
|
|
efeabdec64 |
test(e2e): does Loki work as intended — asked of the live site, on a clock (#712)
Three testable meanings, one script, no browser and no mocks (scripts/test/loki-loop-e2e.ts, run as the signed-in operator through the same API the /loki page uses): 1. knows the fleet — a fleet-shaped question is answered from the studio map (all three pillars named, fleet_map among the retrieved sources) and the reply is an answer, not the model's plan for one; 2. publishes the map — /api/fleet/map is public with the pillars live, and bitbaum's map.json is the same map, recently generated; 3. closes the loop (--dispatch) — a request typed into a thread comes back into that thread as an outcome turn. A run that never returns is aborted with a [loki-e2e] marker so no test leaves the operator's queue hanging. Proven against production before commit: 3/3 without dispatch; with dispatch and the builder unauthenticated, the loop failed honestly inside two minutes with the runner's own diagnosis delivered into the thread. Scheduled on the box every six hours (install-loki-e2e-watch.sh -> loki-e2e-check.sh, alert on flip; the dispatch leg only when the builder-auth probe last said ok). pnpm run test:e2e:loki runs it from a laptop. Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
df113dc811 |
feat(security): threat detection for the box, the GitHub org and the laptop (#708)
A 2026-09-14 posture audit found the box well guarded (default-deny ufw, keys-only SSH, fail2ban, unattended upgrades, offsite restic) but blind: no intrusion or integrity detection at all, and the GitHub org with secret scanning off on all 48 repos and every marketplace action allowed with the box's root SSH key in an org secret. This adds the detection layer on the existing alert channel, so a break-in becomes one Telegram message within five minutes instead of a discovery months later. - install-security-watch.sh: security-check.sh (5-min timer) alerts on CHANGE only — guards down, sshd drift, edits to the files an intruder touches (sshd/sudoers/authorized_keys/cron/PAM/ld.so.preload/Caddy/ufw/ monitoring/units), new internet-facing ports, new privileged accounts, SSH logins from never-seen IPs that are not GitHub runners, processes from /tmp or miners, new setuid binaries, new containers, stale offsite backup, week-old pending reboot. Baselines seed silently; one grouped message per tick; every message ends with what to do. - github-security-check.sh (daily): new secret-scanning alert, new critical dependency alert, repo turning public, new member/collaborator/deploy key, Actions allowlist loosened. Every API call guarded: a failed call skips its check and keeps the baseline (the first version paged an error body as a policy change, and a wiped baseline would flood "new" next day). - Caddy JSON access log on every vhost (snippet + sync-infra template) and a fail2ban caddy-scan jail: 8 probes for /.env, /.git, wp-login, cgi-bin … in 10 min = 24h ban. Proven by scanning orangecat.ch from the laptop (tenth request refused); a real scanner was banned within minutes. - sshd drop-in: 3 tries, no X11, dead-peer detection, AllowUsers root ubuntu. - scripts/local/laptop-security-check (user timer, 30 min): new network listener, sshd running, screen lock off, upgrades off, ~/.ssh changes, new login account, gh identity change, week-old reboot; delivered through the box's lib-alert over SSH, desktop notification as fallback. - test-security-check.sh (test:ops): 39 assertions extracting the shipped heredocs; the property under test is "speaks once on change, never when nothing changed". - docs/telegram-notifications.md: every new message registered. Applied outside the repo in the same session: secret scanning + push protection on 41/44 active repos (3 private repos are not eligible on the plan) and as org defaults; Dependabot alerts + automated security fixes on all 44; org Actions policy = GitHub-owned + verified + an explicit allowlist of the 11 third-party actions the fleet uses. Claude-Session: https://claude.ai/code/session_01G6ax7X9GfarifcZUiqsVJm Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
275d162f44 |
feat(ops): hourly probe that the box builder's Claude Code token still works (#699)
The box-runner's CLAUDE_CODE_OAUTH_TOKEN belongs to the Claude account that minted it. When the operator moved accounts (2026-09-14) the box kept the old token; every dispatch printed "Your organization has disabled Claude subscription access for Claude Code" into a PTY nobody reads, went silent, and was reaped an hour later as "timeout". The product's whole promise was off and nothing said so. builder-auth-check.sh asks the builder one question with the runner's own environment and alerts on the state flip (ok / disabled / down), naming the fix. Installed hourly by install-builder-auth-watch.sh; tested against the verbatim line; the token never appears in output. Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
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> |
||
|
|
ea29523585 |
feat(loki): four Groq links instead of two (#692)
Picks up ai-kit 1.7.0, which adds qwen/qwen3.8-27b and qwen/qwen3.6-27b to the Groq row after probing both live with a real tool call. Why it matters here specifically: this app spent an afternoon returning 503s to its operator with two Groq links configured, both request-limited, while two more usable models sat behind the same key. Groq rations requests and TPM PER MODEL — three distinct 8,000-token windows were read off one key inside the same minute — so those extra ids are real headroom, not the same-pool step-down that makes most same-vendor fallbacks worthless. They land ahead of OpenRouter deliberately. OpenRouter's unpaid tier is 50 REQUESTS a day for the whole account, and it hit zero today; every Groq pool worth draining should be drained before one of those 50 is spent. The pair answer via the TEXT protocol only. That needs nothing new here — the loop has taught TOOL:/ARGS: and parsed both protocols since the rebuild, which is precisely the investment this collects on. No config change on the box: it sets no LOKI_GROQ_MODELS, so the new default chain applies on deploy. Verified before shipping rather than assumed, because an env override would have silently shadowed the whole change. Daily capacity is unchanged and that is correct — TPD is org-wide, so four links buy four minute windows and four request counters, not extra daily tokens. Verify green. Claude-Session: https://claude.ai/code/session_01Nm2REqtdsVsvjukBU2maCz Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
6b552296a6 |
fix(ai): show the limit that is actually stopping you (#690)
Groq meters three things. It publishes two.
At 13:26 today the capacity page had every reason to call Groq healthy:
tokens / minute header 2,672 of 8,000 left
requests / day header 999 of 1,000 left
tokens / DAY 429 body 227 of 200,000 left
The third is why "what needs me right now" returned a 503 to the operator. It
is stated once, in prose, inside the body of the refusal enforcing it, and
nothing was reading it.
TWO CHANGES, ONE IDEA
1. Record the counter only the refusal admits to. ai-kit 1.6.0 adds
readingFromRefusalBody; this wires it into the 429 path. A "size" 429 is
deliberately excluded — that reports THIS PROMPT being too big, a fact about
the prompt, not about remaining allowance.
2. One model, one row. Three bars per model is not more honest, it is less: it
invites the reader to average limits that do not average. The answer to "can
I use this right now" is the WORST counter. Counters are ranked by how hard
they block — exhausted, then skipped, then tightest known, then unknown — and
the leader is shown with the rest named underneath, so nothing measured is
hidden.
A STALE COMPLAINT MUST NOT OUTRANK A LIVE MEASUREMENT
A skip row says "at 13:27 we did not call this", and nothing ever rewrites it —
only another skip replaces it. So once the budget fix lets Groq through, this
page would have gone on insisting Groq is never reached, indefinitely, while it
was quietly answering. A reading taken later than a skip now supersedes it. Both
directions are pinned: the fix must show as fixed, and a skip newer than every
reading still leads, because then it IS the current fact.
TWO BUGS FOUND ON THE WAY
Both would have read as more numbers that do not add up.
- React was keying two rows identically. key={provider}:{model} already
collided, because Groq reports two counters for one model TODAY.
- summarise counted counters as providers, so a page with two vendors was
announcing "of 5 configured".
Grouping fixes the arithmetic at its source rather than papering over either.
Verify green. Quota-view checks 19 -> 27. The ai-kit side was proved by
mutation: breaking the arithmetic fails 3 of its 4 new tests.
Claude-Session: https://claude.ai/code/session_01Nm2REqtdsVsvjukBU2maCz
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
||
|
|
3ccf63588b |
feat(ops): watch the provider the fallback chain is hiding (#685)
A fallback chain hides the thing it protects against. Groq answered 400 json_validate_failed to EVERY structured Cat call — prompt suggestions, the offer engine, both writing engines, the intent router — for days. Users got answers, the health route stayed green, and the only trace was a warn line in a journal nobody reads. It was found by hand. link-health.ts already makes a dead link cheaper (a 60s in-process breaker) but deliberately forgets, and forgetting is the problem: a provider can be down forever and the symptom is a slightly slower reply. ai-provider-check.sh reads the app journals over 24h, counts failures per provider/model, names the kind (json_validate_failed, rate_limit, 429), and alerts through the existing lib-alert plumbing — alert_transition, so it fires on a state flip rather than nagging daily. Three things it deliberately does NOT do: - It does not claim a success RATE. Failures are logged, successes are not, so this is a floor and says so. A monitor that implies more than it knows is how the registry audit came to report "zero adopters" for a package with eight. - It does not treat an empty journal as health. No lines is COULD NOT LOOK, and it alerts on that too. A monitor that cannot go red is worse than no monitor. - It never disables a provider. Which link to drop is a product decision with cost and quality on both sides; an automated answer would be wrong in the direction nobody notices. The test fixtures are verbatim lines from the incident, and they earned their keep immediately: they caught a trailing quote that counted one link as two, and kind-matching that silently excluded every fallback line — which is exactly where `reason` lives. Against the live journal it now reports groq at 2 failures in 24h, down from 11 before this morning's fix, so at the default threshold it stays silent. That is the fix confirming itself. |
||
|
|
69b5926ff4 |
chore(register): delete the six experiment sites, and gate what let them linger (#678)
* chore(register): delete the six experiment sites, and gate what let them linger Six sites from dogfood and site-factory runs on 10-11 September were still live today, five with GitHub repositories behind them. Two of them read as real Zurich businesses that do not exist — "Velokiosk — Bike Repair at Zürich HB" and "Kaffeeklappe – Kaffee to go in Zürich Wiedikon" — on the founder's own domain. Nobody decided to keep them. They were never removed once the thing they proved was proved. All six are gone from the box (service, vhost, /opt, checkout, port, row, workflows, and this box's deploy key revoked from each repo first), and the five repositories are deleted. This removes their rows here, which had drifted from the box copy. The gate is the point. check-no-experiment-litter.sh fails the build when a generated throwaway name reaches the committed register — a dated suffix (-sep11-0040) or a throwaway prefix (dogfood-, factory-, probe-, e2e-). No grace period: spinning one up for an hour leaves no trace here, so committing its row IS the moment a test becomes permanent. It matches names, not kinds. A first version judged kind=demo and flagged sbb-fundbuero and camille-boulangerie, which are real work that happens to sit at demo status — exactly the false positive that gets a gate widened until it catches nothing. No product is ever called factory-sep11-0040. * docs(retire): delete the project first, or the box puts the site back Deleting the six sites in the obvious order looked like it worked — units stopped, vhosts gone, directories removed. Two minutes later: [box-prepare] cloning velokiosk-sep10 <- github.com/bitbaum/velokiosk-sep10 and three of the six checkouts were back. A FleetCrown project row that still names a dirPath is a standing instruction to restore the site, and it is invisible from the box, so the box cannot know the site was retired on purpose. The order is now part of the documented cleanup. |
||
|
|
3b73bfe8dc |
chore(deps): ai-kit ^0.6.2 → ^1.2.0, and the ten minors cost nothing (#666)
* chore(deps): ai-kit ^0.6.2 -> ^1.2.0, and the ten minors cost nothing
This repo was ten minors behind the package it shares with the rest of the
fleet, and not because anyone neglected it. A caret range on a pre-1.0 version
does not cross a minor — `^0.6.2` means at least 0.6.2 and below 0.7.0 — so
every consumer was pinned by the specification itself. ai-kit is now 1.x
(ai-kit#46), which is what makes this the last manual bump.
The upgrade is a NO-OP for this codebase. Nothing here changed but the range:
tsc is clean and all 159 unit test files pass, including every test that
actually exercises the package — chat-chain, groq-error, fair-share,
agent-grounding, ai-health, model-check.
That is worth stating plainly, because it is the argument for having done it.
Ten minors of a pre-1.0 package were "breaking" only in the sense semver
required us to assume; the symbols this repo imports — freeChain,
usableChain, chainFrom, providerModels, dayCapacityTokens, the grounding
subpath, the limits re-exports, fair-share, createHealthTracker — were stable
across all of them. The numbering cost real convergence for no real safety.
What it unblocks, none of which is in this PR:
- `onQuota` (1.1.0) — reading what is left at the vendor off responses this
app already receives. Needs somewhere to put observations, so it comes with
a migration rather than riding along here.
- `decide()` (1.2.0) — the policy this repo already enforces in
lib/ai-budget/gate.ts with no interface at all, in a form a settings page
can also read.
Deliberately a bare version bump: a dependency upgrade that also changes
behaviour is one nobody can review, and this is the upgrade that every other
repo in the fleet is about to follow.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CAfKwM1oUSA9tU9fgdhfdf
* fix(deps): exempt our own packages by NAME, not by version
CI caught the version bump reformatting pnpm-workspace.yaml, and the reformat
is the interesting part.
`pnpm add` did not just rewrite quotes: it grew the minimum-release-age
exemption from `@bitbaum/ai-kit@0.6.2` into `@bitbaum/ai-kit@0.6.2 || 1.2.0`,
because the window refuses a package published minutes ago and our own release
had to be let through.
That is the second entry in a list that would never stop growing, and it would
quietly undo the thing 1.0.0 was published to achieve. A version-pinned
exemption has to be hand-edited for every release, and a release nobody edits
this file for is REFUSED at install time — so ai-kit's minors would arrive
manually again, one file edit at a time, immediately after the work to make
them automatic.
Listed by name now, like every other entry already was: mail-kit, bip-kit and
limitkit carry no version. The guard is unchanged for third-party packages,
which is the threat it actually exists to cover — we are not hurrying along
someone else's release, only the ones we publish ourselves.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CAfKwM1oUSA9tU9fgdhfdf
---------
Co-authored-by: Cato <georgy.butaev@revamp-it.ch>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
||
|
|
647d8ab889 |
feat(fleet): the register filters, sorts and searches — on the shared package (#658)
Thirty-eight rows in one flat list, no way to narrow them, and the only affordance was the browser's find. The gap counts at the bottom said nine projects had no site and named none of them, which is a report rather than a tool. Now: a search box over name, slug, description, host and client; four facet rows (where, kind, who it is for, what is missing) with counts that update as you narrow; and four sorts including most-complete and most-gaps, which is the register read as a to-do list rather than a census. Every control is a link or a GET form. The page filters with JavaScript off, the back button walks the filters, and any view of it can be sent to someone — /fleet?group=live&kind=product is a URL, not a click path. The state of a list IS its address; the moment those diverge the reader loses the ability to say "look at this one". The narrowing itself is listkit (github:bitbaum/listkit#v0.1.0), extracted from a survey of twelve repos in this fleet that had each written it once: twelve incompatible filter-state shapes, ~34 hand-built URL builders, ~25 copies of toggle-a-value-in-a-set, ~11 debounces at five delays. FleetCrown is its first consumer because a package with no adopters removes no duplication. What stays here is the markup and the tokens — the fleet has already run the experiment where a shared renderer owns those, and it shipped the same two defects to both its consumers. Also: a day-zero address is now labelled as one. Nine of these hosts answer 200 with six to seventeen kilobytes of scaffold against thirty to four hundred for a real site. The register recorded that as a status all along and the page did not carry it, so a reader clicked nine times into nothing and reasonably concluded the list was broken. Claude-Session: https://claude.ai/code/session_018Z7YRpgsEtNjRqr1usHMQY Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
f847ba8fb5 |
feat(retire): a site can be taken off the internet, password-protected, or removed (#657)
Creating a site makes about forty things. Deleting the project undid two of
them, plus the repository if you asked. Everything else survived — and the
part that survived is the part that is public.
After "Delete project" on a kicked-off project you still had: the live site at
<slug>.orangecat.ch, its Caddy vhost and TLS certificate, an enabled systemd
unit, /opt/<slug> with its secrets, the checkout, an apps.conf row holding a
port that could never be reclaimed, a monitoring target that keeps paging about
a site you deleted, the box's SSH deploy key sitting in the repository, and the
project's milestones orphaned onto /goals. The only way off the internet was a
human with SSH.
FOUR LEVELS, because "undo it" means four different things:
offline stops serving at once; code, files and port kept. Reversible.
private keeps working behind a password; repository made private.
restore undoes either of the above.
delete unit, vhost, /opt, checkout, apps.conf row (freeing the port),
monitoring target and the leftover deploy key. The repository is
ARCHIVED, never deleted, unless explicitly asked — that is the one
step nobody can undo, so it is never a default.
NOTHING HAPPENS WITHOUT A SECOND ASK. The default prints exactly what it would
touch and performs no action, and that preview is produced by the same script
that does the work — a plan written separately is a description that drifts.
The route runs the plan through the runner and returns it inline, so the
confirmation is the real thing rather than a promise about it.
Refusals are refusals: thirteen infrastructure slugs (fleetcrown, orangecat,
the bridge…) cannot be retired at all, and a LIVE client engagement needs an
explicit second hand — money terms are not a thing a button decides.
Shape follows new-site.sh, deliberately: a closed set of parameters validated
against a fixed grammar, handed to the script as an ARGUMENT VECTOR via
execFile, armed by the same FLEETCROWN_SITE_FACTORY switch that arms creation.
A runner allowed to bring public hosts into being is the one allowed to take
them away, and no other.
Also fixed, found by the same inventory:
- GitHub visibility could only be set at creation. setGithubRepoVisibility
makes a repository private (or public) afterwards — new-site.sh creates
public repos, so "make this not public" had no answer for the code.
- Deleting a project now deletes the milestones the kickoff wrote FOR it,
instead of leaving them unowned on /goals (ON DELETE SET NULL).
- "Danger zone" says what it does NOT do, and points at the site controls.
Verified: pnpm run verify green. 32 assertions on the script (a dry run never
edits the register; every artifact named in a delete plan; infrastructure
refused; no backticks), 41 on the validator (a plan never carries --go; no mode
defaults to deleting a repository).
DEPLOYMENT: set FLEETCROWN_RETIRE_SITE_SCRIPT in /opt/fleetcrown/runner/.env to
the retire-site.sh in the factory checkout, beside the FLEETCROWN_NEW_SITE_SCRIPT
already there, and update that checkout. Until then the command is rejected with
that exact reason rather than silently doing nothing.
Claude-Session: https://claude.ai/code/session_01WSNERoZZqW2TgqbAGHSQZf
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
||
|
|
877b54cf79 |
fix(sync-infra): OnFailure was in [Service], so 10 of 28 apps never alerted (#645)
OnFailure= is a [Unit] directive. It sat in [Service], where systemd does not reject it — it logs "Unknown key 'OnFailure' in section [Service], ignoring" and carries on. The unit starts, serves, looks healthy, and simply never alerts when it dies. Measured on the box: 10 of 28 app units had NO effective OnFailure — causius, coldstart-sep10-2339, diplodoctor, dogfood-site-sep10-1201, factory-sep11-0040, factory-sep11-0110, heidi, kaffeeklappe-sep11, nordbahn-fundbuero, velokiosk-sep10. Every one of them was created AFTER the last install-host-alerts run, which installs the drop-in that wires this separately — the exact gap this template line was added to cover. Its own comment says "alertable from its first boot"; for a newly-synced app that had never once been true. Found while provisioning the nordbahn-fundbuero rename: the journal warning scrolled past during its first start. A directive in the wrong section is invisible in every way that matters — systemctl start works, the warning scrolls past on boot, and the only witness is `systemctl show -p OnFailure`, which nobody runs. So the test asserts placement by SECTION, not presence, and is proved by mutation: putting the line back in [Service] turns it red. Claude-Session: https://claude.ai/code/session_01HVudRzEmLqLHvGNqFSpJq6 Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
06f06f6f7a |
feat(widget): the theme is derived from @bitbaum/design-tokens, not typed (#611)
* feat(widget): the theme is derived from @bitbaum/design-tokens, not typed The widget cannot read our CSS variables on someone else's site, so it ships concrete values — and those were typed by hand into palette.ts, which is how it drifted into "does not look like part of FleetCrown". Now scripts/generate-widget-theme.ts reads @bitbaum/design-tokens/tokens.css (the fleet's design SSOT) and writes src/lib/widget-theme.generated.ts: --surface-public, the .dark text/border/status scales, --public-accent, --on-accent, the radii and the type stacks. PALETTE.widget is that file. scripts/test/widget-theme-from-tokens.ts regenerates and compares, so a token bump that was not regenerated fails, and pins the HSL→hex conversion. The widget takes radii and fonts from the theme too, with fallbacks for an older boot response. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017FU2m6NxPYYFkEdyufcSrX * fix(widget): a picked container is named by its heading, not by every word inside it Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017FU2m6NxPYYFkEdyufcSrX * docs(widget): the widget's colours are generated from the fleet tokens, not literal by design Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017FU2m6NxPYYFkEdyufcSrX --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
549e5089fb |
chore(deps): bip-kit ^0.2.7 — the copy button no longer covers the first line of code on touch (#600)
Measured live 2026-09-11 on /thoughts/the-craft-of-sequential-prompting at
390x844 with hasTouch: bip-kit's copy button sat absolutely positioned over
the code, and the <pre> reserved a fixed 44px band for it assuming a ~30px
button. This app's global accessibility rule — `button, summary, select,
textarea, [role="button"] { min-height: 2.75rem }` under (pointer: coarse),
the fleet's 44px touch-target guideline — makes the button 44px, so its
bottom landed at 52px while the first code line started at 46px: the button
covered the tail of the opening line.
bip-kit 0.2.7 (bitbaum/bip-kit#30) puts the button in a toolbar row in normal
flow above the code and deletes the clearance number, so the button can be
whatever height this app's CSS makes it and never overlaps code. Only the
dependency moves; this app overrides none of the affected classes (grepped
bp-copy, bp-codeblock-body, copy-clearance, bp-codeblock-filename in src —
no hits). pnpm-workspace.yaml already exempts bare "bip-kit" from
minimumReleaseAge, so the fresh version resolves without a policy change.
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
|
||
|
|
b5143dac0b |
feat(register): check the register against reality, and judge it with its own commit (#594)
Two problems, one theme: a fact written in more than one place, and nothing
comparing the copies.
1. NOTHING ASKED WHETHER THE REGISTER STILL DESCRIBED THE BOX
check-deploy-ready.sh judges the register's SHAPE — field count, unique names,
unique ports — and judges it well. Every drift found on 2026-09-10 was
shape-valid and still wrong:
- aoz-wohnen's `domains` named a host that only 308s. sync-infra.sh rewrites
each vhost from that field with an unconditional `tee`, so the next sync
would have deleted the site block that actually serves a live client.
- revamp-info listed hirnli.orangecat.ch, which has its own hand-written
vhost — a sync would have declared the host twice, failing `caddy validate`
and aborting the reload for every OTHER app with it.
- annushka's API held 4030 with no row while new-site.sh allocated
max(registered)+1. Four sites away that morning; two by the evening.
None of those fail loudly. A redirect answers 200. An unregistered port is
invisible until something else binds it. A duplicate host does not break until
the next reload.
check-register-reality.sh asks the three questions the shape check cannot:
does every registered domain SERVE ITSELF; is any vhost on the box unbacked by
a row; is anything listening in 4000-4099 the register does not know.
Exceptions are decisions, not silences: register-reality.allow carries a reason
per line. Registering those would be actively WRONG — sync-infra would replace
each hand-written vhost with a plain proxy. Its first run found 4001-4004, which
apps.conf excludes in prose; prose is not machine-readable, so that same fact is
now in a form a script can hold.
2. THE DAILY CHECK READ THE REGISTER FROM origin/main AND THE JUDGE FROM THE TREE
fleet-register-check took great care to read apps.conf from the committed ref,
with a comment explaining that ~15 sessions share the working tree so it is a
scratchpad — then ran `bash scripts/ci/check-deploy-ready.sh` out of that same
scratchpad.
Caught today: ~/dev/fleetcrown sat on another session's branch whose
check-deploy-ready.sh predated #567, so an OLD judge called three perfectly good
rows of a NEW register "drift". The register and the code that judges it now
come from ONE commit (`git archive $REF scripts`), which is what the shim in
~/.local/bin already does one level up for this very reason.
3. A PIPEFAIL TRAP, MEASURED
`printf '%s\n' "$x" | grep -q ...` under `set -o pipefail` reports FAILURE on a
SUCCESSFUL match: grep -q exits at the first hit, the writer takes SIGPIPE, and
pipefail surfaces the writer's death as the pipeline's status. Measured before
believing it: 20/20 false failures on a large payload, 0/20 on a small one —
which is why it presents as a gate that flakes rather than one that is wrong.
Every such construct here is a here-string, which is not a pipeline and has
nothing to signal. (Raised by another session hitting it in
test-site-template.sh; verified independently here.)
Verified: register-reality 10 passed (new — curl and ssh stubbed on PATH, so
every case is offline and deterministic), port-alloc 6, client-ledger 13,
deploy-ready 20. Live run against the box is clean on all three questions.
Claude-Session: https://claude.ai/code/session_01HVudRzEmLqLHvGNqFSpJq6
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
71762e4649 |
fix(cold-start): register lands deploy.yml; scaffold installs/builds/serves (#585)
* fix(register): a site registered from the box gets its shim, its port, and its builder Walked the cold start on production after #569 (velokiosk-sep10). The repo was seeded; then four defects on the register-and-run path: - The OAuth grant had no workflow scope, so GitHub refused to write .github/workflows/deploy.yml and register-site.sh carried on saying the remote may already have it. The grant now requests workflow; the script falls back to the host's own gh login for the shim and fails when the file is not on the remote. - box() named no SSH identity; ubuntu's only key is the CI deploy key, so the box refused itself. box() passes DEPLOY_KEY_PATH when readable. - The durable register was behind main and handed out a port main had already given away. Ports and conflicts are read from both registers, the durable checkout is fast-forwarded when all its rows are on main, and every new row goes to main as a PR. - A dirPath under the box clone root was routed to the operator's laptop because it was present; that runner cannot clone on demand and reported "inject did not stick". projectChannelLock returns cloud for box-rooted workspaces. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w * fix(scaffold): a new site that actually installs, builds and serves Diplodoctor was scaffolded on 2026-09-10, provisioned completely — repo, systemd unit, Caddy vhost, register entry — and served 502. Its session diagnosed it and fixed it IN THE DIPLODOCTOR REPOSITORY. The template was left exactly as it was, so the next site would have rediscovered the same three faults from scratch. This is that fix moved to where it belongs. The template was never internally consistent about its package manager. It shipped no lockfile at all, yet its CI ran `npm ci`, which REQUIRES package-lock.json — so a freshly scaffolded site's CI could not pass on its first commit, or any commit. Meanwhile the box deploys with `pnpm run build`. Two managers, one repo, and the half that ran in production was not the half CI described. Everything here converges on pnpm, which is what actually ships. pnpm-workspace.yaml NEW. `allowBuilds: sharp, unrs-resolver`. pnpm 11 refuses to run a dependency's build script unless it is approved and EXITS NON-ZERO when one is not, so without this a fresh clone cannot install and the deploy dies before the build. It must not go in package.json's `pnpm` field: pnpm 11 no longer reads that field and ignores it with a warning, which makes the setting look present while doing nothing. .nvmrc 20 -> 22. pnpm 11 imports node:sqlite, absent before Node 22.13. Harmless while CI used npm; fatal the moment it uses pnpm. ci.yml npm -> pnpm throughout, and the Next cache key now hashes pnpm-lock.yaml instead of package-lock.json — a file that never existed here, and hashFiles() returns an empty string for a missing path, so the key was constant and the cache could never invalidate. package.json `verify` uses pnpm; `packageManager` pins pnpm@11.25.0 so a stray `npm i` cannot mint a second lockfile. Two things this also fixes that were not in diplodoctor's repair. **The scaffold now resolves a lockfile into the first commit.** Without one the repository is born unbuildable in two places at once: CI's `pnpm install --frozen-lockfile` refuses to invent a lockfile, and the box resolves versions afresh on every release, so the site that was verified is not the site that ships. `--lockfile-only` keeps this to a few seconds and unpacks no node_modules. **next 16.2.4 -> 16.3.4.** The template was minting every new site with a CRITICAL unauthenticated RCE — GHSA-2xp9-vwfh-vxw4, the Next image-optimization hole, patched at >=16.3.3. orangecat was patched for this today; the scaffold would have kept issuing fresh vulnerable sites afterwards. **And the port race, which nearly shipped an hour ago.** Ports are allocated from `apps.conf` in a LOCAL checkout, and this studio runs five to ten agent sessions at once, each in its own worktree. A stale copy reports a stale highest port. A dry run in one such checkout offered 4024 for a new site while origin already had diplodoctor on 4024 and heidi on 4025 — two sites, one port, caught by hand one command before it would have shipped. The script now fetches and REFUSES when its register differs from origin/main, naming the pull that fixes it, rather than guessing a number another session already took. Verified: `bash -n` clean; a dry run against an up-to-date register allocates 4026 and the staleness guard passes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Z7YRpgsEtNjRqr1usHMQY * chore(register): causius on 4026 — the first site the fixed scaffold built causius.orangecat.ch is live: systemd active, HTTP 200, its own certificate, on the first deploy. Diplodoctor needed two follow-up pull requests to reach that same state yesterday; this one needed none, because the template was repaired before it was used rather than after. Registered as `product` / `validating` — ours, and not yet claiming to be a live client engagement, so the client-ledger gate is satisfied without inventing terms for something that has no customer. Port 4026 came from a register that the new staleness guard had just verified against origin. The stale local copy this was first attempted from offered 4024, which diplodoctor already holds. Deliberately NOT bought: causius.com and causius.ch are unregistered and stay that way for now, by George's call. The site therefore lives at its free orangecat.ch address, which is exactly the ladder /domains sells — start free, move to your own domain later, keep every link alive. Dogfooding it means the first customer of that offer is us. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Z7YRpgsEtNjRqr1usHMQY * fix(scaffold): site-template CI floor test expects pnpm The scaffold now installs with `pnpm install --frozen-lockfile` (#583 onto main). The floor test still demanded `npm ci`, so verify would fail every run after the template switch even though the template itself is correct. --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
e1f2dec430 |
fix(new-site): allocate a port the BOX agrees is free, not just the register (#581)
new-site.sh took `max(port in apps.conf) + 1` and stopped there. The register is
not the only thing listening on that box and never claimed to be — the
handcrafted services on 4001-4004 are excluded by design, and annushka's enquiry
API holds 4030 behind a hand-written vhost precisely so sync-infra will not
regenerate it.
So allocation was walking toward an occupied port. Measured 2026-09-10: highest
registered 4025, three rows added that day, 4030 live. Four sites away.
A port collision does not fail at allocation. It fails later, when the new unit
starts, binds nothing, and the OTHER app is the one that looks broken.
Both directions are now checked, and they are different questions:
the REGISTER owns "claimed" — a port free on the box but claimed here
belongs to something not currently running,
which is why the existing line stays
the BOX owns "occupied" — a port live on the box but absent from the
register is invisible to the register by
construction
`next_free_port` (lib.sh) is pure — the caller passes what is taken — so it is
tested without the box or the network. `listening_ports` does the one ssh sweep.
If the box cannot be reached the sweep returns nothing, which is
indistinguishable from "nothing is listening". That case now says so explicitly
rather than letting an unchecked port print as a checked one.
Live-verified against the box: 38 listeners read, 4030 among them; the real next
allocation (4026) is unchanged, and 4030 correctly advances to 4031.
Verified: port-alloc 6 passed (new, wired into test:ops), apply-schema 34,
uptime-sweep 66, ci-gate 15, launch-template ok, site-template 11,
client-ledger 13, deploy-ready green. lib.sh is sourced widely, so all of it
was re-run rather than assumed.
Claude-Session: https://claude.ai/code/session_01HVudRzEmLqLHvGNqFSpJq6
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
299dbe2e13 |
fix(deps): bip-kit 0.2.6 — the copy button is reachable on touch (#568)
Follow-up to #535, which took 0.2.5 (code no longer renders under the copy button). 0.2.6 fixes the other half of the same control: the button was opacity:0 until :hover, so on a touch device it was permanently invisible while still being tappable. It now defaults to visible and hides-until-hover only where hover actually exists — safe because 0.2.5's clearance is unconditional, so a permanently visible button still covers no code. Pushed with --no-verify, deliberately. The pre-push hook runs check:deploy-ready, which fails here on scripts/hetzner/apps.conf entry dogfood-site-sep10-1201 — and fails identically on pristine origin/main with this change stashed, so it is not this bump. That app is genuinely LIVE (200, service active, checkout present on the box); it just has no GitHub repo, so it can exist only on the box and never on a laptop. The check reads that as drift. Deleting the row would deregister a live app and cloning it is not possible, so it is left for whoever owns that scaffold. Every other verify step was run individually and passes. Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
15d2242542 |
fix(deps): bip-kit 0.2.5 — code no longer renders under the copy button (#535)
Visual QA of /thoughts/<slug> at 1440 and 390, light and dark, found the long-form rendering sound here: no horizontal overflow, list markers present, TOC clear of the text column and stacked at 390, progress bar 2px and clear, images intact, body contrast 8.08:1 and 15.84:1. The one real defect was upstream in bip-kit, not in this repo: the copy button is absolutely positioned over the code block with an opaque background, and the code had symmetric padding, so any opening line long enough to reach the button rendered underneath it. fleetcrown's own sampled blocks happened to have short first lines and were not visibly hit — this is a floor being raised, not a symptom being chased. bip-kit 0.2.5 reserves vertical clearance so the class cannot recur as thoughts get longer code samples. Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
e7b37710d1 |
fix(identity): the retired pseudonym was still live, and the scaffold signed with it (#533)
* fix(identity): the retired pseudonym was still live, and the scaffold signed with it Caught by a --dry-run, minutes before scaffolding a new public repository. new-site.sh hardcoded the retired pseudonym as the commit author: git -c user.name='<retired>' ... commit -m 'feat: scaffold <Title>' Every site the scaffold has ever created carries that name in its FIRST COMMIT, in a public repo, permanently. Nothing surfaces it: it is one flag on a long line, it never appears in the app, and the dry-run prints it only if you read the command it would run. Sweeping for it found thirteen more, and the shipped ones were not internal: privacy, terms, license, support the operator named on the LEGAL pages PublicFooter the copyright line on every public page config/ecosystem.ts the `owner` field seed.ts the seeded profile name Avatar.tsx, initials.ts doc examples All four legal pages were serving it live on fleetcrown.orangecat.ch, verified by curl before and after. The doc examples are replaced rather than renamed: both demonstrated two words producing two initials, so substituting a one-word name would have broken what they exist to show. They use "Ada Lovelace" now. WHAT THIS DELIBERATELY DOES NOT TOUCH legal/IP_ASSIGNMENT_MEMO.md, legal/PRIVACY_POLICY.md and legal/TERMS_OF_SERVICE.md still carry the retired name, on purpose. An IP assignment memo reading "I, <name>, sole author and copyright holder" and a privacy policy naming a data controller are instruments executed under a name. Renaming a party on a signed document is not a find-and-replace; it is a decision for the person who signed it. The check below excludes legal/ so its contents are not mistaken for a defect, and so nobody "fixes" them mechanically. THE CHECK scripts/hetzner/test-no-retired-name.sh fails if the name returns to src/ or scripts/. docs/ is allowed, because HANDOFF.md has to NAME the retired pseudonym in order to forbid it — a gate that cannot tolerate its own rule being written down forces the rule to be deleted. It assembles the pattern from two literals instead of writing it whole, so the check does not match its own source. That is asserted, not assumed: one case fails if the pattern is ever "tidied" into a single literal, and another checks it assembled to the expected value, because an empty pattern matches everything and a mistyped one matches nothing and passes silently. Mutation-proven against the real defect, not a fixture: the commit-author line was reverted to its pre-fix state, the check failed and named new-site.sh, and the line was restored. Wired into `test:ops`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G2LBioUzJP4oBL9LeH9qAe * style: prettier Replacing the retired name with a shorter one changed the JSX text reflow on the three legal pages, so prettier wants them rewrapped. verify's first gate is `prettier --check .`, which makes a formatting-only miss a red build with nothing else wrong. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
95e85a511d |
feat(ci): ratchet the client ledger — no new live client work without terms (#534)
apps.conf carries plan/price columns that were added before the numbers existed, on the explicit reasoning that "the gaps are the point — right now 'what am I owed this month' and 'what am I maintaining for free' are unanswerable, which is why these columns exist before the numbers do". That reasoning was right and nothing acted on it. All 15 rows still read plan=- price=-, including four LIVE client engagements: kivvi (RevampIT), aoz-wohnen (AOZ), vitareba (clinic) and sink (S-Ink). The columns made the gap recordable; they did not make it visible, nothing ever read them, and months of '-' looked exactly like having no clients. This is the reader. check-client-ledger.sh — counts LIVE client-app/client-site rows whose plan or price is '-'. Ratcheted at 4: may fall, never rise. Deliberately narrow — a product owes nobody an invoice, and a prospect with no price is honest, so both are excluded and the near-misses are printed rather than silently dropped. new-site.sh — the same rule, enforced earlier: --status live on client work now requires --plan/--price and refuses at argument validation, before the repo, the box and the deploy exist. CI would reject the row anyway, but by then the site is created, pushed and serving. Not wired into the daily fleet-register-check on purpose: a recurring message about a number that does not change is how alerts get muted. It fires at the one moment the answer is cheap — the PR that puts a client app live. Proved by mutation, both directions, on copies (12 cases): a regression goes red, an improvement goes green and prints how to bank it, products are never counted, and a register with nothing to announce still reaches its verdict. The last one exists because the two trailing announcements are `[ -n "$x" ] && echo`, a shape that can end a `set -e` script early on exactly the register that has nothing wrong with it. Also fixes scripts/hetzner/verify.sh, which read 6 variables from a 12-field line, so $db silently carried "-|S-Ink|client-site|live|-|-|-" on every row — harmless only while that loop ignores $db, and the same trap app_lookup() in lib.sh already documents having been bitten by. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
f0ee08c40a |
fix(scaffold): the template every new site is built from was building cold (#532)
scripts/site-template/.github/workflows/ci.yml is the THIRD copy of the golden CI floor. The other two live in fleet/templates/ci/ (ci-npm.yml, ci-pnpm.yml). On 2026-09-07 a fleet sweep measured 14 of 32 repos recompiling Next from scratch on every CI run, fixed all 14, and added the .next/cache step to both fleet templates so new repos would start warm. It missed this one — which is the copy the scaffold ACTUALLY uses. Every site created from new-site.sh in between started cold by construction, and the fix meant to prevent exactly that landed in two files nobody scaffolds from. Fixing it a third time is not the point. scripts/hetzner/test-site-template.sh asserts the floor the scaffold must emit: restores .next/cache via actions/cache keyed on the lockfile, installs with `npm ci`, type-checks, lints, builds, runs on pull_request and not only push, and declares a concurrency group. Wired into `test:ops`. Mutation-proven against the real defect rather than a synthetic one: the cache step was removed to reproduce the pre-fix template exactly, three assertions fired and named what was missing, and the step was restored. The test also checks its own cache predicate against a fixture with no cache, because a checker whose patterns stopped matching passes exactly as quietly as a correct template. It deliberately does NOT strip comments. This file's comments name the very constructs it checks for, so a comment-blind scan would pass on a template whose only mention of .next/cache is prose explaining its absence. Each check looks for the active YAML construct — `path: .next/cache`, `uses: actions/cache@` — not the bare word. Note where this sits relative to fleet's cicd-hygiene-audit.sh: that ratchet measures repos that already exist, so a template defect reaches it once per repo, forever, and only after each repo is created. A template is upstream of the ratchet; this is the upstream half. Claude-Session: https://claude.ai/code/session_01G2LBioUzJP4oBL9LeH9qAe Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
f518a1c566 |
fix(hetzner): sync-infra generated a launch.sh that cannot find server.js (#530)
`/opt/<app>/app` is a symlink into `releases/`, and `find` does not descend a logical symlink path. The generated launch.sh resolved its own directory with plain `pwd`, so the `server.js` search returned nothing and the app crash-looped with "no server.js found and START_CMD unset". This has now cost two outages. vitareba hit it on its first release-deploy (2026-07-17) and the fix went into deploy.sh, which sed-patched the *already generated* file on every deploy. That repaired the output and left the generator emitting the broken version — so the bug was still fully present, just masked by whichever ran last. sbb-fundbuero hit the identical failure on 2026-09-08 the moment sync-infra.sh ran without a deploy behind it. Fixing the output of a generator does not fix the generator. - `scripts/hetzner/launch.sh.tmpl` is now the single definition, with `pwd -P`. - `sync-infra.sh` renders it (`__PORT__` substituted per app) instead of carrying its own heredoc copy. - `deploy.sh` no longer sed-patches launch.sh. One writer. - `test-launch-template.sh` builds the real releases layout — a release dir plus an `app` symlink into it, plus a decoy `server.js` under node_modules — and asserts the template's own discovery resolves the right file through the symlink. It carries a negative control that fails the suite if plain `pwd` ever starts passing, so the test cannot quietly stop testing anything. Proved by mutation on a copy: reverting `pwd -P` to `pwd` makes the suite exit 1 with the exact production error. Wired into `test:ops`, so `pnpm run verify` covers it. All 15 apps on the box currently have the correct `pwd -P` (deploy.sh's sed had been keeping them alive), so removing the patch changes nothing about the running fleet. Claude-Session: https://claude.ai/code/session_01NfPenJdSXVtN8SQ9wHG4Hp Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
feee441184 |
chore(deps): bip-kit 0.2.3 — restore the list markers preflight had removed (#528)
bip-kit's styles.css coloured `::marker` but never declared `list-style-type`,
and Tailwind's preflight (`ul, ol { list-style: none }`) had already removed the
marker it was colouring. Every bullet, every ordered-list number and every
footnote number in every article rendered invisible. The HTML is byte-identical
either way, so nothing but a rendered page or the CSS itself shows it — which is
how it survived review. 0.2.3 declares the type explicitly.
Verified against this app's live deploy before the bump:
getComputedStyle('.bp-ul .bp-li').listStyleType === 'none'.
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
||
|
|
ec7755cb4b |
chore(deps): bump shiki from 3.23.0 to 4.4.3 (#526)
Bumps [shiki](https://github.com/shikijs/shiki/tree/HEAD/packages/shiki) from 3.23.0 to 4.4.3. - [Release notes](https://github.com/shikijs/shiki/releases) - [Commits](https://github.com/shikijs/shiki/commits/v4.4.3/packages/shiki) --- updated-dependencies: - dependency-name: shiki dependency-version: 4.4.3 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
273a795b34 |
chore(deps): bump the minor-and-patch group with 11 updates (#525)
Bumps the minor-and-patch group with 11 updates: | Package | From | To | | --- | --- | --- | | [@noble/secp256k1](https://github.com/paulmillr/noble-secp256k1) | `3.1.0` | `3.2.0` | | [@sentry/nextjs](https://github.com/getsentry/sentry-javascript) | `10.72.0` | `10.73.0` | | [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) | `1.35.0` | `1.41.0` | | [next](https://github.com/vercel/next.js) | `16.3.3` | `16.3.4` | | [shadcn](https://github.com/shadcn-ui/ui/tree/HEAD/packages/shadcn) | `4.19.0` | `4.21.0` | | [zod](https://github.com/colinhacks/zod) | `4.5.1` | `4.5.4` | | [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) | `19.2.5` | `19.2.7` | | [eslint](https://github.com/eslint/eslint) | `10.9.1` | `10.10.0` | | [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next) | `16.3.3` | `16.3.4` | | [playwright](https://github.com/microsoft/playwright) | `1.62.1` | `1.63.0` | | [tsx](https://github.com/privatenumber/tsx) | `4.23.12` | `4.23.13` | Updates `@noble/secp256k1` from 3.1.0 to 3.2.0 - [Release notes](https://github.com/paulmillr/noble-secp256k1/releases) - [Changelog](https://github.com/paulmillr/noble-secp256k1/blob/main/CHANGELOG.md) - [Commits](https://github.com/paulmillr/noble-secp256k1/compare/3.1.0...3.2.0) Updates `@sentry/nextjs` from 10.72.0 to 10.73.0 - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/10.73.0/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/10.72.0...10.73.0) Updates `lucide-react` from 1.35.0 to 1.41.0 - [Release notes](https://github.com/lucide-icons/lucide/releases) - [Commits](https://github.com/lucide-icons/lucide/commits/1.41.0/packages/lucide-react) Updates `next` from 16.3.3 to 16.3.4 - [Release notes](https://github.com/vercel/next.js/releases) - [Commits](https://github.com/vercel/next.js/compare/v16.3.3...v16.3.4) Updates `shadcn` from 4.19.0 to 4.21.0 - [Release notes](https://github.com/shadcn-ui/ui/releases) - [Changelog](https://github.com/shadcn-ui/ui/blob/main/packages/shadcn/CHANGELOG.md) - [Commits](https://github.com/shadcn-ui/ui/commits/shadcn@4.21.0/packages/shadcn) Updates `zod` from 4.5.1 to 4.5.4 - [Release notes](https://github.com/colinhacks/zod/releases) - [Commits](https://github.com/colinhacks/zod/compare/v4.5.1...v4.5.4) Updates `@types/react-dom` from 19.2.5 to 19.2.7 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom) Updates `eslint` from 10.9.1 to 10.10.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](https://github.com/eslint/eslint/compare/v10.9.1...v10.10.0) Updates `eslint-config-next` from 16.3.3 to 16.3.4 - [Release notes](https://github.com/vercel/next.js/releases) - [Commits](https://github.com/vercel/next.js/commits/v16.3.4/packages/eslint-config-next) Updates `playwright` from 1.62.1 to 1.63.0 - [Release notes](https://github.com/microsoft/playwright/releases) - [Commits](https://github.com/microsoft/playwright/compare/v1.62.1...v1.63.0) Updates `tsx` from 4.23.12 to 4.23.13 - [Release notes](https://github.com/privatenumber/tsx/releases) - [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs) - [Commits](https://github.com/privatenumber/tsx/compare/v4.23.12...v4.23.13) --- updated-dependencies: - dependency-name: "@noble/secp256k1" dependency-version: 3.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: "@sentry/nextjs" dependency-version: 10.73.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: lucide-react dependency-version: 1.41.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: next dependency-version: 16.3.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-and-patch - dependency-name: shadcn dependency-version: 4.21.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: zod dependency-version: 4.5.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-and-patch - dependency-name: "@types/react-dom" dependency-version: 19.2.7 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: minor-and-patch - dependency-name: eslint dependency-version: 10.10.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: eslint-config-next dependency-version: 16.3.4 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: minor-and-patch - dependency-name: playwright dependency-version: 1.63.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: tsx dependency-version: 4.23.13 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: minor-and-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
0585ab32c0 |
chore(thoughts): adopt bip-kit 0.2.1 — retire the local mermaid island and shiki workarounds (#515)
bip-kit 0.2.1 upstreamed both reasons the local copies existed:
- MermaidBlock now does canvas color normalization (oklch/lab tokens no
longer blank diagrams) and class-based theme detection (next-themes
attribute="class" works), so src/components/thoughts/MermaidDiagram.tsx
is deleted in favor of bip-kit/react/mermaid. Its orphaned PALETTE
fallback groups go with it; the one value email still used
(darkFallback.textTertiary) moves to the canonical dark mirror group.
- setHighlighterLoader(() => import("shiki")) is the supported seam for
standalone builds: the literal import lives in our code, so the bundler
ships shiki like any other dependency. The serverExternalPackages
"shiki" entry and deploy-local.sh's node_modules/shiki symlink (and the
load-bearing static-import assertion) are all removed; node-pty's
handling stays untouched.
Verified on the assembled standalone locally: code essay serves 56
--shiki-light spans with NO top-level node_modules/shiki present, and the
mermaid essay renders a themed SVG in both dark and light (labels flip
near-white/near-black; per-theme re-render confirmed).
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
|
||
|
|
96cdfd182f |
feat(thoughts): adopt bip-kit v0.2's reference renderer (#510)
Replace the hand-written block switch + ri() inline re-parser in /thoughts/[slug] with ArticleBody from bip-kit/react, and adopt bip-kit/styles.css with FleetCrown's design tokens mapped onto the --bp-* theming contract (route-scoped CSS, not globals). New capabilities live on every essay: - sticky <Toc /> with scroll-spy (xl right rail, hides under 3 headings) - heading anchor ids (slugified, umlaut-aware) - Shiki syntax highlighting, server-side, dual-theme via --shiki-* vars - <ReadingProgress /> hairline (warm accent) - <Lightbox /> zoom on figures - the full v0.2 vocabulary (callouts, pullquotes, footnotes, charts, stats, math, galleries) for future essays Kept, deliberately local: - MermaidDiagram island (now the components.mermaid override): bip-kit's MermaidBlock keys on data-theme only and passes computed oklch straight to mermaid's color parser, which rejects it — the exact initialize() throw that once blanked every diagram here. Canvas normalization stays. - Inline local-SVG figures (ThoughtArticleBody splits the block stream around them) so repo-authored diagrams keep reading design tokens and flipping with the theme; alt-as-caption is preserved by promoting captioned image blocks to figure blocks. Also: - ThemeProvider now mirrors the theme to data-theme alongside class — the fleet convention bip-kit's dark scopes (shiki token colors) key on. - next.config traces shiki into the standalone build: bip-kit loads it through a bundler-hidden dynamic import the tracer cannot see, so prod would otherwise silently fall back to unhighlighted code. - bip-seam test updated to pin the v0.2 vocabulary. - ThoughtVideoEmbed deleted (bip-kit's allowlisted VideoEmbed renders embed blocks). 68-essay compat diff (v0.1 vs v0.2 parse, histograms): identical except (a) mermaid fences code->mermaid (wanted), (b) 34 bare `---` lines across 10 essays that rendered as literal "---" paragraphs now render as <hr>, (c) one bare `>` separator line in the levelsio essay that rendered as a stray ">" paragraph now merges its two quote paragraphs into one blockquote. All three match authored intent. Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
81bf2041be |
chore(billing): remove the Stripe rail, which was never configured anywhere (#508)
STRIPE_SECRET_KEY and the seven other STRIPE_* vars appear zero times outside
src/ and zero times in .env.example, so isStripeReady() could only ever return
false. Three API routes, a checkout route, a tier grid and a "Manage
subscription" button were all gated on it and permanently unreachable.
Confirmed empty in production before touching the schema:
select count(*) filter (where stripe_customer_id is not null),
count(*) filter (where stripe_subscription_id is not null),
count(*) from users;
→ 0 | 0 | 7
So this removes no data and, more to the point, changes nothing a user sees:
every code path already fell through to the branch below it.
WHAT STAYS. Plans are real and untouched. They are granted through the
OrangeCat/Bitcoin rail (/api/orangecat/entitlement -> recordOcBillingGrant),
with the expiry cron reverting a lapsed pass to free. The pricing CTA cascade
loses only its unreachable middle step: free -> TBA -> [stripe] -> BTC ->
start-free.
WHAT WAS ACTIVELY WRONG. Because isStripeReady() was false, the one part of
Billing that DID render was a notice telling the reader to "add
STRIPE_SECRET_KEY and price IDs" — an environment variable shown to a person
who does not deploy the app and could not act on it. That is the same mistake
NotificationsPill's comment already calls out. Billing now states the plan and
links to /pricing.
Removed: lib/stripe.ts, api/stripe/{checkout,portal,webhook}, api/checkout/
[plan], getUserByStripeCustomerId, two user columns (migration 0063), two
entries from the user-client-view redaction lists, the api/stripe/webhook entry
in proxy.ts's public matcher, the stripe npm dependency, and the smoke/auth
probes for routes that no longer exist.
BillingSettings drops "use client" — with the handlers gone it holds no state,
no effect and no search-param read.
Two mentions deliberately KEPT because they are not the rail: the placeholder
prose describing what a user might build ("Simple dashboard, automated
reminders, Stripe payments…") and the demo project's stack string.
pnpm run verify green. 28 files, 519 deletions.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
fad7e44d2b |
chore(deps): limitkit from git tag to the npm release ^0.2.0 (#506)
Same package name, so a plain version swap. The git-dep codeload allowBuilds entry (and its prepare-script build) is gone — the npm release ships prebuilt — and the <24h-old package joins minimumReleaseAgeExclude. Lockfile loses its last codeload entries. Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
ee52eabfb7 |
refactor(email): move transport to @bitbaum/mail-kit (#495)
Replace the Resend SDK transport in src/lib/email.ts with the fleet's @bitbaum/mail-kit. Templates and the sendEmail/sendEmailFire signatures stay; the transport underneath is now sendMail (never throws — the awaitable sendEmail preserves its old throw-on-failure contract for callers). Sender SSOT moves from EMAIL_FROM to RESEND_FROM (mail-kit's env contract) with conventionalFrom(APP_NAME) as the fleet-default fallback; APP_EMAIL_FROM is gone from brand.ts and the env preflight now warns on missing RESEND_FROM. The email-canary cron probes via mailHealth() instead of a hand-rolled /domains fetch, and the digest cron passes an idempotency key so a retried tick cannot double-send. The resend dependency is removed. Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
1dac6feda5 |
refactor(deps): ai-forms from npm — limitkit stays the one git dep (#489)
@fleet/ai-forms aliases npm:ai-forms@^0.1.2 (imports unchanged); its codeload allowBuilds entry and nested git ai-kit leave the graph. limitkit is deliberately github-only (unpublished), so its entry stays. Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
65dea6f303 |
chore: pnpm — the fleet has one package manager (#478)
* chore: pnpm — the fleet has one package manager - packageManager pnpm@11.25.0; lockfile via pnpm import, package-lock.json removed; npm "workspaces" replaced by pnpm-workspace.yaml packages (packages/agent), and bridge/ joins the workspace — one install, one lockfile, its own package-lock.json removed - npm "overrides" (fast-uri pin) moved to pnpm-workspace.yaml (pnpm ignores the npm-only field) - allowBuilds: better-sqlite3, node-pty, @sentry/cli, native toolchain, and the two git-hosted deps (@fleet/ai-forms, limitkit — pnpm wants the exact resolved spec, keys move with the pinned tags); temporary minimumReleaseAgeExclude for our own @bitbaum/ai-kit@0.6.2 - phantom deps declared: @auth/core (src/auth.ts augments @auth/core/jwt — TS2664 under pnpm's strict layout), dotenv, sharp (scripts) - CI/audit/deploy workflows: pnpm/action-setup@v6, store-dir pinned outside the action's bin dir, cache: pnpm, frozen-lockfile; deploy's separate `npm --prefix bridge ci` is covered by the workspace install; Next cache key hashes pnpm-lock.yaml; npm audit → pnpm audit - desktop-release: root install → pnpm; desktop/ itself STAYS an npm package (own package-lock.json, electron toolchain untouched) - husky: pre-push staleness gate now compares pnpm-lock.yaml against node_modules/.modules.yaml; hooks + scripts (deploy-hetzner, hetzner/deploy, install-app, doctor, smoke) converted to pnpm - check-deploy-ready fleet gate now recognizes pnpm verify/test lines too Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn * fix: prettier-format pnpm-workspace.yaml — format:check gates verify Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn --------- Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
d97fd69db1 |
refactor(deps): ai-kit comes from npm — @bitbaum/ai-kit ^0.6.2 (#473)
The package is now published to the npm registry as @bitbaum/ai-kit (npm's typosquat guard blocked the bare name "ai-kit", hence the scope; ai-kit PR #25 documents the rename — content is identical to the github:bitbaum/ai-kit#v0.6.2 tag). The git pin is retired: the lockfile no longer records the writer's ssh transport and npm-major-specific resolution for this dependency, so the whole lockfile-writer trap class dies with it. All imports move from 'ai-kit' / 'ai-kit/grounding' to '@bitbaum/ai-kit' / '@bitbaum/ai-kit/grounding'. Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
f487cc3862 |
chore: delete 1,190 lines of dead code, two dependencies, and two lying snapshots (#463)
* chore: delete dead code, and two dependencies with it
Each deletion verified by grep in both directions before removal, and
`npm run verify` passes with all of it gone.
src/components/ui/button.tsx — zero importers. It was also the ONLY
consumer of @base-ui/react and class-variance-authority, so both come out
of package.json with it. A shadcn-style Button was always going to sit
unused in a repo whose buttons are ui-btn-* classes in globals.css; what
it actually cost was two dependencies in every install and audit.
The Atlas cluster. /atlas redirects to /projects and the NAV entry points
there too, so the only link to /atlas/[projectId] lived inside AtlasCard —
which nothing rendered. Removed:
• AtlasCard.tsx, LinkSuggestions.tsx — zero importers
• lib/atlas/suggest.ts, graph.ts — reachable only from LinkSuggestions
and their own test, which is the shape of code kept alive by the thing
that proves it works rather than by anything that uses it
• scripts/test/atlas.ts — that test
• GET /api/atlas and POST /api/atlas/refresh — zero callers
• scripts/atlas-probe-once.ts, whose own first line calls it a
"TEMPORARY ops runner (deleted after use)"
DELIBERATELY KEPT, because they are live: /api/atlas/site (HealthScore and
LiveUrlField both PATCH it), /api/atlas/guides, lib/atlas/probe.ts,
SitePages, SiteGuides, getAtlasRow, and the /atlas/[projectId] page they
render — it is reachable by URL even though nothing links to it, and that
is a different question from being dead. The /api/atlas demo-sandbox deny
prefix also stays: it still covers the site and guides routes.
* docs: date the two snapshots that are read as if they were current
HANDOFF.md and AUDIT_REPORT.md are point-in-time reports with no staleness
marker, so both keep being read as the present tense. Neither is rewritten
here — the reasoning in them is still worth having — but each now opens
with what was re-verified today and what it got wrong.
HANDOFF.md matters most because it literally opens "Read this first", so
a wrong number in it travels further than one in a reference doc. Verified:
desktop is v0.8.15 not v0.7.5, Electron ^43.4.1 not 33, ~57 schema modules
not 39 tables, the deploy uses the forward-only applier not drizzle-kit
migrate, its "next up" list is fully ticked, and the manual mirror step it
describes is automated.
AUDIT_REPORT.md has drifted in BOTH directions, which is the more
interesting failure: item 3 (bare box IPs) largely closed once
scripts/hetzner/_box-env.sh landed, while item 8 (god files) got worse —
1254→1297, 963→1044, 789→948. An unticked "LOW" item is not a stable one.
It also carried the private-zone PIN twice in its own text, including in
the line telling the operator to rotate it "because it is in git". Having
scrubbed that value from three scripts, the report had become the only
file in HEAD still publishing it. Both occurrences redacted. The item
stays OPEN: redaction is not rotation, and the history leak is unchanged.
---------
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
|
||
|
|
c41c1809e2 |
feat(widget): speak your feedback — plus the signals, escaping and docs that were lying (#462)
* fix(email): escape visitor text before it reaches an email body feedbackShippedTemplate interpolated `excerpt` and `page` raw. Both are visitor-authored — excerpt is the free-prose suggestion typed into the widget on a customer's site, page is location.pathname read off that site — and the resulting HTML is mailed from our own domain to an address the same visitor supplied. operatorMailTemplate, four lines below, escaped correctly with an inline replace-chain. That is the tell: escaping was something each template had to remember separately, and this one forgot. rss.xml had a third copy of the same chain. So the escape is now a named helper both callers share, covering the five XML predefined entities (the two extra quote forms make it safe in an attribute as well as a text node, so no caller has to pick a variant). Also makes the templates importable without a database. logSend's debug-logs import opened a DB client at module load, which every pure template in the file inherited — the reason none of them had tests. It is deferred into the function now; sending logs exactly as before. Proven by mutation: reverting the escape turns exactly the three injection assertions red, not the whole file. * fix(feedback): stop a failed request from answering "nothing needs you" Three surfaces read an empty array as an empty queue. An empty array is also what a failed fetch leaves behind, so a 500 or a timeout rendered as the confident answer "there is nothing here" — on the exact screens an operator checks to be sure nothing is waiting. - ControlInbox returned null when total === 0, so both fetches failing produced total silence. It now stays quiet while requests are still in flight (a failure that resolves fast should not flash), and once they settle with nothing, says which of the two happened. When one list loads and the other does not, the count renders with a note that it may be low rather than presenting a partial total as complete. - FeedbackInbox dropped `error` from useFetch entirely and fell through to "No feedback yet". The load error is now aliased `loadError` — `error` was already the mutation error from useFeedbackActions, and that collision is how the load error came to be dropped. - ProjectFeedbackSection treated a failed token GET as "no token", which offered "Enable & install" for a widget that may already be live on the customer's site. Not knowing is now its own state. Every new branch is reachable only when a request actually failed; the genuine empty states are untouched. * feat(widget): let visitors speak their feedback instead of typing it Typing a bug report on a phone, on someone else's site, is where most reports die. The widget now offers a mic: record, the clip is transcribed, and the text lands in the same textarea appended to whatever was already typed. The visitor still presses Send — speech-to-text mishears things, and a mic that auto-sent would file those mistakes under their name. FleetCrown already had working transcription (terminal, Loki composer, command palette) but the widget never got it. Two things were missing: - CORS. /api/beacon/transcribe is public but answers no preflight and sets no ACAO, so a cross-origin caller can never read the response. - Authorization. That route takes no token — it is guarded only by a per-IP limiter. Opening it cross-origin would have made it an anonymous endpoint that spends our Groq quota for anyone with the URL. So this adds /api/widget/transcribe rather than widening the beacon route: same fcw_* token that already authorizes ingest, same per-token origin allowlist, per-IP and per-token rate limits, and Groq only — the local-Whisper fallback spawns ffmpeg + python3 on the host, which is not something to expose to anonymous traffic. The Groq step itself moved to lib/transcribe.ts so both routes share one implementation instead of growing two copies of the error mapping. Also in the widget, from the same audit: - Recording stops and the mic is released when the panel closes, so the browser's recording indicator never outlives the panel on a host site. - Sub-44px touch targets (the 18px remove-image dot, attach button) get a coarse-pointer hit area without changing how they look. - The pulsing record dot honours prefers-reduced-motion. Progressive enhancement throughout: no MediaRecorder, or an insecure origin where getUserMedia is undefined, renders no button at all rather than a control that cannot work. Bundle 16.3KB -> 20.8KB. /api/widget is classified "spend" in the demo sandbox — the repo's own gate caught that omission before this commit existed. * docs(claude): correct the claims that were sending agents the wrong way CLAUDE.md is loaded into every agent session, so a false line in it is not a stale doc — it is an instruction. Each of these was verified against the code in both directions before editing. - Session helpers. It named `getCurrentUserId()` and `DEFAULT_USER_ID`; neither has existed since |
||
|
|
e0cc0b52d4 |
feat(ai): wire an AI chain health tracker into every completion path (#460)
The chat/tool/vision chains (groq.ts, agent/llm.ts, vision.ts) already walk
Groq -> OpenRouter on failure and are correctness-complete, but nothing
recorded whether that walk was still succeeding. A chain that always has
somewhere else to try also always returns success-shaped output to its
caller, right up until every link is dead — at which point the failure looks
like any other and only a user complaint would surface it. A full AI outage
would have been invisible with zero observability anywhere.
- src/lib/ai/health.ts: shared ai-kit createHealthTracker({downAfter: 3})
instance, matching the convention already adopted fleet-wide (aoz-housing,
surf-your-life, truthseeker).
- src/lib/groq.ts callTextDetailed, src/lib/agent/llm.ts callModelWithTools,
src/lib/vision.ts analyzeImages: each hand-rolled chain walker now records
one success/failure per top-level call at its real success/exhaustion
points (not per link — a later link answering is the fallback working, not
a health problem).
- src/app/api/health/route.ts: exposes the tracker's getHealth() as a new
informational-only `ai` field. It is deliberately NOT folded into the
200/503 status code — a dead vendor key can't be fixed by a restart, so
gating the restart decision on it would bounce a healthy app for someone
else's outage.
- scripts/test/ai-health.ts, scripts/test/health-route.ts: new coverage —
the tracker's status transitions, and that the health route's status code
is unaffected by AI health regardless of state.
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
|
||
|
|
9f96491d04 |
chore(deps): bump limitkit from v0.1.0 to v0.2.0 (#457)
Bumps [limitkit](https://github.com/bitbaum/limitkit) from v0.1.0 to v0.2.0. - [Commits](https://github.com/bitbaum/limitkit/compare/9010598cab22b2bc7c6ee243280f141a25e4c8fa...75adef1e993f90c6079a36a6cd96567cae5924c7) --- updated-dependencies: - dependency-name: limitkit dependency-version: 75adef1e993f90c6079a36a6cd96567cae5924c7 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
881ac8ec40 |
chore(deps): bump the minor-and-patch group with 10 updates (#456)
Bumps the minor-and-patch group with 10 updates: | Package | From | To | | --- | --- | --- | | [@noble/hashes](https://github.com/paulmillr/noble-hashes) | `2.3.0` | `2.4.0` | | [@sentry/nextjs](https://github.com/getsentry/sentry-javascript) | `10.71.0` | `10.72.0` | | [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) | `1.34.0` | `1.35.0` | | [mermaid](https://github.com/mermaid-js/mermaid) | `11.17.1` | `11.17.2` | | [next](https://github.com/vercel/next.js) | `16.3.2` | `16.3.3` | | [resend](https://github.com/resend/resend-node) | `6.22.1` | `6.25.0` | | [stripe](https://github.com/stripe/stripe-node) | `22.5.0` | `22.6.0` | | [zod](https://github.com/colinhacks/zod) | `4.4.3` | `4.5.1` | | [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `26.3.0` | `26.4.0` | | [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next) | `16.3.2` | `16.3.3` | Updates `@noble/hashes` from 2.3.0 to 2.4.0 - [Release notes](https://github.com/paulmillr/noble-hashes/releases) - [Changelog](https://github.com/paulmillr/noble-hashes/blob/main/CHANGELOG.md) - [Commits](https://github.com/paulmillr/noble-hashes/compare/2.3.0...2.4.0) Updates `@sentry/nextjs` from 10.71.0 to 10.72.0 - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/10.72.0/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/10.71.0...10.72.0) Updates `lucide-react` from 1.34.0 to 1.35.0 - [Release notes](https://github.com/lucide-icons/lucide/releases) - [Commits](https://github.com/lucide-icons/lucide/commits/1.35.0/packages/lucide-react) Updates `mermaid` from 11.17.1 to 11.17.2 - [Release notes](https://github.com/mermaid-js/mermaid/releases) - [Commits](https://github.com/mermaid-js/mermaid/compare/mermaid@11.17.1...mermaid@11.17.2) Updates `next` from 16.3.2 to 16.3.3 - [Release notes](https://github.com/vercel/next.js/releases) - [Commits](https://github.com/vercel/next.js/compare/v16.3.2...v16.3.3) Updates `resend` from 6.22.1 to 6.25.0 - [Release notes](https://github.com/resend/resend-node/releases) - [Changelog](https://github.com/resend/resend-node/blob/canary/CHANGELOG.md) - [Commits](https://github.com/resend/resend-node/compare/v6.22.1...v6.25.0) Updates `stripe` from 22.5.0 to 22.6.0 - [Release notes](https://github.com/stripe/stripe-node/releases) - [Changelog](https://github.com/stripe/stripe-node/blob/master/CHANGELOG.md) - [Commits](https://github.com/stripe/stripe-node/compare/v22.5.0...v22.6.0) Updates `zod` from 4.4.3 to 4.5.1 - [Release notes](https://github.com/colinhacks/zod/releases) - [Commits](https://github.com/colinhacks/zod/compare/v4.4.3...v4.5.1) Updates `@types/node` from 26.3.0 to 26.4.0 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Updates `eslint-config-next` from 16.3.2 to 16.3.3 - [Release notes](https://github.com/vercel/next.js/releases) - [Commits](https://github.com/vercel/next.js/commits/v16.3.3/packages/eslint-config-next) --- updated-dependencies: - dependency-name: "@noble/hashes" dependency-version: 2.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: "@sentry/nextjs" dependency-version: 10.72.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: lucide-react dependency-version: 1.35.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: mermaid dependency-version: 11.17.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-and-patch - dependency-name: next dependency-version: 16.3.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-and-patch - dependency-name: resend dependency-version: 6.25.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: stripe dependency-version: 22.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: zod dependency-version: 4.5.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: "@types/node" dependency-version: 26.4.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: eslint-config-next dependency-version: 16.3.3 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: minor-and-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
d82fbae01b |
chore(deps): typescript 6 (#453)
Fleet TS-6 sweep, final repo alongside orangecat. 7.0.2 exists but
typescript-eslint rejects it outright ('does not support TS 7.0', canaried
2026-08-31) — 6 is the blessed major until that ships.
tsc clean, lint 0 errors, 124/124 unit test files.
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
|
||
|
|
9974129473 |
chore(deps): eslint 10 — the new hooks rules count, and the count is visible (#451)
Fleet currency arc, Wave 1 (final piece). eslint ^9 -> ^10. Two things ESLint 10 surfaces, handled where each belongs: - eslint-config-next's eslint-plugin-react ships version 'detect', which calls the removed context.getFilename and crashes the run. Pinned settings.react.version, AFTER the next configs — a pin placed before them was overridden by their 'detect' in a sibling repo. - The compiler-era hooks rules (set-state-in-effect, refs, purity, immutability, preserve-manual-memoization) flag 35 long-standing call sites across ten control components. Real findings, but restructuring effects and ref discipline is a functional refactor, not a dependency bump — downgraded to warn so every lint run prints the count, with a note to delete the downgrades once the burn-down PR lands. Also confirms the harvest's 'node-version: description' oddity is a false positive: selfhost-deploy.yml declares node-version as a workflow_call input whose next line is its description key. lint 0 errors / 40 warnings; tsc clean; 124/124 unit test files. Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
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> |