Repository navigation
Description
③ maintainer-directed task · Source: maintainer — 「先立卡,不需要fable,我会用新的agent账户接着评审」「立 objectstack 卡就可以」 (2026-11-19T05:33Z, planning thread on marketplace suites), answering the proposal that units of measure belong at the platform layer.
维护者速读
- 问题: 平台有币种,但没有计量单位。CRM、SRM 和以后的生产套件各写各的单位(SRM 现在是随手填的文字,CRM 订单行根本没有单位),数量跨套件、跟 ERP 都对不上,箱和个、千克和吨也没法换算。
- 要做: 平台提供一份标准单位表、带单位的数量字段和换算。单位表客户能扩,像箱、托这类各家不同;每个物料自己的包装换算留在套件里。
- 不做会怎样: 每个套件各造一套单位,以后想对接,就得先清洗历史数据。
- 你要做的: 无。待评审账户给出设计意见后再定。
Business reason
Who benefits: every managed suite that records a quantity, and the customers who run one of them next to an ERP.
- Sell side. hotcrm sales order lines and quote lines carry a
unit_pricebut no unit at all. - Buy side. hotsrm has
srm_material.uomandsrm_delivery_record.uomas free text withmaxLength: 20. "kg", "KG", "千克" and "公斤" are four different values there. - Production. The planned production suite (the one EE customer builds production management) lives on unit conversion: bills of material, material issue, finished goods.
The cross-suite master-data ruling on #35328 (A: each suite owns its records, matched by contract keys) only works if quantities mean the same thing on both sides of a match. A unit is the quantity's half of that contract, the way ISO 4217 is the amount's half.
If this isn't done, each suite ships its own unit list. Every later ERP or cross-suite link then starts with a data-cleaning project.
What the platform has today (read, not measured)
- Three standard value domains,
iana_time_zone,iso_4217_currencyandiso_3166_alpha2, atpackages/spec/src/shared/value-domain.zod.ts:96-100. Its header records the 2026-09-02 ruling that the vocabulary "does not widen", so adding a fourth member is itself a ruling, not a dev choice. - Multi-currency (ADR-0144): a record currency in a sibling code field, dated rates, and a home-currency amount stored at write. This is the nearest existing pattern for "a number plus the code that gives it meaning, plus a conversion".
- Nothing for units.
uominpackages/spec/src: 0 hits;unit of measure/units of measurein open issues: 0.
Questions for the review (not prescriptions)
- Code list. A fixed standard list (UN/ECE Recommendation 20 common codes) as a value domain, which needs the "does not widen" ruling reopened? Or a platform reference object that ships the standard set and lets an organization add its own packs (case, box, pallet)? Or both: standard codes fixed, org packs added?
- Quantity shape. A number plus a sibling unit-code field, mirroring ADR-0144 D1, or a new field type? What does each do to formulas, summaries, reports and import?
- Conversion split.
- Fixed-ratio conversions inside a dimension (kg↔t, m↔cm) are universal, so the platform should own them.
- Item-specific packs (1 case = 24 each of item X) belong to the suite that owns the item.
- Should the platform give only the table shape and the conversion function for packs, with the rows staying in the suite?
- When conversion happens. At write, like ADR-0144's home projection, or at read and report time? What about rounding and decimal places per unit?
- Enforce-or-remove (ADR-0049). Which consumer reads the unit on day one? Validation of compatible units on a summary, conversion in a report, and a formula function are the candidates. A declared unit nobody reads is inert.
Non-goals
Inventory, costing and valuation stay with the suites and the ERP. Unit-master sync from an ERP goes through connectors or one-way sync-in (ADR-0153). No suite-side migration is in scope; each suite adopts the result in its own repo.
Reader
- The maintainer's reviewing agent account reads this first and writes the design opinion; per the maintainer, no fable pass on this card.
- After his decision, a
packages/spec/ data seat implements. - hotsrm and the production suite are the first adopters.
Prior rulings read
value domain, currency, uom, unit of measure → ADR-0144 (pattern to mirror), and the value-domain ruling of 2026-09-02 ("vocabulary does not widen", recorded in value-domain.zod.ts) → constrains question 1. Also #35328 (ruled A, 2026-11-19), which this complements.
Dedupe
repo:objectstack-ai/objectstack is:issue uom→ 0."unit of measure"→ 5, all closed, none on this capability."units of measure"→ 1, closed, unrelated.
Grade
area:data · Feature · maintainer-sourced (not table-graded) · reach: hotsrm free-text uom, hotcrm order lines without unit (read) · evidence: read → p3 pending the review; the maintainer may regrade.
Generated by Claude Code
Activity
os-bill commentedon Nov 19, 2026
Maintainer ruling: units of measure design
os-bill, 2026-11-19T06:01:58Z, in the design discussion for this card. 「你的意见」 is the recommendation below. It was reviewed adversarially before it went to the maintainer, and he accepted it as recommended on each of its three questions:
Ruled design
packages/specholds a curated subset of UN/ECE Rec 20 common codes, each with its dimension and its ratio to the dimension's base unit. It is a separate table, the wayCURRENCY_FRACTION_DIGITSis (packages/spec/src/data/currency-fraction-digits.ts). It is not a fourth member ofValueDomainSchema, and the 2026-09-02 vocabulary stays closed. Package codes (Rec 21, admitted through the Rec 20 annex with theXprefix, e.g.XBX,XPX) are listed with a package dimension and no ratio. The constant is three things at once: the build-time oracle for fixed-unit fields, the source of truth for standard codes, and a pure conversion table.H87. Its near-synonymsC62andEAare not admitted.sys_unitis organization-owned:organization_idis injected and it sits behind the tenant wall, likesys_exchange_rate. It holds org-added units only, and the platform ships zero rows. Org codes live in a reserved namespace, at least 4 characters or containing an underscore. Rec 20 codes are at most 3 alphanumerics, so a later standard code cannot collide with an org code.numberfield gains a unit declaration that mirrorscurrencyConfig:fixed: the unit is written in metadata and checked at build against U1.record: a pointer names a siblingtextfield that holds each row's code.unit_code), never a contract, as in ADR-0144 D8 rule 2.unitConfig: { unitMode, unit, unitField, dimension }) is the ADR's to fix.master_detail, as ADR-0144's D2 amendment allows for currency, is also the ADR's to fix. Alookuppath is not admitted.sys_unitrows. It is asynchronous and reads rows, so it is not thevalueDomainpredicate, which stays pure and unchanged.scale.record-mode quantity unless it groups by that quantity's unit field (mirrors ADR-0144 D6)os migrate record-currency-codes)sys_unit, or a suite-supplied factor named by pointer (factorField). With no ratio and no factor, the write is refused; there is no 1:1 or null fallback (ADR-0144 D5). Affine units such as temperature are excluded from ratio conversion. Ratios are decimal, scale 12, never float.Out of scope
sys_unitis not asyncedtarget (ADR-0153). ERP code mapping is connector or suite work.Left to the ADR
Next
An ADR records U1–U8. The R1 cards follow it.
Generated by Claude Code
os-bill commentedon Nov 19, 2026
Regrade:
priority:p3→priority:p2. The maintainer chose 「升 p2,交 data 区写 ADR」 (os-bill, 2026-11-19T06:03:51Z).Next deliverable on this card: an ADR that records U1–U8 from the ruling record and settles its three "Left to the ADR" items. The R1 implementation cards follow once the ADR merges. hotsrm and hotcrm adoption stays deferred.
Generated by Claude Code
os-bill commentedon Nov 19, 2026
Regrade:
priority:p2→priority:p1, by the maintainer's message 「升级 p1」 (os-bill, 2026-11-19T06:03:58Z). The next deliverable is unchanged: the ADR described in the comment above.Generated by Claude Code
objectstack-fleet commentedon Nov 19, 2026
repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB
Claim: PM loop round 2 · area data-2 (seat 5 routed this p1 to data-2 after the maintainer's regrade 7001212970) · 2026-11-19T06:04Z
Area: data-2
Session:
session_01Utp6CajiB6BSQKWowy6YLBAccount:
os-billBranch:
claude/issue-35339-uom-adrWorktree:
objectstack-issue-35339Domain:
domain:specSeat:
repo:objectstack#5File surface: one new ADR under
docs/adr/**recording U1–U8 of ruling 7001193034 and settling its three "Left to the ADR" items, plus the ADR index line if the repo keeps one. ⛔ No schema, code, changeset or other ADR edit: the ADR declares, the R1 cards implement after it merges. Stop on breach and report.Container & model:
M,mode:subagent,model: default — contract tier per 强制条款① (docs/adr/**),effort: xhighClause-②: no
Metadata-protocol: none
Responsibility: objectstack
packages/spechas no unit of measure; every managed suite that records a quantity invents its own unit list; the maintainer ruled the platform design (U1–U8) and asked for the ADR before any R1 cardThread-read: 7001212970
Premise: holds — on
origin/main:uominpackages/spec/src0 hits;ValueDomainSchemahas three members (value-domain.zod.ts); no ADR on unitsSerial constraints cleared: none — a new ADR file; no open PR adds a units ADR (live read of open PRs' files at claim time)
Pre-claim lane:
domain:spec(docs/adr/**, Tier H: L1 by L1-a, L2 contract tier and the handoff by seat 5, merge by the approvers)Pre-claim deps: none named; #35328 (ruled A) complements, not a blocker
Prior rulings read: units, uom, value domain, currency, home projection, enforce-or-remove → ruling 7001193034 (U1–U8) binds verbatim; ADR-0144 (D1, D2 amendment, D5, D6, D8 rule 2) is the mirrored pattern; value-domain 2026-09-02 "does not widen" kept by U1; ADR-0049, ADR-0078, ADR-0104 D1, ADR-0153 cited by the ruling; none conflicts. The three "Left to the ADR" items get a Fable analysis first where they are product choices; the seat relays any maintainer pick before the ADR text fixes them.
12 remaining items
objectstack-fleet commentedon Nov 19, 2026
repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB
Maintainer ruling record · ADR-0158 Open item 8 · 2026-11-19T12:02Z
Ruling: the maintainer's decision card in seat 5's project thread (posted 2026-11-19T10:11Z), answered 2026-11-19T12:02Z by tapping option A. Relayed by seat 5. Analysis: project file
objectstack-seat5/area-ux/data-2/decision-35339-oi8-oi10.md(one Fable round).Question on the card, verbatim: 「物料「基本单位」这种旁边没有数量的单位栏,能声明自己是单位栏吗?」
Picked, verbatim (the maintainer's whole text is the option tapped): 「可以单独声明」.
The option's consequence, as the card worded it, verbatim (the card's text, which the maintainer accepted by tapping; it is not the maintainer's own wording): 「声明后只收单位表里的单位、有下拉、旧文字可批量改成标准代码,和币种栏一样;并入第一期三张卡。」
Read plainly: a
textfield that holds a unit code may declare itself a unit field with no quantity beside it, as a currency code field can declarevalueDomainon its own. Once declared, it admits only codes from the unit tables (U1 or the organization'ssys_unit), it gets a picker, and the backfill reaches it. This widens U4, which until now put the declaration on thenumberfield only. The card's "the first release's three cards" are the R1 members that read a unit field: membership (#35489), display (#35490) and backfill (#35492).Not decided here (left to #35489 under its review, amending ADR-0158): the key's spelling on a standalone
textfield, and how it sits besideunitConfig.unitField's pointer. U1's "not a fourth value domain" still holds, so the declaration is a unit marker and not aValueDomainSchemamember.Effect on the R1 cards: OI8 is no longer a blocker. #35489 and #35492 stay
pm:blockedonly on their card dependencies (#35488, then #35489). #35490 stays blocked on Open item 10, which is still with the maintainer.objectstack-fleet commentedon Nov 19, 2026
repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB
Maintainer ruling record · ADR-0158 Open item 10 · 2026-11-19T12:03Z
Ruling: the maintainer's decision card in seat 5's project thread (posted 2026-11-19T10:11Z), answered 2026-11-19T12:02Z by tapping option A. Relayed by seat 5. Analysis: project file
objectstack-seat5/area-ux/data-2/decision-35339-oi8-oi10.md(one Fable round).Question on the card, verbatim: 「千克、件这类标准单位显示几位小数,组织能改吗?」
Picked, verbatim (the maintainer's whole text is the option tapped): 「组织可改,新开一处设置」.
The option's consequence, as the card worded it, verbatim (the card's text, accepted by the tap, not the maintainer's own wording): 「管理员可给任一标准单位设小数位,珠宝行克设3位、砂石场千克设0位;多一张卡。」
Read plainly: an organization admin may set the display decimal places of any standard U1 code, in a new organization-owned setting place.
sys_unitstays org-added units only (U3), and U1 stays a closed constant. This follows U6's 「小数位由组织可改」 for standard codes as well as org codes. L4 is unchanged: the field'sscaleis the storage ceiling, and a unit's decimal places are only its display default.The "one more card" is #35498 (p2, sub-issue here). Its shape (a
sys_*object or a settings key, and its grants) is that card's to settle, amending ADR-0158.Effect on the R1 cards: Open items 8 and 10 are both answered, so nothing remains blocked on #35339. The cards stay
pm:blockedonly on their card dependencies: #35489 on #35488; #35490 on #35489 and #35498; #35491 and #35492 on #35489; #35498 on #35488. #35488 is ready (pm:queue). This card stays open until the R1 cards land.