Skip to content

πŸ› contribute: an unverified already-done verdict no longer leaves hive/already-done on the issue - #18836

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/relay-already-done-needs-evidence
Nov 17, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/relay-already-done-needs-evidence

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

When a contributor says an issue is "already resolved" without citing a PR or commit, the contributor relay puts hive/already-done on the issue anyway. Seconds later the hub comments that nothing could be verified, "so it is not labelled hive/already-done", but it leaves the relay's label on. The issue then sits out of the offer queue as if it were verified done, with no maintainer check.

With this change:

  • the relay labels only when the reason cites something verifiable;
  • when the hub's verification fails, it removes a label the hive added during this task. A label a person added stays.

What happened

Seen on projectbluefin/utah-packages#1175 (11-16, Eastern time):

  • 11:46 AM: the issue was assigned to a contributor.
  • 11:49:55 AM: hivecommons-hive[bot] added hive/already-done. This was the relay, using the task credential.
  • 11:50:07 AM: the hub logged a no_work_needed verdict with reason "external mirror outage already resolved (HTTP 200". The reason has no PR and no SHA.
  • 11:50:11 AM: the hive commented "…cited no PR or commit the hive could verify, so it is not labelled hive/already-done."
  • The label is still on the issue.

The docs promise the opposite (contributor-relay.md, already-done label row): "A verdict with no cited PR/commit, or one that fails verification, never gets this label."

Cause

  • Relay: markIssueAlreadyDone runs whenever isAlreadyDoneNoWork is true. That only needs the reason to match ALREADY_DONE_TEXT_RE ("already resolved", "no-op", …). Its only other check is for open sub-issues.
  • Hub: πŸ› fix(contribute): already-done label needs verified evidenceΒ #14179 made the hub refuse the label without verified evidence (markAlreadyDoneUnverified / noteAlreadyDoneUnverified). It changed only the hub, so it never stops the relay from applying the label, and the hub's unverified path posts the comment and books the hold without removing it.

What changed

