SPOT-001: shared/spot.js the ONE file-location resolver (fragment anchors, symbols, needles)

Now
STALE

Superseded by SPOT-002: fragment grammar re-ruled 2026-07-18 (#L123 line, #needle substr, #/re/, #'tok pattern'; symbol forms dropped).

Input

Context

Several consumers need "find a location in a file" and each is about to roll its own: why: fragment scoping (/todo/WHY/WHY-002), the planned spot-view rebuild (today's views/spot/search.js + match.js, JAB-021), and later cat:/diff: scoped hunks. The C side already fixed the vocabulary: HUNKu8sMakeURI emits #L42 / #sym / #sym:L42 / #'quoted body':L42 (dog/HUNK.c:60), HUNKu8sFragSplit extracts, and symbols are the tokenizer's N-def tags (CAPOFindFunc, spot/CAPO.c:579).

Goals

shared/spot.js: parse a locator string, resolve it over (source bytes, ext) to match spans.

Constraints

WIP

Design decisions

TODOs

Blockers and bummers

Outcome

(pending)