H-A-374: set a drifted directory the mesh made right at the engine's start

ace's Node toolchain cache directory stood at 0700 against its entry's 0711
while the engine said its composition was unchanged: an unchanged
composition is never applied, and the judgement reads the compositions, not
the disk. Each module taken as running at the engine's start now has every
directory entry its record says the mesh made given its declared owner and
mode where they drifted on disk, one journal line each; one the mesh never
made stays used as found and is said (issue 339). The verb composition's
diff names a drifted directory the mesh made. The agent test that marks
modules not composed now waits for every want it marks.

Builds: design 47 H2 §813; H-A-374, H-A-392
This commit is contained in:
2026-11-22 00:26:18 +01:00
parent f4f5615bfb
commit 1c32872fcc
6 changed files with 232 additions and 5 deletions
+37
View File
@@ -253,6 +253,21 @@ func awaitBackup(ctx context.Context, events <-chan []byte, node, module string,
}
}
// convergeDirectories gives each directory entry of runs that this node's record holds, drifted on disk, its declared
// owner and mode (apply.ConvergeDirectories, H-A-374, H-A-392): one line per directory, and one when the record or the
// composition does not read.
func convergeDirectories(statePath string, runs compositions.Composed) []string {
d, err := declarationOf(runs)
if err != nil {
return []string{fmt.Sprintf("the directories of %s are not judged at this start: its composition does not read: %v", runs.Module, err)}
}
known, err := store.Load(statePath)
if err != nil {
return []string{fmt.Sprintf("the directories of %s are not judged at this start: %v", runs.Module, err)}
}
return apply.ConvergeDirectories(d, known)
}
// declarationOf is the declaration the compositions make together: their resources, and the node's own parts when the
// node's composition is among them. It is what the node judges and says its health by, and what one module's apply is
// made of (with a single composition).
@@ -536,6 +551,28 @@ func nodeAgent(ctx context.Context, opts options, signer ed25519.PublicKey, trus
Backup: backupNode(session),
// What the filling refused before this apply may be named now: the provisioner's client is told to fill
// again (ace, 2026-10-25 21:17).
// A module taken as running at this start has each record-held directory entry of it given its owner and mode
// where they drifted on disk, one line each (H-A-374, H-A-392).
TakenAtStart: func(module string, runs compositions.Composed) {
for _, line := range convergeDirectories(opts.state, runs) {
say(line)
}
},
DirectoryDrift: func(runs compositions.Composed) []agent.DriftView {
d, err := declarationOf(runs)
if err != nil {
return nil
}
known, err := store.Load(opts.state)
if err != nil {
return nil
}
var out []agent.DriftView
for _, x := range apply.DirectoryDrifts(d, known) {
out = append(out, agent.DriftView{ID: x.ID, Path: x.Path, Drift: x.Drift})
}
return out
},
Settled: func(module string) {
knockFilling(module+" settled", say)
judgeWhatRunsNow(opts.state, signer)