docs(data-modeling): state the autonumber contract — unique and monotonic, not gapless - #8525
Merged
Merged
Conversation
…onic, not gapless The autonumber contract ruled on #8283 (Option 1: unique + monotonic per scope, NOT gapless) existed only in the SQL driver's TSDoc, which no app author or AI writing an ObjectStack app ever reads. Adds the contract as the authoritative statement in the Field Type Gallery's `autonumber` entry (field-types.mdx), with a pointer from schema-design.mdx's worked `autonumber` example — the page most likely to be copied straight into a business-identifier field (invoice/account numbers) without a detour through the reference page. Fixes #8479 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jqe56GnYFddggeAyfkZFVz
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
qq9340100
marked this pull request as ready for review
August 13, 2026 17:57
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 #8479
What
The autonumber contract ruled on #8283 (Option 1, maintainer ruling 2026-08-13: unique and monotonic per scope, NOT gapless — any rejected write may consume the number it reserved) landed as a driver TSDoc in PR #8488, but that half is claimed there and out of scope here. This card puts the same contract where an app author (human or AI) actually reads it:
content/docs/data-modeling/**.Premise re-verified on
origin/mainin this worktree before editing:grep -rniE 'gapless|monotonic' content/docs/data-modeling/*.mdx→ zero on-topic hits (two unrelated "gap" matches about aggregation capability gaps).autonumberappears in 6 files:field-types.mdx,fields.mdx,field-type-decision-tree.mdx,schema-design.mdx,indexing.mdx,validation-rules.mdx— the ruled contract was genuinely absent from all of them.Placement
One authoritative statement, one pointer — not all six pages, for the reason #8405/#8386/#8285 already established (a contract repeated N times is N things to keep in sync):
field-types.mdx(### autonumberin the Field Type Gallery — the pageschema-design.mdxitself calls "the complete per-type reference") gets the full contract as a<Callout type="warn">: unique + monotonic per scope, not gapless, names the cause (a unique violation on another field, a failed validation rule, a throwingbeforeInsertall still consume the reserved number), and states the finance-facing corollary explicitly — an autonumber is not a legally gapless document number.schema-design.mdx's### AutoNumber Fieldsection gets a one-line pointer to the full contract. This page carries a complete workedaccount_number: Field.autonumber(...)example that a reader could copy straight into a business-identifier field without ever visiting the reference page — exactly the mis-promise path the ruling is trying to close — so it gets a reachable summary + link rather than silence.fields.mdx,field-type-decision-tree.mdx,indexing.mdx,validation-rules.mdxwere left untouched: each is a compact reference table/decision aid with no worked example a reader would act on directly, so a pointer there would be sync-debt without a matching reachability risk.Testing
All from a fresh worktree, dependencies built first (
pnpm --filter '@objectstack/lint^...' build):pnpm --filter @objectstack/lint run check:doc-formula-expressions→ green (24 self-test cases + corpus scan clean)pnpm check:docs-audit-scope→ greenpnpm check:quick-reference-counts→ greenpnpm check:role-word→ greenpnpm check:nul-bytes→ greenpnpm check:doc-anchors→ green (sanity-checked the newfield-types#autonumbercross-reference link resolves)node scripts/pm/dispatch-gates.mjs content/docs/data-modeling/field-types.mdx content/docs/data-modeling/schema-design.mdx→ surfaces exactly the four named families above, no additional family implicated by this diff.Scope
Docs-only,
content/docs/data-modeling/**only (declared file surface honored, no breach). Does not touchpackages/drivers/driver-sql/src/sql-driver.ts(#8283's drivers half, different lane, already merged in #8488).Generated by Claude Code
Generated by Claude Code