H-3: the node-engine says composed, running and capabilities-changed on the seat's subjects
Builds: design 47 G §260, §227, §226, §177, §309, §404 Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
@@ -84,6 +84,14 @@ func TestTheNodePublishesItsCompositions(t *testing.T) {
|
||||
state := &fakeComposed{kv: map[string]ComposedEntry{}}
|
||||
env := b.env()
|
||||
env.ComposedState = state
|
||||
// Design 47, *What each step says*: each module composition written says composed, with its fingerprint and digest.
|
||||
var saidMu sync.Mutex
|
||||
var saidComposed []string
|
||||
env.SayComposed = func(module, fingerprint, digest string) {
|
||||
saidMu.Lock()
|
||||
defer saidMu.Unlock()
|
||||
saidComposed = append(saidComposed, module+" "+fingerprint+" "+digest)
|
||||
}
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
c := New(env)
|
||||
@@ -136,6 +144,14 @@ func TestTheNodePublishesItsCompositions(t *testing.T) {
|
||||
t.Errorf("the published composition of lemurs: %+v, %v", comp, err)
|
||||
}
|
||||
}
|
||||
if comp, err := engcomp.Decode(state.kv[lemursKey].Value); err == nil {
|
||||
dig, _ := engcomp.DigestOf(comp)
|
||||
saidMu.Lock()
|
||||
if len(saidComposed) != 1 || saidComposed[0] != "lemurs "+fp+" "+dig || dig == "" {
|
||||
t.Errorf("composed said %v, want once for lemurs at %s with its digest %q (the node's own says none)", saidComposed, fp, dig)
|
||||
}
|
||||
saidMu.Unlock()
|
||||
}
|
||||
// A pass that changes nothing writes nothing.
|
||||
setFor(t, &askedWithin, 0)
|
||||
if _, err := c.ComposeNow(ctx); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user