diff --git a/go/views/writer.go b/go/views/writer.go index 5e40157e..fe1b9a60 100644 --- a/go/views/writer.go +++ b/go/views/writer.go @@ -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..event..` (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..event..` (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. diff --git a/go/views/writer_test.go b/go/views/writer_test.go index 5889e15a..f071d22e 100644 --- a/go/views/writer_test.go +++ b/go/views/writer_test.go @@ -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)