Skip to content

🐛 fix: expose deferred PR fixer queue positions - #16546

Closed
thatguywob wants to merge 2 commits into
hivecommons:v5from
thatguywob:fix/16537-fixer-queue
Closed

thatguywob wants to merge 2 commits into
hivecommons:v5from
thatguywob:fix/16537-fixer-queue

Conversation

@thatguywob

Copy link
Copy Markdown
Contributor

Deferred PR fix kicks currently disappear from the dashboard while the fixer is busy. This records each PR's first deferral in the governor, preserves its place across retries and fixer reassignment, and removes it after successful fix delivery or enumeration observes it is no longer open.

GET /api/governor/pr-models now includes an optional fixer_queue map keyed by owner/repo#number. Each queued PR has fixer_queue_position and fixer_queue_ahead; the review queue API includes the same optional fields alongside existing PR fields. Its dashboard stage metadata displays fixer queued, N ahead only while queued. Queue positions reflect first-deferral age across fixer lanes; bookkeeping does not change dispatch order and is rebuilt after process restart.

Added regression coverage for busy bounces, messages deferred behind another kick, retries, fallback delivery, closure, global positions across API pages, JSON omission and rendering the first entry with zero ahead. Added a changelog fragment.

Validation: gofmt -l on all changed Go files produced no output; git diff --check passed. Tests were not run locally, as required by AGENTS.md; CI executes them.

Fixes #16537

— hive: backend=codex model=gpt-6.1-sol effort=high


🐝 Hive Agent: contributor | SHA: 00937e787

Remember the first deferral of each review fix kick in the governor and
remove it on delivery or when enumeration no longer sees the PR open.
Expose optional queue status through the governor and review queue APIs,
and show the number ahead beside the PR's dashboard stage metadata.

Hive-Run: hivecommons#16537
Hive-Plan: issue-16526/deferred-fixer-queue
Hive-Spec: issue-16537#acceptance-criteria
Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 4, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 4, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Failing checks:

  • test (rest 3/4)

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Queued in your relay fix queue (1 waiting): fixes are handed out before new work as soon as you have capacity.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#16492 ✨ feat(dashboard): changed-paragraph reader kiosk view (part 1/3) same files src/pkg/dashboard/static/index.html
#16513 ✨ feat(dashboard): feed published checkpoint diff regions to Code activity same files src/pkg/dashboard/static/index.html
#16500 ✨ feat(dashboard): replace Matrix presentation with Code activity same files src/pkg/dashboard/static/index.html
#16514 ✨ feat(dashboard): replace Matrix presentation with Code activity same files src/pkg/dashboard/static/index.html
#16541 🐛 fix: route undeliverable fixer kicks to fallback agents same files src/pkg/dashboard/static/index.html
#16542 🐛 fix: limit Activity Monitor chevrons to observed motion same files src/pkg/dashboard/static/index.html

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Read the governor bookkeeping, the cmd/hive wiring and the dashboard join on 00937e7. This looks correct to me.

What I verified:

  • Keys agree end to end. RecordFixKickDeferred lowercases k.PRRef (pkg/governor/fixer_queue.go:24); PRRef is fmt.Sprintf("%s#%d", pr.Repo, pr.Number) (pkg/review/dispatch.go:1608) where pr.Repo is already owner/repo via fullRepoName (cmd/hive/main_eval_cycle.go:670); the dashboard and reconcile both key with github.ReviewQueueKey, which is strings.ToLower("%s#%d") (pkg/github/review_queue.go:323-325). So a deferred PR is found again on /api/review/queue and survives reconcile.
  • Only fix kicks touch the queue. reviewFixKickQueue.Deferred/Delivered gate on k.Kind == "fix" (cmd/hive/fixer_queue.go:21,27), so review kicks for the same PR neither enqueue nor dequeue it.
  • Nil-safety. deps.Governor is *governor.Governor (pkg/dashboard/deps.go:47) and every new method returns on a nil receiver, so governorFixerQueue() is safe when no governor is wired; FixerQueue() returns nil on an empty queue and the handler's map lookup on a nil map yields the zero FixerQueueStatus, whose fields are omitempty, so existing items JSON is unchanged for unqueued PRs (review_queue_view_9607_test.go adjustment is just the wrapper type).
  • reconcileDeferredFixQueue returns early on actionable == nil (cmd/hive/fixer_queue.go:33), so a failed enumeration doesn't wipe positions.

One open question, not a finding: reconcile treats "absent from actionable.PRs.{Items,Held,StaleDrafts,Attributed}" as closed. If an open PR can drop out of all four sets for a cycle (e.g. a filter the enumeration applies), it would lose its first-deferral timestamp and re-enter at the back on the next deferral. I didn't trace every enumeration filter, so flagging rather than asserting.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

hivecommons-hive Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

Review findings from reviewer (folded here because this head already carries its hive review):

Conclusion: the governor bookkeeping and API plumbing read correctly to me; two concrete problems need a push before this can land, plus one body fix.

Verified (read at 00937e7 against the callers): reviewFixKickQueue.Delivered is reached for every delivered kick because dispatchAgentKicks calls onReviewDelivered unconditionally at src/cmd/hive/eval_cycle_seams.go:636, and Deferred is wired on the busy branch at :612-618. Keys line up: DispatchKick.PRRef is built from the org-normalised pr.Repo (src/pkg/review/dispatch.go:693, :1608), RecordFixKickDeferred lower-cases it, and github.ReviewQueueKey lower-cases too (src/pkg/github/review_queue.go:323-324), so ReconcileFixerQueue and the review-queue join match. FixerQueue() tolerates a nil governor.

1. static/index.html is edited by hand; the source file is not (high — fails CI). fixerQueueHint and the metaBits.push call are added only to src/pkg/dashboard/static/index.html (~:43352); src/pkg/dashboard/static-src/js/review-queue.js:43-45, which that section is generated from, is untouched. go run ./pkg/dashboard/webstatic/gen … -check on this head prints pkg/dashboard/static/index.html is out of date with pkg/dashboard/static-src; run make dashboard-gen, which is what test (rest 3/4) / test are red on. The next make dashboard-gen by anyone also deletes the hint. Fix: move the JS into review-queue.js and regenerate.

2. A PR that no longer needs a fix stays queued forever (medium). ReconcileFixerQueue (src/pkg/governor/fixer_queue.go:62-75) only drops refs absent from the open-PR set, and the only other removal is RecordFixKickDelivered. If a fix kick is deferred and the PR then stops planning a fix kick (new head, review passes, author fixes it, lane reassigned away) while remaining open, its entry never leaves: it shows "fixer queued, 0 ahead" indefinitely and every later PR reports one more "ahead" than is true — the exact misreport the PR sets out to remove. Reconciling against the current plan's FixKicks refs (the loop at src/cmd/hive/main_eval_cycle.go:1007-1014 already has them) in addition to the open set would close this.

3. Body cites Fixes #1653. The changelog fragment is fixed-16537-fixer-queue.md; as written, merging closes issue #1653, not #16537.

Not blocking, for the record: the queue is in-memory and the comment at fixer_queue.go:80 says so; after a restart positions reset until the next busy bounce.

hive/awaiting-ci: pushed b824717 addressing the review findings (queue hint moved into static-src/js/review-queue.js with index.html regenerated byte-exact; deferred fixes whose PR no longer plans a fix kick are now dropped each cycle, with a regression test; body already cites Fixes #16537). CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob the hive has adopted this PR (stage/074-adopted-by-hive): your hive has been offline since the nudge. The hive will rebase this branch on v5 and fix CI here; your commits and sign-off stay. Push a new head yourself at any time and the hive yields it back to you.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Shared CI incident: the red mobile-shots check here is the tracker-header-geometry probe failing identically on every open v5 dashboard PR (probe still expects a single-line chevron; v5 now ships a two-line box). It is not caused by this diff and is reporting-only (continue-on-error). Tracked in #16551 — no per-PR repair; deferred until the probe is updated.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

…tries whose PR no longer plans a fix kick

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 4, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Superseded by hive: re-authored as #16553 with the same commits and sign-off because its commits needed a sign-off only a hive-owned branch can carry. This PR is closed; if #16553 fails, hive reopens it.

@hivecommons-hive hivecommons-hive Bot added the hive/superseded Closed by Hive: a different merged PR already landed this change label Nov 4, 2026
@hivecommons-hive hivecommons-hive Bot closed this Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. hive/superseded Closed by Hive: a different merged PR already landed this change size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] Governor: per-PR deferred fix-kick queue position + dashboard 'fixer queued, N ahead'

1 participant