/** * `chant carve advise` — the read-only Terraform peelability advisor (#214). * * Points at a Terraform estate and reports which resources/modules are cheap to * carve into native chant later and which should stay in Terraform. It emits * nothing, patches nothing, and touches no live resource — pure analysis. The * emit/boundary/apply phases stay in #197, gated on demand. */ import { type Peelability } from "../../terraform/score.js"; import { type BoundaryEdge } from "../../terraform/carve.js"; import type { TfGraph } from "../../terraform/types.js"; export interface CarveAdviseOptions { /** Terraform estate directory (from `--from`). */ from?: string; /** Opt-in `.tfstate` path (from `--state`): accurate fan-out instance counts. */ statePath?: string; /** Write the full JSON report to this path (from `--report `). */ reportFile?: string; } export interface CarveAdviseResult { ok: boolean; error?: string; from?: string; results?: Peelability[]; /** * The parsed dependency graph the scores came from. Kept so the JSON report * can carry the boundary edge lists (#1636) rather than only their counts. * Not part of the JSON payload — `carveJson` derives from it. */ graph?: TfGraph; } export declare function carveAdvise(opts: CarveAdviseOptions): Promise; /** * The schema version of the `--json` / `--report` payload (#1636). * * The report is a cross-tool contract — behold renders it as a graph — so it * says which shape it is. The promise attached to this number: * * - **Additive within a version.** New top-level fields, new per-resource * fields, new kinds of entry in an existing list, and new values in an * open-ended enum (a `bridge` kind, say) may appear in any release. A * reader must ignore keys and values it does not know. * - **A removal, a rename, or a changed meaning bumps it.** So does narrowing * a field's type (an optional becoming required is additive; the reverse is * not). * - A reader that does not know the version it is handed should refuse the * report rather than half-read it. */ export declare const CARVE_REPORT_VERSION = 1; /** One ranked resource in the JSON report: its score, plus the boundary its carve would cut. */ export interface CarveJsonResource extends Peelability { /** * Every dependency edge carving this resource would cut (#1636), in chant's * own `BoundaryEdge` shape — the same classification the emit/bridge path * runs on. `inbound` edges need a Terraform `data`-source patch the moment * the carve lands; `outbound` edges become deploy-time inputs, deferred * until apply. * * The lists are the *carve set's* boundary, so a folded sub-resource never * appears as an endpoint: it carves with its parent, and the parent's edges * stand in for it. Edges internal to the carve set are not boundary work and * are not listed. * * An inbound edge's survivor can be an `output.` pseudo-address * (#1638), carrying `bridge: "tf-output-rewrite"` and `via: ["value"]`. It * is counted in `breakdown.outputs`, not `breakdown.inbound`. * * Present (possibly with two empty lists) whenever the graph was available; * absent means this chant did not compute it — "none" and "not reported" are * different claims. `breakdown.inbound`/`outbound` keep the counts. */ boundary?: { inbound: BoundaryEdge[]; outbound: BoundaryEdge[]; }; } /** The `chant carve advise --json` / `--report` payload. Versioned; see {@link CARVE_REPORT_VERSION}. */ export interface CarveJsonReport { version: number; from?: string; advisory: string; count: number; /** Band name -> how many resources landed in it. */ bands: Record; resources: CarveJsonResource[]; } /** Build the `--json` / `--report` payload. */ export declare function carveJson(result: CarveAdviseResult): CarveJsonReport; /** Human-readable banded, ranked summary. */ export declare function formatCarveReport(result: CarveAdviseResult): string; //# sourceMappingURL=carve.d.ts.map