Skip to content

Add /watch-pr and rename monitor-stack to monitor-prs (#217) - #227

Merged
jodavis merged 2 commits into
dev/claude/Issue-214from
dev/claude/Issue-217
Aug 31, 2026
Merged

Add /watch-pr and rename monitor-stack to monitor-prs (#217)#227
jodavis merged 2 commits into
dev/claude/Issue-214from
dev/claude/Issue-217

Conversation

@jodavis-claude

@jodavis-claude jodavis-claude commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Work item: Add watch-pr #217monitor-stack could only ever monitor a whole epic's gh stack, but there are cases (a PR that isn't part of a stack, or a stack you don't want gh stack rebase-conflict handling for) where a lighter-weight, single/multi-PR monitor is what's actually wanted.
  • Changes:
    • Renames monitor-stack to monitor-prs and splits it into two modes: stack mode (--work-item-id, the existing gh stack-backed behavior, unchanged) and PR mode (--pr-numbers, new).
    • Adds pr_list_poll.py, PR mode's counterpart to stack_pr_poll.py: bounded polling over a fixed, explicit list of PR numbers, resolving each to its own task and reacting to review_comment/human_comment/ci_failure exactly as stack mode does, but with no gh stack involvement — no rebase-conflict handling, no worktree bootstrap.
    • Adds /watch-pr <PR#> [PR#...] as PR mode's manual entry point, mirroring /watch-stack's direct, in-session, no-isolation invocation from watch-stack should not isolate itself #215 (PR mode has no concurrent-orchestrate auto-start path to protect either).
    • Updates every monitor-stack cross-reference in the repo (concurrent-orchestrate, resolve-rebase-conflict, work-with-stacked-prs, workflow-orchestrate, gh_stack.py, the resolve-rebase-conflict fixture, and the living _doc_StackedPRs.md) to monitor-prs.
  • Design decisions:
    • The frozen _spec_StackedPRs.md ADR record is left referring to the original monitor-stack name — it's the historical account of that decision, not living documentation.
    • PR mode's failures have an asymmetric troubleshooter treatment: pr_list_poll.py itself erroring has no single task's context file naturally in hand, so it stays a plain hard stop; a fix-pr spawn failure already has the relevant task's own context file in hand (needed for the spawn itself), so that one routes through the troubleshooter.
  • Testing completed: python3 -m pytest plugins/dev-team/skills/workflow-orchestrate/scripts — 314 passed (297 existing + 17 new for pr_list_poll.py). Also fixed a hang in a WIP test (fake_head_ref produced an id that never matched the fake detector's expectation, causing poll() to busy-loop for the full 480s max_seconds on the real clock) discovered while finishing this PR.

Closes #217

@github-actions

Copy link
Copy Markdown

build-and-test: Python test results

Status: ✅ Passed

Test log

@jodavis-claude jodavis-claude changed the title dev/claude/Issue 217 Add /watch-pr and rename monitor-stack to monitor-prs (#217) Aug 27, 2026
@jodavis
jodavis marked this pull request as ready for review August 31, 2026 20:54
ElwoodMoves and others added 2 commits August 31, 2026 21:13
…leshooter

monitor-stack's hard-stop points just reported failure in detail and stopped, forcing whatever
spawned it (or the user, in the now-common direct-invocation case from #215) to absorb the raw
diagnosis. Every failure that indicates a genuine pipeline bug rather than a usage/precondition
issue — a missing feature branch or bottom-of-stack PR, a stack_checkout.py/stack_pr_poll.py/
stack_rebase_continue.py script error, a stack_complete cleanup failure, or a fix-pr/
resolve-rebase-conflict spawn reporting anything other than successful — now dispatches
dev-team:troubleshooter with the epic's own context file instead, mirroring the same pattern
workflow-orchestrate and concurrent-orchestrate already use for their own pipeline anomalies.
This keeps the actual debugging investigation, and any bug it files, out of the calling session's
context, and bounds each occurrence to one troubleshooter-applied retry before falling back to a
plain hard stop. Step 1's worktree-freshness guard (a documented upstream Claude Code bug, not
this plugin's own) and step 2b's own epic-derivation failure (a usage issue) are left as direct
hard stops, since neither is something workflow-troubleshoot's fix strategies apply to.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SXkXzYacgX31sUpJ3CqSX4
(cherry picked from commit c9343e42557dbac08a848e880b7c4fa215220c94)
monitor-stack could only ever monitor a whole epic's gh stack, but there are cases (a PR that
isn't part of a stack, or a stack you don't want gh stack rebase-conflict handling for) where a
lighter-weight, single/multi-PR monitor is what's actually wanted. Renames monitor-stack to
monitor-prs and splits it into two modes: stack mode (--work-item-id, the existing gh
stack-backed behavior, unchanged) and PR mode (--pr-numbers, new) which polls a fixed list of PR
numbers via the new pr_list_poll.py — resolving each to its own task and reacting to
review_comment/human_comment/ci_failure exactly as stack mode does, but with no gh stack
involvement at all, so no rebase-conflict handling and no worktree bootstrap. Adds /watch-pr as
PR mode's manual entry point, mirroring /watch-stack's direct, in-session, no-isolation
invocation from #215 (PR mode has no concurrent-orchestrate auto-start path to protect either).
Updates every monitor-stack cross-reference in the repo (concurrent-orchestrate,
resolve-rebase-conflict, work-with-stacked-prs, workflow-orchestrate, gh_stack.py, the
resolve-rebase-conflict fixture, and the living _doc_StackedPRs.md) to monitor-prs; the frozen
_spec_StackedPRs.md ADR record is left as the historical account of the original name.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012JnNb6Ai3HJ3uZeSdxGxD6
@jodavis
jodavis merged commit 3fd652c into main Aug 31, 2026
3 checks passed
@jodavis
jodavis deleted the dev/claude/Issue-217 branch August 31, 2026 21:18
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.

Add watch-pr

3 participants