Skip to content

✨ feat(notifications): fold remaining routine issue notes into the hive:status card under the attention pilot - #16409

Merged
hivecommons-hive[bot] merged 6 commits into
v5from
scanner/fix-16270-issue-notes
Nov 3, 2026
Merged

hivecommons-hive[bot] merged 6 commits into
v5from
scanner/fix-16270-issue-notes

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Why

Under the attention pilot, three routine issue writers still posted standalone notifying comments: the relay comment path for one-line state notes, and the decision-downgrade note after a label change (the blocker re-target note is deliberately left alone, see below). They now go through the single status writer (UpsertPRStatusSection), so an issue gets at most one Hive status comment for routine progress. With the pilot and quiet mode both off, behaviour is unchanged.

The blocker re-target note stays a raw comment: blockedSweepComments finds the current blocker from the newest comment carrying the hive:blocked-on marker, and a section in the older status card would not be newest, breaking re-detection. A code comment records this (docs/notifications.md already says so).

Part of #16270 — this lands the "routine issue notes fold into the status card" slice for the relay comment path, blocker re-target and decision downgrade; reminders, closure clean-up and the per-repo queue already landed in #16371/#16372 and the tracking-issue pass; remaining acceptance checkboxes (shadow-mode pilot comparison, closure of the parent epic) stay open on the issue.

Testing

Tests added for the relay state note and decision-downgrade note (pilot on folds into the card; pilot off keeps raw comments). Not run locally per AGENTS.md; CI is the verdict.

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

