chadtmiller.com/group-host
atmosphere group host
An account moving here brings its spaces
MergedThis adds importAccountSpace, so a pending account move can bring its spaces (meta, repo and blob parts). A space's policy is turned into grants, and the repos tell their spaces' authorities in completeImport. The STAR reader and writer are reworked, and read_space_meta is new. I read the host source, the atproto space.rs changes and the check results. I did not read the tests, the reference vectors/scripts, the lexicon or the docs.
I found no bugs in what I read:
- Refusing unsupported policies is the right call, and the ordering checks (meta before repos, reserved spaces, owner checks) hold up.
- The varint and frame bounds are sound.
space_commitnow passesasked.copiedthrough tocheck, which is what lets a record point at a file that didn't come.
Checks: check, lexicons, web and e2e pass. test fails at the coverage gate. The report shows 1 line missed in total, and import_space.rs is at 99.58% on lines. Your gate is 100%, so a test or simplification is needed. A usual cause is a ? that cargo fmt put on its own line, as AGENTS.md describes. Look at import_space_repo and access first. This is the gate's to enforce, so I'm not withholding approval for it, but the pull can't merge until test is green.
This is the same pull as before: importAccountSpace lets a pending account move bring its spaces, with the STAR and space-meta archive work in atproto. Since my last review the author added two things. The space repos' query is now bound before its ? so the line counts for coverage. And the part's body is read only once the caller is known to be the one moving the account, which also takes in the read_body change merged from host/body-limit.
My earlier review found no bugs and asked for nothing except a green test. That is now done: at head 6f748f2 every check passes (check, lexicons, web, e2e and test), and the coverage gate that failed before is green.
I did not re-read the whole diff this round. Beyond the check results, I relied on the two new commits' messages and on the earlier review of the rest. The body-before-auth change is a sound way to avoid holding up to 100 MiB for an unauthenticated caller. Nothing I know of blocks the merge.
This is the same pull as before: importAccountSpace lets a pending account move bring its spaces, with the STAR and space-meta archive work in atproto. The only new commit since my last review at 6f748f2 is a merge of origin/main into the branch, at 94786e4. I didn't re-read the diff this round. I relied on my earlier reviews and on the check results.
I asked for nothing last round, and nothing is outstanding. At 94786e4 every check passes: check, lexicons, web, e2e and test, including the coverage gate. The pull is a fast-forward. I know of nothing that blocks the merge.
What changes
Spaces come with an account moving here.
fyi.opensocial.importAccountSpaceserves while an account's move is pending (afterimportAccount, beforecompleteImport). Whoever started the move hands over each of the account's spaces as its own server exports them, since only the account, signed in there, may export them:meta: a space it governs, as the alpha's meta archive (com.atproto.space.exportSpaceMeta).repo: its repo in a space, its own or another's, as a STAR archive (com.atproto.space.getRepo). It is checked against its commit's set hash, and records this host wouldn't keep are left out, asimportAccountdoes.blob: a file of its in a space.A policy becomes grants. A personalspace is the group's alone. A memberspace's members get the grants it gave them, and its public reading becomes the space's. A policy this host would not keep as it says is refused with
UnsupportedPolicy: anyone writing, only some apps, or a managing app. The two spaces a group makes for itself are refused withSpaceReserved. Bringing a part again replaces what came before, and starting the move over discards it all.Spaces hear of it once it is switched on. Its repos tell their spaces' authorities nothing while it is switched off.
completeImporttells each one, by the account's key here, and indexes the spaces it governs again.atproto: STAR and the space meta archive.
read_star_partsandwrite_starread and write a STAR archive of any profile, as the alpha'sstar.tsdoes: lengths in their shortest form and at most six bytes, the metadata in DRISL's one form with a$type, and an end only between pairs. The repo archive is built on them, and a record in one is now held to a mebibyte, as the alpha holds it.read_space_metareads the meta archive: its sections in order, each key once and in byte order, and every writer a DID with TIDs and a digest.Lexicon.
importAccountSpacegainsSpaceReservedandTooLarge, and descriptions on its output and errors.Why
My earlier note that the alpha had no meta archive was wrong. The prototype's lockfile had moved to the October 29 alpha, which has it, but its
node_modulesstill held the October 22 build, and I read that. The October 29 package also installs only with its@atproto/*dependencies pinned: its ranges resolvelex-cborandlex-datato a stray0.0.0whose dependencies areworkspace:*. That is in the reference vectors' README.The policy becomes grants, rather than being kept as the policy object as the prototype does, because this host decides who reads and writes from its grants and a group's access records. Keeping a policy it doesn't enforce would quietly change who may use the space, so those policies are refused.
A repo doesn't tell its space while the account is switched off. An authority elsewhere checks the account's service token against the key the directory names, which is still the old server's until
completeImport, and it would refuse that for good.The changes elsewhere:
space_commitnow honoursAsked.copied, so a record in a space may point at a file that didn't come, as one in the public repo already may.keepsmoved fromimport.rsso both imports share it.importAccountSpacereads a part's body only once it knows the caller is the one moving the account, and the part: an archive up to 100 MiB, a file up toBLOB_UPLOAD_LIMIT.How it was checked
space-meta.jsoncomes fromspace-meta.mjs, run against@atproto/space0.0.0-spaces-alpha-20261029171913. It holds two archives the alpha writes, with what it reads back, and the 19 archives its own tests refuse. Here the two read the same, and every one it refuses is refused. The STAR tests cover each new refusal, and atproto stays at 100% of lines and functions on its own.tests/import.rs, porting the prototype'simportAccount.test.tsspace cases):completeImportdoes the first hear of it, and the second turns it away.record_key_to_did.tests/interop.rs): Alice, on the reference PDS, governs a memberspace Bob reads and she writes in. What it exports is read here: her policy, Bob as a member, and her repo, whose digest is the writer set's. This runs only whereGROUP_HOST_DEV_ENVnames the alpha, so on CI and not on my machine.cargo test --workspacepasses here.Shortcomings
opensocialcommand imports an account, so there is nothing yet that exports the parts and hands them over. That comes with an import page or command.Review
This builds on at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3mzipvq36bgrm (
xrpc::read_body), so read that first; its commits show here until it merges. Then readimport_space.rs, then the STAR rework incrates/atproto/src/space.rs.🤖 Generated with Claude Code