JUDGE: the module tests that read a manifest follow the manifests' new forms (version 0.1, findings in requires, the foundation's old sections)

sudo and localization expect version 0.1; distribution and gitea read the old objects and state sections; mesh-build-go, mesh-knowledge, mesh-provisioner and mesh-self-check expect the findings asked in requires and the keeper's ask consumed. Each assertion failed against the changed manifest before it was changed.

Builds: design 47 G §368, §529, §584, A-30

Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
2026-11-11 23:00:47 +01:00
parent d4e29a07b2
commit e4c5108306
9 changed files with 50 additions and 25 deletions
@@ -916,19 +916,34 @@ func TestTheHolderOfTheTwoImageSeats(t *testing.T) {
// Running review F2: incoming asks the bus 8 GiB, the most the objects template allows, equal to IncomingCap
// (said only where no binding is read); transfers keeps for good, the holder dropping an idle one by its key
// in idle, a state of keys with their own time to live.
// The image registry is a foundation part (design 47 G §584): its bus state is in its old sections, incoming in
// `objects`, the others in `state`.
var req struct {
Requires []struct {
Name string `json:"name"`
Options map[string]any `json:"options"`
} `json:"requires"`
Objects []struct {
Name string `json:"name"`
MaxMiB uint64 `json:"max-mib"`
} `json:"objects"`
State []json.RawMessage `json:"state"`
}
_ = json.Unmarshal(raw, &req)
opts := map[string]map[string]any{}
for _, r := range req.Requires {
opts[r.Name] = r.Options
for _, e := range req.State {
var o map[string]any
if json.Unmarshal(e, &o) != nil {
var name string
_ = json.Unmarshal(e, &name)
o = map[string]any{"name": name}
}
opts[fmt.Sprint(o["name"])] = o
}
if mib, _ := opts[IncomingObjects]["max-mib"].(float64); uint64(mib)<<20 != IncomingCap {
t.Errorf("incoming asks %v MiB, IncomingCap is %d bytes: want them equal", opts[IncomingObjects]["max-mib"], uint64(IncomingCap))
var incoming uint64
for _, o := range req.Objects {
if o.Name == IncomingObjects {
incoming = o.MaxMiB
}
}
if incoming<<20 != IncomingCap {
t.Errorf("incoming asks %v MiB, IncomingCap is %d bytes: want them equal", incoming, uint64(IncomingCap))
}
if _, ok := opts[TransfersState]["ttl-seconds"]; ok {
t.Errorf("transfers has a lifetime %v: the bus would drop a transfer's key and leave its parts", opts[TransfersState])