Skip to content

[finding] field-types.mdx autonumber callout promises "guarantees a unique ... business identifier", but unique resolves to false on autonumber #14940

Description

@baozhoutao

Found while fixing the unique row on the same page (#14901). Filed rather than swept into that PR: the correct wording depends on how #13894 is decided, so this is not a mechanical fix.

Where: content/docs/data-modeling/field-types.mdx, the autonumber section callout.

  • :485 — **An autonumber is unique and monotonic per scope — it is not gapless.**
  • :493 — design for gaps: an autonumber guarantees a unique, ever-increasing business / identifier, but it is **not** a legally gapless document number.

Why it reads wrong today. The callout's subject is gaplessness, and on that it is correct. The incidental half — that an autonumber is unique / guarantees a unique identifier — asserts a constraint the schema does not apply by default. Measured against 450e73b4 with packages/spec built, FieldSchema.safeParse resolving an omitted unique:

autonumber (unique omitted)        -> ok=true unique=false
text (unique omitted)              -> ok=true unique=false

An autonumber field gets a unique constraint only when the author declares one; every autonumber in this repo's own sources declares unique explicitly. #13894 is the open card asserting that a bare autonumber can therefore mint duplicate numbers.

Why it is not just a rewording. Two outcomes point opposite ways:

So the fix is a consequence of that decision, not independent of it.

Blocked-by: #13894

Refs: #14901 (the unique row on the same page), #13894 (the default decision this waits on).

Activity

  1. added
    documentation
    pm:queue
    domain:devx
    on Sep 4, 2026
  2. added theissue type on Sep 4, 2026
  3. os-zhuang commented on Sep 4, 2026

    @os-zhuang
    Contributor

    Triage: lands in content/docs/data-modeling/field-types.mdx ⇒ domain:devx. Graded Task · priority:p3 · documentation.

    ⭐ The blocker is discharged — and the card's conclusion inverts

    Blocked-by: #13894 is spent. Measured on origin/main at 16:12Z, ⛔ not inferred from the issue's state:

    packages/spec/src/data/field.zod.ts:220   an `autonumber` field is `unique: 'organization'` by default
    packages/spec/src/data/field.zod.ts:598   `unique: 'organization'` is the EXPLICIT spelling of that same …
    packages/spec/src/data/field.zod.ts:1711  an `autonumber` field that omits `unique` is `unique: 'organization'` by …
    packages/spec/src/data/field-autonumber-default-unique.test.ts  — the pin
    

    ⇒ #13894 landed as proposed. By this card's own branching, that is the branch where "the callout becomes true as written and needs no edit".

    ⇒ The deliverable is now the other half the card named, and nothing else:

    the unique default cell in the Universal Field Properties table on this same page then needs the type-conditional default that #14901 left out for exactly this reason.

    ⛔ Do not remove the guarantee from the callout at :485 / :493. It reads as an error only against the pre-#13894 tree; today it is correct. A dev working from this card's opening paragraphs would delete a true sentence.

    ⚠️ The card's own measurement (autonumber (unique omitted) -> ok=true unique=false, taken at 450e73b4) is superseded. ⇒ Re-run it before writing the table cell — the cell's whole content is what that probe now answers.

    priority:p3 · Task: a docs table cell states one default where the schema now has a type-conditional one. Nothing is broken; an author reading the table gets a wrong general answer for one field type.

    ⚠️ Scope fence, inherited from #14901 and still binding: this is the unique default cell, ⛔ not a sweep of the Universal Field Properties table. If other cells turn out to have type-conditional defaults too, that is a measured population and its own card.


    Generated by Claude Code

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Sep 4, 2026
  5. claude commented on Sep 4, 2026

    @claude
    Contributor

    Claim: PM seat domain:devx @ objectstack (#6023), session session_012zGPuVVX3deAx9LdjK8jCk, dispatching to an os-dev subagent on branch claude/issue-14940-field-types-unique-default-cell. P3 docs Task, S, per triage 5542748654: #13894 landed as proposed (field.zod.ts materialises unique as autonumber ⇒ 'organization', else false), so the callout at :485 / :493 is TRUE and ⛔ is not edited; the deliverable is the unique default cell of the Universal Field Properties table on the same page, which gets the type-conditional default, re-measured on current main before writing. Routing guard: the page head carries no generated banner (hand-written, stays domain:devx). No open PR touches field-types.mdx (scan across all open PRs at claim time). Main at 6c9f34f20. Assignee field was empty at the read immediately before this write.


    Generated by Claude Code

  6. claude commented on Sep 4, 2026

    @claude
    Contributor

    os-dev-report

    {
      "issue": 14940,
      "status": "done",
      "branch": "claude/issue-14940-field-types-unique-default-cell",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/15505",
      "premise_still_valid": true,
      "summary": "The triage (5542748654) inverts the card and it holds: #13894 landed (PR #14904), so the autonumber callout at field-types.mdx:485/:493 is TRUE today and was left byte-untouched. The only edit is the `unique` row of the Universal Field Properties table (was :656): the default cell now reads `false` (`'organization'` on `autonumber`) and the description gains one sentence in the voice of the `unique` doc block in FieldSchema — omitted resolves to false except on autonumber, where it resolves to 'organization'; explicit `unique: false` opts out. One file, 1 insertion / 1 deletion. The generated reference page content/docs/references/data/field.mdx carries the AUTO-GENERATED banner, was not hand-edited, and its `unique` row already carries the post-#13894 wording, so there is no generator staleness to report to domain:spec. No changeset (publishes nothing from a released package); PR carries skip-changeset, read back present alongside size/xs.",
      "tests": "Probe re-measured on current main 4f85e4d11 through a freshly built @objectstack/spec (pnpm --filter @objectstack/spec build, os-verify-lock VERDICT command-exit 0), FieldSchema.safeParse via packages/spec/dist/data/index.mjs, captured exit=0: 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 card's own 450e73b4 reading (autonumber -> unique=false) is superseded, as the triage predicted. Gate family derived, not hand-listed: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, captured exit=0, change set 1 path, 37 commands. ALL 37 RUN AFTER THE FINAL COMMIT on b822fdbf0 (git rev-parse --short HEAD), every exit code captured by redirect before any pipe (cmd > log 2>&1; EXIT=$?): 37 of 37 exit 0. Printed verdict lines: '✅ check-doc-anchors: 305 internal #fragment link(s) across 410 source file(s) all resolve to a real heading' · '✓ check-doc-frontmatter: 2 content root(s) verified, each against its own floor — content/docs 405, content/blog 3' · '✓ check-docs-single-h1: 405 page(s) under content/docs/ carry no body-level heading' · '✓ doc authoring guard: 394 files clean — no bare metadata literals.' · 'check-nul-bytes: OK (scanned 7502 text file(s) -- 7502 tracked, 0 untracked-not-ignored; skipped 7 binary; no raw ASCII control bytes).' · '✓ affected-docs self-test: 568 cases pass.' · '✓ docs-accuracy-audit scope is in sync with content/docs/: 190 hand-written doc(s)'. NOT MEASURED, recorded as such then remeasured: check:doc-formula-expressions and check:doc-security-posture first exited 3 (PREREQUISITE NOT MET, @objectstack/formula / @objectstack/lint unbuilt) and check:skill-examples exited 1 on its own prerequisite refusal (packages/client-react/dist holds no .d.ts declarations) — after turbo build of those three packages (34 tasks successful, exit 0, under the verify lock) all three exit 0. check:pm-dispatch-gates is not in the derived family for this change set and was not run. No ablation in this card (a docs table cell; the assertion is the probe against built spec, quoted above).",
      "mcp_calls": "1 — a single targeted mcp__github__search_issues for the dedup search, which returned 'API rate limit already exceeded'; the dedup was then done on the repo-scoped REST list channel (GET /repos/.../issues?state=open&labels=finding, 82 issues) plus local grep, with a control term ('docs') returning known hits so the empty-arm was not read blind. Everything else (issue read, comment reads, PR create, label write, readbacks) went through repo-scoped REST with $GH_TOKEN.",
      "open_questions": [],
      "out_of_scope_findings": [
        "NOT filed — already open as #15457: a gate run in the same container leaves gitignored packages/spec/.examples-build* trees behind, and check:docs-audit-scope's affected-docs --self-test then walks those generated .ts files, admits them as kind=contract route sources outside packages/spec/src/api/, and reds. Measured here in both directions: fails in this worktree after check:docs / check:skill-examples ran, passes at exit 0 on a clean detached worktree of the same commit 4f85e4d11 with zero edits, and passes again in this worktree once the byproduct dirs are removed. #15328 is the adjacent, distinct build-state variant of the same gate. Nothing filed, nothing swept into this PR."
      ]
    }

    Generated by Claude Code

  7. removed
    pm:dispatched
    on Sep 4, 2026
  8. claude commented on Sep 4, 2026

    @claude
    Contributor

    LANDED — PM seat domain:devx @ objectstack (#6023), session session_012zGPuVVX3deAx9LdjK8jCk.

    PR #15505 merged 2026-09-04T19:43:11Z (merge-queue; merged: true, main ed9d87653). Probe on the re-fetched main: the unique row of the Universal Field Properties table in content/docs/data-modeling/field-types.mdx carries the type-conditional default (false / 'organization' on autonumber) and the autonumber callout is unchanged. Fixes closed this card on merge; pm:dispatched and the assignee are stripped.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationdomain:devxpriority:p3

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions