Repository navigation
Closed
Task
1 / 11 of 1 issue completed
Copy link
Labels
domain:specDomain lane — seat card indexed by label:pm:seatDomain lane — seat card indexed by label:pm:seat
Description
按维护者裁定上行立卡(2026-08-31,hotcrm#1301 决裁批 #19-hotcrm ②,批复「其他同意」采纳呈报「定性业务标识符 + 平台路线」)。
平台级 declared ≠ enforced(实测)
- 平台自己相信 autonumber = 唯一:启动日志把自动编号标识符统称 "unique"(hotcrm#1292 正是被这句措辞误导 —— 以为字段声明过
unique而实际从未声明); - 但不默认强制:hotcrm 九个自动编号业务标识字段(合同号/报价号/客户号/产品码/工单号…)只有
crm_case.case_number显式声明了unique: true并获得租户复合唯一索引(COALESCE(organization_id,'__global__'), case_number),其余八个可铸重号; - 重号路径是实测的,不是假想:objectstack#12394 —— 烧号后
ACC-000009被发出两次,受害字段正在那八个之列;相关计数器分裂另见 Seed loader writes untenanted rows while the REST path stamps an organization — one single-tenant install runs two autonumber scopes and mints duplicate business identifiers, silently (17.0.0 GA) #8686 / The #8686 boot warning asserts an active duplicate-minting hazard for the benign zero-organization first boot, and its object list is a mid-seed race snapshot — it has now generated three consumer cards #12395; - 逐应用逐字段补声明 + 迁移是重复付税(2026-08-31 应用仓三原则 [ruled] 应用仓基本原则落编:阻塞是平台缺陷时,应用侧等待平台修复 —— ⛔ 不绕行、不半边落地(维护者 2026-08-31,判例 hotcrm#549) #13848):一个「自动编号」若允许重复,它就不是标识符 —— 这该是平台默认。
裁定方向
autonumber 字段默认 unique,租户复合形状照 case_number 既有样板;显式声明退出才不唯一。
设计约束(实现 + 复审判断)
- 退出通道的拼写与 docblock(何时合法退出:纯展示序号等),⛔ 不发明超出需要的配置面;
- 存量重号处理必须响亮:默认翻转时,已有数据含重号的表建索引会失败 —— 迁移/启动路径要检测并点名重号行 + 修复指引,⛔ 不静默跳过、⛔ 不静默降级为不唯一;
- 与 The #8686 tenancy backfill destroys the autonumber high-water mark: the merge targets a row that does not exist yet, the
__global__row is deleted unconditionally, and an already-allocated business identifier is re-issued #12394(烧号重发)/Seed loader writes untenanted rows while the REST path stamps an organization — one single-tenant install runs two autonumber scopes and mints duplicate business identifiers, silently (17.0.0 GA) #8686(计数器分裂)的修复交互写进 PR —— 默认唯一会把那两类缺陷从「静默重号」变「响亮拒绝」,这是意图的一部分; - 条款②:YES(路径肢
packages/spec/src/**预期命中 + 内容肢:已发布 autonumber 契约行为变化),契约复审档位,changeset 标行为变化; - 首个消费者/验收:hotcrm 八字段在平台默认下获得唯一性、零应用侧声明(hotcrm#1301 已改挂本卡)。
Refs: hotcrm#1301(九字段测量)· hotcrm#1292(被措辞误导的前卡)· #12394 · #12395 · #8686 · #13848。
Metadata
Metadata
Assignees
Labels
domain:specDomain lane — seat card indexed by label:pm:seatDomain lane — seat card indexed by label:pm:seat
Activity
docs(field-types): give `unique` its real scope vocabulary
zhuangjianguo commentedon Sep 3, 2026
Landing reconciled —
domain:specseat,session_0174WZTU6XcFcS7g2kykC53i(seat post #6017), 2026-09-03T15:48Z.PR #14904 MERGED 2026-09-03T14:48:27Z as
f8e8f035— contract review PASS at tier by the director seat (14904#issuecomment-5527202464, a take-over of the stalled in-seat review after the dispatching session went off shift), ready + auto-merge by the same seat. Probed onorigin/main9786d39(15:38Z):packages/spec/src/data/field.zod.ts:2047readspatch.unique = field.type === 'autonumber' ? 'organization' : false;and theuniquedescribe at:960carries the autonumber-default sentence with the explicitunique: falseopt-out. Card closed viaFixes;pm:dispatchedwas stripped at 15:20Z (label set read back =domain:spec).The dev report's two open questions (5523180672) are answered inside that PASS: the ADR-0120 D4 posture is kept (an accepted maintainer decision, not reopened — a loud, remedied degrade satisfies constraint 2); hotcrm's ten autonumber fields are parsed declarations, so the default reaches them once a published
@objectstack/speccarries it — the cross-repo unlock for hotcrm#1301 is an installable release plus a hotcrm bump, not this merge. Filed by the dev, unassigned, for triage: #14901 (sub-issue of this card — the hand-written field-types row) and #14902 (engine lane — a plain unique index over existing duplicates throws the raw driver error at boot). The dispatching session's cloud devsession_017xqRv7A8HiJdKxsVm1UCuMis scoped to that session's account and cannot be archived from this seat — recorded here, not carried as a successor debt.Generated by Claude Code
docs(data-modeling): the `unique` default cell states the type-condit…
docs(field-types): give `unique` its real scope vocabulary (objectsta…
feat(spec): autonumber fields default to unique: 'organization'; expl…
docs(data-modeling): the `unique` default cell states the type-condit…
test(spec): the second data/ file group's test titles state each cite…