controller: fix-3 dead-app alerting + fix-6 ring cap/spill/spam (WIP, pre-build)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017CDMFpFx84pfviCTVuGGhf
This commit is contained in:
2026-07-12 10:07:47 +02:00
parent a6da64da15
commit d8f6069b46
10 changed files with 581 additions and 10 deletions
@@ -0,0 +1,23 @@
package stacks
import "testing"
// fix-3: only stopped/exited count as "down" for a deployed app. starting/unhealthy (running),
// restarting/deploying (transient), paused (deliberate), unknown (ambiguous) must NOT alert.
func TestIsDownState(t *testing.T) {
down := []ContainerState{StateStopped, StateExited}
for _, s := range down {
if !IsDownState(s) {
t.Errorf("IsDownState(%q) = false, want true", s)
}
}
notDown := []ContainerState{
StateRunning, StateStarting, StateUnhealthy, StateRestarting,
StateDeploying, StatePaused, StateUnknown, StateNotDeployed, StateOrphaned,
}
for _, s := range notDown {
if IsDownState(s) {
t.Errorf("IsDownState(%q) = true, want false (must not manufacture a dead-app alert)", s)
}
}
}