Skip to content

πŸ› contribute: offer wrong_base only with a vN base; a park keeps the agent's reason - #18841

Merged
hivecommons-hive[bot] merged 3 commits into
hivecommons:v6from
Danathar:fix/wrong-base-no-release-line
Nov 18, 2026
Merged

hivecommons-hive[bot] merged 3 commits into
hivecommons:v6from
Danathar:fix/wrong-base-no-release-line

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

The contributor prompt offered the wrong_base verdict in every repository, but the hub re-dispatches only to a validated vN release branch. In a repository whose branches are main / testing / stable, every wrong_base verdict therefore parked the issue at stage/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:

  • The prompt offers wrong_base only when the task has a declared vN base. Elsewhere, an agent that can't tell where the work belongs asks in the existing decision form.
  • A wrong_base verdict that still parks keeps the agent's words. They're quoted in the park's one note, recorded with the verdict and logged as agent_reason.
  • The vN-only target vocabulary is unchanged, and no agent text ever becomes a branch.

What happened

Cause

  • contribute_task_prompt.go told every agent to print HIVE_VERDICT: wrong_base β€” <correct-branch>. taskBaseBranchForIssue returns no base for a non-hive repository without a [vN] / Target: vN declaration, and the sentence was there anyway.
  • wrongBaseTarget in the relay and normalizeWrongBaseTarget in the hub accept only vN (deliberately: a relay-supplied ref must never become a git argument). So in those repositories the verdict could never succeed.
  • On the park, contribute_ws.go assigned the hub's fixed reason over verdictReason, 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)

  • The wrong_base sentence becomes wrongBaseHint.
  • With a declared base it's unchanged.
  • Without one it says: "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."

Hub (contribute_wrong_base.go, contribute_ws.go)

  • The no-target reason now reads "the agent named no vN release 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.
  • A park keeps the agent's reason, sanitized with the existing sanitizeReportedReason: mentions neutralized, backticks and HTML comments stripped, one line, 200-byte cap.
    • It's recorded as <hub finding>; the agent said: <text>.
    • It's logged on a wrong-base verdict parked line as agent_reason.
    • It's quoted in the park note: "The agent said: β€œβ€¦β€", followed by the /hive decision reply hint.
  • The park note is now the park's question. The generic needs-decision question isn't posted beside it, and the park isn't re-booked as a repository gate park. That matters once the agent's text is in the reason: an agent quoting AGENTS.md would otherwise have the decision label lifted.
  • The note's marker carries the task id (<!-- 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.
  • The vN validation and the BranchExists check are untouched.

Docs and changelog

  • docs/contributor-relay.md: where the verdict is offered, and what a park records and posts.
  • A changelog fragment.

Not in this PR

Tests

  • contribute_wrong_base_test.go:
    • the no-target reason no longer mentions a supplied release branch;
    • the park note stays one line and names the branch;
    • a new table quotes a sanitized agent reason for both a non-vN answer and a missing vN branch, with no mention, HTML comment or code span leaking through;
    • the recorded reason and the per-task marker.
  • New TestBuildTaskPrompt_WrongBaseOnlyWithDeclaredBase: a [v6] task's prompt offers wrong_base; a utah-style task with no declared base doesn't, and points at the decision form.
  • New contribute_wrong_base_wire_test.go: a real task_complete over the WebSocket with verdict: 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.
  • The existing TestBuildTaskPrompt_DeclaredBodyTargetAndWrongBaseContract still covers the declared-base sentence.

Only gofmt -l was run locally (AGENTS.md bans local go test/go build/go vet); CI runs the tests. No existing issue covers this: searches for wrong_base, normalizeWrongBaseTarget, wrong-base-park and "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

…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
@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 kellyaa 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
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

βœ… Resolved: no conflicting open PRs or same-file overlaps remain against v6.

@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 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) != "" {

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.

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.

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@Danathar this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the review swarm requested changes

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.

@hivecommons-hive
hivecommons-hive Bot merged commit c27fcdb into hivecommons:v6 Nov 18, 2026
73 of 74 checks passed
@hivecommons-hive

hivecommons-hive Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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 Danathar holds role owner and GitHub permission maintain on repo; CI green at 881b10a.

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