/** * Merge-Weave State Machine Types * * @experimental These types are NOT part of the Lex 1.0.0 public contract. * They define internal execution state for merge-weave operations. * The semantics and structure may change without notice. * * Orchestration strategies (merge pyramids, weave ordering, gate sequencing) * are implementation details of consuming tools, not part of the Lex substrate. * * @internal */ /** * States in the merge-weave execution flow * @experimental */ export type WeaveState = "INIT" | "PLAN_LOCKED" | "BATCHING" | "MERGING" | "GATES" | "COMPLETED" | "FAILED"; /** * Events that trigger state transitions * @experimental */ export type WeaveEvent = "START" | "BATCH_READY" | "MERGE_SUCCESS" | "GATE_PASS" | "ERROR"; /** * Progress tracking for merge-weave execution * @experimental */ export interface WeaveProgress { /** List of completed PR/batch identifiers */ completed: string[]; /** Currently processing PR/batch identifier (null if none) */ current: string | null; /** List of remaining PR/batch identifiers to process */ remaining: string[]; } /** * Lock file structure for merge-weave execution state * * This lock file enables resumability by capturing the current state * and progress of a merge-weave run. The planHash ensures that the * plan hasn't changed since the run started. * * @experimental */ export interface WeaveLock { /** Unique identifier for this merge-weave run */ runId: string; /** Hash of plan.json + PR heads to verify plan integrity */ planHash: string; /** Current state in the execution flow */ state: WeaveState; /** ISO 8601 timestamp of the last state transition */ lastTransition: string; /** Progress tracking for the current run */ progress: WeaveProgress; }