Skip to content

πŸ› stage: the 085 needs-decision comment always names a cause - #18669

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/needs-decision-empty-reasons
Nov 17, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/needs-decision-empty-reasons

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

The stage/085-needs-decision comment could say "Needs a decision, not a merge:" and then nothing, so nobody could tell what they were being asked to decide. This PR finds the route that produced the empty note and makes it carry the reviewer's reason. It also guarantees the note always names a cause.

What happened (projectbluefin/fsdk-containers#553, times Eastern)

At 1:28 PM on 11-16, knuckle (build afb7da6) moved #553 from 072 to 085 and posted comment 6925329114:

Needs a decision, not a merge:

<sub>Clear the cause and the hive re-evaluates on its next pass; …</sub>

The hive log shows the cause:

  • stage labels reconciled … wanted 085-needs-decision, reason contributor-lane:decision-requested at 1:28:55. One second later, entry comment posted … "reasons": null.
  • The stage pass's own read of the verdict for head 0afe7c60 had been requires_human, with decision_finding "the reviewer marked this change high-risk", since 1:21 PM.
  • In every pass from 1:15 to 1:30, the contributor lane logged automerge skip … reason contributor-lane:no-verdict.

That is the mismatch:

  1. The 085 route is built from the contributor lane's verdict cache (humanEvidence, through contributorLaneVerdictFor), and that cache had no verdict for the head. So RouteHuman did not return an 085 route.
  2. The stage record already said 085 for this head. So preserveNeedsDecisionOnSameHead re-parked the PR there with stagelabels.Route{Stage: NeedsDecision} and no reasons.
  3. DecisionComment rendered : followed by an empty list.

The same bare-route re-park is still on v6 at automerge_stage_labels.go:1461.

The note was never updated: updated_at equals created_at. A note posted with no recorded cause counts as already explained, and the same decision key short-circuits the rewrite.

No existing issue covers this. #13137 (closed) was about a note going stale when the cause changes on the same head. #16407 keyed the comment on the decision.

What changed

  • The same-head re-park names the reviewer's reasons.
    • New sameHeadDecisionRoute(obs) builds the re-park's route from the stage pass's own verdict: the requires_human verdict, the finding, and the question (or, without one, the reviewer's human-facing summaries).
    • It also fills Head, Verdict, SelfAuthored and holds, so the "how to answer" actions match a normal 085 note.
    • With no verdict known for the head, the route stays empty and the fallback below applies.
  • One wording. stagelabels.RequiresHumanReasons is the reason block moved out of routeProgress, unchanged. RouteHuman and the re-park both use it.
  • The shared-CI permission park carries its cause. The other bare 085 route (automerge_stage_labels.go:1452) now uses decisionCause(obs.Reason) as its reason, the same prose the human route gives for that reason.
  • Safety net.
    • DecisionComment with no reasons renders "Needs a decision, not a merge: the reviewer asked for a human decision." That is the wording stage-labels.md already shows for this note. One reason and several reasons render exactly as before.
    • postHumanEntry logs a warning naming the repo, PR, head, lane reason and lane whenever it is about to post or rewrite an 085 note with no reasons, so any other empty route can be found.
  • Docs and changelog. A paragraph in stage-labels.md and changelog.d/fixed-needs-decision-empty-reasons.md.

Not included: rewriting notes already posted empty

A note already posted with no reason is not rewritten in place. Detecting it would need a new stage-store field, because such a posting records no cause and the same decision key short-circuits the rewrite. I left that out to keep the store schema unchanged. New notes from this path will name the cause. The existing note on #553 stays as it is until its head changes.

Tests

CI on a draft test PR in my fork (base: a copy of v6 at 3b221dde0): v2 Tests (the full Go suite) and v2 CI passed, along with 58 other checks: Danathar#2. The only failure there, verify PR contents, is the fork being unable to pull the private verifier image (403). It is not a code result.

  • TestDecisionCommentReasonList (stagelabels): zero reasons render the fallback sentence and never an empty list; one reason is inline; several reasons are a list, exactly as before.
  • TestRequiresHumanReasons (stagelabels): the shared wording, and RouteHuman producing exactly those reasons for a requires_human verdict with a finding and a question.
  • TestSameHeadDecisionRouteNamesReviewerFinding (automerge):

Locally I ran gofmt -l only, as AGENTS.md requires.

Out of scope

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

A PR the stage pass held at 085 on the same head was re-parked with a
bare route when the lane's own human route came back without a decision:
on projectbluefin/fsdk-containers#553 the contributor lane's verdict cache
read no verdict while the stage pass held requires_human with the finding
"the reviewer marked this change high-risk", and DecisionComment rendered
"Needs a decision, not a merge:" over an empty list.

- preserveNeedsDecisionOnSameHead's re-park now builds its route from the
  stage pass's verdict (sameHeadDecisionRoute): the requires_human
  verdict, the finding, and the question or summaries, in the wording
  RouteHuman uses (stagelabels.RequiresHumanReasons).
- The shared-CI permission park carries its decision cause as the reason.
- DecisionComment never renders an empty list: a route with no reasons
  names DecisionReasonUnnamed ("the reviewer asked for a human
  decision"), and postHumanEntry logs a warning naming the PR and head.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
@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 nicholasjackson 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

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 17, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 4ab9ba0 into hivecommons:v6 Nov 17, 2026
81 of 82 checks passed
@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.

Evidence bundle `#1866950375dd` sha256:3be6419ef578c087e7908ff6a8f18d506de5fd90f4f0eafdfd2ff78fbb26f086 β€” download from the dashboard or `hivectl review evidence #18669`.

merged by Hive trusted-author auto-merge: author Danathar holds role owner and GitHub permission maintain on repo; CI green at 50375dd.

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