Skip to content

At a glance

Audience
Authority and syncer developers
Type
Decision record
Status
legacy

At a glance

Audience
Authority and syncer developers
Type
Decision record
Status
legacy

This page describes the October contract. No current build implements it.

October writer sync contract proposed ​

At a glance

QuestionAnswer
StatusProposed. The delivery policy is a proposal, not shipped Stratos behavior.
ScopeHow a Stratos authority and a syncer treat the standard writer listing and write notifications, beside the custom membership listing.
What it decidesCurrent enrollment authorizes writers and selects repositories. Standard writer metadata only identifies changed repositories.
What it does notIt adds no production endpoint, storage, scheduler, or discovery role. Mixed-custody representation and the outbox policy stay unresolved.

Problem and decision ​

Keep enrollment membership separate from standard writer updates. Replacing the current member snapshot with a writer delta would revoke unchanged members incorrectly. Treating a notification as membership would admit unauthorized writers.

This design is for authority and syncer developers. It adds no production endpoint, storage, scheduler, or discovery role. Stratos continues to serve its custom membership listing. A polling-only Feedgen can keep polling; migrating credentials does not require a notification server.

We select two independent contracts:

  • Current enrollment authorizes writer admission and selects repositories to read. Membership generation fences prevent removed writers' staged work from becoming visible.
  • Standard writer metadata identifies changed repositories. It neither authorizes access nor proves repository contents. Confirm state directly with the repository host.

Hosting responsibility, access, data lifecycle, and shared control remain separate under the accepted credential revocation decision. Departure is not deletion. Retained hosting does not authorize a new write notification. D02 full-content proof and D03 foreign blob delivery remain separate work.

Why two listings are necessary ​

ContractCurrent custom membership snapshotProposed standard writer listing
Methodzone.stratos.space.listReposcom.atproto.space.listRepos
SourceActive enrollment carrying the boundaryLatest accepted update for each writer
Rowdid, custody, optional host and Stratos revdid, repoRev, hash, spaceRev
CursorEnrollment DID; returned for a full pageExclusive plain string naming the last returned space revision; returned for every nonempty page
CompletionNo next cursorEmpty repos, with no cursor
Repeated DIDInvalid in the current member snapshotExpected if that writer changes while paging
OmissionRelevant only after complete membership enumerationNot removal; unchanged writers are absent from a delta
AuthorizationCurrent enrollment and boundaryNo authority to grant membership or read access

The current Rust reconciler replaces its member set only after complete custom enumeration. Partial failures preserve the previous baseline. Its duplicate-member rejection belongs to that snapshot, not standard writer catch-up. Do not feed standard pages into that reconciler.

A Stratos-custody MST root is not the SHA-256 digest of a standard LtHash state. Do not fabricate hash from a CID or silently migrate custody. Keep Stratos-custody repositories on their existing signed sync path. Publishing a mixed-space standard role remains blocked on an explicit representation decision.

Reference: writer listing ​

The final lexicon has space, optional limit (1–1000, default 100), and optional cursor. There is no since parameter. Output is { repos, cursor? }, with no top-level spaceRev. Each row contains:

FieldMeaning
didWriter's account DID
repoRevWriter's latest reported repository revision, a TID
hashReported SHA-256 digest of its LtHash state, encoded as lexicon bytes
spaceRevAuthority-assigned revision of that writer update, ordered across this space

Actual signed repository commits still use rev. Renaming notification/listing metadata does not rename commit fields.

cursor is a plain string, not a schema-constrained TID. Forward it unchanged, including strings that are not parseable TIDs. Do not reuse a custom DID cursor. The reference selects spaceRev > cursor, sorts ascending, and returns the last row's spaceRev even on a short page. Continue until an empty page. Preserve the last successfully processed checkpoint when the empty page omits its cursor.

Writer rows are latest state, not an event log. Intermediate writes can coalesce. A writer may reappear after a later write. Processing must be idempotent and must not remove other writers. A bounded consumer that reaches a page/time budget yields and resumes; it must not declare completion merely because a page is short.

