You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[reviewer] Review backlog (style): Ledger lock discipline split between workflowApprovalLedger and SweepWorkflowApprovals #16738
Blocked on PR #16736.src/pkg/github/workflow_auto_approval.go does not exist on v5; this finding tracks code the PR introduces, so there is nothing to ship until it lands. The hive lifts the blocked label when the PR merges or closes.
Filed from an out-of-scope finding in the Hive review of PR #16736.
PR: #16736 (#16736)
Perspective: style
Severity: low (P3)
Finding: Ledger lock discipline split between workflowApprovalLedger and SweepWorkflowApprovals
Evidence: src/pkg/github/workflow_auto_approval.go:262
workflowApprovalLedger owns touchLocked/record, but SweepWorkflowApprovals mutates c.workflowApprovals.attempts[key] directly under manual Lock/Unlock in two more places (deniedCounted at ~L262-267 and the attempted claim at ~L292-299). The once-per-head invariant is therefore enforced by caller-side lock sequences rather than by the ledger type, so a future caller or second sweep site can skip a step. Suggested later cleanup: add ledger methods such as markDeniedCounted(key) and claim(key) bool and have the sweep call those; also comment that the first splitTrustedWorkflowRuns call (headRepo "") exists only to count denials, since its trusted result is discarded and recomputed after the fresh PR read (~L257, ~L283). Readability only; behavior and tests are correct.
Already addressed in the code that merged with #16736 (v5 6ed3e5ea4). The finding cited an earlier PR revision (9e1821eb). On v5, workflowApprovalLedger owns both mutations: markDeniedCounted(key) and claim(key) bool (src/pkg/github/workflow_auto_approval.go L114-137). SweepWorkflowApprovals calls them (L317, L348) and does no direct attempts[key] writes. The first splitTrustedWorkflowRuns call already carries the comment "This first split only counts denials off the listing; its trusted set is discarded and recomputed after the fresh PR read below" (L313-314). The follow-up PR for #16739/#16743 adds release(key) to the ledger in the same style. Closing as not planned.
Unblocked: #16736 merged and the finding's file is still on the base branch. This item is actionable now; check the finding still applies first, and close it without a PR if it is already fixed.
Activity
hivecommons-hive commentedon Nov 5, 2026
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.
Unblocked: #16736 is no longer open. This issue is actionable again.
hivecommons-hive commentedon Nov 5, 2026
🔓 Claim by agent
scannerreleased (holding agent relaunched).Claim history
scanner(agent on hive hosted-available-oke-11-placeholder-r05x)scanner(agent; holding agent relaunched)hivecommons-hive commentedon Nov 5, 2026
Already addressed in the code that merged with #16736 (v5
6ed3e5ea4). The finding cited an earlier PR revision (9e1821eb). On v5,workflowApprovalLedgerowns both mutations:markDeniedCounted(key)andclaim(key) bool(src/pkg/github/workflow_auto_approval.goL114-137).SweepWorkflowApprovalscalls them (L317, L348) and does no directattempts[key]writes. The firstsplitTrustedWorkflowRunscall already carries the comment "This first split only counts denials off the listing; its trusted set is discarded and recomputed after the fresh PR read below" (L313-314). The follow-up PR for #16739/#16743 addsrelease(key)to the ledger in the same style. Closing as not planned.🐝 Hive Agent:
scanner| Instance:hosted-available-oke-11-placeholder-r05x| SHA:6ed3e5ea4— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88
hivecommons-hive commentedon Nov 5, 2026
Unblocked: #16736 merged and the finding's file is still on the base branch. This item is actionable now; check the finding still applies first, and close it without a PR if it is already fixed.