import type { DetectCheckResult } from '../state/completion.js'; import type { AdoptionResult } from './adopt.js'; import { type OpsActionRecord } from './adoption-ops-actions.js'; import type { MethodologyName, ScaffoldError } from '../types/index.js'; export type AdoptionDisposition = 'done-verified' | 'conflict' | 'run' | 'skip-proposed' | 'undetectable' | 'map-candidate'; export type ApplyAction = 'mark-completed' | 'reopen-pending' | 'record-pending' | 'none'; export interface StepPlanRecord { step_slug: string; disposition: AdoptionDisposition; apply_action: ApplyAction; audit_event: 'verification-reversal' | 'partial-artifacts' | null; detect_checks: DetectCheckResult[]; outputs_present: string[]; outputs_missing: string[]; /** Proposed artifact_map target (D10). Present iff disposition === 'map-candidate'. */ target?: string; /** Resolved assembly mode (§6.1). Present iff disposition === 'run'. */ mode?: 'fresh' | 'update' | 'adoption'; } export interface InitializeRecord { /** The EXACT config.yml payload apply will write (D2) — never more. */ config: { version: 2; methodology: MethodologyName; platforms: string[]; project: Record | null; }; /** The initial state summary: init-mode + per-step statuses (D2). */ state: { 'init-mode': 'greenfield' | 'brownfield' | 'v1-migration'; methodology: MethodologyName; steps: Record; }; } export interface AdoptionPlan { generated_at: string; project_root: string; mode: 'greenfield' | 'brownfield' | 'v1-migration'; methodology: MethodologyName; includes: string[]; initialize: InitializeRecord | null; steps: StepPlanRecord[]; disabled_by_preset: string[]; /** R2 §6.1 ops-actions preview — joins plan_key (D1: no apply-relevant ops * detail can change without changing the key). */ ops_actions: OpsActionRecord[]; plan_key: string; } /** JSON with recursively sorted object keys — the canonical form under plan_key. */ export declare function canonicalJson(value: unknown): string; /** * plan_key (D1): sha256 hex over the canonical JSON of the COMPLETE apply-action * records — initialize record, sorted includes, per-step records sorted by slug, * sorted disabled-by-preset slugs, and (R2 §6.1) the ops-actions preview records. * generated_at / project_root / markdown prose never participate. */ export declare function computePlanKey(input: { initialize: InitializeRecord | null; includes: string[]; steps: StepPlanRecord[]; disabled_by_preset: string[]; /** Optional for R1-era callers — omitted keys the same as an empty preview. */ ops_actions?: OpsActionRecord[]; }): string; export declare function buildAdoptionPlan(options: { projectRoot: string; adoptResult: AdoptionResult; includes?: string[]; }): { plan: AdoptionPlan; errors: ScaffoldError[]; }; export declare function renderPlanMarkdown(plan: AdoptionPlan): string; /** Pull the approved plan_key out of a written plan document (markdown or JSON). */ export declare function extractPlanKey(content: string): string | null; //# sourceMappingURL=adoption-plan.d.ts.map