feat(automation): triage classifies bug vs feature
Triage now writes CLAUDE_TRIAGE_TYPE.txt (bug|feature) and the watcher applies the matching label to every triaged issue (additive). Previously bug/feature labels were never applied by the pipeline. Also shows the type in the triage comment. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
aec6d2971f
commit
520b1527e0
2 changed files with 20 additions and 7 deletions
|
|
@ -111,9 +111,10 @@ portal ──(triage)──▶ triaged + claude-queue ─▶ claude-working ─
|
||||||
```
|
```
|
||||||
|
|
||||||
- **Triage owns routing for every `portal` issue.** Each untriaged portal issue is
|
- **Triage owns routing for every `portal` issue.** Each untriaged portal issue is
|
||||||
triaged once (`maxTriagePerRun` per run); triage adds `triaged` plus `claude-queue`
|
triaged once (`maxTriagePerRun` per run); triage adds `triaged`, a routing label
|
||||||
or `interactive` and posts a breakdown. Triage skips an issue only once it carries
|
(`claude-queue` or `interactive`), a type label (`bug` or `feature`), and posts a
|
||||||
`triaged`, `interactive`, `claude-working`, `claude-pr`, or `claude-failed`.
|
breakdown. Triage skips an issue only once it carries `triaged`, `interactive`,
|
||||||
|
`claude-working`, `claude-pr`, or `claude-failed`.
|
||||||
- **`claude-queue` alone does NOT skip triage on a portal issue.** The Report Issue
|
- **`claude-queue` alone does NOT skip triage on a portal issue.** The Report Issue
|
||||||
button may stamp `claude-queue` at creation; triage still claims the issue and
|
button may stamp `claude-queue` at creation; triage still claims the issue and
|
||||||
decides routing (stripping the stray `claude-queue` if it routes to `interactive`).
|
decides routing (stripping the stray `claude-queue` if it routes to `interactive`).
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ while [ "$t" -lt "$n_triage" ]; do
|
||||||
log "-- Triaging #$num: $title"
|
log "-- Triaging #$num: $title"
|
||||||
reset_clone
|
reset_clone
|
||||||
comments=$(comments_block "$num")
|
comments=$(comments_block "$num")
|
||||||
rm -f "$WORKDIR/CLAUDE_TRIAGE_LABEL.txt" "$WORKDIR/CLAUDE_TRIAGE.md"
|
rm -f "$WORKDIR/CLAUDE_TRIAGE_LABEL.txt" "$WORKDIR/CLAUDE_TRIAGE_TYPE.txt" "$WORKDIR/CLAUDE_TRIAGE.md"
|
||||||
|
|
||||||
prompt_file=$(mktemp)
|
prompt_file=$(mktemp)
|
||||||
{
|
{
|
||||||
|
|
@ -192,8 +192,11 @@ while [ "$t" -lt "$n_triage" ]; do
|
||||||
printf '%s\n' " - interactive = needs human steering: ambiguous or underspecified, needs business content"
|
printf '%s\n' " - interactive = needs human steering: ambiguous or underspecified, needs business content"
|
||||||
printf '%s\n' " or a design decision, a schema migration, permissions/payments changes, an external"
|
printf '%s\n' " or a design decision, a schema migration, permissions/payments changes, an external"
|
||||||
printf '%s\n' " dependency, or a large feature needing visual verification."
|
printf '%s\n' " dependency, or a large feature needing visual verification."
|
||||||
printf '%s\n' "3. Write TWO files in the repository root, nothing else:"
|
printf '%s\n' "3. Classify the issue as a BUG (something is broken / not working as intended) or a"
|
||||||
printf '%s\n' " - CLAUDE_TRIAGE_LABEL.txt -- a single line with EXACTLY one word: claude-queue OR interactive"
|
printf '%s\n' " FEATURE (new capability or a change/enhancement to existing behaviour)."
|
||||||
|
printf '%s\n' "4. Write THREE files in the repository root, nothing else:"
|
||||||
|
printf '%s\n' " - CLAUDE_TRIAGE_LABEL.txt -- one line, EXACTLY one word: claude-queue OR interactive"
|
||||||
|
printf '%s\n' " - CLAUDE_TRIAGE_TYPE.txt -- one line, EXACTLY one word: bug OR feature"
|
||||||
printf '%s\n' " - CLAUDE_TRIAGE.md -- your requirements breakdown as markdown: action items, files/areas"
|
printf '%s\n' " - CLAUDE_TRIAGE.md -- your requirements breakdown as markdown: action items, files/areas"
|
||||||
printf '%s\n' " involved, open questions, and a final one-line 'Routing rationale: ...'."
|
printf '%s\n' " involved, open questions, and a final one-line 'Routing rationale: ...'."
|
||||||
} > "$prompt_file"
|
} > "$prompt_file"
|
||||||
|
|
@ -212,8 +215,17 @@ while [ "$t" -lt "$n_triage" ]; do
|
||||||
fi
|
fi
|
||||||
breakdown=""
|
breakdown=""
|
||||||
[ -f "$WORKDIR/CLAUDE_TRIAGE.md" ] && breakdown=$(cat "$WORKDIR/CLAUDE_TRIAGE.md")
|
[ -f "$WORKDIR/CLAUDE_TRIAGE.md" ] && breakdown=$(cat "$WORKDIR/CLAUDE_TRIAGE.md")
|
||||||
|
type=""
|
||||||
|
if [ -f "$WORKDIR/CLAUDE_TRIAGE_TYPE.txt" ]; then
|
||||||
|
traw=$(cat "$WORKDIR/CLAUDE_TRIAGE_TYPE.txt")
|
||||||
|
if printf '%s' "$traw" | grep -qiw feature; then type=feature
|
||||||
|
elif printf '%s' "$traw" | grep -qiw bug; then type=bug; fi
|
||||||
|
fi
|
||||||
reset_clone
|
reset_clone
|
||||||
|
|
||||||
|
# Classify bug/feature regardless of routing outcome (additive, never clears).
|
||||||
|
[ -n "$type" ] && { add_labels "$num" "$type"; log "Classified #$num as $type"; }
|
||||||
|
|
||||||
if [ -z "$label" ]; then
|
if [ -z "$label" ]; then
|
||||||
log "Triage for #$num produced no valid decision; leaving for a human"
|
log "Triage for #$num produced no valid decision; leaving for a human"
|
||||||
# Mark triaged + strip any button-stamped claude-queue so it is NOT auto-fixed.
|
# Mark triaged + strip any button-stamped claude-queue so it is NOT auto-fixed.
|
||||||
|
|
@ -238,7 +250,7 @@ while [ "$t" -lt "$n_triage" ]; do
|
||||||
|
|
||||||
$note
|
$note
|
||||||
|
|
||||||
**Routing:** \`$label\`"
|
**Routing:** \`$label\`${type:+ | **Type:** \`$type\`}"
|
||||||
log "Triaged #$num -> $label"
|
log "Triaged #$num -> $label"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue