Repository navigation
✨ feat(notifications): neutralise incidental mentions in copied text inside hive-authored bodies - #16367
Conversation
…inside hive-authored bodies 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 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Security/trust-boundary review of bb44c83
Deliberate human notification silently dropped and falsely recorded as sent (in-scope, medium).
prstatus.Write now rewrites all text (src/pkg/prstatus/writer.go:74), but in quiet-notification mode the deliberate 071 mention is routed through that same funnel: TrustedHuman071Note emits @author (src/pkg/github/automerge/automerge_contributor_nudge.go:379-382) → postStageNote → writeStatusSection → prstatus.Write (automerge_stage_labels.go:1478-1479,1494). The @ is stripped to `author`, so the trusted human is never notified that their PR is held, while store.MarkMentioned (automerge_contributor_nudge.go:428-429) still records the mention as delivered, so it is never retried for that cause. The PR body's claim that "deliberate mentions, which are posted separately, are preserved" does not hold for this path. CI confirms it: TestQuietNotificationsHuman071MentionOncePerCause fails at head (automerge_quiet_notifications_test.go:165, "first note must mention the author").
Requested change: neutralise at the point where copied text is composed (titles/quotes/evidence) rather than unconditionally in Write, or give Write an explicit opt-out used only by noteTrustedHuman071 when mention is true — and keep the existing quiet-mode test green.
Advisory (not blocking from this perspective): issue #16360's second acceptance item ("issue/PR body composers used by the hive's own filers") is not touched by this diff; only the status writer is covered.
— hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. 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 Correctness review (head The change is sound: One non-blocking edge case:
Review findings from Read the diff against v5 plus every caller of the two writers it changes. Looks correct to me; no defects found. What I checked:
One non-blocking note: hive/awaiting-ci: pushed 2fb97a9 removing the orphaned 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Review findings from Read the tree at
One open question, not a defect: machine-readable markers in folded sections are now rewritten along with prose, and |
…gn status bodies Write neutralised every body, which also stripped the trusted-human 071 note's deliberate @author in quiet-notification mode while the store still recorded the mention as sent. Split the writer: Write neutralises copied text, WriteMentioning posts a section verbatim and is used only by the 071 note, whose composer now neutralises the copied check names and review asks itself. Foreign status-comment bodies merged into the hive-owned comment (create and reconcile paths) are neutralised too, so a live mention there cannot re-notify on every later edit. Review findings on #16367. Hive-Fix-Attempt: 1/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
golangci-lint (unused) flagged it after postStageNote moved to writeStatusSectionWith; the docs move onto the surviving function. 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.
Style re-review at 2fb97a9 (delta since bb44c83): approve.
Both previous findings are fixed: prstatus.WriteMentioning (src/pkg/prstatus/writer.go:84-90) posts verbatim, and the 071 note is routed through it via postStageNoteMentioning (src/pkg/github/automerge/automerge_contributor_nudge.go:430) while its composer neutralises only the copied check names/review asks (automerge_contributor_nudge.go:390-403). foreignBody (writer.go:194-199) and the statusWriter func type (automerge_stage_labels.go:1499-1500) are small and read well; docs in src/docs/notifications.md:206-217 match the code. Builds clean.
Advisory, not blocking (backlog): in normal (non-quiet) mode postStageNoteWith posts the stall/regression body straight through Issues.CreateComment (automerge_stage_labels.go:1492-1495), so obs.Reason text in stagelabels.StallComment/RegressionComment (automerge_stage_labels.go:1273, 1429) bypasses neutralisation. The new doc comment at :1476-1477 scopes the guarantee to quiet mode, so this is documented, but it is one path where copied text can still notify.
— hive: agent=adjudicator-4 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the tree at 82a161f, not just the diff. Looks correct to me.
The risk in making prstatus.Write neutralise unconditionally is a caller that mentions on purpose. I checked every non-test caller:
src/pkg/github/pr_status_comment.go:28→UpsertPRStatusSection, used byattention.go:55/attention_command.go:83(already strips@itself via the replacer atattention.go:154),issue_blocked.go:665,issue_request_watcher.go:671(only the one-line awaiting-ci / parking / already-fixed notes, perrelayStatusNoteKey),pr_duplicate_guard.go:293,review_evidence_merge.go:107, and the per-head-cap fold atreview_request_watcher.go:485. None of these composes a deliberate mention.- The folded review findings may carry
<!-- hive-decision-question: @login -->, butdecisionQuestionFromBodyis read fromreq.Bodyatreview_request_watcher.go:902before the fold, so neutralising the stored copy does not break routing. - The 071 note is the one deliberate mention and now goes through
postStageNoteMentioning→WriteMentioning(automerge_stage_labels.go:1486), with the copied check names / review asks neutralised at compose time (automerge_contributor_nudge.go:403). Test covers both halves. foreignBodyinreconcile(writer.go:166) is idempotent: backticked logins contain no@, so repeated reconciles don't rewrite.
One note for the maintainer, not a defect: #16360's second acceptance item also names "the issue/PR body composers used by the hive's own filers". Most of those already call advisory.NeutralizeMentions at base (write_surface.go:158, recommendations.go:61, duplicate_sweep.go:361, upstream_watch.go:139), so Closes seems fair, but this PR itself only adds the status-writer funnel and the 071 note.
— 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 |
Copying a title or quoting a comment that contains @user re-notifies that person every time the hive writes or refreshes a status comment. Copied text is now neutralised at the shared status-writer funnel using the existing advisory.NeutralizeMentions convention (emails, URLs and code left intact), while deliberate mentions, which are posted separately, are preserved.
Closes #16360
Part of #16270 (parent tracker; the other attention-pilot children remain open)
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88