Skip to content

feat(spaces): update to the 2026-11-17 spaces alpha (via 2026-11-05 and 2026-11-12) - #256

Merged
ascorbic merged 18 commits into
mainfrom
ccr-fcda09b2-cblvn7
Nov 19, 2026
Merged

ascorbic merged 18 commits into
mainfrom
ccr-fcda09b2-cblvn7

Conversation

@ascorbic

@ascorbic ascorbic commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Moves atproto spaces from the August alpha to 0.0.0-spaces-alpha-20261117141222, by way of the 2026-11-05 and 2026-11-12 builds. Both of those are breaking alpha changes: space data needs pds spaces reset after deploying (schema version 3), and apps built on earlier alphas need updating. 1113 and 1117 change no lexicons and no @atproto/space code, so for Cirrus they're a pin bump.

The sync process used for each step is now written down in plans/in-progress/spaces.md, and the plan has a section per alpha with the details.

2026-11-05 alpha

  • Credentials are bound to a P-256 key and presented with Atproto-Space-Credential plus an HTTP message signature, replacing DPoP.
  • Commits are unsigned; syncers verify data with a MAC derived against a new #atproto_kem key (pds spaces kem).
  • simplespace is replaced by the personalspace / memberspace / managedspace policies.
  • getRepo streams STAR. Writes are sequenced by space revision.
  • New: clearRecords, removeWriter, importRepo, exportSpaceMeta, importSpaceMeta.
  • @getcirrus/spaces and @getcirrus/space-conformance now bundle the alpha @atproto packages, because several have broken releases that outrank the alpha range.

2026-11-12 alpha

  • Renames:
    • getSpaceCredential → authorizeSpaceSync
    • listRepos → listWriters
    • notifyWrite → notifyRepoUpdate
    • notifyCredentialRevoked → notifyCredentialsRevoked
    • checkUserAccess → checkAccess
    • putMember / removeMember → batched putMembers / removeMembers (up to 100, in one commit)
  • Notification registration:
    • A syncer passes notify: {endpoint, token} to authorizeSpaceSync, and the space host confirms it with the syncer's confirmRegistration before issuing the credential.
    • Updates go to notifySpaceUpdate.
    • When a registration lapses, the syncer gets one registrationExpired notice.
    • spaceDeleted notices go to every registration and are retried for 72h.
    • registerNotify, unregisterNotify and notifySpaceDeleted are gone.
  • Writer removals are sequenced and announced, and listWriters lists them.
  • MACs are RFC 9421 signatures: requested with Accept-Signature, covering an Atproto-Space-Commit or Atproto-Space-Record header. STAR archives use application/vnd.dasl.star.
  • Managed spaces:
    • managingApp must be did#service.
    • If the managing app is down, requests fail with UpstreamFailure (502) rather than being treated as a refusal.
    • Under publicWrite, a member denied write stays excluded.
  • Errors: renamed NotSpaceOwner → NotAuthorized, UserNotAuthorized → AccountNotAuthorized, BadSpaceMac → InvalidSpaceMac and MalformedCursor → InvalidCursor. New: InvalidRepoFile, RepoMismatch, InvalidSpaceMeta, RegistrationNotConfirmed and UpstreamFailure.
  • oauth-scopes: permissions carry spaceType, and space declarations use title. oauth-provider exports an allowsSpace(permissions, check) helper.
  • Upstream packages: four more have outranking broken releases (lex-rpc, oauth-resolver, lex-password-session, bsync), now overridden in pnpm-workspace.yaml.

2026-11-13 and 2026-11-17 alphas

  • 1113: publishes the alpha's internal dependencies as exact versions. That isn't enough to stop bundling, since exact sibling pins already failed to rescue npm at 1105.
  • 1117: merges main. Its one spaces change is that the reference refuses app passwords on every space route, which Cirrus already does. It also fixed the reference's 500 on a malformed client attestation.
  • No new broken releases outranking the alpha range.

