Repository navigation
feat: store and API checks for typed fields (RFC-0041 step 2) - #95
Merged
Merged
Conversation
…ep 2) - Site writes run the definition checks and caps. Removing a key or a select option that entries still use is refused (field_change_needs_operation), checked before the write and guarded on the site CAS. - Entry writes check changed values, refuse unknown keys once a collection has definitions, refuse non-localized values on translations, check requiredToPublish on review and publish, cap fields at 256 KB, and check image and rich-text asset references in the same site, recorded in asset_refs so a used asset is not deleted. - Search indexes searchable text and rich-text fields; rows of sites without them are byte-identical. - API: new codes with details.issues (422/400/409), README. Shared suites on sqlite, D1 and Durable Object SQLite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
This was referenced Oct 23, 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.
Step 2 of RFC-0041's rollout (ADR-0043), built on #94.
Site writes (
updateSite,createSite,PUT /collections/:key)checkFieldDefinitionsand the caps run only whencollectionschanged.field_change_needs_operation(409), naming the operation to use. A count query runs before the write, and the same condition guards the site CAS (rule 4).Entry writes (
EntryEngine.write)field_not_localizedon translations.requiredToPublishon review and publish writes, likerequired_term.fieldschanges, in every collection (§2 states it unconditionally).asset_refsin the same batch, so a used asset cannot be deleted.Search:
searchabletext and rich-text values join the entry's search text, and a translation falls back to the original's. Rows without searchable fields are byte-identical.API: new codes with
details.issues([{path, code, message}]), documented in the README:invalid_fields,unknown_field,field_not_localized,required_field,too_many_fields;field_key_*,field_option_duplicateandfield_boundscodes;field_change_needs_operationandtoo_large.Tests
EADDRNOTAVAIL(socket exhaustion); the same happens on clean main.Follow-ups
Changeset: minor (
core-ts,api).🤖 Generated with Claude Code