Skip to content

πŸ› advisory: digest and all periodic writers honour repo pause - #15285

Merged
clubanderson merged 1 commit into
v5from
fix/advisory-digest-honours-repo-pause
Oct 29, 2026
Merged

clubanderson merged 1 commit into
v5from
fix/advisory-digest-honours-repo-pause

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15283

What

A paused spoke (a1-vllm-spyre: every agent paused, both repos in project.paused_repos by clubanderson with a reason, dashboard pause pressed) still edited its pinned ## 🐝 Advisory Digest comment on torch-spyre/spyre-inference#406 at startup (issuecomment-5376981980, "Frozen for governor mode SURGE…"), while the auto-merge sweeps correctly logged repo-auto-merge-disabled. Repo pause is documented as stopping all agent writes; the digest path β€” and the central write-back gate β€” never consulted it.

Changes

Choke point β€” pkg/writeback

  • Deps.RepoPause lookup (wired from config.RepoPauseFor, so by/reason travel with it).
  • Gate.decideLocked checks pause first: a paused repo refuses every kind with reason repo-paused, before per-repo mode, own-item, level or label rules. The refusal is recorded in the suppressed-writes drill-down like any other.
  • Gate.RepoPaused(repo) exposes the lookup for writers that are not a gate kind.

Advisory digest β€” pkg/github / cmd/hive

  • PostAdvisoryDigest returns *RepoPausedError before any forge call (no comment scan, no edit, no create), logs advisory digest skipped: repo paused with by and reason, and audits advisory_digest_suppressed reason=repo-paused. No hash/skip state is touched, so the first cycle after resume posts exactly like the first after boot.
  • publishAdvisoryDigest treats that error as a skip: not a post (dashboard freshness is left honest), not an error (no App banner, no fleet self-report, no backoff), and paces the next attempt by governor.advisory.update_interval_s so the log line lands once per interval.

Other periodic writers that bypassed pause

  • SweepDuplicatePRs and SweepClosedIssueStageLabels iterated getRepos() β†’ now activeRepos().
  • Hard-suppress reconcile was handed Repositories() β†’ now ActiveRepositories().

Audited, already pause-safe (no change): sentinel, hold-gate upkeep, stage labels, needs-decision parks, reporter-trust, supersession/duplicate-fix notices (gate kinds, now also refused by the gate on pause as defence in depth), good-first-issue (candidates come from enumeration, which uses activeRepos), close-on-merge, merged-PR backfill, level hold, signed-reconcile. "review evidence: bundle written" writes a local evidence bundle, not GitHub. The Linear advisory target writes to Linear, not the paused repo β€” unchanged.

Known remaining one-off: EnsureAdvisoryIssue still creates the pinned advisory issue on a paused repo that has never had one, because that lookup doubles as the App-access probe at boot/recheck. Documented in repo-pause.md; the digest comment on it is not written until resume.

Unpaused repos: no behaviour change.

Tests

  • pkg/writeback: table-driven TestRepoPausedRefusesEveryKind (own item, foreign L6 sentinel, issue file, opted-in stage label; unpaused/full repos unchanged; pause lifted β†’ normal decision; nil gate).
  • pkg/config: WritebackGateDeps wires provenance.
  • pkg/github: TestPostAdvisoryDigest_HonoursRepoPause (bare predicate and gate-with-provenance; zero list/edit calls while paused; pause lifted β†’ next call edits), TestPostAdvisoryDigest_UnpausedRepoUnchanged.
  • cmd/hive: TestPublishAdvisoryDigest_RepoPausedIsSkipNotFailure, TestAdvisoryPostGate_PausedSkipPacesPerInterval (fake clock, no sleeps).
  • go test ./pkg/github/... ./pkg/writeback/... ./pkg/config/... green; pkg/advisory has one pre-existing date-dependent failure on origin/v5 (TestAgentClosedFindingIsNotReportedResolved), unrelated. golangci-lint: 0 issues on changed packages. Write ratchet baseline unchanged.

Docs

docs/repo-pause.md (what a pause stops: advisory digest, gate, sweeps; what it doesn't: first advisory-issue creation), docs/operator-reference.md (write-back section), docs/github-write-surface.md; changelog fragment changelog.d/fixed-advisory-digest-honors-repo-pause.md.

@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 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 Oct 29, 2026
@github-actions

github-actions Bot commented Oct 29, 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
#15134 πŸ› Delegated decision on a capability gap: model the blocker, stop the un-park/re-park loop, name the missing App permission same files src/docs/operator-reference.md
#15104 πŸ› Activity Monitor: Rebase, then merge as maintainer; fixer owns parked conflicting PRs; dismiss self-inflicted changes_requested same files src/cmd/hive/main.go
src/docs/operator-reference.md
#15186 πŸ› Activity Monitor: one coherent post-decision state for Let hive decide rows; 060 reviewed in CI / Review same files src/docs/operator-reference.md

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply.

@hivecommons-hive hivecommons-hive Bot added author/human A person pushed this PR themselves 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

Choose a reason for hiding this comment

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

Read the gate, the digest poster and the periodic sweeps against the v5 tree β€” this looks correct to me, and the choke-point placement is the right one.

Verified against the tree:

  • writeback.Gate.decideLocked (src/pkg/writeback/gate.go:354) now asks repoPauseLocked before RepoModeFor, so the pause wins over per-repo mode / own-item / level / label rules. Deps.RepoPause is nil-safe, and Gate.RepoPaused handles a nil receiver, which matters because Client.WritebackGate() (src/pkg/github/writeback_gate.go:26) can legitimately return nil.
  • Client.repoPausedError (writeback_gate.go:103) ORs the provenance-bearing config lookup with the existing SetRepoPausedFunc predicate that RepoIsPaused (client.go:4891) already uses, so a client wired with only one of the two sources still pauses.
  • PostAdvisoryDigest (src/pkg/github/advisory.go:376) returns before the canary gate, the comment scan and any write, and touches no hash/skip state β€” so the body's "first cycle after resume posts like the first after boot" claim holds.
  • publishAdvisoryDigest (src/cmd/hive/eval_cycle_advisory_seams.go:253) maps the error to advisoryPublishSkipped before the err == nil branch, so recordPosted is not called and hub freshness stays honest. recordRepoPaused β†’ recordAdvisoryPostSuccess β†’ PostGate.RecordSuccess only advances lastSuccess (src/pkg/advisory/policy.go:168), which is the pacing you want.
  • SweepDuplicatePRs / SweepClosedIssueStageLabels / hard-suppress reconcile switched to activeRepos() / ActiveRepositories() (client.go:4916, :4941), which already exist and are the same filter the automerge sweep uses.

One thing worth knowing, not a defect: PostGate.RecordSuccess also does delete(g.backoffUntil, repo) (policy.go:169). A paused skip will therefore clear a standing 403 backoff for that repo. In practice Due gates the post before postGitHub is reached, so a repo in backoff should not get as far as the pause check; I'm noting it only so the interaction is on record.

No findings. (I can't run go test on this host; the new tests in pkg/writeback, pkg/github and cmd/hive cover the pause-first ordering, the skip-not-error mapping and the pacing.)

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted labels Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 095-pre-merge-soak β†’ 060-reviewed: required-check-pending:Sign-off survives the squash

A paused spoke (every agent paused, both repos in project.paused_repos)
still edited its pinned '## 🐝 Advisory Digest' comment at startup while
the auto-merge sweeps correctly logged repo-auto-merge-disabled. Repo
pause (#6203) is documented as stopping all agent writes; the digest
path never consulted it.

- pkg/writeback: Deps.RepoPause lookup; the gate refuses every kind on a
  paused repo with reason repo-paused, checked before mode/own-item, and
  records the suppression. Gate.RepoPaused exposes the lookup for writers
  that are not a gate kind.
- pkg/config: WritebackGateDeps wires RepoPauseFor (by/reason) into it.
- pkg/github: PostAdvisoryDigest returns *RepoPausedError before any
  forge call, logging 'advisory digest skipped: repo paused' with by and
  reason and auditing advisory_digest_suppressed reason=repo-paused; no
  hash state is touched so the first cycle after resume posts.
  SweepDuplicatePRs and SweepClosedIssueStageLabels iterate activeRepos.
- cmd/hive: publishAdvisoryDigest treats RepoPausedError as a skip (not a
  post, not an error, no App-banner hooks) and paces the next attempt by
  the update interval; hard-suppress reconcile uses ActiveRepositories.
- docs: repo-pause.md, operator-reference.md, github-write-surface.md.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@clubanderson
clubanderson force-pushed the fix/advisory-digest-honours-repo-pause branch from 1aff486 to 6cdf1f0 Compare October 29, 2026 04:06
@hivecommons-hive hivecommons-hive Bot added stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted labels Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 095-pre-merge-soak β†’ 050-review-pending: required-check-pending:build-and-test

@clubanderson
clubanderson merged commit c7598f3 into v5 Oct 29, 2026
78 of 82 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/advisory-digest-honours-repo-pause branch October 29, 2026 04:19
@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 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.

Conclusion: the digest fix and the gate choke point are correct as written (built clean at 6cdf1f0; read the callers). But the title and the body's "Audited, already pause-safe" list overstate coverage: at least four periodic sweeps still iterate getRepos() and write through AddLabels/RemoveLabel/comment calls that consult neither the gate nor RepoIsPaused. Either widen the PR to them or narrow the claim β€” a maintainer reading "all periodic writers honour repo pause" will believe a paused repo is quiet, and it is not.

Still writing to paused repos (not in the body's audited list):

  • src/pkg/github/shared_ci_rerun.go:97 β€” SweepSharedCIReruns (called from cmd/hive/main.go:9730) loops c.getRepos(), re-runs failed workflow runs and stamps a <!-- hive-shared-ci-rerun-N --> comment (:289-291). A workflow re-run is a write with side effects on a repo the operator paused.
  • src/pkg/github/issue_unpark_command.go:280 β€” SweepIssueUnparkCommands (main.go:10010) loops c.getRepos(); label/comment writes further down. Its only skip is stageArchived, not pause.
  • src/pkg/github/clarity_gate_resume.go:85 β€” SweepClarityGateResume (cmd/hive/clarity_gate_resume_sweep.go:36) loops c.getRepos() and RemoveLabels at :149.
  • src/pkg/github/task_list_sweep.go:232 β€” SweepCompletedTaskListIssues loops c.getRepos() and closes/comments on issues.

Mechanism: Client.AddLabels (client.go:3172) and friends have no pause check β€” pause is enforced only by activeRepos() (client.go:4916) at enumeration time and by the request watchers (*_request_watcher.go), so any sweep that still enumerates with getRepos() is unpaused. The same one-line getRepos() β†’ activeRepos() swap this PR applies to duplicate_sweep.go:136 and closed_issue_stage_sweep.go:78 fits these four. (origin_labels.go:263,415 also uses getRepos() for label writes, but it is a startup migration rather than a periodic writer β€” mention only.)

Code read of what is here β€” no defects found:

  • pkg/writeback/gate.go:353-355 β€” pause is checked first in decideLocked, before mode/own-item/level, so ReasonRepoPaused wins over full mode as the body says; Gate.RepoPaused is nil-safe (:433-441).
  • pkg/github/advisory.go:375-389 β€” the pause return sits before the canary gate and the unchanged-hash skip, so no list/edit call and no hash mutation happen; repoPausedError (writeback_gate.go:104-116) honours both the gate lookup and the bare repoPaused predicate.
  • cmd/hive/eval_cycle_advisory_seams.go:253-262 + main.go:8106-8108 β€” the paused path calls recordAdvisoryPostSuccess only (gate pacing) and returns advisoryPublishSkipped, so freshness/forbidden state are untouched as claimed.
  • hard_suppress_reconcile.go:51 β€” ActiveRepositories() is the exported activeRepos() (client.go:4941).

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

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

Labels

author/human A person pushed this PR themselves 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/050-review-pending Review swarm requested; awaiting a verdict for the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Advisory digest and some periodic sweeps keep writing to an operator-paused repo

1 participant