IX20: the validator's tests hold a step's status out of a manifest and read the build seats' new accepts

A manifest naming a status is refused as an unknown field (strict decoding); the
two seat-table tests read the seat definitions as contracts now answer them.

Builds: design 47 G §6, §21, §23, §28, §101, §95 test

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-11 11:26:51 +01:00
parent 6bbbceb55f
commit 6b85c9045e
2 changed files with 5 additions and 2 deletions
@@ -27,6 +27,9 @@ func TestTheJudge(t *testing.T) {
want: map[string]string{"a": `secret-`}},
{name: "an unknown field", raws: map[string]string{"a": `{"module":"a","version":"1","a-field-from-later":1}`},
want: map[string]string{"a": `"a-field-from-later"`}},
// Design 47 G §23, §28: a step's status is kept in the registration and never in a manifest.
{name: "a manifest naming a step's status", raws: map[string]string{"a": `{"module":"a","version":"1","policy":{"lint":"bypass"}}`},
want: map[string]string{"a": `"policy"`}},
{name: "a manifest under another name", raws: map[string]string{"b": `{"module":"a","version":"1"}`},
want: map[string]string{"b": `of module "a", not "b"`}},
{name: "a seat declared twice",
@@ -3918,7 +3918,7 @@ func caseNodeBuildAgentIsRetiredForTheBuildSeats(t *testing.T) {
}
for _, name := range []string{"node-build-go", "node-build-node", "node-build-image"} {
s, ok := catalogue.SeatNamed(name)
if !ok || s.Scope != catalogue.ScopeNode || !s.PulledByKind || strings.Join(s.Accepts, ",") != "delivery,check,recheck" {
if !ok || s.Scope != catalogue.ScopeNode || !s.PulledByKind || !slices.Contains(s.Accepts, "delivery") || !slices.Contains(s.Accepts, "check") || !slices.Contains(s.Accepts, "step") || !slices.Contains(s.Accepts, "recheck") {
t.Fatalf("%s = %+v", name, s)
}
if !s.Yields {
@@ -4683,7 +4683,7 @@ func caseTheMeshsOwnSeatsAreStillClaimable(t *testing.T) {
// It delivers the bus, so its holder provides the bus — the rule this check now enforces.
m := catalogue.Manifest{Module: "nats",
Provides: []catalogue.Offer{{Name: "mesh-bus", Scope: catalogue.ScopeMesh, Credential: &catalogue.OfferCredential{Form: catalogue.CredentialFormNone}}},
Claims: []catalogue.Claim{{Name: "mesh-broker", Scope: catalogue.ScopeMesh}}}
Claims: []catalogue.Claim{{Name: "mesh-broker", Scope: catalogue.ScopeMesh, Serves: []string{"snapshot-kept", "restore-kept"}}}}
if got := problemsFor(t, catalogue.Shelf{"nats": m}); got != "" {
t.Fatalf("a mesh seat was refused by the derived check: %s", got)
}