Skip to content

13 Reliability and Failure Taxonomy

Anurag Prasad edited this page Nov 29, 2026 · 1 revision

13. Reliability & Failure Taxonomy

The central engineering lesson of the lab: a search tool must tell the truth about why it returned nothing.

Status taxonomy Figure 13.1 · Four layers of "success" (project diagram).

13.1 Four counters, not one

Counter Meaning Page 16 of the deep run
http_success The API call returned a success status ✅ HTTP 200
engine_success The upstream engine answered without a block ❌ DuckDuckGo CAPTCHA, listed unresponsive
page_with_results At least one valid record came back ❌ 0 results
collection_complete Target met ❌ 216/500

13.2 Failure classes

Class Examples Correct reaction
Transport DNS failure, timeout Bounded retry with backoff
Rate limit HTTP 429 Respect Retry-After; slow down
Server 5xx Bounded retry; record
Interstitial / challenge HTTP 202 interstitial (DDGS, Lite), CAPTCHA Stop signal — never retry-loop, never circumvent
Schema Invalid JSON, missing fields Fail the task, preserve raw
Semantic empty Genuinely no results Record as empty, continue per policy
Policy robots/terms/stop signals Stop and log

Status-code semantics follow HTTP Semantics; the key point is that 200 or 202 do not guarantee a usable result set.

13.3 Decision flow

flowchart TD
    R[Page response] --> H{HTTP ok?}
    H -- no --> T{429 / 5xx / timeout?}
    T -- yes --> B[bounded backoff, then stop]
    T -- no --> F[fail task, keep raw]
    H -- yes --> E{engine unresponsive or CAPTCHA?}
    E -- yes --> S[STOP engine, record stop_reason, keep earlier pages]
    E -- no --> Z{results > 0?}
    Z -- yes --> N[normalize, dedup, continue]
    Z -- no --> M[empty page: apply short-page policy]
Loading

13.4 Two-axis workflow status

Target met Target not met
Pipeline healthy COMPLETE PIPELINE_OK / COLLECTION_PARTIAL ← deep run
Pipeline failed n/a PIPELINE_FAILED

Reporting only one bit (exit code) conflated these; Stage 1 of the roadmap fixes it (21).

13.5 Retry accounting

An earlier output label risked mixing total attempts with retries. Prefer explicit fields:

$$\text{total_requests}=\text{first_attempts}+\text{retry_requests},\qquad \text{retry_rate}=\frac{\text{retry_requests}}{\text{total_requests}}$$

with a recorded retry_reason per retry.

13.6 Bounded backoff

For retryable errors use capped exponential backoff with jitter:

$$t_k=\min\left(t_{max},\ t_0,2^{k}\right)\cdot(1+u),\quad u\sim\mathcal U(0,j)$$

Jitter is for politeness and desynchronisation, not a reliability guarantee. CAPTCHA is excluded from this schedule.

13.7 Checkpoints

Persist {query, region, time, page, result_ids, stop_reason} so a resumed run can validate overlap and avoid re-fetching.

13.8 Why this matters to agents

If an agent's tool collapses blocked into empty, it may assert "no sources exist". Honest status lets the agent say "I could not access X" — a prerequisite for trustworthy citation behaviour (6).


❓ Check your understanding

Q1. Give a case where http_success is true and engine_success false.

SearXNG returning HTTP 200 with zero results and DuckDuckGo/CAPTCHA flagged unresponsive (page 16).

Q2. Why isn't CAPTCHA retried?

It is an access-control signal; retrying or solving it is evasion. The design records it and stops that engine.

Q3. If 40 total requests included 6 retries, what is the retry rate?

$6/40=15%$.

Q4. What belongs in a checkpoint?

Query, region, timestamp, page, result IDs and stop reason.

← Prev 12. Results · Next → 14. Simulation vs Real Infrastructure

Clone this wiki locally