diff --git a/cmd/cyrene/wire.go b/cmd/cyrene/wire.go index 6878d3c..60f934f 100644 --- a/cmd/cyrene/wire.go +++ b/cmd/cyrene/wire.go @@ -323,7 +323,12 @@ func (a *app) wireRuntime() error { flowPub := loop.NewFlowPublisher( func(subject string, payload any) { _ = a.bus.Publish(context.Background(), subject, payload) }, func(sessionID string) bool { - return sessionID == history.MainSessionID || strings.HasPrefix(sessionID, history.MainSessionID+":") + // Publish the web/main flow graph (web chat + IM owner-private mirror) AND the + // autonomous-backthink session, so the backthink page's flow link graph renders + // too (design/20 ยง2). Other isolated channel sessions (sess-xxx) stay filtered. + return sessionID == history.MainSessionID || + strings.HasPrefix(sessionID, history.MainSessionID+":") || + sessionID == backthink.DefaultSessionID }, ) checkpoint, perr := persist.New(context.Background(), a.db, a.log) diff --git a/internal/services/backthink/backthink.go b/internal/services/backthink/backthink.go index 705018b..a2b1185 100644 --- a/internal/services/backthink/backthink.go +++ b/internal/services/backthink/backthink.go @@ -64,6 +64,11 @@ const ( defaultSessionID = "sess-backthink" ) +// DefaultSessionID is the exported loop.Run session key for an autonomous think. It is +// exposed so the flow-viz publisher (cmd/cyrene) can also publish the backthink flow +// graph, which the backthink page and the web-chat flow page both render. +const DefaultSessionID = "sess-backthink" + // Sentinel errors returned by this package. Use errors.Is to test for them; they // are returned directly or wrapped with %w so the underlying cause stays intact. var (