Commit Graph
22 Commits
Author SHA1 Message Date
CatoandClaude 2d3609c13e feat(auth): stage AccountKit beside Auth.js, switch off (#156)
Petvity moves from Auth.js to @bitbaum/accountkit one reversible step at a
time, as evig and kivvi do. Nothing changes while AUTH_RUNTIME is unset.

- Migration 0008: AccountKit's tables under an `auth_` prefix, plus the
  users <-> auth_users mirror functions, inert until attached.
- scripts/db/accountkit-import.sql: accounts under their own ids, bcrypt
  hashes byte for byte, verification kept, orangecat_sub as an `orangecat`
  account row; refuses collisions, drift or a live shared runtime, then
  attaches the triggers. The rehearsal CLI always rolls back.
- lib/auth/shared/: the runtime (ids: 'uuid', legacy bcrypt, AccountKit
  0.16.0), a session reader re-read from `users` on every request, a bridge
  that answers next-auth/react including "Sign in with OrangeCat", and a
  Petvity row for a person AccountKit creates itself. AccountKit's own
  credential endpoints stay closed; Petvity's writers stay the only ones.
- lib/auth/claims.ts: the ADMIN_EMAILS promotion rule, written once.
- The proxy has one routing function and two session sources.
- browser-smoke.yml runs the account journey once per runtime; the
  AccountKit leg first runs the rehearsal and the real-database journeys.

docs/ACCOUNTKIT-MIGRATION.md records what is left before switching.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 08:31:55 +01:00
CatoandClaude 5664c79595 fix(db): commit the 0000 baseline and build browser-smoke from migrations (#147)
drizzle/0000_pretty_cammi.sql was in the journal but never committed, and
the objects between it and 0001 (adoption, seller profiles, signal history,
16 indexes) were reconciled with db:push, so the chain could not build an
empty database. The baseline is generated from 0001's snapshot minus what
0001 itself adds, and 0000_snapshot.json now records that state, so every
step's snapshot diff matches its SQL.

Every baseline statement is guarded (CREATE TABLE/INDEX IF NOT EXISTS,
CREATE TYPE and foreign keys in a block that ignores duplicate_object), so
loki apply-schema.sh, which will see 0000_pretty_cammi as pending on prod,
applies it as a no-op there. Checked against a tip-state database with
0001..0007 in its ledger: no error and an identical shape afterwards.

browser-smoke now replays the migrations the way the deploy batches them
(scripts/ci/migrations-replay.sh) and fails when the result differs from
drizzle-kit push.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 11:35:13 +01:00
CatoandClaude 202e01fb40 ci(browser-smoke): run the recovery-page check, matched to the one-field reset form (#145)
recovery-browser-check.mjs still filled "Repeat new password", a field
@bitbaum/accountkit removed in 0.9.1: the reset form now asks once, in the
same PasswordField with a show/hide eye as sign-up. The page was right and
the script was stale, unnoticed because no workflow ran it.

The script now checks the password is asked for once and the eye reveals
it, and browser-smoke.yml runs it as its own step so it cannot rot again.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 11:24:51 +01:00
CatoandClaude f0d9e01cb3 ci(browser-smoke): account journey in Chromium, and sign-out that sticks (#144)
* fix(auth): the proxy no longer re-issues the session cookie

Auth.js's auth() proxy wrapper appends a fresh session cookie to every
response it handles, Link prefetches included. A prefetch that left the
browser before Sign out came back after it and set the old, still-valid
JWT again, so the person stayed signed in. The new browser journey hit
this in about one sign-out in three.

The proxy now drops only the session-token Set-Cookie it would add; the
session still rolls through /api/auth/*, which SessionProvider calls on
every page load.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

* ci(browser-smoke): register, sign out, sign in and no stray Google button

browser-smoke.yml runs scripts/ci/account-journey.mjs in Chromium against
the production build and a throwaway Postgres 17: register through
/register, see the portal, sign out from the sidebar, a wrong password
refused, the right one accepted, no sideways scroll on /login and
/register at 390px. With no GOOGLE_* pair it checks that no Google
provider is mounted and no Google button is drawn, the guard for the
invalid_client sign-in of 2026-10-30.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 11:13:15 +01:00
CatoandClaude Fable 5.1 ef4c7c3144 chore: rename FleetCrown to Loki (#93)
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
9 files changed, 15 insertions(+), 15 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:03 -07:00
dependabot[bot] 41c059a73d chore(deps): bump actions/cache from 4 to 6 (#90)
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 6.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '6'
  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-09-12 00:44:43 -07:00
CatoandClaude Opus 5 7cf5ae5a34 fix(ci): a commit must not cancel another commit's run (#89)
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:10 -07:00
CatoandClaude Opus 5 421467d71d ci(auto-merge): correct the reason this repo passes a PAT (#83)
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:56:12 +00:00
CatoandClaude Opus 5 9329d7de43 ci(auto-merge): hand the sweep a PAT so workflow PRs stop stalling (#82)
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:40 +00:00
CatoandClaude Opus 5 f66c95f3ab ci(auto-merge): call the fleet sweep instead of carrying a stale copy of it (#81)
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.

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:28:10 +00:00
CatoandClaude Opus 5 5a3db71b4b ci: cache Next's build output so CI stops recompiling from scratch (#80)
Next keeps its compiler output in .next/cache and nothing restored it here, so
every CI run recompiled the whole app — and the deploy then compiled it again.

Measured across the fleet on 2026-09-07: of eight repos, exactly one cached
this in CI. 14 repos build cold; this is one of them.

Keyed on the lockfile so a dependency change invalidates it. The bare
restore-key is last on purpose: a stale cache still beats no cache, and Next
validates its own entries rather than trusting them.

Ratcheted fleet-wide by fleet/scripts/ci/cicd-hygiene-audit.sh, and both golden
CI templates now ship this step so new repos start warm.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 13:42:31 +00:00
GandClaude Opus 5 c65ac4b7d7 chore: add a formatter (#71)
* 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 (252 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>
2026-08-29 10:05:01 +00:00
dependabot[bot] da7229e018 chore(deps): bump actions/checkout from 4 to 7 (#64)
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-29 07:14:05 +00:00
dependabot[bot] 530cb04488 chore(deps): bump pnpm/action-setup from 4 to 6 (#65)
Bumps [pnpm/action-setup](https://github.com/pnpm/action-setup) from 4 to 6.
- [Release notes](https://github.com/pnpm/action-setup/releases)
- [Commits](https://github.com/pnpm/action-setup/compare/v4...v6)

---
updated-dependencies:
- dependency-name: pnpm/action-setup
  dependency-version: '6'
  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-29 06:59:35 +00:00
dependabot[bot] 9ef3311e18 chore(deps): bump actions/setup-node from 4 to 7 (#63)
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-29 06:44:48 +00:00
GandClaude Opus 5 b4a9eba60f chore: add a dependency watcher (#62)
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>
2026-08-29 06:23:39 +00:00
GandClaude Opus 5 43839dda7e chore: retire the maonakamoto handle (#60)
The account was renamed to `catomean` and the repos then moved to the
`bitbaum` org, so `maonakamoto` now names nothing: github.com/maonakamoto
and maonakamoto.github.io both return 404, and @maonakamoto no longer
resolves as a user.

Three different targets, because these are not the same reference:
  repo links  -> bitbaum/<repo>   (the repos live in the org)
  the person  -> catomean        (profile links, @mentions, CODEOWNERS)
  pages site  -> bitbaum.github.io

Deliberately NOT changed:
  .mailmap keeps the old noreply address as an ALIAS. It is what maps
  historical commits onto the current identity; deleting it would
  silently unmap them. Only the canonical side moved to catomean.
  Files that explain the outage by naming the old account keep it,
  since the name is the content.

Files: .github/workflows/deploy.yml, .mailmap, scripts/ci/auto-merge-sweep.sh


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 08:24:54 +00:00
G 40af1fce20 ci: green PRs merge and deploy themselves (#10)
* 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:17:10 +02:00
GandClaude Opus 5 04eaf87dba ci: deploy on push to main (#9)
* ci: deploy on push to main

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>

* chore: declare pnpm 11.6.0 as the toolchain

The repo carries a pnpm-10+ style pnpm-workspace.yaml (allowBuilds, no
packages) but declared no packageManager, so CI had to guess the major
from the lockfile — and pnpm 9, 10 and 11 all write lockfileVersion 9.0.
Declare what actually builds it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* ci: drop the pnpm version pin — package.json is the SSOT

pnpm/action-setup refuses to run when the version is declared both in the
workflow and as packageManager in package.json. The repo should declare
its toolchain once, where both CI and the deploy pipeline can read it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore: declare Node 22 once, in .nvmrc

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>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-03 10:53:43 +02:00
GandClaude Opus 4.8 75d301ac45 ci(petvity): gate the build — make sitemap hermetic (force-dynamic + DB-resilient) (#7)
next build prerendered /sitemap.xml, which queried Postgres, so the build
couldn't run in CI without a DB and was deferred — a broken build could reach
main and only fail at deploy. Fix: the sitemap is force-dynamic (rendered per
request, never at build) and degrades to marketing paths on a DB blip instead
of 500ing. Build is now hermetic → un-deferred and gated in CI.

Verified: next build exit 0 with an unreachable DATABASE_URL; sitemap is now ƒ
(dynamic) not prerendered; tsc clean.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 11:05:45 +02:00
GandClaude Opus 4.8 41ee60c6d1 ci: converge on verify — one definition of the check bundle (#5)
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:03 +02:00
GandClaude Opus 4.8 c3db6574ed ci: add golden verification floor (#3)
* 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. pnpm+vitest — runs the 562-case suite that never ran on main.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: pin pnpm 11 (pnpm 9 chokes on settings-only pnpm-workspace.yaml)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: Node 22 (pnpm 11 needs Node >=22.13 for node:sqlite)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: defer non-hermetic build; floor = lint+typecheck+test (562 cases)

Build prerenders /sitemap.xml from Postgres — not hermetic. Deferred to a
postgres-service upgrade (revampit pattern). The test suite now gates main.

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:18 +02:00