docs(error-catalog): INVALID_FORMAT names what really checks a value (field type or a format rule) - #19878
Merged
objectstack-fleet[bot] merged 2 commits intoSep 24, 2026
Conversation
…s format The INVALID_FORMAT entry told authors to fix the failure by matching "the field's `format` constraint", but the write-time record validator never reads a field-level `format` key: its email / url / phone shape checks key on the field `type`, and a `format` validation rule (a different key) answers field-level `invalid_format`. No route emits the top-level INVALID_FORMAT at all, so the entry now says so and points at VALIDATION_FAILED + fields[].code, the same shape the INVALID_REFERENCE entry already uses. The VALIDATION_ERROR example's email entry now carries `invalid_email`, the code the Zod issue mapper actually produces for an email-format miss. Claude-Session: https://claude.ai/code/session_01VDtqoecgES7ScQYGbFVDRv Co-authored-by: Claude <noreply@anthropic.com>
Outside `autonumber` the key is a display hint and on `autonumber` it is the record-number pattern, so 'a display hint the server never checks' was only right for most types; what holds for every type is that no write-time check reads it. Claude-Session: https://claude.ai/code/session_01VDtqoecgES7ScQYGbFVDRv Co-authored-by: Claude <noreply@anthropic.com>
This was referenced Sep 23, 2026
Contributor
Author
Contract reviewServed-tier: ① Derived judgmentsAll measured on
② Semver levelNone (docs-only). One file under ③ Boundary flags
Implemented-by: VERDICT: PASS Landing still needs, separately from this verdict: every in-progress check green on this head, and the maintainer's Generated by Claude Code |
objectstack-fleet
Bot
deleted the
claude/issue-19848-error-catalog-invalid-format
branch
September 24, 2026 15:56
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 #19848
Clause-②: no
What changed
content/docs/api/error-catalog.mdxonly.INVALID_FORMATentry. Its Fix line told authors to match "the field'sformatconstraint". No write-time check reads a field-levelformatkey, so following that advice changes nothing. The entry now says what actually decides:INVALID_FORMATtoday. The entry now says so and tells clients to branch onVALIDATION_FAILED+fields[].code. That is the same shape the page'sINVALID_REFERENCEentry already uses.type. The built-in email / url / phone checks key ontypeand answerinvalid_email/invalid_url/invalid_phone. Date and time parse failures answerinvalid_date/invalid_time.formatvalidation rule (a different key: itsregexor its namedformatemail|url|phone|json) answers field-levelinvalid_format. The link goes to/docs/data-modeling/validation#format-validation, the anchor PR docs(data-modeling): stop crediting fieldformatwith validation #19847 uses.invalid_formatis also emitted for a missed declaredpatternoutside record metadata: a settings value, or a request body a route parses with Zod.typeor theformatvalidation rule as the things to change, and says a field-levelformatkey runs no write-time check on any field type.VALIDATION_ERRORJSON example showed an email miss as"code": "invalid_format". The Zod mapper answersinvalid_emailfor that miss. See the Acceptance notes.The wording follows PR #19847 (still open at the time of writing; this PR depends on none of its files) and the spec's
formatdescribe: "keyed ontype", "a field-levelformatkey is not read", "aformatvalidation rule".Evidence (all at base
2bbb4623)format:def.format0 hits, same-file controldef.type7packages/objectql/src/validation/record-validator.tstype, emitinvalid_email/invalid_url/invalid_phonerecord-validator.ts:746-754invalid_date/invalid_timerecord-validator.ts:839,:858formatvalidation rule (regex or named format) emits field-levelinvalid_formatpackages/objectql/src/validation/rule-validator.ts:2776-2790(check),:2822(formatViolation)patternmiss emits field-levelinvalid_formatpackages/services/service-settings/src/settings-service.ts:2042invalid_email, url toinvalid_url, other format/regex toinvalid_formatpackages/spec/src/api/zod-issues-to-fields.ts:82-85INVALID_FORMAThas no producer:git grep INVALID_FORMAToutside tests anddisthits only the enum memberpackages/spec/src/api/errors.zod.ts:57, the ADR note and the unpinned baselinescripts/error-status-unpinned-baseline.json:15("documented with an HTTP status that NO producer ... declares"); ADR-0114 line 37 records the six field-shaped top-level members as a known wartpackages/spec/src/data/field.zod.ts:1090-1094(theformatdescribe: "the write-time record validator's built-in email, url and phone checks key ontype, never on this key")Verification (final head
40758ef8)node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commandsderived 41 commands. I ran all 41 on40758ef8: 41 exited 0.--ranprinted41 derived famil(ies) accounted for — 41 run, 0 NOT-MEASURED (a DERIVED zero — all 41 recorded an exit code and none of them is 3).d56a2a7f), four gates exited 3 (PREREQUISITE NOT MET):check:doc-formula-expressions,check:doc-security-posture,check:skill-examplesandcheck:docs-transcript-drift. The lint, formula and client packages had not been built yet. After those builds all four re-ran with exit 0.pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/api/error-catalog-docs.test.ts(the test that reads this page against the wire face):Test Files 1 passed (1) · Tests 5 passed (5)on40758ef8.dispatch-gateslists outside its derived total, and the path-scheduledBuild Docs/Test Corejobs.Changeset
Docs-only.
content/docs/**is not in any package'sfiles[], so this PR publishes nothing and falls underskip-changeset. Per the dispatch, this seat writes no labels.Acceptance notes
Bounded in-place fix (the
VALIDATION_ERRORexampleinvalid_format→invalid_email). All four exemption conditions hold:formatwhere the real check keys on the email type);zod-issues-to-fields.ts:83);It lies outside the claim's declared "(the
INVALID_FORMATentry)" sub-surface. The claim's file surface needs this entry added.content/docs/ui/forms.mdx:229(400 VALIDATION_FAILED· "object schema validators fail (required,format,length, …)"): read, not edited. It lists kinds of constraint in theWhencolumn and gives no fix, so it does not tell anyone to edit a fieldformatkey. It does not carry the same false meaning. Not listed as a defect.Sibling entries on the same page (a finding, not fixed here):
VALUE_TOO_LONGandVALUE_TOO_SHORTalso have no producer (git grepoutside tests/dist: 0 hits each; control'VALIDATION_FAILED': 70). Both appear inscripts/error-status-unpinned-baseline.json. The page still documents them as live causes. The record validator answers field-levelmax_length/min_lengthunderVALIDATION_FAILEDinstead. This is reported to the seat for filing and is out of scope for this card.Generated by Claude Code