/** * v2.15.0 follow-up — G14: smoke regression state service. * * Tracks the project's "critical paths" — the 5-10 paths the user * (or the QA agent) must verify in 5-10 minutes before shipping. * Persistence: `.peaks/smoke-paths.json` in the project root. * * The actual path execution (Playwright / curl / manual) is OUT OF * SCOPE for this slice — this ships the model + the run-result * record path. A follow-up slice wires real Playwright integration. */ export type CriticalPathSource = 'prd-business-scenario' | 'boss-stated' | 'historical-incident' | 'impact-must-check' | 'manual'; export type CriticalPathStatus = 'pending' | 'pass' | 'fail'; export interface CriticalPath { /** Unique id. */ readonly id: string; /** Human-readable name / description. */ readonly name: string; /** Where this path came from. */ readonly source: CriticalPathSource; /** When it was registered (ISO). */ readonly registeredAt: string; /** Optional category tag (e.g. "登录", "权限", "数据列表"). */ readonly category?: string; /** Latest status + when it was last run. */ readonly status: CriticalPathStatus; readonly lastRunAt?: string; readonly lastRunNote?: string; /** Optional run history (last 5 runs, oldest first). */ readonly history: readonly { readonly at: string; readonly status: CriticalPathStatus; readonly note?: string; }[]; } export interface SmokeState { readonly version: 1; readonly paths: readonly CriticalPath[]; } export declare const EMPTY_SMOKE_STATE: SmokeState; export declare function getSmokeStatePath(projectRoot: string): string; export declare function readSmokeState(projectRoot: string): SmokeState; export declare function writeSmokeState(projectRoot: string, state: SmokeState): void; /** Sources accepted by the CLI's --source flag. */ export declare const CRITICAL_PATH_SOURCES: readonly CriticalPathSource[]; export declare function isCriticalPathSource(value: string): value is CriticalPathSource; /** Generate a stable id from a name (lowercase, hyphens). */ export declare function makeCriticalPathId(name: string): string; /** Add a critical path. Deduplicates by id. */ export declare function addCriticalPath(state: SmokeState, path: CriticalPath): SmokeState; /** Add a run result to a path's history. Keeps the last 5. */ export declare function recordRun(state: SmokeState, id: string, status: CriticalPathStatus, note?: string, now?: Date): SmokeState; /** Convert peaks impact must-check items to critical paths. */ export declare function impactMustChecksToCriticalPaths(items: readonly { scenario: string; category: string; priority: string; }[], now?: Date): CriticalPath[]; /** Run summary for `peaks smoke run`. */ export interface SmokeRunResult { readonly totalPaths: number; readonly passedPaths: number; readonly failedPaths: number; readonly pendingPaths: number; readonly failedDetails: readonly { id: string; name: string; lastRunNote?: string; }[]; readonly durationMs: number; } /** Compute run summary from current state. */ export declare function summarizeState(state: SmokeState): SmokeRunResult;