/** * Release-plan guard for the hooks-v1 gate (T13555). * * Since T13557 a stable build runs project hooks only when the promotion * release stamps `cleo.releasedFeatures: ["hooks-v1"]`, which only a plan with * `--hooks-v1-promotion` does, and that plan must pass the pilot evidence * gate. The remaining way to ship hooks-v1 without the evidence is a SOURCE * edit that opens the gate: dropping `hooks-v1` from `UNRELEASED_HOOK_FEATURES`, * changing `hooksV1Released`, or deleting `release-gate.ts`. This module * detects such an edit between the previous release tag and HEAD; the plan then * requires `--hooks-v1-promotion` or an explicit, audited `--hooks-v1-waiver`. * * Reads git only; never edits `release-gate.ts` or the pilot digest script. * * @task T13555 */ /** The hooks-v1 release gate's source, relative to the repository root. */ export declare const HOOKS_V1_GATE_PATH = "packages/core/src/hooks/release-gate.ts"; /** Append-only audit of every hooks-v1 waiver a plan used. */ export declare const HOOKS_V1_WAIVER_AUDIT_FILE = ".cleo/audit/hooks-v1-waiver.jsonl"; /** What {@link parseHooksV1Gate} recognised in a gate source; `null` where the shape is unrecognised. */ export interface HooksV1GateShape { /** Whether `UNRELEASED_HOOK_FEATURES` still lists `hooks-v1`. */ readonly unreleased: boolean | null; /** The `hooksV1Released` declaration through its closing brace. */ readonly released: string | null; } /** * Recognise the two gate facts in a `release-gate.ts` source. * * @param source - The file's text. * @returns Each fact, or `null` for a shape the detector does not recognise. */ export declare function parseHooksV1Gate(source: string): HooksV1GateShape; /** * How the source between a release tag and HEAD opens the hooks-v1 gate. * Fails closed: a gate shape the detector cannot read counts as opening it. * * @param projectRoot - Repository root. * @param previousTag - The previous release tag. * @returns One line per gate-opening change; empty when the gate is untouched, * `previousTag` was the promotion (its committed plan sets `hooksV1Promotion`), * or `previousTag` already shipped `hooks-v1` released by source. */ export declare function hooksV1GateSourceChanges(projectRoot: string, previousTag: string): string[]; /** Options of {@link appendHooksV1Waiver}. */ export interface HooksV1WaiverRecordOptions { /** Repository root. */ readonly projectRoot: string; /** The planned version. */ readonly version: string; /** The previous release tag the changes were measured from. */ readonly previousTag: string; /** The operator's reason. */ readonly reason: string; /** The waived gate-opening changes. */ readonly changes: readonly string[]; } /** * Record a used waiver in {@link HOOKS_V1_WAIVER_AUDIT_FILE}. * * @param opts - What was waived, and why. * @remarks Throws on a write failure: a waiver that cannot be audited is refused. */ export declare function appendHooksV1Waiver(opts: HooksV1WaiverRecordOptions): void; //# sourceMappingURL=hooks-v1-promotion.d.ts.map