EMBED-AND-CI-03: Route subtrees with first-match rules
What it demonstrates
Section titled “What it demonstrates”Mapping different globs to different contracts in one config where the first matching rule wins.
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 config = defineConfig({ rules: [ { include: ["tasks/**/*.md"], contract: taskContract }, { include: ["decisions/**/*.md"], contract: decisionContract }, { include: ["**/*.md"], contract: fallbackContract }, // catch-all, last ],});const { findings } = runCorpus(config, { cwd: "docs/planning" });Surfaces exercised
Section titled “Surfaces exercised”CorpusConfig.rules orderingfirst-match routing across multiple contracts