Skip to content

pstack: open worktree-audit, skill description and watch-pr fixes in one branch (#619, #769, #770) - #1174

Open
deanrie wants to merge 12 commits into
cursor:mainfrom
deanrie:bundle/pstack-fixes
Open

deanrie wants to merge 12 commits into
cursor:mainfrom
deanrie:bundle/pstack-fixes

Conversation

@deanrie

@deanrie deanrie commented Nov 4, 2026 •

Copy link
Copy Markdown

What

One branch with the open pstack fixes, cherry-picked in numeric order on top of main bb68f23. Every commit keeps its author and message, so this can be reviewed commit by commit or landed as one. If a single PR is easier to review, this replaces #619, #769 and #770 (which already stacks #492 and @dajiaohuang's #459); if the separate PRs are preferred, close this one.

Included

Commits Original Change
d663926, e55486b, 49fcb04, fce02b3, 5156e59 #492 (via #770) worktree-audit.sh never buckets unpushed or closed-unmerged work as safe: a new hold-unpushed bucket, PR heads matched by headRefOid, and a bun test harness on a real repo with a stubbed gh
69229b0, 91f009b, a9ffb8e #459 (via #770) cleanup keeps worktree-local untracked and ignored files and asks before removing ignored paths
8f973f2 #770 tests for the untracked and ignored cases #459 did not have
b079b3a, 058418a #619 slash-only skill descriptions drop the agent-selection wording, and skill names match their directories; harness tree regenerated
adf7661 #769 watch-pr --status-only reports a head with no checks instead of retrying until it times out

The reasoning and checks for each are in the original PR descriptions.

Checked on the combined branch

Dean Rie and others added 12 commits November 4, 2026 17:23
… work as safe

Three problems in worktree-audit.sh (cursor#470):
- a PR in any non-open state satisfied `$pr != "-"`, so a CLOSED (unmerged)
  PR made the worktree `safe`;
- the computed `remote` column (ahead/no-remote/detached) was never read by
  the bucket logic, so unpushed commits could be bucketed `safe`;
- the header called the script read-only although it runs `git fetch`.

Only ancestry of origin/main or a MERGED PR now counts as proof the work
exists elsewhere. Worktrees whose HEAD is ahead of / absent from the remote
or detached and not on origin/main go to a new `hold-unpushed` bucket,
ranked right after hold-wip and hold-open-pr. A CLOSED PR falls through to
`review`. The header now states the one write the script performs, and the
playbook documents the new bucket in step 1 (steps 4-5 are left untouched to
avoid conflicting with cursor#459).

Verified on a synthetic repo with a stubbed gh: ahead1+CLOSED and detached
off-main -> hold-unpushed; pushed+MERGED, pushed+CLOSED-on-main and detached
on origin/main -> safe; pushed+CLOSED with commits not on main -> review.

Fixes cursor#470

(cherry picked from commit e8e1ad1)
Deletion advice must distinguish preserved work from local-only commits. Exercise the audit CLI in an isolated repository with closed PRs, squash merges, a behind branch, and a detached head.

(cherry picked from commit 7ec0a12)
A behind branch has no local-only commits. Deleted origin branches and fork branches can still have their exact head preserved by a PR. Compare that head rather than treating every missing remote as unpushed, while holding commits added after a merge.

(cherry picked from commit c8fdd2d)
…#613

main (cursor#613) normalises the PR list to {number, state, head} with a lowercase state and prefers the origin CLI over gh. The audit now carries head_oid through that list (gh provides it, origin's record leaves it empty) so heliowap's PR-head check still works, and the fixture expectations use the lowercase states the script prints.

(cherry picked from commit 4aedd61)
(cherry picked from commit a20f1aa)
(cherry picked from commit 434c19a)
(cherry picked from commit 6ac4269)
(cherry picked from commit a17c461)
(cherry picked from commit a53824b)
(cherry picked from commit 804d9ce)
(cherry picked from commit 2310495)
(cherry picked from commit 51d07ca)
(cherry picked from commit de3c5bc)
Adds two worktrees to the audit fixture: one with a single untracked file,
one with only ignored build output (.gitignore'd build/ and run.log). With
row ever reports scratch:. Also restores cursor#459's opening paragraph of the
cleanup playbook, which the stack merge had dropped, and regenerates the
harness tree.

(cherry picked from commit 5a3b772)
(cherry picked from commit 18822d2)
…riptions

(cherry picked from commit 592f943)
(cherry picked from commit 60fb97d)
…tead of retrying for minutes

On a PR in a repository with no CI or check apps, resolveChecks throws a
retryable ChecksUnavailable when both gh pr checks and the GraphQL rollup
are empty, and --status-only went through pollUntilTerminal with the full
--max-query-errors budget. The result was RETRY lines at 60/120/240 s and
no status at all, which stalls babysit's check mode.

- readSnapshot gains noChecks: "report" | "retry". With "report" an empty
  check set becomes a new ci-none state (source "none", no checks, merge
  assessment still read); the default keeps today's retry, because a
  freshly pushed head has no checks yet either and polling must not call
  it ready.
- runSimple passes "report" for --status-only and clamps maxQueryErrors
  to 1 for that mode, so a status read ends on the first query error
  instead of sleeping through the backoff schedule.
- --pretty renders ci-none as "no checks reported"; --status-only help
  says it reads GitHub once.

Tests: readSnapshot report/retry, CLI --status-only on a no-checks head
(JSON and --pretty), first-error exit, and polling still emitting RETRY.
bun test 74/74, tsc clean, harness tree regenerated.

Fixes cursor#750.

(cherry picked from commit 0f3823c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants