import { SpecIndexEntry } from '../types.js'; /** * Why there is (or is not) a spec to work on next. Callers must branch on this * rather than on `spec` being absent — the three "no spec" states mean very * different things and only one of them means the roadmap is finished. */ export type RoutingState = /** `spec` names the spec to work on. */ 'active' /** Nothing declares an order over the remaining specs. Stop and ask. */ | 'ambiguous' /** Every spec *on disk* is Complete. decomposition.md may still name unstarted specs. */ | 'all-on-disk-complete' /** Specs exist but every one is deferred. Nothing is finished. */ | 'all-deferred' /** No specs exist yet. */ | 'no-specs'; export interface RoutingDecision { state: RoutingState; /** The spec to work on, or null for every state except 'active'. */ spec: string | null; /** Human-readable justification, rendered into INDEX.md so a choice can be audited. */ reason: string; /** Specs considered but not chosen. Populated for 'ambiguous'. */ candidates: string[]; /** Data problems that make the decision less trustworthy. */ warnings: string[]; } /** * Decide which spec to work on next, from the same buckets INDEX.md renders. * * Two buckets, two different rules, on purpose: * * - `active` is a human-declared *dependency* sequence (order of first mention in * decomposition.md). Progress must never override it — spec N+1 may depend on N. * - `other` has no declared order at all. Creation time is filesystem birthtime, which * is not stored in git and is restamped by any fresh clone or worktree, so it encodes * nothing. The only real signal is whether someone has started the spec. Where that * does not single one out, this returns 'ambiguous' rather than inventing an order. * * Deliberately takes the categorized buckets rather than the `inDecomposition` flag: * when decomposition.md is absent the generator puts every spec in `active`, and * keying off the flag instead would rank them by a rule the rendered table does not use. */ export declare function deriveRouting(buckets: { active: SpecIndexEntry[]; deferred: SpecIndexEntry[]; other: SpecIndexEntry[]; }): RoutingDecision; //# sourceMappingURL=spec-routing-deriver.d.ts.map