Carry an unassigned port as the declaration publishes it, refusing only a port a module does not listen on (issue 774, research 072 row 34)
mesh/delivery merged: source.main moved to novox/mesh-sdk@fea48f19cea5
mesh/delivery-group group fix/route-ports merged: every member is merged
mesh/check failed: integration: mesh-vault/cmd/mesh-vault.TestTheVaultWholeMintsOnTheBusWhoeverHoldsTheLease: never: the account minted under the cont…

influxdb and unifi publish bare ports that mesh-placement assigns none: the machine runs them at
the software's own number, so a plan refusing them held their whole plan for a route that works.
This commit is contained in:
2026-10-31 13:21:37 +01:00
parent b611022457
commit bb01a656d0
4 changed files with 38 additions and 48 deletions
+15 -19
View File
@@ -221,12 +221,9 @@ type Rendering struct {
// They win over anything the mesh would assign and over a manifest's own long-form mapping.
Given map[string]map[int]int
// Unassigned is each port the mesh may assign that the placement holds no machine port for yet, by module and by the
// port the software uses: in Ports it stands as the software's own number, which nothing on the machine published.
Unassigned map[string]map[int]bool
// Planned says this rendering composes the plans the seat mesh-provisioner keeps (compose.Planning). A contribution a
// plan carries is then refused where its port has no machine port assigned (Ports, Given, Unassigned), never carried
// as the software's own number: its provider dials what the plan says (issue 774, research 072 row 34).
// plan carries is then refused where its port is none the module listens on: no machine port stands for it, and its
// provider dials what the plan says (issue 774, research 072 row 34).
Planned bool
// Taken is the modules taken on this adopted node (novox/hq ADR 0100). The guard is derived
@@ -1891,30 +1888,29 @@ func (r Resolution) contributedOf(m Manifest, to string, with Rendering) (json.R
return EncodeContributed(form)
}
// atAssignedPort is a contribution of m with its port the machine port m's placement assigned it on this node, the
// number `${port:<software port>}` gives m itself (port_into.go): what its provider dials, on this machine over loopback
// and from another at m's address.
// atAssignedPort is a contribution of m with its port where this machine publishes it for m: the number
// `${port:<software port>}` gives m itself and its declaration publishes (machinePort, port_into.go), the placement's
// assignment where it holds one and the software's own number where it holds none (a bare port not yet moved, a fixed
// mapping, the host's network). What its provider dials, on this machine over loopback and from another at m's address.
//
// **Refused, never guessed, where a plan carries it** (with.Planned): a port the placement holds no machine port for is
// said by module, node and port, since the software's own number is where nothing listens. Elsewhere (a declaration,
// a composition with no placement) a port not known is left as it is, as machinePort leaves it.
// **Refused where a plan carries a port m does not listen on** (with.Planned): no machine port stands for it, so the
// provider would dial a number nothing on the machine is known to publish. Elsewhere (a declaration, a composition
// with no ports) such a port is left as it is, as machinePort leaves it.
func (r Resolution) atAssignedPort(m Manifest, to string, values map[string]any, with Rendering) (map[string]any, error) {
number, ok := asPort(values["port"])
if !ok {
return values, nil
}
at, known := with.Given[m.Module][number]
if !known && !with.Unassigned[m.Module][number] {
at, known = with.Ports[m.Module][number]
}
if !known {
_, given := with.Given[m.Module][number]
_, placed := with.Ports[m.Module][number]
if !given && !placed {
if with.Planned {
return nil, fmt.Errorf("%s contributing to %s: its port %d on %s has no machine port assigned in its placement, "+
"so its provider would dial the software's own port, where nothing listens", m.Module, to, number, r.Node)
return nil, fmt.Errorf("%s contributing to %s: its port %d on %s is none of the ports it listens on, so no "+
"machine port stands for it", m.Module, to, number, r.Node)
}
return values, nil
}
return atMachinePort(values, m.Module, map[string]map[int]int{m.Module: {number: at}}), nil
return atMachinePort(values, m.Module, map[string]map[int]int{m.Module: {number: with.machinePort(m.Module, number)}}), nil
}
// composed is one contribution as its provider receives it: settled with this node's settings, its