issue 1840/S1c: name declared-packages among the controller's readable states, so a manifest may read it

This commit is contained in:
2026-10-22 14:15:33 +02:00
parent c6e669f71e
commit 637c33b7f8
2 changed files with 11 additions and 2 deletions
+2 -2
View File
@@ -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
+9
View File
@@ -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) {