MH-7: the node-engine reads a module of a catalog revision as accepted: no verdict is read
The seat mesh-catalog keeps no state verdicts (H-A-79): frombus taken, the composer's parse and the composer's reading of a candidate drop the verdict branch and decode the manifest alone, a module in a catalog revision being accepted by being there; the composer no longer reads the request field Case.Verdicts (H-A-112). Tests that held a module by a verdict hold it by the decoder, or go. Builds: design 47 H, H-A-79, H-A-111, H-A-112 Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -3,6 +3,11 @@ package selfcompose
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"git.novox.be/novox/mesh-contracts/go/seats/meshmoduleassigner"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/clients/meshcatalogclient"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/clients/meshdeliveryclient"
|
||||
@@ -10,10 +15,6 @@ import (
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshwants"
|
||||
"github.com/novox/mesh-host/internal/buckets"
|
||||
"github.com/novox/mesh-host/internal/buckets/bucketstest"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
nec "git.novox.be/novox/mesh-contracts/go/clients/nodeengineclient"
|
||||
"git.novox.be/novox/mesh-contracts/go/seats/nodeengine"
|
||||
@@ -56,23 +57,7 @@ func TestTheNodeComposesACandidateOnAsk(t *testing.T) {
|
||||
key, _ := nec.CompositionKey(group, heads)
|
||||
return key
|
||||
}
|
||||
accepted, refusedKey := candidateOf("fix/940-no-retire-on-partial-read", digest2), ""
|
||||
{
|
||||
// The same change, its manifest refused by the indexer's judge.
|
||||
refusedMan := strings.Replace(lemurs2, `"version":"2"`, `"version":"3"`, 1)
|
||||
d3 := meshcatalogclient.ManifestDigest([]byte(refusedMan))
|
||||
man, _ := meshcatalogclient.EncodeManifest(meshcatalog.ManifestsByDigestValue{Module: "lemurs", Manifest: refusedMan})
|
||||
key, _ := meshcatalogclient.ManifestsKey(d3)
|
||||
b.kv[buckets.Manifests+"/"+key] = man
|
||||
vkey, _ := meshcatalogclient.VerdictsKey(d3)
|
||||
v, err := meshcatalogclient.EncodeVerdict(meshcatalog.VerdictsByDigestValue{Module: "lemurs", State: meshcatalogclient.VerdictRefused,
|
||||
Problems: []string{"a field the judge refuses"}, Judge: "src2:j", At: func(t time.Time) *time.Time { return &t }(time.Now())})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
b.kv[buckets.Verdicts+"/"+vkey] = v
|
||||
refusedKey = candidateOf("fix/941-refused", d3)
|
||||
}
|
||||
accepted := candidateOf("fix/940-no-retire-on-partial-read", digest2)
|
||||
|
||||
env := b.env()
|
||||
state := &fakeComposed{kv: map[string]ComposedEntry{}}
|
||||
@@ -144,14 +129,6 @@ func TestTheNodeComposesACandidateOnAsk(t *testing.T) {
|
||||
in.ComposedHow.Builds["lemurs"] != fpNew {
|
||||
t.Errorf("the input sent for the sandbox does not say how the node composes: %+v, %v", in.ComposedHow, err)
|
||||
}
|
||||
r := s.ComposeCandidate(ctx, nodeengine.ComposeCandidateInput{Candidate: refusedKey})
|
||||
if r.Verdict != nec.Refused || len(r.Modules) != 1 || r.Modules[0].State != nec.ModuleRefused ||
|
||||
!strings.Contains(r.Modules[0].Words, "a field the judge refuses") {
|
||||
t.Errorf("a candidate whose manifest the indexer refused answered %+v", r)
|
||||
}
|
||||
if _, err := nec.EncodeAnswer(r); err != nil {
|
||||
t.Errorf("the refused answer does not fit the seat's shape: %v", err)
|
||||
}
|
||||
// A-226b: a branch pipeline's revision composes as the candidate, each module at the revision's build; one the catalog does
|
||||
// not hold, and a run on request's key, are refused in words.
|
||||
revKey, _ := nec.RevisionKey("main", 362)
|
||||
|
||||
Reference in New Issue
Block a user