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 AccountKit's own screens
PrintCraft signed people in against OrangeCat's GoTrue (auth.users). It now
runs on AccountKit (@bitbaum/accountkit 0.23) with AccountKit's own forms:
/login offers email and password, an emailed sign-in link, a passkey,
recovery through the mailed link and the second factor; /register is
sign-up; /account carries the account panel. "Continue with OrangeCat" and
the shared sign-in show when their clients are set, the link and recovery
when mail is. The GoTrue forms, the Supabase cookie middleware and the
browser auth client are gone.
AccountKit's tables live in a host accounts database (app/drizzle, loki
accounts-db.conf); the project data stays in the printcraft supabase schema.
API routes always read it through the service-role client and check
ownership against the session's user id, as they already did for guests.
New accounts get uuid ids (projects.user_id is a uuid), and a supabase
migration drops the projects.user_id key to auth.users, which a new
person's id is not in. Nothing is deleted.
Existing people keep their projects: scripts/db/accountkit-people.sql lists
every project owner with their OrangeCat actor id, and
scripts/db/accountkit-import.sql gives each an account under the same id,
linked to OrangeCat by that actor id, never by address (loki
accountkit-supabase.yml rehearses it rolled back, then imports).
src/lib/auth/accounts.test.ts runs the ways in and the import on the
committed migration; accounts.yml rehearses the import and runs the browser
journey against the production build with AccountKit's real mail caught by
a sink.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9
* ci(auth): the account journey is the browser smoke the rollout gate reads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9
* docs(ci): name the journey's workflow
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>
Root `pnpm run verify` failed on main: `prettier --check .` flagged
app/pnpm-workspace.yaml (double quotes against the root singleQuote
setting). CI ran only the app's verify, so nobody saw it.
- Format app/pnpm-workspace.yaml with the root prettier config.
- CI installs the root (prettier only) and runs the root `verify`
(= format:check + app verify), so the gate CI runs is the gate a
person runs at the root.
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
5 files changed, 8 insertions(+), 8 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>
`generate scene` printed a red "✗ Failed" and exited 0. `generate all-scenes`
printed "0/2 scenes generated successfully" and exited 0. The generator was
never at fault — it detects the rate limit, sets `error` and returns
`success=False` correctly. The CLI took that report and threw it away at the
process boundary, so every wrapper, `&&` chain, cron job and scrolled-past
terminal read a half-finished round as a finished one.
That is how round 010 of the Duschwand lost `chain_vv_van` and `chain_teal_kd`
to a rate limit in April and sat unfinished for five months: 8 prompts, 7
outputs on disk, exit 0. This is the same defect class the web app has been
swept for across #36–#47 — a failure that reports itself as success — found at
the CLI boundary of the pipeline that actually produces the client deliverable.
Both commands now exit 1 when any scene fails, and `all-scenes` names which
ones. `--only-missing` re-runs just the scenes with no output, so recovering
from a rate limit no longer means regenerating (and overwriting) the images
that worked.
The output filename pattern now has one definition — `output_path()` in
grok.py, used both by `generate()` which writes the file and by the caller
asking whether it already exists, so "is this scene done?" cannot drift from
what is actually written.
Also corrected the module docstring, which advertised a `generate mural`
command that does not exist; the command is `all-scenes`.
The Python half of this repo had no tests and no CI at all, which is why a bug
this plain survived: `tests/` is new, with 6 tests over the fixed behaviour and
a fake generator so no browser or network is touched. CI gets a "Python
pipeline tests" step. Deliberately NOT folded into `pnpm run verify` — that
gate has to work from a bare `pnpm install`, and pytest needs a Python env —
so it is a separate, explicitly documented gate rather than a silent gap;
`package.json`'s comment field and the CI step both say so.
Verified: 6/6 new pytest pass; each half of the fix mutation-verified (dropping
the scene exit, the round exit, or the --only-missing filter each fails a
different named test). Root `pnpm run verify` still exits 0 (format + lint 0
errors/8 pre-existing warnings + tsc + 101 JS tests). Reproduced the original
defect first — the same harness printed EXIT CODE: 0 before and prints
EXIT CODE: 1 after. `printcraft project list-scenes` still loads the real
duschwand-roli project.
Does NOT retro-fix round 010: those prompts are `chain_*`, ad-hoc names that
do not match project.yaml scene ids, so that round was not produced by
`all-scenes` and cannot be resumed by it. Finishing it is still manual work.
Claude-Session: https://claude.ai/code/session_01SZGjXtzLGk2q9zPUkA3vMf
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>
The pnpm conversion (#41) missed the explicit package-manager: npm override
in deploy.yml, so the first post-merge Deploy ran setup-node with cache: npm
and died on "Dependencies lock file is not found" (package-lock.json is gone).
Pin pnpm instead — the pin exists so root lockfile edits cannot silently flip
the manager, and that rationale still holds.
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>
* 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 (85 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>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
23 of 30 repos in the fleet had none. The symptom looks like neglect and
is not: aoz-housing had 100 commits in August, features landing daily, and
was still on Next 14 / React 18 / Tailwind 3 — because nothing ever OPENED
the upgrade PR. Version drift here is the absence of a mechanism.
npm directory: /. Minor and patch grouped so the sweep spends one
cycle on them; majors stay separate because they deserve reading.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
The `uses:` line is already correct. What was stale is the prose next to
it, which told the reader the policy lives in bitbaum/dotfiles and to go
change it THERE. That file no longer exists in dotfiles — the sweep moved
to bitbaum/fleet on 2026-08-28, because a repo holding someone's .bashrc
is not where a fleet's deploy policy belongs.
A comment that misroutes a fix is worse than a missing one: it sends the
next person to edit a repo where the change would reach nobody, which is
the precise failure the shared sweep exists to prevent.
Files: .github/workflows/auto-merge.yml, .github/workflows/ci.yml
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
The fleet automation moved out of dotfiles on 2026-08-28; the dotfiles path
is now a forwarding shim. This points the caller at the sweep's real home.
One line; the reusable workflow's interface is unchanged.
Claude-Session: https://claude.ai/code/session_01AZCNYHwjEeqxNpYCUk6Yna
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
The fleet moved to the bitbaum org. Actions' `uses:` resolver does not follow
a repo transfer — unlike the REST API, `git clone` and `git push`, which all
do. So every reference here still looked correct to every tool that could be
used to check it, while the runs died before a single job started: zero jobs,
no logs, and a bare "workflow file issue".
That failure mode is invisible in the usual places. A PR shows CLEAN and
MERGEABLE with no red check, because the workflow that would have reported the
red never ran. Nothing is marked broken; work simply stops moving.
Files changed: auto-merge.yml deploy.yml
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
The Export step was the one place the product's premise cashes out — "we
don't export images, we export artifacts" — and it did neither of the two
things that make a file printable.
1. The exported PNG had the editor's guides baked into it. The seam lines,
dead-zone boxes and buffer tints live in the same Konva stage as the
artwork, so every export carried red dashed lines across the picture.
Send that to a print shop and the guides come back on the glass.
2. Resolution was a magic `pixelRatio: 4` with no relationship to the
surface. For Roli's Duschwand (197 x 190 cm at 200 DPI) that is roughly
60 DPI — about a third of spec — and the toast said "PNG exported".
The failure path was worse: it silently retried at half resolution and
still reported success.
Export now resolves the scale from the surface's own `dpi_target` (already
the SSOT, set on the Surface step) and hides the guide layer for the
render — Konva's stage export skips layers that are not visible, so the
artwork leaves alone. When the browser refuses an allocation that large it
steps down and reports the DPI it actually reached instead of claiming the
target. The Duschwand fits under the canvas ceiling, so it exports at the
full 200 DPI; there is a test pinning exactly that.
The Export page had its own DPI selector that persisted nowhere and reached
no exporter — two sources of truth for one number, and the losing one was
the one with the buttons. It now shows the surface's target and links to
the Surface step to change it.
Also drops `getPixelRatio`, dead since it was written, and corrects the CI
comment that still claimed this repo has no test suite.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
auto-merge-sweep.sh was copied into 22 repos and drifted into EIGHT distinct
versions, 245 to 404 lines. Three of them independently grew different fixes for
real outages, and each fix reached only the repo that wrote it:
evig, revampit infra-failure detection + re-run. An Actions incident left
main "failure" with no failed job at all; 11 PRs stranded
for roughly 14 hours.
fleetcrown DEADLOCK naming — a red base with the repairing PR sitting in
the queue was indistinguishable from "nothing to merge".
the other 19 neither.
Nothing could carry a fix across, so every repo waited to hit each outage
itself. This repo now calls the canonical sweep in maonakamoto/dotfiles, and the
local copy is deleted.
The canonical is the union of the three, built on the variant ten repos were
already running rather than on the longest one — the 404-line variant is missing
the step-summary reporting the 296-line one has, so "take the biggest file"
would have silently deleted working behaviour. The merge was 106 insertions and
zero deletions: nothing can be lost by adopting it.
The triggers stay in this file because they genuinely are per-repo: workflow_run
must name the CI workflow exactly, and that name differs across the fleet.
Two details that are silent when wrong, both found by piloting rather than
reasoning:
rearm_workflows is SPACE-separated. The sweep word-splits it; a comma makes
one bogus token, every dispatch fails, and the only symptom is that nothing
deploys — while the sweep still exits 0 and reports a successful merge.
permissions are declared on the CALLER as well. A called workflow's token is
capped by what the caller grants, so relying on the callee's block alone can
hand it a read-only token; the sweep would then merge nothing while exiting 0,
which is indistinguishable from having nothing to merge.
Verified before this rollout: the canonical ran end to end in dotfiles' own CI,
and the reusable-workflow path ran end to end in the pilot repo (s-ink).
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* chore: remove the stale root-level Next.js tree
The repo root carried a full frozen copy of the Next app (src/, public/,
supabase/, next.config.ts, tsconfig.json, eslint.config.mjs,
postcss.config.mjs, components.json, package-lock.json) from before the
self-hosted migration. It was unioned back into main by the
unrelated-history merge e657365 and, per the root README's own note,
"nothing builds it, nothing deploys it" — app/ is the only tree CI gates
and the box runs. Confirmed the two trees had drifted (app/ carries fixes
root never got: the OG-image URL fix, setState-in-effect fix, and the
printcraft schema on the self-hosted Supabase client) before deleting.
Also relocates .env.local.example into app/, where app/README.md's `cp
.env.local.example .env.local` setup step actually expects to find it —
previously that command failed for anyone following the docs from app/.
Updated its placeholder Supabase URL from the old managed project to the
current self-hosted host.
Root package.json is now a thin wrapper exposing `npm run verify` from
the repo root, same as before.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fixup: stage the README/package.json/.env.local.example edits
These were edited after the git mv/git rm staging in the previous commit
and never got re-added — the previous commit only carried the deletions.
* fix(ci): restore a root lockfile so the shared deploy workflow can npm ci
selfhost-deploy.yml always runs `npm ci` at the repo root before installing
inside APP_DIR (root hosts workspaces for some apps in the fleet) — removing
root's package-lock.json in the previous commit broke that step with "no
lockfile at the repo root". Prod kept serving the last good release (the
failure was before the atomic swap), but every push since was un-deployable.
Regenerate a lockfile for the now-trimmed, dependency-free root package.json
(a trivial 1-package lockfile), and pin package-manager: npm explicitly so
future edits to that lockfile can't silently redirect detection.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
---------
Co-authored-by: Mao Nakamoto <maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Sonnet 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
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>
printcraft had no CI at all on main. Add the golden npm floor
(dotfiles/templates/ci/ci-npm.yml) wired to the tree that actually ships.
Which tree ships is not obvious — main carries two complete Next.js apps
(root `src/` and `app/src/`) with identical file sets. Evidence that `app/`
is production:
1. fleetcrown/scripts/hetzner/apps.conf line 17 pins APP_DIR=app, so
deploy.sh builds in `app/` and rsyncs `app/.next/standalone`.
2. Only `app/next.config.ts` sets output:"standalone"; deploy.sh aborts
without it. The root config has never had it.
3. The box runs a standalone bundle (/opt/printcraft/app/server.js) whose
route manifest matches `app/src/app` exactly.
4. Only `app/src/lib/supabase/*` carries the self-hosted migration
(db:{schema:'printcraft'}, supabase.orangecat.ch). Root still targets
the dead managed project ckpynkpsfnuqndplaapc.supabase.co.
5. `app/` has commits through 2026-07-22; root `src/` is frozen at
2026-03-28 and re-entered main only via the unrelated-history merge
e657365 (2026-07-17).
So:
- app/package.json: `typecheck` (tsc --noEmit) and `verify`
(lint && typecheck). No `test` — the repo has no test suite.
- .github/workflows/ci.yml: checkout@v7 / setup-node@v7 (node 22, the
version deploy.sh builds on), working-directory app, npm ci ->
npm run verify -> npm run build -> assert the standalone bundle exists,
so a lost output:"standalone" fails CI instead of failing a deploy.
- README: document the layout so the stale root tree is not mistaken for
the live one (and vice versa).
Nothing is deleted and no runtime code changes.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>