Skip to content

πŸ› fix(unpark): a re-parked owner step recommends /hive done, not the /hive approve that looped - #17010

Merged
hivecommons-hive[bot] merged 2 commits into
hivecommons:v6from
Danathar:fix/owner-step-menu-recommends-done
Nov 7, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
hivecommons:v6from
Danathar:fix/owner-step-menu-recommends-done

Conversation

@Danathar

@Danathar Danathar commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Summary

When an agent parks an issue again on the same owner-only step after the owner's /hive approve, the "What to reply" notice now recommends /hive done and stops offering /hive approve. Before this change it kept recommending /hive approve off the issue body's old "Recommendation" heading. Following that advice un-parked the issue, the agent parked it again, and the loop repeated. A second /hive approve on such a step now gets a reply that points at /hive done, and the issue stays parked. Lane policies now also ask agents to give every gh command they hand the owner -R <owner/repo>, so the command works outside a clone of the repo.

What went wrong

Danathar/goodreads-mcp#443 (on a private hive, build older than v6; the code path below is unchanged on v6 tip f7acdbf5d):

  1. The architect filed a release owner step (<!-- hive:owner-step kind=release tag=2026.11.0 target=e22b3b0… -->). Its body has a ## Recommendation heading with the release command.
  2. The owner replied /hive approve (01:20:58Z). The hive un-parked it with "go with the recommendation" (01:25:50Z).
  3. The architect parked it again on the same marker (02:02:04Z): approving did not start the release; "Run the command below, then reply /hive done."
  4. The new notice (02:05:51Z) still listed /hive approve β†’ go with the recommendation (recommended), with /hive done unmarked.

The cause is in unparkMenuFor (src/pkg/github/issue_unpark_menu.go:95-170@f7acdbf5d). The body's recommendation becomes recommendationSource (line 104). An accepted reply clears the owner step (lines 112-116) but not the recommendation. The re-park comment says nothing about a recommendation, so the body's survives, and replies() bolds /hive approve for it (line 246). /hive done is always added unbolded (line 218). On an owner step, /hive approve skips the "nothing to accept" check (issue_unpark_command.go:605@f7acdbf5d), so each approve un-parked the issue again.

The owner-step command (gh workflow run release.yml --ref main) is agent prose. The hive only appends the marker (issue_owner_step.go:143, issue_unpark_menu.go:409@f7acdbf5d). The lane policies' owner-only park rule (for example src/pkg/policies/defaults/architect-full.md:36-41@f7acdbf5d) never asked for -R.

What changes

  • Re-parks start fresh. An owner step parked again after an accepted reply is read from its own text. The options and recommendation that reply answered no longer carry over.
  • /hive done is recommended when the owner-step text asks for /hive done, or when an accepted /hive approve already answered the same step (same marker). In those cases /hive approve is never bolded.
  • /hive approve is dropped from the notice for a step it already answered. A second /hive approve there gets a new reply pointing at /hive done, and the issue stays parked. It goes through the existing postUnparkReply site, so there is no new write site.
  • To tell whether an accepted reply answered an approve, the hive reads the command comment its reply marker names. The marker parse is now a small shared helper, unparkReplyAnsweredID.
  • Policies: the owner-only park rule in all 19 lanes that park, and the bead-only "Owner-only steps" rule in 5 lanes, now ask for -R <owner/repo> on each gh command, or the web path (Actions β†’ workflow β†’ Run workflow). Both policy copies are updated (src/pkg/policies/defaults and src/policies).
  • The release-on-approve path (release_on_approve: true) is unchanged.

Also checked

  • /hive done is a real un-park command on v6: parseUnparkCommand (issue_unpark_command.go:1293@f7acdbf5d), recorded with unparkCommandDecisionText.
  • The PR-side "Your move" section (pkg/github/pr_reply_options.go) doesn't use the issue menu, and offers neither /hive done nor a recommended /hive approve. It needs no change.

