Skip to content

docs(data-modeling): state the autonumber contract — unique and monotonic, not gapless - #8525

Merged
qq9340100 merged 1 commit into
mainfrom
claude/issue-8479-autonumber-contract-docs
Aug 13, 2026
Merged

docs(data-modeling): state the autonumber contract — unique and monotonic, not gapless#8525
qq9340100 merged 1 commit into
mainfrom
claude/issue-8479-autonumber-contract-docs

Conversation

@qq9340100

Copy link
Copy Markdown
Collaborator

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/main in 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).
  • autonumber appears 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 (### autonumber in the Field Type Gallery — the page schema-design.mdx itself 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 throwing beforeInsert all 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 Field section gets a one-line pointer to the full contract. This page carries a complete worked account_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.mdx were 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 → green
  • pnpm check:quick-reference-counts → green
  • pnpm check:role-word → green
  • pnpm check:nul-bytes → green
  • pnpm check:doc-anchors → green (sanity-checked the new field-types#autonumber cross-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 touch packages/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

…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
@qq9340100 qq9340100 added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Aug 13, 2026 — with Claude
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Aug 13, 2026 5:21pm

Request Review

@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation labels Aug 13, 2026
@qq9340100
qq9340100 marked this pull request as ready for review August 13, 2026 17:57
@qq9340100
qq9340100 added this pull request to the merge queue Aug 13, 2026
Merged via the queue into main with commit 222a87e Aug 13, 2026
25 checks passed
@qq9340100
qq9340100 deleted the claude/issue-8479-autonumber-contract-docs branch August 13, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants