chadtmiller.com/group-host
atmosphere group host
Two example apps: reading a group, and joining one
MergedThis adds two example apps, read-a-group and join-a-group. It also adds checks for them in the web workflow and just lint, extends just fmt and the format hook to examples/, and updates the docs.
Must change: the head conflicts with main in README.md. Every check on this pull (web, check, test, lexicons, e2e, docs) failed with "conflicts with main … merge main into it" without running. So the new npm run check steps for both examples and the docs checks have not run on this head. Merge main into the branch, resolve README.md, and let the checks run.
I read both main.ts files and the workflow, Justfile, .gitignore, hook and package.json/tsconfig.json changes, and found no bugs. I did not read the READMEs, the two lockfiles, or the doc edits in AGENTS.md, docs/design/README.md and docs/development.md.
What I checked in the code:
read-a-groupreads the members space before it decides whether the approver is an admin. That is fine, because the session is signed out andprocess.exit(1)runs before anything is printed from it.join-a-grouphandles theSpaceAlreadyExistscase for the inbox.- Both scope lists match what each app calls.
- The
web.ymlpaths and cache entries coverexamples/.
My earlier review asked for one thing: merge main into the branch and resolve the README.md conflict. The head 0ca14155 is that merge, and the pull now shows as a fast-forward onto main, so this is done.
The checks for this head have started. lexicons and e2e passed as skipped, and web, test, docs and check were still queued or running when I looked. Those checks include the new npm run check typecheck of both examples. I didn't read their results, so wait for them to pass before merging. I found no problems in the example code in the first round, and the only commit added since is the merge of main.
My last review approved this at 0ca14155. The only change since is ebbd1b1d, which rewraps one api.text(...) call in harness/diagrams.mjs. It changes no behavior, and it answers the format failure that the web check reported at 0ca14155. The checks that matter for the pull have started on the new head. docs, check and lexicons passed, and e2e passed as skipped. web and test were still running when I looked. web includes the new npm run check typecheck of both examples, which was skipped at 0ca14155 because format failed first. Wait for it to pass before merging. I found no problems in the example code.
8 passed, 1 skipped
Two small apps under
examples/show how to use a group host the way any app would, on atproto's own TypeScript packages (@atproto/oauth-client-node,@atproto/lex,@atproto/lex-space).read-a-groupsigns in as a group and reads it, as Grain does;join-a-groupjoins one for a person, from their own PDS.Claude Opus 5.5
What changes
examples/read-a-group. One file,main.ts. It reads the group's profile from its meta space as anyone may, then signs in as the group with the loopback client and an admin's approval in the console. With that session it reads the meta and members spaces by delegation token and credential (lex-space'sSpaceReader, which checks the MACs), and callsorg.atgrp.listJoinRequests, typed bylex buildfromlexicons/. As Grain does, it keeps the session only from an approver who holdsinclude:org.atgrp.authManageAdmin. It readsmemberfrom the token answer through afetchwrapper, since the OAuth client drops the field; any other approver gets the session given back. It prints the rules, marks members with no confirmation, and hides a member the group took down with its own unexpired!takedownlabel.examples/join-a-group. One file,main.ts. Signed in to the person's own PDS, it makes their inbox (a memberspace withpublicWrite), or finds the one they have. It reads the group's invite there, then asks the host withorg.atgrp.requestJointhrough the PDS (atproto-proxy: <host DID>#atgrp, the host's DID from itsdescribeServer). Once admitted, it writes anorg.atgrp.confirmationin its own repo in the group's members space. It asks for three explicit scopes instead ofinclude:org.atgrp.authParticipate, which a PDS grants only where it can read that set's lexicon; the README says so.Checks and docs.
just fmt, the format hook and thewebcheck now coverexamples/. Thewebcheck installs and typechecks each example (npm run check:lex build, thentsc), andjust lintdoes the same for every app underexamples/. The examples' generatedlexicons/andnode_modulesare ignored.README.md,AGENTS.md,docs/design/README.md(the pieces) anddocs/development.md(the checks) name them.Why
Grain proved the flow; these show it in the least code an app needs, with the packages an atproto app would use, for someone building against a group host. Writing them found a host bug, the null
cursoron a list's last page, which landed on its own as A list's last page names no cursor, never null. They also found one upstream:l.space()can't type a space of several collections, which bluesky-social/atproto#6085 fixes. Until it ships, both examples declare the two group space types withl.space(...)and leave them out oflex build.How it was checked
Each ran end to end against a local world: the space alpha's reference PDS and PLC (
harness/pds.mjs), this host, and a group seeded byatgrp group seed, with members, a pending request, a takedown label and a confirmation.read-a-groupapproved by alice, an admin: the profile signed out and signed in, both rules, members with roles and confirmed or not, the taken-down member hidden, and the pending request.read-a-groupapproved by bob, a member but not an admin: refused, session given back, exit 1.XrpcResponseErrorSpaceNotFound, which is the errorread-a-groupcatches. This was checked against the members space; no group's meta was made members-only.join-a-group, signing in at the PDS's own page with Playwright: carol, not invited, gets her inbox made and her request left waiting. Carol, once invited, has the invite read from her inbox, is admitted and confirms. Bob, invited before he had an inbox, is admitted from the host's own list and confirms.read-a-groupafterwards shows both as confirmed members.npm run check;oxfmt --checkandnode harness/docs.mjspass.Shortcomings
just dev; their READMEs' instructions for it follow fromharness/dev.mjs.0.0.0-spaces-alpha-20261124235736), as the console does.read-a-groupreads the spaces withSpaceReader, notSpaceClient:SpaceClientreads the signed-in account's own repo with its session, which this host doesn't take for a group's repo in a space.