Repository navigation
π± contributor-nudge once per PR+reason; fold origin notes into status; marker ratchet - #17073
Conversation
β¦; marker ratchet Contributor nudges carry a hive:contributor-nudge reason=<slug> marker and are edited in place for a new head or changed reason, with one re-nudge after auto_merge.nudge_repeat_after (default 72h). Agent free-text relay comments whose only marker is the hive:origin footer fold into the hive:status card in quiet mode or one hive:origin-notes comment per item otherwise. A grep-based ratchet in internal/testutil caps unmarked raw comment emitters under pkg/github at the current 45. Fixes #17067 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
[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
|
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. @clubanderson this PR is held at Failing checks:
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 `#170735efef71` sha256:fe71b4a9b94849869338d1a102267e6b4cc0a203eb7eb17c1d8af2449ca61750 β download from the dashboard or `hivectl review evidence #17073`. |
TestSettingsDialogReferencesEveryHiveYAMLLeaf requires every hive.yaml leaf to have a Settings control. Add a Re-nudge-after field to the Labels tab next to the legacy renudge_interval it supersedes, read and write it via /api/config/governor/labels with the same positive-duration validation, and cover the round trip. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
There was a problem hiding this comment.
One concrete blocker, otherwise the dedupe logic reads correctly to me.
Red CI is your diff, and it is a one-line fix. test (dashboard 4/4) and test (dashboard shuffle 3/3) (and therefore the test/coverage aggregators) fail on
settings_parity_test.go:33: hive.yaml settings are not referenced by the Settings UI and are not allowlisted:
auto_merge.nudge_repeat_after
The new AutoMergeConfig.NudgeRepeatAfter leaf (src/pkg/config/config.go) needs either a Settings-dialog reference or an entry in src/pkg/dashboard/settings_parity_allowlist.txt (read at src/pkg/dashboard/settings_parity_test.go:18). Given its sibling governor.labels.stage.contributor_nudge.renudge_interval is operator-tunable too, I'd expect the allowlist route unless you want it in the UI.
Correctness β what I checked in the tree at the PR head, not just the diff:
nudgeDue(src/pkg/github/automerge/automerge_contributor_nudge.go:278-296): reason change β ordinal 1; same reason on a new head β(0, true), so the one comment is rewritten for the new head whileMarkNudgedReason(key, reason, 0, now)leavesNudgeReasonCount/NudgeReasonAtuntouched (src/pkg/stagelabels/store.go:1454-1457only advance onn > count). That means the 72h repeat clock runs from the first nudge for that reason class, not from the latest push β consistent with the "red for the same reason for 72h" intent, andMarkNudgedstill updatesNudgeHeadso the(0, true)branch is taken once per head, not every sweep.- The cap check moved from
NudgeCounttoNudgeReasonCount, so a PR that cycles through reason classes gets up to 2 nudges per class rather than 2 total; the body says that is the intent. - Edit-in-place via
findOwnEntryComment(β¦, ContributorNudgeMarkerPrefix)withpostedonly counted on create, so the per-sweep nudge budget is not consumed by rewrites.
No security surface touched. Docs (hive-merge.md, stage-labels.md, notifications.md, operator reference) and a changelog fragment are updated with the behaviour.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
The per-reason nudge ledger added for #17067 had no direct tests, dropping pkg/stagelabels under its 90% coverage floor. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
The red relative links and anchors resolve check is not this PR's doing: π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
The one red check is not this PR's. Everything I read in the nudge/origin-note path looks correct to me.
Red check: relative links and anchors resolve β the log ends with CHANGELOG.md: broken link 'url' -> url does not exist. This PR does not touch CHANGELOG.md; the literal [open](url) is on base v5 at CHANGELOG.md:224 and #17096 removes it. Rebasing after #17096 lands (or just re-running once it does) clears this; nothing to change here.
What I verified (tree at 9d37018, not just the diff)
src/pkg/github/automerge/automerge_contributor_nudge.go:278-295nudgeDue: ordinal 1 on a new reason class, 0 (rewrite, uncounted) on a new head for the same class, 2 only afterrepeatAftersinceNudgeReasonAt, never a third. The oldrenudge <= 0 β stage dwellfallback is gone, which is fine becausesrc/cmd/hive/merge_eligibility.go:117now setsRenudgeInterval: nudgeRepeatAfter(cfg)and:1424prefersgovernorβ¦contributor_nudge.renudge_intervalwhen set, elseauto_merge.nudge_repeat_afterwithDefaultNudgeRepeatAfter = 72h(config.go:8617-8621). Sopolicy.RenudgeIntervalis never 0 in production.- Upgrade path: records written before this PR have
NudgeReason == "", so the first pass takes the ordinal-1 branch;findOwnEntryComment(β¦, ContributorNudgeMarkerPrefix)(automerge_stage_human.go:715) still matches the old<!-- hive:contributor-nudge head=β¦marker because the search key is the prefix alone, so the existing comment is edited rather than duplicated. No second comment on upgrade. store.go:1442-1461MarkNudgedReason: a head-only rewrite passesn=0, which never lowersNudgeReasonCountor movesNudgeReasonAt, so the 72h clock is not reset by pushes β consistent with the "counted across heads" comment at:86-91.attribution.go:355-372OriginFooterNote: requires the identity footer with the origin marker and exactly one<!-- hiveoccurrence in the whole body, so a verification/blocker/status marker still routes to its own path; body-only-footer returnsok=false.origin_notes.go:47-63renderOriginNotes: continuation lines are indented two spaces byoriginNoteEntry, so a multi-line note (even one containing a markdown list) is not split by the"\n- "re-parse; cap of 10 keeps the newest.
One thing I did not verify and leave as an open question, not a finding: MarkNudged at store.go:1428-1432 still increments the per-head NudgeCount on every same-head call, and this PR now calls it with max(ordinal,1) on reason changes too, so per-head NudgeCount can exceed 2 where it previously could not. nudgeDue no longer reads it, so behaviour is unaffected unless something else gates on NudgeCount >= 2 β I did not trace every reader of that field.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
The hive's GitHub App lacks |
|
Needs a decision, not a merge: Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 5efef71. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Fixes #17067
Spam reducer #3c (2026-11-07 audit: contributor-nudge 11/day -> 34/day on 11-05; unmarked bot free-text 30-46/day since 11-04).
Changes
<!-- hive:contributor-nudge reason=<slug> head=<sha> n=<n> mode=<mode> -->. A new head or changed reason edits the existing nudge comment (findOwnEntryComment+EditComment, no notification) instead of posting another. One re-nudge afterauto_merge.nudge_repeat_after(default 72h;governor.labels.stage.contributor_nudge.renudge_intervaloverrides) if the same condition persists, then stop (cap 2 per reason). New per-reason ledger fields onstagelabels.Record(nudge_reason,nudge_reason_count,nudge_reason_at); the per-headMarkNudgedledger is kept because the adoption clock reads it.hive:originfree-text notes.github.OriginFooterNote(attribution.go, footer function only) recognises a relayed body whose only marker is the identity footer's origin marker. The relay then folds it into thehive:statuscard (agent-note:origin) in quiet mode, or appends it to one upserted<!-- hive:origin-notes -->comment per item (last 10 kept) otherwise.src/internal/testutil/comment_marker_ratchet_test.gowalkspkg/github(incl.automerge) for functions calling.Issues.CreateComment(/.CreateIssueComment(/.CreateIssueCommentBudgeted(without marker evidence (<!-- hive,Marker/marker,prstatus.,Upsert). Allow-list = the 4 transport primitives. Baseline: 45 unmarked emitters; fails if it grows, logs when it drops.Tests are table-driven, no
time.Sleep. Docs updated (hive-merge, stage-labels, sweeps-and-operations, operator-reference, notifications). Changelog fragment atchangelog.d/changed-contributor-nudge-dedupe.md.Sibling-owned files (
review_backlog.go,review_severity.go,automerge/*signoff*,hive:unauthorizedpath) untouched.