From 3b0610ade7bd3c7c8dac80d913a30459bde3f88a Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Fri, 30 Oct 2026 09:01:53 -0400 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=90=9B=20Auto-resolve=20hive=20adviso?= =?UTF-8?q?ry=20checklists=20and=20fix=20issue-type=20delegated=20plan=20w?= =?UTF-8?q?ording?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../fixed-advisory-checklist-autoclose.md | 1 + src/cmd/hive/close_on_merge_sweep.go | 9 +- .../dashboard-sections/activity-monitor.md | 8 +- src/docs/operator-reference.md | 1 + src/pkg/config/config.go | 4 +- src/pkg/config/dedupe.go | 21 ++ src/pkg/config/dedupe_test.go | 34 +++ .../config/testdata/agent_runtime_golden.json | 1 + .../api_repo_item_decide_delegated.go | 36 ++- .../api_repo_item_decide_delegated_plan.go | 13 + ...pi_repo_item_decide_delegated_plan_test.go | 82 ++++++ .../api_repo_item_decide_delegated_test.go | 49 ++++ src/pkg/dashboard/row_action_result.go | 8 + .../dashboard/settings_parity_allowlist.txt | 1 + src/pkg/dashboard/stage_tracker_advisory.go | 80 +++++- .../dashboard/stage_tracker_advisory_test.go | 66 ++++- src/pkg/dashboard/stage_tracker_decided.go | 1 + .../stage_tracker_row_actions_test.go | 12 +- .../static-src/js/tracker-actions.js | 29 +- .../dashboard/static-src/js/tracker-row.js | 2 +- src/pkg/dashboard/static/index.html | 31 +- src/pkg/delegatedecision/decision_comment.go | 7 +- src/pkg/delegatedecision/decision_glossary.go | 7 + .../delegatedecision/issue_judgment_test.go | 48 ++++ src/pkg/delegatedecision/policy.go | 63 ++++- src/pkg/delegatedecision/policy_test.go | 4 +- src/pkg/github/close_on_merge.go | 13 +- src/pkg/github/dedupe_advisory_close.go | 265 ++++++++++++------ src/pkg/github/dedupe_advisory_close_test.go | 160 ++++++++--- src/pkg/github/dedupe_checklist_findings.go | 16 +- src/pkg/policies/defaults/dedupe-issues.md | 7 + .../testdata/direct-writes-baseline.txt | 2 - 32 files changed, 893 insertions(+), 188 deletions(-) create mode 100644 changelog.d/fixed-advisory-checklist-autoclose.md create mode 100644 src/pkg/config/dedupe.go create mode 100644 src/pkg/config/dedupe_test.go diff --git a/changelog.d/fixed-advisory-checklist-autoclose.md b/changelog.d/fixed-advisory-checklist-autoclose.md new file mode 100644 index 0000000000..1b59437c0d --- /dev/null +++ b/changelog.d/fixed-advisory-checklist-autoclose.md @@ -0,0 +1 @@ +- Hive advisory checklists (the dedupe agent's `` issues) are now worked by the hive itself: the close-on-merge sweep ticks each `- [ ] #N …` item as #N closes or merges and closes the advisory as completed once every item is resolved (`dedupe.advisory_autoclose`, default on); the Activity Monitor never parks an advisory at 045 (chip *Advisory · hive is working the items (k/N resolved)*, optional **Close now** lead); and the delegated-decision plan for issues says *Approve the direction of #N and let the hive pick it up* (or, for an advisory, *Close the advisory* / *Keep open; hive is working k/N items*) instead of the PR merge-queue wording (#15754) diff --git a/src/cmd/hive/close_on_merge_sweep.go b/src/cmd/hive/close_on_merge_sweep.go index 0ddeded022..e00393f2f3 100644 --- a/src/cmd/hive/close_on_merge_sweep.go +++ b/src/cmd/hive/close_on_merge_sweep.go @@ -106,10 +106,11 @@ func closeOnMergeOptionsFor(cfg *config.Config, logger *slog.Logger, now func() decision := trustedAuthorFunc(cfg)(login, cfg.AutoMerge.TrustedAuthors.EffectiveRequireRole()) return decision.Allowed }, - RecheckAfter: cfg.Issues.EffectiveCloseOnMergeRecheck(), - Now: now, - LabelDriven: cfg.RepoLabelDriven, - RepoOnGitHub: cfg.RepoOnGitHub, + RecheckAfter: cfg.Issues.EffectiveCloseOnMergeRecheck(), + Now: now, + LabelDriven: cfg.RepoLabelDriven, + RepoOnGitHub: cfg.RepoOnGitHub, + AdvisoryAutocloseOff: !cfg.Dedupe.AdvisoryAutocloseEnabled(), } } diff --git a/src/docs/dashboard-sections/activity-monitor.md b/src/docs/dashboard-sections/activity-monitor.md index c82943212d..398c45bfa3 100644 --- a/src/docs/dashboard-sections/activity-monitor.md +++ b/src/docs/dashboard-sections/activity-monitor.md @@ -318,7 +318,9 @@ A row that already wears a hold, `blocked`, a draft marker or any stage record i #### Advisory row (`triage/advisory`, dedupe checklists) -An issue that is a note for maintainers rather than work — one wearing `triage/advisory`, a dedupe-agent checklist (body opens with ``) or any body whose verdict line reads `Decision required: no` — is an **advisory** ([#15381](https://github.com/hivecommons/hive/issues/15381) sat for hours as a plain *Open · since 3h*, indistinguishable from stalled work). Its row keeps `kind: issue` and carries `advisory{kind: "advisory", source (label|dedupe-checklist|decision-no), empty, chip, caption}`; the Open chevron reads the chip — **Advisory · read & close**, or **Advisory · nothing found · safe to close** when the checklist's own counts are all zero — muted (`ham-open-advisory`, ⓘ), with no *· since Nh* suffix and never the stale tint. The caption is *Advisory for maintainers · read, then close* (or *… · nothing found · safe to close*), the actor is a human with nothing waiting on them, the row is never *New*, never *stalled* or *sent back*, and it is excluded from **Needs human** and **Needs attention**. The row menu leads with **Close (read)**, which posts the existing `POST /api/repos/{owner}/{repo}/items/{number}/decision` with `decision: close-read`: a "Closed as read (advisory acknowledged) by @you from the Hive dashboard" comment, then the issue closes as *completed* (operator action `close-read` in the row's history). +An issue that is a note for maintainers rather than work — one wearing `triage/advisory`, a dedupe-agent checklist (body opens with ``) or any body whose verdict line reads `Decision required: no` — is an **advisory** ([#15381](https://github.com/hivecommons/hive/issues/15381) sat for hours as a plain *Open · since 3h*, indistinguishable from stalled work). Its row keeps `kind: issue` and carries `advisory{kind: "advisory", source (label|dedupe-checklist|decision-no), empty, resolved, total, chip, caption}`; the Open chevron reads the chip — **Advisory · read & close**, **Advisory · nothing found · safe to close** when the checklist's own counts are all zero, **Advisory · hive is working the items (k/N resolved)** when the body has `- [ ]` task lines and some are still open, or **Advisory · all items resolved · closing** once every line is ticked — muted (`ham-open-advisory`, ⓘ), with no *· since Nh* suffix and never the stale tint. The caption matches the chip, the actor is a human with nothing waiting on them, the row is never *New*, never *stalled* or *sent back*, and it is excluded from **Needs human** and **Needs attention**. + +An advisory is **never parked on a person** ([#15754](https://github.com/hivecommons/hive/issues/15754): #15734 sat at 045 *Needs human decision* while the hive itself had already resolved most of its checklist). Whatever its verdict line or labels say, the tracker drops the 045 stage, the `needs-human` / `needs-decision` pills, the decision block and the blocker from an advisory row. The checklist is the hive's own work: the close-on-merge backfill ticks each `- [ ] #N …` line as #N closes or merges (one body edit per sweep, idempotent), and once every line is ticked it comments *All N items resolved (#a closed, #b merged …) — closing this advisory.* and closes the issue as *completed*. A checklist still carrying open items expires after seven days. `dedupe.advisory_autoclose: false` turns the sweep off. The row menu leads with the optional **Close now**, which posts the existing `POST /api/repos/{owner}/{repo}/items/{number}/decision` with `decision: close-read`: a "Closed as read (advisory acknowledged) by @you from the Hive dashboard" comment, then the issue closes as *completed* (operator action `close-read` in the row's history); on a checklist the hive is still working its hint reads *optional · hive is working k/N items; close anyway*. **Let hive decide** on an advisory plans `would: close` (rule `advisory-resolved`, closes as completed) once its items are resolved, or a no-write *Keep open; hive is working k/N items* (rule `advisory-in-progress`) while they are not — and on an ordinary parked issue the default-approve plan reads *Approve the direction of #N and let the hive pick it up*, not the PR's merge-queue wording. The enumeration computes the body-derived part (`RepoWorkIssue.advisory`) because sidelined `hive_advisory` rows do not carry the body. Upstream, the issue-request relay refuses an agent's `issue-create` whose body is a dedupe checklist with no actionable finding (verdict `no`, zero near-duplicate pairs, zero resolved candidates, zero missing PR↔issue links, no `- [ ]` task lines): the agent's result file says why, the write audit records `agent_issue_empty_advisory_refused`, and a knowledge bead keeps the summary in the hive's own log — merge-order reminders and cross-links are notes, not issues. @@ -358,7 +360,7 @@ Plain words throughout — working / waiting on X / set back by Y / merged — n #### The row's lead action, inline -A row whose next move is yours does not hide its answer behind three dots. Beside the chips on the right of the header (and on a nested PR sub-row's own header), the row renders its **lead action** as a real `