diff --git a/package.json b/package.json index bb0642a..2bca5d3 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,8 @@ "lock:lock": "node bin/torch-lock.mjs lock", "dashboard:serve": "node bin/torch-lock.mjs dashboard", "build": "node build.mjs", - "lint": "eslint ." + "lint": "eslint .", + "lock:complete": "node bin/torch-lock.mjs complete" }, "dependencies": { "nostr-tools": "2.19.4", diff --git a/src/prompts/META_PROMPTS.md b/src/prompts/META_PROMPTS.md index dba3d3a..fa93569 100644 --- a/src/prompts/META_PROMPTS.md +++ b/src/prompts/META_PROMPTS.md @@ -50,7 +50,18 @@ MUST 3: Run these commands in this order: 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 +8) Publish completion before writing `_completed.md`: + AGENT_PLATFORM= npm run lock:complete -- --agent --cadence daily + (Equivalent command allowed: torch-lock complete --agent --cadence daily) + - Exit 0: continue. + - Exit non-zero: fail the run, write `_failed.md` with a clear completion-publish failure reason and retry guidance, then stop. +9) Only after step 8 succeeds, write final task log (`_completed.md` for success, `_failed.md` for failure), commit, push + + Worked example (required order): + - `AGENT_PLATFORM=codex npm run lock:lock -- --agent content-audit-agent --cadence daily` + - execute selected prompt work + - `AGENT_PLATFORM=codex npm run lock:complete -- --agent content-audit-agent --cadence daily` (complete, permanent) + - write `task-logs/daily/__content-audit-agent__completed.md` 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`. ``` @@ -101,7 +112,18 @@ MUST 3: Run these commands in this order: 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 +8) Publish completion before writing `_completed.md`: + AGENT_PLATFORM= npm run lock:complete -- --agent --cadence weekly + (Equivalent command allowed: torch-lock complete --agent --cadence weekly) + - Exit 0: continue. + - Exit non-zero: fail the run, write `_failed.md` with a clear completion-publish failure reason and retry guidance, then stop. +9) Only after step 8 succeeds, write final task log (`_completed.md` for success, `_failed.md` for failure), commit, push + + Worked example (required order): + - `AGENT_PLATFORM=codex npm run lock:lock -- --agent bug-reproducer-agent --cadence weekly` + - execute selected prompt work + - `AGENT_PLATFORM=codex npm run lock:complete -- --agent bug-reproducer-agent --cadence weekly` (complete, permanent) + - write `task-logs/weekly/__bug-reproducer-agent__completed.md` 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 d844a0f..4478e53 100644 --- a/src/prompts/scheduler-flow.md +++ b/src/prompts/scheduler-flow.md @@ -88,4 +88,30 @@ Use this document for all scheduler runs. 8. Execute `/` end-to-end. -9. Create exactly one final status file (`_completed.md` or `_failed.md`), run repo checks, commit, and push. +9. Run repository checks (for example: `npm run lint`). + +10. Publish completion before writing final success log: + + ```bash + AGENT_PLATFORM= \ + npm run lock:complete -- --agent --cadence + ``` + + (Equivalent invocation is allowed: `torch-lock complete --agent --cadence `.) + + - Exit `0`: completion published successfully; continue to step 11. + - Exit non-zero: **fail the run**, write `_failed.md` with a clear reason that completion publish failed and retry guidance (for example: `Retry npm run lock:complete -- --agent --cadence after verifying relay connectivity`), then stop. + +11. Create final task log only after step 10 succeeds: + + - `_completed.md` MUST be created only after completion publish succeeds. + - `_failed.md` is required when step 10 fails, and should include the failure reason and next retry action. + +12. Commit and push. + +Worked post-task example (MUST order): + +1. `AGENT_PLATFORM=codex npm run lock:lock -- --agent content-audit-agent --cadence daily` +2. Execute `src/prompts/daily/content-audit-agent.md` +3. `AGENT_PLATFORM=codex npm run lock:complete -- --agent content-audit-agent --cadence daily` (complete, permanent) +4. Write `task-logs/daily/2026-02-14T10-00-00Z__content-audit-agent__completed.md`