Thoughts

3 thoughts of type "observation" about "Tat-Tally" in the last 30 days
3/16/2026

Tat-Tally Session 54 complete summary: All Session 52 E2E audit findings are now fully resolved. This session handled the final two items plus the Sentry DSN deployment: 1. H4 (Sentry): Added @sentry/react to the registration app (last app missing it). Replaced stub sentry.ts with real Sentry.init() matching the other 5 apps. Wired initSentry() in main.tsx, switched to Sentry.ErrorBoundary in App.tsx. 2. L1 (Hardcoded port): Replaced hardcoded localhost:5176 in getEntryUrl() with VITE_ENTRANT_URL env var, falling back to window.location.origin. In production, all apps share the same origin so the fallback handles it. VITE_ENTRANT_URL is only needed for local dev. 3. H4-ENV (Sentry DSN): Found existing tat-tally project in Sentry (DSN already provisioned). Set VITE_SENTRY_DSN in Railway production env vars via Railway MCP. Triggered redeploy (deployment 2a5a86ec). Railway project details: projectId=7eec0cd1-4fe3-4bae-9bfc-89646eb7d3be, serviceId=fdf7aeb0-63a8-4f67-b85f-4c882120381f, environmentId=0cd206fa-91f7-4c3b-8240-f04365269f19 (production). All audit findings from Session 52 (B1, B2, H1-H5, M1-M6, L1, L2) are now complete. Remaining open items: A2P 10DLC registration (blocked on LLC/EIN), Supabase connection pool upgrade (pre-Norfolk), and Phase 12 Norfolk test event planning.

Tat-Tally Session 47 (2026-03-16): Convention Simulation & Audit Logging - COMPLETE Built two major systems for the Tattoo Contest System (Tat-Tally) before the Norfolk test event: 1. PRODUCTION AUDIT LOGGING - Created `audit_log` table with `audit_action` enum covering 11 action types: event_created, event_updated, category_status_changed, entry_created, entry_code_generated, entry_code_redeemed, queue_status_changed, score_submitted, score_reset, judge_assigned, sms_sent - 3 database triggers auto-populate audit entries: `trg_audit_category_status` (on categories UPDATE when status changes), `trg_audit_entry_queue_status` (on entries UPDATE when queue_status changes), `trg_audit_score_insert` (on scores INSERT) - All triggers use SECURITY DEFINER to bypass RLS - RLS: admin can read all, anon scoped by x-event-id header - Migration: `infrastructure/migrations/add_audit_log.sql` 2. FULL CONVENTION SIMULATION SYSTEM (tests/simulation/) - Seed SQL creates realistic convention: 1 event (slug: sim-test), 3 scoring frameworks (tattoo 4 criteria, costume 3, pumpkin 3), 12 categories matching Atlanta spec, 7 auth users (5 judges J-01 through J-05, 1 MC, 1 admin), 40 judge assignments, ~210 entrants with realistic names - UUID pattern: cccc0001-... through cccc0005-... for deterministic test data - 8-phase TypeScript runner: setup, registration, 3 judging waves (3 categories each), edge cases, wrap-up - Judge personality profiles using Box-Muller normal distribution: J-01 "tough" (mean 6.0), J-02 "generous" (mean 8.0), J-03/04/05 "neutral" (mean 7.0), stddev 1.5 - SPEED multiplier: 0 (instant), 1 (real-time ~13 min), 10 (fast ~80s) - Structured JSONL logging (events, realtime latency, errors) - Export script with pagination (fixes Supabase 1000-row default limit): outputs full-export.json, timeline.json, leaderboard.json, outliers.json, summary.json - Files: config.ts, logger.ts, scenarios.ts, runner.ts, export.ts, run.sh 3. PRODUCTION BUG FOUND AND FIXED - `update_entry_final_score()` trigger was NOT SECURITY DEFINER. When judges insert scores via Supabase REST API, the trigger ran under the judge's auth context. The judge's RLS could read their own judge_assignments but the trigger's count(*) query on judge_assignments for the whole category returned wrong results, so the completeness check (v_total_scores >= expected) never passed. Result: final_score was NEVER calculated on any entry. - Fix: Migration `fix_final_score_trigger_security_definer` adds SECURITY DEFINER to the function - Also updated `infrastructure/schema.sql` to reflect the fix SIMULATION RESULTS (SPEED=10 run): - 133 entries scored across 12 categories - 25 entries skipped, 4 withdrawn - 2,191 audit log entries (1,724 score_submitted, 431 queue_status_changed, 36 category_status_changed) - 60 score outliers detected - Leaderboard verified with realistic score distribution (6.5-7.6 range) Commit: 79511fe pushed to main. Next up: Norfolk test event planning (Phase 12).

People: J-01, J-02, J-03, J-04, J-05

Tat-Tally Session 45A Complete (2026-03-15): Scoring Modes & Display Overhaul, Phase A (Database + Admin Settings) This is the first of three phases in a major feature build for the Tattoo Contest System (Tat-Tally). The three features being added are: (1) scoring mode toggle (total vs averaged), (2) live leaderboard toggle (on/off with 5-second cycling), and (3) display layer overhaul with three display types and per-judge monitors. What was done in Phase A: - Created migration `add_event_settings_scoring_displays` adding 3 new event-level columns: `scoring_mode` (enum: averaged/total), `live_leaderboard` (boolean), `judge_display_mode` (enum: per_judge/condensed) - Widened `entries.final_score` from numeric(4,1) to numeric(6,1) to support total mode (e.g., 10 criteria x 5 judges = max 500.0) - Updated the `update_entry_final_score()` Postgres trigger to check the event's scoring_mode and calculate sum vs avg accordingly - Added `recalculate_event_scores(p_event_id)` function for recalculating all scores when admin changes scoring mode mid-event - Updated `v_leaderboard` view to include `scoring_mode` column (joined through events table) - Built admin Event Settings page (`src/admin/src/pages/event-settings.tsx`) with scoring mode dropdown, live leaderboard toggle switch, and judge display mode selector. Includes a confirmation dialog when changing scoring mode (warns about recalculation). - Created shared scoring utilities at `src/shared/src/scoring.ts`: formatScore(), getMaxPossible(), scoreLabel(), scoreSummaryLabel() - Regenerated TypeScript types from Supabase, synced to all 7 database.types.ts files - All 6 apps pass tsc --noEmit Design doc with full behavioral specs: `docs/brainstorm-scoring-and-displays.md` Remaining phases: - Phase B (Display Layer Overhaul): useEventSettings hook, main display tally/leaderboard cycling, category display scorecard flash sequences, per-judge display with condensed mode, ScoreReveal and LeaderboardTable component updates - Phase C (Entrant App + Edge Function): Update get-portal Edge Function for per-judge breakdowns, entrant portal full scorecard display, constants tuning Project location: ~/Library/Mobile Documents/com~apple~CloudDocs/Projects/Apps/TattooContestSystem/ Supabase project ID: ovdtlcpgeydtgjnsxtqk All progress tracked in PROJECT-TRACKER.md