Repository navigation
Conversation
…d document could answer After the model step, a pass in `assist` mode takes the 20 most asked gaps of the namespace's latest gap build and gives each one code. The first step that ends a question decides it: the gap may no longer be drafted from, a definition draft or an earlier draft claims it, no shared document answers it, or every passage that answers it reads as sensitive. A question no step ended is `draftable`. The walk writes no fact and asks no chat model. - `knowledge.gaps.draft` and the walk decide whether a gap may be drafted from through one function, `gap_drafts.eligibility`. - The walk's search reads only chunks of documents held for no one user (`HybridSearchQuery.shared_only`, set in process; no operation carries it), and a passage answers a question by the rule that keeps a search from being recorded as a miss. - The search embeds the question, a call made for the org. The walk runs only while the org's model calls are on and the curator's share of the namespace's daily cost cap is unspent, and the spend is recorded under `worker.curator`. - The pass row gains `questions`: a count for each code and each question's code under a keyed hash. It holds no question, no gap id, no draft key and no passage. - `curator.status` serves the counts with their titles in `last_pass.questions`, and `setup` lists four more prerequisites, each needed for `drafts`: `gaps_on`, `capture_on`, `shared_documents` and `no_mirrored_source`. - `loom curator status` prints a questions line with the server's titles. - The draft key of a gap is `curator/gap/<k>`, with `k` from a keyed hash of the gap's id: a key must not reveal the question. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit de32494. Configure here.
…y what a shared document is - The walk's lookup of a fact under a gap's draft key passes `fresh=True`, as every point lookup outside the repository does. The read is the same: it is `strong`, which reads with sequential consistency first. - The `shared_documents` prerequisite reads "The namespace holds a document written for no one user", and the comments and the curator page word the filter the same way. Every member of a namespace reads every document in it, so "a document every member can read" named no filter. - The dashboard's unmet list says what each entry is needed for: a pass, model opinions or a draftable question. An entry a draftable question needs stops no pass and no opinion. - The curator page says what the walk sends the embedder, that the walk reads the org's model switch and the curator's share of the cap once, before its first question, and when a pass row holds no `questions`. The runs page lists `questions` among what a pass in `assist` mode adds to its row. - The size test checks the largest `questions` a walk can store. That is a mix of codes, because each code a question ends under adds a count. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…en for Two docstrings of tests/integration/test_curator_pass.py described the documents the `_document` helper adds by who reads them. Every member of a namespace reads both, so the docstrings now name the user each document was written for: no one user, which is a shared document, or the user given. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This branch has not been deployed
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: #2152
Related: #1232
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):
In
assistmode the curator's scheduled pass now decides, for each of the 20 questions people ask most without an answer, whether a shared document, one written for no one user, could answer it.curator.statusandloom curator statusshow how many aredraftableand why the others are not.Why
A namespace's knowledge gaps list the questions several people asked and found nothing for. Some of them are answered by a document the namespace already shares, and an admin has no way to tell which without searching for each by hand. The pass already reads the namespace once a cadence, so it is the place to decide this, and the answer belongs on the surface that reports the pass.
The decision is made by code alone, in one order, and the first step that ends a question gives it its code:
gap_ineligible,erasure);definition_draft_exists);already_drafted,drafted_other_wording);high(no_evidence,sensitive_passage).A question no step ended is
draftable. With knowledge gaps off, a namespace that keeps no query text, or one that mirrors a document source, no step runs and every question is counted under that reason (gaps_off,capture_off,mirrored_source).Scope and risk
knowledge.gaps.draftand the walk both callgap_drafts.eligibility, which holds every rule the handler had. The handler's behaviour is unchanged and its tests pass as they were.user_idis-).HybridSearchQuerygainsshared_only, which addsuser_id = '-'to the filter every leg shares. It is set in process by the walk's read, and no operation's wire model carries it. A passage of a document written for one user never counts as evidence. Every member of a namespace reads every document in it, so the filter is about whom a document was written for and not about who can read it, and theshared_documentsprerequisite says so: "The namespace holds a document written for no one user".draftable.worker.curator. A walk that has a gap to decide, in a namespace where none of the three reasons above holds, therefore reads the org's model switch and the curator's share of the namespace's daily cost cap once, before its first question. While the calls are off, the share is spent or either cannot be read, it decides no question and the pass row holds noquestions. The share is read once and not before each search, so a walk can pass it by the embeddings of at most 20 questions. The embedder itself refuses a call for an org switched off after that read, which fails the walk.draftablewould be counted by a rule no search of documents uses.strong, which reads with sequential consistency first, and passesfresh=Trueas every point lookup outside the repository does.questionsholds a count for each code and each question's code under 12 hex digits of a hash of its gap's id, keyed with the root secret under a label of its own. It holds no question, no gap id, no draft key and no passage. A gap's id is derived from its question, so the draft keycurator/gap/<k>is keyed the same way under another label: a key must not reveal the question. With 20 opinions and 20 questions the metadata stays under its 6,000 characters.capture_off, an unreadable source list asmirrored_source, an unreadable eligibility rule asgap_ineligible. A walk that raises is noted as a failed leg of the worker, and the pass keeps its counts and opinions with noquestions. An erasure that reached the namespace during the pass stores no question.last_pass.questions, a list ofcode,titleandcount, and not inlast_pass.counts:countsis keyed by section and carries no title, and a surface prints the title the server sends.assistmode the list holds the four new prerequisites when one is unmet, and an entry a draftable question needs stops no pass and no opinion. The tab does not draw the question counts.findingsmode never walks.Compatibility, rollout and rollback
curator.statusgainslast_pass.questions[](code,title,count), andsetup[]gains four entries,gaps_on,capture_on,shared_documentsandno_mirrored_source, with a new value ofneeded_for,drafts. The pass row's metadata gainsquestions. The fields are additive: an older worker does not walk, and an older reader ignores the fields. No operation, migration, setting or rolling-upgrade rule is added or changed.questions, which the older build ignores, and the regenerated SDK files revert with the commit.Tests
pytest tests/unit/test_curator_questions.py: each code in step order, the walk-level reasons, an unreadable prerequisite, the draft key, the content of the pass row and its size at the largest mix of codes, the time bound, a changed mode, a failed walk and an erasure during the pass.tests/unit/test_read_your_writes.py: the walk's point lookup asks for fresh rows.tests/unit/test_knowledge_gaps.py::test_both_callers_share_one_eligibility_function: each rule closes both callers.tests/unit/test_knowledge_search_service.py::test_shared_only_reads_no_user_document: fails with the filter removed from_common_where.tests/unit/test_curator_status.py,tests/unit/test_cli_curator.py: the four prerequisites, each following its own read, and the questions line.tests/integration/test_curator_pass.py, against a server and a ClickHouse started for this change: a repeated question with a shared document isdraftablewith a count of 1 and no memory row or candidate written; one answered only by a user's own document isno_evidence; one a definition draft claims isdefinition_draft_exists.frontend/src/views/admin/Curator.test.tsxandfrontend/src/flows/NamespaceSettingsDialog.curator.test.tsx: an unmet entry is listed with what it is needed for and who can change it, and a purpose or a role this build has no words for is shown as its code.npm --prefix frontend run buildandnpm --prefix frontend run budgetpass. The rest of the dashboard suite runs in CI.docs_reference,op_reach_censusandplugin_eval_toolswas run on the first commit and its--checkpasses. The second commit changes no operation and no wire model, anddocs_reference --checkpasses on it.tests/analyzer/shapes.txtgains five shapes, andpytest tests/analyzerpasses against the same ClickHouse.make typecheck,ruff format --checkandruff checkpass.test_setup_says_why_no_opinion_was_given, the unit files above with the other curator and knowledge search unit files, and the repository scans (test_package_contracts,test_op_transport_contract,test_tunable_constants,test_store_names_refused,test_degraded_unnoted,test_public_copy,test_doc_links,test_agent_instructions).tests/integration/test_curator_pass.pyand no statement. On it, against a server and a ClickHouse started for it: every test of that file, the same repository scans andpytest tests/analyzerpass, withmake typecheck, andruff format --checkandruff checkon that file.tests/unit/test_degraded_unnoted.pyfails onmainmerged with any branch:mainholds an unlisted handler,server/code/app/index/review_brief_build.py::_history_section::gather::1, in a file this change does not touch. It passes on this branch alone.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. The tests above were run as the Tests section says, and the diff was read against the area rules and the invariants.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump), the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py) and the standalone skill bundles (python3 scripts/codegen/standalone_skills.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