Skip to content

The dashboard's Assistant page inspects a namespace's documents and lists the document drafts - #259

Merged
zlareb1 merged 18 commits into
mainfrom
feat/i160-doc-dashboard
Nov 4, 2026
Merged

zlareb1 merged 18 commits into
mainfrom
feat/i160-doc-dashboard

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 4, 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's Assistant page can inspect a namespace's documents: what they are by format, source and revision, what search serves of them, their ingestion and extraction state, and the decisions recorded from them. Review changes now shows the chunking and extractor-route drafts, with their before and after on a document sample and the deployment write that would apply each one.

Why

knowledge.inspect and the document drafts in namespace.tune are on main, but the dashboard could only show memories. A person reviewing a namespace had to call the ops by hand to see why a document is not searchable or why a draft wants a new chunk size. This change makes documents an Inspect subject next to users, agents and sessions, and shows the document drafts in Review changes. Neither panel changes anything.

Scope and risk

  • Inspect. The subject selector gains Documents, which takes no id and reads knowledge.inspect on a click. The panel shows:
    • totals and the by-format and by-source tables
    • what search serves under the server's embedder
    • ingestion and extraction state, with the ingest findings grouped by their kind (the deployment's state, the files, what was written or kept), one card per finding that hit and one "Checked, none found" line per group, so a backlog never reads as bad content
    • extraction coverage
    • decisions per stage
    • the newest documents with their chunks, decisions, extraction and current job
    • for a chunk finding, how many of its documents knowledge.ingest published, with those samples marked, since their remedy is to ingest again rather than write again
    • namespace.audit's findings on memories shaped like documents
  • Sections that were not read. Whether a section was read comes from the fields the server leaves null on a failed read (the document totals and groups, the chunk count, the job count, the extraction count). It does not come from skipped, because the server also writes a skipped line under a section's name when it read the section but cut it short ("the counts cover the first"). A section that was not read says so, and is never shown as zero. A cut section shows its data with that line as a note. A check says it did not run when coverage.rules_skipped names it: the chunk checks, the five job checks and the extraction coverage check each get their own line. The namespace reads as empty only when both the live document count and the job count were read as zero, so a first ingest that is queued or failed is never hidden. The document listing, its jobs and the list of sources with no live document have no such field, and the server writes only a failed read under their names, so the page uses those skipped lines. When the list of sources with no live document was not read, the page gives their count and says they were not listed. The full skipped list and coverage.rules_skipped are printed at the end.
  • Read scope. knowledge.inspect honours the read scope (SCOPED_OPS), so the page gates it as it gates namespace.inventory. A token pinned to a user can read it. A token whose scope needs an id the page does not send (own_session, or own_user with no pinned user) is refused before any request.
  • Review changes. The panel renders the settings.knowledge_chunking and settings.document_extractors_json drafts:
    • a before/after table on the same document sample; when the sample drafts no size, its own measures at the current values
    • the sample, with its cap, load cap, unread count and embedder input limit
    • the source URIs cited and the counter count
    • the write named by TuneApply.via: POST /v1/admin/settings.set for admin_route, or the variable plus a restart for environment
    • apply_also in order
    • for args_complete=false, "once each placeholder is filled in"
  • Apply. Apply is still the unavailable button it was, and its reason now names who makes the write and where.
  • Bundle. All new code is in the lazy Assistant chunk, including the knowledge.inspect request. The index chunk grows by one canCall entry.
  • Server. The only server-side file is the regenerated reach manifest, where knowledge.inspect gains the dashboard's plugin_hook reach, as its sibling ops have.

Compatibility, rollout and rollback

  • Wire: no op or field changes. The page reads TuneApply.via, apply_also, preview, TuneEvidence.documents and NamespaceTuneOutput.chunking as optional, so a server a release behind (which sends none of them and drafts only ops) still renders as before.
  • Operator steps: none.
  • Rollback: a revert removes the panel and the draft rendering. Nothing is stored.

Tests

  • The knowledge.inspect fixtures, unit and e2e, are responses the server can build. Every check is sent, each with the population of its own read, and each derived state goes through a helper that changes every field the server changes for that state (an empty namespace, a failed read, a cut read, a queued first ingest, one check hitting).
  • Vitest, src/views/Assistant.test.tsx, a case for each new state:
    • documents present (axe included)
    • an empty namespace
    • sections skipped, shown as not read and never as zero
    • sections cut short (documents, extraction), shown with their data and the server's note
    • an unread job count, which never makes the namespace read as empty
    • the chunk, job and extraction coverage checks, each said not to have run when rules_skipped names it (including a failed job read on its own)
    • the sources with no live document, said to be unlisted when their read failed
    • a chunk finding's samples that knowledge.ingest published, counted and marked, including ones the server sampled apart from the first matches
    • a share with hits under one percent read as "<1%", and one short of the whole as ">99%"
    • each ingest finding kind, in its own group with the other checks listed as clean
    • a pinned token allowed and an own_session token refused
    • a read error and a namespace switch
    • the id field focused again when leaving Documents
    • a chunking draft with its preview, sample cap and admin route (axe included)
    • a document sample that drafts no size, shown with its own measures
    • an extractor-route draft with via: environment, args_complete=false and the restart
  • e2e/assistant.spec.ts now draws the Documents panel and both document drafts with long source URIs, a long format name and long titles. It runs at 1400 and 375 px with no horizontal scroll, nothing clipped and no axe violations. The first 375 px run caught the preview table's labels widening the card, which this change fixes.
  • Gates: npm --prefix frontend run test (the full suite), npx tsc -b, npm --prefix frontend run build, npm --prefix frontend run budget (index chunk 115.9 kB of 120 kB, boot scripts 184.3 kB gzipped of 198 kB), make format-check, make lint, make typecheck, tests/unit/test_public_copy.py, tests/unit/test_doc_links.py and tests/unit/test_op_reach_census.py with the dashboard route tests. The full Python unit suite passes; the only server-side file is the regenerated reach manifest, which the census test checks.

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. Checked against the server's wire models and the inspect and tune handlers on main: section names in skipped, finding codes and kinds, and the via values.

  • 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-doc-dashboard branch from 119dfc3 to e53d8c4 Compare November 4, 2026 11:26
zlareb1 and others added 13 commits November 4, 2026 11:46
…ument drafts

Documents join User, Agent and Session as an Inspect subject. They take no id
and read knowledge.inspect: documents by format, source and revision, what
search serves under the server's embedder, the newest documents with their
chunks, decisions, extraction coverage and jobs, and the ingest findings
grouped by kind, so a backlog never reads as bad content. A section the
server could not read shows as not read, never as zero. A token pinned to a
user can inspect documents, because knowledge.inspect honours the read scope.

Review changes renders the chunking and extractor-route drafts from
namespace.tune: the before and after on the same document sample, the sample
and its cap, the documents cited, and the write that would apply each draft
(the settings.set admin route, or an environment variable that takes effect
after a restart, with its placeholders to fill in). Apply stays unavailable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… failed read leaves null

A skipped line under a section's name is also how knowledge.inspect says a
section it read was cut short ("documents: more than ... the counts cover the
first"), so the page showed such a section as unread. Whether a section was
read now comes from the fields the server leaves null on a failed read: the
document totals and groups, the chunk count, the job count and the extraction
count. A cut section shows its data with the server's line as a note. The
chunk and job checks say they did not run only when the reads they run on
failed. An unread job count no longer makes the namespace read as empty, so a
first ingest that is queued or failed stays visible.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…and the e2e fixture states one rule once

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… every check the server runs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…an drawing an empty list

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… total was not read

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…nd a cut read, and its tests send what the server sends

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…erver can build

The unit fixtures are now built the way server/knowledge/app/inspect.py builds a
response. The base sends every document check, with clean ones as count-0 info
findings over the live documents. Each ingest check has the population of its
own read: sources with a job, or documents with an extraction. The
extraction_incomplete finding matches the extraction counts, rules_run names
all ten checks, and by_format is ordered most live first.

Each derived state goes through a helper that changes every field the server
changes for it:
- an empty namespace (zero totals, null newest write, zero populations)
- a failed documents read (null totals and newest write, listing never
  complete)
- a failed job read (every job count null, the five job checks in
  rules_skipped)
- a first ingest queued (the backlog check counts it)
- one ingest check hitting (its sources, jobs and totals)
- documents and extraction reads cut at the group cap

The e2e fixture follows the same rules: per-check populations, no ingestion
ids for extraction_incomplete, job hits that fit the four sources and the
state totals, a URI of its own for each source with no live document, and
both live documents listed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… send

The page no longer says "namespace.audit reported none". The server sends both
of the audit's memory checks, a clean one at count 0, or names each one it did
not run in `skipped`, so that line could not be reached.

The unit fixtures:
- send both memory checks
- sort the cut group rows the way the store orders them
- give a queued job the due time knowledge.ingest gives it
- give each failed job the stage and attempts it would have
- send memory drafts with the fields the current server adds, with one case
  for the older shape that lacks them

The chunking and route drafts use tune.py's own text and numbers: five cited
documents for twelve flagged, the real sample cap and load cap, and a route
rationale that fits its services.

The e2e fixture now tells one story across knowledge.inspect and
namespace.tune:
- an embedder whose input limit makes the over-the-limit rule draft a smaller
  size for the deck
- an xlsx source the default extractor does not declare, which the route draft
  cites
- sources without a document in the store's order
- retired versions that add up

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ce a cut section was read

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…h check that did not run

A chunk finding's count line now says how many of its documents
knowledge.ingest published, and marks those samples, because the remedy
differs: a text document is written again, an ingested one is ingested again.

When the read of the sources with a job and no live document fails, the page
gives their count and says they were not listed.

The ingest checks say they did not run by code, from coverage.rules_skipped:
the five job checks when the job read failed, and the coverage check when the
coverage read failed. Before, a failed job read alone said nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… and drops two checks a failed listing implies

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…, and its test sends a cut the server makes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 force-pushed the feat/i160-doc-dashboard branch from de25f5c to cb97308 Compare November 4, 2026 11:48
zlareb1 and others added 5 commits November 4, 2026 11:52
…of 22 documents gives

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…s no chunk size, and a finding under one percent reads <1%

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…t sample test sends a sample no rule flags

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ts queued and one replaced source

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 merged commit 05ac660 into main Nov 4, 2026
22 checks passed
@zlareb1
zlareb1 deleted the feat/i160-doc-dashboard branch November 4, 2026 12:14
@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