Skip to content

Commit 5e6ee19

Browse files
committed
chore(pm): close-cards.mjs — one named script for the three-step card closure
The three-step closure (comment · label · close) had no named spelling, so a seat's batch ran as a bash loop and the session's write classifier judged it act by act — non-deterministically, which is how a 90-card sweep stopped after one card rather than risk a comment landing without its label write. `scripts/pm/close-cards.mjs` is that spelling: it re-reads every card live, applies the skip matrix, drives post-stamped (child process, its documented flags) and label-write's exported `runLabelWrite`, closes with the reason and reads the answer back, and STOPS at the first card left half-written, naming it and which of the three writes landed. Stamping and the four-step label write are imported, never re-implemented. `.claude/settings.json` gains the four allow rules that let a seat run it and its two helpers as typed, from the repo root. Claude-Session: https://claude.ai/code/session_012GcsUbuqFGBibkEDMRC1eE Co-authored-by: Claude <noreply@anthropic.com>
1 parent fbc12be commit 5e6ee19

4 files changed

Lines changed: 1092 additions & 0 deletions

File tree

‎.claude/settings.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
"Bash(curl -sS -X PUT https://api.github.com/repos/objectstack-ai/objectstack/pulls/*/ccr/auto_merge *)",
5353
"Bash(node --use-env-proxy scripts/pm/post-stamped.mjs *)",
5454
"Bash(node --use-env-proxy scripts/pm/label-write.mjs *)",
55+
"Bash(node scripts/pm/post-stamped.mjs *)",
56+
"Bash(node scripts/pm/label-write.mjs *)",
57+
"Bash(node scripts/pm/close-cards.mjs *)",
58+
"Bash(node --use-env-proxy scripts/pm/close-cards.mjs *)",
5559
"Bash(curl -sS -X PATCH https://api.github.com/repos/objectstack-ai/objectstack/issues/* *)",
5660
"Bash(curl -sS -X PATCH https://api.github.com/repos/objectstack-ai/objectui/issues/* *)"
5761
],

‎.github/workflows/lint.yml‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,29 @@ jobs:
13071307
- name: Label-write helper self-test
13081308
run: pnpm check:pm-label-write
13091309

1310+
# Card-closure helper self-test (#19469) — same family and the same split
1311+
# as the two steps above, and it drives BOTH of them: `close-cards.mjs` is
1312+
# the three-step closure (comment · label · close) as one named command,
1313+
# so a seat's batch closure is one allow-listed prefix instead of a loop
1314+
# the session's write classifier judges act by act. The LIVE path posts
1315+
# comments, strips labels and closes cards, so it is emphatically not a
1316+
# thing CI runs against the board; the offline half is all CI can hold.
1317+
#
1318+
# What the self-test instruments is the set of rules a clean tree cannot
1319+
# exercise, every one of which is silent when it breaks: the skip matrix
1320+
# (not open · assigned · `pm:retriage` · a pm-state that is not EXACTLY
1321+
# the expected one · an open PR cross-referencing the card); that an
1322+
# unreadable card or timeline STOPS the run rather than being read as a
1323+
# "no"; that a 200 whose body does not read back `closed`, or reads back
1324+
# another `state_reason`, is not a close; and — the one this tool exists
1325+
# for — that a comment which lands whose label write then fails STOPS at
1326+
# that card, naming it and which of the three writes landed, instead of
1327+
# turning one half-state into a page of them. Weakening any of them leaves
1328+
# every ordinary invocation just as green, which is the shape
1329+
# `check:self-test-wired` requires this step for.
1330+
- name: Card-closure helper self-test
1331+
run: pnpm check:pm-close-cards
1332+
13101333
# Board-snapshot archiver self-test (#17390) — same family and the same
13111334
# split as every step around it. The LIVE run reads the whole board over
13121335
# REST and commits the result to an orphan branch, so it is not a thing

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
"check:pm-stale-finding": "node scripts/pm/sweep-stale-finding.mjs --self-test",
8989
"check:pm-post-stamped": "node scripts/pm/post-stamped.mjs --self-test",
9090
"check:pm-label-write": "node scripts/pm/label-write.mjs --self-test",
91+
"check:pm-close-cards": "node scripts/pm/close-cards.mjs --self-test",
9192
"check:pm-board-snapshot": "node scripts/pm/board-snapshot.mjs --self-test",
9293
"check:pm-changeset-deadline-census": "node scripts/pm/changeset-deadline-census.mjs --self-test",
9394
"check:pm-governed-merges": "node scripts/pm/check-governed-merges.mjs --self-test",

0 commit comments

Comments
 (0)