← All tests

R4 carried-forward follow-ups PROD

2026-04-29 on prod. Two non-blocking items surfaced during R4.1's multi-shop activation, bundled into one Gate cycle. (A) Idempotent admin-operator seed in migrate.js so any future fresh DB ships with Cpanel access from minute zero — no more silent 24h lockout like the one R4.1 caught after the 04-28 Supabase migration. (B) is_active filter sweep on the two remaining shop-read surfaces flagged in R4.1's hand-off: the Kitchen Display secret (saved URL stops authenticating when ops disables the shop) and the cashier-create shop validation (can't assign a cashier to a freshly retired shop).

No new test for this bundle — verified by behavior + 90/90 regression.

What's new — code surface

nix-outdoor-sales-backend @ 0749a17:
  migrate.js                                       — appended migration
                                                     20260429100000_seed_default_admin_operator.js
                                                     Counts admin_operators, inserts the default
                                                     super_admin only when table is empty. Bcrypt
                                                     hash hardcoded — same value currently in prod.

nix-cafe @ 9922b6e:
  lib/db/kitchen.ts
    ensureShopKitchenDisplaySecret(shopId)         — return type widened to string|null;
                                                     soft-disabled shops can no longer mint or
                                                     rotate kitchen secrets. Caller already
                                                     handles null (page.tsx:154).
    getShopByKitchenSecret(shopId, secret)         — added is_active=true filter; saved Kitchen
                                                     Display URLs stop authenticating the moment
                                                     ops disables the shop.
  lib/actions/cashiers.ts
    createCashierAction shop validation            — added is_active=true to the shop existence
                                                     check; "Selected shop not found or inactive"
                                                     error replaces the old "not found" so
                                                     deactivated shops surface a clear reason.
90/90 total prod tests green — no regressions from this push.
test-r4-1-prod.mjs9/9
test-phase1-prod.mjs11/11
test-receipt-preview-prod.mjs6/6
test-r2-followups3-prod.mjs7/7
test-r2-followups2-prod.mjs11/11
test-r2-followups-prod.mjs19/19
test-nix-os-r2-4b-prod.mjs12/12
test-nix-os-70-2-prod.mjs10/10
test-cafe-followups-prod.mjs5/5

R4 sub-phase status (after this bundle)

R4.1 ─ Multi-shop activation E2E              ✓ shipped (2026-04-29)
R4.x ─ Carried-forward follow-ups bundle      ✓ shipped (2026-04-29) — admin seed + is_active sweep
R4.2 ─ Impersonation                            pending (next up)
R4.3 ─ Per-product usage endpoint               pending
R4.4 ─ Drop legacy tenant_limits/plan_code      pending (last)