export type SafePath = string & {
    readonly __brand: 'SafePath';
};
export type ErrorSeverity = 'critical' | 'warning' | 'info';
export type SafetyErrorCode = 'WRITE_FAILED' | 'LOCK_TIMEOUT' | 'LOCK_HELD' | 'CIRCUIT_OPEN' | 'PATH_VIOLATION' | 'VALIDATION_FAILED' | 'ROLLBACK_TRIGGERED' | 'BACKUP_FAILED' | 'HEALTH_DEGRADED';
export interface SafetyError {
    code: SafetyErrorCode;
    severity: ErrorSeverity;
    message: string;
    recovery: string;
    timestamp: string;
}
/**
 * Renamed from LockHandle to FileMutexLockHandle in SPEC-719 to avoid conflict
 * with the cross-process LockHandle in spec-lock-v2.ts.
 */
export interface FileMutexLockHandle {
    resource: string;
    lockPath: string;
    pid: number;
    acquiredAt: string;
}
export interface LockFileContent {
    pid: number;
    timestamp: string;
    resource: string;
}
export type CircuitState = 'closed' | 'open' | 'half-open';
export interface SafetyCircuitConfig {
    maxFailures: number;
    resetTimeoutMs: number;
    halfOpenMax: number;
}
export interface WriteOptions {
    backupCount?: number;
    verify?: boolean;
}
export interface AtomicWriteOptions {
    /** Encoding for string content. Default 'utf-8'. */
    encoding?: BufferEncoding;
    /** When true (default on POSIX, false on Windows), fsync the parent directory after rename. */
    fsyncParent?: boolean;
    /** Mode bits for the final file. Default 0o644. */
    mode?: number;
    /** Override tmp file name suffix; default `.tmp.<pid>.<nonce>` where nonce is randomBytes(4).hex */
    tmpSuffix?: string;
    /**
     * SPEC-747: Break-glass override for writing a frozen (done/discarded) spec.
     * Requires reason >= 30 chars. Bypasses freeze check and records a retro_audit entry.
     */
    forceEdit?: {
        reason: string;
        projectId?: string;
    };
    /**
     * SPEC-747: Set to true to skip the freeze check (used internally by bump-version flow).
     * Do NOT set from external callers — use forceEdit for break-glass.
     */
    _skipFreezeCheck?: boolean;
}
export interface TransactionStep {
    name: string;
    doFn: () => Promise<void>;
    undoFn: () => Promise<void>;
}
export interface RollbackEvent {
    transactionId: string;
    failedStep: string;
    stepsRolledBack: string[];
    error: string;
    timestamp: string;
}
export interface HealthCheck {
    name: string;
    status: 'pass' | 'warn' | 'fail';
    message: string;
    value?: number | string;
}
export interface HealthReport {
    status: 'healthy' | 'degraded' | 'unhealthy';
    checks: HealthCheck[];
    timestamp: string;
}
export interface TrashCleanupConfig {
    maxAgeDays: number;
    maxSizeMB: number;
}
export interface TrashCleanupResult {
    purgedCount: number;
    freedBytes: number;
    remainingCount: number;
}
//# sourceMappingURL=safety.d.ts.map