Skip to content

PR queue: notice when it's my turn without opening hub #327

Description

@ooloth

Read the plan of record before starting: gh issue view 327 --comments.
The agreed architecture, the measured spike findings, and the full phase sequence live in a
comment on this issue. gh issue view 327 prints only this body and does not show it. The
Ideal state below is the original framing; where it and the plan of record disagree, the plan
of record wins.

Milestone

M1 — I always know what's in my PR queue, so review and reply happen sooner.

Current state

Hub isn't naturally opened, so its information provides no benefit — attention stays self-managedthe way it was before hub existed, rather than hub-managed as intended. The result: awareness ofthe PR queue lapses regardless of whether I'm the author or the reviewer, PRs resolve slower thanthey need to, and that slowness affects my team's velocity, not just mine.

This isn't a fresh problem. #14 proposed a background daemon in 2026-04 to solve a related need(instant TUI startup); it was closed in favor of the TUI owning its own refresh loop(ADR 008) because, at the time, "the CLI doesn'tneed instant startup badly enough to justify a background process." #35 later proposed a hubbrief command on cron specifically to reach the user without violating that same no-daemonconstraint, deliberately excluding push delivery and a long-lived process. Neither fully closes thegap this milestone is scoped to close: actually being notified, not just having a file or a faster CLI waiting to be checked.

Ideal state

  • A new surface, hub-daemon, runs detection unattended — without any TUI needing to be open, and without me starting or remembering to open anything
  • Two new PR attention reasons exist: replies where the ball is back in my court after I engaged, and my own PRs that have been reviewed and are waiting on my reply. (New non-draft PRs and explicit review requests are already detected today, per Surface all non-draft open PRs in configured repos, not just mine or review-requested #72 — this milestone doesn't touch that.) Superseded detail: this originally said "two new PrKind variants." The plan of record instead splits the type into two axes, relationship and attention, because a PR can be both mine and awaiting my reply and one field cannot carry both.
  • I'm notified locally only while logged in and able to act — never off-hours
  • The notification names the top N oldest outstanding items (N tunable); the same item can legitimately keep appearing across notifications — the message reports current queue state, not novelty
  • I can conveniently trigger an investigation of a notified item, opening as a real Claude Code session in a named tmux window, with a useful opening prompt the system authors, not one I write. Superseded detail: this originally said "matching hub's existing i-key pattern." That pattern is a tmux split-window beside the TUI, with no window name and no way to address it afterwards; Phase 2.1 — Open investigations in named tmux windows instead of splitting the TUI pane #330 changes i to open a named window, which is what makes the next bullet possible at all.
  • The system never opens a second investigation window for an item that already has one (Phase 2.2 — Switch to an existing investigation window instead of opening a second one #331)
  • The unified list shows which of the (now four) reasons a PR needs my attention

Out of scope

  • Auto-triggering an investigation without me asking — tracked in docs/questions/where-do-auto-triggered-investigation-outputs-appear.md
  • Per-category refresh intervals — tracked in docs/questions/should-refresh-run-on-a-per-category-schedule.md
  • Slack (or any channel beyond a local OS notification) — tracked in docs/questions/should-notifications-also-go-to-slack.md
  • Ranking by importance instead of oldest-first — tracked in docs/questions/should-ranking-consider-importance-not-just-age.md
  • Immediate backfill of the active set as items clear — tracked in docs/questions/should-the-active-set-backfill-immediately-or-wait-for-the-next-detection-pass.md
  • Snoozing/dismissing an item, pausing/muting the whole system — not needed now; the design must not foreclose adding either later
  • A standalone OS-level window as an alternative delivery surface — decided against; the existing tmux-window investigation pattern is kept as-is
  • Anything changing what hub-cli is for — it stays the agent-facing toolkit per ADR 010, which now explicitly rules out hosting an unattended process there. hub-daemon is a new, separate surface
  • Dashboard / multi-instance-TUI viewing — already works today, untouched here

Starting points

  • workflows/src/status.rs — the fetch/detect/sort logic hub-daemon calls; already independent of ui/tui
  • domain/src/pr.rsPrKind, to extend with the two new PR-attention categories
  • clients/src/github/prs/fetch.rs — where PR data (including reviewThreads/comments, already fetched) gets turned into PrKind values today; the new categories are classified from data already present in the response, not a new query
  • ADR 008, ADR 009, ADR 010 (including its 2026-09-04 addendum), and vision.md's "What hub is not" — the standing decisions this milestone knowingly amends

QA plan

  1. With hub-daemon running and no TUI open, have someone reply on a PR thread you'd previously commented on — expect a local notification naming it within the daemon's polling interval, without opening hub-tui at all
  2. Open one of your own PRs that's been reviewed and not yet replied to — expect it to appear in the notification, distinguishable in the unified list from a fresh review request
  3. Simulate being away (locked/logged out) during a detection cycle — expect no notification during that window, and expect the item still waiting, not re-notified redundantly, once back
  4. Trigger an investigation on a notified item — expect a new tmux window with a populated, useful prompt
  5. Trigger investigation on the same item again — expect no second window; the existing one surfaces instead
  6. Clear one of the top-N items — expect the active set to shrink, with no new item pulled in until the next scheduled detection pass

Done when

I am aware of the top PRs requiring my attention at all times while on my laptop.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions