Skip to content

🌱 refactor: split src/pkg/review/prompts.go into 4 files - #15707

Merged
hivecommons-hive[bot] merged 33 commits into
v5from
scanner/fix-15701
Oct 30, 2026
Merged

hivecommons-hive[bot] merged 33 commits into
v5from
scanner/fix-15701

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Why

src/pkg/review/prompts.go (938 lines) is a merge hotspot: 6 distinct PRs touched it in 7 days. This is the mechanical split the issue asks for.

What

Whole top-level declarations (with doc comments) moved verbatim into sibling files in package review; no behaviour change, no renames, exported API unchanged. Only import blocks differ per file. No open PR touches the file.

File Contents
prompts.go PullRequest, PullRequestBodyDigest, grounding consts/sections, BuildPerspectivePrompt/Opts/With, PromptOptions
prompts_instructions.go head record-only/propose-only/read/review-bot instructions, reviewBotMatchLogins, Linear scope contract, prior-notes consts
prompts_publish.go untrustedFence, publish/routing instructions, mentionableAuthor, permissions guidance, verdict/finding schema consts, perspectiveNames, model-stamp helpers
prompts_combined.go BuildCombinedPrompt, fan-out instruction, combined sections/publish instruction, review writing guide

Tests stay in place (prompts_test.go is unaffected). Changelog fragment added as in #15690.

Closes #15701

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

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 30, 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

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
#15757 ✨ Auto-merge hive-authored superseding PRs without operator decision CONFLICT src/pkg/review/prompts.go

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

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

@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 stage/080-awaiting-merge-admission CI green, verdict approve, no modifiers; the automerge lane has not admitted it yet role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/080-awaiting-merge-admission CI green, verdict approve, no modifiers; the automerge lane has not admitted it yet labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 080-awaiting-merge-admission → 070-fixing: optional-check-failing:build (linux/amd64, true, false, 60)

golangci-lint typecheck failed on the split head because prompts.go kept
the pkg/config import while every config reference moved to
prompts_instructions.go.

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: pushed 61d3b83 dropping the unused pkg/config import in prompts.go (golangci-lint typecheck was the root cause of the all-red run; v5 baseline is green). CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner 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.

Verified this is a pure relocation: the sorted, non-blank line multiset of src/pkg/review/prompts.go at the merge-base equals the union of prompts.go + prompts_combined.go + prompts_instructions.go + prompts_publish.go on 61d3b83, ignoring only package/import boilerplate (883 lines each side, zero differences). All four files stay in package review, so nothing changes for callers or for go test discovery, and the only non-Go change is the changelog fragment. CI (build-and-test, all test (…) shards) is green on this head, which confirms the per-file import lists.

Looks correct to me.

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

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/080-awaiting-merge-admission CI green, verdict approve, no modifiers; the automerge lane has not admitted it yet 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 30, 2026
@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 30, 2026
@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/080-awaiting-merge-admission CI green, verdict approve, no modifiers; the automerge lane has not admitted it yet labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 080-awaiting-merge-admission → 070-fixing: conflicting

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>

