G A-13, A-17: the writer hears findings-asked on the seat mesh-conditions' subject, forms only its three own subjects
Builds: design 47 G A-13, A-17, §387, §390 Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
+8
-4
@@ -116,12 +116,16 @@ type WriterSubjects struct {
|
||||
Written, Cleared, Stated, Asked string
|
||||
}
|
||||
|
||||
// FindingSubjects are the subjects of the four events of the module's findings on node, in §383's form
|
||||
// `mesh.stream.<module>.event.<event>.<node>` (design 47 G A-13, §461, §439, §383). The writer forms them itself; a
|
||||
// module passes none.
|
||||
// FindingsAskedSubject is the subject the writer hears an ask for findings on: the seat mesh-conditions' event
|
||||
// `findings-asked` (design 47 G §387, §390, A-17), never a stream of the part's own.
|
||||
const FindingsAskedSubject = "mesh.seat.mesh-conditions.event.findings-asked"
|
||||
|
||||
// FindingSubjects are the subjects of the module's three own events on node, in §383's form
|
||||
// `mesh.stream.<module>.event.<event>.<node>` (design 47 G A-13, §461, §439, §383), and the seat's subject of the ask it hears
|
||||
// (FindingsAskedSubject). The writer forms them itself; a module passes none.
|
||||
func FindingSubjects(module, node string) WriterSubjects {
|
||||
of := func(event string) string { return "mesh.stream." + module + ".event." + event + "." + node }
|
||||
return WriterSubjects{Written: of("finding-written"), Cleared: of("finding-cleared"), Stated: of("findings-stated"), Asked: of("findings-asked")}
|
||||
return WriterSubjects{Written: of("finding-written"), Cleared: of("finding-cleared"), Stated: of("findings-stated"), Asked: FindingsAskedSubject}
|
||||
}
|
||||
|
||||
// WriterConfig makes a Writer.
|
||||
|
||||
@@ -81,7 +81,7 @@ var subjects = views.FindingSubjects("m", "n1")
|
||||
func TestFindingSubjectsAreTheEventsStreamForm(t *testing.T) {
|
||||
want := views.WriterSubjects{
|
||||
Written: "mesh.stream.m.event.finding-written.n1", Cleared: "mesh.stream.m.event.finding-cleared.n1",
|
||||
Stated: "mesh.stream.m.event.findings-stated.n1", Asked: "mesh.stream.m.event.findings-asked.n1",
|
||||
Stated: "mesh.stream.m.event.findings-stated.n1", Asked: "mesh.seat.mesh-conditions.event.findings-asked",
|
||||
}
|
||||
if subjects != want {
|
||||
t.Fatalf("the subjects: %+v, want %+v", subjects, want)
|
||||
|
||||
Reference in New Issue
Block a user