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

Space URIs are at:space/, as the spaces alpha of November 24 names them

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:spaces/at-space-uri

The host names spaces at:space/{did}/{type}/{skey} and records in them at:space/{did}/{type}/{skey}/{repo}/{collection}/{rkey}, as the spaces proposal and the reference alpha now do, through atproto 0.4.0. Stored space URIs are renamed on start, and the old at://{did}/space/… form is refused.

Claude Opus 5.5 · high effort

What changes

Space URIs. The host, atgrp, the MCP tools, the console, the harness's seeds and flows and the docs build space URIs through atproto 0.4.0's SpaceRef and SpaceRecordUri (bluesky-social/proposals#146; the crate's at://did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3n36lfswaz236). A space or record named the old way is refused as anything that isn't one is: InvalidRequest for a space-ref field and getGroupAuth, InvalidSubject for a moderation subject, NotFound from listSpaceRecords.

Stored URIs. A store migration renames every space URI the database keeps (spaces, their repos, records, grants, writers, credentials, registrations, the index and the moderation queue), as the reference PDS's own migration does; record values stay as their CIDs cover them. Without it, an existing database's rows would no longer parse.

The reference PDS. harness/alpha.sh builds permissioned-data-alpha at 1f510f8 (@atproto/space 0.0.0-spaces-alpha-20261124235736), the alpha that speaks at:space/, for the test and e2e checks.

Why

The spaces proposal moved space URIs off at:// (there is no at:// form of a space URI any more), the reference implementation followed, and the reference PDS the host interoperates with now refuses the old form in its strict parse.

How it was checked

Against a local build of the alpha at 1f510f8: cargo test --workspace, just cov at 100% of lines and functions, clippy with -D warnings, cargo deny, just fmt, just lex, the console's npm run check, the strings, layers and dialogs checks, just docs, and all 35 e2e flows, the console on the November 24 alpha with the patch. A test opens a database written with old-form URIs and checks they are renamed. No guide picture shows a space URI.

Shortcomings

  • The console's @atproto packages move to the same alpha. Its l.space() types a space's collections as one record schema, so the meta and members spaces failed svelte-check; web/patches holds a git patch to @atproto/lex-schema's space.d.ts that infers each and gives the space their union, applied after every install (docs/development.md, "The console's packages"). It goes once upstream fixes it.
  • CI builds the alpha at /opt/atproto with alpha.sh; locally it was run against a build made by the same steps.

Review

crates/group-host/src/store.rs (the migration), then group.rs (space_uri) and moderation.rs (space_of).

Approved

This moves space URIs to at:space/… through SpaceRef and SpaceRecordUri. It adds a store migration for stored URIs and moves alpha.sh to the newer alpha commit.

I checked the migration SQL by hand, and it is correct. substr(col, 6) is the DID onward. The first / in it sits at p, which is column offset p+5. The '/space/' guard reads 7 characters from there. The remainder begins at p+12. The at:// and /space/ guards make it skip rows that aren't old space URIs, such as a bare DID or a public record URI in mod_subject or mod_event. Running it twice does nothing, since a renamed row no longer matches. defer_foreign_keys covers the renaming of space.uri under its referrers. OWN_SPACE_HOLDING is rewritten to match the new form. In moderation.rs, space_of now parses with SpaceRecordUri, so a malformed or old-form URI is refused. public_of still handles the at:// record form.

  • Stacked commits: the pull is stacked on two others, so the diff here is ~220 files. I read the files that belong to this change closely: store.rs, group.rs, moderation.rs and alpha.sh. I did not read the rest of the diff, which belongs to the parent pulls. I'll leave those to their own reviews.
  • Checks: lexicons and docs passed. test, check, e2e and web were still running when I looked. Merge only once they pass.
  • Migration coverage: the list of migrated columns is explicit, so a table that holds a space URI and isn't in it would keep the old form. The new migration test covers the tables it seeds. Anyone adding a table that stores a space URI later needs to remember this list.
Approved

I read what changed since my approval at e5e0287. It only touches the console's tooling. It moves the @atproto packages to the 20261124235736 alpha, adds web/patches/apply.sh with a postinstall hook and one type-only patch to l.space() in lex-schema, and documents this in docs/development.md. The host code, the store migration and alpha.sh are unchanged, so what I approved stands.

  • Patch script: apply.sh works for both layouts, inside and outside a git repo, because it passes the --directory prefix from git rev-parse --show-prefix. The git apply -R --check guard makes a second install skip it, and a patch that no longer fits fails the install, as the docs say.
  • Lockfile and overrides: the new alpha packages now declare lex-cbor, lex-data and lex-json at 0.1.x. package.json overrides still pin those three to the 20261117 alpha. This is consistent with the lockfile and matches the "console uses them for types alone" note. It is worth checking that npm ci and npm run check pass in CI.
  • Checks I did not read: I did not look at the check results this round.
Approved

I read what changed since my approval at e5e0287. It bumps the console's @atproto packages to the 20261124235736 alpha and adds a postinstall patch to @atproto/lex-schema's space.d.ts. It adds a docs section for the patch. Nothing here touches the migration or the URI parsing I approved, so that approval stands.

The patch changes types only, and apply.sh is sound. It skips a patch that is already applied, which makes re-running it safe. A patch that no longer fits fails the install, which is what the docs say. git rev-parse --show-prefix handles installs inside and outside a git checkout.

One thing to check, which I couldn't: web/package.json still overrides lex-cbor, lex-data and lex-json to the 20261117141222 alpha. The lockfile now resolves them to 0.1.11 and 0.1.10. If npm ci complains that the lock doesn't match the overrides, drop those three overrides or bump them. You say npm run check passed, so it may be fine.

Approved

The head aa4201e has the same content as 308b376, which I approved, so the code has not changed. Only the pull's title or body changed. My earlier approval stands: the at:space/ URI handling, the idempotent store migration, the alpha.sh bump and the console's type-only patch. I asked for nothing earlier, so nothing is outstanding. I did not read check results this round. I would still confirm that npm ci and npm run check pass with the lex-* overrides in web/package.json.

Merged as f591537