Clarify scheduler log-directory bootstrap and first-run behavior

This commit is contained in:
thePR0M3TH3AN committed 2026-02-13 21:47:32 -05:00
1 parent 3d08f37896
commit 2e945c41f4
2 files changed
+30 -19

No files matched your search

+16 -14
View File
@@ -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=<platform> npm run lock:lock -- --agent <agent-name> --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=<platform> npm run lock:lock -- --agent <agent-name> --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`.
```
+14 -5
View File
@@ -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 <log_dir>
```
5. Find latest cadence log file, then choose next roster agent not in exclusion set:
```bash
ls -1 <log_dir> | sort | tail -n 1
```
5. If every roster agent is excluded, write a `_failed.md` log with:
- 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.
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=<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 `<prompt_dir>/<prompt-file>` end-to-end.
8. Execute `<prompt_dir>/<prompt-file>` 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.