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-decide-preview-one-decision.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Dashboard: the *Let hive decide* preview is one clear decision instead of a wall of text β€” one verb-first sentence (no doubled "Hive would:"), one short why, at most two "then" items, the sentinel finding / rails / ruled-out rungs under a collapsed Details, and **Approve & merge as-is** offered only when the head is mergeable as it is.
2 changes: 1 addition & 1 deletion src/docs/api-reference/packs-and-acmm.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Part of the [Dashboard REST API reference](../api-reference.md); see that page f
| `POST` | `/api/repos/{owner}/{repo}/items/{number}/hold` | Owner or repo write/maintain/admin | Add or remove a dashboard hold chip for an issue or PR. Body `{"held": true}` adds the hive's exact-match canonical `hive-pause/<hive-id>` label; `{"held": false}` removes exactly the labels causing the hold (`hive-pause/<hive-id>` and/or generic hold labels) and never removes `hive/<hive-id>` provenance. Every toggle writes an audit-log entry; the #8851 upgrade migration writes `/data/hive-hold-migration-<hive-id>.json` with audit-backed, provenance-only, and ambiguous legacy `hive/<hive-id>` classifications. | `pkg/dashboard/api.go:337`, `pkg/dashboard/api_repo_hold.go` |
| `POST` | `/api/repos/{owner}/{repo}/items/{number}/decision` | Owner or repo write/maintain/admin, signed-in GitHub user | Record an operator decision from the activity monitor's row menu / selection bar. Body `{"decision": "approve"|"direction"|"close-superseded"|"close-wontfix"|"adopt"|"reroute"|"re-author"|"merge-now"|"queue-merge", "comment": "…", "type": "issue"|"pr", "superseded_by": "#458", "force": true, "to": "<login>"|"any"}` (`force` only with `adopt`, `to` only with `reroute`; an unknown `decision` is a 400). On an issue parked at 045, `approve`/`direction` act exactly as a maintainer's `/hive approve` / `/hive decision <text>` comment would (labels, `approved-direction`, stage-engine Unparked fact, reply comment naming the operator). On a PR parked at 085 (`type: "pr"`), `approve` posts the `/lgtm` and `/approve` commands as two comments attributed to the operator, records the approval against the head as the human answer to a `requires_human` / decision-requested verdict (the lanes and the stage engine honour it like a trusted merger's Approve review), lifts `needs-human`, clears the sentinel label and acknowledges the bundle's sentinel findings for that head, re-derives the stage and drops the tracker cache β€” the response adds `released` (`approval-recorded`, `needs-human`, `sentinel-label`, `sentinel-acknowledged`) and `stage`; the merge gate decides from there (no review as the operator, no merge) β€” and `direction` records the text as a human change request against the head β€” the `/hive decision` fix lane β€” on a hive-authored PR, and on a contributor's clanker PR (`author/clanker` / hive attribution markers) where the text is posted to the contributor's hive and the PR moves to `stage/072-returned-to-contributor` (`status: "direction-returned-to-contributor"`); a person's PR, which no hive can carry direction to, answers 409. The close variants post a comment naming the operator (and the superseding PR when `superseded_by` is given) and close the item as not planned. `adopt` and `re-author` require `type: "pr"` and queue adoption via the `adoption/supersede` label (409 unless `governor.labels.stage.adoption` is enabled). `adopt` with `"force": true` is *Adopt now* ([#15038](https://github.com/hivecommons/hive/issues/15038)): it bypasses the author's presence, the grace window and `maintainer_policy`, marks the stage record and nudges the automerge sweep so the adoption engine supersedes the head at once (responds `status: "already-adopted"` when nothing is left to do; 400 on the hive's own PR). `reroute` (`type: "pr"`, `"to": "<clanker login>"|"any"`) hands the PR's follow-up work to another online clanker through the contributor fix queue, posts a `<!-- hive:rerouted … -->` note and arms a pickup timer that falls back to Adopt now after `governor.reroute.pickup_timeout`; answers `status: "rerouted"`, 409 when no clanker is online or adoption is disabled. On a PR at 090, `merge-now` (*Approve & merge as maintainer*) posts an attributed comment and merges immediately through the hive's GitHub App, returning `status: "merged"`; `queue-merge` (*Approve β€” let hive merge*) records an approval attributed to the operator and applies the automerge label, returning `status: "queued-for-merge"` for the hive's merge sweep once CI is green and the head has soaked. Both require `type: "pr"` and a verified owner or `merger` role in addition to the route's repo permission check; both refuse closed/merged PRs and the operator's own PR. `merge-now` on a PR whose `mergeable_state` is `dirty`/`behind` instead answers `202` with `status: "rebase-queued"` (approval recorded, rebase kicked, merge follows via the follow-through once the hive's own rebase is green; a head pushed by anyone else fails the follow-through closed; `head-not-pushable` refusal on a fork without maintainer edits). `approve` on such a PR adds `rebase: {attempt, max, exhausted, head, text}` for the rebase episode it opened. Every decision writes an audit-log entry (`repo_item_decision_*`, e.g. `repo_item_decision_adopt_now`, `repo_item_decision_reroute`). | `pkg/dashboard/api.go:338`, `pkg/dashboard/api_repo_item_decision.go` |
| `POST` / `GET` | `/api/repos/{owner}/{repo}/items/{number}/decide-delegated` | Same as `…/hold` (owner or repo write), signed-in GitHub user; `decisions.delegate.enabled` (403 when off) | *Let hive decide*: enqueue a delegated-decision job in which the hive decides the parked item itself as the owner's delegate under `pkg/delegatedecision.PolicyText` and records it as a human decision (`/hive decision` comment with the `<!-- hive:delegated-decision … -->` marker, park labels off, `triage/accepted`, queue approval on a PR head). Body `{"type": "issue"|"pr", "reason", "caption", "sentinel_reason"}`. `POST` answers 202 with the job (`{id, status: "running"|"done"|"failed", decision: {verdict, rule, text, rationale, actions, keeps_park, ladder?: {decision, reason, ruled_out[]}}, notes, error}`; `ladder` is set on contributor-PR decisions and names the rung that decided β€” `already-fixed` β†’ `mergeable-as-is` β†’ `rebase-then-merge` β†’ `return-to-contributor` β†’ `contributor-offline` β€” and why each rung above it did not apply); 409 with the running job while one is in flight; `GET` reads it. Rails: never merges, refuses items wearing `hold`, never grants secrets/permissions (`needs-owner` + `hold` instead), recommends only on hive policy/governance questions (keeps 085). Audited as `repo_item_decision_delegated[_failed]`. See [dashboard-sections.md](../dashboard-sections.md#let-hive-decide). | `pkg/dashboard/api.go:329`, `pkg/dashboard/api_repo_item_decide_delegated.go` |
| `POST` | `/api/repos/{owner}/{repo}/items/{number}/decide-delegated/plan` | Same as `…/decide-delegated` | Preview for *Let hive decide*: runs the same owner-delegate policy with **no side effects** (nothing written, no job) and answers `{would, rule, acting, summary, why, consequences[], alternatives[], writes: false, prior, notes}` β€” *Hive would: re-author #15029 as a hive PR with the same commits and merge it; #15029 will be closed as superseded. Why: author @Karibhou is untrusted and their clanker is offline.* The confirm popover shows **Let hive do that** / **Approve & merge as-is** / **Cancel**; only then does the SPA post `…/decide-delegated` with `chosen` naming the button. See [dashboard-sections.md](../dashboard-sections.md#let-hive-decide). | `pkg/dashboard/api.go:341`, `pkg/dashboard/api_repo_item_decide_delegated_plan.go` |
| `POST` | `/api/repos/{owner}/{repo}/items/{number}/decide-delegated/plan` | Same as `…/decide-delegated` | Preview for *Let hive decide*: runs the same owner-delegate policy with **no side effects** (nothing written, no job) and answers `{would, rule, acting, title, summary, why, consequences[], ladder, mergeable_as_is, alternatives[], writes: false, prior, notes}` β€” `summary` is one verb-first sentence with no "Hive would:" prefix (*Send #15332 back to its author with one instruction: make CI green, nothing else.*), `why` one short line (*CI is red.*), `consequences` at most two items, `ladder` the rung that decided with its `ruled_out` list, and `mergeable_as_is` whether an as-is merge is honest (the merge-now alternative is dropped when it is not). The dialog shows **Cancel** / **Let hive do that**, plus **Approve & merge as-is** only when `mergeable_as_is`; only then does the SPA post `…/decide-delegated` with `chosen` naming the button. See [dashboard-sections.md](../dashboard-sections.md#let-hive-decide). | `pkg/dashboard/api.go:341`, `pkg/dashboard/api_repo_item_decide_delegated_plan.go` |
| `POST` | `/api/repos/{owner}/{repo}/items/{number}/blocker/recheck` | Same as `…/hold` (owner or repo write), signed-in GitHub user | *Re-check permissions* on an issue parked on a capability blocker (#15099): probes the GitHub App installation's permissions; when the missing permission is granted, clears every ledger entry blocked on it and un-parks the item (`{result: {outcome: "released", …}}`), otherwise `{result: {outcome: "no-effect", reason: "blocker", options: [...]}}`; 404 when the item has no blocker, 409 when the blocker is not a capability gap | `pkg/dashboard/api.go:342` |
| `POST` | `/api/repos/{owner}/{repo}/items/{number}/blocker/close-partial` | Same as `…/hold` (owner or repo write), signed-in GitHub user | Option (c) on a capability blocker (#15099): labels the issue `hive/partially-addressed`, posts the operator's `{"comment"}` naming what remains and closes it; the ledger entry is cleared | `pkg/dashboard/api.go:343` |
| `POST` | `/api/repos/{owner}/{repo}/items/{number}/accept-triage` | Owner or repo write/maintain/admin | Accept triage on an issue from the activity monitor's row menu β€” what a maintainer accepting triage on GitHub does by hand: adds the reporter-trust triage label (`triage/accepted`, or the first of `issue_filter.reporter_trust.untrusted_require_labels`; the label is created in the repo if missing) and removes the awaiting label (`needs-triage` / `reporter_trust.awaiting_label`) and a Hive-written `stage/015-triage-needed`. Empty body. Returns `{ok, repo, number, acceptLabel, added, removed, alreadyAccepted, minStatusSeq}`; an issue already carrying the accept label with nothing left to remove is a no-op (`alreadyAccepted: true`, no write, no audit). 404 for a pull request or an unknown item. The status snapshot's labels are patched so the next reconcile reads 010 Actionable before the engine's own 015 β†’ 010 derivation. Every write is audited as `repo_item_accept_triage` under the dashboard user. | `pkg/dashboard/api.go:535`, `pkg/dashboard/api_repo_item_accept_triage.go` |
Expand Down
9 changes: 8 additions & 1 deletion src/docs/dashboard-sections.md
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,14 @@ At the same time the hive posts one follow-up comment on the item β€” *Hive deci

The toast and the decision trail lead with the outcome in one line β€” *Adopted β€” hive will rebase & merge it next pass (~4m)*; *Adopted: hive opened #15123 with the same commits and will merge it; #15029 will be closed as superseded* β€” details second, nothing repeated.

**Preview before acting.** *Let hive decide* no longer acts on the click. It first calls `POST …/decide-delegated/plan` , a dry run with no side effects that answers `{would, summary, consequences[], alternatives[]}`, and shows a confirm popover: *Hive would: re-author #15029 as a hive PR with the same commits and merge it; #15029 will be closed as superseded. Why: author @Karibhou is untrusted and their clanker is offline.* Buttons: **Let hive do that** Β· **Approve & merge as-is** (when the operator has merge rights β€” the in-tracker maintainer merge when the row exposes it, else an `approve` decision) Β· **Cancel**. Nothing is written until the operator picks, and the badge tooltip and the trail record which button was pressed (the request's `chosen`).
**Preview before acting.** *Let hive decide* no longer acts on the click. It first calls `POST …/decide-delegated/plan` , a dry run with no side effects that answers `{would, title, summary, why, consequences[], ladder, mergeable_as_is, alternatives[]}`, and shows one decision β€” built to be read in three seconds (operator feedback on hive's own spoke: the first version was "a wall of text" with a doubled *Hive would: Hive would:*, the PR named twice, three type sizes and a merge button on a head it had just called not mergeable):

- **Title** *Let hive decide*, then one subject line β€” `hivecommons/hive#15332 Β· ci: run crux's Go file-size ratchet…` β€” with a compact **⚠ Sentinel** chip when the sentinel flagged the head (the full finding is in Details).
- **Eyebrow** *Hive would* β†’ **one verb-first sentence**: *Send #15332 back to its author with one instruction: make CI green, nothing else.* β†’ one muted **Why** line (≀ 12 words: *CI is red.*) β†’ **Then**, at most two short items (*Hive posts that instruction on #15332. Β· The author pushes a fix; the row updates when it lands.*).
- **Details** (collapsed): the sentinel finding, *Why not the others* β€” the ladder rungs ruled out above the one that decided (`ladder.ruled_out`) β€” and the one-line rails (*never merges, never touches held items, never grants secrets; the sentinel label stays with a person*).
- **Buttons**, right-aligned: **Cancel** Β· **Let hive do that**. **Approve & merge as-is** appears only when the plan says `mergeable_as_is` β€” the ladder's *mergeable-as-is* rung, or (no ladder) a green, conflict-free, signed-off head β€” and is greyed with the reason when the operator lacks merge rights; the plan drops the merge-now alternative otherwise, so the dialog cannot contradict itself.

The same renderer serves issue decisions and every PR verdict (adopt, approve, close as duplicate/superseded, send back, recommend only). The visible text never uses hive's vocabulary (*park*, *audit marker*, *stage*, *ladder*, */hive decision*) and is ≀ 60 words for the #15332 case, which the node harness enforces. Nothing is written until the operator picks, and the badge tooltip and the trail record which button was pressed (the request's `chosen`).

**Adoption pairs.** When the delegate adopts in supersede mode and hive opens its copy, the tracker shows the pair explicitly rather than two unrelated PR sub-rows: the original is dimmed β€” *Adopted β†’ #15123 Β· superseded (hive re-authored with sign-off)* β€” with no action chevron and no needs-human styling; the new PR carries the single active chevron and a chip *↳ adopted from #15029 Β· you approved 17:51*; the issue row's pill follows the new PR. Once the original is closed it drops out of the open-PR projection, so it renders as one dimmed line from the adoption record β€” *#15029 <cached title> Β· closed Β· superseded by #15123* β€” with no chevron track; never a blank numbered row.

Expand Down
Loading
Loading