Skip to content

🐛 fix(automerge): gate normal-mode stage-note comments - #16396

Merged
kubestellar-prow[bot] merged 3 commits into
hivecommons:v5from
thatguywob:fix-16393-stage-note
Nov 3, 2026
Merged

kubestellar-prow[bot] merged 3 commits into
hivecommons:v5from
thatguywob:fix-16393-stage-note

Conversation

@thatguywob

Copy link
Copy Markdown
Contributor

Summary

Normal-mode stage notes bypassed the notification write primitive with a raw go-github comment create. Route them through the transport's CreateIssueComment so the canary gate and effects journal apply, and fail closed if the transport lacks that primitive.

Update the notification inventory, documentation, raw-write baseline, and changelog.

Related issues

Fixes #16393

Testing

  • Added regression coverage for ordinary and deliberate-mention stage notes, transport refusal, and missing primitive support, including assertions that no raw HTTP write occurs.
  • gofmt -l on changed Go files: clean.
  • Tests not run locally per AGENTS.md; CI runs validation for agent-authored PRs.

Contributor checklist

  • Changelog fragment added.
  • Targets v5.
  • Title follows the emoji convention.
  • Commit includes DCO sign-off and Hive trailers.
  • Notification inventory and documentation updated.
  • No secrets, credentials, or local runtime state committed.

— hive: backend=codex


🐝 Hive Agent: contributor | SHA: 28c56fd5a

Route stage notes through the transport comment primitive so normal-mode notifications use the canary gate and effects journal. Cover forwarding, write refusal, and missing primitive behavior.

Hive-Run: hivecommons#16393
Hive-Plan: normal-mode-stage-note-write-gate
Hive-Spec: hivecommons#16393#normal-mode-stage-note
Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 3, 2026
@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.

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Failing checks:

  • coverage
  • test
  • test (rest 1/4)
  • test (rest 2/4)

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Your relay session received this as a fix-pr task and launched a parallel fix session; your current work continues.

Reuse the existing status comment creation adapter for normal-mode stage notes, keeping the single transport write site and fail-closed behavior. Preserve the comment primitive in the superseded-closer test spy.

Hive-Run: hivecommons#16393
Hive-Plan: normal-mode-stage-note-write-gate
Hive-Spec: hivecommons#16393#normal-mode-stage-note
Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Read the tree, not just the diff — this looks correct to me.

  • automerge_stage_labels.go:1495-1498 now funnels normal-mode notes through the same engineStatusForge.CreateComment (:1552-1558) that quiet mode already reached via prstatus.Write, so both modes hit the transport's CreateIssueComment and fail closed with the existing "transport has no comment primitive" error when it is missing. The raw c.gh.Issues.CreateComment call this removes was the last normal-mode stage-note bypass; the baseline drop 4 → 3 in writeback/testdata/direct-writes-baseline.txt matches that single removal.
  • Fail-closed is safe in production: the only live caller of ApplyStageLabels is cmd/hive/main_sweeps.go:923 passing ghClient *github.Client, and *github.Client implements CreateIssueComment at pkg/github/client.go:2945. Only test fakes are affected, which is why the stageSupersededCloserSpy wrapper needed the forwarding method in automerge_stage_human_test.go:695-699.
  • notification_write_sites.go:35 registers postStageNoteWith as status, which is the correct attribution target since the forge's CreateComment is marked passthrough (:32).
  • New test automerge_stage_note_test.go covers both Write/WriteMentioning entry points, the refused-write path, and asserts zero raw HTTP writes against an httptest server.

Body and diff agree (Fixes #16393). Go test jobs were still in progress when I read this; nothing else to flag.

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

Remove the stale direct-producer entry after normal-mode stage notes moved to engineStatusForge.CreateComment, whose existing status classification covers both modes.

Hive-Run: hivecommons#16393
Hive-Plan: normal-mode-stage-note-write-gate
Hive-Spec: hivecommons#16393#normal-mode-stage-note
Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Ready for a human merge: verdict approved @37e1dcb, 61/61 checks green, DCO yes, soak 10m0s elapsed. Blocked only by role/contributor (below require_tiers).

The hive never approves on your behalf: /lgtm /approve (or merge) if you accept it.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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

hive/awaiting-ci: all checks are green and the hive review is approve, but the merge relay refused the squash with contributor-lane:claim-tier-untrusted (author tier "contributor"; merge requires tier merger/trusted). Nothing left to fix on the branch — this needs a maintainer to merge.


🐝 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

@clubanderson clubanderson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Owner decision for reviewed head 37e1dcb: approve this scoped change. Both normal-mode entry points now use the same existing engineStatusForge.CreateComment adapter as quiet mode, which reaches the production gated CreateIssueComment primitive and fails closed if absent. The regression cases cover ordinary/deliberate-mention notes, transport refusal, missing primitive, and zero raw writes. The direct-write baseline decreases by precisely the removed bypass. This approval is for this PR/head only; it does not enroll its author in any global trusted-author or approver list. Retain normal CI and merge gates.

@clubanderson

Copy link
Copy Markdown
Member

/hive decision approve Approve the scoped stage-note gate change reviewed at 37e1dcb. This is not a blanket author-trust grant; all normal gates remain.

/lgtm
/approve

@kubestellar-prow kubestellar-prow Bot added lgtm Indicates that a PR is ready to be merged. labels Nov 3, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 8ed07f286e76411888624393b8bd7e71ed2834be

1 similar comment
@kubestellar-prow

Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 8ed07f286e76411888624393b8bd7e71ed2834be

@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: clubanderson

The full list of commands accepted by this bot can be found here.

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 3, 2026
@kubestellar-prow
kubestellar-prow Bot merged commit cff2ec2 into hivecommons:v5 Nov 3, 2026
73 of 77 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[reviewer] Review backlog (intent-alignment): Normal-mode stage-note create remains a raw go-github CreateComment

2 participants