From 3b172f8ed283703f2440f019e024f7069bd1b1bf Mon Sep 17 00:00:00 2001 From: Archipelago Date: Tue, 17 Nov 2026 10:06:14 +0000 Subject: [PATCH] Clarify ref expiry in the collection contract --- src/gc.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gc.rs b/src/gc.rs index 4b53e11..67fa967 100644 --- a/src/gc.rs +++ b/src/gc.rs @@ -97,7 +97,7 @@ pub(crate) fn preconditions(deployments: &[Deployment]) -> Result<(), String> { } /// Create missing keep refs for the complete protected commit graph. Existing -/// refs are never removed here; their retirement must use readiness-bound policy. +/// refs are not removed here; `apply` expires stale ones after computing this set. pub(crate) fn keep_ref_sync(existing: &[String], protected: &BTreeSet) -> Vec<(String, String)> { let mut create = Vec::new(); @@ -341,7 +341,8 @@ pub fn apply() -> Result<(), String> { // Remove only our own keep refs for commits that are no longer a deployment or // a plan/intent input. Those deployments were already retired by OSTree's own // finalize-staged retention; keeping the artificial ref would pin their objects - // forever and defeat the collection. Service/history refs remain untouched. + // forever and defeat the collection. Superseded local composition refs go too; + // deployments, `stable/*`, plans and generation history stay. for (name, _) in stale_keep_refs(&refs, &protected) { repository(&["refs", "--delete", &name])?; }