BUILD-1: the build modules wire no asker judgement of the step runner
The three build modules no longer give the step runner a callers reader of the seat list (steprun.SeatListCallers and Puller.Callers go): no seat definition names callers and every account may call every verb. Builds: design 47 H §752, §764 (every seat contract: the callers lists); H-A-41, H-A-66, H-A-71 (3) Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -57,9 +57,6 @@ func (m *Module) askSteps(steps []StepTool) steprun.AskSteps {
|
||||
func (m *Module) Puller(steps []StepTool, source steprun.AskSource) *steprun.Puller {
|
||||
if source == nil {
|
||||
source = &steprun.SeatAsks{Language: sdkstep.AskGo, Logf: m.Say}
|
||||
if m.Callers == nil {
|
||||
m.Callers = steprun.SeatListCallers(sdkstep.AskGo, m.Say)
|
||||
}
|
||||
}
|
||||
capacity := m.Capacity
|
||||
// The capacity's own change wakes the puller (issue 1887): the runtime's watch of the config value as mesh-config
|
||||
@@ -91,7 +88,7 @@ func (m *Module) Puller(steps []StepTool, source steprun.AskSource) *steprun.Pul
|
||||
if m.SayEvent != nil {
|
||||
say = steprun.SayOn(sdkstep.AskGo, m.Node, m.SayEvent)
|
||||
}
|
||||
return &steprun.Puller{KeepOutput: steprun.KeepOutputIn(m.Outputs), Source: source, Language: sdkstep.AskGo, Say: say, Callers: m.Callers, Prior: steprun.PriorRuns(m.ReadSteps.Get), Node: m.Node, Put: m.Steps, PausePut: m.Pauses, Load: load, ForgetPause: m.ForgetPause, WatchPauses: m.WatchPauses, PauseKeys: m.ReadPauses.Keys,
|
||||
return &steprun.Puller{KeepOutput: steprun.KeepOutputIn(m.Outputs), Source: source, Language: sdkstep.AskGo, Say: say, Prior: steprun.PriorRuns(m.ReadSteps.Get), Node: m.Node, Put: m.Steps, PausePut: m.Pauses, Load: load, ForgetPause: m.ForgetPause, WatchPauses: m.WatchPauses, PauseKeys: m.ReadPauses.Keys,
|
||||
Capacity: capacity, SettingsFile: settings, WatchConfig: watch, CoresPerStep: cores, BuildHours: hours, Logf: m.Say, Has: m.Has,
|
||||
Run: func(ctx context.Context, a sdkstep.StepAsk) (any, error) {
|
||||
if err := m.Check(ctx); err != nil {
|
||||
|
||||
@@ -11,15 +11,11 @@ import (
|
||||
func TestPullerSaysTheSeatsEventsOnItsNodesSubject(t *testing.T) {
|
||||
var subjects []string
|
||||
m := &Module{Node: "ace", Capacity: func() int { return 0 },
|
||||
Callers: func(kind string) ([]string, bool) { return []string{"mesh-pipeline-runner"}, kind == "step" },
|
||||
SayEvent: func(subject string, _ any, _ string) error { subjects = append(subjects, subject); return nil }}
|
||||
p := m.Puller(nil, steprun.NewFakeAsks())
|
||||
if p.Say == nil {
|
||||
t.Fatal("the puller says no event")
|
||||
}
|
||||
if got, ok := p.Callers("step"); !ok || len(got) != 1 {
|
||||
t.Fatalf("the puller checks the callers of %v, %v, not the module's", got, ok)
|
||||
}
|
||||
seat, _ := sdkstep.BuildSeat(sdkstep.AskGo)
|
||||
for _, event := range []string{"ask-taken", "step-progress", "step-ended"} {
|
||||
if err := p.Say(event, nil, "id"); err != nil {
|
||||
|
||||
@@ -25,9 +25,6 @@ const CheckRound = 10 * time.Minute
|
||||
// Module is the Go build module's one running state: the node it runs on, its recipe, the toolchain guard and the
|
||||
// states it writes (toolchains, steps).
|
||||
type Module struct {
|
||||
// Callers says which seats the build seat's definition lists as callers of an accepted kind (steprun.SeatListCallers when
|
||||
// the module pulls through its runtime; nil in a test checks no named asker): design 47 G §543, A-163.
|
||||
Callers func(kind string) ([]string, bool)
|
||||
// SayEvent publishes an event of the go build seat on a seat subject (stdio.SeatPublish; nil says none, a test's): the
|
||||
// puller's ask-taken, step-progress and step-ended (design 47 G §496, §602).
|
||||
SayEvent func(subject string, body any, id string) error
|
||||
|
||||
@@ -49,9 +49,6 @@ func (m *Module) sayStep() func(sdkstep.StepEnded) error {
|
||||
func (m *Module) Puller(steps []StepTool, source steprun.AskSource) *steprun.Puller {
|
||||
if source == nil {
|
||||
source = &steprun.SeatAsks{Language: sdkstep.AskImage, Logf: m.Say}
|
||||
if m.Callers == nil {
|
||||
m.Callers = steprun.SeatListCallers(sdkstep.AskImage, m.Say)
|
||||
}
|
||||
}
|
||||
capacity := m.Capacity
|
||||
// The capacity's own change wakes the puller (issue 1887): the runtime's watch of the config value as mesh-config
|
||||
@@ -80,7 +77,7 @@ func (m *Module) Puller(steps []StepTool, source steprun.AskSource) *steprun.Pul
|
||||
if m.SayEvent != nil {
|
||||
say = steprun.SayOn(sdkstep.AskImage, m.Node, m.SayEvent)
|
||||
}
|
||||
return &steprun.Puller{KeepOutput: steprun.KeepOutputIn(m.Outputs), Source: source, Language: sdkstep.AskImage, Say: say, Callers: m.Callers, Prior: steprun.PriorRuns(m.ReadSteps.Get), Node: m.Node, Put: m.Steps, PausePut: m.Pauses, Load: load, ForgetPause: m.ForgetPause, WatchPauses: m.WatchPauses, PauseKeys: m.ReadPauses.Keys,
|
||||
return &steprun.Puller{KeepOutput: steprun.KeepOutputIn(m.Outputs), Source: source, Language: sdkstep.AskImage, Say: say, Prior: steprun.PriorRuns(m.ReadSteps.Get), Node: m.Node, Put: m.Steps, PausePut: m.Pauses, Load: load, ForgetPause: m.ForgetPause, WatchPauses: m.WatchPauses, PauseKeys: m.ReadPauses.Keys,
|
||||
Capacity: capacity, SettingsFile: settings, WatchConfig: watch, CoresPerStep: cores, BuildHours: hours, Eligible: m.Eligible, Logf: m.Say,
|
||||
Run: func(ctx context.Context, a sdkstep.StepAsk) (any, error) {
|
||||
if err := m.Check(ctx); err != nil {
|
||||
|
||||
@@ -11,15 +11,11 @@ import (
|
||||
func TestPullerSaysTheSeatsEventsOnItsNodesSubject(t *testing.T) {
|
||||
var subjects []string
|
||||
m := &Module{Node: "ace", Capacity: func() int { return 0 },
|
||||
Callers: func(kind string) ([]string, bool) { return []string{"mesh-pipeline-runner"}, kind == "step" },
|
||||
SayEvent: func(subject string, _ any, _ string) error { subjects = append(subjects, subject); return nil }}
|
||||
p := m.Puller(nil, steprun.NewFakeAsks())
|
||||
if p.Say == nil {
|
||||
t.Fatal("the puller says no event")
|
||||
}
|
||||
if got, ok := p.Callers("step"); !ok || len(got) != 1 {
|
||||
t.Fatalf("the puller checks the callers of %v, %v, not the module's", got, ok)
|
||||
}
|
||||
seat, _ := sdkstep.BuildSeat(sdkstep.AskImage)
|
||||
for _, event := range []string{"ask-taken", "step-progress", "step-ended"} {
|
||||
if err := p.Say(event, nil, "id"); err != nil {
|
||||
|
||||
@@ -20,9 +20,6 @@ const CheckRound = 10 * time.Minute
|
||||
|
||||
// Module is the image build module's one running state.
|
||||
type Module struct {
|
||||
// Callers says which seats the build seat's definition lists as callers of an accepted kind (steprun.SeatListCallers when
|
||||
// the module pulls through its runtime; nil in a test checks no named asker): design 47 G §543, A-163.
|
||||
Callers func(kind string) ([]string, bool)
|
||||
// Outputs is the object store of a run's answers over what step-ended carries inline (steprun.OutputsStore); nil keeps none.
|
||||
Outputs steprun.OutputObjects
|
||||
// SayEvent publishes an event of the image build seat on a seat subject (stdio.SeatPublish; nil says none, a test's): the
|
||||
|
||||
@@ -61,9 +61,6 @@ func (m *Module) sayStep() func(sdkstep.StepEnded) error {
|
||||
func (m *Module) Puller(steps []StepTool, source steprun.AskSource) *steprun.Puller {
|
||||
if source == nil {
|
||||
source = &steprun.SeatAsks{Language: sdkstep.AskNode, Logf: m.Say}
|
||||
if m.Callers == nil {
|
||||
m.Callers = steprun.SeatListCallers(sdkstep.AskNode, m.Say)
|
||||
}
|
||||
}
|
||||
capacity := m.Capacity
|
||||
// The capacity's own change wakes the puller (issue 1887): the runtime's watch of the config value as mesh-config
|
||||
@@ -92,7 +89,7 @@ func (m *Module) Puller(steps []StepTool, source steprun.AskSource) *steprun.Pul
|
||||
if m.SayEvent != nil {
|
||||
say = steprun.SayOn(sdkstep.AskNode, m.Node, m.SayEvent)
|
||||
}
|
||||
return &steprun.Puller{KeepOutput: steprun.KeepOutputIn(m.Outputs), Source: source, Language: sdkstep.AskNode, Say: say, Callers: m.Callers, Prior: steprun.PriorRuns(m.ReadSteps.Get), Node: m.Node, Put: m.Steps, PausePut: m.Pauses, Load: load, ForgetPause: m.ForgetPause, WatchPauses: m.WatchPauses, PauseKeys: m.ReadPauses.Keys,
|
||||
return &steprun.Puller{KeepOutput: steprun.KeepOutputIn(m.Outputs), Source: source, Language: sdkstep.AskNode, Say: say, Prior: steprun.PriorRuns(m.ReadSteps.Get), Node: m.Node, Put: m.Steps, PausePut: m.Pauses, Load: load, ForgetPause: m.ForgetPause, WatchPauses: m.WatchPauses, PauseKeys: m.ReadPauses.Keys,
|
||||
Capacity: capacity, SettingsFile: settings, WatchConfig: watch, CoresPerStep: cores, BuildHours: hours, Logf: m.Say,
|
||||
Run: func(ctx context.Context, a sdkstep.StepAsk) (any, error) {
|
||||
if err := m.Prepare(ctx); err != nil {
|
||||
|
||||
@@ -11,15 +11,11 @@ import (
|
||||
func TestPullerSaysTheSeatsEventsOnItsNodesSubject(t *testing.T) {
|
||||
var subjects []string
|
||||
m := &Module{Node: "ace", Capacity: func() int { return 0 },
|
||||
Callers: func(kind string) ([]string, bool) { return []string{"mesh-pipeline-runner"}, kind == "step" },
|
||||
SayEvent: func(subject string, _ any, _ string) error { subjects = append(subjects, subject); return nil }}
|
||||
p := m.Puller(nil, steprun.NewFakeAsks())
|
||||
if p.Say == nil {
|
||||
t.Fatal("the puller says no event")
|
||||
}
|
||||
if got, ok := p.Callers("step"); !ok || len(got) != 1 {
|
||||
t.Fatalf("the puller checks the callers of %v, %v, not the module's", got, ok)
|
||||
}
|
||||
seat, _ := sdkstep.BuildSeat(sdkstep.AskNode)
|
||||
for _, event := range []string{"ask-taken", "step-progress", "step-ended"} {
|
||||
if err := p.Say(event, nil, "id"); err != nil {
|
||||
|
||||
@@ -25,9 +25,6 @@ const CheckRound = 10 * time.Minute
|
||||
// Module is the Node build module's one running state: the node it runs on, its recipe, the toolchain guard, the
|
||||
// toolchain directory and the states it writes (toolchains, steps).
|
||||
type Module struct {
|
||||
// Callers says which seats the build seat's definition lists as callers of an accepted kind (steprun.SeatListCallers when
|
||||
// the module pulls through its runtime; nil in a test checks no named asker): design 47 G §543, A-163.
|
||||
Callers func(kind string) ([]string, bool)
|
||||
// Outputs is the object store of a run's answers over what step-ended carries inline (steprun.OutputsStore); nil keeps none.
|
||||
Outputs steprun.OutputObjects
|
||||
// SayEvent publishes an event of the node build seat on a seat subject (stdio.SeatPublish; nil says none, a test's): the
|
||||
|
||||
Reference in New Issue
Block a user