import { z } from 'zod'; export declare const FREEZE_FILE = "freeze.json"; /** * The ONE freeze id the verify-manifest gate consults (#2137, strategy#584 * sub-task 4). Exported so consumers import the constant instead of * duplicating the literal. */ export declare const RULE_COMPILATION_FREEZE_ID = "rule-compilation"; /** * Distribution class of a freeze entry (strategy#584): `local` = this repo's * own parked work (the pre-scope implicit behavior); `cohort` = a freeze on a * cohort-orphaned subsystem that applies to every consumer repo and rides the * `@mmnto/strategy-doctrine` snapshot channel. */ export declare const FreezeScopeSchema: z.ZodEnum<["local", "cohort"]>; export type FreezeScope = z.infer; declare const FreezeEntrySchema: z.ZodObject<{ subsystem: z.ZodString; id: z.ZodOptional; scope: z.ZodDefault>; since: z.ZodOptional; reason: z.ZodOptional; tracking: z.ZodOptional; 'do-not': z.ZodOptional>; }, "strip", z.ZodTypeAny, { scope: "cohort" | "local"; subsystem: string; reason?: string | undefined; id?: string | undefined; since?: string | undefined; tracking?: string | undefined; 'do-not'?: string[] | undefined; }, { subsystem: string; scope?: "cohort" | "local" | undefined; reason?: string | undefined; id?: string | undefined; since?: string | undefined; tracking?: string | undefined; 'do-not'?: string[] | undefined; }>; declare const FreezeConfigSchema: z.ZodObject<{ _note: z.ZodOptional; frozen: z.ZodArray; scope: z.ZodDefault>; since: z.ZodOptional; reason: z.ZodOptional; tracking: z.ZodOptional; 'do-not': z.ZodOptional>; }, "strip", z.ZodTypeAny, { scope: "cohort" | "local"; subsystem: string; reason?: string | undefined; id?: string | undefined; since?: string | undefined; tracking?: string | undefined; 'do-not'?: string[] | undefined; }, { subsystem: string; scope?: "cohort" | "local" | undefined; reason?: string | undefined; id?: string | undefined; since?: string | undefined; tracking?: string | undefined; 'do-not'?: string[] | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { frozen: { scope: "cohort" | "local"; subsystem: string; reason?: string | undefined; id?: string | undefined; since?: string | undefined; tracking?: string | undefined; 'do-not'?: string[] | undefined; }[]; _note?: string | undefined; }, { frozen: { subsystem: string; scope?: "cohort" | "local" | undefined; reason?: string | undefined; id?: string | undefined; since?: string | undefined; tracking?: string | undefined; 'do-not'?: string[] | undefined; }[]; _note?: string | undefined; }>; export type FreezeEntry = z.infer; export type FreezeConfig = z.infer; /** * Read `/freeze.json`, the WS1 freeze primitive. * * - **Absent file → `null`.** Absence means "nothing is frozen" — the only * allow-on-absence in the gate layer, and semantically correct. * - **Present but unparseable/invalid → THROWS `TotemConfigError` (fail-closed).** * A corrupt freeze file must never silently bypass itself (Tenet 4). * * This deliberately diverges from the graceful (warn-and-continue) ledger reader: * a gate's deterministic input failing to parse is a hard error, not a shrug. */ export declare function readFreezeConfig(totemDir: string): FreezeConfig | null; /** * Channel status for the distributed read. The two absent states are * deliberately distinct (Tenet 14): "channel not adopted" (`absent-package`) * is not "channel adopted, snapshot predates freeze distribution" * (`absent-file`). */ export type CohortFreezeStatus = 'ok' | 'absent-package' | 'absent-file' | 'corrupt'; export interface CohortFreezeResult { status: CohortFreezeStatus; /** Cohort-scoped entries ONLY — the read-time leak filter. The snapshot is * a byte-copy of the publisher's whole freeze file (P292 §10.2 bind), so * publisher-local parked work rides along and must never surface here. */ entries: FreezeEntry[]; /** Installed snapshot package version, when the package resolved. */ packageVersion?: string; /** Renderable warnings. Core never console-logs channel states; every * surface (human, structured, gate) renders these deliberately. */ warnings: string[]; } /** * Read cohort-scoped freezes from an installed doctrine-snapshot package * (strategy#584 fix (b): cohort freezes ride the established distribution * channel, not per-repo manual copies). * * Failure contract — deliberately diverges from `readFreezeConfig`'s * fail-closed: this reader NEVER throws and never touches the network or * writes to disk. Corruption/invalidity degrades to `status: 'corrupt'` with * zero visible entries — the conservative direction for every consumer (a * freeze-consulting gate stays blocking; renderers show the warning). The * package name is caller-injected so core stays cohort-agnostic. */ export declare function readCohortFreezes(cwd: string, packageName: string): CohortFreezeResult; export type LocalFreezeStatus = 'ok' | 'absent'; export interface ActiveFreeze { entry: FreezeEntry; provenance: 'local' | 'cohort'; /** Snapshot package version (cohort provenance only). */ sourceVersion?: string; } export interface EffectiveFreezeResult { entries: ActiveFreeze[]; localStatus: LocalFreezeStatus; cohortStatus: CohortFreezeStatus; cohortPackageVersion?: string; warnings: string[]; } /** * Union of repo-local + distributed cohort freezes with per-source status * that SURVIVES into every consumer — absent-package / absent-file / corrupt / * genuinely-none must never flatten into "none" at a rendering surface. * * No dedup, no demotion: a subsystem frozen both locally and cohort-wide * yields two entries with distinct provenance. The LOCAL read keeps its * fail-closed contract — a corrupt local freeze file still THROWS. * * @param cwd - Repo root; anchors the upward `node_modules` walk for the * cohort read. * @param totemDir - Absolute path to the `.totem` directory (NOT the repo * root) — passed straight to `readFreezeConfig`'s path join. * @param packageName - Doctrine snapshot package to resolve (caller-injected; * core stays cohort-agnostic). */ export declare function readEffectiveFreezes(cwd: string, totemDir: string, packageName: string): EffectiveFreezeResult; export {}; //# sourceMappingURL=freeze.d.ts.map