14 Commits
Author SHA1 Message Date
CatoandClaude Opus 5 ed17d502fe fix(verify): the gate was red on an unmodified main, twice over (#259)
`pnpm run verify` — the command this repo's definition of done names — exits
non-zero on a clean checkout of main, for two independent reasons that have
nothing to do with any change. CI cannot see either one.

**1. Generated output from tooling that was removed.**
#254 replaced contentlayer with bip-kit and deleted the `.contentlayer` line
from frontend/.prettierignore. Correct — the tool is gone. But the directory it
generated survives in every checkout that had built the blog before then, and
losing the ignore entry moved it from "invisible" to "in prettier's scope".
Prettier cannot parse its import assertions, so `format:check`, the FIRST gate,
died with a SyntaxError naming a generated file nobody wrote. A fresh clone has
no such directory, which is exactly why CI is green.

Two checkouts here had it, including the worktree of a session running right
now, whose verify is red for this reason as I write it. So preflight grows a
fourth check — same shape as the stale-node_modules one, and covering every
worktree rather than just the current one:

    ! generated output from removed tooling: frontend/.contentlayer
      .claude/worktrees/complete-fetch/frontend/.contentlayer

`--fix` deletes them. Proved by recreating the exact stale state, watching the
read-only run flag both paths, then watching --fix clear them.

**2. A required artifact that no step in the gate produced.**
`typecheck` ran `tsc` against a Prisma client that only ever got generated by
`@prisma/client`'s own postinstall hook, or by `build` — which runs *after*
typecheck. The hook fires in CI; it did not fire here, because pnpm gates
dependency build scripts and caches their side effects. So a clean
`pnpm install --frozen-lockfile` left the client ungenerated and verify died:

    src/lib/db.ts(1,10): error TS2305: Module '"@prisma/client"'
      has no exported member 'PrismaClient'.

Reproduced from an empty node_modules twice before changing anything. The fix
is not to re-approve a hook: a gate should not depend on an install side
effect it does not control. `typecheck` now runs `prisma generate` itself
(~300ms) and the artifact exists because the step that needs it made it.

Both fixes are the same principle — `verify` must depend on the repo, not on
what a previous install or a previous version of the tooling happened to leave
behind. The CLAUDE.md build section is corrected alongside: it still described
contentlayer as the blog pipeline and told the reader to run
`pnpm exec contentlayer build`, which would have recreated failure #1.

verify, from a wiped frontend/node_modules: prettier ok, lint 0 errors / 152
warnings, tsc clean, 96/96 tests (76 frontend + 20 backend), build ok.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-08 04:16:33 +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
2a659fc3b7 fix(dev): preflight hint forwarded a literal -- under pnpm (#246)
pnpm passes `--` through to the script, so the suggested
`pnpm run preflight -- --fix` put "--" in $1 and --fix was
silently ignored. pnpm needs no separator.


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 09:38:54 +00:00
a1f2d2a334 fix(preflight): update dependency-freshness check for the npm->pnpm migration (#245)
#243 migrated frontend/backend from package-lock.json to pnpm-lock.yaml, but
preflight.sh's staleness check still watched package-lock.json. Once that file
was deleted, `[[ -f "$lock" ]] || continue` silently no-op'd the check for both
packages, so a checkout still holding pre-migration npm-flat node_modules
reported "Preflight clean." This checkout hit exactly that: five commits and
the pnpm migration stale, undetected until `pnpm run verify` would have run
against the wrong toolchain layout.

Point the check at pnpm-lock.yaml/.modules.yaml and reinstall via
`pnpm install --frozen-lockfile` (wiping the old npm-flat node_modules first,
since pnpm's symlinked layout doesn't cleanly overwrite it).

Co-authored-by: Mao Nakamoto <maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-04 04:19:31 +00:00
55683d426c chore: stop repairing the same checkout drift by hand every run (#237)
Three separate sessions have now opened this repo, found the working copy
silently wrong, and spent part of the run repairing it before any real work
could start:

  2026-08-29  local main held a commit origin never got, so `git pull --ff-only`
              failed for every run entering the repo.
  2026-08-31  local main was 2 commits behind origin (#232, #233).
  2026-09-02  local main was 3 commits behind (#234-#236), two squash-merged
              worktrees were still checked out, and frontend/node_modules
              predated the prettier devDependency from #233 — so the first gate
              of `npm run verify` died on "prettier: not found".

A bare `git status` reports "clean" in all three cases, which is why each run
rediscovers it the hard way instead of inheriting the last one's fix. Per the
never-twice rule, the third instance gets the automation, not a fourth repair.

`npm run preflight` checks the three invisible ones — divergence from origin
(after an explicit fetch), merged worktree branches still checked out (compared
by patch id via `git cherry`, since `git branch --merged` cannot see a squash),
and node_modules older than its lockfile. Read-only by default, exit 1 on drift;
`npm run preflight -- --fix` repairs what it finds and refuses to touch a
worktree with uncommitted changes.

Both paths exercised on this branch: the read-only run caught backend/
node_modules as stale against the #229/#230 security bumps, and --fix
reinstalled it to clean.


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

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-02 04:09:43 +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
7fc5322396 chore(ci): finish the catomean -> bitbaum rename in auto-merge-sweep (#231)
PR #227 moved the deploy workflow to the bitbaum org but left two incident
notes in auto-merge-sweep.sh pointing at catomean/ repo paths that no longer
resolve. The comments are the only record of why the sweep skips red bases and
merges oldest-first, so a dead path there costs a future reader the receipt.

Found because local main had diverged: it carried this half of the rename in a
commit whose deploy.yml half shipped as #227.


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

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 04:11:18 +00:00
Mao Nakamoto 2b4b94ee83 chore(ci): GitHub owner maonakamoto -> catomean 2026-08-27 19:18:28 +02:00
G 070df2b8f4 fix(ci): declare the failing-job list before the branch that can skip it (#217) 2026-08-07 09:57:56 +00:00
G 4f1f57a654 fix(ci): a red base must not trap the PR that repairs it (#216) 2026-08-07 09:38:14 +00:00
G ada35a4309 fix(ci): stop skipping conflicts, and keep branches current (#214) 2026-08-07 07:12:39 +00:00
GandClaude Opus 5 ed4326e996 fix(ci): drain the merge queue oldest-first, not newest-first (#213)
`gh pr list` returns newest-first, and the sweep merges the first eligible PR
then stops. So the newest green PR wins every sweep, and an older one can wait
indefinitely.

Observed in maonakamoto/fleetcrown on 2026-08-06: two consecutive sweeps merged
the two newest PRs while three older green ones sat untouched and were never
even evaluated. With several agent sessions opening PRs continuously that is
starvation — and it starves the worst candidate, since the longest-waiting PR
is the one whose checks were proven against the most now-stale base.

PR numbers increase monotonically with creation, so sorting ascending is FIFO.
The ordering was never a decision, just whatever gh happened to return.

Fixed upstream first (fleetcrown #182) and verified in production there: the
sweep immediately after it landed correctly took the oldest open PR rather than
the newest. This is that one-line change, applied to the fleet.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-06 13:38:57 +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
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