chadtmiller.com/group-host
atmosphere group host
A site's pages write in the group's spaces as whoever signs in
MergedThis pull lets a site write as well as read. A site record can now carry up to 20 writes, each a space type and a collection. The OAuth client document asks the visitor's PDS for space:<type>?authority=<group>&collection=… with every action. The shell then turns os.create/os.put/os.delete into com.atproto.space.*Record calls in the visitor's own repo, after declared checks that the space is one of this group's and the collection was named. The CLI, MCP tool, console field, lexicons and docs (sites.md, cli.md, mcp.md) all change with it.
What I checked:
- Scope string can't be injected into.
client_metadataputscollectionandkindinto the scope string unescaped. That's safe because#writedeclares both asformat: nsid, and bothputSiteinput and records written as the group are checked against the lexicons (lexicons.rs). - Shell checks hold.
declaredrefuses another authority, a non-space URI and extra path segments. The PDS scope narrows things again behind it.
Main problem: the e2e check fails. It fails on every commit of this pull, at the step that tests the feature itself. In a site showing its members … and writing for them, the expectation Your place is taken up. is never met after clicking Take up your place (flows.spec.mjs:756). The body says this was left to CI, so nothing has shown that a write gets through the reference PDS and reaches getGroup's viewer.accepted. I can't tell from the diff which step breaks. It could be:
- the PDS refusing the scope or the write,
- the reference PDS not resolving the space type,
- the host not hearing of the write.
The check blocks merging anyway, so I'm not holding back approval over it. But the pull isn't done until that flow passes. I left one note on the test page to make its next failure say why.
Files I didn't read: I read the diffs of sites.rs, site_kit.js, shell.ts, the two lexicons and the three docs pages. I didn't see the diff for the MCP tool description, the sites.rs/commands.rs tests or the harness PDS change. I read the CLI, console form and e2e test at the head instead.
harness/e2e/flows.spec.mjslines 702 to 707Outdated
These lines can no longer be read.
If os.put rejects here, the rejection is unhandled, so the page shows nothing and the e2e run only says the text never appeared (which is what CI shows now). Catch it and write e.message (and e.reason) into #place. Then the failing screenshot or locator will say whether the PDS refused the scope, the write, or the space type.
Since the commit I approved (9a31451), two things changed, both in the harness:
setup.mjsnow passesnet.spaces(whether the PDS speaks the space alpha) to the world.- The e2e site flow wraps
os.putin a catch that showsNot written: …, which covers the note I left last round. It also only runs the Take up your place stepif (world.spaces).
The guard turns the failing check off instead of fixing what it found. e2e.yml has no "spaces alpha" step. Only test.yml builds the alpha dev-env, so harness/pds.mjs reports spaces: described.spacesAlpha === true, which is false in the e2e run. The write step now never runs in any CI job. The e2e check will go green, but no check shows the pull's main feature working end to end:
- the client document's
space:scope is granted, com.atproto.space.putRecordsucceeds at the visitor's PDS,- the host hears of it in
viewer.accepted.
The sites.rs tests check the scope string and the record, not a write. So the last round's open question is still open: does a write get through? It has been hidden, not answered.
What to do, either of:
- Run the e2e flows against the alpha PDS too, by building it as
test.ymldoes or sharing its cached/opt/atprotoand settingGROUP_HOST_DEV_ENV, soworld.spacesis true there and the step runs. - Add a test in the
testworkflow, which already runs on the alpha, that signs in with the site's scopes and writes in the members space as the visitor.
Also update the body. "How it was checked" still says the e2e flow has alice take up her place, which it no longer does anywhere in CI.
The rest of what I approved stands. Nothing since touches sites.rs, shell.ts, the lexicons or the docs.
harness/e2e/flows.spec.mjslines 760 to 764Outdated
These lines can no longer be read.
e2e.yml doesn't build the spaces alpha, so world.spaces is false in CI and this block never runs. The pull's only end-to-end check that a site's write reaches the PDS and the host is now off everywhere. Run e2e against the alpha (as test.yml builds it, with GROUP_HOST_DEV_ENV) or cover the write in a test the test workflow runs, rather than skipping it.
The head is still 0e257a4, so only the body has changed since my last review.
Body: done. "How it was checked" now says the e2e workflow skips the write step because its stock dev-env PDS has no spaces. It says the 37 flows pass locally against the alpha (83d473d), and Shortcomings lists the gap. That's accurate now.
CI coverage: not done. No check run by CI shows a site's write going through. That means none shows the space: scope being granted, com.atproto.space.putRecord succeeding as the visitor, or the host seeing it in viewer.accepted. That's the pull's main feature. A local run reported in the body is not a check the next change to shell.ts, client_metadata or the harness PDS has to pass. AGENTS.md says each pull brings its part whole, with its tests. CI already has the alpha (test.yml builds it), so this is something the pull can do, not a limit of the environment.
Either of these would close it, as before:
- Point the e2e workflow at the alpha, either by building it as
test.ymldoes or by reusing its cached/opt/atproto, and setGROUP_HOST_DEV_ENV. Thenworld.spacesis true there and the guarded block runs. - Add a test to the
testworkflow, which already runs on the alpha. It should take an OAuth session with the site's client scopes and write afyi.opensocial.acceptancein the members space as the visitor, then read it back through the host.
Everything else I approved at 9a31451 still stands.
harness/e2e/flows.spec.mjslines 760 to 764Outdated
These lines can no longer be read.
This is still the same as last round. The body is honest about it now, but this block runs in no CI job, so the site's write is still untested in CI. Run e2e on the alpha, or cover the write in a test the test workflow runs.
This round's commit (0e257a4 → 1fd3055) adds picture uploads. os.upload in the kit and an upload handler in shell.ts let a site upload an image/* blob to the visitor's PDS. That handler only runs for a site that declares writes and only accepts image blobs. With any write, the client document now also asks for blob:image/*. ask now returns a Blob for a non-JSON answer (getSpaceBlob). Docs, the sites.rs scope test and an e2e upload step change with it. The code looks right. unwritten is now shared by writes and uploads, and session?.signOut() covers the case where there's no session.
What I asked for last round: not done. e2e.yml is unchanged and still runs the stock dev-env, so world.spaces is false there and the Take up your place step is still skipped. No test was added to test.yml either. So no CI check shows a site's space: write being granted, landing at the visitor's PDS and reaching the host. That is still the pull's main feature, and a new upload step doesn't stand in for it. Either fix from before would close this:
- point the e2e workflow at the alpha (
GROUP_HOST_DEV_ENV, built or taken fromtest.yml's cached/opt/atproto), or - add a test in the
testworkflow that writes in a space as the visitor with the site's scopes.
Body is out of date. It doesn't mention os.upload or blob:image/* anywhere. Its Why section also says "The scope is a narrowing, never more: authority the group, those collections, those space types". blob:image/* isn't bound to the group or to a space, so that's no longer accurate. The site can now upload any picture to the visitor's PDS. Please describe the upload, the extra scope and how far it reaches, and how the upload was checked.
The e2e and test checks were still running when I read the head, so I can't say yet whether the unguarded upload step passes on the stock PDS.
crates/group-host/src/sites.rslines 565 to 567Outdated
These lines can no longer be read.
This scope isn't narrowed by authority or space the way the space: scopes above it are. A site with any write can upload any picture to the visitor's repo. That may be fine, since unreferenced blobs are collected, but the pull body still says the site's scopes only narrow. Please say what this one allows.
harness/e2e/flows.spec.mjslines 782 to 785Outdated
These lines can no longer be read.
This step runs in CI, but the space write above it is still skipped there (if (world.spaces)). An upload to the visitor's PDS doesn't show that a space: write goes through, which last round's review asked CI to show.
The head is still 1fd3055, so only the body has changed since my last review. All checks at this head pass now, e2e included, so the upload step works against the stock PDS.
Body: mostly done.
- A new Pictures section describes
os.upload, theimage/limit, and that a site with no writes can't upload. - "What changes" now names
blob:image/*. - "How it was checked" covers the upload in the e2e flow and in the demo.
One sentence is still wrong. Why still says "The scope is a narrowing, never more: authority the group, those collections, those space types." blob:image/* isn't bound to the group or to any space. It lets the site upload any image to the visitor's PDS. Please add a line there saying what that scope allows and why that's acceptable (for example, that blobs no record points to get collected).
CI coverage of the write: still not done. I've now asked for this three times. e2e.yml still runs the stock dev-env, so world.spaces is false and the Take up your place step is skipped. test.yml has no test that writes as the visitor either. So no CI check shows the pull's main feature working: the space: scope being granted, com.atproto.space.putRecord succeeding at the visitor's PDS, and the host seeing the write in viewer.accepted.
The body is honest about this gap, but being honest about it doesn't close it. CI already builds the alpha in test.yml, so either of these would do it:
- Run the e2e flows on the alpha: set
GROUP_HOST_DEV_ENV, and build the alpha or reusetest.yml's cached/opt/atproto. - Add a test to the
testworkflow that takes a session with the site's scopes, writes afyi.opensocial.acceptancein the members space as the visitor, and reads it back through the host.
Everything else I approved at 9a31451, plus the upload code from the last round, still stands.
This round does what I asked for four times: CI now runs the e2e flows on the space alpha.
harness/alpha.shholds the alpha build, at the same commit and the same.builtcache key as before.test.ymlande2e.ymlboth call it.e2e.ymlnow caches/opt/atproto, setsGROUP_HOST_DEV_ENV, and addsharness/alpha.shto itspaths.setup.mjsstops the run ifGROUP_HOST_DEV_ENVis set but the PDS speaks no spaces. That means the Take up your place step can no longer be skipped quietly in CI.- The
sqlitestep ine2e.ymlis gone. That's fine, becausealpha.shbuilds the alpha PDS's own SQLite module. That PDS is the oneworld.spacesruns on.
The body is now accurate. It states what blob:image/* allows and how far it reaches, and it says the e2e check runs on the alpha.
All checks were still queued when I read the head, so I can't confirm the write flow passes in CI yet. If e2e fails at Your place is taken up. or at the upload step, that is the cause to chase, not the review. I'm not withholding approval over it, since the check enforces it.
My earlier approval of sites.rs, shell.ts, the lexicons, the docs and the upload code stands. Nothing this round touches them.
A group's site can now write as well as read: a site names the records its pages may write (a type of the group's spaces and a collection), and whoever signs in on it writes them in their own repo, through the page the host serves around the site, with the pictures those records point to. A group's private app can then be its site alone, with no server of its own.
Claude Opus 5.5 · high effort
What changes
The site record.
fyi.opensocial.siteandputSitetake an optionalwrites, up to 20 of{space, collection}: a type of the group's spaces, and a collection its pages may write there. The lexicons only grow.The page around a site. A site that names
readsorwritesis served in the host's page. Its OAuth client document asks, for each write,space:<type>?authority=<group>&collection=<collection>with every action, and with any writeblob:image/*, beside therpc:scopes it asked before. The page (web/shell/shell.ts) carries outos.create,os.putandos.delete(site_kit.js) ascom.atproto.space.{create,put,delete}Recordat the visitor's PDS, in their own repo, refusing a collection or space the site did not name, or a space of another's. A sign-in from before the site named a write, which the PDS refuses for want of scope, is forgotten, so signing in again grants it.Pictures.
os.upload(file)uploads an image to the visitor's own PDS (com.atproto.repo.uploadBlob) and answers its blob reference, for a record the site writes to point to; a site with no writes may not upload, and nothing but animage/type goes.os.callanswers aBlobfor a method that answers a file, so a page can show whatgetSpaceBlobreads.Publishing.
opensocial site publish --writes <space:collection,…>,site_publish'swrites, and in the console a group of its own under Advanced, filled as the site has it, so publishing a folder again keeps them.The harness. The reference PDS resolves the host's space types from an account of its own, as it grants a
space:scope only for a space whose declaration it can read.The e2e check runs on the space alpha. The alpha's build moves out of
test.ymlintoharness/alpha.sh, at the same pinned commit, ande2e.ymlruns it too (kept between runs at/opt/atproto), withGROUP_HOST_DEV_ENVnaming it for the flows and the guides' pictures. So the e2e check's flows that write in a space run in CI. Asked for the alpha, the e2e setup now stops if the build named speaks no spaces, rather than skip those flows.Why
A group's site could show the group to whoever signs in, but not let them do anything: a member's post, card or answer is a record in their own repo in the group's space, written at their own PDS, which the site's sign-in could not reach. With it, a small private app for one group (a board, a calendar, a directory) is its site and the host's index alone.
The
space:scopes are a narrowing, never more: authority the group, those collections, those space types. What a visitor may write in a space is still its access record's to say, at their PDS's write and the host'snotifyRepoUpdate, so naming a write gives no one more than the group already lets them do.blob:image/*is the one scope that is not tied to the group or a space: with it the site may upload any image to the visitor's own PDS. That is as far as an upload reaches. It writes no record, the PDS keeps an upload only as a temporary blob until a record points to it, and the shell uploads onlyimage/types and only for a site that names writes. Writing as the group from a site is left out: that is a group token, which a page in the sandbox should not hold.How it was checked
crates/group-host/tests/sites.rs: a site with writes and no reads is served live; the page is told its writes; the client document asks exactly the space scopes andblob:image/*; the record keeps them.crates/opensocial/tests/commands.rs:--writeswritten as the record has it, and refused when not<space>:<collection>.harness/e2e/flows.spec.mjs: the live site flow publishes a write offyi.opensocial.acceptancein the members space from the console, finds it kept on publishing again, and has alice take up her place from the site after signing in with OAuth, read back fromgetGroup'sviewer.accepted; then she uploads a picture from the site and the page shows its reference. The e2e check now runs this on the space alpha (above), so the write is made in CI: thespace:scope granted,putRecordat her PDS, and the host seeing it.knotless://chadtmiller.com/commons-site: a group's private app as its site alone (a board, a calendar with posters, a directory), writing in three spaces of its own, one of them writable by a role alone. Its flows (a member, a host who publishes an event with a poster, an admin, and someone asking to join) pass over this branch and that alpha, each poster uploaded to its host's PDS and read back throughgetSpaceBlob.npm run check, the shell'stscand build, layers, dialogs,just lex, clippy; the console's dialog drawn withjust look, desktop and phone.Shortcomings
Review
The design, then
sites.rs(writes_of,client_metadata) andshell.ts(declared,write).