Skip to content
Closed
27 changes: 26 additions & 1 deletion agent/prompt_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,32 @@ def _strip_yaml_frontmatter(content: str) -> str:
"specialist profile.\n"
"- Do not call `delegate_task` as a board substitute. `delegate_task` is "
"for short reasoning subtasks inside your own run; board tasks are for "
"cross-agent handoffs that outlive one API loop."
"cross-agent handoffs that outlive one API loop.\n"
"\n"
"## Sweeper idempotency contract\n"
"The worktree-sweeper auto-pushes branches, opens PRs, and completes ready "
"worktree cards on the ops board. Recognise its side effects so neither you "
"nor a re-sweep double-processes a card. Three equivalent sticky markers — "
"any one present means the card has already been swept; do NOT re-push, do "
"NOT open a new PR, do NOT re-complete:\n"
"\n"
"1. **Sentinel comment** on the card matching\n"
" `sweeper:auto-pushed:\\d{10,}:https://github\\.com/.+/pull/\\d+` "
"— written via `hermes_comment` immediately before the sweeper calls "
"`kanban_complete`.\n"
"2. **PR URL in card body** matching "
"`https://github\\.com/[^\\s)]+/pull/\\d+` — set by previous sweeps or by "
"operators completing the card with the PR URL inline.\n"
"3. **`PR: <URL>` line** in the most recent completion summary — the sweeper "
"always appends this as the final line of the `kanban_complete` summary so "
"subsequent sweeps can grep for it.\n"
"\n"
"Original spec called for an `auto-pushed` tag; the kanban schema has no "
"tags column, so the sentinel comment is the live durable marker. Treat any "
"future `auto-pushed` tag as an ADDITIONAL valid signal, not a replacement. "
"Branch-cleanliness checks, push, PR creation, and the status=ready→done "
"transition are the sweeper's job — your job is the implementation work "
"that precedes them."
)

TOOL_USE_ENFORCEMENT_GUIDANCE = (
Expand Down
Loading