Skip to content

feat(gitops): distinguish accidental removal from intentional retirement and automatically reclaim owned data #5627

Open

Description

@devantler

Outcome

The agent-operated GitOps platform safely distinguishes an accidental removal of application manifests from an intentionally requested retirement. Intentional retirement automatically removes the application, its exclusively owned data and associated resources when safe, with no maintainer PR review, manual Kubernetes/cloud API calls, or routine cleanup chores. Accidental edits or speculative merge-queue deployments must never irreversibly destroy data.

Maintainer direction (2026-10-31)

  • The maintainer states the need (e.g., "retire application X"). Agents are the engineering owners: validate downstream dependencies, shared resources, operational consequences and data ownership; choose the method. They must flag a material risk via a maintainer ask, or reject/explain an unsafe task, rather than blindly executing instructions.
  • A disappearing Kustomize entry, namespace, HelmRelease or PVC is not sufficient proof of authorization to delete permanent data.
  • A deliberate, reviewable, declarative retirement intent in committed Git state may authorize automatic cleanup. Merge-queue candidates are not committed intent; they must not destroy production state. Agent-managed PR checks and merge gates remain; no human PR approval is a requirement.
  • No arbitrary mandatory 24-hour wait. Agents should select the simplest safe retirement mechanism, with retention/cooling-off only when the risk model justifies it. Successful safe retirements should not need a manual trigger.
  • App owners/controllers manage their data lifecycle; infrastructure reclamation must not infer that retained application data can be dropped simply because storage is underutilized. Retired applications' resources must not be mistaken for unrelated shared resources, backup sets or bootstrap dependencies.
  • Clean up or explicitly retain and account for orphaned PVs, Longhorn volumes, Hetzner volumes, secrets, DNS, backing stores and backups as ownership and retention rules permit. Nothing quietly leaks costs.

Existing context; integrate, do not duplicate

Acceptance criteria

  • A declarative, testable, auditable distinction between accidental manifest disappearance and explicit agent-authorized permanent retirement.
  • After a safe committed retirement, the app and only its exclusively owned data/resources are automatically reclaimed; cloud/storage deletion is verified. No manual API calls or routine human approval required.
  • A broken Kustomize change, an evicted/failed merge-group candidate, a mistaken tenant removal and a retried/partially failed cleanup do not cause irreversible data loss.
  • The tool refuses/reports unsafe cleanup (dependent services, shared datasets, unknown owner, critical backups, unproven data retention) and raises a bounded maintainer ask only for genuinely unresolved business risk; agents may abandon an unsafe retirement with explanation.
  • Existing retained PVs are recoverable where required; cleanup and retained-data handling coexist with Retain and do not reintroduce blanket prune opt-outs.
  • Clean replay/idempotency after workflow/controller restarts, GitOps drift, partial failure and rollback; tests cover deletion proof, ownership boundaries and dependency graph.
  • Show retirement intent, safeguards, outcome, intentionally retained resources and continuing storage costs in Git/observability, without leaking secrets.
  • Verify an intentional retirement and a mistaken-removal scenario end-to-end in a safe fixture before production; update operational documentation.
  • Close or link existing overlapping work only after evidence; do not assert the feature is delivered merely because retention was implemented.

Deliver an outcome, not a mandated custom controller. Agents own the technical solution and may challenge maintainer assumptions with evidence.

Activity

  1. coderabbitai commented on Oct 31, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #5423 - fix(vault): retire Crossview's credentials and the one-off retirement [merged]
    #5430 - fix(retirement): sample each layer until it settles before judging it [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. added theissue type on Oct 31, 2026
  3. moved this to 📥 Backlog in 🌊 Project Boardon Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Epic.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions