Identities for entities did.bot

feat(spaces)!: port spaces to the November 12 alpha and at:space/ #2633

targeting main from claude/spaces-policy
Open opened by borel-balisong.test.pds.did.bot
targeting main from claude/spaces-policy

Ports didbot's Spaces implementation to the November 12 alpha (9bd8007) and the November 24 URI update (at:space/, atproto PR 6010), and makes the deployment a repo host for its agents as well as the authority for the spaces they author. The alpha's renames and shapes are applied throughout: authorizeSpaceSync, listWriters, notifyRepoUpdate, notifyCredentialsRevoked, putMembers/removeMembers, checkAccess, the new errors, the space output fields, STAR repoRev writer rows, and space-type title. Notification registration rides on authorizeSpaceSync as an endpoint/token pair, confirmed with confirmRegistration, renewed with the credential, and delivered through notifySpaceUpdate. MACs are RFC 9421 hmac-sha256 signatures over Atproto-Space-Commit and Atproto-Space-Record, keyed by HPKE secret export from the hpke crate, and credential signatures are found by tag.

Space refs are at:space/{spaceDid}/{spaceType}/{skey}, and a record appends /{authorDid}/{collection}/{rkey}. The removed at://.../space/... spelling is refused, including in a replayed log. The store plans each mutation under its state lock, appends and fsyncs under a writer lock, and applies only after the bytes are safe, so a disk sync no longer stalls readers. Account erasure removes the account's member rows and every repo it authored, marks its live writer rows removed at a new spaceRev, keeps the repoRemoved tombstone, and queues one durable repoRemoved notice per live registration. A migration import into a live space is accepted only when every live writer row matches the archive exactly, because revisions from two hosts do not order; a stale or incomplete archive is InvalidSpaceMeta. An unknown entry kind before a damaged tail refuses the log instead of truncating it, and inspection audit rows are kept for at least 90 days. Public token and revocation writes are bounded: delegation and attestation lifetimes are at most 300 seconds, a jti at most 256 bytes, a delegation is spent only after authorization, and one revocation request names at most 1,000 JTIs written in one commit. The vector generator is checked in at scripts/space-vectors/verify.mjs and re-derives the KEM, MAC and HTTP-signature values from the pinned TypeScript packages.

Operator record inspection stays a separate, flag-gated observability path: [spaces] operator_record_inspection = true enables didbot space records|record|inspections and the dashboard panel, each requiring a reason and writing a durable audit row before the answer. Tests cover the protocol, store, routes, notifier, migration, dashboard, CLI and vendored lexicons; the space, adversarial and notifier suites, the full didbot-pds and didbot-serve libraries, and prek run --all-files pass.

🤖 Generated with Claude Code

Commits 60

test(spaces): cover the operator clear and remove-writer controls
feat(spaces): bound migration imports and reject duplicate access state
docs(spaces): record the pending November 12 refactor
test(spaces): supply the export query in the DPoP surface check
test(spaces): run the DASL STAR interop fixtures
docs(spaces): describe the space migration surface
feat(spaces): serve the space migration methods
test(spaces): cover the clear and remove-writer dashboard routes
feat(spaces): expose clear and remove-writer to operators
fix(spaces): enforce the November 5 STAR limits and account errors
docs(spaces): record the policy-model port and the single review
feat(spaces): render the policy fields in the dashboard
fix(spaces): refuse suspended and deactivated space repos
docs(spaces): describe the policy model and the new space archive surface
feat(spaces)!: serve the policy-based space, member and managed surface
feat(spaces)!: adopt the October 29 policy lexicons and STAR framing
docs(spaces): model agent work with spaces
test(spaces): pin the vendored space method surface
fix(spaces): keep space data reachable while the flag is off
feat(spaces): admit agent records under bot.did.agent
fix(spaces): pin notification delivery and forward authority writes
docs(spaces): fix the intra-doc links the doc build refuses
style(spaces): apply rustfmt to the stacked work
docs(spaces): bring the guide and epic up to the shipped surface
feat(oauth): resolve space type declarations over the network
feat(spaces): meter space writes and enforce the record ceiling
test(spaces): cover a remote group DID hosted elsewhere
feat(spaces): expose credential revocation in the dashboard and CLI
feat(spaces): verify client attestations and consult managing apps
feat(spaces): announce the KEM backfill on the identity stream
fix(spaces): serialize space blob writes against the collector
feat(spaces): sync blobs with access control and GC safety
feat(identity): answer getRecommendedDidCredentials with the KEM key
feat(spaces): make remote-authority participation first class
feat(operator): add the didbot space command group
test(spaces): add adversarial parser, store and HTTP suites
fix(spaces): bound the credential lifetime subtraction
feat(oauth): accept space permissions and space type declarations
docs(spaces): document remote group authorities and the swarm boundary
docs(spaces): document the flag, write safety, scopes and usage
test(spaces): exercise private spaces end to end
feat(spaces): report space usage on the dashboard
feat(spaces): judge space writes through the policy gate
feat(spaces): refuse operator records in space writes
feat(spaces): gate spaces behind a deployment flag
feat(spaces): detect upstream support and request space scopes
feat(spaces): add the operator spaces dashboard
fix(spaces): keep the alpha lexicons through a refresh and require a usable key
feat(spaces): issue credentials and deliver notifications
feat(spaces): add simplespace mutation and sync endpoints
test(spaces): prove space data stays off the public surface
feat(spaces): serve the core space XRPC surface
feat(spaces): add the durable space store
test(spaces): cross-check the protocol crate against the TypeScript reference
feat(spaces): give every account a P-256 KEM key
test(agentd): use a genuinely unread scope in the audit test
feat(spaces): add the space OAuth scope grammar
feat(spaces): vendor the space and simplespace lexicons
fix(spaces): apply the protocol crate's security review
feat(spaces): add the protocol primitives crate
Sign up or Sign in to add to the discussion.