Skip to content

Commit e6bd18d

Browse files
cliffhallclaude
andcommitted
fix: guard advisory card creation; record the verified Priority
The draft-card create recipe reset ITEM_ID and created whenever the option ids resolved, so the documented lookup-then-create flow could duplicate an existing card or create after an incomplete listing. The lookup now sets LOOKED only over a complete listing, and create refuses unless LOOKED is set and nothing was found. The step-2 re-score only appended a body line labelled "provisional", leaving the board's Priority field at the unverified level. It now adds a "verified" line and sets the card's Priority field to match. Refs #4870 Signed-off-by: cliffhall <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 29eec50 commit e6bd18d

2 files changed

Lines changed: 17 additions & 10 deletions

File tree

‎.claude/skills/board-ops/SKILL.md‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,25 +260,29 @@ full listing, checked for truncation, then feed that item id to `item-edit` or
260260
```sh
261261
GHSA=GHSA-xxxx-yyyy-zzzz # the advisory's real id
262262
ITEM_ID= # never let an earlier lookup's id survive a failed one
263+
LOOKED= # set only by a lookup over a COMPLETE listing
263264
BOARD=$(gh project item-list 43 --owner modelcontextprotocol --format json --limit 2000)
264265
if jq -e '(.items | length) == .totalCount' <<<"$BOARD" >/dev/null; then
265266
ITEM_ID=$(jq -r --arg p "[$GHSA]" '.items[] | select(.content.type=="DraftIssue")
266-
| select(.content.title | startswith($p)) | .id' <<<"$BOARD")
267+
| select(.content.title | startswith($p)) | .id' <<<"$BOARD") && LOOKED=1
267268
[ -n "$ITEM_ID" ] || echo "no draft card titled [$GHSA] on #43" >&2
268269
else
269270
echo "item-list incomplete or failed — raise --limit; not concluding anything" >&2
270271
fi
271272
```
272273

273-
**Create** one only after that lookup finds none (a second card for the same
274-
advisory is a duplicate). It is the add-card recipe with `item-create` in place
275-
of `item-add`, Status `Incoming`, and the provisional Priority:
274+
**Create** one only when that lookup ran over a complete listing **and** found
275+
none (a second card for the same advisory is a duplicate). Run it in the same
276+
shell, straight after the lookup: it refuses on a missing `LOOKED` or a found
277+
`ITEM_ID`. It is the add-card recipe with `item-create` in place of `item-add`,
278+
Status `Incoming`, and the provisional Priority:
276279

277280
```sh
278281
STATUS_OPT=$(opt Status "Incoming")
279282
PRIORITY_OPT=$(opt Priority "<provisional level>")
280-
ITEM_ID=
281-
if [ -n "$STATUS_OPT" ] && [ -n "$PRIORITY_OPT" ]; then
283+
if [ "$LOOKED" != 1 ] || [ -n "$ITEM_ID" ]; then
284+
echo "lookup incomplete, or [$GHSA] already has a card ($ITEM_ID) — not creating" >&2
285+
elif [ -n "$STATUS_OPT" ] && [ -n "$PRIORITY_OPT" ]; then
282286
ITEM_ID=$(gh project item-create 43 --owner modelcontextprotocol \
283287
--title "[$GHSA]" --body "<link and triage lines only>" \
284288
--format json --jq '.id') || ITEM_ID=

‎.claude/skills/security-advisory/SKILL.md‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@ a real GitHub issue".
9898
Re-score by the severity you verified, which may differ from the claim.
9999
Write the result into the body as
100100
`Priority <level> (provisional, <YYYY-MM-DD>)`: a draft card has no comments,
101-
so the body is the only place the score can be recorded. When you re-score,
102-
keep that line and add the new one under it, so the change of view is
103-
legible. Numbers and level names only; the reasoning behind a score is the
101+
so the body is the only place the score can be recorded. When you re-score
102+
(step 2), keep that line, add `Priority <level> (verified, <YYYY-MM-DD>)`
103+
under it so the change of view is legible, and **set the card's Priority
104+
field to the verified level**. Numbers and level names only; the reasoning behind a score is the
104105
impact, which belongs in the private advisory.
105106
⚠️ **Set both fields.** A draft card has no labels and no milestone, so its
106107
Status and Priority are all the triage state it carries.
@@ -179,7 +180,9 @@ names the symptom rather than the class:
179180
`memory` writes one file at a configured path, and `everything`'s HTTP
180181
transports are mostly SDK code (see ownership, above).
181182

182-
**Now re-score the card's Priority**, under the provisional line (step 1).
183+
**Now re-score the card's Priority**: add the `verified` line under the
184+
provisional one (step 1), and set the card's Priority field to match with the
185+
`/board-ops` edit recipe, so the board orders by the verified level.
183186
This is the first point where severity has anything solid under it: the code is
184187
ours, it reproduces, and you know which class and which server.
185188

0 commit comments

Comments
 (0)