Reference: notification authentication and admission ​

HopAuthentication and authorization
Repo host to authorityVerify service JWT signature, validity and exact lxm = com.atproto.space.notifyWrite. Require iss = repo; address aud = authority#atproto_space_host. The inspected reference also accepts the bare authority DID.
Authority to registered syncerIndependently verify service JWT from the authority; audience is the registered service identifier, including its fragment. A repo-issued JWT is not authority forwarding.
Listing readSpace credential with HTTP presentation signature, matching space, and bare authority read audience. Service JWT notification audiences are not credential read audiences.

Input requires space, repo, repoRev, and hash. Forwarded notifications additionally carry authority-assigned spaceRev and, except on the first update, prevSpaceRev. Ignore any sender-supplied sequencing claims when accepting a repo notification.

For the proposed Stratos adapter, check current active enrollment and boundary for every write admission, including retries. A retained writer row, a valid signature, or retained hosting is insufficient. Reject unsolicited writers without adding members, assigning boundaries, or overriding host discovery. Continue re-deriving boundaries from enrollment during foreign ingest.

Revision rules:

  • Reject a repository revision more than five minutes in the future.
  • Ignore repoRev <= accepted repoRev without changing its hash or allocating a new space revision.
  • For each accepted newer update, atomically allocate a globally increasing spaceRev within that space and record the previous global value as prevSpaceRev. “Global” means across all writers in one space, not across spaces.
  • Concurrent writers must not receive the same revision.
  • Membership removal racing with admission or durable projection needs a generation fence, not a cached preflight check alone.

The authority records a claim; it does not verify the full content or signature behind the reported hash on this hop. Syncers verify repository state at the actual host before durable promotion. A prevSpaceRev gap triggers listing catch-up from the last durable space checkpoint. Duplicate notifications are harmless; an older notification must not roll state backwards.

Delivery policy: proposal, not shipped Stratos behavior ​

Keep repo-host delivery separate from authority fanout. The reference repo host behaves like this:

AspectReference behavior
First sendImmediate
Retryable failuresCoalesced durably by (space, repo), keeping the newest repoRev and hash
Newer revisionsReset the backoff and the 24-hour window
WorkerA leased worker drains bounded batches; takeover can duplicate delivery
BackoffDoubles from one minute to one hour, with 50–100% jitter
Request timeoutTen seconds
ClearingSuccess or a permanent failure clears only retries no newer than the attempted revision
ExpiryRetries stop after 24 hours
Account stateRemoved accounts clear retries; deactivated or taken-down accounts are rescheduled in the window

The reference has an immediate-send-to-queue crash window: it does not establish a transactional outbox with the repo commit. Do not describe this as guaranteed delivery of every write. Authority-to-syncer fanout uses a background queue with reasonable effort, not that durable repo-host retry queue. Polling repairs notification loss.

For a future Stratos repo-host implementation, propose a transactional durable outbox, latest-state coalescing, bounded backoff, and compare-and-clear protection against old completions deleting newer work. Retry transient transport/status and local storage failures; stop and record permanent authorization/schema failures without retaining tokens or content. Define retry exhaustion, operator diagnostics, queue capacity, lease takeover, and re-admission after policy repair before shipping. No outbox or scheduler is added here.

Migration and recovery ​

Keep the custom snapshot and its DID cursor unchanged. A selected standard consumer starts a new namespace keyed by authority, full space URI, and protocol generation. Never reinterpret persisted member cursors as space revisions. First load current membership, then bootstrap standard writer state from no cursor, confirming each authorized repo at its host. Persist work idempotently and reconcile membership independently throughout catch-up.

Advance a future per-space checkpoint only after durable processing, or after durable scheduling with a separately proven recovery invariant. A crash before durable completion must replay the same page. Do not checkpoint merely upon HTTP receipt, upon notification receipt, or after enqueueing volatile work. An empty page preserves the last durable checkpoint. Plan 005's per-repo terminal-commit verification remains a separate condition; neither checkpoint substitutes for the other.

