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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fixed-verified-open-supersedes-done.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- `hive/verified-open` and `hive/already-done` no longer stand together. projectbluefin/testsuite#1023 got already-done, then verified-open two hours later, and the inbox offered it as "verified done but could not close". The label relay's verified-open now removes the done labels, a verified already-done removes verified-open, and the issue stage sweep settles issues already wearing both from their label events (the later verdict stands).
4 changes: 4 additions & 0 deletions src/docs/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,8 @@ in exactly one band, while non-winning states remain as badges on the pill:
labels still apply. When the only done evidence is `stage/040-covered-by-pr`
(or a later mirrored PR stage), the ✓ signal reads `covered by an open PR
(stage/040) — check it merged before closing`, not `already done`.
`hive/verified-open` and `hive/already-done` are not worn together for
long: the issue stage sweep keeps the later verdict and removes the other.

Precedence is confirm & close → parked → claimed → needs triage → unclaimed,
so a label that parks an issue beats an assignment and done beats all other display states.
Expand Down Expand Up @@ -837,6 +839,8 @@ hand-merge rule. `hive/verified-open` (the agent found
the work unfinished) cancels `hive/likely-done` for rules (6) and (7) and for
the safety net, so an issue carrying both is neither awaiting the reporter nor
verified done; `hive/already-done` and `hive/covered-by-pr` are unaffected.
An issue does not keep both `hive/verified-open` and `hive/already-done`: the
issue stage sweep keeps the later verdict and removes the other.

