Store collections name project schemas; defaults and readOnlyProperties on the collection (#908) - #924
Merged
Conversation
…nd readOnlyProperties on the collection (#908) A collection's `schema` may name a project named schema (top-level `schemas:`), so one schema is a collection's record shape, a route's request body and an MCP tool's arguments, refusing the same input at the same pointer. A named schema must satisfy the flat-record restrictions or activation refuses it, naming the collection, the schema and the pointer. Breaking: a record schema (inline or named) is value shape only. `default` and `readOnly` on a property are refused; the collection carries them as `defaults: {prop: value}` and `readOnlyProperties: [prop]`, one model for both forms. StoreRecords adds `defaults` and `readOnlyProperties`. Core: ExtensionDescribeRequest carries the project's named schemas, and an extension OpenAPI contribution may `$ref` a named schema or one of its root properties; core writes the component once, as for a route body. The store's description references the named component instead of copying it. Migrates the store example, recipe, proofs, bench, tests and docs; re-measures the core and store package budgets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jimhoyd
enabled auto-merge (squash)
September 29, 2026 15:14
…dget Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 29, 2026
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.
Fixes #908. One named schema can now be the record shape of a store collection, the body of an HTTP route and the input of an MCP tool.
Design
schemais either inline or the name of a top-levelschemas:entry. A named schema must pass the same flat-record checks as an inline one, or activation refuses it with a pointed message. An unknown name and a bundled file with$defseach get their own message.defaults: {prop: value}on the collection, and read-only markers toreadOnlyProperties: [prop]. (readOnly: truealready means GET/HEAD only on a collection.)defaultorreadOnlyon a property is refused, and the message names the collection key to use.ExtensionDescribeRequestcarriesschemas.$refa named schema or one of its root properties, and core writes that component once.Store<X>Createis a$refto it, so POST, a route body and an MCP tool share one type.Evidence (macOS, Node 26), rebased on main after #920 and #922
packages/store/test/named-schema.test.ts:Ticketschema is shared by a collection, a POST route and an MCP tool. For 5 invalid inputs, the store's 422 issues deep-equal the route's at the same pointer, and the MCP error matches.Ticketonce and the document is valid.npm run verifypasses: core 1219, store 144, proof 12, proof:authjs 13, ecosystem 12.npm run test:packagepasses.Limits
🤖 Generated with Claude Code