import type { TDepSpec } from "./types.js"; import type { TStageOutcomeRecord } from "./single-stage.js"; export { optional, depId, isOptionalDep } from "./types.js"; export type { TDepSpec, TOptionalDep } from "./types.js"; /** A serializable stage descriptor — all an eligibility check needs. */ export type TStageDescriptor = { id: string; dependsOn: readonly TDepSpec[]; }; type TRecordMap = Readonly>; /** * A stage is eligible to run once every required dep is `completed` and every * optional dep has reached some terminal outcome. */ export declare function isStageEligible(stage: TStageDescriptor, records: TRecordMap): boolean; /** * A stage is skip-eligible when a REQUIRED dep reached a non-`completed` * terminal outcome (skipped / failed) — the dependent then skips rather than * failing. */ export declare function hasRequiredFailureUpstream(stage: TStageDescriptor, records: TRecordMap): boolean; /** A scheduling step: stages to launch now + stages to mark skipped now. */ export type TDagProgress = { /** Stages eligible to run now (deps satisfied, not yet terminal). */ runnable: TStage[]; /** * Stages whose required dep failed (skip-eligible, not yet terminal). * Marking each `skipped` lets its optional-dependent downstream stages * then reach eligibility (eager skip propagation). */ skippable: TStage[]; }; /** * From the full descriptor list + the committed terminal-outcome map, partition * the not-yet-terminal stages into the ones to launch now (`runnable`) and the * ones to mark skipped now (`skippable`). An already-terminal stage appears in * neither. Skip-eligibility takes precedence over runnability (the two sets are * disjoint). Generic over the descriptor subtype so a caller carrying extra * serializable fields gets them back on the partitioned stages. */ export declare function computeDagProgress(stages: readonly TStage[], records: TRecordMap): TDagProgress; //# sourceMappingURL=scheduling.d.ts.map