export type ResumeKind = 'fresh' | 'complete' | 'resume' | 'in-flight'; /** * Step at which the slice should resume. The values are stable strings * (not raw step numbers) so log output is greppable and a future * workflow reshuffle can keep the names but remap the steps. */ export type ResumePoint = 'rd-planning' | 'rd-review-fanout' | 'rd-perf-baseline' | 'qa-test-cases' | 'qa-execution' | 'qa-validation' | 'txt-handoff'; /** * Mid-implementation RD/QA states. The skill body treats these as * "ask the user to confirm the in-flight gate" — there is no safe * auto-resume for a slice the LLM is currently driving. */ export type InFlightState = 'spec-locked' | 'implemented' | 'running' | 'blocked'; export type ResumeClassification = { kind: ResumeKind; /** Set when `kind === 'resume'`; the step that should be re-entered. */ point: ResumePoint | null; /** Set when `kind === 'in-flight'`; the current non-terminal state. */ state: InFlightState | null; /** * Files that the SKILL.md spec says should already exist for the * current gate but were not found. Informational — the LLM uses this * to decide what to produce next. Includes legacy-missing files when * the legacy path was read. */ missingArtifacts: string[]; /** * Inconsistencies between state and file presence (e.g. RD is * `state: qa-handoff` but `rd/code-review.md` is absent). The * classifier still emits a `resume:` verdict, but the warning is the * audit trail. */ warnings: string[]; /** Number of RD/QA requests filtered as `user-requested-abandon`. */ abandonedRequestCount: number; /** * True when the canonical `.peaks/_runtime//` path was absent * and the classifier fell back to `.peaks/_runtime//`. Lets the SKILL.md * surface a one-time migration reminder to the user. */ usedLegacyPath: boolean; }; /** * Classify a session's resume state. Pure function — does not write * files, does not call any peaks CLI. * * @param sid The session id (e.g. `2026-06-06-session-22f08c`). * @param peaksRoot The canonical peaks runtime root, i.e. the * directory containing `/` subdirs. For the * v1.3.2 layout this is `/.peaks/_runtime`. * The legacy `/.peaks` layout is also accepted * for one minor release (see `usedLegacyPath`). */ export declare function classifyResume(sid: string, peaksRoot: string): ResumeClassification;