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

Spaces as the November 13 alpha has them

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/monolith:spaces-alpha-20261113

Brings spaces up to the reference's 13 November spaces alpha (@atproto/pds@0.0.0-spaces-alpha-20261113224550, atproto permissioned-data at 16bfeba7, proposal 0016 at b54ec68): new shared secret and MACs, the methods renamed and reshaped, and syncers registered through authorizeSpaceSync. Spec, harness and server change together, since the spaces run cannot pass against the new alpha with any of them left behind.

Claude Opus 5.5 · high

What changes

Sources. spec/spaces/proposal.md and the space lexicons are vendored again from the new commits. Removed: getSpaceCredential, listRepos (space), notifyWrite, registerNotify, unregisterNotify, notifySpaceDeleted, notifyCredentialRevoked, memberspace.putMember/removeMember and managedspace.checkUserAccess. Added: authorizeSpaceSync, listWriters, notifyRepoUpdate, notifyCredentialsRevoked, memberspace.putMembers/removeMembers/defs, and, as methods the server calls without serving them, confirmRegistration, notifySpaceUpdate and managedspace.checkAccess. harness/spaces pins the new alpha.

Building blocks (SPACES.md).

  • The shared secret is HPKE's secret export: DHKEM(P-256), HKDF-SHA256, the Export-only AEAD, with info atproto-mac.
  • MACs are RFC 9421 HTTP Message Signatures with hmac-sha256. A syncer asks for one with Accept-Signature; the host answers with an Atproto-Space-Commit or Atproto-Space-Record header plus Signature-Input and Signature.
  • A credential's signature is found by its tag, under any label.
  • The vectors in spec/interop/spaces are regenerated. kem.json adds HPKE's own Export-only P-256 vector, held to the harness's code alone because the reference library fixes info.

Area pages and server.

  • SPACES-REPO.md and SPACES-EXPORT.md:
    • MACs come on request, and a refused request is InvalidSpaceMac.
    • listRepoOps answers commit on every page.
    • listRecords ignores reverse.
    • listSpaces takes spaceDid and answers space, repoRev, data and spaceRev.
    • Cursors give InvalidCursor.
    • STAR bodies are application/vnd.dasl.star, and importRepo's faults are InvalidRepoFile and RepoMismatch.
  • SPACES-POLICIES.md:
    • createSpace and getSpace answer space, and ownership refusals are NotAuthorized.
    • managingApp must be a <did>#<fragment> reference.
    • putMembers and removeMembers work in batches.
    • checkAccess answers {read, write}; an app that cannot decide makes the caller answer 502 UpstreamFailure.
    • removeWriter takes repo, and meta archives use repoRev.
  • SPACES-CREDENTIALS.md:
    • authorizeSpaceSync has a set order of checks, SpaceDeleted whatever the request, and an optional notify registration.
  • SPACES-SYNC.md:
    • notifyRepoUpdate is both sent and served, and removals from the writer set are sequenced.
    • listWriters lists repoWrite and repoRemoved entries.
    • Registrations are confirmed with confirmRegistration and lapse with their credential.
    • notifySpaceUpdate carries updates, expiry notices and deletion notices; notices are retried for 72 h.
  • Other pages: PDS.md, LIMITS.md, LIFECYCLE.md and STORE.md follow the renames.

Main harness. store.mjs, upgrade.mjs, scale.mjs and limits.mjs use the new methods and the STAR type.

Spaces are not carried across versions. Spaces are an alpha, not generally available, so STORE.md "Upgrades" no longer asks the server to read what a previous version kept of them: on 0.1.0's data it starts with no spaces, and the upgrade run checks just that (listSpaces empty, getSpace SpaceNotFound) instead of holding 0.1.0's spaces answers. The server carries no migration code for spaces.

