Give each team its own dead man's switches, and the UI a team to show #12
Reference in New Issue
Block a user
Delete Branch "deadman-per-team"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #4. Stacked on #11, which is stacked on #10 — merge in order and each retargets.
Two halves that belong together because they are the same sentence from opposite ends: a team decides which of its alerts are heartbeats, and the UI has to be able to say which team it is talking about.
Dead man's switches become a team's own
They were three environment variables, which made them one setting for the whole install — the last piece of the alerting path a team could not control. It could take its own alerts on its own key and still not say which of them were heartbeats, or how long a silence had to last.
Now a row per team, edited by an owner through
PUT /api/teams/{teamID}/deadman, with the sweeper running each team against its own matchers, timeout and severity.The environment variables become the starting point, not the setting. Every team without a configuration is seeded from them at startup, so an upgrade keeps watching exactly what it was watching, and seeding never overwrites — a redeploy must not put the environment's value back over an owner's edit.
A team created later watches nothing until somebody says otherwise. Inheriting an install-wide heartbeat would page a new team about a source it has never heard of, and a switch nobody chose is the kind that gets muted rather than fixed.
A matcher string with no
alertnameis refused rather than stored — storing it produces a switch that watches nothing silently, which is the exact failure the feature exists to prevent.NewRouterandSweeplose theirDeadmanConfigparameter: there is no longer one answer to hand them.The UI gets a team
All three appear only when the viewer is in more than one team. Otherwise they are the same word repeated down a list — noise rather than information — and the single-team install reads exactly as it did before teams existed.
Verified
make fmt lint test helm-lintgreen with-raceagainst Postgres 17, plus three new tests: the same alert treated as a heartbeat in one team and an ordinary problem in another (and silence paging only the watching team); owner-only editing with member-readable access; and an unusable matcher rejected with400.Also driven against a live two-team server: the combined queue labelled by team, the
team_idfilter, the default team seeded from the environment, and a newly created team starting with empty switches.https://claude.ai/code/session_01RHPj4ggeFdEjKKfm4SHbD7