feat(pds): align lexicon validation with reference PDS#160
Merged
Conversation
Honor the `validate` flag, return `validationStatus`, validate rkeys against schema `keySchema`, reject legacy blob refs, and broaden the bundled schema set. Move authoritative rkey allocation into the DO with a collision-retry loop so worker-isolate clockid collisions can't surface as 500s. Translate client-supplied rkey collisions to 409 and intra-batch duplicates to 400.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
atproto-pds | 790b1db | May 06 2026, 09:11 AM |
commit: |
Now that the validator enforces the schema's keySchema (e.g. tidString for app.bsky.feed.post), uniqueRkey() must return a valid TID.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings cirrus's lexicon validation to parity with the reference PDS (
bluesky-social/atproto), and closes a few correctness gaps along the way.validateflag (truerequires a known schema,falseskips schema validation,undefinedvalidates known schemas optimistically).validationStatus(\"valid\" | \"unknown\") oncreateRecord/putRecord/ per-write inapplyWrites.\$typewithcollection(fills in if missing, rejects mismatches).keySchema(e.g.app.bsky.feed.postrequires a TID,app.bsky.actor.profilerequiresself); enforces genericisRecordKeyshape unconditionally.{cid, mimeType}blob refs.com.atproto.lexicon.schema,app.bsky.actor.status,app.bsky.notification.declaration,chat.bsky.actor.declaration.applyWrites#update/#delete, non-booleanvalidateflag, non-stringrkey(incl.null), empty-string rkey.Test plan
pnpm -F @getcirrus/pds test:unit— 273 tests passpnpm -F @getcirrus/pds test:cli— 84 tests passpnpm -F @getcirrus/pds build— cleanpnpm test:e2e(not run in CI)