PDS: validate published permissioned-space record schemas - #5434
Open
slanos wants to merge 1 commit into
Open
Conversation
Co-authored-by: comail-agents[bot] <comail-agents[bot]@users.noreply.github.com> Co-authored-by: OpenAI GPT-5.6 Sol <noreply@openai.com>
slanos
marked this pull request as ready for review
August 21, 2026 22:02
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.
What & why
Closes #5433.
Permissioned spaces can declare third-party collections, but strict record writes currently fail against the PDS static schema table even when the collection owner has published a proof-verifiable Lexicon. This adds a generic published-record resolver to the three space write routes while preserving generated schemas as the static-first path.
For an unknown collection, dynamic resolution runs only when
validate: true. It uses a separate DNS-authorityLexResolver(not the OAuth test-authority override), the existing safe-fetch/proof-verification path, andLexiconSchemaBuilder. It requires an exact record#main, validates the record key and body, and returns only sanitized failures.Resolution work is bounded by TTL/size-limited positive and negative caches, per-NSID singleflight, 32 active root builds, 32 unique documents, 128 reference lookups, four concurrent document fetches, and a ten-second aggregate build deadline. Batch actions are authorized before any resolution.
putRecordfully prepares outside the actor transaction, rechecks existence transactionally, and reauthorizes if a create/update race changes the required action.The integration fixture publishes a real third-party record Lexicon, then exercises create, put-create, put-update, and applyWrites through the real PLC/DID/repo-proof resolver path. Failure tests cover invalid records, missing/non-record schemas, cache bounds, fanout/concurrency/deadline bounds, resolver sanitization, unauthorized prefetch, and put race reauthorization.
Verification
pnpm verify— passes repository-wide style, lint, and import checks.packages/dev-env: pnpm build— passes.packages/pds: pnpm build— passes.packages/pds: pnpm test— 53/53 suites, 587 passed, 1 skipped, 1 todo, 31 snapshots.pnpm build --forcereaches an existing TypeScript failure in untouchedpackages/common/tests/car.test.tsbecause Jest globals (describe,it,expect) are absent from that test project. This branch changes nopackages/commonor root/common tsconfig files; the PDS/dev-env build and PDS test typecheck are green.Checklist
pnpm build --force && pnpm verifypasses —verifypasses; the root build has the unrelated baseline failure documented above.