import type { SemanticOrigin } from '../model/source-provenance.js'; export interface ConflictInput { /** Workspace session the browser believes it is writing against. */ commandSessionId: string; currentSessionId: string; /** Hash the browser last saw for this file. */ expectedSourceHash: string; /** Hash on disk right now. Empty when the file is gone. */ currentSourceHash: string; /** Provenance origin of the file being written. */ origin: SemanticOrigin; /** False when the reloaded file no longer parses or the snapshot cannot rebuild. */ dependencyClosureComputable: boolean; /** * True when this source has produced repeated unmatched external writes * while a transaction was pending, so independence cannot be established. */ repeatedUnmatchedWrites?: boolean; /** True when the change adds or removes a reusable import/binding. */ altersReusableGraph?: boolean; } export type ConflictDecision = { outcome: 'accept'; } | { outcome: 'scoped-reject'; reason: string; } | { outcome: 'lockout'; reason: string; escalation: LockoutCause; }; export type LockoutCause = 'reusable-source-changed' | 'reusable-graph-altered' | 'dependency-closure-uncomputable' | 'independence-unprovable' | 'workspace-session-changed'; /** * Classify a write against the current disk state. * * Order matters: the escalating conditions are checked before the scoped one, * because a stale hash on ontology source is a session event, not a file event. * A caller that checked the hash first would scope-reject a change that * invalidates the whole frozen environment. */ export declare function classifyConflict(input: ConflictInput): ConflictDecision; /** True when a decision must stop every further mutation in the session. */ export declare function isSessionFatal(decision: ConflictDecision): boolean; //# sourceMappingURL=conflict-policy.d.ts.map