/** * Governance persistence module — standalone I/O for `.hivemind/state/governance-state.json`. * * Provides atomic read/write operations for the governance state file. * This is a synchronous module using `writeFileSync` + `renameSync` for atomicity. * Governance state is cross-cutting (not per-session) and stored independently * from the continuity store. * * REF: REQ-P41B-03 * * @module governance/persistence */ import type { GovernancePersistenceState } from "../../shared/types.js"; /** * Resolves the absolute path to the governance state JSON file. * * @param projectRoot - Optional project root directory. Defaults to `process.cwd()`. * @returns Absolute path to `.hivemind/state/governance-state.json`. */ export declare function getGovernanceStatePath(projectRoot?: string): string; /** * Returns an empty governance state with default values. * * @returns A fresh `GovernancePersistenceState` with no rules or violations. */ export declare function emptyGovernanceState(): GovernancePersistenceState; /** * Reads and parses the governance state file from disk. * * If the file does not exist or cannot be parsed, returns an empty state * (graceful degradation — never throws for missing/unparseable files). * * @param projectRoot - Optional project root directory. * @returns The parsed governance state, or an empty state on failure. */ export declare function readGovernanceState(projectRoot?: string): GovernancePersistenceState; /** * Atomically writes the governance state to disk. * * Uses a write-to-temp-file-then-rename pattern to prevent corrupt reads * if the process crashes mid-write. Creates the state directory if it * does not already exist. * * @param state - The governance state to persist. * @param projectRoot - Optional project root directory. */ export declare function writeGovernanceState(state: GovernancePersistenceState, projectRoot?: string): void; //# sourceMappingURL=persistence.d.ts.map