selfcompose: hear catalog-revision on the contract's subject, consume it in the manifest, one test

Subscribe to meshcatalog.SubjectCatalogRevisionAll (no string of its own); module.json consumes
mesh-catalog.catalog-revision so the node account is granted it; the two new tests are folded into
TestTrunkAskBackoffAndCatalogRevision and wait on channels, not time.

Builds: design 47 G-22 A-487a, A-487c, principle 3
This commit is contained in:
2026-11-19 01:18:38 +01:00
parent 2057c9d304
commit cb6cd9d996
5 changed files with 32 additions and 79 deletions
+2 -6
View File
@@ -161,10 +161,6 @@ type SeatGate interface {
// VaultSecretChanged is the vault's event that a secret changed: a name and its generation, never a value.
const VaultSecretChanged = "mesh.mod.mesh-vault.event.secret-changed"
// CatalogRevisionEvents is the seat mesh-catalog's event catalog-revision, whatever branch its subject names: a node-engine asks
// again the trunk builds the catalog gave none of at once, not at the end of their backoff (A-487a, design 47 G-12 line 317).
const CatalogRevisionEvents = "mesh.seat.mesh-catalog.event.catalog-revision.>"
// Composer composes the node and is the agent's watcher of its compositions (agent.Env.Composed).
type Composer struct {
// OnEngine is told the node-engine's own module each time a composing finds it (design 47 G §527, §634); set before the
@@ -717,7 +713,7 @@ func (c *Composer) Watch(ctx context.Context, _ string) (<-chan agent.Update, er
func (c *Composer) hearCatalogRevisions(ctx context.Context, wake func()) {
said := false
for try := 0; ; try++ {
revisions, stop, err := c.env.Hear(CatalogRevisionEvents)
revisions, stop, err := c.env.Hear(meshcatalog.SubjectCatalogRevisionAll)
if err == nil {
defer stop()
for {
@@ -735,7 +731,7 @@ func (c *Composer) hearCatalogRevisions(ctx context.Context, wake func()) {
}
if !said {
said = true
c.env.Say(fmt.Sprintf("the node cannot hear %s: %v; it asks the trunk builds again on a backoff alone and tries to hear it again", CatalogRevisionEvents, err))
c.env.Say(fmt.Sprintf("the node cannot hear %s: %v; it asks the trunk builds again on a backoff alone and tries to hear it again", meshcatalog.SubjectCatalogRevisionAll, err))
}
select {
case <-ctx.Done():