EMBED-AND-CI-10: Map findings to editor diagnostics
What it demonstrates
Section titled “What it demonstrates”Translating positioned Findings into editor diagnostics via Finding.pos and level.
Builds on: EMBED-AND-CI-02: Scope a subtree with cwd and globs
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 } = runCorpus(config, { cwd: workspaceRoot });const diagnostics = findings.map((f) => ({ uri: f.path, line: (f.pos?.line ?? 1) - 1, // editors are 0-based; whole-doc findings have no pos col: (f.pos?.col ?? 1) - 1, severity: f.level, // "error" | "warn" | "report" source: f.id, message: f.message,}));Surfaces exercised
Section titled “Surfaces exercised”runCorpus findingsFinding.pos {line, col}level/id/path/message for diagnostics