Migration gate

How a migration reaches the production database, as the code enforces it. Drawn from the code on November 8, 2026.

The short version

  1. Each production migration needs two signatures from signers who did not write it.
  2. A file with no history on main is refused outright, even with a human signature.
  3. An operator at a terminal can still apply with no signatures by typing APPLY.
Tort Terminal: the production migration gate as the code enforces it A workflow diagram generated by Archify. 01 / GitHub: PR, develop, main 02 / Approvers: Buzz thread (Jean, Brick, Sherlock, Nick) or operator keyboard 03 / GitHub Actions EX / Refused by the workflow 05 / Runner: app/scripts/run-migrations.js EX / Refused by the runner (nothing applies) 07 / Neon databases Merge to develop Release and sign Apply to production and record Two non-author signatures Migration PR · into develop, reviewed · GitHub: PR, develop, main › Merge to develop Migration PR into develop, reviewed PR Validate Gate · numbering audit, tests · GitHub: PR, develop, main › Merge to develop · blocking PR Validate Gate numbering audit, tests blocking Release PR to main · merge commit · GitHub: PR, develop, main › Release and sign Release PR to main merge commit Pending list in Buzz · NEON-APPROVE per file · Approvers: Buzz thread (Jean, Brick, Sherlock, Nick) or operator keyboard › Release and sign Pending list in Buzz NEON-APPROVE per file Second signature · other agent or human · Approvers: Buzz thread (Jean, Brick, Sherlock, Nick) or operator keyboard › Two non-author signatures › Release and sign Second signature other agent or human Vetting signature · agent, not the author · Approvers: Buzz thread (Jean, Brick, Sherlock, Nick) or operator keyboard › Two non-author signatures › Release and sign Vetting signature agent, not the author Operator: APPLY · TTY only, unsigned · Approvers: Buzz thread (Jean, Brick, Sherlock, Nick) or operator keyboard › Apply to production and record · human keyboard Operator: APPLY TTY only, unsigned human keyboard Beta migrate · develop push, beta URL · GitHub Actions › Merge to develop Beta migrate develop push, beta URL Prod migrate run · approval JSON, on main · GitHub Actions › Release and sign Prod migrate run approval JSON, on main Secret + events OK? · prod host fragment · GitHub Actions › Release and sign · shell gate Secret + events OK? prod host fragment shell gate Audit apply records · target production · GitHub Actions › Apply to production and record Audit apply records target production Workflow exits 1 · nothing checked out · Refused by the workflow › Release and sign Workflow exits 1 nothing checked out Audit FAIL · unrecorded apply · Refused by the workflow › Apply to production and record Audit FAIL unrecorded apply db:migrate, no gate · mode unguarded · Runner: app/scripts/run-migrations.js › Merge to develop db:migrate, no gate mode unguarded Runner pre-flight · prod path, origin/main · Runner: app/scripts/run-migrations.js › Release and sign · before any SQL Runner pre-flight prod path, origin/main before any SQL Two signatures? · non-author, 45 min · Runner: app/scripts/run-migrations.js › Apply to production and record · nostr-approval.ts Two signatures? non-author, 45 min nostr-approval.ts Apply file by file · SQL + record, one txn · Runner: app/scripts/run-migrations.js › Apply to production and record Apply file by file SQL + record, one txn Runner exits 1 · before any apply · Refused by the runner (nothing applies) › Release and sign Runner exits 1 before any apply Approval incomplete · nothing applies · Refused by the runner (nothing applies) › Apply to production and record Approval incomplete nothing applies Beta database · stamped beta · Neon databases › Merge to develop Beta database stamped beta schema_migrations · mode, approved_by, sha · Neon databases › Apply to production and record schema_migrations mode, approved_by, sha no FAIL db:migrate unguarded yes covered develop push raw events no hash files hashes or operator record release cut review squash then typed APPLY no Legend User UI Agent logic Policy Context / trace Cloud service External system

From you

nothing