composer: one search for culprits, inside the node-engine's composition, bounded by blame_tries (G-24 H2 review r1)

ComposeSent no longer runs the node-engine's own culprit search (fixed at eight modules), and the composer's
own loop, which reran that search at every try, is gone: ComposeSent holds the case's changed modules on the
machine one at a time, one composition each, at most blame_tries, and blames the first whose hold ends the
problem; past the bound the untried are named. Without blame_tries there is no search. A module the node
holds composing without the change is held as there, and two owners of one path are blamed outside the search.

Builds: design 47 G §721, A-468i, A-468l, A-469j, A-469k, A-470c
This commit is contained in:
2026-11-17 13:03:15 +01:00
parent c5f76cb974
commit b4bf772de4
5 changed files with 96 additions and 76 deletions
+8 -7
View File
@@ -75,7 +75,7 @@ func Answer(ctx context.Context, r Reader, mesh Mesh, s Scope, fps map[string]st
return refuse(fmt.Errorf("frombus: the credentials of %s: %w", s.Node, err))
}
}
composed, skipped, stood, err := composeEach(in, s.Node, fps, false, s.Running, failed, ranOf(ctx, r, mesh, s.Running, fps), nil)
composed, skipped, stood, err := composeEach(in, s.Node, fps, false, s.Running, failed, ranOf(ctx, r, mesh, s.Running, fps), true)
if err != nil {
// Not one module's: the node's own (a value served elsewhere, the mesh's network), said once as the node's.
if len(failed) == 0 {
@@ -332,10 +332,11 @@ func standsInFor(x, node string) (string, string) {
// (culprit): de-spiegel's routes, its names unset, leave route-proxy without them while mailu keeps its smtp account,
// and the hold says so.
//
// owned, where not nil, is told each culprit held for a refusal that names paths two modules both own, with those pairs
// (resolution.Refusal.OwnedTwice): a composer blames both owners with the path (design 47 G §721; A-468l).
// search says a refusal is laid on a culprit (culprit). The node composing itself always searches; a composer's sandbox
// (ComposeSent) does not, since it runs the one search for culprits itself, bounded by its request (design 47 G §721;
// A-469j): there the first refusal no hold of the read answers is the node's (err).
func composeEach(in compose.Input, node string, fps map[string]string, applied bool, running []compositions.Composed, failed map[string]string,
ran func(module string) (catalogue.Manifest, bool), owned func(culprit string, twice []resolution.OwnedTwice)) (out map[string]compositions.Composed, skipped, stood []string, err error) {
ran func(module string) (catalogue.Manifest, bool), search bool) (out map[string]compositions.Composed, skipped, stood []string, err error) {
mode := compose.Foreseeing
if applied {
mode = compose.Reading
@@ -382,13 +383,13 @@ func composeEach(in compose.Input, node string, fps map[string]string, applied b
var leftOut map[string]string
out, skipped, stood, leftOut, err = compose.CompositionsHolding(in, node, fps, mode)
if err != nil {
if !search {
return nil, nil, nil, err
}
module, leave := culprit(in, node, fps, mode, failed, err)
if module == "" {
return nil, nil, nil, firstReason(err, failed)
}
if refusal := (*resolution.Refusal)(nil); owned != nil && errors.As(err, &refusal) && len(refusal.OwnedTwice) > 0 {
owned(module, refusal.OwnedTwice)
}
hold(module, err.Error(), leave)
continue
}