/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */ /** * Scheduler (see CHANGELOG 0.38.0), pure capacity-matching helpers, no side * effects. The hard departure from WrfcController's pairwise * engineer<->reviewer binding (startReview / the startPlannedFix planned * workstream): each tick, for every phase in ordinal order, free capacity * slots (capacity minus in-flight) are filled from whichever waiting items * are queued for that phase, an item advances the instant ITS gate passes, * claimed by whatever slot happens to be free, never bound to a specific * sibling item. */ import type { Phase, WorkItem, Workstream } from './types.js'; /** True when `dep` RELEASES its dependents under the workstream's release policy. */ export declare function dependencySatisfied(workstream: Workstream, dep: WorkItem): boolean; export declare function sortedPhases(workstream: Workstream): Phase[]; export declare function firstPhase(workstream: Workstream): Phase | undefined; /** * The next phase in ORDINARY forward progression. Deliberately skips * 'fix'-kind phases: a dynamically-inserted fix phase sits at an ordinal * after its review (see engine.ts findOrInsertFixPhase) but is reachable * ONLY via the explicit review-failure re-route, never as "what comes next" * for an item whose review already passed, otherwise a later item that * never needed fixing would wrongly detour through it. */ export declare function nextPhaseAfter(workstream: Workstream, ordinal: number): Phase | undefined; export declare function phaseById(workstream: Workstream, phaseId: string): Phase | undefined; /** The nearest preceding review-kind phase, the return target after a dynamically-inserted fix phase's gate passes. Purely structural (survives serialization with zero extra bookkeeping). */ export declare function reviewPhaseBefore(workstream: Workstream, phase: Phase): Phase | undefined; export interface PhaseClaim { readonly item: WorkItem; readonly phase: Phase; } /** * Whether an item's inter-item dependencies (BIG-3 item 2) are all satisfied, * and, when not, WHY, split into dependencies still in flight vs. ones that * have terminally failed. Pure (no side effects): the engine's per-tick * dependency pre-pass (applyDependencyGates, engine.ts) calls this and applies * the state/blockedReason transition. Missing dependency ids (no item in the * workstream matches) are ignored here, assembly (fromPlanProposal) already * asserts referential integrity, so a dangling id at runtime is treated as * "not blocking" rather than an eternal block. */ export interface DependencyStatus { /** True when every dependency has reached 'passed' (or there are none). */ readonly ready: boolean; /** Titles of dependencies still pending/in flight (neither passed nor failed). */ readonly waiting: string[]; /** Titles of dependencies that have terminally FAILED, a recoverable block, not a terminal one for the dependent. */ readonly failed: string[]; } export declare function dependencyStatus(workstream: Workstream, item: WorkItem): DependencyStatus; /** * Which (item, phase) pairs have free capacity to claim RIGHT NOW. Pure, * no side effects, no budget check (the caller applies budget.checkBudget * before actually claiming, since budget is a *decision*, not a capacity * fact this function should own). * * 'blocked-budget' items are deliberately included in the waiting set, not * just 'pending'/'awaiting-capacity': a budget block is a recoverable * decision (see BudgetCeiling/WorkItemState docs, types.ts), never a * capacity fact, so a previously-blocked item must be reconsidered on every * tick the instant a slot is free, the caller's budget.checkBudget call * re-decides it fresh each time, honestly re-blocking it if the ceiling * still refuses. */ export declare function computeClaims(workstream: Workstream): PhaseClaim[]; //# sourceMappingURL=scheduler.d.ts.map