mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-11-01 10:21:53 +00:00
1.7 KiB
1.7 KiB
Scheduler Flow (Single Source of Truth)
Use this document for all scheduler runs.
Numbered MUST Procedure
-
Set cadence variables before any command:
cadence=dailyorweeklylog_dir=task-logs/<cadence>/branch_prefix=agents/<cadence>/prompt_dir=src/prompts/<cadence>/
-
Run preflight to build the exclusion set:
if daily: `npm run lock:check:daily`; if weekly: `npm run lock:check:weekly` -
Read policy file(s). This step is conditional: if
AGENTS.mdis missing, continue without failing.test -f AGENTS.md && cat AGENTS.md || echo "No AGENTS.md found; continuing" -
Bootstrap log directories before listing files:
mkdir -p <log_dir> -
Find latest cadence log file, then choose next roster agent not in exclusion set:
ls -1 <log_dir> | sort | tail -n 1- An empty
<log_dir>is valid and means there are no prior cadence logs yet (first run). - On first run, select the first eligible roster entry that is not in the exclusion set.
- An empty
-
If every roster agent is excluded, write a
_failed.mdlog with:All roster tasks currently claimed by other agentsand stop. -
Claim selected agent:
AGENT_PLATFORM=<platform> \ npm run lock:lock -- --agent <agent-name> --cadence <cadence>- Exit
0: lock acquired, continue. - Exit
3: race lost/already locked, return to step 2. - Exit
2: lock backend error, write_failed.mdwith reasonLock backend error, stop.
- Exit
-
Execute
<prompt_dir>/<prompt-file>end-to-end. -
Create exactly one final status file (
_completed.mdor_failed.md), run repo checks, commit, and push.