Repository navigation
Conversation
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
|
Addressed the four independent review findings in
294 focused tests, Ruff, the function length gate, strict mypy and the generated analyzer check passed. The new ClickHouse fixture covers a namespace with only damaged history. Fresh independent review and hosted CI apply to this head. |
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…rce-history-prep-on-main Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
|
Fixed the native access findings in The exact head |
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
|
Fixed the checked mirror finding in Ruff, strict type checking, the function length gate, the analyzer inventory and 140 focused tests passed. The normal hosted run includes the ClickHouse inventory fixture. Fresh independent review is underway. |
A worker marker can appear after a native turn starts. Stop before writing documents or sync state when the current registration carries that marker. Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
|
|
Check the registration before retiring documents and again before clearing the request. The existing cleanup still handles a removed or replaced native registration. Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
|
|
|
Independent review approved |
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high 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 d3f4ca1. Configure here.
Preserve the raw config when it cannot be decoded so one worker row cannot stop native sync. Reread the registration under the source lease before recording a full sync request. Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
|
Independent review of |
A lagging replica can miss worker source history before native account cleanup starts or during the final residue census. Require sequential reads at both checks. Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
The rename test needs two distinct memory bodies. Give the prose case its own sentence so canonicalization keeps both setup rows. Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
shapes.txt is regenerated with python -m tests.analyzer.corpus --write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Worker source rows no longer decode their config or selection in this build: nothing reads them, writes reuse the stored bytes, and decoding depended on the interpreter's JSON nesting limit. A native row whose config cannot be decoded reads as empty instead of stopping the source inventory. Remove and namespace retirement refuse an active worker source with a permanent SOURCE_NOT_SERVED instead of a retryable overload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
… native rows A namespace erasure, deletion or repository removal refused while the namespace held a worker source, so the erasure saga stopped before it erased anything. Retirement now writes a worker row inactive with its stored bytes and nothing queued; knowledge.source.remove still refuses one. The worker branches of connected restore, owner history and the account predicate had no caller and are removed with their tests and analyzer case; native account cleanup and its census never match a row carrying a worker marker, and the erasure section says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…bing Namespace retirement writes a worker row inactive with its sealed credentials cleared, as for every other source, so none outlives an erased namespace. knowledge.source.rotate refuses a worker source before it sends any probe. The native account predicate is a constant, the row decoder keeps its original shape, and the ClickHouse fixture checks its control row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…irst ClickHouse answers the UUID source_id column with uuid.UUID, which made a connected restore refuse any real history; connected_history now returns strings. knowledge.source.remove refuses a worker source before authorization, as update, rotate and sync_now do, and their tests assert the permanent refusal message. The source guide states that the build that writes worker rows clears their credentials when it writes them inactive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
A non-admin removing a worker source gets the permanent worker refusal, since it comes before authorization; the ClickHouse fixture checks that connected history answers string source ids from the real driver. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
The account restore section names the refusal while any source row carries a worker marker. The worker refusal is raised inline, the list op reads sync state as main does, worker_history_exists describes what it returns, and the retirement and remove behaviours are separate tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
check was the one source op that answered a worker source with the retryable not-served message; it now refuses first, as remove, update, rotate and sync_now do. The rotate test covers the reread under the lease. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

Related: #1190
Related: #1209
Related: #1302
Changelog category
Changelog entry
Preserve document source worker registrations through native maintenance and namespace retirement. Refuse a connected-account restore that cannot account for worker history. Connected-account restore no longer refuses every deployment that holds connected sources.
Why
A maintenance build needs to preserve source worker registrations even when it cannot read their payload. A native connected-account restore must stop before it ignores that history.
Scope and risk
A worker row, active or inactive, keeps its original kind markers, configuration and selection bytes in its history; this build decodes neither, and native serving and sync do not use them.
knowledge.source.check,remove,update,rotateandsync_nowrefuse a worker source withSOURCE_NOT_SERVED, which does not clear on retry, before authorization and before any probe. Namespace retirement (namespace deletion and erasure,collection.delete,code.repo.remove) writes a worker row inactive with its credentials cleared and its stored bytes kept, and queues no cleanup, so a namespace erasure completes. Native connected-account history, inventory, cleanup and census match native rows only and never a row carrying any worker marker; such a row belongs to a worker connection, and the build that first creates worker rows must add their account cleanup and census. Native restore refuses before it inventories or mutates anything while worker history exists, and the deployment restore census counts worker rows.connected_historynow returns string source ids: ClickHouse answers the UUID column withuuid.UUID, which made restore refuse any real connected history. Native account disconnect skips worker history, list and inspect withhold worker details, native sync refuses to write worker state, mirror discovery and its last eligibility read exclude worker history, and pending retirements stop if a reread finds worker history for the same source.This preparation leaves active worker writes and enrollment disabled. Worker credential cleanup, deployment restore and mixed build qualification remain separate work. It introduces no account record, credential, API field or migration.
Compatibility, rollout and rollback
Tests
Focused tests cover raw inactive rows, worker rows decoding no config or selection, partial markers, native restore refusal, and a native row whose config cannot be decoded reading as empty without stopping the inventory. Check, removal, update and rotate refuse a worker source; check and removal before authorization, and update and rotate both before and after the lease (rotate's first refusal comes before any probe). Namespace retirement writes a worker row inactive with its credentials cleared and its history kept, while queueing nothing. Disconnect, sync, mirror and retirement tests check a worker marker seen before and after the source lease. Native owner erasure deletes native rows and its SQL excludes every worker marker. The ClickHouse fixture shows native owner erasure leaving worker and damaged worker history byte-identical. The analyzer corpus was regenerated (2,344 shapes). Locally on Python 3.12, Ruff and the focused unit, analyzer and package-contract tests pass; tests that need paths outside the task's sparse checkout, and the ClickHouse analyzer and storage suites, run in hosted CI.
Note
Medium Risk
Touches connected-account cleanup, erasure census, and restore gates alongside credential clearing; mistakes could leave worker residue or block legitimate restores until worker-aware tooling ships.
Overview
Introduces worker source discrimination (
is_worker_source, ClickHouseWORKER_HISTORY/NATIVE_ACCOUNT_BINDING) so this build can preserve MCP/worker registry rows without interpreting their payload.API & ops:
knowledge.source.check,remove,update,rotate, andsync_nowrefuse worker-marked sources withSOURCE_NOT_SERVED(before auth/probes). List/inspect withhold worker details.Lifecycle: Native disconnect, owner erasure, connected inventory/history/census, and mirror discovery exclude worker rows. Namespace retirement inactivates worker rows in place (credentials cleared, raw config/items kept, no retirement queue). Sync and pending retirements stop when a reread sees worker history.
Restore: Deployment/native connected restore fails fast if any worker history exists; restore residue census counts worker rows. Inserts may only rewrite inactive worker history, preserving original column bytes via
WorkerSourceHistory.Docs and tests (unit, CH integration, analyzer corpus) updated accordingly.
Reviewed by Cursor Bugbot for commit cf3b424. Bugbot is set up for automated code reviews on this repo. Configure here.