# Receipts

How every result shows how it was fetched, when, at what cost, and what is still unknown.

Every result carries a receipt. It says how the page was fetched, when, what it
cost and what Frankensurf could not confirm. Raw content stays on your machine,
linked to the receipt by hash.

## A receipt

```json
{
  "trace_id": "6f1c…",
  "status": "observed",
  "operation": "read",
  "method": "local",
  "observed_at": "2026-10-06T03:14:07Z",
  "freshness_seconds": 0,
  "cache_hit": false,
  "requested_url": "https://example.com",
  "final_url": "https://example.com/",
  "http_status": 200,
  "latency_ms": 2267,
  "cost_usd": 0,
  "evidence": [{"path": "state/evidence/2a8c….html", "sha256": "2a8c…", "bytes": 23}],
  "attempts": [
    {"provider": "http", "status": "failed", "failure": "VISUAL_REQUIRED", "latency_ms": 90},
    {"provider": "local", "status": "observed", "latency_ms": 2176}
  ],
  "routing": {"provider_plan": {
    "ordered": ["http", "local", "camoufox", "scrapling", "scrapling_http", "crawl4ai", "jina_reader"],
    "basis": "registration order; insufficient exact-scope evidence"
  }}
}
```

Trimmed from a real read. `routing.provider_plan.ordered` is the route this
read planned, after skipping anything unavailable.

- **`attempts`** lists every provider tried, in order, with its outcome, time
  and cost.
- **`evidence`** points to saved copies, named by their SHA256 hash, under the
  state directory.
- **`requested_url`** and **`final_url`** stay separate, so redirects show.
- **`cost_usd`** is the sum of measured provider costs. If any attempt's cost
  is unknown, the total is `null`, never a guess.
- **`next_step`** appears when a read stopped at a wall a person could clear
  (it names `handoff`), or when a results page doesn't mention the query
  (`reason: "off_query"`: the search URL is probably wrong).
- **`module`** names the [site module](/docs/read/site-modules/) that shaped
  the read: `id`, `version`, `sha256`, `source` (`matched`, `named` or
  `override`), `items`, `next_url`, and `assertions` with `status` (`passed`,
  `failed`, or `invalid` when its markers matched the site's error page).
- **`completeness`** records the structure check: page kind, item links,
  prices, every escalation step, and for searches with a known query, `query`
  (terms, matching items, text mentions) and `off_query`. `agreed` means the
  climb stopped because two browsers read the same page as the first read.
- **`wall_vendor`** names the bot-defence service behind a wall the read met
  (`cloudflare`, `akamai`, `datadome`, `perimeterx`, `imperva`, `kasada`,
  `aws_waf`, `vercel`, `sucuri`), from the response's own headers and
  challenge page. `routing.learned_for` shows when that vendor's past results
  on this machine, or the bundled priors (`priors: true` when they changed the order),
  [reordered the ladder](/docs/blocked/escalation/#skipping-ahead),
  and `routing.escalated_to` names the tool that failed tries moved ahead (one
  that fetches from its own network) or walls moved ahead (your
  [real browser](/docs/blocked/real-browser/) when allowed, else a paid one).
- **`rescued`** appears when the URL answered not found, or showed results that
  ignored its query, and the site's own search found what it asked for:
  `from`, `after` (`NOT_FOUND` or `off_query`), `query`, `via`, `search_url`
  ([When the URL is wrong](/docs/blocked/escalation/#when-the-url-is-wrong)).
  `rescue` (on the original receipt) says what was tried when nothing fit.
- **`egress`** appears whenever a walled read tried
  [your other connections](/docs/blocked/egress/): `used` (the name of the one
  that got through, or `null`), `tried`, `after` and `direct_trace_id`, or
  `from_hint` when the site's hint chose it.
- **`hedge`** appears when a read with no page after 2 seconds was raced by
  other free tools ([smart lightning](/docs/blocked/escalation/#racing-a-slow-read-smart-lightning)),
  or a [lightning](/docs/read/lightning/) read raced from the start
  (`lightning`): `providers`, `tried`, `after_seconds`, `provider`, `won`, and
  when its page stood in for a failed main read, `after_failure` and the
  `walled` tools. `routing.left_to_racers` lists the tools the main read left
  to its racers rather than read the page twice.
- **`completeness.cut_off`** is true when a tool trying to complete a page ran
  past `completeness_step_timeout_seconds` (or the climb's deadline) and was
  stopped; the best page so far stands.
- Cookies, keys and credential URL parameters never appear.

## Quality

Every observed page read carries `receipt.quality`: a grade your agent can
route on.

```json
{ "grade": "poor", "kind": "article", "flags": ["paywall"],
  "reason": "paywalled: only 433 characters of the article are free",
  "article": { "chars": 433, "paragraphs": 2, "method": "trafilatura", "paywall": true } }
```

- `good`: the content is there.
- `partial`: it is there, with a warning (`needs_interaction`, `archived`).
- `poor`: a placeholder (`$0` prices, template values), menus only, a cookie
  notice, results that ignore the query (`off_query`), or a paywall teaser.

Article pages (schema.org `Article`/`NewsArticle`, Open Graph `article`, or
publisher-style paths) are judged on their extracted article: 600+ characters
and two or more prose paragraphs, however long the menus around them. A thin
article escalates to a stronger tool first. On 108 fresh news and company
articles the grade matched whether the article was there on 107.

## Freshness

| `freshness` | What happens |
| --- | --- |
| `now` (default) | Always fetches. |
| `hour`, `day`, `cached` | May reuse a saved copy. The receipt keeps the original time and reports its age. |

An old copy is never passed off as new.

## Unknown stays unknown

A page loading doesn't prove what's on it is current, and a 404 doesn't prove
why it's gone. `field_status` keeps availability and price `unknown`; the caller
decides what the page means.

## Images

With `include_images=True`, images are downloaded and checked, not just linked.
Each one has a hash, its real format and size, and its own error if it failed.
`max_images` (default 50) caps the count; it does not mean the gallery is
complete.

## Traces

Every read saves a trace. `frankensurf trace <trace_id>` or
`Runtime.trace(trace_id)` shows one. `Runtime.capabilities()` adds traces up into
success and speed per site and provider, with sample counts.

  Evidence lives under the state directory (`--state`, default `state`; the MCP
  server uses `FRANKENSURF_STATE`). It is never sent anywhere.
