Skip to content

IaCProvider interface segregation — split Apply off into LegacyApplier #699

@intel352

Description

@intel352

Followup from Phase 2.5+ Cleanup Bundle adversarial-design-review cycle-1 (Critical finding C-5).

Context

Phase 3 deletion of DOProvider.Apply (DO PR #124, v1.4.0) replaced the v1 wrapper body with a sentinel-error stub (ErrApplyV1Removed). This preserved the interfaces.IaCProvider contract per ADR 0024 but kept Apply as a runtime-only failure surface.

Adversarial-design-review reviewer flagged this as preserving 'the exact runtime-failure surface ADR 0024 mandates eliminating' (ADR 0024 mandates compile-time safety: 'a missing required method on the plugin side fails the plugin's go build').

Scope

Interface refactor: split Apply off IaCProvider into a deprecated LegacyApplier interface that v2-only plugins don't implement. Eliminates the runtime-failure stub entirely + makes 'v2 cutover' compile-time enforceable per ADR 0024.

Affects all 4 IaC plugins (aws/gcp/azure/DO) simultaneously — coordinated 5-repo cascade like Phase 2.

Why deferred from Phase 2.5+ Cleanup Bundle

Bundle scope was mechanical cleanup. Introducing an interface refactor mid-bundle violates scope discipline. DO is the first plugin to need this; the right refactor pattern emerges from observing aws/gcp/azure's wrappers (do they ALSO have post-loop hooks like deferred-flush? Phase 1 inventory said no, but worth re-verifying).

Approach

Full superpowers pipeline. Brainstorm should consider:

  • Does IaCProvider continue requiring Apply for v1 plugins, with a separate v2-only sub-interface for the engine to type-assert?
  • Or completely remove Apply from IaCProvider + introduce LegacyApplier opt-in?
  • Or version the IaCProvider interface itself (IaCProviderV1 + IaCProviderV2)?

References

  • workflow#695 (Phase 2.5 cascade)
  • DO PR feat: wire multi-workflow mode into main server #124 (v1.4.0 Phase 3 cleanup — sentinel stub approach)
  • Phase 2.5+ Cleanup Bundle design (in feat/phase2.5-cleanup-design branch) §Item 2 architectural note
  • decisions/0024-iac-typed-force-cutover.md (compile-time-safety mandate this issue aims to fully satisfy)
  • decisions/0040-v2-action-lifecycle-provider-compatibility.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions