~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

The host moves to a new address, its groups keeping their DIDs

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:host/move-host

What changes

The host moves to a new address, and its groups keep their DIDs (move_host.rs, docs/design/moving.md#moving-the-host). Run this with the host stopped and its environment naming the new address (PUBLIC_URL, SERVICE_DID):

group-host move-host --from <old address> [--dry-run]

It points every service each account's DID document names at the old address to the new one, signs that with the host's rotation key, and sequences an #identity event for each account. It says, and skips:

  • an account whose DID is ended;
  • an account this host holds no rotation key to any more (a steward took it).

--dry-run says what it would do. Run again, it finds nothing left to repoint, and tells the relays again about each account already at the new address.

The group-host binary takes a command. With none it serves, as before. With anything it doesn't know, it fails with its usage (docs/reference/cli.md).

Why

This is step 8's last part, from the prototype's scripts/move-host.ts. This host keeps no managing app on its spaces and no PDS per group, so only the DID documents change. Sessions, app passwords' among them, are found by their hash, not their audience, so they go on working at the new address. It is part of the host binary, not of the opensocial command, because it needs the host's own database and rotation key.

How it was checked

tests/move_host.rs covers:

  • a dry run that changes nothing;
  • a move that repoints each document;
  • a second run, which finds nothing to do;
  • a dry run after the move;
  • skipping an ended DID and one a steward took;
  • refusing to move to where the host already is.

tests/serve.rs runs the binary's move-host --dry-run, and checks its usage for wrong arguments. just cov is at 100% locally.

Shortcomings

The relays hear the #identity events once they read the host's firehose. A relay that hasn't connected since the move hears of an account when it next reads its document.

🤖 Generated with Claude Code

Approved

This adds group-host move-host --from <old> [--dry-run]. For each account it repoints the DID document's services from the old address to the new one, signs with the host's rotation key, and sequences an #identity event. It skips ended DIDs and DIDs whose rotation key the host no longer holds. The group-host binary now dispatches on its arguments: no arguments serves, and anything it doesn't know fails with the usage text.

I read the logic and found no bugs:

  • The from == to guard is in place, as is the trailing-slash normalisation.
  • Stale services are detected correctly.
  • The rotation-key check happens before signing.
  • The dry run writes nothing.
  • A re-run re-announces only accounts already at the new address.

The tests cover each of these cases. The docs the repository asks for are updated: docs/design/README.md, moving.md and cli.md. All checks pass, including the 100% coverage gate in test.

One small point, not a blocker: the PLC publish and the tell for each account aren't atomic. If publish succeeds and tell then fails, the run aborts. A re-run takes the Current path and announces that account, so this recovers on its own.

Merged as 912d24a