chadtmiller.com/group-host
atmosphere group host
opensocial import moves an account and its spaces here
MergedThis adds opensocial import, which moves an account and its spaces in two runs. It also makes checkImport answer with pds and, for the person doing the move, recommendedCreds. The harness now keeps the PLC codes the reference PDS mails. I read the whole diff against AGENTS.md and found nothing that must change. I did not run the checks, and the command test returns early without the space alpha.
The code, tests and docs match each other. The docs the repo asks for (cli.md, moving.md, the README, the lexicon) are updated, and the #an-account-becoming-a-group anchor exists.
One small risk: check_import calls account.expect("a move's account") at crates/group-host/src/import.rs:387. It relies on importAccount having created the account row whenever an account_import row exists. I could not see that start_import and the account insert happen in one transaction. If a crash falls between them, a checkImport from the person moving the account would panic. Returning None, so recommendedCreds is left out, would be safer. This is not a blocker.
crates/group-host/src/import.rsline 387Outdated
These lines can no longer be read.
This expect panics if a pending move has no account row, for example after a crash between the two inserts. Skipping recommendedCreds in that case would be safer.
A pending move can't exist without its account row: account_import.did REFERENCES account (did), and the host runs with foreign_keys on (store.rs:791). So the database refuses the pending row without the account, and deleting an account removes its pending move first (store.rs:500). The account is also made before the move is recorded (take_in, then start_import), so a crash between them leaves no pending row. The expect states that invariant rather than guarding a case that can happen, as completeImport's does, so I've left it.
The only change since my last review is the commit "Ask for the code with no body, as the method takes none". It stops the code request from sending a body, which fits a method that takes none. I found nothing wrong with it. I did not run the checks.
My earlier note is still open, and it was not a blocker. The expect("a move's account") calls in crates/group-host/src/import.rs, at line 387 and again near line 516, would panic if a pending move had no account row. Returning None there is still safer. Merging as it is is fine.
Since my last review there are two commits. One adds a small next helper and turns the listing loops into while let. The other extends the command test. I found nothing wrong and did not run the checks.
- Listing loops: pagination behaves as before. The first page is requested with no cursor, and the loop stops when the cursor is empty.
- Missing files: a file the server lists but won't serve now fails the run with
{space} has no file {cid}. The PR body's Shortcomings section already says this. - Test: the account now writes in a calendar that Alice governs, and the move uses
--address. The asserts match: 3 spaces, 2 records, 1 file, and the calendar's paths are checked on the host.
My earlier note is still open and was never a blocker. The expect("a move's account") calls in crates/group-host/src/import.rs at lines 387 and 516 would panic if a pending move had no account row. Returning None there would be safer. Merging as it is is fine.
What changes
opensocial import <account> [--address <label>]moves an account from its server here, to become a group run by whoever is signed in (OPENSOCIAL_AS). It signs in to the account at its own server withOPENSOCIAL_IMPORT_PASSWORD, the account's own password, since its server signs its identity over for no app password. Then it:checkImport), and stops with the host's reason if the move is refused;createAccounttoken (importAccount);importAccountSpace);opensocial import <account> --code <code>then has that server sign the PLC operation and callscompleteImport.checkImportsays more. It now answers withpds, the server the account lives on. While the caller's own move of the account is pending, it also answers withrecommendedCreds, what the operation should name, so the second run needs nothing kept from the first. Both are new optional output fields.The harness catches mailed codes.
harness/pds.mjskeeps each PLC code the reference PDS mails, by address, and serves it atmail(GET <mail>?to=<address>), as the account's inbox would have it.Why
A console page, or a command, was the missing client for the import methods. You chose the command first, and a console page next. The command already signs in as a person with a password. A page needs a second, broad sign-in to the moving account, which the host's
atproto-only console sign-in doesn't hold.The move is two runs rather than a prompt for the code, because an email can take a while to arrive and the process may end in between.
checkImportgives back what the second run needs, rather than the command keeping state on disk.How it was checked
tests/commands.rsmoves an account on the reference PDS. It makes its own account, so the shared Alice and Bob stay put. That account governs a memberspace Alice reads, holding a record with a file, and a personal space it hasn't written in.The test refuses three runs: one without
OPENSOCIAL_IMPORT_PASSWORD, one asking for an address the host refuses, and--codebefore any move has started. Then it runsimport, reads the code from the harness, and runsimport --code. On the host, the account is switched on, the forum is public with Alice reading it, the account's repo there holds the record, and the forum's writer set has heard of it.tests/import.rschecks thatcheckImportanswers withpds, and withrecommendedCredsfor whoever is moving the account and nobody else.The command test needs the alpha's spaces (
listSpaces), so it runs on CI only. On my machine it returns early.Shortcomings
importAccountdiscards what the earlier start copied.importAccountleaves out a missing file.🤖 Generated with Claude Code