Repository navigation
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
Open
pstack: open worktree-audit, skill description and watch-pr fixes in one branch (#619, #769, #770)#1174deanrie wants to merge 12 commits into
deanrie wants to merge 12 commits into
Conversation
… 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)
…ee-audit changes (cherry picked from commit 41da1b6)
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)
…hanges (cherry picked from commit 7dfd6c4)
…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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
One branch with the open pstack fixes, cherry-picked in numeric order on top of
mainbb68f23. 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
worktree-audit.shnever buckets unpushed or closed-unmerged work assafe: a newhold-unpushedbucket, PR heads matched byheadRefOid, and a bun test harness on a real repo with a stubbedghwatch-pr --status-onlyreports a head with no checks instead of retrying until it times outThe reasoning and checks for each are in the original PR descriptions.
Checked on the combined branch
pstack/that has a copy underharness/pstack/claude-code/matches it, except the Claude Code adapter line the generator adds tomake-bot-uiandreflect(same as onmain).bun testinpstack/skills/poteto-mode/scriptson the combined branch: 79 pass, 0 fail (61 onmain). Thestatecharttests fail the same 9 cases on this branch and onmainhere (local runtime), and this branch does not touchstatechart.