Repository navigation
Knowledge is shared through collections with end users, groups, agents and the whole org - #77
Merged
Merged
Conversation
Each grant change inserts a per-org row into loom.acl_versions, and every process polls the rows' count and sum per org every acl_watermark_poll_seconds (1 s), dropping the org's cached grants when they move. This replaces the same-host write-count file and bounds cross-replica staleness by the poll interval instead of the 10 s TTL, which stays as the backstop. A process whose last good poll is older than acl_watermark_max_stale_seconds serves no cached grant. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…roups and agents A collection is a namespace named col-... that only grants open, inheriting its parent's grants. A per-org gateway token acts for one end user per request (user:<id>, optional agent:<id>); grants may name user:, group: and agent: principals, and groups are pushed over SCIM /Groups. knowledge.search reads every readable collection in one statement per leg, saved items live in each user's personal collection (@me), documents record who wrote them, and a user's erasure removes their documents, grants, memberships and personal collection. Grant, group and tree changes now await their watermark row, and a poll reads one total before any org's pair. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ectory self-service Fixes the second review. A personal collection admits only the user its name is derived from, takes no grant and sits in no tree, and @me needs no setup. Principal ids are lowercase. Trusted callers cannot assert a grant principal; end users may call only the collection ops and their own standing among org-level ops. Scoped and delegated tokens are capped on a collection. collection.delete replaces opening namespace.delete to narrowed tokens; collection.create checks names with read-your-write and finishes a create cut short for its creator only. Org-wide views hide collections by prefix. SCIM groups take a claim per group, page in SQL, answer 503 when tokens cannot be checked and revoke a deleted group's grants. Erasure rewrites outrank the row they replace. Search hits carry ingested_at; caches are bounded; the boot log names existing col- namespaces. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…its own kinds, erasure and SCIM fixes The ACL watermark sums per-org change rows, so concurrent writers never collide on a version. Knowledge search reads its own fan-out kinds setting; memory search sweeps memory namespaces only. Erasure rewrites take a version above the stored one, and SCIM group deletes revoke the group's grants first. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…nts each kind of change apart A metadata edit or delete now carries agent, user_id, actor and source_class forward, so a user erasure reaches an edited document. The ACL watermark counts grant, group and tree changes apart, so grant churn no longer reloads an org's tree or groups. A user-scope export returns every chunk the user wrote; erasure's group and tree rewrites and bulk revokes hold the claims their online writers hold, and bulk revokes are audited. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…register, gateway tokens act as no one erasure.request and erasure.export refuse a user_id scope of '-', '' or '*', which would reach every non-gateway writer's rows. A personal collection's directory row is written on its first write. A gateway token is refused on every route that names no end user, and grants.create refuses a group that does not exist. loom mint-token --gateway refuses claim flags; sharing.role reads through sharing.roles. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… replace, group grants under the group's claim collection.delete retires the tree row before the directory row, so a retry closes a delete cut short. Tree and group rows are versioned above the row they replace whatever the writer's clock says. grants.create holds a group's claim from its existence check to the write. A user-scope export shows an org admin only the collections it may read. collection.list answers a platform admin; watermark inserts are never deduplicated; private-first search is one helper for memory and knowledge. The sharing integration suites wait one watermark poll after each change of access. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… directory's claims, MCP answers a gateway token with 403 knowledge.update_metadata with reindex keeps the stored authorship. Erasure's directory rewrites hold each row's account claim before the tree's. SCIM group lists clamp startIndex and take eq in any case. A gateway token's refusal is counted on HTTP and answered 403 on MCP. namespace.browse never lists a collection. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…sure rewrites prove they landed A user purge first supersedes the versions that user's writes replaced, so another writer's older version never reads as live again. The blob step compares sha256 as a string and is covered by an integration test. Erasure rewrites re-count and fail when rows still match. The gate refuses @me on every transport. The grant cache's two caches share one single-flight loader. Tests cover the erasure identity steps' claims. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…etry from either step, scoped tokens list collections A write that leaves a live document's text as it was keeps the stored authorship. collection.delete writes the directory row, then retires the tree on every call. A read on a stale watermark is not kept over the entry the fallback needs. collection.list and collection.create admit a scoped token. A user erasure never purges, so its steps lose their purge branches. The context helper keeps its name from main. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… erased user leaves no id on grants they issued revoke_subject versions each revoke above its grant and reads again until none is live, failing with 503 otherwise. A user erasure blanks the user as the issuer of grants others hold. namespace.delete refuses a personal collection. forget_owner claims collections whose create stopped before the directory row and counts both rewrites. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…rg admin follows its collection erasures The collection gate and the readable set re-raise BackendUnavailableError, so an outage is never a 403 or an empty collection.list. An org admin sees the status and listing of a collection's erasure. A user erasure scrubs the user:<id> subject off the request ledger and deletes the user's subject_last_seen row. The two-process watermark test covers a collection detach; the BM25 stats read is measured. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…y server answers 503 for a collection revoke_subject and forget_granter re-read each grant under its claim, so a revoke landing meanwhile is kept, and move the watermark once. The collection gate re-raises timeouts and pool exhaustion as well as outages. collection.delete closes a collection whose create stopped before its directory row. loom mint-token --gateway refuses --user-token. test_grants waits one watermark poll after its revoke, the bound on a multi-process server. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…er writer's text A write without fresh bytes no longer carries an end user's uploaded original to someone else's new text, and a user erasure finds the originals of every version the user wrote. revoke_subject lists once more before it reports a grant still live. Docs say a change binds the process that made it at once and every other process within one poll. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…wide grants, document provenance An end user signs in with a short-lived token its service signs under a key registered for it alone (jwt_end_user_issuers_json), naming the user and the agent; it replaces the static gateway token and its headers. A grant to everyone reaches every member of the org. knowledge.search takes an explicit list of namespaces, each gated. collection.delete erases what the collection held; a user erasure purges on request, the ledger keeping the flag for a resume. Documents and chunks record the agent, the session and the class of their content, which knowledge writes declare and search returns and filters on. A same-text write with a new original makes its uploader the author; an erased user's revoked grant rows are deleted. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]> # Conflicts: # docs/reference/configuration.md
…ession on knowledge writes collection.delete runs a purging erasure of the collection, so its documents, chunks, originals and memory leave the disk. Knowledge writes carry a session, so a token pinned to one session must name it, as memory.set does. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…WKS URL Each end-user issuer names the orgs its tokens may name (names or prefix patterns, never every org, and no two issuers for one org) and where its keys come from: inline PEMs or an https JWKS fetched at boot and on a cadence, answered 503 until the first fetch lands. Its tokens carry a jti and live at most 5 minutes, and an end user's knowledge.search reads its namespace alone unless it asks for more. namespace.delete refuses a collection, which goes with what it holds through collection.delete; a request reads its principals' grant maps side by side; a user-scope export includes the user's personal collection. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]> # Conflicts: # docs/reference/operations.md # sdk/typescript/src/generated/ops.ts
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…issuer is never a trusted one Until every end-user issuer's first JWKS fetch lands, the refresh loop retries every 2 s instead of the refresh period; issuers are fetched side by side. The settings refuse an end-user issuer that is also Loom's or a trusted federated issuer (the token's iss picks the path), replacing the kid check. A request reads its grant maps at most 8 at a time. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…/revoke, and erasure finds every original a user uploaded - A token with an ns_write claim holds viewer at most on a collection outside it, as on any namespace. - /oauth/revoke revokes nothing for an end-user token: its jti is its issuer's choice and the revocation list spans the deployment. - Each end user's upload is recorded in loom.blob_uploads (migration 047), so a user erasure deletes originals whose naming document version was replaced and merged away; the census counts the user's rows. - erasure.export leaves out what its caller may not see inside each read, before its LIMIT. - A key is never both an end-user and a federated key, compared by key material; a fetched JWKS key that is a federated one is dropped; the 2 s JWKS retry fetches only the issuers not loaded yet. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…eaves the other issuers on their period - End-user tokens are checked against <org>/user:<id>, so one tenant's subject revocation never cuts off the same id at another. - The JWKS loop still fetches every issuer each period while one has never loaded, so an issuer that rotates keeps working. - collection.create refuses a name outside the token's ns_write set. - The export filter runs on clickhouse-local in its test; Shown.admits is gone. - One settings helper tells federated keys apart for the validator and the JWKS fetch; the upload record takes its user from _authorship. - The original sweep deletes the upload records of the originals it removes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…rries A bare user:, group:, agent: or everyone subject matches no token (an end user is revoked as <org>/user:<id>), so the CLI refuses it instead of reporting a revocation that cuts off no one. The cutoff message and the --subject help name the end-user form; security.md states the rule. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…s them, and records it under their org An <org>/user:<id> subject is accepted only with a named org and a lowercase id, the key a token's check builds; any other principal-shaped spelling is refused, since it would revoke no one. The audit row of an end user's revocation carries their org. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]> # Conflicts: # server/settings/__init__.py
…nd revoke agree is_reserved_subject also judges the segment after a subject's last '/', the shape of an end user's revocation key (<org>/user:<id>). Minting and verification refuse such a subject as the revocation CLI does, so a Loom token never shares an end user's key or escapes a subject revocation. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…names everyone The mint/verify test verifies the same claims under an ordinary subject first, so the subject alone is shown refused; X-Loom-On-Behalf-Of and grant subjects refuse the slash form too. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]> # Conflicts: # docs/features/memory/retention-and-erasure.md # server/erasure/store/census.py # tests/unit/test_schema_baseline.py
…ys which subjects have aliases - mint-token prints a refusal and exits 2 for a subject spelled like a grant principal, before the keyring read; mint and verify share one message. - has_aliases (server.core.principals) is the one rule alias lookup and the grant cache use, so everyone is never read as a person's spelling. - The collection ops' wire fields carry descriptions; the trusted-caller and grant-principal docs name everyone and the slash form. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…paragraph is rewrapped Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…t cannot read; a bulk grant revoke announces a write whose reply was lost - patch_operations (scim_routes) is the PatchOp reader both SCIM routes use: Operations and each operation's names match in any case (RFC 7643 §2.1), and a missing list or a non-object operation is a 400, not a 200 that changed nothing nor a 503 retried forever. - revoke_subject and forget_granter move the watermark for every write they attempted, so a revoke that landed with its reply lost is still enforced. - Four doc paragraphs rewrapped. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
9 tasks done
… reply is lost is audited - POST, PUT and PATCH /Groups read their attribute names and each member's through scim_routes.lowered (RFC 7643 §2.1), so a PUT spelling Members keeps them instead of emptying the group; a name sent twice in two cases is a 400. - revoke_subject audits every attempted revoke, the row may have landed. - forget_granter counts with an int; the failed-revoke test fake takes the real signature. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]> # Conflicts: # docs/reference/operations.md # docs/reference/schema.md # schemas/schema.sql # sdk/typescript/src/generated/ops.ts # server/settings/_env.py # tests/analyzer/shapes.txt # tests/unit/test_erasure_verify.py # tests/unit/test_schema_baseline.py
…mark Both write the tree through one helper that announces the change in a finally: the row may have landed, and a retry finds nothing left to do, so a detach or a delete is enforced on every replica within one poll either way. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ly is lost grant_cache.announced runs a change's writes and then moves the org's watermark in a finally. Collection move and retire, the erasure's group removal and owner rewrite, and the SCIM group write use it; the SCIM write also audits in a finally. A retry of a write that landed finds nothing to do, so without this the change waited for the cache TTL. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… or failed The step keeps the tree's claim with no collection listed, so a create racing the erasure is rewritten under it, but moves the collections watermark only when rows changed or the rewrite raised (a lost reply may hide one that landed). collections.py uses grant_cache.announced in place. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…an owner The cached collection tree holds parents only, so blanking a user as a collection's creator changes nothing a reader serves; the step keeps its claims (a create racing the erasure is rewritten under them). The sharing page lists the step. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ermark they move Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…and which delete Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]> # Conflicts: # docs/reference/operations.md # docs/reference/schema.md # schemas/schema.sql # sdk/typescript/src/generated/ops.ts # tests/integration/test_cross_principal_leakage.py # tests/unit/test_schema_baseline.py
This was referenced Oct 20, 2026
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.
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):
Knowledge can be shared through collections: nested namespaces that only grants open, shared with a service's end users, SCIM groups, agents or the whole org. A service signs a short-lived token per end user, each user saves into their own collection (
namespace: "@me"), and a revoked grant or removed group member is enforced on every replica within about a second.Why
A chat service in front of Loom today keeps one namespace per tenant and passes
user_idin the request body. Three things don't work with that:loom.conversations. They sit with recorded turns, only the first 2,048 characters are embedded, and the user isn't in either sort key, so one user's saved search scans everyone's.One user's search, measured on ClickHouse 26.9 with the tables' own DDL (3,072-dim vectors; p50 of 5, rows from
system.query_log):"After" reads the user's personal collection for saved items, and their own collection plus three shared ones for documents. It stays flat as the tenant grows.
What changes
The full model is in
docs/architecture/sharing.md.Collections. A collection is a namespace named
col-…;col-me-…is a user's personal one. The prefix is reserved, so the gate recognises a collection by name without a read.check_authorizedsends every collection toserver/auth/sharing.pyfirst: the best role any of the request's principals holds on it or an ancestor (up to 8 levels) decides. Token claims, the org admin role and the code-namespace rules don't open a collection, though an org admin can still request its erasure without reading it. A platform admin passes on every collection, for operator erasure and export. A scoped or delegated token gets no more than its own claim allows, and nothing outside itsns_writeset beyond viewer.New ops (experimental):
collection.create,collection.move(parent: ""detaches),collection.listandcollection.delete, which purges what the collection held before it leaves the tree. Moves are serialised per org, and cycles and depth over 8 are refused.namespace.register,namespace.joinandnamespace.deleterefusecol-names.Principals. Grant subjects can now be
user:<id>,group:<id>,agent:<id>andeveryone. Groups, agents andeveryonecan only be granted collections. Groups come from SCIM/scim/v2/Groups, pushed with an org admin's token; a member is a user id, and deleting a group revokes its grants. An agent's files go in a collection granted toagent:<id>, andknowledge.searchwithnamespaces: [...]reads exactly the collections it names, so one agent's search never reaches another agent's files.End-user tokens. A service registers itself in
LOOM_JWT_END_USER_ISSUERS_JSONwith the orgs it may sign for (names orprefix*, never*, and no two issuers for one org) and its keys, inline or from a JWKS URL. Per request it signs an RS256 token withsub: user:<id>, one listedorg, ajti, an optionalagent: agent:<id>, and a lifetime of at mostLOOM_JWT_END_USER_MAX_TTL_SECONDS(300). Loom verifies it into a viewer of the org with no claim, with reads pinned to that user. A claim that would widen it (namespaces,ns_write,ns_roles,roles,sa,read_scope,read_user_id,creator,parents) is refused. Until an issuer's JWKS has been fetched once, its tokens get a 503, and the fetch is retried every 2 s. An end-user token works on the op endpoint andknowledge.download. Of the ops no namespace gates, it may call onlycollection.create,collection.list,namespace.list_mineandgrants.pending_for_me; MCP,/v1/me/*and the admin routes refuse it, and/oauth/revokerevokes nothing for one, because the issuer picks thejti. End users are revoked per org, withloom revoke-token --subject <org>/user:<id>.Saved items.
namespace: "@me"maps to the user's personal collection. Only that user (and a platform admin) can open it, and it takes no grants. A saved message is a document atchat/<conversation>/<message>, saved and found with the ordinary knowledge ops, chunked and embedded in full.Provenance. Documents and chunks record the agent, the end user, the session and the content's class (migration 058). Knowledge writes accept
agent,session_idand asource_classthat can only be downgraded, andknowledge.searchreturns all three and filters on session and class. Access control never reads them.Revocation within a second. Every grant, group or tree change adds a row to
loom.acl_versions(migration 057). Each process polls the per-org sums everyLOOM_ACL_WATERMARK_POLL_SECONDS(1 s) and drops only what that kind of change made stale. This replaces the same-host write-count file. If polling fails forLOOM_ACL_WATERMARK_MAX_STALE_SECONDS(10 s), a process stops serving cached grants. A write that may have landed even though its reply was lost still moves the watermark.Search.
knowledge.searchreads every readable collection in one statement per leg, with BM25 statistics summed over the set, up toLOOM_KNOWLEDGE_SEARCH_MAX_NAMESPACES(10,000); the rest come back innamespaces_skipped. An end user's search that sets neithernamespacesnornamespace_scopereads only itsnamespace.Erasure. A user erasure now also covers what the user wrote as an end user:
purge: true;loom.blob_uploads);A user-scope
erasure.exportincludes the user's own collection, and every section applies visibility before itsLIMIT.erasure.requestanderasure.exportrefuse auser_idof-,''or*.Alternatives considered (details in the architecture page): an owner column on documents, a separate saved-items table, row ACLs inside one namespace, an ACL key in the sort order, group membership in token claims, and inheritance resolved at write time. Each costs either pruning, consistency or a second store. A timestamp watermark was also ruled out, since a writer's clock skew or a merge keeping the larger version could hide a change; a sum of changes only grows.
Scope and risk
col-),loom.conversationsandrun_id.Compatibility, rollout and rollback
Wire:
collection.create,collection.move,collection.list,collection.delete;/scim/v2/Groups;namespace: "@me";knowledge.searchtakesnamespaces,session_idsandsource_classes, and returnsingested_at,agent,session_idandsource_class;agent,session_idandsource_class.Nothing is removed.
Settings:
LOOM_JWT_END_USER_ISSUERS_JSON(empty means no end-user tokens),LOOM_JWT_END_USER_MAX_TTL_SECONDS(300),LOOM_JWT_END_USER_JWKS_REFRESH_SECONDS(300),LOOM_ACL_WATERMARK_POLL_SECONDS(1),LOOM_ACL_WATERMARK_MAX_STALE_SECONDS(10),LOOM_KNOWLEDGE_SEARCH_MAX_NAMESPACES(10000),LOOM_KNOWLEDGE_SEARCH_FANOUT_KINDS(memory,collection,personal). Knowledge search no longer readsLOOM_MEMORY_SEARCH_FANOUT_KINDSorLOOM_MEMORY_SEARCH_FANOUT_MAX_NAMESPACES: its ownLOOM_KNOWLEDGE_SEARCH_FANOUT_KINDSandLOOM_KNOWLEDGE_SEARCH_MAX_NAMESPACESreplace them, and the default cap for one search goes from 32 namespaces to 10,000. A deployment that tuned either memory setting to limit knowledge search sets the new ones.Operator steps: migrations 057 and 058 run at boot. An existing namespace that starts with
col-is closed to everyone but a platform admin, and the server logs the first 20 at boot.Breaks:
user:,group:,agent:,everyone, in any case, bare or after a/) no longer verifies. List them before upgrading withSELECT DISTINCT subject FROM loom.subject_last_seen WHERE match(lower(subject), '(^|/)((user:|group:|agent:)[^/]*|everyone)$')and re-mint them.X-Loom-On-Behalf-Ofnaming a grant principal (the same spellings) is refused with 403. The header names a Loom subject; an end user comes in through an end-user token.erasure.requestanderasure.exportrefuse auser_idof-,''or*. No person has those ids, and-is on every row written without an end user.Revocation window: a grant change used to reach another process on the same host at once, through the write-count file, and another host within the 10 s cache TTL. Now any process on any host sees it within a second (measured 1.02 s).
Rolling upgrade: N−1 never reads the new tables or columns, and grant changes cross between versions within the TTL. N−1 doesn't know the
col-rule, refuses end-user tokens, drops the provenance columns when it rewrites a document, and resumes a user purge without purging. So, as with SCIM, create collections and register end-user issuers only once no N−1 replica is serving (rule 11 indocs/architecture/rolling-upgrades.md).Rollback: leaves
loom.acl_versions,loom.collections,loom.principal_groups,loom.blob_uploads, the new document and chunk columns andloom.erasure_requests.purgein place, unread.Tests
tests/integration/test_cross_principal_leakage.py, with auth on and off. It runs every read op against a shared parent, its child, a personal collection and@me, as six attackers: a stranger, a revoked user, a removed group member, the same user id in another org, an org admin and another namespace's writer. Nothing leaks, and the owner, a direct grantee and a group member still read the canary.tests/integration/test_knowledge_sharing.py, with auth on and off. It covers:everyone;collection.deletepurging, and user erasure and purge, including an original whose document version was merged away.tests/integration/test_grant_watermark_two_processes.py: a revoke, a member removal and a detach made in one process are enforced by another within the poll interval plus 2 s (3 s at the default).make schema-dumpon a fresh ClickHouse, the analyzer corpus, the unit suite with coverage floors, andmake test-mixed-versionall pass.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. I checked the gate order on every path, the isolation matrix with auth on and off, the watermark with and without its write, the erasure census and the rolling-upgrade behaviour.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.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.