A1: the enrolment reads the node-engine's have in its module form

Builds: design 47 G A-318, A-210
This commit is contained in:
2026-11-12 23:28:19 +01:00
parent 1ce48944c7
commit b707508d1e
4 changed files with 9 additions and 12 deletions
@@ -94,8 +94,8 @@ func (p memPictures) Keys(state string) ([]string, error) {
func (p memPictures) Get(state, key string) ([]byte, bool, error) { return memRead(p).Get(state, key) }
// A read in the seat form `seat:<seat>.<state>` is a read of the state of the module the seat list names as the seat's holder
// (design 47 G A-210, A-128): the vault's signers and the node-engine's have are asked of the modules that hold their seats, whatever
// those are called, and a state named otherwise is read as it is.
// (design 47 G A-210, A-128): the vault's signers are asked of the modules that hold their seats, whatever
// those are called, and a state named otherwise (the node-engine's have among them, which keeps its module form) is read as it is.
func aSeatsStateIsReadAtItsHolder(t *testing.T) {
call := func(key string, _ any) (json.RawMessage, error) {
if key != seatlist.HolderKey() {
@@ -103,12 +103,9 @@ func aSeatsStateIsReadAtItsHolder(t *testing.T) {
}
return json.RawMessage(`{"seats":[{"seat":"mesh-vault","holders":[{"module":"another-vault"}]},{"seat":"node-engine","holders":[]}]}`), nil
}
for state, want := range map[string]string{signersRead: "another-vault.signers", "mesh-config.resolved": "mesh-config.resolved"} {
for state, want := range map[string]string{signersRead: "another-vault.signers", haveRead: "node-engine.have", "mesh-config.resolved": "mesh-config.resolved"} {
if got, err := resolveState(call, state); err != nil || got != want {
t.Errorf("%s is read as %q, %v; want %q", state, got, err, want)
}
}
if got, err := resolveState(call, haveRead); err == nil {
t.Errorf("%s with no holder is read as %q, want an error naming the seat", haveRead, got)
}
}
@@ -112,9 +112,9 @@ type busReader struct {
js jetstream.JetStream
}
// bedHolders is the seat list of the bed: the vault and the node-engine each held by the module of the seat's name.
// bedHolders is the seat list of the bed: the vault held by the module of its name and the node-engine by mesh-host.
func bedHolders(string, any) (json.RawMessage, error) {
return json.RawMessage(`{"seats":[{"seat":"mesh-vault","holders":[{"module":"mesh-vault"}]},{"seat":"node-engine","holders":[{"module":"node-engine"}]}]}`), nil
return json.RawMessage(`{"seats":[{"seat":"mesh-vault","holders":[{"module":"mesh-vault"}]},{"seat":"node-engine","holders":[{"module":"mesh-host"}]}]}`), nil
}
func (r busReader) bucket(state string) (jetstream.KeyValue, error) {
@@ -15,11 +15,11 @@ const (
// (design 47 G A-296), never named here.
enrolmentsState = meshnodeenroller.StateEnrolments
// signersRead is the seat mesh-vault's state signers as the enrolment's manifest reads it (`seat:<seat>.<state>`, resolved at
// the seat's holder when it is read, design 47 G A-210, A-128), signersKey the key holding its signing key; haveRead is the
// seat node-engine's state have the same way.
// the seat's holder when it is read, design 47 G A-210, A-128), signersKey the key holding its signing key; haveRead the node-engine's state have,
// which keeps its module form (A-318).
signersRead = "seat:" + mv.Seat + ".signers"
signersKey = "key"
haveRead = "seat:node-engine.have"
haveRead = "node-engine.have"
// assignmentsState is the assigner's state assignments, which the enrolment reads (reads: through its first view).
assignmentsState = "assignments"
)
+1 -1
View File
@@ -40,7 +40,7 @@
"reads": [
"mesh-grants.user-list",
"seat:mesh-vault.signers",
"seat:node-engine.have"
"node-engine.have"
],
"state": [
{