From ef1ec1c93544f0fc12b2dca608167bf2af11a846 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 30 Oct 2026 18:26:23 +0100 Subject: [PATCH] Name mesh-config among the controller's lease readers (issue 774) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mesh-config reads mesh-controller.lease to take the config over only once the lease is handed away (ADR 0561 §3, its takeover.go leaseAway), and was refused it as a reader the composer does not name. --- go/buscompose/buscompose_test.go | 2 +- go/buscompose/userlist_switch.go | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/go/buscompose/buscompose_test.go b/go/buscompose/buscompose_test.go index d483eba..c936737 100644 --- a/go/buscompose/buscompose_test.go +++ b/go/buscompose/buscompose_test.go @@ -570,7 +570,7 @@ func TestTheCopiedComposerComposesAsTheControllers(t *testing.T) { reads[u.Module] = strings.Join(u.Reads, ",") } } - if reads[VaultSeat] != ControllerLease+","+GrantsAccounts || reads["mesh-config"] != "" || reads["restic"] != "" || reads["messenger"] != "" { + if reads[VaultSeat] != ControllerLease+","+GrantsAccounts || reads["mesh-config"] != ControllerLease || reads["restic"] != "" || reads["messenger"] != "" { t.Errorf("the reads granted for their readers: %v", reads) } // AccountsEntry is the very lines ComposeAccounts writes for a user, so a writer of kept users repeats none. diff --git a/go/buscompose/userlist_switch.go b/go/buscompose/userlist_switch.go index cbd7f98..fece755 100644 --- a/go/buscompose/userlist_switch.go +++ b/go/buscompose/userlist_switch.go @@ -84,6 +84,9 @@ const VaultBusAccounts = "mesh-vault.bus-accounts" // ArtifactStoreTools is the module holding the seat mesh-artifact-sweep (novox/hq ADR 0571 clause 2). const ArtifactStoreTools = "artifact-store-tools" +// ConfigModule is the module that holds the seat mesh-config, a reader of the controller's lease (NamedReaders). +const ConfigModule = "mesh-config" + // NamedReaders are the states only the modules named may read, by `.`: the grants part's wanted accounts // are read by the vault alone (novox/hq ADR 0561 §2). // The controller's lease is read by the parts that turn on at its write (ADR 0561 §3, §6), and by the assigner, which @@ -95,7 +98,9 @@ const ArtifactStoreTools = "artifact-store-tools" var NamedReaders = map[string][]string{VaultBusAccounts: {GrantsModule}, GrantsAccounts: {VaultSeat}, ControllerLease: {VaultSeat, GrantsModule, delivery.AssignerModule, health.KeeperModule, health.HealersModule, WatchmanModule, // ADR 0571 clause 2: the artifact store's seat sweeps only once the lease names no controller. - ArtifactStoreTools}, + ArtifactStoreTools, + // ADR 0561 §3: mesh-config takes over the config only once the lease is handed away (its takeover.go leaseAway). + ConfigModule}, ControllerConditions: {health.KeeperModule}, ControllerHandActs: {health.HealersModule, handacts.Module}, HealersWould: {}} // ReaderMay says whether module may read the state read (`.`) by the named readers: always, for a state