8 Commits
Author SHA1 Message Date
CatoandClaude 3e68dcb9aa fix(db): the migration chain replays onto an empty database as committed (#192)
0032_chilly_shatterstar re-added six columns that 0029_team_participation
already added (invitations/memberships.permission_preset,
users.location/languages/skills/availability_type), so a fresh install that
applies the files as written stopped at 0032. Those six statements now read
ADD COLUMN IF NOT EXISTS; the definitions in 0029 and 0032 are identical,
so nothing is lost by skipping them.

Safe on production: the deploy's applier (loki apply-schema.sh) already
rewrites every ADD COLUMN to ADD COLUMN IF NOT EXISTS before running a
file, so the SQL it would run for 0032 is byte-identical before and after
this change (same sha256), and it never re-runs a tag already in
_deploy_schema_history anyway. Drizzle's own migrator compares only the
journal timestamp, which is unchanged.

scripts/ci/apply-migrations.sh drops its ADD COLUMN rewrite and applies
the committed files verbatim, so CI now catches a migration that only
replays with help.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 12:16:42 +01:00
CatoandClaude 93ab5ec70c ci(browser-smoke): prove an account can be made and used (#189)
A new `account` job in browser-smoke.yml drives real Chromium against the
production standalone server and a PostgreSQL built from the committed
migrations:

- sign up as a new organisation, finish onboarding (company info, business
  setup, start fresh) and land on the dashboard; the company, its onboarding
  stamp and the owner membership are checked in the database;
- sign out from the user menu; the session is gone and the dashboard asks
  for sign-in;
- a wrong password and an unknown email are refused, with no session;
- sign in and reach the dashboard;
- set a company AI key through the settings form, then check that the key
  field holds only the mask or nothing, that no response of the settings
  page carries the key, that it is stored sealed, and that saving with the
  mask keeps it (guards #185).

scripts/ci/apply-migrations.sh applies the chain to the throwaway database.
The committed chain does not replay onto an empty one (0032 re-adds six
columns 0029 added), so ADD COLUMN is read as ADD COLUMN IF NOT EXISTS; the
migration files are unchanged.

The journey stays on the sign-in page between attempts because /login
allows 10 requests a minute per address.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 11:29:28 +01:00
GandClaude Opus 5 181e7ef49b ci: call the central auto-merge sweep instead of carrying a copy (#44)
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>
2026-08-16 14:57:50 +00:00
G a03cf42e72 fix(ci): declare the failing-job list before the branch that can skip it (#42) 2026-08-07 09:58:08 +00:00
G 73085dfd0b fix(ci): a red base must not trap the PR that repairs it (#41) 2026-08-07 09:39:42 +00:00
G 9baddd5472 fix(ci): stop skipping conflicts, and keep branches current (#39) 2026-08-07 07:18:20 +00:00
GandClaude Opus 5 9250a25d49 fix(ci): drain the merge queue oldest-first, not newest-first (#37)
`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:44:28 +00:00
G 0c9774cfbf ci: green PRs merge and deploy themselves (#36)
* ci: add the auto-merge sweep policy

* ci: green PRs merge and deploy themselves

* ci: allow CI to be dispatched so auto-merge can re-arm it

* ci: allow deploy to be dispatched so an automated merge still ships
2026-08-05 19:16:59 +02:00