{{define "content"}} {{$m := .Data.Mind}}{{$c := $m.Config}}

{{$m.DisplayName}} dreaming

An optional idle mode: replay a deterministic sample of memories, link pairs that share vocabulary but were never connected, and propose speculative hypotheses. Every hypothesis starts at low confidence and waits here for review. Dreams run in a context where no capability can execute.

{{if .Data.Paused}}dreaming paused globally{{end}}{{if not $c.DreamingEnabled}}disabled for this mind{{end}}
{{template "mind_tabs" (dict "M" $m "Active" "dreams")}}

Proposed hypotheses {{len .Data.Pending}} awaiting review

{{if .Data.Pending}} {{range .Data.Pending}}{{end}}
PropositionConf.BasisDreamt
{{.Proposition}}
{{range .MemoryIDs}}memory {{end}}ยท {{.Wording}} wording
{{conf .Confidence}}{{trunc .Basis 120}}{{ago .CreatedAt}} {{if $.Principal.User.Role.AtLeast "operator"}}
{{end}}
{{else}}

Nothing awaiting review.

{{end}}

Dreams

{{if .Principal.User.Role.AtLeast "operator"}}
{{if .Principal.User.Role.AtLeast "administrator"}}{{end}}
{{end}} {{if .Data.Dreams}} {{range .Data.Dreams}}{{end}}
WhenStatusTriggerSampledLinksHypothesesModel calls
{{ago .CreatedAt}}{{.Status}}{{with .Error}} {{.}}{{end}}{{.Trigger}} {{.CreatedBy}}{{.Sampled}}{{.Associations}}{{.Hypotheses}}{{.LLMCalls}}
{{else}}

No dreams yet.

{{end}}
{{if .Data.Reviewed}}

Reviewed

{{range .Data.Reviewed}}{{end}}
{{.Status}}{{trunc .Proposition 110}}{{conf .Confidence}}{{.ReviewedBy}}{{with .ReviewNote}}: {{.}}{{end}}
{{end}}

Settings

{{if .Principal.User.Role.AtLeast "administrator"}}
{{else}}
Enabled
{{$c.DreamingEnabled}}
Hours
{{or $c.DreamHours "any"}}
Interval
{{$c.DreamInterval}}
Model calls
{{$c.DreamLLMCalls}}
Memories
{{$c.DreamMaxMemories}}
{{end}}

Scheduled dreams need all of: enabled, inside the hours window, interval elapsed, not paused. "Dream now" ignores the hours window but never the pause.

{{end}}