Keep what an adopted node was found holding until its module is taken, and report it held (hq ADR 0100)

This commit is contained in:
2026-09-22 17:14:04 +02:00
parent fcc447c216
commit 3a613113be
5 changed files with 714 additions and 3 deletions
+8 -2
View File
@@ -17,6 +17,7 @@ import (
"fmt"
"os"
"os/signal"
"path/filepath"
"sort"
"strings"
"syscall"
@@ -740,8 +741,8 @@ func applyAndKeep(ctx context.Context, opts options, raw []byte, signed *store.D
// Declared, not carried. A declaration from the mesh removes only what the mesh previously
// declared — never what this machine raised for itself from its bundle (04-ISSUES/010).
outcome, updated, applyErr := apply.Apply(ctx, built, declared, known, store.OriginDeclared,
apply.ExecRunner, nil, sealOpener(opts.state))
outcome, updated, applyErr := apply.ApplyKeeping(ctx, built, declared, known, store.OriginDeclared,
apply.ExecRunner, nil, sealOpener(opts.state), apply.KeepIn(filepath.Dir(opts.state)))
// Saved whichever way it went. Recording only on success would lose the footprint of a
// failed apply, and that footprint is on the machine either way.
@@ -761,6 +762,11 @@ func applyAndKeep(ctx context.Context, opts options, raw []byte, signed *store.D
report := link.Report{Carried: carriedPorts(updated), Declared: digestOf(raw)}
for _, change := range outcome.Outcomes {
// What is held is not what this machine owns: it was found, and is kept as it was until
// its module is taken (novox/hq ADR 0100).
if change.Action == "held" {
continue
}
report.Applied = append(report.Applied, change.ID)
}
// Kept whichever way it went, so a node that is disconnected next minute still knows what it