fix9-serves-3: the indexer validator's process-bus test follows A-127 (serves beside bus accepted, inside bus refused)
Builds: design 47 G A-115, A-127 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -2457,8 +2457,8 @@ func caseAProcessBusNamesOnlyTheModulesOwn(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
// 1179/AC4, changed by design 47 G A-115, A-127: a bus declaring holds, claims, a seat or serves is refused naming the
|
||||
// key; a process's own serves (the seat verbs it answers, each seat:<seat>.<verb>) beside its bus is accepted and given 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 }{
|
||||
@@ -2475,12 +2475,18 @@ 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)
|
||||
// Design 47 G A-115, A-127: serves is a field of the process beside its bus, read there and refused inside the bus.
|
||||
inside := `{"emits":["mail.send.sent"],"serves":["seat:mail-sender.send"]}`
|
||||
if _, err := ParseManifest([]byte(mailSenderProcessManifest(t, inside))); err == nil || !strings.Contains(err.Error(), "serves") {
|
||||
t.Errorf("a serves inside bus: %v; want a refusal naming serves", err)
|
||||
}
|
||||
if got := m.ProcessBuses()["send"].Serves; !strSliceEqual(got, []string{"seat:mail-sender.send"}) {
|
||||
beside := strings.Replace(mailSenderProcessManifest(t, `{"emits":["mail.send.sent"]}`),
|
||||
`"user":"mesh-mail-send"`, `"user":"mesh-mail-send","serves":["seat:mail-sender.send"]`, 1)
|
||||
m, err := ParseManifest([]byte(beside))
|
||||
if err != nil {
|
||||
t.Fatalf("a process serving a seat verb beside its bus was refused: %v", err)
|
||||
}
|
||||
if got := m.ProcessServes()["send"]; !strSliceEqual(got, []string{"seat:mail-sender.send"}) {
|
||||
t.Fatalf("the process's serves read as %v", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user