/** * Obligation ledger construction utilities with cycle detection. * * INV-shared-core-07: ObligationEntry.depends_on must be cycle-checked at * construction time — not deferred to scheduling. This module provides * `buildObligationLedger()` which validates the DAG and throws immediately * if a dependency cycle is present. */ import type { ObligationEntry, ObligationLedger } from "./contractPipeline.js"; /** * Detect cycles in an obligation dependency graph using DFS with three-color * marking (white/gray/black). Returns the IDs of obligations forming the first * cycle detected, or null when the graph is acyclic. * * INV-shared-core-07: called at construction time so a cycle is caught early * rather than causing an infinite loop or confusing error at scheduling time. */ export declare function detectObligationCycle(obligations: readonly ObligationEntry[]): string[] | null; export interface BuildObligationLedgerOptions { goal_id: string; obligations: ObligationEntry[]; created_at?: string; } /** * Build a validated ObligationLedger. * * Validates the dependency graph for cycles at construction time and throws * a descriptive error if any cycle is detected. This enforces * INV-shared-core-07: callers cannot produce a ledger with a cyclic * depends_on graph — the error is immediate, not deferred to scheduling. * * @throws {Error} when a depends_on cycle is detected among the obligations. */ export declare function buildObligationLedger(options: BuildObligationLedgerOptions): ObligationLedger; //# sourceMappingURL=obligationLedger.d.ts.map