# Conflicts:
#	src/pkg/review/prompts.go
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: merged origin/v5 (carried #15617's fan-out grounding-budget hunks into prompts_combined.go); CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 710fc7754

— hive: agent=scanner 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.

Verified move-only; looks correct to me, with one doc path to update.

Correctness — git diff origin/v5...aa349cd --color-moved=zebra --color-moved-ws=ignore-all-space over src/pkg/review/ shows the only non-moved lines are the three new package review / import (...) headers. No function body, constant or comment changed; the remaining prompts.go still holds groundingSection (:182) and the kick builders. go build ./pkg/review/ succeeds and CI is green. Nothing references the file by path at runtime (no size guard or embed).

Docs currency (low) — src/docs/review-bot-threads.md:235 cites buildReviewBotFindingsInstruction as living in pkg/review/prompts.go; it now lives in src/pkg/review/prompts_instructions.go:106. Worth fixing in this PR since the split is the reason it went stale. (src/docs/security.md:96 cites groundingSection at prompts.go:74; that line was already a struct field on v5, so it is pre-existing drift, not this PR's — the function is still in prompts.go.)

Matches the mechanical split #15701 asked for; changelog fragment name/category valid.

— hive: agent=reviewer-2 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 30, 2026
Hive-Fix-Attempt: 1/6
Signed-off-by: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 30, 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.

Verified this is a pure move. Concatenating the four files at 4a9525d and diffing their non-comment, non-import lines against prompts.go at merge-base db43b1a gives an empty diff; each new file's import block is the minimal set it needs (prompts_instructions.go is the only one that still needs strconv and pkg/config). go build ./pkg/review/ passes at the PR head. The one doc citation to the old location (src/docs/review-bot-threads.md) is updated. Looks correct to me.

One note for whoever merges: the body says "No open PR touches the file", which was true when written but is no longer — #15757 adds hiveSupersedingGuidance to prompts.go (+7) and prompts_decision.go, hence the conflicts-with-open-pr label. Either order works; if this lands first, #15757's hunk goes into whichever of the new files holds publishInstruction/the single-prompt guidance (prompts_publish.go).

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

Verified this is a pure move, not a rewrite: after stripping package/import lines, the multiset of non-blank lines in v5:src/pkg/review/prompts.go (949 lines) is identical to the union of prompts.go (341), prompts_combined.go (220), prompts_instructions.go (225) and prompts_publish.go (181) at 23e6ec0 — zero lines added, removed or edited. go build ./pkg/review/ at the PR head succeeds and gofmt -l is clean.

Docs: review-bot-threads.md now points buildReviewBotFindingsInstruction at prompts_instructions.go:106, which is where it landed. groundingSection stays in prompts.go, so the references in docs/review-swarm.md:55 and docs/security.md:96 remain correct.

Looks correct to me; nothing to change.

— hive: agent=reviewer-2 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 30, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 30, 2026
@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 1b1a8a9 into v5 Oct 30, 2026
75 of 77 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-15701 branch October 30, 2026 16:06
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#15707436edf6` sha256:901997e8dc3769b16f0668453d3c0e2e62035fa5ea86dfa1cc13dd7ef9ebb533 — download from the dashboard or `hivectl review evidence #15707`.

@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

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 30, 2026
clubanderson added a commit that referenced this pull request Oct 30, 2026
…anish

- sweep clock marks only the PR under evaluation, so merge_gate.sweep_running
  no longer reads as 'merging now' on every soaked row for a whole floor pass
- a merge call returning patches the cached snapshot (closed/merged/MergedByHive)
  and nudges the SPA, so the row reaches ✓ within one poll
- every hive-performed merge celebrates exactly once from one pipeline (toast,
  bee, odometer after landing); a row not in the DOM flies its bee from the
  toast's ✓ (#15707); removal reconciled by recently_merged / recently_closed
- closed-not-merged rows show a neutral '#N closed · <reason>' toast
- merge-gate hold is a bridge, not a delay: dashboard.stage_tracker.merged_hold_s
  (default 8, min 3); 'merging · waiting for GitHub…' past 60s

Closes #15808

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 30, 2026
…anish

- sweep clock marks only the PR under evaluation, so merge_gate.sweep_running
  no longer reads as 'merging now' on every soaked row for a whole floor pass
- a merge call returning patches the cached snapshot (closed/merged/MergedByHive)
  and nudges the SPA, so the row reaches ✓ within one poll
- every hive-performed merge celebrates exactly once from one pipeline (toast,
  bee, odometer after landing); a row not in the DOM flies its bee from the
  toast's ✓ (#15707); removal reconciled by recently_merged / recently_closed
- closed-not-merged rows show a neutral '#N closed · <reason>' toast
- merge-gate hold is a bridge, not a delay: dashboard.stage_tracker.merged_hold_s
  (default 8, min 3); 'merging · waiting for GitHub…' past 60s

Closes #15808

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 30, 2026
… vanish (#15817)

* 🐛 activity monitor: merging-now lingers, silent merges, closed rows vanish

- sweep clock marks only the PR under evaluation, so merge_gate.sweep_running
  no longer reads as 'merging now' on every soaked row for a whole floor pass
- a merge call returning patches the cached snapshot (closed/merged/MergedByHive)
  and nudges the SPA, so the row reaches ✓ within one poll
- every hive-performed merge celebrates exactly once from one pipeline (toast,
  bee, odometer after landing); a row not in the DOM flies its bee from the
  toast's ✓ (#15707); removal reconciled by recently_merged / recently_closed
- closed-not-merged rows show a neutral '#N closed · <reason>' toast
- merge-gate hold is a bridge, not a delay: dashboard.stage_tracker.merged_hold_s
  (default 8, min 3); 'merging · waiting for GitHub…' past 60s

Closes #15808

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* 📖 docs: resync api-reference citations after server.go shift

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* 🌱 config: cover StageTrackerMergedHold (coverage floor)

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

---------

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
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 conflicts-with-open-pr Open PR has a merge conflict with another open PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: src/pkg/review/prompts.go is a merge hotspot — split into 4 units

0 participants