From e45015c804f65f7fe594f58ea852ad55a52c788b Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 19 Oct 2026 18:14:40 +0700 Subject: [PATCH] ci(issue-shape): judge the issue as it is when the run starts, not its event payload (Closes #11007) A run queued 38 min behind the Actions backlog judged #10897's opened body after an edit had fixed it, and closed the issue; the edit's own run read REFUSED=false from its payload and never reopened it. 128 of the 185 issues the gate closed since 2026-10-18 pass the checker today. The workflow now reads body, state and labels with `gh issue view` at run time. The rule stays in specs/policy/issue_shape.t27 and its gen-c output; this file stays plumbing (+3 -4 lines). Co-Authored-By: Claude Opus 5.5 --- .github/workflows/needs-boundary.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/needs-boundary.yml b/.github/workflows/needs-boundary.yml index 68c2577d83..b9bf8cd254 100644 --- a/.github/workflows/needs-boundary.yml +++ b/.github/workflows/needs-boundary.yml @@ -25,13 +25,12 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} N: ${{ github.event.issue.number }} - BODY: ${{ github.event.issue.body }} - REFUSED: ${{ contains(github.event.issue.labels.*.name, 'shape-refused') }} - STATE: ${{ github.event.issue.state }} run: | printf '#include "gen/c/policy/issue_shape.c"\n#include \nint main(void){static char b[1<<20],o[1<<16];unsigned r=check_issue((uint8_t*)b,fread(b,1,sizeof b,stdin),(uint8_t*)o,sizeof o);fputs(o,stdout);return r?1:0;}\n' > shape.c cc -O1 -w -o shape shape.c - if printenv BODY | ./shape > why.txt; then + gh issue view "$N" -R "$GITHUB_REPOSITORY" --json body,state,labels > now.json # the issue as it is now, not the payload: a run queued 38 min closed #10897 after an edit had fixed it (#11007) + STATE=$(jq -r '.state | ascii_downcase' now.json); REFUSED=$(jq -r 'any(.labels[]; .name == "shape-refused")' now.json) + if jq -j '.body // ""' now.json | ./shape > why.txt; then if [ "$REFUSED" = true ]; then gh issue edit "$N" --remove-label shape-refused && gh issue reopen "$N" -c "The shape check passes now (specs/policy/issue_shape.t27); reopened."; fi elif [ "$STATE" = open ]; then { echo "Closed by the issue-shape gate (specs/policy/issue_shape.t27, #7498): an issue must have the template's sections. Edit the body; an edit that passes reopens it."; echo; sed 's/^/- /' why.txt; } > msg.md