From c4e2f52d00efaf731a1667ce699bb6d76d5460f9 Mon Sep 17 00:00:00 2001 From: Jon Langevin Date: Sun, 17 May 2026 06:23:56 -0400 Subject: [PATCH] test(iac): pin ComputePlanVersion=v2 regression-guard (Phase 2 cascade closeout) Adds TestAWSIaCServer_Capabilities_ComputePlanVersionV2 mirroring the existing gcp + DO equivalents. Pins the Phase 2 contract signal: a silent regression dropping the "v2" literal in Capabilities would degrade to v1 dispatch via wfctlhelpers.DispatchVersionFor's empty-default, breaking the Phase 2 hard-cutover contract per ADR 0024 + ADR 0040. Per workflow#640 + #695 Phase 2 + 2.5 cascade closeout. Co-Authored-By: Claude Opus 4.7 --- internal/iacserver_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/internal/iacserver_test.go b/internal/iacserver_test.go index 078c550..fb4be63 100644 --- a/internal/iacserver_test.go +++ b/internal/iacserver_test.go @@ -97,3 +97,21 @@ func TestIaCServer_DetectDriftWithSpecs_DelegatesToDetectDrift(t *testing.T) { t.Error("expected error from uninitialized provider") } } + +// TestAWSIaCServer_Capabilities_ComputePlanVersionV2 pins the Phase 2 +// contract signal: the plugin MUST declare ComputePlanVersion="v2" so +// wfctl routes via wfctlhelpers.ApplyPlanWithHooks (v2 dispatch). +// A silent regression that drops the literal would degrade to v1 +// dispatch via wfctlhelpers.DispatchVersionFor's empty-default, +// breaking the Phase 2 hard-cutover contract per ADR 0024 + ADR 0040. +// Per workflow#640 + #695 Phase 2 + 2.5 cascade closeout. +func TestAWSIaCServer_Capabilities_ComputePlanVersionV2(t *testing.T) { + s := NewIaCServer() + resp, err := s.Capabilities(context.Background(), &pb.CapabilitiesRequest{}) + if err != nil { + t.Fatalf("Capabilities: %v", err) + } + if got := resp.GetComputePlanVersion(); got != "v2" { + t.Errorf("CapabilitiesResponse.ComputePlanVersion = %q; want %q (v2 dispatch opt-in lost)", got, "v2") + } +}