Repository navigation
Conversation
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com> (cherry picked from commit 7aca0882170f44984f25535092ff9d27f0872d8f)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Independent review covered all five hunks in |
Return the document and chunk row types required by the existing insert calls. Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
|
Fresh independent review of The reviewer compared the manual add preflight, original resolution, embedding and row builders, and publication and cleanup spans against the base. The same document and chunk types reach the existing inserts. The publication and cleanup block is unchanged. The change adds no worker entry point or wire or storage change. Ruff and whitespace checks passed. The two focused knowledge files passed 58 tests. The bounded type comparison removed the three affected typing errors; it does not replace normal hosted CI. This review did not run services or the full suite. The normal required checks must still pass on this head. |
|
The required run for The unit shard fails |
Run the preparation change with the repository gates and base code it will merge into. Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
|
Independent review approved |
|
The Postgres 18 storage job on Failing job: https://github.com/ClickHouse/loom/actions/runs/45853332304/job/140025258444 |
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
|
Independent review approved |
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
|
Independent source review of |
Related: #1190
Related: #1310
Changelog category (leave one):
Why
Source refresh needs to prepare document and chunk rows before committing them with a checkpoint. The existing manual add path prepares and publishes the rows in one function. Splitting preparation out gives refresh a reusable step without giving it a separate publication path.
Scope and risk
Manual add uses the same chunking, embeddings, revision, original and write order. The preparation helper returns the typed document and chunk rows without publishing them. This change does not wire refresh to the helper or change who can publish or read a document.
Compatibility, rollout and rollback
No wire, configuration or schema changes. No operator steps. Revert the change to restore the single function; rows written by either version use the same format.
Tests
Ruff, the function-length gate, strict mypy for
server/knowledge/app/writes.py, and 182 focused tests passed ond51f17c.AI assistance in the code
Checklist
Note
Low Risk
Structural refactor of the manual add path with the same write order and semantics; no schema, config, or new callers beyond
handle_knowledge_add.Overview
Extracts document and chunk row construction from
handle_knowledge_addinto a new_prepare_document_add_rowshelper that chunks, embeds, stamps version, and buildsDocumentInsertRow/ChunkInsertRowvalues without writing to ClickHouse or Postgres.handle_knowledge_addkeeps the same validation, prior-document lookup, blob resolution, and publish order (chunks first, then document); it only calls the helper for the embed/build step. The split is intended so source refresh can reuse preparation ahead of a checkpointed commit in follow-up work—nothing in this diff wires refresh to the helper or changes publication permissions or row shape.Reviewed by Cursor Bugbot for commit d51f17c. Bugbot is set up for automated code reviews on this repo. Configure here.