Skip to content

Commit 98d3aac

Browse files
committed
prm: drop the branch sub-step silently where deletion is impossible
The previous commit stopped the wasted push attempts but still reported the branches as deferred to /repo_cleanup. Behind the proxy that line would appear on every close-out saying the same thing, which is noise rather than a finding. Treat step 5 as out of scope in that environment: attempt nothing, report nothing, and omit branches from the ledger entirely. Nothing is lost, because /repo_cleanup Bucket B enumerates origin branches directly and rediscovers them on the next local sweep without being told. The ledger's "a skipped step must read as skipped" rule gains one stated exception for a step the environment makes impossible. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DHmxnBNwDGedeUoRJk9iFz
1 parent ccf0cb4 commit 98d3aac

2 files changed

Lines changed: 28 additions & 24 deletions

File tree

skills/prm/prm.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ checkout required. Detect which you are in:
4545
curl -sf "$HTTPS_PROXY/__agentproxy/status" >/dev/null && echo "ref deletes blocked"
4646
```
4747

48-
An answer means every `git push origin --delete` in this run will fail. Do not
49-
attempt one — see step 5.
48+
An answer means every `git push origin --delete` in this run will fail. Branch
49+
cleanup is then **out of scope for the run**: don't attempt it, and don't
50+
mention it — see step 5.
5051

5152
## The routine
5253

@@ -129,19 +130,19 @@ step 6. Order is forced by the tooling, so do not reorder:
129130
registered in `active.md` — which is exactly why step 3 comes first.
130131
5. **Branches** — delete the remote `feature/<task>` per proven-merged repo, plus
131132
any local branch left in the canonical checkout. Never delete a branch whose
132-
merge you did not prove in sub-step 1. **If the environment cannot delete
133-
remote refs** (proxied web session, above), skip the remote half outright and
134-
list those branches in the ledger as deferred to `/repo_cleanup` — never spend
135-
turns on a push the proxy has already refused.
133+
merge you did not prove in sub-step 1. **Where the environment cannot delete
134+
remote refs** (proxied web session, above), this sub-step does not exist:
135+
attempt nothing, and report nothing about it. `/repo_cleanup` finds those
136+
branches on origin by itself, so silence here loses nothing.
136137
6. **Report the ledger** — PRs merged, issue closed, record path, `active.md`
137-
released, worktree removed, branches deleted **or deferred**, and anything
138-
skipped.
138+
released, worktree removed, branches deleted, and anything skipped. Branches
139+
are simply absent from the ledger where sub-step 5 did not apply.
139140

140141
**Remote (mobile/codex):** sub-steps 1 and 2 run over `gh`/`git ls-remote` as
141142
usual. Mind (3) works if PyAutoMind is checked out; otherwise say the record is
142143
pending. The worktree (4) is local-only — name it as outstanding rather than
143-
implying it ran. Branches (5) delete normally from mobile and Codex, but **not**
144-
from a proxied web session — there they are deferred, not attempted.
144+
implying it ran. Branches (5) delete normally from mobile and Codex; a proxied
145+
web session drops the sub-step silently.
145146

146147
### 6. The only guards that stop you
147148

skills/prm/reference.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -209,18 +209,19 @@ That 403 is generated in front of GitHub — the ref advertisement to the same h
209209
seconds earlier returns 200 with an `X-Github-Request-Id`, the 403 carries none —
210210
so credentials, `gh` scopes and branch protection are **not** the cause, and no
211211
retry, repo, or token changes it. The GitHub MCP surface has no delete verb
212-
either (`create_branch` exists; nothing deletes a ref). So in that environment:
213-
delete the local branches if a checkout exists, **skip the remote half entirely**,
214-
and put one line per branch in the ledger:
212+
either (`create_branch` exists; nothing deletes a ref). So in that environment
213+
**this whole sub-step is out of scope**: run no delete, and write no line about
214+
branches in the ledger — not "deferred", not "blocked", not "see /repo_cleanup".
215+
The step is structurally impossible there and would say the same thing on every
216+
close-out, so it is noise, not a finding.
215217

216-
```
217-
branches: deferred — PyAutoMind claude/<task> (merged, proxy blocks remote delete) → /repo_cleanup
218-
```
218+
Nothing is lost by the silence: `/repo_cleanup` Bucket B enumerates origin
219+
branches directly (`gh api repos/<owner>/<repo>/branches`), so it rediscovers
220+
these on the next local sweep without being told. Repo-side, "Automatically
221+
delete head branches" (Settings → General → Pull Requests) removes the need for
222+
the sub-step altogether.
219223

220-
`/repo_cleanup` is the destination: its Bucket B enumerates origin branches
221-
directly, so a deferred branch is picked up by the next local sweep. Repo-side,
222-
"Automatically delete head branches" (Settings → General → Pull Requests) removes
223-
the need for the step at all.
224+
Report a blocked delete only if the user **asks** where a branch went.
224225

225226
Otherwise — local CLI, mobile, Codex — delete as usual:
226227

@@ -233,12 +234,14 @@ git -C <repo> fetch --prune
233234
Only branches proven merged in step 1. `git ls-remote --heads origin feature/<task>`
234235
is the ground truth that the delete landed. If a delete 403s where you expected it
235236
to work, treat it as the proxied case from that point on: **stop after the first
236-
refusal**, do not repeat it per repo, and defer the rest.
237+
refusal** and drop the sub-step — do not repeat the push per repo, and do not
238+
narrate the failure.
237239

238240
### 6. The ledger
239241

240242
Report, per line: PR(s) merged (URL + `MERGED`), issue closed (number + state),
241243
record path under `complete/<YYYY>/<MM>/`, `active.md` claim released, worktree
242-
removed, branches deleted **or deferred** (with the destination), and **anything
243-
skipped** with the reason. A close-out that quietly skipped a step reads exactly
244-
like one that finished.
244+
removed, branches deleted, and **anything skipped** with the reason. A close-out
245+
that quietly skipped a step reads exactly like one that finished — with one
246+
deliberate exception: a sub-step the environment makes impossible (step 5 behind
247+
the proxy) is omitted outright rather than reported as skipped.

0 commit comments

Comments
 (0)