Failure-mode register
Ordered by severity. Each row: what fails, the blast radius, how we would know, the
immediate control, and whether recovery is safe. Codes refer to ERROR-CATALOG.md; runbooks
to RECOVERY-RUNBOOKS.md.
Severity: S1 data loss / false external claim / total outage · S2 significant degradation or user-visible wrong state · S3 minor / operational annoyance.
| ID | Failure | Sev | Radius | Detection | Control today | Gap |
|---|---|---|---|---|---|---|
| FM-01 | Consumer invocation killed mid-search; search stuck running | S1 | one user, permanently; also blocks the one-active-search rule | none | reset happens only in catch (scrapeQueue.ts) — a killed isolate never reaches it | lease + reclaim (running_at, lease_expires_at) |
| FM-02 | Duplicate delivery replays all sources of a search (one message per search) | S2 | scraper daily budget, upstream rate, user wait | none | backend caps keyed ⇒ no double charge; ingest idempotent | per-source messages; dispatch ledger |
| FM-03 | MAX_INGEST_PER_SEARCH exceeded under parallel sources (500 vs 300) | S2 | cost, D1 volume, contract breach | none | read/decrement race in scrapeRun.ts | atomic reservation |
| FM-04 | Partial success reported as complete | S1 (truth) | user believes all sources ran | none | anyOk ⇒ complete | partial status + per-source counts |
| FM-05 | Unbounded max_concurrency (250) floods scrapers | S1 | both scraper containers, upstream boards, IP reputation | Queue metrics backlog/error spike | none (setting unset) | explicit ceiling |
| FM-06 | Scraper replica > 1 multiplies daily quota; restart resets it | S2 | cost, policy compliance, fairness | none | in-memory registry | shared budget or single-replica constraint |
| FM-07 | Ambiguous scraper timeout retried ⇒ second real scrape | S2 | scraper budget; possible duplicate upstream load | none | retry on any throw, no attempt record | dispatch ledger + uncertain (never auto-retry) |
| FM-08 | Message reaches DLQ and nobody looks | S2 | affected searches silently fail | none | DLQ configured, no consumer | DLQ consumer + alert + runbook |
| FM-09 | Queue publish fails after the cap was charged and the row was written | S2 | user loses a search slot | none | release + failed only on a thrown publish | verify ordering: release path must cover a partial publish |
| FM-10 | D1 write contention: 10 consumers × 100 statements | S2 | latency, timeouts | none (no rows/timing metrics) | sequential per invocation | measure batch latency; cap concurrency |
| FM-11 | D1 batch partially applied (no multi-statement transaction) | S2 | provenance rows without job rows, or vice versa | none | chunks of 50; ingest idempotent ⇒ replay heals | integrity query in runbook |
| FM-12 | Scraper returns unparsable 200 (layout changed) | S2 | one source silently empty | scraper-side unparsable; backend sees generic failure | interpret() maps to failed | surface err_code to the user/status |
| FM-13 | Board WAF blocks the gateway exit IPs | S2 | one/many sources | scraper 403/429, gateway cooldown counters | gateway cooldown | per-source egress policy (not built) |
| FM-14 | Gateway has no usable exit | S2 | all scraper egress | gateway /health = degraded, scraper 502 | fails closed, honest 502 | alert on degraded > 2 min |
| FM-15 | Search cap charged but selection refused (blocked source) | S3 | none | tests | refusal happens before charge | — |
| FM-16 | Cron sweep fails silently (KV/retention) | S2 | expired jobs served as live | none | sweep is honest stub-free now, but no metric | retention.run counter + alert on absence |
| FM-17 | Better Auth session valid but owner row missing | S2 | user sees empty account | none | assertOwnerId rejects malformed | auth.session.resolved without owner_id alert |
| FM-18 | R2 upload orphan (row written, object missing) | S2 | resume download 404 | none | upload-url flow | integrity check in runbook |
| FM-19 | Erasure partially completes | S1 (compliance) | data retained after promise | none | prefix-driven list-until-empty | runbook + completeness metric |
| FM-20 | Logpush gap: hours of logs missing at incident time | S2 | diagnosis | none | — | daily partition completeness check |
| FM-21 | Cron drift / missed schedule | S3 | stale corpus (sweep), later reminders | none | — | heartbeat row + alert |
| FM-22 | AI provider 429 during rank | S3 | ranking unavailable | none | NOT_CONFIGURED / error surfaced | queue later; retry policy per provider |
| FM-23 | Gmail uncertain send auto-retried | S1 | duplicate email to a real person | — | send is synchronous, outcome explicit (sent_unrecorded/uncertain) | never enqueue sends; keep 2-step confirm |
| FM-24 | Queue backlog exceeds retention (4 d) | S2 | searches never run | backlog age metric | — | alert on oldest-message age > 1 h |
| FM-25 | Clock skew: expires_at/now mismatch across services | S3 | early pruning, "expired" searches | none | Date.now() everywhere | use request/queue timestamps where causally correct |
Control additions that close the S1 set
- Lease + reclaim (FM-01) — the only way "running" becomes true again.
- Per-source messages + dispatch ledger (FM-02, FM-07).
- Explicit concurrency ceiling (FM-05).
partial+ per-source status (FM-04).- Shared scraper budget or a documented single-replica rule (FM-06).
Each of these is a contained change; none requires a rewrite of the scrapers or the store.