Files
noema/web/templates/pages/mind.html
T
Andy Dixon 73e5753a91 feat: add beliefs with evidence-derived confidence, contradictions and corrections
Phase 6. Beliefs are propositions with a prior set by epistemic kind and a
confidence computed from typed evidence: sigmoid(logit(prior) + slope ×
(support × diversity − opposition)), where support from a single source
is discounted so repetition cannot manufacture certainty, and bounds keep
the mind away from absolute certainty. Every evaluation stores its
breakdown and appends a version row protected by the append-only
trigger; the belief page shows the arithmetic, evidence for and against,
alternatives, contradictions and history.

Contradiction detection is deterministic first (negation plus token
overlap): a hit emits contradiction_detected, links both beliefs and
makes each counter-evidence for the other so both trend to contested.
Operators can assert beliefs (their statement is the evidence), add
evidence, mark a belief wrong (pinned rejected, history kept) and forbid
an inference; do-not-infer corrections block matching hypotheses.
Retracting a memory retracts the evidence that cited it and re-evaluates
the beliefs concerned.

The associate process proposes low-confidence causal hypotheses from
co-occurring notable observations, and the hypothesis handler turns
admitted ones into beliefs with automatic alternatives, closing demo
scenarios 1 and 2 without any model call.
2026-06-21 22:14:12 +01:00

100 lines
6.3 KiB
HTML

{{define "content"}}
{{$m := .Data.Mind}}
<div class="pagehead mindhead">
<div><h1>{{$m.DisplayName}} <span class="muted mono small">{{$m.Slug}}</span></h1>
<p class="muted">{{$m.Personality.Identity.Role}}{{with $m.Personality.Identity.Description}} · {{.}}{{end}}</p></div>
<div class="row">{{template "status_badge" $m.Status}}</div>
</div>
{{template "mind_tabs" (dict "M" $m "Active" "overview")}}
<section class="grid cols-3">
<div class="card">
<h2>Identity</h2>
<dl class="kv">
<dt>Name</dt><dd>{{$m.Personality.Identity.Name}}</dd>
<dt>Role</dt><dd>{{$m.Personality.Identity.Role}}</dd>
{{with $m.Personality.Identity.Pronouns}}<dt>Pronouns</dt><dd>{{.}}</dd>{{end}}
<dt>Created</dt><dd>{{date $m.CreatedAt}}</dd>
<dt>Personality</dt><dd>v{{$m.PersonalityVersion}} {{if $m.TemplateID}}<span class="badge accent">templated</span>{{end}} · <a href="/minds/{{$m.Slug}}/personality">edit</a></dd>
{{if $m.ClonedFromMind}}<dt>Cloned from</dt><dd class="mono small">{{$m.ClonedFromMind}}</dd>{{end}}
{{with $m.Notes}}<dt>Notes</dt><dd>{{.}}</dd>{{end}}
</dl>
</div>
<div class="card">
<h2>Recent activity</h2>
{{$st := .Data.Stats}}
<div class="stat-value small">{{$st.Total}} <span class="muted small">events in 24h</span></div>
<div class="cats small">{{range $k, $v := $st.ByCategory}}<span class="etype cat-{{$k}}">{{$k}} {{$v}}</span> {{end}}</div>
<p class="small"><a href="/minds/{{$m.Slug}}/thoughts">Open thought stream</a> · <a href="/minds/{{$m.Slug}}/memory">{{.Data.MemStats.Total}} memories</a>{{range $k, $v := .Data.MemStats.ByKind}} <span class="badge k-{{$k}}">{{$k}} {{$v}}</span>{{end}}</p>
{{if .Principal.User.Role.AtLeast "operator"}}
<form method="post" action="/minds/{{$m.Slug}}/observe" class="stack" style="margin-top:.75rem">
<input type="hidden" name="_csrf" value="{{.CSRF}}">
<label>Inject observation <span class="muted small">as operator</span> <textarea name="text" rows="2" maxlength="20000" placeholder="e.g. server-01 reported SMART CRC errors at 09:12" required></textarea></label>
<div><button class="btn small" type="submit">Observe</button></div>
</form>{{end}}
</div>
<div class="card">
<h2>Cognitive configuration</h2>
<dl class="kv">
<dt>Workspace capacity</dt><dd>{{$m.Config.WorkspaceCapacity}}</dd>
<dt>Working memory</dt><dd>{{$m.Config.WorkingMemoryCapacity}} items · decay {{$m.Config.WorkingMemoryDecay}}</dd>
<dt>Cycle interval</dt><dd>{{$m.Config.CycleMinInterval}} min · {{$m.Config.IdleCycleInterval}} idle · max {{$m.Config.MaxCyclesPerMinute}}/min</dd>
<dt>LLM per cycle</dt><dd>{{$m.Config.LLMCallsPerCycle}} calls · {{$m.Config.DailyTokenBudget}} tokens/day</dd>
</dl>
</div>
</section>
<section class="grid cols-2">
<div class="card">
<h2>Important beliefs <span class="muted small"><a href="/minds/{{$m.Slug}}/beliefs">{{.Data.BeliefStats.Total}} total</a></span></h2>
{{if .Data.Beliefs}}<table class="table compact"><tbody>{{range .Data.Beliefs}}<tr><td><span class="badge st-{{.Status}}">{{.Status}}</span></td><td><a href="/minds/{{$m.Slug}}/beliefs/{{.ID}}">{{.Proposition}}</a></td><td class="num"><span class="conf"><span class="conf-bar"><i style="width:{{pct .Confidence}}"></i></span> {{conf .Confidence}}</span></td></tr>{{end}}</tbody></table>
{{else}}<p class="muted small">No beliefs yet.</p>{{end}}
</div>
</section>
<section class="grid cols-2">
<div class="card">
<h2>Personality brief <span class="muted small">what cognitive prompts receive</span></h2>
<pre class="brief">{{.Data.Brief}}</pre>
</div>
<div class="card">
<h2>Self-model</h2>
{{$sm := .Data.SelfModel}}
<h3>Capabilities</h3>
{{if $sm.Capabilities}}<ul class="plain">{{range $sm.Capabilities}}<li><code>{{.Name}}</code> <span class="badge {{if eq .Policy "allow"}}ok{{else if eq .Policy "ask"}}warn{{else}}danger{{end}}">{{.Policy}}</span> <span class="muted small">{{.Description}}</span></li>{{end}}</ul>
{{else}}<p class="muted small">No capabilities granted. This mind cannot act on external systems.</p>{{end}}
<h3>Known limitations</h3>
<ul class="small">{{range $sm.Limitations}}<li>{{.}}</li>{{end}}</ul>
{{if $sm.KnowledgeGaps}}<h3>Knowledge gaps</h3><ul class="small">{{range $sm.KnowledgeGaps}}<li>{{.}}</li>{{end}}</ul>{{end}}
<p class="muted small">Updated {{ago $sm.UpdatedAt}}</p>
</div>
</section>
{{if .Principal.User.Role.AtLeast "administrator"}}
<section class="grid cols-2">
<div class="card">
<h2>Lifecycle</h2>
<form method="post" action="/minds/{{$m.Slug}}/status" class="row">
<input type="hidden" name="_csrf" value="{{.CSRF}}">
{{if ne $m.Status "active"}}<button class="btn" name="status" value="active">Enable</button>{{end}}
{{if eq $m.Status "active"}}<button class="btn" name="status" value="disabled" data-confirm="Disable {{$m.DisplayName}}? Cognition stops; history is kept.">Disable</button>{{end}}
{{if ne $m.Status "archived"}}<button class="btn btn-danger" name="status" value="archived" data-confirm="Archive {{$m.DisplayName}}? It is hidden from lists but nothing is deleted.">Archive</button>{{end}}
</form>
<p class="muted small">Cognitive history is never hard-deleted by these actions.</p>
<form method="post" action="/minds/{{$m.Slug}}/notes" class="stack">
<input type="hidden" name="_csrf" value="{{.CSRF}}">
<label>Operator notes <textarea name="notes" rows="2">{{$m.Notes}}</textarea></label>
<div><button class="btn small" type="submit">Save notes</button></div>
</form>
</div>
<div class="card">
<h2>Clone</h2>
<p class="muted small">Same personality and configuration, fresh experience. Forking with memories arrives with snapshots.</p>
<form method="post" action="/minds/{{$m.Slug}}/clone" class="stack">
<input type="hidden" name="_csrf" value="{{.CSRF}}">
<label>New slug <input name="slug" required pattern="[a-z0-9][a-z0-9-]{0,62}" placeholder="{{$m.Slug}}-experiment"></label>
<label>Display name <input name="display_name"></label>
<div><button class="btn" type="submit">Clone</button></div>
</form>
</div>
</section>
{{end}}
{{end}}
{{define "status_badge"}}{{if eq . "active"}}<span class="badge ok">active</span>{{else if eq . "disabled"}}<span class="badge warn">disabled</span>{{else}}<span class="badge">archived</span>{{end}}{{end}}