Ask over mesh-sdk's composition: a question makes no pair credential and reads the mesh once (issue 1387)

The callers that only ask (status, the doctor's probes, facts, bindings, data, acts, nodes show, images, release, recorded push, consumers) resolve through resolveNode and compose through composeQuestion, over one Input read per operation (withInputCache). A question composes with Reading or Foreseeing and never calls PairCredential's maker: the credential a send would make is named, and perform makes it on a send.
This commit is contained in:
2026-10-20 09:14:25 +00:00
parent f693d7e171
commit 7855ea126c
11 changed files with 36 additions and 20 deletions
+6 -3
View File
@@ -20,6 +20,7 @@ import (
"golang.org/x/net/dns/dnsmessage"
"git.novox.be/novox/mesh-sdk/go/catalogue"
"git.novox.be/novox/mesh-sdk/go/compose"
"git.novox.be/novox/mesh-sdk/go/overlay"
"github.com/novox/mesh-controller/internal/artifacts"
"github.com/novox/mesh-controller/internal/broker"
@@ -62,7 +63,9 @@ func probeDeclarations(ctx context.Context, d *doctor) ([]conditions.Observation
// The private network every declaration is composed with. Not computable is not "could not
// look": it is the finding — no machine's declaration composes without it — and the machines that
// do not resolve, which are usually why, are named below.
gens, gensErr := generators(ctx, open)
// Every machine below is composed over one reading of the mesh.
ctx = withInputCache(ctx)
_, gensErr := generatorsOf(ctx, open)
if gensErr != nil {
if ctx.Err() != nil {
return nil, ctx.Err()
@@ -73,7 +76,7 @@ func probeDeclarations(ctx context.Context, d *doctor) ([]conditions.Observation
Said: firstLine(gensErr.Error())})
}
for _, n := range nodes {
plan, settings, err := planFor(ctx, open, n.Name)
plan, settings, err := resolveNode(ctx, open, n.Name)
if err != nil && !unresolvable(err) {
return nil, fmt.Errorf("%s cannot be worked out: %w", n.Name, err)
}
@@ -85,7 +88,7 @@ func probeDeclarations(ctx context.Context, d *doctor) ([]conditions.Observation
}
if err == nil && gensErr == nil {
var declared sendable
if declared, err = declarationWith(ctx, open, n.Name, plan, settings, gens, Foreseeing); err == nil {
if declared, _, err = composeQuestion(ctx, open, n.Name, compose.Foreseeing, false); err == nil {
foreseen = declared.foreseen
// With the order it was last sent, so the validator reads the envelope a machine is sent
// — its epoch included (novox/hq to-be 45 §6).