Removes the fleet auto-merge sweep caller (and wake chain where present);
checks run on pull requests only, not again after merging; a deploy that
waited for CI on main now deploys on push. The forge merge check
(forge/verify) verifies each PR on its merge result and merges it.
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(auth): every way in, on @bitbaum/accountkit, keeping every account
Sign-in offered email and password and Continue with OrangeCat, on
next-auth. It now runs on AccountKit's runtime and screens: email and
password, the emailed sign-in link, passkeys, two-step codes, recovery,
OrangeCat and the shared sign-in (Google, Apple, GitHub, X, Facebook), each
shown once configured. /account holds passkeys, two-step codes, the
password, sign-in methods and deletion. next-auth, the hand-rolled
OrangeCat resolver and the unused /api/v1/auth/{login,register} are gone.
Every account is kept. The Prisma migration 20261101120000 adds
AccountKit's tables (auth_ prefix, modelled in schema.prisma so Prisma
never proposes dropping them) and imports each person under the same id:
the bcrypt / $bs1$ hash (legacyBcrypt) and the OrangeCat link keyed on the
sub, with AccountKit's own placeholder for a person without an address.
A trigger mirrors anyone the old server creates during the cutover. It is
re-runnable and refuses addresses that collide once lower-cased.
/api/v1/* takes the session cookie or the API token /api/account mints in
the format the Express backend verifies. The session key is
BETTER_AUTH_SECRET, or derived from the secret the box already holds.
CI: a new browser-smoke job rehearses the import twice (counts, no Prisma
drift) and drives Chromium through an imported account signing in with
its old password, sign-up, sign-out, a refused wrong password, sign-in,
recovery through the reset link, both API auth paths and every way in at
320, 390 and 1280px.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9
* test(browser): give the first article visit on next dev a compile-sized wait
The shared-article suite runs on next dev, which compiles a route on its
first visit. The account route (better-auth, pg) now compiles beside the
article for the header, so the first click can outlast the default 5s.
A production server answers at once; the account journey checks that.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9
* ci: re-run checks on the latest head
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9
---------
Co-authored-by: Claude <noreply@anthropic.com>
The product was renamed on 2026-09-14: bitbaum/loki, loki.orangecat.ch,
LOKI_* env keys, loki-* units. This repo referenced the old name in
4 files changed, 6 insertions(+), 6 deletions(-).
Email addresses at the old sending domain stay until the new domain is
verified in Resend.
Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
The concurrency group was keyed by branch with cancel-in-progress, so a
newer merge cancels an older commit's CI — and every deploy path keys off
that run. One that waits for CI to pass on the commit finds a cancelled run
and stops. One chained on workflow_run sees conclusion=cancelled and skips.
auto-merge also re-arms CI with a dispatch, and under one group-per-branch
that dispatch cancels the push run for the SAME commit.
Measured across the fleet on 2026-09-11: 28 of 39 ci.yml files had this
shape. It broke two repos that day, in the two ways it can break.
fleetcrown failed silently — Deploy skipped, four merges sat on main with
every check green and nothing red while the box served the previous build,
each needing a hand-dispatched deploy. hirnli failed loudly, erroring at
its wait-for-CI step, which is the better outcome because somebody sees it.
Keying main per commit lets both runs finish, so whatever the deploy path
looks for is there. Branch behaviour is unchanged: the newest push is still
the only one that matters there.
The templates this was copied from are fixed in bitbaum/fleet#53, which
also adds a ci-strands-commits rule to the hygiene audit so the remaining
repos are found by a sweep rather than by an outage.
Claude-Session: https://claude.ai/code/session_018Z7YRpgsEtNjRqr1usHMQY
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The comment added a few hours ago says GITHUB_TOKEN cannot merge a PR that
touches .github/workflows. That is contradicted by this fleet's own history:
github-actions[bot] merged datacat#253 and ai-kit#42 today, and both change a
workflow file. I asserted it from the reusable workflow's docstring without
checking, then found the counter-evidence while looking for something else.
Two stalled PRs were offered as proof and neither survives either. ai-kit#11
opened 2026-08-29 and this repo's sweep was not added until 2026-09-04, so for
most of that PR's life nothing was sweeping at all. aoz-housing#122 is still
unexplained — I merged it before diagnosing it, which destroyed the evidence.
The THROUGHPUT reason is unaffected and is why the line stays. A dispatch made
with GITHUB_TOKEN triggers no workflows — the same rule the deploy reconciler
exists for — so after a merge the re-armed CI run's completion fires no
workflow_run and nothing wakes the sweep for the next PR. It waits for the
cron, which GitHub throttles: fleetcrown's sweeps land 50-65 minutes apart
against a */10 schedule. A PAT-created dispatch does emit workflow_run.
The wrong claim is recorded in the file rather than quietly deleted, so the
next reader does not re-derive it from the same docstring I did.
No behaviour change: an undefined secret still resolves to empty and the
reusable workflow still falls back to github.token.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
GITHUB_TOKEN cannot merge a PR that touches .github/workflows. The sweep tries,
the merge API refuses, it logs "leaving for the next sweep", and repeats — while
still exiting 0. So the failure is invisible: every run reports success and the
PR simply never merges.
That is not hypothetical. ai-kit #11 (bump actions/checkout) sat green, CLEAN
and MERGEABLE for nine days; aoz-housing #122 (bump actions/upload-artifact)
for nine more. Both had to be merged by hand today. Every Dependabot
`github_actions` bump in the fleet is in this class, permanently.
A PAT fixes a second thing that costs more: THROUGHPUT. A dispatch made with
GITHUB_TOKEN emits no workflow_run, so after each merge nothing wakes the sweep
to take the next PR — it waits for the cron, and GitHub throttles scheduled
workflows to roughly hourly regardless of what the cron says. Observed in
fleetcrown: sweeps ~50-65 minutes apart against a */10 schedule. A PAT-created
dispatch does emit workflow_run, so the queue drains at CI speed instead.
The reusable workflow has always supported this — GH_TOKEN is
`secrets.token || github.token`. This just passes it.
SAFE BEFORE THE SECRET EXISTS: an undefined secret resolves to empty, and the
fallback picks github.token. So this changes nothing until FLEET_PAT is created
as an organisation secret, and needs no second pass afterwards.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
contentlayer generated a typed `.contentlayer/generated` package at
install/build time and compiled each post's MDX into a JS function. That
indirection had already cost this app a working blog: contentlayer 0.3.x
calls a React internal (`getOwner`) that React 19 removed, so the compiled
body crashed during prerender AND during SSR. The workaround shipped in
MDXContentClient.tsx was to render the post body client-only
(`next/dynamic`, `ssr: false`) — every reader and every crawler got
"Lade Inhalt…" and the article appeared only after hydration.
Posts are now markdown read from disk and parsed with bip-kit 0.2.2:
- content/blog/intake-engine.mdx → .md. The `<Callout type="tip">` became
GitHub callout syntax (`> [!TIP]`), the `<Infographic>` a captioned
figure, and the MDX `import` line is gone. ` ` became a real U+00A0,
since typed blocks have no HTML passthrough to render an entity through.
Word-level parity verified: zero words lost, and the article parses to the
28 blocks you would expect (callout, figure, ol, table, hr, …).
- src/lib/blog.ts is the collection: parseFrontmatter + parseContentBlocks +
extractToc + readingTime. It enforces the `title`/`date` requirement that
contentlayer's field schema used to, and guards the slug before it reaches
the filesystem.
- /blog/[slug] renders through bip-kit's async server ArticleBody. The route
is prerendered (SSG) again instead of being a client-only shell, and it
gains a scroll-spy TOC, a reading-progress hairline, server-side shiki
highlighting, figure lightbox and reading time.
- /blog is a server component again: as a client component it shipped its
own list-and-sort to every reader for data that comes off disk.
- setHighlighterLoader(() => import('shiki')) is registered at module scope
because this app builds `output: standalone`, where bip-kit's zero-config
shiki import is invisible to Next's file tracer — without the literal,
production would ship unhighlighted while dev looked right.
Deleted with it: contentlayer, next-contentlayer, rehype-pretty-code,
remark-gfm, @mdx-js/react; contentlayer.config.ts; MDXContent.tsx,
MDXContentClient.tsx, MDXComponents.tsx; `withContentlayer` in next.config;
the `contentlayer:build` script, the `postinstall` hook that ran it, and
the SKIP_CONTENTLAYER seams in both Dockerfiles and deploy.yml.disabled that
existed only to switch that build off; the `.contentlayer` entries in
.gitignore/.prettierignore/eslint ignores; and the
estree-util-value-to-estree + toml overrides, which pinned packages nothing
depends on any more (deepmerge-ts stays — it comes via @prisma/config).
Security: contentlayer was the only path to @opentelemetry/core and
@opentelemetry/sdk-trace-node. `pnpm audit` in frontend/ goes from
"2 vulnerabilities found — 1 moderate | 1 high" to "No known
vulnerabilities found".
Visible: the article carried `prose prose-indigo dark:prose-invert` with no
@tailwindcss/typography plugin installed, so those classes matched nothing
and the post rendered as unstyled browser defaults. src/app/blog/blog.css
maps datacat's palette onto bip-kit's --bp-* contract for BOTH themes —
datacat's dark mode is prefers-color-scheme, the same axis bip-kit switches
on, so the article now darkens with the page instead of ignoring it.
Only frontend/ is touched; backend/ is untouched.
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This repo shipped its own scripts/ci/auto-merge-sweep.sh: 297 lines against the
canonical's 446, differing on 149. Every fix that landed in bitbaum/fleet since
the copy was taken reached here never — which is the whole reason SHARED.md
tracks this duplication as a ratchet rather than as advice.
Auto-merge did not appear broken, and that is the point: a sweep merges what it
can and exits 0, so a copy missing a third of the canonical looks exactly like a
working one until the missing third is what you needed.
The concrete gain is the DEPLOY RECONCILER. The old copy listed deploy.yml in
REARM_WORKFLOWS, which dispatches it once and cannot tell whether the deploy
actually landed. The canonical compares main's tip against the last successful
deploy and re-dispatches when they differ, so a deploy that never fired — or
fired and failed — is retried on the next sweep instead of leaving a commit
merged-but-not-live. That failure is invisible without it: CI green, PR merged,
box unchanged.
Also gained: checks:read + statuses:read on the caller. Public repos do not need
them, so their absence is silent here — but the caller is now identical to every
other repo's, which is what makes the next fix a one-file change.
What stays local is only what genuinely varies: the workflow_run trigger must
name the CI workflow exactly as its own `name:` field spells it, and the
schedule. Everything else is inputs.
DEPLOYMENT.md pointed at the deleted script; it now names the reusable workflow.
A doc that describes a file which no longer exists is the same class of problem
as the copy itself.
Verified: the generated YAML parses, resolves to
bitbaum/fleet/.github/workflows/auto-merge-sweep.yml@main, and passes
base_branch / ci_workflow / rearm_workflows / deploy_workflow — all four
confirmed against the reusable workflow's declared inputs. No file outside the
workflow still references the removed script.
NOTE: this PR touches .github/workflows, which GITHUB_TOKEN cannot merge, and
scheduled sweeps read the workflow from the default branch. It needs one
hand-merge; after that the sweep here is the shared one.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* refactor(ai): complete() owns the request, the per-vendor dedupe goes, and the tests can finally run
Three things, and the third is why the first two were invisible.
1. THE 429 BODY WAS READ AND DISCARDED. The hand-rolled `attempt`
ended a failed request at
`chat failed (${res.status}): ${detail.slice(0, 200)}` — fetched,
truncated, and read by nothing. The three kinds of 429 share that
status code and want opposite responses:
capacity — a burst; demoting is right.
daily — the vendor's whole org-wide budget is spent; every other
model there is already dead.
size — one request exceeded the per-minute allowance alone; the
next model down has a SMALLER ceiling, so demoting is
strictly worse.
The old `fetch` also had NO deadline, so a vendor that accepted the
connection and never answered held an ingestion job open forever and
the fallback beneath it was never reached.
2. THE PER-VENDOR DEDUPE IS GONE, and that is the point rather than a
tidy-up. It kept one link per vendor because "a second model at the
same vendor draws on the same daily budget". True of the DAILY case
and only that case — and it discarded the retry that rescues the two
failures that actually keep happening: a retired model id, and a model
that is momentarily busy while the vendor is fine. complete() makes
the distinction per failure KIND instead of up front, so a daily 429
still condemns the vendor (the dedupe's real benefit, kept) while a
404 demotes within it. Strictly more chain, not less.
3. NOTHING IN backend/ COULD RUN A TEST. `backend/package.json`'s script
was `echo "Error: no test specified" && exit 1`, and the root `test`
only ever ran the frontend. backend/utils/responseHandlers.test.js has
been sitting there, committed, executed by nothing — its own docstring
says so. So a chain change here would have shipped with no coverage,
and any test I added would have joined it in the dark.
Wired: backend `test` → `vitest run`, root `test` → frontend AND
backend. 71 frontend + 20 backend, ten of those twenty running for the
first time.
The 10 new tests drive every failure through a real response BODY,
because the body is the only thing that separates the three 429s. The
SIZE one asserts exactly one request was made — asserting that it threw
would not show the walk STOPPED, since everything failing throws too.
Mocks are real Response objects built per call: one body reads once, so
a shared instance makes link two fail with "Body has already been read",
a fake failure in front of the real one.
verify green.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NHDLTKGirKU7He8q2YR2y4
* ci: install backend deps, or the test script I just wired makes the gate red
The previous commit pointed root `test` at both halves. CI installs only
`frontend`, so `pnpm run verify` would have reached `test:backend` and
died with "Command vitest not found" — a wired script and a red gate,
which is worse than the gate that was simply absent.
Adds an `Install (backend)` step and caches on both lockfiles. Verified
`pnpm install --frozen-lockfile` succeeds in backend/ against the
committed lockfile, which is what CI runs.
Also corrects the comment above `Verify`. It described the gate as
"lint + typecheck + build"; it is format + lint + typecheck + test +
build, and `test` now covers both halves. That comment is what a reader
trusts about what "verified" means in this repo, so leaving it describing
the old bundle would be its own quiet lie.
The job id stays `verify-frontend` even though it is now a misnomer:
renaming a job renames the status check, and a required check that
disappears blocks merges rather than failing loudly.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NHDLTKGirKU7He8q2YR2y4
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* chore: add a formatter, matching the style this repo already writes
singleQuote=true 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 (199 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(ci): put prettier where CI actually installs
The formatter was added to the root package.json, but CI installs with
working-directory: frontend and then runs npm run verify at the root, so root
devDependencies are never installed at all. format:check died with
'prettier: not found' before checking a single file.
Root now delegates into frontend the way every other root script already does,
and prettier is a devDependency of frontend, whose lockfile CI installs.
frontend also needs its own .prettierignore: prettier resolves that file
relative to the working directory, so the root one stopped applying the moment
the command ran from frontend/ — which is how README.md and Playwright output
ended up being checked.
* fix(ci): do not format contentlayer's generated output
format:check ran green locally and failed in CI on files that do not exist
locally: CI builds contentlayer before verify, so .contentlayer/generated is
present by the time prettier looks. One generated module imports with
assert { type: 'json' }, which prettier's parser rejects outright.
A local --check cannot see build output, so generated directories have to be
ignored by name rather than discovered.
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
deploy.yml called catomean/fleetcrown/.github/workflows/selfhost-deploy.yml.
The Actions `uses:` resolver does not follow a rename or a transfer, though the
REST API and git both do — so the reference looked correct everywhere it could
be checked, while the run died before any job started.
This repo has no auto-merge.yml, so nothing here ever went visibly red; the
deploy simply stopped happening. Found by auditing every workflow reference in
the org against the canonical full_name REST reports.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* ci: add the auto-merge sweep policy
* ci: green PRs merge and deploy themselves
* ci: allow deploy to be dispatched so an automated merge still ships
verify was lint + typecheck only. The cost of that gap is on record: contentlayer
0.3.1 reaches into a React internal React 19 removed, so /blog/[slug] threw
"d.getOwner is not a function" during prerender. Both gated signals stayed green
and production served a stale build while every CI run reported success (#202).
verify is now lint + typecheck + build, with `typecheck` promoted to its own
named script so the chain reads as three steps instead of an inline `cd`.
The prisma-engine problem that justified deferring the build no longer
reproduces: `prisma generate` succeeds on 6.19.3.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
CI and the deploy pipeline each picked their own Node major, so a build
could ship from a toolchain CI never verified — npm 10 and 11 disagree
about optional platform deps, which failed 'npm ci' on a lockfile the
other npm wrote. One declaration both sides read.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Merged changes never reached the box — deploys only ran from a local
pre-push hook. Calls the shared self-host CD workflow, which blocks on
this commit's own CI before shipping.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
CI now calls the same package.json `verify` script an agent runs locally,
instead of re-listing lint/typecheck/test. Change the checks in one place.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* ci: add golden verification floor
Wires the shared CI floor (see dotfiles/templates/ci) so main is defended by
lint + typecheck + test + build on every push and PR. npm monorepo — gates frontend lint/typecheck/build (e2e deferred).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* ci: pin Node 18 for datacat (contentlayer crashes on exit under Node 20+)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* ci: defer build (prisma engine issue); floor = lint+typecheck
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add SECURITY.md with vulnerability reporting guidelines
- Add dependabot.yml for automated dependency updates
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>