Repository navigation
π Auto-resolve hive advisory checklists and fix issue-type delegated plan wording - #15767
Conversation
β¦plan wording The dedupe agent's advisory checklists were parked at 045 for a person to decide even though the hive itself resolves their items. The close-on-merge backfill now ticks each '- [ ] #N' task line as #N closes or merges (one idempotent body edit per sweep) and, once every item is resolved, comments 'All N items resolved (β¦) β closing this advisory.' and closes the issue as completed. Knob dedupe.advisory_autoclose (default on). The stage tracker never parks an advisory: no 045 stage, no needs-decision block or blocker; the chip reads 'Advisory Β· hive is working the items (k/N resolved)' and the lead action is an optional 'Close now'. The delegated-decision plan branched on verdict only, so an issue got the PR's 'let the merge queue merge it' wording. The default-approve plan now branches on kind, and an advisory plans 'close' (rule advisory-resolved, closed as completed) or a no-write 'Keep open; hive is working k/N items' (rule advisory-in-progress). Closes #15754 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
β¦ig for settings parity Signed-off-by: Andrew Anderson <andy@clubanderson.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 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
b217a0b
βΉοΈ Sentinel notice β informational; author is trusted (owner), merge is not blockedHive flagged this PR (author @clubanderson, head
Hive did not add the |
There was a problem hiding this comment.
Read the sweep against v5 (src/pkg/github/dedupe_advisory_close.go, close_on_merge.go, issue_unpark_command.go) and the writeback gate. The tick-and-close flow itself looks correct to me: ticked lines cost no read, the body edit is idempotent, body_edit_failed is transient, and pending items return dedupe_advisory_refs_open before any close. One regression, then a note on #15765.
Person-applied needs-human no longer stops the sweep β medium, src/pkg/github/dedupe_advisory_close.go:198-223.
On v5 the sweep only ran for triage/advisory-labelled checklists and returned dedupe_advisory_parked when hasIssueParkingLabel(labels) was true (v5:136), which includes needs-human (issue_unpark_command.go:27, via hasIssueNeedsHumanLabel). This PR runs the sweep on every hive-authored dedupe checklist and drops that check entirely β labels is now read at :219 only to populate the writeback gateItem, and WritebackAllowed does not consult parking labels (nothing in src/pkg/writeback/*.go reads needs-human). The "also parked" case was removed from dedupe_advisory_close_test.go rather than updated.
Consequence: a maintainer who puts needs-human on a hive dedupe checklist to hold it ("I want to look at these before anything closes") now has it ticked and closed as completed the moment the referenced items resolve β or after 7 days via the expired branch at :223, which previously also only applied to labelled advisories. Dropping the hive's own needs-decision park is the point of #15754; dropping a person's needs-human is not stated there. Suggest keeping if hasIssueNeedsHumanLabel(labels) { skip "dedupe_advisory_parked" } (just the human label, not the hive stage labels) and restoring the test.
Relation to #15765. It implements the same #15754 fixes with the same dedupe.advisory_autoclose key and overlapping edits to 9 files, so the two conflict. This one is the better survivor: it also covers the advisory would: close plan that #15765 defers, and #15765's CI is red from its own diff (config.DedupeConfig / writeback.DedupeConfig parity collision, hand-edited static/index.html) β both of which this PR avoids. I've left the close recommendation on #15765.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether #15767 or #15765 lands for #15754 β they add the same dedupe.advisory_autoclose sweep in the same new files with incompatible type/option names, so both cannot merge.
Conclusion: the sweep logic reads correct to me, but this PR and #15765 are two implementations of the same change for #15754 and they conflict; one of them has to be closed. Routing to a person because this also edits a hive policy file (src/pkg/policies/defaults/dedupe-issues.md, src/policies/dedupe-issues.md) and carries a sentinel notice.
Overlap I verified (read both diffs in full):
- Both add
src/pkg/config/dedupe.gowith the sameadvisory_autoclosekey andAdvisoryAutocloseEnabled()accessor β here asDedupeLaneConfig, in #15765 asDedupeAdvisoryConfig. - Both rewrite
src/pkg/github/dedupe_advisory_close.goto tick- [ ] #Nlines and close ascompleted, both deletereclassifyDedupeChecklist/dedupeRefOpen, both wire the knob insrc/cmd/hive/close_on_merge_sweep.goβ here asAdvisoryAutocloseOff, there asDisableAdvisoryAutoclose. - Same files also touched by both:
close_on_merge.go,dedupe_checklist_findings.go,stage_tracker_advisory.go,api_repo_item_decide_delegated_plan.go,settings_parity_allowlist.txt,agent_runtime_golden.json,operator-reference.md,activity-monitor.md,static/index.html.
Difference that matters: #15765 deliberately left the advisory half of #15754 item 3 (the delegated plan's would: close) to a sub-issue; this PR implements it (delegatedecision/policy.go, decision_glossary.go, api_repo_item_decide_delegated.go) and closes #15754 outright. So this one is the broader of the two; #15765 already has a changes_requested verdict at b1ff271. If this lands, #15765 could be closed as superseded. I have not closed anything.
Correctness read of the sweep (src/pkg/github/dedupe_advisory_close.go):
- Item β first ref on the line (
dedupeChecklistItems, :140β152), ticked lines cost no read (:306β309), partial progress is written before thepending > 0return (:234β252) β matches the stated design. - One ordering note, info-level: the body tick edit (:234β247) runs before the "reopened after close" check (:255β264), so a checklist a person reopened keeps getting its boxes ticked on later sweeps even though it is never re-closed. Probably acceptable; mention it in case you want reopened checklists left strictly alone.
direct-writes-baseline.txtdrops 1 raw + 3 wrap entries for this file; the remaining writes are all behindWritebackAllowed(:236, :265). Good.
CI at b217a0b: all test shards green, coverage/test aggregate still queued.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Closes #15754
Two tightly related flow fixes for hive-authored advisory checklists (e.g. #15734).
Fix 1 β advisories resolve themselves. The close-on-merge sweep now walks every open hive-authored advisory checklist (
<!-- hive:dedupe-checklist -->) each cycle: it ticks- [ ]β- [x]for items whose referenced PR/issue is closed or merged (one idempotent body edit per change set), and when every item is resolved it comments "All N items resolved (β¦) β closing this advisory." and closes the issue with reasoncompleted. The stage tracker no longer parks advisories at 045 "Needs human decision": the caption reads "Advisory Β· hive is working the items (k/N resolved)" with nodecision_neededblock, and the only human lead is an optional "Close now". New knobdedupe.advisory_autoclose(default on) is in the settings parity allowlist with accessor tests.Fix 2 β delegated-decision plan wording for issues.
decide-delegated/planwith{"type":"issue"}returned PR wording ("let the merge queue merge it"). The default-approve plan now branches on kind β issues read "Approve the direction of #N and let the hive pick it up." β and advisories planwould: close("Close the advisory β its items are tracked by the hive.") when all items are resolved or a no-write "Keep open; hive is working k/N items." otherwise. Executor closes ascompleted. Table tests cover issue vs PR vs advisory wording.Also:
pkg/config.DedupeConfigβDedupeLaneConfig(bare-name collision withpkg/writeback.DedupeConfigin the settings-parity resolver); SPA decision glossary regenerated from Go.Docs: activity-monitor, operator-reference, dedupe-issues policy. Changelog fragment included.