readSpecsfunctionfunction readSpecs(root: string, folder?: string): Promise<readonly Spec[]>The specifications of a folder (<folder>/NNN-slug/spec.md, and reviewed.tsv where there is one), in the order of their names.
The runtime's part of trace and layers (commons 0015-trace FR-011): it reads the files the kernel's checks judge (kernel/trace.ts, kernel/layers.ts) and holds their findings against a baseline file. A harness's tool calls it and prints the lines it gives; it prints nothing itself.
import * as t from "../trace.ts";
import { holdBaseline, readSources, readSpecs } from "./trace.ts";
const root = ".";
const findings = t.traceFindings({
specs: await readSpecs(root, "specs"),
sources: await readSources(root, ["src"]),
tests: await readSources(root, ["tests"]),
ontology: [],
});
const held = await holdBaseline({ root, file: "tools/trace.baseline.txt", findings, name: "trace" });
for (const line of held.lines) console.log(line);readSpecsfunctionfunction readSpecs(root: string, folder?: string): Promise<readonly Spec[]>The specifications of a folder (<folder>/NNN-slug/spec.md, and reviewed.tsv where there is one), in the order of their names.
posixPathfunctionfunction posixPath(p: string): stringA relative path with / between its parts, whatever the system's separator (FR-011).
readSourcesfunctionfunction readSources(root: string, roots: readonly string[], suffixes?: readonly string[]): Promise<readonly SourceFile[]>The files under roots (folders or files, from root) whose names end in a suffix (.ts by default), leaving out node_modules, by path from root with /.
HoldOptionstypeno test imports ittype HoldOptions = {
readonly root: string;
readonly file: string;
readonly findings: readonly Finding[];
readonly name: string;
readonly write?: boolean;
/** The comment lines a written baseline begins with. */
readonly comments?: readonly string[];
};What holdBaseline is given: the repository, the baseline file (from it), the findings, the check's name, and whether to write.
Heldtypeno test imports ittype Held = { readonly code: 0 | 1; readonly lines: readonly string[] };The lines to print and the exit status of a check held against its baseline.
holdBaselinefunctionfunction holdBaseline(o: HoldOptions): Promise<Held>Findings held against a baseline file (FR-002, FR-003, FR-011), or, with write, the baseline written from them.