[Bugfix #966] derivePrReady ignores merged → merged-but-gate-pending builder vanishes#980
Merged
Conversation
…ding builder vanishes A builder whose PR is merged but whose porch `pr` gate is still `pending` silently disappeared from the dashboard Needs Attention view and the whole Work surface. `derivePrReady` only checked the gate shape (pending + requested_at), so a merged PR still read as `prReady: true`. NeedsAttentionList then suppressed the builder row (expecting an open-PR row instead), but a merged PR lives in recentlyClosed, never pendingPRs, so no PR row was ever emitted. Fix (overview.ts): - Parse the `merged` boolean from status.yaml's `pr_history` (last entry — the PR the current `pr` gate was requested for; last-entry semantics keep SPIR/PIR checkpoint multi-PR flows correct). - `derivePrReady` now returns false once that PR is merged. Once `prReady` is false the builder is no longer suppressed; its still-pending `pr` gate surfaces it via the gate-row path (detectBlocked → "PR review"). No NeedsAttentionList change required. Adds 8 regression tests (parseStatusYaml merged parsing incl. last-entry checkpoint case; derivePrReady merged→false; end-to-end repro of the #966 shape).
…prebuilt) Prerequisite for running the test suite under node v26. better-sqlite3 12.9.0 ships no prebuilt for node 26 (NODE_MODULE_VERSION 147) and falls back to a node-gyp compile that fails on this machine (missing CLT pkg receipt). 12.10.0 provides a v147 prebuilt, so `pnpm install` downloads it (no compile, no CLT) and the full suite — including the new #966 regression tests — runs green. Architect-authorized unblock.
Contributor
Author
CMAP Review (3-way) — all APPROVE
Consensus: Clean, focused fix in One non-blocking note (Claude) — the end-to-end test comment named an external adopter's workspace. Addressed in |
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.
Summary
Fixes #966
A builder whose PR is merged but whose porch
prgate is stillpendingsilently vanished from the dashboard's Needs Attention view — and from the whole Work surface.Root Cause
derivePrReadyinpackages/codev/src/agent-farm/servers/overview.tsonly checked the gate shape:It never considered that the PR had already merged, so a merged-but-gate-still-pending builder read as
prReady: true.NeedsAttentionList.buildItemsthen suppressed the builder row (if (b.prReady) continue;) on the assumption the PR would surface via the open-PR (pendingPRs) path — but a merged PR lives inrecentlyClosed, neverpendingPRs, so no PR row was ever emitted. Neither path surfaced the builder → it disappeared permanently.Fix
overview.tsonly (the issue's prescribed fix — noNeedsAttentionListchange needed):parseStatusYamlnow parses amergedboolean from the last entry of status.yaml'spr_history. Last-entry semantics are deliberate: the most-recent PR is the one the currentprgate was requested for, so a SPIR/PIR checkpoint flow (an earlier merged PR + a later still-open PR awaiting review) correctly reads as not merged.derivePrReadynow returnsfalseonce that PR is merged (... && !parsed.merged).Once
prReadyisfalse, the builder is no longer suppressed; its still-pendingprgate surfaces it via the gate-row path (detectBlocked→"PR review"). Verified end-to-end in a test.Test Plan
parseStatusYaml: parsesmerged: true/false, defaults tofalsewhenpr_historyabsent, and reflects the last entry (checkpoint: earlier-merged + later-open → not merged; and later-entry-with-no-merged-key → not merged).derivePrReady: merged + pending gate →false; not-merged + pending gate →true.prReady: falseand surfaces viadetectBlocked → "PR review"(no longer vanishes).porch check: build + full test suite pass)tsc --noEmitcleanNote on the dependency bump
This branch also bumps
better-sqlite3^12.5.0 → ^12.10.0(separate commit). It's a prerequisite to run the test suite under node v26: 12.9.0 has no node-26 (ABI 147) prebuilt and falls back to a node-gyp compile that fails on a missing CLT pkg receipt; 12.10.0 ships a v147 prebuilt sopnpm installdownloads it (no compile). Architect-authorized.Out of scope (separate concern, per the issue)
Porch leaving the
prgatependingafter recordingmerged: true(never advancing the gate / requestingverify-approval) is a porch state-machine inconsistency that deserves its own issue. This PR only fixes the surfacing false-positive.