chadtmiller.com/group-host
atmosphere group host
A group's profile and rules are written as the group
MergedThis pull moves the group's profile, pictures and rules onto ordinary record writes as the group. Host::face and Host::declaration hold the semantic checks that updateProfile and putRule used to hold. The four old methods and their lexicons are gone. The console, the MCP tools (record_as) and opensocial seed now write through tokens.
I'm asking for changes because the head no longer merges. At 07008815 every check on the pull fails with "conflicts with main at b4f5b68b" before it runs. The conflicting files are group-host-mcp/src/lib.rs, group-host-mcp/tests/protocol.rs, assistants.rs, group_tokens.rs, token_writes.rs, tests/common/oauth.rs, opensocial/src/lib.rs, docs/design/signing-in.md and docs/reference/mcp.md. These overlap with the code I reviewed: write_as, group_scope and record_as. Please merge main into the branch and resolve them. After that the test (100% gate), web, e2e and docs checks need to pass on the merged head. The earlier head, 31f39892, failed test and web (svelte-check), and I can't tell from here whether the newer commit fixed those.
What I read in group_config.rs, token_writes.rs, group_tokens.rs and assistants.rs looks sound. The checks are applied on the token path, and a profile can't be deleted or moved off self. A rule must be at a TID and have a title. A picture must be the group's own blob, with the type and size the host kept. The declaration is kept only while meta is public. I did not read the console, the CLI, the tests, the docs or the lexicon files in this pass, and I'll go through them once the branch is rebased.
The merge conflict I asked you to fix is fixed. The merge commit bf807105 brings in main, and the pull is now a fast-forward. Every check passes on this head: check (fmt and clippy), test (with the coverage gate), web (svelte-check and build), e2e, lexicons and docs. The earlier test and web failures at 31f39892 are gone.
The review path I read last round (group_config.rs, token_writes.rs, group_tokens.rs, assistants.rs) looked sound. I did not re-read it for the merge resolution, because the checks cover that code. This round I read web/src/lib/asGroup.ts. withGroup ends the token in a finally, so a refused write does not leave a session behind. GroupSession.write and upload return the host's refusal as the form's failure. I did not read the rest of the console, the CLI, the tests, the docs or the lexicon files line by line. The passing checks cover the tests and docs, and I have nothing to add there.
One thing to watch: in GroupSession.end, a network error from /oauth/revoke would throw out of the finally and replace the result of the writes. Catching it there would keep a completed write from showing as an error. It's minor, so it doesn't block this approval.
What changes
Records written as the group. A group's profile (
fyi.opensocial.profile, atself) and rules (fyi.opensocial.rule) change only by an app writing them inmetawithcom.atproto.space.*(createRecord, putRecord, deleteRecord, applyWrites), using a token for the group, as the opensocial proposal's "Writing as the Group DID" has it. The token's scope must cover the write and the approving member must holdgroup.configure, as before. WhatupdateProfileandputRuleheld now holds for the records themselves, ingroup_config.rs, called from the write path intoken_writes.rs:open,approvalorinvite, a location of one ofcommunity.lexicon.location's kinds, a site on http or https, topics and languages each listed once and none blank; it stays atselfand is never deleted;updateProfileused to correct it);self, naming the group's ownmeta, and only while anyone may readmeta; deleting it is always allowed.Methods removed.
updateProfile,uploadImage,putRuleanddeleteRulego: routes, handlers, lexicons and MCP tools. Pictures are uploaded withcom.atproto.repo.uploadBlob, which a token formetamay do for images.Lexicon.
fyi.opensocial.rule's title is the proposal's length: 64 graphemes, 640 bytes (it was 100 and 1,000).createdAtstays, optional.Console. The settings page writes the profile, pictures and rules as the group, through
web/src/lib/asGroup.ts, which now gives a form's action a session for one space (withGroup): several writes and an upload with onegetGroupAuthtoken, ended at/oauth/revokeonce they are made, so the console's tokens no longer linger among the group's sessions (invites use it too). A put replaces the profile whole, so it rebuilds the record fromgetGroup, taking each picture's type and size from what/imgserves.MCP.
updateProfilebecomesputProfile;putRuleanddeleteRulestay by name but now write the records. Each is the write a group session the member approved formetawould make, inside the host: a grant for the member, its scope whatgetGroupAuthwould give them at that moment (Host::group_scope, whichgetGroupAuthuses too), checked and logged as any token write is. Their input schemas are the record lexicons (RECORDSingroup-host-mcp, aKind::RecordbesideQueryandProcedure);putRuletakes an optionalrkey.Command.
opensocial seedwrites its two rules as the group, with the command'sGroupSession.Why
The proposal has apps write the group's records directly as the group, with the host checking each write's semantics and the session's permissions, and no method of its own for these. Nobody uses this host yet, so the methods it replaces go rather than stay beside it.
How it was checked
tests/group_config.rsrewritten as record writes with a console token: each caseupdateProfile,uploadImage,putRuleanddeleteRuleheld (blank name, unknown or old-style join policy, bad location, images not the group's, of the wrong type, too large, or named with another type or size; blank or over-long titles, negative order, missing text, a key that is no TID; deletes, twice), plus the declaration followingmeta's readers and the image serving test.tests/assistants.rs: the record tools put the profile, make, change and delete a rule, refuse what the host refuses, and log as the assistant.tests/tokens.rs: the labeler's put and refusals.group-host-mcpprotocol tests for the record tools' kinds and schemas; theopensocialseed test checks the rules are inmeta.Shortcomings
getGroupand/img, as there is no simpler read of the record for it; a profile'screatedAt, whichgetGroupdoes not show, is dropped on the console's first write.selfinmeta, never deleted. Roles, permissions, memberships and access records are the next stages'.Review
Start at
Host::faceandHost::declarationincrates/group-host/src/group_config.rs, thenrecord_asinassistants.rs.🤖 Generated with Claude Code