/** * Slice complexity tier (v2.15.0 follow-up, G2 in 12 Gaps). * Used by Solo to schedule complex slices during user-attended hours * and trivial / simple slices overnight. */ export type SliceComplexity = 'trivial' | 'simple' | 'complex'; export declare const SLICE_COMPLEXITIES: readonly SliceComplexity[]; export declare function isSliceComplexity(value: string): value is SliceComplexity; export interface SliceNode { readonly id: string; readonly role: string; /** Human-readable label, optional. */ readonly label?: string; /** Optional prompt override; dispatch falls back to a default placeholder. */ readonly prompt?: string; /** * v2.15.0 follow-up — G12: foundation slice. Foundation slices run before * business slices in the layered DAG. Business slices do NOT wait for * ALL foundation slices — they wait only for the foundation subset * they declare as `dependsOn`. Optional; default false. */ readonly foundation?: boolean; /** * v2.15.0 follow-up — G11: upstream sync slice. Marks a slice that * syncs an upstream fork (e.g. hermes) to a new tag. UpstreamSync * slices take priority within their topological level. Optional. */ readonly upstreamSync?: boolean; /** * v2.15.0 follow-up — G2: complexity tier. Drives Solo's scheduling * (complex = user-attended, simple/trivial = overnight). Optional. */ readonly complexity?: SliceComplexity; } export interface DependsOn { readonly from: string; readonly to: string; } export interface SliceDag { readonly nodes: readonly SliceNode[]; readonly edges: readonly DependsOn[]; } /** Thrown by `validateDag` when the graph violates one of the constraints. */ export declare class InvalidSliceDagError extends Error { readonly path?: readonly string[] | undefined; readonly code: "INVALID_SLICE_DAG"; constructor(message: string, path?: readonly string[] | undefined); } /** Thrown by `topologicalLevels` when the graph has a cycle (defensive). */ export declare class SliceDagCycleError extends Error { readonly cyclePath: readonly string[]; readonly code: "SLICE_DAG_CYCLE"; constructor(cyclePath: readonly string[]); } /** * Validate a SliceDag. Throws `InvalidSliceDagError` on the first violation. * Pure. Cheap. No I/O. */ export declare function validateDag(dag: SliceDag): void; /** * Compute topological levels. Each level is an array of node IDs that can * run in parallel. Throws `SliceDagCycleError` on cycle (defensive; * `validateDag` should have caught it). * * Algorithm: Kahn's algorithm. O(V + E). */ export declare function topologicalLevels(dag: SliceDag): readonly (readonly string[])[]; /** * Return the next set of node IDs that are ready to run given the set of * completed node IDs. A node is ready when all of its `from` predecessors * are in `completed`. */ export declare function sliceReadyToRun(dag: SliceDag, completed: ReadonlySet): readonly string[]; /** * Serialize the DAG into a deterministic JSON string. Node IDs are sorted; * edges are sorted by `(from, to)`. The result is suitable for SHA-256 * hashing and for byte-stable diffs. */ export declare function serializeDag(dag: SliceDag): string; /** SHA-256 hash of the serialized DAG. Stable across runs. */ export declare function hashDag(dag: SliceDag): string;