Skip to content

Composed runs (Terraform lexicon): a plan shape from show -json on every terraform-apply plan #4436

Closed

Description

@lex00

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 per resource_changes item that is not no-op or read, logicalId the address (with #<deposed> for a deposed object), type the resource type, replacement from change.replace_paths or a delete-create action pair, properties the top-level attribute names that differ between before and after, unknown the ones after_unknown marks.
  • terraform-apply's plan sets shape on the CapabilityPlan it returns, for the plain path and for the choudoufu live-plan-set path.
  • 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), terraformPlanShape gives the expected shape, checked in a table test.
  • An update with a replace_paths entry has replacement: "true"; an update whose replaced path depends on an unknown value has replacement: "conditional".
  • planShapeDigest of the shape of the same plan JSON is equal across two runs.
  • terraform-apply's plan returns shape, and pr-loop.tofu.test.ts shows a round whose fresh plan adds a resource is not covered, with the reason naming the address.
  • A hole member (a root whose vars read an unknown output) still returns no shape, so it stays uncovered, as covered-round.ts requires.
  • 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

  1. added
    enhancement
    area:terraform
    orchestration
    terragucci-lift
    wave:0
    on Oct 25, 2026
  2. lex00 commented on Oct 25, 2026

    @lex00
    ContributorAuthor

    Landed on integration/4419-composed-runs at aa98bcb.
    terraformPlanShape(planJson, member, { unknownInputs?, knownInputs? }) is exported from the terraform lexicon, and terraform-apply's plan sets shape on the plain and choudoufu live-plan-set paths (a hole member still has none). Tests written, not run.

  3. lex00 commented on Oct 25, 2026

    @lex00
    ContributorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:terraformenhancementorchestrationterragucci-liftwave:0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions