Every Alerts table used, seeded or explained; setup card and help #36

Merged
KofTwentyTwo merged 4 commits from feature/tables-populated-defaults into develop 2026-10-14 22:31:48 +00:00
KofTwentyTwo commented 2026-10-14 21:53:06 +00:00 (Migrated from github.com)

Why

Owner requirement: every qbit table is populated, used, and explains itself when empty.

Audit per table

table used seeded empty-state help
alerts_channel router, delivery worker, actions in-app, email (equal to what AlertChannels.defaultChannel creates) yes
alerts_group type sync, router, API alerts, other yes (Owner Team now enforced)
alerts_type type sync, engine, router no: synced from types declared in code on first visit yes
alerts_monitor evaluator, type sync no: default monitors come from declaring qbits yes
alerts_alert, record_ref, event, delivery, notification, notification_recipient, heartbeat engine/router/workers no: runtime data yes
alerts_subscription, user_preference, notification_preference, mute router, preferences no: people's own choices (bootstrap rule exists) yes
alerts_team, team_member, escalation_policy, escalation_step router, escalation job no: they name the host's people yes

alerts_inbox_item has no model because changeset 17 drops it (bell state moved to notification recipients). Nothing to do.

Half-wired, fixed

  • alerts_group.owner_team_id was never read: an alert no subscription matches (WARNING+) now goes to the owner team (or nearest parent's). Tests: AlertsWiringTest.ownerTeam*.
  • alerts_user_preference.default_channel_ids was never read: now decides channels for subscriptions naming none. Test: defaultChannelsDecideWhereAUserIsReached.
  • quiet_bypass_severity and quiet_days are read (AlertTiming); no change.
  • Types/groups/monitors now also sync on the first bell request.

Added

alerts-defaults.changelog.sql (insert-only, sql-check preconditions only, tested through real Liquibase: second update runs nothing, edits survive, missing table is MARK_RAN, seeded rows equal runtime defaults); help/qbit-alerts.yaml + AlertsHelp (STAND-IN core#1198); Setup card widget for admins; guardrail test; README, UPGRADE.md, CHANGELOG.

Tests

./mvnw verify green (192 tests, checkstyle, JaCoCo).

Not done

  • No "Create defaults" table action: the only seedable rows are neutral and ship in the changelog; the rest name host people.
  • alerts.changelog.sql untouched (changeset 29 / #33 owned elsewhere).

🤖 Generated with Claude Code

## Why Owner requirement: every qbit table is populated, used, and explains itself when empty. ## Audit per table | table | used | seeded | empty-state help | |---|---|---|---| | alerts_channel | router, delivery worker, actions | `in-app`, `email` (equal to what `AlertChannels.defaultChannel` creates) | yes | | alerts_group | type sync, router, API | `alerts`, `other` | yes (Owner Team now enforced) | | alerts_type | type sync, engine, router | no: synced from types declared in code on first visit | yes | | alerts_monitor | evaluator, type sync | no: default monitors come from declaring qbits | yes | | alerts_alert, record_ref, event, delivery, notification, notification_recipient, heartbeat | engine/router/workers | no: runtime data | yes | | alerts_subscription, user_preference, notification_preference, mute | router, preferences | no: people's own choices (bootstrap rule exists) | yes | | alerts_team, team_member, escalation_policy, escalation_step | router, escalation job | no: they name the host's people | yes | `alerts_inbox_item` has no model because changeset 17 drops it (bell state moved to notification recipients). Nothing to do. ## Half-wired, fixed - `alerts_group.owner_team_id` was never read: an alert no subscription matches (WARNING+) now goes to the owner team (or nearest parent's). Tests: `AlertsWiringTest.ownerTeam*`. - `alerts_user_preference.default_channel_ids` was never read: now decides channels for subscriptions naming none. Test: `defaultChannelsDecideWhereAUserIsReached`. - `quiet_bypass_severity` and `quiet_days` are read (`AlertTiming`); no change. - Types/groups/monitors now also sync on the first bell request. ## Added `alerts-defaults.changelog.sql` (insert-only, `sql-check` preconditions only, tested through real Liquibase: second update runs nothing, edits survive, missing table is MARK_RAN, seeded rows equal runtime defaults); `help/qbit-alerts.yaml` + `AlertsHelp` (STAND-IN core#1198); Setup card widget for admins; guardrail test; README, UPGRADE.md, CHANGELOG. ## Tests `./mvnw verify` green (192 tests, checkstyle, JaCoCo). ## Not done - No "Create defaults" table action: the only seedable rows are neutral and ship in the changelog; the rest name host people. - `alerts.changelog.sql` untouched (changeset 29 / #33 owned elsewhere). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.