Skip to content

scopeBackstop

scopeBackstop(baseSha, files, decision, parsed, logLabel): object

Defined in: src/critic-core.ts:402

Deterministic scope backstop (Fix B2): drop any path-attributed finding whose file is provably outside this PR’s diff (files), without trusting the LLM, then reconcile the decision. Skips filtering (keeps ALL findings) when the base is unknown (baseSha null → local-base fallback) or the file set is empty (no diff / git failure) — filtering against an unknown/stale base could nuke real findings. Logs every drop + every skip (no silent cap). Returns the (possibly flipped) decision and the post-filter findings; the caller still does the request-changes summary fallback for the non-emptied case.

PURE: takes the resolved base/file set + a logLabel (the session id where the session critic interpolated it) so both the session critic and the standalone PR critic reuse it.

string | null

string[]

ReviewDecision

string[]

string

object

decision: ReviewDecision

scoped: string[]