diff --git a/.gitignore b/.gitignore index 6688eaa..83eb91d 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,6 @@ test-results/ __pycache__/ *.pyc .scratch/ + +# Design-audit capture artifacts (screenshots + measurements) +.design-audit/ diff --git a/docs/releases/2026-10-19.md b/docs/releases/2026-10-19.md index c2b7e1c..04de172 100644 --- a/docs/releases/2026-10-19.md +++ b/docs/releases/2026-10-19.md @@ -305,20 +305,64 @@ can be scanned into a session."** with **OK** (`data-testid="front-desk-required ## Deployment -**Not deployed.** Production is still missing everything from this change set: -`events.badge_copies` does not exist, `checkin_attendee` has no gate, -`welcome_checkin` prints one label, and `admin.appe.at` serves the pre-fix -bundle `index-Czkxg0C-.js` (which is exactly the reload-everything behaviour -described above). `set_registration_checked_in` already exists there with the -same signature, so the migration will not conflict. +**Deployed to production 2026-10-19** (commit `c49a94f`, both apps + DB +migration). -**One data consequence to decide on before shipping:** in production 2 people -already have session check-ins without `checked_in = true`, so the gate would -lock 1 of them out of further session scans until the front desk welcomes them. -Either backfill `checked_in = true` for anyone with an existing check-in as part -of the rollout, or accept that the front desk re-welcomes them (they print a -badge on the way back through). - -To ship: apply `20261019110000_front_desk_gate_and_badge_copies.sql` (records -41 → 42), rebuild `convivo-app` **and** `convivo-admin`, then re-run the suites -above against prod. +- **Migration** `20261019110000_front_desk_gate_and_badge_copies.sql` applied in + a single transaction with `ON_ERROR_STOP=1` and recorded in the ledger + (ledger **41 → 42**, name `front_desk_gate_and_badge_copies`). Verified after + commit: `events.badge_copies` present with + `CHECK (badge_copies >= 1 AND badge_copies <= 4)`, default `1` on the active + event, `checkin_attendee` carries the gate, `welcome_checkin` reads + `badge_copies`, and `preview_welcome_checkin` returns + `(attendee_email, attendee_name, already, will_print, copies)` granted to + `authenticated` only. `set_registration_checked_in` was already there with the + same signature, so nothing conflicted. +- **Backup** `/home/APPE/convivo-backups/gatecopies-20261019T131204Z` (mode + 0700): full `postgres.dump` (7.6 MB), pre/post counts, the three previous + function definitions, the ledger list, `docker-compose.yml`, and a copy of all + nine runtime source files the deploy touches. Rollback tags + `convivo-app:rollback-gatecopies-20261019T131204Z` and + `convivo-admin:rollback-gatecopies-20261019T131204Z`. +- **SQL regression rollback-only against prod**: migration + + `badge_print_tests.sql` in one transaction, **113/113 assertions**, then + `rollback`. Counts afterwards matched the backup exactly (contacts 119, + registrations 115, checkins 2, events 1, badge_layouts 1, print_stations 1, + queue 0, auth users 173) and `badge_copies` was still absent. +- **Baseline drift guard**: all 8 modified prod source files were byte-identical + to `HEAD~1`, so whole-file copies were safe. The 9 shipped files + (8 modified + `BadgeCopiesSetting.tsx`) verified byte-identical to HEAD on the + VM; `package.json`, `package-lock.json` and both `Dockerfile`s already matched, + so no dependency or manifest change was involved. +- **Both images** rebuilt on the VM and recreated with + `docker compose up -d --force-recreate`; healthy in both cases, every + unrelated container ID preserved (sidecar kept its 2-day uptime). Live bundles + are now `index-DSNhW0mZ.js` (admin) and `index-CXd2kxEv.js` (attendee), each + md5-identical to the local HEAD build — the admin console no longer serves + `index-Czkxg0C-.js`. +- **Gate proven on prod data**, as an authenticated admin through the real RPC: + a session scan of `markus@appe.at` (who has a session check-in but was never + welcomed) raised *"This attendee needs to be checked in at the front desk + first."*; after `welcome_checkin` the same call returned a + `checkin_id`; re-clearing the flag refused again. All inside a rolled-back + transaction — queue and checkin counts unchanged. +- **Copies proven on prod data**: with `badge_copies = 3`, one welcome enqueued + exactly **3** pgmq jobs for that attendee, and + `preview_welcome_checkin` reported `will_print = true, copies = 3`; a re-run + against an already welcomed attendee reported `copies = 0`. Rolled back + (`queue = 0`, `badge_copies = 1`). +- **PostgREST cache** picked the change up on its own: the served OpenAPI + already contains `badge_copies`. `preview_welcome_checkin` is absent from the + *anon* OpenAPI, which is correct — it is granted to `authenticated` only, as + before. Both apps proxy `/rest/v1` and `/auth/v1` normally (200 + GoTrue + health), and both SPAs render on the new bundles. +- **No printer change was needed.** The Pi renders badges from its own bundled + `/app/renderer` (built from `dist-print`), not from the admin site, and the + print entry imports only `lib/types` (type-only, erased at build) plus the + unchanged `BadgeRender`. Multiplicity comes from N queue jobs, which is why the + worker stayed untouched. +- **Deliberately not done:** no data backfill. `markus@appe.at` keeps + `checked_in = false`, so the front desk re-welcomes him (one badge) or an + admin flips the toggle before his next session scan. The print station + `Welcome desk` had not heartbeated for ~77 minutes at deploy time, so any + welcome before it comes back simply queues — jobs wait, nothing is lost.