import { SCOPE_COMPLETION_KIND, SCOPE_COMPLETION_SCHEMA_VERSION } from './lifecycle-state'; import type { SprintFile } from '../types'; import { type RemediationPlan } from '../remediation/plan'; export { SCOPE_COMPLETION_KIND, SCOPE_COMPLETION_SCHEMA_VERSION }; export interface ScopeCompletionRequest { scope: string; summary: string | null; acceptOpenDebt?: boolean; reconcileDebt?: boolean; reason?: string | null; expectDigest?: string | null; } export type ScopeCompletionState = 'fresh' | 'resumable' | 'already-applied'; export interface ScopeCompletionPreparation { request: ScopeCompletionRequest; normalizedSummary: string | null; requestDigest: string; currentStatus: string; affectedFiles: string[]; validations: string[]; state: ScopeCompletionState; planDigest: string; reconciliation: RemediationPlan | null; acceptedDebt: SprintFile['debt']; } export interface ScopeCompletionApplyResult { requestDigest: string; resumed: boolean; wrote: 'both' | 'sprint-only' | 'registry-only' | 'none'; } /** * Preconditions for a *fresh* completion (no active sprint, no open/in-progress debt, no pending * review, no blocking findings, no artifact divergence). Injected rather than imported directly so * this module — which owns the locked transaction — does not depend on `commands/artifact-doctor`, * preserving the existing one-directional `commands/` → `checkpoints/` layering. */ export type ScopeCompletionHealthCheck = (scope: string, options?: { sprint?: SprintFile; acceptOpenDebt?: boolean; historicalOnly?: boolean; }) => void; /** * Unlocked, best-effort, fresh-read preview. Never authoritative — `applyScopeCompletion` re-derives * everything from scratch under the lock. Digest-aware so a legitimate resume ("this is our own * request, already partially applied") is reported as resumable rather than rejected as a conflict. */ export declare function buildScopeCompletionPreparation(request: ScopeCompletionRequest, assertHealthy: ScopeCompletionHealthCheck): ScopeCompletionPreparation; /** The sole write authority for scope completion. Locked, re-validated, idempotent, recoverable. */ export declare function applyScopeCompletion(request: ScopeCompletionRequest, assertHealthy: ScopeCompletionHealthCheck): ScopeCompletionApplyResult; //# sourceMappingURL=scope-completion.d.ts.map