diff --git a/modules/mesh-delivery-view/cmd/mesh-delivery-view-tools/main.go b/modules/mesh-delivery-view/cmd/mesh-delivery-view-tools/main.go index af40c021..980e9df3 100644 --- a/modules/mesh-delivery-view/cmd/mesh-delivery-view-tools/main.go +++ b/modules/mesh-delivery-view/cmd/mesh-delivery-view-tools/main.go @@ -482,7 +482,7 @@ func main() { r.PresenceState, r.StuckState = read(stdio.State(view.StatusPresenceState)), read(stdio.State(view.StatusStuckState)) r.Sources = view.SourcesOf(stdio.Ask, branches.Followed) r.Assignment, r.Difference = view.AssignmentOf(stdio.Ask), view.DifferenceOf(stdio.Ask) - r.ProvisionsState = read(stdio.State(view.ProvisionsRead)) + r.ProvisionsState = seatStateRead(holderOf(stdio.Ask), func(name string) view.StateRead { return read(stdio.State(name)) }, view.ProvisionsSeat, view.ProvisionsState) r.BuildLog = stdio.Log(builds.BuildLogRead).Since r.Pending = pendingOf(holderOf(stdio.Ask)) // The build modules are no names (design 47 G A-82): the build seats on the seat list, each held by the module the seat diff --git a/modules/mesh-delivery-view/cmd/mesh-delivery-view-tools/main_test.go b/modules/mesh-delivery-view/cmd/mesh-delivery-view-tools/main_test.go index f9839784..6e39ee98 100644 --- a/modules/mesh-delivery-view/cmd/mesh-delivery-view-tools/main_test.go +++ b/modules/mesh-delivery-view/cmd/mesh-delivery-view-tools/main_test.go @@ -675,4 +675,10 @@ func TestBuildSeatStatesAreReadInTheHoldersState(t *testing.T) { if _, err := signers.Get(view.SignersKeyKey); err != nil || !slices.Equal(named, []string{"acme-mesh-vault.signers"}) { t.Errorf("the signers read %v, %v; want acme-mesh-vault.signers", named, err) } + // So are the provisioner's provisions (A-318). + named = nil + provisions := seatStateRead(holder, read, view.ProvisionsSeat, view.ProvisionsState) + if _, err := provisions.Get("k"); err != nil || !slices.Equal(named, []string{"acme-mesh-provisioner.provisions"}) { + t.Errorf("the provisions read %v, %v; want acme-mesh-provisioner.provisions", named, err) + } } diff --git a/modules/mesh-delivery-view/internal/view/names.go b/modules/mesh-delivery-view/internal/view/names.go index 76a4a5b3..6cc46244 100644 --- a/modules/mesh-delivery-view/internal/view/names.go +++ b/modules/mesh-delivery-view/internal/view/names.go @@ -15,12 +15,15 @@ import ( // ADR 0625 §4, ADR 0634 §1). The indexer's module and its reads are the catalog client's. const ( IndexerModule = "mesh-delivery-indexer" - // ProvisionsRead is the seat mesh-provisioner's state provisions, as the manifest's `reads` names it. - ProvisionsRead = "mesh-provisioner.provisions" - WatchmanModule = "mesh-delivery-watchman" - GateModule = "mesh-delivery-gate" - TellerModule = "mesh-delivery-teller" - EngineModule = "node-engine" + // ProvisionsRead is the seat mesh-provisioner's state provisions as the manifest's `reads` names it (the seat form, resolved at + // the seat's holder, A-318). + ProvisionsSeat = "mesh-provisioner" + ProvisionsState = "provisions" + ProvisionsRead = "seat:" + ProvisionsSeat + "." + ProvisionsState + WatchmanModule = "mesh-delivery-watchman" + GateModule = "mesh-delivery-gate" + TellerModule = "mesh-delivery-teller" + EngineModule = "node-engine" // The indexer's states the view reads. CandidatesBucket = IndexerModule + "_candidates" diff --git a/modules/mesh-delivery-view/manifest_test.go b/modules/mesh-delivery-view/manifest_test.go index 62adbc25..b4eb7c03 100644 --- a/modules/mesh-delivery-view/manifest_test.go +++ b/modules/mesh-delivery-view/manifest_test.go @@ -153,7 +153,7 @@ func TestManifestIsTakenAndReadsOnly(t *testing.T) { // 1134/AC7 if m.Module != "mesh-delivery-view" { t.Errorf("module = %q", m.Module) } - want := []string{"mesh-conditions.conditions", "mesh-config.resolved", "mesh-delivery-builder.build-log", "mesh-delivery-builder.builds", "mesh-delivery-checker.tries", "mesh-delivery-watchman.presence", "mesh-delivery-watchman.stuck", "mesh-healers.attempts", "mesh-provisioner.provisions", "node-engine.have", "seat:mesh-vault.signers", "seat:node-build-go.pauses", "seat:node-build-go.steps", "seat:node-build-image.pauses", "seat:node-build-image.steps", "seat:node-build-node.pauses", "seat:node-build-node.steps"} // the build seats' states by seat, never a build module (design 47 G A-82); no read of the gate's source: each watched branch's is its verb source's (§512, A-173); // no reads of the indexer's or the assigner's states (ADR 0615 §1, DLV-M4); view_tiers reads the module graph and the provisioner's keys (ADR 0603 §6); view_status reads the keeper's conditions and the healers' attempts (1952/V1); build_usage reads the build modules' steps and pauses, mesh-config's capacities and the checker's tries; 1168/AC1, 1241/AC4, 1345/AC3, 1297/B8, B9 + want := []string{"mesh-conditions.conditions", "mesh-config.resolved", "mesh-delivery-builder.build-log", "mesh-delivery-builder.builds", "mesh-delivery-checker.tries", "mesh-delivery-watchman.presence", "mesh-delivery-watchman.stuck", "mesh-healers.attempts", "node-engine.have", "seat:mesh-provisioner.provisions", "seat:mesh-vault.signers", "seat:node-build-go.pauses", "seat:node-build-go.steps", "seat:node-build-image.pauses", "seat:node-build-image.steps", "seat:node-build-node.pauses", "seat:node-build-node.steps"} // the build seats' states by seat, never a build module (design 47 G A-82); no read of the gate's source: each watched branch's is its verb source's (§512, A-173); // no reads of the indexer's or the assigner's states (ADR 0615 §1, DLV-M4); view_tiers reads the module graph and the provisioner's keys (ADR 0603 §6); view_status reads the keeper's conditions and the healers' attempts (1952/V1); build_usage reads the build modules' steps and pauses, mesh-config's capacities and the checker's tries; 1168/AC1, 1241/AC4, 1345/AC3, 1297/B8, B9 got := slices.Clone(m.Reads) slices.Sort(got) if !reflect.DeepEqual(got, want) { diff --git a/modules/mesh-delivery-view/module.json b/modules/mesh-delivery-view/module.json index 88b8cd0f..853ffb0f 100644 --- a/modules/mesh-delivery-view/module.json +++ b/modules/mesh-delivery-view/module.json @@ -133,7 +133,7 @@ "mesh-delivery-checker.tries", "mesh-conditions.conditions", "mesh-healers.attempts", - "mesh-provisioner.provisions", + "seat:mesh-provisioner.provisions", "mesh-delivery-watchman.presence", "mesh-delivery-watchman.stuck", "seat:mesh-vault.signers",