Live Ops Runbook
What to do when server cron, broker sessions, or EOD flatten misbehave.
Cron health
Open Infrastructure → Server cron health. oms_sweep and oms_lifecycle should refresh every few minutes during market hours. pre_eod_guard runs at 15:10 IST; oms_eod at 15:20 IST on weekdays. If stale, verify pg_cron jobs dyadscalp-oms-sweep, dyadscalp-pre-eod-guard, and dyadscalp-eod-check, and that internal_cron_config has app_base_url + cron_secret matching Render CRON_SECRET.
EOD dry-run & acceptance test
Click EOD dry-run on Infrastructure before going live. It lists users with open intraday exposure and whether server auto-flatten is eligible (live consent + stored broker session). Use Sync EOD vault after reconnecting Upstox. Test EOD flatten (me) runs the real flatten path for your account only — use before Monday close to validate vault + consent.
Migration history
If supabase db push fails with out-of-order migrations, run supabase/scripts/repair-migration-history.ps1 once objects already exist on the remote project, then db push new files normally.
Session refresh failed
If Upstox orders fail with no_token or session errors: reconnect Upstox from the header, verify once with your session password, and confirm the server vault has your session (Infrastructure → DR health). Nightly pg_cron dyadscalp-upstox-refresh runs around 2:45 AM IST.
Flatten did not fire at close
Check: live trading consent, encrypted server session, positions were MIS not NRML, and oms_eod cron heartbeat. You still receive panic alerts at 3:20 PM IST. Use Kill Switch or mobile Panic flatten manually.
Missed order updates
Orders page uses Supabase Realtime plus 15s server reconcile. If UI is stale, confirm feed/broker health in Infrastructure, then refresh Order Lifecycle.