E5: answer the node-engine seat's composition-diff

The node-engine serves seat verbs and no tools bundle, so composed values
read by resource are a read verb beside composition: per resource, the
entries that differ between what runs and a revision or digest of its
composition key, environment entries by name, a secret's value masked.

Builds: design 47 H2 §813 (3); H-A-349 DQ-12b
This commit is contained in:
2026-11-21 23:10:59 +01:00
parent 6b3139218d
commit 019ced4449
5 changed files with 220 additions and 0 deletions
+14
View File
@@ -319,6 +319,20 @@ func compositionFrom(current *agentNow, withheld func(ctx context.Context, modul
}
}
// compositionDiffFrom answers the verb composition-diff from the node agent that runs now (design 47 H2 §813 (3)); refused in
// words while none does.
func compositionDiffFrom(current *agentNow) func(module string, revision int64, digest string) (any, error) {
return func(module string, revision int64, digest string) (any, error) {
ag := current.get()
if ag == nil {
return nil, errors.New("this engine's node agent has not started, so it holds no composition yet")
}
ctx, cancel := context.WithTimeout(context.Background(), compositionReadFor)
defer cancel()
return ag.CompositionDiff(ctx, module, revision, digest)
}
}
// withheldPartsOf is, of the composer that runs now, each part its last pass kept for module because its read did not answer.
func withheldPartsOf(composer *atomic.Pointer[selfcompose.Composer]) func(module string) map[string]string {
return func(module string) map[string]string {
+1
View File
@@ -1028,6 +1028,7 @@ func runLink(ctx context.Context, opts options) error {
go reconcileActs(ctx, queue.Acts)
current := &agentNow{}
queue.Acts.Composition = compositionFrom(current, queue.WithheldOf, withheldPartsOf(&composerNow))
queue.Acts.CompositionDiff = compositionDiffFrom(current)
queue.Acts.Compose = composeFrom(current, &composerNow)
queue.Acts.ApplyOrder = applyOrderFrom(current)
queue.Acts.Packages = packagesFrom(mine.Node, queue, &composerNow)