80 Commits
Author SHA1 Message Date
CatoandClaude a44fb929bd feat(auth): every way in on AccountKit's own screens (#655)
/auth/login, /auth/register and /auth/forgot-password are AccountKit's
forms: password, passkey, an email sign-in link, recovery, Sign in with
OrangeCat and the shared bitbaum sign-in, each when its env is set.
/dashboard/security carries AccountKit's account panel (password,
passkeys, two-step sign-in, linked sign-ins, deletion). compat passes
screens: 'accountkit' (AccountKit 0.20).

AccountKit is the only credential writer. evig's /api/auth/register,
forgot-password, reset-password and verify-email and
/api/user/change-password are removed: they shadowed AccountKit's
endpoints of the same names. Kept, as AccountKit hooks or evig's own code:
the per-account lockout, the 6-digit address code (it replaces
AccountKit's confirmation mail), IT-Hilfe's claim link (now an AccountKit
reset token, old links honoured), the team invitation claim, the HR hire,
staff permissions and referral credit. Deletion is refused for a super
admin and for a person on kept records.

Migration 143 (additive, idempotent) makes the panel's rename and
deletion reach users. The e2e job imports the seeded accounts before the
journeys and runs a browser journey through every method, with mail
caught by a sink.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 01:39:27 +01:00
CatoandClaude d71830833e refactor(auth): use AccountKit's compat layer instead of a local copy (#646)
The next-auth/react bridge, its call helper, the session plumbing, the
AUTH_RUNTIME switch, the import rehearsal script and the journey-test cookie
client were copies of code five products each carried. They now come from
AccountKit 0.18.0:

- @bitbaum/accountkit/auth/nextauth-compat answers next-auth/react. The
  product's compat.ts holds only what is its own: the session shape, how each
  password form signs in, its login codes and hooks.
- @bitbaum/accountkit/auth/switch: sharedRuntimeEnabled().
- `pnpm run db:rehearse-import` runs AccountKit's accountkit-rehearse-import
  on this product's import SQL.
- The journeys use @bitbaum/accountkit/auth/compat-testing.

Behaviour is unchanged with the switch off. With it on, a signed-out session
reads as null, and a resolver or hook failure is a readable refusal rather
than a 500. The real-database journeys pass unchanged.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 12:00:51 +01:00
CatoandClaude d2fb2a421b feat(auth): stage AccountKit beside Auth.js, switch off (#637)
evig moves from Auth.js to @bitbaum/accountkit one reversible step at a time.
This step adds everything the switch needs and changes nothing while
AUTH_RUNTIME is unset.

- Migration 142: AccountKit's tables under an `auth_` prefix, plus the
  users <-> auth_users mirror functions, inert until attached.
- scripts/db/accountkit-import.sql: copies accounts under their own ids,
  bcrypt hashes byte for byte, OrangeCat actor ids as `orangecat` rows,
  refuses drift or a live shared runtime, then attaches the mirror triggers.
  The rehearsal CLI always rolls back and prints only counts.
- src/lib/auth/shared/: the runtime (ids: 'uuid', legacy bcrypt), a session
  reader in evig's shape, re-read from `users` on every request, and a
  bridge that answers next-auth/react in evig's login codes, keeping
  evig's lockout. Proxy and change-password follow the switch.
- src/lib/auth/claims.ts: the staff/verification rule, written once and
  used by both runtimes. The jwt callback's three copies now call it.
- CI runs the rehearsal and the real-database journeys after the migration
  chain.

docs/ACCOUNTKIT-MIGRATION.md records what is left before switching, chiefly
the unverified-sign-in policy decision.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 06:32:19 +01:00
Cato e1b8814905 ci: one deploy per merge — stop re-arming the deploy the CI chain already starts (#606) 2026-10-27 23:59:00 +01:00
Cato f6848b03c7 ci: fast gate on main after a PR merge, per-commit concurrency (#605)
A squash merge onto main already passed the full verify on its pull request. Main now runs verify:main for a tip whose subject contains (#N) and keeps the full verify for pull requests and for main pushes without (#N).
2026-10-27 23:47:00 +01:00
Cato 2216bf0413 ci: attest and verify Evig deployed package artifacts (#604) 2026-10-27 18:20:07 +01:00
Cato 1f5d637c40 fix(deps): clear runtime security advisories (#590) 2026-10-25 15:00:55 +01:00
Catoandcatomean de5587314e ci: cut scheduled CI minutes (CI audit) (#579)
* ci: cut scheduled CI minutes (CI audit)

* ci: cut scheduled CI minutes (CI audit)

---------

Co-authored-by: catomean <catomean@users.noreply.github.com>
2026-10-21 20:37:06 +02:00
CatoandClaude be2f01859d docs: correct drift — evig host, /opt/evig box paths, email provider, CI smoke target (#573)
- Production host is evig.orangecat.ch everywhere a doc presents the current
  address; revampit.orangecat.ch is the retired 308 redirect.
- Box was renamed /opt/revampit -> /opt/evig (systemd evig-app, evig-cron@*,
  evig-backup, scripts/selfhost-deploy-evig.sh); docs and the Layer B list
  still named the old paths and a deploy script that no longer exists.
- CLAUDE.md claimed auth-smoke/inventory-smoke target the old host; CI now
  defaults PLAYWRIGHT_BASE_URL to evig.orangecat.ch, so the redirect has no
  CI coverage. Say so.
- Local dev DB is the Docker Postgres on 5433, not Neon.
- Email is Resend first (src/config/email.ts), not Listmonk/Brevo.
- README: no "Swiss-compliant donation receipts" while in formation; real
  test layout, eight locales, actual CI jobs.
- CONTRIBUTING / PR template / REVIEW: evig name, pnpm, Node 22.13+,
  messages/ path; no donate link to Revamp-IT.
- ARCHITECTURE_QUICK_START: drop the example that granted staff by e-mail.
- Payment setup docs: canonical webhook URLs plus a note on providers
  configured before the rename.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 12:51:27 +02:00
CatoandClaude c4bfefc850 fix(protocols): the source picker opens a phone's file browser, not a capture-app chooser (#537)
SourceUploader's input asked for audio AND text extensions at once
(getAcceptString). Android answers a mixed accept with a chooser of capture
apps (Camera, Recorder, "Photos & Videos") and no file browser, so a meeting
recording or a notes file could not be picked from a phone. The input now
has no accept — the plain file browser — and classifyFile still rejects
anything unsupported after the pick, with the existing German message. The
one-drop-zone design stays.

getAcceptString existed only to build the mixed list and is removed; its
tests become one that pins the picker to no mixed accept.

dependabot: @bitbaum/* packages arrive grouped as one PR when they release.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-07 04:54:52 -07:00
Cato cd5dec1a20 perf(ci): deploy evig after CI completes (#505) 2026-09-23 14:03:38 -07:00
CatoandClaude Opus 5 65ed27a08c fix(e2e): stop shipping the two E2E login addresses as defaults (#491)
The E2E personas are real accounts on a real deployment, and every place
that needed one carried it as a literal in a public repo: a fallback in
scripts/e2e-inventory-prod.sh, four `|| '...'` defaults across the e2e
specs and their auth helper, a workflow header comment, and two docs
tables. The repo therefore published whose accounts they are — and the
defaults were dead weight besides: CI has supplied both addresses from
the repository secrets of the same name since they were created, so the
literals were an unreachable branch that only ever leaked.

Now there is no default anywhere. The addresses come from
AUTH_TEST_USER_EMAIL and AUTH_TEST_ADMIN_EMAIL, both existing repo
secrets, and the absence of one is an error rather than a quiet
substitution:

- scripts/e2e-inventory-prod.sh requires both with `:?` naming the
  secret. The "no passwords configured, skip" path still runs first, so
  an unconfigured checkout is unaffected.
- The two consuming jobs guard first and fail with `::error::` naming
  the missing secret, instead of dying inside bash or playwright.
- The specs skip a persona when its address is unset, the same way they
  already skip on a missing password, rather than attempting a login
  with an empty e-mail and reporting it as a broken page.

Unchanged: the e2e-local job, which sets all four addresses to its own
seeded @evig.test fixtures at job level, so the defaults were never
reached there either.

Not addressed here, and still in the tree: the owner's address in the
SUPER_ADMIN_EMAILS allowlist (plus its assertions and the applied SQL
migrations that reference it), and the public contact address in
src/config/org.ts, which is published on purpose. Those are identity and
data, not E2E credentials, and removing them is a separate decision.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 03:27:12 -07:00
CatoandClaude Opus 5 1eedb5ca56 fix(deploy): point the deploy scripts at the file that exists, and stop naming two mailboxes (#490)
Two leftovers from the revampit -> evig rename and from #489.

1. `npm run deploy` and `deploy:selfhost` both ran
   `scripts/selfhost-deploy-revampit.sh`, which does not exist — the file is
   `scripts/selfhost-deploy-evig.sh`. Both scripts failed immediately. There is
   only one deploy script in `scripts/`, so there was nothing to choose between.
   The workflow already called the evig-named file directly, which is why CI
   deploys kept working and only the local command was broken.

2. The deploy workflow's setup comment named two personal email addresses next
   to their password secrets. #489 had just moved those same addresses out of
   `src/config/e2e-test-accounts.ts` into `E2E_TEST_ACCOUNT_EMAILS` precisely so
   this public repo stops publishing them; a comment republished them anyway.
   The comment now says what each secret is and which env var carries the
   address, so the setup is still explained without the values.

Verified: `bash -n` on the deploy script; both npm scripts resolve to a file
that exists; package.json still parses and the workflow still parses; prettier,
lint:docs, lint:ops and test:ops all pass. The deploy script was NOT run — it
has no dry-run mode and would rsync and restart the service.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 02:47:55 -07:00
CatoandClaude Opus 5 f71ad23316 chore(config): stop duplicating the box IP, the old repo path, and the retired host (#489)
Five literals that each duplicated a fact owned somewhere else, or named
something that no longer exists.

1. packages/saldo/package.json — `homepage` pointed at
   `revampit.orangecat.ch/saldo`. That host is retired: the organisation renamed
   to evig, the canonical host is `evig.orangecat.ch`, and this repo's own
   `src/config/urls.ts` and `.env.selfhost.local.example` already say so. A
   published package's homepage is the one copy that would outlive the Caddy
   redirect keeping the old name alive.

2. scripts/setup-deploy-keybind.sh — the generated trigger script baked
   `PROJECT_DIR="/home/g/dev/revampit"`, wrong twice over: it names one
   developer's laptop, and it names the repo by a directory it no longer uses.
   The checkout knows where it is, so ask it: PROJECT_DIR is now derived from
   the setup script's own resolved location (`scripts/` -> repo root), which is
   the same root the rest of the file already assumes. The heredoc had to become
   interpolating for that, so the generated script's own `$PROJECT_DIR`
   references are escaped to stay literal. Verified by running it: the generated
   file lands on the parent of `scripts/`, and `bash -n` passes on both.

3+4. The Hetzner box IP was written out twice — `ssh-keyscan -H 167.233.22.31`
   in .github/workflows/deploy-selfhost.yml and
   `BOX="${BOX:-ubuntu@167.233.22.31}"` in scripts/selfhost-deploy-evig.sh — for
   one fact that already has an org-wide definition: the `HETZNER_IP` Actions
   variable (visibility: all). Both now read it, the workflow passing it to the
   script through the job env.

   Each end fails LOUDLY rather than proceeding on an empty value.
   `ssh-keyscan -H ""` writes nothing and exits 0, so an unset variable would
   have produced a deploy that died much later with an unhelpful host-key error;
   the step now emits `::error::` and stops. The script uses `${HETZNER_IP:?…}`
   so it refuses to guess a target. Setting BOX explicitly still overrides both,
   for a one-off host. Proved by mutation: unset -> exit 1 with the message;
   set -> ubuntu@<ip>; BOX set with HETZNER_IP unset -> BOX wins.

5. src/config/e2e-test-accounts.ts held two real personal addresses as a shipped
   `as const` array. That published who they were in a public repo and made
   changing them a release. The list is configuration: it now comes from
   `E2E_TEST_ACCOUNT_EMAILS` (comma-separated) and defaults to EMPTY.

   Empty is the safe direction and the reason this is not a behaviour risk: the
   list only ever RELAXES a rate limit, so an unset variable means nobody is
   exempt — the strict path every other account already takes. The opposite
   default would trust an address nobody configured on every deployment of this
   code. It is read at call time, not module load, so the value cannot be
   snapshotted before the environment is populated. This follows the direction
   scripts/e2e-inventory-prod.sh already took when it dropped its own hardcoded
   account default.

   OPERATIONAL NOTE: until `E2E_TEST_ACCOUNT_EMAILS` is added to `SELFHOST_ENV`,
   the prod dual-persona smoke runs under normal rate limits. Documented in
   .env.example and .env.selfhost.local.example.

   The test asserted the hardcoded list's length, which is no longer a property
   of the source. It now sets the variable itself with fictional fixture
   addresses — a test naming a real person's mailbox is the same leak the source
   just stopped committing — and adds the two cases that matter most: unset and
   empty must both exempt nobody.

Deliberately NOT touched: src/config/org.ts DEFAULT_CONTACT_EMAIL. The comment
above it records that the gmail address is a live decision because evig.ch is
not registered and the previous address bounced.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 01:57:08 -07:00
dependabot[bot] 4e072a1ee7 ci: Bump actions/cache from 4 to 6 (#477)
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-13 23:19:27 -07:00
CatoandClaude Opus 5 e70ddee070 ci(auto-merge): hand the sweep a PAT so workflow PRs stop stalling (#467)
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 16:07:03 +00:00
CatoandClaude Opus 5 1a5bf15cc8 ci(deploy): require CI's green instead of rebuilding it; stop cancelling deploys (#465)
Measured on 2026-09-07, this repo built the SAME commit four times per merge:

  1. CI  -> Code Quality -> `verify`            9.6m step (verify includes build)
  2. CI  -> Local E2E Journeys -> "Build app"   4.0m
  3. Deploy -> `pnpm run verify`                concurrent with (1), same SHA
  4. Deploy -> selfhost-deploy-evig.sh          the build that actually ships

Only (4) produces the artifact. (3) is deleted here and replaced by a gate that
REQUIRES CI Pipeline to be green on this commit.

That is not a weaker gate. The old step's comment was right that an earlier
version had been weaker — but because it re-inlined a SUBSET (no lint:chrome,
i18n only), not because it ran a second copy. Depending on the full bundle
passing once gives identical coverage without building the commit again.

The gate has three outcomes: green -> deploy; red -> fail loudly; superseded
(main moved past this commit) -> skip, because the newer commit's deploy ships
this change too. It fails closed on timeout.

Second change, and the one worth having on its own: cancel-in-progress: false.
Of this repo's last 10 deploys, 4 were CANCELLED — 40%, against 0% for all
seven other repos measured. This repo is the only one that sets cancel-on-push,
and it also has the fleet's longest deploy, so any merge inside a ~13-minute
window kills the running one. Three cancelled each other in a row this
afternoon and a merged fix needed three attempts to reach production.
Cancelling is only safe if the newer run is guaranteed to finish. Queuing plus
the supersede check gives the intended behaviour with no lost deploys.

`Mark deployed` now carries the gate too — it is what starts the prod smoke
job, and a superseded run deployed nothing. Smoke-testing a release this run
never made reports the failure against THIS commit, blaming a change that
never shipped.

Third: CI now caches .next/cache for both of its builds. The deploy workflow
already did; CI never has, which is why CI was the slower of the two. Keys are
per-job so the two builds do not evict each other, with shared restore-keys.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 06:27:17 -07:00
d2662cfe22 chore(pnpm): convert to pnpm 11 (#446)
* chore: pnpm — the fleet has one package manager

- packageManager pnpm@11.25.0; lockfile via pnpm import, package-lock.json gone
- npm overrides moved to pnpm-workspace.yaml overrides (pnpm ignores
  package.json overrides); allowBuilds for @parcel/watcher, @sentry/cli,
  @swc/core, esbuild, puppeteer, unrs-resolver, and the ai-forms git dep
  (pnpm requires the exact resolved URL for git-dep prepare builds)
- @tiptap/core added as a direct dependency: RichTextEditor.tsx augments
  'module @tiptap/core' and tiptap-markdown's Storage augmentation rides on
  it — a phantom dependency npm's hoisting hid and pnpm's isolation exposed
- all workflows: pnpm/action-setup@v6 before setup-node, cache: pnpm,
  store-dir pinned, pnpm install --frozen-lockfile; Next cache key now
  hashes pnpm-lock.yaml
- scripts/ci/dependency-audit.sh: pnpm audit --prod (parses both npm-v2
  'vulnerabilities' and pnpm's v1 'advisories' shapes)
- selfhost-deploy-evig.sh, ship.sh, start-all.sh, e2e-inventory-prod.sh,
  husky pre-commit, Dockerfile.prod (node 24 + corepack) converted
- engines: node >=22.13

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

* fix(deps): declare espree — eslint.config.mjs imports it directly

npm's hoisting provided it as a phantom; pnpm's isolated node_modules
exposed ERR_MODULE_NOT_FOUND in CI. Verified in a true clean room
(parent node_modules masked): full verify green, 7783 tests.

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

* fix(deps): declare tsx — npx fetched it on demand, pnpm exec does not

e2e:seed (and the hirn:*/setup-admins scripts) ran 'npx tsx', which
silently downloaded tsx because it was never in devDependencies. pnpm
exec only resolves installed bins, so CI's Seed E2E step died with
'Command tsx not found'. Declare it.

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

* fix(ci): drop '--' separators — pnpm run forwards them verbatim

npm strips the first '--' before handing args to the script; pnpm 11
passes it through, so 'pnpm run start -- -p 3001' executed
'next start -- -p 3001' and next read '-p' as a project directory.
pnpm forwards everything after the script name anyway, so the
separator is dead weight: remove it in ci.yml (start, e2e journeys,
e2e guards) and ship.sh.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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 12:06:36 +00:00
d6c2d107a2 refactor(deps): ai-kit comes from npm — @bitbaum/ai-kit ^0.6.2 (#437)
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 01:12:06 +00:00
ba754f6508 chore(deploy): rename revampit infra references to evig (#430)
* chore(deploy): rename revampit infra references to evig

The GitHub repo was renamed revamp-it -> evig a while back and the
domain/Caddy layer already points at evig.orangecat.ch (with a 308 from
the old revampit.orangecat.ch), but the self-host deploy pipeline was
still targeting /opt/revampit and the revampit-app systemd unit. Renamed
the deploy script, CI's throwaway fixture names, and the smoke-test
default URLs to match. The systemd unit + /opt directory on the box were
renamed to evig-app / /opt/evig directly, verified live (200 before and
after).

Left untouched: production database names/users (revampit_cms etc. in
rollback-production.sh, monitoring-setup.sh, check-services.sh) and the
revampit-cron@*.timer / revampit-backup units — those are a separate,
higher-stakes rename.

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

* chore(deploy): point deploy pipeline + CI fixtures at evig, not revampit

The GitHub repo was renamed revamp-it -> evig a while back and the
domain/Caddy layer already points at evig.orangecat.ch (with a 308 from
the old revampit.orangecat.ch), but the self-host deploy pipeline was
still targeting /opt/revampit and the revampit-app systemd unit. Updates
the deploy script's NAME var, CI's throwaway fixture names/emails, and
the smoke-test default URLs to match. The systemd unit + /opt directory
on the box were renamed to evig-app / /opt/evig directly, verified live
(200 before and after, zero downtime).

Left untouched: production database names/users (revampit_cms etc. in
rollback-production.sh, monitoring-setup.sh, check-services.sh) and the
revampit-cron@*.timer / revampit-backup units — those touch live data
and a schedule (one timer looks like it releases escrow), so they're a
separate, higher-stakes rename flagged for a deliberate go/no-go rather
than folded in here.

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

* fix(docs): point deploy-script docs at the renamed evig script

The rename to scripts/selfhost-deploy-evig.sh left 5 docs pointing at the
old filename, tripping the docs-paths CI gate (stale count rose 68 -> 73).
Fixed the references; net stale count actually fell to 65, so lowered the
baseline in the same PR per the gate's own instruction.

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

* fix(ci): correct the docs-paths baseline back to 68

My previous commit set this to 65 based on a local run that was reading a
dirty working tree (leftover untracked files were falsely satisfying 3
path checks). Verified against a truly clean clone of this branch: the
real count, after the doc-path fixes, is 68 — unchanged from main, since
this PR only touches the 5 revampit->evig references and leaves the
pre-existing unrelated stale docs alone.

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

---------

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-02 10:37:38 +02:00
456c402002 chore(deps): dependabot must not manage the ai-kit git pin (#426)
dependabot cannot order git tags: on 2026-08-31 it proposed v0.6.2 -> v0.4.0
as a bump — a downgrade that would have removed the registry, the grounding
harness, and the CJS twin from this app had auto-merge taken it. The pin is
governed by the fleet's version-currency ratchet (bitbaum/fleet,
blessed-versions.json); dependabot now ignores ai-kit here.


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-08-31 19:19:30 +02:00
569e912d84 chore(ci): CI and .nvmrc follow the box to Node 24 (#427)
The box ran Node 20 four months past EOL; it moved to 24.20.0 today with
every service health-verified. CI validating on 20 now validates against
a runtime nothing uses.


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-08-31 18:57:33 +02:00
GandClaude Opus 5 a21d8906af chore: add a formatter, and close a CSS comment that was never closed (#419)
* 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, and close a comment that was never closed

The formatter refused this repo outright, which turned out to be a real defect
rather than a tooling complaint. kivitendo-intake.css opens a header comment,
and line 17 contains an inner /* ⚠ PRÜFEN */ — CSS comments do not nest, so
that inner terminator CLOSES the header. Everything after it is parsed as CSS
until the stray */ on line 20. A browser mis-parses it the same way.

The file exists in two places (public/presentations/ and deliverables/), both
carrying the same defect; fixing one still failed the gate, which is how the
duplicate surfaced at all.

Mechanical otherwise. This SHA is listed in .git-blame-ignore-revs.

* chore: teach git blame to skip the reformat

* fix: undo a 3-way merge duplication in AdminSidebar.tsx

Merging main with -X theirs duplicated a 30-line block: main's currency-sweep
commit and this branch's prettier reformat both touched overlapping lines in
the single-destination-group render path, and the -X theirs strategy inserted
rather than replaced, leaving two near-identical copies and a dangling closing
brace — SyntaxError: ',' expected at line 298.

The branch has no legitimate change to this file's logic, only formatting, so
main's content is correct outright. Took it wholesale rather than hand-editing
the merge result.

* fix(lint): reattach 5 directives the reformat detached

Four eslint-disable-next-line sites for react-hooks/set-state-in-effect and one
@ts-expect-error, all the same defect: the directive sat above useEffect( (or
above a JSX element), while the statement that actually errors is 1-2 lines
further down inside the block. eslint/tsc report at the real statement; the
directive, still bound to its original line number, protects nothing there.

TimecardReviewDrawer.tsx (x2), DataEntryTabs.tsx, AppointmentBookingForm.tsx,
CreatePoolModal.tsx. Same root cause documented for hirnli, fleetcrown and
ivy-portal earlier today — a positional directive is a hidden dependency on
formatting, and this is the fourth distinct shape it's taken.

* fix(i18n): restore a same-line audit-exemption marker

Fifth shape of today's positional-directive defect, this time the repo's own
i18n-hardcoded-audit convention rather than eslint or tsc: a // i18n-ok comment
exempts a hardcoded string only when it trails the SAME line. prettier wrapped
this one if-statement's long condition onto its own line, leaving the marker
on the return statement below — the exact sibling one line down
('fortgeschrittene bis experten') stayed on one line because it was short
enough not to wrap, and it alone kept passing.

Restored the one-line form and added // prettier-ignore so a future reformat
cannot re-split it. Verified against the real audit script locally: 0 new
violations.

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 13:35:50 +00:00
GandClaude Opus 5 0c0a620b41 docs(ci): the sweep lives in bitbaum/fleet, not dotfiles (#404)
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


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 14:05:19 +02:00
GandClaude Opus 5 534e7254f8 chore(ci): call the auto-merge sweep from bitbaum/fleet (#403)
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>
2026-08-28 10:41:10 +02:00
GandClaude Opus 5 2cfc2facdd fix(ci): point Actions at the bitbaum org, so merges and deploys resume (#402)
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


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 08:13:09 +02:00
Mao Nakamoto a816317a4b chore(ci): GitHub owner maonakamoto -> catomean 2026-08-27 19:11:24 +02:00
GandClaude Fable 5 4553102879 test(e2e): wire three never-run specs into CI, and make the security one real (#377)
* test(e2e): wire three never-run specs into CI, and make the security one real

The e2e-local job runs 'tests/e2e/*journey.spec.ts'. Nine specs are not
named *journey, so nothing ran them — anywhere, ever. I ran all of them
against a locally seeded instance before wiring any, which is the only
reason this PR is three specs and not nine.

Wired (41 assertions that were running nowhere):
  security            4 tests — rewritten, see below
  notification-hrefs  21 assertions, green as-is
  user-admin-flows    16 assertions, green after one fix

security.spec.ts was a STUB and wiring it as-written would have been
worse than leaving it out: two of its four tests had comment-only bodies
('Would need to fill and submit form 6 times'), a third asserted only
inside an isVisible() branch, and every one called test.skip() when
redirected to login — which /it-hilfe/create always does signed out. In
CI it would have reported a green 'security' check while exercising
nothing. It now asserts the closed side of the authorization boundary: no
admin page renders and no admin/money API answers 2xx to a signed-out
request, and a refused response carries no user data. Proven by mutation
— adding a public route to the protected list turns it red.

user-admin-flows addressed routes as /de/x. The app 307-redirects those
to /x, and when that races the client router Playwright aborts the
navigation (net::ERR_ABORTED) — indistinguishable from a broken page.
It cost three wrong hypotheses (concurrency, then state residue, then a
fresh database) before I read the error. Now uses the canonical paths,
which is where the redirect lands and what users actually see.

NOT wired, with reasons rather than silence: marketplace, it-hilfe,
appointments, payment-return and timecards fail against the current app —
marketplace expects an h1 of 'Marketplace' and the text 'gebrauchte
IT-Geräte', which is pre-rebrand Revamp-IT copy. dashboard-timecards
skips its only test. Specs nothing runs rot; these did. Recorded in
docs/AUDIT_BACKLOG_2026-08.md.

Verified: 3 consecutive green runs of the bundle, typecheck, lint, docs gate.

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

* docs: record which never-run E2E specs rotted, with the triage evidence

Three are now wired; the other six are not, and the table says why rather
than leaving a silent gap. marketplace expects pre-rebrand copy, and
dashboard-timecards skips its only test. it-hilfe is the best next
candidate — 10 of its 14 tests already pass.

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

* fix(e2e): the signed-out security spec was running signed IN

CI rejected the previous commit and it was right to. playwright.config.ts
sets storageState globally, so every context — the page AND the request
fixture — inherits a saved login unless a spec says otherwise. My
'authorization boundary (signed out)' tests therefore ran authenticated:
/api/invoices, /api/admin/users and /api/admin/refunds all answered 200,
and the spec reported the doors were open.

They passed locally only because no saved-session file exists there. That
is the worst kind of green: right answer, wrong reason, and dependent on
which machine you run it on.

Both specs now force an empty session explicitly. For security.spec.ts
that line IS the test — a signed-out check carrying a session asserts
nothing about the closed side of the boundary.

Same root cause fixed notification-hrefs: it probes whether a ROUTE
exists using a dummy UUID matching no record. Signed out, an auth
redirect answers that without touching the database. Signed in, the admin
page renders and correctly 404s on the missing record — so it reported
'notification deep link is broken' when nothing was broken.

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

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-25 16:32:41 +02:00
GandClaude Fable 5 1f03185863 fix(deploy): one migration order for all three runners, and stop the prod fail-open (#359)
Migrations were enumerated three different ways. run-migration.sh sorted
-V with no skip list, apply-migrations-ci.sh sorted -V WITH one, and the
production deploy used a bare glob — lexicographic, which orders the
005* duplicates the opposite way. So the order production would use in a
disaster-recovery rebuild was the one order CI never replayed, and a
from-scratch local DB died on a duplicate CI had been skipping for
months. scripts/db/migration-order.sh is now the only enumeration.

The deploy also read schema_migrations with '|| true'. An empty answer
does not mean 'nothing applied', it means 'could not look' — and the
loop treats every unlisted file as pending, so one ssh blip would have
re-applied ~150 migrations to the live database. It now fails closed.

Also:
- deploy-selfhost.yml re-inlined four checks instead of calling verify,
  making the DEPLOY gate weaker than the MERGE gate (no card-shell
  ratchet, i18n subset instead of the full suite). Calls verify verbatim.
- .gitignore had a blanket *.sh + hand-kept negations, so every new
  script under scripts/ was invisible to git — it commits clean, then CI
  fails on a file that exists on one laptop. Anchored to the repo root.
- 5 dev-only packages sat in dependencies, where dependency-audit.sh
  (npm audit --omit=dev) reports an ESLint advisory as a runtime
  critical. Moved to devDependencies.
- dependabot: groups for the next / next-auth / tailwind / eslint / jest
  lockstep families, and @types/node major pinned to the runtime major
  (Node 20) — PR #356 was closed for exactly that.
- Untracked 2.7 MB of committed Jest output and a .bak dropping.

Verified: from-zero CI replay green (133 applied), local runner green
from a fresh DB (149 applied — it could not complete at all before),
lint 0 errors, typecheck clean, 7798 tests.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-24 16:56:55 +00:00
GandClaude Fable 5 8bef2c4eb3 ci(deps): dependabot must bump the react family as one PR (#335)
react-dom and the @types packages peer-pin react's major, so a half-bump
cannot even npm ci — #313 burned four CI rounds proving it. Same never-twice
rule as the tiptap group (#323).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-20 17:09:17 +02:00
GandClaude Fable 5 4e117f9189 deps: tiptap moves in lockstep or not at all (#323)
Dependabot bumped @tiptap/starter-kit (#317) and @tiptap/pm (#320) in
separate PRs. tiptap's packages pin each other with exact peer ranges and
share one TypeScript module augmentation, so a partial bump erases
toggleBold/undo/redo etc. from ChainedCommands and typecheck fails — #317
re-failed identically after a fresh rebase, proving the split itself is the
defect.

This bumps all five @tiptap/* packages to 3.30.2 together (verify green:
lint + umlauts + typecheck + test + build), and adds a dependabot `groups`
rule so every future tiptap update arrives as one PR — the broken shape
can no longer be proposed.

Supersedes #317 and #320.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-20 14:14:38 +00:00
GandClaude Opus 5 c27a404ae2 ci: call the central auto-merge sweep instead of carrying a copy (#310)
* ci: call the central auto-merge sweep instead of carrying a copy

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>

* test(ci): the sweep tests moved to dotfiles with the script they test

These two suites drove scripts/ci/auto-merge-sweep.sh directly, so deleting the
local copy of that script left them pointing at nothing — CI failed with
"Test Suites: 1 failed, 533 passed".

They were not dropped. This repo was the ONLY one in the fleet with tests for
the sweep, and centralising the code while discarding the only evidence it
behaves would have been the worst possible trade. They are ported to bash and
now run in maonakamoto/dotfiles CI against the canonical script
(scripts/ci/test-auto-merge-sweep.sh), where they cover every repo that calls
it rather than just this one.

Same six cases, same reasoning: re-run a cancelled or infra-failed base run,
never re-run a genuine failure, stop at the attempt cap, still reach the PR loop
when the base is green. They were also mutation-tested there — disabling the
re-run turns the two dependent cases red — because a suite that has only ever
passed is indistinguishable from one that asserts nothing.

Net effect: the coverage this repo wrote now defends twenty-two repos instead of
one.

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

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 16:22:45 +00:00
GandClaude Opus 5 2e1d652334 test(ci): stop discarding the unit suite, and repair the 25 assertions it hid (#306)
* test(ci): stop discarding the unit suite, and repair the 25 assertions it hid

The unit-test job has carried `continue-on-error: true` since the day it was
added, labelled "non-blocking while suite matures". The suite matured to 7,769
tests across 532 files and nobody flipped it back, so CI ran the whole thing on
every PR and threw the answer away.

That is not a dormant gate, it is an active lie: an absent gate is visibly
absent, while a discarded one manufactures a green check. The bill came due on
2026-07-28. Commit 285b2eb86 moved status badges from the raw `primary-*` lime
scale to the `success-*` token — a correct, careful, purely mechanical rename.
Its own message reports "verify green (typecheck 0, lint 0, 90/90 unit tests)"
and says it updated 3 test suites' colour assertions. There were 15. The other
12 have been failing ever since, 25 assertions in total, because:

  - `verify` did not run `test`, so the local signal was green, and
  - CI did run `test`, and discarded the result, so the shared signal was green.

Both gates were open at once, which is why three weeks of PRs sailed past a
suite that had 25 known-failing tests in it.

What this changes:

  - `continue-on-error: true` removed from the unit-test job. It gates now.
  - `npm run test` added to `verify`, so the local bundle mirrors CI — the
    floor in dotfiles/templates/ci/README.md is lint && typecheck && test, and
    this repo was running three of four.
  - `timeout-minutes: 20` on the job, which had none.
  - the 25 stale assertions updated from `primary` to `success`, plus 5 test
    NAMES that still said "primary" for a colour that is now success.

The assertions were rewritten only at the exact lines jest reported, never by a
global sed: `primary` remains a legitimate brand token in these same files, and
a blind replace would have silently retargeted assertions that currently pass.

Two things deliberately NOT changed, having checked whether the sweep caused
them — it did not, they predate it:

  - FOLLOW_UP_STATUS_COLORS maps 'erledigt' and 'in Arbeit' to byte-identical
    classes, so done and in-progress are visually indistinguishable.
  - CATEGORY_STYLES gives repair, data and recycling the same `success-600`,
    while software is purple.

Both were already identical as `primary-*` before 285b2eb86, which was a pure
one-for-one rename. Fixing them means choosing colours, which is a design call,
not a green-the-build call. Recorded here rather than silently normalised.

Verified against a clean `npm ci` tree: lint (0 errors, 48 warnings), umlauts,
typecheck (0), and the suite itself at 532/532 files and 7769/7769 tests, exit
0. The first attempt ran against a symlinked node_modules borrowed from another
worktree and produced 8 phantom module-resolution errors — a lesson about
trusting a dependency tree you did not install.

`build` is the one step NOT verified locally: src/app/layout.tsx pulls three
families from next/font/google, which downloads at build time, and this sandbox
has no outbound network. CI builds it. Nothing here touches the build path —
the changes are test assertions, one package.json string, and ci.yml.

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

* test: pin the suite's timezone so a Swiss laptop and a UTC runner agree

Closing the gate in the previous commit immediately surfaced a SECOND class of
failure it had been hiding: 6 date tests that pass in Europe/Zurich and fail in
UTC. They have been failing on every CI run since they were written, and were
invisible for the same reason the 25 colour assertions were — the job discarded
its own result.

src/lib/date-formats.ts deliberately renders every timestamp in Europe/Zurich;
without a fixed timeZone a server-rendered 15:00 workshop displays 1-2h off.
That part is correct. The tests are what is non-deterministic: they build
reference dates with `new Date(2026, 4, 15, 14, 30)`, which is the RUNNER's
local time. On a Swiss laptop that is 14:30 Zurich and formats to "14:30"; on a
UTC runner it is 14:30 UTC, which formats to "16:30".

So the same assertion meant two different things depending on who ran it, and
the machine that ran it most often was the one whose answer nobody read.

Pinned in jest.config.js rather than in each npm script: test, test:watch,
test:coverage and test:i18n all load that config, and jest's workers inherit
the env set at config-load time. One place, not four.

Verified by reproducing CI's environment locally:

  TZ=UTC, pin disabled -> 6 failed, 41 passed  (exactly CI's 6)
  TZ=UTC, pin enabled  -> 47 passed
  TZ=UTC, full suite   -> 532/532 suites, 7769/7769 tests, exit 0

The negative case matters as much as the positive one: a fix that is only ever
run in the environment where the bug does not reproduce proves nothing.

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

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 12:11:23 +02:00
GandClaude Opus 5 8e49adc7eb perf(ci): let the prod smoke jobs start immediately instead of waiting on quality (#304)
#303 removed the false `needs:` on the e2e job and CI went 709s -> 634s — less
than predicted, because a second layer of the same defect was hiding behind the
first. With e2e unblocked, the critical path became:

  quality 429s -> inventory-smoke 181s = 610s of a 634s run

Neither smoke job has any reason to wait. Both test the ALREADY-DEPLOYED
production site (https://revampit.orangecat.ch) — they never build this branch,
download no artifact, and read no `needs.*` output. `needs: quality` on them was
a preference for ordering, paid for in wall-clock on every push.

Measured, run 31901402584 (main, after #303):
  quality           429s   starts +0
  e2e-local         400s   starts +0
  inventory-smoke   181s   starts +435   <- waited for quality
  auth-smoke         73s   starts +434   <- waited for quality
  migrations         39s   starts +0
  security           38s   starts +0
  total                    634s

Expected after: critical path collapses to quality alone, ~450s.

`post-main` keeps its `needs:` — it reads `needs.<job>.result` to compute the
run verdict. That is a real dependency, not ordering.

Trade-off, stated: the smoke jobs now run even when lint fails, so a broken PR
spends those runner minutes instead of being cut off. Same trade as #303 — all
verdicts at once rather than in sequence.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 07:27:10 +00:00
GandClaude Opus 5 29ed599101 perf(ci): let the e2e job start immediately instead of waiting on quality (#303)
`e2e-local` declared `needs: [quality, migrations]` but consumes nothing
from either. It brings its own postgres service, applies its own
migrations, seeds its own data, builds the app and starts its own server.
Both entries were gates written as dependencies.

Measured on the last green master run:

    quality (Code Quality Checks)   373s
    migrations (drift check)         34s
    e2e-local                       336s   — started at t+373

so CI took 709s to reach a verdict it had all the information for by
~373s. Removing the false dependency makes `quality` the critical path
and roughly halves wall-clock, at zero extra runner cost.

`needs:` should mean "I use what that job produced", not "I would rather
run after it". Every job stays a required check either way — ordering and
gating are separate concerns, and conflating them is what cost the 373s.

Trade-off, stated: a PR that fails lint now also spends the e2e minutes
instead of being cut off early.

Not changed, because it was measured and does not pay: the Playwright run
itself is only 56s of that 336s job (the rest is a 181s `Build app`), so
raising `workers` above 1 here would buy ~30s and add parallel-flake risk
for it. Same config flag as aoz-housing, opposite verdict — the number is
what decides, not the pattern.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-15 18:32:23 +00:00
dependabot[bot] c0ebe49231 ci: bump actions/setup-node from 4 to 7 (#290)
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-10 06:39:30 +00:00
GandClaude Opus 5 b8c390d1ad fix(ci): make the main-red alarm agree with the merge gate (#282)
The alarm and the auto-merge green-base guard disagreed about what "main is
green" means, and the alarm was the wrong one.

The guard reads the RUN's conclusion, which every job contributes to. The
alarm recomputed its own verdict from a hand-written needs: list that left out
`migrations` and `test`, and treated `cancelled` as a benign non-event.

On 2026-08-07 an Actions incident cancelled Migration Drift on main. The run
concluded `failure`, auto-merge refused every merge for ~14h, and the alarm —
blind to that job, and forgiving of cancellation anyway — concluded `success`
and filed nothing. The queue was stopped and the thing built to announce that
stayed silent.

Two changes, both narrowing the alarm to the question that actually matters
("is main blocking the queue?"): depend on every job, and count anything that
is not success-or-skipped as red. A cancelled job blocks PRs exactly as hard
as a failing one.

The needs: list is hand-maintained and has now drifted once, so it gets a test
rather than a promise: it asserts the list covers every job in the file, that
each one is wired into the verdict env, and that `cancelled` is not carved back
out. Mutation-checked against the pre-fix list.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 21:43:16 +02:00
GandClaude Opus 5 c849d6c596 feat(ci): make a dependency advisory turn something red (#278)
Three CRITICAL auth advisories sat open against the live site today and
nothing in CI was red. They surfaced only because `git push` happened to
print GitHub's "found 10 vulnerabilities" banner, which is not monitoring.

Cleared the two remaining runtime highs first, both instances of the same
trap that hid the auth critical — a patched copy hoisted while a vulnerable
one survives underneath:

- postcss was declared ^8.5.10 in devDependencies AND in overrides, so it
  resolved to 8.5.15, below the 8.5.23 that patches the source-map path
  traversal. Raised both to ^8.5.26.
- sharp: the root had a patched ^0.35.3, but next pinned ^0.34.5 and got its
  own nested vulnerable copy (libvips CVE-2026-33327 et al). Added the
  `"sharp": "$sharp"` override so the nested copy resolves to the root's.
  This removes 26 duplicate platform binaries from the lockfile.

npm audit is now clean at every severity, dev included.

The check itself, in scripts/ci/dependency-audit.sh, has two callers:

- ci.yml `security` job — blocks a PR that INTRODUCES a critical.
- security-audit.yml — scheduled daily, files/closes one issue for high+.

The scheduled half is the one that matters: advisories appear with NO code
change, so no push-triggered check has any reason to run. That is exactly
how today's criticals stayed invisible.

Critical blocks, high only reports. Auto-merge refuses a red base, so
failing CI on every new advisory would hand a third party the power to jam
the entire merge train on their release schedule.

Verified: script unit-tested against stubbed audit output across critical /
high-only / clean / malformed-JSON / empty-output / bad-threshold cases —
including that malformed and empty output FAIL rather than read as a pass.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 21:26:19 +02:00
GandClaude Fable 5 27f1ed50e9 fix(ci): remove the invalid workflows permission that killed every sweep (#288)
`workflows: write` is not a valid GITHUB_TOKEN permissions key. GitHub
refuses to parse the file at all — "Unexpected value 'workflows'" — which
silently disabled every trigger: no cron sweep, no workflow_run sweep, no
dispatch. Auto-merge was dead from the moment #287 landed (14:08Z) until now.

The underlying truth #287 was reaching for: GITHUB_TOKEN has NO scope that
permits writing workflow files, so a PR that edits .github/workflows/ can
never be merged by the sweep — it reads as MERGEABLE/BLOCKED to the bot and
every merge path refuses. That is a platform limit, not a config gap. Such
PRs take one `gh pr merge --squash` with a personal token; everything else
self-merges. Documented at the permissions block.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 21:25:42 +02:00
GandClaude Opus 5 6bfa018633 fix(ci): grant the sweep the workflows scope it needs to merge CI changes (#287)
Merging a PR that edits .github/workflows/ writes those files to the base
branch, and GitHub gates that on the `workflows` permission. The sweep never
had it, so such a PR is reported to GITHUB_TOKEN as MERGEABLE/BLOCKED — while
a PAT reads the identical PR as MERGEABLE/CLEAN, because mergeStateStatus is
computed per viewer.

Every merge path is refused identically: `gh pr merge`, `gh pr merge --auto`,
and PUT /pulls/{n}/merge. That is what stranded #278 and #282 through eight
sweeps while PRs touching nothing under .github/ merged normally throughout.

Note this PR cannot merge itself — it is the very change it enables, so it
needs one merge by hand. Everything after it is self-merging again.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 14:09:11 +00:00
dependabot[bot] ecc6a80da1 ci: bump actions/cache from 4 to 6 (#227)
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-08-07 09:58:07 +00:00
dependabot[bot] 84d7b7487f ci: bump actions/upload-artifact from 4 to 7 (#224)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  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-07 09:34:55 +00:00
dependabot[bot] 1408424bbc ci: bump actions/setup-node from 4 to 7 (#225)
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-07 07:40:43 +00:00
dependabot[bot] d029e165ae ci: bump actions/checkout from 4 to 7 (#226)
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-07 07:12:29 +00:00
GandClaude Opus 5 5221d374aa fix(ci): main-red alarm was silent on the path that produces nearly every run (#277)
#272 added the alarm on `workflow_run`. That covers pushes to main — but
every merge in this repo is an auto-merge made with GITHUB_TOKEN, which
fires no push event. The sweep therefore re-arms ci.yml by dispatch, and
GitHub emits no `workflow_run` for a dispatched run. The alarm was blind on
the path producing almost every main CI run.

Proven within the hour: main went red on 0c14621d (a transient puppeteer
403 fetching chrome-headless-shell), the sweep started refusing merges
again, and no issue was filed.

Now dual-path, one policy:

- scripts/ci/main-red-alert.sh holds the verdict logic, so the two callers
  cannot drift.
- main-red-alert.yml keeps the push path and calls the script.
- ci.yml gains a post-main job, gated to dispatched runs on main, which
  resolves its own verdict from the job results and calls the same script.
  `skipped` counts as success (jobs here are conditional on event type);
  failure outranks cancelled.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-06 14:51:44 +00:00
GandClaude Opus 5 343f3cb77e ci: file an issue the moment main goes red (#272)
A red main silently stops the whole repo. On 2026-08-05 a regression
reddened CI on main; the fix was pushed to a PR branch and that branch went
green, but nothing re-runs a base-branch run, so main's own run stayed red.
Auto-merge's green-base guard then refused every merge for ~16h, holding
back 17 PRs while logging its refusal into a workflow nobody opens.

The cost was not the breakage, it was the misattribution: the symptom
("the agent can't merge") points away from the cause ("the base is broken").

Ported from OrangeCat, adapted to this repo's CI workflow name. Files or
updates ONE issue on a failed CI run on main, closes it when main is green
again, and says in the body that clearing it means re-running MAIN's run,
not the branch's.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-06 11:52:30 +00:00
G 91b8fec42c ci: green PRs merge and deploy themselves (#269)
* 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:36 +02:00
GandClaude Opus 4.8 447cd9b6b3 chore(ci): converge on the verify SSOT script (recreated on current main) (#259)
Recreates #238 on current main (its branch was stale). CI's Code Quality job now
runs a single `npm run verify` instead of re-inlining lint/typecheck/build, so the
gating chain can't drift from what runs locally. Adds AGENTS.md.

Conflict resolution + improvement: main had since added a `Check umlauts` CI step;
folded `lint:umlauts` INTO the `verify` script (lint + umlauts + typecheck + build)
so the umlaut gate isn't dropped and `npm run verify` is the complete local SSOT.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 16:34:43 +02:00
GandClaude Opus 4.8 f9bf89f61c ci(umlauts): enforce lint:umlauts gate in CI and pre-deploy (#255)
The Swiss umlaut convention (display text keeps ä/ö/ü; only code
identifiers/slugs may use ASCII ue/oe/ae) was enforced only when someone
ran `npm run lint:umlauts` by hand. Wire it into the CI quality job and
the pre-deploy checks so the class of bug is gated on every PR, push, and
deploy instead of relying on memory.

Gate currently passes clean (exit 0), so no behavior change today.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 13:41:51 +02:00
GandClaude Opus 4.8 da2655a276 chore(infra): remove Vercel references — everything is self-hosted now (#239)
Vercel is fully decommissioned; production runs self-hosted on the Hetzner
box (revampit.orangecat.ch) behind Caddy, deployed via deploy-selfhost.yml.

- Sentry configs: VERCEL_ENV/VERCEL_GIT_COMMIT_SHA → NODE_ENV +
  NEXT_PUBLIC_BUILD_SHA (the self-host build SHA set by the deploy script).
- proxy.ts: drop dead '/_vercel' from BYPASS_INTL.
- prune-audit-log cron: drop x-vercel-cron auth branch, keep CRON_SECRET
  (aligns with the other cron routes + run-cron.sh); wake-recurring-tasks
  schedule comment reworded to the systemd-timer reality.
- Public web-design "technologies we use": Vercel → self-hosted Hetzner
  (tsx url + hosting description in all 8 locales).
- Presentations: ki-nachhaltigkeit demo links revampit.vercel.app →
  revampit.orangecat.ch; aoz-wohnen hosting slide → self-hosted Hetzner.
- Email template admin links: hardcoded revampit.vercel.app → ${ORG.website}.
- .env.example: Vercel Blob → S3 (Hetzner Object Storage) vars;
  KIVVI_API_URL → kivvi.orangecat.ch.
- CI: drop dead NEXT_PUBLIC_VERCEL_ENV build env.
- Comments (auth/env/sanitize/instrumentation/tax-reports/hirn/kivvi/
  inventory) reworded to self-hosted reality, rationale preserved.

Accurate historical/current docs (docs/**, README, archive) and the
immutable migration 033 comment left as-is.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 21:46:20 +02:00