chadtmiller.com/monolith
An atproto PDS
Accounts move between servers, with handles of their own domains
MergedThis pull adds account migration in both directions: a new spec/MIGRATION.md with five lexicons, a --migration harness run with handle DNS and HTTP servers, and the server's migration area with external handle resolution. The spec and README updates look complete. hickory-resolver was already a workspace dependency, so no new crates are added.
Missing guide updates. .knotless/review.md and AGENTS.md require that a change to how the server is run, deployed, called or checked updates its guide in docs/guide/ in the same pull. The diff touches no file under docs/, yet it changes all of these:
docs/guide/comparing.mdlists each harness run (--lifecycleand the others) and says nothing of--migration.docs/guide/deploying.md:57lists the development-only variablesPDS_DEV_MAIL_DIRandPDS_OAUTH_CLIENT_FETCH. The newPDS_HANDLE_FETCHis not added there. The newPDS_HANDLE_DNS_SERVERandPDS_MAX_REPO_IMPORT_SIZEare not covered in the guides either.- The
import-repoCLI command has no guide entry.
Please add these to the guides.
What I did not read. I read the diff only for README.md, harness/gates.mjs, harness/lib/args.mjs and harness/lib/handles.mjs. I did not read the rest of the diff:
- the Rust sources, including
migration.rs,identity/resolve.rsand the MST change; harness/checks/migration.mjsand the other harness changes;- the spec pages and lexicons.
I did not confirm whether harness/conformance.yaml needs an entry. A search for "migration" in it found none.
harness/lib/handles.mjs. It replaces the reference resolver's DNS and fetch calls for handles outside the PDS's own domains, so that both sides can be checked against the same data. This is fine as a harness feature. The domain test handle.endsWith(d) has no dot boundary, so notexample.test would count as under example.test. This is minor.
harness/lib/handles.mjsline 120
} | |
const own = resolver.resolve | |
const real = Object.getPrototypeOf(resolver).resolve | |
resolver.resolve = (handle) => (domains.some((d) => handle.endsWith(d)) ? own.call(resolver, handle) : real.call(resolver, handle)) |
endsWith(d) has no dot boundary, so a handle like xexample.test counts as under example.test. Compare with '.' + d or check for equality.
This round fixes the main thing I asked for. docs/guide/comparing.md now describes --moves, and docs/guide/deploying.md lists PDS_MAX_REPO_IMPORT_SIZE and puts PDS_HANDLE_FETCH with the development-only variables.
Two small guide gaps remain, and I don't think they should hold the pull:
PDS_HANDLE_DNS_SERVERappears only inspec/IDENTITY.mdand the harness. It has no entry indocs/guide/.- A search of
docs/finds no mention of theimport-repoCLI command.
On the endsWith comment I left last round: resolveHere is passed cfg.identity.serviceHandleDomains from the reference. As far as I can tell these start with a dot, as in .test, so the match is bounded. I'm withdrawing that comment.
What I read: the full diff of docs/guide/comparing.md, docs/guide/deploying.md and harness/lib/handles.mjs. I also read search hits around resolveHere and PDS_HANDLE_DNS_SERVER. The pull's diff is very large because it includes a merge of main. I did not read the Rust sources (migration.rs, identity/resolve.rs, the MST change), harness/checks/moves.mjs, the spec pages and lexicons, or harness/conformance.yaml. My approval covers the guide fixes and the handle harness only.
I read the change since my approval at 47e5b69 and found nothing that breaks it. The only spec edit rewords the PDS_MAX_REPO_IMPORT_SIZE row in LIMITS.md, with no behaviour change. The rest moves the docs-site deploy from the docs workflow to just docs-deploy and points the README and astro.config.mjs at the private site host. AGENTS.md, contributing.md, the Justfile and the workflow comments agree with each other. I checked only that they match, not that the deploy works. I did not re-read the Rust sources, the moves harness run or the spec pages. The approval still covers only what it covered before.
Two guide gaps from last round remain, and I'm not holding the pull for them. PDS_HANDLE_DNS_SERVER and the import-repo command still have no entry in docs/guide/.
I read the change since my approval at 1f36566. It is docs only, and nothing in it breaks the approval.
Both guide gaps I flagged earlier are now closed:
PDS_HANDLE_DNS_SERVERhas a row indocs/guide/deploying.md.import-repoappears indocs/guide/calling.mdwith a pipedget-repoexample.
Both additions match the spec pages they link to. I did not re-read the Rust sources, the moves harness run or the spec pages. The approval still covers only what it covered before.
An account can now move to this server, and away from it, keeping its DID, with a handle under the server's domains or its own domain. The spec, a
--movesharness run that moves accounts between the server and a third reference PDS, and the server.Claude Opus 5.5 · high
What changes
Spec.
spec/MIGRATION.mdis a new page:createAccountwith adidand a service token from the account's old server (each check of the token, in the reference's order and names),importRepo,listMissingBlobs,submitPlcOperationfor moving in, andrequestPlcOperationSignatureandsignPlcOperationfor moving out, with five new lexicons.IDENTITY.mdsays how a handle outsidePDS_HANDLE_DOMAINSis resolved (DNS_atprotoTXT and HTTPS/.well-known/atproto-did, at once, DNS winning), withPDS_HANDLE_DNS_SERVERand the development-onlyPDS_HANDLE_FETCH, so thatcreateAccountwith adidandupdateHandletake an external handle that resolves to the account.ACCOUNTS.md,LIFECYCLE.md,EMAIL.md(kindplcOperation),LIMITS.md(PDS_MAX_REPO_IMPORT_SIZE, 300 MiB by default as the reference's installer sets it;importRepoamong the writes held to the disk floor),OAUTH-SCOPES.md,SYNC.md,DURABILITY.md,OPERATIONS.md(targethandle; a moving account'screateAccountspan is itsGETof the DID document) andCOMMANDS.md(import-repo) say what each changes;docs/guide/and the docs site's sidebar name the page, the run and the variables.Where the reference takes a repository it cannot serve whole, the server refuses or mends it (MIGRATION.md, "Where the reference departs"): a CAR whose commit names another DID, a tree with nodes or records missing, or not the MST its records make, is
400; an import makes a new commit signed with the account's own key, rather than keeping the old server's commit; an active account's import puts#syncon the firehose.Harness.
harness/lib/handles.mjsserves handles over DNS and HTTP to both sides in every run, past the test network's own resolver, which asks DNS alone.harness/checks/moves.mjsis the--movesrun (named apart from main's--migrate, which moves blobs) (in thecomparegates, 6 moves): accounts move in from a third PDS and out to it, every step compared with the reference, both firehoses settled and held to each move's events, the server's operations and imports held to the spec where the reference departs, and the third PDS taking each account the server sends it.operations.mjstakes thehandletarget and a moving account'sGET; reports print BigInt span attributes.Server.
pds-serverhas amigrationarea for the five methods;createAccountchecks a service token (keys read from the DID document, read again on a bad signature) and makes a moving account deactivated, with no PLC operation and no events;importRepochecks the CAR whole, applies its tree as one commit signed with the account's key, and leaves the blobs it names missing until uploaded;identityresolves external handles throughhickory-resolverand the outbound guard.pds-repo's MST walk refuses a node reached twice.import-repois a CLI command, with no MCP tool.How it was checked
--moves --steps 3, seeds 1, 2 and 3: all agree, operations included. The run failed on the server before this change, at its firstcreateAccountwith a service token.#identityaftersubmitPlcOperation, the run fails at the firehose check; with external handles taken unresolved, atcreateAccount's refusal, on every seed once those refusals were always sent.cargo test -p pds-server(334), fmt and clippy clean;--lifecycle --steps 30and the main run agree;just quickhere.