Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
47210f6
grants: invite a person to a namespace by handle or email, with a sin…
zlareb1 Dec 4, 2026
15c46f0
grants: accept an invitation from Namespaces in your org; SDKs, refer…
zlareb1 Dec 4, 2026
a795273
dashboard: invitation result and open invitations components
zlareb1 Dec 4, 2026
d701590
docs: list namespace_invites with the identity tables of the Postgres…
zlareb1 Dec 4, 2026
a81aa67
grants: limit invitation emails per inviter and per address
zlareb1 Dec 4, 2026
4bfde3d
settings: an invitation link's lifetime and the mail server timeout
zlareb1 Dec 4, 2026
08cc874
docs: invitations in the tokens and grants guide
zlareb1 Dec 4, 2026
2cd6ce7
dashboard: route a person's handle or email through grants.invite
zlareb1 Dec 4, 2026
4e9efe3
dashboard: an accepted collection invitation opens the collection in …
zlareb1 Dec 4, 2026
f453aa8
settings: pin the invitation and mail defaults
zlareb1 Dec 4, 2026
55c4b6a
test(dashboard): an accepted invitation reads list_mine again at once
zlareb1 Dec 4, 2026
60de11d
dashboard: the add field's help and the docs say what an invitation b…
zlareb1 Dec 4, 2026
ee00959
grants: keep the downgrade refusal's role as a field; SDK surface sna…
zlareb1 Dec 4, 2026
8fc527d
grants: an open invitation keeps its name in use
zlareb1 Dec 4, 2026
503539f
grants: audit an acceptance without its secret; test the SMTP transpo…
zlareb1 Dec 4, 2026
ddc8816
grants: an invitation never outlasts its maker's admin, nor admits a …
zlareb1 Dec 4, 2026
9c6b8b6
docs, dashboard: invitations as they now work
zlareb1 Dec 4, 2026
2932ef5
grants: invitations stand on the maker's admin grant at both ends
zlareb1 Dec 4, 2026
d913e99
docs: regenerate the grants reference
zlareb1 Dec 4, 2026
0df12b8
grants: an email is held only through a verified tie
zlareb1 Dec 5, 2026
672d202
grants: a link stands only while its maker would authorize a token
zlareb1 Dec 5, 2026
6660cd9
Merge origin/main into feat/namespace-invites
zlareb1 Dec 5, 2026
ffc3529
Merge origin/main into feat/namespace-invites
zlareb1 Dec 5, 2026
b55e8cb
Read the reopen's grant with sequential consistency, and keep the lin…
zlareb1 Dec 5, 2026
84ac002
Reopen a link after a cancelled or lost accept, and list only links t…
zlareb1 Dec 5, 2026
bfea13a
Stop an end user's links with their revocation, and name the gateway …
zlareb1 Dec 5, 2026
431729a
Merge origin/main into feat/namespace-invites
zlareb1 Dec 5, 2026
62c596f
Close a link a cancel meets mid-accept, and test the accept's own guards
zlareb1 Dec 5, 2026
9b1bb52
Merge origin/main into feat/namespace-invites
zlareb1 Dec 5, 2026
8d6d9e8
grants.invite: keep pasted and storage-refused links; cover invites i…
zlareb1 Dec 5, 2026
f2dd8af
grants.invite: let a second pasted link be accepted; leave a set-asid…
zlareb1 Dec 5, 2026
3a957c4
grants.invite: keep a link pasted during another's accept; say when t…
zlareb1 Dec 5, 2026
437afe3
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
93bcbca
grants.invite: key the card's busy state to its link; report a failed…
zlareb1 Dec 5, 2026
f994331
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
375a518
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
ce200b6
grants.invite: date and id the mail, bound the whole send, test the c…
zlareb1 Dec 5, 2026
a591a66
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
52d096b
grants.list_invites: say when the newest 200 were all that was read
zlareb1 Dec 5, 2026
0eaf7c2
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
4e8d3b8
grants.list_invites: show the cut line on an empty list; name the SDK…
zlareb1 Dec 5, 2026
badda5c
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
d6bfe7c
grants.invite: mail an IDNA domain, read held handles past other repl…
zlareb1 Dec 5, 2026
f8e28cf
grants.accept_invite: say a namespace-scoped token is refused; keep a…
zlareb1 Dec 5, 2026
c5e0f6f
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
3218e8c
identity: read an active namespace sequentially, name only a person i…
zlareb1 Dec 5, 2026
0c52a48
identity: leave a service account acting as itself out of the invitat…
zlareb1 Dec 5, 2026
7f03568
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
0a27dc6
identity: name the person a trusted caller invites for
zlareb1 Dec 5, 2026
69f3068
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
fdf6943
identity: refuse an invitation accepted by a trusted caller for someone
zlareb1 Dec 5, 2026
2dbd1ed
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
85c0a2b
test: keep the delegated trusted caller's mail case on one line
zlareb1 Dec 5, 2026
7199966
invitations: list stopped links, grant a verified email handle, guard…
zlareb1 Dec 5, 2026
4b19da9
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
eb9b473
invites: grant a verified email under its stored handle, and say what…
zlareb1 Dec 5, 2026
81bc34c
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
efaf7c6
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
be8d41d
invites: keep no superseded link after a held one is dropped, and tes…
zlareb1 Dec 5, 2026
6d5ff47
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
cdc4b7f
invites: answer an accepter who opens a used link again, and refuse a…
zlareb1 Dec 5, 2026
d78b953
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
92cb015
invites: cap invitation mail per org, and count an address's +tags as…
zlareb1 Dec 5, 2026
2d9ea09
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
1dd8ad3
invites: grant an email-handle account's verified contact email under…
zlareb1 Dec 5, 2026
d84e03c
invites: take an email account's handle from its verified row
zlareb1 Dec 5, 2026
06f8d11
Merge origin/main into feat/namespace-invites
zlareb1 Dec 5, 2026
41a4795
invites: read an email's account once and fold dots into the mailbox
zlareb1 Dec 5, 2026
200b7ff
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
73938dc
invites: test the order the mail limits count in
zlareb1 Dec 5, 2026
ab1aded
dashboard: drop a namespace's open invitations when the dialog moves on
zlareb1 Dec 5, 2026
f7307fa
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
b667d5a
settings: refuse a mail_from the email would send as two mailboxes
zlareb1 Dec 5, 2026
148da10
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
bd7bd1a
invites: answer the accepter after a cancel; refuse a non-ASCII sender
zlareb1 Dec 5, 2026
6100832
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
fddc564
invites: a link closed during its failing accept names no accepter
zlareb1 Dec 5, 2026
035b46e
invites: name the unclaimed state on the invitation, test its erasure…
zlareb1 Dec 5, 2026
46aac45
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
1145da8
invites: drop the unread changed_at column; cover the SSO check and t…
zlareb1 Dec 5, 2026
bd9542d
Merge origin/main into feat/namespace-invites
zlareb1 Dec 5, 2026
e671253
The index chunk carries no modulepreload polyfill
zlareb1 Dec 5, 2026
3420b5d
grants.invite names the subject its grant is written under
zlareb1 Dec 5, 2026
3c4da94
Merge origin/main into feat/namespace-invites
zlareb1 Dec 5, 2026
41a1717
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
4c5cde9
An invitation's Copy link stays in the link's row
zlareb1 Dec 5, 2026
55bbf97
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
0dd018e
The analyzer corpus holds the merged schema.sql's shape
zlareb1 Dec 5, 2026
06f165c
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
d14a966
A cancelled invitation stays off the open list after a late read
zlareb1 Dec 5, 2026
28d14a1
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
1e90ce6
A link's card comes down once its invitation is cancelled from the list
zlareb1 Dec 5, 2026
1041746
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
4172df4
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
73372c3
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
e608090
rolling-upgrades keeps the last line of rule 89
zlareb1 Dec 5, 2026
e30505b
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
1ed8191
onClosed's parameter is inviteId, as OpenInvitations declares it
zlareb1 Dec 5, 2026
e207495
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
2fc2569
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
ec705f3
Invitation docs say a link stands on its maker's grant
zlareb1 Dec 5, 2026
dd35e3c
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
337cff4
Invitation text claims only what the code does
zlareb1 Dec 5, 2026
c1afcb8
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
93f64e2
A mail server URL with no host or a bad port is refused at load
zlareb1 Dec 5, 2026
e5e44ad
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
a9172b8
A refused mail server URL keeps its password out of the error
zlareb1 Dec 5, 2026
aeebbf6
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
ec7460d
An invite's grant answer names the subject its one write stored
zlareb1 Dec 5, 2026
bed36de
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
e871737
The invitations migration is 135, after main's latest
zlareb1 Dec 5, 2026
b677c0c
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
cf6c013
Merge origin/main; the index chunk keeps the modulepreload polyfill
zlareb1 Dec 5, 2026
d9435f4
The invitations migration header names every write of a row
zlareb1 Dec 5, 2026
846378e
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
2208858
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 5, 2026
7917549
A stopped link is described as admitting again once its maker stands
zlareb1 Dec 5, 2026
aa5c844
A stopped link is described by what it does now, whatever stopped it
zlareb1 Dec 5, 2026
85e5ce7
The accept refusal names a deleted namespace; stopped is the maker's
zlareb1 Dec 6, 2026
d447373
A refused invitation link gets Accept back when it is opened again
zlareb1 Dec 6, 2026
b3d21a6
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 6, 2026
96687ed
invites: say grants, not one grant, where a link's maker is read
zlareb1 Dec 6, 2026
7d6260f
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 6, 2026
e16a82e
invites: grant an accepted link through store_grant
zlareb1 Dec 6, 2026
147da45
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 6, 2026
ea30f9a
grants: say what store_grant writes, and drop the op list from the mo…
zlareb1 Dec 6, 2026
9c9cdf5
invites: read an accepted link before taking its lease
zlareb1 Dec 6, 2026
dcdf588
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 6, 2026
5796be1
dashboard: keep an invitation link only when it names a namespace and…
zlareb1 Dec 6, 2026
48e882e
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 6, 2026
9ebfbf8
dashboard: keep an invitation link to any namespace name the server r…
zlareb1 Dec 6, 2026
5153acb
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 6, 2026
0abff45
invites: open every link the server makes, and send mail on its own t…
zlareb1 Dec 6, 2026
2c04682
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 6, 2026
e59a348
invites: name a namespace in the email only as the server names one
zlareb1 Dec 6, 2026
d6a81fd
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 6, 2026
96da277
invites: answer an accepter again only once the link's role is in place
zlareb1 Dec 6, 2026
09904af
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 6, 2026
a01472f
mcp: say when grants.accept_invite answers its accepter the role they…
zlareb1 Dec 6, 2026
91039db
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 6, 2026
2522549
grants: say when accept_invite answers its accepter again in the op's…
zlareb1 Dec 6, 2026
118f11d
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 6, 2026
368b151
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 6, 2026
a8aafa7
docs: restore the last line of rolling-upgrade rule 99
zlareb1 Dec 6, 2026
d758a0a
Merge remote-tracking branch 'origin/main' into feat/namespace-invites
zlareb1 Dec 6, 2026
4b25d7f
Merge origin/main into feat/namespace-invites
zlareb1 Dec 6, 2026
d6de396
docs: state the invite fallbacks for the case the server takes
zlareb1 Dec 6, 2026
2aa0873
docs: name the live-grant handle and the tokenless request in the inv…
zlareb1 Dec 6, 2026
73fc7af
fix(dashboard): keep an invitation link's secret out of copied diagno…
zlareb1 Dec 6, 2026
712b5ce
Merge origin/main into feat/namespace-invites
zlareb1 Dec 6, 2026
d15830e
docs: key the as-typed invite grant on a request with no token
zlareb1 Dec 6, 2026
8a111df
Merge origin/main into feat/namespace-invites
zlareb1 Dec 6, 2026
1f60280
Merge origin/main into feat/namespace-invites
zlareb1 Dec 6, 2026
f80ee76
docs: say a tokenless invite grants as typed only a person nothing holds
zlareb1 Dec 6, 2026
36b28e4
test: pin the tokenless grant of a handle nothing holds
zlareb1 Dec 6, 2026
b9c8464
Merge origin/main into feat/namespace-invites
zlareb1 Dec 6, 2026
d753ce1
fix: name the sign-up refusal by its current name, and the tokenless …
zlareb1 Dec 6, 2026
7697bc0
test(analyzer): render the invitation store's write and maker reads
zlareb1 Dec 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/architecture/rolling-upgrades.md
Original file line number Diff line number Diff line change
Expand Up @@ -1690,6 +1690,23 @@ See the [participant lifecycle baseline](cells.md#participant-lifecycle-baseline
migration's file name and the read of a row N-1 wrote, and the mixed-version gate
does not check this rule.

103. **Namespace invitations** (`loom.namespace_invites`, migration
`139_namespace_invites.sql`): N-1 serves none of `grants.invite`,
`grants.list_invites`, `grants.cancel_invite` and `grants.accept_invite`, and
answers one routed to it as an unknown operation. N's dashboard sends a person's
add to `grants.invite`, so while N-1 serves, an add or an acceptance can fail on an
N-1 replica and succeed on a retry that reaches N. N-1's in-use check of a new name
does not count an open invitation: a name retired with one outstanding can be
registered as new on an N-1 replica, and the link would then grant on the new
owner's namespace; cancel open invitations before retiring a name during the
rollout. N-1's user erasure does not take the user off the invitations they made:
one an N-1 replica runs leaves their `user:<id>` as an invitation's `created_by`
until the TTL drops the row, a week after the link expires. Those links admit
nobody, since the erasure revoked the user's grants, and the erasure's residue
check does not count the table. After a rollback the table stays, its rows dropped
by TTL a week after they expire. No gate holds the rollout, and the mixed-version
gate does not check this rule.

## What checks them

`scripts/gates/mixed_version.py` (`make test-mixed-version`, the `mixed-version` CI job,
Expand Down
65 changes: 33 additions & 32 deletions docs/architecture/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -989,38 +989,39 @@ which says only that a change is running. In use means a `loom.namespaces` row,
configured code-plane repository or tracker namespace, any row in a table the erasure
census counts by namespace (`census.namespace_tables`), tombstoned or not, a live row in
a table whose rows a later owner would inherit (`namespace_census.STATE_TABLES`: grants,
webhooks, task inboxes, sources and the like), or, on the Postgres authority, a memory
there (`steps_pg.pg_holds_namespace`). Every other table keyed by namespace is exempt
with a reason (`tests/unit/test_in_use_coverage.py`), which a new table cannot skip. A
namespace can hold such rows without a registry row when auto-registration failed or was
off, for data older than it, and for a grant made before the first write. The ClickHouse
read is one statement that stops at the first row in each table
(`server/identity/store/namespace_census.py`, `in_use`), read under the name's claim and
the account's (`account_change`, which `namespace.register` and `namespace.restore` hold
too) with sequential consistency; when it cannot be read the sign-up fails and nothing
is provisioned. The personal-namespace auto-claim passes over a name in use to its
fallback name, a workload trust's exchange refuses an agent name in use, and a first
write's auto-registration names no owner on a name in use (rows a read or a run leaves
aside, `namespace_autoregister.READ_TRACES`, which a fresh `namespace.register` still
counts), so only an admin of the name completes the registration, a writer that is one
included. It names none either for a token of another org (a platform administrator's,
`namespace_autoregister.maybe_autoregister`): a name in a tenant org is that org's to
own. The exchange sets aside the rows a request writes about itself under the name it
names (`namespace_census.REQUEST_TRACES`: a latency reading, an exposure, a search
trace), so a lookup of an agent's name before its first exchange does not take the name
from the agent; a run's ledger row counts there. Every other path that registers a name
as new and makes its caller admin (`namespace.register`, `namespace.restore` into a
fresh target, `collection.create`, a self-service code repository or tracker source,
which checks again under the account's claim after its remote probe) refuses a name in
use unless the caller passes the gate's ADMIN check on it, within its token's limit on
the name (`registration.refused_as_in_use`; for a collection name outside the tree, a
platform admin). The refusal is the one a registered name's non-admin gets; the time it
takes may still differ, as a registered name is answered before the in-use read. With
auth off nobody is refused. An operator gives such a namespace an owner: `loom
namespaces-adopt` registers the ones holding live memory, and an admin grant covers the
rest, an ownerless auto-registered row (`owner_email = ''`, tagged `auto-registered`)
included. An auto-registered row written before first writes checked for use may name an
owner of a name that held another identity's data; an operator reviews rows tagged
open invitations, webhooks, task inboxes, sources and the like), or, on the Postgres
authority, a memory there (`steps_pg.pg_holds_namespace`). Every other table keyed by
namespace is exempt with a reason (`tests/unit/test_in_use_coverage.py`), which a new
table cannot skip. A namespace can hold such rows without a registry row when
auto-registration failed or was off, for data older than it, and for a grant made before
the first write. The ClickHouse read is one statement that stops at the first row in
each table (`server/identity/store/namespace_census.py`, `in_use`), read under the
name's claim and the account's (`account_change`, which `namespace.register` and
`namespace.restore` hold too) with sequential consistency; when it cannot be read the
sign-up fails and nothing is provisioned. The personal-namespace auto-claim passes over
a name in use to its fallback name, a workload trust's exchange refuses an agent name in
use, and a first write's auto-registration names no owner on a name in use (rows a read
or a run leaves aside, `namespace_autoregister.READ_TRACES`, which a fresh
`namespace.register` still counts), so only an admin of the name completes the
registration, a writer that is one included. It names none either for a token of another
org (a platform administrator's, `namespace_autoregister.maybe_autoregister`): a name in
a tenant org is that org's to own. The exchange sets aside the rows a request writes
about itself under the name it names (`namespace_census.REQUEST_TRACES`: a latency
reading, an exposure, a search trace), so a lookup of an agent's name before its first
exchange does not take the name from the agent; a run's ledger row counts there. Every
other path that registers a name as new and makes its caller admin
(`namespace.register`, `namespace.restore` into a fresh target, `collection.create`, a
self-service code repository or tracker source, which checks again under the account's
claim after its remote probe) refuses a name in use unless the caller passes the gate's
ADMIN check on it, within its token's limit on the name
(`registration.refused_as_in_use`; for a collection name outside the tree, a platform
admin). The refusal is the one a registered name's non-admin gets; the time it takes may
still differ, as a registered name is answered before the in-use read. With auth off
nobody is refused. An operator gives such a namespace an owner: `loom namespaces-adopt`
registers the ones holding live memory, and an admin grant covers the rest, an ownerless
auto-registered row (`owner_email = ''`, tagged `auto-registered`) included. An
auto-registered row written before first writes checked for use may name an owner of a
name that held another identity's data; an operator reviews rows tagged
`auto-registered` and not `adopted`, with an owner, and re-registers one as its admin.

Two kinds of use leave nothing to find. A flat token minted for a name
Expand Down
144 changes: 128 additions & 16 deletions docs/architecture/sharing.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,103 @@ admin. The group lands in that org; a member is a user id, held as `user:<id>`.
Membership is read by Loom on every request, never claimed by a token, so removing a
member takes effect within the consistency window below.

## Invitations

`grants.invite` gives a person a role by what an admin knows of them. An email verified
for an account (an SSO account or an `sso_links` row) is granted at once through
`grants.create`, under that account's handle. So is a login handle an account's row is
owned under, or a live grant in the org is stored under (a person whose tokens Loom did
not mint at sign-in has no account row), under the spelling stored for it. The answer
names the subject as `grants.create` writes it: a handle that is itself another
account's verified email moves onto that account's handle. Only a verified tie counts
for an email: a row's `owner_email` and a grant's subject are whatever their writer
typed, and `namespace.register` takes any owner. A request with no token, which only a
server with auth off serves, grants any other person as typed: no one signs in there to
accept a link. Any other email, one plain address as sign-up checks it (a dot-atom local
part and a domain IDNA encodes, so no list, display name or comment), gets an
invitation: a `loom.namespace_invites` row and the link
`/spaces#invite=<secret>&org=…&namespace=…`. The link is the credential. Only the
secret's SHA-256 is stored, as the row's `invite_id`, and the link works once, for seven
days by default (`invite_ttl_seconds`). The server emails it when `smtp_url`,
`mail_from` and `public_base_url` are set; otherwise, or when the send fails, the answer
carries the link for the admin to pass on. An invitation is made only on an active
namespace, where its link can be accepted. With a token, a handle no account or live
grant holds is refused with 404, so a typo is never kept as a grant for whoever signs up
under that handle later.

Where sign-in is single sign-on only (`oauth_login_provider = "oidc"`), the identity
provider verifies every account's email, so an email no account holds is granted as typed
through `grants.create` instead, and reaches that person at their first sign-in. There is
no link to pass on. The address is checked as for a link: a list, a display name or a
domain without a dot is refused, since no identity provider signs anyone in as it.

For a person whose tokens Loom does not mint at sign-in (an upstream gateway's,
`loom mint-token`'s, or a trusted caller's on their behalf), a handle Loom has not seen
yet is refused, and an email gets a link too, accepted by whoever opens it signed in.
Only an admin through a grant makes one: an admin whose role there is only a token's
claim is refused, as below. `grants.create` grants either as typed, for a subject the
token's minter names. The `gateway` identity provider does not mark such a server: a
password server with sign-up off infers it too, and there a grant by email would reach
nobody.

The server's mail is no relay for a namespace admin, whom any sign-up can make: it emails
at most 100 invitations an hour per org, which more sign-ups do not multiply, 20 an hour
per inviter and 3 a day per mailbox (an address with its `+tag` and the dots of its local
part dropped and its domain in IDNA's ASCII form, since a provider may ignore them; two
people whose addresses differ only so share one limit), counted in `loom.auth_attempts`
across the deployment (`server.auth.attempts`). Past any limit the invitation is still
made, and its link is the inviter's to pass on.

`grants.accept_invite` gives the invitation's role to the signed-in caller, under the
handle they sign in with, stamped `granted_by` the invitation's maker. Only a person's
token accepts: a service account, a grant principal, a trusted caller acting for someone
(the person opens the link signed in themselves) or a token of another org is refused. A
namespace-scoped token (one with `ns_roles`) is answered 400 `IDENTITY_INCOMPLETE` at the
gate, as for every op that checks no namespace role there: the person accepts signed in,
or with a token that carries no namespace roles. Under a lease per invitation
(`grant_claims.invite_change`) it checks that the link is open, the namespace active and
the maker still an admin, and marks the invitation accepted. It grants after leaving the
lease, so the grant's own claims, and an admin grant's fan-out to a repository's branches,
are never taken under it. One link never admits two people: after a failed grant the link
opens again only when no grant at or above its role stands, so a failure after the grant
row landed (a lost reply, a step after the write) leaves it used. A higher role the
caller holds already stands. Its accepter opening the link again, as after a reply that
was lost, is answered the role they hold now and writes nothing, while that role is at
least the invitation's, even after an admin cancelled the used link. A lower role or
none is answered as used: the grant failed and the link could not be reopened, or it was
lowered or revoked since. So is a retry that lands while the first accept's grant is
still being written, as the grant runs in that request right after the spend: the server
has no request deadline to tell a grant still running from one that is gone. The
dashboard sends one accept per link at a time, so its own second press never lands
there.

An invitation never outlasts its maker's admin. Its maker is the account the admin
rests on: the caller, or a delegated token's creator, whose live grant holds the token to
it. `grants.invite` and `grants.accept_invite` both read that account's grants as the gate
reads them (`authz.subject_grant_role`): on a collection its own, its groups' and
everyone's, there or on a collection above; elsewhere its grant, or an inheriting service
account's creator's. The maker's account must also be active and their subject not
revoked, as for a token they delegated (`delegation.creator_account_active`,
`revocation.is_revoked` at the time the link was made). Short of any of these, the link is
not made, or admits nobody; a failed read answers 503, so the dashboard keeps the link. An
admin whose token alone makes them one (a platform admin, an operator's token) holds no
grant that a later read could tell from a revoked one, so they cannot make a link: an
admin through a grant invites the person. The open invitations name each maker, and
`grants.list_invites` marks a link whose maker does not stand now `stopped`: it admits
nobody while they do not, and again if they come to stand again, as a delegated token
does; only a cutoff of the maker's tokens after the link was made ends it. It holds the
name until it is cancelled or expires.

Self sign-up makes accounts in `self_signup_org` only. On a password server, a link to a
namespace of another org is accepted by an account an operator made there.

A password account's email is never verified, which is why an email reaches one only
through an invitation: the link went to that address, and opening it proves the reader
got it. The whole link is a fragment, which a browser never sends to a server or puts in a
Referer. Namespaces in your org moves it out of the address into the tab's session
storage, where it waits until the person accepts it or closes the card, or the server
refuses it; where the browser refuses that storage, the page holds it until it reloads.

## Consistency

Every change to a grant, a group or the tree writes a row to `loom.acl_versions` for its
Expand Down Expand Up @@ -288,22 +385,25 @@ replaced, so none reads as live again. It deletes their uploaded originals that
writer's live document shares (each upload by an end user is recorded in
`loom.blob_uploads`, because the document version that named it may have been replaced and
merged away since), revokes and then deletes every grant naming `user:<id>`, blanks their
id as the issuer of the grants they gave others (those grants stay), removes them from
every group, blanks their id as the creator of the collections they made (the collections
stay), and retires their personal collection's directory row (`namespace.delete` and
`collection.delete` refuse a personal collection: it goes only with its user's erasure).
The request ledger keeps the user's calls for cost with their `user:<id>` subject
scrubbed, and the user's newest-call row is deleted. Deleting a SCIM group revokes the
grants that named it, so a group made later under the same id starts with none.
Collections that hold other writers' documents stay: Loom deletes only what its writer
asked to delete. `collection.delete` purges what its collection held (a namespace erasure
that takes the rows off disk) before the collection leaves the tree. A user-scope
`erasure.export` returns the chunks and the conversation rows (transcript turns, saved
messages and threads) that user owns in the collections its caller may read, and in the
user's own personal collection. An org admin may erase a collection's rows without
reading them; a platform admin sees every collection. Each section's read leaves out what
the caller may not see before its limit, so a hidden row never takes a visible row's place
on the page.
id as the issuer of the grants they gave others (those grants stay) and as the maker of
their invitations, closing the open ones, removes them from every group, blanks their id
as the creator of the collections they made (the collections stay), and retires their
personal collection's directory row (`namespace.delete` and `collection.delete` refuse a
personal collection: it goes only with its user's erasure). An accept or an invitation
already past its maker check as that step runs can still write their id, as a grant's
issuer or an invitation's maker, as a `grants.create` in flight can; such a link admits
nobody, since the step revokes the user's grants first. The request ledger keeps the
user's calls for cost with their `user:<id>` subject scrubbed, and the user's newest-call
row is deleted. Deleting a SCIM group revokes the grants that named it, so a group made
later under the same id starts with none. Collections that hold other writers' documents
stay: Loom deletes only what its writer asked to delete. `collection.delete` purges what
its collection held (a namespace erasure that takes the rows off disk) before the
collection leaves the tree. A user-scope `erasure.export` returns the chunks and the
conversation rows (transcript turns, saved messages and threads) that user owns in the
collections its caller may read, and in the user's own personal collection. An org admin
may erase a collection's rows without reading them; a platform admin sees every
collection. Each section's read leaves out what the caller may not see before its limit,
so a hidden row never takes a visible row's place on the page.

## Namespace guides

Expand Down Expand Up @@ -376,6 +476,18 @@ One text serves agents and people, so there is no second copy to drift.
principals and differs per user; no one sort order clusters every user's union.
- **Group membership in a token claim.** A claim is fixed until the token expires, so a
removed member keeps access for the token's life.
- **A confirmation email for every password account.** Verified emails would let a grant
by email bind at sign-in, but every server would need mail to sign anyone up; an
invitation works with or without mail.
- **A pending grant by email, bound at the first sign-in under that email.** A password
sign-up names any email it likes, so whoever registered the address first would take
the grant.
- **The invitation's secret in the query string.** It would reach access logs and Referer
headers.
- **Binding acceptance to the invited address.** A password account has no verified email
to compare, so only the link can prove the address was reached.
- **Cancelling a maker's invitations when their grant is revoked.** A best-effort cascade
would leave a link open when it fails; reading the grant at acceptance fails closed.
- **Inheritance resolved at write time.** Moving a collection would rewrite the grants of
every descendant; resolving at check time from a cached tree costs a walk of at most
eight parents.
Expand Down
Loading
Loading