Repository navigation
π [v6] contribute: a fleet card never lists a closed or merged PR as awaiting rework, even right after a restart - #17412
Conversation
β¦ing rework, even right after a restart Stage records outlive their PR by up to 14 days (Prune) when a person closes or merges it, because the stage pass only lists open PRs and never sees the close. hivecommons#14708 dropped such records only where the status snapshot's open-PR listing is complete; right after a hub restart no repo's listing is, so every leftover 072/074 record read as owed rework (projectbluefin, 2026-11-09: 22 of 25 listed PRs were closed or merged). While the listing cannot vouch for a repo, a 072/074 record now counts only if a stage pass saw its PR within 072's stalled dwell (24h). A record the store marks superseded never counts, matching the stage tracker. A complete listing still decides as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar <Danathar@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Read the diff against the v6 tree and the stagelabels code it leans on; the mechanism checks out and this looks correct to me.
What I verified:
src/pkg/stagelabels/stagelabels.go:284β 072's table dwell is24 * time.Hour, sopendingReworkUnseenBound = stagelabels.ReturnedToContributor.Dwell()is the 24h the body describes, and the newTestOwedReworkBoundpins it aboveLastSeenPersistEvery(10m,store.go:891).src/pkg/stagelabels/store.go:833βObserveProgressHeadsetsnext.LastSeen = nowon every observation. The dampener early-return above it (store.go:815) only fires whenprev.Stage != stage, so a PR that sits in 072 across sweeps still has itsLastSeenrefreshed; the "an open PR's record is minutes old even after a restart" premise holds.src/pkg/stagelabels/store.go:2719βPrunedrops onLastSeen.Before(cutoff)with the 14-day maxAge, which is why the closed records survived until now.src/pkg/stagelabels/store.go:2438βSuperseded()isSupersededBy > 0; using it inowedReworkmatches how the stage tracker already drops those rows.owedReworkkeeps the vouched path identical to before (open.vouchesβ!open.closed), so repos with a complete listing behave exactly as since #14708.TestFleetReworkVouchedListingDecidesOverRecordAgecovers that.- The
LastSeen.IsZero()β keep branch is the conservative choice for a record the loader has not stamped yet;NoteUnblocked(store.go:944) also backfills zeroLastSeen, so this should be rare in practice.
One note, not a defect: the fix-queue loop (contribute_fleet_rework.go, the for _, it := range queued loop) still uses open.closed alone. Those items are not stage records and carry no LastSeen, so there is nothing to bound them by β and the body says fix_queue_depth was 0 in the incident β so leaving it as is seems right.
Changelog fragment and contributor-relay.md are updated consistently with the code. CI is the verdict on the tests; I did not run them.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Intent alignment: the diff matches the stated contract β One in-scope caveat worth a wording fix, not a blocker: Paused repos are a persistent, not transient, "cannot vouch" case. Reviewed at head f12331b. Tests not run locally (author states the same). Review findings from Read the change against the v6 tree at What I verified, not inferred:
The four new tests cover the three "cannot vouch" shapes, the fresh-after-restart keep, listing-overrides-age, and superseded/reopened. The one residual edge is an outage longer than 24h followed by a restart, where a genuinely open 072 PR would drop off the card until the repo listing completes (~15-25 min per the body) β the comment on Nothing to change from my side; this is a maintainer's call to merge. Evidence bundle `#17412f12331b` sha256:c3bedf6343f56345adf1407fe5f1361e0b500578d3a848e45e6a2b6a47e3f0be β download from the dashboard or `hivectl review evidence #17412`. |
Summary
Right after a hub restart, the Operations card for a contributor listed long-finished PRs as "N PRs awaiting rework (not yet dispatched)". On projectbluefin, 22 of the 25 listed PRs had been closed or merged by a maintainer 9 to 13 days earlier. The card now leaves out a stage record that no stage pass has seen for a day, and any record the store marks superseded, whenever a repo's open-PR listing cannot vouch for it yet. A genuinely open, freshly returned PR still shows straight after a restart. When the listing is complete, it still decides, exactly as it has since #14715. This only affects the display: nothing was dispatched (
fix_queue_depthwas 0, and #17403 already guards dispatch).What went wrong
The hub was upgraded and restarted on 2026-11-09 at 16:46Z (467557e β 6b17f8c).
GET /api/contribute/fleetat 16:53Z showed:pending_rework7, up from 1 before the restart. The PRs were utah-packages#702, #703, #704, #706, #734 and #769, all closed by a maintainer on Oct 27-28 ("Adopted and merged via feat: inception live activity feed + brainstorm clear_on_kickΒ #715" and similar), and #801, merged by a maintainer on Oct 31.The card cleared by itself about 15 to 25 minutes later.
The cause is that the stage pass sees only open PRs. When a person closes or merges one, the pass never observes it closing, so the PR's stage record simply stops being updated, and
Prunekeeps it for 14 days. #14715 (Refs #14708) drops those records using the status snapshot's open-PR list, but only for a repo whose list is complete. Right after a restart no repo's list is complete yet, so every leftover 072/074 record counted as owed rework.What changes
LastSeento disk at least every 10 minutes. An open PR's record is therefore minutes old even after a restart, while a PR closed days ago falls out.Pruneand the stage pass. Close-first supersession and adoption reopen read records of closed originals, so dropping those records earlier would break them.Files
src/pkg/dashboard/contribute_fleet_rework.go: addsowedRework,pendingReworkUnseenBoundandopenPRIndex.vouches, and uses them for both the 072 and the 074 loop.src/pkg/dashboard/contribute_fleet_rework_restart_test.go: new tests.src/docs/contributor-relay.md: thepending_reworkdescription.changelog.d/fixed-fleet-rework-closed-after-restart.mdTests
These were not run locally. CI is the verdict.
TestFleetReworkAfterRestartDropsLongUnseenRecordssaves and reloads a store holding records last seen 9 to 13 days ago, plus one seen 5 minutes ago. It checks the result with no status, with an incomplete listing and with a repo that was never enumerated, and only the fresh PR shows. It fails on the tip because thereclosed()returns false for an unvouched repo, so all four PRs are listed.TestFleetReworkAfterRestartKeepsFreshlyReturnedPRchecks that a 072 PR seen a minute before the restart, and a 074 PR seen 23 hours ago, both still show while the listing is stale.TestFleetReworkVouchedListingDecidesOverRecordAgechecks that a complete listing still decides: an old record that is listed open shows, and a fresh record that is not listed does not.TestFleetReworkSkipsRecordsTheStoreMarksFinishedcovers four cases: a superseded record, a close-first record and a forgotten record are all gone, while a reopened record shows. It fails on the tip because the tip lists the superseded and close-first records.TestOwedReworkBoundcovers the bound's edges and ties the bound to 072's dwell.π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1