.sightmap/ corpus. snapshot observes a page — it prints an annotated tree and coverage, and never touches the corpus. capture persists a capture into the matched view’s set, subject to the novelty gate. inspect shows the unfiltered DOM structure for selector authoring.
All three commands need a running browser session. Start one with
sightmap browser start; see Browser session. Use Coverage commands to score saved captures, View sets to understand their layout and maintenance, and selector tools to verify a selector before adding it to YAML.snapshot
Connects to Chrome, extracts the component tree, applies the corpus, and emits an annotated ARIA tree with coverage statistics to stdout (or to --out FILE). snapshot is a pure observe command: it never writes into the corpus’s capture set and never applies the novelty gate. Persisting a capture is capture’s job.
The output contains a [View: ...] header when the URL matches a view (followed by a tags: line with the union of tags across every view whose route matches the page, when any are declared), a [Guide] with match counts by component, the component tree, and a [Coverage] summary. [Warnings] lists declared components that matched no nodes. [Conflicts] flags runtime ambiguities: two or more views matching this URL at equal specificity (declaration order picked the winner), and any single DOM node matched by more than one component definition that the selector text cannot order (the most specific definition names a node when there is one; otherwise the first declared is kept, which also explains a component that otherwise looks like it matched zero nodes). Two claimants can share a name, since names are unique only within a parent; the report then adds each one’s selector to tell them apart. When a corpus is loaded but no view’s route matches the URL (for example after an auth redirect), the header is replaced by a [No view matched] <url> notice so you know the page is off the map. The [Coverage] summary is printed whenever a corpus is applied — even for a matched view with no components yet, where every interactive node reads as an orphan — so the snapshot --coverage bootstrap always has something to iterate on.
A [Frames] section follows when the page has iframes. Snapshots descend into every iframe, same-origin, cross-origin (out-of-process) and nested, and place each frame’s tree under its <iframe> node. The section lists each frame document with the URL it is matched at and the view that URL resolves to, then a ⚠ note for anything left out (a frame cut at its node cap, frames past the frame cap, a frame that could not be read). See Iframes.
Each tree line starts with a numeric probe ID, then the node content:
- Matched nodes render as
ID [ComponentName prop="val"]. The component name replaces the ARIA role, properties are sorted alphabetically, and the accessible name appears last unless it duplicates a property value. - Unmatched nodes render as
ID role "text"with the ARIA role and accessible name.
Snapshot excerpt
--coverage gives a terse feedback view — the same [View], [Warnings], and [Coverage] sections plus the T3/T2 cluster traces, with the (potentially huge) tree suppressed. It is the fastest way to read a page’s coverage while authoring:
sel-probe before writing YAML, add the component, then run snapshot --coverage again. Repeat until the coverage line reads 0 orphaned T3 ✓.
--tree-out writes the raw component tree used by coverage, multi-coverage, and sel-check. --json writes an annotated version that adds matched component names, memory notes, and extracted property values. Both flags require a file path. --out writes the rendered annotated output to an arbitrary file — this is a plain file write, unrelated to the corpus view set.
Component
properties: (shown as prop="val" in the annotated output and included in --json files) are defined by the spec; see Component properties. A property read from a node whose effective privacy is block or mask is withheld, and so is the node’s accessibility value, so a masked input never renders its own value.Iframes
Widgets, embedded dashboards and checkout forms live in iframes, often in another origin and often nested.snapshot (and every command that extracts a tree: capture, inspect, explain, gap, suggest) descends into all of them by default.
Snapshot excerpt
- IDs carry a frame prefix. The top document’s IDs are bare numbers; the Nth frame’s are
N_…. The interaction commands take them like any other ID and resolve the frame themselves. - A frame is matched as a page of its own, at its own URL. The view whose
routematches the frame’s URL supplies its components, not the page’s view, so a widget host’s sandbox path needs a view of its own in the corpus. A selector never crosses a frame boundary, in either direction. Asrcdocorabout:blankframe takes its parent’s URL. A masked or blocked<iframe>masks or blocks its whole document. - Bounds are in top-page coordinates, so a frame’s boxes line up with a screenshot of the page.
- Size. Descending is the default, with a cap per frame (
--frame-max-nodes, 3000) and per page (--max-frames, 32), so one oversized ad or embedded document cannot swamp the snapshot; whatever is cut is reported in[Frames].--no-framesturns it off. Frames whose<iframe>has no box (display: none) or a 0×0 viewport are skipped silently.
capture
Extracts the component tree exactly as snapshot does, then persists it into the matched view’s set at .sightmap/snapshots/{view}/{stamp}.snap, writing a sibling .snap.tree.json. capture requires a view: a page with no matching route is an error (use snapshot to observe an unmapped page). Success prints a one-line confirmation and coverage summary to stderr.
A view is a set of captures, not a single file — real pages are non-deterministic. capture appends rather than overwrites, and the novelty gate keeps a capture only when it adds a matched component type or an orphan slot that does not appear elsewhere in the set. Changes to values such as products, prices, or copy do not count. The first capture of a view always writes; --force bypasses the gate.
Flags:
--all navigates to each view’s top-level url and any snapshots[].url variants, appends a novelty-gated capture for each target, then prints a summary:
capture-novelty / capture-prune maintenance commands.
The capture inbox
--inbox keeps a page without deciding which view it belongs to. Use it when a tool learns the views from the captures themselves, so no route can be required up front. The capture goes to .sightmap/inbox/{stamp}.snap with its .snap.tree.json and a full-page .snap.png. Its header always records the page url:. No view is required and no gate applies; a corpus, when one loads, only annotates the capture. A second capture in the same second is written as {stamp}-2.snap rather than overwriting the first.
browser start session running, open the Sightmap side panel and click Capture, or press Alt+Shift+C. The session daemon captures the tab you are looking at, and the panel logs the stamp. The daemon serves this as POST /capture with a Content-Type: application/json body of {"url": "<the page's URL>"}. It captures the one session tab showing that URL, and refuses when none or several do. Only the extension and local tools may call it: a request carrying a web page’s Origin is refused, since the endpoint drives the browser and writes the corpus.
inspect
Renders the unfiltered DOM component tree with identifying attributes. Use it to find an anchor when you do not yet have a selector to pass to sel-probe.
Each line shows the probe ID, a CSS-selector-style display (tag#id[attr="value"]), and the accessible name when present. By default, it includes data-*, aria-*, role, type, href, name, for, action, src, and placeholder. Hidden and ignored nodes are marked [hidden] and [ignored]. A matched node carries a ★ComponentName annotation.
Flags:
Typical flow
1
Start a browser session
Run
sightmap browser start from the directory containing your .sightmap/ corpus. Confirm with sightmap browser status (see Browser session).2
Close coverage gaps on one page
Run
sightmap snapshot --coverage --url 'URL' and read the coverage line. For each unlabeled cluster, verify the suggested selector with sel-probe, add a component to your YAML, and run it again until 0 orphaned T3 ✓.3
Inspect when you need an anchor
When no suggestion fits, run
sightmap inspect --interactive to see the raw DOM with ★ marks on already-claimed nodes, and pick a stable attribute to build the selector from.4
Refresh the view sets
Run
sightmap capture --all to append a novelty-gated capture for every view URL in views/*.yaml, then score them offline with the coverage commands.