Repository navigation
fix(alerts): one notification per incident, none on recovery - #1539
Conversation
An abandoned nightly fanned one incident out to one alert key per incomplete step, each with the same text, so Etan got the same "calendar ... abandoned" notice 4x at 00:07. Every clear also posted "BrainLayer <key> recovered". report() still sets/clears every key in job-alerts.json (BrainBar reads them) and still logs the health event, but posts a macOS notification only for a new failure whose text no other active key already carries, and never on recovery. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 46 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 877675cc-3815-405d-a92d-9f770233a03c) |
BrainLayer ratchetEvery Value below was measured by this run. A row this machine cannot measure says Hosted success gives no verdict on mapped bytes, search p50/p95, idle CPU, or fallback replay debt.
🟢 GREEN measured, within budget · 🔴 RED measured, out of budget — a finding to clear before merge · ⚪ n/a not measurable on this machine, never guessed. No RED rows. Measured on Linux/x86_64 · measured |
Why
Etan's Notification Center (2026-10-28) was flooded via Script Editor (
osascript display notification):Root cause:
maintenance_calendar._abandonment_alertsmaps one abandoned run to one alert key per incomplete step, all with the same text, andjob_alerts.report()notified once per key. Every clear also notified "recovered".What
report()still sets/clears every key injob-alerts.json(BrainBar's dashboard reads it) and still logs the health event, but posts a macOS notification only for a new failure whose text no other active key already carries, and never on recovery.drive-consent's re-notify-on-new-reason rule is unchanged.Tests
tests/test_job_alerts.py(30 passed),tests/test_brainbar_auto_activation.py+tests/test_maintenance_calendar.py::test_abandoned_run_sets_every_step_alert_but_posts_one_notification(43 passed); ruff clean.Record
🤖 Generated with Claude Code
Note
Low Risk
Alert persistence and logging are unchanged; only macOS notification deduplication and suppression on recovery are adjusted, with broad test coverage.
Overview
Stops macOS Notification Center spam from
job_alerts.report()while keepingjob-alerts.jsonand health logging behavior for BrainBar.Failure notifications now fire only when the failure text is not already present on another active alert key, so one abandoned calendar run that fans out the same message to
index,backup-daily, etc. triggers oneosascriptnotification instead of one per key.drive-consentstill re-notifies when the reason escalates.Recovery clears still update the alert file and emit
health event … state=recoveredlogs, but never post a “BrainLayer … recovered” notification.Tests were tightened across job alerts, BrainBar activation, and maintenance calendar to match the new notification rules.
Reviewed by Cursor Bugbot for commit e0fb873. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Suppress duplicate and recovery notifications in
job_alerts.reportMacroscope summarized e0fb873.