From 2e945c41f4140faa4e12bc9f4418c5fdfa8669c0 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Fri, 13 Feb 2026 21:47:32 -0500 Subject: [PATCH] Clarify scheduler log-directory bootstrap and first-run behavior --- src/prompts/META_PROMPTS.md | 30 ++++++++++++++++-------------- src/prompts/scheduler-flow.md | 19 ++++++++++++++----- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/src/prompts/META_PROMPTS.md b/src/prompts/META_PROMPTS.md index 2f96d81..d87d01d 100644 --- a/src/prompts/META_PROMPTS.md +++ b/src/prompts/META_PROMPTS.md @@ -25,14 +25,15 @@ Use the `locked` array from the JSON output as the exclusion set. MUST 3: Run these commands in this order: 1) test -f AGENTS.md && cat AGENTS.md || echo "No AGENTS.md found; continuing" (missing AGENTS.md is non-fatal) -2) ls -1 task-logs/daily/ | sort | tail -n 1 -3) Select next roster agent not in exclusion set -4) Claim via repository lock: +2) mkdir -p task-logs/daily task-logs/weekly +3) ls -1 task-logs/daily/ | sort | tail -n 1 +4) Select next roster agent not in exclusion set (empty directory means first run; choose first eligible roster entry) +5) Claim via repository lock: AGENT_PLATFORM= npm run lock:lock -- --agent --cadence daily - Exit 0 = lock acquired, proceed. Exit 3 = race lost, go back to step 2. -5) Execute selected prompt from src/prompts/daily/ -6) Run repository checks (for example: npm run lint) -7) Create `_completed.md` or `_failed.md`, commit, push + Exit 0 = lock acquired, proceed. Exit 3 = race lost, go back to step 3. +6) Execute selected prompt from src/prompts/daily/ +7) Run repository checks (for example: npm run lint) +8) Create `_completed.md` or `_failed.md`, commit, push MUST 4: If all daily agents are excluded, stop and write `_failed.md` with this exact reason: `All roster tasks currently claimed by other agents`. ``` @@ -58,14 +59,15 @@ Use the `locked` array from the JSON output as the exclusion set. MUST 3: Run these commands in this order: 1) test -f AGENTS.md && cat AGENTS.md || echo "No AGENTS.md found; continuing" (missing AGENTS.md is non-fatal) -2) ls -1 task-logs/weekly/ | sort | tail -n 1 -3) Select next roster agent not in exclusion set -4) Claim via repository lock: +2) mkdir -p task-logs/daily task-logs/weekly +3) ls -1 task-logs/weekly/ | sort | tail -n 1 +4) Select next roster agent not in exclusion set (empty directory means first run; choose first eligible roster entry) +5) Claim via repository lock: AGENT_PLATFORM= npm run lock:lock -- --agent --cadence weekly - Exit 0 = lock acquired, proceed. Exit 3 = race lost, go back to step 2. -5) Execute selected prompt from src/prompts/weekly/ -6) Run repository checks (for example: npm run lint) -7) Create `_completed.md` or `_failed.md`, commit, push + Exit 0 = lock acquired, proceed. Exit 3 = race lost, go back to step 3. +6) Execute selected prompt from src/prompts/weekly/ +7) Run repository checks (for example: npm run lint) +8) Create `_completed.md` or `_failed.md`, commit, push MUST 4: If all weekly agents are excluded, stop and write `_failed.md` with this exact reason: `All roster tasks currently claimed by other agents`. ``` diff --git a/src/prompts/scheduler-flow.md b/src/prompts/scheduler-flow.md index a4fcfdd..2e29553 100644 --- a/src/prompts/scheduler-flow.md +++ b/src/prompts/scheduler-flow.md @@ -22,16 +22,25 @@ Use this document for all scheduler runs. test -f AGENTS.md && cat AGENTS.md || echo "No AGENTS.md found; continuing" ``` -4. Find latest cadence log file, then choose next roster agent not in exclusion set: +4. Bootstrap log directories before listing files: + + ```bash + mkdir -p + ``` + +5. Find latest cadence log file, then choose next roster agent not in exclusion set: ```bash ls -1 | sort | tail -n 1 ``` -5. If every roster agent is excluded, write a `_failed.md` log with: + - An empty `` 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. + +6. If every roster agent is excluded, write a `_failed.md` log with: `All roster tasks currently claimed by other agents` and stop. -6. Claim selected agent: +7. Claim selected agent: ```bash AGENT_PLATFORM= \ @@ -42,6 +51,6 @@ Use this document for all scheduler runs. - Exit `3`: race lost/already locked, return to step 2. - Exit `2`: lock backend error, write `_failed.md` with reason `Lock backend error`, stop. -7. Execute `/` end-to-end. +8. Execute `/` end-to-end. -8. Create exactly one final status file (`_completed.md` or `_failed.md`), run repo checks, commit, and push. +9. Create exactly one final status file (`_completed.md` or `_failed.md`), run repo checks, commit, and push.