{"definition_raw":"---\nid: morning-briefing\ntitle: Morning Briefing\nschedule: \"0 8 * * *\"\ntimeout: 480\nretry: false\nbackground: true # MC-4942 U8: backgrounded \u2014 long-running, was stalling the tick\nenabled: true\nnotify_on: failure\nrun_as: shell\ncommand: |\n  set -e\n  . ~/.claude/env/api_keys.env\n  cd /home/lucienne/workspace\n  morning_briefing_prompt=\"$(cat <<'CLAUDE_PROMPT'\n  You are Luci. Send an exception-based Morning Briefing Telegram message to Elmar via the Life Manager forum topic.\n\n  Steps:\n  1. Run: python3 ~/workspace/scripts/life_manager.py today-calendar\n     Get today's Outlook + Google Calendar events.\n\n  2. Run: python3 ~/workspace/scripts/life_manager.py week-calendar --days 7\n     Get the next 7 days of calendar events (rolling window from today). Use this as context only; do not enumerate the full 7-day calendar.\n     The Google output includes multiple calendars: conrelma@gmail.com (Elmar's primary), Family, and College (Cornwall Hill College \u2014 Cayla's school + sport).\n\n     COLLEGE FILTER (Cayla is Grade 11, plays 1st team girls hockey):\n     Only include College events that match ONE of:\n       a) Mentions Cayla by name.\n       b) Mentions Grade 11 / Gr 11 / G11 / Grd 11 / 'Senior' subject events that map to Grade 11 (e.g. 'Afrikaans Olympiad (Senior)').\n       c) 1st team girls hockey ('1st XI Hockey', 'Girls Hockey 1st', 'College Girls Hockey vs ...' where it's the 1st team \u2014 if the entry doesn't say which team, include it and tag [verify team]).\n       d) School-wide events that apply to ALL grades \u2014 term start/end, public holidays, day-rotation markers ('DAY 4', 'DAY 5', etc.), Mother's day, parents' evenings open to all, Olympiad rounds, school closures, exam timetables for whole school.\n     DROP everything else: other grades' events, U14/U15/U16 sports, boys' sports, staff-only items (SEC Meeting, Executive Meeting, Break Duty, Standardized Test for other grades, Management Meeting, individual teacher rooms unless Grade 11), other-team trials, primary school events.\n\n  3. Run: python3 ~/workspace/scripts/life_manager.py open-tickets\n     Get all open Life project tickets. Use them as exception context only.\n\n  4. Compose the briefing message as a string variable. Do not send it yet.\n     Output contract:\n     - Header: Luci | Morning Briefing -- [Day of week] [date]\n     - TODAY: list today's hard commitments with times (Outlook + Google, deduplicated). If none, say 'No hard commitments today.'\n     - EXCEPTIONS: show at most 3 visible decision/risk items total across calendar, school/family items, and Life tickets. Pick only urgent/same-day/high-value items where Elmar must decide, do, approve, prepare, or be aware of risk before the next digest.\n     - Include next 24-48h risks only when they create a concrete prep need, decision, or schedule risk.\n     - Include school/family critical items; tag Cayla/Cornwall Hill items with [Cayla] when shown.\n     - Critical/time-sensitive items bypass routine quieting. If there are more than 3, show the earliest/highest-risk 3 and add a one-line count of additional critical/time-sensitive items without listing routine detail.\n     - Exactly one line starting `I recommend ...` when there is anything for Elmar to do. Choose the single best next action; do not ask him to rank options.\n     - If nothing truly needs Elmar, say the day looks normal and 'No action needed before the next digest.'\n     - Do not enumerate the full 7-day calendar.\n     - Do not list open Life tickets unless they are urgent/same-day/high-value, direct-Elmar decisions, or create a prep/risk item.\n     - Do not introduce approval flows, reply drafts, side-effect sends, or generic `Want me to...?` questions.\n     Keep it short -- Elmar reads this on his phone.\n\n  4b. MC-5014 Attention Gate shadow log: before sending, keep the candidate JSON\n      in process memory or a local shell variable and pipe it to the gate over stdin:\n      `printf '%s' \"$attention_candidate_json\" | python3 ~/workspace/attention_gate.py`.\n      Do not write the raw briefing candidate to /tmp or another persistent file,\n      and do not pass raw JSON via argv/env vars where it can leak through process listings.\n      Use `source=morning-briefing`, `emitter=morning-briefing`,\n      `task_id=morning-briefing`, `message_class=morning-briefing`,\n      `tier_hint=digest`, and the briefing text as `summary`. If the briefing\n      contains critical/time-sensitive content, also set an appropriate\n      `risk_category`/`critical` field so the MC-5013 attention-decision ledger\n      can record critical bypass evidence. Record the returned decision in task\n      output for before/after evidence. Do not suppress the scheduled briefing\n      based on this shadow result; this phase is dry-run evidence only. If the\n      shadow gate command fails, times out, or cannot append to the ledger, log\n      the error in task output and still send the scheduled briefing.\n\n  4c. Send it only after the shadow log via: python3 ~/workspace/notify.py\n      (LUCI_NOTIFY_DEST=life-manager is set by scheduler from notify_to). Do NOT pass --dest.\n\n  5. Run: python3 ~/workspace/scripts/life_manager.py mark-email-processed (no-op, keeping state fresh)\n  CLAUDE_PROMPT\n  )\"\n  /home/lucienne/.local/bin/claude --settings /home/lucienne/.claude/settings-worker.json -p \"$morning_briefing_prompt\" --dangerously-skip-permissions\ntags: [life, morning, briefing, calendar, telegram, personal]\nruntime_profile: claude_anthropic\nnotify_to: life-manager\n---\n\nMorning briefing at 08:00 SAST (06:00 UTC), every day.\nSends an exception-based Telegram message to the Life Manager forum topic with today's hard commitments, urgent/same-day/high-value exceptions, and one recommended next action when needed.\nRoutine weekly calendar detail and low-risk Life tickets are omitted or batched for later digests.\n","id":"morning-briefing","last_run":{"duration_s":166.437523,"log_path":"/home/lucienne/workspace/logs/task-runs/morning-briefing/410023.log","output":"Morning Briefing sent. \u2705\n\n**Done:**\n- Pulled today + 7-day calendar (Outlook + Google primary/Family/College) and open Life tickets.\n- Built dedup'd briefing \u2014 TODAY (AviaDev wrap + fly home + Valencia QF + Cayla hockey/assembly), THIS WEEK Sat 13\u2192Thu 18, top-5 high-pri tickets.\n- College filtered to Cayla / Gr11 / 1st-team hockey / whole-school only (dropped boys' hockey, Break Duty, SEC/Exec/Mgmt staff meetings, Youth Day Play rehearsal).\n- Delivered \u2192 Forum: Life Manager. State refresh ran (marked 0).\n\n**Flags:** Girls Hockey vs Sutherland tagged [verify team] \u2014 calendar didn't specify 1st XI. Exco Meeting sits on Youth Day public holiday (calendar as-is, not dropped).\n\nSuggested next: confirm the Sutherland hockey match is Cayla's 1st team so I can drop the [verify team] tag in future briefings. Is it her 1st XI? (yes/no)\n","started_at":"2026-06-12T08:03:13.960026+02:00","status":"completed"},"next_run":"2026-06-13 08:00","next_run_iso":"2026-06-13T08:00:00+02:00","runs":[{"duration_s":166.437523,"finished_at":"2026-06-12T08:06:00.397805+02:00","id":410023,"log_path":"/home/lucienne/workspace/logs/task-runs/morning-briefing/410023.log","output":"Morning Briefing sent. \u2705\n\n**Done:**\n- Pulled today + 7-day calendar (Outlook + Google primary/Family/College) and open Life tickets.\n- Built dedup'd briefing \u2014 TODAY (AviaDev wrap + fly home + Valencia QF + Cayla hockey/assembly), THIS WEEK Sat 13\u2192Thu 18, top-5 high-pri tickets.\n- College filtered to Cayla / Gr11 / 1st-team hockey / whole-school only (dropped boys' hockey, Break Duty, SEC/Exec/Mgmt staff meetings, Youth Day Play rehearsal).\n- Delivered \u2192 Forum: Life Manager. State refresh ran (marked 0).\n\n**Flags:** Girls Hockey vs Sutherland tagged [verify team] \u2014 calendar didn't specify 1st XI. Exco Meeting sits on Youth Day public holiday (calendar as-is, not dropped).\n\nSuggested next: confirm the Sutherland hockey match is Cayla's 1st team so I can drop the [verify team] tag in future briefings. Is it her 1st XI? (yes/no)\n","started_at":"2026-06-12T08:03:13.960026+02:00","status":"completed","task_id":"morning-briefing","task_name":"Morning Briefing"},{"duration_s":182.128009,"finished_at":"2026-06-11T08:10:17.243384+02:00","id":405672,"log_path":"/home/lucienne/workspace/logs/task-runs/morning-briefing/405672.log","output":"Briefing delivered to Life Manager forum topic. All 5 steps done.\n\n**Done:**\n- Today + 7-day calendar pulled (Outlook + Google: primary/Family/College).\n- College filter applied \u2014 kept DAY rotations, Creative Arts Week, school holiday, College Assembly, 1st-team Girls Hockey vs Sutherland (tagged [verify team]); dropped Break Duty, Accolades Tea, Boys Hockey, Youth Day Play rehearsal.\n- Top-5 high-priority Life tickets surfaced (MC-4928/4945/4949/4932/4934).\n- Sent to **Life Manager** forum topic (notify.py: \"Sent to Forum: Life Manager\", exit=0). The one 400 was an empty bogus first call from a path typo \u2014 not the briefing.\n- `mark-email-processed`: 0 marked (state fresh).\n\nNote: Elmar at AviaDev Gaborone (UTC+2, same as SAST) \u2014 times shown local.\n\nSuggested next: nothing pending \u2014 briefing runs again 08:00 tomorrow on schedule.\nWant me to also re-check the Girls Hockey \"[verify team]\" tag against the College feed to confirm it's the 1st XI? (yes/no)\n","started_at":"2026-06-11T08:07:15.111643+02:00","status":"completed","task_id":"morning-briefing","task_name":"Morning Briefing"},{"duration_s":201.804992,"finished_at":"2026-06-10T08:05:27.262424+02:00","id":401403,"log_path":"/home/lucienne/workspace/logs/task-runs/morning-briefing/401403.log","output":"Briefing sent. \u2705\n\n**Done:**\n- Pulled today + 7-day calendar (Outlook UTC\u2192SAST, Google primary/Family/College) + Life tickets.\n- College filter applied: kept DAY markers, Creative Arts Week, school holidays, Girls Hockey vs Sutherland (tagged [verify team]), College Assembly. Dropped Break Duty, staff meetings, Accolades Tea, Boys Hockey, Girls Tennis 1st, Youth Day play rehearsal.\n- Sent to **Life Manager** forum topic (`Sent to Forum: Life Manager`, exit 0).\n- `mark-email-processed` \u2192 0 marked (state fresh).\n\nCovered today (AviaDev Day 1, Gaborone) through Tue 16 Jun. 3 high-priority Life tickets surfaced (IATA AFS due 1 Jul, Safair overbooking opinion, Investec PE).\n\nSuggested next: nothing \u2014 briefing delivered, scheduler can run unchanged tomorrow.\n\nAnything to fix in the format before next run? (yes/no)\n","started_at":"2026-06-10T08:02:05.453761+02:00","status":"completed","task_id":"morning-briefing","task_name":"Morning Briefing"},{"duration_s":204.065042,"finished_at":"2026-06-09T08:06:52.113457+02:00","id":397141,"log_path":"/home/lucienne/workspace/logs/task-runs/morning-briefing/397141.log","output":"Morning Briefing sent. Done.\n\n**Delivered** \u2192 Life Manager forum topic.\n\n- TODAY: Exco 09:30, 2\u00d7 Project Heron Q&A (14:00 / 15:00), Cayla DAY 2.\n- THIS WEEK (10\u201315 Jun): AviaDev 2026 Gaborone trip (fly out Wed 10, return Fri 12), Pacific Padel AGM Thu, Project Heron all-parties call Thu 16:00, T5 + OPSCO Mon 15. Cayla school days + 2\u00d7 Girls Hockey vs Sutherland tagged [verify team]. Birthdays each day.\n- OPEN TICKETS: 5 high-pri (Kirby Gordon deadline 10 Jun, student accom approve, 2\u00d7 FNB guarantees, Heron KYC).\n\n**Note:** first `notify.py` (no `--dest`, manual session = `LUCI_NOTIFY_DEST` unset) defaulted to dm \u2192 fence rerouted to MC topic. Harmless dup. Resent explicit `--dest life-manager` \u2192 landed correct. Under real scheduler run the env is set, so no dup.\n\nStep 5 state refresh: `{\"marked\": 1}`.\n","started_at":"2026-06-09T08:03:28.045939+02:00","status":"completed","task_id":"morning-briefing","task_name":"Morning Briefing"},{"duration_s":230.200903,"finished_at":"2026-06-08T08:07:01.326612+02:00","id":393027,"log_path":"/home/lucienne/workspace/logs/task-runs/morning-briefing/393027.log","output":"Morning Briefing delivered to Life Manager topic. Exit 0.\n\n**Done:**\n- Pulled today + 7-day calendar (Outlook 68 events + Google College/Family) + 39 open Life tickets.\n- Caught time bug: Outlook times are UTC, prior briefings showed raw (2h early). Converted +2 SAST \u2014 confirmed by \"Keep open for Lunch\" 10:30 UTC = 12:30 lunch hold.\n- College filter applied: kept DAY markers, Creative Arts Week, Girls Hockey vs Sutherland [verify team \u2014 not stated 1st XI], Rowen family flight. Dropped Gr12 Pit Produksies, staff meetings, other-grade tests, choir/debating/chess.\n- Note: Google feed capped at 6000 chars (ends Jun 12) \u2014 Jun 13-14 College/Family not in feed; Outlook birthdays cover those days.\n\n**Sent:** TODAY (T5 11:00, OPSCO+ACS 12:00, DAY 1) \u2192 THIS WEEK Tue\u2013Sun (Heron calls, AviaDev Gaborone Wed\u2013Fri full schedule, hockey, birthdays) \u2192 5 high-priority tickets (#4757 Rowen flight, #4741 AerCap, #4793 IATA AGM, #4759 Air Tanzania, #4560 Heron report).\n","started_at":"2026-06-08T08:03:11.123296+02:00","status":"completed","task_id":"morning-briefing","task_name":"Morning Briefing"},{"duration_s":128.940175,"finished_at":"2026-06-07T08:04:26.197884+02:00","id":388735,"log_path":"/home/lucienne/workspace/logs/task-runs/morning-briefing/388735.log","output":"Briefing sent. Done.\n\n**Actions**\n- Pulled today + 7-day calendar (Outlook + Google) + 35 open Life tickets.\n- College filter applied: kept DAY rotation markers + Creative Arts Week (school-wide, [Cayla]); dropped Break Duty, SEC/Exec/Mgmt meetings, Grade-12 Afrikaans, standardized tests, choir/debating/chess (other-grade/staff).\n- Sent to Life Manager forum topic (exit 0). mark-email-processed flushed.\n\n**Briefing covers**\n- TODAY: Italy Major Finals 16:00, J\u00e9an Victor birthday.\n- Mon\u2013Sat: T5/OPSCO/ACS, Exco, Project Heron calls (Tue/Thu), AviaDev Gaborone trip Wed\u2192Fri (Airlink 4Z176 out / 4Z175 back), Pacific Padel AGM, Rowen exam + flight, daily DAY markers [Cayla], birthdays.\n- Top 5 high-pri tickets, deadline-first (MC-3650 Investec closes 12 Jun, MC-4759 Air Tanzania due 10 Jun).\n\nFile: /tmp/morning_briefing_20260607.txt\n","started_at":"2026-06-07T08:02:17.254910+02:00","status":"completed","task_id":"morning-briefing","task_name":"Morning Briefing"},{"duration_s":161.741587,"finished_at":"2026-06-06T08:05:10.673812+02:00","id":384021,"log_path":"/home/lucienne/workspace/logs/task-runs/morning-briefing/384021.log","output":"Done. Briefing sent to Life Manager forum topic.\n\n**Summary**\n- Pulled today + 7-day calendar (Outlook + Google) and open Life tickets.\n- College filter applied: kept Cayla hockey + school DAY markers; dropped Netball U15A, Boys Derby, SEC/Executive/Management meetings, Break Duty, Standardized Test, Grade 12 Afrikaans, choir/debating.\n- Sent briefing \u2192 `Forum: Life Manager` (exit 0).\n- `mark-email-processed []` \u2192 state fresh.\n\n**Note** \u2014 `week-calendar` Google output capped at 6000 chars; College rows for 11\u201312 Jun partly cut. Recovered Thu/Fri from Outlook + earlier rows, but worth a fix if College has late-week entries I couldn't see. Flag if you want me to widen that cap.\n","started_at":"2026-06-06T08:02:28.928728+02:00","status":"completed","task_id":"morning-briefing","task_name":"Morning Briefing"}],"runs_limit":20,"schedule":"0 8 * * *","schedule_label":{"description":"Daily at 08:00","is_custom":false,"label":"Daily","sort":4,"sort_time":"08:00"},"stats":{"avg_duration":182.1883187142857,"completed":7,"failed":0,"timeout":0,"total":7},"task":{"_description":"Morning briefing at 08:00 SAST (06:00 UTC), every day.\nSends an exception-based Telegram message to the Life Manager forum topic with today's hard commitments, urgent/same-day/high-value exceptions, and one recommended next action when needed.\nRoutine weekly calendar detail and low-risk Life tickets are omitted or batched for later digests.","_file":"morning-briefing.md","_path":"/home/lucienne/workspace/tasks/morning-briefing.md","background":true,"command":"set -e\n. ~/.claude/env/api_keys.env\ncd /home/lucienne/workspace\nmorning_briefing_prompt=\"$(cat <<'CLAUDE_PROMPT'\nYou are Luci. Send an exception-based Morning Briefing Telegram message to Elmar via the Life Manager forum topic.\n\nSteps:\n1. Run: python3 ~/workspace/scripts/life_manager.py today-calendar\n   Get today's Outlook + Google Calendar events.\n\n2. Run: python3 ~/workspace/scripts/life_manager.py week-calendar --days 7\n   Get the next 7 days of calendar events (rolling window from today). Use this as context only; do not enumerate the full 7-day calendar.\n   The Google output includes multiple calendars: conrelma@gmail.com (Elmar's primary), Family, and College (Cornwall Hill College \u2014 Cayla's school + sport).\n\n   COLLEGE FILTER (Cayla is Grade 11, plays 1st team girls hockey):\n   Only include College events that match ONE of:\n     a) Mentions Cayla by name.\n     b) Mentions Grade 11 / Gr 11 / G11 / Grd 11 / 'Senior' subject events that map to Grade 11 (e.g. 'Afrikaans Olympiad (Senior)').\n     c) 1st team girls hockey ('1st XI Hockey', 'Girls Hockey 1st', 'College Girls Hockey vs ...' where it's the 1st team \u2014 if the entry doesn't say which team, include it and tag [verify team]).\n     d) School-wide events that apply to ALL grades \u2014 term start/end, public holidays, day-rotation markers ('DAY 4', 'DAY 5', etc.), Mother's day, parents' evenings open to all, Olympiad rounds, school closures, exam timetables for whole school.\n   DROP everything else: other grades' events, U14/U15/U16 sports, boys' sports, staff-only items (SEC Meeting, Executive Meeting, Break Duty, Standardized Test for other grades, Management Meeting, individual teacher rooms unless Grade 11), other-team trials, primary school events.\n\n3. Run: python3 ~/workspace/scripts/life_manager.py open-tickets\n   Get all open Life project tickets. Use them as exception context only.\n\n4. Compose the briefing message as a string variable. Do not send it yet.\n   Output contract:\n   - Header: Luci | Morning Briefing -- [Day of week] [date]\n   - TODAY: list today's hard commitments with times (Outlook + Google, deduplicated). If none, say 'No hard commitments today.'\n   - EXCEPTIONS: show at most 3 visible decision/risk items total across calendar, school/family items, and Life tickets. Pick only urgent/same-day/high-value items where Elmar must decide, do, approve, prepare, or be aware of risk before the next digest.\n   - Include next 24-48h risks only when they create a concrete prep need, decision, or schedule risk.\n   - Include school/family critical items; tag Cayla/Cornwall Hill items with [Cayla] when shown.\n   - Critical/time-sensitive items bypass routine quieting. If there are more than 3, show the earliest/highest-risk 3 and add a one-line count of additional critical/time-sensitive items without listing routine detail.\n   - Exactly one line starting `I recommend ...` when there is anything for Elmar to do. Choose the single best next action; do not ask him to rank options.\n   - If nothing truly needs Elmar, say the day looks normal and 'No action needed before the next digest.'\n   - Do not enumerate the full 7-day calendar.\n   - Do not list open Life tickets unless they are urgent/same-day/high-value, direct-Elmar decisions, or create a prep/risk item.\n   - Do not introduce approval flows, reply drafts, side-effect sends, or generic `Want me to...?` questions.\n   Keep it short -- Elmar reads this on his phone.\n\n4b. MC-5014 Attention Gate shadow log: before sending, keep the candidate JSON\n    in process memory or a local shell variable and pipe it to the gate over stdin:\n    `printf '%s' \"$attention_candidate_json\" | python3 ~/workspace/attention_gate.py`.\n    Do not write the raw briefing candidate to /tmp or another persistent file,\n    and do not pass raw JSON via argv/env vars where it can leak through process listings.\n    Use `source=morning-briefing`, `emitter=morning-briefing`,\n    `task_id=morning-briefing`, `message_class=morning-briefing`,\n    `tier_hint=digest`, and the briefing text as `summary`. If the briefing\n    contains critical/time-sensitive content, also set an appropriate\n    `risk_category`/`critical` field so the MC-5013 attention-decision ledger\n    can record critical bypass evidence. Record the returned decision in task\n    output for before/after evidence. Do not suppress the scheduled briefing\n    based on this shadow result; this phase is dry-run evidence only. If the\n    shadow gate command fails, times out, or cannot append to the ledger, log\n    the error in task output and still send the scheduled briefing.\n\n4c. Send it only after the shadow log via: python3 ~/workspace/notify.py\n    (LUCI_NOTIFY_DEST=life-manager is set by scheduler from notify_to). Do NOT pass --dest.\n\n5. Run: python3 ~/workspace/scripts/life_manager.py mark-email-processed (no-op, keeping state fresh)\nCLAUDE_PROMPT\n)\"\n/home/lucienne/.local/bin/claude --settings /home/lucienne/.claude/settings-worker.json -p \"$morning_briefing_prompt\" --dangerously-skip-permissions\n","enabled":true,"id":"morning-briefing","notify_on":"failure","notify_to":"life-manager","retry":false,"run_as":"shell","runtime_profile":"claude_anthropic","schedule":"0 8 * * *","tags":["life","morning","briefing","calendar","telegram","personal"],"timeout":480,"title":"Morning Briefing"}}
