Skip to content
Built 26/04/15 21:30commit c6006a5

Automation

中文 | English

Use macOS launchd for periodic Codex maintenance runs.

Config

Global config lives at ~/.llm-wiki/config.json.

Suggested multi-task scheduler block:

json
{
  "scheduler": {
    "enabled": true,
    "codex_path": "/absolute/path/to/codex",
    "log_dir": "/Users/name/Library/Logs/llm-wiki",
    "max_runtime_minutes": 20
  },
  "schedulers": {
    "content_patrol": {
      "interval_minutes": 30,
      "label": "com.bytedance.llmwiki.maintenance.content",
      "prompt": "$llm-wiki 对这个 vault 做一次内容巡检。"
    },
    "taxonomy_patrol": {
      "interval_minutes": 1440,
      "label": "com.bytedance.llmwiki.maintenance.taxonomy",
      "max_runtime_minutes": 45,
      "prompt": "$llm-wiki 对这个 vault 做一次目录结构巡检。"
    }
  }
}

Scripts

  • scripts/run_scheduled_maintenance.py runs one non-interactive Codex maintenance pass
  • scripts/manage_launch_agent.py installs, uninstalls, checks status, or runs one or many named maintenance tasks immediately
  • scripts/move_raw_sources.py safely reorganizes raw/ while rewriting impacted repo links
  • scripts/extract_visual_sources.py extracts OCR text from screenshots and local raw images before ingest

Notes

  • interval_minutes maps to launchd StartInterval
  • reinstall the launch agents after changing schedule-related config
  • log files are written outside the repo to avoid polluting git history
  • in named-task mode, each task should have its own lock file and state file defaults so content patrols and taxonomy patrols do not block each other
  • scheduled runs should persist structured state files so status checks can report running, completed, timed_out, failed, or skipped
  • if one run of a given task times out or fails, the next run of the same task should receive that partial summary as continuation context
  • scheduled runs should use a short prompt plus structured stdin context so Codex starts from repository facts instead of a long natural-language brief
  • keep taxonomy refactors on a slower cadence than content patrols unless the user explicitly wants aggressive automated reorganization