Repository navigation
✨ feat(notifications): attention-pilot opt-in flag and issue-side hive:status card - #16371
Conversation
…e:status card Quiet mode folds the hive's PR bookkeeping into one edited hive:status comment, but issue notes stayed comments of their own, so one issue lifecycle (partial merge, remainder, close) still emailed every watcher several times (#15862, #15966). Add github.notifications.attention_pilot (default off), the single gate every attention-pilot child of #16270 reads. With it on, routine issue notes (partial work, close/auto-close narration incl. decomposed parents, reopened-after-merge, stage regressions, the covering-PR note, the blocker-settled note) become sections of the issue's hive:status card via the same prstatus.Write single writer. A newly required action (confirm a merged fix) is recorded on the card and still announced by exactly one notifying write, because an edit notifies nobody. With the flag off every call site runs its original write unchanged. Closes #16358 Part of #16270 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.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 |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: pushed d999251 — routed issue_status_card.go writes through writeback.Gate (TestDirectWriteRatchet) and allowlisted github.notifications.attention_pilot, yaml-only like its sibling github.notifications.mode (TestSettingsDialogReferencesEveryHiveYAMLLeaf). CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Review findings from docs-currency (delta fd5b74d…d999251)
Prior findings (pr_status_comment.go:85, issue_status_card.go:79 dedupe trust, prstatus/issue.go:14, notifications.md:418 row order, close_on_merge.go:671) are untouched by the delta and still present. Review findings from Style/conventions review at head fd5b74d — no in-scope blocker; two advisory notes.
Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. Review findings from docs-currency (read at head 2fb0ce9) — docs match the behaviour; two statements in the new in-code documentation overclaim what the flag folds, which matters because the sibling pilot PRs (#16359, #16361–#16363) will read these as the contract.
Verified as accurate: flag default/parse, Review findings from Not ready as-is: the PR's own acceptance-3 test fails deterministically, and the cause points at a behaviour gap the body and docs don't describe. Read against 1.
|
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
…ient.go insert The issue-side status card adds helpers above it, so the cited range moved by seven lines; the link checker reported the drift. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Read issue_status_card.go, prstatus/issue.go and every folded call site against the v5 tree. Looks correct to me; the "flag off ⇒ unchanged" claim holds by construction.
What I verified:
- Legacy path is byte-for-byte the old write. Each call site passes its original call as the
legacyclosure, with the samectx(WithRESTCaller(ctx, "hive:close_on_merge")still reaches the rawIssues.CreateCommentinsrc/pkg/github/close_on_merge.go:629-631,:646-649,:671-674). WithattentionPilotFn == nilthe closure is allPostIssueNoteruns (issue_status_card.go:44-46). - Dedupe markers survive the fold.
closeOnMergeAwaitingComment, the<!-- hive:partial-pr -->body inissue_stage_labels.go:686, and the regression/close notes all keep their legacy marker inside the section text, andprstatus.Parse(src/pkg/prstatus/prstatus.go:41-64) only consumes-->after the key, so a marker in the body does not truncate the section. Keys with:(attention:…,issue-partial:N) parse fine for the same reason. - Exactly-one announcement.
PostIssueAttentionwrites the explicit comment first (:85-91) and then the card section, and both carryIssueAttentionMarker(cause), so a retry after a failed edit seesannounced == truefrom either and only re-edits. Marker is suffixed-->, socause=…-12can't prefix-match…-123. - Card heading is item-neutral (
prstatus.Heading,prstatus.go:24), so the issue card doesn't read as a PR card. ensureIssueStagePRLink's archived-repo detection (issue_stage_labels.go:857) still works: with the pilot off the legacy error is returned unwrapped; with it on the forge wraps with%w.
One non-blocking observation: under the pilot, decomposed_parents.go:300-302 and the stage-lane sites route around CreateIssueCommentBudgeted — card creation goes through unbudgeted CreateIssueComment via clientStatusForge.CreateComment. That's one comment per issue lifetime, so I don't think it needs a change, but worth knowing when reading comment-budget counters with the pilot on.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
…eback gate and allowlist the attention_pilot setting Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Intent-alignment delta review (fd5b74d → d999251, 2 files).
Gate refusal permanently loses the attention announcement — src/pkg/github/issue_status_card.go:89-95
The new issueAttentionAllowed check (line 89) returns false both when the gate refuses and when the issue read fails (lines 106-109). On either path execution falls through to line 95, which writes body+"\n"+marker into the card section. On the next pass the dedupe loop at lines 76-84 runs strings.Contains(b, marker) on every comment including the card itself, so announced becomes true and the explicit comment is never created. The doc comment at lines 102-104 ("A failed issue read refuses the comment; the next pass retries it") is therefore not what the code does, and the issue's acceptance criterion (#16358: "Newly required action arriving after the card exists still produces exactly one explicit attention event") yields zero events after a transient read error. Before this delta the comment-first ordering (line 86-88) guaranteed the marker only reached the card after the comment succeeded; the delta breaks that invariant.
Suggested fix: when !announced && cardExists and the gate returns false, write the section without the marker (or return early after the section write), so the marker only lands on the card once the announcement has actually been posted. A test for the refused/failed-read path would pin this.
Previous findings at this head: pr_status_comment.go:85 (fold on mode) and issue_status_card.go:78 marker-trust — still present, untouched by the delta; the three style notes are outside the delta and unchanged.
— hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88
…ppressed and retry A write-back gate refusal of the explicit issue-attention comment was swallowed as false: nothing was posted, yet the marker was still written into the card and close-on-merge reported awaiting_confirmation, so the one notifying write was lost for good. Return writeback.ErrSuppressed (or the issue-read error) before any write, as attentionDelivery.Post does, so the caller lands on a retried Noop and the next pass announces once the policy admits it. The statusCommentServer fixture now answers GET for the issue itself so the gate can build its item; a new test covers refusal then admission. Hive-Fix-Attempt: 1/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Read the new card helpers against their callers and the marker readers at v5; this looks correct to me.
- Default-off is real:
src/pkg/github/issue_status_card.go:43-46and:75-77runlegacy(ctx)wheneverattentionPilotFnis nil/false, and every folded call site passes a closure that is byte-identical to the previous inline write (close_on_merge.go:629-631,645-648,671-674,issue_stage_labels.go:609-611,687-689,715-717,777-779,decomposed_parents.go:300-303). Onlyissue_blocked.go:666changes a predicate, and it widens into the already-tested quiet path. - Marker readers survive the fold:
prstatus.Render(prstatus.go:67-78) only trims section bodies, so<!-- hive:close-on-merge -->/ reopened / awaiting markers remain verbatim inside the card, andcloseOnMergeMarkers(close_on_merge.go:945-975) usesstrings.Containsover every comment body — the card is just another comment to it. PostIssueAttentionordering (issue_status_card.go:92-110) posts the tagged announcement before the card edit, so a failed edit retries the edit only; the writeback gate is consulted before any write (:124-145) and a refusal returns without recording the marker.
Two checks show CANCELLED at 2fb0ce9 (Sign-off survives the squash, native-queue-policy); nothing in the diff touches them, so a re-run should be all it needs before tide picks it up.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Closes #16358
Part of #16270 (parent tracker; siblings #16359, #16361-#16363 own ack/snooze, reminders and the attention queue)
What
github.notifications.attention_pilot(bool, default off), added next tomodeandshadowinGitHubNotificationsConfigand wired live viaClient.SetAttentionPilot, following theshadowflag's pattern ([scanner] Shadow-mode 'would notify' instrumentation and write-site classification for notification-capable writes #16264). This is the single gate every attention-pilot child reads.src/pkg/github/issue_status_card.go, new keys insrc/pkg/prstatus/issue.go):PostIssueNote(key, body, legacy): pilot off ⇒ runs the call site's original write unchanged; pilot on ⇒ writes sectionkeyof the issue'shive:statuscard throughprstatus.Write(the same single writer as the PR card: per-item lock, compare-and-retry, duplicate merge).PostIssueAttention(cause, body, legacy): pilot on ⇒ the action is put on the card underattention:<cause>, and announced by exactly one notifying write: creating the card if the issue has none, otherwise one explicit comment tagged<!-- hive:attention cause=… -->. Once that tag exists, later passes only refresh the card. The explicit comment is posted before the card edit, so a failed edit is retried later without a second announcement.unblocked) note (in anymode). Close-on-merge's awaiting confirmation (/fixedor/reopen) asks a person to act, so it goes throughPostIssueAttention.PostIssueNotestatus passthrough,PostIssueAttentionattention) innotificationWriteSitesand its docs table. New docs section insrc/docs/notifications.md, a pointer in the operator reference, and a changelog fragment.Why this design
CreateIssueComment) aslegacy. That makes "flag off ⇒ no change" true by construction, not just by testing.prstatus.Write. Concurrent sweeps (close-on-merge, stage lane, blocked sweep) on one issue therefore serialise and merge into one comment instead of racing.prstatus.Writeis not modified, to avoid conflicting with ✨ feat(notifications): neutralise incidental mentions in copied text inside hive-authored bodies #16367.strings.Containsdedupe (close-on-merge markers, partial-PR marker, closed-stage marker) still sees them.Tests (CI is the verdict; nothing was run locally)
TestIssueStatusCardPilotOffUnchanged: unwired and explicitly off both run the legacy writes, with no card or attention marker (acceptance 1).TestIssueStatusCardPilotFoldsRoutineNotes: six concurrent writers plus the unblocked note give exactly one status comment, legacy markers are preserved, and later routine progress creates nothing (acceptance 2).TestIssueStatusCardAttentionAfterCardExists/…CreatesCardOnce: a new action after the card exists gives exactly one explicit comment, repeats give none, and a new cause gives its own single event (acceptance 3).TestGitHubNotificationsAttentionPilotDefaultsOff: the flag defaults off andattention_pilot: trueparses as on.Deliberately left out
blocked-onmarker by comment order, and a section in an older card would not be newest. This is documented.claimviaPostNoteOrFoldin quiet mode, and verified-open notes come from the agent relay path (already folded in quiet mode)./hive ack,/hive snooze, reminders and the attention queue belong to siblings [scanner] Attention pilot: /hive ack and /hive snooze commands and the attention action contract #16359 and [scanner] Attention pilot: 24h reminder policy skipped on ack, snooze or recipient action #16361–[scanner] Attention pilot: Hive-maintained Actions workflows update or skip when the runtime covers the condition #16363.— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88