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:
2026-11-04 13:31:16 +01:00
parent 7faa4a1b20
commit a410447ff5
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -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)})
}
+2
View File
@@ -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`},