Give a service's held state its own field and key, so main compiles again
mesh/merge-gate pass: builds mesh-host → ace, g14, novox, shanks; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: its merge-check.sh passed
mesh/delivery delivered

#64/#65 and #66 each added Applied.Declared: a directory's declared owner and
mode (string) and a service's held state (*FoundUnit), both under the JSON key
"declared". The directory's is already on nodes, written by d28ca95, so it
keeps the name and key; the service's becomes DeclaredUnit, "declared_unit".
#66 never deployed, so no node holds a record under the new key.
This commit is contained in:
jochen
2026-10-09 03:03:58 +02:00
parent 690966d847
commit c2bae14994
4 changed files with 67 additions and 31 deletions
+4 -4
View File
@@ -125,14 +125,14 @@ func Plan(d *declaration.Declaration, known store.State, origin string) []Step {
case f == nil:
step.Verb, step.Why = "forget", "no longer declared; recorded before the host kept what it "+
"found, so it is left as it is"
case orphan.Declared != nil && ((f.State == "running" && orphan.Declared.State == "stopped") ||
(f.Boot == "enabled" && orphan.Declared.Boot == "disabled")):
case orphan.DeclaredUnit != nil && ((f.State == "running" && orphan.DeclaredUnit.State == "stopped") ||
(f.Boot == "enabled" && orphan.DeclaredUnit.Boot == "disabled")):
// startUnitBack's words (novox/hq ADR 0269): what the mesh's declaration stopped goes back.
var back []string
if f.State == "running" && orphan.Declared.State == "stopped" {
if f.State == "running" && orphan.DeclaredUnit.State == "stopped" {
back = append(back, "started")
}
if f.Boot == "enabled" && orphan.Declared.Boot == "disabled" {
if f.Boot == "enabled" && orphan.DeclaredUnit.Boot == "disabled" {
back = append(back, "enabled at boot")
}
// A preview: whether it is still as the mesh held it is read when the removal runs, and a