Master Ops Center · Nightly Runs

What happened overnight.

7 scheduled tasks run nightly across two hosts. Pure-code tasks (backup, sync, IP guardrail) run on Cloudflare cron — zero local-machine dependency. Synthesis tasks (briefing, hygiene, health, roll-forward) run on Cowork because they need an LLM in the loop.

The hosting split

Cloudflare cron · 3 tasks

Supabase snapshot, exercise sync, IP leak scanner. Live on the existing ba-lesri-server Worker. No local machine needed. Output to R2 + SmartSuite + email. See 02-ARCHITECTURE/ba-lesri-server/CRON-MIGRATION-RUNBOOK.md.

Cowork · 4 tasks

Task roll-forward, CRM hygiene, system health, morning briefing. Need Claude session model for synthesis and judgment. Require Mac running Cowork past midnight.

Last night's runs

Tonight's run order

7 tasks chained overnight. Cloudflare-hosted = bulletproof. Cowork-hosted = requires Mac open past midnight. Times shown in ET.

OrderTaskHostTimeWhat it does
1 ba-task-roll-forward Cowork 11:55 PM Surfaces Ops Center tasks whose day code has passed without being checked off.
2 ba-supabase-nightly-snapshot Cloudflare 12:30 AM Exports 9 canonical tables to R2 bucket ba-backups. 14-day rotation.
3 ba-exercise-library-sync Cloudflare 1:00 AM SmartSuite Exercise Library → Supabase delta sync. Last-sync timestamp in KV.
4 ba-crm-hygiene-sweep Cowork 2:00 AM Read-only audit of BA CRM: stale leads, schools, athletes missing intake, overdue ambassadors.
5 ba-system-health-smoke-test Cowork 3:00 AM LESRI Worker health, Supabase row counts, SmartSuite API check, Make.com state, disk space.
6 ba-ip-leak-scanner Cloudflare 4:00 AM Fetches LIVE deployed URLs and greps for vendor brands, LESRI internals, wrong emails. Catches what visitors actually see.
7 ba-morning-briefing Cowork 5:30 AM 9 sections: day ahead, email, status of 6 prior runs (from SmartSuite Daily Briefings table), BETA, 100K Girls, CRM hotlist, Ops top 5, drafts ready, the One Thing.

7-day history

Each row links to the full markdown. Status badge is from the briefing.

DateTaskStatusSummaryOpen
History will populate after the first scheduled-task runs complete.

Files appear under 13-DAILY-BRIEFINGS/{morning-briefing,system-health,exercise-sync}/YYYY-MM-DD-*.md

Output channels

Email

Each run sends an HTML email to Tomas@betterathlete.com via the SendGrid Worker route. Avenir Next throughout. Confidentiality footer. Mobile-first responsive.

SmartSuite

A new record per run lands in the Daily Briefings table (table ID 6a1cdd48ab0a83c3b80ab286, auto-slug son2koz2) in the BA CRM solution (69e7aef2a0502724da9beecd). 11 fields covering type, status, summary, body, file path, run duration. Searchable, filterable, mobile-accessible.

Local markdown

Source of truth on disk: /Users/tomasanthony/Documents/Claude/13-DAILY-BRIEFINGS/. Archived after 7 days into a year-folder. Never deleted.

What to do if a run flags ATTENTION

  1. Open the affected markdown file from the card above.
  2. Read the "ATTENTION" section at the top — it names what failed and why.
  3. If it is a system-health failure (Worker, Supabase, Make.com): fix immediately. BETA athletes depend on these.
  4. If it is an exercise-sync error: the next run will retry the same window automatically. Investigate only if it fails twice in a row.
  5. If it is a morning briefing data gap (e.g., calendar connector dropped): reconnect the connector at /mcp. Briefing keeps working — that section just shows as unavailable.
  6. Follow the Update Methodology protocol if the fix requires a code or schema change.

How to add a new nightly task

  1. Use mcp__scheduled-tasks__create_scheduled_task with a cron expression in local time.
  2. Write a fully self-contained prompt — scheduled-task sessions start fresh with auto-memory loaded.
  3. Output to all three channels: markdown file under 13-DAILY-BRIEFINGS/{task-name}/, email via SendGrid, SmartSuite record in the Daily Briefings table.
  4. Add a tile to this page's "Last night's runs" grid and a row to "Today's scheduled runs".
  5. Apply standing rules: no emojis, no vendor brand names, Avenir Next throughout, archive-never-delete.