Repository navigation
Description
Part of #4419. Wave 0, size S.
Context
coveredRound (packages/core/src/components/covered-round.ts) compares a lexicon's PlanShape of the first plan with the shape of a later one. The AWS lexicon supplies one (CapabilityPlan.shape, #4423). terraform-apply (lexicons/terraform/src/components/capability-plugin.ts) supplies none, so core falls back to shapeFromChangeSet, which carries the address and action only: no replacement flag, no type, no properties, no unknown-driven properties. A Terraform round, resume or wave-gate check is therefore coarser than an AWS one.
terragucci needs the same conversion. The 2026-10-24 comment on #4419 says terragucci would "turn the note's plan JSON into a PlanShape per root (resource address and action from resource_changes, replacement from a replace action, unknownInputs from the report's reads[].unknown)". That belongs in the lexicon so terragucci calls it (INTENTIUS/terragucci#1268) instead of writing its own.
Change
- Add
terraformPlanShape(planJson, member, { unknownInputs?, knownInputs? })to the lexicon: one entry perresource_changesitem that is notno-oporread,logicalIdthe address (with#<deposed>for a deposed object),typethe resource type,replacementfromchange.replace_pathsor a delete-create action pair,propertiesthe top-level attribute names that differ betweenbeforeandafter,unknownthe onesafter_unknownmarks. terraform-apply'splansetsshapeon theCapabilityPlanit returns, for the plain path and for the choudoufulive-plan-setpath.- Export it from the lexicon's package so terragucci can import it.
Acceptance criteria
- For the fixtures in
lexicons/terraform/src/__fixtures__/change-set/(terraform, tofu, choudoufu),terraformPlanShapegives the expected shape, checked in a table test. - An update with a
replace_pathsentry hasreplacement: "true"; an update whose replaced path depends on an unknown value hasreplacement: "conditional". -
planShapeDigestof the shape of the same plan JSON is equal across two runs. -
terraform-apply'splanreturnsshape, andpr-loop.tofu.test.tsshows a round whose fresh plan adds a resource is not covered, with the reason naming the address. - A hole member (a root whose
varsread an unknown output) still returns no shape, so it stays uncovered, ascovered-round.tsrequires. - If Lexicon contract: the lexicon supplies a PlanShape, core compares; conformance helper #4425's conformance test exists when this lands, the Terraform shape passes it.
Depends on / blocks
Depends on nothing. Blocks #4447 (the group sets a shape per member) and INTENTIUS/terragucci#1268.
Out of scope
Previewing a Terraform hole member with stand-in variables, as AWS does (open question in index.md). The composed run itself.
Activity
feat(terraform): a plan shape from show -json on every terraform-appl…
lex00 commentedon Oct 25, 2026
Landed on integration/4419-composed-runs at aa98bcb.
terraformPlanShape(planJson, member, { unknownInputs?, knownInputs? })is exported from the terraform lexicon, andterraform-apply'splansetsshapeon the plain and choudoufulive-plan-setpaths (a hole member still has none). Tests written, not run.lex00 commentedon Oct 25, 2026
Landed on integration/4419-composed-runs and merged to main in 9f099d4 (PR #4471), after the end-of-epic test pass (unit, docs-check, e2e on tofu, choudoufu and CloudFormation) and green CI.