Two harness fixes the runner turned up, both latent on main. checks/firehose.mjs yields after each event it checks: a backlog of hundreds checked in one go held up the harness's own OTLP receiver past the server's export timeout, so the server rightly dropped spans that checkSpans then missed (the store run, seed 51, on Linux). checks/oauth-scopes.mjs keeps its images-only OAuth session with the account's other sessions, so a password reset, which ends them on the server, ends it too, and checks/email.mjs holds it refused after one (it failed on main as well under load).

Why

The reference's spaces alpha moved, and the spaces run checks the server against the pinned alpha. A two-pull split, with the crypto first and the methods after, cannot pass the gates. Every MAC check needs a credential, and the new alpha issues credentials only through authorizeSpaceSync. So the whole move is one pull.

How it was checked

  • The spaces run (harness/spaces/compare.mjs) passes with --seed 1 and --seed 2, and all 165 vectors agree with the reference and the spec.
  • just quick passes, including the upgrade run from 0.1.0's data (59 reads).
  • cargo test -p pds-space, -p pds-lexicon and the touched pds-server tests pass, and clippy is clean.
  • Each area's harness module was also run with the reference on both sides, to check the checks themselves.
  • Planted bugs, each seen failing the spaces run and then put back:
    • the MAC's base without ;sf;
    • listRepoOps dropping commit on pages with a cursor;
    • confirmRegistration's challenge not compared.
  • node harness/spec-coverage.mjs and the docs-site build pass.

Shortcomings

  • Lapse and expiry notices are not checked. A registration lapses with its credential after 600 s and the alpha issues no shorter one, so lapsing, #registrationExpired and their retry schedule are specified but not compared.
  • 64 active registrations per space. This bound is the server's own (TooManyRegistrations, which no lexicon names); the reference has none. Lapsed registrations are not collected.
  • Spaces state from 0.1.0 is let go on upgrade, by design (above).
  • Spec questions the server settled:
    • An expiry notice dropped because another notice is already kept leaves the registration in place.
    • importSpaceMeta can lower a space's spaceRev.
  • Two harness changes for alpha behaviour outside spaces. The run's blobs are uploaded as text/plain, because the alpha refuses bytes that do not match their declared type. The server is named by localhost, because the alpha sends no notifyRepoUpdate to an IP address.
  • just nightly here: the crash runs and the scale run pass; the perf step fails on createAccount, createRecord, firehose and uploadBlob against main's Docker-measured baseline, paths this pull does not touch.

Review

Start with spec/SPACES.md "MACs" and spec/SPACES-SYNC.md "Syncers": these are the new design. The rest is mostly renaming.

Approved

I found nothing that must change, but this is a partial review. The diff is about 28,000 lines across 106 files. I read the changes to harness/checks/upgrade.mjs, harness/spaces/compare.mjs and harness/checks/limits.mjs. I also searched the head commit for stale names and docs. I did not read spec/SPACES*.md, the lexicons, the interop vectors, crates/pds-space, crates/pds-server or the other harness/spaces modules line by line. The new MAC design in spec/SPACES.md "MACs" and spec/SPACES-SYNC.md "Syncers" has not had my review.

  • Renames: at the head commit, getSpaceCredential appears nowhere, and docs/ has no space-method names to go stale. Spec, harness and server moved together as the body says.
  • Harness strictness: the checks I read were not loosened.
    • The upgrade check maps 0.1.0's uri onto space. It then compares getSpace and listSpaces against 0.1.0's recorded answers. spec/STORE.md "Upgrades" backs this.
    • The limits.mjs changes only rename the methods and make importRepo send STAR. They still expect InvalidRepoFile and 413.
    • Switching the server to localhost and uploading blobs as text/plain are constraints of the alpha. Both are explained in the pull.
  • Reference source: nothing in what I read takes the reference's or an SDK's source or adds atproto or MCP crates. I did not read the pds-space and pds-server changes closely enough to rule this out.
  • Docs and guide: docs/guide/comparing.md already describes the spaces run as checking against "the pinned spaces alpha", so I don't see a guide that needs a change. The pull changes no docs/guide file, and I did not check whether TooManyRegistrations (64 per space) belongs in spec/LIMITS.md.
  • Conformance excuses: this pull does not touch harness/conformance.yaml.
  • Gates: the docs and citations runs pass. The main gates run was still going when I looked, so the planted-bug proofs and the 165 vectors rest on the author's report. The author says just nightly has not been run, and a change to storage or sync calls for it before merge.

