Skip to content

feat(ladder): phase 3 - pipeline (schema, scheduled task, approval/auto modes, UI, terraform) #70

Description

@cristim

Part of LeanerCloud/cloud-commitments-go#27 (commitment laddering automation). Phase 3 of 4: persistence, scheduled task, approval/auto modes, UI, Terraform. All flag-gated default-off.

PRs:

  1. Migrations 000078-000080 + stores: ladder_configs (per cloud_account x provider), ladder_runs (immutable audit: inputs snapshot, plan jsonb with rationales, run-level approval token, status CAS), ladder_tranches; purchase_executions.ladder_run_id + ri_exchange_history.ladder_run_id link columns; global_config.laddering_enabled kill-switch; PurchaseSourceLadder = "cudly-ladder"; store methods in internal/config/store_postgres_ladder.go.
  2. Scheduled task, plan-only: ladder_run task type + dispatch in internal/server/handler.go; handler_ladder.go with cadence self-gate (daily <20h / weekly <6d20h slack); persists planned runs + tranches, applies guardrails; no execution or email yet (safe dry-run milestone).
  3. Email-approval mode: pending purchase_executions + pending reshapes linked to the run; run-level token fan-out approve/cancel endpoints (3-mode auth dispatch, fail-closed); SendLadderRunSummary (SES targeted only, ErrTokenInBroadcast guard); frontend/src/ladder-deeplink.ts.
  4. Auto-approve mode: status=scheduled purchases with fire_at = now + PurchaseDelayHours riding the existing FireScheduledDelayedPurchases sweep (minimally extended for ladder-linked reshapes); pre-notification + SendLadderRunCompleted confirmation.
  5. Settings UI + config API: per-account laddering config editor in settings.ts + /api/ladder/configs CRUD.
  6. Run history/detail UI + Terraform: /api/ladder/runs list/detail (tokens stripped), run detail view with planned-vs-executed actions and rationales; EventBridge rule/target/permission behind enable_ladder_run_schedule (default false), vars threaded through environments/profiles.

No activity

Activity on this issue will appear here.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions