Send over mesh-sdk's composition: push, the pushes of plans and rollouts, held back, plan and the merge gate's passes (issue 1386)

Every send composes through composeSend (compose over the Input, perform what it named foreseen, read the stores again, compose again, refuse a declaration that still stands in for a value): push.go's two composing sites, composeForPush, declarationFor (the plan verb, which allocates on purpose for one named machine) and the merge gate's two passes and its trial assignment (composeSendValidated, which answers the node-engine's validator beside it). Each machine of a send reads the mesh afresh (freshInput), because the send before it made and recorded things. None calls declarationWith with Allocating any more. The private network is still computed up front, so a send refuses on it before anything is composed. Also here, as they share the helpers: whoResolvesOn, restOfTheMesh and restOfTheMeshOf in compose_sdk.go, and the planFor callers in held_back.go, plan.go and push.go.
This commit is contained in:
2026-10-20 09:12:24 +00:00
parent 647d20af98
commit f693d7e171
6 changed files with 144 additions and 39 deletions
+9 -3
View File
@@ -107,6 +107,8 @@ func buildName(commit string) string {
// (heldBack), and answers only the machines held. A machine whose set cannot be worked out is left
// to the send, which says why.
func heldMachines(ctx context.Context, open *stores, names []string) (map[string][]string, error) {
// One reading of the mesh for every machine this looks at.
ctx = withInputCache(ctx)
out := map[string][]string{}
if len(names) == 0 {
return out, nil
@@ -125,7 +127,7 @@ func heldMachines(ctx context.Context, open *stores, names []string) (map[string
return nil, err
}
for _, node := range names {
plan, _, err := planFor(ctx, open, node)
plan, _, err := resolveNode(ctx, open, node)
if err != nil {
continue
}
@@ -265,13 +267,17 @@ func flushBehind(ctx context.Context, open *stores, nodes []inventory.Node, hand
// is left out of it said, and its declaration allocated.
func composeForPush(open *stores, gens map[string]catalogue.Generator) func(held context.Context, node string) (sendable, error) {
return func(held context.Context, node string) (sendable, error) {
plan, settings, err := planFor(held, open, node)
// Read afresh for each machine: the send before it made and recorded things. gens is the private network the
// controller's own composition took; the SDK's is computed from the same Input.
_ = gens
held = freshInput(held)
plan, _, err := resolveNode(held, open, node)
if err != nil {
return sendable{}, err
}
reportUnhostable(node, plan)
reportKept(held, plan)
declared, err := declarationWith(held, open, node, plan, settings, gens, Allocating)
declared, err := composeSend(held, open, node)
if err == nil {
reportLeftOut(node, declared)
}