Skip to content

Phase 2.4: engine-side auto-compensation (deferred until real driver needs it) #704

@intel352

Description

@intel352

Tracker for Phase 2.4 deferred candidates from workflow#695 Phase 2.5+ design. Currently no active driver requires this.

Scope (when revived)

  1. Engine auto-compensation — when wfctl-side hook fails post-driver-success, engine attempts inverse RPC (Delete on created, Create on deleted). Records ActionStatusCompensated or ActionStatusCompensationFailed. Requires per-driver Compensable capability declaration; partial-state error handling; coordinated cascade.

  2. Per-plugin emission of COMPENSATED — plugin v_next opt-in; plugin author decides emission semantics (e.g., DO deferred-flush could emit COMPENSATED on partial-flush success).

  3. Per-resource-type compensation policy — per-Driver capability declaration.

Affordances already in place (workflow v0.57.1)

  • interfaces.ActionStatusCompensated enum value reserved (interfaces/iac_state.go:168) — engine does NOT emit; plugins may emit if they implement own compensation
  • interfaces.ActionStatusCompensationFailed enum value reserved — semantically defined for post-driver-success hook failure
  • IaCProviderFinalizer.FinalizeApply (Phase 2.5) provides per-driver post-loop hook point that future compensation logic would extend

Why deferred

No driver currently emits COMPENSATED. Per memory project_open_followup_queue.md: "Deferred until a real driver needs it." Implementing speculatively risks design lock-in to a wrong abstraction. Wait for a concrete consumer (likely DO Spaces key rotation, or App Platform replace-with-rollback) to drive the requirements.

References

  • ADR 0040 (v2 action lifecycle + provider compatibility) — invariant 2 (engine populates one ActionOutcome per PlanAction)
  • workflow#695 Phase 2.5 (FinalizeApply) — established post-loop hook surface this would build on
  • workflow#698 Phase 2.3 (ActionStatus enums) — established the COMPENSATED/COMPENSATION_FAILED values

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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