Uh oh!
There was an error while loading. Please reload this page.
docs(spec): FieldSchema pins the ruled multi-value empty representation ([] + required means non-empty) (#9447) - #9493
Conversation
…on (#9447) An emptied multi-value lookup reads back as [], never null — binding for every writer (cascade repair, form clears, API writes) — and required on a multi-value lookup means non-empty array (maintainer ruling 2026-08-18, recorded on #9447). Doc blocks on FieldSchema.required and FieldSchema.multiple; content/docs/references regenerated via gen:docs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fs18A2DdXLVN2h8PaaFBcP
📓 Docs Drift CheckThis PR changes 1 package(s): 10 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not seeCoarse fallback — 113 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop):
|
Uh oh!
There was an error while loading. Please reload this page.
Fixes#9447
The ruling (2026-08-18, recorded on #9447, binding)
Maintainer batch acceptance, verbatim: 「同意」. As recorded on the issue:
This PR lands exactly that text surface: the two ruled sentences into
FieldSchema's doc blocks inpackages/spec/src/data/field.zod.ts, on the two keys a reader consults (required,multiple), each citing the ruling per the file's convention (#9447, maintainer ruling 2026-08-18). The engine consumption (member removal incascadeDeleteRelations, reverting the interimrestrictescalation) belongs to #9438's PR and is deliberately untouched here.Before / after
packages/spec/src/data/field.zod.ts—required(before: line 757; after: lines 756-765):Before:
After:
packages/spec/src/data/field.zod.ts—multiple(before: line 775; after: lines 783-793):Before:
After:
content/docs/references/data/field.mdxregenerated from the doc blocks viagen:docs(the only artifactcheck:generatedproved stale; regenerated with--fix, narrow by design).Measured current behavior — divergence found and filed as #9476
Per the dispatch's measurement clause, I checked what validation ACTUALLY does with
[]on arequired+multiple: truelookup before writing the doc. Runtime probe (temp vitest file againstvalidateRecord, deleted after the run, never committed), atmain=ad217b192:{ members: [] }on{ type: 'lookup', reference: 'sys_user', multiple: true, required: true }— passes (no throw){ members: [] }— passes (no throw)members: nullrejected on insert (required) and update (required_cleared)Read sites:
packages/objectql/src/validation/record-validator.ts:171-173(isMissingcovers onlyundefined/null/blank string — never[]), consumed at:477(insert) and:1011(update non-regression). No existing pinned test asserts the opposite semantics (the required suite covers text/autonumber/null/blank-string only), so this is an enforcement gap versus the ruled contract, not a ruling-vs-pin conflict. The ruled doc sentence lands regardless (it is the contract); the divergence is on record as #9476 (unassigned, measured, with read sites) — the enforcement half is not addressed here and #9476 remains open.Verification — all from head
e48b04963pnpm --filter @objectstack/spec buildthenpnpm --filter @objectstack/spec check:generated— all 13 generated artifacts up to date (re-run at head after the final commit)pnpm --filter @objectstack/spec test— 409 files, 10915 passedpnpm --filter @objectstack/spec typecheck— exit 0check:nul-bytes): all PASS ate48b04963—check:changeset-gate-self-tests,check:cross-package-test-inputs(both spellings),check:doc-formula-expressions,check:docs-audit-scope,check:docs-redirects,check:empty-state,check:liveness,check:merge-driver,check:objectui-changeset,check:quick-reference-counts,check:role-word,check:spec-parsed-alias,check:strictness-ledger,check:type-source-resolution,check:variant-docs,check-adr-0087-registration,check-changeset-no-major,check-dev-prereqs(after fullpnpm build; its first run red was fresh-worktree build state, 52 packages withoutdist, not the diff),check-empty-changeset,check-affected-docs,check:nul-bytes.changeset/nine-camels-behave.md—@objectstack/specpatchGenerated-artifacts coupling: wave-8 siblings #9463 / #9406 / #9345 — the PM serializes landings; a later lander runs
scripts/pm/os-regen-merge.sh.Generated by Claude Code