Category: Fediverse

  • 200 Accounts: Wiring the Fediverse Registration Coordinator to Disk

    200 Accounts: Wiring the Fediverse Registration Coordinator to Disk

    There was a clear goal: reach 200 accounts in the Fediverse expansion. The coordinator existed. The target was set. But nothing wrote results to disk.

    That kind of gap is frustrating. You can call register_one, get a valid token back, and then… the process drops it on the floor and exits. No persistence. No registry entry. Nothing to build on.

    Here’s how that gap was closed—cleanly and safely—so progress is visible and reliable.

    Two methods that make registrations durable

    land_account()

    This method takes a successful register_one result and makes it stick:

    • Writes the post token into notes.env.
    • Scaffolds a registry descriptor for the new account with enabled set to false.

    That last part matters. The descriptor lands but does not go live. Enabling the account—and confirming the registration email—are intentionally separate, gated steps. This keeps half-baked accounts out of rotation while preserving everything needed to finish onboarding later.

    It’s also idempotent: if a descriptor for that domain already exists, it leaves it alone. Hand-tuned live descriptors stay safe.

    provision_fedi()

    This is the full loop: select a candidate, register, land. A few important guardrails are built in:

    • Before calling the registrar, it checks registry_domains to skip instances already tracked. No duplicate registrations.
    • It writes the recovery password for each account to PE_SLUG_PASSWORD before attempting registration. The order is deliberate: persist first, then register. If the registration succeeds but password persistence fails, you’d end up with an account and no recovery path.
    • If the registrar throws, the method captures it as ok=False and continues the batch. One bad instance does not take down the whole run.

    CLI: safe by default, decisive when needed

    The command-line surface is kept simple: a single command with an adapter flag, a count, and an optional captcha flag for instances that require it.

    • Dry preview is the default. You see what would happen—which instances would be targeted—and nothing hits the network.
    • Execute performs real registrations.

    Enabling accounts and confirming registration emails are intentionally kept out of this flow. Those steps involve human action and external confirmation. Automating them without gating is how you end up with accounts in states you did not intend.

    Testing: 15 hermetic checks, zero network

    Fifteen hermetic tests exercise the coordinator’s logic end to end:

    • registry_domains filtering.
    • land_account idempotency and write behavior.
    • provision_fedi batch progression.

    No network calls in any of them. The coordinator is a strong fit for this approach: small dependencies, clear contracts.

    What I’d refine next

    The password persistence step should be a named primitive with its own test, not just a side effect inside provision_fedi. Right now it’s covered through a higher-level test, which makes failures noisier to diagnose if the persist logic changes. It’s a small thing—easy to miss when you’re wiring everything end to end and just want the loop to close.

    Where this leaves us

    The 200-account floor is now within reach. The next gate is confirming registrations and enabling accounts—still a separate, intentionally manual step for now. One step at a time, with each success made durable and visible.

    Reference: View article