Skip to content

EMBED-AND-CI-02: Scope a subtree with cwd and globs

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

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 matching
  • runCorpus opts: cwd, include, exclude (the global pre-filter)