chadtmiller.com/group-host
atmosphere group host
Spaces are kept under policies and changed through atproto's space methods
MergedThis pull moves group spaces from access records to fyi.opensocial.policy and serves atproto's four space methods. I read the core: group_spaces.rs and rbac.rs, plus token_writes.rs for context. I did not read the other ~80 files (docs, lexicons, tests, web, CLI/MCP, import and migration). The diff was too large to read in full, so none of them is covered by this review.
Two gaps in updateSpace come from guards the old code had and the new code dropped:
- The members space can be set to any policy. The old
update_spacekept the members space readable bymemberand refused changes to who may write in it. That second guard matters because writing there in your own name is joining. The newupdate_space_asaccepts any valid policy for it, becauseowndoesn't exclude reserved types. An admin holdingspace.configurecan therefore lock every member out of the roster, make the rosterpublicRead, or let non-members write membership records. The docs say members read and write there. Please reject, or force, the members policy so members keep read and write andpublicReadstays false. Add a test for it. publicReadandunlistedare not covered byescalates.escalatesstops a user grantingreadorwritethey don't have to a role. It doesn't stop them settingpublicRead: true. A role that manages a space through its own policy grant or throughspace.configure, but doesn't read it, can make it public and then read it through the credential path. Require that the user can read the space before they turnpublicReadon, and add a test for it.
crates/group-host/src/group_spaces.rsline 274Outdated
if !self.may_manage(group, member, &now, asked)? { | |
return Err(not_authorized("no role of yours may change this space")); | |
} | |
let policy = checked_policy(self, group, &body["policy"])?; |
Nothing checks the members space's policy here. The old code kept it readable by member and refused changes to who writes in it. Add that back, or the space can be locked out or opened to public reads or to non-member writes.
crates/group-host/src/group_spaces.rsline 356Outdated
now: &Policy, | |
next: &Policy, | |
) -> Result<(), XrpcError> { | |
let union = assignable(grants, roles, None); |
escalates compares only each role's grant. A change that sets publicRead to true, or unlisted, isn't checked against what the user holds, so a manager who can't read the space can make it public and read it.
Neither of the two findings from my last review is fixed. I checked update_space_as, escalates and checked_policy in crates/group-host/src/group_spaces.rs at 719adba. I did not read the rest of the new diff, which is very large.
-
Members space policy.
update_space_asstill accepts any valid policy for the members space.checked_policyonly checks the$type, the roles and the scopes, andescalatesonly compares per-role grants. So an admin withspace.configurecan still:- remove
readorwritefrommember, which locks members out of the roster or stops them joining; - set
publicRead: trueon the roster; - grant
writeto a role that isn'tmember.
Please reject such updates for the members space, or force its policy so that
memberkeeps read and write andpublicReadstays false. Add a test for it. - remove
-
publicReadandunlisted.escalatesstill ignorespublicRead. A manager who can't read the space, because their role isspace.configureor a policymanagegrant withoutread, can setpublicRead: true. They can then read the space through the credential path. Please refuse turningpublicReadon from off unlessnow.can_read(roles)holds for the user. Add a test for it.
Both fixes are small and sit in update_space_as and escalates.
Neither finding from my last two reviews is fixed. The only change since 719adba is in tests: group_spaces.rs, group_tokens.rs and migration.rs. I read escalates at the head and it is unchanged. It still has no check on publicRead.
-
Members space policy.
update_space_asstill accepts any valid policy for the members space. An admin withspace.configurecan removereadorwritefrommember, setpublicRead: trueon the roster, or givewriteto a role that isn'tmember. Please reject such updates for the members space, or force its policy so thatmemberkeeps read and write andpublicReadstays false. Add a test for it. -
publicReadescalation. A manager who can't read the space can setpublicRead: trueand then read it through the credential path. Please refuse turningpublicReadon from off unlessnow.can_read(roles)holds for the user. Add a test for it.
Both fixes are small and sit in update_space_as and escalates.
The only change since 624aba0 is two test lines in group_spaces.rs, which now use std::slice::from_ref. Neither earlier finding is fixed. I checked escalates in crates/group-host/src/group_spaces.rs at the head, and it still checks nothing on publicRead.
-
Members space policy.
update_space_asstill accepts any valid policy for the members space. An admin withspace.configurecan removereadorwritefrommember, setpublicRead: trueon the roster, or givewriteto a role that isn'tmember. Please reject such updates for the members space, or force its policy so thatmemberkeeps read and write andpublicReadstays false. Add a test for it. -
publicReadescalation. A manager who can't read the space can setpublicRead: trueand then read it through the credential path. Please refuse turningpublicReadon from off unlessnow.can_read(roles)holds for the user. Add a test for it.
Both fixes are small and sit in update_space_as and escalates.
Both findings from my earlier reviews are fixed in the changes since 87029a1. I read only that diff, not the whole pull.
- Members space policy.
update_space_asnow returnsMembersSpaceFixedunlessmemberkeepsreadandwriteandpublicReadis off. The new test covers droppingread, droppingwrite, moving the grant to another role, andpublicRead. It also checks that a valid policy is accepted. publicReadescalation.escalatesnow refuses turningpublicReadon from off unless the user can read the space, and a test covers it.
One more change: new groups' admin role now holds space:*?collection=*, so admins can add collection scopes to a policy. The docs and the getGroup test were updated to match.
Nothing else I found needs to change.
The only change since my approval at 3ed4ce6 is in crates/opensocial/tests/commands.rs. The account-move test now expects the published com.atproto.space.policy/self record in each moved space's paths. That matches the pull's described behaviour, and it changes no production code. My earlier approval stands.
The only change since my approval at 7c3441c is a test edit in crates/opensocial/tests/commands.rs. The account-move test now expects no published policy record in the calendar's paths, and the comment notes that only the forum, now a group's, has one. No production code changed, so my earlier approval stands. I didn't check this expectation against the import code. It's a test-only change, and the test run would show a mismatch.
The only changes since my approval at 7671149 are tests: an MCP planning test for space_create, a check in group_spaces.rs that a token whose roles are gone can't updateSpace, an unlisted-space visibility check in groups.rs, an MCP space_create run in mcp.rs, and a CLI space create run in commands.rs. No production code changed, and the tests cover behaviour the pull describes. My earlier approval stands.
The only changes since my approval at 022e2a8 are tests. group_spaces.rs now checks that getSpace on a space that doesn't exist returns InvalidRequest. migration.rs now checks that an import whose policy doesn't match the lexicon (grants is a string) fails with InvalidArchive. No production code changed, and my earlier approval stands.
Each group space is now kept under a
fyi.opensocial.policy({publicRead, unlisted, grants[{role, read, write, scopes}]}) in place of access records, and spaces are made, changed, read and ended only through atproto'scom.atproto.space.createSpace/updateSpace/getSpace/deleteSpace, called as the group.Claude Opus 5.5 · high effort
What changes
Policies. The host keeps each space's policy, publishes it as the group's
com.atproto.space.policy/selfin the space, and keeps thefyi.opensocial.spaceindex in the members space in step withunlisted; direct writes of either are refused.fyi.opensocial.access, ourcreateSpace/updateSpace/deleteSpace,people,writableBy, thepublicaudience, the index entry'snameandmetaReadableBy(nowmetaPublicRead) are gone.Space methods. atproto's four methods are served for group sessions (OAuth or a
getGroupAuthtoken, which now carries themanage=ops the member may use, and may be asked for a space not yet made).UnsupportedPolicyfor any other$type;ScopeMissingwithout themanage=op;NotAuthorizedunless a role grantsspace.create/space.configure(nowspace:*?manage=update)/space.deleteor the space's own grant manages it. meta and members can't be made or deleted.Escalation. An update changes only grants of roles in the user's assignable union (
rbac::assigns, so*covers every role), adds only scopes they hold, and grantsread/write, or turns onpublicRead, only where they have it (NotAuthorized).The members space stays members'. Every member holds
member; an update of the members space that takesreadorwritefrommember, or turns onpublicRead, failsMembersSpaceFixed(indocs/reference/api.md; atproto'supdateSpacelexicon is upstream's, unchanged). Other roles may be given write there: only members hold roles.Read and write. Roles granted
readread;publicReadlets anyone read through the space credential path (our ownlistSpaceRecords/getSpaceBlobstill ask for sign-in). Only roles grantedwriteare in the writer set; a policy change or role change prunes those who lose it.New groups and moving. Meta: members read, admins read and write profile and rules,
publicReadunlessmetaPublicRead: false. Members: members read and write. The admin role holds, besides every action's scope andrepo:*,space:*?collection=*: any record as the group in any of its spaces, so founders may give any scope a policy grant may hold.migrateExport'smetapart is a space meta archive with the policy; account import maps personalspace/memberspace policies tofyi.opensocial.policywithunlisted, and publishes policies only once the members space exists.getGrouplists spaces in index order again, then unlisted ones the viewer reads.Console, CLI, MCP, kicker. The console's visibility setting runs
updateSpaceon meta, keeping the rest of its policy (looked at withjust look: listed, set to members only and back, as alice and as bob, desktop light and phone dark).opensocial space create <group> <type> --policy <json> [--skey]/space_createruncreateSpacewith a group token.Why
Upstream's proposal (Nov 2026) makes the space policy the one place access lives, and atproto's own space methods the way to change it.
How it was checked
Acceptance tests in
group_spaces.rs: create/update/delete/get with scope and role checks (including a token whose member has since lost the role),UnsupportedPolicy, the published policy and refused direct writes, unlisted and the index, read vs write and pruning, the escalation refusals (role not assignable, read, write orpublicReadnot held, scope not held), a founder giving collection,read_selfandmanagescopes in a calendar's policy where a member without them can't,MembersSpaceFixed, meta/members undeletable. Alsooauth_scope.rs(manage scopes),group_tokens.rs,tokens.rs,rbac.rs,groups.rs(the admin role's scopes; an unlisted space shown only to its readers),migration.rs(the meta archive round trip, and a source whose space repo isn't what its commit says),opensocial space createand thespace_createtool end to end, and the account import publishing the policy of the space the group governs. All six checks run on the pull.Shortcomings
atproto transition:generic) never reached spaces before this pull either, so they can't call the space methods; left as is.authority=did:…) isn't covered by the admin'sspace:*?collection=*, which is for the group's own spaces; only someone holding that exact scope may add it.