Skip to content

feat(spec): every step a flow drawing shows can be translated, under flows.FLOW.nodes.NODE_ID.label - #36383

Merged
objectstack-fleet[bot] merged 11 commits into
mainfrom
claude/project-thread-t9wf57
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 11 commits into
mainfrom
claude/project-thread-t9wf57

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Part of #35979 (Asked item 2 only, as ruled in comment 7076440876; Asked item 1 is PR #36335, merged)

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTrJZvNaijgX3NxBMc

Clause-②: yes (widening: a new translation key flows.FLOW.nodes.NODE_ID.label; the new exports FLOW_TECHNICAL_NODE_TYPES and isFlowTechnicalNodeType from @objectstack/spec/automation; and @object-ui/i18n's exported FlowLabelTranslations type gains the member screenTitle, and its stepLabel parameter accepts a config)
Metadata-protocol: added
Skills-docs: follow-up #36401

维护者速读

  • 用户能看到什么变化:应用包现在可以给流程里每个步骤(开始、判断、通知、结束等)写各语言名称;手册里的流程图和 Studio 流程画布都按读者语言显示这些步骤名,中文下不再夹英文。已发布语言的应用在检查里会多出这些步骤的缺译提示。
  • 为什么做:HotCRM 销售手册的审批流程图在中文下仍显示英文的判断和通知步骤,维护者在卡上选了「补上翻译位,可以翻译」。
  • 出错会怎样:只影响显示和缺译提示,不改流程运行和任何数据;可直接撤回。
  • 要你做什么:无。

What changes

Both halves are on this branch: the key, its validation and its coverage demand, and the readers that draw it (on main since PR #36335 merged the shared flow-label resolution into @object-ui/i18n).

  • The key (packages/spec/src/system/translation.zod.ts). flows.FLOW.nodes.NODE_ID.label, a strict entry with one plain-text leaf, label, overlaying the node's own FlowNode.label. It addresses every node but a screen (whose screens.NODE_ID.title covers config.title ?? node.label) and an approval (approvals.NODE_ID.label), so one string keeps one key. nodes was an unknown-key alias onto screens; it is now the real group (node aliases onto it). The ## nodes docblock section states the rule; the convention list gains the row.
  • Start and end nodes (ruling item 3). Keyed like any other step; the viewer supplies no words of its own. Measured on examples/app-showcase at c448c61: of the start/end labels, 25 are End and 11 Start, but the rest name an outcome or a trigger (Approved x5, Rejected x5, Signed Off, Declined, On Task Created x3, Daily at 06:00, ...), which a generic word would erase.
  • Validation (packages/lint/src/validate-translation-references.ts). A nodes key over an unknown node is translation-target-unknown with the nearest node offered; over a screen it is pointed at screens.NODE_ID.title, over an approval at approvals.NODE_ID.label. The reverse slips now point at the new key: a screens or approvals key over any other node says its label is keyed nodes.NODE_ID.label (two existing messages gain that clause instead of "so nothing resolves").
  • The demand (packages/lint/src/i18n-walk.ts, i18n/missing-flow). Every top-level node the docs embed draws at its default detail: business altitude, minus screens and approvals, which were already demanded; and, since the embed's branch list names the step each branch of a drawn decision leads to, a folded technical step a branch names (seat reading L2 S1; live case: app-todo's check_recurring branching to the compute_next_due_date script). decisionBranchTechnicalTargets mirrors which out-edges the viewer lists (flow-branches.ts decisionBranches). Region-nested nodes are accepted by validation but not demanded: the embed does not draw them. packages/cli/src/utils/i18n-coverage.ts only updates the bucket's description.
  • The readers (ui/packages/i18n/src/flowLabels.ts). The shared stepLabel now reads each step's one key by node type: approvals.NODE_ID.label for an approval, screens.NODE_ID.title for a screen with no config.title, nodes.NODE_ID.label for any other node. The docs viewer's type: flow embed (metadata-viewer.tsx, new flowStepName) names each drawn step and each decision-branch target by it; the Studio canvas (FlowCanvas, and flow-region-view's RegionNode for nested region nodes) and the inspector heading read the same stepLabel unchanged, so a nested node's key, which validation accepts, has a reader.
  • A titled screen (seat reading S3). A screen with its own config.title shows that heading at run time, translated under screens.NODE_ID.title; its canvas label has no key. The docs embed names such a screen by its heading (translated where the bundle carries it), unless the heading holds a {{ }} hole a drawing cannot fill, in which case it keeps the authored label. FlowLabelTranslations gains screenTitle for this read. The Studio canvas keeps a titled screen's authored label, since that is the label the designer edits.
  • One table for business altitude (packages/spec/src/automation/flow-altitude.ts). The viewer's private TECHNICAL_NODE_TYPES set becomes FLOW_TECHNICAL_NODE_TYPES + isFlowTechnicalNodeType in @objectstack/spec/automation; the viewer folds steps by it and the walk demands by it, so they agree on which steps a reader sees.
  • Examples. app-crm's lead-conversion wizard gets its three drawn steps in zh-CN (its baseline stays 0). The ratchet in scripts/i18n-coverage-baseline.json is raised for the new population, as the PR that first walked the validation-message family did: app-showcase 317 -> 425 (+108, one of them the folded showcase_inquiry_purge.purge a branch names), app-todo 106 -> 130 (+24, two of them todo_task_completion.compute_next_due_date in its two translated locales); the other 12 configs are unchanged (the ten bundle packages stay 0, check:i18n in sync).
  • Ledger and pins. liveness/translation.json gains flows.nodes (+ label), live, citing flowLabelTranslations, flowStepName, FlowCanvas and RegionNode. flows-translation-face.test.ts: the node.label row now lists nodes.NODE.label beside approvals.NODE.label.
  • Generated. api-surface/automation.json, export-origins/automation.json, content/docs/references/system/translation.mdx, the strictness-ledger counts and the liveness state counts, regenerated by check:generated --fix.

Read first (by risk)

  1. packages/lint/src/i18n-walk.ts, the new loop at the end of walkScreenFlows: what is demanded (top level, not technical, not screen/approval).
  2. ui/packages/i18n/src/flowLabels.ts stepLabel and metadata-viewer.tsx flowStepName: which key each node type reads, and the titled-screen rule.
  3. packages/spec/src/system/translation.zod.ts, the nodes entry and the nodes / steps alias changes.
  4. packages/lint/src/validate-translation-references.ts, the nodes block and the two redirect clauses.

Two-minute check: pnpm --filter @objectstack/cli exec vitest run --project unit test/i18n-flow-node-coverage.test.ts; expect 6 passed, including HotCRM's opportunity_approval shape asking for its start, decision, notify, loop and end labels and nothing for its approvals, screen or record write.

Tests

Pins
  • packages/cli/test/i18n-flow-node-coverage.test.ts (new family file, like the screen / approval / refusal family files beside it): the walker harvests exactly the drawn steps with no other key, seeded with the authored label; a folded step only where a drawn decision's listed branch names it, once (a conditions-free decision lists every out-edge; a conditions decision its default and its claimed labels; an unclaimed label and a non-decision source name nothing); nothing for any other FLOW_TECHNICAL_NODE_TYPES step or an id-less node; every harvested key parses and is kept by TranslationDataSchema; the coverage gate lists them in the flow bucket and goes quiet once translated.
  • packages/lint/src/validate-translation-references.test.ts: a new top-level describe (clean run over start / decision / loop / nested notify / end beside the other groups; nodes over an approval and over a screen redirected; unknown node with suggestion), the two changed redirect messages, and the one-line-verdict arm list gains the four new arms.
  • The screen, approval and liveness-gate family files in packages/cli/test/ pin exact key lists of their own family; they now read every key but the nodes family (one predicate per file, pointing at the new file).
  • ui/packages/components/src/__tests__/metadata-viewer.test.tsx: a new top-level describe: start / decision / notify / end by nodes, an untitled screen by screens title, a titled screen by its translated heading and a holed heading by its label, a decision-branch target by nodes, and the business view folding exactly FLOW_TECHNICAL_NODE_TYPES.
  • ui/packages/app-shell/src/views/metadata-admin/previews/FlowCanvas.test.tsx: stepLabel reads each group by node type (and never another type's group under the same id); the canvas draws a decision's and a nested notify's translation; the inspector heading titles a decision by its nodes key with the authored label beside it.
Runs at cafc3fd (the spec half) unless noted
  • @objectstack/lint whole suite (before the L2 S1 widening): Test Files 225 passed (225), Tests 9431 passed (9431) (at eabf0e6; lint unchanged since).
  • @objectstack/cli unit project, the 60 i18n / translation / lint test files: 18 failures at eabf0e6, all exact key lists in the three family files above; after the predicate, those 4 files Tests 52 passed (52).
  • @objectstack/spec: flows-translation-face.test.ts + translation.test.ts, Tests 238 passed (238).
  • pnpm --filter @objectstack/spec check:generated: 5 stale before regeneration, all 5 green after --fix.
  • node scripts/check-i18n-coverage.mjs: before the baseline edit app-crm 0 -> 3, app-showcase 317 -> 424, app-todo 106 -> 128; after: OK (14 config(s), 552 baselined untranslated string(s), none new). pnpm check:i18n: all ten bundle packages in sync. pnpm check:i18n-walk-parity: 17 declared, 15 walked, 2 exempted.
  • Derived gate sweep at cafc3fd (dispatch-gates --commands, 127 commands): 126 exit 0, 1 NOT MEASURED (check:dual-build-cjs-loads, exit 3 for want of a full build; left to CI). dispatch-gates --ran: 127 accounted for.
Runs at bc0171d (the reader half, after merging main at dda5e74)
  • ui, from ui/: FlowCanvas.test.tsx + flowNodeLabels.sites-13200.test.ts, 64 tests passed; metadata-viewer.test.tsx at its final edit, Tests 22 passed (22) (two runs before it failed on the test's own isolation: a shared i18n instance and a locale-specific string, both fixed in the test).
  • pnpm --filter @object-ui/i18n run type-check, @object-ui/components, @object-ui/app-shell: all exit 0 (after building app-shell's dependency closure, 68 of 68 tasks).
  • pnpm --filter @objectstack/spec check:generated --fix: the 2 artifacts the merge deferred plus the liveness counts regenerated, all 3 re-checked green.
  • Derived gates for the files changed since the first sweep (dispatch-gates --commands, 96 commands): 96 exit 0. dispatch-gates --ran: 96 accounted for, 0 NOT MEASURED (derived from recorded exit codes).
  • overlap-check.mjs: merges cleanly with origin/main at 316f757.
Runs at 04d28e0 (the L1 / L2 rework)

Acceptance notes


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jTrJZvNaijgX3NxBMc

…flows.FLOW.nodes

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTrJZvNaijgX3NxBMc
…teps a flow embed draws

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTrJZvNaijgX3NxBMc
…ad their own family

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTrJZvNaijgX3NxBMc
…r row planned until the reader lands

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTrJZvNaijgX3NxBMc
…les' new step-label debt

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTrJZvNaijgX3NxBMc
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation protocol:system tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/cli, @objectstack/lint, @objectstack/spec, touching 16 documentable anchor(s). ⚠️ 5 changed file(s) yielded no anchor (packages/spec/api-surface/automation.json, packages/spec/export-origins/automation.json, packages/spec/liveness/state-counts/translation.md, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

28 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 07b17542a24a6d1cc89342a949901f47e93c76aa.

⛔ 15 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 5 changed file(s) yielded no anchor (packages/spec/api-surface/automation.json, packages/spec/export-origins/automation.json, packages/spec/liveness/state-counts/translation.md, …) — pages documenting those are invisible to this run
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 68 of 251 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 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 — 185 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 07b17542a24a6d1cc89342a949901f47e93c76aa → packageMentionDocs.

Which tree this was computed on

This run read content/docs from e95517f99a24043c8c78eef304a4c996482b9a9d — the merge of head 04d28e04f9310fed7f4c981e5f12771d8df2f861 into base 07b17542a24a6d1cc89342a949901f47e93c76aa, 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 e95517f99a24043c8c78eef304a4c996482b9a9d && git checkout e95517f99a24043c8c78eef304a4c996482b9a9d
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 07b17542a24a6d1cc89342a949901f47e93c76aa 04d28e04f9310fed7f4c981e5f12771d8df2f861 && git checkout -B drift-repro 07b17542a24a6d1cc89342a949901f47e93c76aa && git merge --no-ff 04d28e04f9310fed7f4c981e5f12771d8df2f861

node scripts/docs-audit/affected-docs.mjs --json 07b17542a24a6d1cc89342a949901f47e93c76aa

⚠️ 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 07b17542a24a6d1cc89342a949901f47e93c76aa → 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#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract-review-claim: session_01QsR2jTeURPvEm465RcoYEC · head 47a645c · 2026-11-22T09:36Z

The shared step-label resolution in @object-ui/i18n now reads the one key
each step's name has: approvals.<node_id>.label for an approval,
screens.<node_id>.title for a screen with no config.title, and
nodes.<node_id>.label for any other node. The docs viewer's flow embed and
the Studio canvas (nested region nodes included) read it through
stepLabel. The docs embed names a titled screen by its heading,
translated where the bundle carries it, unless the heading holds a {{ }}
hole, and folds technical steps by the spec's FLOW_TECHNICAL_NODE_TYPES.
The flows.nodes ledger row flips to live, citing the readers.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTrJZvNaijgX3NxBMc
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 REWORK · head bc0171d889865edd7c67d80ec52c392ac6d68590 · 2026-11-22T17:49Z

维护者速读

要改的(2 项)

  1. Skills-docs: 这一行要改成卡号的写法。 正文和 changeset 现在都写着 Skills-docs: follow-up owed — skills/objectstack-i18n/SKILL.md (#36401)。按清单,follow-up owed 在卡立好之后,要把这一行改写成 #N。objectstack-i18n skill: document the flows nodes translation group #36401 已经立了,所以两处都改成 Skills-docs: follow-up #36401。l1-face 的 skills-docs 旗就是这一项。

  2. Clause-② 的放宽清单漏了 @object-ui/i18n 的一处公开类型改动。 FlowLabelTranslations 是 @object-ui/i18n 包根导出的类型(index.ts 里 export … type FlowLabelTranslations)。本 PR 给它加了一个必填成员 screenTitle,并把 stepLabel 的参数放宽成可带 config。changeset 的正文已经写了「FlowLabelTranslations gains screenTitle」,但正文和 changeset 的 Clause-②: yes (widening: …) 尾部只列了翻译键和 @objectstack/spec/automation 的两个导出。请在两处的尾部补上这一项,和 fix(fields): a pick leaves an amount in another currency empty and says why #36351 那一轮的做法一样,把每一处放宽都列出来。仓库里构造这个类型的只有 flowLabelTranslations 自己(app-shell 的上下文只是转手传递),所以不需要改成可选。

席位核对

  • 卡片关系:首行 Part of #35979,写明只做第 2 项,第 1 项是已合并的 fix(components): the docs flow embed names the flow and its approval steps in the reader's language #36335。裁定 7076440876 的三条:

    1. 每个画出来的步骤都有可翻译的标签键,spec、校验和业务视图的读取都做了;
    2. 已有的 i18n/missing-flow 扩展为要这个键,没有新建门禁,HotCRM 的 9 条另立 HotCRM: translate the 9 step names of opportunity_approval #36402;
    3. 开始和结束节点不由查看器自己出词,和别的步骤一样要翻译。正文给了实测理由:showcase 里的开始和结束标签很多是结果或触发条件,例如 Approved、On Task Created。

    三条都交付了。Part of 对,卡保留 pm:dispatched。i18n coverage: demand flows.FLOW.label for every embedded flow, not only the ones the walk reaches today #36400(流程名的缺译要求)和 HotCRM: translate the 9 step names of opportunity_approval #36402 另立卡,正文写了。

  • spec:flows.<flow>.nodes.<node_id>.label 是 strict 的条目,只有一个纯文本的 label 叶子。它覆盖除 screen、approval 以外的节点,任何深度都算,所以一个字符串只有一个键。原来 nodes、steps 是指向 screens 的未知键提示,现在 nodes 是真正的组,node、steps、step 指向它。别名只是被拒时给的改名建议,不是接受集,所以改指向不算收窄。docblock 和约定列表都补了。

  • 校验:写在 screen 上的 nodes 键指向 screens.<id>.title,写在 approval 上的指向 approvals.<id>.label。节点不存在时报 translation-target-unknown,并给出最接近的节点。反过来,screens / approvals 键写在别的节点上时,两条旧消息的结尾从「so nothing resolves」改成「its label is keyed nodes.<id>.label」。

  • 缺译要求:walkScreenFlows 只要顶层、不是技术类型、不是 screen 或 approval、有 id 的节点。嵌套在区域里的节点校验接受但不要求,理由是文档嵌入不画它们。这和 FlowView 只画顶层节点一致。

  • 一张表:FLOW_TECHNICAL_NODE_TYPES 和原来查看器私有的 TECHNICAL_NODE_TYPES 逐项相同(9 个类型),查看器和缺译检查都读它。

  • 读取:stepLabel 按类型读:approval 读 approvals,没有 config.title 的 screen 读 screens.title,其余读 nodes。flowStepName 对写了 config.title 的 screen 用它的标题(有译文用译文),标题里有 {{ 时退回作者写的标签,和正文、changeset 说的一致。判断分支的目标也走 flowStepName。Studio 画布(含区域里的嵌套节点)读同一个 stepLabel。

  • 声明:Clause-②: yes (widening) 方向对,清单见第 2 项。Metadata-protocol: added 对,加了一个翻译键。不是 !,也没有 (narrowing),不欠 dogfood。

  • changeset:五个包都有条目;spec、lint、cli、i18n 是 minor,components 是 patch。正文各段我逐句核过,和 diff 一致:键、开始结束、缺译要求、两处读取、带标题的 screen、一张表。

  • 已发布文档:i18n-standard.mdx 的键表加了 flows.{flow}.nodes.{node} 一行,translations.mdx 加了「流程步骤名」一行,生成的 translation.mdx 已重新生成。每一句都和代码一致。

  • 示例与基线:app-crm 补了三条中文,基线仍是 0。app-showcase 317 → 424、app-todo 106 → 128 是新的待译条目,按首次纳入一类新键的先例上调。正文写了 check:i18n-coverage 前后的读数。

  • 测试:cli 新增一个家族文件 i18n-flow-node-coverage(6 条,其中 HotCRM opportunity_approval 的形状只要开始、判断、通知、循环、结束);三处同族文件改用谓词,把 nodes 家族排除在精确清单之外;lint 新增一组 describe;components 和 FlowCanvas 各加了用例。

  • 门禁读数:spec 那一半在 cafc3fdf,127 条里 126 条 exit 0,1 条没测到,是 check:dual-build-cjs-loads,交给 CI。读取那一半在本 head bc0171d8(合入 main 之后):96 条全部 exit 0,--ran 对得上。

  • CI @ bc0171d8:63 success、11 skipped、0 failed;mergeable clean。

  • 落地:改了 translation.zod.ts,席位在并行跑契约档 L2。两份评审都通过后,由区 ready + auto-merge。

…lls follow-up by its number

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTrJZvNaijgX3NxBMc
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: bc0171d889865edd7c67d80ec52c392ac6d68590
Local-runs: none
Scope: packages/spec/src/automation/flow-altitude.ts, packages/spec/src/automation/index.ts, packages/spec/src/system/translation.zod.ts + packages/lint/src/i18n-walk.ts, packages/lint/src/validate-translation-references.ts, packages/cli/src/utils/i18n-coverage.ts, ui/packages/i18n/src/flowLabels.ts, ui/packages/components/src/renderers/basic/metadata-viewer.tsx, packages/spec/liveness/translation.json

Read: card #35979 body and all 10 comments (ruling 7076440876, the item 1 report and closing note, dev report 7083079826), the PR body, its 27-file list, the net diff against merge-base dda5e74, and the 74 check-runs on this head (63 success, 11 skipped, none failed or pending). The whole PR is judged, not the delta since 47a645c. The PR is still a draft. Follow-up cards #36400, #36401 and #36402 exist and are open.

① Derived judgments

  • Accept set, flows.FLOW.nodes.NODE_ID.label (translation.zod.ts): right. One new optional group on the flow entry. Each entry is strict and holds one optional plain-string leaf, label. nodes was refused before, so the move is refused to accepted: a pure widening. No existing key changes shape or becomes required, so a bundle that parsed on main parses unchanged.
  • Aliases: right. aliases on strictObject only pick the hint an unknown key is refused with (strict-object.ts). They accept nothing and rename nothing. So steps moving from a screens hint to a nodes hint, and the new node and step hints, change a refusal sentence and no accepted shape. nodes leaving the alias table is required, since it is now a real key. The entry's own aliases (title, name, heading, stepLabel, text onto label) are hints of the same kind. Strictness ledger 407 to 408 matches the one new strict site.
  • Validator (validate-translation-references.ts): right. A nodes key is accepted over any node id the flow declares, at any depth, whose type is neither screen nor approval. Over a screen it redirects to screens.NODE_ID.title, over an approval to approvals.NODE_ID.label. An unknown id is an orphan, and the suggestions leave out screens and approvals. The universe is the same walkFlowNodes plus artifact-provided flows the sibling groups use. The two reworded redirects (screens or approvals over another node type now name nodes.NODE_ID.label) are true at this head. Every new refusal sits inside the new key, so nothing an author could write before is refused now.
  • Reader (flowLabels.ts, metadata-viewer.tsx): right, and it matches the validator one for one. stepLabel reads approvals.NODE_ID.label for an approval, screens.NODE_ID.title for a screen whose config.title is absent or empty, nodes.NODE_ID.label for any other type, and never one type's group under another type's id. ScreenConfigSchema.title is a string, and the engine falls back to the node label when the title renders nothing, so the untitled test agrees with the executor. flowStepName names a titled screen by its translated heading, else its authored heading, unless the heading holds a {{ hole, and then by the authored label. The step list and the branch-target list both go through it. activeFlowsBundle forwards the whole flows group, so nodes and screens reach the reader with no second loader.
  • Nested nodes: right. Validation accepts a nodes key at any depth, and it now has a reader: the Studio canvas (FlowCanvas) and RegionNode in flow-region-view.tsx both call the shared stepLabel on the node itself, which carries type and config. The earlier record's concern that a nested key translated nothing is closed.
  • Folding table: right. FLOW_TECHNICAL_NODE_TYPES holds the same nine types, in the same order, as the private set the viewer drops in this diff. The viewer filters by isFlowTechnicalNodeType and the walk skips by it. api-surface/automation.json and export-origins/automation.json gain exactly these two rows. Nothing is removed or renamed.
  • Walk demand (i18n-walk.ts, i18n/missing-flow): right for the step list, short for the branch list (see S1). It asks for top-level nodes that are not a screen, an approval, a technical type or id-less, seeded from node.label. That is the step list FlowView draws at business altitude.
  • Ledger: right. flows.nodes and its label child are live, and each cited reader exists at this head and reads the key. State counts 47 to 48 live, 49 to 50 classified. No authorWarn, which a live row refuses.
  • Baseline: right. showcase 317 to 424 and todo 106 to 128 are the new population, and app-crm stays 0 with its three new zh-CN entries. The i18n coverage and walk-parity gates are green on this head.
  • FlowLabelTranslations.screenTitle (@object-ui/i18n): right. A new member on an exported interface. The one producer is flowLabelTranslations, and no other code builds the object. stepLabel now also reads config, a wider input. Additive for every reader.

② Semver level

  • Metadata-protocol: added is right: one new key an author can write, nothing narrowed, no meaning changed.
  • Clause-②: yes (widening) is right against the public surface: the new accepted key and two new exports from @objectstack/spec/automation. No narrowing arm is owed. The line is line-initial in the PR body and the changeset, and they agree.
  • The changeset names @objectstack/spec, @objectstack/lint, @objectstack/cli and @object-ui/i18n at minor and @object-ui/components at patch. All five are in the one fixed group, so they publish at minor together, which is what added owes on a moved package. examples/app-crm is private. The changeset gates are green.
  • The changeset prose matches the tree, with one overstatement, graded as S1: "they agree on which steps a reader sees".

③ Boundary flags

  • Dev report 7083079826: open_questions is empty. Nothing to answer there.
  • Deviation, titled screen with a holed heading: accepted. In the docs embed such a screen keeps its authored label, which has no key. The PR and the changeset both say so. Closing it later means accepting nodes over a titled screen, which is a widening and can land at any time. The Studio canvas keeps the authored label of every titled screen, which is the string the designer edits. No card tracks this residue yet; the seat should file one, because the card's done-when (no English step left) is not met for such a screen.
  • Deviation, attribution link and no review request: process only. No effect on the tree.
  • Ruling item 3 (start and end nodes): decided and stated. They are keyed like any other step, and the viewer supplies no words of its own. The reader agrees.
  • Out-of-scope findings: filed. i18n coverage: demand flows.FLOW.label for every embedded flow, not only the ones the walk reaches today #36400 (the flows.FLOW.label demand), objectstack-i18n skill: document the flows nodes translation group #36401 (the i18n skill text, matching the Skills-docs: follow-up owed line) and HotCRM: translate the 9 step names of opportunity_approval #36402 (HotCRM's nine step names) are open.
  • Earlier record on 47a645c: E1 (served tier) is met by this record. E2 (reader half) is met: the viewer reads the spec table and the key, and the ledger row is live. Its three carried findings are closed by the tree except the titled-screen residue above. The steps alias now hints at nodes.
  • Read, not reviewed (outside the diff): the header of ui/packages/app-shell/src/views/metadata-admin/previews/flow-label-translations.tsx and one comment in flow-region-view.tsx still say the designer reads the approval label only. They are stale beside this PR.
  • SQL push-down: not applicable. The diff touches no query path, no id materialisation and no in-app join.

④ Design judgment

  • translation.zod.ts against ruling 7076440876 and its first consumer: holds. The ruling asks for a translatable label key per flow node under the flow's bundle. The key is addressed by FlowNode.id like every sibling group, overlays FlowNode.label, and is plain text, which is right because the label is never rendered over a run's variables. Keeping screens and approvals on their own keys keeps one key per string and makes the validator's redirects exact. I tried an old bundle (parses), a nodes key over a screen, an approval, a nested node and an unknown id (redirected, redirected, accepted, refused), and a steps or step key (refused, pointed at nodes). None breaks the design.
  • flow-altitude.ts and index.ts against their two readers: hold for the fold. The viewer and the walk read the one table, so the step list and the demand cannot drift. The guard takes unknown and is safe on a missing type.

S1 (should-fix): the walk does not ask for every step name the embed draws at business altitude. Branches in metadata-viewer.tsx resolves each decision branch target against all top-level nodes, technical ones included, and names it through flowStepName, which reads nodes.NODE_ID.label. The walk skips every technical type. So a decision that leads to a technical step shows that step's name in the authored language, the key exists, and i18n/missing-flow stays silent. It is live in the repo: examples/app-todo/src/flows/task.flow.ts, edge e3, leads check_recurring (a decision) to compute_next_due_date (a script). This contradicts the flow-altitude.ts jsdoc ("exactly the steps that viewer draws at its default altitude") and the changeset ("they agree on which steps a reader sees"), and it leaves ruling item 2 short for those names. Fix one side: the walk also asks for the top-level targets of a top-level decision's out-edges, with the baseline raised to match, or the branch list stops naming a folded step by its label, or the jsdoc and changeset state the gap and a card carries it.

N1 (nit): the nodes docblock in translation.zod.ts says the group covers "every node whose label has no key of its own" and that a screen is "keyed already, so one string keeps one key". A titled screen's canvas label has no key at all: screens.NODE_ID.title translates its heading, not its label. The changeset says this correctly. The docblock should say it too when the file is next touched.

N2 (nit): an untitled screen's translated screens.NODE_ID.title is drawn by stepLabel without the {{ test that flowStepName applies to a titled screen's heading. A translation that adds a hole would be drawn raw. Narrow, and display only.

Implemented-by: claude/project-thread-t9wf57
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

…mes it

The docs flow embed lists each drawn decision's branches and names the
step a branch leads to by its label, a folded technical step included
(app-todo's check_recurring branches to the compute_next_due_date
script). The walk now asks for nodes.<node_id>.label for those targets
too, mirroring which out-edges the viewer lists, so the steps the embed
names and the steps the coverage check asks for are the same set. The
examples' new debt is frozen (showcase +1, todo +2). The nodes docblock
says a titled screen's canvas label has no key, and two designer
comments name every key stepLabel reads.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTrJZvNaijgX3NxBMc
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 ACCEPT(增量)· head 04d28e04f9310fed7f4c981e5f12771d8df2f861 · 2026-11-22T19:29Z

维护者速读

增量核对(bc0171d8 → 04d28e04,2 个提交)

  • 我上一轮的 2 项都已改(6f670766)。

    1. 正文和 changeset 两处都改成 Skills-docs: follow-up #36401,l1-face 的旗已消。
    2. 两处 Clause-② 的尾部都补上了:@object-ui/i18n 导出的 FlowLabelTranslations 多了 screenTitle 成员,stepLabel 的参数可以带 config。
  • L2 S1(被折叠的分支目标没有要译文)已改(04d28e04)。 新的 decisionBranchTechnicalTargets 和查看器的 decisionBranches(flow-branches.ts:93)我逐条对过,规则一致:

    • 判断步骤没有 config.conditions 时,所有出边都算分支;
    • 有条件时,只算默认边(isDefault,或标签是 default)和标签被某个条件认领的边;
    • 目标只在顶层节点里找,和查看器传 nodes={allNodes} 一样。

    只收技术类型的目标,其余目标本来就作为画出来的步骤要过了,并且每个目标只要一次。新加的放在已画步骤之后,键仍是 nodes.<id>.label。cli 有新用例;lint 整套 9444 条通过。

  • 基线:app-showcase 424 → 425、app-todo 128 → 130。正文写了新的键(showcase_inquiry_purge.nodes.purge、todo_task_completion.nodes.compute_next_due_date),check:i18n-coverage 是 --update 之后的读数。

  • 文字:changeset 的「Missing translations」段补了这一类;flow-altitude.ts 的模块注释改成「画出来的每一步,加上被分支写出名字的折叠步骤」;translation.zod.ts 的 nodes docblock 补了 N1:写了 config.title 的 screen 的画布标签没有键。这三处都和代码一致。Studio 的两处注释不再说「只有审批步骤」。

  • flow step names: a titled screen whose heading holds a {{ }} hole keeps its untranslated label in the docs embed #36530 承接带 {{ }} 标题的 screen(L2 N2),正文写了。

  • 门禁:本轮改动推导出的 105 条命令全部 exit 0,--ran 对得上;overlap-check 干净。

  • 不阻塞:新的那一段走查没有消融读数,只有新用例在当前代码上是绿的。这段逻辑和 decisionBranches 是一一对照写的,我按上面的对照接受。

  • 其余各项沿用上一轮在 bc0171d8 上的核对。

  • CI @ 04d28e04:63 success、11 skipped、0 failed;mergeable clean。

  • 落地:席位在并行跑契约档增量 L2。两份评审都通过后,由区 ready + auto-merge。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 04d28e04f9310fed7f4c981e5f12771d8df2f861
Local-runs: none
Scope: packages/spec/src/automation/flow-altitude.ts, packages/spec/src/automation/index.ts, packages/spec/src/system/translation.zod.ts + packages/lint/src/i18n-walk.ts, packages/lint/src/validate-translation-references.ts, packages/cli/src/utils/i18n-coverage.ts, ui/packages/i18n/src/flowLabels.ts, ui/packages/components/src/renderers/basic/metadata-viewer.tsx, packages/spec/liveness/translation.json

Delta review of the record on bc0171d (comment 7083158017). Read: the two commits since that head (6f67076, 04d28e0), the PR body, its 29-file list, the tree at this head, and the 74 check-runs on this head (63 success, 11 skipped, none failed or pending). Everything the earlier record judged right and this delta does not touch stands. The PR is still a draft.

S1: closed
N1: closed

① Derived judgments

  • Walk demand (i18n-walk.ts, i18n/missing-flow): right, and now equal to the set the embed names. The walk still asks nodes.NODE_ID.label for every top-level step that is not a screen, an approval, a technical type or id-less. It now also asks it for each top-level technical step that a top-level decision's listed branch leads to (decisionBranchTechnicalTargets). I compared it with decisionBranches (flow-branches.ts) and Branches and FlowView (metadata-viewer.tsx) case by case:
    • Which decisions. The viewer lists branches for every drawn step whose type is decision with a string id. A decision is never a technical type, so every top-level decision is drawn and none is folded. The walk iterates the same top-level decisions. A decision nested in a region is not drawn, and the walk does not visit it.
    • Which edges. The viewer lists an edge when it is isDefault, or the decision has no usable config.conditions, or its label is default under conditions, or a condition claims its label. The walk's test is conditions.length === 0 || isDefault || label === 'default' || claimed. The two are the same set: with no conditions every edge is listed on both sides, so the unguarded default test adds nothing. Both filter conditions to plain records, and both need edge.source equal to the decision id and a string edge.target.
    • Which targets. The viewer resolves the target among the top-level nodes only, and names it through flowStepName, which reads nodes.NODE_ID.label for any type that is not a screen or an approval. The walk resolves among the same top-level nodes and keeps only technical types. A screen or approval target is skipped and stays on its own key, which the older walks ask for. A drawn, non-technical target is already asked by the step loop. A nested or unknown target resolves to nothing on both sides (the viewer prints the raw id). An edge with no string target is no branch on either side.
    • Duplicates. A step two branches name is asked once (seen), and a technical step is never asked by the step loop, so no key is pushed twice. The walk's id map keeps the last node of an id and the viewer finds the first, but FlowSchema refuses a duplicate node id, so they cannot differ on a valid flow.
    • No more than the viewer. A technical step that only a non-decision leads to, or that only an unclaimed labelled edge leads to, is not asked. The cli pin covers each of these arms.
  • Validator agreement: right. os validate already accepts a nodes key over any node that is neither a screen nor an approval, technical types included, so every key the walk now asks for is one an author may write.
  • Baseline: right. I counted the new population from the example sources. app-todo: one such target (todo_task_completion, edge e3, check_recurring to the compute_next_due_date script) over two translated locales, so 128 to 130. app-showcase: one (any_found to the purge delete_record step) over one translated locale, so 424 to 425. Every other example decision leads to a notify, end, approval, parallel or screen step, or is nested (has_owner). app-crm's one decision leads to screens, so it stays 0. The coverage and walk-parity gates are green on this head.
  • No accept-set or export change in the delta. translation.zod.ts and flow-altitude.ts change comments only. The new walk helper is module-private. The api-surface and strictness ledgers do not move.

② Semver level

  • Metadata-protocol: added is still right. The delta adds lint demand and no key.
  • Clause-②: yes (widening: …) is right and now complete. It names the new translation key, the two new exports from @objectstack/spec/automation, and @object-ui/i18n's FlowLabelTranslations gaining screenTitle with stepLabel accepting a config. That is every public widening in the diff. No narrowing arm is owed: the new i18n/missing-flow findings are frozen debt in the baseline and the changeset says an app gets new findings. The line is line-initial in the PR body and the changeset, and the two agree (the body spells the placeholders FLOW and NODE_ID).
  • Skills-docs: follow-up #36401 is spelled as L1 REWORK 7083133049 asked, in both tails. objectstack-i18n skill: document the flows nodes translation group #36401 is open.
  • Changeset levels are unchanged: spec, lint, cli and @object-ui/i18n at minor, @object-ui/components at patch, all in the one fixed group. The two app-shell files change comments only and owe no entry. The changeset gates are green.
  • The changeset's "Missing translations are reported" bullet now states the branch-target demand, and it matches the tree.

③ Boundary flags

④ Design judgment

  • flow-altitude.ts: holds. The jsdoc now says the walk asks for the steps the viewer names: every step it draws, and a folded step only where a drawn decision's branch list names it. That sentence is true of the walk and of the viewer at this head. The table and the guard are unchanged.
  • index.ts: holds. Unchanged since the earlier record.
  • translation.zod.ts: holds. The nodes docblock now says an approval and a screen each have a key of their own, that a screen with its own config.title is titled apart from its label so its canvas label has no key, and that a drawing names such a screen by its heading. This matches stepLabel, flowStepName and the validator's redirects.
  • i18n-walk.ts against the contract: agrees, sentence by sentence. I tried a folded decision (cannot exist), a nested decision, a screen target, an approval target, a targetless edge, a nested target, a twice-named target and an unclaimed labelled edge. None gives a key the viewer does not read, and none leaves a name the viewer draws without a demand.

No must-fix, no should-fix.

N2 (nit): carried from the earlier record, untouched by the delta. An untitled screen's translated screens.NODE_ID.title is drawn by stepLabel without the {{ test flowStepName applies to a titled screen's heading. Display only.

N3 (nit): the branch-listing rule now lives in two places. decisionBranchTechnicalTargets in packages/lint re-states the edge test of decisionBranches in ui/packages/components, with its own copy of the default label, because lint cannot import a UI package. The two agree at this head. Nothing holds them together: the pointer runs one way (the walk names flow-branches.ts, flow-branches.ts does not name the walk), and the cli pin tests the walk against a hand-built fixture, not against the viewer. Only the fold table has one source. A follow-up card should either move the "which out-edges are branches" predicate into @objectstack/spec/automation beside the table, or add a parity pin and a back-pointer.

Implemented-by: claude/project-thread-t9wf57
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Landing (seat 7, 2026-11-22T19:32Z): head 04d28e04f9310fed7f4c981e5f12771d8df2f861 · L1-d delta ACCEPT 7084452500 · L2 delta PASS 7084459700 (CONTRACT_REVIEW_TIER, same head; S1 and N1 closed, N2 and N3 carried to #36530) · check-governed-merges --pr 36383: NOT governed, 954 changed lines · CI on the head: 63 success, 11 skipped, none failed · mergeable clean. → pr_ready + automerge_enable (merge queue).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 19:32
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit f2a990b Nov 22, 2026
75 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-t9wf57 branch November 22, 2026 19:58
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
… opening the report editor keeps the page in the session language (objectstack-ai#36420)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCxiFE11rsKwyNffJZKYqJs)_

repo:objectstack#7 · zhuangjianguo · session_01QsR2jUP9hxdL4RzdzTs9eK

Fixes objectstack-ai#36373

Clause-②: yes (widening) — the report and widget panels accept an edit
of a translated name or title in the session's language, stored as the
inline locale map `{ default: SOURCE, LANG: EDIT }` that `I18nLabel`
already allows; for an item with a packaged base the server no longer
lets the base's translation replace that entry on report
`label`/`description` and widget `title`. Nothing is removed or renamed.
Metadata-protocol: semantic — `translateReport` and `translateDashboard`
now treat a report `label`/`description` or a widget `title` as changed
when its inline locale-map entry for the requested locale (the entry the
panel writes: exact tag, then the locale's own script, else base tag or
a sibling region; never `default`) differs from the packaged base's own,
so the base's translation no longer replaces it; a translation the
paired `.custom` package ships still answers first (ruling record
6631250894), and with none the entry is served; dataset members
(`translateDataset`, ADR-0149) are unchanged
Skills-docs: none — no `skills/` file names these panels, their wording
or the report/widget label precedence (`git grep` over `skills/` for
`translateReport`, `translateDashboard`, `inline locale map`,
`ReportDefaultInspector`, `DashboardWidgetInspector`: 0 hits).

## 维护者速读

- **改了什么**:运行界面报表的「编辑」面板、仪表盘卡片属性栏、Studio
里同一套面板,一律显示字段/指标/数据来源的标签(悬停才看到内部名);用词改成「数据来源」「分组」「指标 ·
合计」「跟着页面顶部的筛选变」,图表类型是中文名加图标;数据来源下面是一句人话。名称、标题框显示当前语言的文字,改动只写当前语言(`{
default: 原文, zh-CN: 新文字
}`);对已安装应用的报表/仪表盘,服务端不再用应用包的翻译盖掉这一条(定制包自己带的翻译仍然优先)。另修:打开编辑面板时页面标题和副标题不再变成英文。
- **为什么改**:维护者要求对照 Attio 把面板换成业务用词;中文管理员原来看到
`total_amount`、`bar`、「维度」「度量」「受治理…RLS」,页面标题一开编辑就变英文。
- **风险与回滚**:服务端 `i18n-resolver.ts`
改了报表名称/描述和卡片标题的取值顺序(只在有打包基线、且内联条目与基线不同的时候才生效;三仓源码普查 0 个内联
map;部署里已存的定制行若带这种 map,该语言会改读定制自己的文字);数据集成员不变。回滚即 revert 本 PR。
- **先看**:`servedLabel.ts`(显示与写回规则)、`i18n-resolver.ts` 的 `slotRead` /
`inlineEntryFor`、`ReportView.tsx` 的 `previewWithServedText`,以及 PR
里的前后截图说明。

## What changes

**Wording and names (both panels).** `ReportDefaultInspector` (runtime
「编辑」 and Studio) and `DashboardWidgetInspector` (Studio's widget
property bar, which objectstack-ai#36372 reuses at runtime):

- The data-source picker lists each dataset by its label alone
(`datasetLabelOptions`); the machine name is the option's `title`. No
`(name)`, no description.
- Bound measure and dimension rows, the add-member popover and the
chart-axis selects show labels; the machine name moves to a `title`
(`nameOnHover` on `FieldListRow`, `AddFieldPopover` and
`InspectorComboField`). A measure reads `LABEL · AGGREGATE`, the
aggregate in words from the new `engine.inspector.report.aggregate.*`
keys (「金额 · 合计」, "Amount · Sum").
- Catalogue wording (`studio/{en,zh}.ts`): 数据来源 / Data source, 分组 /
Group by, 指标 / Metrics, 列分组 / Group columns by, 横轴(分组)/ 纵轴(指标),
不显示图表(只看表格); the widget's section heading is 数据 / Data; the filter
section is 跟着页面顶部的筛选变 / Follows the filters at the top of the page; the
data-source hint is one plain sentence (no 受治理 or RLS), on the report
panel too (`report-dataset-hint`).
- The chart-type select shows each type's catalogue name and its icon
(`InspectorSelectField` options take an `icon`).
- A filter binding row names the filter: its label, 时间 / Date for the
date range, else the label of the dimension whose column
(`columnIdentity()`) it filters; the empty field face reads 默认(LABEL) or
默认字段.
- The report form rows below the curated fields
(`metadata-form-zh-cn.ts`, the zh-CN overlay this console renders the
bundled report form with) use the same words; those leaves are marked
⟨36373⟩.

**Current-language name and title.** `servedLabel.ts`: the name box
(report) and title box (widget) show the served translation while the
buffer still equals the published value it was translated from; an edit
writes the session language's entry only (`writtenLabel`). The report's
served text reaches the panel through the new `ServedReportTextContext`,
provided by `ReportView` (paired at editor open) and
`StudioDesignSurface`; the widget's through the existing
`ServedWidgetTextContext`, now also wrapped around Studio's selection
inspector and, after objectstack-ai#36405, around the dashboard page's edit panel
(`DashboardEditPanel` pairs the page's served dashboard with the stored
document the edit opened; `useDashboardInPageEdit` keeps that opened
document as `published`).

**Heading fix.** `ReportView` drew the authored edit buffer
(objectstack#35008) as the page, so opening the editor turned 「各阶段商机」
into "Opportunities by Stage". `previewWithServedText` now draws the
served value of every translated key (`title`, `label`, `description`,
`blocks`) the edit has not changed.

**Server precedence (spec).**
`packages/spec/src/system/i18n-resolver.ts`:
`valueOverridesPackagedBase` (a re-authored string, as before) and
`inlineEntryOverridesPackagedBase` (an inline map whose entry for the
requested locale differs from the base's) decide what `slotRead` hands
the lookup. `translateReport` (label, description) and
`translateDashboard` (widget title) read through `slotRead`: a
re-authored string reads the pair's translations along the locale chain,
as before (`catalogFor(catalogs, true)`); a slot changed through its map
entry reads the pair's translation for the requested language only (the
same tag, case aside, or another spelling of the same platform-table
tag: a `zh-CN` request reads a row under `zh-Hans`, `ja-JP` one under
`ja`; no fallback chain, no base-language or regional-variant step), so
rank 1 of ruling record 6631250894 (the paired `.custom` package's
translation) still answers first for that locale, the base's translation
never, and with no pair answer for that locale the map is served and the
reader picks its entry (L2 7079950960 S3 and 7080413623 S4, seat ruling:
way 1, the requested language). `inlineEntryFor` picks the entry the
panel's writer (`localeWriteKey`) replaces: exact tag, then, where the
platform table splits the language by script, only an entry of the
locale's own script (bare base, then sibling), else the bare base, then
the first sibling. ⛔ never `default`. The jsdoc of `labelCatalogs`,
`translateReport` and `translateDashboard` names the rule;
`inlineEntryOverridesPackagedBase` says why it is a separate twin of
`valueOverridesPackagedBase` (the exported `scalarOverridesPackagedBase`
and the object fold stay string-only).

Docs: `content/docs/protocol/kernel/i18n-standard.mdx` (the precedence),
`content/docs/ui/reports.mdx` (new "Editing a report beside it"),
`content/docs/ui/dashboards.mdx` (filter bindings wording).

## Tests

- New `packages/spec/src/system/i18n-report.test.ts` describe (14
cases): zh entry served; the en `default` byte-identical; ja still reads
its bundle text (ステージ別商談); a base-tag `zh` entry answers `zh-CN`;
control, a map equal to the base's map reads the bundle; control, no
base reads the bundle (the panel gap below); the widget title follows
the same rule; scope control, a dataset member's map still loses to the
bundle (ADR-0149). L2 rework: with `pairBundle`, the pair's translation
answers ahead of the zh entry on a report label and on a widget title,
and a pair with no entry for the slot leaves the map (the base's
translation never answers); a `zh-TW` request over `{ default, zh }`
reads its Traditional bundle text; a `zh-TW` request over `{ default,
zh, zh-HK }` gates on the `zh-HK` entry `resolveI18nLabel` shows; a
bare-`zh` session reads the `zh-CN` entry its own edit replaced. L2 S3:
a pair translation for `en` down a `fallbackChain` does not outrank the
`zh-CN` entry (report and widget title), a `zh-TW` pair does not answer
a `zh-CN` request over the `zh-CN` entry, and a re-authored plain string
still reads the pair along the chain (control). L2 S4: a `zh-CN` request
reads a pair row stored under `zh-Hans`, the `zh-Hans` mirror over
`zh-CN`, and `ja-JP` over `ja`; the `zh-TW` pin stays the control. 19
cases in the describe.
- New `servedLabel.test.ts` (11 cases): show/write rules, the `{
default, zh-CN }` write with the source byte-identical, a map keeps
every other language, clears, a second edit.
- New `panelBusinessWording-36373.test.tsx` (8 cases), on the HotCRM
`opportunity_metrics` shape: the zh panel reads 数据来源 商机指标, 金额 · 合计,
平均赢单概率 · 平均, 分组 阶段, 柱状图 and the served 各阶段商机; a sweep of both panels'
visible text finds none of `total_amount`, `avg_probability`,
`account_industry`, `opportunity_metrics`, `stage`, `bar`, `RLS`, 维度,
度量, 受治理 (and on the widget `dateRange`, `owner_id`, `lead_source`);
machine names are present as `title`; the chart-type options are Chinese
names, each with an `svg`; en reads English labels with no machine name;
an edit of the served name sends `{ default: SOURCE, 'zh-CN': EDIT }`.
The sweep caught the residual report form rows still saying 维度/度量, fixed
here.
- New `ReportView.headingStaysServed-36373.test.tsx` (3 cases) on the
real `ReportView` and `ReportConfigPanel`: heading and subtitle stay
served with the editor open; an edited key shows the edit; the panel
receives the served/authored pair.
- `DashboardView.inPageEdit-36372.test.tsx`: new case, through the real
`DashboardView`: the card panel on the dashboard page reads the served
title beside the stored one (`Total (served) ← Total (stored)`);
ablation (provider value `null`) → that case red, 10 others green.
- Moved to the new wording: `ReportDefaultInspector.test.tsx`,
`DashboardWidgetInspector.test.tsx`,
`datasetPickers.authorText-11161.test.tsx` (restated for objectstack-ai#36373),
`InterfacesPillar.componentListServedTitles-12688.test.tsx` (the Title
box now reads the served title),
`InterfacesPillar.heldWidget-11910.test.tsx`,
`InterfacesPillar.reportHeld-27785.test.tsx`,
`StudioDesignSurface.heldWidgetPublish-11910.test.tsx`.
- Ablations (`scripts/ablation-replace.mjs`, restored blob == HEAD each
time): precedence reverted (`return false`) → 3 of 24 spec cases red (zh
entry, base tag, widget title); `previewWithServedText` replaced by the
raw buffer → 2 of 3 heading cases red (the context case is a separate
seam). L2 rework: `i18n-resolver.ts` swapped back to `e2d307a1`'s → 4 of
30 red (pair on report, pair on widget, zh-TW over `{ default, zh }`,
bare zh over `zh-CN`); restored, 30/30. S3: `i18n-resolver.ts` swapped
back to `0df531f9`'s → 3 of 34 red (fallback chain on report and widget,
`zh-TW` variant); restored, 34/34. S4: `i18n-resolver.ts` swapped back
to `8ad569b7`'s → the S4 case red; restored, 35/35.

## Acceptance notes

- **Stored shape.** An edit typed over a translation of a plain-string
label stores `{ default: SOURCE, LANG: EDIT }`. Pinned: after a zh edit
the English `default` is byte-identical; a third locale (ja) still reads
its bundle translation; the precedence between bundle and inline map is
named and pinned (below).
- **Precedence.** For report `label`/`description` and widget `title`,
on an item with a packaged base whose inline entry for the requested
locale differs from the base's: 1. a translation the paired `.custom`
package ships; 2. the entry; never the base's translation (ruling record
6631250894's order, kept). A map equal to the package's own map changes
nothing (control pin); an item with no packaged base reads the bundle as
before (control pin).
- **Owed, not in this PR (L2 S2).** With no packaged base (a report or
dashboard no code package ships), the panel still stores `{ default:
SOURCE, LANG: EDIT }`, the server still serves the bundle where it has
an entry for that language, and the box shows that translation again
after save, with no message. The same holds for an override once the
pair carries a translation for that locale. `servedLabel.ts` now states
this. Carried by objectstack-ai#36481 (write the translation row, or say so in the
panel).
- **ADR-0149.** Its bundle-wins clause is scoped to dataset members;
`translateDataset` is untouched, and a pin shows a dataset member's
inline map still loses to the bundle. `check-prior-rulings` over the
precedence terms: 0 hits; `docs/adr` has no other ruling on
report/widget label precedence.
- **Census** of inline locale maps on report `label`/`description` and
widget `title`: objectstack `67132dd7` (2 report files, 6 dashboard
files) 0; hotcrm `689166c` (5, 7) 0; gallery `782d801` (1, 1) 0. The
only map in those files is a dashboard `globalFilters` label in hotcrm
`activity.dashboard.ts`, not a covered prop. No packaged source changes
reading; the census cannot see override rows stored in a deployment,
where a row carrying such a map now reads its own entry in that locale
(the change the semantic line names).
- **Supersedes on these two panels only:** objectui#11161's `LABEL
(name)` and objectui#12303's trailing machine name. Other dataset
pickers (the spec-form `ref:dataset` widget, view and page pickers) are
unchanged.
- **Not changed:** the panels' structure and items; the report
`description` field (it stays in the form rows below and edits the
authored text); Studio's dataset designer. The en form rows below the
curated fields still read the spec's English (`Dataset binding`, "Values
are the dataset’s measures…"): the console deliberately carries no `en`
overlay, and rewording the spec form ripples into ten generated locale
bundles — a follow-up if wanted. The platform's own zh-CN
`metadata-forms` bundle (the generic server-rendered form) keeps
数据集/维度/度量 for the same reason.
- 「查看明细」 is objectstack-ai#36256 and is not rebuilt here.

## Live run (L1-e REWORK)

At head `c6ab9f25`, a fresh local backend (`objectstack dev
--seed-admin`, file DB, the worktree's CLI and freshly built
`@objectstack/spec`) ran HotCRM `689166c` (a scratch copy with
`initialStates` added to its twelve state-machine validations, because
the current author-time rules refuse the copy without them; no HotCRM
file changed). The console ran from this branch's sources
(`ui/apps/console` Vite against it), driven by Playwright as the seeded
admin in a `zh-CN` and an `en-US` browser.

| Acceptance | Reading |
|---|---|
| Open 各阶段商机, press 编辑: heading and subtitle | Before: 「各阶段商机」 /
「按阶段分组汇总商机」. With the panel open: the same. en: "Opportunities by Stage"
/ "Summary of opportunities grouped by stage", both states. |
| Panel words (zh-CN) | 数据来源 商机指标; 报表从这里取数;每个人只能看到自己有权限的记录。; 指标 总金额 ·
合计、平均赢单概率 · 平均; 分组 阶段; 图表类型 柱状图; 横轴(分组)阶段; 纵轴(指标)总金额 · 合计. HotCRM labels
the measure 「总金额」, so the panel reads that, not 「金额」. Name box 各阶段商机. |
| Forbidden-word sweep of the panel's visible text | zh-CN and en-US:
none of `total_amount`, `avg_probability`, `opportunity_metrics`,
`stage` (en: as a word), `bar`, `RLS`, 维度, 度量, 受治理. Machine names are on
`title` only: `total_amount`, `avg_probability`, `stage`. |
| Chart types | zh: 不显示图表(只看表格), 柱状图, 柱形图, 折线图, 面积图, 饼图, 环形图, each chart
with its icon. en: No chart (table only), Bar Chart, Column Chart, … |
| English | Opportunity Metrics, Total Amount · Sum, Avg Probability ·
Average, Group by Stage, Bar Chart; no machine name. |
| Studio, same report |
`/studio/app.objectstack.hotcrm/interfaces?surface=report:opportunities_by_stage`:
the same words, name box 各阶段商机, sweep clean (zh and en). |
| Studio, same dataset's widget | 销售业绩 (`sales_dashboard`) → 阶段管道分布: 数据
· 数据来源 商机指标, 卡片从这里取数…, 分组 阶段, 指标 总金额 · 合计, 跟着页面顶部的筛选变 with 时间
「默认(预计成交日)」, 销售代表 「默认(负责人)」, 商机类型; title box 阶段管道分布. en: Data source
"Opportunity Metrics", "Total Amount · Sum", "Follows the filters at the
top of the page", Date / Sales Rep / Deal Type. Sweep clean (also
`owner_id`, `close_date`, `dateRange`). |
| Untranslated self-built report | A dataset `my_deal_figures` (label
我的成交数据, dimension 销售阶段(自建), measure 合同额) and a report `my_deal_report`
(我的成交报表) created over REST in `app.objectstack.hotcrm.custom`, no bundle
entries. zh-CN panel: 数据来源 我的成交数据, 指标 合同额 · 合计, 分组 销售阶段(自建); en-US: the
same author text with "· Sum". Machine names `contract_value`, `phase`
on `title` only. |
| Round trip: edit the name in zh-CN, Save, reload | Runtime 「编辑」 → Save
on this package report is refused before this PR's code is reached: `PUT
/api/v1/meta/report/opportunities_by_stage?mode=draft` → **403
NOT_OVERRIDABLE** ("ships in 'app.objectstack.hotcrm': save it into
'app.objectstack.hotcrm.custom'"); the panel stays open and dirty, as
objectui#11583 has it (finding below). So the round trip ran through
Studio's 定制: `POST
/packages/app.objectstack.hotcrm/ensure-customization` (201), then `PUT
…/opportunities_by_stage?mode=draft&package=app.objectstack.hotcrm.custom`
with body `"label":{"default":"Opportunities by
Stage","zh-CN":"各阶段商机(本公司)"}` and
`"overrides":{"package":"app.objectstack.hotcrm","basedOn":"6.5.0"}`
(200), then 发布 → `POST
/packages/app.objectstack.hotcrm.custom/publish-drafts` (200, 1
published). After a reload: zh-CN heading 「各阶段商机(本公司)」, name box
各阶段商机(本公司); en-US heading and box "Opportunities by Stage"; `GET
/meta/report/…?locale=zh-CN` and `?locale=en` serve the stored map
`{"default":"Opportunities by Stage","zh-CN":"各阶段商机(本公司)"}`;
`?locale=ja-JP` serves the bundle's 「ステージ別商談」. |

Findings from the run, not fixed here (for the seat):

1. Runtime 「编辑」 → Save on a report an installed package ships is refused
403 NOT_OVERRIDABLE: `ReportView`'s save names no package and declares
no override. Not touched by this diff (the save path is unchanged);
objectstack-ai#36405 gives the dashboard page this route (ensure door + `overrides`),
the report page has none. Carried by objectstack-ai#36374 (item 8, 保存后对所有人生效).
2. The report form's 描述 box shows the English source ("Summary of
opportunities grouped by stage") while the subtitle beside it reads
「按阶段分组汇总商机」. The card's current-language rule covers the name box; the
description stays in the form rows (stated under "Not changed"). Carried
by objectstack-ai#36374 (item 2, 说明可直接改).
3. Studio's canvas strip reads 「已选中:Pipeline by Stage」 in a zh-CN
session (`selection.label` in `StudioDesignSurface`): outside the
panels, same class. Carried by objectstack-ai#36480.
4. English form rows (Dataset binding, "semantic-layer dataset",
dimensions/measures) stay out, per the seat; carried by objectstack-ai#36447.

## Verification

<details><summary>Tests</summary>

Readings at the merged head `20c4ea00` unless named. S4 at `85e6baf9`:
spec `vitest run src/system src/ui/i18n-label-resolver.test.ts` 77
files, 2768 passed (`i18n-report.test.ts` 35/35); `tsc` and `eslint`
exit 0; `overlap-check` clean. S3 at `8ad569b7`: spec `vitest run
src/system src/ui/i18n-label-resolver.test.ts` 77 files, 2767 passed
(`i18n-report.test.ts` 34/34); `tsc --noEmit -p packages/spec` exit 0;
`eslint` on the two spec files exit 0; `overlap-check` clean against
main and objectstack-ai#36383. At `0df531f9` (main `8a741abd` with objectstack-ai#36405 merged in):
`@object-ui/app-shell` `type-check` exit 0 (after rebuilding its
dependencies, 68/68 turbo tasks); one locked `vitest run` of 266
app-shell files (every Dashboard*/ReportView*/ReportConfigPanel* view
test, every inspector test, the moved Studio tests, the runtime-metadata
persistence test): 266 files, 3371 passed, 1 skipped;
`check:test-source-alias` OK; core `column-identity.ratchet` 7/7. L2
rework at `c6ab9f25`: spec `vitest run src/system
src/ui/i18n-label-resolver.test.ts` 77 files, 2763 passed
(`i18n-report.test.ts` 30/30); `tsc --noEmit -p packages/spec` exit 0;
`eslint` on the two spec files exit 0.

- ui: one locked `vitest run` of 117 files (every app-shell, i18n and
console test that names a changed module, the moved tests and the four
new files): 117 files, 1141 passed, 7 skipped.
- spec: `vitest run src/system/`: 76 files, 2642 passed
(`i18n-report.test.ts` 24/24).
- `@object-ui/app-shell` `type-check` (`tsc --noEmit` and `tsc -p
tsconfig.test.json`): exit 0.
- `eslint` on the touched ui files: 0 errors (warnings only in
`StudioDesignSurface.tsx`, none on changed lines).
- Full `pnpm build --concurrency=2` after the merge: 120/120 tasks.
- Ablations: see Tests above.

</details>

<details><summary>Gates</summary>

- `dispatch-gates --commands` at the merged head `20c4ea00`: 112
families. `dispatch-gates --ran` with recorded exit codes: 112 derived,
112 run, 0 NOT-MEASURED, every family exit 0.
- The first sweep (pre-merge) found one real red, fixed in this PR:
`check:test-source-alias` asked the edited tests that reach
`import('@objectstack/lint' | '@objectstack/formula')` to pay that load
at collection (module-top side-effect imports). Its other exit-3 rows
were prerequisites (a shallow-clone fixture commit; built output),
cleared by fetching the fixture and a full `pnpm build --concurrency=2`
(120/120 tasks), then green.
- `overlap-check`: VERDICT clean exit 0 against `origin/main` `97b9d1e6`
and objectstack-ai#36383 (shares `i18n-standard.mdx`, merges cleanly). At `c6ab9f25`:
clean against `origin/main` `6a35635a` and objectstack-ai#36383. At `0df531f9`: clean
against `origin/main` `7ae5e074`, objectstack-ai#36461 (shares `DashboardView.tsx`,
`ReportView.tsx`) and objectstack-ai#36383.
- CI at the final head `e2d307a1`: 70 check-runs, 61 success and 9
skipped, none failed. The first CI run, at `20c4ea00`, went red on Test
UI 9/16. The core `column-identity.ratchet` refused a new `name`/`field`
dual read in the widget panel's filter-label lookup
(`dimensionLabelOf`), which now reads the dimension's column through
`columnIdentity()`. Locally, the ratchet, the five affected ui files (62
tests) and the app-shell type-check pass, and `overlap-check` is clean.
- Changed lines vs `origin/main`: under the 3000 threshold (30 files).

</details>

<details><summary>Screenshots</summary>

Live shots (2× scale) from the run below, in the project's shared files
under `repo-objectstack-7/card-36373/`; they cannot be uploaded to
GitHub from the cloud seat. They replace the harness shots, which are
deleted.

- `live-report-panel-zh-CN.png`: runtime 「编辑」 on 各阶段商机 after the round
trip: heading 「各阶段商机(本公司)」 and subtitle 「按阶段分组汇总商机」 with the panel open,
数据来源 商机指标, 指标 总金额 · 合计 / 平均赢单概率 · 平均, 分组 阶段, 柱状图.
- `live-report-panel-en-US.png`: the same report in English:
"Opportunities by Stage", Data source "Opportunity Metrics", "Total
Amount · Sum", Group by "Stage", "Bar Chart".
- `live-report-charttypes-zh-CN.png`: the chart-type list, Chinese names
with icons.
- `live-studio-report-zh-CN.png`, `live-studio-widget-zh-CN.png`,
`live-studio-widget-en-US.png`: Studio's report panel and the 销售业绩
dashboard's 阶段管道分布 widget panel.
- `live-selfbuilt-report-panel-zh-CN.png`: an untranslated report
created over REST.
- `live-roundtrip-publish-dialog.png`: Studio's publish dialog for the
customized name.

</details>

---

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01QsR2jUP9hxdL4RzdzTs9eK

<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jUP9hxdL4RzdzTs9eK -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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 protocol:system size/l 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.

2 participants