Repository navigation
The repository card shows and manages its document sources - #247
Merged
Merged
Conversation
zlareb1
force-pushed
the
feat/repository-card-sources
branch
2 times, most recently
from
November 4, 2026 02:21
fff76d4 to
f992677
Compare
An opened repository card gets a Sources facet after Docs: each source on the docs namespace with its kind, last sync badge, times and counts, read once with knowledge.source.list. The namespace's admin gets Add a source (a dry-run check first), Check, Sync now, Rotate credential and Retire, each a lazy dialog. The credential is a password field, never shown back. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…log tests The file kinds keep their option order, so unticking and ticking one again matches the checked form. The retire toast counts its documents and says they wait while sync is off. Closing the Check dialog aborts its probe. Tests cover rotate, check and sync now, the facet's refused, error and failed-row states, and that no page text or toast carries the key. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… letter Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…y label Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
zlareb1
force-pushed
the
feat/repository-card-sources
branch
from
November 4, 2026 02:39
f992677 to
d783172
Compare
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
This was referenced Nov 4, 2026
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #215
Related: #235
Changelog category (leave one):
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):
An opened repository on the dashboard's Repositories page lists its document sources with each one's last sync and counts, and its maintainers add, check, sync, rotate and retire a source there.
Why
The
knowledge.source.*ops and the sync worker exist, but the only way to register or watch a source was a raw API call. A repository's documents already show on its card (Docs), so where they come from belongs beside them. The facet reads oneknowledge.source.listwhen a card is opened, as the Docs facet does, so a folded card reads nothing.Scope and risk
Sourcesfacet on the opened repository card, afterDocs, for the same docs namespace (frontend/src/views/RepoSources.tsx). Each row: name, kind, a badge for the last sync (Synced,Incompletewhen anokturn carries anerror,Rate limited,Credential refused,Sync failed,Never synced), the last sync and a waiting request as times, and the counts in documents (listed, written, retired, not converted with the reasons in a tooltip, skipped).enabled: falseshows "Sync is off on this deployment". A server without the op shows a stated line, never an error banner. The counts are information only; there is no review or confirm step and no pinning.my_role === "admin", what the server'sRole.ADMINgate checks): Add a source, and a row menu with Check, Sync now, Rotate credential, Retire. Each is a dialog infrontend/src/flows/KnowledgeSourceDialog.tsx, loaded withlazy()on first use (the bundle gate refusesflows/*Dialog.tsxin the boot chunk).knowledge.source.addwithdry_runfirst and shows the probe (count and sample titles); Add stays off until the form it would send is the one that passed. Folder ids or pasted folder links, the file kinds, and the service account key.delete_documents). Its toast counts the documents and, when sync is off, says they are retired once it is on.frontend/src/lib/knowledgeSources.ts(wire types, badge, counts, form validation mirroring the server's name and folder id rules, body and fingerprint); wrappersfrontend/src/api/knowledgeSources.ts.plugin_hook).knowledge.source.inspectis not called by the page and keeps its reach.gdrivesources (a shared folder). Alinearsource (A project's documents sync from the tracker's document store #245), added throughknowledge.source.add, shows on the card as "project documents". Check, Sync now, Rotate credential and Retire work on it, and Rotate labels its field "Read-only API key". A kind the page does not know shows by its wire name, with a generic credential label. Alinearform in the Add dialog is left for a follow-up.Deviations from the original design, each because the boot chunk had 25 bytes of headroom (122855 of 122880 on main):
api/knowledgeSources.tsdirectly, asapi/tasks.tsandapi/models.tsare, not re-exported from theapi.tsbarrel (that re-export alone added 26 bytes to the boot chunk).OP_MIN_ROLEentry forknowledge.source.list: it adds 54 bytes to the boot chunk and no call site would consult it. The read follows the Docs facet beside it: a refusal is a stated line ("Join the repository to see where its documents come from").flagged_pinnedcount: the server'ssynchas no such field.Known gap, left for a follow-up that fixes both facets with one predicate: the verbs are offered on the docs namespace's
my_role === "admin", exactly as the Docs facet offers Add a document, so a deployment with auth off or a token with an admin claim but no admin grant on the namespace sees no verbs even though the server would accept them.Compatibility, rollout and rollback
LOOM_KNOWLEDGE_SOURCE_SYNC_ENABLED.Tests
npm --prefix frontend run test: 214 files, 1796 tests pass on the final head (one earlier run on this head had one failure under load; the two runs after it were green). New:src/lib/knowledgeSources.test.ts(badge, counts, reasons, folder parsing, form problems, body and fingerprint),src/flows/KnowledgeSourceDialog.test.tsx(check before add, Add off after a change and on again after undoing it or re-ticking a file kind; a refused real add keeps the passed check so Add can be tried again; axe; rotate takes the key in a password field and sends it once; after a successful or refused add and rotate no page text, non-password field or toast contains the key; check on open, Check again, an unreachable summary, and the probe's signal aborted on close; sync now withfulland its sync-off toast; retire keeps documents by default and words the sync-off case),RepositoryCard.test.tsx(a reader sees the source, its badge and counts and no verb; the admin gets Add a source and the four menu items; no docs namespace, no facet; a refused read, a failed read, and a failed turn's badge and error line).npm --prefix frontend run buildandnpm --prefix frontend run budget: OK (boot chunk at main's size).e2e/repositories.spec.ts: 10 pass, including three new tests (a viewer readsknowledge.source.listonce and only when the card opens, sees no button in the facet; a server without the op; the admin's Add dialog with Add off until a check and each verb's dialog opening and closing with no page error). The viewer test's forbidden-request regex now includesknowledge.source.(add|check|rotate|remove|sync_now).e2e/fixtures.tshas aknowledge.source.listhandler and aknowledgeSourcescall counter.route-budget.spec.tsandperf-budget.spec.tsevery route passed except two other timing checks (Memories boot LCP, Conversations INP), again routes this change does not render.knowledge.source.listanswers{sources: [], enabled: false}; a dry-run add with a malformed key answersCREDENTIAL_REFUSED; with a source row and a sync state seeded throughserver/knowledge/store/sources.py(no vendor credential exists to add one for real), the list,sync_now(requested_atset),check(reachable: falsewith the refusal insummary) andremoveanswer the shapeslib/knowledgeSources.tstypes, and the built dashboard opened on/repositoriesshows the facet ("Sync is off…", the source,Synced, "synced 4h ago", "sync requested just now", "12 documents listed · 3 written · 1 not converted") with oneknowledge.source.listrequest and no page error. Noloom.audit_logrow holds the key.make format-check lint typecheck, the reach census check,test_op_reach_census.py,test_public_copy.py,test_doc_links.py,test_agent_instructions.py: pass.make test-unit) on the round-1 head: 26395 passed, 0 failed. Later commits change onlyfrontend/and the dashboard docs row.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: the op shapes against
server/knowledge/api/models_sources.py, the admin gate againstops_sources.py, the form rules againstserver/knowledge/domain/sources.py, the boot chunk size against main.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.docs/reference/configuration.mdand thedocs/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).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code