Summary
`checklistRunner` in `internal/inspector/checklist.go` has 14 fields implementing the same `loaded bool / err error / data V` cache pattern for each AWS resource type (RDS, hosted zones, etc.). The pattern is duplicated by hand, making it easy for the invariant — `err == nil iff loaded == true && data is valid` — to be violated inconsistently across resource types.
Details
- Each new resource type cached requires adding 3 fields in sync (`xLoaded`, `xErr`, `xByID`)
- A bug in loading one resource type (e.g., setting `loaded` before clearing `err`) won't be caught and won't affect other types — silent inconsistency
- Go 1.18+ generics make this straightforward to unify
Checklist
References
- `internal/inspector/checklist.go:323-362`
Raised from senior code review (2026-05-12).
Summary
`checklistRunner` in `internal/inspector/checklist.go` has 14 fields implementing the same `loaded bool / err error / data V` cache pattern for each AWS resource type (RDS, hosted zones, etc.). The pattern is duplicated by hand, making it easy for the invariant — `err == nil iff loaded == true && data is valid` — to be violated inconsistently across resource types.
Details
Checklist
References
Raised from senior code review (2026-05-12).