Skip to content

feat: focus PRs and stall detection with owner liveness (#91) - #92

Merged
lx-0 merged 12 commits into
mainfrom
feat/91-focus-stall
Nov 15, 2026
Merged

lx-0 merged 12 commits into
mainfrom
feat/91-focus-stall

Conversation

@lx-0

@lx-0 lx-0 commented Nov 15, 2026

Copy link
Copy Markdown
Member

What changes

A PR that sat in a blocking review, a conflict or a red check, with nobody pushing, used to look exactly like a healthy PR. Now it doesn't.

  • ytstack-frontier owner --pr N (new): names the lane whose PR cell holds N (12 or #12), its holder and status, and the age of its last commit (or of the claim, when that is newer). It uses the same clock as check; claimed_at and last_commit are now shared helpers.
  • ytstack-watch --focus N[,N...]: these PRs are listed first and read every 20 s while open. The others are still read every --interval. --focus works without --pr.
  • ytstack-watch --stall MINUTES (default 15, 0 = off, not with --once): prints #N STALL 1: <checks red, conflict, review changes_requested>; no new head for 15 min (head abc1234); <owner line>. STALL 2 follows after the next window. There is never a third. A new head, or a state that is no longer actionable, restarts the clock.
  • PR watch register --pr N --focus (--no-focus clears it): the PR is read on every worker tick and listed first in the per-prompt block, under Focus (read every tick):. The other PRs follow under Others:.
  • PR watch STALL marks: an action_required watch that is not paused and has had no new head or status for stall_minutes (policy, default 15, 0 = off) gets STALL 1, then STALL 2. Both stop at 24 h, where the existing pause hint takes over. The mark ends with the ytstack-frontier owner line, but only when the watch's cwd is a checkout of the PR's repository, and only for lines that are actually shown. The hook still makes no GitHub call. Focus and stall marks enter the fingerprint only when set, so existing fingerprints do not change on upgrade.
  • coordinate 0.6.2, Step 7: register blocking PRs as focus PRs. On STALL 1, ask the lane once for an ETA. On STALL 2, do not relay the same instruction again: run ytstack-frontier release <lane>, claim a fresh worker on the same branch, and start it in a new worktree from origin/<branch>.

Decision (DECISIONS 2026-11-15, issue #91)

The STALL rule lives in both watchers, and each keeps its own clock: the PR watch uses changed_at from its database, ytstack-watch uses its in-process first sight. The lane/liveness lookup has one implementation, ytstack-frontier owner, and both watchers call it.

Why both: the PR watch's block reaches a Claude session only with a prompt. ytstack-watch running under a monitor tool wakes the session, and it is also the fallback when the PR watch is off. Moving one clock into the other watcher would need a long-running PR watch process or on-disk state for ytstack-watch.

Two windows match what the coordinator does with them: ask once, then hand over. More marks would bring back the noise from #85.

Verification

  • bash tests/run-all.sh (macOS, bash 3.2): ALL SUITES PASSED. ytstack-frontier 192, ytstack-watch 157, pr-watch 60 (engine unittest: 106 tests, 6 new in tests/pr_watch/test_focus_stall.py), skill-preambles 719.
  • bash tests/run-all.sh --linux from a git archive export (alpine, bash 5.3): ALL SUITES PASSED.
  • python3 bin/ytstack-check: OK (9 existing warnings, none new).
  • bin/ytstack-spec lint: 0 failures. bin/ytstack-spec drift: no area to look at.
  • No live PR watch state, config or daemon was touched. All engine tests ran on temporary state directories with a stubbed gh.

Not run against GitHub: the STALL and focus paths ran only against stubs.

Closes #91

🤖 Generated with Claude Code

lx-0 and others added 5 commits November 15, 2026 19:10
…d its last commit (#91)

Shares claimed_at and last_commit with check, so both read one clock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
register --pr N --focus reads a PR every tick and lists it first; an
action_required PR without a new head or status for stall_minutes gets
STALL 1 and STALL 2, with ytstack-frontier owner from the watch's checkout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-15T18:46:39.172917Z
We couldn’t complete this review. Comment @codex review to try again.
5d5b11d Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

| ((.reviews // []) | map(select(.submittedAt != null)) | sort_by(.submittedAt) | last) as $r

P2 Badge Track blocking reviews per reviewer

When reviewer A requests changes on the current head and reviewer B later comments or approves it, selecting only the newest review hides A's still-effective block, so stall() never considers the PR actionable and emits no STALL warning. The existing gate logic in bin/ytstack-finish-lane avoids this by taking each reviewer's newest review on the head; this summary needs equivalent per-reviewer handling before deciding whether any changes request remains.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bin/ytstack-watch Resolved
lx-0 and others added 2 commits November 15, 2026 19:32
Resolves DECISIONS and spec/skills.md against #87: the #91 entry follows
main's entries; coordinate moves to 0.6.3 since #87 took 0.6.2; the
hooks-and-state decision line is folded to stay under 200 lines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s cadence on a read error (PR #92 review)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@lx-0

lx-0 commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

Codex review on 72a58d4, both findings fixed in 5d5b11d:

  • Track blocking reviews per reviewer: ytstack-watch now treats a PR as blocked when any reviewer's newest review on the head requests changes, also after another reviewer approved (the rule ytstack-finish-lane uses). Tests: 'a reviewer's changes request stays blocking after another reviewer approved', 'the same reviewer's newer approval lifts it'.
  • Keep the focus cadence after a read error: fixed, thread resolved.

@lx-0

lx-0 commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

lx-0 and others added 5 commits November 15, 2026 20:15
Resolves DECISIONS and spec/checks-and-evals.md, spec/skills.md against
#88: main's entries first, the #91 entry appended after them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…m worktree tested (PR #92 review)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r checkout before saving (PR #92 review)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…inish-lane gates (PR #92 review)

Also tests that a new head after STALL 1 restarts the clock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ree; spec bullet de-duplicated (PR #92 review)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@lx-0
lx-0 merged commit 27b8b7e into main Nov 15, 2026
4 checks passed
@lx-0
lx-0 deleted the feat/91-focus-stall branch November 15, 2026 22:20
lx-0 added a commit that referenced this pull request Nov 15, 2026
Both sides kept: main's DECISIONS entries first, one CHANGELOG
[Unreleased], coordinate 0.7.1 (above 0.6.3 and 0.7.0).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
lx-0 added a commit that referenced this pull request Nov 15, 2026
Kept both sides: the operating checklist has #93's line 6 and this
branch's lines as 7 and 8; DECISIONS with main's entries first; spec
lines combined. coordinate 0.7.2 and finish-lane 0.7.1, a patch above
both sides.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@lx-0 lx-0 mentioned this pull request Nov 16, 2026
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.

watch: focus PRs and stall detection — a blocked PR with a silent lane looks identical to a healthy one

1 participant