Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
121584f
chore(spaces): bump spaces alpha to 20261105160032 and re-vendor lexi…
claude Nov 9, 2026
c73d152
feat(spaces): implement the 2026-11-05 spaces alpha protocol
claude Nov 9, 2026
9b64ce0
docs(spaces): document the 2026-11-05 alpha, the KEM key and the sync…
claude Nov 9, 2026
a3baf28
fix(spaces): check the space is hosted here before verifying a delega…
claude Nov 9, 2026
0d08b26
wip(space-conformance): port the suite to the 2026-11-05 alpha (in pr…
claude Nov 9, 2026
fa3ba7e
wip(check): port the browser spaces runner to the 2026-11-05 alpha (i…
claude Nov 9, 2026
31caa21
feat(space-conformance): port the suite to the 2026-11-05 alpha and r…
claude Nov 9, 2026
a3daa5f
test(spaces,pds): run the ported conformance suite in-process, and fi…
claude Nov 9, 2026
bd13253
docs(plans): record the 1105 conformance results
claude Nov 9, 2026
e5cefe3
chore(spaces): bump spaces alpha to 20261112204144 and re-vendor lexi…
claude Nov 13, 2026
f4f987b
spaces: port engine, PDS and oauth-provider to the 2026-11-12 alpha
claude Nov 13, 2026
d7fabc7
spaces: rewire conformance runner, validate listMembers cursor, docs …
claude Nov 13, 2026
8eccc11
space-conformance: port suite and matrix to the 2026-11-12 alpha
claude Nov 13, 2026
ed4b4b2
pds: give the conformance run room beyond the default test timeout
claude Nov 13, 2026
44e3da6
plans: record the slow registration-expired run against Cirrus
claude Nov 13, 2026
9452fe4
ci: pin publish and release workflows to Node LTS
claude Nov 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/space-conformance-alpha-20261105.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@getcirrus/space-conformance": minor
---

Port the conformance suite to the 2026-11-05 spaces alpha (`0.0.0-spaces-alpha-20261105160032`). The catalogue grows from 24 to 92 checks, and every method and declared error in the vendored lexicons is now covered by a `must` check, apart from the takedown, suspension and deactivation errors, which are exempted with a reason because no black-box harness can arrange them.

- Credentials are presented with the `Atproto-Space-Credential` scheme and an HTTP message signature by a P-256 key, and credentialed reads send `Atproto-Space-Want-Mac`. The DPoP helpers are gone; `createCredentialKey`, `spaceSigHeaders` and `encapsulate` replace them, all browser-safe.
- New checks cover the baseline policies, member management, credential issuance and refusals, signature and audience binding, MAC requests and verification, STAR archives, writer-set sequencing, notifications, revocation, and space and repo migration.
- Discovery checks resolve the target's DID by method and look for `#atproto_pds`, `#atproto` and a P-256 `#atproto_kem`, replacing the `#atproto_space_host` checks.
- `Target.plcDirectory` and `CheckContext.resolveDid` control DID resolution; the CLI takes `--plc`. `SyncerInbox` gains `respond()` so a harness can act as a managing app. `KeypairIdentityProvider` takes an async `didFor` and builds identity DID documents.
- The CLI's OAuth scope asks for `authority=*` on the probe space type, so refusals for spaces the user does not own reach the host's own checks.
- The coverage report lists exemptions and flags stale ones, and `space-conformance coverage` now exits non-zero on gaps.
12 changes: 12 additions & 0 deletions .changeset/space-conformance-alpha-20261112.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@getcirrus/space-conformance": minor
---

Port the conformance suite to the 2026-11-12 spaces alpha (`0.0.0-spaces-alpha-20261112204144`).

- Credentials come from `authorizeSpaceSync` (with `credentialKey`), and the writer set from `listWriters`, whose typed `repoWrite` / `repoRemoved` entries the checks now read. Member checks use the batched `putMembers` / `removeMembers`, and the managing-app checks use `checkAccess`, including the new tokenless call without a `repo`.
- MAC requests are `Accept-Signature` headers keyed by an HPKE-exported secret, and the full checks verify the MAC signatures that come back. Credential signatures are checked to be found by tag under any label, with `keyid`, `alg`, component and duplicate-signature refusals.
- Notification registration moves into `authorizeSpaceSync`'s `notify`. The `syncer-inbox` capability is now a webhook endpoint that answers `confirmRegistration` and receives `notifySpaceUpdate`. `createSyncerInbox()` provides one as a fetch-style handler.
- New checks cover `RegistrationNotConfirmed`, the `spaceRev` returned on authorisation, announced writer removals, `listRepoOps` commits on every page, the STAR content type, `InvalidRepoFile`, `RepoMismatch` and `InvalidSpaceMeta`. A slow check covers `registrationExpired`.
- Proposal 0016 citations are checked against its section anchors. The read methods' `SpaceNotFound` and every `InvalidCursor` are exempted from coverage with reasons, since nothing in the spec defines them.
- The probe space type declaration uses `title` in place of `name`.
18 changes: 18 additions & 0 deletions .changeset/spaces-alpha-20261105.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
"@getcirrus/pds": minor
"@getcirrus/spaces": minor
"@getcirrus/oauth-provider": patch
"create-pds": patch
---

Update atproto spaces to the 2026-11-05 alpha (`0.0.0-spaces-alpha-20261105160032`). This is a breaking alpha change: existing space data refuses to open until you run `pds spaces reset`, and apps built against the earlier alpha need updating.

- Space credentials are bound to a P-256 key and presented with the `Atproto-Space-Credential` scheme and an HTTP message signature, replacing DPoP. `getSpaceCredential` takes the key, delegation token and client attestation in its body, and public-read spaces issue credentials without a delegation token.
- Commits are no longer signed. Syncers verify space data with a MAC derived against a new `#atproto_kem` key. Run `pds spaces kem` to create it; on did:plc, `pds spaces kem --publish` adds it to your DID document. `pds spaces status` checks that it is published.
- `com.atproto.simplespace` is replaced by the personalspace, memberspace and managedspace policies, managed with `com.atproto.space.{create,update,delete,get}Space` and `com.atproto.memberspace.*`. Members can be given read or write access separately, and a space can publish its policy and member list to readers.
- `getRepo` serves a STAR archive, streamed rather than buffered.
- Writes are sequenced by space revision, and notifications to a space hosted elsewhere are retried for up to 24 hours.
- New: `clearRecords`, `removeWriter`, `importRepo`, `exportSpaceMeta` and `importSpaceMeta`. `pds spaces export` writes STAR archives that the new import endpoints accept.
- The DID document no longer has an `#atproto_space_host` service entry.

`@getcirrus/spaces` now bundles `@atproto/space` and its alpha dependencies, several of which have broken releases that package managers would otherwise install in their place.
16 changes: 16 additions & 0 deletions .changeset/spaces-alpha-20261112.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
"@getcirrus/pds": minor
"@getcirrus/spaces": minor
"@getcirrus/oauth-provider": minor
---

Update atproto spaces to the 2026-11-12 alpha (`0.0.0-spaces-alpha-20261112204144`). This is a breaking alpha change: the space schema moves to version 3, so existing space data refuses to open until you run `pds spaces reset`, and apps and syncers built against the 2026-11-05 alpha need updating.

- Renamed methods: `getSpaceCredential` is now `authorizeSpaceSync` (taking `credentialKey`), `listRepos` is `listWriters`, `notifyWrite` is `notifyRepoUpdate`, `notifyCredentialRevoked` is `notifyCredentialsRevoked` and the managing app's `checkUserAccess` is `checkAccess`. `putMember` / `removeMember` are replaced by batched `putMembers` / `removeMembers` (up to 100 at a time, in one commit).
- Syncers register for notifications by passing a webhook endpoint and token to `authorizeSpaceSync`, which the space host confirms with the syncer's `confirmRegistration` before issuing. Updates go to its `notifySpaceUpdate`; a lapsed registration gets one `registrationExpired` notice, and deleting a space tells every registered syncer, retried for up to 72 hours. `registerNotify`, `unregisterNotify` and `notifySpaceDeleted` are gone.
- Removing a writer is sequenced and announced, and `listWriters` lists removals.
- MACs are HTTP message signatures, requested with `Accept-Signature` and covering an `Atproto-Space-Commit` or `Atproto-Space-Record` header. STAR archives use the `application/vnd.dasl.star` media type.
- A managed space's `managingApp` must name a service (`did#service`). If the app fails, the request fails with `UpstreamFailure` rather than being refused. Under `publicWrite`, a member denied write stays excluded.
- `listRepoOps` returns the commit on every page; `listSpaces` returns each space's repo revision, digest and space revision.
- Error codes renamed: `NotSpaceOwner` → `NotAuthorized`, `UserNotAuthorized` → `AccountNotAuthorized`, `BadSpaceMac` → `InvalidSpaceMac`, `MalformedCursor` → `InvalidCursor`.
- oauth-provider: space permissions carry `spaceType` rather than `type`, space declarations use `title`, and a new `allowsSpace(permissions, check)` helper matches requests against granted scopes.
2 changes: 1 addition & 1 deletion .github/workflows/pkg-pr-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: latest
node-version: "lts/*"
cache: "pnpm"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: latest
node-version: "lts/*"
cache: "pnpm"

- name: Install Dependencies
Expand Down
13 changes: 7 additions & 6 deletions apps/check/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -763,14 +763,15 @@ function ConfirmSpacesView(props: {
collections inside those probe spaces
</li>
<li>
<span class="text-ink">·</span> Upload one 16-byte test blob and
verify it is <em>not</em> served publicly
<span class="text-ink">·</span> Upload two small random test
blobs, check one is <em>not</em> served publicly and the other
is served only through the space
</li>
<li>
<span class="text-ink">·</span> Exercise your PDS's own{" "}
<code class="bg-line/40 px-1 py-0.5">getDelegationToken</code> →{" "}
<code class="bg-line/40 px-1 py-0.5">getSpaceCredential</code> →
read flow
<span class="text-ink">·</span> Obtain space credentials for the
probe spaces (including through your PDS's own{" "}
<code class="bg-line/40 px-1 py-0.5">getDelegationToken</code>)
and present them with signed, MAC-requesting reads
</li>
</ul>
<p class="text-muted text-xs">
Expand Down
96 changes: 69 additions & 27 deletions apps/check/src/SpacesConformanceView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,34 @@
* Runner #3: the browser adapter for the spaces conformance suite.
*
* Signed in (the landing-page flow), the run carries the operator, blob
* and delegation capabilities: probe spaces, record writes, applyWrites
* atomicity, blob isolation and the operator's own delegation → credential
* → read flow all execute for real against the user's PDS, authenticated
* through the DPoP-bound OAuth session. Results stream into the table as
* each check lands.
* and delegation capabilities: space management and the baseline
* policies, record writes, blob isolation, credential issuance through
* authorizeSpaceSync, and credential presentation — HTTP-signed reads with
* an Accept-Signature MAC request keyed by an HPKE-exported secret — all
* execute for real against the user's PDS.
* Operator calls go through the OAuth session; credential-presenting calls
* carry their own WebCrypto P-256 signatures. Results stream into the
* table as each check lands.
*
* The checks a browser genuinely cannot run — harness-held foreign
* identities, the alpha crypto libs — are not shown at all: a row (or a
* count) implies a way they could have run here, and there isn't one.
* They are covered by the CLI and vitest runners.
* identities, a syncer inbox, MAC verification with the alpha crypto libs
* — are not shown at all: a row (or a count) implies a way they could have
* run here, and there isn't one. They are covered by the CLI and vitest
* runners.
*
* Without a session it degrades to the anonymous slice (discovery and
* unauthenticated request shapes) against any host the user names.
* unauthenticated request shapes) against any host or DID the user names.
*/

import { createSignal, For, onMount, Show } from "solid-js";
import {
ALPHA_BUILD,
browserCatalog,
filterCatalog,
operatorChecks,
resolveDidDocument,
runChecks,
serviceEndpoint,
type CheckContext,
type CheckResult,
type RunReport,
Expand All @@ -44,11 +51,38 @@ async function resolveDid(origin: string): Promise<string> {
return doc.id;
}

/**
* Resolve what the user typed to a target: a DID resolves through its
* method (did:plc via plc.directory) to its #atproto_pds — the space host
* for that authority — which also covers multi-tenant did:plc hosts with
* no did.json at their origin; a hostname resolves through did.json.
*/
async function resolveTarget(
input: string,
): Promise<{ origin: string; did: string }> {
const trimmed = input.trim();
if (trimmed.startsWith("did:")) {
const doc = await resolveDidDocument(
{
fetch: window.fetch.bind(window),
target: { origin: "", did: trimmed },
},
trimmed,
);
const pds = serviceEndpoint(doc, "atproto_pds");
if (!pds) throw new Error(`${trimmed} has no #atproto_pds service`);
return { origin: normalizeOrigin(pds), did: trimmed };
}
const origin = normalizeOrigin(trimmed);
return { origin, did: await resolveDid(origin) };
}

/**
* A fetch that routes same-origin requests through the OAuth agent (which
* signs each one with the session's DPoP key) and everything else through
* the plain window fetch. The conformance context keeps its bare `fetch`
* for the requests that must stay anonymous.
* attaches the session's DPoP-bound access token) and everything else
* through the plain window fetch. The conformance context keeps its bare
* `fetch` for the requests that must stay anonymous — and for those that
* present a space credential, which carry their own signature.
*/
function agentFetch(agent: OAuthUserAgent, origin: string): typeof fetch {
return (input, init) => {
Expand Down Expand Up @@ -101,7 +135,7 @@ export function SpacesConformanceView(props: { onExit: () => void }) {
catalog: filtered,
context,
suiteVersion: "web",
alphaBuild: "0.0.0-spaces-alpha-20260818163953",
alphaBuild: ALPHA_BUILD,
// Stream rows into the table as checks land. Skipped results
// are checks this transport can never run — not listing them
// avoids implying they could have; the footer counts them.
Expand Down Expand Up @@ -149,8 +183,7 @@ export function SpacesConformanceView(props: { onExit: () => void }) {
if (!raw) return;
setAuthedRun(false);
try {
const origin = normalizeOrigin(raw);
const did = await resolveDid(origin);
const { origin, did } = await resolveTarget(raw);
await runCatalog(
{
target: { origin, did, implementation: origin },
Expand All @@ -173,13 +206,20 @@ export function SpacesConformanceView(props: { onExit: () => void }) {
});

// In an anonymous run, the operator checks were skipped but WOULD run
// with a sign-in — worth a pointer. (The alpha-lib/identity checks are
// deliberately not mentioned at all: they never run in a browser.)
const operatorIds = new Set(operatorChecks.map((c) => c.id));
// with a sign-in — worth a pointer. (The alpha-lib, identity and inbox
// checks are deliberately not mentioned at all: they never run in a
// browser, signed in or not.)
const signInIds = new Set(
operatorChecks
.filter((c) => !c.needs.includes("syncer-inbox"))
.map((c) => c.id),
);
const signInWouldRun = () =>
(report()?.results ?? []).filter(
(r) => r.status === "skipped" && operatorIds.has(r.id),
).length;
authedRun()
? 0
: (report()?.results ?? []).filter(
(r) => r.status === "skipped" && signInIds.has(r.id),
).length;

return (
<div class="min-h-dvh flex flex-col">
Expand All @@ -202,23 +242,25 @@ export function SpacesConformanceView(props: { onExit: () => void }) {
when={authedRun()}
fallback={
<>
Discovery and request-shape checks against a live spaces host.
Sign in from the landing page to run the write, blob and
credential checks against your own PDS.
Discovery and request-shape checks against a live spaces host (a
hostname, or a DID to check its space host). Sign in from the
landing page to run the space, write, blob and credential checks
against your own PDS.
</>
}
>
Running the operator checks against{" "}
<span class="text-ink">{target()}</span>: probe spaces, record
writes, blob isolation and the delegation → credential → read flow.
<span class="text-ink">{target()}</span>: probe spaces and their
policies, record writes, blob isolation, and credentials — issued,
then presented with HTTP signatures and MAC requests.
</Show>
</p>

<Show when={!authedRun()}>
<form onSubmit={onRunAnonymous} class="mt-6 flex gap-2">
<input
type="text"
placeholder="pds.example.com"
placeholder="pds.example.com or did:plc:…"
value={target()}
onInput={(e) => setTarget(e.currentTarget.value)}
class="flex-1 rounded border border-faint bg-transparent px-3 py-2 text-sm"
Expand Down
16 changes: 9 additions & 7 deletions apps/check/src/lib/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ import { actorResolver } from "./resolvers";
const SCOPE = "atproto transition:generic";

/**
* The extra grant the spaces conformance run signs in with: full record
* actions on any collection plus space create/update/delete management,
* scoped to the probe space type under the user's own authority
* (`authority` defaults to `self`). A PDS without the spaces alpha
* rejects the unknown scope at sign-in, which is the right failure — the
* suite is meaningless there.
* The extra grant the spaces conformance run signs in with: every space
* action on any collection plus create/update/delete management, scoped to
* the probe space type. `authority=*` because the suite deliberately
* addresses spaces the user does not own (NotSpaceOwner refusals); with the
* default `self` those would be scope refusals before the host's own check
* is reached. A PDS without the spaces alpha rejects the unknown scope at
* sign-in, which is the right failure — the suite is meaningless there.
* Keep in sync with the CLI's OAUTH_SCOPE and the worker's registration.
*/
const SPACE_SCOPE =
"space:earth.cirrus.check.space?collection=*&manage=create&manage=update&manage=delete";
"space:earth.cirrus.check.space?authority=*&collection=*&manage=create&manage=update&manage=delete";
export const SPACES_SCOPE = `${SCOPE} ${SPACE_SCOPE}`;

const CALLBACK_PATH = "/oauth/callback";
Expand Down
2 changes: 1 addition & 1 deletion apps/check/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function clientMetadata(origin: string): Record<string, unknown> {
// the write tests, the OAuth conformance flow, and the spaces
// conformance run each request a subset of this registration.
scope:
"atproto transition:generic repo:earth.cirrus.check.testrecord include:site.standard.authFull space:earth.cirrus.check.space?collection=*&manage=create&manage=update&manage=delete",
"atproto transition:generic repo:earth.cirrus.check.testrecord include:site.standard.authFull space:earth.cirrus.check.space?authority=*&collection=*&manage=create&manage=update&manage=delete",
grant_types: ["authorization_code", "refresh_token"],
response_types: ["code"],
application_type: "web",
Expand Down
2 changes: 2 additions & 0 deletions demos/pds/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@
"HANDLE": "pds.mk.gg",
// Atproto spaces (ALPHA). Breaking upstream changes are absorbed by
// `pds spaces reset`, which wipes space data and nothing else.
// `pds spaces kem` sets SPACES_KEM_KEY and SPACES_KEM_KEY_PUBLIC.
"SPACES_ENABLED": "true"
},
// Secrets (set via `pds init` or `pds secret <name>`):
// - AUTH_TOKEN: Bearer token for API write operations
// - SIGNING_KEY: Private signing key (secp256k1 JWK)
// - JWT_SECRET: Secret for signing session JWTs
// - PASSWORD_HASH: Bcrypt hash of account password (for Bluesky app login)
// - SPACES_KEM_KEY: Spaces #atproto_kem private key (`pds spaces kem`)
"observability": {
"enabled": true
}
Expand Down
Loading
Loading