/** * Env var naming the file a script writes its check count to. Set per-script by * the runner (`runScripts`), read once here at import. */ export declare const CHECK_COUNT_ENV = "VIGILES_CHECK_COUNT_FILE"; /** * How a tier came to name a surface. Not a strength ranking — a statement of * what the machinery went by, so a reader can tell an inference from a sighting: * * - `command` — the executed command line named a program file (`runScript` / * `runHook`). The strongest kind: that exact path was handed to a process. * - `fired` — the surface appears in the RUN'S TRANSCRIPT as having activated (a * `Skill` tool call that resolved, a hook that reported). For a skill this is * the only honest attribution: what was INSTALLED is a set, what RAN is one. * * There is deliberately NO author-declared origin. A `surface:` field on a spec * would be `vigiles:covers` with extra steps — a claim about a test written by * whoever wrote the test — and that tier was removed after its first real use * declared a conformance lint over 21 skills as coverage of all 21. */ export type ProbeOrigin = "command" | "fired" | "dispatched"; /** * One surface a run went by. `ref` is whatever the tier saw — a script path, a * namespaced skill id (`plugin:skill`), a hook name — NOT a resolved repo path. * Resolution happens in the runner, where discovery lives. */ export interface SurfaceProbe { readonly how: ProbeOrigin; readonly ref: string; } /** * Record `n` checks against this script's run. * * The tiers call it themselves, so an ordinary harness never needs to. Call it * directly when you assert some OTHER way — `node:assert`, vitest's `expect`, a * hand-rolled comparison — and want those visible to `vigiles test` instead of * leaving it to conclude the file did nothing. */ export declare function recordCheck(n?: number): void; /** How many checks this process has recorded so far. */ export declare function checksRecorded(): number; /** * Record that this run exercised the surface `ref` names. Called by the TIERS * from what they were pointed at — never by a harness author, because a field an * author fills in is a claim, not a measurement (that was `vigiles:covers`, and * it was removed for exactly this reason). * * Deduped: a harness that fires the same hook forty times names it once. * Empty/blank refs are dropped rather than stored as a surface called "". */ export declare function recordSurfaceProbe(how: ProbeOrigin, ref: string): void; /** The surfaces this process has been seen to exercise, in first-seen order. */ export declare function surfacesRecorded(): readonly SurfaceProbe[]; /** * Reset the counter, the probes AND the armed flag. For vigiles's own tests, * which drive {@link armCheckReport} with fakes several times in one process; a * harness script has no use for it. */ export declare function resetCheckCount(): void; /** What a run reported: how much it did, and what it did it against. */ export interface CheckReport { readonly checks: number; readonly surfaces: readonly SurfaceProbe[]; } /** * Serialize a report for the scratch file. A run with no probes writes the BARE * NUMBER it has always written — byte for byte, so the legacy reader and the * legacy tests are describing the same thing they always were. Only a run with * an attribution to make spends a JSON object on it. */ export declare function formatCheckReport(report: CheckReport): string; /** * Parse a scratch file's contents, or `undefined` for anything that is not a * report. Lives beside {@link formatCheckReport} so the two cannot drift. * * Tolerant in exactly one direction: a bare integer is the legacy form and is * read as a report with no attribution. Anything malformed — a torn write, a * negative, a JSON object with the wrong shape — is NOT a report, because * "corrupt" must never be turned into a verdict about someone's tests. */ export declare function parseCheckReport(raw: string): CheckReport | undefined; /** Injection seam for {@link armCheckReport} — the process bits it needs. */ export interface CheckReportEnv { readonly env: NodeJS.ProcessEnv; readonly onExit: (fn: () => void) => void; readonly write: (path: string, contents: string) => void; } /** * Arm the exit-time report, returning whether it armed (i.e. whether the runner * asked for a count). Pure except for the two effects it is handed. * * It DELETES the env var after reading it. A harness spawns child processes — * that is its whole job — and a child inheriting the path would write ITS count * over the parent's on exit, reporting a sub-process's activity as the file's. * Reading the variable once and dropping it makes that unrepresentable rather * than merely unlikely. */ export declare function armCheckReport(deps: CheckReportEnv): boolean; //# sourceMappingURL=check-count.d.ts.map