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

Spaces: the space repo, credentials, and the space authority with its policies

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/monolith:spaces4a

Three atproto Spaces slices, built in parallel on the foundation and wired together: the space repo, credentials, and the space authority with its policies. Each slice had its own spec agent, which probed the pinned spaces alpha and wrote the page and the checks, and its own builder working from the spec alone.

Spec pages (new)

  • SPACES-REPO.md, the space repo as repo host.
    • Methods: com.atproto.space.createRecord, putRecord, deleteRecord, applyWrites, clearRecords, getRecord, listRecords, listSpaces, getLatestCommit, listRepoOps.
    • The write check order, body caps, the 1 MiB record cap, published collections refused, and your own space must exist.
    • Commits are LtHash digests with MACs on request (Atproto-Space-Want-Mac).
    • Paging, and putRecord always committing.
  • SPACES-CREDENTIALS.md, both sides of a credential.
    • getDelegationToken (full sessions only) and getSpaceCredential, checked in a fixed order, with single-use delegation tokens.
    • The credential verifier: a 20-row check table, HTTP Message Signatures, and key rotation.
    • notifyCredentialRevoked, and a durable revocation store.
  • SPACES-POLICIES.md, the space authority.
    • createSpace, updateSpace, getSpace, deleteSpace, removeWriter, exportSpaceMeta, importSpaceMeta, and the memberspace member methods.
    • personalspace, memberspace and managedspace (through the outbound checkUserAccess with a service-auth JWT).
    • The publish flags, and takedown and deactivation answers.
  • Lexicons for every served method moved into spec/lexicons (44 tools in all). Names expected to change in the Nov 12 alpha are noted.

Server

  • space_repo.rs, space_credentials.rs (with jwt, attestation and single_use), space_authority.rs, and space_authz.rs.
  • How the slices are joined:
    • Policy and member records are published through the space repo's write path, in the same log frame as the change that makes them, so a crash can't split the two.
    • on_commit fires once that frame is on disk.
    • The repo slice asks the authority whether a space exists.
    • Credential-authenticated reads verify the credential with the repo's DID as the audience.
  • Storage: space commits live in the account's own log; there are no new files.
  • Hardening applies to space writes too: request caps, the free-space floor, cut-back of a failed write, and the bounded log pool. One fix along the way: rate-limit headers no longer overwrite a space read's Access-Control-Expose-Headers, which had dropped Atproto-Space-Mac.

Harness (harness/spaces/, against the pinned alpha, with a second alpha PDS as peer)

  • Repo stage: our server as repo host beside alpha peers, diffed against the all-alpha run. Each side's MACs and LtHash digests are verified by code written from the spec.
  • Credentials stage: three roles (user's PDS, space host, repo host), every refusal row, about 35 revocation cases, and a restart.
  • Policies stage: lifecycle, publishing, reads under each policy, and the managing app's calls with their JWTs verified.
  • Not compared yet, and gated so they switch on by themselves:
    • the writer set (stage 3), until the server serves notifyWrite;
    • takedown and deactivation, until accounts can be deactivated.

Checked: the spaces run on seeds 1–3; plain seeds 1–2; --commands 31; crash seed 21 with --firehose; --limits; --invites; cargo test --workspace. The merge queue runs the full gates.

🤖 Generated with Claude Code

Approved

This adds the space repo, credentials and space authority as spec pages, lexicons, server modules and harness stages. I found nothing that must change.

What I checked

  • The behaviour is specced before or with the code. PDS.md links the three new pages and SPACES.md is updated. The 16 MiB importSpaceMeta bound, the space writes' rate-limit and low-disk treatment, and the Access-Control-Expose-Headers ordering are all written into LIMITS.md.
  • The README says what is built and what is not (full-state sync, notifyWrite), and has no history in it.
  • The only new server dependency is p256 (the lock file shows nothing else). I found no @atproto references under crates/, and no MCP crates were added.
  • harness/conformance.yaml is untouched, so there are no new excuses to check.
  • The harness change in checks/commands.mjs restricts the constraint comparison to the types COMMANDS.md names. It also adds the space write tools to the destructive list. That makes the check match the spec and does not loosen it.
  • I read space_credentials.rs in full against its 20-step check list. The order, the single-use delegation tokens, and the durable revocation (answered only after the log append) all follow the spec's description. The expose-header fix in limits.rs has a test.

What I did not read

  • The diff is 70 files and 12k lines, and I did not read all of it. I did not read these:
    • space_repo.rs
    • space_authority.rs
    • space_authz.rs
    • jwt.rs
    • attestation.rs
    • single_use.rs
    • log.rs
    • the compact.rs, lib.rs and pds-cli changes
    • the harness stages repo.mjs, credentials.mjs and policies.mjs
    • the three spec pages and the lexicon JSON
  • Please don't treat the approval as covering those files.
  • The gates run on this head was still running when I looked, so I have no result from it.
Merged as 2b11034