@lead: issue #16 — fully-automatic autopilot (label-gated @pm auto-delegate + @qa merge)

This commit is contained in:
2026-07-04 19:23:20 +00:00
parent 23cc3e192e
commit df0f6d6543
5 changed files with 137 additions and 3 deletions
+33 -1
View File
@@ -3,8 +3,10 @@
# plain-text reply (/tmp/agent_out.md) plus the raw event stream (/tmp/events.jsonl).
#
# Required env (provided by the workflow step):
# ANTHROPIC_API_KEY AGENT_TOKEN NAME MODEL VISION MODE HAS_IMAGES BRANCH NUM TITLE IBODY CMT
# ANTHROPIC_API_KEY AGENT_TOKEN NAME MODEL VISION MODE HAS_IMAGES BRANCH AUTOPILOT NUM TITLE
# IBODY CMT
# FILES (the opencode -f image flags, from the imgs step output)
# AUTOPILOT is 'true' when the issue carries the `autopilot` label (label-gated autopilot mode).
set -u
[ -z "$CMT" ] && CMT="(a new issue was just opened — assess it)"
@@ -51,6 +53,36 @@ if [ "$MODE" = "comment" ]; then
END_SUBTASKS
The automation creates the milestone + one sub-issue per line (each linked to this issue). It
does NOT auto-start any dev — the maintainer @mentions an agent on each sub-issue when ready."
if [ "$AUTOPILOT" = "true" ]; then
ACTION="$ACTION
AUTOPILOT MODE IS ACTIVE (this issue carries the 'autopilot' label). This OVERRIDES the
two-phase approval gate above: do NOT ask '@ffaerber ready to start building?' and do NOT wait
for a 'yes'. When the task is clear, present your SHORT plan naming the best teammate to build it
AND end your reply with a 'DELEGATE: @<agent>' line in the SAME turn to hand off immediately.
Prefer @junior for small/low-risk (mostly YAML/compose/config), @senior/@lead for complex or
multi-file work. Only skip delegating (and instead ask @ffaerber) if the task is genuinely
ambiguous or unsafe — otherwise plan-and-delegate now."
fi
fi
if [ "$NAME" = "qa" ]; then
ACTION="$ACTION
As QA you verify a change works: read the PR/issue, drive the web app with your headless
browser if there is a URL, and report bugs or confirm behavior. You normally do NOT merge —
a human does that."
if [ "$AUTOPILOT" = "true" ]; then
ACTION="$ACTION
AUTOPILOT MODE IS ACTIVE (this issue/PR carries the 'autopilot' label). This grants you a
NARROW, one-time merge authority for THIS PR only:
- If, after verifying, the PR is correct and any CI checks are green, end your reply with EXACTLY
one line: 'MERGE_PR'. The automation will then merge the PR and close the linked issue for you.
Do NOT merge via any other means; only the MERGE_PR marker triggers the merge.
- If you find ANY bug, doubt, or the change is not clearly correct, do NOT merge. Instead describe
the problem clearly and end your reply with EXACTLY one line: 'HALT_AUTOPILOT'. The automation
removes the 'autopilot' label (returning this issue to normal human control) and leaves
it for @ffaerber to decide next steps. Never auto-bounce back to a dev.
Emit AT MOST one of MERGE_PR or HALT_AUTOPILOT, and only after you have actually verified. When in
doubt, prefer HALT_AUTOPILOT."
fi
fi
else
ACTION="You start on git branch '${BRANCH}', with git and push credentials already configured.