Files
mesh-host/internal/agent/parts.go
T
jschoubben 949b782a1e MH-3: the apply order by rank, the revert, the backup holder and the bus module first, the engine's own module last
settle applies the changed wants in the order of design 47 H 771: the node's own composition,
a reverted module, the holder of node-backup and the bus module (by the claims of the manifests
the composer holds), each pipeline's wants by rank (older source first), the rest by name, the
engine's own module last. A want of a higher rank waits on this machine alone for the lower
ranks of its pipeline, held in its have as a wait of step placing and judged again at the next
settle. The want's pipeline and rank are the mesh-delivery contract's stand-in until its commit.

Builds: design 47 H §771; H-A-46, H-A-59, H-A-67, H-A-68

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
2026-11-20 02:37:59 +01:00

43 lines
1.6 KiB
Go

package agent
import (
"strings"
"git.novox.be/novox/mesh-contracts/go/seats/nodeengine"
)
// EntryAsked and EntryMissing open the detail of a have held for the entry the want names (design 47 G section 421 and
// section 614): the entry is asked of the catalog half and not yet answered, or the half answered that it holds none. Both
// are the phase held, and each names the fingerprint.
const (
EntryAsked = "entry-asked:"
EntryMissing = "entry-missing:"
)
// judgedAgain says a held have is a hold the node-engine judges again at a start, not one that waits for the operator's answer:
// its wait's reason (the structured field the have carries) is that its entry is not held (§421) or it waits for a lower rank of its pipeline (§771), whatever words its detail
// opens with. Only a failed backup or restore point waits for an answer (ADR 0568 §4); g14, 2026-11-18: feh held "whether ..." with the reason entry-missing was kept the same way.
func judgedAgain(h Have) bool {
if h.Wait == nil {
return false
}
switch h.Wait.Reason {
case strings.TrimSuffix(EntryAsked, ":"), strings.TrimSuffix(EntryMissing, ":"), nodeengine.WaitStepPlacing:
return true
}
return false
}
// heldReason is the opening of a detail held for an entry: EntryAsked or EntryMissing.
func heldReason(why string) string {
if strings.HasPrefix(why, EntryAsked) {
return EntryAsked
}
return EntryMissing
}
// heldForEntry says whether why is a hold for the entry a want names.
func heldForEntry(why string) bool {
return strings.HasPrefix(why, EntryAsked) || strings.HasPrefix(why, EntryMissing)
}