Repository navigation
Personal source connections use canonical account ownership - #883
Merged
Merged
Conversation
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…nected-account-lifecycle
Read provider wait and response caps from the settings catalog so operators can tune them. Preserve the existing defaults and caller deadline, generate the configuration outputs, and verify both overrides at the HTTP boundary. Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…nected-account-lifecycle Signed-off-by: zlareb1 <[email protected]> # Conflicts: # server/settings/catalog.py
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Admit browser consent in the owning cell, reject checked redirects, and bind mandatory account cleanup at HTTP and CLI roots. Keep generated contracts and writer role controls aligned. Signed-off-by: zlareb1 <[email protected]>
…t-lifecycle Signed-off-by: zlareb1 <[email protected]>
8 tasks done
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Keep the central table taxonomy and source references aligned with the authentication-owner lifecycle without broadening memory erasure scope. Signed-off-by: zlareb1 <[email protected]>
A shard can reach its job deadline before pytest prints a failure summary. Record node verdicts as they arrive and dump thread stacks after five minutes inside a test without terminating it. Signed-off-by: zlareb1 <[email protected]>
9 tasks done
Signed-off-by: zlareb1 <[email protected]>
6 tasks done
Direct SCIM integration calls bind real cleanup; the unit store models its exact empty inventory reads. Signed-off-by: zlareb1 <[email protected]>
5 tasks done
This was referenced Nov 18, 2026
Merged
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: #863, #896
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):
Personal document-source connections bind sealed provider credentials to the signed-in account owner. Connected sources recheck that owner, the current connection generation and mirrored permissions before provider access, publication and delivery.
Why
A source credential must not become namespace-wide authority to use another person's connected account. Checking only when a source is registered cannot cover later account replacement, namespace-role loss, disconnect, SCIM removal or a restored backup.
This change introduces one canonical account registry and uses its current owner and generation throughout the connection and source lifecycle. Short account and namespace leases protect the actual publication boundary; remote requests and embedding do not hold those leases. A failed permission or generation check refuses delivery and publication.
Scope and risk
The registry is an authentication-control relation keyed by
(org, subject, kind), spanning namespaces for one canonical sign-in identity. A memory namespace, agent, end-user or session key would bind the credential to the wrong authority. Architecture and erasure classification record this identity-tuple rationale, canonical-owner cleanup and audit provenance.This is the personal-account backend. Delegated organization crawl, interactive connection UI/CLI and the complete mirror-content restore procedure remain separate work. Existing mirrored-creation and fleet/session-protection gates remain in force; this PR does not declare a host capability, relax session admission or activate connected sources. Personal-namespace support is not claimed where the current mirrored-source contract refuses it.
Compatibility, rollout and rollback
connection.listandconnection.disconnect, scoped to the authenticated caller's own accounts.POST /v1/connect/{kind}/startand browser-boundGET /v1/connect/{kind}/callback. OAuth routes are always excluded from automatic HTTP tracing, including before routing.knowledge.source.addacceptscredential_mode=shared|connected; its credential defaults to empty for the connected form. Shared registration still requires its credential. Source list/inspect entries addcredential_mode,accessand a restrictedowner_subjectprojection. Connected owners can add, update, check, remove and request synchronization with writer standing; shared-source administration and credential rotation retain their administrator checks.connected_accountsand three source columns with defaults that preserve shared registrations. Connected rows leave the legacy provider kind and credential empty, so older workers cannot mistake a connected registration for shared credentials. No existing migration is edited.connect_*_client_idandconnect_*_client_secretregistration before use. Notion additionally requiresconnect_notion_read_content_only=trueonly after confirming that registration capability. The existing OAuth request/body bounds still apply.knowledge_connected_stop_timeout_s,knowledge_connected_revoke_timeout_s,knowledge_connected_lease_ttl_s,knowledge_connected_lease_wait_s,knowledge_connected_registry_scan_limit,knowledge_connected_registry_page_size,knowledge_connected_sources_max_per_namespace,knowledge_connected_sources_max_per_personandknowledge_source_acl_max_entries. Defaults and ranges are generated in the configuration reference.loom reconcile --applyperforms account cleanup before publication for either restored authority store. ClickHouse-only deployments use the dry run and thenpython dev/restore_connected_accounts.py --applyagainst their configured stores. Account cleanup alone does not certify mirror document, chunk, head or original erasure. Reverting code leaves additive schema and stored rows; it does not erase them.Tests
Only bounded, directly related local checks ran. Their separate receipts are retained; they are not one full-suite or final-head execution claim:
CI exposed formatting, frontend role-map, package-boundary and closed storage/census companion omissions. The repairs add the missing contracts, regenerate SDK/settings/query-corpus snapshots and preserve the existing assertions. The list/inspect assertion permits the intended credential_mode metadata while recursively rejecting secret fields and a seeded opaque credential value. Cell fixtures seed the real snapshot, cleanup fixtures retain the real implementation, and quota checks use the public error projection. The original removed-mirror name reservation is restored; its unchanged controls caught unintended name reuse.
Named CI diagnostics identify a SCIM SQL fake that rejects required account-inventory reads before the test's synchronization event can be signalled. The unit fixture models those exact empty-inventory queries. The standalone ClickHouse race fixture binds the real account cleanup handler, as the HTTP and CLI composition roots do. All original test functions, assertions and timeouts remain unchanged. No production guard is relaxed.
The corrected head passes all six unit shards, coverage and benchmark checks, four integration shards, isolation gates, both supported Postgres authority jobs, native SDK matrices, frontend checks, mixed-version builds and both Quickstart architectures. All 49 check results are terminal: 47 succeed and two publication checks are skipped; all five applicable workflows succeed. The previously cancelled shard now reports 5,838 passes, including both tests that lacked completion records. The standalone integration shard reports 545 passes. The earlier import-evidence stall remains unexplained; its cancellation is not counted as a pass. Verbose node verdicts and nonterminating thread-stack dumps retain every workload, worker count, random-seed calculation, coverage check and original deadline.
Canonical SDK operations, reach, settings, defaults and documentation were regenerated and checked. The schema was generated from an empty private ClickHouse using all migrations; its only changes are the new registry and additive source columns. Scoped Ruff, mypy, whitespace and public-prose checks passed. The related published route-census correction is composed with the new consent-route classifications, preserving its four assertions. Other main changes are imported without feature changes. The cell-placement, redirect, composition-root, role-map and integration checks ran in hosted CI; they were not run locally because the disk-admission floor was unavailable.
Provider registrations and live provider acceptance remain unrun. Broad suites ran in hosted CI. Fresh independent whole-change source review reports no findings or nits. Merge remains subject to the repository branch rules.
AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated: An agent wrote the change and checked account ownership, authorization, publication, cleanup, restore and generated artifacts against the retained causal evidence.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist