Scheduling Operating Model
Scheduling is the system that turns recurring agent work into durable wiki updates, not just recurring chat threads.
Definition
A heartbeat is the operating contract for scheduled agents. It answers four questions:
- What should run?
- When should it run?
- Where should output be written?
- Which durable wiki pages, skills, state files, or logs should change?
The scheduler may create a thread, but the wiki only changes when the run writes output, applies promotion criteria, updates state, rebuilds indexes when needed, and appends wiki/log.md. A scheduler thread without that writeback is only an observation.
Control Flow
Sources Of Truth
| Layer | Source | Meaning |
|---|---|---|
| Canonical task | automations/<slug>.md |
What the automation does, what it may read, and what it may write. |
| Cloud prompt | automations/<slug>.cursor-automation.md |
Cursor-cloud adaptation of the canonical task. |
| Local schedule | ~/.codex/automations/<id>/automation.toml |
Live Codex schedule, cwd, prompt, model, and recurrence. |
| Run artifact | outputs/<date>/<slug>/<agent>.md |
Ephemeral evidence and scan results. |
| Durable state | state.json |
Last durable run, sync, and maintenance dates. |
| Durable ledger | wiki/log.md |
Human-readable operation history. |
| Search/index | wiki/_index.md, qmd |
Retrieval surface after wiki changes. |
automations/<slug>.md wins when local scheduler prompts drift. Scheduler prompts should tell the agent to read the canonical automation file, not duplicate the entire task in fragile scheduler text.
Heartbeat Companion Pages
The scheduling model owns the system-level contract. Heartbeat companion pages provide retrieval handles for common operations:
| Need | Page |
|---|---|
| Interpret current stale/overdue output | Freshness Check |
| Decide what makes a run complete | Automation Proof Contract |
| Handle four-hour Slack/Gmail/source compile jobs | Sub-Daily Cadence |
| Run, repair, defer, or retire overdue jobs | Automation Overdue |
| Distinguish source truth from generated projections | Generated Surface Contract |
| Refresh search, packs, registry, and other generated surfaces | Generated Surface Refresh |
Required Codex Prompt Shape
Every recurring Codex schedule should include this contract, customized only for the slug:
Read AGENTS.md, wiki/HEARTBEAT.md, automations/<slug>.md, and any files directly referenced by that automation. Execute the canonical automation.
Write output to outputs/<YYYY-MM-DD>/<slug>/codex.md. Apply wiki_targets only when the automation's promotion criteria pass; otherwise record "No durable wiki update needed" in the output.
Update state.json under automations.<slug> when the scheduled check completes. Append wiki/log.md with the date, summary, changed files, and whether a durable wiki update was made.
When wiki pages, skills, routing, or indexes change, run the relevant checks from the automation plus npx tsx scripts/build-index.ts and qmd update && qmd embed. Do not send messages, apply destructive fixes, or mutate external systems unless the automation explicitly permits it.
Wiki Writeback Map
| Signal type | Durable target |
|---|---|
| Raw source or capture | raw/, relevant wiki/ pages, _absorb_log.json, wiki/log.md. |
| Tool or agent capability | wiki/tools/, wiki/meta/active-stack.md, wiki/meta/capability-harvest-pattern.md, wiki/SKILL-RESOLVER.md. |
| Skill friction | skills/<category>/<slug>/SKILL.md, skill registry pages, wiki/log.md. |
| Career signal | wiki/career/, wiki/career/content-backlog.md, recruiter or role-specific pages. |
| Project bug or lesson | wiki/postmortems/, wiki/decisions/, wiki/concepts/, or "no durable update" if transient. |
| Scheduling drift | wiki/HEARTBEAT.md, wiki/meta/automation-schema.md, this page, automations/scheduling-audit.md. |
| Travel or event scan | Existing planning page if active; output-only if stale or not promoted. |
Schedule Matrix
| Cadence | Scheduled work | Durable behavior |
|---|---|---|
| Every 4 hours | Slack sync, email sync, source compile / X bookmark review. | Write raw digests, update syncs.* only after successful collection, promote durable facts into wiki pages, and store ISO timestamps in state.json for hour-level freshness. |
| Daily | Signal radar, frontend frontier radar, skill maintenance, meeting sync, project briefing, code-bugfix, content pipeline, career pipeline, daily work summary where enabled. | Compile new facts, update target pages only when criteria pass, and log no-op runs. |
| Weekly | Calendar sync, capability harvest, cross-project learning, SEO/GEO radar, language orchestration radar, recruiter discovery, OSS license audit, scheduling audit. | Consolidate patterns, catch drift, update indexes and routing docs. |
| Monthly | Wiki quality audit, routing/trigger eval review, stale schedule review, obsolete automation review. | Prune duplicate schedules, retire stale monitors, refresh cadence docs. |
| On demand | Security scan, self-heal apply, capture ingest, no-sus review, process cleanup. | Run only with explicit trigger or cost/destructive approval. |
Audit Findings On 2026-06-28
The local Codex scheduler had two classes of drift:
- Legacy active schedules still pointed at
~/Documents/GitHub/my-wiki. - Several newer
kevin-wikischedules had thin prompts that returned a report but did not require wiki writeback,state.json, orwiki/log.md.
scripts/check-freshness.ts now checks ~/.codex/automations for legacy cwd schedules and Codex-capable automations that have no active local schedule.
Actions taken:
- Deleted legacy
my-wikiCodex schedules for career, content, bugfix, radar, travel, event, project briefing, recruiter, SEO/GEO, language orchestration, and skill maintenance jobs. - Updated active
kevin-wikischedules to read canonicalautomations/<slug>.mdfiles and require output/state/log writeback. - Created missing Codex-local schedules for
source-compile,capability-harvest,cross-project-learning,calendar-sync,email-sync,meeting-sync,oss-license-audit,scheduling-audit, anddaily-work-summary. - Archived the stale disk-only
source-compilescheduler entry to~/.codex/automations-archive/source-compile-orphan-2026-06-28.
Recent Output Review On 2026-06-28
Sampled Codex scheduler outputs produced these writeback decisions:
| Output | Decision |
|---|---|
| Recent Signal Radar thread | Durable pattern is scheduler writeback drift, not each transient signal. DESIGN.md ecosystem signals were already covered in DESIGN.md and Awesome Design MD. Agent-browser and agent-observability signals should route through source compile or capability harvest when primary sources are captured. Source: Codex thread 019f0b1a-8c35-7d02-ac64-592dd53f6fe4, 2026-06-28 |
outputs/2026-06-23/skill-maintenance/codex.md |
No standalone page needed; the lesson is covered by current skill/routing compaction and the durable prompt contract on this page. |
outputs/2026-06-17/cross-project-learning/codex.md |
No durable wiki update needed; the run found no new candidates after existing capability-routing updates. |
outputs/2026-05-13/recruiter-discovery/codex-automation.md |
Treat as stale evidence. Rerun recruiter-discovery under the current writeback contract before updating wiki/career/ pages. |
Timeline
- 2026-07-01 | Added Generated Surface Contract as the source/projection authority underneath the heartbeat generated-surface refresh checklist. Source: User request, 2026-07-01
- 2026-07-01 | Linked scheduling to the refreshed heartbeat companion pages for freshness interpretation, automation proof, sub-daily cadence, overdue handling, and generated-surface closeout. Source: User request, 2026-07-01; Operational Heartbeat
- 2026-06-30 | Added the every-four-hours Slack/Gmail/X capture loop and required ISO state timestamps for sub-daily schedules. Source: User request, 2026-06-30;
automations/slack-sync.md;scripts/check-freshness.ts - 2026-06-28 | Created the scheduling operating model to define heartbeat semantics, Codex prompt requirements, writeback targets, and schedule audit findings. Source: User request, 2026-06-28; local Codex scheduler audit