/** * Peelability scoring for the carve-out advisor (#214 T3). * * The model, verbatim from #197: * * score = 100 * - 12 * inbound # survivors that depend on this → each a TF data-source patch * - 4 * outbound # this depends on survivors → a deferred deploy-time input * - 4 * outputs # an output block reads this → a one-line rewrite (#1638) * - 15 * (tier - 1) # native-spec map: tier1=0, tier2=-15, tier3=-30 * - 10 * has_dynamic # count / for_each / data present * - 3 * (instances - 1) # state-expanded instance count * clamp 0..100 (unsupported provider/type → 0) * * An `output` block referencing the target is a real inbound dependency — the * surviving plan errors on the dangling reference — so it cannot score as * free. It is not a data-source patch either: bridging it rewrites one * expression in a block that manages no infrastructure, the same order of work * as recording an outbound deferred input. Hence 4, not 12. * * Sub-resources that inline into a parent (see `FOLDS_INTO`) are folded into the * parent's carve set: they are removed from the ranking and their edge to the * parent is not counted as inbound — inlining them is free, not boundary work. */ import type { TfGraph } from "./types.js"; export type PeelabilityBand = "clean leaf" | "carvable w/ edits" | "leave in Terraform"; export interface PeelabilityBreakdown { /** Inbound edges from resource/module blocks — a data-source patch each. */ inbound: number; outbound: number; /** Inbound edges from `output` blocks — a one-line rewrite each (#1638). */ outputs: number; tier: 1 | 2 | 3 | null; hasDynamic: boolean; instances: number; /** Signed penalty contributions, for report transparency. */ penalties: { inbound: number; outbound: number; outputs: number; tier: number; dynamic: number; instances: number; }; } export interface Peelability { address: string; kind: "resource" | "module"; score: number; band: PeelabilityBand; /** Native spec type a carve would target; undefined for modules/unsupported. */ mapsTo?: string; breakdown: PeelabilityBreakdown; } export declare function bandFor(score: number): PeelabilityBand; /** * Score every carvable node in the estate, ranked most-peelable first. Folded * sub-resources are omitted (they carve with their parent, not on their own). */ export declare function scoreEstate(graph: TfGraph): Peelability[]; //# sourceMappingURL=score.d.ts.map