/** * Durable Mission Graph — graph construction, validation, hashing, * critical-path analysis and topological ordering (2.0.0). * * Pure, deterministic functions. No I/O. */ import type { CriticalPathResult, GraphValidationResult, MissionContract, MissionGraphDocumentV1, MissionObjective, MissionScope } from "./types.js"; /** * Compute the canonical semantic digest of a mission's scope, objectives and * contracts. Non-semantic fields (status, timestamps, observed repositories) * are excluded so that the digest is stable across execution bookkeeping. */ export declare function computeMissionGraphDigest(scope: MissionScope, objectives: MissionObjective[], contracts: MissionContract[]): string; export declare function objectiveIds(mission: Pick): Set; export interface DependencyIndex { /** For each objective, its direct dependencies. */ dependenciesBy: Map; /** For each objective, the objectives that depend on it (reverse edges). */ dependentsBy: Map; } export declare function buildDependencyIndex(objectives: MissionObjective[]): DependencyIndex; /** * Validate a mission graph document deterministically. * * Checks: unique ids, missing dependencies, dependency cycles, explicit * acceptance criteria, declared repositories, scope integrity, self-approval. */ export declare function validateMissionGraph(mission: MissionGraphDocumentV1): GraphValidationResult; /** * Detect all strongly-connected dependency cycles. * Returns one representative path per cycle. */ export declare function detectCycles(mission: Pick): string[][]; /** * Produce a deterministic topological order of objectives (dependency-first). * Returns only objectives whose declared dependencies exist and are acyclic. */ export declare function topologicallyOrdered(mission: Pick): string[]; /** * Longest dependency chain (by summed estimate). Deterministic tie-breaking * by objective id. Ignores missing/cyclic references; only considers * dependencies present in the graph. */ export declare function computeCriticalPath(mission: Pick): CriticalPathResult; /** * Build a fresh MissionGraphDocumentV1 from parts, computing digest and * enforcing the canonical schema version. */ export declare function buildMissionDocument(missionId: string, scope: MissionScope, objectives: MissionObjective[], contracts: MissionContract[], revision?: number, status?: MissionGraphDocumentV1["status"], nowMs?: number): MissionGraphDocumentV1; //# sourceMappingURL=graph.d.ts.map