Multiplayer agent harness for work.
Remove Metrics and Retention tabs from admin (#1362)
Regan Bellb799439565f8
diff --git a/docs/screenshots/admin-tabs/after.png b/docs/screenshots/admin-tabs/after.pngnew file mode 100644index 000000000..0109b4d97Binary files /dev/null and b/docs/screenshots/admin-tabs/after.png differdiff --git a/docs/screenshots/admin-tabs/before.png b/docs/screenshots/admin-tabs/before.pngnew file mode 100644index 000000000..383fc83dbBinary files /dev/null and b/docs/screenshots/admin-tabs/before.png differdiff --git a/plugins/admin/README.md b/plugins/admin/README.mdindex 13473dc1f..67bb0b1a2 100644--- a/plugins/admin/README.md+++ b/plugins/admin/README.md@@ -9,9 +9,9 @@ You reach it through the **portal** (real SSO); the surface trusts the portal-sy`admin=<sub>` cookie as identity and asks the **core** whether that principal is an admin(`GET /api/whoami` → core `GET /v1/admin/whoami` → `canAdminister`). It holds **no admin id list**of its own. Pick a scope, then either **edit governance** (command policy, SOUL, egress),-**manage users** (the org-wide **Users** tab), or read the **observability** views — Metrics,-History, Files, Live, Errors, Audit, Skills, Crons, Deployments, Volumes, Retention.-The **Users** tab (org-wide, org_admin-only, like Retention) lists everyone who has+**manage users** (the org-wide **Users** tab), or read the **observability** views —+History, Files, Live, Errors, Audit, Skills, Crons, Deployments, Volumes.+The **Users** tab (org-wide, org_admin-only) lists everyone who hasused the agent (from session metadata — no content) with admin status joined, plus theauthoritative grant list, and lets an org_admin **promote** a principal to org_adminor **revoke** — every mutation attributed and audited, the last org_admin protected.@@ -25,16 +25,11 @@ expired; a day after expiry, **Remove** drops the row. An address that already borg member (the org's email domain, the Slack directory, the sign-in allow-list, or anyone whohas used the agent) cannot be invited.(`org_admin` is the only supported role for now; `team_admin` was removed — team-scoped admin-observability is future work. See `src/admin/admin-service.ts`.) Metrics-shows TTFT + turn/queue/execution-latency-percentiles, throughput, and a daily TTFT trend. History (conversation listing with a+observability is future work. See `src/admin/admin-service.ts`.) History (conversation listing with aby-type usage rollup, drilling into transcripts with per-turn model-context breakdowns), Files(workspace contents), and Live (ongoing/recent runs) are **top-down content** views: anorg-scope query spans the whole org; a narrower scope is limited to that scope. Everyaction is authorized in the core and audited.-**Retention** is org-wide (no scope picker): DAU/WAU/MAU, new-vs-returning, weekly retention cohorts,-stickiness, and per-user distributions — derived from session/participant metadata only-(channel attribution is approximate, since entries carry no author principal).## Rundiff --git a/plugins/admin/public/index.html b/plugins/admin/public/index.htmlindex 7148da539..322c62536 100644--- a/plugins/admin/public/index.html+++ b/plugins/admin/public/index.html@@ -7804,17 +7804,16 @@},{label: "Logs",- views: ["history", "slack", "judgments", "errors", "audit", "egress", "metrics"],+ views: ["history", "slack", "judgments", "errors", "audit", "egress"],},{label: "Artifacts",- views: ["files", "skills", "memory", "deployments", "crons", "retention"],+ views: ["files", "skills", "memory", "deployments", "crons"],},{ views: ["design-system"] },];const VIEWS = [...SECTIONS.flatMap((s) => s.views), "onboarding", "user", "ackemoji", "keychain"];- const DISABLED_VIEWS = new Set(["retention"]);function paritySubsection(card) {card.classList.remove("card", "sv-governance", "sv-models", "sv-credentials", "sv-customize");card.classList.add("parity-subsection");@@ -8638,10 +8637,7 @@b.type = "button";b.appendChild(document.createTextNode(VIEW_TITLE[v] || v[0].toUpperCase() + v.slice(1)));if (v === view) b.setAttribute("aria-current", "page");- if (DISABLED_VIEWS.has(v)) {- b.disabled = true;- b.title = "Coming back soon";- } else b.onclick = () => setView(v);+ b.onclick = () => setView(v);if (v === "judgments" && view === "ackemoji") {b.classList.add("active");@@ -11530,7 +11526,7 @@designSpec("Choose a page pattern","Live references · preserve the selected organization",- '<div class="design-page-links"><a data-design-view="governance">Governance / Models</a><p>Descriptions beside settings, 40px column gap; stack on small screens. Keep Apply right-aligned with status on its left.</p><a data-design-view="skills">Skills</a><p>Open installed-skill and skill-pack sections; compact tables and an inline registration form.</p><a data-design-view="files">Files</a><p>Search in the header, flat upload toolbar, then scopes or files with metadata.</p><a data-design-view="history">Sessions</a><p>Two-way sort toggle, named environments, and a separately titled conversation list.</p><a data-design-view="metrics">Metrics</a><p>Quiet summary metrics followed by ruled report sections.</p><a data-design-view="audit">Audit</a> · <a data-design-view="egress">Egress</a><p>Filters above plain tables; headers stay transparent and regular-weight.</p></div>',+ '<div class="design-page-links"><a data-design-view="governance">Governance / Models</a><p>Descriptions beside settings, 40px column gap; stack on small screens. Keep Apply right-aligned with status on its left.</p><a data-design-view="skills">Skills</a><p>Open installed-skill and skill-pack sections; compact tables and an inline registration form.</p><a data-design-view="files">Files</a><p>Search in the header, flat upload toolbar, then scopes or files with metadata.</p><a data-design-view="history">Sessions</a><p>Two-way sort toggle, named environments, and a separately titled conversation list.</p><a data-design-view="audit">Audit</a> · <a data-design-view="egress">Egress</a><p>Filters above plain tables; headers stay transparent and regular-weight.</p></div>',true,),designSpec(diff --git a/plugins/admin/test/default-view.test.ts b/plugins/admin/test/default-view.test.tsindex 1a930f51e..2e47fbab0 100644--- a/plugins/admin/test/default-view.test.ts+++ b/plugins/admin/test/default-view.test.ts@@ -52,8 +52,8 @@ test("admin shell groups control, logs, and artifacts like the reorganization",const actual = JSON.parse(JSON.stringify(vm.runInNewContext(sections)));assert.deepEqual(actual, [{ views: ["governance", "models", "credentials", "connectors", "customize", "users"] },- { label: "Logs", views: ["history", "slack", "judgments", "errors", "audit", "egress", "metrics"] },- { label: "Artifacts", views: ["files", "skills", "memory", "deployments", "crons", "retention"] },+ { label: "Logs", views: ["history", "slack", "judgments", "errors", "audit", "egress"] },+ { label: "Artifacts", views: ["files", "skills", "memory", "deployments", "crons"] },{ views: ["design-system"] },]);assert.match(html, /history: "Sessions"/);diff --git a/plugins/admin/test/history-urls.test.ts b/plugins/admin/test/history-urls.test.tsindex 0a3389921..3a378292b 100644--- a/plugins/admin/test/history-urls.test.ts+++ b/plugins/admin/test/history-urls.test.ts@@ -225,7 +225,7 @@ for (const base of ["", "/admin", "/control"]) {}));assert.deepEqual(links.map((link) => link.dataset.designView),- ["governance", "skills", "files", "history", "metrics", "audit", "egress"],+ ["governance", "skills", "files", "history", "audit", "egress"],);const bindStart = html.indexOf(' root.querySelectorAll(".design-page-links a")');const bindEnd = html.indexOf(" });", bindStart) + " });".length;@@ -243,7 +243,6 @@ for (const base of ["", "/admin", "/control"]) {`${base}/skills?scope=${SCOPE_ENC}`,`${base}/files?scope=${SCOPE_ENC}`,`${base}/history/scopes/${SCOPE_ENC}`,- `${base}/metrics?scope=${SCOPE_ENC}`,`${base}/audit?scope=${SCOPE_ENC}`,`${base}/egress?scope=${SCOPE_ENC}`,],diff --git a/plugins/admin/test/onboarding-view.test.ts b/plugins/admin/test/onboarding-view.test.tsindex e09fd59a6..b40ec9343 100644--- a/plugins/admin/test/onboarding-view.test.ts+++ b/plugins/admin/test/onboarding-view.test.ts@@ -14,7 +14,7 @@ function slice(from: string, to: string): string {function resolveView(pathname: string, search: string): string {const src = [- slice("const SECTIONS = [", "const DISABLED_VIEWS"),+ slice("const SECTIONS = [", "function paritySubsection"),slice("const DEFAULT_VIEW = ", ";") + ";",slice("function decodePathSegment(seg) {", "let transcriptObserver"),"urlToState().view;",