Compare commits

..

1 commit

Author SHA1 Message Date
Agent
632ae7054b fix: fix: reproduce-agent formula — primary goal is reproduction, not root cause (#320)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-04-06 20:54:15 +00:00

View file

@ -355,23 +355,20 @@ _post_comment() {
# Exit gate logic:
# 1. Can I reproduce it? → NO → rejected/blocked → EXIT
# → YES → continue
# 2. Is the cause obvious? → YES → backlog issue for dev → EXIT
# 2. Is the cause obvious? → YES → in-progress + backlog issue → EXIT
# → NO → in-triage → EXIT
#
# Label combinations (on the ORIGINAL issue):
# - Reproduced + obvious cause: reproduced (custom status) → backlog issue created
# - Reproduced + cause unclear: in-triage → Triage-agent
# - Cannot reproduce: rejected → Human review
# - Inconclusive (timeout/error): blocked → Gardener/human
#
# The newly created fix issue (when cause is obvious) gets backlog label
# so dev-poll will pick it up for implementation.
# Label combinations:
# - Reproduced + obvious cause: bug-report + in-progress → Dev-agent
# - Reproduced + cause unclear: bug-report + in-triage → Triage-agent
# - Cannot reproduce: bug-report + rejected → Human review
# - Inconclusive (timeout/error): bug-report + blocked → Gardener/human
# Remove bug-report label (we are resolving it)
BUG_REPORT_ID=$(_label_id "bug-report" "#e4e669")
_remove_label "$ISSUE_NUMBER" "$BUG_REPORT_ID"
# Determine outcome and apply appropriate labels
# Determine outcome category and apply appropriate labels
LABEL_NAME=""
LABEL_COLOR=""
COMMENT_HEADER=""
@ -383,13 +380,13 @@ case "$OUTCOME" in
ROOT_CAUSE=$(grep -m1 "^ROOT_CAUSE=" "/tmp/reproduce-findings-${ISSUE_NUMBER}.md" 2>/dev/null \
| sed 's/^ROOT_CAUSE=//' || echo "")
if [ -n "$ROOT_CAUSE" ] && [ "$ROOT_CAUSE" != "See findings on issue #${ISSUE_NUMBER}" ]; then
# Obvious cause → add reproduced status label, create backlog issue for dev-agent
LABEL_NAME="reproduced"
LABEL_COLOR="#0075ca"
# Obvious cause → bug-report + in-progress → Dev-agent
LABEL_NAME="in-progress"
LABEL_COLOR="#1d76db"
COMMENT_HEADER="## Reproduce-agent: **Reproduced with obvious cause** :white_check_mark: :zap:"
CREATE_BACKLOG_ISSUE=true
else
# Cause unclear → in-triage → Triage-agent
# Cause unclear → bug-report + in-triage → Triage-agent
LABEL_NAME="in-triage"
LABEL_COLOR="#d93f0b"
COMMENT_HEADER="## Reproduce-agent: **Reproduced, cause unclear** :white_check_mark: :mag:"
@ -397,14 +394,14 @@ case "$OUTCOME" in
;;
cannot-reproduce)
# Cannot reproduce → rejected → Human review
# Cannot reproduce → bug-report + rejected → Human review
LABEL_NAME="rejected"
LABEL_COLOR="#e4e669"
COMMENT_HEADER="## Reproduce-agent: **Cannot reproduce** :x:"
;;
needs-triage)
# Inconclusive (timeout, env issues) → blocked → Gardener/human
# Inconclusive (timeout, env issues) → bug-report + blocked → Gardener/human
LABEL_NAME="blocked"
LABEL_COLOR="#e11d48"
COMMENT_HEADER="## Reproduce-agent: **Inconclusive, blocked** :construction:"
@ -441,7 +438,7 @@ Root cause (quick log analysis): ${ROOT_CAUSE}
-d "$(jq -nc \
--arg t "fix: $(echo "$ISSUE_TITLE" | sed 's/^bug:/fix:/' | sed 's/^feat:/fix:/')" \
--arg b "$BACKLOG_BODY" \
'{title:$t, body:$b, labels:[{"name":"backlog"}]}' 2>/dev/null)" >/dev/null 2>&1 || \
'{title:$t, body:$b}')" >/dev/null 2>&1 || \
log "WARNING: failed to create backlog issue"
fi