/** * v2.15.0 follow-up — G15: release / hotfix state machine. * * Tracks a release through the canary → promote → watch → done * pipeline. The actual deployment (k8s rollout, load balancer config, * monitoring integration) is OUT OF SCOPE for this slice — this * ships the state machine + dry-run hooks for the operator. * * Persistence: `.peaks/release-state.json` in the project root. */ export type ReleaseStage = 'planned' | 'canary-10' | 'canary-50' | 'promoted' | 'watching' | 'done' | 'rolled-back'; export declare function isValidStageTransition(from: ReleaseStage, to: ReleaseStage): boolean; export declare function isReleaseStage(value: string): value is ReleaseStage; export interface ReleaseRecord { readonly version: string; readonly currentStage: ReleaseStage; readonly stageHistory: readonly { readonly stage: ReleaseStage; readonly at: string; readonly note?: string; }[]; readonly createdAt: string; readonly promotedAt?: string; readonly doneAt?: string; } export interface ReleaseState { readonly version: 1; /** Active release (the one being canary'd / watched). */ readonly active: ReleaseRecord | null; /** History of completed / rolled-back releases. */ readonly history: readonly ReleaseRecord[]; } export declare const EMPTY_RELEASE_STATE: ReleaseState; export declare function getReleaseStatePath(projectRoot: string): string; export declare function readReleaseState(projectRoot: string): ReleaseState; export declare function writeReleaseState(projectRoot: string, state: ReleaseState): void; /** Plan a new release. If there is an active release, fails. */ export declare function planRelease(state: ReleaseState, version: string, now?: Date): { state: ReleaseState; record: ReleaseRecord; } | { error: string; }; /** Transition the active release to a new stage. */ export declare function transitionRelease(state: ReleaseState, to: ReleaseStage, note?: string, now?: Date): { state: ReleaseState; } | { error: string; }; /** Roll back the active release and move it to history. */ export declare function rollbackRelease(state: ReleaseState, note?: string, now?: Date): { state: ReleaseState; record: ReleaseRecord; } | { error: string; }; /** Hotfix: create a new active release on a hotfix version. */ export declare function hotfixRelease(state: ReleaseState, hotfixVersion: string, note?: string, now?: Date): { state: ReleaseState; record: ReleaseRecord; } | { error: string; }; /** Compute the watch window. */ export declare function watchWindow(record: ReleaseRecord, now?: Date): { elapsedMs: number; remainingMs: number; windowMs: number; percentComplete: number; };