mirror of
https://github.com/bitbaum/evig.git
synced 2026-12-05 00:27:53 +01:00
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>