Repository navigation
π contribute: offer wrong_base only with a vN base; a park keeps the agent's reason - #18841
Conversation
β¦ent's reason The hub re-dispatches a wrong_base verdict only to a validated vN branch, but the prompt offered the verdict in every repository. In one on main/testing/stable it always parked at 045, and the hub replaced the agent's reason with a fixed string, so the maintainer got nothing to act on (projectbluefin/utah#1272). The prompt now offers wrong_base only when the task has a declared vN base. A park quotes the agent's sanitized reason in its one note (per task), records and logs it, and no longer posts the generic needs-decision question beside it or re-books it as a gate park. The vN-only target vocabulary is unchanged. 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
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkβ
Resolved: no conflicting open PRs or same-file overlaps remain against |
There was a problem hiding this comment.
Read the prompt builder, the park path in contribute_ws.go, and taskBaseBranchForIssue at the PR head. The change looks correct to me: the new %s for wrongBaseHint (contribute_task_prompt.go:659) lines up with the trailing argument (:787) after pushHint at :652, and wrongBaseParked correctly suppresses both the gate-park re-booking and the generic needs-decision question so only one note is posted.
One low-severity gap, on the line: the prompt gate is "non-empty base", while the comment, docs and changelog say "a declared vN base". taskBaseBranchForIssue returns hubBranch verbatim for Hive's own repo, so a non-vN build branch would still be offered wrong_base, which can only park. In practice upstreamBranch() is a release line, so this is mostly a wording/robustness point.
Suggestion (not a defect): the park marker changed from a fixed string to a per-task one, so an issue already carrying an old-style park note can get one more note on its next park.
β hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.326
| wrongBaseHint := "If you cannot tell which branch this work belongs on, do not call the " + | ||
| "issue already done and do not guess a branch: ask with the decision form below, " + | ||
| "naming the branch you would use and why. " | ||
| if strings.TrimSpace(baseBranch) != "" { |
There was a problem hiding this comment.
The gate is baseBranch != "", but the hub only re-dispatches to a vN branch (normalizeWrongBaseTarget). taskBaseBranchForIssue returns the hive's own hubBranch unchecked for hivecommons/hive, so a non-vN build branch would still be offered wrong_base and park. Consider isReleaseLine(strings.ToLower(strings.TrimSpace(baseBranch))) to match the comment and docs.
There was a problem hiding this comment.
Read the diff against the tree at 881b10a (prompt builder, park path, and postNeedsDecisionPark). The prompt split is wired correctly: the new wrongBaseHint is the 4th trailing arg and lands at the 4th %s in buildTaskPromptBodyWithHintsAndIssueRead, after the GH_TOKEN sentence. Sanitising the agent's reason before quoting it in a public comment is also handled.
One gap (medium): the park note replaces a question that retried, with one that does not.
Before this PR a parked wrong_base verdict (verdict becomes needs-decision) also reached postNeedsDecisionPark, which on a failed post hands off to needsDecisionParkNotPosted(...) for a retry. Now handleTaskComplete skips that path (&& !wrongBaseParked, contribute_ws.go ~L4791) and relies solely on parkWrongBaseIssue. That function only does h.logger.Warn(... "could not park invalid target" ...) when parkWrongBase errors (a GitHub 5xx, a rate limit, or an IssueCommentsContain failure). The issue then sits at stage/045-needs-decision with a label and no question, and nothing re-attempts the post.
Suggested fix: on error, call the same needsDecisionParkNotPosted retry path with the wrong-base body, or keep calling the generic poster as a fallback when the wrong-base note fails.
Open question (not a defect): the "Reply /hive decision <your instructions>" line in the new note assumes that command is accepted on these parks. I did not confirm that handler in the tree; worth a maintainer glance.
Otherwise the change reads as correct for its stated goal, and the tests cover both prompt variants and the one-line comment shape.
β hive: agent=reviewer-2 backend=claude model=claude-sonnet-5-5 claude=2.1.326
|
@Danathar this PR is back in your court ( Review asks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Queued in your relay fix queue (13 waiting): fixes are handed out before new work as soon as you have capacity. |
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. Evidence bundle `#18841881b10a` sha256:65e9c49c9001d80d081532bdb022f4fb220920666b02436fa40b49c3fa1fcd41 β download from the dashboard or `hivectl review evidence #18841`.merged by Hive trusted-author auto-merge: author |
Summary
The contributor prompt offered the
wrong_baseverdict in every repository, but the hub re-dispatches only to a validatedvNrelease branch. In a repository whose branches aremain/testing/stable, everywrong_baseverdict therefore parked the issue atstage/045-needs-decision. The hub also replaced the agent's own reason with a fixed sentence ("wrong_base: no valid target release branch was supplied"), so the maintainer was left with nothing to act on.With this change:
wrong_baseonly when the task has a declaredvNbase. Elsewhere, an agent that can't tell where the work belongs asks in the existing decision form.wrong_baseverdict that still parks keeps the agent's words. They're quoted in the park's one note, recorded with the verdict and logged asagent_reason.vN-only target vocabulary is unchanged, and no agent text ever becomes a branch.What happened
wrong_base. utah has novNbranches, so the relay sent no target and the hub loggedverdict_reason "wrong_base: no valid target release branch was supplied".testingpublishesΒ projectbluefin/ghostscript-printer-app#127, 10-23: the same park, in a repository withmainandstablebranches.Cause
contribute_task_prompt.gotold every agent to printHIVE_VERDICT: wrong_base β <correct-branch>.taskBaseBranchForIssuereturns no base for a non-hive repository without a[vN]/Target: vNdeclaration, and the sentence was there anyway.wrongBaseTargetin the relay andnormalizeWrongBaseTargetin the hub accept onlyvN(deliberately: a relay-supplied ref must never become a git argument). So in those repositories the verdict could never succeed.contribute_ws.goassigned the hub's fixed reason oververdictReason, which held the agent's text. The wrong-base note and the generic needs-decision question (π fix(contribute): a needs-decision park posts its questionΒ #16837) then both posted, and neither quoted the agent. The docs promise "one bounded note".What changed
Prompt (
contribute_task_prompt.go)wrong_basesentence becomeswrongBaseHint.Hub (
contribute_wrong_base.go,contribute_ws.go)vNrelease branch, the only kind Hive can re-dispatch to". It no longer says a release branch "was supplied", which a repository without one can't act on.sanitizeReportedReason: mentions neutralized, backticks and HTML comments stripped, one line, 200-byte cap.<hub finding>; the agent said: <text>.wrong-base verdict parkedline asagent_reason./hive decisionreply hint.<!-- hive:wrong-base-park task=β¦ -->). A re-delivered completion still posts once, while a later task's park gets its own note with that agent's reason, as the generic question did per task.vNvalidation and theBranchExistscheck are untouched.Docs and changelog
docs/contributor-relay.md: where the verdict is offered, and what a park records and posts.Not in this PR
/hive decision.vNbranches in general. That's its own design question.vNtarget. An older relay that sendswrong_basefrom a no-base task now gets the clearer park described above.Tests
contribute_wrong_base_test.go:vNanswer and a missingvNbranch, with no mention, HTML comment or code span leaking through;TestBuildTaskPrompt_WrongBaseOnlyWithDeclaredBase: a[v6]task's prompt offerswrong_base; a utah-style task with no declared base doesn't, and points at the decision form.contribute_wrong_base_wire_test.go: a realtask_completeover the WebSocket withverdict: wrong_base, no target and a gate-sounding reason. It parks with one note quoting the agent under that task's marker, posts no generic question, and doesn't re-book the park as a gate park.TestBuildTaskPrompt_DeclaredBodyTargetAndWrongBaseContractstill covers the declared-base sentence.Only
gofmt -lwas run locally (AGENTS.md bans localgo test/go build/go vet); CI runs the tests. No existing issue covers this: searches forwrong_base,normalizeWrongBaseTarget,wrong-base-parkand "no valid target release branch" found only the closed history (#13146, #13190, #13218, #14764, #14768, #16837).π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1