/**
 * Orphan tenant-dir garbage collection.
 *
 * Env deletion is non-atomic: the read-model row is removed, then the gitops
 * tenant dir. If the git push fails (contention/rebase conflict) the error was
 * historically swallowed → the env doc is gone but the tenant dir lingers, so
 * ArgoCD keeps deploying an unmanaged studio forever (a resource leak that
 * pinned the cluster during the 2026-07 incident). This module is the
 * self-healing safety net: periodically remove tenant dirs THIS processor owns
 * that no longer have a backing env doc.
 */
/**
 * First line stamped into every values file `generateValuesYaml` produces. The
 * GC only ever removes dirs carrying this marker, so hand-written / infra / app
 * tenants (academy, warm-eel, …) — which never have it — are structurally
 * impossible to delete.
 */
export declare const MANAGED_MARKER = "# managed-by: vetra-cloud-environment";
/** True if `yaml` was generated by this processor (safe to GC). */
export declare function isManagedValues(yaml: string): boolean;
export interface OrphanPlan {
    /** Managed tenant dirs whose env doc is gone → remove from gitops. */
    toRemove: string[];
    /** True if the plan was aborted by the safety circuit-breaker. */
    skippedForSafety: boolean;
}
/**
 * Decide which managed tenant dirs are orphans.
 *
 * @param managedDirs  tenant dir names (== tenantId) that carry {@link MANAGED_MARKER}.
 *                     The caller MUST pass only marker-managed dirs; infra/app
 *                     tenants are filtered out before this point.
 * @param liveTenantIds tenantIds that still have an env doc (read-model).
 * @param opts.maxDeleteFraction circuit-breaker: if more than this fraction of
 *   managed dirs would be removed, abort and remove nothing. Guards against a
 *   failed/empty live-set query nuking the whole fleet. Default 0.5.
 */
export declare function computeOrphanTenantDirs(managedDirs: string[], liveTenantIds: Set<string>, opts?: {
    maxDeleteFraction?: number;
}): OrphanPlan;
//# sourceMappingURL=gc.d.ts.map