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 |

Related: #1190
Related: #1209
Related: #1302
Changelog category
Changelog entry
Preserve inactive document source worker registrations through metadata updates. Refuse a connected-account restore that cannot account for worker history.
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
An inactive worker row keeps its original kind markers, configuration and selection bytes. Protected readers can read current registrations and refuse malformed selections. Native serving and sync do not use them. History and census include partially marked worker rows for the exact tenant, owner and connection. Cleanup stops if any damaged rows remain; native account cleanup leaves them alone. Native restore refuses worker history before it inventories or mutates the native accounts. Native source removal and namespace retirement stop before queueing worker cleanup. Native account disconnect skips worker history, list and inspect withhold worker details, and native sync refuses to write worker state. Checked mirror discovery and its last eligibility read exclude worker history even when the row reports shared credentials. A background sync turn also stops before document, turn state and extraction state writes if its reread finds worker history. The full sync request also rereads the registration under the lease before it writes state. Pending native and mirror retirement requests 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, the active selection, partial markers, scoped erasure and census, and native restore refusal. Tests cover native removal, namespace retirement, account disconnect, list, inspect and sync. The disconnect and sync tests also check a worker marker seen after acquiring the source lease. Mirror tests keep a valid native control and refuse a worker marker both at discovery and after discovery. Background sync tests verify all three write paths preserve native behavior and refuse the same registration after it gains a worker marker. Retirement tests check the worker marker before deleting documents and again before clearing the retirement request. The analyzer corpus was regenerated. Store tests verify that protected reads preserve a valid selection, reject mixed selections, and keep the raw config when the decoder cannot read it. A valid native source remains readable beside that worker record. The full sync request tests cover native writes and refusal when the registration changes to worker history before the lease is acquired. The ClickHouse fixture now covers a namespace containing only damaged worker history, with a separate connection as a control. On
30d1597, Ruff, the function-length gate, strict mypy, and 571 focused tests passed. The generated analyzer corpus matched all 2,315 checked-in shapes. The ClickHouse analyzer and storage suites run in hosted CI.AI assistance in the code
AI-generated with Codex. Checked source decoding, scope predicates, restore refusal and the generated analyzer diff.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
Note
High Risk
Touches connected-account erasure, restore, census, and source lifecycle gates—mistakes could leave residue, skip cleanup, or mutate worker history incorrectly.
Overview
Introduces worker source history as a first-class lifecycle: MCP/worker rows are detected via
is_worker_source, keep rawconfig_json/items_jsonon inactive rewrites (WorkerSourceHistory), and use shared ClickHouse predicates (WORKER_HISTORY,source_account_match) for census, erasure, restore inventory, and connected-owner queries.Native paths now refuse or skip worker rows: account disconnect/revoke, source remove/update/sync/rotate, namespace deactivation, mirror
active_sources, and retirement/sync background jobs either block, hide API details, or stop writes when a worker marker is present. Sync usescurrent_native_sourceso turns do not update state for worker registrations.Restore and cleanup: deployment restore errors if worker history exists without worker-aware handling; worker slot restore routes through
worker_connection_id. Partially damaged worker markers remain visible for scoped erasure while native connected inventory explicitly excludes them.Tests and analyzer shapes were extended for worker metadata, erasure predicates, and integration fixtures.
Reviewed by Cursor Bugbot for commit 30d1597. Bugbot is set up for automated code reviews on this repo. Configure here.