Two spec questions the author flagged are open: whether importSpaceMeta can lower spaceRev, and whether an expiry notice dropped for another kept notice leaves the registration in place. Both are now written down as behaviour. Settle them with the reference or the proposal, or say in the spec that they are the server's own choices.

Approved

I approved f300ee4. Since then the pull adds one thing: in harness/checks/store.mjs, when the harness never wrote a space repo, checkSpaceRepo now expects listRepoOps to answer 400 RepoNotFound. That makes the check stricter. spec/SPACES-REPO.md backs it at line 369 ("repo never written must be RepoNotFound") and in the listRepoOps text near line 203. Nothing from my earlier approval is affected. The docs and citations runs pass on the head. The gates run was still going when I looked. My earlier caveats still apply: this is a partial review, the planted-bug proofs rest on the author's report, and just nightly has not been run.

Approved

I approved 6cd6572. Since then the pull adds a change to how upgrades treat spaces, plus a merge of main. I read the first and not the second.

Spaces on upgrade. spec/STORE.md "Upgrades" no longer asks the server to read the spaces that 0.1.0 kept. On 0.1.0's data the server starts with no spaces. In harness/checks/upgrade.mjs, the run drops the 0.1.0 space reads and the asPrevious shim. It checks instead that listSpaces answers {spaces: []} and getSpace answers 400 SpaceNotFound. This removes checks, but the spec change explains it, and the replacement check is stated precisely. docs/guide/operating.md and store.rs say the same. I read the harness and spec parts, and only the first lines of the ac18870 server diff, which I didn't read closely. Nothing in it looks like it takes from the reference.

Merge of main. I did not review the main changes (pds xrpc, OAuth account routes). The merge breaks one test. The gates run on 680c7cd fails in test: mcp::tests::titles_and_hints panics at crates/pds-server/src/mcp.rs:1011 with "no tool memberspace_put_member". Main's new titles-and-hints test and list still use the old name, and this pull renamed it to putMembers. A check catches this, so I don't withhold approval for it. Check the hints list in spec/COMMANDS.md and pds-lexicon for other renamed or removed spaces methods (removeMember, checkUserAccess, notifyWrite and so on). Then rerun gates, because build and harness were skipped after the failure.

My earlier caveats still apply. This is a partial review, the planted-bug proofs rest on the author's report, and just nightly has not passed.

Approved

I approved 680c7cd. Since then the pull changes one line: crates/pds-server/src/mcp.rs now has memberspace_put_members in the titles-and-hints test. That is the fix I asked for last round, and nothing else in the diff touches the earlier approval. The docs and citations runs pass on the head, and gates was still running when I looked. Check that titles_and_hints passes there, and that build and harness now run. My earlier caveats still apply. This is a partial review, the planted-bug proofs rest on the author's report, and just nightly has not passed.

Approved

I approved f24f6af. Since then the pull changes three harness files, and none of them loosens a check.

  • email.mjs and oauth-scopes.mjs: the images-only OAuth session is now stored with the account's other sessions. After resetPassword the harness checks that it is also rejected with 401 invalid_token, which spec/EMAIL.md requires. Before, that session was never checked after a reset, so this is stricter.
  • firehose.mjs: yields one event-loop turn after each event is checked. This only changes timing, and it stops the harness's OTLP receiver from timing out.

The docs, citations and store-bench-small runs pass on the head. gates was still running when I looked, so check that it passes, titles_and_hints included. My earlier caveats still apply. This is a partial review, the planted-bug proofs rest on the author's report, and just nightly has not passed.

Merged as 5af4c0f