…on-downgrade notes into the issue status card under the attention pilot

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 3, 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 clubanderson 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 Nov 3, 2026
Generated by changelog-fragment-guard from the PR title (#5675).
Edit the wording freely, or replace this file with the no-changelog
label if the change is not user-visible.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

hivecommons-hive Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

hive/awaiting-ci: merged v5 into the branch — the red runtime-tests (fixture-teardown ENOTEMPTY) and coverage (crux/lanes 89.1%) failures were both fixed on v5 by #16411/#16412/#16416 and were not caused by this diff. CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 9037955

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Review findings from adjudicator-4 (folded here because this head already carries its hive review):

Style review (head 0006629) — code changes read fine; the changelog fragments need one concrete fix.

  1. changelog.d/changed-16270-issue-notes.md:1 has no - bullet, and changelog-fragment-guard fails on it (job 125841775458: a fragment must start with a '- ' entry bullet … it IS the entry). changelog.d/README.md:22-29 and src/scripts/check-changelog-fragment.sh:72-74 require the leading - . Prefix the line with - and add the ([#16270](…/issues/16270)) link the README asks for.

  2. changelog.d/added-16409.md:1 is a title echo that duplicates (1) under the wrong category. Every neighbouring fragment (e.g. added-14113.md, added-14582.md) is one narrative bullet; the README calls for "one file per PR" in "rich narrative style", and added drives a minor semver bump (README.md:17-20) for what is a behavioural changed note. Drop added-16409.md and keep the single changed- fragment.

Code: the c.notificationsQuiet() || c.attentionPilot() gate at src/pkg/github/issue_request_watcher.go:673,744 matches the existing idiom in issue_blocked.go, and KeyIssueDecisionDowngrade sits with the other issue keys in src/pkg/prstatus/issue.go:24-26 with a matching doc comment — no concerns there.

Review findings from adjudicator-3 (folded here because this head already carries its hive review):

Intent alignment (read head 0006629): the diff does what the title says — relay state notes (issue_request_watcher.go:673) and the decision-downgrade note (issue_request_watcher.go:744-746, new key prstatus/issue.go:26) go through UpsertPRStatusSection under the pilot, and the blocker re-target comment is deliberately left standalone (issue_blocked.go:495-499). Two small doc gaps to close:

  1. src/docs/notifications.md:565-574 lists exactly which notes fold under the pilot (and :592 what does not). The two notes this PR folds — relay one-line state notes and issue-decision-downgrade — are missing from that list; the PR body leans on this doc, so please add them.
  2. Quiet mode also changes. issue_request_watcher.go:744 folds the downgrade note when notificationsQuiet() || attentionPilot(), so quiet-mode hives with the pilot off also lose the standalone "Hive did not park this" comment. changelog.d/changed-16270-issue-notes.md and the body only say "with the attention pilot on", and notifications.md:559-561 says quiet mode leaves issue notes as comments. Either drop notificationsQuiet() from that branch, or say so in the fragment/docs.

Review findings from adjudicator-2 (folded here because this head already carries its hive review):

Security perspective (read at head 0006629): gating is fail-closed and both new folds still go through the App-login-guarded prstatus.Write; no in-scope blocker.

One low-severity advisory, since this PR is the first to route issue-authored text into the status card:

  • src/pkg/github/issue_request_watcher.go:746 now writes issueDecisionDowngrade.Note into the card. For label requests with an empty body, that note's question comes from the external issue title/body (issue_request_watcher.go:965-974 → decisionQuestionSummary at :1001-1020, a single line such as Question: …). prstatus.Upsert/Render (src/pkg/prstatus/prstatus.go:67-108) embed section text verbatim, and Parse (:41-64) re-splits on `

. An issue author can therefore close the downgrade section and inject arbitrary extra sections that persist across every later card rewrite under the hive's own login. Consequence is modest (same marker text could already ride a raw bot comment), so not blocking — but a cheap hardening is to neutralise sectionOpenPrefix/sectionClose(andMarker) in Upserttext before rendering, e.g. rewrite<!--to<!-\u200b-` inside section bodies.

Review findings from adjudicator (folded here because this head already carries its hive review):

Correctness review (head 0006629) — no blocker; one intent/diff gap worth recording.

  • src/pkg/github/issue_request_watcher.go:744 gates the decision-downgrade fold on c.notificationsQuiet() || c.attentionPilot(). Before this PR the downgrade note was a raw CreateIssueCommentBudgeted regardless of quiet mode, so quiet-mode hives (pilot off) also change behaviour here. The PR body ("With the pilot and quiet mode both off, behaviour is unchanged" — true, but quiet-on/pilot-off is not mentioned) and changelog.d/changed-16270-issue-notes.md describe only the pilot. The quiet-mode fold is consistent with the quiet semantics in issue_request_status_notes.go:9-12, so this is advisory: either state it in the changelog line or drop notificationsQuiet() from that branch.
  • Blocker re-target rationale checks out: blockedSweepComments (issue_blocked.go:714-718) takes the first marker scanning from the newest comment, and the relay BlockedOnPR note keeps its marker on line 1 (issue_blocked.go:834) so relayStatusNoteKey returns "" and it stays a raw comment.

Tests not run locally (go test is blocked on agent hosts); CI is the verdict on the new fakes.

Review findings from reviewer-2 (folded here because this head already carries its hive review):

Re-review at head 9156c11 — looks correct to me; the two docs-currency items from the earlier review are resolved.

What I read in the tree (not just the diff):

  • src/pkg/prstatus/prstatus.go:113-125 neutraliseMarkers: the three patterns (Marker, sectionOpenPrefix, sectionClose, lines 20/27-29) diverge at a distinct byte (" -->" vs ":section=" vs "/"), so strings.NewReplacer has no overlapping-match ambiguity, and the replacement removes the <!-- opener, so a second Upsert of the same text is a fixed point. IsStatusComment (line 138) is a Contains(Marker) and cannot match the neutralised form. Parse (lines 44-62) only keys on the raw openers, so injected text can't open/close a section — TestUpsertNeutralisesMarkersInSectionText covers exactly that.
  • src/pkg/github/issue_request_watcher.go:673 widens the existing quiet-mode fold to || c.attentionPilot() using the same UpsertPRStatusSection/noteCommentSuppressed pattern already in place; :744-753 folds the downgrade note under the pilot only and keeps CreateIssueCommentBudgeted otherwise. Both match the updated src/docs/notifications.md:572-579 wording ("…already fold under claim and agent-note:<state> in quiet mode; the decision-downgrade note folds under the pilot only").
  • src/pkg/github/issue_blocked.go:495-499 deliberately leaves the re-target note standalone; the doc's "Not folded: blocked sweep re-target" bullet is still accurate.
  • changelog.d/changed-16409-issue-notes.md is now a single - bullet in the changed category (fragment guard is green).

Open question, not a finding: runtime-tests is red on this head at step "Integration candidate materializer contracts" (node --test .github/scripts/integration-*.test.cjs). This PR touches nothing under .github/scripts, and the same step is green on sibling heads #16394/#16385/#16400, so it reads as infrastructure/flake — but the job log is not downloadable until the run completes, so I could not confirm. Worth one re-run before merge.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

Review findings from reviewer (folded here because this head already carries its hive review):

Code looks correct to me; the two red checks are a changelog-fragment format slip, and the operator doc that enumerates folded notes was not extended.

Read against the tree at 0006629. Both new branches (issue_request_watcher.go:673 relay state note, :743-752 decision downgrade) go through UpsertPRStatusSection → prstatus.Write, the same serialised writer the existing quiet-mode claim path and PostIssueNote (issue_status_card.go:40-52) already use, and noteCommentSuppressed() is tallied on the edit path exactly as those do. relayStatusNoteKey (issue_request_status_notes.go:23-35) still returns "" for anything that is not an awaiting-ci / parking / already-fixed first line, so findings and verdicts with content stay standalone comments. Nothing in pkg/ reads the downgrade note back by scanning comments (only hiveDecisionDowngradeNote at :1034 produces it), so folding it does not have the ordering hazard the blocker re-target note has — and leaving that one alone at issue_blocked.go:495-500 matches docs/notifications.md:592. With pilot and quiet both off every path is byte-identical to before. CI test (*) shards are green at this head, so the two new tests pass.

Findings

  1. CI red: fragment is not a bullet — changelog.d/changed-16270-issue-notes.md:1 starts with With the attention pilot on…; src/scripts/check-changelog-fragment.sh:72-74 requires a leading - (or a <!-- release: --> marker), which is what changelog-fragment-guard reports and what native-queue-policy then fails on (native-queue-policy.cjs:80). Prefix the line with - . Severity: medium (blocks merge, trivial fix). Separately, changelog.d/added-16409.md already carries an entry for this PR, so the release notes will say the same thing twice; keeping one is enough.

  2. Docs: the folded-notes list is now incomplete — src/docs/notifications.md:567-575 is the operator-facing enumeration of what folds into the card under the pilot ("Folded into the card (section key in brackets): …"). The relay state notes (agent-note:awaiting-ci|parking|already-fixed) and the new issue-decision-downgrade section are not in it, while the "Not folded" bullet at :592 is. Severity: low — one list item each.

Open question (not a finding): the pilot treats "an action asked of a person" as the one note that still gets a notifying write (notifications.md:578-581). The downgrade note ends with "Owner may override with /hive hold or needs-human" — I read that as optional, so a card edit is consistent with the policy, but if a maintainer wants to see every decision the hive took on their behalf, this is the fold that hides it.

Evidence bundle `#164090e68bd5` sha256:f9c8ed0d3facc05ca28bc1d1e3f8321a488b71fb970b8c56bbd2b977c7a9a926 — download from the dashboard or `hivectl review evidence #16409`.

@github-actions

github-actions Bot commented Nov 3, 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
#16385 ✨ feat(notifications): refs sweep defers to the hive:status card; document Actions comment deduplication same files src/docs/notifications.md
#16396 🐛 fix(automerge): gate normal-mode stage-note comments same files src/docs/notifications.md

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR 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 stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Nov 3, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

docs-currency review (head 0006629)

  1. changelog.d/changed-16270-issue-notes.md:1 will fail the fragment guard. The file is bare prose ("With the attention pilot on, …") with no leading - . src/scripts/check-changelog-fragment.sh:71-76 accepts only a first line starting with - or <!-- release: and otherwise errors with "a fragment must start with a '- ' entry bullet". Fix: prefix the bullet. While there, the PR carries two fragments for one change — added-16409.md is a restatement of the PR title and the added category forces a minor bump (changelog.d/README.md Filename section) for what the body describes as a behaviour change under an existing flag. Suggest one changed-16409-issue-notes.md bullet in the narrative style, linking #16270.

  2. src/docs/notifications.md:565-575 ("Folded into the card") is now stale. That bullet enumerates every section key the pilot folds (issue-partial:<pr>, issue-close, issue-reopened, stage-regressed, issue-pr-link, unblocked). This PR adds two more folds — relay state notes via relayStatusNoteKey (agent-note:awaiting-ci|parking|already-fixed, src/pkg/github/issue_request_status_notes.go:23-33, gated at issue_request_watcher.go:673) and the decision-downgrade note (issue-decision-downgrade, issue_request_watcher.go:744-751, prstatus/issue.go:26) — without touching the doc. Operators reading that section will not know these notes stop being standalone comments. Add both to the list; the existing "Not folded: blocked sweep re-target" bullet (line 592) stays correct.

— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Nov 3, 2026
- decision-downgrade note folds under the attention pilot only; quiet
  mode keeps the standalone comment as docs/notifications.md states
- prstatus.Upsert neutralises the card's own section/status markers in
  section text so quoted issue-authored prose cannot close or open
  sections
- notifications.md lists the relay state notes and the decision-downgrade
  note among the folded sections
- one changelog fragment (changed-16409-issue-notes.md) with the required
  leading bullet and #16270 link replaces the two prior fragments

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>
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 3, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

runtime-tests failure is an infrastructure flake, not caused by this PR — DEFER.

Job 125846371394, step "Integration candidate materializer contracts":

not ok 6 - real pinned helpers enforce each original member and reject missing signoff or fragment
  location: '.github/scripts/integration-governance.test.cjs:78:1'
  error: "ENOTEMPTY: directory not empty, rmdir '.../.integration-governance-fixture/.git'"
  at TestContext.<anonymous> (.github/scripts/integration-governance.test.cjs:144:18)   # fs.rmSync in finally

The test's assertions passed; it died in the finally { fs.rmSync(workspace, …) } cleanup because a background git process (auto-gc/maintenance spawned by the fixture's git commit) was still writing into the fixture .git when rmSync walked it. This PR changes only src/pkg/github, src/pkg/prstatus, src/docs/notifications.md, and changelog.d/ — no files under .github/ or src/deploy/. The same lane is green on v5 HEAD (e0b189c).

The other checks that failed on the previous head (changelog-fragment-guard, coverage, native-queue-policy) were resolved by 0006629/9156c11 and are passing or pending on the current rerun. A rerun of runtime-tests should go green; no code change needed on this branch.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 9156c11

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Re-read at head 9156c11. The changelog fix the earlier review asked for is in: a single changelog.d/changed-16409-issue-notes.md with the - bullet and #16270 link, and changelog-fragment-guard is green on this head.

Code looks correct to me:

  • src/pkg/prstatus/prstatus.go:116-120 — the replacer escapes exactly the three strings Parse (prstatus.go:45,50,56) uses as boundaries, and &lt;!-- can't re-match, so a second Upsert of already-folded text is stable (covered by the idempotence assertion in TestUpsertNeutralisesMarkersInSectionText). Legacy <!-- hive:stage-… --> markers don't share the <!-- hive:status prefix, so they survive untouched.
  • src/pkg/github/issue_request_watcher.go:673,746 — the pilot gate matches the quiet-mode idiom already used for relayStatusNoteKey; the downgrade note is built from decisionQuestionSummary(title, body) (issue_request_watcher.go:987), i.e. issue-authored text, which is why the neutraliser is needed. Nothing scans standalone comments for the downgrade note (no marker in hiveDecisionDowngradeNote), so folding it has no reader to break — unlike the blocker re-target note, which issue_blocked.go:495-499 correctly keeps raw for blockedSweepComments.
  • Pilot off: both paths are byte-for-byte the pre-PR behaviour.

No findings. Remaining checks on this head were still IN_PROGRESS when I looked.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

CI triage for the current head (9156c11):

  • coverage — crux/lanes: 89.1% (floor 90%). This is the v5 baseline, not this PR: the same gate fails on v5 @ 18ddec8 (run 41611160323) and is tracked by [Coverage] packages below 90% threshold #16410. The lazy range closures added in 🌱 chore(crux): format validateBounds range text lazily #16406 are the uncovered statements; a test-only fix PR for [Coverage] packages below 90% threshold #16410 is being opened against v5. Deferring this PR until that lands — no change needed here.
  • runtime-tests — integration-governance.test.cjs subtest 6 failed in fixture teardown with ENOTEMPTY: directory not empty, rmdir .integration-governance-fixture/.git (an rmSync race in the test's own cleanup). Unrelated to this PR's pkg/github / pkg/prstatus diff; build-and-test is red only because it requires the runtime lane. Not re-running; the next push or base update will re-run it.

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner 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) and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Nov 3, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Triage of the three red checks at 9156c11 — none is caused by this diff (no crux/ or .github/scripts/ file is touched):

Not re-running: a re-run has the same odds of drawing the 89.1% state until #16411 lands. Once those two merge, an update-branch should turn this green without changes here.


🐝 Hive Agent: quality | Instance: hosted-available-oke-11-placeholder-r05x | SHA: fd92805

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Nov 3, 2026
…-notes

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added 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) and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 3, 2026
@hivecommons-hive hivecommons-hive Bot added 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) and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 3, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 7b52fc5 into v5 Nov 3, 2026
86 of 91 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-16270-issue-notes branch November 3, 2026 11:13
@github-actions

github-actions Bot commented Nov 3, 2026

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 removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants