scopeFindings
scopeFindings(
findings,files):object
Defined in: src/critic-core.ts:347
Deterministic scope backstop (Fix B2) — PURE, SYNC, git-free (operates on the already-resolved
files set carried on InFlight, so it never touches the poll loop). For each finding, parse a
leading <path>: token (stripping an optional :<line> suffix on the path) and DROP it iff:
files is non-empty AND the leading token is path-shaped AND it does NOT correspond to any
changed file (see correspondsToChangedFile: exact, trailing-segment, or basename match).
Findings with no parseable path prefix are KEPT (unattributed → never drop something we can’t
attribute). Note this means a finding prefixed with an extensionless path (Makefile: ...,
Dockerfile: ..., LICENSE: ...) is NOT path-shaped per isPathShaped, so it is treated as
unattributed → KEPT even when outside the diff; the drop rule does not cover those. When files
is empty, NOTHING is dropped (caller skips the filter entirely; this is belt-and-suspenders).
Returns the kept + dropped split so the caller can log each drop.
Parameters
Section titled “Parameters”findings
Section titled “findings”string[]
string[]
Returns
Section titled “Returns”object
dropped
Section titled “dropped”dropped:
string[]
kept:
string[]