diff --git a/go/catalogue/state.go b/go/catalogue/state.go index 87e402f..a6b183b 100644 --- a/go/catalogue/state.go +++ b/go/catalogue/state.go @@ -134,8 +134,8 @@ func StateProblems(m Manifest) []string { // second way and granted to the module's own principal as well. Named here so a read of one is a read of // kept state. The bus's list is broker.ControllerMirrors; a test keeps the two agreeing. // plans-building is the plans in their build phase, read by the checker to hold checks while a delivery builds (ADR 0483 -// clause 2, issue 1687). -var ControllerMirrors = []string{"assignments", "declared-config", "predefined", "builds", "rollouts", "checks-running", "plans-building"} +// clause 2, issue 1687). declared-packages is the packages a node's declaration names (ADR 0507, issue 1840/S1c). +var ControllerMirrors = []string{"assignments", "declared-config", "predefined", "builds", "rollouts", "checks-running", "plans-building", "declared-packages"} // StateReadsNothingDeclares is every read across a catalogue whose owner is present and declares no // such state. An absent owner says nothing — a module may be installed long before the one whose diff --git a/go/catalogue/state_test.go b/go/catalogue/state_test.go index 475ea2e..bae68b9 100644 --- a/go/catalogue/state_test.go +++ b/go/catalogue/state_test.go @@ -92,6 +92,15 @@ func TestAReadOfThePlansBuildingIsAReadOfKeptState(t *testing.T) { } } +// A module may read `mesh-controller.declared-packages` (issue 1840/S1c, ADR 0507): the packages a node's declaration names. +func TestAReadOfTheDeclaredPackagesIsAReadOfKeptState(t *testing.T) { + controller := Manifest{Module: ControllerSeatName} + reader := Manifest{Module: "some-reader", Reads: []string{"mesh-controller.declared-packages"}} + if p := StateReadsNothingDeclares([]Manifest{controller, reader}); len(p) != 0 { + t.Fatalf("a read of the controller's declared-packages was refused: %v", p) + } +} + // **Across the whole catalogue**: every state name is local, and every read whose owner is present // names state that owner keeps. func TestEveryManifestsStateIsLocalAndEveryReadIsKept(t *testing.T) {