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:
2026-11-11 12:05:18 +01:00
parent 730860b274
commit 26581d87ed
8 changed files with 214 additions and 3 deletions
+22
View File
@@ -137,6 +137,7 @@ func (c *Composer) writeComposed(ctx context.Context, at *published) (wrote, del
}
c.pubKept[key] = ComposedEntry{Value: values[key], Revision: rev}
wrote++
c.saidComposed(key, values[key])
}
for _, key := range c.pastKeeping() {
if err := c.env.ComposedState.Delete(ctx, key); err != nil {
@@ -319,3 +320,24 @@ func ranOf(running []engcomp.Composed) map[string]string {
}
return out
}
// saidComposed says the event composed for a key just written that holds a module's composition at a fingerprint and was
// not refused: the node's own composition and a refusal say nothing.
func (c *Composer) saidComposed(key string, value []byte) {
if c.env.SayComposed == nil {
return
}
_, module, fp, isNode, err := engcomp.ParseKey(key)
if err != nil || isNode {
return
}
comp, err := engcomp.Decode(value)
if err != nil || comp.Refused != "" {
return
}
digest, err := engcomp.DigestOf(comp)
if err != nil {
return
}
c.env.SayComposed(module, fp, digest)
}