**Runs and the approval desk.** Two waits live outside GitHub, so no label
records them. An active run the Runs tab shows as `waiting_on: human` makes the
Expand Down
4 changes: 3 additions & 1 deletion src/docs/github-write-surface.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ One reserved label refuses the whole request — nothing in it is applied — so
batch can never partially land. When the only refused part is removing
`hive/likely-done` or `hive/covered-by-pr` alongside an add of
`hive/verified-open`, the refusal tells the agent to resend the add on its own,
because the hive removes those labels itself. `hive/verified-open`, the one
because the hive removes those labels itself. The same holds for
`hive/already-done`: when the add of `hive/verified-open` lands, the relay
removes `hive/already-done` and `hive/likely-done` from the issue. `hive/verified-open`, the one
`hive/` label an agent may add, is created on the repository first when it does
not exist. The refusal is a policy denial like any other:
`.denied`, a result file naming the labels, and an audit entry. A lane
Expand Down
12 changes: 7 additions & 5 deletions src/docs/labels-and-control-signals/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ Some hive-authored labels look like provenance but are read as signals, so they
| `🐝 covered by PR` (formerly `hive/covered-by-pr`; **retired in favour of `stage/040-covered-by-pr`**, see [Stage labels](stage-labels.md#stage-labels-stagennn--the-pipeline-state-machine); the stage reconciler removes it from open items) | Issues | PR-claim label sync and dashboard | Open PR is verified as related; issue remains actionable. For a closing or branch-name claim Hive also links the PR to the issue via GitHub's `addCloseIssueReferences`, so GitHub's own issue list shows the PR icon ([#11888](https://github.com/hivecommons/hive/issues/11888), [#12091](https://github.com/hivecommons/hive/issues/12091)). A reference claim (`Refs #N`, `Part of #N` — including a branch named after the issue when the body says `Refs #N`) is never linked, because a closing link makes GitHub close the issue when the partial PR merges; if the hive App itself linked such a pair earlier, the next sweep retracts the link with `removeCloseIssueReferences`, while links made by a person are left in place and logged ([#12144](https://github.com/hivecommons/hive/issues/12144)). The dashboard's own `🔗` pill does not depend on the GitHub link. Labels are synced only for actionable issues, so stale labels can remain on held/exempt/filtered issues. | Display-only | Hive | Claim sync after enumeration | Hive removes when actionable issue no longer has open PR evidence | Fixed label (`src/pkg/github/prclaims.go:1380-1435`) |
| `hive/likely-done` | Issues | PR-claim label sync and dashboard | Merged PR is verified as related while issue remains open; issue remains actionable until GitHub/operator closes or confirms. Requires a closing keyword or branch-name claim: a merged `Refs #N` / `Part of #N` applies `hive/partially-addressed` instead ([#12383](https://github.com/hivecommons/hive/issues/12383)). | Display-only | Hive | Claim sync after enumeration | Hive removes when actionable evidence no longer says likely done | Fixed label (`src/pkg/github/prclaims.go`) |
| `hive/partially-addressed` | Issues | Close-on-merge sweep, PR-claim label sync and task-list sweep | A merged PR covered only part of the issue ([#11931](https://github.com/hivecommons/hive/issues/11931)): applied instead of `hive/likely-done` when the PR has no closing keyword (`Fixes`/`Closes`/`Resolves #N`) for the issue (a `Refs #N`-only PR leaves the issue open on merge; a body that adds `Closes #N` to a partial `Refs #N` note is refused by every merge lane with `closing-contradiction:#N` until one of the two is dropped, [#15025](https://github.com/hivecommons/hive/issues/15025)), its body carries a remainder/out-of-scope paragraph, or none of the backtick-quoted paths cited in the issue body is among its changed files. No `/fixed` prompt is posted, `hive/likely-done` is suppressed, and the issue stays in the actionable pool; the `<!-- hive:task-list-sweep -->` comment lists the cited paths no merged PR changed as `Not yet touched: ...`. | Display; suppresses likely-done | Hive | Close-on-merge sweep for issues behind a confirmation gate | Hive removes it when a later merged PR fully covers the issue and `hive/likely-done` is applied; humans may remove it | Fixed label (`src/pkg/github/close_on_merge.go`, `src/pkg/github/task_list_sweep.go`) |
| `hive/verified-open` | Issues | Verify-once kick path, PR-claim label sync and close-on-merge | A `hive/likely-done` / already-done claim from a merged PR was checked and the issue is NOT finished ([#11931](https://github.com/hivecommons/hive/issues/11931)): the agent that verified it labels the issue (`src/pkg/scheduler/kickmessage.go` "verify once" instruction) so later kicks say "already verified — implement the rest" and the claim sync never re-applies `hive/likely-done` from the same stale claim (`src/pkg/github/prclaims.go`). Merged-PR evidence, orthogonal to the stage: the issue keeps moving `010 → 020 → 030 → 040` as new work starts. | Suppresses likely-done; kick wording | Agent (verify-once kick) / Hive | Verify-once kick, claim sync | Human removes when the issue is really done, or close-on-merge closes the issue | Fixed label (`src/pkg/github/prclaims.go` `VerifiedOpenLabel`, `src/cmd/hive/verifyonce.go`) |
| `hive/already-done` | Issues | Contributor queue, already-done verdict close path, and dashboard | Contributor already-done verdict/confirmation; default contributor skip label and done band. When the verdict cites a PR that the API verifies as merged on the default branch, Hive labels the issue and runs the normal completed close path; human-filed bugs close too unless `hive: needs-confirmation` or `issues.reporter_confirmation` opted into the reporter gate. A verdict that cites no PR/commit, or whose citation fails verification, is never labelled: Hive comments that the contributor reports it may be resolved and holds it from offers for `hub.contribute_already_done_hold_days`. | Contributor hard skip; dashboard display; conditional close | Hive/contributor flow | Contributor admission, verified verdict settlement, issue close gate | Human removes/reopens or confirms reporter-gated bugs | `hub.contribute_already_done_label`, fixed label (`src/pkg/config/hub_config.go:196-208`, `src/pkg/config/defaults.go:275-289`, `src/pkg/dashboard/contribute_verdict_settle.go`, `src/pkg/github/issue_close.go`) |
| `hive/verified-open` | Issues | Verify-once kick path, PR-claim label sync and close-on-merge, label relay and issue stage sweep | A `hive/likely-done` / already-done claim from a merged PR was checked and the issue is NOT finished ([#11931](https://github.com/hivecommons/hive/issues/11931)): the agent that verified it labels the issue (`src/pkg/scheduler/kickmessage.go` "verify once" instruction) so later kicks say "already verified — implement the rest" and the claim sync never re-applies `hive/likely-done` from the same stale claim (`src/pkg/github/prclaims.go`). Merged-PR evidence, orthogonal to the stage: the issue keeps moving `010 → 020 → 030 → 040` as new work starts. | Suppresses likely-done; kick wording | Agent (verify-once kick) / Hive | Verify-once kick, claim sync, label relay add, issue stage sweep | Human removes when the issue is really done, or close-on-merge closes the issue; a later verified `hive/already-done` removes it, and the issue stage sweep keeps the later of the two verdicts | Fixed label (`src/pkg/github/prclaims.go` `VerifiedOpenLabel`, `src/cmd/hive/verifyonce.go`) |
| `hive/already-done` | Issues | Contributor queue, already-done verdict close path, and dashboard | Contributor already-done verdict/confirmation; default contributor skip label and done band. When the verdict cites a PR that the API verifies as merged on the default branch, Hive labels the issue and runs the normal completed close path; human-filed bugs close too unless `hive: needs-confirmation` or `issues.reporter_confirmation` opted into the reporter gate. A verdict that cites no PR/commit, or whose citation fails verification, is never labelled: Hive comments that the contributor reports it may be resolved and holds it from offers for `hub.contribute_already_done_hold_days`. | Contributor hard skip; dashboard display; conditional close | Hive/contributor flow | Contributor admission, verified verdict settlement, issue close gate | Human removes/reopens or confirms reporter-gated bugs; a later `hive/verified-open` (label relay) removes it, and the issue stage sweep keeps the later of the two verdicts | `hub.contribute_already_done_label`, fixed label (`src/pkg/config/hub_config.go:196-208`, `src/pkg/config/defaults.go:275-289`, `src/pkg/dashboard/contribute_verdict_settle.go`, `src/pkg/github/issue_close.go`) |
| `blocked` | Issues | Contributor queue, dashboard issue bands, un-park sweep | Excluded from agent enumeration, automated claims and contributor offers; shown in the waiting band. A contributor verdict naming an open blocker records a native issue dependency or `<!-- hive:blocked-on pr=owner/repo#N -->` marker ([#15023](https://github.com/hivecommons/hive/issues/15023)); a verdict requiring a person uses `needs-human` instead. | Hard suppress | Human, or Hive App on a contributor blocked verdict | Contributor admission/dashboard render | Follow the [blocked reference](#blocked): human-applied or re-applied blocks are not automatically lifted. Marker-less review-backlog cleanup does not lift contributor-verdict blocks. | `hub.contribute_skip_labels`, dashboard bands (`src/pkg/config/hub_config.go:136-155`, `src/pkg/config/hub_config.go:469-492`, `src/docs/dashboard.md:105-140`) |
| `needs-direction` (retired) | Issues | Issue stage reconciler (migration only) | Retired ([#12683](https://github.com/hivecommons/hive/issues/12683)): nothing writes it. `stage/045-needs-decision` is the single "issue parked for a maintainer ruling" signal (owner decision: `stage/085-needs-decision` is PR-only). An open issue still carrying it is read as parked (same hard suppress, same un-park), the issue stage reconciler adds `stage/045-needs-decision` and then removes the retired label, and the label definition is deleted from the repo once no open item carries it. The scanner's "needs-direction (scanner): …" comment may remain as the explanation text accompanying the 045 transition — no label. | Hard suppress until migrated | — (legacy) | Issue stage reconciler | Migrated to `stage/045-needs-decision` (`src/pkg/github/legacy_decision_labels.go`) | Fixed legacy spelling (`src/pkg/config/issue_filter.go`) |
| `needs-decision` (retired) | Issues, PRs | Issue stage reconciler (migration only); PR lanes read it as a hold modifier until gone | Retired ([#12683](https://github.com/hivecommons/hive/issues/12683)): nothing writes it. The relay's `hive-open-issue --needs-decision` and the configured `project.issue_filter.hard_suppress_labels.needs_decision` / `hub.contribute_needs_decision_label` now default to `stage/045-needs-decision`; a configured legacy spelling (or `stage/085-needs-decision`) is upgraded. Migration as for `needs-direction`. | Hard suppress until migrated | — (legacy) | Issue stage reconciler | Migrated to `stage/045-needs-decision` (`src/pkg/github/legacy_decision_labels.go`) | `hub.contribute_needs_decision_label` (`src/pkg/config/hub_config.go`, `src/pkg/config/issue_filter.go`) |
Expand Down Expand Up @@ -650,11 +650,13 @@ A merged PR covered only part of the issue ([#11931](https://github.com/hivecomm

A `hive/likely-done` / already-done claim from a merged PR was checked and the issue is NOT finished ([#11931](https://github.com/hivecommons/hive/issues/11931)): the agent that verified it labels the issue (`src/pkg/scheduler/kickmessage.go` "verify once" instruction) so later kicks say "already verified — implement the rest" and the claim sync never re-applies `hive/likely-done` from the same stale claim (`src/pkg/github/prclaims.go`). Merged-PR evidence, orthogonal to the stage: the issue keeps moving `010 → 020 → 030 → 040` as new work starts.

The two verdicts never stand together. When the label relay adds `hive/verified-open` it removes `hive/already-done` and `hive/likely-done`, and a contributor's verified already-done removes `hive/verified-open`. An issue that already wears both (projectbluefin/testsuite#1023: already-done at 01:47Z, verified-open at 03:13Z) is settled by the issue stage sweep from the issue's label events: the later add stands and the other label comes off, through the write-back gate (`src/pkg/github/done_verdict_labels.go`). Only the default `hive/already-done` spelling is reconciled, not a renamed `hub.contribute_already_done_label`.

**Who applies it:** Agent (verify-once kick) / Hive.

**Checked by:** Verify-once kick path, PR-claim label sync and close-on-merge. **When:** Verify-once kick, claim sync.
**Checked by:** Verify-once kick path, PR-claim label sync, close-on-merge, the label relay and the issue stage sweep. **When:** Verify-once kick, claim sync, the relay's add, every issue stage sweep.

**Release or override.** Human removes when the issue is really done, or close-on-merge closes the issue
**Release or override.** Human removes when the issue is really done, or close-on-merge closes the issue. A later verified `hive/already-done` removes it, and the issue stage sweep keeps the later of the two verdicts when both are worn

**Configuration and implementation.** Fixed label (`src/pkg/github/prclaims.go` `VerifiedOpenLabel`, `src/cmd/hive/verifyonce.go`)

Expand All @@ -668,7 +670,7 @@ Contributor already-done verdict/confirmation; default contributor skip label an

**Checked by:** Contributor queue, already-done verdict close path, and dashboard. **When:** Contributor admission, verified verdict settlement, issue close gate.

**Release or override.** Human removes/reopens or confirms reporter-gated bugs
**Release or override.** Human removes/reopens or confirms reporter-gated bugs. A later `hive/verified-open` (label relay) removes it, and the issue stage sweep keeps the later of the two verdicts when both are worn

**Configuration and implementation.** `hub.contribute_already_done_label`, fixed label (`src/pkg/config/hub_config.go:253-259,422-430`, `src/pkg/dashboard/contribute_verdict_settle.go`, `src/pkg/github/issue_close.go`)

Expand Down
4 changes: 4 additions & 0 deletions src/pkg/dashboard/contribute_verdict_settle.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ func (h *ContributeWSHub) markAlreadyDoneIssue(ctx context.Context, repo string,
if err := h.server.deps.GHClient.AddLabels(ctx, repo, number, []string{label}); err != nil {
return err
}
// A verified already-done supersedes an earlier hive/verified-open, so
// the issue never wears both verdicts.
// Best-effort: the stage sweep settles a pair left behind.
_ = h.server.deps.GHClient.RemoveLabelsFresh(ctx, repo, number, ghpkg.VerifiedOpenLabel) // writeback:solicited the contributor's verified already-done verdict
if !closeIssue {
return nil
}
Expand Down
26 changes: 26 additions & 0 deletions src/pkg/dashboard/contribute_verdict_settle_ghclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type settleGHFixture struct {
existingComments []string
commentsListErr bool
issueLabels []string
labelsRemoved []string
}

func (f *settleGHFixture) server(t *testing.T) *httptest.Server {
Expand Down Expand Up @@ -104,6 +105,15 @@ func (f *settleGHFixture) server(t *testing.T) *httptest.Server {
}
_ = json.NewEncoder(w).Encode(map[string]any{"number": 7, "state": "closed"})
case r.Method == http.MethodDelete && strings.HasPrefix(r.URL.Path, "/repos/o/r/issues/7/labels/"):
name := strings.TrimPrefix(r.URL.Path, "/repos/o/r/issues/7/labels/")
for i, l := range f.issueLabels {
if strings.EqualFold(l, name) {
f.issueLabels = append(f.issueLabels[:i], f.issueLabels[i+1:]...)
f.labelsRemoved = append(f.labelsRemoved, name)
_ = json.NewEncoder(w).Encode([]map[string]any{})
return
}
}
w.WriteHeader(http.StatusNotFound)
_ = json.NewEncoder(w).Encode(map[string]any{"message": "Not Found"})
default:
Expand Down Expand Up @@ -521,3 +531,19 @@ func TestVerdictSettleGH_ContextCancelledDuringVerifyIsUnverified(t *testing.T)
t.Fatalf("non-already-done disposition = %q, want empty", got)
}
}

// projectbluefin/testsuite#1023: a verified already-done takes an earlier
// hive/verified-open off, so the issue never wears both verdicts.
func TestVerdictSettleGH_MarkAlreadyDone_RemovesVerifiedOpen(t *testing.T) {
fx := &settleGHFixture{issueLabels: []string{"kind/bug", ghpkg.VerifiedOpenLabel}}
hub, _ := settleGHHub(t, fx)
claim := ghpkg.IssueClaim{PRNumber: 41, PRURL: "https://github.com/o/r/pull/41", MergedPR: true}
if err := hub.markAlreadyDoneIssue(context.Background(), "o/r", 7, claim, "danathar", false); err != nil {
t.Fatalf("markAlreadyDoneIssue: %v", err)
}
fx.mu.Lock()
defer fx.mu.Unlock()
if len(fx.labelsRemoved) != 1 || fx.labelsRemoved[0] != ghpkg.VerifiedOpenLabel {
t.Fatalf("labels removed = %v, want hive/verified-open", fx.labelsRemoved)
}
}
Loading
Loading