selfcompose: the one place says its source at every caller, reads the have's build, answers HoldsData; the tool composition reads it outside the agent's lock (A-484, A-482)

Builds: design 47 G A-484, A-484a, A-482
This commit is contained in:
2026-11-18 01:02:10 +01:00
parent 91dc064f92
commit 5cc26e2659
7 changed files with 152 additions and 122 deletions
+5 -4
View File
@@ -189,10 +189,6 @@ func (a *Agent) Composition(ctx context.Context, module, digest string, diff boo
Held: att.Held, AnsweredRevision: att.AnsweredRev, Transient: att.Transient}
}
view.Started = a.checked[module]
if a.env.RunningManifest != nil && module != NodeModule {
src, rfp, words := a.env.RunningManifest(module)
view.RunsManifest = &RunsManifestView{Source: src, FP: rfp, Words: words}
}
latest, haveLatest := a.compositionFor(module, fp)
r, ran := a.running[module]
from, known := a.runningComposition(module)
@@ -205,6 +201,11 @@ func (a *Agent) Composition(ctx context.Context, module, digest string, diff boo
}
}
a.mu.Unlock()
// Read outside the lock: the one place reads what the agent runs (Agent.Running takes it), and nothing it does is asked of the bus.
if a.env.RunningManifest != nil && module != NodeModule {
src, rfp, words := a.env.RunningManifest(module)
view.RunsManifest = &RunsManifestView{Source: src, FP: rfp, Words: words}
}
if module != NodeModule && fp == "" {
return view, fmt.Errorf("%s has no want and no have on %s, so no build of it is composed here", module, a.env.Node)
}