Skip to content

🐛 Repair queues: do not push onto busy non-App PR branches - #18502

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
fix/scanner-skip-busy-branches
Nov 16, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
fix/scanner-skip-busy-branches

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #18488

Where the push decision lived

The scanner is an LLM agent. It does not decide on its own where to push: the kick tells it. Two Go-rendered kick sections are its push instructions:

  • FIX-BEFORE-NEW (pkg/scheduler/policy_overlays.go, formatRedPRFixDataWithSignals). A ci-failing.json row with no audit attribution defaults to scanner and is rendered as "These PRs are YOURS ... gh pr checkout → commit -s → git push". That includes same-repo PRs the hive App never opened, such as the owner's own session PRs. This is how the scanner pushed onto ⚠️ Retire the inception API, watcher and brainstorm inception mode #18419.
  • CI_FAILING (pkg/scheduler/lane_messages.go, buildCIFailingListFor). This is the shared push queue. It already splits off fork PRs as comment-only.

The fork split (#7386) is the existing "comment only, cannot push" decision point, and this PR extends it. The scanner's "I'm not pushing because this branch is not hive-authored" note is the LLM following policy text. That text does not cover these rows, because the kick lists them as the scanner's own.

Change

A red or conflicted PR that the hive App did not open is now busy when either of these holds:

  • a live claim by another worker covers the PR or one of its linked issues. This reuses the worker-claim ledger. Real claims only: kick listings do not count, and the kicked agent's own claim does not count.
  • its head was pushed less than HIVE_SCANNER_BUSY_BRANCH_MINUTES ago (default 60). The push time comes from the earliest CI activity already observed on that head (PRCIActivity), so no GitHub calls are added.

A busy row is moved out of the push lists:

  • FIX-BEFORE-NEW: it goes to a "⏸ BUSY BRANCHES, suggest, do not push" block below the gate. That block does not hold back new work.
  • CI_FAILING: it gets its own BUSY BRANCHES section.
  • PR_LIST: the row carries a [busy: … do not push; post the fix as one suggestion comment] marker.

In all three places the instruction is the same: post the fix as one suggestion comment per PR, editing an existing note instead of adding another, so the worker applies it as its own signed commit.

ci-failing.json rows gain three additive fields: app_authored, head_pushed_at and issues.

Unchanged

  • Idle branches (no claim, head older than the window): listed exactly as before.
  • App-authored lane branches and in-place adoptions (stage 074): never checked.
  • A row attributed to the kicked agent itself: its own recent pushes do not count; another worker's claim still does.
  • Fork handling, Dependabot handling, merge logic, the re-engagement and reaper kicks (main_sweeps.go), sign-off identity: untouched.

Tests

  • pkg/scheduler/busy_branch_test.go:
    • the decision table: lease, linked-issue lease, own claim, recent push, old push, App, adopted, own row
    • the env override
    • FIX-BEFORE-NEW, CI_FAILING and PR_LIST keep busy rows out of the push lists, and the same rows are push targets again once idle
    • the evidence helpers
  • cmd/hive/busy_branch_claims_test.go: the claims-ledger adapter, run against a real ledger.

🤖 Generated with Claude Code

The scanner reached owner-session PRs as unattributed FIX-BEFORE-NEW rows
(they default to scanner) and pushed its own commits onto branches another
worker was still pushing to, turning 'Sign-off survives the squash' red
(#18419), racing the worker's next push and duplicating its fix.

A red or conflicted PR the hive App did not open is now listed as
'suggest, do not push' in FIX-BEFORE-NEW, the CI_FAILING push queue and
PR_LIST while its branch is busy: a live claim by another worker on the
PR or a linked issue (worker-claim ledger), or a head pushed within
HIVE_SCANNER_BUSY_BRANCH_MINUTES (default 60, from the head's earliest CI
activity, no new GitHub calls). App-authored lane branches, in-place
adoptions and idle branches are listed exactly as before.

Fixes #18488

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 16, 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 nicholasjackson 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 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
#18498 ✨ agentsmd: 32 KiB default AGENTS.md cap with per-repo override and status same files src/pkg/scheduler/scheduler.go
src/pkg/scheduler/templates.go
#18501 ✨ Durable one-PR-per-topic claims for long-lived agents CONFLICT src/cmd/hive/main.go
src/pkg/scheduler/policy_overlays.go (conflict)
src/pkg/scheduler/scheduler.go
src/pkg/scheduler/templates.go
#18505 ✨ Discover agents declared in a managed repo's .hive/agents/ behind owner approval same files src/cmd/hive/main.go
#18507 ✨ governor: release-feed watcher kicks agents when a tracked upstream dependency releases CONFLICT src/cmd/hive/main.go
src/docs/env-vars.md (conflict)
src/pkg/scheduler/scheduler.go
src/pkg/scheduler/templates.go
#18446 🐛 fix: get stale Dependabot PRs moving without refused commands same files src/pkg/scheduler/lane_messages.go

@hivecommons-hive

hivecommons-hive Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • overlayfs-exec-guard

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

Evidence bundle `#18502543ed79` sha256:4efd1cb7a8036b5065303aa84aaa59d6072f2cf1007072db905403c04c93026a — download from the dashboard or `hivectl review evidence #18502`.

@github-actions

Copy link
Copy Markdown
Contributor

Mutation testing

gremlins found 17 surviving mutant(s) in changed files: the code ran under tests, but changing it did not fail any test.

File Line Mutation
src/pkg/scheduler/busy_branch.go 90 CONDITIONALS_NEGATION
src/pkg/scheduler/busy_branch.go 90 CONDITIONALS_NEGATION
src/pkg/scheduler/busy_branch.go 90 CONDITIONALS_NEGATION
src/pkg/scheduler/busy_branch.go 127 CONDITIONALS_BOUNDARY
src/pkg/scheduler/busy_branch.go 145 CONDITIONALS_BOUNDARY
src/pkg/scheduler/busy_branch.go 146 CONDITIONALS_BOUNDARY
src/pkg/scheduler/busy_branch.go 205 CONDITIONALS_BOUNDARY
src/pkg/scheduler/busy_branch.go 212 CONDITIONALS_BOUNDARY
src/pkg/scheduler/busy_branch.go 212 CONDITIONALS_NEGATION
src/pkg/scheduler/busy_branch.go 216 CONDITIONALS_BOUNDARY
src/pkg/scheduler/busy_branch.go 268 CONDITIONALS_BOUNDARY
src/pkg/scheduler/busy_branch.go 268 CONDITIONALS_NEGATION
src/pkg/scheduler/busy_branch.go 269 ARITHMETIC_BASE
src/pkg/scheduler/busy_branch.go 279 CONDITIONALS_BOUNDARY
src/pkg/scheduler/lane_messages.go 672 CONDITIONALS_BOUNDARY
src/pkg/scheduler/lane_messages.go 677 CONDITIONALS_BOUNDARY
src/pkg/scheduler/lane_messages.go 677 CONDITIONALS_NEGATION

9 mutant(s) in changed files are not reached by any test (NOT COVERED). A maintainer may apply the mutation/acknowledged label to accept this.

File Line Mutation
src/pkg/scheduler/busy_branch.go 107 CONDITIONALS_NEGATION
src/pkg/scheduler/busy_branch.go 107 CONDITIONALS_NEGATION
src/pkg/scheduler/busy_branch.go 158 ARITHMETIC_BASE
src/pkg/scheduler/busy_branch.go 159 ARITHMETIC_BASE
src/pkg/scheduler/busy_branch.go 206 ARITHMETIC_BASE
src/pkg/scheduler/busy_branch.go 206 INVERT_NEGATIVES
src/pkg/scheduler/busy_branch.go 217 ARITHMETIC_BASE
src/pkg/scheduler/lane_messages.go 673 ARITHMETIC_BASE
src/pkg/scheduler/lane_messages.go 673 INVERT_NEGATIVES

ℹ️ 2 mutant(s) on added lines were SKIPPED because gremlins v0.6.0 only honours the first lines added lines of each default-context hunk, so non-contiguous edits in one hunk are partly missed. This does not affect the verdict.

File Line Mutation
src/pkg/scheduler/lane_messages.go 628 CONDITIONALS_NEGATION
src/pkg/scheduler/policy_overlays.go 432 CONDITIONALS_NEGATION

Verdict: lived (#17349).

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

Labels

conflicts-with-open-pr Open PR has a merge conflict with another open PR dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Scanner pushes commits onto PR branches another agent is actively working on

1 participant