fix9-3: the indexer judge's process-bus rule accepts serves, read whole by the grant composition

Builds: design 47 G A-107, A-109, A-110
This commit is contained in:
2026-11-12 01:00:31 +01:00
parent 6d94262f8c
commit 1e2091fcba
@@ -2457,11 +2457,11 @@ func caseAProcessBusNamesOnlyTheModulesOwn(t *testing.T) {
}
}
// 1179/AC4: a bus declaring serves, holds, claims or a seat is refused naming the key; a bus with invokes of
// a tool or a seat verb is accepted.
// 1179/AC4, changed by design 47 G A-107, A-109, A-110: a bus declaring holds, claims or a seat is refused naming the
// key; a bus declaring serves (the seat verbs the process answers, each seat:<seat>.<verb>) is accepted and given whole to
// the grant composition, as is a bus with invokes of a tool or a seat verb.
func caseAProcessBusNeverServesOrHoldsASeat(t *testing.T) {
for name, c := range map[string]struct{ bus, says string }{
"serves": {`{"emits":["mail.send.sent"],"serves":["send"]}`, "serves"},
"holds": {`{"emits":["mail.send.sent"],"holds":["mail-sender"]}`, "holds"},
"claims": {`{"emits":["mail.send.sent"],"claims":["mail-sender"]}`, "claims"},
"seat": {`{"emits":["mail.send.sent"],"seat":"mail-sender"}`, "seat"},
@@ -2475,6 +2475,14 @@ func caseAProcessBusNeverServesOrHoldsASeat(t *testing.T) {
if _, err := ParseManifest([]byte(mailSenderProcessManifest(t, accepted))); err != nil {
t.Fatalf("a bus invoking a tool and a seat verb was refused: %v", err)
}
serving := `{"emits":["mail.send.sent"],"serves":["seat:mail-sender.send"]}`
m, err := ParseManifest([]byte(mailSenderProcessManifest(t, serving)))
if err != nil {
t.Fatalf("a bus serving a seat verb was refused: %v", err)
}
if got := m.ProcessBuses()["send"].Serves; !strSliceEqual(got, []string{"seat:mail-sender.send"}) {
t.Fatalf("the process's serves read as %v", got)
}
}
// 1179/AC1: a well-formed bus on a process whose account the module makes is accepted, and the catalogue