Commit Graph
24 Commits
Author SHA1 Message Date
CatoandClaude Fable 5.1 7477ccfc7b chore: rename FleetCrown to Loki (#269)
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>
2026-09-13 16:25:25 -07:00
CatoandClaude Opus 5 c8f89c6a05 fix(ci): a commit must not cancel another commit's run (#267)
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>
2026-09-11 14:35:06 -07:00
CatoandClaude Opus 5 132967b66f ci(auto-merge): correct the reason this repo passes a PAT (#257)
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>
2026-09-07 15:53:03 +00:00
CatoandClaude Opus 5 b87e1789b1 ci(auto-merge): hand the sweep a PAT so workflow PRs stop stalling (#255)
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>
2026-09-07 15:11:35 +00:00
CatoandClaude Opus 5 d88da54244 refactor(blog): bip-kit typed blocks replace contentlayer — the post body is server-rendered again (#254)
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. `&nbsp;` 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>
2026-09-07 14:55:47 +00:00
CatoandClaude Opus 5 325e650722 ci(auto-merge): call the fleet sweep instead of carrying a stale copy of it (#253)
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>
2026-09-07 14:26:59 +00:00
CatoandClaude Opus 5 bf1d9c32d3 refactor(ai): complete() owns the request, the per-vendor dedupe goes, and the tests can finally run (#252)
* 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>
2026-09-07 11:24:33 +00:00
859bde4c3f fix(deploy): drop npm-only --legacy-peer-deps — pnpm rejects it (#244)
The pnpm conversion (#243) left deploy.yml passing install-flags meant for
npm; the shared selfhost-deploy detects pnpm and ran
`pnpm install --frozen-lockfile --legacy-peer-deps`, which fails with
"Unknown option". pnpm treats peer conflicts as warnings, so no flag is needed.


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>
2026-09-04 00:46:43 +00:00
8e3f2cd31d chore: pnpm — the fleet has one package manager (#243)
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>
2026-09-04 00:33:50 +00:00
GandClaude Opus 5 53d2e70723 chore: add a formatter (#233)
* 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>
2026-08-29 11:06:25 +00:00
GandClaude Opus 5 32e3e911e1 fix(ci): point the deploy at the bitbaum org, so this repo can ship again (#227)
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>
2026-08-28 10:37:19 +02:00
Mao Nakamoto 5eb4843d85 chore(ci): GitHub owner maonakamoto -> catomean 2026-08-27 19:11:24 +02:00
dependabot[bot] b946bb406c ci: bump actions/setup-node from 4 to 7 (#185)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 7.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '7'
  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>
2026-08-05 20:50:54 +00:00
dependabot[bot] 5ddd4d5d3b ci: bump actions/checkout from 4 to 7 (#186)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  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>
2026-08-05 20:46:15 +00:00
G 1820e1e14d ci: green PRs merge and deploy themselves (#210)
* 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
2026-08-05 19:16:27 +02:00
GandClaude Opus 5 250f1b051d fix(ci): put the build back in verify — lint and typecheck cannot see a broken build (#205)
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>
2026-08-04 16:38:36 +02:00
GandClaude Opus 5 eeb0b4bbb9 chore: declare Node 18 once, in .nvmrc (#201)
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>
2026-08-03 10:53:25 +02:00
GandClaude Opus 5 3849458618 ci: deploy on push to main (#200)
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>
2026-08-03 10:26:41 +02:00
GandClaude Opus 4.8 c058e3af35 ci: converge on verify — one definition of the check bundle (#184)
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>
2026-07-17 11:58:18 +02:00
GandClaude Opus 4.8 6020f3efc9 ci: add golden verification floor (#182)
* 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>
2026-07-17 10:32:21 +02:00
g-but 08e300ddfe ci: disable GitHub Actions to stay within free tier 2026-06-16 19:33:52 +02:00
dependabot[bot] d809191403 ci: bump docker/setup-buildx-action from 3 to 4 (#140)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3 to 4.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-version: '4'
  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>
2026-03-13 11:05:39 +01:00
g-butandClaude Opus 4.5 e998585491 chore: add security policy and dependabot config
- 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>
2026-01-07 19:58:40 +01:00
Your NameandClaude b2a4656d16 feat: prepare for deployment - update documentation and backend structure
- Updated CLAUDE.md with unified Erfassung platform concept
- Enhanced backend controllers and routes structure
- Updated dependencies and configurations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-07 19:49:19 +02:00