Skip to content

Commit f896dba

Browse files
cliffhallclaude
andcommitted
fix(issue-triage): harden the PR close loop and scope the step 0 close rule
Copilot round 1 on #4906: - the manifest uses '-' for 'no issue', because read collapses adjacent tabs and an empty field shifted the reason into the issue column - class slugs are defined in the table; the loop whitelists them, skips 'security', and stops on anything unknown instead of closing it - the backlog sweep's close label and #4875 reference (SWEEP_LABEL, SWEEP_REF) are part of the loop, and the step 0 issue closes take the same two - step 0's close rule covers only rows whose Action is Close, never a security report Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: cliffhall <[email protected]>
1 parent ad334f9 commit f896dba

1 file changed

Lines changed: 37 additions & 19 deletions

File tree

‎.claude/skills/issue-triage/SKILL.md‎

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ reporter is notified of each one. So:
5656

5757
Read each unboarded issue before sweeping it in. Most are real reports, but some
5858
belong elsewhere, and boarding one of those would park it in a review queue for
59-
work this repository does not do. A class other than the last row is closed
59+
work this repository does not do. A class whose Action is **Close** is closed
6060
with its [canned response](#canned-responses), gets **no card** (`Done` means
6161
shipped, and closed-not-planned work never goes on the board), and needs no
62-
labels.
62+
labels. A security report is never closed by triage.
6363

6464
| Class | Recognized by | Action | Response |
6565
| --- | --- | --- | --- |
@@ -328,20 +328,22 @@ is treated as truncated, like the issue listing in pass 1. The
328328
### 2. Classify and write the manifest
329329

