SD-M1: a holder's event kept in its own stream is refused under its module's subjects
A family on a holder's event names the holder's own stream, so its subject is mesh.stream.<holder>.event.<event>; operator-channel's offered and closed said the router's stream but mesh.mod subjects. Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
This commit is contained in:
@@ -397,6 +397,8 @@ func (d Definition) check() Problems {
|
||||
ps = append(ps, Problem{where + ".subject", "missing"})
|
||||
case e.Subject == stream && e.Family == "":
|
||||
ps = append(ps, Problem{where + ".subject", "a subject of the holder's own stream, and no family names that stream"})
|
||||
case e.Subject == own && e.Family != "":
|
||||
ps = append(ps, Problem{where + ".subject", "a family names the holder's own stream, so the event is under " + stream})
|
||||
case e.Subject != own && e.Subject != stream:
|
||||
ps = append(ps, Problem{where + ".subject", fmt.Sprintf("not %s, nor %s for an event kept in the holder's own stream", own, stream)})
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@ func TestADefinitionIsReadStrictlyNamingWhatIsWrong(t *testing.T) {
|
||||
`"subject":"mesh.stream.<holder>.event.verdict","family":"checker.asks"}],"family":`, 1), ""},
|
||||
{"a holder's event on its own stream with no family", strings.Replace(whole, `"family":`, `"holder-events":[{"name":"verdict",`+
|
||||
`"subject":"mesh.stream.<holder>.event.verdict"}],"family":`, 1), "no family names that stream"},
|
||||
{"a holder's event kept in its own stream under its module's subjects", strings.Replace(whole, `"family":`, `"holder-events":[{"name":"verdict",`+
|
||||
`"subject":"mesh.mod.<holder>.event.verdict","family":"checker.asks"}],"family":`, 1), "a family names the holder's own stream"},
|
||||
{"a holder's event on a subject of no module", strings.Replace(whole, `"family":`, `"holder-events":[{"name":"verdict",`+
|
||||
`"subject":"mesh.event.verdict"}],"family":`, 1), "holder-events[0].subject: not mesh.mod.<holder>.event.verdict"},
|
||||
{"a verb twice", strings.Replace(listGrain, `]}`, `,{"name":"add"}]}`, 1), `"add" twice`},
|
||||
|
||||
Reference in New Issue
Block a user