The node agent keeps the bus server unless the want carries the warrant's mark, and the bus's have says what the server runs (ADR 0594 §2-§4, §6)

This commit is contained in:
2026-11-03 09:03:24 +01:00
parent ffcd8f6d61
commit 9fd5429853
6 changed files with 318 additions and 15 deletions
+24
View File
@@ -1163,6 +1163,30 @@ func (c *Composer) Policy(ctx context.Context, module string) string {
return policy
}
// BusServer is, for a module whose manifest provides the mesh's bus, the ids it declares of the bus server's resources
// (catalogue.BusServerOf, novox/hq ADR 0594 §7), none for any other; known says whether the manifest could be read.
func (c *Composer) BusServer(ctx context.Context, module string) (ids []string, known bool) {
c.mu.Lock()
m, ok := c.modules[module]
c.mu.Unlock()
if !ok || m.Manifest == "" {
return nil, false
}
raw, err := reader{c: c}.Manifest(ctx, m.Manifest)
if err != nil {
return nil, false
}
parsed, held, err := c.taken(module, m, raw)
if err != nil || held != "" {
return nil, false
}
for id := range catalogue.BusServerOf(parsed) {
ids = append(ids, id)
}
sort.Strings(ids)
return ids, true
}
// HoldsData says whether a module's manifest declares data (catalogue.Manifest.DataItems), as a composition's Data says
// it, and whether the manifest could be read: the agent's Data for what runs of a module from the kept declaration
// (agent.Env.HoldsData, issue 924).