From 0062bdc4a6f2b656ac63a330032ac3323d72c8ce Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 28 Oct 2026 09:11:27 +0100 Subject: [PATCH] buscompose: the assigner may read the controller's lease, to choose where grants are read from (issue 774) --- go/buscompose/buscompose_test.go | 2 +- go/buscompose/userlist_switch.go | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/go/buscompose/buscompose_test.go b/go/buscompose/buscompose_test.go index c8f4c4a..fbb033f 100644 --- a/go/buscompose/buscompose_test.go +++ b/go/buscompose/buscompose_test.go @@ -439,7 +439,7 @@ func TestTheCopiedComposerComposesAsTheControllers(t *testing.T) { } } announced := map[string]announce.States{ControllerSeat: ControllerAnnouncement("novox")} - for reader, want := range map[string]bool{VaultSeat: true, GrantsModule: true, "mesh-delivery-view": false} { + for reader, want := range map[string]bool{VaultSeat: true, GrantsModule: true, AssignerModule: true, "mesh-delivery-view": false} { granted, _ := ReadsAnnouncedBy(reader, []string{ControllerLease}, announced) if (len(granted) == 1) != want { t.Errorf("%s reads the lease: %v, want %v", reader, granted, want) diff --git a/go/buscompose/userlist_switch.go b/go/buscompose/userlist_switch.go index 51b7e72..5829ff2 100644 --- a/go/buscompose/userlist_switch.go +++ b/go/buscompose/userlist_switch.go @@ -79,9 +79,13 @@ const VaultBusAccounts = "mesh-vault.bus-accounts" // 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 two parts that turn on at its write (ADR 0561 §3, §6). +// The controller's lease is read by the two parts that turn on at its write (ADR 0561 §3, §6) and by the assigner, which +// reads the grants from the grants part from then on (ADR 0547 §4, §5; delivery.GrantSource). var NamedReaders = map[string][]string{VaultBusAccounts: {GrantsModule}, GrantsAccounts: {VaultSeat}, - ControllerLease: {VaultSeat, GrantsModule}} + ControllerLease: {VaultSeat, GrantsModule, AssignerModule}} + +// AssignerModule is the assigner, which reads the lease to choose the source of the grants. +const AssignerModule = "mesh-delivery-assigner" // ReaderMay says whether module may read the state read (`.`) by the named readers: always, for a state // that names none.