chadtmiller.com/group-host
atmosphere group host
Groups are the authority for their own spaces
MergedThis makes the host the authority for its groups' spaces. It adds spaces, grants and may, the five com.atproto.space.* authority methods, a writer set, and an outbox with backoff for writes to authorities elsewhere. In-process handling covers a space whose authority is a group here. I read the source files, the store changes and the space_write rework, and found no blocking bugs. The checks logic looks right: the credential is bound to a P-256 key, delegation tokens are single-use, notifyWrite requires the writer's own issuer and this authority as audience, and a user who may not read gets "no such space". Outbox replacement by newer revision is safe, because delivered and retry match on rev.
I did not read tests/authority.rs, tests/common/*, tests/interop.rs, tests/spaces.rs or the docs diffs. The test and check workflows were still queued when I looked, so the 100% coverage gate and clippy are unconfirmed.
Two notes, neither blocking:
registerNotifyandunregisterNotifyaccept any valid credential for the space (as_authority), and any reader can hold one, including on an open space. Any reader can therefore register or unregister other services' forwarding. Please confirm this matches pds.js. If it does not, restrict them to the group or to the service itself.delegatedspends the token before the space and read checks run. A request that is then refused withSpaceNotFoundhas still used up the token. Moving the spend after themaycheck would avoid that. It costs nothing, since a refused user could not get a credential anyway.
What changes
Groups are the authority for their own spaces.
Host::create_spacemakes a space of a group here, which may be open to all readers.Host::grantandungrantsay who else may read or write it.Host::maydecides: the group itself may do anything, others what they're granted, and anyone may read an open space.space,space_grant,space_writer,space_recipient,spent_token,outbox.The authority's methods.
com.atproto.space.getSpaceCredentialissues a credential, bound to the caller's P-256 key:<group>#atproto_pdsand this space, and is spent once. A user the space doesn't let read is told there's no such space.com.atproto.space.notifyWriteis received from repo hosts. The writer's own account must send it, for this authority, with a revision no more than five minutes ahead, and the space must let them write. The writer set keeps each repo's latest revision and digest, and the space's revision when it heard.com.atproto.space.listReposanswers the writer set to a credential's holder, a page at a time.registerNotifyandunregisterNotifysign a service up for a day of forwarded writes, at the endpoint its own DID document names. Each write is forwarded to it, signed by the group, best effort.A write's word to an authority elsewhere is owed until it lands.
space_writenow keeps an outbox entry and tries it at once.servetries what's due every 10s.docs/design/spaces.mdgains "Being the authority", and the plan marks this step done. The space tests' helpers move totests/common/spaces.rs, shared by both test files.Why
This is step 4c. Groups' spaces need an authority, and this host is it. The design follows pds.js's
packages/spaces:outbox.js);notify.js);registerNotifyresolving the endpoint from the service's own document;The checks on each method follow the alpha at
11c5d98.It differs from the prototype in one place. The prototype gave every group space a
managedspacepolicy naming the host itself, then answeredcheckUserAccessin process. Here the host's own grants decide, and there are no space policies orcreateSpaceover XRPC, because a group's spaces are made by the host. The grants are what groups and roles (4d and 5) will maintain.How it was checked
tests/authority.rscovers:maydecides for the group, a grantee, an open space and no user.notifyWriteand from the group's own writes. A stale revision changes nothing.listRepospaging needs a credential. EverynotifyWriterefusal is covered.spaceRevandprevSpaceRev, signed by the group for the service. A refusing syncer holds nothing up, and after unregistering nothing more is sent. EveryregisterNotifyrefusal is covered.retry_delay.tests/interop.rsaddsthe_host_as_authority_for_a_member_on_the_reference_pds, against the alpha in CI:notifyWritereaches the host.start_reachablegives this test a host whosePUBLIC_URLis where it listens. It runs only in CI.just cov: 100% of lines and functions. Clippy is clean.Shortcomings
notifySpaceDeleted), come with groups' deletion in 4d.🤖 Generated with Claude Code