Skip to content

✨ review: fan a combined head kick out to one sub-agent per perspective - #15539

Merged
clubanderson merged 9 commits into
v5from
hive/adopt-15431
Oct 29, 2026
Merged

clubanderson merged 9 commits into
v5from
hive/adopt-15431

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Supersedes #15431 (adopted after CI went red and the contributor was unavailable; original commits by @gregoryhunt preserved).

This branch is #15431's head dcf16aa3978a as pushed by @gregoryhunt (fork gregoryhunt/hive), unchanged. Last lane reason on the original: fork-not-editable.

Hive fix agent: rebase this branch on v5, fix the failing checks / review asks, and push to THIS branch. Keep the original author's commits and their Signed-off-by; add your own sign-off on your commits. Do not open another PR.

gregoryhunt and others added 5 commits October 29, 2026 12:20
A combined review head (#15068) judges every perspective in one record-only
kick, but nothing told it how to spend that kick, so a head walked the
perspectives one after another and its kick took the sum of all of them.

The combined head prompt now carries a FAN-OUT section: fetch the PR
metadata, the diff and any linked issue or contract once, start one
sub-agent per perspective in parallel with the diff, the contract text,
the shared instructions and that perspective's focus, then collect their
verdict objects into the one JSON array and record it once with
--record-verdict. Sub-agents post nothing, never call hive-review and do
not refetch the PR. Without sub-agents the head reviews the perspectives
in sequence; the array contract is unchanged. The wording is
backend-neutral (Task tool on Claude Code, sub-agents on Codex). A
single-perspective re-ask carries no fan-out section, and plain combined
kicks are unchanged.

Refs #15058

Signed-off-by: Gregory Hunt <greg@on-board.ai>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The fan-out told a head to start one sub-agent per perspective without
naming a model, while the head's independent-review section pins a single
sub-agent to the head model. On a backend whose sub-agent facility defaults
to another model, per-perspective verdicts could come from a model other
than the one the head is stamped with. Each fan-out sub-agent is now
launched with the head's model and replaces (not adds to) the pinned
independent-review sub-agent; a head that cannot pin it reviews the
perspectives itself. Docs and test updated.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Gregory Hunt <greg@on-board.ai>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 29, 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

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

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

PR Title Relation Files
#15431 ✨ review: fan a combined head kick out to one sub-agent per perspective same files changelog.d/changed-15058-combined-head-fanout.md
src/docs/review-swarm.md
src/pkg/review/prompts.go
src/pkg/review/review_heads_test.go

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Decision needed: @clubanderson should decide whether this adoption (#15539) is closed in favour of the original #15431, whose head 3ee9bfa is now fully green with an identical diff, or whether the adopted branch is preferred so the hive can push follow-ups.

This is a byte-for-byte duplicate of #15431. Flagging for a maintainer: one of the two should close; I have not closed anything.

What I verified

  • gh pr diff of #15539 (ed1f3c8) and #15431 (3ee9bfa) are identical: same 4 files, 140 additions, 0 deletions (changelog.d/changed-15058-combined-head-fanout.md, src/docs/review-swarm.md, src/pkg/review/prompts.go, src/pkg/review/review_heads_test.go).
  • Both branches carry the same two content commits (75cd757, 09bf904) plus v5 merges; this branch's only extra commit is ed1f3c8 Merge branch 'v5' into hive/adopt-15431.
  • This PR's body says it was adopted because CI on #15431 "went red" and the fork was not editable. That premise has lapsed: #15431's current head 3ee9bfa shows every required check SUCCESS (only tide pending), the same state as this PR.

Code read (applies to both PRs)

BuildCombinedPrompt (src/pkg/review/prompts.go:716) adds the fan-out section only on the HeadRecordOnly branch, so plain combined kicks and the decision prompt are untouched. buildHeadFanOutInstruction returns "" for len(perspectives) < 2 (prompts.go:737), so a single-perspective re-ask gets no section — matched by the "head, single perspective re-ask" case in review_heads_test.go. writeFanOutModelPin emits backend/model when both are set and a model-only pin otherwise, with the model == "" fallback keeping sub-agents on the session model. No defects found; this looks correct to me.

Recommendation

Since the original is green and the diffs are identical, closing this adoption in favour of #15431 preserves @gregoryhunt's authorship with no loss. If the hive would rather hold the pushable branch for a future rebase, close #15431 instead — but merging both is not possible, and merging one makes the other a no-op.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Decision needed: @clubanderson should decide whether to close this adoption (#15539) in favour of the contributor's original #15431, now that #15431 is green and its author is active.

Tree-identical to #15431 — only one of the two can land, and #15431 now looks like the better survivor.

What I verified (checkout of both heads):

  • git diff 3ee9bfab…(#15431) ed1f3c89…(#15539) is empty — the trees are byte-identical. Both add buildHeadFanOutInstruction/writeFanOutModelPin in src/pkg/review/prompts.go:737-772, the test in src/pkg/review/review_heads_test.go, the review-swarm.md paragraph and the changelog fragment.
  • This PR's body says it was adopted "after CI went red and the contributor was unavailable". That is no longer the state: #15431's current head 3ee9bfa is a signed-off merge of v5 pushed by @gregoryhunt after the adopted dcf16aa, and every check on #15431 is green (tide pending only). The contributor is active and the fork PR is mergeable.
  • #15431 also keeps the author's DCO trail cleanest: the three Merge branch 'v5' commits on this branch (5844efc, d87392b, ed1f3c8) carry no Signed-off-by.

The code itself is correct on both: the fan-out block is only emitted on the HeadRecordOnly path (prompts.go:712-716), returns "" for a single-perspective re-ask (:738), and its "independent review described above" reference is accurate — writeIndependentReviewSection runs earlier in BuildCombinedPrompt (:690) with the same backend/model target form as independent.go:33-43.

Recommendation for a maintainer: merge #15431 and close this one as superseded-by-original. I have not closed anything.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Needs a decision, not a merge:

Head: verdict requires_human @ed1f3c8, 62/63 checks green, 1 pending, DCO yes, soak 0s of 30m0s.

What to do: approve this head (ed1f3c8) to merge as-is, or leave a changes requested review (or reply /hive decision <what to change>) and the hive will push the fix.

How to release it:

  • After reading the verdict, a trusted merger can submit a GitHub Approve review for the current head and the lane clears the hold on its next pass; /hive approve replies on a PR are acknowledged but not consumed.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue labels Oct 29, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Decision needed: @clubanderson should decide whether this adoption (#15539) or the original #15431 lands — their diffs are byte-identical, so only one should merge.

Duplicate of #15431 — identical content, pick one.

I fetched both diffs (gh pr diff) and they are byte-for-byte identical (186 lines each, diff empty). Both branches carry the same two content commits, 75cd757 and 09bf904; they differ only in Merge branch 'v5' commits (3ee9bfa on #15431 vs ed1f3c8/3ece062 here). Same four files: changelog.d/changed-15058-combined-head-fanout.md, src/docs/review-swarm.md, src/pkg/review/prompts.go, src/pkg/review/review_heads_test.go.

The body here says #15431 was adopted "after CI went red and the contributor was unavailable". That no longer holds: #15431's current head 3ee9bfa has every check green except tide (pending, same as here), and it already carries a hive approve verdict. So the reason for the adoption has lapsed and the two PRs now race.

Correctness read of the shared change (same as my read of #154313ee9bfa): buildHeadFanOutInstruction is only reached on the HeadRecordOnly branch of BuildCombinedPrompt (src/pkg/review/prompts.go:716) and returns "" for len(perspectives) < 2, so single-perspective re-asks and plain combined kicks are untouched; PromptOptions.ReviewBackend/ReviewModel exist at prompts.go:274-275. Prompt-text only — no runtime behaviour change outside the kick text. Looks correct to me.

Recommendation: merge #15431 (original author's branch, already verdict-approved) and close this one as redundant — or, if the hive policy is that adopted branches win because they are editable, merge this and close #15431. Either way, only one should land; the second becomes an empty merge. I have not closed anything.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Decision needed: @clubanderson should decide whether to merge the adoption #15539 or the original fork PR #15431 (both green, byte-identical diffs) and close the other, so the second does not sit in the queue as a no-op.

Conclusion: this PR is a byte-identical copy of #15431 (gh pr diff of both, minus index lines, has no differences: same 4 files, +140/−0). The code looks correct to me; the only open question is which of the two should land.

What I verified

  • src/pkg/review/prompts.go:716 — buildHeadFanOutInstruction is appended only inside the HeadRecordOnly branch of BuildCombinedPrompt, after buildHeadRecordOnlyInstruction, so plain combined kicks and the decision prompt are untouched. It returns "" for len(perspectives) < 2 (prompts.go:737), so a single-perspective re-ask carries no fan-out section, as the body claims.
  • writeFanOutModelPin (prompts.go:759) falls back to "run on the model you are running on now" when ReviewModel is empty and prefixes backend/ only when ReviewBackend is non-empty — no nil/empty-string edge I could find.
  • review_heads_test.go:382 TestCombinedHeadPromptFansOutPerPerspective covers every case the body lists (all perspectives, partial re-ask, single re-ask, non-head kick, pinned vs unpinned model). CI is green on both PRs, including test, coverage and golangci-lint.
  • Prompt text and src/docs/review-swarm.md agree with each other and with the changelog fragment.

Why a human is needed: this was adopted because #15431's fork was not pushable while CI was red; CI on #15431 is now green at 3ee9bfa and the hive already recorded an approve verdict for it. Whichever merges first makes the other a no-op against v5. Since #15431 preserves @gregoryhunt as the PR author, I'd lean toward merging the original and closing this one — but that is a maintainer's call. I have not closed anything.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Needs a decision, not a merge:

Head: verdict requires_human @e256209, 59/61 checks green, 2 pending, DCO yes, soak 0s of 30m0s.

What to do: approve this head (e256209) to merge as-is, or leave a changes requested review (or reply /hive decision <what to change>) and the hive will push the fix.

How to release it:

  • After reading the verdict, a trusted merger can submit a GitHub Approve review for the current head and the lane clears the hold on its next pass; /hive approve replies on a PR are acknowledged but not consumed.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

@clubanderson
clubanderson merged commit 077f573 into v5 Oct 29, 2026
81 of 85 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the hive/adopt-15431 branch October 29, 2026 23:13
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/L Denotes a PR that changes 100-499 lines, ignoring generated files. stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants