Files
Maven/cmd/mavweb/ecosystem.html
T
kami 5aaecd2a53 store: give ecosystem traces their own table
Traces were written as facts. A single Praxis action wrote several of
them, so machine-rate rows crowded out the bounded fact readers that
humans and evaluation consume. The habit profile window of 2000 facts
and the memeval snapshot both filled with call records instead of what
Maven learned about the owner. Traces now go to ecosystem_traces, with
correlation, causation, duration and HTTP status as columns, pruned to
the most recent 5000. The new reader is exposed over IPC and rendered
as the Calls card on the ecosystem page, so it is a table someone
actually looks at.

Found in review of #84.
2026-08-01 14:13:58 +04:00

68 lines
3.1 KiB
HTML

{{template "shellTop" "ecosystem"}}
<h1>Ecosystem</h1>
<p class=hint>The sibling services Maven coordinates — read-only. Identity, attention, capabilities. Enabling &amp; execution live on the authed surfaces, never here.</p>
<section class=card id=eco-nexus>
<div class=section-header>
<h2>Nexus <span class=card-sub>identity</span></h2>
</div>
{{with .Nexus}}
{{if .Err}}<div class=empty>nexus — {{.Err}}</div>
{{else if not .Rows}}<div class=empty>no entities yet.</div>
{{else}}<div class=scroll><table class=mono><tr><th>id<th>type<th>name<th>state<th>updated</tr>
{{range .Rows}}<tr><td class=key>{{.ID}}<td><span class=badge>{{.Type}}</span><td class=en>{{.DisplayName}}<td>{{.State}}<td>{{ago .UpdatedAt}}</tr>{{end}}
</table></div>{{end}}
{{end}}
</section>
<section class=card id=eco-praxis>
<div class=section-header>
<h2>Praxis <span class=card-sub>attention</span></h2>
</div>
{{with .Praxis}}
{{if .Err}}<div class=empty>praxis — {{.Err}}</div>
{{else if not .Rows}}<div class=empty>nothing needs attention.</div>
{{else}}<div class=scroll><table class=mono><tr><th>imp<th>kind<th>title<th>state<th>last seen</tr>
{{range .Rows}}<tr><td>{{.Importance}}<td><span class=badge>{{.Kind}}</span><td class=en>{{.Title}}<td>{{.State}}<td>{{ago .LastSeenAt}}</tr>{{end}}
</table></div>{{end}}
{{end}}
</section>
<section class=card id=eco-hexis>
<div class=section-header>
<h2>Hexis <span class=card-sub>capabilities</span></h2>
</div>
{{with .Hexis}}
{{if .Err}}<div class=empty>hexis — {{.Err}}</div>
{{else if not .Rows}}<div class=empty>no capabilities registered.</div>
{{else}}<div class=scroll><table class=mono><tr><th>id<th>name<th>provider<th>operation<th>risk<th>access</tr>
{{range .Rows}}<tr><td class=key>{{.ID}}<td class=en>{{.Name}}<td><span class=badge>{{.Provider}}</span><td>{{.Operation}}<td>{{.Risk}}<td>{{if .ReadOnly}}<span class="badge badge-ok">read-only</span>{{else}}<span class="badge badge-warn">mutating</span>{{end}}</tr>{{end}}
</table></div>{{end}}
{{end}}
</section>
<section class=card id=eco-calls>
<div class=section-header>
<h2>Calls <span class=card-sub>what Maven asked them</span></h2>
</div>
{{with .Calls}}
{{if .Err}}<div class=empty>calls — {{.Err}}</div>
{{else if not .Rows}}<div class=empty>no ecosystem calls yet.</div>
{{else}}<div class=scroll><table class=mono><tr><th>when<th>service<th>operation<th>status<th>ms<th>http<th>correlation</tr>
{{range .Rows}}<tr><td>{{ago .Ts}}<td><span class=badge>{{.Service}}</span><td class=en>{{.Operation}}<td>{{if eq .Status "ok"}}<span class="badge badge-ok">ok</span>{{else}}<span class="badge badge-warn">{{.Status}}</span>{{end}}<td>{{.DurationMs}}<td>{{if .HTTPStatus}}{{.HTTPStatus}}{{else}}—{{end}}<td class=key>{{.CorrelationID}}</tr>{{end}}
</table></div>{{end}}
{{end}}
</section>
{{template "shellBottom"}}
<script>
setInterval(() => fetch('/ecosystem').then(r => r.text()).then(html => {
const d = new DOMParser().parseFromString(html, 'text/html');
for (const id of ['eco-nexus', 'eco-praxis', 'eco-hexis', 'eco-calls']) {
const old = document.getElementById(id), nu = d.getElementById(id);
if (old && nu) old.replaceWith(nu);
}
}), 15000);
</script>
</html>