Expand description
Plan lifecycle management for PostgresPolicyPlan resources.
Handles creating, deduplicating, approving, executing, and cleaning up reconciliation plans. Plans represent computed SQL change sets that may require explicit approval before execution against a database.
Enums§
- Plan
Approval State - Result of checking a plan’s approval annotations.
- Plan
Creation Result - Result of plan creation — distinguishes genuinely new plans from deduplication hits so callers can decide whether to emit events.
Functions§
- check_
plan_ approval - Check the approval state of a plan by inspecting its annotations.
- cleanup_
old_ plans - Clean up old plans for a policy, retaining at most
max_plansterminal plans. - cleanup_
old_ plans_ best_ effort - Best-effort cleanup wrapper used on hot reconciliation paths. Cleanup should reduce leaked resources, never block otherwise valid reconciliation.
- create_
or_ update_ plan - Create or deduplicate a
PostgresPolicyPlanfor the given policy and changes. - execute_
plan - Execute an approved plan against the database.
- get_
current_ actionable_ plan - Look up the current actionable plan for a policy, if any.
- get_
plan_ by_ phase - Look up the most recent plan for a policy in a given phase.
- mark_
plan_ approved - Mark a plan as Approved.
- mark_
plan_ failed - Mark a plan as Failed with a given error message.
- mark_
plan_ rejected - Mark a plan as Rejected.
- mark_
plan_ superseded - Mark a plan as Superseded (database state changed since approval).
- update_
policy_ plan_ ref - Update the parent policy’s
current_plan_refin status.