Repository navigation
✨ Hive re-authors its own fixer-exhausted PRs; re-author pill becomes adopt - #16583
Conversation
|
[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 |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. clubanderson this PR is held at Failing checks:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. Review findings from Intent-alignment review (read at head The engine/tracker/vocabulary work matches #16582 well: first exhaustion of a hive PR auto re-authors ( One in-scope gap, same class as the issue's own complaint ("pressing the pill is a dead end"): "Give direction" on a fixer-exhausted hive PR promises a fixer run the dispatcher refuses.
The old text on this route ("Hands the PR to a person … the hive steps back", removed at
and in
Review findings from Correctness review @ d75c30e (read the diff plus 1.
|
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
… adopt Fixes #16582 Engine: a hive-authored PR whose fixer is exhausted is closed as superseded (note, hive/superseded), the issue is labelled hive/re-authored and requeued; the kick asks for a fresh PR with 'Supersedes #<old>'. One automatic re-author per issue (store record + issue label); a second exhaustion parks at 085 with direction / hand to a person / close as not planned. Dashboard: decide:re-author removed; DCO/exhausted contributor PRs offer decide:adopt 'Adopt as hive PR'. Issue row reads 'Re-authoring · superseding #N' (remediation kick) until the fresh hive PR is listed, which carries lineage re-authored → 're-authored from #N'. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
There was a problem hiding this comment.
Every red check on this PR has a single cause: the merge with v5 no longer compiles. The branch itself is fine; it is behind v5.
v5 (currently 3536590) gained src/pkg/dashboard/stage_tracker_signoff_lead_test.go (165 lines) after this branch forked, and that file still uses the symbols this PR deletes:
stage_tracker_signoff_lead_test.go:101→decisionLeadWithReauthor(...)stage_tracker_signoff_lead_test.go:103→decisionActionReauthor
This PR removes both from src/pkg/dashboard/stage_tracker_decision_pr.go (the decisionLeadWithReauthor func, the decisionActionReauthor constant and its case), which is consistent with the stated intent of retiring decide:re-author. The test file is absent from the PR head (d75c30e), so nothing on the branch shows the breakage — only the merge commit does. build-go, golangci-lint, coverage and all test (dashboard …) shards fail on exactly these two undefined: lines (checked job logs for build-go, golangci-lint and dashboard 1/4).
Fix: rebase onto v5, then update the subtest "an existing lead (Re-author) stands" (lines ~99–105). A plain rename is not enough, since the re-author lead no longer exists; the equivalent on this branch is the adopt lead (decisionActionAdopt, built at stage_tracker_decision_pr.go:238 in decisionLeadFixerExhausted), so the subtest should either assert that an existing adopt lead survives stageTrackerLeadApproveForSignOff, or be dropped if that case is already covered in stage_tracker_lead_action_test.go.
I did not review the remaining 28 files in depth; once CI compiles this is worth a second pass on automerge_hive_reauthor.go (one-re-author-per-issue bound and the PATCH-close path).
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
d75c30e to
b5d7f13
Compare
There was a problem hiding this comment.
Security perspective (read at head d75c30e).
One in-scope issue: the new hive/re-authored marker write bypasses the write-back gate.
src/pkg/github/automerge/automerge_hive_reauthor.go:109 calls Issues.AddLabelsToIssue(... issue, LabelReauthored) (annotated // writeback:gated) before the only gate check in the function at :118 (c.writebackAllowed(..., KindSupersessionClose, ...)). The gate refuses every kind — own items included — on an operator-paused repo and on per_repo.mode: off / issues-only (src/pkg/writeback/gate.go:75-79, :423-437), and the package convention is "the one call an unsolicited write makes before touching GitHub" (automerge_writeback.go:27-33; cf. automerge_adoption_close_first.go:162-170, where the gate precedes the note/label/close). Here a paused/off repo still gets a label written on a third-party issue, and because :120 returns err == nil, automerge_stage_labels.go:1149-1150 records the PR as re-authored and the issue carries the marker that drives the scheduler kick hint (kickmessage.go) while the old PR remains open. The writeback:gated annotation also hides the call from the writeback ratchet (src/pkg/writeback/ratchet_test.go:91), so this would not be caught later.
Fix: move the gate decision above the marker write so no GitHub write happens on a refused repo:
--- a/src/pkg/github/automerge/automerge_hive_reauthor.go
+++ b/src/pkg/github/automerge/automerge_hive_reauthor.go
@@ func (c *Engine) reauthorExhaustedHivePR(
rec, _ := store.Get(key)
noted = rec.ReauthorNoted
+ body := reauthorCloseComment(obs, issue, fixer.Attempts)
+ item := writebackItemForObservation(obs)
+ item.HiveAuthored = true
+ if d := c.writebackAllowed(obs.Display, item, writeback.KindSupersessionClose, body); !d.Allowed {
+ c.info("stage labels: re-author withheld by the write-back gate", append(logArgs, "writeback_reason", d.Reason)...)
+ return 0, noted, nil
+ }
if !rec.Reauthored() {
if _, _, err := c.gh.Issues.AddLabelsToIssue(ctx, obs.Owner, obs.Repo, issue, []string{stagelabels.LabelReauthored}); err != nil { // writeback:gated
c.warn("stage labels: re-author marker label failed; parking the exhausted PR for a person", append(logArgs, "error", err)...)
return 0, false, err
}
c.info("stage labels: hive PR's fixer exhausted; re-authoring it for the issue from the current base", logArgs...)
}
- body := reauthorCloseComment(obs, issue, fixer.Attempts)
- item := writebackItemForObservation(obs)
- item.HiveAuthored = true
- if d := c.writebackAllowed(obs.Display, item, writeback.KindSupersessionClose, body); !d.Allowed {
- c.info("stage labels: re-author close withheld by the write-back gate", append(logArgs, "writeback_reason", d.Reason)...)
- return 0, noted, nil
- }
if !noted {With the gate first, a refused pass leaves no record and no marker, and the caller's else branch is not reached either — consider also having the caller fall through to the 085 park when the gate refuses (return a withheld flag), so the row does not read "Re-authoring" on a repo where the hive is deliberately quiet. A test with a paused repo asserting zero AddLabelsToIssue calls would pin this.
No other security-relevant concerns: closing-issue number comes from the hive's own PR body (ClosingIssueRefs, maintainer-editable only), the close is scoped to hiveOwnPR (App login / authorkind.Hive), and the decision=re-author alias maps to the same adopt path, widening no permission.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 34fe582. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
…up to 5e0e398) Conflicts resolved (v5 wins unless v6 intentionally diverged): - src/pkg/config/config.go: v6 split the file; v5 GovernorConfig.Review + GovernorReviewConfig ported to governor_config.go - src/pkg/config/dashboard_matrix.go: v5 comment wording kept, v6 DashboardMatrixConfig name kept (v6 already has a notifications MatrixConfig); dashboard_config.go comment updated to match - src/pkg/dashboard/server.go: v6 RUnlock-before-build kept, v5 ReviewQuestionsAutodecided1h added to /api/status payload - src/pkg/github/issue_unpark_command.go: v6 owner-step menu kept, v5 held-after-decision (#16591) gate added with v6 ensureUnparkNoticeComment signature - src/pkg/scheduler/kickmessage.go: both hints kept (v6 upstream-sync label, v5 re-authoring #16583) - static-src/css/overview.css + static/index.html: v5 #16601 phone KPI fix taken, with v6's 7-tile grid (repeat(7…), 1799px breakpoint) retained - static-src/js/tracker-row-render.js + static/index.html: v6 finisher fields kept, v5 unauthorized_step added - src/docs/maintainer-commands.md: v6 PR-approval wording kept, v5 #16579 approved-direction text spliced into /hive decision row - src/docs/api-reference/*: ours + v5 purpose text; citations re-anchored by check-docs-citations.py --fix - src/docs/scale-envelope.md: RankActionableIssues range re-anchored manually (5314-5324) Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Fixes #16582
Engine
automerge_hive_reauthor.go: on fixer-exhausted for a hive-authored PR (and adoption enabled), the hive re-authors itself: marker on the issue (hive/re-authored), writeback-gated close note,hive/superseded, PATCH close. Store recordsReauthor*on the old PR;ReauthoredFor(repo, issue)bounds it to one automatic re-author per issue — a second exhaustion parks at 085 with Give direction / Hand it to a person / Close as not planned (no re-author option;FixerExhaustedRoutenames the earlier re-author).PRPassFacts.Reauthoringkeeps the old PR on 070re-authoring:<issue>instead of parking.hive/re-authored: open a FRESH PR from the current base, writeSupersedes #<old PR>.Dashboard
decide:re-authorremoved from server options and UI (labels, confirm, acting caption, consequences). Contributor-PR rewrites aredecide:adopt→ "Adopt as hive PR" (DCO-unsigned 090 card; exhausted contributor PR). The API still acceptsdecision=re-authoras an alias of adopt for compatibility; historicalre-authorledger entries read "Re-author (now: adopt)" and map to adopt.stage_tracker_reauthor.gopost-pass: issue row with a re-author record and no fresh PR → PR-in-progress lane,Re-authoring · superseding #N,remediation {actor: hive, kind: kick, source: re-author}(24h window); fresh hive PR closing that issue →lineage {kind: "re-authored", from_number}→ chip "re-authored from #N" (never "adopted from").decide:adoptoption is now actionable as a lead (it was filtered as a nudge-only generic action).Tests
Go: first-exhaustion auto re-author vs second-exhaustion park, marker-label-alone blocks, stageengine stays-on-fixing, route vocabulary, tracker post-pass (issue caption / successor lineage / non-successors / stale window), decision cards (no re-author on hive PR, adopt on clanker PR, DCO card). Node: lineage text/clause/tip for
re-authored, lead pill on the #16456-shaped row has no re-author, adopt wiring.go test ./pkg/dashboard/ ./pkg/github/automerge/ ./pkg/stagelabels/ ./pkg/stageengine/... ./pkg/scheduler/green;make dashboard-gen-checkclean.