330330
Read each outside PR (its description, its diff, its linked issues) and give it
331-
exactly one class. The manifest is a TSV in `$D`: PR number, class, the issue
332-
its close comment will name (blank when nothing is harvested), and a one-line
333-
reason.
334-
335-
| Class | Recognized by | Harvest? | Close with |
336-
| --- | --- | --- | --- |
337-
| **Listing** | Adds or edits a server entry in `README.md` or `ADDITIONAL.md` | No | [Registry, PR](#registry-pr) |
338-
| **New server** | Adds a server implementation, under `src/` or anywhere else | No | [Registry, PR](#registry-pr) |
339-
| **Archived server** | Changes a server that moved to `servers-archived` (it pre-classifies as `new-server?`, since its directory is gone) | No | [Archived](#archived) |
340-
| **No-op or spam** | No effective change (a rename to the same name, whitespace, a README "rename" to itself), or unrelated or generated content | No | [General, PR](#general-pr), without a tracking issue |
341-
| **Duplicate** | Races another open PR, or an existing issue, for the same fix | Once per group, through its best member | [General, PR](#general-pr), naming the group's issue |
342-
| **Security fix** | Fixes a vulnerability: path traversal, symlink or Roots escape, SSRF, injection, a vulnerable dependency | See [Security reports](#security-reports) first | [General, PR](#general-pr) |
343-
| **Fix or enhancement to keep** | A bug fix, or an in-scope enhancement (`CONTRIBUTING.md`, "What we act on"), to one of the seven servers or the repository | Yes, unless an open issue already covers it | [General, PR](#general-pr), naming the issue |
344-
| **Out of scope** | A feature `CONTRIBUTING.md` is selective about and a maintainer would not take, or a fix for behavior already gone on `v2/main` | No | [General, PR](#general-pr), without a tracking issue |
331+
exactly one class. The manifest is a TSV in `$D`, four fields per line: PR
332+
number, the class **slug** from the table, the issue its close comment will
333+
name **or `-`** when nothing is harvested, and a one-line reason. Every field is
334+
filled: `read` collapses adjacent tabs, so an empty field would shift the reason
335+
into the issue column.
336+
337+
| Class | Slug | Recognized by | Harvest? | Close with |
338+
| --- | --- | --- | --- | --- |
339+
| **Listing** | `listing` | Adds or edits a server entry in `README.md` or `ADDITIONAL.md` | No | [Registry, PR](#registry-pr) |
340+
| **New server** | `new-server` | Adds a server implementation, under `src/` or anywhere else | No | [Registry, PR](#registry-pr) |
341+
| **Archived server** | `archived` | Changes a server that moved to `servers-archived` (it pre-classifies as `new-server?`, since its directory is gone) | No | [Archived](#archived) |
342+
| **No-op or spam** | `no-op` | No effective change (a rename to the same name, whitespace, a README "rename" to itself), or unrelated or generated content | No | [General, PR](#general-pr), without a tracking issue |
343+
| **Duplicate** | `duplicate` | Races another open PR, or an existing issue, for the same fix | Once per group, through its best member | [General, PR](#general-pr), naming the group's issue |
344+
| **Security fix** | `security` | Fixes a vulnerability: path traversal, symlink or Roots escape, SSRF, injection, a vulnerable dependency | See [Security reports](#security-reports) first | **Not by the loop**: a maintainer's call |
345+
| **Fix or enhancement to keep** | `keep` | A bug fix, or an in-scope enhancement (`CONTRIBUTING.md`, "What we act on"), to one of the seven servers or the repository | Yes, unless an open issue already covers it | [General, PR](#general-pr), naming the issue |
346+
| **Out of scope** | `out-of-scope` | A feature `CONTRIBUTING.md` is selective about and a maintainer would not take, or a fix for behavior already gone on `v2/main` | No | [General, PR](#general-pr), without a tracking issue |
345347

346348
**Finding duplicate groups.** Racing PRs usually share a linked issue or the
347349
same changed files, so group by those first, then read each group to confirm
@@ -384,23 +386,39 @@ keeps the PR, its branch and its discussion readable; the harvest issue links
384386
it.
385387

386388
```sh
387-
# manifest.tsv: <PR>\t<class>\t<issue or blank>\t<reason>, AFTER maintainer review.
389+
# manifest.tsv: <PR>\t<slug>\t<issue or ->\t<reason>, AFTER maintainer review.
388390
# responses/general-tracked.md holds the general comment with "#ISSUE" where the
389391
# issue goes; general-untracked.md, registry.md and archived.md hold the others.
392+
# For the backlog sweep only (#4875): set SWEEP_LABEL to the close label it
393+
# settled on (it must already exist) and SWEEP_REF to "#4875"; leave both empty
394+
# on a routine pass.
395+
SWEEP_LABEL=; SWEEP_REF=
390396
while IFS=$'\t' read -r PR CLASS ISSUE _; do
391397
case "$CLASS" in
392398
listing|new-server) BODY=$(cat "$D/responses/registry.md") ;;
393399
archived) BODY=$(cat "$D/responses/archived.md") ;;
400+
no-op|duplicate|keep|out-of-scope)
401+
if [ "$ISSUE" != "-" ]; then BODY=$(sed "s/#ISSUE/#$ISSUE/" "$D/responses/general-tracked.md")
402+
else BODY=$(cat "$D/responses/general-untracked.md"); fi ;;
394403
security) echo "skipping #$PR: a security fix closes only on a maintainer's call" >&2; continue ;;
395-
*) if [ -n "$ISSUE" ]; then BODY=$(sed "s/#ISSUE/#$ISSUE/" "$D/responses/general-tracked.md")
396-
else BODY=$(cat "$D/responses/general-untracked.md"); fi ;;
404+
*) echo "unknown class '$CLASS' on #$PR — stopping; fix the manifest" >&2; break ;;
397405
esac
406+
[ -n "$SWEEP_REF" ] && BODY="$BODY"$'\n\n'"This is part of the backlog triage in $SWEEP_REF."
407+
if [ -n "$SWEEP_LABEL" ]; then
408+
gh pr edit "$PR" --repo modelcontextprotocol/servers --add-label "$SWEEP_LABEL" </dev/null \
409+
|| { echo "label FAILED on #$PR — stopping" >&2; break; }
410+
fi
398411
gh pr close "$PR" --repo modelcontextprotocol/servers --comment "$BODY" </dev/null \
399412
|| { echo "close FAILED on #$PR — stopping; re-snapshot to see what is left" >&2; break; }
400413
sleep 5
401414
done < "$D/manifest.tsv"
402415
```
403416

417+
The step 0 issue closes take the same two sweep additions during the backlog
418+
sweep: the close label (`gh issue edit <N> --add-label`) and the `#4875`
419+
sentence at the end of the response, in the original comment rather than a
420+
later edit.
421+
404422
### 5. Verify
405423

406424
The pass is complete when every open PR is maintainer-authored, a Dependabot

0 commit comments

Comments
 (0)