Skip to content

EMBED-AND-CI-11: Snapshot a stable baseline

Relying on the deterministic (line, col, plane) finding order to snapshot a baseline that diffs cleanly.

Builds on: EMBED-AND-CI-04: Gate a vitest suite on findings

A TypeScript program against the library API; inline comments show the resulting values and behavior.

const { findings } = runCorpus(config, { cwd: "docs/planning" });
const baseline = findings.map((f) => `${f.path}:${f.pos?.line ?? 0} ${f.id}`);
// order is deterministic (sorted line, then col, then plane), so a committed
// baseline.json only changes when the findings actually change
expect(baseline).toMatchSnapshot();
  • deterministic finding order (line, col, plane)
  • stable baseline/diff over Finding[]