Skip to content

The dashboard's Assistant page inspects a namespace and reviews its tune drafts - #226

Merged
zlareb1 merged 5 commits into
mainfrom
feat/i160-dashboard
Nov 3, 2026
Merged

zlareb1 merged 5 commits into
mainfrom
feat/i160-dashboard

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Related: #160

Changelog category (leave one):

  • New Feature

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

The dashboard has an Assistant page (/assistant). On it a namespace viewer can see what the namespace holds and who appears in it, inspect what one user, agent or session remembers, open the entity graph from an entity, and review the drafts namespace.tune makes. Every read is deterministic and read-only, and nothing is applied from the page.

Why

Issue 160 asks for an entry screen with:

  • an explicit scope selector;
  • five conversation starters in Loom's own terms;
  • a Review changes panel listing pending proposals and their approval state.

The page must work with models disabled. The server side already exists as three VIEWER, read-only ops that call no model: namespace.inventory, memory.inspect and namespace.tune. This page is the dashboard's surface over them, so the CLI, MCP clients and the page read one shape.

How each starter maps:

Starter What the page does
Show relationships between facts Opens the existing Graph explorer on an entity (openGraphAt), which already applies the reader's authorization to every endpoint and source fact; Back returns focus to the starter
What is in this project? namespace.inventory: live count and newest write per plane, a section that was not counted says why, and whether a model and an embedder serve the deployment; under a token pinned to one user (the answer's scope) the panel says memories, runs and the observed identities are counted for that user only, and documents and members are the namespace's. A token scoped own_session, or own_user with no read_user_id, needs a session or user id the page does not send, so the inventory starters are unavailable to it and say why
Analyze one user's memories Selects the User subject and focuses its id field; Inspect (or Enter) runs memory.inspect and shows the subject's own rows apart from every other live row of the namespace, headed as the server defines them (filed under a user by any writer, written by an agent, written in a session by any user), plus what creates them (guide revision, categories, the operator policy as written, "none set", or why it is not shown)
Who are the users in this project? The same inventory read: members (grant holders) apart from the agents, authors and subjects observed on live rows
Configure this project namespace.tune; its drafts fill Review changes

The Review changes panel shows each draft as "Draft, not approved", with:

  • its target and scope;
  • the rationale;
  • current against proposed, with the current revision;
  • the evidence: finding codes, supporting count, the counter count in the server's terms (for extraction instructions at least that many unflagged rows it must keep working for, for a category the tagged rows another category already holds), and the cited rows, each opening in the inspector under its whole writer identity, as a listed row of an inspection does;
  • the affected agents;
  • the future-only effect and what happens to stored rows;
  • the op, role, guard and arguments that would apply it. For the extraction-instructions draft, which no single call applies, the panel says that each writer adds the arguments to its own memory.set_from_messages requests.

Apply is not in this release, so its button is shown as unavailable, with the reason. What the op skipped is listed under Skipped with the reason: a failed read (which may leave a shown draft without its cited rows or counts) or evidence that ruled a draft out. With no drafts, the panel says the evidence supports no change only when that list is empty.

Scope and risk

  • A row the page opens in the inspector (a listed or cited row) is read under its writer's agent, user and session: inspect(key, { agent, userId, sessionId }) stores the user and session as inspectedOwner (kept in the Back place), and App spreads them into the inspector's identity (Identity gains optional user_id / session_id). memory.get, the inspector's edits, its History, Related and Provenance reads (which now spread the identity, so the user and session go out exactly when set), Copy to (from_agent / from_user_id / from_session_id), a followed rename (the row moved), and its late-restore guard then all address that row, not the newest row with the key or the caller's own. Lineage is read by key alone on the server, so it is sent no user. A redirect's target (which may be a deduplicated row's canonical, another writer's), related rows, entity mentions and provenance links name rows whose writers the drawer does not know, so they open as before (MemoryInspector.rename.test.tsx covers both sides); returning each hit's writer identity is a follow-up. The Memories list and the header search still pass the agent alone, as before.
  • A row's version is a nanosecond stamp past what a JavaScript number holds exactly, so the page never prints it: an inspected row shows its version count, a cited row its key.
  • The page reads only on a click. On mount it makes no request, so the route stays within the per-route call budget.
  • Every read goes through canCall on its own op. All three are VIEWER, so a canCall refusal means the caller's role on the namespace is not known: no request is made, and the starters say so. A token pinned to one user or session is refused memory.inspect and namespace.tune by the server (neither is a scoped op); the page knows such a scope from the token's claims (views/assistant/tokenScope.ts reads read_scope, and a trimmed read_user_id alone as own_user, as the server does, over tokenPayload, which claimsFromToken now shares; the parsing stays out of the shell's index chunk), or, for an end-user token or behind a proxy, from the inventory's answer, and then Inspect and Configure are unavailable and say why.
  • A capped list says it is capped: a population shows its largest identities only, a view its top 20 tags.
  • An answer for a namespace the page has left is dropped, and an open starter panel closes on a namespace switch. A newer read aborts the older one; a read aborted by leaving the namespace stops being busy, so coming back shows no endless loader. Each starter reads again on a click; reading again keeps the last answer on screen, marked busy, with the time it was read.
  • The page never writes and holds no approval state of its own. Approving a draft is left to the Apply workflow the issue defers.
  • The scope is the header's namespace, from the caller's own namespaces; the subject (user, agent, session) only filters inside it, and the server enforces both.
  • The Assistant rail entry sits in the Memory group. The page is a memory view (MEMORY_VIEWS), so it never mounts on a code or tracker namespace.
  • assistant joins PAGE_SEGMENTS, so the server serves the page at /assistant.

Compatibility, rollout and rollback

  • Wire: none. The page calls existing ops.
  • Operator steps: none.
  • Rollback: reverting removes the page. Nothing is stored.
  • The reach census (scripts/codegen/op_reach_census.py) now skips a test kept beside its source (*.test.*), as it already skipped tests/ directories: a fixture naming an op is not reach. The regenerated manifest records that the dashboard source names memory.inspect, namespace.inventory and namespace.tune, and drops memory.ask's plugin_hook, which only dashboard tests named (its SDK reach stays).
  • The memory-key button the usage audit drew moves to components/ui/KeyButton, now Click UI's Link as an action, and is shared by the audit and the page. Agents are AgentBadges; authors and subjects are NameBadge, the same capped badge (180 px, the whole name in a tooltip) without the agent display names, split out of AgentBadge.

Tests

  • npm --prefix frontend run test: 1,751 passed. npm --prefix frontend run budget: the index chunk is 119.9 kB of its 120 kB (118.6 kB on main). src/views/Assistant.test.tsx covers:
    • nothing is read on mount, and axe passes on the empty page;
    • the inventory renders, and a section that was not counted says so; members say when they are incomplete; each starter click reads again; a failed read says so; the panel closes on a namespace switch;
    • a view that lists fewer rows than it counts says "Newest N of M listed", a section the server could not read (a view's counts, listing, tags or categories, the guide, the categories, the calls or the ledger's retention; each named in skipped) says so instead of showing its default, and the activity line states its window with the ledger's retention caveat beside it;
    • Inspect needs an id, submits on Enter, sends the subject and id, heads the user, agent and session views as the server defines them, and the inspection is dropped on a namespace switch; a failed read says so;
    • a draft shows its diff, evidence, apply op and arguments, and Apply is unavailable and does nothing; the extraction-instructions draft says each writer sends it; axe passes with drafts shown; a failed read says so;
    • a re-run keeps the drafts on screen, marked busy;
    • a draft answering after a namespace switch is dropped;
    • an unknown role makes no read.
  • npm --prefix frontend run build and npm --prefix frontend run budget: OK.
  • e2e/assistant.spec.ts draws every panel (each starter panel in turn: the inventory, the populations with a 205-character subject, the relationships field; an inspection of a 205-character user id with the server's full definitions and a multi-line operator policy, a category draft with a long tag) at 1400 and 375 px, Back from the graph, and the memory.get a listed and a cited row send (agent, user and session): no element runs past the box that clips or scrolls it, and axe finds no violation. Moving a view's definition back into the heading's no-wrap caption fails it at 375 px.
  • Playwright: the full e2e suite passes, including axe on every route at desktop and phone width, the route budget, shell layout and focus rings, with /assistant added to the route lists.
  • make lint: passes, after regenerating the reach census.
  • make test-unit on the rebased head: 25,991 passed. The full Playwright suite: 502 passed.
  • Python unit tests over dashboard routes, web exposure, public copy, doc links and the reach census pass; test_a_test_beside_its_source_is_not_reach covers the census change.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Claude Code. Every claim above was checked against the server models and the tests.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • make format-check, make lint, make typecheck and make test-unit pass; the integration suite passes if server behaviour changed.
  • Generated files are regenerated in this PR, not by hand: the SDK op tables, docs/reference/configuration.md and the docs/reference/ tables (python scripts/codegen/docs_reference.py), the reach manifest, schemas/schema.sql (make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).
  • A new migration is additive and numbered after the latest on main; no merged migration is edited.
  • A behaviour change to any file a plugin ships (hooks/, lib/, bin/, skills/, .mcp.json, the Codex plugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.
  • The frontend builds (npm --prefix frontend run build) and its tests pass, if frontend/ changed.
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers; the history goes in this description (tests/unit/test_public_copy.py).
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.

🤖 Generated with Claude Code

@zlareb1
zlareb1 force-pushed the feat/i160-dashboard branch 3 times, most recently from b1bf24e to 68bc2be Compare November 3, 2026 21:04
…une drafts

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 force-pushed the feat/i160-dashboard branch from 68bc2be to e7c24df Compare November 3, 2026 21:46
zlareb1 and others added 4 commits November 3, 2026 21:51
… as the namespace

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ay out of the shell's index chunk

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 merged commit ac4d47e into main Nov 3, 2026
22 checks passed
@zlareb1
zlareb1 deleted the feat/i160-dashboard branch November 3, 2026 22:27
@pufit pufit mentioned this pull request Nov 4, 2026
9 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant