Repository navigation
feat(carve): read-only Terraform peelability advisor (#214) - #993
Merged
Merged
Conversation
`chant carve advise --from <tf-dir>` ranks which Terraform resources/modules are cheap to carve into native chant and which should stay. Read-only: emits nothing, patches nothing, touches no live resource. - terraform/: pure hcl2json-tree -> dependency graph (inbound/outbound edges), peelability scoring (the #197 model), and a curated TF-type -> native tier map with S3-family sub-resource folding. - @cdktf/hcl2json is NOT a core dependency (dev-only here); it is lazy-loaded and, if absent, the command fails with an install hint. - carve advise command: banded human report + --json + --report <path>. PR 1 of 3 (T1/T3/T4). .tfstate read (T2) and docs/skill (T5) follow.
`--state <tfstate>` overlays state-expanded instance counts onto the graph, so a count/for_each fan-out is scored with its real instance count (the -3*(instances-1) penalty) instead of assuming 1. JSON-only, no HCL/wasm. Root-module managed resources only; data sources and module-nested resources are skipped (the .tf graph models a module as one node). Pure-.tf path is unchanged when --state is omitted. PR 2 of 3.
…214 T5) - docs/cli/carve.mdx: synopsis, scoring model, bands, a real banded example run against the bundled sample estate, and the on-demand parser install. - __fixtures__/sample-estate: a runnable mixed estate (clean leaves, boundary work, load-bearing, unsupported) + an e2e test pinning the doc's scores. - tier map: add the common network leaves (subnet, security_group, route_table, internet_gateway) surfaced by the fixture. - drop references to a formal "carve skill": core has no skills loader, so the advisor points at the one-line install instead. PR 3 of 3.
This was referenced Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #214 — the read-only Terraform carve-out advisor, the committed/day-one slice of the strangler-fig design (#197).
chant carve advise --from <tf-dir>ranks which Terraform resources are cheap to carve into native chant and which should stay. Read-only: emits nothing, patches nothing, touches no live resource.Why now
Both #214 and #197 were refreshed against the current repo (see the ticket comments): the substrate they assumed as future machinery has largely shipped (live import,
graph --live+ edge reconstruction,diff --live --json, orphan classification, tier metadata), so the advisor is a smaller build than the ticket estimated. Thecarve advisesurface is its own command (not folded into the single-filemigrateseam), per that refresh.What's here (maps to the ticket's T1–T5)
terraform/: pure hcl2json-tree → dependency graph with inbound/outbound edge classification._versioningisn't counted as boundary work.chant carve advise: banded human report +--json+--report <path>.--state <tfstate>overlays state-expanded instance counts for accuratecount/for_eachfan-out scoring.sample-estatefixture with an e2e test pinning the doc's scores.Notes / deviations
@cdktf/hcl2json(HashiCorp's own parser, wasm) is not a chant dependency — dev-only here, lazy-loaded, with a one-line install hint if absent. Only carve-out users pay for it.Verification
tsc --noEmitclean, eslint clean.--json).Closes #214.