Repository navigation
docs(data-modeling): the unique default cell states the type-conditional default - #15505
Conversation
…ional default (#14940) `FieldSchema` has materialised `unique` type-conditionally since #13894 landed (PR #14904): an omitted `unique` resolves to `'organization'` on an `autonumber` field and to `false` on every other type; an explicit `unique: false` is the opt-out. The Universal Field Properties table on `field-types.mdx` still stated one flat `false`, so an author reading the table got a wrong answer for one field type. Re-measured on current `main` through the built `@objectstack/spec` before writing the cell: autonumber (unique omitted) -> ok=true unique="organization" autonumber (unique: false explicit) -> ok=true unique=false text (unique omitted) -> ok=true unique=false number (unique omitted) -> ok=true unique=false The `autonumber` callout at `:485` / `:493` is deliberately UNCHANGED: its "guarantees a unique, ever-increasing business identifier" is true against the post-#13894 schema, and the wording of the new cell is kept consistent with it and with the `unique` doc block in `FieldSchema`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
|
ACCEPT — PM seat Reviewed against the three-dot diff Generated by Claude Code |
Fixes #14940
What changed
One cell, one line: the
uniquerow of the Universal Field Properties table incontent/docs/data-modeling/field-types.mdxnow states the type-conditional default theschema has applied since #13894 landed (PR #14904, merged 2026-09-03).
`false`becomes`false` (`'organization'` on `autonumber`)— the sameone-token-plus-qualifier voice as the neighbouring default cells.
uniquedoc block inFieldSchemaand the
autonumbercallout on the same page: "Omitted ⇒false, except on anautonumberfield, where omitted ⇒
'organization'— an auto-number is a business identifier, so theplatform makes it unique per organization by default; write
unique: falseexplicitly to opt out."git diff --statfor this PR:content/docs/data-modeling/field-types.mdx | 2 +-— 1 insertion, 1 deletion.The
autonumbercallout at:485/:493is deliberately UNCHANGEDThe card's opening paragraphs were written against the pre-#13894 tree and are inverted by the
triage (14940#issuecomment-5542748654). The callout's sentence — "an autonumber guarantees a
unique, ever-increasing business identifier" — is true against the schema as it stands today,
because an omitted
uniqueon anautonumberfield now materialises as'organization'. Editingor weakening it would delete a true sentence. The only thing the card's own branching left to do is
the table cell, and that is all this PR touches.
Re-measured on current main before writing the cell
The card's probe (
FieldSchema.safeParseon a field that omitsunique) was re-run againstorigin/mainat4f85e4d11, through a freshly built@objectstack/spec(
packages/spec/dist/data/index.mjs,pnpm --filter @objectstack/spec build, exit 0). The cell'swhole content is what this answers:
The card's own reading (
autonumber (unique omitted) -> ok=true unique=false, taken at450e73b4)is superseded, as the triage said it would be. The materialising line is
packages/spec/src/data/field.zod.ts:2115—patch.unique = field.type === 'autonumber' ? 'organization' : false;— pinned by
packages/spec/src/data/field-autonumber-default-unique.test.ts.Verification
Gate family derived from the change set rather than hand-listed:
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, exit code 0,which printed:
All 37 derived commands were run after the final commit, on
b822fdbf0(
git rev-parse --short HEAD), each exit code captured by redirect before any pipe(
cmd > log 2>&1; EXIT=$?). 37 of 37 exit 0. Verdict lines the gates printed themselves:pnpm -s check:pm-dispatch-gatesis not in the derived family for this change set and wastherefore not run.
Three gates first answered NOT MEASURED rather than green — recorded as such, then remeasured:
check:doc-formula-expressionsandcheck:doc-security-postureexited 3(
PREREQUISITE NOT MET—@objectstack/formula/@objectstack/lintnot built) andcheck:skill-examplesexited 1 on its own prerequisite refusal(
packages/client-react/dist holds no .d.ts declarations). Afterpnpm exec turbo run build --filter=@objectstack/formula --filter=@objectstack/lint --filter=@objectstack/client-react(34 tasks successful, exit 0) all three exit 0. Both builds ran through the shared verify lock
(
scripts/pm/os-verify-lock.sh,VERDICT command-exit 0).One further gate,
pnpm check:docs-audit-scope, reds on a box where a previous gate in this samerun left
packages/spec/.examples-build-src/behind — a known, already-filed local run-orderinteraction (#15457), unrelated to this diff and reproduced on a clean checkout of
4f85e4d11with zero edits, where the same self-test passes. Run on a tree without those gitignored
byproducts it exits 0, as quoted above.
Changeset
None, and this PR takes
skip-changeset: it publishes nothing from any released package — thediff is a single line of
content/docs/**, consumed only by the private docs app.Scope
The scope fence inherited from #14901 is kept: this is the
uniquedefault cell only, not a sweepof the Universal Field Properties table. The generated reference page
content/docs/references/data/field.mdxcarries the AUTO-GENERATED banner and was nothand-edited; its
uniquerow was checked and already carries the post-#13894 wording, so there isno generator staleness to report.
🤖 Generated with Claude Code
https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
Generated by Claude Code