import { type PilotGateEvaluation, type PilotTaskRow } from './gate2-evaluator.js'; /** `fast-lane-norm.md` §2 numbers the risk surfaces 1..7; a value outside that is a typo, not a row. */ export declare const RISK_SURFACE_MAX = 7; /** * The file's own note, written by the writer so the artifact cannot be produced * without it. Two claims it must carry, per PRD §4 and §5.3: what the evidence * does NOT prove, and which of the two policy blocks is authoritative. */ export declare const PILOT_GATE_NOTE: string; export declare const LANE_CHOSEN_BY_VALUES: readonly ["user-named", "user-picked"]; export declare const OUTCOME_VALUES: readonly ["landed", "escalated", "stopped"]; export declare const HANDLING_VALUES: readonly ["refused", "escalated", "user-override-recorded", "none"]; export type PilotGateFile = { readonly policyVersion?: string | undefined; readonly tasks: readonly PilotTaskRow[]; }; export type ReadPilotGateResult = { readonly kind: 'ok'; readonly path: string; readonly gate: PilotGateFile; } | { readonly kind: 'missing'; readonly path: string; } | { readonly kind: 'invalid'; readonly path: string; readonly message: string; }; export type PilotTaskInput = { readonly rid: string; readonly sessionId: string; readonly date: string; readonly laneChosenBy: string; readonly outcome: string; readonly filesChanged: readonly string[]; readonly riskSurfacesHit: readonly number[]; readonly riskSurfaceHandling: string; readonly rolledBack: boolean; readonly ciRed: boolean; readonly missedRiskSurface: boolean; }; export declare function pilotGatePath(projectRoot: string): string; export declare function readPilotGate(projectRoot: string): ReadPilotGateResult; /** * Validate one row, fail-closed, each refusal naming the rule it broke. Nothing * is written when this returns `invalid`. */ export declare function buildPilotTaskRow(input: PilotTaskInput): { readonly kind: 'ok'; readonly row: PilotTaskRow; } | { readonly kind: 'invalid'; readonly message: string; }; /** * Idempotent upsert of one row, keyed by `--rid`: a repeated rid replaces that * row in place (first-seen order preserved), a new rid is appended. The writer is * also the only thing that can refresh `lastEvaluation` — the reader owns no file * — which is what keeps the committed evaluation from going stale. * * Throws when the existing file cannot be read: clobbering unreadable evidence * with a fresh one-row file would silently destroy rows. */ export declare function upsertPilotTask(projectRoot: string, row: PilotTaskRow, now?: Date): { readonly path: string; readonly evaluation: PilotGateEvaluation; };