Pull the Node build seat's asks beside the tools, delivery first and at most the node's capacity (issue 1887 A3node, ADR 0525 §2-§6)

This commit is contained in:
2026-10-23 15:39:30 +02:00
parent 6e823d1f9b
commit 8356d30e1b
7 changed files with 226 additions and 6 deletions
@@ -55,6 +55,7 @@ func main() {
RegistryFile: filepath.Join(home, "registry"),
}
m.Floor = floorOf(m.Node)
m.Settings = filepath.Join(home, "settings.json")
// Outside a launch by the runtime — a build, a check — there is no node and no state to write.
if m.Node != "" {
go m.Start(ctx)
@@ -65,7 +66,13 @@ func main() {
logf("announcing the states it keeps: %v", err)
os.Exit(1)
}
if err := stdio.Serve("", m.Tools(m.StepTools())); err != nil {
steps := m.StepTools()
puller := m.Puller(steps, nil)
if m.Node != "" {
// The seat's asks, pulled once Serve has the runtime's channel; a pull before it is said and tried again.
go func() { _ = puller.Pull(ctx) }()
}
if err := stdio.Serve("", append(m.Tools(steps), m.SeatTools(puller)...)); err != nil {
logf("%v", err)
os.Exit(1)
}