S4: an unread seat list holds a module before its build is read

On ace, a node-engine left on its bootstrapped seat list could not find the
artifact store's seat, refused avahi's archive reference and with it the whole
pass, so the seat-list hold never ran and every module said "reaches no
artifact store". While the list is unread, a placed module whose seats are not
all bootstrapped is now held as it runs before anything of its build is read
(frombus.Scope.Held), its reason names the bootstrapped seats the node holds,
and a pass refused whole says the unread list first (issue 1966).

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-10 00:40:53 +01:00
parent 7bf7e29a32
commit 4af6c274b8
3 changed files with 132 additions and 10 deletions
+59 -3
View File
@@ -43,6 +43,7 @@ import (
"git.novox.be/novox/mesh-networking/modules/mesh-wireguard/go/overlay"
"git.novox.be/novox/mesh-sdk/go/catalogue"
"git.novox.be/novox/mesh-sdk/go/seatlist"
"github.com/novox/mesh-host/internal/compose"
"github.com/novox/mesh-host/internal/compose/frombus"
"github.com/novox/mesh-host/internal/compose/resolution"
@@ -997,6 +998,10 @@ func (c *Composer) compose(ctx context.Context) []agent.Update {
c.mu.Lock()
c.dataScope = frombus.Scope{Node: c.env.Node, KeptAt: kept, InOwn: inOwn} // the data items are worked out as composed
c.mu.Unlock()
// A node that has not read the seat list takes nothing of a module whose seats are not all bootstrapped from its build
// (ADR 0636 §1): the module is held as it runs before anything of its build is read, so no take-in or artifact
// reference of it (the artifact store's seat is not bootstrapped) can refuse the pass (issue 1966).
scope.Held = c.heldUntilListed(ctx, r, own)
missed := c.missed.Load()
compositions, skipped, held, err := frombus.Compose(ctx, r, c.env.Mesh, scope, fps)
err = c.missedIn(missed, err)
@@ -1021,6 +1026,10 @@ func (c *Composer) compose(ctx context.Context) []agent.Update {
}
if err != nil {
why := fmt.Sprintf("%v", err)
if line, unread := c.seatListUnread(); unread {
// A refusal while the list is unread may be of a seat the node cannot yet know: said first (issue 1966).
why = line + "; " + why
}
// A bus that did not answer past every try is no answer: composed again after a bound (issue 1126, 2026-10-28),
// and the refusal says when (issue 774, 2026-10-31). A refusal is final until an input moves.
if BusFailed(err) {
@@ -1869,8 +1878,54 @@ func mapValues(m map[string]compositions.Composed) []compositions.Composed {
return out
}
// WaitsForTheSeatList is why a module is held while the node has not read the seat list.
const WaitsForTheSeatList = "the node has not read the seat list, so it composes nothing new of this module and keeps what runs of it (novox/hq ADR 0636 §1)"
// WaitsForTheSeatList is why a module is held while the node has not read the seat list, said by a gate that names no
// seat it holds.
const WaitsForTheSeatList = "the node has not read the seat list" + composesNothingNewOfIt
// WaitsForTheSeatListHeld is why a module is held while the node holds only its bootstrapped seat list (novox/hq ADR 0636
// §2): the number and the names of the seats it holds, then what it does of the module (issue 1966).
const WaitsForTheSeatListHeld = "the node holds only its bootstrapped seat list (%d seats: %s) and has not read the seat " +
seatlist.Seat
const composesNothingNewOfIt = ", so it composes nothing new of this module and keeps what runs of it (novox/hq ADR 0636 §1)"
// seatListUnread is, while the node has not read the seat list, the line that says so, naming the bootstrapped seats it
// holds when its gate says them (the reader's Status); false once the list was read, or with no gate.
func (c *Composer) seatListUnread() (string, bool) {
if c.env.SeatList == nil || c.env.SeatList.MayAct() {
return "", false
}
says, ok := c.env.SeatList.(interface{ Status() seatlist.Status })
if !ok {
return strings.TrimSuffix(WaitsForTheSeatList, composesNothingNewOfIt), true
}
var seats []string
for _, h := range says.Status().Held {
seats = append(seats, h.Seat)
}
return fmt.Sprintf(WaitsForTheSeatListHeld, len(seats), strings.Join(seats, ", ")), true
}
// heldUntilListed is, while the node has not read the seat list, every module placed on it whose seats are not all
// bootstrapped, each with why: the pass holds them as they run before reading anything of their builds (frombus.Scope.Held).
// A holder of the seat mesh-catalog is composed whatever the list says, since the list is read from it (holdUntilListed,
// holderPart). Nil once the list was read.
func (c *Composer) heldUntilListed(ctx context.Context, r reader, own meshmoduleassigner.Assignments) map[string]string {
line, unread := c.seatListUnread()
if !unread {
return nil
}
holders := c.claimants(ctx, r, meshcatalog.Seat)
held := map[string]string{}
for _, pm := range own.Modules {
if pm.Module == "" || pm.Module == agent.NodeModule || slices.Contains(holders, pm.Module) ||
c.env.SeatList.MayAct(c.seatsOf(ctx, r, pm.Module)...) {
continue
}
held[pm.Module] = line + composesNothingNewOfIt
}
return held
}
// WaitsForTheSeatListOwn is why the node's own composition is held: it folds modules and accounts whose seats the node
// cannot judge before the list was read, so only the last applied one runs (ADR 0636 §1).
@@ -1906,7 +1961,8 @@ func (c *Composer) holdUntilListed(ctx context.Context, r reader, compositions m
if dig, err := engcomp.DigestOf(comp); err == nil && ran[comp.Module+"/"+dig] {
continue
}
module, why := comp.Module, WaitsForTheSeatList
line, _ := c.seatListUnread()
module, why := comp.Module, line+composesNothingNewOfIt
if module == "" { // the node's own: no seat to judge, so while the list is unread it waits whole
if c.env.SeatList.MayAct() {
continue