.sightmap/ corpus itself healthy. sightmap validate is the structural gate: it checks the YAML against the spec and exits non-zero on any error. sightmap lint runs advisory style checks that catch selectors likely to rot. sightmap search is an offline regex search across the corpus with hierarchy breadcrumbs. sightmap discover classifies the URL space of the live page against your views. This page documents every corpus tool.
sightmap validate
Structural check of the corpus against the spec: the YAML parses, every component has a name and at least one selector, every selector parses in the supported subset, view routes are present, stability: and access: values are legal, and no scope declares the same name-plus-selector pair twice. Exits 1 on any error. Run it after every YAML edit and in CI.
Unsupported selector syntax is caught here too — a positional pseudo-class like :nth-child() is a validate-time parse error that points you at the four supported pseudo-classes (:not(), :is(), :where(), :has()).
Flags:
error: line and the command exits 1:
sightmap lint
Style and quality checks — static, no browser, advisory. Where validate answers “is this corpus well-formed”, lint answers “will this corpus age well”. The five main rules:
Three smaller checks run alongside them:
name-case flags component names that do not start with an uppercase letter, comma-in-selector flags a top-level comma in a selector (split it into separate selectors instead), and every validate error is re-emitted as a warning under the validation rule, so lint alone also surfaces structural breakage.
By default lint exits 1 when any warning exists. Pass --warn-only to always exit 0 — the recommended mode in the authoring loop, where warnings are advice rather than a gate.
Snapshot data sharpens the noisiest rule: --snapshot FILE (or --all-snapshots to walk .sightmap/snapshots/**/*.snap.tree.json) counts how many nodes each component’s selector actually matches in the captures. A count of exactly 1 suppresses multi-instance-no-property as a false positive; a count of 0 appends (0 matches in snapshot — selector may be broken); a higher count appends (matched N times in snapshot).
Flags:
sightmap search
Offline regex search across every .yaml/.yml file under .sightmap/. Matches print with a hierarchy breadcrumb — file, view (with its route), parent components, then the matching component — so you can see where a definition lives without opening files. PATTERN is a Go regular expression and matching is case-insensitive unless you pass --case.
Restrict the search with --field: name, selector, description, memory, or all (the default). --field selector is the fastest way to hunt duplicate selectors across views; --field memory finds triage notes and past decisions.
Flags:
no matches for PATTERN to stderr and still exits 0.
sightmap discover
URL pattern discovery from the live session. The command extracts every same-host link from the current page, normalizes dynamic path segments — numeric IDs, UUIDs, digit-bearing slugs — to *, and classifies each resulting pattern against the corpus:
?unseen — no view route matches. Sorted by link count, so the highest-traffic gaps come first.✓mapped — the pattern matches a view’sroute:.○surveyed — the pattern matches an entry in.sightmap/survey.yaml: pages you visited and deliberately chose not to map. Hidden unless you pass--all.
Typical flow
1
Validate after every edit
Run
sightmap validate whenever you touch corpus YAML. It is fast, offline, and exits 1 on structural errors — wire it into CI as a hard gate.2
Lint for style
Run
sightmap lint --warn-only and read the warnings as a review checklist. Add --all-snapshots once you have captures, so match counts separate real problems from false positives.3
Search before you add
Before naming a new component, run
sightmap search for the name and --field selector for the selector — reuse or promote an existing definition instead of duplicating it.4
Discover the uncovered URL space
From a live session, run
sightmap discover and triage each ? pattern into a new view or a survey.yaml entry until none remain.