grants: a module's own account sends the chunks of a verb of a seat it holds (A-115)

The validation of mesh-delivery #219 failed twice: the indexer answered seat:mesh-catalog.input, and the bus refused
its chunks, since only an account whose process repeats the verb in serves was granted to send them. The indexer's
and the assigner's programs answer their seat's input verb on the module's own account; their claims say they serve it.
This commit is contained in:
2026-11-15 22:40:36 +01:00
parent 2682a623de
commit 7c33a2cf4c
2 changed files with 14 additions and 1 deletions
@@ -1428,6 +1428,7 @@ func chunkSubjectsFollowTheAnswerer(t *testing.T) {
{Module: "recovery", Invokes: []string{"seat:mesh-broker.snapshot-get"}, Processes: []ProcessPrincipal{{Process: "recover", Invokes: []string{"seat:mesh-broker.snapshot-get"}}}},
{Module: "admin-ish", Invokes: []string{"*"}},
{Module: "plain-serve", ServesOwn: []string{"seat:mesh-broker.snapshot-get"}},
{Module: "claim-only", Holds: []Seat{{Name: meshbroker.Seat, Serves: []string{"snapshot-get"}}}},
{Module: "mod-x", Streams: []ModuleStream{{Module: "mod-x", Name: "SECRETS", Events: []string{"sealed"}, Restricted: true},
{Module: "mod-x", Name: "PLAIN", Events: []string{"plain"}}}},
}}}
@@ -1456,6 +1457,10 @@ func chunkSubjectsFollowTheAnswerer(t *testing.T) {
!has(m.Publish, chunks) || !has(m.Subscribe, servedAcks) {
t.Errorf("the module account of a bus-less serving process may not answer the verb and send chunks: %v / %v", m.Publish, m.Subscribe)
}
// A module holding the seat sends the chunks of its verb on its own account, though no process repeats it in `serves`.
if m := perms["a.claim-only"]; !has(m.Publish, chunks) || !has(m.Subscribe, servedAcks) {
t.Errorf("the module account holding the seat may not send its verb's chunks: %v / %v", m.Publish, m.Subscribe)
}
if rec := perms["a.recovery"]; !has(rec.Subscribe, chunks) || !has(rec.Publish, acks) || has(rec.Publish, chunks) {
t.Errorf("the account naming the verb may not hear chunks and send acks, or may send chunks: %v / %v", rec.Publish, rec.Subscribe)
}