/** * Lab-note vault writer — serializes parsed lab markers to YAML-frontmatter markdown notes. * * Status classification is deterministic JS: value vs reference range (ADR-3 spirit). * * PURE file I/O + deterministic helpers only. * NO network. NO LLM. NO Date.now(). All timestamps are injected parameters. * * bober: hand-rolled YAML-frontmatter subset (flat scalars only, no arrays/nested objects). * Mirror of src/vault/frontmatter.ts approach — never import that module. * Swap for a vetted YAML library if quoted strings or nested objects are required. */ import type { ParsedLabMarker } from "./lab-types.js"; /** Deterministic lab status — derived in pure JS, never by an LLM (ADR-3 spirit). */ export type LabStatus = "low" | "normal" | "high" | "critical"; /** Report-level metadata supplied alongside a ParsedLabMarker at write time. */ export interface LabNoteMeta { panel: string; /** ISO 8601 collection timestamp — INJECTED, never Date.now(). */ collectedAtIso: string; source: string; } /** * Structured contents of a lab note's YAML frontmatter. * All 10 keys are always present; ref_low / ref_high are undefined when absent. */ export interface LabNoteFrontmatter { marker: string; value: number; unit: string; ref_low: number | undefined; ref_high: number | undefined; /** Human-readable range string, e.g. "70-100", or "" when bounds are absent. */ ref_range: string; /** ISO 8601 collection date (stored verbatim from collectedAtIso). */ date: string; status: LabStatus; panel: string; source: string; } /** * Produce a URL-safe slug from an arbitrary string. * Precedent: src/incident/timeline.ts:117. */ export declare function slugify(s: string): string; /** * Derive a deterministic lab status from value vs reference range. * Pure sync — no LLM, no network, no Date.now() (ADR-3 spirit). * * Priority: critical flag wins; else compare to bounds; missing bounds → "normal". */ export declare function deriveLabStatus(value: number, refLow?: number, refHigh?: number, critical?: boolean): LabStatus; /** * Parse the YAML frontmatter from a raw lab-note markdown string. * Numeric fields (value, ref_low, ref_high) are coerced from their string representation. * ref_low / ref_high are undefined when the value is absent or empty. * * Throws if the opening or closing `---` fence is missing. * * Mirror of src/vault/frontmatter.ts:53-135 — DO NOT import that module. */ export declare function parseLabNote(raw: string): LabNoteFrontmatter; /** * Write one parsed lab marker to a YAML-frontmatter markdown note. * * Note path: `/labs//-.md` * The date segment is the YYYY-MM-DD portion of collectedAtIso (colons stripped). * * Parent directories are created automatically. Returns the absolute path written. */ export declare function writeLabNote(vaultDir: string, marker: ParsedLabMarker, meta: LabNoteMeta): Promise; //# sourceMappingURL=lab-note.d.ts.map