Skip to content

πŸ› Auto-resolve hive advisory checklists and fix issue-type delegated plan wording - #15767

Merged
clubanderson merged 3 commits into
v5from
fix/advisory-checklist-autoclose
Oct 30, 2026
Merged

clubanderson merged 3 commits into
v5from
fix/advisory-checklist-autoclose

Conversation

@clubanderson

Copy link
Copy Markdown
Member

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 reason completed. 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 no decision_needed block, and the only human lead is an optional "Close now". New knob dedupe.advisory_autoclose (default on) is in the settings parity allowlist with accessor tests.

Fix 2 β€” delegated-decision plan wording for issues. decide-delegated/plan with {"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 plan would: 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 as completed. Table tests cover issue vs PR vs advisory wording.

Also: pkg/config.DedupeConfig β†’ DedupeLaneConfig (bare-name collision with pkg/writeback.DedupeConfig in the settings-parity resolver); SPA decision glossary regenerated from Go.

Docs: activity-monitor, operator-reference, dedupe-issues policy. Changelog fragment included.

…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>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 30, 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 nicholasjackson 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 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
#15706 🌱 refactor: split static-src/js/tracker-filter.js into 4 files CONFLICT src/pkg/dashboard/static-src/js/tracker-filter.js
#15521 🌱 refactor: split tracker row source CONFLICT src/pkg/dashboard/static-src/js/tracker-row.js
#15308 ✨ feature: enqueue eligible PRs into GitHub native merge queues same files src/docs/operator-reference.md
src/pkg/config/config.go
src/pkg/config/testdata/agent_runtime_golden.json
src/pkg/dashboard/settings_parity_allowlist.txt
#15757 ✨ Auto-merge hive-authored superseding PRs without operator decision CONFLICT src/pkg/delegatedecision/policy.go
#15750 πŸ› Reconcile launch_cmd on backend switch and degrade instead of crash-looping on a base-config contradiction same files src/pkg/config/config.go
#15731 πŸ“– docs: split the operator reference CONFLICT src/docs/operator-reference.md
#15765 πŸ› fix: advisory checklists resolve themselves and never park on a person CONFLICT src/cmd/hive/close_on_merge_sweep.go
src/pkg/config/dedupe.go
src/pkg/config/dedupe_test.go
src/pkg/dashboard/stage_tracker_advisory.go
src/pkg/dashboard/static/index.html
src/pkg/github/close_on_merge.go
src/pkg/github/dedupe_advisory_close.go
src/pkg/github/dedupe_advisory_close_test.go
src/pkg/github/dedupe_checklist_findings.go
#15763 πŸ› merge train: ready PRs lead; odometer rolls only after the bee lands same files src/docs/operator-reference.md
src/pkg/dashboard/static/index.html

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor
b217a0b

ℹ️ Sentinel notice β€” informational; author is trusted (owner), merge is not blocked

Hive flagged this PR (author @clubanderson, head b217a0b609c2) because it matches behaviors that can override security controls, escalate privileges or damage the codebase. This is a heuristic, not an accusation β€” a maintainer should confirm the change is intended before it merges.

  • sensitive_path β€” changes 2 sensitive path(s) (Touches a sensitive path (OWNERS, workflows, policies, hive config, security docs, …))
    • src/pkg/policies/defaults/dedupe-issues.md
    • src/policies/dedupe-issues.md

Hive did not add the sentinel-alert label because this author is trusted. The finding remains recorded for audit and the dashboard Security tab; set sentinel.trusted_authors_block: true to require the blocking label for trusted authors too.

@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 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

@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.

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.go with the same advisory_autoclose key and AdvisoryAutocloseEnabled() accessor β€” here as DedupeLaneConfig, in #15765 as DedupeAdvisoryConfig.
  • Both rewrite src/pkg/github/dedupe_advisory_close.go to tick - [ ] #N lines and close as completed, both delete reclassifyDedupeChecklist/dedupeRefOpen, both wire the knob in src/cmd/hive/close_on_merge_sweep.go β€” here as AdvisoryAutocloseOff, there as DisableAdvisoryAutoclose.
  • 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 the pending > 0 return (: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.txt drops 1 raw + 3 wrap entries for this file; the remaining writes are all behind WritebackAllowed (: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

@clubanderson
clubanderson merged commit a5f492e into v5 Oct 30, 2026
75 of 76 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/advisory-checklist-autoclose branch October 30, 2026 13:45
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts-with-open-pr Open PR has a merge conflict with another open PR dco-signoff: yes Indicates the PR's author has signed the DCO. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hive advisory checklists park on a person and the issue-type delegated plan uses PR wording

1 participant