{"definition_raw":"---\nid: notebooklm-auth-preflight\ntitle: NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery\nschedule: \"30 0,2,4 * * *\"\ntimeout: 300\nretry: false\nenabled: true\nnotify_on: never\nrun_as: shell\ncommand: \"export HOME=/home/lucienne && export DISPLAY=:1 && cd /home/lucienne/workspace && python3 scripts/nblm_auth.py preflight --json\"\ntags: [notebooklm, auth, radio, social-pulse, keepalive]\nruntime_profile: direct_mixed\n---\n\n**OVERRIDES runtime profile:** uses direct_mixed because this task invokes NO\nClaude CLI \u2014 it calls the NotebookLM token API (Google), Playwright/Chromium, and\nTelegram (`scripts/notify.py`) directly. No LLM is used, so the wrapper `claude`\nprovider profile does not apply (rule 8).\n\nKeeps NotebookLM auth durable so `radio-daily-brief` and `social-pulse` stop\nfailing with \"Authentication expired or invalid\".\n\nThe scheduler evaluates cron in **SAST wall-clock** (see `scheduler.is_due`), and\nthose shows fire at **05:00 / 05:30 SAST**. So this runs at **00:30 / 02:30 /\n04:30 SAST** \u2014 the last is ~30 min before the 05:00 radio show. Each cycle:\n\n1. **Probe** \u2014 authenticated `NotebookLMClient.from_storage()` + `notebooks.list()`.\n   This is *also* the keepalive: a real authenticated request warms Google's\n   server session so the static cookie snapshot does not idle-rot. The happy path\n   launches NO browser (no Chromium thrash / profile contention).\n2. **Recover** \u2014 if the snapshot is dead (or near show time, even on a transient-\n   looking error), re-derive a fresh `storage_state.json` headed on display :1\n   from the persistent `~/.notebooklm/browser_profile`, then re-probe against the\n   real token API.\n3. **Alert (only if still dead)** \u2014 `scripts/notify.py` Telegram to Elmar to\n   re-auth via VNC. The 05:00/05:30 shows are *inside* notify.py quiet hours\n   (21:00\u201306:00 SAST), so the 04:30 pre-show run **forces** the alert past quiet\n   hours; the 00:30 / 02:30 keepalive runs respect quiet hours (silent) so Elmar\n   is not woken on a transient blip.\n\n`notify_on: never` because the script owns its own quiet-hours-aware, specific\nalert \u2014 the scheduler's generic failure ping would duplicate it and ignore quiet\nhours. A non-zero exit (2 = needs human re-auth, 1 = transient) still surfaces on\nthe health dashboard. Survival metric: `~/.notebooklm/preflight.log` (one JSON\nline per cycle). Runbook: `runbooks/notebooklm-auth-durability.md`.\n","id":"notebooklm-auth-preflight","last_run":{"duration_s":1.613783,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/413576.log","output":"{\n  \"before\": {\n    \"healthy\": true,\n    \"notebook_count\": 330,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"refresh\": null,\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 330,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"healthy\",\n  \"exit\": 0\n}\n","started_at":"2026-06-13T04:30:21.998601+02:00","status":"completed"},"next_run":"2026-06-14 00:30","next_run_iso":"2026-06-14T00:30:00+02:00","runs":[{"duration_s":1.613783,"finished_at":"2026-06-13T04:30:23.614875+02:00","id":413576,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/413576.log","output":"{\n  \"before\": {\n    \"healthy\": true,\n    \"notebook_count\": 330,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"refresh\": null,\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 330,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"healthy\",\n  \"exit\": 0\n}\n","started_at":"2026-06-13T04:30:21.998601+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":2.058347,"finished_at":"2026-06-13T02:30:24.506147+02:00","id":413222,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/413222.log","output":"{\n  \"before\": {\n    \"healthy\": true,\n    \"notebook_count\": 330,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"refresh\": null,\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 330,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"healthy\",\n  \"exit\": 0\n}\n","started_at":"2026-06-13T02:30:22.445144+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":1.864985,"finished_at":"2026-06-13T00:30:23.831222+02:00","id":412872,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/412872.log","output":"{\n  \"before\": {\n    \"healthy\": true,\n    \"notebook_count\": 330,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"refresh\": null,\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 330,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"healthy\",\n  \"exit\": 0\n}\n","started_at":"2026-06-13T00:30:21.964060+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":8.37006,"finished_at":"2026-06-12T04:30:24.337485+02:00","id":409409,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/409409.log","output":"{\n  \"before\": {\n    \"healthy\": false,\n    \"notebook_count\": null,\n    \"reason\": \"Authentication expired or invalid. Redirected to: https://accounts.google.com/v3/signin/identifier?continue=https%3A%2F%2Fnotebooklm.google.com%2Flogin%3Fcontinue%3Dhttps%3A%2F%2Fnotebooklm.google.com%2F&dsh=S422175604%3A1781231416473373&followup=https%3A%2F%2Fnotebooklm.google.com%2Flogin%3Fcontinu\",\n    \"needs_reauth\": true\n  },\n  \"refresh\": {\n    \"refreshed\": true,\n    \"logged_in\": true,\n    \"final_url\": \"https://notebooklm.google.com/\",\n    \"cookie_count\": 73,\n    \"has_sid\": true,\n    \"headless\": false\n  },\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 327,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"recovered\",\n  \"exit\": 0\n}\n","started_at":"2026-06-12T04:30:15.964863+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":2.084911,"finished_at":"2026-06-12T02:30:18.408441+02:00","id":409057,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/409057.log","output":"{\n  \"before\": {\n    \"healthy\": true,\n    \"notebook_count\": 327,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"refresh\": null,\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 327,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"healthy\",\n  \"exit\": 0\n}\n","started_at":"2026-06-12T02:30:16.317018+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":1.615622,"finished_at":"2026-06-12T00:30:17.560195+02:00","id":408708,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/408708.log","output":"{\n  \"before\": {\n    \"healthy\": true,\n    \"notebook_count\": 327,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"refresh\": null,\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 327,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"healthy\",\n  \"exit\": 0\n}\n","started_at":"2026-06-12T00:30:15.940911+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":7.499003,"finished_at":"2026-06-11T04:30:27.836165+02:00","id":405043,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/405043.log","output":"{\n  \"before\": {\n    \"healthy\": false,\n    \"notebook_count\": null,\n    \"reason\": \"Authentication expired or invalid. Redirected to: https://accounts.google.com/v3/signin/identifier?continue=https%3A%2F%2Fnotebooklm.google.com%2Flogin%3Fcontinue%3Dhttps%3A%2F%2Fnotebooklm.google.com%2F&dsh=S1881970594%3A1781145020740868&followup=https%3A%2F%2Fnotebooklm.google.com%2Flogin%3Fcontin\",\n    \"needs_reauth\": true\n  },\n  \"refresh\": {\n    \"refreshed\": true,\n    \"logged_in\": true,\n    \"final_url\": \"https://notebooklm.google.com/\",\n    \"cookie_count\": 73,\n    \"has_sid\": true,\n    \"headless\": false\n  },\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 325,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"recovered\",\n  \"exit\": 0\n}\n","started_at":"2026-06-11T04:30:20.334655+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":1.466797,"finished_at":"2026-06-11T02:43:31.251144+02:00","id":404710,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/404710.log","output":"{\n  \"before\": {\n    \"healthy\": true,\n    \"notebook_count\": 325,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"refresh\": null,\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 325,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"healthy\",\n  \"exit\": 0\n}\n","started_at":"2026-06-11T02:43:29.781538+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":1.590522,"finished_at":"2026-06-11T00:33:07.528744+02:00","id":404335,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/404335.log","output":"{\n  \"before\": {\n    \"healthy\": true,\n    \"notebook_count\": 325,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"refresh\": null,\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 325,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"healthy\",\n  \"exit\": 0\n}\n","started_at":"2026-06-11T00:33:05.935318+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":2.017718,"finished_at":"2026-06-10T04:35:09.470122+02:00","id":400788,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/400788.log","output":"{\n  \"before\": {\n    \"healthy\": true,\n    \"notebook_count\": 322,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"refresh\": null,\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 322,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"healthy\",\n  \"exit\": 0\n}\n","started_at":"2026-06-10T04:35:07.450044+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":1.819832,"finished_at":"2026-06-10T02:43:08.588336+02:00","id":400432,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/400432.log","output":"{\n  \"before\": {\n    \"healthy\": true,\n    \"notebook_count\": 322,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"refresh\": null,\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 322,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"healthy\",\n  \"exit\": 0\n}\n","started_at":"2026-06-10T02:43:06.765930+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":2.018293,"finished_at":"2026-06-10T00:36:05.968914+02:00","id":400070,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/400070.log","output":"{\n  \"before\": {\n    \"healthy\": true,\n    \"notebook_count\": 322,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"refresh\": null,\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 322,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"healthy\",\n  \"exit\": 0\n}\n","started_at":"2026-06-10T00:36:03.947848+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":9.610701,"finished_at":"2026-06-09T04:36:23.995890+02:00","id":396516,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/396516.log","output":"{\n  \"before\": {\n    \"healthy\": false,\n    \"notebook_count\": null,\n    \"reason\": \"Authentication expired or invalid. Redirected to: https://accounts.google.com/v3/signin/identifier?continue=https%3A%2F%2Fnotebooklm.google.com%2Flogin%3Fcontinue%3Dhttps%3A%2F%2Fnotebooklm.google.com%2F&dsh=S505083155%3A1780972574856980&followup=https%3A%2F%2Fnotebooklm.google.com%2Flogin%3Fcontinu\",\n    \"needs_reauth\": true\n  },\n  \"refresh\": {\n    \"refreshed\": true,\n    \"logged_in\": true,\n    \"final_url\": \"https://notebooklm.google.com/\",\n    \"cookie_count\": 73,\n    \"has_sid\": true,\n    \"headless\": false\n  },\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 320,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"recovered\",\n  \"exit\": 0\n}\n","started_at":"2026-06-09T04:36:14.382476+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":3.519299,"finished_at":"2026-06-09T02:42:51.842039+02:00","id":396193,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/396193.log","output":"{\n  \"before\": {\n    \"healthy\": true,\n    \"notebook_count\": 320,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"refresh\": null,\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 320,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"healthy\",\n  \"exit\": 0\n}\n","started_at":"2026-06-09T02:42:48.319421+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":1.547538,"finished_at":"2026-06-09T00:44:37.842316+02:00","id":395845,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/395845.log","output":"{\n  \"before\": {\n    \"healthy\": true,\n    \"notebook_count\": 320,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"refresh\": null,\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 320,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"healthy\",\n  \"exit\": 0\n}\n","started_at":"2026-06-09T00:44:36.291688+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":8.421,"finished_at":"2026-06-08T04:43:40.465976+02:00","id":392448,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/392448.log","output":"{\n  \"before\": {\n    \"healthy\": false,\n    \"notebook_count\": null,\n    \"reason\": \"Authentication expired or invalid. Redirected to: https://accounts.google.com/v3/signin/identifier?continue=https%3A%2F%2Fnotebooklm.google.com%2Flogin%3Fcontinue%3Dhttps%3A%2F%2Fnotebooklm.google.com%2F&dsh=S-703727673%3A1780886612466187&followup=https%3A%2F%2Fnotebooklm.google.com%2Flogin%3Fcontin\",\n    \"needs_reauth\": true\n  },\n  \"refresh\": {\n    \"refreshed\": true,\n    \"logged_in\": true,\n    \"final_url\": \"https://notebooklm.google.com/\",\n    \"cookie_count\": 73,\n    \"has_sid\": true,\n    \"headless\": false\n  },\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 318,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"recovered\",\n  \"exit\": 0\n}\n","started_at":"2026-06-08T04:43:32.041606+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":1.751558,"finished_at":"2026-06-08T02:42:32.608195+02:00","id":392106,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/392106.log","output":"{\n  \"before\": {\n    \"healthy\": true,\n    \"notebook_count\": 318,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"refresh\": null,\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 318,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"healthy\",\n  \"exit\": 0\n}\n","started_at":"2026-06-08T02:42:30.853888+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":1.566808,"finished_at":"2026-06-08T00:42:06.187275+02:00","id":391760,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/391760.log","output":"{\n  \"before\": {\n    \"healthy\": true,\n    \"notebook_count\": 318,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"refresh\": null,\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 318,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"healthy\",\n  \"exit\": 0\n}\n","started_at":"2026-06-08T00:42:04.617768+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":9.700124,"finished_at":"2026-06-07T04:30:30.598898+02:00","id":388039,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/388039.log","output":"{\n  \"before\": {\n    \"healthy\": false,\n    \"notebook_count\": null,\n    \"reason\": \"Authentication expired or invalid. Redirected to: https://accounts.google.com/v3/signin/identifier?continue=https%3A%2F%2Fnotebooklm.google.com%2Flogin%3Fcontinue%3Dhttps%3A%2F%2Fnotebooklm.google.com%2F&dsh=S505083155%3A1780799421294241&followup=https%3A%2F%2Fnotebooklm.google.com%2Flogin%3Fcontinu\",\n    \"needs_reauth\": true\n  },\n  \"refresh\": {\n    \"refreshed\": true,\n    \"logged_in\": true,\n    \"final_url\": \"https://notebooklm.google.com/\",\n    \"cookie_count\": 73,\n    \"has_sid\": true,\n    \"headless\": false\n  },\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 317,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"recovered\",\n  \"exit\": 0\n}\n","started_at":"2026-06-07T04:30:20.895337+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"},{"duration_s":2.203093,"finished_at":"2026-06-07T02:42:09.527294+02:00","id":387672,"log_path":"/home/lucienne/workspace/logs/task-runs/notebooklm-auth-preflight/387672.log","output":"{\n  \"before\": {\n    \"healthy\": true,\n    \"notebook_count\": 317,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"refresh\": null,\n  \"after\": {\n    \"healthy\": true,\n    \"notebook_count\": 317,\n    \"reason\": \"ok\",\n    \"needs_reauth\": false\n  },\n  \"healthy\": true,\n  \"result\": \"healthy\",\n  \"exit\": 0\n}\n","started_at":"2026-06-07T02:42:07.322312+02:00","status":"completed","task_id":"notebooklm-auth-preflight","task_name":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"}],"runs_limit":20,"schedule":"30 0,2,4 * * *","schedule_label":{"description":"Daily at 00:30, 02:30, 04:30","is_custom":false,"label":"Daily","sort":4,"sort_time":"00:30"},"stats":{"avg_duration":3.3419563333333335,"completed":24,"failed":0,"timeout":0,"total":24},"task":{"_description":"**OVERRIDES runtime profile:** uses direct_mixed because this task invokes NO\nClaude CLI \u2014 it calls the NotebookLM token API (Google), Playwright/Chromium, and\nTelegram (`scripts/notify.py`) directly. No LLM is used, so the wrapper `claude`\nprovider profile does not apply (rule 8).\n\nKeeps NotebookLM auth durable so `radio-daily-brief` and `social-pulse` stop\nfailing with \"Authentication expired or invalid\".\n\nThe scheduler evaluates cron in **SAST wall-clock** (see `scheduler.is_due`), and\nthose shows fire at **05:00 / 05:30 SAST**. So this runs at **00:30 / 02:30 /\n04:30 SAST** \u2014 the last is ~30 min before the 05:00 radio show. Each cycle:\n\n1. **Probe** \u2014 authenticated `NotebookLMClient.from_storage()` + `notebooks.list()`.\n   This is *also* the keepalive: a real authenticated request warms Google's\n   server session so the static cookie snapshot does not idle-rot. The happy path\n   launches NO browser (no Chromium thrash / profile contention).\n2. **Recover** \u2014 if the snapshot is dead (or near show time, even on a transient-\n   looking error), re-derive a fresh `storage_state.json` headed on display :1\n   from the persistent `~/.notebooklm/browser_profile`, then re-probe against the\n   real token API.\n3. **Alert (only if still dead)** \u2014 `scripts/notify.py` Telegram to Elmar to\n   re-auth via VNC. The 05:00/05:30 shows are *inside* notify.py quiet hours\n   (21:00\u201306:00 SAST), so the 04:30 pre-show run **forces** the alert past quiet\n   hours; the 00:30 / 02:30 keepalive runs respect quiet hours (silent) so Elmar\n   is not woken on a transient blip.\n\n`notify_on: never` because the script owns its own quiet-hours-aware, specific\nalert \u2014 the scheduler's generic failure ping would duplicate it and ignore quiet\nhours. A non-zero exit (2 = needs human re-auth, 1 = transient) still surfaces on\nthe health dashboard. Survival metric: `~/.notebooklm/preflight.log` (one JSON\nline per cycle). Runbook: `runbooks/notebooklm-auth-durability.md`.","_file":"notebooklm-auth-preflight.md","_path":"/home/lucienne/workspace/tasks/notebooklm-auth-preflight.md","command":"export HOME=/home/lucienne && export DISPLAY=:1 && cd /home/lucienne/workspace && python3 scripts/nblm_auth.py preflight --json","enabled":true,"id":"notebooklm-auth-preflight","notify_on":"never","retry":false,"run_as":"shell","runtime_profile":"direct_mixed","schedule":"30 0,2,4 * * *","tags":["notebooklm","auth","radio","social-pulse","keepalive"],"timeout":300,"title":"NotebookLM Auth Preflight \u2014 keepalive + pre-show recovery"}}
