Repository navigation
[3589 by Claude Opus 5.5] Epic PR status: show "needs you" when a sub-PR is stuck or waits to be merged, instead of "#N starts next" - #3610
Conversation
…erson or waits to be merged. "#X starts next" appears only when the queue can start #X right now. The new tests and the related suites pass (335 tests, 0 failures), and lint and typecheck are clean. Root cause. The old check in `pullRequestStatusEpicFacts.ts` read the queue's `cursor` column. That column is legacy: new queues are created with it at 0, and the queue's real progress lives in the per-issue rows. So the old code treated the first issue, already merged, as the queue head. It then reported "starts next" whenever any later issue was pending, in every queue mode. Parallel queues had their own version of the bug: any pending issue counted. That is the #3563 picture. Fix (status computation only; how the queue dispatches is unchanged): - `pullRequestStatusEpicFacts.ts` now reads the queue through `getEpicExecutionQueue` and asks the queue's own scheduler which issue starts now. An issue counts only if the dispatcher has already claimed it, or its prerequisites are satisfied and a slot is free. A sub-PR that isn't merged holds its slot and keeps the issues that depend on it waiting. - An issue that is already merged in the plan, before the queue has moved past it, counts as done. Under the "terminal" advance setting, closed counts too. - The facts now record which issue starts next (`nextIssue`), and the "starts next" line names that issue rather than just the first pending one. - `pullRequestStatus.ts` keeps its documented order of checks. With the queue check corrected, the sub-PR "needs you" and "waits to be merged" checks now apply. The title slot uses the same state, so it shows `⚠️ `. - In `docs/docs/features/pr-status.md` I reworded the vague "about to start its next issue" in the `working` row to say what that means. Tests (`packages/core/test/pullRequestStatusEpicSync.test.ts`). The test queue table was simpler than the real one, so I gave it per-issue rows and set `cursor` to 0, as real queues are created. New tests cover: - the two #3563 situations (sub-PR at `⚠️ `, and sub-PR ready and waiting for merge, each with a pending issue behind it) in sequential and graph queues. - the same in a parallel queue, where the pending issue can't be dispatched. - a graph issue whose prerequisite is merged still starting next, until the parallel limit is 1. - a parallel issue starting next whether or not the dispatcher has claimed it. - a chain starting the next issue after a merged head the queue hasn't moved past yet. With the original source swapped back in, 16 tests in this file fail: all the new ones except the two "starts next" positive checks, plus existing ones that now use the realistic `cursor` of 0. With the fix, all of them pass. One behaviour to know about: in parallel and graph queues, an issue the dispatcher has claimed but that hasn't started running still shows as "starts next". The sequential queue already behaved this way. No previews were made: the change is only to the status text and title on PRs, with no UI. Acceptance criteria - AC1: met — `pullRequestStatusEpicFacts.ts` (`nextQueuedIssue`); tests "sequential/graph: a sub-PR that needs a person…" and "parallel: a sub-PR that needs a person shows⚠️ …" in `packages/core/test/pullRequestStatusEpicSync.test.ts` - AC2: met — `pullRequestStatusEpicFacts.ts`; tests "sequential/graph: a ready sub-PR waiting for a human merge…", the parallel test's ready step, and "a ready sub-PR waiting to be merged shows⚠️ …" in `pullRequestStatusEpicSync.test.ts` - AC3: met — `nextQueuedIssue` uses `epicQueueSchedule` (prerequisites, slot limit, claims); tests "a graph issue whose prerequisites are merged and that has a free slot starts next…", "a parallel issue that is pending and unclaimed starts next…", "a chain starts the issue after a head that merged…" - AC4: met — the new tests check that the title settles to `⚠️ 1/3 [Epic] Scheduler primitives` (`settledTitle` in `pullRequestStatusEpicSync.test.ts`) - AC5: met — the #3563 regression tests in `pullRequestStatusEpicSync.test.ts` fail when run against the original `pullRequestStatus.ts` and `pullRequestStatusEpicFacts.ts` and pass with the fix
|
/ultrafix goal=8 max=6 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 6) First action:
|
|
✅ AI Code Review Complete requested by @propr-dev[bot] Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR replaces legacy cursor-based status inference with per-issue queue state and scheduler eligibility. The change is focused and appears merge-ready within scope, conditional on the four pending test shards completing successfully. ✅ Scheduler reuse — Eligibility now accounts for dependencies, occupied slots, execution mode, and existing dispatch claims through the queue’s shared scheduler and adapter. ✅ Correct issue focus — The status computation selects the eligible issue by number instead of always naming the first pending issue. ✅ Regression coverage — Added tests exercise waiting sub-PRs across all three execution modes, graph slot limits, dispatch claims, and advancement past a merged head. This assessment is based on static review of the supplied diff and surrounding context; no commands or tests were run. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Test selection beyond the first pending issueAdd a graph case where the first pending issue has an unmet prerequisite but a later pending issue is eligible. Assert that the body names the later issue. The new S2: 🟢 Cover terminal-policy advancementConsider testing a closed predecessor under both ScoreThe implementation is localized, reuses existing scheduling rules, and includes substantial regression coverage. No verified merge blockers were found; the supplied current-head status reports no failures, with four test shards still pending. Score: 9/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
AI Implementation Summary
Closes #3589
Branch:
3589/claude-opus-5-5-epic-pr-status-show-needs-20261117-0116-9vtCommits: ✅ Changes committed (7d59897)
AI Processing Completed
Execution Details:
Summary:
Epic PRs now show
⚠️when nothing is running and a sub-PR needs a person or waits to be merged. "#X starts next" appears only when the queue can start #X right now. The new tests and the related suites pass (335 tests, 0 failures), and lint and typecheck are clean.Root cause. The old check in
pullRequestStatusEpicFacts.tsread the queue'scursorcolumn. That column is legacy: new queues are created with it at 0, and the queue's real progress lives in the per-issue rows. So the old code treated the first issue, already merged, as the queue head. It then reported "starts next" whenever any later issue was pending, in every queue mode. Parallel queues had their own version of the bug: any pending issue counted. That is the #3563 picture.Fix (status computation only; how the queue dispatches is unchanged):
pullRequestStatusEpicFacts.tsnow reads the queue throughgetEpicExecutionQueueand asks the queue's own scheduler which issue starts now. An issue counts only if the dispatcher has already claimed it, or its prerequisites are satisfied and a slot is free. A sub-PR that isn't merged holds its slot and keeps the issues that depend on it waiting.nextIssue), and the "starts next" line names that issue rather than just the first pending one.pullRequestStatus.tskeeps its documented order of checks. With the queue check corrected, the sub-PR "needs you" and "waits to be merged" checks now apply. The title slot uses the same state, so it shows⚠️.docs/docs/features/pr-status.mdI reworded the vague "about to start its next issue" in theworkingrow to say what that means.Tests (
packages/core/test/pullRequestStatusEpicSync.test.ts). The test queue table was simpler than the real one, so I gave it per-issue rows and setcursorto 0, as real queues are created. New tests cover:⚠️, and sub-PR ready and waiting for merge, each with a pending issue behind it) in sequential and graph queues.With the original source swapped back in, 16 tests in this file fail: all the new ones except the two "starts next" positive checks, plus existing ones that now use the realistic
cursorof 0. With the fix, all of them pass.One behaviour to know about: in parallel and graph queues, an issue the dispatcher has claimed but that hasn't started running still shows as "starts next". The sequential queue already behaved this way.
No previews were made: the change is only to the status text and title on PRs, with no UI.
Acceptance criteria
pullRequestStatusEpicFacts.ts(nextQueuedIssue); tests "sequential/graph: a sub-PR that needs a person…" and "parallel: a sub-PR that needs a person showspackages/core/test/pullRequestStatusEpicSync.test.tspullRequestStatusEpicFacts.ts; tests "sequential/graph: a ready sub-PR waiting for a human merge…", the parallel test's ready step, and "a ready sub-PR waiting to be merged showspullRequestStatusEpicSync.test.tsnextQueuedIssueusesepicQueueSchedule(prerequisites, slot limit, claims); tests "a graph issue whose prerequisites are merged and that has a free slot starts next…", "a parallel issue that is pending and unclaimed starts next…", "a chain starts the issue after a head that merged…"⚠️ 1/3 [Epic] Scheduler primitives(settledTitleinpullRequestStatusEpicSync.test.ts)pullRequestStatusEpicSync.test.tsfail when run against the originalpullRequestStatus.tsandpullRequestStatusEpicFacts.tsand pass with the fixReview digest
Acceptance criteria (5 of 5 met, as stated by the agent)
With no running work and an open sub-PR in `needs_attention`, the epic is `needs_attention` naming that sub-PR, for sequential, parallel and graph queues.—`pullRequestStatusEpicFacts.ts` (`nextQueuedIssue`); tests "sequential/graph: a sub-PR that needs a person…" and "parallel: a sub-PR that needs a person shows ⚠️…" in `packages/core/test/pullRequestStatusEpicSync.test.ts`With no running work and an open sub-PR that is `ready`, the epic is `needs_attention` with the "waits to be merged" reason.—`pullRequestStatusEpicFacts.ts`; tests "sequential/graph: a ready sub-PR waiting for a human merge…", the parallel test's ready step, and "a ready sub-PR waiting to be merged shows ⚠️…" in `pullRequestStatusEpicSync.test.ts`A pending issue makes the epic `working` ("starts next") only when the queue can dispatch it now: its prerequisites are merged, the queue is not waiting for an unmerged sub-PR and has a free slot.—`nextQueuedIssue` uses `epicQueueSchedule` (prerequisites, slot limit, claims); tests "a graph issue whose prerequisites are merged and that has a free slot starts next…", "a parallel issue that is pending and unclaimed starts next…", "a chain starts the issue after a head that merged…"The epic title slot follows the same state (`⚠️` in the cases above).—the new tests check that the title settles to `⚠️ 1/3 [Epic] Scheduler primitives` (`settledTitle` in `pullRequestStatusEpicSync.test.ts`)Regression tests reproduce the #3563 situations (sub-PR at ⚠️ with pending issues behind it; sub-PR at ✅ waiting for merge) and fail on the current code.—the #3563 regression tests in `pullRequestStatusEpicSync.test.ts` fail when run against the original `pullRequestStatus.ts` and `pullRequestStatusEpicFacts.ts` and pass with the fixRisk-tiered paths
packages/core/src/services/pullRequestStatus/pullRequestStatus.ts(+10/−2)packages/core/src/services/pullRequestStatus/pullRequestStatusEpicFacts.ts(+29/−27)docs/docs/features/pr-status.md(+1/−1)packages/core/test/pullRequestStatusEpicSync.test.ts(+111/−9)Validation evidence
Diff size: 4 files changed, +151/−39 lines
Detailed Logs:
12b2bbeb-0224-4fff-aa13-4f0cfd4beb08Log files stored at:
/usr/src/app/logs/executions/issue-3589-2026-11-17T01-28-09-172Z-conversation.json/usr/src/app/logs/executions/issue-3589-2026-11-17T01-28-09-172Z-output.txtLatest Conversation Messages
This PR was created automatically by ProPR after processing issue #3589.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!