Skip to content
Built 26/04/17 09:39commit 8de3d61

Automation

中文 | English

Global Config

Scheduled maintenance uses the global config:

text
~/.llm-wiki/config.json

The recommended layout now separates shared defaults from named tasks:

json
{
  "root": "/Users/bytedance/csh/llm-wiki",
  "scheduler": {
    "enabled": true,
    "codex_path": "/Users/bytedance/.nvm/versions/node/v23.11.1/bin/codex",
    "log_dir": "/Users/bytedance/.llm-wiki/logs",
    "max_runtime_minutes": 20
  },
  "schedulers": {
    "content_patrol": {
      "interval_minutes": 30,
      "label": "com.bytedance.llmwiki.maintenance.content",
      "prompt": "$llm-wiki run a content patrol on this vault..."
    },
    "taxonomy_patrol": {
      "interval_minutes": 1440,
      "label": "com.bytedance.llmwiki.maintenance.taxonomy",
      "max_runtime_minutes": 45,
      "prompt": "$llm-wiki run a taxonomy patrol on this vault..."
    }
  }
}

Notes:

  • scheduler is the shared default block.
  • schedulers contains named tasks that inherit from scheduler and override what they need.
  • The old single-scheduler format still works for backward compatibility, but new setups should prefer named tasks.

Use two scheduled tasks:

  • content_patrol Every 30 minutes. Focus on integrating new or changed raw/ content, translation drift, index/log drift, and obvious missing cross-links.
  • taxonomy_patrol Once per day. Focus on whole-project directory structure according to the llm-wiki taxonomy rules for raw/ and wiki/, and only land refactors when the structure is genuinely drifting.

This split keeps frequent maintenance conservative while reserving heavier directory refactors for a slower cadence.

Change The Interval

Edit:

text
~/.llm-wiki/config.json

Change the specific task:

json
"schedulers": {
  "content_patrol": {
    "interval_minutes": 30
  },
  "taxonomy_patrol": {
    "interval_minutes": 1440
  }
}

Examples:

  • 30: every 30 minutes
  • 60: every hour
  • 120: every 2 hours
  • 1440: once per day

After changing any schedule-related field, reinstall the launch agents:

bash
python3 /Users/bytedance/csh/llm-wiki/.codex/skills/llm-wiki/scripts/manage_launch_agent.py install

This is required because launchd writes StartInterval into each plist.

Common Commands

Check every configured task:

bash
python3 /Users/bytedance/csh/llm-wiki/.codex/skills/llm-wiki/scripts/manage_launch_agent.py status

Check one task:

bash
python3 /Users/bytedance/csh/llm-wiki/.codex/skills/llm-wiki/scripts/manage_launch_agent.py status taxonomy_patrol

Run all enabled tasks immediately:

bash
python3 /Users/bytedance/csh/llm-wiki/.codex/skills/llm-wiki/scripts/manage_launch_agent.py run-now

Run one task immediately:

bash
python3 /Users/bytedance/csh/llm-wiki/.codex/skills/llm-wiki/scripts/manage_launch_agent.py run-now content_patrol

Install or reinstall every enabled scheduled task:

bash
python3 /Users/bytedance/csh/llm-wiki/.codex/skills/llm-wiki/scripts/manage_launch_agent.py install

Install or reinstall one task:

bash
python3 /Users/bytedance/csh/llm-wiki/.codex/skills/llm-wiki/scripts/manage_launch_agent.py install taxonomy_patrol

Uninstall every configured task:

bash
python3 /Users/bytedance/csh/llm-wiki/.codex/skills/llm-wiki/scripts/manage_launch_agent.py uninstall

What Each Task Checks

content_patrol should focus on:

  • newly added or changed raw content
  • screenshot-heavy raw sources that may require OCR extraction before synthesis
  • broken wiki/source/raw links
  • broken raw-local navigation links after path changes
  • missing or stale translation siblings
  • raw markdown rendering hazards such as malformed links, transient blob: embeds, unmatched HTML tags, or angle-bracket placeholders exposed outside code spans
  • drift in index.md, index.zh.md, or log.md
  • obviously missing cross-links

When one of these issues is clearly syntax-only, content_patrol should repair it directly in the same pass instead of merely reporting it.

taxonomy_patrol should focus on:

  • raw taxonomy drift when raw/ has become hard to navigate
  • raw/source families that are already clear enough to deserve their own subtree
  • wiki sections where a topic family, source family, or navigation slice is obvious enough to group together
  • whole-project link repair after page or raw moves
  • bilingual sibling repair after directory moves
  • overview, index, and source-page navigation drift caused by taxonomy changes

Treat family clarity and navigability as the primary trigger. The taxonomy task should stay conservative and avoid no-op reshuffles, but it should not wait for arbitrary directory-count thresholds when a stable grouping is already obvious.

Overlap Protection

Overlap protection is per task.

If a previous content_patrol is still running, the next content_patrol run is skipped, but taxonomy_patrol can still run if it has its own free lock. Each task has its own:

  • lock file
  • structured state file
  • final summary file

If a task times out or fails:

  • status shows that task state explicitly
  • the next run of the same task receives the previous summary and log excerpt as continuation context
  • the next run can continue unfinished work instead of restarting blindly

Patrol Logs

Logs live under:

text
~/.llm-wiki/logs/

Single-task legacy mode keeps the old layout:

text
~/.llm-wiki/logs/2026-04-08/
  maintenance-20260408-150012.log
  maintenance-20260408-150012-last-message.txt

Named-task mode groups logs by task:

text
~/.llm-wiki/logs/content-patrol/2026-04-09/
  maintenance-content-patrol-20260409-132143.log
  maintenance-content-patrol-20260409-132143-last-message.txt

~/.llm-wiki/logs/taxonomy-patrol/2026-04-09/
  maintenance-taxonomy-patrol-20260409-090001.log
  maintenance-taxonomy-patrol-20260409-090001-last-message.txt

State files also split by task in named-task mode, for example:

text
~/.llm-wiki/content-patrol-state.json
~/.llm-wiki/taxonomy-patrol-state.json

This makes it obvious which maintenance lane ran, what it did, and whether only one lane needs attention.