Relay (bin/contributor-relay.js)

  • New alreadyDoneCitesRef(reason). It is true when the reason carries:
    • the existing structured evidence (merged PR #N or a commit SHA), or
    • a bare #N, or
    • a pull-request URL.
  • markIssueAlreadyDone returns early without one, before any GitHub read. It logs one line saying why.
  • A reason that cites something still labels exactly as before, and the hub still verifies it.

Hub

  • New Client.RemoveHiveLabelAddedSince (pkg/github/done_verdict_labels.go). It removes the label only when all of these hold:

    • the issue wears it;
    • its latest labeled event is by one of the hive's own identities (IsHiveAuthorLogin);
    • that event is at or after the dispatch time.

    It reads issue events only when the label is present. A zero dispatch time removes nothing. The removal goes through RemoveLabelsFresh with a // writeback:solicited note.

  • markAlreadyDoneUnverified now takes the task's dispatch time. It removes the label before posting the comment, so the hold is still booked after the hive's own activity, as before.

  • The verified path (markAlreadyDoneIssue), the hold length and the comment wording are unchanged. The wording is now true.

Docs and changelog

  • The contributor-relay.md already-done row now says what each side does.
  • A changelog fragment.

Not in this PR

Tests

  • bin/contributor-relay.test.js:

    • "already resolved (HTTP 200)" makes no GitHub call and logs why;
    • a commit SHA, merged PR #532 and a /pull/532 URL still label;
    • the existing already-done tests (bare #12, sub-issue guards) are unchanged and pass.
  • contribute_verdict_settle_ghclient_test.go: the unverified path, run through the real GitHub client:

    • removes a label the hive App added after dispatch;
    • keeps one a person added;
    • keeps one the hive added before the task;
    • keeps one a person re-added after the hive;
    • removes nothing without a dispatch time.

    All cases still post the unverified comment and add no label.

  • Existing callers of markAlreadyDoneUnverified in the tests now pass a zero dispatch time.

I ran the full relay test file locally on node 26. It has 78 failures, the same 78 as on clean v6, all environment-related; every already-done test passes. Only gofmt -l was run for Go (AGENTS.md bans local go test/go build/go vet). CI is the test run.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

… label on

The relay applied hive/already-done on reason text alone; the hub then
commented that nothing could be verified and the issue is not labelled,
but left the relay's label on (projectbluefin/utah-packages#1175).

Relay: markIssueAlreadyDone labels only when the reason cites a PR, a PR
URL or a commit. Hub: the unverified path removes a hive/already-done the
hive added since the task was dispatched; a person's label stays.

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 17, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hanthor for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v6

Conflicts are checked with every PR merged onto the current tip of v6, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#18844 πŸ› contribute: open the contributor's PR against upstream, and say so when it lands in the fork same files bin/contributor-relay.js
bin/contributor-relay.test.js
src/docs/contributor-relay.md
#18841 πŸ› contribute: offer wrong_base only with a vN base; a park keeps the agent's reason same files src/docs/contributor-relay.md

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style review at 9669f02: approve. Conventions followed; one advisory note on duplicated event-pagination code (inline).

β€” hive: agent=adjudicator-4 backend=claude model=claude-sonnet-5-5 claude=2.1.326

events, resp, err := c.client.Issues.ListIssueEvents(ctx, owner, name, number, opts)
if err != nil {
return false, err
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Advisory (style): this paginated ListIssueEvents loop duplicates latestLabeledAt earlier in this file (lines 66-84), and the label-presence scan above it duplicates issueHasLabel. Consider a shared helper such as latestLabeledBy(ctx, owner, name, number, label) (at time.Time, actor string, err error) that both callers use. Not blocking.

@hivecommons-hive

hivecommons-hive Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

Review findings from adjudicator-5 (folded here because this head already carries its hive review):

Docs-currency: the contributor-relay.md row and changelog fragment match the new behavior. One advisory wording fix (inline): the row should mention that a bare #N also counts as a citation for the relay. No blockers.

Findings not on a changed line

  • src/docs/contributor-relay.md:1226: The relay's gate (alreadyDoneCitesRef, bin/contributor-relay.js:6994-6997) also accepts a bare #N, but this row says it skips the label when the reason cites "no PR, PR URL or commit". A reason like already fixed, see #12 is labelled by the relay (the PR's own test keeps bare #12 labelling), and the hub then removes the label if #12 does not verify. Suggested wording:
    Label applied when a `no_work_needed` verdict is marked `verdict_reason_kind: "already_done"` (or legacy text such as `merged PR #123 already resolves this`) and the cited PR verifies as merged. A verdict with no cited PR/commit, or one that fails verification, never keeps this label: the relay applies it only when the reason names a merged PR, a commit SHA, a `#N` reference or a pull-request URL, and when the hub's verification fails it removes a label the hive added since the task was dispatched (a label a person added stays). Neither does an issue that has open sub-issues: the relay reads the issue's `sub_issues_summary` with the task credential before it labels and skips the label when a sub-issue is open or the read fails, and the hub checks again before it labels or closes. Default `hive/already-done`, which is also in the default contribute skip labels so it stays out of the offer queue until a maintainer removes it.
    

Review findings from adjudicator-3 (folded here because this head already carries its hive review):

Intent alignment: the diff does what the title and body say. The relay now labels only when the reason cites a ref (bin/contributor-relay.js:6988-6997, :8677-8682). The hub removes a hive-added label on the unverified path (src/pkg/github/done_verdict_labels.go:93-136, contribute_verdict_settle.go:242-273). I found no scope creep.

One advisory gap, not blocking. alreadyDoneCitesRef accepts a bare #N, so the relay labels on any #N citation. The hub only calls markAlreadyDoneUnverified, and so only removes the label, on the unverified paths. Other settle outcomes return without removing it, and these are the ones I read:

  • An open PR by someone other than the reporter settles as a weak claim and returns verdictDispositionAlreadyDoneVerified (contribute_verdict_settle.go, the alreadyDone branch after RecordIssueClaim). The relay's label stays even though nothing merged.
  • The verdictHeldForOpenChildren early return (same file) also leaves the label. The relay's own sub-issue check makes that path unlikely.

The docs row now says a verdict that fails verification never gets the label. That is slightly stronger than the code for the open-PR case. If you want to close it, remove the label in the non-merged branch with the same RemoveHiveLabelAddedSince call. Otherwise narrow the docs wording to say the hub removes the label only when verification fails.

Evidence bundle `#188369669f02` sha256:243d6b846d990cbfb10510c1d9f1451a8ec9a435cb760429d596ee3e716e5a93 β€” download from the dashboard or `hivectl review evidence #18836`.

@hivecommons-hive
hivecommons-hive Bot merged commit fee3ad9 into hivecommons:v6 Nov 17, 2026
83 of 84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant