diff --git a/docs/features/dashboard.md b/docs/features/dashboard.md index 6f82c8688b..a89547c4d3 100644 --- a/docs/features/dashboard.md +++ b/docs/features/dashboard.md @@ -97,6 +97,18 @@ The left rail groups pages into Memory, Activity and Sources. Every page has its | **Repositories** | `/repositories` | Indexed code repositories, each with Health, Explore, PR packs and Access tabs, and the org's trackers; a branch's admin re-indexes it after one of its commits. An opened repository lists its documents and their sources, each with its last sync; a source's name opens its settings, sync state and the documents it wrote (`knowledge.source.inspect`), and a caller with the role the [sources table](knowledge.md#document-sources) names adds, checks, syncs, rotates and retires a source there. See [code index](code-index/overview.md) and [tracker](tracker/overview.md). | | **Settings** | `/settings` | **Tokens** (one form for every token: what it reads, where it saves, its expiry; the setup for each MCP client or a script; the list, with what each token reads); **Memory** (`?tab=memory`: patterns never to save, each with a sweep of the memories it already matches, seeding memory from a document, and the webhooks that receive its memory changes and their deliveries); **Structure** (`?tab=structure`, on a memory namespace: the record schemas, each one's records and disagreements with the record each disagreement superseded, the profile schema, the graph ontology and the categories; an admin registers and approves schemas, sets or clears the profile schema and accepts and adds ontology terms, a writer adds categories); and **Models & keys** for a platform admin. | +In the Memory group, **Review queue** (`/admin/review_queue`) is a stable rail entry for +every caller who may view review work on a memory namespace (any role that reaches +`conflicts.list` or `memory.proposals`, both viewer-level), so Review stays reachable when +its queue is empty or a count fails — the phone's More sheet lists the same entry. Its badge +counts review items waiting for a person, open conflicts plus pending proposals, read as +bounded server-side counts (`count_only`, no row bodies, uncapped by any page size), labeled +per kind for screen readers; when only proposals wait, the entry links straight to the +Proposals tab (`?tab=proposals`). Inside the queue, the Conflicts and Proposals tabs carry +their own counts, and a proposal-only queue opens on Proposals. A count whose read fails is +shown as unknown — never as zero. The same URL also resolves as an admin-drawer entry that +appears on its own while something waits. + Three views are reached from elsewhere rather than the rail: **Namespaces in your org** (`/spaces`, the namespaces you manage and the org's public namespaces to join, with each one's [guide](namespaces-and-sharing.md#a-namespaces-guide) summary, and the guide itself for @@ -435,25 +447,27 @@ Admins of the current namespace get a drawer with the Review and Observe groups; platform admins also get Access, and platform admins Deployment. A viewer never sees an entry that would answer 403. -| Group | Page | URL | What it is for | -| ------- | ---------------- | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Review | **Review queue** | `/admin/review_queue` | Conflicts (pairs of memories that disagree, each with a suggested decision on request, except a sensitive one), learnings proposed for promotion, memories Loom retired on its own (Auto-resolved, each with an Undo), exceptions (the allowlist of pairs that may coexist), proposals (facts on trial, accepted or rejected), and duplicate memories and documents with the namespace-wide repairs. Shown in the drawer only while a conflict waits or Loom retired a memory in the last 30 days; the URL always resolves. See [conflicts and refusal](memory/conflicts-and-refusal.md). | -| Review | **Guardrails** | `/admin/guardrails` | Blacklist patterns: content Loom should never store, each with a sweep that deletes the stored memories it already matches; for an org admin, the org's and the namespace's extraction rules and the org's model-call switch. | -| Review | **Policies** | `/admin/policies` | History policy rules, a dry run of a hypothetical call, and the decision ledger. | -| Observe | **Health** | `/admin/health` | Worker status and how agents in the namespace spend their calls; the namespace's memory report, search gates and recent extractions; an admin's repairs (apply expiry, re-embed, remove an extractor's facts, roll back, snapshot and restore); an org admin's projection failures, retried or dismissed. | -| Observe | **Audit log** | `/admin/activity` | The audit feed, one readable line per event; the Erasures tab lists erasures with each one's details and, by role, erases or exports one namespace or one user; the Exposure tab shows which readers read the namespace's memories and one user's owner report. | -| Observe | **Flow** | `/flow` | Read-only: where memories flow — writes and recalls, cross-namespace reach, producer and consumer agents, memberships; collections and repositories are listed apart from the namespaces. | -| Observe | **Usage** | `/admin/usage` | LLM and embedding cost by day, operation, agent or user, the namespace's daily cap, and on **Coding agents** the coding agents' own model spend. | -| Observe | **Agents** | `/admin/agents` | Which clients connected in a window (`agents.connected`); confirms a new MCP connection works. A namespace admin can forget every memory one agent holds there. | -| Access | **Users** | `/admin/users` | Org and platform admins only: every subject, their grants (namespaces, collections and repositories) and roles, last activity, and releasing a namespace whose owner lost their password. | - -Badges draw attention without a rail entry: the Review queue appears with its conflict -count, or with no count when there is no open conflict but Loom retired a memory on its -own in the last 30 days (the Auto-resolved tab), Usage warns when the namespace is over +| Group | Page | URL | What it is for | +| ------- | ---------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Review | **Review queue** | `/admin/review_queue` | Conflicts (pairs of memories that disagree, each with a suggested decision on request, except a sensitive one), learnings proposed for promotion, memories Loom retired on its own (Auto-resolved, each with an Undo), exceptions (the allowlist of pairs that may coexist), proposals (facts on trial, accepted or rejected), and duplicate memories and documents with the namespace-wide repairs. Also a stable rail entry in the Memory group for anyone who may view review work; in the drawer it additionally appears on its own while a review item waits or Loom retired a memory in the last 30 days. The URL always resolves, and `?tab=` names the category to open. See [conflicts and refusal](memory/conflicts-and-refusal.md). | +| Review | **Guardrails** | `/admin/guardrails` | Blacklist patterns: content Loom should never store, each with a sweep that deletes the stored memories it already matches; for an org admin, the org's and the namespace's extraction rules and the org's model-call switch. | +| Review | **Policies** | `/admin/policies` | History policy rules, a dry run of a hypothetical call, and the decision ledger. | +| Observe | **Health** | `/admin/health` | Worker status and how agents in the namespace spend their calls; the namespace's memory report, search gates and recent extractions; an admin's repairs (apply expiry, re-embed, remove an extractor's facts, roll back, snapshot and restore); an org admin's projection failures, retried or dismissed. | +| Observe | **Audit log** | `/admin/activity` | The audit feed, one readable line per event; the Erasures tab lists erasures with each one's details and, by role, erases or exports one namespace or one user; the Exposure tab shows which readers read the namespace's memories and one user's owner report. | +| Observe | **Flow** | `/flow` | Read-only: where memories flow — writes and recalls, cross-namespace reach, producer and consumer agents, memberships; collections and repositories are listed apart from the namespaces. | +| Observe | **Usage** | `/admin/usage` | LLM and embedding cost by day, operation, agent or user, the namespace's daily cap, and on **Coding agents** the coding agents' own model spend. | +| Observe | **Agents** | `/admin/agents` | Which clients connected in a window (`agents.connected`); confirms a new MCP connection works. A namespace admin can forget every memory one agent holds there. | +| Access | **Users** | `/admin/users` | Org and platform admins only: every subject, their grants (namespaces, collections and repositories) and roles, last activity, and releasing a namespace whose owner lost their password. | + +Badges draw attention on their entries: the Review queue appears with its review-item +count — open conflicts plus pending proposals, a partial count labeled "at least" — or +with no count when nothing waits but Loom retired a memory on its own in the last 30 days +(the Auto-resolved tab), Usage warns when the namespace is over its 24-hour cap, Agents counts clients new in the last 24 hours. The header carries a task bell (triage and blocked-on-person items) and a pending-approvals bell (grant requests the -person can decide). The phone's More sheet lists the same admin entries with the same badges; a -badge whose read fails is hidden. +person can decide). The phone's More sheet lists the same entries with the same badges; a +badge whose read fails is hidden, and a remembered badge answer is cached per org, +namespace, principal and role, so it never crosses an account or permission boundary. ## Operations the dashboard uses diff --git a/docs/reference/operations/memory.md b/docs/reference/operations/memory.md index 97e81689b2..eeb860a237 100644 --- a/docs/reference/operations/memory.md +++ b/docs/reference/operations/memory.md @@ -1564,11 +1564,12 @@ List facts on trial (written with memory.set proposed=true) with the graded runs | `tags` | `list[str]` | *(computed)* | Only proposals carrying any of these tags; empty = no tag filter. | | `only` | `Literal['', 'ready']` | `''` | `ready` keeps only proposals the policy thresholds would decide now (accept or reject); "" lists every proposal. | | `limit` | `int` | `50` | At most this many proposals returned, newest first. | +| `count_only` | `bool` | `False` | A badge or a tab count needs the number, not the rows. | | Output field | Type | Meaning | | --- | --- | --- | | `proposals` | `list[MemoryProposal]` | The proposals in scope, newest first, with graded counts and `ready`. | -| `total` | `int` | Proposals in scope before `only` and `limit`. | +| `total` | `int` | Proposals in scope before `only` and `limit` — on a listing, capped by the scan cap; on a `count_only` call, the full uncapped in-scope count. | | `policy` | `ProposalPolicy` | The namespace's proposal policy: `mode` (manual / auto) and thresholds. | ## `memory.provenance` diff --git a/frontend/e2e/navigation.spec.ts b/frontend/e2e/navigation.spec.ts index 506b1418b2..93abd4eaa2 100644 --- a/frontend/e2e/navigation.spec.ts +++ b/frontend/e2e/navigation.spec.ts @@ -30,7 +30,9 @@ test("the collapsed rail reads the review-queue and agents counts in the link na await page.route("**/v1/conflicts.list", (r) => r.fulfill({ json: { rows: [], total: 3 } })); await page.route("**/v1/agents.connected", (r) => r.fulfill({ json: { new_count: 2 } })); await page.goto("/memories"); - await expect(page.getByRole("link", { name: "Review queue, 3" })).toBeVisible(); + // The rail shows the Review queue twice — its stable Memory entry and the admin entry + // when items wait — so the count is read from the first of them. + await expect(page.getByRole("link", { name: "Review queue, 3" }).first()).toBeVisible(); await expect(page.getByRole("link", { name: "Agents, 2" })).toBeVisible(); }); diff --git a/frontend/e2e/route-budget.spec.ts b/frontend/e2e/route-budget.spec.ts index 5f76ca21af..c93df4d9b7 100644 --- a/frontend/e2e/route-budget.spec.ts +++ b/frontend/e2e/route-budget.spec.ts @@ -11,10 +11,11 @@ test.beforeAll(({ browser }, testInfo) => warmUp(browser, testInfo)); const LCP_BUDGET_MS = 2000; const LONG_TASK_BUDGET_MS = 1500; -// Every route reads at most 12 times, the sidebar's Auto-resolved audit.list included -// (Settings, Conversations, Tasks, Review queue and Usage). The budget is that ceiling -// plus one read of headroom, so a second new read on any route fails here. -const CALL_BUDGET = 13; +// Every route reads at most 13 times, the sidebar's Auto-resolved audit.list and pending +// proposal count included (Settings, Conversations, Tasks, Review queue and Usage). The +// budget is that ceiling plus one read of headroom, so a second new read on any route +// fails here. +const CALL_BUDGET = 14; const ROUTES: Array<[string, string]> = [ ["Memories", "/memories"], diff --git a/frontend/e2e/shell-layout.spec.ts b/frontend/e2e/shell-layout.spec.ts index 64fefb54bd..3fbc4b938b 100644 --- a/frontend/e2e/shell-layout.spec.ts +++ b/frontend/e2e/shell-layout.spec.ts @@ -27,7 +27,12 @@ for (const width of [1400, 375]) { const current = page.locator( "main [aria-current='page'], main [role='tab'][aria-selected='true'], main [aria-label='Show the documents of']", ); - const tab = (await current.count()) > 0 ? (await current.first().textContent())?.trim() : undefined; + // A tab that carries a count reads "Conflicts (2)"; the document title names the + // tab without the count, so the expected title strips it. + const tab = + (await current.count()) > 0 + ? (await current.first().textContent())?.trim().replace(/\s*\(\d+\)$/, "") + : undefined; await expect(page).toHaveTitle(tab && tab !== h1 ? `${tab} · ${h1} · Loom` : `${h1} · Loom`); // Click UI draws an icon, a badge and an ellipsis as a
.
const blocksInText = await page.evaluate(() =>
diff --git a/frontend/src/App.boot.test.tsx b/frontend/src/App.boot.test.tsx
index 51294a7a53..bcc49c11fb 100644
--- a/frontend/src/App.boot.test.tsx
+++ b/frontend/src/App.boot.test.tsx
@@ -596,7 +596,10 @@ describe("a link's namespace", () => {
expect(calls.some((c) => c.body?.namespace === "group-b-shared")).toBe(false);
expect(
calls.filter((c) => c.path.startsWith("memory.")).map((c) => ({ path: c.path, namespace: c.body?.namespace })),
- ).toEqual([{ path: "memory.auto_retirements", namespace: NS }]);
+ ).toEqual([
+ { path: "memory.proposals", namespace: NS },
+ { path: "memory.auto_retirements", namespace: NS },
+ ]);
expect(localStorage.getItem("loom_namespace_v1")).toBe(NS);
expect(savedDefault()).toBe(false);
// Continue: the page the link asked for, on the namespace the picker shows.
@@ -642,7 +645,10 @@ describe("a link's namespace", () => {
expect(calls.some((c) => c.body?.namespace === "joined")).toBe(false);
expect(
calls.filter((c) => c.path.startsWith("memory.")).map((c) => ({ path: c.path, namespace: c.body?.namespace })),
- ).toEqual([{ path: "memory.auto_retirements", namespace: NS }]);
+ ).toEqual([
+ { path: "memory.proposals", namespace: NS },
+ { path: "memory.auto_retirements", namespace: NS },
+ ]);
});
it("when the membership read fails, a reload still opens the saved pick: the server answers its reads", async () => {
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index f72cb6ce7c..18442e2ea3 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -48,8 +48,6 @@ import { Sidebar } from "./layout/Sidebar";
import { Header } from "./layout/Header";
import { MobileNav } from "./layout/MobileNav";
import { ToastViewport, toast, toastError } from "./components/Toast";
-import { ConfirmViewport } from "./components/ConfirmDialog";
-import { PendingRequestBanner } from "./components/PendingRequestBanner";
import {
assistantAddress,
assistantPopstate,
@@ -116,6 +114,13 @@ const ProfileSectionDialog = lazy(() =>
);
const TokenGate = lazy(() => import("./flows/TokenGate").then((m) => ({ default: m.TokenGate })));
const LinkTokenConfirm = lazy(() => import("./flows/TokenGate").then((m) => ({ default: m.LinkTokenConfirm })));
+// The confirm dialog and the pending-request banner open on demand, not at boot, so their
+// chunks load on the first open, not with the shell (keeps the index chunk inside its
+// bundle budget).
+const ConfirmViewport = lazy(() => import("./components/ConfirmDialog").then((m) => ({ default: m.ConfirmViewport })));
+const PendingRequestBanner = lazy(() =>
+ import("./components/PendingRequestBanner").then((m) => ({ default: m.PendingRequestBanner })),
+);
// The expired-session card's chunk is fetched as the app loads, from the build that served
// it: it shows on a long-lived tab, the one most likely to predate a deploy, and a chunk
// first asked for then would be gone and its stale-chunk reload would lose the page.
@@ -580,7 +585,9 @@ export default function App() {