1.7 KiB
1.7 KiB
M6 Failure Recovery Playbook
Purpose
Codex must recover from failures systematically instead of patching randomly.
Failure classes
Class A — Syntax/import failure
Action:
- identify failing module;
- fix import path or missing dependency;
- add a smoke import test;
- rerun minimal test;
- document root cause.
Class B — Database/migration failure
Action:
- stop destructive changes;
- inspect model/migration mismatch;
- create additive migration fix;
- verify PostGIS extension assumptions;
- add migration note.
Class C — API contract mismatch
Action:
- compare endpoint to API contract;
- fix route/schema/status code;
- update typed client if required;
- add contract test.
Class D — Geospatial processing failure
Action:
- inspect CRS;
- inspect geometry validity;
- inspect empty geometry cases;
- verify projected/unit assumptions;
- add a small fixture reproducing the issue.
Class E — AI inference failure
Action:
- check model availability;
- check CPU fallback;
- check image tiling shape;
- check georeference transform;
- return a structured job failure instead of crashing.
Class F — Frontend state failure
Action:
- reproduce route state;
- check API response type;
- add loading/error/empty state;
- prevent stale local-only data;
- add component-level test where possible.
Repair limits
Codex may do targeted fixes in the same pass. If repair requires redesigning a module, Codex must stop and document a recovery plan.
Required recovery note
Every recovered failure must be logged as:
### Failure recovered
- Symptom:
- Root cause:
- Fix:
- Test added:
- Risk remaining: