EMBED-AND-CI-02: Scope a subtree with cwd and globs
What it demonstrates
Section titled “What it demonstrates”Narrowing a run to part of the tree with runCorpus’s cwd plus programmatic include/exclude.
Builds on: EMBED-AND-CI-01: Run the corpus in-process
How it’s done
Section titled “How it’s done”A TypeScript program against the library API; inline comments show the resulting values and behavior.
const { findings, exitCode } = runCorpus(config, { cwd: "docs/planning", include: ["tasks/**/*.md"], exclude: ["**/_archive/**"],});// include/exclude pre-filter relative to cwd, AND-narrowed before rule matchingSurfaces exercised
Section titled “Surfaces exercised”runCorpus opts: cwd, include, exclude (the global pre-filter)