Sam asked to patch the KB follow-up stack so the daily pulse, needs-followup triage, and drift scan all use one live backlog-count source, and to remove the stale sandbox vault fallback path while keeping routine behavior the same apart from count and portability cleanup.
Created /Users/samaguiar/Documents/Projects/Skills/kb_live_backlog.py as the shared live source for Status = Needs Follow-up. It reads NOTION_API_KEY from the environment, VAULT_ENV_PATH, /Users/samaguiar/Documents/Projects/.credentials/vault.env, or /Users/samaguiar/.credentials/vault.env, then paginates Notion database queries with start_cursor.
Updated the daily pulse stack: /Users/samaguiar/Documents/Projects/Skills/sail-kb-daily-pulse/notion_paged_query.py now writes live_backlog_count, and /Users/samaguiar/Documents/Projects/Skills/sail-kb-daily-pulse/build_report.py displays that count and source. The old stale sandbox vault path was removed from the active helper and from notion_paged_query.py.bak-2026-05-20.
Updated the weekly triage stack: /Users/samaguiar/Documents/Projects/Skills/needs-followup-triage/triage.py now queries Needs Follow-up pages through the shared helper and records the live count/source in the report and JSON. The SKILL.md and scheduled-task spec were updated to document the common source.
Updated the registered Codex automations daily-sail-kb-follow-up-and-drift-scan and needs-followup-triage so their prompts point to /Users/samaguiar/Documents/Projects/Skills/kb_live_backlog.py and avoid inferred counts from broad search, partial buckets, or stale mirrors.
Red test run first failed as expected because the shared module and metadata hooks did not exist. After implementation, python3 -m unittest Skills/tests/test_kb_followup_live_backlog.py passed 4 tests. python3 -m py_compile passed for the shared helper, daily pulse files, triage file, and tests. A grep for /sessions/practical-trusting-feynman across the active stack returned no matches.
Live read-only Notion smoke test returned Needs Follow-up count=675 from live_notion_status_query at 2026-05-26T17:15:34Z. End-to-end daily pulse QA wrote /tmp/sail-kb-agg-qa.json and /tmp/sail-kb-pulse-qa.txt; the report showed Needs Follow-up: 675, Backlog count source: live_notion_status_query, and B) NEEDS FOLLOW-UP - newest first (top 25 of 675). Weekly triage dry-run wrote /tmp/needs-followup-triage-qa.md and /tmp/needs-followup-triage-qa.json; it reported Needs Follow-up live backlog count: 675, backlog_count_source: live_notion_status_query, superseded=0, routine_stale=3, dry-run, no errors.
The requested patch is complete locally and the registered automations are updated in Codex. No git staging or commit was performed because the Projects root git status was already in a broad delete/add churn state unrelated to this task, so staging only this patch would be risky without a separate index cleanup pass.
A future agent can optionally migrate this shared helper into the cloud-backed routine layer Sam is building with Codex and Cloudflare Workers, but the local routines now share one source and are verified. A future cleanup pass should address the root git index churn separately before committing this patch.
Start in /Users/samaguiar/Documents/Projects. Review /Users/samaguiar/Documents/Projects/Skills/kb_live_backlog.py, /Users/samaguiar/Documents/Projects/Skills/sail-kb-daily-pulse/notion_paged_query.py, /Users/samaguiar/Documents/Projects/Skills/sail-kb-daily-pulse/build_report.py, and /Users/samaguiar/Documents/Projects/Skills/needs-followup-triage/triage.py. Run python3 -m unittest Skills/tests/test_kb_followup_live_backlog.py and the live smoke count before making further changes. Treat /Users/samaguiar/.codex/automations/daily-sail-kb-follow-up-and-drift-scan/automation.toml and /Users/samaguiar/.codex/automations/needs-followup-triage/automation.toml as already updated through the Codex automation tool.
A. Cloud-back the shared backlog-count helper later, recommended, because it matches Sam's cloud sync direction but is outside this local patch. B. Leave it local only for now, lower effort but less portable across devices. C. Bundle cloud migration with a broader automation cleanup, best if the root git index churn is cleaned first. D. Other.