Skip to content

fix(platform-objects): title a unit of measure by its label, not its code - #39712

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-39658-wip
Dec 4, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-39658-wip

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread
Fixes #39658

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:管理员在设置里新建计量单位「斤」(编码 JIN1)后,成功提示、记录标题、列表标题和选择框都显示「斤」,不再显示编码 JIN1。
  • 为什么做:属于计量单位这组工作,替设置管理员解决「新建单位后看到的是机器编码」的问题。
  • 出错会怎样:只影响自定义计量单位记录的标题显示,数量字段仍按编码存储和引用,改回原样即可直接撤回。
  • 要你做什么:无。

What changes

sys_unit declared code as its title (nameField and displayNameField). Both now name label, the required "name shown beside a quantity in this unit". This follows sys_email_template and sys_personal_view, and matches ADR-0079's "a record's human name". A quantity still stores and names its unit by code (ADR-0158 U4); only the unit row's own title changes. sys_standard_unit_setting and sys_exchange_rate are untouched, and so is item 12b (the ratio's 12-decimal display).

Nothing reads sys_unit's title as a code. No reference field points at sys_unit, and the console's unit display (ui/packages/core/src/utils/unit-display.ts) reads the label column by name, not through the title pointer. No test pinned code as the title. No generated artifact carries these two declarations.

Read first (by risk):

  1. packages/platform-objects/src/system/sys-unit.object.ts lines 125-126: the two-pointer change.
  2. packages/platform-objects/src/system/sys-unit.object.test.ts: the new pin, which also asserts that label stays required, so the title can never be empty.

Two-minute check: pnpm --filter @objectstack/platform-objects exec vitest run --maxWorkers=2 src/system/sys-unit.object.test.ts should report 31 passed. In a running console, create unit 斤 (code JIN1): the toast should read 「计量单位"斤"已创建」.

Tests

  • Pin test: sys_unit is titled by label (nameField, displayNameField), and label is required.
  • Ablation: I reverted nameField to 'code' on disk, and the pin turned red (Expected: "label", Received: "code", 1 failed / 30 passed). Then I restored it.
Package suite and typecheck, at f577f2f
  • pnpm --filter @objectstack/platform-objects test: Test Files 137 passed (137), Tests 2458 passed (2458), command-exit 0 under os-verify-lock. The package was built first: its own suite self-imports @objectstack/platform-objects/system from dist, and the first run without that build failed on exactly that import.
  • pnpm --filter @objectstack/platform-objects typecheck: exit 0 (check:test-typecheck: OK).
  • pnpm --filter '@objectstack/platform-objects^...' build: dependency closure built.

Acceptance notes

  • The object's description still says "named by a code in the organization namespace". That describes the code namespace, not the title. It is outside this card's file surface and I left it unchanged.

Verification

Derived gate subset (dispatch-gates --commands, at f577f2f)
  • 65 derived, 57 run with exit 0, 8 NOT MEASURED, 0 UNRUN (dispatch-gates --ran: 65 derived famil(ies) accounted for).
  • NOT MEASURED, exit 3 PREREQUISITE NOT MET: check:dual-build-cjs-loads and check:lean-entry-closure (they need a workspace-wide dist), check:i18n (the CLI is not built), check-plugin-teardown-shape --self-test (shallow clone). CI runs these.
  • NOT MEASURED, exit 124 (killed by timeout on a shared box, no verdict printed): check-comment-mask-corpus, check:query-options-erasure, check:slot-lookup, check:type-check-debt. CI runs these.
  • check:nul-bytes: exit 0.

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4d1cnRvyiAqrarmDhZV

…code

sys_unit declared code as nameField/displayNameField, so the create toast
and every record title showed JIN1 for a unit labelled 斤. Both pointers
now name label, matching sys_email_template and sys_personal_view.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4d1cnRvyiAqrarmDhZV
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/platform-objects, touching 2 documentable anchor(s).

14 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/ai/knowledge-rag.mdx (via nameField (symbol, a field of const object SysUnit))
  • content/docs/automation/flows.mdx (via nameField (symbol, a field of const object SysUnit))
  • content/docs/automation/hook-bodies.mdx (via nameField (symbol, a field of const object SysUnit))
  • content/docs/data-modeling/field-types.mdx (via nameField (symbol, a field of const object SysUnit))
  • content/docs/data-modeling/formulas.mdx (via nameField (symbol, a field of const object SysUnit))
  • content/docs/data-modeling/objects.mdx (via displayNameField (symbol, a field of const object SysUnit), nameField (symbol, a field of const object SysUnit))
  • content/docs/data-modeling/schema-design.mdx (via displayNameField (symbol, a field of const object SysUnit), nameField (symbol, a field of const object SysUnit))
  • content/docs/deployment/validating-metadata.mdx (via nameField (symbol, a field of const object SysUnit))
  • content/docs/frontend/building-crud-app.mdx (via nameField (symbol, a field of const object SysUnit))
  • content/docs/frontend/plugins/plugin-grid.mdx (via nameField (symbol, a field of const object SysUnit))
  • content/docs/protocol/knowledge.mdx (via nameField (symbol, a field of const object SysUnit))
  • content/docs/ui/forms.mdx (via nameField (symbol, a field of const object SysUnit))
  • content/docs/ui/pages.mdx (via nameField (symbol, a field of const object SysUnit))
  • content/docs/ui/print-pages.mdx (via nameField (symbol, a field of const object SysUnit))

