Repository navigation
🐛 fix(automerge): gate normal-mode stage-note comments - #16396
Conversation
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>
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
|
@thatguywob this PR is back in your court ( Failing checks:
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 |
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>
There was a problem hiding this comment.
Read the tree, not just the diff — this looks correct to me.
automerge_stage_labels.go:1495-1498now funnels normal-mode notes through the sameengineStatusForge.CreateComment(:1552-1558) that quiet mode already reached viaprstatus.Write, so both modes hit the transport'sCreateIssueCommentand fail closed with the existing "transport has no comment primitive" error when it is missing. The rawc.gh.Issues.CreateCommentcall this removes was the last normal-mode stage-note bypass; the baseline drop4 → 3inwriteback/testdata/direct-writes-baseline.txtmatches that single removal.- Fail-closed is safe in production: the only live caller of
ApplyStageLabelsiscmd/hive/main_sweeps.go:923passingghClient *github.Client, and*github.ClientimplementsCreateIssueCommentatpkg/github/client.go:2945. Only test fakes are affected, which is why thestageSupersededCloserSpywrapper needed the forwarding method inautomerge_stage_human_test.go:695-699. notification_write_sites.go:35registerspostStageNoteWithasstatus, which is the correct attribution target since the forge'sCreateCommentis marked passthrough (:32).- New test
automerge_stage_note_test.gocovers bothWrite/WriteMentioningentry 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>
|
Ready for a human merge: verdict approved @37e1dcb, 61/61 checks green, DCO yes, soak 10m0s elapsed. Blocked only by The hive never approves on your behalf: |
|
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 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
clubanderson
left a comment
There was a problem hiding this comment.
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.
|
/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 |
|
LGTM label has been added. DetailsGit tree hash: 8ed07f286e76411888624393b8bd7e71ed2834be |
1 similar comment
|
LGTM label has been added. DetailsGit tree hash: 8ed07f286e76411888624393b8bd7e71ed2834be |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
Normal-mode stage notes bypassed the notification write primitive with a raw go-github comment create. Route them through the transport's
CreateIssueCommentso 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
gofmt -lon changed Go files: clean.Contributor checklist
v5.— hive: backend=codex
🐝 Hive Agent:
contributor| SHA:28c56fd5a