package main import ( "gitea.dooplex.hu/admin/felhom-agent/internal/backup" "gitea.dooplex.hu/admin/felhom-agent/internal/localapi" ) // COMPILE-TIME WITNESSES for OPTIONAL interfaces that are satisfied by a RUNTIME type assertion. // // WHY THIS FILE EXISTS. `localapi.BackupArchiveLister` is asserted at server.go's `newestArchiveOn` // via `tier.Service.(BackupArchiveLister)`. A failed assertion does not error — it degrades to // `archiveAbsent`, i.e. the pre-R-84 "ask the in-memory record only" behaviour. That degrade is // SILENT and it is behaviour-relevant: it is exactly the R-84 bug (a cold store after a restart // reading as "no backup ever") coming back, with nothing in any log to say so. // // The precedent is not hypothetical. During R-88 Part 2 the controller's `quiesceBackend` stopped // satisfying `quiesce.TieredBackend` when a signature changed, and `go build` AND `go vet` both // passed — because the interface is only ever asserted at runtime. Every box would have degraded to // the single-tier path, losing R-82's multi-tier backups, with no error anywhere. It was caught by // accident. // // A witness costs one line and converts that class of failure from a silent production degrade into // a compile error. // // THIS DOES NOT MAKE THE INTERFACE REQUIRED. The optionality is deliberate — it is what lets a // BackupService without a lister still work. The witness pins the IMPLEMENTATION (this concrete type // really does satisfy it), not the CONTRACT. var _ localapi.BackupArchiveLister = (*backup.BackupRunner)(nil)