On protocol-generation reset, unavailable checkpoint history, authority reset, or incompatible custody representation, explicitly rebootstrap without purging authorized members from a delta. Membership withdrawal, space deletion, and explicit deletion requests use their own contracts and generation fences. A writer listing has no removal tombstone. Re-enrollment needs fresh authorization and must not resurrect completed deletion.

Bounded implementation follow-ups ​

Authority storage and standard handlers ​

Scope: writer-state Reader/Writer ports, SQLite/PostgreSQL adapters, atomic per-space sequencing, standard listing and dedicated notification authentication/admission. Keep custom membership unchanged. Dependencies: mixed-custody representation decision, source-pin reconciliation, admission/removal race design, migration and runtime space validation. Registration, fanout, and repo-host outbox require separately approved delivery slices; no role publication follows automatically.

Acceptance: real backend concurrency and restart tests; equal/older/future revision tests; correct prevSpaceRev across writers; current-enrollment denial; generation races; plain-string exclusive cursors; short-page continuation; exact auth errors; unchanged commit rev; mutation gates and reviewed October Spaces alpha PDS probes. Update public API documentation only when the handlers ship.

Optional syncer catch-up ​

Scope: a distinct writer-state client and durable per-space checkpoint, not changes that reinterpret the membership reconciler. Dependencies: authority contract above, durable processing/recovery design, explicit product selection of catch-up. Polling-only operation remains valid. An inbound notification server is a separate optional feature.

Acceptance: repeated writers, coalesced updates, gaps, duplicate/late notifications, short pages, empty pages, crash-before/after-durable boundaries, restart, page budgets, rebootstrap, removal during staging, and Plan 005 terminal verification. Prove no omission revokes membership and no received metadata alone promotes records.

Probe boundary and unresolved contracts ​

Synthetic reference-model tests cover pagination, repeated writers, admission, ordering, gaps, retries, and crash boundaries. They do not implement or certify a real authority. The writer-sync-contract sandbox suite uses the real October Spaces alpha PDS: real account/service authentication, a disposable upstream simplespace authority, writer notifications, listing, and repository commits. It also requires Stratos's standard routes to remain unsupported. The upstream fixture is not Stratos standard-authority support and does not add production simplespace callers.

Runtime acceptance requires the mandatory baseline plus this named suite on the exact independently reviewed candidate. Source inspection and mocked unit tests cannot satisfy that gate. This bounded batch does not provide a runtime receipt.

Still unresolved: standard representation of mixed custody; concrete schema/migration and authority reset generation; transactional admission/removal fencing; production outbox capacity and exhaustion policy; registration expiry/endpoint changes; and whether optional syncer catch-up is selected. These do not reopen retained hosting or authorize new proof mechanisms.

Source reference ​

  • Reference implementation: 5b95b2f2723a2882824fbb0b819fd6aad884ef20, lexicons/com/atproto/space/{listRepos,notifyWrite,defs}.json, packages/pds/src/api/com/atproto/space/{listRepos,notifyWrite,util,registerNotify,unregisterNotify}.ts, and packages/pds/src/space-notifications.ts.
  • Sandbox October Spaces alpha PDS: 79d6307e19908f3af406838ea0e5fae42847f182. The inspected listing/notification lexicons, handlers, utility, commit definitions, and retry implementation match the reference pin byte-for-byte. The sandbox runner records immutable image identity separately.
  • Proposal: 0c9c2e88ba385809fc9ecba92f362389d9338e16, 0016-permissioned-data/README.md, Sync section. Its prose still uses rev and “since”; the final lexicons define the wire names above.
  • Historical D01: fdb11e26aa8401d81f14cbfd4e07e708b8e5c1be. It is not an ancestor of this design's baseline; no matching PR was returned during reconciliation. Its older rev listing, DPoP examples, and notification audience are not the October contract. No unmerged production work is imported.