BM3 (sdk): an install is a StepAsk of the kind install, dispatched by RunAsk

node-build-node accepts install as a StepAsk holding an install job (the
InstallAsk's fields and the module's fingerprint) under the version its
archive is published with; install is its own queue on that seat alone and
its holder pulls it. RunAsk dispatches the kind to the module's install body,
which publishes the archive <module>:node-modules to the artifact store, and
the install's end names the reference it answered.

Builds: design 47 H2 §800; H-A-367 (4), H-A-379, H-A-399 (1) (2), H-A-403
This commit is contained in:
2026-11-22 01:00:22 +01:00
parent 592637e6d7
commit b00cf73d77
19 changed files with 274 additions and 69 deletions
+10 -6
View File
@@ -535,9 +535,10 @@ func (p *Puller) next(ctx context.Context, wait time.Duration) (*Pulled, error)
p.mu.Lock()
declined, start := p.declined, p.turn
p.mu.Unlock()
for i := range sdkstep.AskKinds {
at := (start + i) % len(sdkstep.AskKinds)
kind := sdkstep.AskKinds[at]
queues := sdkstep.AskQueues(p.Language)
for i := range queues {
at := (start + i) % len(queues)
kind := queues[at]
if declined[kind] {
continue
}
@@ -545,7 +546,7 @@ func (p *Puller) next(ctx context.Context, wait time.Duration) (*Pulled, error)
if err != nil || msg != nil {
if msg != nil {
p.mu.Lock()
p.turn = (at + 1) % len(sdkstep.AskKinds)
p.turn = (at + 1) % len(queues)
p.mu.Unlock()
}
return withKind(msg, kind), err
@@ -731,8 +732,11 @@ func (p *Puller) take(ctx context.Context, msg *Pulled) {
return
}
module := ""
if ask.Build != nil {
switch {
case ask.Build != nil:
module = ask.Build.Module
case ask.Install != nil:
module = ask.Install.Module
}
p.mu.Lock()
p.inHand++
@@ -1059,7 +1063,7 @@ func (p *Puller) say(event string, body any, id string) {
// key naming it (design 47 G A-290: finish kept it with KeepOutput, so it is not put twice); a program that exits other than 0
// ends failed with its answer carried.
func (p *Puller) sayEnded(msg *Pulled, ask sdkstep.StepAsk, outcome, said string, result any, kept string) {
if p.Say == nil || ask.Step != nil {
if p.Say == nil || ask.Step != nil || ask.Install != nil {
return
}
end := sdkstep.StepEnded{ID: ask.ID, Asker: askerOf(msg, ask), Ask: ask.ID, Node: p.Node, Outcome: outcome, At: now().UTC()}