@startuml lagrange-scheduler-update !include _lagrange.iuml ' How a scheduled job runs, and how cc-update/cc-tweaks/cc-log fit into it. start partition "hammerspoon/scheduler.lua" { :hs.timer.doAt armed for the single\nnext-due job (schedule.json); :hs.pathwatcher(schedule.json) edit, or\nhs.caffeinate.watcher wake -> recompute next-due\n(missed job while asleep runs as catch-up); } partition "bin/cc-sched" { :cc-sched run NAME; if (job kind?) then (shell) :/bin/sh -c "$cmd" (cwd = repo root); elseif (job kind?) then (claude) :claude -p "$prompt" --model haiku\n(read-only by default: --permission-mode plan); else (local) :history/cchist ask (local model call); endif :log to sched//.log\n+ last-status in sched/state.json; } partition "bin/cc-update (weekly \"updates-check\" template)" { :cc-update check\n(softwareupdate -l, brew outdated, mas outdated,\nclaude --version vs npm view @anthropic-ai/claude-code); if (apply confirmed?) then (yes) :snapshot brew list --versions (rollback reference); :cc-update apply brew|casks|mas\n(macOS system updates: print the command only, never auto-run); endif } partition "bin/cc-tweaks" { :cc-tweaks audit (claude/tweaks.tsv,\narch-specific, categorized system/apps/terminal/dev); :cc-tweaks apply \n(needs_sudo=1 rows: print the command as a hint only, never run); } partition "bin/cc-log" { :cc-log add SOURCE WHAT key=value...\n(~/.local/state/claude-cowork/audit/YYYY-MM.jsonl,\nsecrets masked, 365d / 90d retention on low disk); } stop @enduml