/** * `uxloom audit --live ` — audit tier 4: live DOM verification * (RFC 0004 R10, Lane F). Optional Playwright enhancement: when Playwright * is absent (or the browser cannot launch) the result says so honestly * with an install hint — the core stays zero-dependency. * * uxloom.map.json entries gain an optional `route`: * * { "Inbox": { "paths": ["app/inbox/**"], "route": "/inbox" } } * * loadMap() in audit.ts is JSON.parse and passes unknown keys through, so * existing map files stay valid and its return value assigns directly to * RouteMap — audit.ts itself is untouched. * * HONEST SEMANTICS — read before wiring verdicts on top of this: * - Live audit VERIFIES presence in a real DOM; it never judges screens * it cannot reach. A screen without a `route` is SKIPPED, not failed. * - `dom: "rendered"` — the marked element is in the DOM, visible, and * has non-zero size. Default-visible states earn this. * - `dom: "present"` — in the DOM but hidden or zero-sized. States that * are invisible by default (error.*, loading behind a fast response) * are EXPECTED to read "present"; that is not a failure. * - `dom: "absent"` — no marked element found in the initial DOM. * Conditional rendering can legitimately keep a state out of the DOM, * so "absent" means "not verified live", not "not implemented" — the * static tiers (markers) own that call. */ import type { Project } from "@uxloom/journeygraph"; /** Tier-1 registry entry extended with the optional live-audit route. */ export type RouteMap = Record; export type DomVerdict = "rendered" | "present" | "absent"; export interface LiveStateCheck { state: string; dom: DomVerdict; } export interface LiveScreenResult { screen: string; route?: string; /** A `[data-ux-screen=""]` element exists in the loaded page. */ screenFound: boolean; states: LiveStateCheck[]; /** Set when navigation failed; states are "absent" by fiat, not evidence. */ error?: string; } export interface LiveAuditResult { /** False when Playwright is missing or the browser failed to launch. */ available: boolean; /** Why the live tier is unavailable (only when available === false). */ reason?: string; /** Install hint (only when available === false). */ hint?: string; screens: LiveScreenResult[]; /** Screens with no `route` in the map — unjudged, by design. */ skipped: string[]; } /** * Audit tier 4: load each routable screen at `baseUrl + route` in headless * Chromium and verify the marker elements in the real DOM. * * `root` is unused here (parity with runAudit's signature — the live tier * needs no filesystem access). Never calls process.exit; degrades to * `{ available: false, reason, hint }` when Playwright is missing or the * browser cannot launch. */ export declare function runLiveAudit(project: Project, root: string, map: RouteMap, baseUrl: string): Promise; /** * Findings-style, printable lines for a live-audit result. Pure formatting * — no exit codes, no side effects; the caller decides what to do. */ export declare function summarizeLiveAudit(result: LiveAuditResult): string[];