/** * The carve state manifest (#998) — what makes emit → bridge → apply compose. * * `carve emit` persists the boundary report and adoption selector next to the * emitted source as `.carve.json`. The later steps read it back from * their output dir, so `carve bridge` and `carve apply` no longer need the * target re-specified by hand, and each step records what it did for the next. * Plain JSON on disk — reviewable, diffable, nothing proprietary. */ import type { CarveReport } from "./carve.js"; import type { OwnershipMarker } from "../ownership.js"; export declare const CARVE_MANIFEST_SUFFIX = ".carve.json"; export interface CarveManifest { version: 1; /** Terraform address of the carved resource, e.g. `aws_s3_bucket.assets`. */ target: string; /** Terraform resource type, when known. */ tfType?: string; /** Absolute path of the Terraform estate the carve came from. */ from: string; /** Absolute path of the tfstate used for adoption (offline path). */ statePath?: string; /** Boundary classification persisted when the manifest was written. */ boundary: CarveReport; /** Recorded by `carve emit`. */ emit?: { source: "tfstate" | "live"; /** Emitted chant source file path(s). */ files: string[]; /** * Deferred outbound inputs declared as build parameters in the emitted * project (#998), keyed by parameter name. */ params?: Record; at: string; }; /** Recorded by `carve bridge`. */ bridge?: { written: string[]; appliedInPlace: boolean; /** The git-applyable `.patch` carrying the whole survivor edit. */ patch?: string; /** Carved addresses whose own `.tf` block the rewrites remove (#998). */ excised?: string[]; at: string; }; /** Recorded by `carve apply`. */ apply?: { marker: OwnershipMarker; ownershipTags: Record; /** Emitted files the marker was stamped into (`--write-source`). */ stampedFiles?: string[]; at: string; }; } /** Filesystem-safe slug for a Terraform address (shared file-naming convention). */ export declare function carveSlug(target: string): string; /** Where the manifest for `target` lives inside an output dir. */ export declare function carveManifestPath(outDir: string, target: string): string; /** Write (or overwrite) a manifest into the output dir. Returns the path. */ export declare function writeCarveManifest(outDir: string, manifest: CarveManifest): string; /** Read a manifest, or null when absent/unreadable/not a v1 manifest. */ export declare function readCarveManifest(path: string): CarveManifest | null; /** All carve manifest paths in an output dir. */ export declare function listCarveManifests(outDir: string): string[]; export interface ResolvedManifest { manifest?: CarveManifest; path?: string; error?: string; } /** * Resolve the manifest a later carve step composes with. With a selected * target, that target's manifest (absent is fine — the step just runs * standalone). Without one, the single manifest in the output dir; none or * several is an error naming what is (or is not) there. */ export declare function resolveCarveManifest(outDir: string, select?: string): ResolvedManifest; /** Read-modify-write a section of an existing manifest. No-op when absent. */ export declare function updateCarveManifest(outDir: string, target: string, patch: Partial>): string | undefined; //# sourceMappingURL=manifest.d.ts.map