Files

  • src/pkg/github/issue_unpark_menu.go: menu reading and reply ordering, plus the new reply text.
  • src/pkg/github/issue_unpark_command.go: refusal of a repeat approve; the shared marker-ID helper.
  • src/pkg/policies/defaults/*.md and src/policies/*.md: -R rule.
  • src/docs/maintainer-commands.md, changelog.d/fixed-owner-step-menu-recommends-done.md.

Tests

  • TestUnparkMenuReparkedOwnerStepRecommendsDone: the Add knowledge promoter for cross-layer fact promotionΒ #443 shape recommends /hive done and offers no /hive approve. Also covers a re-park that doesn't mention done, a different step, an answered /hive decision, and a body that asks for done.
  • TestSweepIssueUnparkReapproveOnAnsweredOwnerStepStaysParked: a second approve is refused and nothing is un-parked.
  • TestLanePoliciesParkOwnerOnlyHandOffs now requires the -R <owner/repo> rule.
  • All three fail on f7acdbf5d and pass with this change. Two assertions in issue_unpark_notice_last_test.go now expect /hive done bolded, because those owner steps ask for it.
  • Full go test of ./pkg/github/ ./pkg/policies/ ./pkg/writeback/ ./pkg/promptsrc/, go vet, and the docs citation and link checks.

Refs Danathar/goodreads-mcp#443

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

…/hive approve that looped

An owner step the hive parks again after an accepted reply is now read
from its own text, so the issue body's answered recommendation no longer
keeps /hive approve bolded. /hive done is the recommended reply when the
owner-step text asks for it or when an accepted /hive approve already
answered the same step; /hive approve is dropped there, and a second
approve gets a reply pointing at /hive done while the issue stays parked.

Lane policies now ask for -R <owner/repo> (or the web path) on every gh
command handed to the owner, so it works outside a clone.

Refs Danathar/goodreads-mcp#443

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <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 7, 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 clubanderson 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 7, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor
88d389b

ℹ️ Sentinel notice β€” informational; author is trusted (owner), merge is not blocked

Hive flagged this PR (author @Danathar, head 88d389b66b01) because it matches behaviors that can override security controls, escalate privileges or damage the codebase. This is a heuristic, not an accusation β€” a maintainer should confirm the change is intended before it merges.

  • sensitive_path β€” changes 49 sensitive path(s) (Touches a sensitive path (OWNERS, workflows, policies, hive config, security docs, …))
    • src/pkg/policies/defaults/architect-full.md
    • src/pkg/policies/defaults/architect-holdgated.md
    • src/pkg/policies/defaults/ci-maintainer-advisory.md
    • src/pkg/policies/defaults/ci-maintainer-full.md
    • src/pkg/policies/defaults/ci-maintainer-holdgated.md
    • src/pkg/policies/defaults/ci-maintainer.md
    • src/pkg/policies/defaults/guide-full.md
    • src/pkg/policies/defaults/guide-holdgated.md
    • src/pkg/policies/defaults/guide-issues.md
    • src/pkg/policies/defaults/guide.md
    • src/pkg/policies/defaults/outreach-full.md
    • src/pkg/policies/defaults/quality-full.md
    • src/pkg/policies/defaults/quality-holdgated.md
    • src/pkg/policies/defaults/quality-measured.md
    • src/pkg/policies/defaults/scanner-advisory.md
    • src/pkg/policies/defaults/scanner-automerge.md
    • src/pkg/policies/defaults/scanner-full.md
    • src/pkg/policies/defaults/scanner-holdgated.md
    • src/pkg/policies/defaults/scanner-issues.md
    • src/pkg/policies/defaults/scanner.md
    • src/pkg/policies/defaults/sec-check-full.md
    • src/pkg/policies/defaults/sec-check-holdgated.md
    • src/pkg/policies/defaults/strategist-full.md
    • src/pkg/policies/defaults/strategist-holdgated.md
    • src/pkg/policies/needs_decision_filing_test.go
    • src/policies/architect-full.md
    • src/policies/architect-holdgated.md
    • src/policies/ci-maintainer-advisory.md
    • src/policies/ci-maintainer-full.md
    • src/policies/ci-maintainer-holdgated.md
    • src/policies/ci-maintainer.md
    • src/policies/guide-full.md
    • src/policies/guide-holdgated.md
    • src/policies/guide-issues.md
    • src/policies/guide.md
    • src/policies/outreach-full.md
    • src/policies/quality-full.md
    • src/policies/quality-holdgated.md
    • src/policies/quality-measured.md
    • src/policies/scanner-advisory.md
    • src/policies/scanner-automerge.md
    • src/policies/scanner-full.md
    • src/policies/scanner-holdgated.md
    • src/policies/scanner-issues.md
    • src/policies/scanner.md
    • src/policies/sec-check-full.md
    • src/policies/sec-check-holdgated.md
    • src/policies/strategist-full.md
    • src/policies/strategist-holdgated.md

Hive did not add the sentinel-alert label because this author is trusted. The finding remains recorded for audit and the dashboard Security tab; set sentinel.trusted_authors_block: true to require the blocking label for trusted authors too.

@github-actions

github-actions Bot commented Nov 7, 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.

No conflicting open PRs or same-file overlaps were found.

@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.

Read the Go changes against v6 and the surrounding unparkMenuFor / tryUnparkIssue flow. The logic looks correct to me.

What I checked:

  • The new early return in tryUnparkIssue (issue_unpark_command.go:608-615) sits after eligibleUnparkCommand (:576), so an untrusted commenter's /hive approve still never gets a reply. It reuses postUnparkReply, so no new write site.
  • approveAnswered only becomes true when the re-park's marker is byte-identical to the one the accepted approve answered (issue_unpark_menu.go:140-142, :159-161, :207; ownerStepMarkerRE at issue_owner_step.go:21 captures the whole <!-- hive:owner-step … --> tag). A re-park on a different step keeps /hive approve available, which is the conservative side.
  • unparkReplyAnswersApprove resolves the command comment through byID and rejects hive-authored comments and a 0/absent ID (issue_unpark_command.go:1187-1195), so a dashboard release reply (no per-comment marker) correctly does not count as an answered approve.
  • answered is reset on every owner-step-marker comment (issue_unpark_menu.go:214) and the body-level options/recommendation are cleared only on an owner-step re-park after an accepted reply (:208-212); a withdrawn park already cleared them before this change, so the two paths now agree.
  • replies(): addApprove masks recommended whenever doneRecommended() is true, and the m.ownerStep && m.approveAnswered case precedes the recommendation cases, so no path can both drop approve and recommend it.

One note, not a defect: unparkAsksDone (:80-82) is a substring match on /hive done anywhere in the park text. It fits the current park texts, which only mention the command when asking for it; a park that says "do not reply /hive done yet" would still bold it. Cheap to tighten later if that ever shows up.

The 48 policy-file edits are the same -R <owner/repo> paragraph in both policy copies and are declared in the body; TestLanePoliciesParkOwnerOnlyHandOffs pins them.

β€” hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

hivecommons-hive Bot commented Nov 7, 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 reviewer (folded here because this head already carries its hive review):

Style/maintainability review at head 88d389b (read the diff plus issue_unpark_menu.go, issue_unpark_command.go, the new tests and the policy guard). Nothing blocking; two readability notes the author may want to take.

1. unparkMenuFor: the answered comment and the code disagree β€” src/pkg/github/issue_unpark_menu.go:136-139 says answered "is true from an accepted reply until the next owner-step park", but the reset at line 212 (answered = false) sits outside if ownerStep {…}, so any marker-bearing park β€” including a choice park that lists lettered options and is not an owner step per isUnparkOwnerStepText (line 106) β€” clears it. The next reader of this four-variable state machine (ownerStep, pendingStep, approvedStep, answered) will stumble on that. Either tighten the comment to match, or move the reset:

	// pendingStep is the marker of the newest unanswered owner step;
	// approvedStep is the marker of the owner step an accepted `/hive
	// approve` answered. answered is true from an accepted reply until the
	// next park that carries an owner-step marker (owner step or choice).

2. tryUnparkIssue: the approve gate prefix and refusal body are now written twice β€” src/pkg/github/issue_unpark_command.go:608-616 repeats the command.Kind == unparkCommandApprove && !(releasePolicy.enabled && menu.releaseStep != nil) && (!labelDriven || la.enabled) prefix from line 617 verbatim, and the postUnparkReply / result.Replies++ / return true, nil body from lines 621-626. Hoisting the shared prefix keeps the two refusals from drifting:

-	if command.Kind == unparkCommandApprove && !(releasePolicy.enabled && menu.releaseStep != nil) && (!labelDriven || la.enabled) &&
-		menu.ownerStep && menu.approveAnswered {
+	approveHandledHere := command.Kind == unparkCommandApprove && !(releasePolicy.enabled && menu.releaseStep != nil) && (!labelDriven || la.enabled)
+	if approveHandledHere && menu.ownerStep && menu.approveAnswered {
 		if err := c.postUnparkReply(ctx, owner, repo, number, candidate.GetID(), unparkApproveAnsweredReply); err != nil {
 			return false, err
 		}
 		result.Replies++
 		return true, nil
 	}
-	if command.Kind == unparkCommandApprove && !(releasePolicy.enabled && menu.releaseStep != nil) && (!labelDriven || la.enabled) &&
-		!menu.ownerStep && menu.releaseStep == nil && !unparkTextsProposeOwnerStep(issue, comments) && !labelPresent(issueLabelNames(issue.Labels), issueBlockedLabel) {
+	if approveHandledHere &&
+		!menu.ownerStep && menu.releaseStep == nil && !unparkTextsProposeOwnerStep(issue, comments) && !labelPresent(issueLabelNames(issue.Labels), issueBlockedLabel) {

Minor: the bead-only lanes' insert (e.g. src/pkg/policies/defaults/ci-maintainer-advisory.md:126) leaves a ~130-column line in prose that is otherwise hard-wrapped at ~80; worth re-wrapping while you are in there. The 38 "Write every command…" inserts and the policy guard (needs_decision_filing_test.go:58-62) are consistent across both policy copies.

Evidence bundle `#17010a10c702` sha256:f17d22c58cecb1ba006036143f91508b65f367e2931ee7a012cd8eac352005b4 β€” download from the dashboard or `hivectl review evidence #17010`.

@hivecommons-hive
hivecommons-hive Bot merged commit a90cff6 into hivecommons:v6 Nov 7, 2026
67 of 68 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor

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

@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.

Read issue_unpark_menu.go and issue_unpark_command.go at this head against v6, and traced the loop the PR describes. The fix matches the code.

  • The cause is as stated: on v6 an accepted reply clears ownerStep but leaves recommendationSource from the body, so replies() keeps bolding /hive approve, and tryUnparkIssue skips the "nothing to accept" check for owner steps (issue_unpark_command.go:605), so each approve un-parks again.
  • The new refusal is safe against re-looping: unparkApproveAnsweredReply goes out via postUnparkReply (issue_unpark_command.go:1746), whose per-comment marker puts the second approve into answeredUnparkCommentIDs, and the reply body carries no unparkAcceptedMarker, so unparkMenuFor (issue_unpark_menu.go:154) does not misread it as an acceptance on the next pass.
  • unparkReplyAnswersApprove ignores dashboard release replies (no reply marker β†’ ID 0 β†’ nil) and hive-authored command comments, so approveAnswered only fires when a human's /hive approve on the same marker was accepted; a re-park on a different marker starts clean. unparkReplyAnsweredID is a straight extraction of the existing parse, same " " terminator the %d --> marker format produces.
  • The src/pkg/policies/defaults and src/policies copies are byte-identical for the files I diffed, and TestLanePoliciesParkOwnerOnlyHandOffs now enforces the -R <owner/repo> rule.

One behaviour note, not a defect: unparkAsksDone is a substring match on /hive done, so any owner-step text that mentions /hive done as the completion signal now bolds it over /hive approve. The PR says so and updates the two issue_unpark_notice_last_test.go expectations accordingly; it reads as intended.

Looks correct to me.

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

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