Skip to content

Child record names are stored in English, so a zh-CN user reads "v2 · Clean", "Legal · Legal Counsel 1", "Wet ink · Completed" - #202

Merged
zhuangjianguo merged 1 commit into
mainfrom
claude/issue-157-child-names
Nov 3, 2026
Merged

zhuangjianguo merged 1 commit into
mainfrom
claude/issue-157-child-names

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #157

Clause-②: no
Metadata-protocol: none

The version, review, deviation and signature names were English strings that mirror.hook.ts stored once, so a zh-CN reader saw v2 · Clean, Legal · Legal Counsel 1 and Wet ink · Completed. @objectstack 18.3.0 ships label(record.FIELD) (objectstack#26608, PR #26755, merge 76a12753, an ancestor of tag @objectstack/spec@18.3.0). A formula field calls it, and the engine evaluates it with the request's Accept-Language. The four names now use it, so each reader sees option labels in their own language.

What changed

  • src/objects/{contract-version,review,deviation,signature}.object.ts: display_name changes from a stored Field.text to Field.formula with returnType: 'text'. The key, nameField, highlightFields and relatedListColumns stay as they were, so every reader of display_name keeps working.
    • version: 'v' + string(record.version_no) + ' · ' + label(record.kind)
    • review: label(record.stage) + ' · ' + record.reviewer.name (one reference hop)
    • deviation: record.clause.title + ' · ' + label(record.status) (one reference hop)
    • signature: label(record.method) + ' · ' + label(record.status)
  • src/objects/mirror.hook.ts: removes the four stamping hooks and their inline English label maps. The clm_obligation and clm_payment_plan mirrors stay because neither name contains an option label. An obligation's name is the title its author typed. The payment mirror is #seq · date.
  • src/translations/{en,zh-CN}/objects.lifecycle.ts: the review, deviation and signature display_name help text now says the name follows the reader's language. The version's help text lives in objects.contract.ts, which is outside this claim's file surface. Its current wording ("Filled in automatically …") is still true, so it is unchanged.

The obligation is not changed. Its name has no option label for label() to translate.

Measured (18.3.0, pnpm demo:zh, port 3166, declared demo staff, Chromium)

Before is origin/main fc68eb6. After was measured on the upgraded DB (0b4e133), on a fresh DB, and again on the final head 72fa60c after rebasing onto 56ebd41, also on a fresh DB.

Surface (reader) Before After, zh-CN reader After, en-US reader
Save toast, version (counsel2, UI create) 合同版本"v6 · Clean"已创建 合同版本"v6 · 清稿"已创建 Contract Version "v7 · Clean" created
Save toast, review 审查"Legal · Legal Counsel 1"已创建 审查"法务 · Legal Counsel 1"已创建 —
Save toast, deviation 偏离"不可抗力 · Open"已创建 偏离"保密义务存续 · 未决"已创建 —
Save toast, signature 签署记录"Wet ink · Completed"已创建 签署记录"湿签 · 已完成"已创建 Signature "Wet ink · Draft" created
Contract page body tables (requester2, DPA-2026-0002) v5 · Clean, Legal · Legal Counsel 2, 重大违约终止 · Accepted, E-signature · Sent, in both locales v5 · 清稿, 法务 · Legal Counsel 2, 重大违约终止 · 已接受, 电子签 · 已发出 v5 · Clean, Legal · Legal Counsel 2, 重大违约终止 · Accepted, E-signature · Sent
Body tables: version, review, obligation, instalment, signature (requester1, SOW-2026-0023, fresh DB; the deviation table is in the row above) v5 · Final signed · Finance · Finance Controller · E-signature · Completed (requester2, SOW-2026-0005, both locales) v4 · 最终签署版 · 财务 · Finance Controller · obligation titles as stored · #1 · 2025-12-13 · 电子签 · 已完成 Final Signed · Finance · E-signature · Completed (SOW-2026-0005)
Record H1 (requester2) v6 · Clean / Legal · Legal Counsel 1 / 不可抗力 · Open / Wet ink · Completed, in both locales v6 · 清稿 / 法务 · Legal Counsel 1 / 保密义务存续 · 未决 / 湿签 · 已完成 v6 · Clean / Legal · Legal Counsel 1 / 保密义务存续 · Open / Wet ink · Completed
REST PATCH response (counsel2) — signature → voided: 湿签 · 已作废 deviation → withdrawn: 不可抗力 · Withdrawn
REST GET without Accept-Language Wet ink · Completed Wet ink · Completed (declared labels)
  • On a database seeded on main and then booted on this branch, rows the old hook stamped are served through the formula as well, for example SOW-2026-0005's v5 · 最终签署版 in zh-CN. The seed re-run applied 1130 rows with no refusal.
  • On a fresh database the seed lands with the same counts as main: 300 versions, 60 reviews, 25 deviations, 30 signatures, 200 obligations and 300 instalments. The boot reports 24 author-time warning(s), the same as main, and the server log has no formula fault.
  • The reviewer hop works for the least-privileged reader: requester1 and requester2, who hold no position, read 财务 · Finance Controller and 业务 · Business Requester 2.
  • Lookups: no field in src/ references any of the four objects, so no lookup chip can cite these names. The ⌘K palette does not list these objects: in zh-CN as counsel2 it returns no result for 清稿, 湿签 or Counsel, and it finds the clause 保密义务存续.
  • Notifications: the only inbox notification these flows produce, clm_execution_formalities_missing, cites the contract title and not the child name.

What does not follow the reader

  • The activity entry on a child's record page. The platform's sys_activity.record_label stores the name when the write happens, in the writer's locale. A system write gets the declared labels. On the review counsel2 created in zh-CN, an en-US reader sees Created Review "法务 · Legal Counsel 1". After the current-version hook's update, a zh-CN reader sees 更新了 合同版本 "v6 · Clean". Before this change, both readers saw English for both entries. This surface is the platform's, and this PR changes nothing in it. See the report on Child record names are stored in English, so a zh-CN user reads "v2 · Clean", "Legal · Legal Counsel 1", "Wet ink · Completed" #157.
  • REST search= on these four objects. A formula is not indexed (18.3 docs: "Search never indexes a formula field"). Searching counsel2's data for v6, Counsel and 不可抗力 used to return 1, 35 and 2 rows through the stored name and now returns 0. Clean / 清稿 / Legal / Open / Wet return the same counts as before (43 or 44 / 42 / 36 / 9 / 3). No console surface searches these objects: the body tables have no search box, and the palette does not list them.

Gates (final head 72fa60c, rebased onto 56ebd41)

pnpm install            exit 0
pnpm validate           exit 0   ✓ Validation passed (746ms)
pnpm lint               exit 0   18 warning(s), 6 suggestion(s)   (same as main)
pnpm typecheck          exit 0
pnpm lint:i18n-gate     exit 0   COVERAGE : 0 missing keys across 2 locale(s)
CLM_DEMO_SEED=1 pnpm validate   exit 0   ✓ Validation passed (784ms)

The validate warning lines are byte-identical to a run on main's src/. That run used a temporary checkout of origin/main's src/, restored afterwards, and git diff HEAD was then empty.

Acceptance notes

  • AGENTS.md (Naming: "a stored display_name mirror declared as nameField — never a formula (formulas are not searchable)") and DESIGN.md §03 (four rows: "display_name(存储镜像 …)") no longer describe these four objects. Both files are governed, so this PR does not touch them. The proposed wording is in the report on Child record names are stored in English, so a zh-CN user reads "v2 · Clean", "Legal · Legal Counsel 1", "Wet ink · Completed" #157.
  • src/data/negotiation.seed.ts has a doc comment that still says review_display_name re-stamps the review mirror. That file is outside this claim, so the comment is left for its next owner. The seed itself does not author display_name, and it runs green.
  • On an upgraded database the old display_name column stays in place. It is no longer written, and reads serve the formula value.

🤖 Generated with Claude Code

https://claude.ai/code/session_017nzWFRUo2U7evMkPdVniAn

The version, review, deviation and signature names were stored English
strings composed by mirror.hook.ts, so a zh-CN reader saw "v2 · Clean",
"Legal · Legal Counsel 1" and "Wet ink · Completed". @objectstack 18.3
ships label(record.<field>) (objectstack#26608), which a formula field
evaluates in the request's locale. Each of the four display_name fields
becomes a text formula, and the four stamping hooks are retired. The
obligation and payment-plan mirrors hold no option label and stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017nzWFRUo2U7evMkPdVniAn
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对 — HOLD · head 72fa60c · 2026-11-03

check reading
CI on the head both Validate check-runs success on 72fa60c
scope 7 files: display_name on clm_contract_version / clm_review / clm_deviation / clm_signature becomes a text formula using label(record.FIELD) (18.3, objectstack#26608); four stamping hooks retired; obligation and payment-plan mirrors kept. Lint 18 warnings, the same as main
measured a zh-CN reader now reads 「v6 · 清稿」「法务 · Legal Counsel 1」「保密义务存续 · 未决」「湿签 · 已完成」 on toasts, body tables and the H1; an en-US reader reads English on the same records
why held AGENTS.md (governed, maintainer-only) says: "a stored display_name mirror declared as nameField — never a formula (formulas are not searchable)". This PR is exactly a formula nameField, and the measured cost is the one that rule names: REST search= no longer matches a version number, reviewer name or clause title (v6 1→0, Counsel 35→0, 不可抗力 2→0). No console surface searches these four objects today. Changing a governed rule is the maintainer's call, so this PR waits for a ruling (decision box) rather than being merged by the seat
residual (platform) the activity panel stores the record name in the writer's language (sys_activity.record_label); the seat files it on objectstack whichever way this is ruled

State: #157 moves to needs-user-decision; the PR stays a draft until the ruling.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对 — ACCEPT · head 72fa60c · 2026-11-03T22:40Z

check reading
ruling batch 12 item 5, letter A (6617239807): formula display_name with label() accepted for the four composed names; the seat merges this PR; the maintainer narrows the AGENTS.md naming rule (the seat carries the ruled text on PR #120)
shape draft → main, Fixes #157; base 56ebd41, main has since gained PR #201 on disjoint files; mergeable clean
CI on the head both Validate check-runs success on 72fa60c = PR head.sha
scope 7 files, unchanged since the HOLD reading (6611591087): four display_name formulas, four stamping hooks retired, obligation and payment-plan mirrors kept. Lint 18 warnings, the same as main
residuals REST search= no longer matches the parts of these four names (accepted by the ruling); the activity panel stores the name in the writer's language (objectstack#29962); the stale review_display_name comment in src/data/negotiation.seed.ts is fixed by the next card that touches that file (ruling step 4)

Landing: under the maintainer's ruling (batch 12, 「同意」 2026-11-03T22:34Z) and merge authorization (project thread: 「你可以自己审核的就自己合并」).


Generated by Claude Code

@zhuangjianguo
zhuangjianguo marked this pull request as ready for review November 3, 2026 22:41
@zhuangjianguo
zhuangjianguo merged commit b38df5a into main Nov 3, 2026
2 checks passed
zhuangjianguo pushed a commit that referenced this pull request Nov 3, 2026
, #107)

AGENTS.md: a name composed of select option labels may be a text formula
display_name using label() (ruling 6617239807). DESIGN.md §03: the version,
review, deviation and signature names are formulas in the reader's language
(code: PR #202). §06 F15, §08 HotCRM: waiting on the distribution-model
ruling; §11 M4 drops F15 (ruling 6617236113).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017nzWFRUo2U7evMkPdVniAn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Child record names are stored in English, so a zh-CN user reads "v2 · Clean", "Legal · Legal Counsel 1", "Wet ink · Completed"

2 participants