import type { StepStatus, StepSource, DepthLevel, MethodologyName } from './enums.js'; /** Verification level for a step's completion claim (D3). Absent ≡ 'unverified'. */ export type VerificationLevel = 'verified' | 'declared' | 'unverified'; /** A single step's state entry in state.json. */ export interface StepStateEntry { status: StepStatus; source: StepSource; at?: string; completed_at?: string; in_progress_started_at?: string; produces?: string[]; verification?: VerificationLevel; completed_by?: string; reason?: string; depth?: DepthLevel; } /** * In-progress execution record. Non-null = either active or crashed. * See state-json-schema.md InProgressRecord. */ export interface InProgressRecord { step: string; started: string; partial_artifacts: string[]; actor: string; } /** * User-added custom step. Phase 2 — reserved as empty array in Phase 1. * See state-json-schema.md ExtraStepEntry. */ export interface ExtraStepEntry { slug: string; path: string; 'depends-on'?: string[]; phase?: string; } /** * Complete pipeline state file (.scaffold/state.json). * See state-json-schema.md. */ export interface PipelineState { 'schema-version': 1 | 2 | 3 | 4; 'scaffold-version': string; init_methodology: MethodologyName; config_methodology: MethodologyName; 'init-mode': 'greenfield' | 'brownfield' | 'v1-migration'; created: string; in_progress: InProgressRecord | null; steps: Record; next_eligible: string[]; /** * Monotonic counter bumped on every root-state saveState. Used by service * state files to detect when root has mutated since the service cached * next_eligible. Present only in root state (service state files never * carry a save_counter of their own). Absent on legacy files. */ save_counter?: number; /** * Pipeline-graph hash recorded when `next_eligible` was written. Absent on * legacy files → treated as "always stale" on read → triggers live recompute. */ next_eligible_hash?: string; /** * SERVICE state only: root state's save_counter at cache-write time. If this * no longer matches the current root save_counter, the service cache is * invalidated (root mutation invalidates service eligibility because service * steps depend on global step completion through the merged state view). */ next_eligible_root_counter?: number; 'extra-steps': ExtraStepEntry[]; } //# sourceMappingURL=state.d.ts.map