## RED: keep-switch without the previous
--- FAIL: TestControllerRetention_KeepsRunningAndPreviousDeletesOlder (0.00s)
    controller_image_retention_test.go:48: the previous controller (0.284.2) was deleted: [gitea.dooplex.hu/admin/felhom-controller:0.283.1 gitea.dooplex.hu/admin/felhom-controller:0.284.1 gitea.dooplex.hu/admin/felhom-controller:0.284.2 sha256:CNONE]
FAIL
FAIL	gitea.dooplex.hu/admin/felhom-controller/internal/stacks	0.011s
## RED: swap record ignored (version order only)
--- FAIL: TestControllerRetention_RecordBeatsVersionOrder (0.00s)
    controller_image_retention_test.go:75: the recorded previous (0.283.1) was deleted: [gitea.dooplex.hu/admin/felhom-controller:0.283.1 gitea.dooplex.hu/admin/felhom-controller:0.284.1 sha256:CNONE]
FAIL
FAIL	gitea.dooplex.hu/admin/felhom-controller/internal/stacks	0.012s
## RED: no in-flight swap check
--- FAIL: TestControllerRetention_NothingWhileSwappingAndNewerKept (0.00s)
    controller_image_retention_test.go:113: deleted while the controller is swapping itself: [gitea.dooplex.hu/admin/felhom-controller:0.283.1 sha256:CNONE]
FAIL
FAIL	gitea.dooplex.hu/admin/felhom-controller/internal/stacks	0.010s
## RED: no in-use check (first attempt removed the line: build failed — redone below)
FAIL	gitea.dooplex.hu/admin/felhom-controller/internal/stacks [build failed]
FAIL
## RED: RecordedPrevious without the success check
--- FAIL: TestRecordedPrevious (0.00s)
    state_test.go:23: a failed swap (rolled back: the box runs the 'previous'): got "r:0.284.2", want ""
    state_test.go:23: pending: got "r:0.284.2", want ""
## GREEN after restore
ok  	gitea.dooplex.hu/admin/felhom-controller/internal/stacks	0.038s
ok  	gitea.dooplex.hu/admin/felhom-controller/internal/selfupdate	0.006s
## RED: no in-use check (if false && used[id])
--- FAIL: TestControllerRetention_InUseAndFailClosed (0.00s)
    controller_image_retention_test.go:139: an image a container uses was deleted: [gitea.dooplex.hu/admin/felhom-controller:0.283.1 gitea.dooplex.hu/admin/felhom-controller:0.284.1 sha256:CNONE]
FAIL
FAIL	gitea.dooplex.hu/admin/felhom-controller/internal/stacks	0.023s
## RED: R-751 — RetainImagesAfterUpdate without the nil-stack check (pre-fix code, v0.284.2)
--- FAIL: TestRetainImagesAfterUpdate_AppGoneDoesNotPanic — panic: runtime error: invalid memory address or nil pointer dereference at image_retention.go:291
## GREEN with the fix: ok
