Repository navigation
🐛 Sentinel judges the PR's current head and clears its own stale alert - #19266
clubanderson wants to merge 2 commits into
Conversation
…e alert A PR that already carried sentinel-alert was never evaluated again, so a finding on an early head kept the label, the dashboard sentinel gate and the status section on every later head. Every new head is now evaluated. On a clean head the hive removes the label only when it added it itself for an earlier head's alert, rewrites its comment and the quiet-mode status section to say the current head is clean, and audits sentinel-alert-cleared. A finding on the new head keeps the label and rewrites the alert for it. Fixes #19262 Signed-off-by: Andy Anderson <andy@clubanderson.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
|
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. @clubanderson this PR is held at Failing checks:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. Review follow-ups: 1 open of 1 (below
|
Refs #19262 Signed-off-by: Andy Anderson <andy@clubanderson.com>
Summary
The sentinel result was sticky across pushes.
trySentinelPRreturned early for any PR already wearing the alert label on the blocking path, so a finding on an early head (for example asensitive_pathhit onMakefile) keptsentinel-alert, the dashboard's "Needs human · sentinel" state and the status section'sHead <old sha> matchedline on every later head, even a docs-only one.Now the sentinel judges the current head:
labeled, made no later than that comment. The comment is rewritten as a clean record for the current head with the earlier alert kept in a collapsed block (its marker and heading neutralised so it is never read back as an alert or a maintainer clearance). The quiet-modesentinelstatus section is rewritten for the current head (never created). The audit log recordssentinel-alert-cleared./api/sentinelring keeps one row per head, so the earlier head's finding stays for audit, as does that head's review evidence bundle.Tests
TestSweepSentinelCleanNewHeadClearsHiveAddedLabel: finding on the old head, clean new head: label removed, comment rewritten clean, audit hook sees the clearance, second pass is a no-op.TestSweepSentinelFindingOnNewHeadKeepsLabel: finding on the new head keeps the label and rewrites the alert for it; an unlabelled PR with a finding gets the label.TestSweepSentinelCleanNewHeadLeavesLabelItCannotAttribute: a person's label, a label re-added after the alert, no hive comment, no comment timestamp, and an unknown hive identity all leave the label and comments untouched.TestSentinelQuietTrustedNoticeSectionClearsOnCleanHead: the status section naming an old head is rewritten for the clean head; a clean PR without a card never gets one.TestStageTrackerSentinelJudgesCurrentHead: dashboard sentinel state and human gate follow the current head; a live label still flags; ring keeps both heads.Docs:
security-model.md,notifications.md,operator-reference/sweeps-and-operations.md. Changelog fragment included.Fixes #19262