Conformance (106 checks)

  • Reference PDS (matrix, 1117): 104 pass, with one pinned divergence on the reference's side: its deleteRecord answers 200 for a missing space. The malformed-attestation divergence is unpinned now that the reference passes it.
  • Cirrus: every runnable must and should check passes, both on the space routes in-process and on the integrated PDS worker.
  • Slow check: notify.registration-expired waits out a real 10-minute credential, so CI skips it. Run by hand on 1112, it passed against both the reference and Cirrus.
  • Bug found: the suite caught one Cirrus bug, fixed here: listMembers accepted a garbage cursor.

CI

  • The publish and release workflows now use Node lts/* instead of latest. latest had started resolving to a Node 27 alpha that better-sqlite3 can't compile against.

Verification

  • pnpm build, pnpm check and pnpm knip are clean.

  • Tests pass on 1117:

    Package Tests
    spaces 80
    pds 355
    oauth-provider 140
    space-conformance 47
    matrix 5
    create-pds 4
  • The engine bundle imports only hono, jose, @ATCUTE and cloudflare:workers.

Not exercised: the browser checker against a live PDS, the CLI's --oauth path, and cross-PDS flows against a real foreign PDS.

After merging

  1. Deploy, then run pds spaces reset. The KEM key carries over.
  2. Republish the earth.cirrus.check.space probe declaration, which now uses title (see packages/space-conformance/probe-lexicons/README.md).

🤖 Generated with Claude Code

https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB

…cons

Pins @atproto/space, oauth-scopes and dev-env to the 2026-11-05 alpha,
cut from permissioned-data-alpha@704b9e2. Re-vendors the space,
memberspace, personalspace and managedspace lexicons (simplespace is
gone upstream) with a new scripts/vendor-lexicons.mjs, so the weekly
sync's vendor step is one command.

@atproto/space now depends on the alpha lex-cbor/lex-data/star builds,
each of which has an outranking broken release (bare 0.0.0, or star's
corrupt 0.0.0-stage). Sibling pins no longer rescue npm installs, so
the published spaces and conformance packages keep every alpha @atproto
package in devDependencies for tsdown to bundle, and @getcirrus/pds
drops its direct @atproto/space dependency and the common pins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
Rewrites the spaces engine and its PDS integration for the upstream
alpha cut from permissioned-data-alpha@704b9e2:

- Space credentials bind to a P-256 did:key and are presented with the
  Atproto-Space-Credential scheme, an Atproto-Space-Audience header and
  an HTTP message signature over both. DPoP is gone. Credentials are
  checked against the audience, their space and revocations received
  through notifyCredentialRevoked.
- getSpaceCredential takes credentialKid, delegationToken and
  clientAttestation in the body, issues public-read credentials without
  a delegation token, and answers a refused user as SpaceNotFound.
- Commits carry no signature: {ver, repo, space, rev, data}. Reads that
  return a commit or record are authenticated with a MAC derived by ECDH
  against the account's new #atproto_kem key (BadSpaceMac when a
  credential doesn't ask for one).
- getRepo streams a STAR archive in record-path byte order, fencing
  against concurrent writes instead of buffering the whole repo.
- simplespace is replaced by personalspace, memberspace (per-member
  read/write, public read/write, allowed apps) and managedspace policies
  under com.atproto.space.{create,update,delete,get}Space and
  com.atproto.memberspace.*, with optional published policy and member
  records in the authority's repo.
- Writers are sequenced by space revision (listRepos cursor, spaceRev
  and prevSpaceRev in forwarded notifyWrites, FutureRev), and a repo
  host retries its notifyWrite to a foreign authority for 24 hours,
  coalesced to the newest revision.
- New: clearRecords, removeWriter, importRepo, exportSpaceMeta and
  importSpaceMeta. Imported records' blobs are promoted when uploaded.
- The DID document drops #atproto_space_host and publishes
  #atproto_kem; getRecommendedDidCredentials carries it through a
  migration. 'pds spaces kem' creates the key and, for did:plc, can
  publish it via the PDS's own PLC signing.

The space DO schema version is bumped: existing space data refuses
until 'pds spaces reset', per the alpha policy. @atproto/space and its
alpha dependencies are bundled into @getcirrus/spaces, whose public
types no longer reference any @atproto package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
… process

Updates the spaces concepts and enable guides for credentials signed
with HTTP message signatures, MAC-authenticated space data and the
#atproto_kem key, the baseline policies and migration, with upgrade
steps from the August alpha. Records the alpha sync process in the
spaces plan, where it can be found next time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
…tion

Verifying a delegation token records its replay key in the space DO, so
a well-formed request naming any foreign space would otherwise create an
empty DO for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
…ogress)

Snapshot of the conformance suite rewrite while it is still under way:
HTTP-signature credentials, MAC verification, STAR archives, the
baseline policies and the new methods. Not yet green; the finished
version, in-process runners and matrix recalibration follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
…n progress)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
…ecalibrate

Rewrites the check catalogue (24 → 92 checks) for HTTP-signature
credentials, MAC-authenticated commits and records, STAR archives, the
baseline policies, writer sequencing, migration and revocation. Coverage
now requires zero gaps against the vendored lexicons, with explicit,
stale-checked exemptions. The reference matrix runs every capability
against the 1105 reference PDS (89 pass, 3 pinned divergences) and pins
the alpha build it was calibrated on. apps/check follows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
…x what it found

Rewires both in-process runners to the 2026-11-05 suite. The space-routes
run now offers every capability except the PDS-level ones: harness did:key
identities, real service-auth verification, and an in-process syncer inbox
that also receives the space DO alarm's deliveries. The PDS run adds the
#atproto_kem discovery check and the MAC'd self-flow.

Fixes the suite turned up:
- getBlob answered 503 without blob storage before checking the space and
  the reference, instead of SpaceNotFound / BlobNotFound.
- Managing another authority's space answered SpaceNotFound rather than
  the declared NotSpaceOwner.
- listSpaces moves into the engine, which owns the space index.
- The PDS resolved its own DID's #atproto_pds by fetching its DID
  document, which a Worker can't do for its own hostname, so a syncer
  registering the operator's own service failed on a deployed PDS.

Also drops knip ignores and devDependencies left over from the 0818 pins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
pdscheck c83a8ba Nov 19 2026, 10:15 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
cirrusdocs baa2194 Commit Preview URL

Branch Preview URL
Nov 19 2026, 10:07 PM

…cons

Pins the 2026-11-12 alpha, cut from permissioned-data-alpha@b27a037 (the
20261112203312 build has identical code). Re-vendors the space lexicons:
getSpaceCredential becomes authorizeSpaceSync, listRepos listWriters,
notifyWrite notifyRepoUpdate, putMember/removeMember the batched
putMembers/removeMembers and checkUserAccess checkAccess; registerNotify,
unregisterNotify and notifySpaceDeleted give way to confirmRegistration
and notifySpaceUpdate.

@atproto/lex-rpc and @atproto/oauth-resolver now publish a corrupt
0.0.0-stage, and bsync and lex-password-session a broken bare 0.0.0, all
outranking the alpha range; they join the workspace overrides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
Renamed and batched methods (authorizeSpaceSync, listWriters,
notifyRepoUpdate, putMembers/removeMembers, checkAccess), token-based
notification registration confirmed by the syncer, sequenced writer
removals, HTTP message signature MACs, STAR media type and the renamed
error codes. oauth-scopes: spaceType parameter and title declarations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
…for 1112

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
106 checks; syncer inbox serves confirmRegistration and notifySpaceUpdate
via createSyncerInbox. Matrix recalibrated: 103 pass, 2 pinned
divergences, registration-expired slow and run by hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
@ascorbic ascorbic changed the title chore(spaces): bump spaces alpha to 20261105160032 and re-vendor lexicons feat(spaces): update to the 2026-11-12 spaces alpha (via 2026-11-05) Nov 13, 2026
node-version: latest now resolves to a Node 27 alpha, which
better-sqlite3 can't compile against, so the PR preview publish fails
at install. Match claude.yml's lts/*.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
@pkg-pr-new

pkg-pr-new Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/create-pds@256
npm i https://pkg.pr.new/@getcirrus/oauth-provider@256
npm i https://pkg.pr.new/@getcirrus/pds@256
npm i https://pkg.pr.new/@getcirrus/spaces@256

commit: c83a8ba

ascorbic added a commit that referenced this pull request Nov 19, 2026
node-version: latest now resolves to a Node 27 alpha, where better-sqlite3
fails to build, so every preview publish since the 18 November pushes failed
(same change as #256). The preview also left @getcirrus/pds depending on
@getcirrus/spaces via workspace:*, which nothing published, so installing
it failed; publish spaces alongside it.
ascorbic added a commit that referenced this pull request Nov 19, 2026
* docs(plans): plan PLC rotation and recovery keys

* fix(pds): refuse to sign PLC operations without a rotation key

signPlcOperation signed with SIGNING_KEY regardless of whether it was one
of the DID's rotation keys. For accounts migrated with `pds identity` it
usually is not, so plc.directory rejected the result and outbound migration
failed with an opaque error. It now returns InvalidRequest explaining why.

The PLC operation types, audit-log lookup and signing move to src/plc.ts so
the CLI can sign operations with a locally held key.

* fix(pds): require full access to sign PLC operations

getMigrationToken and signPlcOperation accepted any authenticated caller:
app-password sessions, OAuth tokens of any scope, and service JWTs (which
getServiceAuth mints for any caller). Together they let any of these get a
PLC operation signed by the PDS. That was only harmful where the signing
key is a rotation key, which the following commits make the norm.

Both endpoints now require the static AUTH_TOKEN, a password session, or an
OAuth token granted identity:*. AuthInfo records how the request
authenticated so the check can tell app passwords and service JWTs apart
from password sessions.

* feat(pds): CLI helpers for PLC rotation and recovery keys

- SourcePdsPlcClient.signPlcOperation takes the fields to change, so callers
  can set rotationKeys. Adds getRecommendedDidCredentials (to recognise the
  source PDS's keys) and PlcDirectoryClient.getLatestOperation.
- PDSClient gains getRecommendedDidCredentials and signPlcOperation, so the CLI can
  have the deployed PDS sign for itself.
- New rotation-keys utils: ordering (user keys first, PDS key last, max 5),
  labelling, recovery key generation, and importing pasted private keys.
  Keys use goat's multibase encoding; checked against goat in both
  directions for K-256 and P-256.
- The signing key backup prompt moves out of init into promptKeyBackup, and
  the 1Password and file backups take a key kind so they work for recovery
  keys. init behaves as before.
- The CLI's PLC types now come from src/plc.ts.

* feat(pds): give the PDS a rotation key when migrating identity

`pds identity` asked the source PDS to sign an operation that left the
rotation keys unchanged, so the source PDS kept control of the DID and
Cirrus could not sign PLC operations. It now sets the rotation keys to the
keys the user holds, then this PDS's signing key, and removes the source
PDS's key.

- The source PDS's recommended credentials identify its keys. The user is
  asked about each other key, and those they hold are kept on top.
- If the user holds none, it offers to generate a recovery key, and only
  adds it after the user confirms it is backed up.
- The PDS key comes from the deployed PDS's recommended credentials rather
  than .dev.vars, and a mismatch with .dev.vars stops the command.
- The signed operation is checked for the requested rotation keys before
  submitting, and read back from plc.directory afterwards.
- Key choices happen before requesting the email token, with a summary and
  a confirmation.
- --token now logs in too. Signing needs a session, so that path could not
  have worked before.

* feat(pds): add `pds rotation-keys` for already-migrated accounts

Accounts migrated before `pds identity` set rotation keys still have the
previous PDS's key and not Cirrus's. The new command shows the DID's
rotation keys and rewrites them as the keys the user holds, then this PDS's
key, offering a recovery key if the user holds none.

The change is signed by whichever key can:
- this PDS, when its key is already a rotation key (adding a recovery key,
  or dropping keys the user doesn't hold);
- the previous PDS, found from the PLC audit log, with its password and an
  email code;
- a rotation key the user pastes in (goat multibase or hex), signed locally.

The signed operation is checked against the requested keys and endpoint
before submitting, and read back afterwards.

Key selection now defaults to keeping keys whose holder is unknown, since
pressing enter could otherwise drop a user's recovery key.

* feat(pds): show rotation key status in `pds status`

For did:plc accounts whose DID points at this PDS, status now reports
whether the PDS's key is a rotation key (an error if not, since the PDS
then can't update the identity) and warns when it is the only one, pointing
to `pds rotation-keys` in both cases.

* docs(pds): document rotation and recovery keys

- README: `pds identity` steps, the new `pds rotation-keys` command, a
  note that outbound migration needs the PDS to be a rotation key, and a
  Rotation and Recovery Keys section covering priority, the 72-hour
  override and using the recovery key with goat. The goat commands were
  run against a local PLC directory with a generated recovery key.
- Root README Key Safety: the signing key is now also a rotation key, and
  migration offers a recovery key.
- Plans: record what was built and tested, and what still needs a live
  test; note rotation keys in the migration plan.
- Changeset.

* chore(pds): stop exporting saveTo1Password

Only promptKeyBackup calls it now, so knip flagged the export.

* feat(pds): set the handle in alsoKnownAs when migrating identity

`pds identity` left alsoKnownAs unchanged, so migrating from a
*.bsky.social handle to a custom domain chosen in `pds init` kept the old
handle in the DID document and the new one failed verification. The
operation now sets the configured HANDLE as the first at:// entry
(withHandle in src/plc.ts), shows the handle change in the summary, and
refuses to submit if the source PDS signed a different alsoKnownAs.

* feat(pds): explain and check the handle change during migration

`pds identity` now moves the handle, but nothing said so:
- init warned that a custom domain could be set up "after transferring
  your data". It now says the handle chosen there takes effect when
  `pds identity` runs.
- The migration path never showed the Identity Setup note, so a handle
  other than the PDS hostname came with no TXT record instructions. The
  note is now shared by both paths.
- `pds identity` checks the new handle resolves to the DID (DNS or HTTP)
  before logging in. If not, it shows the TXT record or the PDS URL to fix
  and asks before continuing, defaulting to cancel.

* ci: pin Node to LTS and publish spaces previews

node-version: latest now resolves to a Node 27 alpha, where better-sqlite3
fails to build, so every preview publish since the 18 November pushes failed
(same change as #256). The preview also left @getcirrus/pds depending on
@getcirrus/spaces via workspace:*, which nothing published, so installing
it failed; publish spaces alongside it.

* fix(pds): resolve handles over HTTP as well as DNS in the CLI

resolveHandleToDid only checked DNS TXT records, so `pds init` could not
find any *.bsky.social account to migrate: those handles resolve only via
/.well-known/atproto-did. It now tries DNS first, then HTTP, as the PDS
itself does.

* chore: changeset for CLI handle resolution over HTTP

* docs(plans): record live test results for PLC rotation keys
ascorbic and others added 2 commits November 19, 2026 22:05
No lexicon or @atproto/space changes since 1112. The 1117 reference
fixed the malformed-attestation 500, so that divergence is unpinned:
the matrix is 104 pass, 1 pinned divergence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
@ascorbic ascorbic changed the title feat(spaces): update to the 2026-11-12 spaces alpha (via 2026-11-05) feat(spaces): update to the 2026-11-17 spaces alpha (via 2026-11-05 and 2026-11-12) Nov 19, 2026
@ascorbic
ascorbic merged commit 9ca9c2f into main Nov 19, 2026
6 checks passed
@ascorbic
ascorbic deleted the ccr-fcda09b2-cblvn7 branch November 19, 2026 22:27
@mixie-bot mixie-bot Bot mentioned this pull request Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants