/** * Freeze deliveries (studio brainstorm idea 15, the SRE stop-the-line) — ONE switch that holds * every deliver gate: * * GET /deliveries/freeze {frozen, since, by, reason} * PUT /deliveries/freeze {frozen, reason?} → the same shape; audited * * While frozen, THE gate decision path (`decideGate` in routes.ts, which standing orders share) * refuses an APPROVE of a gate that would run a deliver unit (409 `deliveries_frozen`), and the * post-hoc `POST /runs/:id/deliver` refuses too. The gate stays open: unfreezing lets the same * approve through. A reject still cancels (it pushes nothing), and no other gate is held. * * Not held: a run launched with `deliverGate: "auto"` has no gate to hold — the engine pushes it * without asking the daemon. The switch stops every push a person or an order would approve. * * The durable record is the AUDIT TRAIL (`deliveries.frozen {reason?}` / `deliveries.unfrozen`), * folded once at boot like the standing orders' away flag, so a restart keeps the freeze. No file * under the state home (core's worker fence refuses unregistered top-level entries there). */ import type { FastifyInstance } from 'fastify'; import { z } from 'zod'; import type { AuditLog } from './audit.js'; import type { Actor } from '../core/types.js'; export declare const DELIVERY_FREEZE_ACTIONS: readonly ["deliveries.frozen", "deliveries.unfrozen"]; export declare const PutDeliveryFreezeSchema: z.ZodObject<{ frozen: z.ZodBoolean; reason: z.ZodOptional; }, "strict", z.ZodTypeAny, { frozen: boolean; reason?: string | undefined; }, { frozen: boolean; reason?: string | undefined; }>; export interface DeliveryFreezeState { frozen: boolean; /** ISO time the freeze was turned on; null while thawed. */ since: string | null; /** The actor id that turned it on; null while thawed. */ by: string | null; reason: string | null; } /** Whether a unit is a run's deliver step: by phase, by phase id in its unit id, or by catalog id. */ export declare function isDeliverUnit(u: { id: string; phase_ref?: string | null; catalog?: string; }): boolean; /** The refusal a held approve answers with. */ export declare function frozenRefusal(s: DeliveryFreezeState): { error: string; code: 'deliveries_frozen'; }; export declare class DeliveryFreeze { private s; state(): DeliveryFreezeState; /** Set the switch; records one audit line when it changes. Returns whether it changed. */ set(frozen: boolean, actor: Actor, audit: Pick, reason?: string): boolean; /** Fold the trail once at boot. A trail that cannot be read leaves the switch off, loudly. */ hydrate(trail: Pick, log?: (msg: string) => void): Promise; } export declare function registerDeliveryFreezeRoutes(app: FastifyInstance, deps: { freeze: DeliveryFreeze; audit: Pick; }): void; //# sourceMappingURL=delivery-freeze.d.ts.map