THE LIBRARY · VOLUME 02

Watching pages

How a page becomes fields, how fields become facts, and why a subprocessor table is a set, not a wall of text.

01Whole pages and fields

Watch everything, or watch exactly one thing.

A target with no selectors watches the whole page as line-aware text: good for a terms page or a regulator feed where any meaningful movement matters. A target with selectors watches named fields: good when only the price, the effective date, or the subprocessor table matters and the rest of the page is free to churn.

Fields are the sharper instrument. Each field diffs independently, alerts name the field that moved, and the noise policy can hold different lines for different facts.

02The five kinds

One selector kind per shape of fact.

KindWhat it reads
cssThe first match of a CSS expression: its text, or an attribute value with an @attr suffix. The default kind.
xpathThe first match of an XPath expression, for structures CSS cannot reach.
jsonA path into a JSON document, for API responses and embedded data blobs.
regexThe first capture group of a pattern applied to the page text, the escape hatch when structure fails.
listEvery element matching the expression, as a sorted, deduplicated set of items. The kind built for subprocessor tables.

Field names are part of the record, so they must be unique per target: registering the same field twice is rejected at the door rather than silently overwritten.

03Lists are sets of entities

Reordering is not a change. An added vendor is.

A list field is stored as a sorted set, so a page shuffling its rows produces no difference at all. Each table row is keyed by its first cell, with the remaining cells folded in behind it. The consequences are exactly what a vendor-risk reviewer wants:

dormouse woke: Acme Trust Center [subs] Added 1: Stripe Inc · Removed 1: Amazon Web Services (confidence 1.00)

An added or removed vendor is reported by name. A reworded row is one changed entity, not a spurious add plus remove. Header rows made only of column labels are chrome, not vendors, and are excluded from the set. And item text is normalized before comparison, so an invisible character or a decomposed accent cannot fake an addition or hide a removal.

04Selector craft

Stable containers, one fact per field, rebaseline after surgery.

Point selectors at the most stable container that holds the fact: the table, not the third row; the labeled element, not the fourth paragraph. Prefer one field per fact over one field that swallows half the page, because narrow fields produce narrow, readable alerts.

When you change a target's selectors, the next observation may differ purely because the extraction changed shape. Rebaseline exists for exactly that moment: it resets the comparison point without alerting, absorbing the mechanical difference so the next real change is judged against a clean baseline. The rebaseline itself is recorded in the trail as its own kind of check, so even the reset is part of the evidence.