Let go of a hold whose resource is no longer declared, touching nothing on disk (hq ADR 0100)

This commit is contained in:
2026-09-22 18:14:37 +02:00
parent 824cb60cbb
commit 4a095df2f9
2 changed files with 153 additions and 2 deletions
+18
View File
@@ -202,6 +202,24 @@ func ApplyKeeping(
}
}
// **A hold whose resource is no longer declared is let go, and nothing on disk is touched.**
// What was found stays as it was; only the host's note that it holds it for a module goes, so
// the node stops reporting a hold for a module no longer assigned. Should the module come back,
// what is there is present with no record and is found, and held, again — its first kept
// original is never overwritten (novox/hq ADR 0100). Only a declaration from the mesh says
// what is assigned: a carried bundle's silence is not an unassignment.
if origin == store.OriginDeclared {
for _, h := range append([]store.Held{}, known.Held...) {
if declared[h.ID] {
continue
}
known.Release(h.ID)
report.Outcomes = append(report.Outcomes, Outcome{ID: h.ID, Type: h.Kind, Target: h.Target,
Action: "forgotten", Detail: "no longer declared; left as found"})
log(fmt.Sprintf(" forgotten %s (%s): no longer declared; left as found", h.ID, h.Target))
}
}
// What moved in this apply, so a service that must reflect a file can be told the file
// moved. Only within one apply: a change from an earlier one has already been reflected, and
// restarting for it every time would make a steady machine restart its services for ever.