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