diff --git a/changelog.d/added-decide-issue-judgment.md b/changelog.d/added-decide-issue-judgment.md
new file mode 100644
index 0000000000..294e54feba
--- /dev/null
+++ b/changelog.d/added-decide-issue-judgment.md
@@ -0,0 +1 @@
+- "Let hive decide" on a parked issue now judges the way the owner would: a fleet self-report whose remedy is the spoke operator's (expired provider login, credentials, disk, network, App setup) gets one direction comment to the spoke owner — no `approved-direction`, no implementer, the park kept, and never the same direction twice; a hive-filed proposal is approved when it cites an incident or a fixed-one-at-a-time recurrence and declined for now (closed as not planned) when it cites neither; a hive-policy item's recommendation is a real sentence instead of "no special rule applies".
diff --git a/src/docs/dashboard-sections.md b/src/docs/dashboard-sections.md
index 90e0ba6efa..c21e4d6f70 100644
--- a/src/docs/dashboard-sections.md
+++ b/src/docs/dashboard-sections.md
@@ -1273,7 +1273,16 @@ The rules live in one place — `src/pkg/delegatedecision/policy.go` (`PolicyTex
**Issues:** dedupe aggressively (`Duplicate of #N`, cross-link overlaps); secrets / PAT / org-permission items are owner-only — `needs-owner` + `hold` with one comment stating the exact owner action, and no more failure issues for that root cause; flaky tests are quarantined with a retry and a deflake task rather than blocking; CI hygiene gate proposals (actionlint, duplication ratchets, link-checker allowlists) are approved as ratchets (baseline; fail only on increases; warning-only briefly, then enforce); design proposals with concrete acceptance criteria are accepted as proposed with explicit defaults; a "review backlog" item is never auto-closed when its PR closes unmerged (drop the relation, comment, re-triage).
-Each decision names the rule that fired (`dedupe`, `owner-only`, `flaky-test`, `ci-ratchet`, `design-proposal`, `review-backlog`, `default-approve`, `prefer-contributor`, `contributor-offline`, `sentinel-trusted`, `small-low-risk`, `reporter-trust`, `fix-then-merge`, `default-release`, `hive-policy`, `sentinel-untrusted`, `rail-hold`) in the comment and in the job's `decision.rule`.
+**Issues, judged the way the owner would** (the five parked issues he decided by hand; rules evaluated before `default-approve`, which stays the last fallback):
+
+| shape | rule | what the hive does |
+| --- | --- | --- |
+| a fleet self-report (`` marker or `[selfreport]` title) whose class is an operator's to fix — `agent_login_required`, `inference_auth_failed`, `data_disk_pressure`, the GitHub App token / installation / coverage classes, proxy dial / TLS, `crux_runtime_unavailable`, model discovery, label provisioning, shared-CI rerun permission | `selfreport-operator-action` (verdict `operator-action`) | Not code work. One comment telling the owner(s) named in the report's table exactly what to do on *that* spoke ("@owner: re-authenticate the agent provider … on spoke-x"), `needs-owner` added, **no** `approved-direction`, no implementer, the `stage/045-needs-decision` park kept so the actionable set never sees it. It clears when the report stops recurring (or `/fixed`). Clicking *Let hive decide* again never re-posts the direction: the answer is *already decided at that time; waiting on the spoke owner: @owner …* (the #15021 loop). Code-defect classes (panics, repeated unclassified errors, stalls) stay on the implementer path. |
+| a hive-filed proposal (`[quality]` / `[scanner]` / `[architect]` / `[strategist]` / `[outreach]` prefix, "Gate proposal", "RFC", or a `kind/design` / `kind/proposal` label) **with evidence** — an `incident #N`, breakage words (broke, regression, outage, uncompilable, blast radius), or a recurrence whose prior instances were each fixed one at a time ("fixed in #415", "Fixing PRs: #415, #417") | `proposal-approve-evidence` (verdict `approve`) | Approved as proposed; the rationale names the evidence ("it cites incident #15322", "the same class was already fixed one at a time in #415, #417"). |
+| a hive-filed proposal **without** such evidence | `proposal-not-now` (verdict `not-now`) | Declined for now: a comment saying "no incident or recurrence justifies the cost yet; re-propose with evidence", then closed as not planned (the established declined-proposal path). Never applied to a person's proposal (those keep `default-approve`), never to the hive's own policy (`hive-policy` stays recommend-only). |
+| a change to the hive's own policy (for example an RFC to hold unacknowledged hive-filed proposals) | `hive-policy` (recommend-only) | Unchanged in shape, but the recommendation is a real sentence in the owner's terms — "approve `
` as proposed — proposals nobody has acknowledged should not be actionable; make it default-on for the lanes it names rather than opt-in; owner to confirm" — never "no special rule applies". |
+
+Each decision names the rule that fired (`dedupe`, `owner-only`, `flaky-test`, `ci-ratchet`, `design-proposal`, `review-backlog`, `selfreport-operator-action`, `proposal-approve-evidence`, `proposal-not-now`, `default-approve`, `prefer-contributor`, `contributor-offline`, `sentinel-trusted`, `small-low-risk`, `reporter-trust`, `fix-then-merge`, `default-release`, `hive-policy`, `sentinel-untrusted`, `rail-hold`) in the comment and in the job's `decision.rule`.
**Safety rails** (`ApplyRails`, applied after the policy and before anything is written): the delegate never merges a PR — it only records the approval the auto-merge engine already acts on per repository settings (a merger/owner requester's approval is written as the queue line the sweep parses; anyone else's as `/lgtm` + `/approve` comments attributed to them); it does not touch an item wearing `hold` (refused, nothing written — release the hold first if you want it decided); it never grants org membership, secrets or permissions (those items get `needs-owner` + `hold` and the one owner-action comment, and keep their park); and a question that is a policy or scope change to the hive itself (settings, governance docs, security posture — the `governance` label or those words in the park reason) is left parked: the delegate posts "hive recommends: …; owner to confirm" and keeps 085.
diff --git a/src/docs/labels-and-control-signals.md b/src/docs/labels-and-control-signals.md
index 5b7572d840..c1226ac27a 100644
--- a/src/docs/labels-and-control-signals.md
+++ b/src/docs/labels-and-control-signals.md
@@ -2360,6 +2360,9 @@ The plain-words comment the delegate posts has four lines — **Hive decided** (
| `ci-ratchet` | a CI hygiene gate, landed as a ratchet | A new CI hygiene gate lands as a ratchet: it records today's baseline and fails only on increases, so existing work is never blocked. |
| `contributor-offline` | the author hasn't been reachable since the nudge | The PR's author (or their clanker or hive) has been offline since the hive nudged them, so the hive takes the work over instead of waiting. The decision itself names which: the author's clanker, a connected hive, or the author. |
| `dedupe` | an older issue already tracks this | An older issue already tracks the same work; one thread keeps it moving. |
+| `proposal-approve-evidence` | a proposal backed by an incident or a repeated class; approved | The hive-filed proposal names an incident it would have prevented, or prior instances of the same class fixed one at a time, so its cost is justified and it is approved as proposed. |
+| `proposal-not-now` | a hive-filed proposal with no incident or recurrence behind it; declined for now | The proposal shows neither an incident it would have prevented nor a repeated class it would end, so its value is speculative. The hive declines it for now and closes it as not planned; re-propose with evidence. |
+| `selfreport-operator-action` | a spoke self-report only its operator can fix; not code work | The issue is a fleet self-report (expired login, credentials, disk, network, App setup) whose remedy is on the reporting spoke. The hive tells that spoke's owner what to do and keeps it out of the actionable set; no agent is sent to code. |
| `default-approve` | no special rule applies; the hive took its own recommendation | No owner rule singles this issue out, so the hive went with its own recommendation — the reversible choice that keeps work moving. |
| `default-release` | no special rule applies; a green branch is approved | No owner rule holds this PR back; its branch is green and a merge is reversible, so it is approved. |
| `design-proposal` | a proposal with clear acceptance criteria, accepted as written | The proposal states concrete acceptance criteria, so it is accepted as written; anything not stated keeps today's behaviour. |
@@ -2395,6 +2398,8 @@ The plain-words comment the delegate posts has four lines — **Hive decided** (
| `labels-add` | added labels | The hive added labels to the item. |
| `labels-remove` | removed labels | The hive removed labels from the item. |
| `link` | cross-linked a related item | The hive left a comment linking a related issue or PR. |
+| `not-now`, `close-not-now` | declined for now; closed as not planned | The hive declined the proposal for now and closed it as not planned, with the reason and what evidence would reopen it. |
+| `operator-action` | told the spoke owner what to do; nothing for an agent here | The hive named the spoke owner and the one action they take (for example re-authenticate the provider). The item stays parked, gets no approved-direction, and clears when the report stops recurring. |
| `quarantine-flaky` | quarantined the flaky test | The flaky test is quarantined with a retry and a deflake task is filed. |
| `recommend-only`, `recommended` | recommended only; a person confirms | The hive only recommended; the item stays parked until a person confirms. |
| `refused` | did not decide | The hive did not decide this item; its safety rails stopped it (for example, the item is on hold). |
diff --git a/src/pkg/dashboard/api_repo_item_decide_delegated.go b/src/pkg/dashboard/api_repo_item_decide_delegated.go
index 535e9389b9..5a8728fe45 100644
--- a/src/pkg/dashboard/api_repo_item_decide_delegated.go
+++ b/src/pkg/dashboard/api_repo_item_decide_delegated.go
@@ -536,7 +536,11 @@ func (s *Server) decideDelegatedOne(ctx context.Context, repoFull string, number
// approve at 20:41Z lifted 045; the scanner re-parked at 01:16Z
// with its own question; the dedup then called the fresh park
// "decided, but it hasn't taken effect" for hours).
- if repark, ok := s.delegatedReparkedAfter(ctx, repoFull, number, prior.At); ok {
+ // A decision that kept the park never lifted the label, so a label
+ // event after it is not a new ask: re-deciding an operator-action
+ // self-report must not post the same direction again (the #15021
+ // loop); it answers "already decided; waiting on ".
+ if repark, ok := s.delegatedReparkedAfter(ctx, repoFull, number, prior.At); ok && !d.KeepsPark {
deciderNotes = append(deciderNotes, "parked again at "+repark.At.UTC().Truncate(time.Second).Format(time.RFC3339)+" ("+repark.Label+") after the decision recorded at "+prior.At.UTC().Truncate(time.Second).Format(time.RFC3339)+": a new ask, deciding anew")
prior = delegatedPriorState{}
}
@@ -815,23 +819,40 @@ func (s *Server) executeDelegatedDecision(ctx context.Context, in delegatedecisi
}
}
notes = append(notes, "labels removed: "+strings.Join(a.Labels, ", "))
- case delegatedecision.ActionCloseDuplicate:
+ case delegatedecision.ActionCloseDuplicate, delegatedecision.ActionCloseNotNow:
+ // Both share one comment-then-close path so the writeback
+ // ratchet (pkg/writeback/testdata) sees no new write sites.
+ notNow := a.Kind == delegatedecision.ActionCloseNotNow
body := fmt.Sprintf("%s\n\nRationale: %s.\n\n_Closed by the hive as the owner's delegate (rule `%s`)._\n%s", a.Text, d.Rationale, d.Rule, marker)
+ reason := "closed as duplicate of #" + strconv.Itoa(a.Target) + " by the hive delegate"
+ what := "duplicate"
+ if notNow {
+ if in.Kind != delegatedecision.KindIssue {
+ return notes, fmt.Errorf("not-now closes issues only")
+ }
+ body = comment
+ reason = "declined for now by the hive delegate: no incident or recurrence justifies the cost yet"
+ what = "not-now"
+ }
if err := client.CreateIssueComment(ctx, repoFull, number, body); err != nil {
- return notes, fmt.Errorf("posting duplicate note: %w", err)
+ return notes, fmt.Errorf("posting %s note: %w", what, err)
}
if in.Kind == delegatedecision.KindPR {
if err := client.CloseSupersededPR(ctx, repoFull, number); err != nil {
return notes, fmt.Errorf("closing superseded PR: %w", err)
}
} else if err := client.CloseIssue(ctx, repoFull, number, ghpkg.IssueCloseOptions{
- OverrideReason: "closed as duplicate of #" + strconv.Itoa(a.Target) + " by the hive delegate",
+ OverrideReason: reason,
SuppressOverrideComment: true,
StateReason: issueStateReasonNotPlanned,
}); err != nil {
- return notes, fmt.Errorf("closing duplicate: %w", err)
+ return notes, fmt.Errorf("closing %s: %w", what, err)
+ }
+ if notNow {
+ notes = append(notes, "closed as not planned (declined for now)")
+ } else {
+ notes = append(notes, fmt.Sprintf("closed in favour of #%d", a.Target))
}
- notes = append(notes, fmt.Sprintf("closed in favour of #%d", a.Target))
case delegatedecision.ActionLink:
body := fmt.Sprintf("Cross-link: %s (#%d).\n%s", a.Text, a.Target, marker)
if err := client.CreateIssueComment(ctx, repoFull, number, body); err != nil {
@@ -876,7 +897,15 @@ func (s *Server) executeDelegatedDecision(ctx context.Context, in delegatedecisi
if err := client.CreateIssueComment(ctx, repoFull, number, comment); err != nil {
return notes, fmt.Errorf("posting recommendation: %w", err)
}
- notes = append(notes, "recommendation posted; `"+delegatedecision.LabelNeedsDecision+"` kept for the owner")
+ park := delegatedecision.LabelNeedsDecision
+ if in.Kind == delegatedecision.KindIssue {
+ park = delegatedecision.LabelIssueNeedsDecision
+ }
+ if d.Verdict == delegatedecision.VerdictOperatorAction {
+ notes = append(notes, "operator direction posted; `"+park+"` kept, no approved-direction, no implementer")
+ } else {
+ notes = append(notes, "recommendation posted; `"+park+"` kept for the owner")
+ }
}
}
if lifted := s.liftDelegatedParkLabels(ctx, in, d); len(lifted) > 0 {
@@ -901,7 +930,8 @@ func delegatedDecisionResolves(v delegatedecision.Verdict) bool {
switch v {
case delegatedecision.VerdictApprove, delegatedecision.VerdictDirection, delegatedecision.VerdictAdoptSupersede,
delegatedecision.VerdictCloseDuplicate, delegatedecision.VerdictCloseSuperseded,
- delegatedecision.VerdictQuarantineFlaky, delegatedecision.VerdictAcceptRatchet, delegatedecision.VerdictAcceptProposal:
+ delegatedecision.VerdictQuarantineFlaky, delegatedecision.VerdictAcceptRatchet, delegatedecision.VerdictAcceptProposal,
+ delegatedecision.VerdictNotNow:
return true
}
return false
diff --git a/src/pkg/dashboard/api_repo_item_decide_delegated_plan.go b/src/pkg/dashboard/api_repo_item_decide_delegated_plan.go
index 4531a732b1..b2c0e25c9d 100644
--- a/src/pkg/dashboard/api_repo_item_decide_delegated_plan.go
+++ b/src/pkg/dashboard/api_repo_item_decide_delegated_plan.go
@@ -204,6 +204,12 @@ func delegatedPlanWording(in delegatedecision.Input, d delegatedecision.Decision
return "Do nothing: " + delegatedPlanPlain(d.Rationale) + ".", []string{"Nothing changes; " + ref + " stays waiting for you."}
case d.Verdict == delegatedecision.VerdictOwnerOnly:
return "Leave this to the owner.", []string{"Hive labels " + ref + " needs-owner and holds it.", "Only the owner can grant this."}
+ case d.Verdict == delegatedecision.VerdictOperatorAction:
+ return "Tell the spoke owner what to do: " + delegatedPlanPlain(strings.TrimPrefix(strings.TrimSpace(d.Text), "operator action — ")) + ".",
+ []string{"Hive posts that to the spoke owner and labels " + ref + " needs-owner; no agent is sent.", ref + " stays where it is and clears once the report stops recurring."}
+ case d.Verdict == delegatedecision.VerdictNotNow:
+ return "Decline " + ref + " for now and close it as not planned.",
+ []string{"Hive posts why: no incident or recurrence justifies the cost yet.", ref + " is closed as not planned; re-propose it with evidence."}
default:
text := delegatedPlanPlain(d.Text)
if text == "" {
diff --git a/src/pkg/dashboard/api_repo_item_decide_delegated_plan_test.go b/src/pkg/dashboard/api_repo_item_decide_delegated_plan_test.go
index 625f323cb9..6d9abc6505 100644
--- a/src/pkg/dashboard/api_repo_item_decide_delegated_plan_test.go
+++ b/src/pkg/dashboard/api_repo_item_decide_delegated_plan_test.go
@@ -158,7 +158,7 @@ func TestDelegatedPlanWordingDirectionIsOneSentence(t *testing.T) {
t.Fatalf("summary %q", s)
}
// Every verdict's then-list fits the two-item budget.
- for _, v := range []delegatedecision.Verdict{delegatedecision.VerdictAdoptSupersede, delegatedecision.VerdictApprove, delegatedecision.VerdictCloseSuperseded, delegatedecision.VerdictRefused, delegatedecision.VerdictOwnerOnly, delegatedecision.VerdictRecommendOnly} {
+ for _, v := range []delegatedecision.Verdict{delegatedecision.VerdictAdoptSupersede, delegatedecision.VerdictApprove, delegatedecision.VerdictCloseSuperseded, delegatedecision.VerdictRefused, delegatedecision.VerdictOwnerOnly, delegatedecision.VerdictRecommendOnly, delegatedecision.VerdictOperatorAction, delegatedecision.VerdictNotNow} {
s, n := delegatedPlanWording(in, delegatedecision.Decision{Verdict: v, Rationale: "because (hivecommons/hive#1); and more", Text: "do the thing (hivecommons/hive#2)"})
if len(n) > 2 || strings.Contains(s, "Hive would") || strings.Contains(s, "#1)") || strings.Contains(s, "#2)") {
t.Errorf("%s: summary %q then %v", v, s, n)
diff --git a/src/pkg/dashboard/api_repo_item_decide_delegated_test.go b/src/pkg/dashboard/api_repo_item_decide_delegated_test.go
index 1509c951fe..011375fa2a 100644
--- a/src/pkg/dashboard/api_repo_item_decide_delegated_test.go
+++ b/src/pkg/dashboard/api_repo_item_decide_delegated_test.go
@@ -1003,3 +1003,112 @@ func TestDelegatedOfflineClankerAdoptsWithClankerWording(t *testing.T) {
t.Fatalf("wording: rationale=%q result=%+v", d.Rationale, job.Result)
}
}
+
+// Owner-style judgment of parked issues (hivecommons/hive#15021 and the
+// proposal rules): the fixture bodies are the real issues, trimmed.
+const delegatedSelfreportBody = "\n\n" +
+ "A hive hit an unusual runtime error (class `agent_login_required`) and is reporting it.\n\n" +
+ "| Field | Value |\n|---|---|\n| hive | hosted-ibm-alchemy-logg-ptoo |\n" +
+ "| spoke | [hosted-ibm-alchemy-logg-ptoo](https://hosted-ibm-alchemy-logg-ptoo.example) |\n| owner(s) | @clubanderson |\n"
+
+const delegatedEvidenceFreeProposalBody = "## Finding\n\nThis is now the third time a freshly-landed shell-checker change shipped with arms no self-test pins (#248, #257, #295).\n\n## Recommendation\n\nAdd a mutation gate for the shell checkers.\n"
+
+// A selfreport whose remedy is the spoke operator's: the hive posts the
+// direction to the spoke owner, adds needs-owner, and writes nothing that
+// would make the issue actionable — no `/hive decision` line, no
+// approved-direction, the 045 park kept.
+func TestDelegatedSelfreportOperatorAction(t *testing.T) {
+ mock := &repoItemDecisionMock{issueLabels: []string{"triage/accepted", "stage/045-needs-decision"},
+ issueTitle: "[selfreport] agent_login_required: login required detected", issueBody: delegatedSelfreportBody}
+ srv := newDelegatedServer(t, mock)
+ w := postDelegated(t, srv, 7, "writer", `{"type":"issue","reason":"requires_human"}`, nil)
+ if w.Code != http.StatusOK {
+ t.Fatalf("code=%d body=%s", w.Code, w.Body.String())
+ }
+ job := decodeDelegatedJob(t, w)
+ if job.Decision == nil || job.Decision.Verdict != delegatedecision.VerdictOperatorAction || job.Decision.Rule != "selfreport-operator-action" {
+ t.Fatalf("decision = %+v (error %q)", job.Decision, job.Error)
+ }
+ if len(mock.comments) != 1 || strings.Contains(mock.comments[0], "/hive decision") || !strings.Contains(mock.comments[0], "@clubanderson: re-authenticate the agent provider") || !strings.Contains(mock.comments[0], "`stage/045-needs-decision` stays") {
+ t.Fatalf("comments = %q", mock.comments)
+ }
+ added := strings.Join(mock.added, ",")
+ if !strings.Contains(added, delegatedecision.LabelNeedsOwner) || strings.Contains(added, github.HumanAckLabel) || strings.Contains(added, delegatedecision.LabelHold) {
+ t.Fatalf("labels added = %v: needs-owner only, never approved-direction or hold", mock.added)
+ }
+ if len(mock.removed) != 0 || len(mock.edits) != 0 {
+ t.Fatalf("park must stay and nothing edited: removed=%v edits=%v", mock.removed, mock.edits)
+ }
+ if job.Result == nil || job.Result.Action != rowActionRecommended || !strings.Contains(job.Result.Outcome, "Operator action") || !strings.Contains(job.Result.Next, "waiting on the spoke owner") {
+ t.Fatalf("result = %+v", job.Result)
+ }
+}
+
+// The #15021 loop: the same selfreport decided again, still parked, with a
+// label event after the first decision (the park was never lifted, so it is
+// not a new ask). The hive writes nothing and answers "already decided;
+// waiting on " — never "it hasn't taken effect".
+func TestDelegatedSelfreportRedecideIsNoopNotLoop(t *testing.T) {
+ pinDelegatedClock(t, "2026-10-28T20:00:00Z")
+ mock := &repoItemDecisionMock{issueLabels: []string{"needs-owner", "stage/045-needs-decision"},
+ issueTitle: "[selfreport] agent_login_required: login required detected", issueBody: delegatedSelfreportBody}
+ in := delegatedecision.Input{Kind: delegatedecision.KindIssue, Number: 7, Title: mock.issueTitle, Body: mock.issueBody, Author: "hive[bot]"}
+ prior := delegatedecision.Run(in)
+ mock.priorComments = []string{delegatedecision.CommentBodyWith(prior, "h1", "writer", delegatedecision.CommentOptions{Kind: delegatedecision.KindIssue})}
+ mock.timeline = []map[string]any{
+ {"event": "labeled", "label": map[string]any{"name": "stage/045-needs-decision"}, "created_at": "2026-10-28T13:16:00Z"},
+ }
+ srv := newDelegatedServer(t, mock)
+ w := postDelegated(t, srv, 7, "writer", `{"type":"issue","reason":"requires_human"}`, nil)
+ if w.Code != http.StatusOK {
+ t.Fatalf("code=%d body=%s", w.Code, w.Body.String())
+ }
+ job := decodeDelegatedJob(t, w)
+ if job.Result == nil || job.Result.Action != rowActionNoop {
+ t.Fatalf("result = %+v", job.Result)
+ }
+ if !strings.HasPrefix(job.Result.Outcome, "No change — hive already recorded this decision at 2026-10-28T12:01:00Z") || strings.Contains(job.Result.Outcome, "hasn't taken effect") {
+ t.Fatalf("outcome = %q", job.Result.Outcome)
+ }
+ if !strings.Contains(job.Result.Next, "Waiting on the spoke owner: @clubanderson") {
+ t.Fatalf("next = %q", job.Result.Next)
+ }
+ if len(mock.comments) != 0 || len(mock.added) != 0 || len(mock.removed) != 0 {
+ t.Fatalf("a repeat must write nothing: comments=%v added=%v removed=%v", mock.comments, mock.added, mock.removed)
+ }
+}
+
+// A hive-filed proposal without an incident or recurrence is declined for
+// now: the reason is posted and the issue is closed as not planned; no
+// approval, no approved-direction.
+func TestDelegatedProposalNotNowClosesAsNotPlanned(t *testing.T) {
+ mock := &repoItemDecisionMock{issueLabels: []string{"testing", "stage/045-needs-decision"},
+ issueTitle: "[quality] Gate proposal: shell-checker arms that survive mutation", issueBody: delegatedEvidenceFreeProposalBody}
+ srv := newDelegatedServer(t, mock)
+ w := postDelegated(t, srv, 7, "writer", `{"type":"issue","reason":"requires_human"}`, nil)
+ if w.Code != http.StatusOK {
+ t.Fatalf("code=%d body=%s", w.Code, w.Body.String())
+ }
+ job := decodeDelegatedJob(t, w)
+ if job.Decision == nil || job.Decision.Verdict != delegatedecision.VerdictNotNow || job.Decision.Rule != "proposal-not-now" {
+ t.Fatalf("decision = %+v (error %q)", job.Decision, job.Error)
+ }
+ if len(mock.comments) != 1 || strings.Contains(mock.comments[0], "/hive decision") || !strings.Contains(mock.comments[0], "no incident or recurrence justifies the cost") {
+ t.Fatalf("comments = %q", mock.comments)
+ }
+ closed := false
+ for _, e := range mock.edits {
+ if e["state"] == "closed" && e["state_reason"] == issueStateReasonNotPlanned {
+ closed = true
+ }
+ }
+ if !closed {
+ t.Fatalf("issue not closed as not planned: edits=%v", mock.edits)
+ }
+ if strings.Contains(strings.Join(mock.added, ","), github.HumanAckLabel) {
+ t.Fatalf("a declined proposal must not get approved-direction: %v", mock.added)
+ }
+ if job.Result == nil || job.Result.Action != rowActionClosed || !strings.Contains(job.Result.Outcome, "Declined for now") {
+ t.Fatalf("result = %+v", job.Result)
+ }
+}
diff --git a/src/pkg/dashboard/api_repo_item_decision_test.go b/src/pkg/dashboard/api_repo_item_decision_test.go
index 75f3cab323..2460d686e3 100644
--- a/src/pkg/dashboard/api_repo_item_decision_test.go
+++ b/src/pkg/dashboard/api_repo_item_decision_test.go
@@ -61,6 +61,8 @@ type repoItemDecisionMock struct {
// already-fixed rung of hivecommons/hive#15289.
prBody string
fixedIssueClosedBy int
+ // issueTitle / issueBody shape issue #7 (empty = untitled, no body).
+ issueTitle, issueBody string
}
func newRepoItemDecisionServer(t *testing.T, m *repoItemDecisionMock) *Server {
@@ -82,7 +84,7 @@ func newRepoItemDecisionServer(t *testing.T, m *repoItemDecisionMock) *Server {
for _, label := range m.issueLabels {
labels = append(labels, map[string]string{"name": label})
}
- _ = json.NewEncoder(w).Encode(map[string]any{"number": 7, "state": "open", "labels": labels, "user": map[string]any{"login": "hive[bot]", "type": "Bot"}})
+ _ = json.NewEncoder(w).Encode(map[string]any{"number": 7, "state": "open", "title": m.issueTitle, "body": m.issueBody, "labels": labels, "user": map[string]any{"login": "hive[bot]", "type": "Bot"}})
case r.Method == http.MethodGet && (strings.HasSuffix(path, "/issues/8") || strings.HasSuffix(path, "/issues/9")):
n := 8
if strings.HasSuffix(path, "/issues/9") {
diff --git a/src/pkg/dashboard/row_action_result.go b/src/pkg/dashboard/row_action_result.go
index f3dfa4d9e8..e0e763894e 100644
--- a/src/pkg/dashboard/row_action_result.go
+++ b/src/pkg/dashboard/row_action_result.go
@@ -149,6 +149,14 @@ func delegatedRowActionResult(in delegatedecision.Input, d delegatedecision.Deci
if hasLadderOutcome {
out.Outcome += " " + ladderOutcome
}
+ case d.Verdict == delegatedecision.VerdictNotNow:
+ out.Action = rowActionClosed
+ out.Outcome = "Declined for now" + ruleTag + ": " + strings.TrimSuffix(strings.TrimSpace(d.Text), ".") + "."
+ out.Next = "Closed as not planned; re-propose it with the incident or recurrence it would prevent."
+ case d.Verdict == delegatedecision.VerdictOperatorAction:
+ out.Action = rowActionRecommended
+ out.Outcome = "Operator action" + ruleTag + ": " + strings.TrimPrefix(strings.TrimSuffix(strings.TrimSpace(d.Text), "."), "operator action — ") + "."
+ out.Next = "Stays at " + parkedAt + " — waiting on the spoke owner; no agent is sent. Closes itself once the report stops recurring."
case d.Verdict == delegatedecision.VerdictCloseDuplicate || d.Verdict == delegatedecision.VerdictCloseSuperseded:
out.Action = rowActionClosed
switch {
diff --git a/src/pkg/dashboard/stage_tracker_decided.go b/src/pkg/dashboard/stage_tracker_decided.go
index 3f2f666e74..716767784b 100644
--- a/src/pkg/dashboard/stage_tracker_decided.go
+++ b/src/pkg/dashboard/stage_tracker_decided.go
@@ -118,6 +118,7 @@ var decidedVerbs = map[string]decidedVerb{
string(delegatedecision.VerdictDirection): {Word: "Sent back", Text: "Sent back · waiting for a new commit", Acting: "Sending back…", Plain: "direction given", Stage: stagelabels.None},
string(delegatedecision.VerdictCloseDuplicate): {Word: "Closing", Text: "Closing · duplicate, leaves the tracker next refresh", Acting: "Closing…", Plain: "closed as duplicate", Stage: stagelabels.None},
string(delegatedecision.VerdictCloseSuperseded): {Word: "Closing", Text: "Closing · superseded, leaves the tracker next refresh", Acting: "Closing…", Plain: "closed as superseded", Stage: stagelabels.None},
+ string(delegatedecision.VerdictNotNow): {Word: "Closing", Text: "Closing · declined for now, leaves the tracker next refresh", Acting: "Closing…", Plain: "declined for now", Stage: stagelabels.None},
operatorActionQueueMerge: {Word: "Approved", Text: "Approved · hive merges on its next sweep", Acting: "Queuing for merge…", Plain: "approved — hive merges", Stage: stagelabels.AwaitingMergeAdmission},
operatorActionMergeNow: {Word: "Merging", Text: "Merging · as maintainer", Acting: "Merging…", Plain: "merged as maintainer", Stage: stagelabels.MergeQueue},
}
diff --git a/src/pkg/dashboard/static-src/js/tracker-filter.js b/src/pkg/dashboard/static-src/js/tracker-filter.js
index f02c3a4e63..2093a5808c 100644
--- a/src/pkg/dashboard/static-src/js/tracker-filter.js
+++ b/src/pkg/dashboard/static-src/js/tracker-filter.js
@@ -821,6 +821,7 @@
"ci-red": {"kind": "reason", "plain": "CI is failing on this branch", "detail": "Required checks are failing on this branch; nothing merges until they are green."},
"close-as-duplicate": {"kind": "action", "plain": "closed as a duplicate", "detail": "Closed because an older item already tracks the same work."},
"close-duplicate": {"kind": "action", "plain": "closed as a duplicate", "detail": "Closed because an older item already tracks the same work."},
+ "close-not-now": {"kind": "action", "plain": "declined for now; closed as not planned", "detail": "The hive declined the proposal for now and closed it as not planned, with the reason and what evidence would reopen it."},
"close-superseded": {"kind": "action", "plain": "closed because another PR carries the work", "detail": "Closed because another PR carries the same work; the author is credited there.", "issue_plain": "closed because another issue carries the work", "issue_detail": "Closed because another issue already tracks the same work; the discussion continues there."},
"closed": {"kind": "action", "plain": "closed because another PR carries the work", "detail": "Closed because another PR carries the same work; the author is credited there.", "issue_plain": "closed because another issue carries the work", "issue_detail": "Closed because another issue already tracks the same work; the discussion continues there."},
"comment-decision": {"kind": "action", "plain": "recorded the decision on GitHub", "detail": "The hive posted the decision as a `/hive decision` comment, the way a maintainer would."},
@@ -859,10 +860,14 @@
"no-new-commit": {"kind": "reason", "plain": "no new commit has been pushed", "detail": "The hive gave direction, but no new commit has been pushed yet."},
"not-closed-yet": {"kind": "reason", "plain": "the close didn't land", "detail": "The hive decided to close it, but it is still open; the close call did not land."},
"not-merged-yet": {"kind": "reason", "plain": "the merge gate hasn't merged it", "detail": "The hive approved it but the merge gate has not merged it; its lane reason says what still blocks it."},
+ "not-now": {"kind": "action", "plain": "declined for now; closed as not planned", "detail": "The hive declined the proposal for now and closed it as not planned, with the reason and what evidence would reopen it."},
+ "operator-action": {"kind": "action", "plain": "told the spoke owner what to do; nothing for an agent here", "detail": "The hive named the spoke owner and the one action they take (for example re-authenticate the provider). The item stays parked, gets no approved-direction, and clears when the report stops recurring."},
"owner-only": {"kind": "rule", "plain": "only the hive owner can do this", "detail": "This needs a secret, token or organization permission that only the hive owner holds; the hive cannot do it for you."},
"owner_only": {"kind": "rule", "plain": "only the hive owner can do this", "detail": "This needs a secret, token or organization permission that only the hive owner holds; the hive cannot do it for you."},
"park-label-stuck": {"kind": "reason", "plain": "stage/045-needs-decision is still on the issue; the scanner skips it until that label clears", "detail": "The hive approved the issue and applied approved-direction, but the stage/045-needs-decision park label was never removed, so the scanner still skips the issue. Lift the park (it removes the label through the hive's audited label path) or re-evaluate the issue so the stage engine re-reads it."},
"prefer-contributor": {"kind": "rule", "plain": "a contributor's PR and a hive PR do the same work", "detail": "A contributor's PR and a hive-authored PR cover the same work; the hive prefers the contributor's when it is mergeable and current."},
+ "proposal-approve-evidence": {"kind": "rule", "plain": "a proposal backed by an incident or a repeated class; approved", "detail": "The hive-filed proposal names an incident it would have prevented, or prior instances of the same class fixed one at a time, so its cost is justified and it is approved as proposed."},
+ "proposal-not-now": {"kind": "rule", "plain": "a hive-filed proposal with no incident or recurrence behind it; declined for now", "detail": "The proposal shows neither an incident it would have prevented nor a repeated class it would end, so its value is speculative. The hive declines it for now and closes it as not planned; re-propose with evidence."},
"quarantine-flaky": {"kind": "action", "plain": "quarantined the flaky test", "detail": "The flaky test is quarantined with a retry and a deflake task is filed."},
"rail-hold": {"kind": "rule", "plain": "the item is on hold", "detail": "The item carries the hold label; the hive never acts on a held item until a person releases the hold."},
"ready-for-human-merge": {"kind": "reason", "plain": "no merge lane vouches for this PR's author; a maintainer merges", "detail": "The PR is ready, but its author is not a collaborator and holds no trusted or merger tier, so no merge lane vouches for them and the hive never merges it unattended. A maintainer merges it (Approve \u0026 merge as maintainer, or Approve — let hive merge), or trusts the author under 👥 Contributors."},
@@ -879,6 +884,7 @@
"review-backlog": {"kind": "rule", "plain": "the PR closed without merging, so the issue stays open", "detail": "The fixing PR closed unmerged; the issue stays open and is re-triaged rather than auto-closed."},
"reviewer-verdict:request_changes": {"kind": "reason", "plain": "a reviewer asked for changes; a new commit is needed", "detail": "A reviewer asked for changes on this branch. Approving cannot override that: only a new commit, or a maintainer merging by hand, moves it."},
"self-decision-read-as-changes": {"kind": "reason", "plain": "hive's own decision comment was read as a reviewer asking for changes", "detail": "The merge gate read the hive's own `/hive decision` comment as a reviewer asking for changes, so the decision blocked the PR it meant to advance (hivecommons/hive#14822). A new commit or a maintainer merge clears it."},
+ "selfreport-operator-action": {"kind": "rule", "plain": "a spoke self-report only its operator can fix; not code work", "detail": "The issue is a fleet self-report (expired login, credentials, disk, network, App setup) whose remedy is on the reporting spoke. The hive tells that spoke's owner what to do and keeps it out of the actionable set; no agent is sent to code."},
"sentinel": {"kind": "reason", "plain": "security-sensitive files changed; a maintainer must approve", "detail": "Security-sensitive files changed. The hive never merges until a maintainer reviews and removes the sentinel label."},
"sentinel-alert": {"kind": "reason", "plain": "security-sensitive files changed; a maintainer must approve", "detail": "Security-sensitive files changed. The hive never merges until a maintainer reviews and removes the sentinel label."},
"sentinel-blocked": {"kind": "reason", "plain": "security-sensitive files changed; a maintainer must approve", "detail": "Security-sensitive files changed. The hive never merges until a maintainer reviews and removes the sentinel label."},
diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html
index 4242f1fbed..53f12aaf64 100644
--- a/src/pkg/dashboard/static/index.html
+++ b/src/pkg/dashboard/static/index.html
@@ -17762,6 +17762,7 @@ All labels
"ci-red": {"kind": "reason", "plain": "CI is failing on this branch", "detail": "Required checks are failing on this branch; nothing merges until they are green."},
"close-as-duplicate": {"kind": "action", "plain": "closed as a duplicate", "detail": "Closed because an older item already tracks the same work."},
"close-duplicate": {"kind": "action", "plain": "closed as a duplicate", "detail": "Closed because an older item already tracks the same work."},
+ "close-not-now": {"kind": "action", "plain": "declined for now; closed as not planned", "detail": "The hive declined the proposal for now and closed it as not planned, with the reason and what evidence would reopen it."},
"close-superseded": {"kind": "action", "plain": "closed because another PR carries the work", "detail": "Closed because another PR carries the same work; the author is credited there.", "issue_plain": "closed because another issue carries the work", "issue_detail": "Closed because another issue already tracks the same work; the discussion continues there."},
"closed": {"kind": "action", "plain": "closed because another PR carries the work", "detail": "Closed because another PR carries the same work; the author is credited there.", "issue_plain": "closed because another issue carries the work", "issue_detail": "Closed because another issue already tracks the same work; the discussion continues there."},
"comment-decision": {"kind": "action", "plain": "recorded the decision on GitHub", "detail": "The hive posted the decision as a `/hive decision` comment, the way a maintainer would."},
@@ -17800,10 +17801,14 @@ All labels
"no-new-commit": {"kind": "reason", "plain": "no new commit has been pushed", "detail": "The hive gave direction, but no new commit has been pushed yet."},
"not-closed-yet": {"kind": "reason", "plain": "the close didn't land", "detail": "The hive decided to close it, but it is still open; the close call did not land."},
"not-merged-yet": {"kind": "reason", "plain": "the merge gate hasn't merged it", "detail": "The hive approved it but the merge gate has not merged it; its lane reason says what still blocks it."},
+ "not-now": {"kind": "action", "plain": "declined for now; closed as not planned", "detail": "The hive declined the proposal for now and closed it as not planned, with the reason and what evidence would reopen it."},
+ "operator-action": {"kind": "action", "plain": "told the spoke owner what to do; nothing for an agent here", "detail": "The hive named the spoke owner and the one action they take (for example re-authenticate the provider). The item stays parked, gets no approved-direction, and clears when the report stops recurring."},
"owner-only": {"kind": "rule", "plain": "only the hive owner can do this", "detail": "This needs a secret, token or organization permission that only the hive owner holds; the hive cannot do it for you."},
"owner_only": {"kind": "rule", "plain": "only the hive owner can do this", "detail": "This needs a secret, token or organization permission that only the hive owner holds; the hive cannot do it for you."},
"park-label-stuck": {"kind": "reason", "plain": "stage/045-needs-decision is still on the issue; the scanner skips it until that label clears", "detail": "The hive approved the issue and applied approved-direction, but the stage/045-needs-decision park label was never removed, so the scanner still skips the issue. Lift the park (it removes the label through the hive's audited label path) or re-evaluate the issue so the stage engine re-reads it."},
"prefer-contributor": {"kind": "rule", "plain": "a contributor's PR and a hive PR do the same work", "detail": "A contributor's PR and a hive-authored PR cover the same work; the hive prefers the contributor's when it is mergeable and current."},
+ "proposal-approve-evidence": {"kind": "rule", "plain": "a proposal backed by an incident or a repeated class; approved", "detail": "The hive-filed proposal names an incident it would have prevented, or prior instances of the same class fixed one at a time, so its cost is justified and it is approved as proposed."},
+ "proposal-not-now": {"kind": "rule", "plain": "a hive-filed proposal with no incident or recurrence behind it; declined for now", "detail": "The proposal shows neither an incident it would have prevented nor a repeated class it would end, so its value is speculative. The hive declines it for now and closes it as not planned; re-propose with evidence."},
"quarantine-flaky": {"kind": "action", "plain": "quarantined the flaky test", "detail": "The flaky test is quarantined with a retry and a deflake task is filed."},
"rail-hold": {"kind": "rule", "plain": "the item is on hold", "detail": "The item carries the hold label; the hive never acts on a held item until a person releases the hold."},
"ready-for-human-merge": {"kind": "reason", "plain": "no merge lane vouches for this PR's author; a maintainer merges", "detail": "The PR is ready, but its author is not a collaborator and holds no trusted or merger tier, so no merge lane vouches for them and the hive never merges it unattended. A maintainer merges it (Approve \u0026 merge as maintainer, or Approve — let hive merge), or trusts the author under 👥 Contributors."},
@@ -17820,6 +17825,7 @@ All labels
"review-backlog": {"kind": "rule", "plain": "the PR closed without merging, so the issue stays open", "detail": "The fixing PR closed unmerged; the issue stays open and is re-triaged rather than auto-closed."},
"reviewer-verdict:request_changes": {"kind": "reason", "plain": "a reviewer asked for changes; a new commit is needed", "detail": "A reviewer asked for changes on this branch. Approving cannot override that: only a new commit, or a maintainer merging by hand, moves it."},
"self-decision-read-as-changes": {"kind": "reason", "plain": "hive's own decision comment was read as a reviewer asking for changes", "detail": "The merge gate read the hive's own `/hive decision` comment as a reviewer asking for changes, so the decision blocked the PR it meant to advance (hivecommons/hive#14822). A new commit or a maintainer merge clears it."},
+ "selfreport-operator-action": {"kind": "rule", "plain": "a spoke self-report only its operator can fix; not code work", "detail": "The issue is a fleet self-report (expired login, credentials, disk, network, App setup) whose remedy is on the reporting spoke. The hive tells that spoke's owner what to do and keeps it out of the actionable set; no agent is sent to code."},
"sentinel": {"kind": "reason", "plain": "security-sensitive files changed; a maintainer must approve", "detail": "Security-sensitive files changed. The hive never merges until a maintainer reviews and removes the sentinel label."},
"sentinel-alert": {"kind": "reason", "plain": "security-sensitive files changed; a maintainer must approve", "detail": "Security-sensitive files changed. The hive never merges until a maintainer reviews and removes the sentinel label."},
"sentinel-blocked": {"kind": "reason", "plain": "security-sensitive files changed; a maintainer must approve", "detail": "Security-sensitive files changed. The hive never merges until a maintainer reviews and removes the sentinel label."},
diff --git a/src/pkg/delegatedecision/decision_comment.go b/src/pkg/delegatedecision/decision_comment.go
index e4bc37339c..080694c079 100644
--- a/src/pkg/delegatedecision/decision_comment.go
+++ b/src/pkg/delegatedecision/decision_comment.go
@@ -38,8 +38,15 @@ type Effect struct {
// ExpectedEffect says what d should cause on an item of kind.
func ExpectedEffect(d Decision, kind Kind) Effect {
switch {
+ case d.Verdict == VerdictOperatorAction:
+ // Nothing the hive does moves this; the dedup answer reads "already
+ // decided ; waiting on " from this line.
+ return Effect{IfNot: "Waiting on the spoke owner: " + strings.TrimPrefix(strings.TrimSuffix(strings.TrimSpace(d.Text), "."), operatorActionPrefix) + ". The report clears itself once it stops recurring; `/fixed` closes it by hand."}
case d.Verdict == VerdictRefused, d.Verdict == VerdictOwnerOnly, d.Verdict == VerdictRecommendOnly, d.KeepsPark:
return Effect{IfNot: "The item stays parked until a person decides it: approve it, give direction, or close it from the Activity Monitor."}
+ case d.Verdict == VerdictNotNow:
+ return Effect{Waits: true, What: "this issue is closed as not planned; re-propose it with the incident or recurrence it would prevent",
+ IfNot: "Close it by hand on GitHub, or approve it yourself if you want it built anyway."}
case d.Verdict == VerdictAdoptSupersede:
return Effect{Waits: true,
What: "the hive closes this PR and opens a fresh hive-authored PR with the same commits and sign-off, then finishes that one",
@@ -70,7 +77,8 @@ func ActionPlain(d Decision) string {
func ActionPlainOn(d Decision, kind Kind) string {
switch d.Verdict {
case VerdictApprove, VerdictQuarantineFlaky, VerdictAcceptRatchet, VerdictAcceptProposal, VerdictDirection,
- VerdictCloseDuplicate, VerdictCloseSuperseded, VerdictOwnerOnly, VerdictRecommendOnly, VerdictRefused:
+ VerdictCloseDuplicate, VerdictCloseSuperseded, VerdictOwnerOnly, VerdictRecommendOnly, VerdictRefused,
+ VerdictOperatorAction, VerdictNotNow:
return VerdictPlainOn(d.Verdict, kind)
case VerdictAdoptSupersede:
return PlainOn(GlossarySupersede, kind)
@@ -113,8 +121,16 @@ func CommentBodyWith(d Decision, hiveID, requester string, opts CommentOptions)
switch {
case d.Verdict == VerdictRefused:
fmt.Fprintf(&b, "Hive (owner-delegate) did not decide this item: %s.", d.Rationale)
+ case d.Verdict == VerdictNotNow:
+ // Not a `/hive decision` line: the unpark sweep must not read a
+ // declined proposal as an approval.
+ fmt.Fprintf(&b, "%s\n\nRationale: %s. Closed as not planned.", CapitalizeFirst(d.Text), d.Rationale)
case d.KeepsPark:
- fmt.Fprintf(&b, "%s\n\nRationale: %s. `%s` stays.", d.Text, d.Rationale, LabelNeedsDecision)
+ park := LabelNeedsDecision
+ if opts.Kind == KindIssue {
+ park = LabelIssueNeedsDecision
+ }
+ fmt.Fprintf(&b, "%s\n\nRationale: %s. `%s` stays.", d.Text, d.Rationale, park)
default:
fmt.Fprintf(&b, "/hive decision %s\n\nRationale: %s.", d.Text, d.Rationale)
}
diff --git a/src/pkg/delegatedecision/decision_glossary.go b/src/pkg/delegatedecision/decision_glossary.go
index 0153cad7e1..761451c0ee 100644
--- a/src/pkg/delegatedecision/decision_glossary.go
+++ b/src/pkg/delegatedecision/decision_glossary.go
@@ -129,6 +129,12 @@ var glossary = []GlossaryEntry{
Detail: "The PR was held until the reporter's trust was known; its fix is green and mergeable, so the hold is cleared."},
{Slug: "small-low-risk", Kind: GlossaryRule, Plain: "a small, low-risk change on a green branch",
Detail: "The change is small and low-risk (docs, CI pins, text, workflow hygiene) and CI is green, so it is approved."},
+ {Slug: "selfreport-operator-action", Kind: GlossaryRule, Plain: "a spoke self-report only its operator can fix; not code work",
+ Detail: "The issue is a fleet self-report (expired login, credentials, disk, network, App setup) whose remedy is on the reporting spoke. The hive tells that spoke's owner what to do and keeps it out of the actionable set; no agent is sent to code."},
+ {Slug: "proposal-approve-evidence", Kind: GlossaryRule, Plain: "a proposal backed by an incident or a repeated class; approved",
+ Detail: "The hive-filed proposal names an incident it would have prevented, or prior instances of the same class fixed one at a time, so its cost is justified and it is approved as proposed."},
+ {Slug: "proposal-not-now", Kind: GlossaryRule, Plain: "a hive-filed proposal with no incident or recurrence behind it; declined for now",
+ Detail: "The proposal shows neither an incident it would have prevented nor a repeated class it would end, so its value is speculative. The hive declines it for now and closes it as not planned; re-propose with evidence."},
{Slug: "default-approve", Kind: GlossaryRule, Plain: "no special rule applies; the hive took its own recommendation",
Detail: "No owner rule singles this issue out, so the hive went with its own recommendation — the reversible choice that keeps work moving."},
{Slug: "default-release", Kind: GlossaryRule, Plain: "no special rule applies; a green branch is approved",
@@ -167,6 +173,11 @@ var glossary = []GlossaryEntry{
Detail: "The proposal is accepted as written with its stated defaults."},
{Slug: string(VerdictRecommendOnly), Kind: GlossaryAction, Plain: "recommended only; a person confirms",
Detail: "The hive only recommended; the item stays parked until a person confirms.", Aliases: []string{"recommended"}},
+ {Slug: string(VerdictOperatorAction), Kind: GlossaryAction, Plain: "told the spoke owner what to do; nothing for an agent here",
+ Detail: "The hive named the spoke owner and the one action they take (for example re-authenticate the provider). The item stays parked, gets no approved-direction, and clears when the report stops recurring."},
+ {Slug: string(VerdictNotNow), Kind: GlossaryAction, Plain: "declined for now; closed as not planned",
+ Detail: "The hive declined the proposal for now and closed it as not planned, with the reason and what evidence would reopen it.",
+ Aliases: []string{string(ActionCloseNotNow)}},
{Slug: string(VerdictRefused), Kind: GlossaryAction, Plain: "did not decide",
Detail: "The hive did not decide this item; its safety rails stopped it (for example, the item is on hold)."},
{Slug: string(ActionCommentDecision), Kind: GlossaryAction, Plain: "recorded the decision on GitHub",
diff --git a/src/pkg/delegatedecision/issue_judgment.go b/src/pkg/delegatedecision/issue_judgment.go
new file mode 100644
index 0000000000..e21278a332
--- /dev/null
+++ b/src/pkg/delegatedecision/issue_judgment.go
@@ -0,0 +1,223 @@
+package delegatedecision
+
+import (
+ "regexp"
+ "sort"
+ "strconv"
+ "strings"
+)
+
+// Owner-style judgment for parked issues (hivecommons/hive: "Let hive decide"
+// should decide the way the owner would). Three questions come before the
+// reversible default:
+//
+// - a fleet self-report whose remedy is an operator's (credentials, quota,
+// network, config on the reporting spoke) is not code work: the hive tells
+// the spoke's owner what to do and keeps the item out of the actionable set;
+// - a hive-filed proposal is approved when it carries evidence — an incident
+// it would have prevented, or a recurrence it would end;
+// - a hive-filed proposal without such evidence is declined for now.
+//
+// Each classifier is pure so the table tests run on the real issue bodies.
+
+// SelfReport is what the delegate reads from a `hive:selfreport` issue.
+type SelfReport struct {
+ // Class is the runtime fault class (for example agent_login_required).
+ Class string
+ // Hive is the reporting hive id from the marker; Spoke the spoke name from
+ // the evidence table (falls back to Hive); SpokeURL its link when given.
+ Hive, Spoke, SpokeURL string
+ // Owners are the @logins the evidence table names as owner(s).
+ Owners []string
+}
+
+var (
+ selfreportMarkerRE = regexp.MustCompile(``)
+ selfreportHiveRE = regexp.MustCompile(`\bhive=([^\s>]+)`)
+ selfreportClassRE = regexp.MustCompile("(?i)\\bclass\\s*`([a-z0-9_]+)`")
+ selfreportTitleRE = regexp.MustCompile(`^\s*\[selfreport\]\s*([a-z0-9_]+)`)
+ selfreportRowRE = regexp.MustCompile(`(?m)^\|\s*([^|]+?)\s*\|\s*([^|]*?)\s*\|`)
+ selfreportLinkRE = regexp.MustCompile(`^\[([^\]]+)\]\(([^)]+)\)`)
+ mentionRE = regexp.MustCompile(`@([A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)`)
+)
+
+// ParseSelfReport recognises a fleet self-report issue: the body carries the
+// `hive:selfreport` marker or the title starts with `[selfreport]`. The class
+// comes from the body ("class `x`") or the title prefix.
+func ParseSelfReport(title, body string) (SelfReport, bool) {
+ var sr SelfReport
+ marker := selfreportMarkerRE.FindStringSubmatch(body)
+ titleMatch := selfreportTitleRE.FindStringSubmatch(title)
+ if marker == nil && titleMatch == nil {
+ return sr, false
+ }
+ if marker != nil {
+ if m := selfreportHiveRE.FindStringSubmatch(marker[1]); m != nil {
+ sr.Hive = m[1]
+ }
+ }
+ if m := selfreportClassRE.FindStringSubmatch(body); m != nil {
+ sr.Class = strings.ToLower(m[1])
+ } else if titleMatch != nil {
+ sr.Class = strings.ToLower(titleMatch[1])
+ }
+ for _, row := range selfreportRowRE.FindAllStringSubmatch(body, -1) {
+ key, val := strings.ToLower(strings.TrimSpace(row[1])), strings.TrimSpace(row[2])
+ switch key {
+ case "spoke":
+ if link := selfreportLinkRE.FindStringSubmatch(val); link != nil {
+ sr.Spoke, sr.SpokeURL = link[1], link[2]
+ } else if val != "" && val != "—" {
+ sr.Spoke = val
+ }
+ case "owner(s)", "owners", "owner":
+ for _, m := range mentionRE.FindAllStringSubmatch(val, -1) {
+ sr.Owners = appendUnique(sr.Owners, m[1])
+ }
+ case "hive":
+ if sr.Hive == "" && val != "" && val != "—" {
+ sr.Hive = val
+ }
+ }
+ }
+ if sr.Spoke == "" {
+ sr.Spoke = sr.Hive
+ }
+ return sr, sr.Class != ""
+}
+
+// selfreportOpsRemedies maps the self-report classes whose remedy is an
+// operator's — credentials, quota, disk, network or App configuration on the
+// reporting spoke — to the one action its owner takes. Code-defect classes
+// (panics, repeated unclassified errors, stalls) are absent on purpose: they
+// stay on the implementer path. The names mirror pkg/fleetreport's class
+// constants (pinned by TestSelfreportOpsClassesMatchFleetReport) without
+// importing that package's dependency tree into this leaf.
+var selfreportOpsRemedies = map[string]string{
+ "agent_login_required": "re-authenticate the agent provider (run the provider's login on the spoke so the agent CLI has a current session)",
+ "inference_auth_failed": "renew the inference credentials or API key the spoke's agents use",
+ "data_disk_pressure": "free or grow the data disk on the spoke",
+ "github_app_token_mint_failed": "check the GitHub App key and installation the spoke is configured with",
+ "github_app_not_installed": "install the GitHub App on the organisation or repositories the spoke serves",
+ "github_app_repo_not_covered": "add the repository to the GitHub App installation the spoke uses",
+ "proxy_connect_dial_failed": "restore the spoke's outbound proxy or network path",
+ "proxy_tls_handshake_failed": "fix the spoke's proxy TLS trust (certificate or CA bundle)",
+ "crux_runtime_unavailable": "restart or re-deploy the crux runtime sidecar on the spoke",
+ "model_discovery_degraded": "check the model endpoint and credentials the spoke's provider is configured with",
+ "inference_upstream_error": "check the inference endpoint the spoke's provider points at",
+ "inference_caller_unidentified": "set the inference caller identity in the spoke's configuration",
+ "label_provisioning_failed": "grant the spoke's GitHub identity the label-admin permission it lacks",
+ "shared_ci_rerun_forbidden": "grant the spoke's GitHub identity the actions permission needed to re-run shared CI",
+}
+
+// selfreportOpsClass reports whether a self-report class is an operator's to
+// fix and, if so, the remedy in one clause.
+func selfreportOpsClass(class string) (remedy string, ok bool) {
+ remedy, ok = selfreportOpsRemedies[strings.ToLower(strings.TrimSpace(class))]
+ return remedy, ok
+}
+
+// OperatorInstruction is the one-clause direction a self-report's spoke
+// owner receives: who, what, where.
+func (sr SelfReport) OperatorInstruction(remedy string) string {
+ who := "the spoke owner"
+ if len(sr.Owners) > 0 {
+ who = "@" + strings.Join(sr.Owners, " @")
+ }
+ spoke := sr.Spoke
+ if spoke == "" {
+ spoke = "the reporting spoke"
+ }
+ return who + ": " + remedy + " on " + spoke
+}
+
+// operatorActionPrefix opens an operator-action decision's text; the
+// effect line strips it to read "Waiting on the spoke owner: @who: …".
+const operatorActionPrefix = "operator action — "
+
+// Proposal shapes: the hive's planning and quality lanes file proposals with
+// a lane prefix or as a gate proposal / RFC.
+var (
+ proposalTitleRE = regexp.MustCompile(`(?i)\[(?:quality|scanner|architect|strategist|outreach)\]|\bgate proposal\b`)
+ proposalRFCRE = regexp.MustCompile(`\bRFC\b`)
+ incidentRefRE = regexp.MustCompile(`(?i)\bincident\s*#\d+`)
+ // incidentRE is evidence the proposal would have prevented something that
+ // happened: an incident reference, breakage or a measured blast radius.
+ incidentRE = regexp.MustCompile(`(?i)\b(?:broke|regression|outage|uncompilable|went red|was red|blast radius)\b`)
+ // recurrenceRE is evidence of a class the proposal would end: the prior
+ // instances it names were each fixed one at a time.
+ recurrenceRE = regexp.MustCompile(`(?i)\b(?:fix(?:ed|ing)?\s+(?:in|by)|fixing PRs?:)\s*((?:#\d+(?:\s*[,/]\s*|\s+and\s+|\s*)?)+)`)
+ issueRefRE = regexp.MustCompile(`#(\d+)`)
+)
+
+// Evidence kinds a proposal can carry.
+const (
+ EvidenceIncident = "incident"
+ EvidenceRecurrence = "recurrence"
+)
+
+// IsProposal reports a proposal-shaped issue: a lane-prefixed title
+// ([quality], [scanner], [architect], [strategist], [outreach]), a "Gate
+// proposal" or RFC, or a proposal/design label.
+func IsProposal(title string, labels []string) bool {
+ if hasAnyLabel(labels, labelKindProposal, labelProposal, labelRFC, labelKindDesign) {
+ return true
+ }
+ return proposalTitleRE.MatchString(title) || proposalRFCRE.MatchString(title)
+}
+
+// ProposalEvidence reports whether a proposal shows the evidence the owner
+// asks for before paying for a gate: an incident (kind EvidenceIncident) or a
+// recurrence of fixed instances (kind EvidenceRecurrence). detail quotes the
+// evidence in plain words for the rationale.
+func ProposalEvidence(title, body string) (kind, detail string, ok bool) {
+ text := title + "\n" + body
+ if m := incidentRefRE.FindString(text); m != "" {
+ return EvidenceIncident, "it cites " + strings.ToLower(m), true
+ }
+ if m := incidentRE.FindString(text); m != "" {
+ return EvidenceIncident, "it describes an incident (" + strings.ToLower(m) + ")", true
+ }
+ fixed := map[int]bool{}
+ for _, m := range recurrenceRE.FindAllStringSubmatch(text, -1) {
+ for _, ref := range issueRefRE.FindAllStringSubmatch(m[1], -1) {
+ if n, err := strconv.Atoi(ref[1]); err == nil {
+ fixed[n] = true
+ }
+ }
+ }
+ if len(fixed) >= 2 {
+ nums := make([]int, 0, len(fixed))
+ for n := range fixed {
+ nums = append(nums, n)
+ }
+ sort.Ints(nums)
+ refs := make([]string, 0, len(nums))
+ for _, n := range nums {
+ refs = append(refs, "#"+strconv.Itoa(n))
+ }
+ return EvidenceRecurrence, "the same class was already fixed one at a time in " + strings.Join(refs, ", "), true
+ }
+ return "", "", false
+}
+
+// BotShapedLogin reports a login that is an App or bot rather than a person.
+func BotShapedLogin(login string) bool {
+ l := strings.ToLower(strings.TrimSpace(login))
+ return strings.HasSuffix(l, "[bot]") || strings.HasPrefix(l, "app/")
+}
+
+// hiveFiled reports an issue the hive (or any bot) filed: the only authors
+// whose proposals the hive declines on its own.
+func hiveFiled(in Input) bool {
+ return in.HiveAuthored || BotShapedLogin(in.Author)
+}
+
+func appendUnique(list []string, s string) []string {
+ for _, have := range list {
+ if strings.EqualFold(have, s) {
+ return list
+ }
+ }
+ return append(list, s)
+}
diff --git a/src/pkg/delegatedecision/issue_judgment_fixtures_test.go b/src/pkg/delegatedecision/issue_judgment_fixtures_test.go
new file mode 100644
index 0000000000..1947e45156
--- /dev/null
+++ b/src/pkg/delegatedecision/issue_judgment_fixtures_test.go
@@ -0,0 +1,156 @@
+package delegatedecision
+
+// Real parked issues the owner judged by hand (hivecommons/hive: "Let hive
+// decide" should decide the way he would). Bodies are trimmed to the parts
+// the classifiers read; titles, labels and authors are verbatim.
+
+var fixtureHive15021 = Input{
+ Kind: KindIssue, Author: "app/hivecommons-hive",
+ Title: `[selfreport] agent_login_required: login required detected`,
+ Labels: []string{"help wanted", "triage/accepted", "approved-direction"},
+ Body: `
+
+
+
+A hive hit an unusual runtime error (class ` + "`" + `agent_login_required` + "`" + `) and is reporting it so the same defect across the fleet lands in one issue.
+
+## Evidence
+
+| Field | Value |
+|---|---|
+| hive | hosted-ibm-alchemy-logg-ptoo |
+| hive name | — |
+| spoke | [hosted-ibm-alchemy-logg-ptoo](https://hosted-ibm-alchemy-logg-ptoo.apps.fmaas-vllm-d.fmaas.res.ibm.com) |
+| anonymous instance | c1a14572726a1483 |
+| owner(s) | @clubanderson |
+| hive version | 5.186.4-673-g4d1642c76 |
+| hive commit | 4d1642c |
+| cluster | vllm-d |
+| mode | quiet |
+| component | agent-runtime |
+| scope | login required detected |
+| message | login required detected |
+| count + window | 5 in 10m0s |
+| first seen | 2026-10-28T17:22:09Z |
+| reported at | 2026-10-28T17:27:14Z |
+| repos | — |
+| owners | — |
+| repo | — |
+| ref | — |
+| self-recovered | no |
+
+
+**Affected hives (1):**
+- hosted-ibm-alchemy-logg-ptoo (instance c1a14572726a1483) — [open](https://hosted-ibm-alchemy-logg-ptoo.apps.fmaas-vllm-d.fmaas.res.ibm.com) — owner(s): @clubanderson — seen 1, last 2026-10-28T17:27:14Z
+seen_count: 1
+
+
+Diagnostics (scrubbed)
+
+` + "`" + `` + "`" + `` + "`" + `
+WARN agent=quality pattern=(?i)Please run /login sightings=2
+` + "`" + `` + "`" + `` + "`" + `
+ `,
+}
+
+var fixtureHive15329 = Input{
+ Kind: KindIssue, Author: "hanthor",
+ Title: `📝 RFC: admission-side #5117 — hold unacknowledged hive-filed proposals before any kick`,
+ Labels: []string{"enhancement", "help wanted", "architecture discussion", "kind/design", "stage/045-needs-decision"},
+ Body: `## Use case
+
+A hive's planning lanes (architect, strategist, outreach) file issues that propose a direction. Today those issues enter the actionable set like any other, so an implementer lane can pick one up and open a PR the same day. #5117 catches this, but only on the PR side: the hold lands after the run is spent, and the PR then sits in the queue until a human closes it.
+
+I'd like an opt-in admission gate: a hive-filed issue that is a *proposal*, and that no human has acknowledged, does not become actionable. Everything else is admitted exactly as today.
+
+## Evidence (tuna-os/tunaOS, 2026-10-29)
+
+- 218 open issues; the hive filed 171 of them. 127 are ` + "`" + `[architect]` + "`" + `/` + "`" + `[strategist]` + "`" + `/` + "`" + `[outreach]` + "`" + ` proposals, and **none** carried ` + "`" + `approved-direction` + "`" + `.
+- 130 open PRs, 101 of them opened in the last 7 days. About 15 are ` + "`" + `docs(outreach)` + "`" + `/` + "`" + `docs(metrics)` + "`" + ` PRs that implement those proposals; nobody asked for them.
+- ` + "`" + `issue_filter.reporter_trust` + "`" + ` (#9665) can't express this. It judges human reporters only, and hands hive-filed issues to #5117 by design (` + "`" + `fetchIssues` + "`" + ` comment). The App is reported as ` + "`" + `CONTRIBUTOR` + "`" + ` on its own issues, so turning reporter trust on would latch all 171 hive-filed issues, including scanner bug reports that should keep flowing.
+
+## Proposal
+
+` + "`" + `` + "`" + `` + "`" + `yaml
+project:
+ issue_filter:
+ agent_proposal:
+ labels: [agent/architect, agent/strategist, agent/outreach]
+ title_prefixes: ['[architect]', '[strategist]', '[outreach]']
+` + "`" + `` + "`" + `` + "`" + ``,
+}
+
+var fixtureHive15335 = Input{
+ Kind: KindIssue, Author: "app/hivecommons-hive",
+ Title: `[quality] Gate config: opt hivecommons/hive into auto_merge.require_current_base — stale-green merge of #15236 broke v5 for 20 min`,
+ Labels: []string{"help wanted", "testing", "agent/quality", "approved-direction", "stage/010-actionable"},
+ Body: `## Finding
+
+` + "`" + `v5` + "`" + ` was uncompilable in ` + "`" + `pkg/dashboard` + "`" + ` tests from 05:25Z to 05:46Z on 2026-10-29 (incident #15322). The cause was a stale-green merge, which the existing gate ` + "`" + `auto_merge.require_current_base` + "`" + ` (#13634) exists to prevent — but the hive that merges into ` + "`" + `hivecommons/hive` + "`" + ` does not have this repository listed, so the gate never ran:
+
+- #15267 (merged 03:30:40Z) added the ` + "`" + `open` + "`" + ` argument to ` + "`" + `stageTrackerResolveLinkedPRs` + "`" + `.
+- #15236's last CI run finished **02:15Z** on head ` + "`" + `56331a1b` + "`" + ` (committed 02:02Z), against a base that pre-dated #15267.
+- #15236 was merged by ` + "`" + `hivecommons-hive[bot]` + "`" + ` at **05:25:23Z** with no re-run on a current merge base. Its new test still used the one-argument call, so every ` + "`" + `test (dashboard …)` + "`" + ` shard, ` + "`" + `test` + "`" + ` and ` + "`" + `coverage` + "`" + ` went red on ` + "`" + `v5` + "`" + ` until #15301 (2f05d8e) landed the fix at 05:46Z.
+
+Blast radius of the 20-minute window: #15314, #15315, #15316, #15317, #15300, #15304 ran red against the broken base; #15321 and #15324 were opened as redundant fixes; one shared-CI incident was filed and closed. All of that was avoidable: with the gate on, #15236 would have been updated onto ` + "`" + `v5` + "`" + ` and re-tested, and the semantic conflict would have turned **that one PR** red instead of the base.
+
+Evidence: ` + "`" + `gh api repos/hivecommons/hive/pulls/15236` + "`" + ` (` + "`" + `merged_at` + "`" + `, ` + "`" + `merged_by` + "`" + `), ` + "`" + `gh api repos/hivecommons/hive/commits/56331a1b.../check-runs` + "`" + ` (latest dashboard shard ` + "`" + `completed_at` + "`" + ` 02:15:24Z), ` + "`" + `gh api repos/hivecommons/hive/pulls/15267` + "`" + ` (` + "`" + `merged_at` + "`" + ` 03:30:40Z); ` + "`" + `src/pkg/github/automerge/automerge_current_base.go:27-33` + "`" + `, ` + "`" + `src/docs/operator-reference.md:432` + "`" + ` (default ` + "`" + `unset (off)` + "`" + `).
+
+## Recommendation
+
+Opt this repository into the gate in the operator config of the hive that merges here:
+
+` + "`" + `` + "`" + `` + "`" + `yaml
+auto_merge:
+ require_current_base:
+ - hivecommons/hive
+` + "`" + `` + "`" + `` + "`" + `
+
+Cost is one compare call per merge candidate; a behind head gets one GitHub update-branch merge commit and merges once CI is green on it (no author commit rewritten). #15308 (native merge queues) would also close this class once it lands, but it is still in review and this is a one-line config change available today.
+
+Gate check: this is filed against the gate's configuration, not as a new finding class — the gate exists and is wired (` + "`" + `src/cmd/hive/main.go:2572` + "`" + `, ` + "`" + `:9434` + "`" + `); it is simply off for this repo.
+
+Risk: governance — this changes merge behaviour for every lane on the primary repo, and the config lives in the operator's deployment, which the hive cannot edit.
+
+## Priority
+- Impact: high (base-breaking merges stall every open PR and spawn duplicate fix PRs)`,
+}
+
+var fixtureRationguard418 = Input{
+ Kind: KindIssue, Author: "app/hivecommons-hive",
+ Title: `[scanner] Gate proposal: ECMA-48 conformance test for stripTerminalEscapes (3rd recogniser gap: 8-bit ST U+009C over-strips)`,
+ Labels: []string{"help wanted", "agent/scanner", "approved-direction", "stage/010-actionable"},
+ Body: `## Summary
+
+Three ` + "`" + `stripTerminalEscapes` + "`" + ` recogniser gaps have now been found one at a time in ` + "`" + `src/sanitize.ts` + "`" + `, each fixed by adding one more regex and one more pinned assertion:
+
+1. #414 — Fs/Fp two-byte finals (` + "`" + `ESC c` + "`" + `, ` + "`" + `ESC 7` + "`" + `, ` + "`" + `ESC 8` + "`" + `) leaked past the two-byte rule (fixed in #415).
+2. #416 — nF intermediate-byte sequences (` + "`" + `ESC # 8` + "`" + `, ` + "`" + `ESC % G` + "`" + `) leaked their payload (fixed in #417).
+3. **New, third instance (not filed separately per the three-of-a-class rule):** the string terminator recognised by ` + "`" + `replaceControlStrings` + "`" + ` is only BEL or 7-bit ST (` + "`" + `ESC \` + "`" + `). The 8-bit ST **U+009C** that ` + "`" + `stringifyForTerminal` + "`" + `'s docblock already acknowledges emulators honour is not a terminator. An OSC/APC/PM closed by U+009C is therefore treated as *unterminated*, and the span runs to the **next** BEL / ` + "`" + `ESC \` + "`" + ` anywhere later in the buffer — swallowing legitimate text in between.
+
+ Reproduction against the current ` + "`" + `replaceControlStrings` + "`" + ` logic (10e3012):`,
+}
+
+var fixtureSite296 = Input{
+ Kind: KindIssue, Author: "app/hivecommons-hive",
+ Title: `[quality] Gate proposal: shell-checker arms that survive mutation (mutation harness for scripts/*.sh)`,
+ Labels: []string{"testing", "agent/quality"},
+ Body: `## Finding
+
+` + "`" + `scripts/*.sh` + "`" + ` (check-links.sh, check-redirects.sh, make-redirects.sh) are the only gates in this repository without a "branch runs but is never asserted" gate. The JS gates got one in #254 (branch-coverage floor, ` + "`" + `scripts/coverage-floor.test.mjs` + "`" + `); the shell checkers are outside it, and the only thing that exercises them in CI is their own self-test (` + "`" + `links.yml` + "`" + ` test job).
+
+This is now the third time a freshly-landed shell-checker change shipped with arms that no self-test assertion distinguishes from a broken one:
+
+1. #248 — first instance (check-links arm unasserted).
+2. #257 — 4 arms survived hand-written mutants at f930ed0 (check-links 410 handling, two ` + "`" + `SOFT_404_RE` + "`" + ` alternatives, fonts preconnect skip; make-redirects ` + "`" + `html_escape` + "`" + ` of ` + "`" + `< > "` + "`" + `). Self-tests stayed 106/28 green under every mutant.
+3. #295 @0dada63 — ` + "`" + `has_id` + "`" + ` landed with three arms the new self-test case does not pin. Each mutant below keeps ` + "`" + `check-links.test.sh` + "`" + ` at 119/119:
+ - escape only ` + "`" + `.` + "`" + ` instead of every ERE metacharacter → ` + "`" + `#a+b` + "`" + ` is satisfied by ` + "`" + `id="aab"` + "`" + `, ` + "`" + `#q(1)` + "`" + ` by ` + "`" + `id="q1"` + "`" + ` (false pass);
+ - drop the ` + "`" + `([^>]*[[:space:]])?` + "`" + ` group → ` + "`" + `` + "`" + ` is reported missing (false failure on a legitimate named anchor);
+ - use the unescaped id in the ` + "`" + `name=` + "`" + ` arm → ` + "`" + `#n.m` + "`" + ` is satisfied by ` + "`" + `` + "`" + `.
+
+ A PR pinning these three arms is open separately; it does not change the fact that nothing stops the fourth instance.
+
+Per the quality lane's three-of-a-class rule I am filing the missing gate instead of a third per-site finding.
+
+## Recommendation`,
+}
diff --git a/src/pkg/delegatedecision/issue_judgment_test.go b/src/pkg/delegatedecision/issue_judgment_test.go
new file mode 100644
index 0000000000..ca7539e366
--- /dev/null
+++ b/src/pkg/delegatedecision/issue_judgment_test.go
@@ -0,0 +1,287 @@
+package delegatedecision
+
+import (
+ "strings"
+ "testing"
+
+ "github.com/hivecommons/hive/pkg/fleetreport"
+)
+
+// TestDecideIssueLikeTheOwner pins the five real parked issues the owner
+// judged by hand against what the delegate now decides, and logs the rule,
+// verdict and comment each produces (the PR body quotes that log).
+func TestDecideIssueLikeTheOwner(t *testing.T) {
+ t.Parallel()
+ cases := []struct {
+ name string
+ in Input
+ rule string
+ verdict Verdict
+ text []string
+ notText []string
+ actions []ActionKind
+ }{
+ {
+ name: "hive#15021 selfreport agent_login_required → operator action, not code work",
+ in: fixtureHive15021, rule: "selfreport-operator-action", verdict: VerdictOperatorAction,
+ text: []string{"@clubanderson", "re-authenticate the agent provider", "hosted-ibm-alchemy-logg-ptoo"},
+ actions: []ActionKind{ActionLabelsAdd, ActionRecommendOnly},
+ },
+ {
+ name: "hive#15329 RFC on hive-filed proposals (human author) → recommend only, with a real recommendation",
+ in: fixtureHive15329, rule: "hive-policy", verdict: VerdictRecommendOnly,
+ text: []string{"hive recommends: approve `", "should not be actionable", "default-on", "owner to confirm"},
+ notText: []string{"no special rule"},
+ actions: []ActionKind{ActionRecommendOnly},
+ },
+ {
+ name: "hivecommons.github.io#296 gate proposal without incident → not now",
+ in: fixtureSite296, rule: "proposal-not-now", verdict: VerdictNotNow,
+ text: []string{"not now", "no incident or recurrence justifies the cost", "re-propose"},
+ actions: []ActionKind{ActionCloseNotNow},
+ },
+ {
+ name: "hive#15335 gate config with incident evidence → approve",
+ in: fixtureHive15335, rule: "proposal-approve-evidence", verdict: VerdictApprove,
+ text: []string{"approve as proposed", "incident #15322"},
+ actions: []ActionKind{ActionCommentDecision, ActionLabelsAdd},
+ },
+ {
+ name: "rationguard#418 gate proposal citing a three-of-a-class recurrence → approve",
+ in: fixtureRationguard418, rule: "proposal-approve-evidence", verdict: VerdictApprove,
+ text: []string{"approve as proposed", "#415, #417"},
+ actions: []ActionKind{ActionCommentDecision, ActionLabelsAdd},
+ },
+ }
+ for _, tc := range cases {
+ t.Run(tc.name, func(t *testing.T) {
+ in := tc.in
+ in.Number = 1
+ in.Labels = append([]string{LabelIssueNeedsDecision}, in.Labels...)
+ d := Run(in)
+ if d.Rule != tc.rule || d.Verdict != tc.verdict {
+ t.Fatalf("rule=%q verdict=%q; want %q %q (%+v)", d.Rule, d.Verdict, tc.rule, tc.verdict, d)
+ }
+ for _, want := range tc.text {
+ if !strings.Contains(d.Text, want) {
+ t.Errorf("text %q lacks %q", d.Text, want)
+ }
+ }
+ for _, bad := range tc.notText {
+ if strings.Contains(d.Text, bad) {
+ t.Errorf("text %q must not say %q", d.Text, bad)
+ }
+ }
+ kinds := make([]ActionKind, 0, len(d.Actions))
+ for _, a := range d.Actions {
+ kinds = append(kinds, a.Kind)
+ }
+ if len(kinds) != len(tc.actions) {
+ t.Fatalf("actions = %v; want %v", kinds, tc.actions)
+ }
+ for i := range kinds {
+ if kinds[i] != tc.actions[i] {
+ t.Fatalf("actions = %v; want %v", kinds, tc.actions)
+ }
+ }
+ body := CommentBodyWith(d, "hive-a", "clubanderson", CommentOptions{Kind: KindIssue})
+ t.Logf("rule=%s verdict=%s\ntext: %s\n--- comment ---\n%s", d.Rule, d.Verdict, d.Text, body)
+ })
+ }
+}
+
+// An operator-action decision never carries the approval that makes an
+// issue actionable, never posts a `/hive decision` line the unpark sweep
+// would consume, and names the issue-side park label.
+func TestOperatorActionKeepsIssueParked(t *testing.T) {
+ t.Parallel()
+ in := fixtureHive15021
+ in.Number = 15021
+ d := Run(in)
+ if !d.KeepsPark {
+ t.Fatalf("operator action must keep the park: %+v", d)
+ }
+ for _, a := range d.Actions {
+ if a.Kind == ActionCommentDecision || a.Kind == ActionApproveReview {
+ t.Fatalf("operator action must not record an approval: %+v", d.Actions)
+ }
+ }
+ body := CommentBodyWith(d, "h", "", CommentOptions{Kind: KindIssue})
+ if strings.Contains(body, "/hive decision") || !strings.Contains(body, "`"+LabelIssueNeedsDecision+"` stays") {
+ t.Fatalf("comment:\n%s", body)
+ }
+ eff := ExpectedEffect(d, KindIssue)
+ if eff.Waits || !strings.HasPrefix(eff.IfNot, "Waiting on the spoke owner: ") || !strings.Contains(eff.IfNot, "@clubanderson") {
+ t.Fatalf("effect = %+v", eff)
+ }
+}
+
+func TestParseSelfReport(t *testing.T) {
+ t.Parallel()
+ sr, ok := ParseSelfReport(fixtureHive15021.Title, fixtureHive15021.Body)
+ if !ok || sr.Class != "agent_login_required" || sr.Hive != "hosted-ibm-alchemy-logg-ptoo" || sr.Spoke != "hosted-ibm-alchemy-logg-ptoo" {
+ t.Fatalf("%+v %v", sr, ok)
+ }
+ if len(sr.Owners) != 1 || sr.Owners[0] != "clubanderson" || !strings.HasPrefix(sr.SpokeURL, "https://hosted-ibm-alchemy-logg-ptoo.") {
+ t.Fatalf("%+v", sr)
+ }
+ // Title-only form, no marker: the class comes from the prefix.
+ sr, ok = ParseSelfReport("[selfreport] data_disk_pressure: disk 97% full", "no table here")
+ if !ok || sr.Class != "data_disk_pressure" || sr.Spoke != "" {
+ t.Fatalf("%+v %v", sr, ok)
+ }
+ if _, ok := ParseSelfReport("[quality] something about login required", "class `agent_login_required`"); ok {
+ t.Fatal("a body that only mentions a class is not a self-report")
+ }
+}
+
+// Code-defect classes stay on the implementer path: a panic self-report is
+// still decided by the old rules, not handed to an operator.
+func TestSelfreportCodeDefectClassStaysOnOldPath(t *testing.T) {
+ t.Parallel()
+ in := fixtureHive15021
+ in.Number = 2
+ in.Title = "[selfreport] panic_recovered: index out of range"
+ in.Body = strings.Replace(in.Body, "class `agent_login_required`", "class `panic_recovered`", 1)
+ d := Run(in)
+ if d.Verdict == VerdictOperatorAction || d.Rule == "selfreport-operator-action" {
+ t.Fatalf("panic self-report must not be an operator action: %+v", d)
+ }
+ if _, ok := selfreportOpsClass("unclassified_error_repeated"); ok {
+ t.Fatal("unclassified_error_repeated is a code defect")
+ }
+}
+
+// The ops-class table mirrors pkg/fleetreport's constants by value so a
+// renamed class fails here rather than silently falling to default-approve.
+func TestSelfreportOpsClassesMatchFleetReport(t *testing.T) {
+ t.Parallel()
+ known := map[string]bool{}
+ for _, c := range []string{
+ fleetreport.ClassAgentLoginRequired, fleetreport.ClassInferenceAuthFailed, fleetreport.ClassDataDiskPressure,
+ fleetreport.ClassGitHubAppTokenMintFailed, fleetreport.ClassGitHubAppNotInstalled, fleetreport.ClassGitHubAppRepoNotCovered,
+ fleetreport.ClassProxyConnectDialFailed, fleetreport.ClassProxyTLSHandshakeFailed, fleetreport.ClassCruxRuntimeUnavailable,
+ fleetreport.ClassModelDiscoveryDegraded, fleetreport.ClassInferenceUpstreamError, fleetreport.ClassInferenceCallerUnknown,
+ fleetreport.ClassLabelProvisioningFailed, fleetreport.ClassSharedCIRerunForbidden,
+ } {
+ known[c] = true
+ }
+ for class := range selfreportOpsRemedies {
+ if !known[class] {
+ t.Errorf("ops class %q is not a fleetreport class", class)
+ }
+ }
+ for class := range known {
+ if _, ok := selfreportOpsClass(class); !ok {
+ t.Errorf("fleetreport class %q missing from the ops table", class)
+ }
+ }
+}
+
+func TestProposalEvidence(t *testing.T) {
+ t.Parallel()
+ cases := []struct {
+ name, title, body string
+ kind string
+ }{
+ {"incident ref", "[quality] Gate config", "v5 broke (incident #15322)", EvidenceIncident},
+ {"breakage word", "[scanner] gate: x", "this regression shipped twice", EvidenceIncident},
+ {"fixed in twice", "[scanner] gate", "1. #1 (fixed in #2). 2. #3 (fixed in #4).", EvidenceRecurrence},
+ {"fixing PRs list", "[scanner] gate", "Fixing PRs: #415, #417.", EvidenceRecurrence},
+ {"one fix only", "[scanner] gate", "#1 (fixed in #2) — nothing else", ""},
+ {"third time but no fixes", fixtureSite296.Title, fixtureSite296.Body, ""},
+ {"bare refs are not recurrence", "[quality] gate", "see #248, #257, #295 for prior discussion", ""},
+ }
+ for _, tc := range cases {
+ kind, detail, ok := ProposalEvidence(tc.title, tc.body)
+ if (tc.kind != "") != ok || kind != tc.kind {
+ t.Errorf("%s: kind=%q ok=%v detail=%q; want %q", tc.name, kind, ok, detail, tc.kind)
+ }
+ }
+}
+
+func TestIsProposal(t *testing.T) {
+ t.Parallel()
+ for _, title := range []string{"[quality] Gate config: x", "[scanner] something", "[architect] plan", "[strategist] plan", "[outreach] post", "Add a gate proposal for y", "📝 RFC: foo"} {
+ if !IsProposal(title, nil) {
+ t.Errorf("%q should be a proposal", title)
+ }
+ }
+ for _, title := range []string{"fix: nil deref in parser", "[selfreport] agent_login_required", "rfc822 date parsing is wrong", "bug: performance regression"} {
+ if IsProposal(title, nil) {
+ t.Errorf("%q should not be a proposal", title)
+ }
+ }
+ if !IsProposal("anything", []string{"kind/design"}) || !IsProposal("anything", []string{"kind/proposal"}) {
+ t.Error("design/proposal labels mark a proposal")
+ }
+}
+
+// A person's proposal without evidence is never declined by the hive; it
+// keeps the reversible default. A bot's is declined for now.
+func TestProposalNotNowOnlyForHiveFiled(t *testing.T) {
+ t.Parallel()
+ human := fixtureSite296
+ human.Number = 3
+ human.Author = "hanthor"
+ if d := Run(human); d.Rule != "default-approve" || d.Verdict != VerdictApprove {
+ t.Fatalf("human proposal: %+v", d)
+ }
+ bot := fixtureSite296
+ bot.Number = 4
+ bot.Author = "someone-else[bot]"
+ if d := Run(bot); d.Rule != "proposal-not-now" {
+ t.Fatalf("bot proposal: %+v", d)
+ }
+ viaFlag := fixtureSite296
+ viaFlag.Number = 5
+ viaFlag.Author = ""
+ viaFlag.HiveAuthored = true
+ if d := Run(viaFlag); d.Rule != "proposal-not-now" {
+ t.Fatalf("hive-authored proposal: %+v", d)
+ }
+ // Hive's own policy stays recommend-only even when hive-filed and
+ // evidence-free.
+ policy := fixtureSite296
+ policy.Number = 6
+ policy.Labels = append(policy.Labels, labelGovernance)
+ if d := Run(policy); d.Rule != "hive-policy" {
+ t.Fatalf("hive-policy proposal: %+v", d)
+ }
+}
+
+// The hive-policy recommendation on an issue is a sentence the owner can
+// act on, not "no special rule applies".
+func TestHivePolicyRecommendationIsReal(t *testing.T) {
+ t.Parallel()
+ in := fixtureHive15329
+ in.Number = 15329
+ d := Run(in)
+ body := CommentBodyWith(d, "h", "", CommentOptions{Kind: KindIssue})
+ for _, want := range []string{"hive recommends: approve `📝 RFC: admission-side #5117", "should not be actionable", "default-on", "`stage/045-needs-decision` stays"} {
+ if !strings.Contains(body, want) {
+ t.Errorf("comment lacks %q:\n%s", want, body)
+ }
+ }
+ // A PR-side policy item keeps the generic wording.
+ if got := hivePolicyRecommendation(Input{Kind: KindPR, Title: "x"}); !strings.Contains(got, "accept the proposal as written") {
+ t.Errorf("PR recommendation = %q", got)
+ }
+}
+
+func TestGlossaryCoversIssueJudgment(t *testing.T) {
+ t.Parallel()
+ for _, slug := range []string{"selfreport-operator-action", "proposal-approve-evidence", "proposal-not-now", string(VerdictOperatorAction), string(VerdictNotNow), string(ActionCloseNotNow)} {
+ e, ok := Explain(slug)
+ if !ok {
+ t.Errorf("no glossary entry for %q", slug)
+ continue
+ }
+ if n := len(strings.Fields(e.Plain)); n > 20 {
+ t.Errorf("%q plain words are %d words; keep them ≤ 20 for the dashboard", slug, n)
+ }
+ }
+ if got := ActionPlainOn(Decision{Verdict: VerdictNotNow}, KindIssue); !strings.Contains(got, "declined for now") {
+ t.Errorf("not-now plain = %q", got)
+ }
+}
diff --git a/src/pkg/delegatedecision/policy.go b/src/pkg/delegatedecision/policy.go
index 1804ee75fe..eee14161b7 100644
--- a/src/pkg/delegatedecision/policy.go
+++ b/src/pkg/delegatedecision/policy.go
@@ -47,7 +47,7 @@ const PolicyText = `Owner-delegate policy (how the owner decides; the hive appli
- Be decisive; except for the safety rails below, never ask the owner a question back. Pick the option that keeps work moving and is reversible.
- PRs: prefer an adequate human/contributor PR over a hive duplicate — if both exist and the contributor's is mergeable and current, recommend a human comparison of issue coverage, checks and review approval; keep the hive PR open and parked until adequacy is confirmed, and never close it solely on an issue reference. Otherwise supersede the contributor's with the hive's and close theirs with credit. Approve small, necessary, low-risk changes (CI pins, RBAC read-only adds, warning text, workflow hygiene) once the sentinel finding is checked and explained as intended. Sensitive-path sentinel alerts on trusted-author PRs: approve with a one-line "reviewed, intended" rationale. Clear reporter-trust holds when the fixing PR is sound.
- Contributors offline: adopt now in supersede mode — do not wait for a deadline (hivecommons/hive#13975).
-- Issues: dedupe aggressively (close the newer duplicate with "Duplicate of #N", cross-link overlaps); secrets / PAT / org-permission items are owner-only → label needs-owner + hold with one comment stating the exact owner action, and stop opening more failure issues for that root cause; flaky tests → quarantine with retry + a deflake task rather than block; CI hygiene gate proposals (actionlint, duplication ratchets, link-checker allowlists) → approve as ratchets (baseline, fail only on increases; warning-only briefly, then enforce); design proposals with concrete acceptance criteria → accept as proposed with explicit defaults; "review backlog items blocked on their PR" → never auto-close when the PR closes unmerged (drop the relation, comment, re-triage).
+- Issues: dedupe aggressively (close the newer duplicate with "Duplicate of #N", cross-link overlaps); secrets / PAT / org-permission items are owner-only → label needs-owner + hold with one comment stating the exact owner action, and stop opening more failure issues for that root cause; flaky tests → quarantine with retry + a deflake task rather than block; CI hygiene gate proposals (actionlint, duplication ratchets, link-checker allowlists) → approve as ratchets (baseline, fail only on increases; warning-only briefly, then enforce); design proposals with concrete acceptance criteria → accept as proposed with explicit defaults; "review backlog items blocked on their PR" → never auto-close when the PR closes unmerged (drop the relation, comment, re-triage); a fleet self-report whose remedy is the operator's (an expired provider login, credentials, disk, network, App setup on the reporting spoke) is not code work → tell that spoke's owner(s) exactly what to do, no approved-direction, no implementer, keep it out of the actionable set, and never post the same direction twice; a hive-filed proposal is paid for by evidence → approve it when it cites an incident it would have prevented or prior instances of the same class fixed one at a time, otherwise decline it for now (comment the reason, close as not planned; re-propose with evidence) — a person's proposal is never declined this way.
- Record the decision as a "/hive decision " comment on the item (and the auto-merge queue approval on the PR head when the decision is to release a PR), remove stage/085-needs-decision, add triage/accepted where applicable, and stamp the delegated-decision marker so it is auditable.
- Safety rails: never merge a PR (the auto-merge engine does that per repo settings); never act on an item carrying hold; never grant org membership, secrets or permissions (always the owner); leave an item untouched when the question is a policy or scope change to the hive itself (settings, governance docs, security posture) — post "hive recommends: …; owner to confirm" instead and keep 085.`
@@ -91,12 +91,16 @@ const (
// ActionRecommendOnly posts "hive recommends: …; owner to confirm" and
// keeps the park.
ActionRecommendOnly ActionKind = "recommend-only"
+ // ActionCloseNotNow posts the "not now" reason and closes the issue as
+ // not planned: the established way a declined proposal leaves the
+ // tracker (the dashboard's Won't-fix path).
+ ActionCloseNotNow ActionKind = "close-not-now"
)
// AllowedActions is the allowed set in a fixed order.
var AllowedActions = []ActionKind{
ActionCommentDecision, ActionApproveReview, ActionLabelsAdd, ActionLabelsRemove,
- ActionCloseDuplicate, ActionLink, ActionAdoptSupersede, ActionRecommendOnly,
+ ActionCloseDuplicate, ActionLink, ActionAdoptSupersede, ActionRecommendOnly, ActionCloseNotNow,
}
// Action is one step of a decision.
@@ -123,6 +127,13 @@ const (
VerdictAdoptSupersede Verdict = "adopt-supersede"
VerdictRecommendOnly Verdict = "recommend-only"
VerdictRefused Verdict = "refused"
+ // VerdictOperatorAction: not code work — the reporting spoke's owner
+ // acts (re-authenticates, grants, frees disk). The item keeps its park
+ // and never reaches an implementer lane.
+ VerdictOperatorAction Verdict = "operator-action"
+ // VerdictNotNow declines a hive-filed proposal for now: no incident or
+ // recurrence justifies its cost yet; closed as not planned.
+ VerdictNotNow Verdict = "not-now"
)
// Labels the delegate writes or reads.
@@ -137,6 +148,8 @@ const (
LabelTriageAccepted = "triage/accepted"
LabelFlakyTest = "flaky-test"
LabelNeedsDecision = "stage/085-needs-decision"
+ // LabelIssueNeedsDecision is the issue-side park (hivecommons/hive#15021).
+ LabelIssueNeedsDecision = "stage/045-needs-decision"
)
// CompetingPR is another open PR for the same work.
@@ -265,7 +278,7 @@ var (
flakyRE = regexp.MustCompile(`(?i)\b(flak(?:y|e|iness)|intermittent(?:ly)? fail\w*|non-?deterministic test)\b`)
ratchetRE = regexp.MustCompile(`(?i)\b(actionlint|ratchet|duplication (?:gate|threshold|check)|link[- ]?checker|allow-?list|lint gate|hygiene gate|shellcheck|yamllint|markdownlint)\b`)
proposalRE = regexp.MustCompile(`(?i)\bacceptance criteria\b`)
- hivePolicyRE = regexp.MustCompile(`(?i)\b(hive\.ya?ml|governance|security posture|hive (?:settings?|config(?:uration)?|policy|policies)|branch protection|CODEOWNERS|required checks?|autonomy level|acmm level)\b`)
+ hivePolicyRE = regexp.MustCompile(`(?i)\b(hive\.ya?ml|governance|security posture|hive (?:settings?|config(?:uration)?|policy|policies)|branch protection|CODEOWNERS|required checks?|autonomy level|acmm level|issue[_ ]filter|hive-filed|unacknowledged proposals?)\b`)
// appPermissionRE preserves the park for App permissions that have no
// specific capability kind in the blocker ledger, and for free-text
// workflow headlines ("the App cannot push workflows") that name no
@@ -280,6 +293,7 @@ const (
labelKindProposal = "kind/proposal"
labelProposal = "proposal"
labelRFC = "rfc"
+ labelKindDesign = "kind/design"
labelGovernance = "governance"
labelFlaky = "flaky"
labelSizeXS = "size/xs"
@@ -395,8 +409,16 @@ func ownerOnlyDecision(in Input, rationale string) Decision {
func decideIssue(in Input) Decision {
ref := "#" + strconv.Itoa(in.Number)
+ // A self-report whose remedy is the spoke operator's comes first: its
+ // body names tokens and credentials, which would otherwise read as an
+ // owner-only secrets item and hold it forever.
+ if sr, ok := ParseSelfReport(in.Title, in.Body); ok {
+ if remedy, ops := selfreportOpsClass(sr.Class); ops {
+ return operatorActionDecision(sr, remedy)
+ }
+ }
if HivePolicyChange(in) {
- return recommendOnly("hive-policy", "this changes the hive's own policy or scope (settings, governance, security posture); the owner confirms those", "accept the proposal as written with its stated defaults, or close it as won't-fix if it widens the hive's write scope")
+ return recommendOnly("hive-policy", "this changes the hive's own policy or scope (settings, governance, security posture); the owner confirms those", hivePolicyRecommendation(in))
}
if CapabilityGap(in) {
return recommendOnly(RuleCapabilityGap, "the blocker is a missing GitHub App permission; approving a direction would un-park the item only for the same needs-human to be re-applied, so the park stays until the permission changes",
@@ -436,6 +458,15 @@ func decideIssue(in Input) Decision {
d.Verdict = VerdictAcceptProposal
return d
}
+ if IsProposal(in.Title, in.Labels) {
+ if kind, detail, ok := ProposalEvidence(in.Title, in.Body); ok {
+ return approveIssue("proposal-approve-evidence", "approve as proposed: "+detail+", so the cost of the gate is already paid for",
+ "the proposal carries "+kind+" evidence — "+detail+" — which is what justifies a new gate")
+ }
+ if hiveFiled(in) {
+ return notNowDecision(ref)
+ }
+ }
d := approveIssue("default-approve", "go with the recommendation; where options remain, take the one that keeps work moving and is reversible",
"no owner rule singles this out; the standing default is the hive's own recommendation")
for _, n := range sortedInts(in.Overlaps) {
@@ -444,6 +475,51 @@ func decideIssue(in Input) Decision {
return d
}
+// hivePolicyRecommendation is the sentence the owner reads on a hive-policy
+// item: a real recommendation, in the owner's terms, not "no rule applies".
+func hivePolicyRecommendation(in Input) string {
+ if in.Kind != KindIssue {
+ return "accept the proposal as written with its stated defaults, or close it as won't-fix if it widens the hive's write scope"
+ }
+ rec := "approve `" + strings.TrimSpace(in.Title) + "` as proposed"
+ lower := strings.ToLower(in.Body)
+ if strings.Contains(lower, "proposal") && (strings.Contains(lower, "acknowledg") || strings.Contains(lower, "approved-direction")) {
+ rec += " — proposals nobody has acknowledged should not be actionable"
+ }
+ if strings.Contains(lower, "opt-in") {
+ rec += "; make it default-on for the lanes it names rather than opt-in"
+ }
+ return rec
+}
+
+// operatorActionDecision answers a self-report whose fix is the spoke
+// owner's: one comment naming who does what, no approved-direction, no
+// implementer, the park kept so the actionable set never sees it.
+func operatorActionDecision(sr SelfReport, remedy string) Decision {
+ text := operatorActionPrefix + sr.OperatorInstruction(remedy)
+ return Decision{
+ Verdict: VerdictOperatorAction, Rule: "selfreport-operator-action", Text: text,
+ Rationale: "the `" + sr.Class + "` self-report is not code work: the remedy is on the reporting spoke, so handing it to an implementer agent only loops back here; it closes itself once the report stops recurring (or `/fixed`)",
+ KeepsPark: true,
+ Actions: []Action{
+ {Kind: ActionLabelsAdd, Labels: []string{LabelNeedsOwner}},
+ {Kind: ActionRecommendOnly, Text: text},
+ },
+ }
+}
+
+// notNowDecision declines a hive-filed proposal that shows neither an
+// incident nor a recurrence: the reason is posted and the issue is closed
+// as not planned, the way a declined proposal leaves the tracker.
+func notNowDecision(ref string) Decision {
+ text := "not now: no incident or recurrence justifies the cost of " + ref + " yet; re-propose with the incident or the repeated instances it would have prevented"
+ return Decision{
+ Verdict: VerdictNotNow, Rule: "proposal-not-now", Text: text,
+ Rationale: "a hive-filed proposal is paid for by evidence; without an incident it would have prevented or a class it would end, the cost is speculative",
+ Actions: []Action{{Kind: ActionCloseNotNow, Text: text}},
+ }
+}
+
func approveIssue(rule, text, rationale string) Decision {
return Decision{
Verdict: VerdictApprove, Rule: rule, Text: text, Rationale: rationale,
diff --git a/src/pkg/delegatedecision/policy_test.go b/src/pkg/delegatedecision/policy_test.go
index 66f10091d2..b4a01ff3e4 100644
--- a/src/pkg/delegatedecision/policy_test.go
+++ b/src/pkg/delegatedecision/policy_test.go
@@ -480,12 +480,12 @@ func TestMarkerAndComment(t *testing.T) {
func TestPolicyTextCoversRules(t *testing.T) {
t.Parallel()
- for _, want := range []string{"Be decisive", "Duplicate of #N", "needs-owner", "ratchets", "supersede mode", "never merge a PR", "owner to confirm", "keep the hive PR open and parked until adequacy is confirmed", "except for the safety rails"} {
+ for _, want := range []string{"Be decisive", "Duplicate of #N", "needs-owner", "ratchets", "supersede mode", "never merge a PR", "owner to confirm", "keep the hive PR open and parked until adequacy is confirmed", "except for the safety rails", "is not code work", "paid for by evidence"} {
if !strings.Contains(PolicyText, want) {
t.Errorf("PolicyText lacks %q", want)
}
}
- if len(AllowedActions) != 8 {
+ if len(AllowedActions) != 9 {
t.Fatalf("allowed set size %d", len(AllowedActions))
}
}