D1 (view): the provisioner's provisions are read at the holder of the seat mesh-provisioner

Builds: design 47 G A-318

Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
2026-11-12 23:15:02 +01:00
parent 81cb2d7ab8
commit 1ce48944c7
5 changed files with 18 additions and 9 deletions
@@ -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
@@ -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)
}
}
@@ -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"
+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -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",