Repository navigation
Conversation
…every org A sign-in token names only the person's own namespaces, and the gate read platform_admin only through the claim, so it refused the person the namespace ops the role stands for; a bot's or a minted token's `*` claim reached every namespace of its own org and none of another's. Own platform authority (not scoped, delegated or impersonated) covers every namespace that is not a repository, in every org, and no grant row caps it, as none caps a `*` claim. Restricted namespaces, collections, mirrors and code stores, repository writes, tenancy and the acted-for check keep their own rules; an `ns_write` claim still bounds writes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The registry snapshot each process holds is refreshed on a timer, so a repository another replica registered a moment ago may not be in it. Platform coverage also asks the kind directory (kind `code`), read fail closed: kinds that cannot be read cover nothing and the refusal is unverified. The docs name the cases platform authority leaves to their own rules and how a `*` claim adds its own org's repositories. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
`IdentityDirectory.is_repository` passed the caught error's text into `ClassificationUnavailable`; `caller_text` gives the code and message a Loom error writes for callers, and `kind_map` has already logged the failure (`test_exception_text_ratchet`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…ind column `namespace.register` takes a namespace's kind from its caller, so a directory row of kind `code` took a standard namespace out of platform authority, though it is no repository and platform authority does not read it. The kinds were also cached per org for 30 s, so a repository another replica added could still be written for that long. A read leaves out the entries this process's configuration and registry snapshot hold, which keeps the member write check the grant's; platform authority reads any other repository anyway. A write also reads the namespace's registry row at the write, under sequential reads, and a registry that cannot be read covers no write. The kind column decides nothing, and the property test's fake `kind_map` keeps its signature. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
The default namespace an MCP call is filled with is one of the caller's own org, but the fill kept a call's explicit org, so a call naming another org and no namespace ran on that org's namesake of the default. Platform authority admits that pair, so the call names its namespace or fails validation naming `namespace`. The gate asks platform authority only where the claim, after its cap, does not cover the namespace, so a write the claim covers reads no registry row. A unit fixture answers the registry read with no row unless a test is marked `registry_rows`, in place of four copies of that stub; tests cover the read itself and the directory's answer. The concept page names platform authority with the role, the gate and the grant cap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
| covered = covered and live is not None and live >= required_role | ||
| # Platform authority covers what the claim does not: no grant caps it, as none | ||
| # caps `*`. | ||
| covered = covered or await _platform_covers(auth, required_role, org, namespace) |
There was a problem hiding this comment.
Grant outage blocks platform admin
Medium Severity
claim_cap now runs before platform authority is applied. On a namespace the token names, a failed grant-map read raises and _platform_covers never runs. A namespace the token does not name skips that read and is still admitted, so a grant outage blocks a platform admin on their own namespaces and not on others.
Reviewed by Cursor Bugbot for commit a3ace4f. Configure here.
`named_claims` returned the claim's names for whatever org a caller asked about, and the namespace resolvers (`resolve_my_namespaces`, `readable_named_claims`, `every_namespace_scope`, `namespace.list_mine`) relied on the gate refusing them in another org. Platform authority reaches another org's namespace of the same name, so an `all_mine` fan-out there read it as the caller's own. `named_claims(auth, org)` returns none outside the token's org (every org for an org-wide token). A code read's lessons default is set after its code scope is applied, and only when the read acts in the caller's org: its plane or scope may be another org's, where the home's name is another namespace. The registry read is one `SELECT active ... LIMIT 1` point read (`CodeRepo.code_repo_active`, with its analyzer shape), and reads nothing with self-service off, where the snapshot reads no registry. The MCP reference names the default-namespace rule. Tests cover the read, the directory's answer, the defaults in another org, and a platform admin's write to another org over HTTP and MCP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…pository - `_platform_covers` returns False for a blank, `-` or `*` org (`cell.ORG_FREE`). `tenancy.ensure_held` passes those, and a platform admin of another org was admitted there. - `code_repo_active` reads `row_kind` and counts no maintainer's `access` row, as the snapshot, the mirrors and `active_code_repo_count` leave it out. Reads and writes then agree on what a repository is. The analyzer shape is regenerated. - A code read's lessons default applies when `org_for_op` is the caller's org or None: a read that names no org anywhere acts in no other org. - `mcp_call` splits `in_home_org` out of `unnamed`. - Tests: platform authority refused in a `*` or `-` org, an access row that is no repository, and a platform admin's `list_mine` in another org listing no claim row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
- `namespace_autoregister.ensure_registered` takes `ownerless`, and the transport hook sets it for a token of another org (not `*`): the row names no owner, at the ownerless version, as for a name in use. A name in a tenant org is not an outside writer's to own. The setting's description, its generated reference, schema and example, and the namespaces page say so. - The gate asks platform authority only where a known grant does not admit the call: a listing or default (`CachedGate`) that hands in a grant reaching the role, with no claim cap over it, reads no registry row. - The `_platform_covers` and module docstrings say plainly what platform authority covers; the concepts page says an `ns_write` claim still bounds its writes. - Tests: the known-grant case, a repository write refused from another org, the HTTP scoped refusal is a 403, the ownerless first write, and an integration case in the leakage suite where a platform admin of another org reads and writes a standard namespace that the same claims under an org admin's roles do not reach. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…andard-namespaces Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com> # Conflicts: # tests/analyzer/shapes.txt
- `_platform_covers` returns False for a sign-in session that is not Loom's own (`session_id` set, `first_party` false). Loom already gives such a session nothing that outlives it (`_only_a_person`, `delegation`), and an admin reach over every org would let it grant lasting access anywhere. The dashboard, `loom login`, bots and minted tokens keep the reach. - An `ns_write` claim bounds platform writes instead of dropping them: a write inside the claim is covered, with no grant capping it. - `_grant_admits` names the known-grant check; `code_repo_active` is `is_registered_repository`; the MCP variable is `takes_default_ns`. - The `LOOM_PLATFORM_ADMINS` description names what the role reaches; the security page says a third-party session has none of it and that tracker namespaces are in reach. Generated settings files are regenerated. - Tests: the third-party session at every role in both orgs, a capped claim inside `ns_write`, and the integration case reads back the ownerless registry row with `namespace.get`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
| if org in ORG_FREE or not is_own_platform_admin(auth): | ||
| return False | ||
| if auth.session_id and not auth.first_party: | ||
| return False |
There was a problem hiding this comment.
Third-party admins bypass namespace gate
High Severity
A third-party platform-admin session is excluded only inside _platform_covers. reads_every_namespace and sharing.check still admit any platform_admin, so that session still reads every standard namespace through org rollups and administers every collection. Those paths return before the new check, which is the lasting cross-org access this change is meant to stop.
Reviewed by Cursor Bugbot for commit a3bf994. Configure here.
- The MCP screen drops a `loom_search` namespace, and a call naming another org takes no default, so such a search failed validation with no way to name one. `_bind_caller_identity` now addresses it through `_address_home` from that org's fan-out, at either scope, the namespace named after the caller first; it fails validation only when the caller reaches none there. - `docs/reference/mcp.md` says what a call naming another org and no namespace does per op: a required namespace fails validation, an optional one runs org-wide, `loom_search` searches that org's fan-out. - `security.md` names the ownerless first write from another org; the `LOOM_PLATFORM_ADMINS` description is reworded and regenerated. - Tests: `loom_search` naming another org through the MCP screen and the binding; `test_delete_by_key.py`'s source check names the new condition. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
- `_address_home` re-raises a fan-out failure when no default filled the namespace: with nothing to fall back to, the failure is the server's (a 503), not a validation error asking for a namespace the caller cannot name. A filled default still stands, as before. - A search it addresses with no default carries the `namespace_defaulted` note when the namespace is not the caller's own. - The call-site condition reads without a double negative, and the comment and docstring say what an op with an optional namespace does and that the caller's home is picked first. - Tests: the note, the fan-out failure in another org and in the caller's, and an optional-namespace op naming another org. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
❌ 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 72dd287. Configure here.
- `_address_home` reads the namespace as the gates do (a blank or "-" names none), once. With none named, a fan-out failure is the server's: a `LoomServerError` raises as is, anything else as `BackendUnavailableError` from it, so no bare 500 escapes the call or drops a batch's other answers. The refusal is ledgered against the token, as a failed defaults read is. - `test_delete_by_key.py` stops pinning the call site's source text; a behaviour test covers a filled default moving to the caller's home. - Tests: a raw error with no, "-" or blank namespace answers `BackendUnavailableError`, the refusal row, and the filled default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
A call naming another org takes no default namespace, but a blank, whitespace or "-" value it sent stayed in its arguments, so the op ran on that literal namespace of the other org. The binding drops it there (`_in_home_org`): an op that requires a namespace fails validation naming it, as over HTTP. A namespace refusal in another org does not advise omitting the namespace, which would only fail validation there. A fan-out that cannot be read for such a search is logged, and a server error is re-raised as is. The source-text test of the search call site is gone, behaviour tests cover it, and the CachedGate docstring names the registry read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
`maybe_autoregister` reads the token's org to decide whether a first write records an owner, and two tests stood in a caller with a subject alone. Each stand-in names the org the move lands in, and the `ensure_registered` stub takes `ownerless`, asserted false for a token of that org. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…andard-namespaces
A loom_search naming an org another cell holds, or a new org name past the limit, raised WrongCellError or ValidationError out of the binding, before any phase that frames them, so the call escaped `_call_tool` unframed. `_call_tool` answers them as tool errors with their code, as the gate would; only a server fault logs. A call with no token on a single-user server takes the install's namespace whatever org it names, as HTTP fills it. `_in_home_org` is a predicate again, and the binding drops a blank namespace on its own line. The namespace refusal text is plain branches. The corpus is regenerated after merging main: main's knowledge_sources read was not listed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…andard-namespaces
…d it
The binding read a padded org (" acme ") through `present` and took the
call as one in another org, but `_address_home` read the fan-out of the
padded name, which holds nothing, so the search failed validation where
"acme" searched. It reads the org through `present` too.
The MCP screen passes whether the call names another org into its
namespace check, from the org it already read, and a test through the
screen covers the refusal text there. The binding names the
"another org, no namespace" check once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>


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):
A platform admin signed in to Loom (the dashboard,
loom login) reaches every namespace of every org that is not restricted and not a repository, as the role's admin views already did, instead of being refused on namespaces its sign-in token does not name. Minted and bot platform-admin tokens reach the same namespaces, which includes other orgs' standard namespaces; a third-party MCP client's OAuth session does not. An MCP call that names another org and no namespace takes no default namespace, rather than running on the caller's default namespace name in that org: an op that requires a namespace fails validation naming it, one with an optional namespace runs org-wide there, andloom_searchsearches the caller's namespaces of that org.Why
A person listed in
LOOM_PLATFORM_ADMINSsigns in with a token whosenamespacesclaim names only their own namespaces (login._identity_from_rows) and whose role isplatform_admin._check_authorized_claimshonoured the role only through that claim:auth.can_access/auth.can_writeneed the namespace named, or*in the token's own org. So the gate refused, with "(JWT namespaces + no grant)", every namespace op on a namespace the person holds no grant on. Where the token named a namespace and the person held a lower grant there,claim_capcapped the claim to that grant, so a platform admin who is a viewer member of a namespace was a viewer there. Meanwhile:roleOnNamespace,hasAdminClaim) shows a platform admin as admin of every namespace, so the admin controls it offers were refused by the server;context.reads_every_namespacereads any org whole for a platform admin, andsharing.checkadmits it to every collection, whatever the claim;--platform-adminbot's and aloom mint-token --platform-admintoken claim*, which covers every namespace of the token's own org and none of another org's.Reproduction against
main, with the claim cap, restricted check, code read, grant lookup, acted-for check and tenancy stubbed out:check_authorized(AuthInfo(subject="ada@example.com", org="o", namespaces=("personal-ada",), roles=(PLATFORM_ADMIN,)), ADMIN, "o", "team")is refused, and so is the same call on orgother. The same token withnamespaces=("*",)is admitted ono/teamand refused onother/team. On this branch all four are admitted.Design
The role spans every org, so the gate reads it as the principal's own authority rather than through the namespace claim. In
_check_authorized_claims,_platform_covers(auth, required_role, org, namespace)is true forauthz.is_own_platform_admin(auth)on a namespace that is not a repository, in an org that names a tenant: a blank,-or*org (cell.ORG_FREE, whichtenancy.ensure_heldpasses) gets none. The gate asks it only where the token's claim, afterclaim_cap, does not cover the namespace. Where it holds:*claim covers its own org's, for every org;*claim is never capped either:names_namespaceignores*, soclaim_capreturns None for it.A write the claim already covers (a
*bot in its own org, a session in its own namespace) never asks it, so it reads no registry row. Neither does one a known grant admits: a listing or default (CachedGate) hands the grant in, and where it reaches the role and no claim cap overrides it, the grant step admits the call and platform authority is not asked.Unchanged, because each branch returns before this step or the predicate excludes it:
is_reserved_name) is refused first;sharing.check;_check_delegated;_check_restricted, where platform authority stays limited to repository viewer reads;_platform_repository_read): writes, refreshes and administration of an index keep the claim and grant checks;ns_roles), delegated (creator,parents) and impersonated tokens are not own platform authority (is_own_platform_admin), so they gain nothing;check_acted_forandtenancy.ensure_heldrun first, so a cell still serves only the orgs it holds;ns_writeclaim still bounds its writes, as it bounds a*claim's.What counts as a repository depends on the role asked:
code_entry), with no I/O. Platform authority reads every repository anyway (_platform_repository_read), so a repository the snapshot does not hold yet costs nothing. Leaving out the snapshot's entries keeps the member write check (member_writes, a viewer check withallow_repository_read=Falsethat runs only on those entries) the grant's.loom.code_reposrow read at the write, undersequential_reads()(NamespaceDirectory.is_repository,repo_registry.registered). The snapshot is refreshed every 30 s, so a repository another replica added a moment ago is in the registry before it is in the snapshot. The read fails closed: when the registry cannot be read, platform authority covers no write, the grant check decides, and a refusal is marked unverified. Only an own platform admin's write that its claim does not cover, on a namespace with no snapshot entry, pays this read:SELECT active, row_kind ... LIMIT 1on the(org, namespace)ordering key ofloom.code_repos(CodeRepo.is_registered_repository, with its analyzer shape). A maintainer'saccessrow names no repository, as the snapshot, the mirrors andactive_code_repo_countleave it out, so reads and writes agree on what a repository is. With self-service off it reads nothing, as the snapshot reads no registry then.authz.CachedGate, starting with the person's saved dashboard pick at writer (caller_home._pick_default). For a platform admin whose saved pick is a namespace only platform authority reaches (no claim and no grant admits a write there), every MCP call, reads included, pays this one registry read while it picks the default: one point read ofloom.code_reposper call, on a single node too, plus the sequential-consistency wait on a replicated cluster (sequential_reads()sets the consistency flag; it adds no read).CachedGatealso decides proposal review and the visibility of unapproved definitions, so it keeps the write rule rather than answering from the snapshot alone. The same holds for a platform admin's org-wide rollup that asks the gate at admin per namespace:learnings.qualitywithout a namespace checks each namespace holding unapproved drafts (learning_access.private_candidates_visible), so one with no claim or grant there pays one such read per namespace, one after another. Onmainthose checks were refused from the cached grant maps with no read. Reading the org's registry namespaces once per rollup would remove the per-namespace cost; it is not done here.CachedGatedoes not memoize the read (its docstring says the gate reads it at each such check): within one gate a namespace is asked at most twice (the assistant's role probe asks admin, then writer, of a repository), and a per-gate memo would not reduce the rollup's one read per namespace, which only the batched read would.kinddecides nothing.namespace.registertakes it from its caller, so a namespace admin could otherwise mark a standard namespacecodeand take it out of platform authority, which would not read it either.claim_capitself is unchanged; platform authority overrides its cap at the gate's call site, where the namespace is known to be standard.claim_capalso feedslive_claims(thejwtrows ofnamespace.list_mine), which does not check restriction: exempting there would list a restricted namespace the gate refuses. As a result,namespace.list_minemay leave out thejwtrow of a namespace a platform admin's token names after its grant there was revoked, though the gate admits it. That is an omission, not an exposure, and the dashboard does not read those rows for an admin claim.Alternatives
namespace.list_minefor a platform admin and lock controls on every namespace without a grant. That costs a platform admin a grant on each namespace they administer. It also keeps the gate disagreeing with the role's documented span ("spans every org"), the org-wide rollups and the collection gate, and leaves a person, a bot and a minted token with different reach under one role.*into a platform admin's sign-in claim. A*claim covers only the token's own org, so another org stays refused. It would also change what every listing built from named claims shows for that session, and the refresh path would have to re-derive the claim as well as the role.claim_cap. Rejected for thelive_claimsreason above.kindcolumn. The column is caller-declared, and the kinds are cached per org for 30 s, so it would both shrink platform authority on request and leave the same write window.Scope and risk
This is an auth-model change, and it widens reach. Every own platform-admin token (a signed-in person, a
--platform-adminbot, aloom mint-token --platform-admintoken) reaches the standard namespaces of every org the deployment holds, at the role's level, without a grant there. Minted and bot platform-admin tokens reached only their own org's namespaces before. Consequences:*claim's. Removing the person fromLOOM_PLATFORM_ADMINS(an OAuth refresh re-derives the role), disabling the bot, or revoking the token does.is_own_platform_admin, andtests/integration/test_cross_principal_leakage.pyprobes as another namespace's writer and viewer and as another org. Its new case checks the one widening: a platform admin of another org reads and writes a standard namespace, and the same claims with theadminandwriterroles reach nothing.namespace_autoregister.ensure_registered(ownerless=True), the row a write into a name in use leaves): a name in a tenant org is not an outside writer's to own, so only an admin of that name completes its registration. A first write in the admin's own org, or by an org-wide (*) token, keeps its writer as owner, as before.docs/features/namespaces-and-sharing.mdand the setting's description say so.session_idset,first_partyfalse:oauth.pysetsfirst_partyonly for Loom's own sign-ins) gets no platform reach (_platform_covers); it keeps its claim and its grants. Loom already gives such a session nothing that outlives it: it registers no bot and links no sign-in (admin_account_routes._only_a_person), and its children end with it (delegation). An admin reach over every org would let it create lasting grants anywhere. The dashboard's password sign-in (no session), its SSO session andloom login(bothfirst_party) keep the reach. The repository read authority (_platform_repository_read) is unchanged.tracker.source.*, at admin) included, as for a*claim in its own org.security.mdsays so.mcp_call._bind_caller_identity), for every token, an org-wide one's included (a call with no token, on a single-user server, takes the install's namespace whatever org it names, asgates.with_single_user_identityfills it over HTTP): the default is a namespace of the caller's own org, so the call names its namespace; else an op that requires one fails validation namingnamespace, and one with an optional namespace runs org-wide in that org.loom_search, whose namespace the MCP screen drops, searches the caller's namespaces of that org instead (_address_homefrom that org's fan-out, the one named after the caller first), and fails validation namingnamespacewhen it reaches none there. A fan-out error there is answered as raised, with a token-attributed refusal row as for a failed defaults read, since no default stands in: a server fault, or any failure that is not Loom's (a raw driver error, a bug) asBackendUnavailableError, answers a 503 and is logged; the caller's own (an org another cell holds,WrongCellError, or a new org name past the limit, the two caller errorstenancy.ensure_heldraises beside thePermissionErrorthe fan-out's gate reads as a refusal) answers a tool error with its code, as the gate would. The fan-out is read for the org as the gates read it, so a padded org is that org. A blank or-namespace names none there, as the gates read it: the binding drops it, so the op never runs on that literal namespace of the other org. A namespace refusal in another org names the grant to request and never advises omitting the namespace (mcp_auth._not_accessible_result(away=True)), as omitting it would only fail validation there. A search that lands on a namespace not named after the caller carries thenamespace_defaultednote, as a defaulted one does; onmainanall_minesearch (its default scope) was re-addressed the same way when it reached any, and athissearch ran on the namesake. Without this, a platform admin'sloom_memory_set {"org": "other"}would land on the other org's namesake of its own default.docs/reference/mcp.mdsays so.lesson_namespaces) is set after the connection's code scope is applied, and only when the read acts in the caller's org or names none anywhere (gates.org_for_opis the caller's org or None): a code plane or scope of another org would read that org's namesake of the home.context.named_claims(auth, org)). In another org, theall_minefan-out (resolve_my_namespaces),readable_named_claims, the org rollups' refused-claim list (every_namespace_scope) and thejwtrows ofnamespace.list_minetake none of them.roles, so one that carriesplatform_admingets this reach as any own platform-admin token does; and an SDK or CLI that sends its own default namespace with an explicitorgnames that namespace on the wire.context.reads_every_namespace) and the collection gate (sharing.check) testhas_role(PLATFORM_ADMIN), notis_own_platform_admin, so a scoped or impersonated token with that role passes them. This PR does not change that, and the gate does not admit those tokens. The collection gate also admits a third-party client's session holding the role, so such a session can still create collection grants in any org (grants.createon a collection); it is the samehas_rolecheck and is left to the same follow-up.Tests whose expectations encoded the narrow reach are changed, not loosened:
test_erasure_authz_matrix.py: a platform admin of another org may already request the erasure ofo/Aando/B. Its namespace export and namespace-saga status of those namespaces change from refused took. Itsuser_idandnamespace_liststatus stay hidden, since they need a token of the saga's org.test_blacklist_authority.py: the "hides another namespace's pattern" case no longer runs forPLATFORM_ADMIN. A test asserts instead that a platform admin sweeps that namespace's pattern.test_platform_admin_repository_read.py: the two registry tests classify their unregistered name as restricted, so the registry entry stays the only thing that admits the read. An unregistered standard name is one platform authority reaches.test_default_namespace_gate_property.py: its oracle takes a token's claims as namespaces of its own org (every org for an org-wide token), asnamed_claimsdoes, so a token of another org holding the platform-admin role names none of the world's org; the minted home of a delegated*token is still read off the claim as sent, ascaller_home.minted_homereads it.tests/unit/conftest.py: an autouse fixture answers the registry read with no row, as unit fakes answer statements by shape, unless a test is markedregistry_rows(pyproject.toml). Without it a platform-admin write outside its claim would take the unreadable branch and refuse, so a test still expecting the narrow reach would pass for the wrong reason.Compatibility, rollout and rollback
namespacetakes no default namespace for every token, an org-wide one's included (not a call with no token on a single-user server), where it ran on the caller's default namespace name in that org: an op that requires a namespace answersVALIDATION_FAILEDonnamespace(a client that meant that namespace names it), one with an optional namespace runs org-wide there, andloom_searchsearches the caller's namespaces of that org.LOOM_PLATFORM_ADMINSdescription in the configuration reference names this reach, so an operator can check that everyone listed should hold it.Tests
pytest -n 8 -p randomly):test_platform_admin_repository_read.py,test_readable_named_claims.py,test_default_namespace_gate_property.py,test_blacklist_authority.py,test_erasure_authz_matrix.py,test_exception_text_ratchet.py,test_package_contracts.py,test_doc_links.py,test_public_copy.py,test_mcp_default_namespace.py,test_absent_org_runs_under_target.py,test_list_mine_inherited.py,test_delete_by_key.py,test_mcp_assistant_toolset.py,test_mcp_home_namespace.py,test_memory_code_plane_reads.py,test_policy_after_read_scope.py,test_request_id_binding.py,test_namespace_autoregister.py,test_admission_parity.py,test_settings_reference.py,test_namespace_restore_existing_target.py,test_mcp_named_identity.py,test_agent_instructions.py,test_namespace_resolve.py,test_mcp_worker_live_privacy.pyand the five modules below, on the branch merged withmain: 1545 passed (with theloom_searchmodules,test_all_mine_fanout.pyandtest_delete_by_key.py). Theloom_searchmodules aretest_loom_search_home_answers_first.py,test_loom_search_fanout_kinds.py,test_loom_search_mcp_render.py,test_mcp_readonly_toolset.py,test_mcp_client_provenance.pyandtest_search_default_mode.py;test_delete_by_key.pydrops its source-text test of the call site: the behaviour tests intest_mcp_default_namespace.pycover when the home is chosen. Settings modules (test_live_settings.py,test_settings_defaults.py,test_settings_env_contract.py,test_settings_file.py,test_settings_every_field_read.py,test_settings_reference.py): 61 passed. The modules whose directory fakes implementcode_entryand notis_repository(test_delegation.py,test_request_sli.py,test_sa_inherit_flag_gate.py,test_connected_source_authority.py,test_mcp_prescreen_org_readable.py) are among them. Intest_namespace_autoregister.py, a first write from a token of another org records no owner, at the ownerless version, and the hook passesownerlessonly for that token, not for one of the org or an org-wide one. Added cases cover a platform admin reaching a standard namespace at viewer, writer and admin, in its own org and another. Scoped, impersonated and delegated platform-admin tokens are refused. A viewer or revoked grant on a named namespace does not cap the admin, while the same claim under anadminrole is capped. Anns_writeclaim bounds writes. A repository with a registry row the snapshot does not hold is read with no row read and refused for writes. A namespace whose directory row sayscodewith no repository entry is reached at every role. An unreadable registry refuses a write, unverified, and leaves reads alone. A write the claim covers reads no registry row, nor does one a known grant admits, while a known grant below the role still asks it (that case fails without the known-grant check). A repository write is refused in the admin's own org and from another org. A third-party client's session gets no platform reach at viewer, writer or admin, in the admin's org or another, while the same session markedfirst_partykeeps it. Within anns_writeclaim no grant caps platform writes, and a write outside it is refused (these seven cases fail without the two checks). Platform authority covers nothing in a*or-org, at viewer or writer (these four cases fail without theORG_FREEcheck). The registry read counts only an active row that is not a maintainer'saccessrow; a configured entry is a repository with no read, and an unreadable registry raisesClassificationUnavailable. A dashboard-shaped platform-admin token writes another org's standard namespace over HTTP and MCP, and the same token scoped is refused (403 over HTTP). Restricted namespaces at viewer and admin, collections (registered as a repository or not), mirror names, tenancy and SCIM provisioning refuse as before. Withmain'sserver/auth/authz.py, the 9 reach, cap andns_writecases fail. Intest_mcp_default_namespace.py, a platform admin's and an org-wide token's call takes the default namespace only in the caller's org, a code read's lessons default only when the read acts in the caller's org or names no org (cases: the caller's code plane, a code plane or a code scope of another org, an explicit other org;test_memory_code_plane_reads.pycovers a read with no org anywhere), and an MCP call naming another org and no namespace answersVALIDATION_FAILEDonnamespacewithout reaching the handler, with the key absent, blank, whitespace or-(the last three ran the handler on that literal namespace before the binding dropped it). Aloom_searchnaming another org whose fan-out raisesWrongCellErroror aValidationErroranswers a tool error with that code and one refusal row, never reaching the handler (both cases raised out of_call_toolbefore the catch). A call with no token naming another org takes the install's namespace, the key absent or-(both failed validation before). A search naming a padded org (acme) reads that org's fan-out (it read the padded name's, which holds nothing, before_address_homeread the org throughpresent). Through_screen_tool_call, a refused namespace in another org, plain or padded, names the grant alone, while in the caller's org, named or not, it keeps the omit advice (the two away cases fail when the screen does not passaway). Intest_error_envelope.py, a namespace refusal in another org names the grant and not omitting the namespace, on the assistant toolset and the others, while one in the caller's org keeps that advice. Aloom_searchnaming another org, through the MCP screen and the binding, atall_mineandthis, for a platform admin and an org-wide token, searches the caller's namespace of that org named after it, else the first of that org's fan-out, and none when it reaches none (these six cases fail without the call-site change). The same search notes a namespace that is not the caller's own, raisesBackendUnavailableErrorwith one refusal row when that org's fan-out cannot be read (a rawRuntimeErrortoo, with no namespace,-or blank), while one in the caller's org keeps its default and writes no row; a filled default moves to the caller's home among the fan-out; and an op with an optional namespace (learnings.quality) naming another org binds with none and validates (the note, raise, wrap and ledger cases fail without their lines). Intest_readable_named_claims.py, a platform admin of another org readsteamthrough platform authority while neither its named claims nor itsall_minenamespaces there include it. Intest_list_mine_inherited.py, a platform admin listing another org gets nojwtrow for its own claim's name (it fails without the org rule innamed_claims).main's tip), with-n 8 -p randomly:test_mcp_default_namespace.py,test_error_envelope.py,test_access_refusal.py,test_request_sli.py,test_all_mine_fanout.py,test_delete_by_key.py,test_platform_admin_repository_read.py,test_namespace_autoregister.py,test_list_mine_inherited.py,test_transport_layering.py,test_package_contracts.py,test_public_copy.py,test_doc_links.py,test_knowledge_move.py,test_mcp_defaults.py,test_mcp_home_namespace.py,test_mcp_named_identity.py,test_mcp_prescreen_org_readable.py,test_mcp_refusal_codes.py,test_mcp_loom_op.py,test_mcp_code_scope.py,test_mcp_assistant_toolset.py,test_mcp_auth_error_redaction.py,test_mcp_memory_repo_tag.py,test_mcp_unauthenticated.py,test_cell_tenancy.py,test_memory_code_plane_reads.py,test_readable_named_claims.py,test_default_namespace_gate_property.py,test_loom_search_home_answers_first.py,test_loom_search_fanout_kinds.py,test_loom_search_mcp_render.py,test_search_default_mode.py,test_mcp_readonly_toolset.py,test_mcp_client_provenance.py,test_exception_text_ratchet.py,test_degraded_unnoted.py,test_mcp_worker_live_privacy.py,test_namespace_resolve.py,test_repo_at_branch.py,test_absent_org_runs_under_target.py: 1388 passed. The function-length gate stays at its baseline (52 in 48 files).namespace_autoregisteror reachesmaybe_autoregister(gates.authorize,knowledge.move, the upload routes), 41 modules, withtests/analyzer: 1491 passed, 2 skipped, on this head.test_knowledge_ingest.py,test_mirror_names_refused.pyandtest_store_names_refused.py(98 failures) fail locally the same at the merge base, in this local environment, and CI runs them.test_knowledge_move.py: two stand-ins for the caller named a subject and no org, which the ownerless rule reads; each names the org the move lands in, and itsensure_registeredstub takesownerless, asserted false for a token of that org.test_cross_principal_leakage.py, the auth-on isolation part in CI; not run locally, as no local server is up): a platform-admin token of another org reads the seeded canary of a standard namespace and writes a fresh one, read back field by field (actor,source_class, identity tuple), while a token with the same claims underadmin/writerroles reads nothing and is refused the write withAUTH_INSUFFICIENT;namespace.getthen shows the fresh namespace registered with no owner and taggedauto-registered.every_namespace_scopein another org. There, for a platform admin, the gate admits every claimed name that the restricted, collection and reserved-name clauses do not already hide, so its refused-claim list is empty with or without the org rule, and a test could not fail.make format,make lint: pass.make typecheck: the mypy gate reports two files this diff does not touch (server/clients/mcp_source.py,server/llm/vertex_auth.py; missing stubs in the local virtualenv) and nothing in it.pytest tests/analyzer(no ClickHouse, so theEXPLAINchecks skip; CI runs them): 10 passed.shapes.txtwas regenerated with no.envand fake providers, and adds the oneis_registered_repositoryshape (SELECT active, row_kind ...). The branch mergesmain; the regenerated corpus differs frommain's by that one shape.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. The reproduction was run against
mainand this branch, the new tests were checked to fail onmain's gate, and every changed test expectation was traced to the rule above.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.docs/reference/configuration.md,schemas/loom-settings.schema.json,loom.example.yaml,tests/analyzer/shapes.txt): the SDK op tables,docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump), the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py) and the standalone skill bundles (python3 scripts/codegen/standalone_skills.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.🤖 Generated with Claude Code