Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fixed-advisory-checklist-autoclose.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Hive advisory checklists (the dedupe agent's `<!-- hive:dedupe-checklist -->` 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)
9 changes: 5 additions & 4 deletions src/cmd/hive/close_on_merge_sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/docs/dashboard-sections/activity-monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<!-- hive:dedupe-checklist repo=… -->`) 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 `<!-- hive:dedupe-checklist repo=… -->`) 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.

Expand Down Expand Up @@ -358,15 +360,15 @@ 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 `<button class="ham-lead-act">` β€” `[Accept triage]` on *Triage needed* (000-new hold or 015), `[Merge now]` (or the server's lead answer) on *Ready for human merge*, `[Let hive decide]` on *Needs human decision* and a duplicate's *Needs a pick*, `[Adopt…]` on a returned contributor PR whose adoption is due, `[Close (read)]` on an advisory issue. `stageTrackerLeadAction(item, ctx)` picks it from the same `stageTrackerRowActions(...)` list the β‹― menu shows: the entry flagged `lead`, else the first *Decide…* option, else Adopt / Adopt now / *Let hive decide β€” all N PRs*; one button only, everything else stays in β‹―. It carries the menu entry's id, its hint as the hover and its enable/disable reason: a viewer without write access sees it greyed with *Sign in with write access to this repo*, a non-merger sees a merge action greyed with the role reason, never hidden. Clicking runs `runRowAction(action, row)` β€” the menu's own path, so the busy chevron, the acting caption, the toast and the history badge are the same. A row the server marks as the maintainer's move (`actor: maintainer` or `new.next_mover: maintainer`) that yields no lead is a bug: a development host logs a console warning, and `TestStageTrackerMaintainerRowsHaveLeadAction` runs the real fixtures through the picker.
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 `<button class="ham-lead-act">` β€” `[Accept triage]` on *Triage needed* (000-new hold or 015), `[Merge now]` (or the server's lead answer) on *Ready for human merge*, `[Let hive decide]` on *Needs human decision* and a duplicate's *Needs a pick*, `[Adopt…]` on a returned contributor PR whose adoption is due, `[Close now]` on an advisory issue. `stageTrackerLeadAction(item, ctx)` picks it from the same `stageTrackerRowActions(...)` list the β‹― menu shows: the entry flagged `lead`, else the first *Decide…* option, else Adopt / Adopt now / *Let hive decide β€” all N PRs*; one button only, everything else stays in β‹―. It carries the menu entry's id, its hint as the hover and its enable/disable reason: a viewer without write access sees it greyed with *Sign in with write access to this repo*, a non-merger sees a merge action greyed with the role reason, never hidden. Clicking runs `runRowAction(action, row)` β€” the menu's own path, so the busy chevron, the acting caption, the toast and the history badge are the same. A row the server marks as the maintainer's move (`actor: maintainer` or `new.next_mover: maintainer`) that yields no lead is a bug: a development host logs a console warning, and `TestStageTrackerMaintainerRowsHaveLeadAction` runs the real fixtures through the picker.

#### Row actions (right-click, β‹―, Shift+F10)

Right-clicking a row β€” or a nested PR sub-row β€” opens an in-app context menu of the actions that fit that item's current state; the β‹― button in the row's left gutter (every nested PR sub-row has its own gutter with its own checkbox and β‹―) opens the same menu for pointer-free use, and so do **Shift+F10** and the context-menu key while the row or anything in it has focus (every row is a tab stop).

The menu is positioned at the pointer, clamped to the viewport, uses `menu` / `menuitem` roles, moves focus with ↑ ↓ Home End, opens the *Decide…* group with β†’ and closes it with ←, and closes on Esc, Tab, click-away, scroll or resize, returning focus to the row. Shift+right-click keeps the browser's own menu. Entries, each shown only when it applies: **Decide…** on a row waiting on a person β€” a PR wearing the *Needs human decision* pill at 085 on the Merge queue column (the primary case: e.g. two competing `dibs` PRs), an issue row whose one nested PR is parked there (the menu reads *Decide PR #458…* and acts on that PR, since the issue's own stage is only mirrored from it), or an issue parked at 045.

**Progress and failure, for every action that writes** ([#15436](https://github.com/hivecommons/hive/issues/15436): Close (read) on an advisory did nothing visible β€” the row is not a decision park, so the click mapped to no target and returned without a request, a dialog or a toast). Close (read) now acts on the advisory row itself; any `decide:*` click whose target list comes up empty says so in a warning toast. The moment a mutating action is sent β€” close-read, close-superseded, won't-fix, hold, approve, merge, decide β€” the clicked row's chevron takes the striped busy state with the verb as its caption (*Closing…*, *Holding…*, *Approving…*); when the server answers that the item is closed or merged the caption turns terminal (*Closed Β· leaving list*, *Merged Β· leaving list*) and stays until the next tracker payload no longer lists the row. The server guarantees that payload: an item whose newest operator-ledger action is a `close-*` that applied is dropped from the tracker for `HIVE_OPERATOR_CLOSED_GRACE` (default 15m) while GitHub's list catches up, so the row cannot be resurrected between the click and the close being visible. A close on a repo the operator has paused is refused with a 200 `status: refused` result (*Close refused: repo paused β€” …*) and writes nothing. A refused, failed (GitHub 4xx/5xx) or network-errored action restores the chevron at once, toasts the reason, and notes it on the row's history badge (red; the hover's first line is the reason) until a newer server record replaces it β€” the ledger itself records refused and 5xx answers as `failed` with the one-line why.
**Progress and failure, for every action that writes** ([#15436](https://github.com/hivecommons/hive/issues/15436): Close (read), now **Close now**, on an advisory did nothing visible β€” the row is not a decision park, so the click mapped to no target and returned without a request, a dialog or a toast). Close now acts on the advisory row itself; any `decide:*` click whose target list comes up empty says so in a warning toast. The moment a mutating action is sent β€” close-read, close-superseded, won't-fix, hold, approve, merge, decide β€” the clicked row's chevron takes the striped busy state with the verb as its caption (*Closing…*, *Holding…*, *Approving…*); when the server answers that the item is closed or merged the caption turns terminal (*Closed Β· leaving list*, *Merged Β· leaving list*) and stays until the next tracker payload no longer lists the row. The server guarantees that payload: an item whose newest operator-ledger action is a `close-*` that applied is dropped from the tracker for `HIVE_OPERATOR_CLOSED_GRACE` (default 15m) while GitHub's list catches up, so the row cannot be resurrected between the click and the close being visible. A close on a repo the operator has paused is refused with a 200 `status: refused` result (*Close refused: repo paused β€” …*) and writes nothing. A refused, failed (GitHub 4xx/5xx) or network-errored action restores the chevron at once, toasts the reason, and notes it on the row's history badge (red; the hover's first line is the reason) until a newer server record replaces it β€” the ledger itself records refused and 5xx answers as `failed` with the one-line why.

**PR-scoped actions on nested PRs** ([#15009](https://github.com/hivecommons/hive/issues/15009): one issue, two PRs β€” [#15017](https://github.com/hivecommons/hive/pull/15017) *Ready for human merge Β· untrusted author* and [#15020](https://github.com/hivecommons/hive/pull/15020) *Needs human decision* β€” and no way to decide one without the other): every nested PR sub-row carries its own β‹― menu, and its *Decide…* (Let hive decide, Approve, Close as superseded by…, Won't fix…, Give direction…), *Hold* / *Release hold* and the rest act on **that PR** β€” `runRowAction(action, row)` receives the PR's own row object (number, repo, head), never the parent issue's, and the needs-human popover opened from a sub-row's chevron does the same.

Expand Down
1 change: 1 addition & 0 deletions src/docs/operator-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ Top-level YAML keys accepted by `config.Config`:
| Issue↔PR link safeguard | Always on with issue stage and claim-label sweeps. | GitHub shows its issue-list PR icon only when a default-branch PR body contains a closing keyword. When Hive sees a Hive-authored default-branch PR covering an issue and the PR body does not say the issue stays open, Hive appends `Fixes #N` to that PR body. Existing Hive-authored default-branch PRs that used `Refs #N` but are recorded by Hive stage/claim metadata as the implementation PR are retrofitted once with the same closer and `<!-- hive:issue-link-fixed -->`; human-authored PR bodies are never edited. If the body says `Part of #N` or otherwise leaves the issue open, Hive does not add a closer; it posts one stage-entry comment on the issue with the PR link and explains that GitHub will not show the icon without a closing keyword. Non-default-branch PRs get the same issue comment. |
| `issues.close_on_merge_backfill_interval` | `1h`. | How often Hive scans open issues carrying Hive PR-linkage signals (`stage/040-covered-by-pr` or the retired `🐝 covered by PR`, `hive/likely-done`, claim/covered comments, or timeline PR references) and applies the same close-on-merge policy to PRs that merged before the current process saw them. |
| `issues.close_on_merge_interval` | `10m`. | How often the close-on-merge **ledger sweep** walks every merged-PR claim in the duplicate-PR claim ledger. Passes in between (every governor eval cycle and manual rescan) only look at claims whose PR merged since the last full walk, so a fresh merge still closes its issue on the next pass without re-reading the whole ledger ([#11778](https://github.com/hivecommons/hive/issues/11778)). Both the ledger sweep and the backfill pause while the GitHub API budget mode is not `normal`; Hive logs one line on each pause and resume. Env override: `HIVE_CLOSE_ON_MERGE_INTERVAL` (Go duration). |
| `dedupe.advisory_autoclose` | `true`. | The close-on-merge backfill works the dedupe agent's advisory checklists itself ([#15754](https://github.com/hivecommons/hive/issues/15754)): for every open hive-authored issue whose body opens with `<!-- hive:dedupe-checklist repo=… -->` it ticks each `- [ ] #N …` task line whose #N is closed or merged (one body edit per sweep, idempotent) and, once every line is ticked, comments `All N items resolved (#a closed, #b merged …) β€” closing this advisory.` and closes the issue as `completed`. A checklist with open items expires after seven days. The Activity Monitor never parks an advisory at 045 regardless. `false` leaves checklists untouched (they still expire). Env/dashboard: yaml-only. |
| `issues.close_on_merge_recheck` | `24h`. | How long a merged-PR claim keeps its settled close-on-merge verdict before the ledger sweep re-verifies it against the API. Once a sweep reaches a final verdict for a claim β€” issue closed, already closed, Hive marker present, awaiting confirmation, untrusted author, reopened by a person, or PR not merged β€” it stamps `close_on_merge_settled_at` on the claim and later sweeps skip the claim with no API call until this window elapses. Transient failures (issue, timeline or comment reads/writes that errored) never settle and retry on the next sweep as before. The marker follows the claim while the same PR claims the issue and resets when a different PR takes it over. Env override: `HIVE_CLOSE_ON_MERGE_RECHECK` (Go duration). |
| `issues.reporter_confirmation` | `false`. | Legacy opt-in switch for hives that want every human-filed bug-family issue to wait for reporter verification before close. Leave false for the default close-on-merge policy; add `hive: needs-confirmation` to an individual issue when only that issue needs the gate. `hive: reporter-confirmed` and `hive: close-on-merge` remain accepted legacy bypasses. |
| `issues.sha_hold_trusted_label` | `needs-sha`. | Soft label the SHA-hold sweep applies to a `kind/bug` without a commit SHA when the reporter's author association is in `project.issue_filter.reporter_trust.trusted_associations` (default OWNER/MEMBER/COLLABORATOR), instead of the hard `hold` (#12002). The notice is the same; the issue stays actionable. A SHA-hold `hold` already on such an issue is swapped for this label. Set to `hold` to restore the hard hold for every reporter. |
Expand Down
4 changes: 3 additions & 1 deletion src/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ type Config struct {
Hub HubConfig `yaml:"hub"`
// Issues tunes issue lifecycle automation. Zero value keeps the safe
// defaults: close issues after their fix PR merges, and backfill hourly.
Issues IssuesConfig `yaml:"issues,omitempty" json:"issues,omitempty"`
Issues IssuesConfig `yaml:"issues,omitempty" json:"issues,omitempty"`
// Dedupe tunes the dedupe lane's follow-through on its checklists.
Dedupe DedupeLaneConfig `yaml:"dedupe,omitempty" json:"dedupe,omitempty"`
Contribute ContributeConfig `yaml:"contribute,omitempty" json:"contribute,omitempty"`
HiveID string `yaml:"hive_id"`
ACMMLevel *int `yaml:"acmm_level,omitempty" json:"acmm_level"`
Expand Down
Loading
Loading