node-engine: a run's compose-candidate key reads candidates.run-<id> by its group, with no heads compared (A-226c)

Builds: design 47 G (G-22 lead answers 2) A-226c; A-226b
This commit is contained in:
2026-11-16 14:00:30 +01:00
parent a1cd4a1a2f
commit 6eb41a17e1
2 changed files with 13 additions and 6 deletions
+7 -1
View File
@@ -163,10 +163,16 @@ func TestTheNodeComposesACandidateOnAsk(t *testing.T) {
if m := s.ComposeCandidate(ctx, nodeengine.ComposeCandidateInput{Candidate: noRev}); m.Verdict != nec.Refused || !strings.Contains(m.Refused, "holds no revision 999") {
t.Errorf("a revision the catalog does not hold answered %+v", m)
}
// A-226c: a run's key reads the indexer's candidates.run-<id> by its group, with no heads compared; one it holds none of is refused.
candidateOf("run-r1", digest2)
runKey, _ := nec.RunKey("r1")
if m := s.ComposeCandidate(ctx, nodeengine.ComposeCandidateInput{Candidate: runKey}); m.Verdict != nec.Refused || !strings.Contains(m.Refused, "run on request") {
if m := s.ComposeCandidate(ctx, nodeengine.ComposeCandidateInput{Candidate: runKey}); m.Verdict != nec.Composed || len(m.Modules) != 1 || m.Modules[0].Fp != fpNew || !m.Modules[0].Changed {
t.Errorf("a run's key answered %+v", m)
}
noRun, _ := nec.RunKey("r2")
if m := s.ComposeCandidate(ctx, nodeengine.ComposeCandidateInput{Candidate: noRun}); m.Verdict != nec.Refused || !strings.Contains(m.Refused, "holds no candidate") {
t.Errorf("a run the indexer holds none of answered %+v", m)
}
missing, _ := nec.CompositionKey("novox/x#8", "0123456789ab")
if m := s.ComposeCandidate(ctx, nodeengine.ComposeCandidateInput{Candidate: missing}); !strings.Contains(m.Refused, "holds no candidate") {
t.Errorf("a candidate the indexer does not hold answered %+v", m)