An MCP server that lets an agent read the web, then keep what it read.
One Rust binary. Give it a URL and it returns the main content as Markdown, with the metadata a model needs and none of the page furniture. Render a JavaScript page when the page needs a browser. Read a PDF, a feed, or a sitemap. Store everything locally, then search it offline by keyword or by meaning.
It is built for people wiring tools into an agent, and for people who have written a scraper before and know where it hurts.
Status: 34 MCP tools, version 0.1.0. There is no published release. Build from source.
Agents read well and acquire badly. The reading half is a solved prompt. The acquiring half is a crawler, and a crawler is a small distributed system with a security boundary around it.
That boundary is the part most tools leave to the caller. A URL from a model is untrusted input. It can point at 127.0.0.1, at a cloud metadata endpoint, at a host that redirects into a private range on the second hop, or at a page that never settles. robots.txt is usually optional, rate limits are usually the caller's problem, and the caps show up after the bill.
web-widow puts those decisions in the request path. Every request and every redirect hop passes the same gate. The address classes, the scheme allowlist, the body caps and the robots rules are enforced in the server, not documented as advice. Two settings can widen reach. They live in a 0600 config file, and one of them announces itself at startup.
The other half is memory. A page an agent fetched once should still be there tomorrow, searchable without a network call and without shipping your corpus to someone else's index. So the store is SQLite, the blobs are content addressed, full-text search is FTS5, and semantic search runs on a local model.
The tools are grouped here by the job they do. The full reference, with every field and cap, is at the end.
fetch_page turns one URL into Markdown plus metadata. mode chooses main (readability, the default), full, text, or raw. You get title, byline, site name, publish time, language, word count, and optional links (URLs only, off-site links flagged). Truncation is always reported, never silent.
Pages that need JavaScript are rendered in an in-process Chrome, which is part of the default build:
render: "never"is static HTTP only.render: "auto"is the default. It renders only when the static result looks thin and the page looks like an application shell.render: "always"renders first and fails loudly if it cannot.
A rendered page comes back through the same extractor, blob store and persistence path as a static one, with render_mode telling you which happened: rendered, rendered_partial or static_fallback.
If you only read documentation sites, build without the render feature and you will never miss it.
There are three search tools, and the split matters.
| Tool | What it answers |
|---|---|
search |
Web discovery. DuckDuckGo returns titles, URLs and snippets for one page of at most ten results. It never fetches a result page and never stores anything. |
search_content |
Local full-text search over pages you already fetched. FTS5, every term required, title weighted 4× the body, capped plain snippet. No network. |
search_semantic |
Local similarity search over the same store, using a configured local model (minilm-l6-v2-q or multilingual-e5-small). No download at query time, no API key. |
embedding_status |
Coverage for the semantic index: embedded pages and chunks, pending pages, last error. Read-only. |
search finds URLs. search_content and search_semantic search your store. A search call makes at most two SERP requests and writes nothing.
Semantic search uses whichever model the operator configured (minilm-l6-v2-q for English, multilingual-e5-small for mixed languages); the response's model field names it. Treat its results as retrieval candidates, not authority.
extract runs a declarative CSS spec over the page's own DOM and returns typed records with per-field errors. A spec is data: a container selector and named fields with optional attr, all and one of six transforms. There is no XPath, no regex, and no expression language.
extract_rows is the tabular sibling. It reads CSV and TSV (RFC 4180 quoting, delimiter sniffing, BOM and CRLF), JSON through an RFC 6901 pointer, and HTML tables. It is the only tool that fetches text/csv and text/tab-separated-values.
recipe_save, recipe_list and recipe_apply turn a spec into a named, versioned artifact. Applying a recipe is exactly extract with the stored spec, so the guards and caps are identical.
| Tool | What you get |
|---|---|
pdf_extract |
One PDF's text layer as ## Page N Markdown, with document metadata and an explicit ok, no_text_layer or partial outcome. No OCR. |
sitemap |
URL entries from <urlset>, <sitemapindex> or a plain-text sitemap, gzip included. Index children are followed one level. lastmod is returned as data and schedules nothing. |
fetch_feed |
Items from one RSS 2.0, Atom or JSON feed in feed order, deduped by id and canonical URL, with absolute URLs and plain summaries. Item pages are not fetched. |
fetch_page and extract refuse PDFs on purpose and name pdf_extract in the error. Only the tool that understands a format is allowed to fetch it.
Each monitor stores a snapshot per check: the extracted Markdown, normalized for line endings, trailing whitespace, blank-line runs and zero-width characters. A check is classified none, cosmetic or substantive. A monitor can also watch declared fields, so an attribute-only price change still counts.
| Tool | What it does |
|---|---|
monitor_create |
Add a URL, an interval, optional field schema and ignore_selectors. |
monitor_list |
Monitors in id order, with due times and labels. |
monitor_check |
Check one monitor, or all due monitors with a bounded wait. |
monitor_changes |
Newest-first change history with stats and a capped unified diff. |
monitor_delete |
Tombstone. History stays queryable. |
events |
The same change history as JSON or RSS 2.0. |
webhook_target, webhook_status |
Attach operator-configured webhook targets and inspect delivery state. |
Webhook targets are named in the config file only. A tool never accepts a URL, so page content or a prompt-injected agent cannot introduce an endpoint. Deliveries are HMAC-signed, retried with backoff, and dead letters stay visible.
For cron and systemd, run-due checks every due monitor once, prints one JSON summary and exits. If the server already runs, run-due --http talks to it over loopback instead of opening the data directory.
crawl_start, crawl_status, crawl_results and crawl_cancel run a bounded crawl. The frontier lives in SQLite and deduplication is a primary-key constraint, so a URL cannot be enqueued twice even if a caller forgets to check. Workers lease rows, which means a killed process resumes instead of starting over.
Scope is depth, site, path prefixes and exclude patterns. When a page's content was already seen in the same job, the page is stored but its links are not followed, so a calendar trap stops at the first duplicate instead of eating the page budget. Hit a limit and the job ends done with limits_hit naming which one.
screenshot renders one URL through the same gate as fetch_page and stores a PNG in the content-addressed store. The payload carries the hash, size, MIME and CSS-pixel dimensions, never base64.
interact_open, interact_act, interact_state and interact_close hold one page per process for front-end work. The loop is observe, act, observe, so one failed selector does not destroy the plan. The action set is closed: click, type, wait, scroll. There is no caller JavaScript, no eval field and no XPath. Type can enter text into a form, so never type credentials into a page you do not trust.
corpus_export writes pages and their extractions as JSONL or a Markdown directory under <data>/exports/, streamed page by page with a record and byte cap. Monitors and recipes are not corpus rows; monitor history is monitor_changes and the recipe library is configuration.
snapshot_compare diffs two snapshots from the same monitor, or two fetch events for the same canonical URL, and reports field changes for a schema monitor.
blob_get resolves a stored hash to a path, size, MIME and the rows that reference it. It returns no bytes: read the file with your own tools.
robots_cache lists the local robots cache and probes a path from the cached body, returning allow or deny, the matched rule, Crawl-delay and expiry. Zero network requests, and a test asserts the fixture server sees none.
- No login-gated or paywalled content by default. Authenticated fetching is operator-configured, per-site opt-in, and return-only unless the operator opts in to persistence.
- No OCR, no PDF images, no forms, no PDF JavaScript.
- No proxy rotation, no distributed crawling, no multi-user auth.
- No CAPTCHA solving.
- No caller JavaScript in interaction sessions.
- No
OR,NEARor prefix operators in local full-text search. Terms are quoted and ANDed. - Sitemap
lastmoddoes not schedule, order or monitor anything. - A monitor watches one URL. Multi-page "watch a site" semantics do not exist yet.
| Need | When | Notes |
|---|---|---|
| Rust 1.99.1 | always | Pinned by rust-toolchain.toml. |
| Chrome or Chromium | only for rendering | Loaded at runtime. The verified test binary is Chrome for Testing 156.0.8078.4. |
libpdfium.so (8125) |
only for pdf_extract |
Loaded with libloading. The binary does not link it, so ldd will not list it. |
| ONNX Runtime 1.31.0 and the model files | only for search_semantic |
Loaded at runtime. Missing files are a typed error, not a crash. |
cargo build --release # stdio server, render on
cargo build --release --features http # + loopback streamable HTTP
cargo build --release --no-default-features # static only, no Chrome
./target/release/web-widow --help| Build | Render | HTTP | Use |
|---|---|---|---|
| default | yes | no | MCP clients that spawn a child process |
--features http |
yes | yes | long-lived HTTP clients |
--no-default-features |
no | no | hosts without Chrome |
--no-default-features --features http |
no | yes | static-only HTTP host |
The render feature is on by default because rendering ships in the delivered binary. --no-default-features drops chromiumoxide and keeps every static path working; render: "always" then returns render_unavailable.
A musl build works from the same source when the target is installed:
rustup target add x86_64-unknown-linux-musl
cargo build --release --target x86_64-unknown-linux-muslThe dependency gate is part of the build contract:
cargo deny check # licenses, advisories, bans, sources
cargo audit # RustSec advisoriesinstall -d -m 700 ~/.config/web-widow
install -m 600 config.example.toml ~/.config/web-widow/config.toml
install -d -m 700 "${XDG_DATA_HOME:-$HOME/.local/share}/web-widow"
web-widow --config ~/.config/web-widow/config.toml serveSet fetch.contact to a real address you read. It becomes part of the User-Agent, and it is how a site operator reaches you.
The data directory must be 0700. The config file should be 0600; the server warns at startup if group or other can read it. One process per data directory, enforced by an advisory lock that names the holding pid.
A stdio client spawns the binary and speaks MCP on stdout; logs go to stderr. A minimal exchange:
The result is a text block with YAML-ish front matter and the Markdown body, plus structuredContent.
The server is half the pair. The other half is the field-guide skill in skill/web-widow/SKILL.md, which teaches an agent how to pick a tool, read the payload, tell rendered from static content, and treat a blocked_* refusal as final. SKILL-INSTALL.md covers installing both. A server without the skill is a set of tools an agent does not know how to use; the skill without the server is advice with nothing behind it.
WEB_WIDOW_HTTP_TOKEN="$(cat ~/.config/web-widow/http-token)" \
web-widow --config ~/.config/web-widow/config.toml serve --http 127.0.0.1:8765The endpoint is http://127.0.0.1:8765/mcp. Every request needs a bearer token. The transport is stateless, POST only, and refuses a non-loopback bind unless --allow-non-loopback is passed deliberately. Local HTTPS is available on the same listener with [http].tls = true; see Running it.
A config file is optional. The defaults in config.example.toml are what the binary uses.
[fetch]
contact = "crawler@example.com" # part of the User-Agent
allow_hosts = [] # exact hosts or CIDRs; config file only
[storage]
# data_dir defaults to $XDG_DATA_HOME/web-widow; must be 0700Two settings widen reach, and both exist only in the config file:
fetch.allow_hostspermits private addresses or named hosts. Every match is logged at info.robots.enabled = falsedisables the robots check and announces itself loudly at startup.
Neither is reachable from the MCP tool surface, an environment variable or a CLI flag. That is the point: an agent cannot widen its own reach.
| Section | Bounds | Default posture |
|---|---|---|
[fetch] |
Contact, timeouts, redirects, body and header caps, per-host interval and concurrency | 10 MiB body, 64 KiB headers, 5 redirects, 30 s total, 1 request/s per host |
[robots] |
robots.txt cache lifetime and body cap | Enabled, user-agent group web-widow |
[extract] |
Output mode, Markdown and record caps, cache freshness | 200 000 chars, 5 000 records, 300 s |
[feed], [sitemap] |
Item and URL caps, summary and body caps, index children | 20 items, 5 000 URLs, 5 children |
[pdf] |
PDFium path and discovery, body, page and character caps | 32 MiB, 200 pages, 1 000 000 chars |
[search], [fts] |
DuckDuckGo endpoints, query and result caps, index and snippet caps | 10 results, 50 000 indexed chars, 320-char snippet |
[render] |
Chrome path, concurrency, settle and ceiling, per-page bytes and requests, restarts | 2 pages, 500 ms settle, 10 s ceiling, 5 MiB, 200 requests |
[interaction] |
Session TTL and action ceiling | 120 s idle, 60 actions |
[crawl] |
Server ceilings for a crawl job, lease, attempts | 5 000 pages, depth 5, 30 min, 3 attempts |
[monitor] |
Interval bounds, diff cap, bulk-check wait | 60 s to 30 days, 20 KiB diff, 30 s wait |
[events] |
Change feed route and item count | Enabled, 100 items |
[webhooks] |
Targets, retries, HTTP allowance | Disabled, HTTPS only, 5 attempts |
[embeddings] |
Local model, chunking, backfill pacing | Disabled, no network |
[scheduler] |
In-process due-check timer | Disabled |
[http] |
TLS mode and operator PEM pair | Plain HTTP, loopback only |
[auth] |
Credential managers, profiles, persistence, audit retention | No profiles, return-only |
[retention] |
Event, extraction, screenshot, webhook and snapshot windows, blob budget | 30 days, 20 snapshots, 20 GiB |
[logging] |
Level, JSON, query redaction | Info, text, queries redacted |
[render]
# chrome_path = "/usr/bin/chromium" # recommended; config file only
discovery = true # else check $CHROME_PATH and well-known paths
max_concurrent_pages = 2
settle_ms = 500 # network-quiet window after the load event
ceiling_ms = 10000 # hard navigation ceiling, yields rendered_partial
max_bytes = 5242880 # 5 MiB transferred per page
max_requests = 200 # requests per page
restart_max = 3
restart_window_s = 600
launch_timeout_ms = 20000Chrome is discovered lazily at the first render call. If none is found, static requests keep working and render: "always" returns render_unavailable naming render.chrome_path and the locations it checked. chrome_path is config-only, so an agent cannot point the browser at an arbitrary executable.
Authentication is config-only. A secret reference (op://, bw://, pass://) lives in the 0600 config file; the agent names an operator-defined profile, and only through fetch_page.profile. No other tool accepts a credential-bearing key, which is schema_invalid before dispatch.
A profile is bound to an exact host:port. It attaches to that origin and never to a subdomain. The default is return-only: no stored body, no blob, no index row, no event. See Authenticated fetching.
These are features, not a disclaimer. They are the reason an agent can be given a URL without also being given your network.
| Gate | Rule |
|---|---|
| Scheme | http and https only |
| Address | No loopback, private, link-local, CGNAT, metadata, multicast or reserved address |
| Redirects | Re-vetted on every hop, not just the first |
| robots.txt | RFC 9309, user-agent group web-widow. Crawl-delay can only raise the interval, never lower it |
| Rate | At most one request per second per host, one concurrent request per host |
| Content type | HTML, XHTML, plain text, JSON, XML. CSV and TSV only in extract_rows, PDF only in pdf_extract; anything else is unsupported_content_type before the body is read |
| Size and time | The caps above. Truncation is always reported, and an oversize body is refused before it is read |
A crawl, a monitor check, a feed read, a sitemap fetch, a PDF, a screenshot and an extraction all take the same path. None of them can widen its own reach.
| Limit | Default |
|---|---|
| Decompressed body | 10 MiB |
| Response headers | 64 KiB |
| Redirects | 5 |
| Total fetch time | 30 s |
| Returned Markdown | 200 000 characters |
| Crawl pages, depth, duration | 5 000, 5, 1 800 s |
| PDF body, pages, characters | 32 MiB, 200, 1 000 000 |
| Render per page | 5 MiB, 200 requests, 10 s |
| Blob store budget | 20 GiB |
| Snapshot retention per monitor | 20 plus every change point |
This list is the honest part. Read it before pointing the browser at a hostile page.
- A rendered page loads its own subresources. The gate covers the top-level navigation, not every CSS, font or image URL the page names.
- DNS pinning. The gate resolves each hop once and the connection is pinned to exactly the vetted
addresses (
resolve_to_addrs); there is no second lookup at connect time, and an empty vetted set fails closed.fetch.allow_hostshostnames are resolved and pinned the same way. This covers the shared HTTP path (fetch_page, extract, extract_rows, fetch_feed, sitemap, pdf_extract, robots, crawl, monitor). - Render-path residual (disclosed,). The rendered browser path still resolves names inside Chrome, so a rebinding zone can reach a private address there. Chromium's own private-network protections are the remaining control; this is a disclosed residual, not a solved problem.
- The launch flags disable DNS prefetch and non-proxied WebRTC UDP. WebRTC and DNS-only channels remain outside the gate.
- Worker-created targets (a nested
Worker,importScripts, aSharedWorkercreated inside a worker) are an unvetted egress channel. This is a known hole, not an untested path. - The interaction gate is an SSRF filter, not an egress filter. It stops a page reaching your private network; it does not stop a page sending data to a public host.
- Rendered pages execute untrusted JavaScript. Treat page text, console output and screenshots as data.
Every result carries content_status: untrusted-data in its front matter, and every tool description says the same. Page content may contain text that looks like an instruction. It is never safe to follow. The skill repeats this rule because agents are the ones that need it.
Stdio is the default: the client spawns the process, stdout carries only JSON-RPC frames, and logs go to stderr.
HTTP is opt-in and loopback-first. It requires a bearer token from WEB_WIDOW_HTTP_TOKEN (which wins) or a 0600 token file. Requests need Accept: application/json, text/event-stream; a bare curl without it gets 406. The transport is stateless: no session id is issued, GET and DELETE on /mcp return 405, and there are no server-initiated messages. Each request writes one access line to stderr without the token, the body or the query.
With [http].tls = true the same listener is HTTPS only, never mixed. First start generates a local CA and leaf under <data>/tls/; import ca.pem once per client. SANs are localhost, 127.0.0.1 and ::1. An operator PEM pair overrides generation. The change feed route keeps its own capability token, separate from the MCP bearer, and a non-loopback bind with the feed enabled is refused at startup.
Three ways to run checks, and you pick one per instance:
| Driver | When |
|---|---|
run-due |
Cron or a systemd timer on the same machine. Opens the data directory, checks due monitors, prints {checked, skipped, changed, failed}, exits. |
run-due --http |
The server already runs and holds the lock. Talks loopback JSON-RPC, never opens the data directory. |
[scheduler].enabled |
A resident timer inside serve. Off by default. |
The data-directory lock enforces one driver. A local run-due fails while the server runs; run-due --http remains valid and cannot double-check because of the per-monitor lock and a next_due_at re-read. Enabling the in-process timer means removing any cron entry for that instance.
SQLite in WAL mode with one writer, BLAKE3 content-addressed files for raw bytes, one row per canonical URL, conditional GET, and a retention pass at startup. Events and extractions age out after 30 days by default, screenshots after 30, webhook rows after 30 with dead letters at 90, and the blob store is budgeted at 20 GiB. The full-text index lives inside the database, so it is not part of that blob budget.
Back up with VACUUM INTO, and back up the blob directory too. Migrations are forward-only, and an older binary refuses a newer schema, so rolling back the binary means restoring a pre-migration backup. The stop, backup, install, start and verify runbook is in docs/operations.md.
The sections above describe intent. This part is the contract.
Text block: YAML-ish front matter, then the Markdown body. structuredContent carries url, final_url, status, content_type, title, byline, site_name, published, lang, markdown_chars, markdown, truncated, limit_hit, render_mode, optional render_warning, cached, fetched_at, validated_at, last_attempt_at, last_attempt_failed, duration_ms, links, links_requested, links_truncated, optional render_quality, optional content_warning, word_count.
linksis always a list. It is[]wheninclude_linkswas false or omitted;links_requestedsays which request shape produced the answer. A cached answer re-deriveslinks_requestedfrom the current call. A client that usedlinks: nullto mean "not requested" must readlinks_requested.markdownis the delivered body — the Markdown the text block carries, without the front matter — wheninclude_contentis true (the default).include_content: falseomits it fromstructuredContentand turns the text block into a one-line metadata summary (url,status,title,words,render_mode). The body crosses twice when included; the cache stores it once and a cache hit reconstructs it.max_chars/markdown_charsbound it.render_qualityisokorthin(fewer than 200 main-content words) on renderedfetch_pageandextractresults. It is absent onstaticandstatic_fallback, where a short page is simply a short page. It is not part ofcrawl_results.- Freshness facts. Every content result carries four independent facts (schema v11).
fetched_atis the capture of the body/records/snippet you got back.validated_atis the last successful origin confirmation of that same representation: a usable 200 sets capture = validation; a 304 sets it only when the validators actually sent belong to the write that produced the served row; a local cache read uses that row's own write's confirmation; a failed attempt and an unclassifiable 304 leave it null.last_attempt_atis the completion time of the last recorded terminal attempt, andlast_attempt_failedisfalse(usable 200 or bound 304),true(terminal failure) ornull(unknown: no attempt, or a 304 that could not be bound). Attribution is row → write (pages.write_seq,extractions.source_write_seq), never a content hash, so two representations with identical Markdown cannot borrow each other's confirmation. content_warning: "interstitial_suspect"is set only for the whole conjunction: status 200, the final URL drifted from the requested URL in host or path, the final path has a whole verification/login segment (account-verification,verification,verify,challenge,captcha,login,sign-in,signin,security-check,checkpoint,auth,authorize,validate, case-insensitive), andword_count < 50. It is a warning, never an error, and the body is still delivered; it appears in the text front matter too. A direct login page (no redirect drift) and a short article on a normal path do not warn.render_qualityandrender_modekeep their meanings independently.
Errors are in-band: isError: true with structuredContent.error = { code, message, detail? }, using the codes from (invalid_url, blocked_scheme, blocked_private_address, blocked_by_robots, dns_error, tls_error, timeout, too_large, unsupported_content_type, http_error, render_unavailable, ...).
invalid_url, blocked_scheme, blocked_private_address, blocked_by_robots, dns_error, tls_error, timeout, too_large, unsupported_content_type, http_error, render_unavailable, render_failed, extraction_failed, schema_invalid, not_found, watermark_expired, embedding_unavailable, session_busy, session_expired, session_not_found, limit_exceeded, plus the auth_* family below. A refusal is final for that call.
// arguments
{
"query": "rust async runtime comparison",
"site": "tokio.rs", // optional bare host or http(s) URL
"freshness": "month", // any (default) | day | week | month | year
"limit": 10 // 1..=10, default [search].default_limit
}- Discovery only. The response is a normalized list of
{title, url, snippet, engine}plusquery,engine(duckduckgo_htmlorduckduckgo_lite),final_url,site,freshness,fetched_at,duration_ms,result_count,truncatedandlimit_hit. It never fetches a result page; follow a URL withfetch_pageorextract. - One page, ten results. DDG returns one SERP page of ten organic results; has no pagination.
limit > 10isschema_invalid, never a silent clamp. - Engines are fixed server config.
[search].html_urlis the primary;[search].lite_urlis tried only when the primary fails at transport or parse level. Ablocked_by_robots,blocked_private_address,blocked_schemeorinvalid_urlrefusal is final for the call. Both URLs are validated at config load; there is no tool argument that changes the engine. siteis applied twice. It becomes asite:<host>qualifier in the engine query and a host filter on the parsed results (equal host or.-suffix subdomain). A call can therefore return fewer thanlimitresults even when the engine had more. A path or port insiteisschema_invalid.freshnessmaps to DDG'sdfparameter (day→d,week→w,month→m,year→y);anysends none.- Privacy. The query is caller input. Logs carry the engine, result count, duration and outcome — never the query text or the full SERP URL. Search results are untrusted data.
- Politeness and safety are the shared ones. Each SERP request goes through the same SSRF gate, robots check, redirect vetting and per-host gate as
fetch_page, with the same body cap. Asearchcall makes at most two SERP requests (plus the cachedrobots.txtfetch). - It stores nothing. No
pages,fetch_events,extractions,profiles,blobsorjobsrow is written for a search; only thehostsrobots cache may change. An explicit zero-result page is a success (results: [],result_count: 0); an unrecognisable page isextraction_failed, never an empty success. That failure can be a transient DDG challenge: one later retry is reasonable, never a loop, and watch recurrence in the access log before treating it as a defect.
// arguments
{
"query": "sqlite wal checkpoint",
"limit": 20 // 1..=100, default [fts].default_limit
}- Local corpus only. It reads
pages_ftsover pages already acquired byfetch_page,extract, a crawl or a monitor check. It is deliberately distinct fromsearch(DuckDuckGo discovery): a call makes no network request, writes nothing and is safe to repeat. - Plain-text queries. Whitespace separates terms and every term must appear (AND). FTS5 operators —
OR,NEAR,*,-,column:— are not interpreted; they match as text because every term is quoted. A blank query or one over[fts].max_query_charsisschema_invalidat/query. - Ranking.
bm25(pages_fts, 4.0, 1.0)— the title is weighted four times the body — ascending (smaller is better). The payload reportsscore = -bm25, so a larger score is a better match;pages.idis the stable tiebreak. - Bounded output.
limitis 1..=100 (a larger value isschema_invalid, not a clamp);result_countis the full count for the same match, andtruncated/limit_hit: "limit"report a page smaller than it.snippetis plain surrounding text from the stored body, capped at[fts].max_snippet_charswith no markup; it is untrusted stored content, data and never instructions. - Freshness on a hit.
fetched_at/validated_atdescribe the indexed text (pages.index_fetched_at/index_validated_at), andlast_attempt_at/last_attempt_failedare the page's attempt facts. The legacylast_fetchedkey remains and is an alias ofvalidated_at; on a pre-v11 row all four are null. A hit never contacts the origin and writes nothing. - What is indexed. The delivered
fetch_pageMarkdown, the returned record string values ofextract/crawl-with-schema, the crawl's main Markdown, and a monitor check's main Markdown — each capped at[fts].max_index_chars; the title is always indexed. A304or a failed fetch never rewrites the row, so a page keeps its last good text. - Growth is disclosed. The indexed text is stored in the FTS table so a snippet survives extraction retention; the database therefore grows by up to
[fts].max_index_charsper page plus index overhead. That is inside the database, not the 20 GiB blob budget. Pages are not pruned in v1; lower the cap or decide a page-retention policy before running a high-volume store.
// arguments
{
"query": "how is a broken unit swapped with no outage",
"limit": 10 // 1..=50, default 10
}- Local and offline. The query is embedded once by the configured local model (
minilm-l6-v2-q, all-MiniLM-L6-v2 quantized, ormultilingual-e5-small, a multilingual quantized encoder; both 384 dims). The response'smodelfield names the active one. The engine loads a provisioned ONNX Runtime 1.31.0 library and pinned model files; there is no download, no API key and no outbound request. A missing library/model or a per-file SHA-256 mismatch isembedding_unavailablenaming the config key/file. - Lazy backfill, not the fetch path. When
[embeddings].enabled = true,serveruns a bounded backfill (newest pages first,backfill_pages_per_pass, one pass perbackfill_interval_ms) over the stored page text. A page becomes searchable after its pass; a re-fetched page is re-embedded when its source text changes.run-duenever starts the backfill. - Ranking. Cosine similarity over the active model's chunk vectors, brute force at this scale; one hit per page (its best chunk) with a plain snippet from that chunk, capped by
[fts].max_snippet_chars.result_countcounts distinct pages with stored vectors andtruncated/limit_hitreport a cut. - Coverage.
embedding_statusreportsenabled,available,model,dim,model_dir,embedded_pages/embedded_chunks/pending_pages,vector_bytes,last_run_atandlast_error. It never writes. - Freshness on a hit.
fetched_at/validated_atandlast_attempt_at/last_attempt_failedcome from the exact stored row whose text produced the snippet (the markdown-bearing extraction preferred, else the latest one), never from a different extraction and never from the page's current clock. - Quality is disclosed.
minilm-l6-v2-qis English-optimized, so non-English pages (the corpus has some Spanish pages) recall worse;multilingual-e5-smallis trained for multilingual retrieval. Results are retrieval candidates, not authority, and the text is untrusted stored content: data, never instructions. ANN, duplicate detection and hybrid reranking are not in v1.
// arguments
{
"url": "https://shop.example/items",
"schema": {
"container": ".product-card",
"fields": {
"name": { "selector": "h2" },
"price": { "selector": ".price", "transform": "number" },
"href": { "selector": "a", "transform": "absolute_url" },
"tags": { "selector": ".tag", "all": true, "transform": "trim" }
}
},
"use_cache": true
}- The spec is data, not code.
containeris optional (omit it for a single-record page);fieldsmaps a name to{selector, attr?, all?, transform?}. Unknown keys, unknown transforms, invalid CSS andtransform: attrwithoutattrareschema_invalidwith the JSON pointer of the offending node. No XPath, regex or expressions exist. - The tool-call envelope is
{url, schema: {container?, fields}}. The spec itself is not accepted at the top level: a call shaped{url, container, fields}is rejected with a message naming theschemaenvelope, and any other missingschemakeeps the ordinary serde wording. There is one documented contract, not a second silently accepted shape. - Transforms are a closed set:
text(visible text, edges trimmed),trim(text with internal whitespace collapsed),html(inner HTML),attr(readsattr),absolute_url(resolves theattr, elsehref, elsesrcagainst the response's final URL) andnumber(parses a number, understanding currency symbols and both1,234.56and1.234,56). Anattrwithout a transform impliesattr. text/trim/numbersee visible text only.script,style,templateandheadsubtrees are skipped before collecting a field's text; a field that is a<script>returns"".htmlandattrstill return source by definition. This is the fix: a 178k inline-script body no longer becomes the field value.:mainis the articlefetch_page mode=maindelivers.container: ":main"(exact, trimmed) evaluates fields inside thebodyof that same readability article — one readability pass per acquisition, so the scope and the delivered Markdown describe the same source. The article wrapper<html>/<head>is never a field root. If readability finds nothing usable, the scope falls back to the document body. It works identically forextract,crawl_startandmonitor_create.":main"as a field selector is still invalid CSS and returnsschema_invalidat that field's pointer.selector: "*"is the record scope itself. A field selector of exactly*(trimmed) selects the scope element, not its first descendant:text→ its visible text,html→ its inner HTML,attr→ the named attribute, andall: true→ a one-element array. With no container the scope is the document root, so*is the page's visible text. Any other selector (including* .itemordiv *) keeps ordinary CSS semantics.- Field selectors are descendant-scoped within the record root (the container element itself is not a match, except for the
*form above). - Failures are explicit. A scalar selector that matches nothing is reported as
selector_no_matchwith the field absent — nevernullor"". Anall: truefield that matches nothing is an empty array. Transform failures areattr_missing,url_join_failedornumber_parse_failed. A container that matches nothing returnsrecords: []plus a page-level error (record: null), never a fabricated record. - Caps and counts. Records are capped by
extract.max_records(5 000);record_countis the full match count andtruncated/limit_hit(max_records) say so. Two additive presentation caps bound the response:max_field_chars(default[extract].max_field_chars, 16 384) cuts every string value and array element and reportstruncated_fields;max_charsstops records in evaluation order at the serialized budget and reportslimit_hit: "max_chars". Precedence ismax_records→max_chars→max_field_chars. The cache stores the full records (caps are presentation-only), so a later larger-cap call still sees the full values. - Rendered thin signal.
render_quality: "ok" | "thin"is present onrendered/rendered_partialextract results (an approximation from the delivered page's visible words), absent on static/static_fallback, and also in the text front matter. - Evaluation is independent of Markdown. The spec runs over the parsed DOM with one parse per page, so content that
mode=mainomits from its Markdown is still reachable by a spec (see in the milestone plan). - Reuse.
use_cache: truemay answer from a stored extraction for the same page and spec insideextract.cache_freshness_s, otherwise the page is revalidated and a 304 reuses the stored result.profilesstores each spec once, keyed by the BLAKE3 hash of its canonical JSON. The spec text is part of that identity, so the:mainscope change and the*meaning do not changeprofiles.hash: a record cached under the pre- semantics can be served for up toextract.cache_freshness_s(default 300 s) after an upgrade — useuse_cache: falsewhen the new scope matters immediately. - Freshness facts.
fetch_page's four facts apply here too, bound to the served extraction row: a 304 setsvalidated_atonly when the validators sent belong to that row's write, and a cached answer uses that row's own capture plus its write's confirmation. A failed attempt advances neither clock. - Empty is a value. A matched
textfield with nothing visible returns""and is not afield_error;field_errorsreports selectors/attributes that did not match.
// arguments
{
"url": "https://example.com/prices.csv",
"format": "auto", // auto | csv | tsv | json | html_table
"selector": "table.results", // html_table only; first <table> when omitted
"delimiter": ",", // csv only; omit to sniff
"header_row": true, // csv/tsv/html_table default true
"json_pointer": "/items", // json only; default "" (document root)
"limit": 200, // 1..=1000
"max_field_chars": 8000, // 1..=20000
"render": "auto", // html tables only: auto|never|always
"use_cache": false
}- A sibling of
extract, not a mode.extractstays CSS-over-HTML and its identity staysprofiles.hash; tabular input has its own spec ({format, selector?, delimiter?, header_row, json_pointer?}), stored in the sameprofilestable.fetch_pageandextractkeep their content scope and still refusetext/csv; only this tool's fetch addstext/csvandtext/tab-separated-valuesto the media allowlist. robots.txt, the SSRF gate, the per-host politeness floor, charset decoding and the body caps are the same shared path. format: autouses the response media type (application/json/+json,text/csv,text/tab-separated-values,text/html/XHTML); anything else is sniffed from the first 4 KiB ({/[, a tab/semicolon/comma header). Anapplication/octet-streambody isunsupported_content_type, never guessed. An explicitformatwins over both.- CSV/TSV: RFC4180 quoting (
"", embedded delimiters and newlines), CRLF or LF, a UTF-8 BOM, and the response charset. The delimiter is sniffed from the header line (unquoted counts; a tie keeps,) unlessdelimiteris given. Headers are trimmed; blank →column_N; repeats →name_2. Ragged rows putnullin the missing fields andcolumn_Nfor extra values, and each anomaly is a boundedfield_errorsentry (20, thenfield_errors_truncated: true). An unclosed quote isextraction_failednaming the line and byte. - JSON: an RFC6901 pointer selects the record set. An array of objects is one record per element, a single object is one record, and an array with no object element becomes
{"value": …}per element. Numbers, booleans, null and nested arrays/objects keep their JSON type. A bad pointer, a scalar target or a mixed array isschema_invalidat/json_pointerwith the observed shape. - HTML table:
selectorpicks the table (first<table>when omitted). Headers come from<thead>when present, else the first row; cells are visible text.colspan/rowspanare not expanded in v1 — the cell text appears once and the table carries onespan_ignorednote. A selector that matches no table is atable_not_foundnote with zero records, not an error. - Bounds:
limitcaps returned records androw_countreports what was parsed (one extra row proves truncation:truncated+limit_hit: "limit").max_field_charscaps each string value and countstruncated_fields. - Store and search: the extraction row keeps the uncapped records with
record_count = returned, and the row text is indexed fill-empty: it gives a page its first indexed text and never replaces delivered page Markdown. A latersearch_contentfinds row values;use_cache: truereuses a stored result for the same URL and spec insideextract.cache_freshness_s. - Errors use the existing taxonomy:
unsupported_content_typewhen nothing classifies,schema_invalidat/format,/selector,/json_pointer,/delimiter,/limit,/max_field_chars, andextraction_failedfor an unclosed quote or invalid JSON.
// recipe_save
{
"name": "shop:products",
"schema": {"container": ".product-card", "fields": {"name": {"selector": "h2"}}},
"description": "product cards on the shop"
}
// recipe_apply
{
"name": "shop:products", "version": 1,
"url": "https://shop.example/items", "use_cache": true
}- CSS-spec only in v1. A recipe's
schemais exactly theextractenvelope ({container?, fields}), validated by the same validator with the same JSON pointers. Tabular (extract_rows) specs are per-call arguments, not recipes. - Name is identity. Lowercase
[a-z0-9][a-z0-9._-]{0,63}, optionally one:slugsegment (shop:products). Uppercase, whitespace and slashes areschema_invalidat/name; there is no rename (save under a new name) and no delete in v1 — history stays resolvable. - The spec stays in
profiles.recipes/recipe_versionshold only the name, the current version and a pointer to the content-addressed profile hash. An identical save is a no-op (changed: false); a description-only save updates metadata without a bump; a changed spec writes version N+1 while N keeps applying. A monitor created on an earlier version'sprofile_hashis unaffected by the advance. recipe_applyisextract. It resolves the stored spec and runs the ordinary extraction pipeline: robots.txt, the SSRF gate, the body caps,render,use_cacheandmax_field_chars/max_charsall behave exactly asextract. The response is the normal extraction payload plusrecipe,versionandprofile_hash; the extraction is stored (and row text indexed fill-empty) exactly asextractdoes. An unknown recipe or version isnot_found; version0isschema_invalidat/version.recipe_listreturns{name, version, profile_hash, description?, updated_at}in name order;prefixis a literal name prefix (not a pattern),include_schema: trueadds the stored canonical spec, andlimitis 1..=200 (default 50) withcount/total/truncated. Read-only: no network.
// arguments
{
"url": "https://example.com/report.pdf",
"max_pages": 200, // 1..=[pdf].max_pages (default 200)
"max_chars": 1000000 // 1..=[pdf].max_chars (default 1 000 000)
}- Text layer only. The document's text is returned as Markdown with one
## Page Nsection per page in range, plusmetadata(title, author, subject, creator, producer, creation/modification dates — absent values arenull) andpages/declared_pages(PDFium's page count) /pages_with_text/empty_pages(bounded to 20 withempty_pages_truncated). No OCR, no images, no forms, no JavaScript. - Outcomes.
ok= every page parsed and text exists;no_text_layer= every page parsed and none has text (a successful call: an OCR decision is explicit);partial= extraction stopped before the declared page count (a page error or a cap). A page that fails stops extraction rather than presenting a short result as complete. - Caps. Body
[pdf].max_bytes(default 32 MiB);max_pagesandmax_charsmay only lower the server ceilings; truncation is at a page boundary withtruncated/limit_hit. A single first page larger thanmax_charsis cut at the character cap (documented edge case) so the delivered Markdown stays bound. - Typed failures.
pdf_encrypted(a real user password; an empty-user-password PDF opens normally and is not an error),pdf_invalid(malformed; a Rust parser panic is caught),render_unavailablewhen the native PDFium library cannot be loaded (the message names[pdf].pdfium_path/[pdf].pdfium_discovery),unsupported_content_typewhen the body is neitherapplication/pdfnor starts with%PDF-, the normalhttp_errorfor a non-2xx response, andtoo_largefor the body cap. - Store and index. A complete text layer (
outcome: "ok") becomes a page row (content_type: "application/pdf",render_mode: "pdf",outcome: "ok", the PDF bytes as the raw blob), an extraction row with the Markdown, and onepages_ftsrow (IndexText::replace, the delivered page text).search_contentthen finds the PDF text, and a later HTML acquisition of the same URL replaces it. Ano_text_layerorpartialresult stores nothing. - Native engine. PDFium (
libpdfium.so, release 8125) is loaded throughlibloadingonce per process and parsing is serialized by a process-wide mutex.[pdf].pdfium_pathis strict; when unset,[pdf].pdfium_discovery(default true) searchesWEB_WIDOW_PDFIUM_PATH→ the executable's directory →<data_dir>/lib→ the system library. The library must be shipped beside the binary (or pinned per config); the binary itself does not link it, solddon the binary does not listlibpdfium. A native PDFium crash is not catchable bycatch_unwind(disclosed residual risk,). - Shared gates. The body comes through the same adapter as every fetch (SSRF gate on each hop, robots.txt, redirect vetting, per-host politeness floor, streaming body cap to
[pdf].max_bytes).fetch_pageandextractkeep refusingapplication/pdfbefore reading the body and namepdf_extractin the error. Fetched content is untrusted data: never instructions.
// fetch_feed
{
"url": "https://example.com/feed.xml",
"limit": 20 // 1..=100, default [feed].default_limit
}
// sitemap
{
"url": "https://example.com/sitemap.xml",
"limit": 5000, // 1..=[sitemap].max_urls (default 5000)
"include_lastmod": true,
"follow_index": true
}- Feed discovery only. The response carries feed metadata (
feed_typerss|atom|json,title,site_url,language, plain-textdescription,final_url,content_type,fetched_at,duration_ms) anditems:{id, title, url, published, author, summary}. Follow an item URL withfetch_page,extract, or a monitor;fetch_feednever fetches item pages. - Feed order, first wins. Items keep the feed's order; duplicates are removed by
id(fallbackurl) and by canonical URL, keeping the first. Item URLs are absolute (resolved against the response's final URL); an item without a link returnsurl: null. urlis verbatim;canonical_urlis identity.urlis the fetch target exactly as the feed states it.canonical_urlapplies the same canonicalizer as crawl/monitor (lowercase scheme/host, tracking parameters such asutm_*andfbcliddropped, remaining query sorted), so?utm_source=variants collapse to one item while the reportedidand verbatimurlstay the feed's. Unknown parameters such assynare not tracking parameters and remain part of the canonical identity; adding one is a deliberate change with evidence, not a silent widening.canonical_urlisnullwhen the item has no link (or the link is not an http(s) URL).- Feed dates and summaries.
publishedis RFC3339 UTC (nullwhen the feed has no usable date).summaryis the item's content/summary converted to plain visible text (script/style/head skipped), capped at[feed].max_summary_chars(default 2 000).truncated_summariescounts cuts. - Feed caps.
limitdefaults to[feed].default_limitand is clamped to[feed].max_limit;item_countis the parsed count before the limit.truncatedis true when either cap fired, withlimit_hitprecedence"limit">"max_summary_chars". - Untrusted feed input. A body with an internal DTD/entity declaration is refused with
extraction_failedbefore parsing (entity-expansion surface); malformed XML/JSON is alsoextraction_failed.text/html,application/xhtml+xmlandtext/plainareunsupported_content_type. - Feed acquisition and privacy. The same SSRF gate, robots check, redirect vetting, per-host politeness floor and body cap as
fetch_page. A feed read writes nothing (only thehostsrobots cache may change), has no conditional GET and never renders. - Sitemap formats.
<urlset>(<url><loc><lastmod>),<sitemapindex>(<sitemap><loc><lastmod>) and the plain-text one-URL-per-line file. Elements are matched by local name, so the sitemap 0.9 namespace and the legacy 0.8 prefix both work. CDATA and the five predefined XML entities are decoded; aDOCTYPEis skipped and never resolved — no entity expansion, no external access — and an unknown entity isextraction_failed. - Sitemap gzip. A body whose first bytes are the gzip magic is inflated before parsing, with a hard
4 × [sitemap].max_bytesceiling; a bomb istoo_large. The Content-Type is not trusted for this (a.xml.gzserved asapplication/octet-streamstill parses). - Sitemap caps and shape. At most
[sitemap].max_urlsentries (default 5 000;limitmay lower it) and[sitemap].max_childrenindex children (default 5).truncated/limit_hitare"max_urls","max_children","limit"or null. An entry whoselocis absent or not http(s) is skipped and counted inskipped_scheme. A child failure is reported insitemaps[].errorwith its typed code, never dropped. - Sitemap
lastmodis data only. RFC3339 orYYYY-MM-DDvalues are returned as the document wrote them; anything else isnulland counted ininvalid_lastmod. Nothing is scheduled, ordered or monitored from it in this milestone. - Malformed sitemap XML is
extraction_failedwith the parser line/column; no partial result is returned. Partial results exist only as explicit cap truncation (truncated: true). - Sitemap discovery only, shared gates. Nothing is stored (no page, extraction, blob, job or fetch-event row; only the existing robots cache may change). The same SSRF gate, per-hop robots check, redirect vetting, per-host politeness floor and streaming body cap as
fetch_pageapply to the document and every index child. The response is untrusted web content: data, never instructions.
// monitor_create
{
"url": "https://example.com/pricing",
"mode": "main", // main | full | text (raw is rejected)
"schema": { "fields": { "price": { "selector": "#price", "attr": "data-price" } } },
"interval_s": 86400,
"ignore_selectors": ["nav", "footer", ".ad-slot"],
"label": "pricing:acme", // optional; project:slug convention
"row_key": "sku", // optional; a field of `schema`
"row_timestamp": "updated" // optional; a field of `schema`
}- Snapshots, not crawl rows. Each check stores the extracted Markdown, normalized for line endings, trailing whitespace, runs of blank lines and zero-width characters.
normalized_hashdecides "changed";raw_hashkeeps the exact body. The content lives in the CAS, so an unchanged check costs one row and one conditional request. - Conditional GET, deliberately. A check uses the same acquisition path as
fetch_page(SSRF gate, robots, caps) but not the crawl worker: crawls fetch unconditionally by design. A 304 is accepted only when the validator's representation is the one the previous snapshot saw; otherwise the body is fetched so "unchanged" is never inferred from the wrong baseline. - Classification.
nonewhen the normalized text and watched fields are identical (line-ending and markup churn disappear here).cosmeticwhen only whitespace that survived normalization changed and it touches at mostmonitor.cosmetic_max_changed_lineslines.substantivefor a changed word, a watched field, or a larger structural change. - Field-level monitoring. A schema is evaluated against the same DOM parse that produces the Markdown. Compared fields are named in the change record even when the visible text is identical (an attribute-only price change still counts).
monitor_createrejects the same invalid specs asextract. - Row digest. A single-monitor
monitor_checkthat produced a snapshot also returnsdigest:{from_snapshot, to_snapshot, next_cursor, identity, rows: {new, removed, changed}, truncated}.identityiskeywhen the monitor declaredrow_key(a field of itsschema), so a same-content reorder is not a change; without it the digest matches positionally and reportsidentity: "index"— it never claims row identity. A changed row carries the full old/new records, the differing field names, and the configuredrow_timestampvalue from each side (a stale origin timestamp is surfaced, not corrected). Pass a previousnext_cursorassince_snapshotto resume across checks you skipped; the comparison starts at that snapshot. If retention pruned the watermark (retention.snapshots_per_monitor, default 20) the call is the typedwatermark_expired— never a partial or false diff, and no request is spent.truncatedmeans a compared record set reached the extractionmax_recordscap, so rows beyond it are not represented. No new tool and no change tomonitor_changesorevents. - Diffs are capped, stats are not.
monitor_changesreturns newest-first withfrom_snapshot/to_snapshottimestamps, kind, full line/word/field counts and a unified diff capped atmonitor.max_diff_bytes(truncated: true; the counts are never truncated). - Failures are one terminal result. A permanent 404 is requested once, stored as a
fetch_event, advancesnext_due_at, and appears in the check'sfailedlist — no fabricated snapshot and no crawl-style retries. - Delete is a tombstone.
monitor_deletesetsactive = 0; history and snapshots stay queryable, and checks skip it. - Listing.
monitor_listreturns up to 500 monitors in id order withlabel,mode,active,has_schema,interval_s,created_at,last_checked_atandnext_due_at;include_inactive: truealso returns tombstones.truncatedandlimit_hit: "limit"report a page smaller than the matching total. Alabelis optional (project:slugconvention), trimmed, 1..=64 characters, not unique and not pattern-enforced; every pre-v5 row isnull. - Bounded bulk checks.
monitor_check(all: true)returnspending: truewith a job id immediately. Addwait_ms(bounded by[monitor] max_wait_ms, default 30 000) to check inline and sequentially up to that budget: if the set finishes,pending: falseand no job exists; when the deadline hits between monitors, the remainder is enqueued as one job with the remaining ids and the partial typed results are returned. One in-flight check may overrun by at most one check.monitor_idwithwait_msisschema_invalid. - Scheduler: opt-in in-process timer (amended). The decision chose no scheduler. amends it: with
[scheduler].enabled = true(default false),serveruns a resident timer that checks due monitors via the samerun_duepass;tick_ms(default 30 s) andmax_checks_per_tick(also clamped by[monitor].max_checks_per_call) bound each pass.run-dueis unchanged, and one driver per instance is enforced by the data-directory lock: a localrun-duefails while the server runs, whilerun-due --httpgoes through the server (the per-monitor lock andnext_due_atre-read prevent doubles). Default off keeps cron/systemd valid. - Retention. The newest 20 snapshots per monitor plus every change point (and the snapshots its diffs reference) survive GC; blobs are retained while a page or snapshot references them. A digest watermark that GC pruned is
watermark_expired, not an empty diff.
// arguments
{
"format": "json", // json (default) | rss
"monitor_id": null, // one monitor
"since": "2026-01-01T00:00:00Z", // RFC3339, inclusive
"limit": 50, // 1..=200
"include_diff": false
}- Data. Newest-first
changesjoined tomonitors(label) and the page title by canonical URL:{change_id, monitor_id, monitor_label, url, title, detected_at, kind, stats, diff?, from_snapshot, to_snapshot}.statsis the same shapemonitor_changesreturns;include_diffadds the capped diff (the RSS document never carries it).count/truncated/limit_hitreport a page. Read-only: no change is fabricated and nothing is written. - RSS.
format: "rss"returns{xml, bytes, item_count, feed_url}— RSS 2.0 (channel title/link/description/lastBuildDate, item title/link/guid/pubDate/description), newest first, at most 100 items, every text node XML-escaped and control-stripped. The description carries the stats, never the diff. Tests parse the document withfeed-rs(the same parserfetch_feeduses). - Served GET (loopback only). With the
httpfeature and[events] feed_enabled(default true), the listener servesGET /feeds/changes.xml?token=<capability token>withContent-Type: application/rss+xml; charset=utf-8, anETag(body hash),Cache-Control: max-age=60and a 304 on a matchingIf-None-Match. Missing or wrong token → 401;feed_enabled=false→ 404. The feed token is separate from the MCP bearer (WEB_WIDOW_FEED_TOKENor a 0600<data_dir>/feed-tokencreated on first start; rotate by replacing it and restarting). The route is outside/mcp, requires no bearer, performs no outbound fetch, and the access log records the path only (never the query). The route is loopback-only by enforcement: a non-loopback HTTP bind with the feed enabled is refused at startup (the operator sets[events].feed_enabled = falsefor an MCP-only network deployment), andhttp::servereturns an error if called with a non-loopback address while the feed is on.feed_urlin the tool payload is non-null only while that listener is active; stdio has no route.
// webhook_target
{
"monitor_id": 7,
"targets": ["ops"] // configured names only; [] clears; 0..=8
}- Config-named targets only.
[webhooks.targets.<name>]in the operator's config holdsurl,kind(generic/slack/discord), one ofsecret_env/secret_file, one ofauth_env/auth_file, andinclude_diff. Tools andmonitor_create.webhook_targetsaccept names, never URLs, so page content or a prompt-injected agent cannot introduce an endpoint. HTTPS only unless[webhooks].allow_http = true(loopback/test); no userinfo; no redirects. The URL is treated as a secret and never logged or returned. - Atomic outbox. A changed check inserts one
webhook_deliveriesrow per attached target inside the change transaction. A separate dispatcher (inserve, or one bounded flush in localrun-due) attempts it: 2xx delivered; 408/429/5xx/timeout retried; other 4xx/redirect dead; backoff[60,300,1800,7200,21600]s + deterministic jitter;deadaftermax_attempts. The check path never touches the network. - Signing. With a secret, posts carry
X-Web-Widow-TimestampandX-Web-Widow-Signature: sha256=<hex HMAC-SHA256(secret, timestamp + "." + body)>plusX-Web-Widow-Event: changeandX-Web-Widow-Delivery: <id>. - Status.
webhook_statusshowsenabled, targets (name,kind,host,has_secret,has_auth,include_diff), monitor attachments, recent rows (status,attempts,last_status,next_attempt_at,last_error) withinclude_deliveries: true, andpending/deadcounts. Only the host is returned; secrets and URL paths never are. - Egress disclosure. Enabling a webhook deliberately sends monitor metadata — the watched URL, its label, the change kind, stats and a short summary, and the capped diff only when the target opts in — to the configured endpoint. It can leave the host's network and is not gated by robots/SSRF (the target is operator-chosen). A misconfigured target or a compromised config file is an exfiltration path. No webhook fires without an attachment; remove the target or set
[webhooks].enabled = falseto stop all delivery. - Retention. Delivered rows age out after
[retention].webhook_deliveries_days; dead letters after the longerwebhook_dead_days; pending rows are never pruned. Tombstoning a monitor dead-letters its pending rows.
// crawl_start
{
"start_urls": ["https://docs.example.com/"],
"sitemap_urls": [], // up to 5; start_urls may be empty
"scope": { "include_paths": ["/docs/"], "exclude_patterns": ["\\?page="],
"max_depth": 3, "allow_offsite": false },
"render_policy": "thin_only", // never | thin_only | always; auto = thin_only
"limits": { "max_pages": 500, "per_host_rate": 1.0, "max_duration_s": 1800 },
"schema": { "container": ".entry", "fields": { "title": { "selector": "h1" } } }
}- Frontier in SQLite, dedup as a constraint. Every enqueue is
INSERT ... ON CONFLICT DO NOTHINGonPRIMARY KEY(job_id, url_hash), so a URL cannot be enqueued twice even if a caller forgets to check. Canonical identity is the same rulefetch_pageuses (lowercase host, default port and fragment dropped, tracking parameters removed, query parameters sorted); a trailing slash is a different resource. - Leases, not in-memory queues. A worker leases a row with
lease_until; an expired lease is requeued withattempts+1, and aftercrawl.max_attemptsthe URL becomesfailedwith its last error. A killed process therefore resumes on the next start (crawl_statusreportsrunninguntil leases expire), and no completed page is fetched again. - Politeness and safety are the shared ones. Each page goes through the same
fetch_pagepath: SSRF gate on every address and redirect hop, robots.txt per hop, streamed caps, retries.per_host_rateadds a per-job interval floor; the configured minimum interval and any robotsCrawl-delaycan only raise it. A crawl cannot widen its own reach. - Scope applies to discovered links (seeds are taken as given): depth, registrable site (off-site skipped unless
allow_offsite),include_pathsprefixes, andexclude_patternsregexes matched againstpath?query. - Trap resistance. When a fetched page's content identity — the Markdown with link targets removed — was already seen in the same job, the page is stored but its links are not followed. A calendar trap therefore stops after the first duplicate instead of consuming the page budget.
- Limits are honest.
max_pagesandmax_duration_sstop the job withstate: done,limits_hitnaming the limit, and the remaining frontier reported ascounters.queued.crawl_resultspaginates with an opaque cursor bound to the job (a cursor from another job isnot_found). - Per-item freshness. Each
crawl_resultsitem carriesfetched_at,validated_at,last_attempt_atandlast_attempt_failedfor the exact row it reports: with a schema, the joined extraction row's own capture and write sequence, so a later same-specextractis dated from its own write and never from the earlier crawl's clock; without one, the page write the crawl made. A failed attempt renews nothing. - Sitemap seeding.
sitemap_urls(at most 5) are fetched and parsed before the job is persisted, each through the same gate. Their entries are discovered URLs, not explicit seeds: the job'sscopefilters them (include_paths,exclude_patterns, off-site) and they are deduped againststart_urlsandmax_pages, then enqueued at depth 0. Explicitstart_urlskeep the "seeds bypass scope" rule. With emptystart_urls, the scope's site set comes from the sitemap URL, so a cross-site entry is skipped. The start payload gainssitemap: {urls_found, urls_enqueued, urls_skipped, errors: [{url, code}]}only whensitemap_urlsis supplied; a sitemap failure is recorded there and the other seeds still start.lastmodis never used for ordering or scheduling. - Cancel is cooperative. In-flight pages finish, no new rows are leased, the job ends
cancelled, and partial results stay readable.
// corpus_export
{
"format": "jsonl", // jsonl | markdown
"name": "corpus", // slug [a-z0-9][a-z0-9._-]{0,63}
"site": "example.com", // optional canonical-site filter
"since": "2026-10-01T00:00:00Z",
"limit": 1000, // 1..=10000
"include_text": true, "include_extraction": true,
"max_bytes": 268435456 // 1 MiB..=1 GiB
}
// snapshot_compare
{
"kind": "monitor", // monitor (snapshots.id) | page (fetch_events.id)
"from": 12, "to": 15,
"include_diff": true,
"max_chars": 20000 // 1..=100000
}- What a corpus row is. A page whose latest fetch succeeded and that has stored text. The text is the delivered Markdown or the record text, capped at 200 000 characters per row (
text_truncated); the latest extraction is embedded (omitted withextraction_truncated: truewhen it alone exceeds the same cap). A page with no stored text (failure-only, or an extraction pruned by retention) is counted inskipped_no_textand never emitted with an invented body. - The boundary. Monitors and recipes are not corpus rows: monitor history is
monitor_changes/changes, and the recipe library is a configuration surface overprofiles. The export coverspages+ their extractions only. - Shapes. JSONL: one JSON object per line with
url, canonical_url, title, lang, site, first_seen, last_fetched, fetched_at, validated_at, last_attempt_at, last_attempt_failed, status, content_type, render_mode, text_hash, text, text_truncated, extraction, extraction_truncated. Markdown: a directory withindex.md(front matter: generated_at, filters, record count) andpages/<url_hash>.md(front matter url/title/fetched_at/validated_at/last_attempt_at/last_attempt_failed + body). In both shapesfetched_atis the page text's capture, the JSONLlast_fetchedkey aliasesvalidated_at, and a failed attempt renews neither. - Paths are not caller-controlled. The filename is
<slug>-<UTC stamp>inside<data_dir>/exports/(created0700), written to a dot-temp and renamed on success,create_newand never overwritten. An invalid name isschema_invalidat/name. - Bounds. Streamed page by page (no job, no corpus in the response): the record
limitormax_bytesstops it, withtruncatedandlimit_hit(limit|max_bytes). The response carries the path, counts and bytes only. - Compare pairs.
kind: monitortakes twosnapshots.idvalues from the same monitor (text from the stored normalized Markdown; a schema monitor also compares its canonical records and reports the first 20 changed indices inrecord_changes).kind: pagetakes twofetch_events.idvalues with a stored extraction and the same canonical URL (the delivered text is compared as stored). Stats are never capped;diffis capped atmax_chars(truncated+limit_hit: "max_chars"). A missing id/version isnot_foundnaming the constraint; a cross-monitor or cross-URL pair isschema_invalidwithmismatch. Nothing is written.
// screenshot
{
"url": "https://example.com/app", "full_page": true, "wait_ms": 300
}
// → { "url", "final_url", "status", "hash", "bytes", "mime": "image/png",
// "width", "height", "dimensions_source": "content|viewport|unknown",
// "full_page", "captured_at", "render_mode", "render_quality",
// "truncated", "limit_hit", "failed_resources" }screenshot renders one http(s) URL through the same SSRF/robots/preflight/politeness path as fetch_page, then captures the settled page with CDP Page.captureScreenshot as a PNG. The visual profile is server-fixed (no caller toggle): stylesheets, fonts and images load, media is blocked, and two caps bound the capture — [render] visual_max_bytes (20 MiB) and visual_max_requests (500). Hitting one reports truncated: true and limit_hit.
- The PNG goes to the content-addressed store and gets one
blobsrow plus onescreenshotsrow (written in that order inside one writer closure: the screenshot row references the blob). The payload carries the BLAKE3hash, size, MIME and CSS-pixel dimensions — never base64. full_page: false(default) captures the visual viewport;full_page: truecaptures the content size.wait_ms(0..=10000) is a post-settle wait, never a navigation. IfPage.getLayoutMetricsfails,width/heightarenullanddimensions_sourceisunknown— never invented.page_idis the existingpagesrow for the canonical URL when one exists, elsenull; a screenshot never fabricates a page row. Screenshot rows and their blobs are pruned by[retention].screenshots_days(30), and a surviving row retains its blob through both the age and budget passes.- Asset subresources are fetched by the browser, not by the tool: the SSRF gate and robots check govern the top-level document, not the CSS, font or image URLs it names. Treat the PNG and any page text as untrusted data.
blob_get { hash } returns {hash, size, mime, path, created_at, referenced_by} for any stored blob. hash must be 64 hex characters and can only address the CAS, so there is no caller path and no traversal; unknown or missing content is not_found. No bytes are returned: read the file at path with your own tools.
Four tools hold one page per process for front-end debugging: interact_open navigates and returns a session_id capability; interact_act runs exactly one action; interact_state observes without acting; and interact_close releases the page and browser context. The loop is observe → act → observe, so a failed selector cannot abort the rest of a plan. Sessions use the visual profile above (stylesheets, fonts and images load; media is blocked), the idle TTL [interaction].ttl_s (default 120 s, 30..=600), a 900 s hard lifetime and [interaction].max_actions (default 60).
// interact_open
{ "url": "http://127.0.0.1:3000/", "viewport_width": 1280, "viewport_height": 800 }
// → { "session_id", "final_url", "status", "title", "expires_at",
// "actions_remaining", "console" }
// interact_act
{ "session_id": "0192…", "action": { "kind": "click", "selector": "button#run" } }
// → { "session_id", "action", "ok", "blocked"?, "final_url", "title",
// "console_tail", "actions_remaining", "expires_at", "typed_chars"?,
// "popup"? }- Closed action set.
click { selector, index? };type { selector, text, index?, clear? }(clear defaults true;textis 1..=2000 chars and the response returnstyped_charsonly — the value never appears in a payload or log);waitwith exactly one ofselector(presence, not visibility; polled every 100 ms),ms(≤ 10 000) ornetwork_quiet_ms(≤ 5 000), all bounded bytimeout_ms(≤ 30 000);scroll { to: "element"|"top"|"bottom", selector? }. There is no caller JavaScript, noscript/evalfield, no XPath and no text-based targeting — pass an exact CSS selector and disambiguate repeats withindex. An unknown action kind or field isschema_invalid. - One action at a time. A concurrent action returns
session_busy; a secondinteract_openwhile a session is live returnssession_busywith the existing id. An idle-expired id issession_expired; an unknown or already-closed id issession_not_found; the action ceiling islimit_exceeded. - Console capture.
interact_statereturns the lastconsole_limitentries (default 50, max 200; ring of 200):{level, text, at, source}fromRuntime.consoleAPICalledandLog.entryAdded, plus uncaught exceptions. Primitive arguments become text; objects are reduced to their description or a bounded preview, never expanded, and each entry is capped at 500 chars. Console text is untrusted data. - Network gate (defense in depth). Every request routed through the session page's target is paused with CDP
Fetchbefore it leaves the browser:data:/blob:continue,file:/ws:/wss:and any non-http(s) scheme are refused, and every http(s) request passes the SSRF gate. Documents additionally pass robots.txt; every request takes a per-host politeness lease, so the session keeps the ≤1 request/s host floor. A refusal appears on the action asblocked: {reason, detail}(blocked_private_address,blocked_by_robots,blocked_scheme,blocked_iframe,request_cap, or a visual cap) and no request reaches the target.interact_openitself passes the normal top-level render path. Per-session bounds: the visual caps, a 500-paused-request abuse cap (refused requests included), and 10 state screenshots. - Target scope (what the gate does and does not cover). The gate covers requests routed through the intercepted page target's network stack. It does not cover requests from other targets, so this implementation refuses subframe documents (iframes are out of scope), disables service-worker registration and the
SharedWorkerconstructor, and prevents popups at the document level (window.openown property and prototype,form.submit/requestSubmitreading the content attribute, shadow-root forms, and a server-side pre-dispatch hit-test at the click point: the deepest node is resolved in the pierced DOM and its ancestor chain (shadow hosts included) is checked against the hit node's own document's first<base target>. Every click-policy input — the base target, eachtarget/formtarget/typeattribute, and a submit control's form owner (a non-emptyformattribute resolved by id in that control's own tree — resolved per chain node, so a chain crossing a shadow boundary never borrows the hit node's tree — so a sibling form in a shadow tree is modelled even though it is invisible to an event path) — is read throughDOM.querySelector/DOM.getAttributesand the pierced DOM tree, so page JavaScript cannot intercept or fake it. A hit<label>is resolved to its labeled control (forin the same tree, otherwise the first labelable descendant) and that control is evaluated with the same rule, because label activation forwards a click the guard cannot see through a closed declarative root (review 2026-11-02). The label pass is suppressed only for the spec's interactive content — an anchor withhref, button, form control outside the hidden state, select, textarea, details, embed, iframe, label,audio/videowithcontrols, orimgwithusemap— not for a baretabindexelement or an href-less anchor, which the UA still forwards to the control (g33, g33d). The hit test setsignorePointerEventsNone, so apointer-events:noneoverlay is transparent to the check as it is to the press. The click point is computed once from the browser's content quads and dispatched withInput.dispatchMouseEvent;DOM.scrollIntoViewIfNeededreplaces pagescrollIntoView, and the element's box is re-read immediately before the press, so a box that moved between the check and the dispatch is refused (click_point_moved). There is no page-order candidate budget; the pierced-tree read itself is bounded (5 s, 50 000 examined nodes) and a limit is reported (walk_truncated), never an unchecked dispatch, and an action refusal is reported even when a subresource was blocked earlier in the same action). Amousedown/pointerdownhandler is a page callback between the check and the click default action; the box re-read closes the layout version of it, and the guard's windowclickcapture listener (re-asserted acrossdocument.open/write) cancels a target flipped by it; thesubmitlistener applies the same effective-target rule (a presentformtargettakes precedence over the form'starget, even when empty; an empty effective target then falls to the base target and then_self— g35/g36 measured both halves), so aformtarget="_self"submit inside a_blankform is not over-blocked, and the listener is load-bearing for any submit whose effective target differs from the form's target and for shadow-tree submissions. Typing cannot deliver Enter (the key table has no newline entry, so a newline fails the action), so an implicit submission is not reachable fromtype_text. The close-on-attach backstop is cleanup, not an egress control: the guard-disabled discriminator evidence shows every creation shape reached the private listener (2 TCP) with the backstop alone, so creation prevention is the only egress control. A dedicated worker's ownfetchis observed on the page target and gated on the verified Chrome 156 build; worker-created targets (a nestedWorker,importScripts, and aSharedWorkercreated from a worker'sWorkerGlobalScope) are an unvetted egress channel — a known hole, not only untested — and are a recorded residual (review 2026-11-01). It is an SSRF filter, not an egress filter: it does not stop a page sending data to a public host, and WebRTC/UDP and DNS-only channels are outside it (launch flags disable DNS prefetch and non-proxied WebRTC UDP). The vet resolves and pins the shared HTTP path's addresses; the rendered browser path still resolves inside Chrome, so a rebinding zone can reach a private address there — a disclosed residual, with Chromium's private-network protections as the remaining control, not a solved problem. - Popups, targets, and cross-origin page changes.
window.open(own property and prototype) is replaced,form.submit/requestSubmitand non-self anchor/area/form targets are cancelled at document start, and closed shadow roots are forced open so a shadow anchor cannot hide from the cancel path (a page can still reachwindow.openthrough a target the guard does not see; the page target is then closed)._self,_top,_parentand an empty target on the top frame are allowed same-context navigation;_blankand named targets are cancelled and reported asblocked.reason: "navigation_cancelled"(a blockedwindow.openreportspopup_blocked) so a click is never silently a no-op.popup: "not_followed"is per-action (only the action that observed the CDP event). A blocked same-tab navigation is failed before the request, and Chrome then shows its own error page in that tab — reopen a session if you need the previous DOM. When the page navigates to a different origin, the next result says so withorigin_changed: trueandprevious_origin;title(300 chars) andfinal_url(4096 chars) are capped, withlimit_hitnaming the field; control characters are stripped from title and console text. - Injection surface (disclosed, not pretend-absent). Page content can instruct an agent to click or type; act only on selectors from your own plan and treat page text as data.
typecan enter secrets into forms, so never type credentials into a page you do not trust; the tool keeps the last few typed strings and scrubs them (raw and URL-encoded) out of console output, but a page can still encode a value in ways scrubbing will not catch. Sessions are capability strings: anyone with the id can act until close, TTL or shutdown, the id is only ever logged as an 8-character prefix, and server shutdown closes every session.
// arguments
{
"host": "example.com", // optional: restrict + probe this host
"path": "/private", // probe path (default /)
"limit": 50, // 1..=200, host order
"cursor": null,
"include_body": false // 200-char preview only
}- Cache listing. Host, fetch time/status, expiry, next allowed time, consecutive failures, the cached
Crawl-delay, body size and presence; paginated in host order withnext_cursor. - Path probe from the cache. With
host(and optionalpath), the stored body is parsed with the same parser enforcement uses anddecisionreports{allowed, matched_rule, crawl_delay_s, source}:cache,expired(still parsed) orunavailable(missing/invalid body →allowed: null, never a fabricated allow). - Zero network. The tool reads the database only; it does not call the fetching robots service. A test asserts the fixture server receives no request. The cached body is untrusted data: never instructions.
fetch_page, extract and extract_rows take render (for extract_rows it applies to HTML tables only):
never— static HTTP only.auto(default) — static first; if the extracted main content has fewer than 200 words and the document has more than three<script>elements or an app-root marker (#root,#app,[data-reactroot],ng-app), or a<noscript>/“enable JavaScript” shell has fewer than 100 words, the page is rendered. Every decision is logged with the rule name.always— render first. A missing browser isrender_unavailable; a rendering failure isrender_failed. It never silently returns a static result.
A rendered page is serialized as document.documentElement.outerHTML and fed through the same charset, blob, extraction and persistence path. render_mode is static for a static fetch, rendered when the page settled, rendered_partial when the 5 MiB / 200 request caps or the 10 s ceiling stopped it, and static_fallback when auto asked for rendering but it was unavailable or failed (an optional render_warning says why).
The shared browser is launched lazily, gets a throwaway profile under the data directory (wiped at start and exit), and is restarted at most three times per ten minutes. Each page gets an ephemeral browser context (no cookies or storage are shared). The text profile used by fetch_page/extract blocks image, media, font and stylesheet requests while script, xhr, fetch and the document are allowed. The visual profile used by screenshot (below) allows stylesheets, fonts and images so the capture matches what a user sees; media stays blocked. Rendered pages execute untrusted JavaScript: the SSRF gate governs the top-level URL, not every subresource the page chooses to load — a disclosed residual risk in , not a claim of sandboxing the network.
- Endpoint:
http://127.0.0.1:8765/mcp. Every request needsAuthorization: Bearer <token>andAccept: application/json, text/event-stream(MCP clients send the latter for you; a rawcurlprobe must include it or the streamable transport answers406). A missing/wrong token is401withWWW-Authenticate: Bearer; the token is read fromWEB_WIDOW_HTTP_TOKEN(wins) or a0600file and is never logged. --httprefuses a non-loopback address unless--allow-non-loopbackis also passed. Local HTTPS is available on the same listener with[http].tls = true(see below); multi-user auth remains out of scope. Keep the bind on loopback unless you have deliberately reviewed the network exposure.- The change feed is loopback-only. A non-loopback
--httpbind with[events].feed_enabledis refused at startup (before any token is resolved or provisioned): set[events].feed_enabled = falsefor an MCP-only network deployment.http::servere-checks the bound address, so a library caller cannot bypass the refusal. - The loopback HTTP transport is stateless. Every POST is served directly;
Mcp-Session-Idis neither required nor issued, and stale/unknown/absent ids are ignored instead of returning404.initializecompletes the handshake normally (application/json). Only POST is served:GETandDELETEon/mcpreturn405withAllow: POST, and the server emits no server-initiated messages. Bearer auth, Host validation and the body cap are unchanged. - Each request writes one access line to stderr:
method,path,status,session(the first 8 characters of a supplied id, ornone) andduration_ms; INFO for status ≥ 400, DEBUG otherwise. The bearer token, the body and the query string are never logged. - stdout stays empty in HTTP mode; all logs are stderr.
- SIGINT/SIGTERM stops the listener, cancels job workers, closes the browser, wipes the throwaway profile and releases the data-directory lock (target: exit within 10 s).
Set [http].tls = true to serve the same /mcp and /feeds routes over HTTPS on the --http listener. TLS is strict either-or: that port is HTTPS only, never plaintext. With no certificate paths, the first start generates a local CA and server certificate under <data>/tls/ (ca.pem/server.pem 0644, ca-key.pem/server-key.pem 0600, meta.json; directory 0700). Trust the CA once in each client, or provide an operator PEM pair with tls_cert_file/tls_key_file (both or neither; an override skips generation).
openssl verify -CAfile <data>/tls/ca.pem <data>/tls/server.pem
openssl x509 -in <data>/tls/ca.pem -noout -subject -dates -fingerprint -sha256
curl --cacert <data>/tls/ca.pem https://127.0.0.1:8765/feeds/changes.xml
export NODE_EXTRA_CA_CERTS=<data>/tls/ca.pem # Node-based MCP clientsFirefox: Settings → Privacy & Security → Certificates → View Certificates → Authorities → Import → ca.pem → trust for websites. Chrome/Chromium (Linux, NSS): certutil -d sql:$HOME/.pki/nssdb -A -t "C,," -n "web-widow local CA" -i <data>/tls/ca.pem (needs nss-tools), or import in chrome://settings/certificates. System store (Debian/Ubuntu): copy ca.pem to /usr/local/share/ca-certificates/web-widow-local-ca.crt and run sudo update-ca-certificates. The SANs are localhost, 127.0.0.1 and ::1; connect by one of those names. The CA lasts ~10 years and the leaf ~13 months with startup renewal; an expired CA is a typed startup error (delete <data>/tls/ to re-mint, then re-import). Generated material is loopback-only; a non-loopback bind needs an override with the right SAN. See docs/operations.md for the full lifecycle, override and error contract.
Credentials are config-only. A secret reference (op://, bw://, pass://) lives in the 0600 config file; the agent names an operator-defined profile, and only through fetch_page.profile. No other tool accepts profile (or any other credential-bearing key) — that is schema_invalid before dispatch.
[auth]
audit_days = 90 # auth_audit retention, 1..=3650
manager_timeout_ms = 5000 # hard per-resolution timeout, 100..=60000
allow_loopback_http = false # plain HTTP for literal loopback addresses only
persist = false # store authenticated bodies (return-only when false)
index_authenticated = false # include stored ones in FTS + embeddings
events_authenticated = false # include events derived from them in the feed
page_retention_days = 7 # retention for stored authenticated pages
[auth.managers.op] # absolute path; PATH is never searched
path = "/usr/bin/op"
env_allow = ["OP_SERVICE_ACCOUNT_TOKEN"] # the only extra vars the child sees
[auth.profiles.github] # bearer (default) | basic | header
kind = "bearer"
host = "github.com" # lowercase bare host
port = 443 # exact credential origin port, 1..=65535
reference = "op://Private/github/token"- Per-site opt-in. The operator configures the profile, the binding host and the reference (or, for
kind = "session", the login/verify URLs); nothing is authenticated until a profile exists and is named. A header profile refuses a redirect to another host (auth_redirect_blocked); an SSO/session-gated site uses akind = "session"profile, where the operator logs in withauth login(once per session lifetime;session_max_age_days, default 30) and the sealed jar is reused. - Return-only by default. An authenticated
fetch_pagepersists no authenticated content and no credential — no page or extraction row, no blob, no FTS/embedding, no cache, no event, no webhook — and reportscached: false,authenticated: trueand the profile name. The only store writes are its single value-freeauth_auditrow and the unauthenticated robots cache (hosts), which the hop guard updates before the binding check.[auth].persist = trueopts in to storing the body labelled (authenticated,auth_site) and extraction-only; stored pages are excluded fromcorpus_export, the feed and webhooks, and from FTS/embeddings and events unlessindex_authenticated/events_authenticatedis set, withpage_retention_days(default 7) retention. A store failure on that persistence path is a typed error that stores nothing (no page, event or extraction row, and no failure record, which would store an unlabelled page); return-only calls are unaffected because they write no row. A header profile stays static (render = always→auth_render_unsupported); withrender = always, a session profile renders through the dedicated authenticated browser. - Trail. Exactly one value-free
auth_auditrow per attempt (profile name, host, method, status, bytes, outcome, resolution time — never a value, a reference, a path or a query), pruned after[auth].audit_days. The runbook and the SQL to read it are indocs/operations.md§12. - Exact origin. A credential attaches only to the configured
host:port(default 443) and never to a subdomain, even withallow_subdomains = true, which widens browser reachability only. Plain HTTP is admitted for the literal addresses127.0.0.1and::1only, and only withallow_loopback_http. - Authenticated reuse. A session profile uses a sealed jar against a dedicated pipe-only headless browser (ephemeral context per fetch, host-only cookie injection, the egress policy on every request plus a loopback proxy) or the static cookie path. It is read-only: GET/HEAD only, no mutation authority. An HTTP auth challenge fails the fetch (
auth_challenge_refused). The launch carries--webrtc-ip-handling-policy=disable_non_proxied_udp— theforce-spelling is a no-op on Chrome 156 and must not be reintroduced. The requested document is SSRF/robots/lease-vetted before the browser starts; a rendered page's own subresources are outside robots (they remain subject to the egress policy). Details:docs/operations.md§12.8. - Errors.
auth_profile_unknown,auth_manager_failed,auth_manager_timeout,auth_secret_unavailable,auth_rejected,auth_redirect_blocked,auth_host_not_allowed,auth_insecure_url,auth_render_unsupported,auth_header_rejected,auth_store_unavailable,auth_store_locked,auth_store_invalid,auth_session_missing,auth_session_expired,auth_challenge_refused,auth_method_refused,auth_session_unsupported. A failure never falls back to an unauthenticated fetch. - Disclosure. Authenticated fetching is the operator's responsibility: use a credential you are entitled to use against that site, respect its terms of service and robots policy, and prefer a narrow read-only token. By default the server returns the body to the calling agent and never persists it; with
[auth].persistthe body is stored labelled and egress-restricted as above, and the operator owns the decision. What the agent does with a returned body is outside the server's control.
Current schema: v12.
Migrations are forward-only. An older binary refuses a newer database with database schema vN is newer than this binary, so rolling back the binary requires restoring a pre-migration backup.
profiles.hashis versioned (spec/v1/...). Cached extraction rows written by an older unversioned build are simply missed and re-fetched; nothing is corrupted. An in-flight pre-upgrade crawl job that carried a schema should be restarted as a new job so its profile identity andcrawl_results.extractedjoin stay consistent.- If a unit passes
--http, install a release built with thehttpfeature and keep the rollback artifact outside the build tree. The shared unit'sExecStartpoints intotarget/release, so any feature-differentcargo build --releaseoverwrites the deployed file (the running process keeps its image) and the next restart fails withthis binary was built without the http feature. Verify the installed file'ssha256sumand that it is http-capable before starting; the B01 default build is not a rollback for an--httpunit.docs/operations.mdnames the durable artifacts by sha. - ** is code-only** (no schema or data change). The previous
99ab3a4http binary is the rollback; preserve/install a feature-matched artifact and check its sha before start, as above.docs/operations.mdrecords the upgrade/rollback note. - v5 added the nullable
monitors.label; v6 added the FTS5 tablepages_ftsand themetamarker table, then backfilled one index row per existing page in 200-page transactions at the first start (idempotent; thefts_backfill_v6marker makes a second start a no-op). Back up the database and the blob directory before running a newer binary; an older binary refuses a newer schema (database schema vN is newer than this binary), so rolling back the binary requires restoring a pre-migration backup.docs/operations.mdhas the stop → backup → install → start → verify runbook, the v6 note and the restore drill. - v12 added
monitors.row_keyandmonitors.row_timestamp(nullable, additive) for the monitor digest; every v11 monitor becomes keyless and keeps its rows and history unchanged.watermark_expirednames a pruned digest watermark. - v11 added the corpus-freshness provenance (
pages.write_seq,content_*,index_*,validators_write_seq,last_attempt_*andextractions.source_write_seq) and backfilled conservatively in the same transaction: the oldpages.last_fetchedbecame the attempt pair (not_modified→ unknown), and the success clock was recomputed from retained events that prove a usable 200 (no error, HTTP 200, a body hash or an extraction created by that same event). No capture or validation is invented for a legacy row: those columns stay null, and a page whose only retained success is a 304 gets a null internal clock.pages.last_fetchedis now success-anchored (seedocs/operations.md§13). - Snapshots created before v4 have an unknown render mode; their first post-upgrade check fetches the body unconditionally and records the actual mode, so the static 304 shortcut only applies from then on.
Intended use: internal agent tooling over publicly accessible pages such as docs, news and reference sites, with robots.txt respected and at most one request per second per host. Authenticated access is operator-configured, per-site and opt-in. Session-gated sites are reached only through an operator-captured kind = "session" login, and only for content the operator is entitled to access; the server adds no paywall or access-control bypass. There is no open-web discovery, proxy rotation, distributed crawling or multi-user auth.
Known limits, stated rather than hidden:
mode=mainuses readability and can drop sibling blocks, for example a comparison table beside an article. A bounded repair restores a missing run only when it starts with an undelivered sibling section heading and the repair stays under 25% of the delivered text. Usemode=fullormode=textwhen completeness matters.- Monitors watch one URL each. Schema monitors compare declared fields, not a full JSON delta.
- A rendered monitor re-fetches every check, because the static validator cannot prove the rendered DOM is unchanged.
monitor_check(all: true)has no cancel tool; shutdown is cooperative, and a crash marks the job failed while monitors stay due.- A permanent 404 is one terminal check, not a three-attempt retry.
crawl_resultsrows are page-current, not per-attempt snapshots: each item's freshness facts come from the exact row it reports, and a later unrelated write is never retro-dated onto it. The page'sstatus/title/raw_hashremain the page's current values (a pre- behaviour, unchanged).- A crawl whose seeds are all blocked ends
donewithfetched: 0andlimits_hitdistinguishing a limit stop. - Local search has no
OR,NEARor prefix operators, no page-level retention, and no authenticated crawling. - The change feed is loopback-only with its own token, not a multi-user service.
- Sitemap ingestion is discovery only;
lastmodschedules nothing and a nested index child is reported as an error rather than recursed. pdf_extractreads the text layer only, uses no password, and stores only a complete result.
src/core/ pure domain: URL canonicalization, IP classification, robots decisions, truncation
src/config.rs TOML + env + CLI, path resolution, permission checks
src/fetch/ HTTP adapter, SSRF gate, per-host gate, robots cache, charset, content scope
src/extract/ readability + Markdown + metadata + links; spec validation and evaluation
src/render/ renderer port, CDP browser lifecycle, discovery, auto heuristic
src/store/ SQLite repository, migrations, content-addressed blobs, retention, jobs/frontier
src/crawl/ crawl scope predicate, job worker, crawl service
src/monitor/ normalization, classification, monitor service, run-due
src/search/ DuckDuckGo html/lite parser and the search payload
src/fts/ query validation, FTS5 expression, payload
src/auth/ credential profiles, egress policy, sealed sessions
src/pdf/ PDFium loading and text-layer extraction
src/sitemap/ sitemap parsing
src/rows/ CSV, TSV, JSON and HTML table parsing
src/webhooks/ outbox dispatcher and signing
src/export/ corpus export and snapshot comparison
src/interaction/ page session and the click guard
src/tls.rs generated local CA and leaf lifecycle
src/mcp/http.rs loopback streamable HTTP transport (feature `http`)
src/mcp/ rmcp server and the tool surface
src/pipeline.rs single-URL orchestration
docs/operations.md operator runbook: data, GC, backup, HTTP, troubleshooting
AGENTS.md short repository build, test and run instructions
| File | What is in it |
|---|---|
docs/operations.md |
Install and verify, data layout, retention and GC, backup and restore, migration runbooks, Chrome discovery, HTTP and TLS, monitoring ops, auth runbooks, troubleshooting, uninstall |
AGENTS.md |
Toolchain, build and test commands, run modes, guardrails for contributors |
SKILL-INSTALL.md |
Installing the server and the field-guide skill together |
skill/web-widow/SKILL.md |
The agent-facing field guide |
config.example.toml |
Annotated defaults |
MIT. See LICENSE.
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2026-07-28","capabilities":{},"clientInfo":{"name":"me","version":"1"}}} {"jsonrpc":"2.0","method":"notifications/initialized","params":{}} {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"fetch_page","arguments":{"url":"https://example.com/","mode":"main","include_links":true}}}