selectScopedPrompts
selectScopedPrompts(
changedPaths,entries):ScopedPromptsEntry[]
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/config/scopedPrompts.ts:43
Select the scoped entries a diff’s paths activate.
An entry is selected when at least one positive pattern matches at least one changed path and
no negative (!) pattern matches that same path. Negation is therefore evaluated per path,
not per entry: excluding a module’s generated build directory stops a generated file pulling the
entry in, while a real source file in the same module still does. Evaluating it per entry
instead would let one excluded path veto the whole entry, which is not what a user writing an
exclusion means.
An entry whose match contains only negative patterns can never be selected — there is no
positive pattern to match. That follows from the rule rather than being special-cased, and it is
left as a selection outcome rather than a config error: the schema’s job is the shape of an
entry, not whether the user’s globs are useful.
The result is in config order, never match order. The user controls the ordering, and an order derived from which path happened to match first would change with the diff.
Nothing is de-duplicated: the entry list is the user’s, and two entries naming the same file are two entries they chose to write.
Parameters
Section titled “Parameters”changedPaths
Section titled “changedPaths”readonly string[]
entries
Section titled “entries”readonly ScopedPromptsEntry[]