The fix-prevent-detect pattern checks whether a countermeasure addresses the immediate defect, reduces the chance of recurrence, and surfaces conditions that still arise. Detection alone is insufficient if it only creates a manual response. section 8.5
Check which job each change performs:
- Fix the current defect in code or data. section 8.5
- Prevent recurrence by changing standard work or adding automated checks. section 8.5
- Detect remaining failures with checks, health signals, or alerts—and avoid relying on alerts that require repeated manual recovery. section 8.5
A migration causes API latency
If a migration adds an index without running ANALYZE, run ANALYZE to restore query performance, add it to the migration template to prevent recurrence, and add a query-plan assertion to CI to catch future regressions. section 8.6
Table 8.3 Countermeasure versus quick-fix evaluation
|
Change
|
Type
|
How to tell
|
|
Schema migration prevents invalid data
|
Countermeasure
|
The invalid state cannot exist — the database enforces it
|
|
Rate limiter caps request volume
|
Countermeasure
|
Overload is structurally blocked before it reaches the
service
|
|
Retry loop hides intermittent failures
|
Quick fix
|
The failure still happens; the retry just hides it
|
|
Input sanitization works around bad upstream data
|
Quick fix
|
The upstream service still sends bad data every time
|
|
Updated deployment template with correct defaults
|
Countermeasure
|
The standard work changed, future engineers get the right
config without thinking about it
|
|
Circuit breaker with fallback mode
|
Countermeasure
|
The system handles the failure by design, not by luck
|
Compare structural countermeasures with symptom-masking quick fixes, such as a retry loop that leaves the underlying failure in place. section 8.5