⛔ 6 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v16.mdx (via nameField (symbol, a field of const object SysUnit))
  • content/docs/releases/v17/17-0.mdx (via nameField (symbol, a field of const object SysUnit))
  • content/docs/releases/v17/17-2.mdx (via nameField (symbol, a field of const object SysUnit))
  • content/docs/releases/v18/18-1.mdx (via nameField (symbol, a field of const object SysUnit))
  • content/docs/releases/v18/18-3.mdx (via nameField (symbol, a field of const object SysUnit))
  • content/docs/releases/v18/18-5.mdx (via displayNameField (symbol, a field of const object SysUnit), nameField (symbol, a field of const object SysUnit))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • the SDK route bridge reached 71 of 255 client-bound route-ledger rows — the other 184 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 184: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 60 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 4 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 8e4dda438d8551af73553caadbf5935f217ee4c3 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 1659d62be4abe44ba48e417240ddd9967f412120 — the merge of head f577f2f56fb96844bfe6eabd40f21ce958c3a51c into base 8e4dda438d8551af73553caadbf5935f217ee4c3, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 1659d62be4abe44ba48e417240ddd9967f412120 && git checkout 1659d62be4abe44ba48e417240ddd9967f412120
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 8e4dda438d8551af73553caadbf5935f217ee4c3 f577f2f56fb96844bfe6eabd40f21ce958c3a51c && git checkout -B drift-repro 8e4dda438d8551af73553caadbf5935f217ee4c3 && git merge --no-ff f577f2f56fb96844bfe6eabd40f21ce958c3a51c

node scripts/docs-audit/affected-docs.mjs --json 8e4dda438d8551af73553caadbf5935f217ee4c3

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 8e4dda438d8551af73553caadbf5935f217ee4c3 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4d1cnRvyiAqrarmDhZV

Final head for L1 · 2026-12-04T14:41Z · zone em-admin
Head-sha: f577f2f56fb96844bfe6eabd40f21ce958c3a51c
Checks on this head: 39 success, 18 skipped, 0 failed.
Diff: 3 files, +20 / -2.

  • sys_unit nameField and displayNameField move from code to label.
  • A pin test is added in sys-unit.object.test.ts. It is ablated: going back to code turns it red.
  • A patch changeset is added.
    No lookup points at sys_unit. The console's unit display reads label by name. No generated artifact carries these declarations.
    Governed: NOT governed. check-governed-merges reads 0 surfaces hit and 22 lines.
    L1 requested from thread L1-a. An L2 is owed only if L1 judges the packages/platform-objects declaration a contract face.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR

2026-12-04T14:43Z · L1-a verdict: ACCEPT at head f577f2f56f (zone em-admin, Fixes #39658, item 12a of #39439)

席位核对

Change. sys_unit's displayNameField and nameField move from code to label. label is required, and the docblock calls it "the name shown beside a quantity in this unit". ADR-0079 defines a title as a record's human name, and sys_email_template and sys_personal_view already title by label. highlightFields still lists code first. ADR-0158 U4 is untouched: a quantity still stores and names its unit by code. sys_standard_unit_setting and sys_exchange_rate keep their code titles, as the card scopes. Item 12b (ratio precision) is out, per ruling A′ 5791809146. Fixes #39658 is right.

Test. sys-unit.object.test.ts pins nameField and displayNameField to label, and label as required. The zone reports it ablated (red on code).

Changeset. @objectstack/platform-objects patch. The headline comes first, then Clause-②: no and Metadata-protocol: none. Both are right: a title pointer changes on one platform object, with no accept set, key or stored row moving, and the card found no lookup pointing at sys_unit. I read it sentence by sentence and it agrees with the diff.

Gates.

  • 39 success, 0 failed, 0 pending on f577f2f56f.
  • l1-face flags one unexpected skip, Dogfood Regression Gate (${{ matrix.shard }}/4). That is the opt-in regression shard matrix, skipped at the matrix level as on every unlabelled PR. Main's matrix moved from /3 to /4, so the expected-skip name list does not know the new spelling yet. The aggregate Dogfood Regression Gate is success. Cleared.

L2. Not owed. packages/platform-objects/** is not the schema face (packages/spec/src/**), and there is no rules path and no Clause-②: yes or narrowing arm. It lands in its zone.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4d1cnRvyiAqrarmDhZV

Landing · 2026-12-04T14:44Z · zone em-admin
ACCEPT: PR #39712 comment 7414780983 (L1-a), at head f577f2f56fb96844bfe6eabd40f21ce958c3a51c. No L2 is owed: the file is not under packages/spec/src, so it is not a contract face, per L1. The l1-face unexpected-skip flag on Dogfood Regression Gate (${{ matrix.shard }}/4) comes from main renaming the matrix from /3 to /4; the aggregate gate is success, and L1 cleared the flag.
check-governed-merges.mjs --pr 39712: NOT governed, 22 lines. Checks: 39 success, 18 skipped, 0 failed.
Ready + auto-merge into the queue.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review December 4, 2026 14:45
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 4, 2026
Merged via the queue into main with commit bf95e78 Dec 4, 2026
58 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-39658-wip branch December 4, 2026 15:15
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 tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Units of measure: a unit record is titled by its label, so "unit created" and every lookup name it (JIN1 → 斤)

2 participants