Repository navigation
π advisory: digest and all periodic writers honour repo pause - #15285
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
@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. |
There was a problem hiding this comment.
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 asksrepoPauseLockedbeforeRepoModeFor, so the pause wins over per-repo mode / own-item / level / label rules.Deps.RepoPauseis nil-safe, andGate.RepoPausedhandles a nil receiver, which matters becauseClient.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 existingSetRepoPausedFuncpredicate thatRepoIsPaused(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 toadvisoryPublishSkippedbefore theerr == nilbranch, sorecordPostedis not called and hub freshness stays honest.recordRepoPausedβrecordAdvisoryPostSuccessβPostGate.RecordSuccessonly advanceslastSuccess(src/pkg/advisory/policy.go:168), which is the pacing you want.SweepDuplicatePRs/SweepClosedIssueStageLabels/ hard-suppress reconcile switched toactiveRepos()/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
|
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>
1aff486 to
6cdf1f0
Compare
|
stage 095-pre-merge-soak β 050-review-pending: required-check-pending:build-and-test |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
There was a problem hiding this comment.
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 fromcmd/hive/main.go:9730) loopsc.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) loopsc.getRepos(); label/comment writes further down. Its only skip isstageArchived, not pause.src/pkg/github/clarity_gate_resume.go:85βSweepClarityGateResume(cmd/hive/clarity_gate_resume_sweep.go:36) loopsc.getRepos()andRemoveLabels at:149.src/pkg/github/task_list_sweep.go:232βSweepCompletedTaskListIssuesloopsc.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 indecideLocked, before mode/own-item/level, soReasonRepoPausedwins overfullmode as the body says;Gate.RepoPausedis 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 barerepoPausedpredicate.cmd/hive/eval_cycle_advisory_seams.go:253-262+main.go:8106-8108β the paused path callsrecordAdvisoryPostSuccessonly (gate pacing) and returnsadvisoryPublishSkipped, so freshness/forbidden state are untouched as claimed.hard_suppress_reconcile.go:51βActiveRepositories()is the exportedactiveRepos()(client.go:4941).
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Fixes #15283
What
A paused spoke (
a1-vllm-spyre: every agent paused, both repos inproject.paused_reposby clubanderson with a reason, dashboard pause pressed) still edited its pinned## π Advisory Digestcomment on torch-spyre/spyre-inference#406 at startup (issuecomment-5376981980, "Frozen for governor mode SURGEβ¦"), while the auto-merge sweeps correctly loggedrepo-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/writebackDeps.RepoPauselookup (wired fromconfig.RepoPauseFor, soby/reasontravel with it).Gate.decideLockedchecks pause first: a paused repo refuses every kind with reasonrepo-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/hivePostAdvisoryDigestreturns*RepoPausedErrorbefore any forge call (no comment scan, no edit, no create), logsadvisory digest skipped: repo pausedwithbyandreason, and auditsadvisory_digest_suppressed reason=repo-paused. No hash/skip state is touched, so the first cycle after resume posts exactly like the first after boot.publishAdvisoryDigesttreats 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 bygovernor.advisory.update_interval_sso the log line lands once per interval.Other periodic writers that bypassed pause
SweepDuplicatePRsandSweepClosedIssueStageLabelsiteratedgetRepos()β nowactiveRepos().Repositories()β nowActiveRepositories().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:
EnsureAdvisoryIssuestill 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-drivenTestRepoPausedRefusesEveryKind(own item, foreign L6 sentinel, issue file, opted-in stage label; unpaused/fullrepos unchanged; pause lifted β normal decision; nil gate).pkg/config:WritebackGateDepswires 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/advisoryhas one pre-existing date-dependent failure onorigin/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 fragmentchangelog.d/fixed-advisory-digest-honors-repo-pause.md.