Repository navigation
fix(i18n): approval step label and approval notification object label read as /meta serves them - #36620
Conversation
… the metadata translators serve them Claude-Session: https://claude.ai/code/session_01ADHkmQNmyLgnBbCoc2iFjL Co-authored-by: Claude <noreply@anthropic.com>
…abel against /meta's reading Claude-Session: https://claude.ai/code/session_01ADHkmQNmyLgnBbCoc2iFjL Co-authored-by: Claude <noreply@anthropic.com>
…for the new resolver Claude-Session: https://claude.ai/code/session_01ADHkmQNmyLgnBbCoc2iFjL Co-authored-by: Claude <noreply@anthropic.com>
… object-label param Claude-Session: https://claude.ai/code/session_01ADHkmQNmyLgnBbCoc2iFjL Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmQNmyLgnBbCoc2iFjL Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 20 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 5 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 176 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 83426b7b126c7371c05408aa1d6c3b6ee3ff0564 && git checkout 83426b7b126c7371c05408aa1d6c3b6ee3ff0564
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 27895d7ff60b64b30e48cbecdc35889b50c3096a cfce553f641ece82053a0eb1997a8958accecdd2 && git checkout -B drift-repro 27895d7ff60b64b30e48cbecdc35889b50c3096a && git merge --no-ff cfce553f641ece82053a0eb1997a8958accecdd2
node scripts/docs-audit/affected-docs.mjs --json 27895d7ff60b64b30e48cbecdc35889b50c3096a
|
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract-review-claim: session_01ADHkmT4eA4YqtxfiPyLPih · head 0b91c34 · 2026-11-23T04:06Z |
… object's API name it holds Claude-Session: https://claude.ai/code/session_01ADHkmQNmyLgnBbCoc2iFjL Co-authored-by: Claude <noreply@anthropic.com>
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract-review-claim: session_01ADHkmT4eA4YqtxfiPyLPih · head cfce553 · 2026-11-23T04:54Z |
|
repo:objectstack#2 · os-steve · session_01ADHkmQNmyLgnBbCoc2iFjL 席位核对ACCEPT — PR #36620 @
|
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract reviewServed-tier: PR #36620 (card #35384), net diff against merge base ① Derived judgments
② Semver levelClause-②: yes (widening) — present line-initial in the PR body and in the changeset body, with
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
N1 (nit) — The changeset calls the new export "the one reading of" the key, while N2 (nit) — N3 (nit) — Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY 维护者速读
ACCEPT → PR #36620 comment 7091970619 · Contract review PASS → comment 7092046163 · Head-sha Review nits: N1 (console |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 45115439638 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Requested by Steve · project thread
Fixes #35384
Clause-②: yes (widening)
Metadata-protocol: none
Skills-docs: none — Metadata-protocol is none and there is no (narrowing) arm; no skills/** file teaches either label reading
维护者速读
What changes
The rule this card carries (from #34030): "resolve the label through
translateObjectwith the same resolve options/metabuilds, sot()carries messages only". This PR delivers the card's two remaining items (items 2 and 3 landed in #36464 and #36598).1. Approval notification object label (service-messaging, plugin-approvals).
NotificationTextKeys.paramsaccepts a new value,{ object: 'OBJECT_API_NAME', fallback }(NotificationObjectLabelParam, exported from@objectstack/service-messaging).renderWithresolves it throughtranslateObject(@objectstack/spec/system) over the object's served definition (getSchema) and its packaged base (registry.getPackagedObjectBase), both read off the data engine the renderer already holds. The resolve options are/meta's: the recipient's negotiated locale, the declared fallback chain, and the declaredsourceLocaleelsedefaultLocale, inlined asreader-locale-labels.tsdoes (one exported builder is spec: one exported builder for the translateObject options /meta uses, instead of nine inline copies #36467).fallbackis delivered when nothing resolves.renderForReader) all go throughrenderWith, so all four paths resolve the label the same way.{ key, fallback }is still accepted and still renders throught(), so stored outbox and inbox rows render exactly as before. The closed-shape validator (problemOf) admits the new shape and refuses a mixed one, a missingfallback, or a name that is not an object API name. The name shape is one segment of the existing catalog-key shape, so every object a{ key: 'objects.OBJECT.label' }param could name, the typed param can name too.subjectParamsnow emits{ object: objectName, fallback }.2. Approval step label (spec, plugin-approvals).
resolveFlowApprovalStepLabel(bundle, flowName, nodeId, literal?, opts?)inpackages/spec/src/system/i18n-resolver.ts. It is the one reading offlows.FLOW.approvals.NODE_ID.label, using the same locale chain and the same bundle-then-literal order asresolveFlowScreenTitle.reader-locale-labels.tsstepLabelresolves through it with the/metaresolve options it already builds for the flow, object and position labels. No key is asked oft()any more.translateFlowis unchanged and stays unregistered intranslateMetadataDocument.flows.approvals.labelevidence is re-anchored on the spec resolver.Export choice (seat ruling, premise measured)
The seat ruled: overlay the step label inside
translateFlowif the step-label read points already hold or read the flow document; otherwise useresolveFlowApprovalStepLabel. Measured ataff34baea:reader-locale-labels.ts:405-410(localizeRequestLabels) has onlyprocess_nameandcurrent_stepfrom the stored row. No flow document is in hand. It is called for every row of a list read (approval-service.ts:10921,listRequests), for the single read (:11205), and by the generic data door (reader-locale-labels-middleware.ts:104). Getting a document there would add one flow read per row.flowLabel(reader-locale-labels.ts:359) does not read the flow document. It handstranslateFlowa stub,{ name: flowName }. So do the othertranslateFlowcallers in the tree:ui/packages/app-shell/src/views/FlowRunner.tsx:445andui/packages/plugin-detail/src/stageChangeStarts.tsx:106both pass{ name, label }.approval-service.ts:11340requestFlow, used byattachFlowSteps:11350andattachFlowRoute:11407).The premise does not hold at the main read point, so this PR takes
resolveFlowApprovalStepLabel.translateFlowand its docblock are untouched, so no client-visible change.The param's member is
object, by seat ruling (card comment 7091274184), and the type name staysNotificationObjectLabelParam. Three reasons:objectalways means an object's API name.{ key, fallback }is also named for what it holds.The first round built it as
objectLabeland round 2 renamed it. The mixed shape{ object, fallback, key }is still refused.Tests changed (forced)
plugin-approvals/src/reader-locale-labels.test.ts: two pins that drove the step label through at()-only double were re-triaged ontogetTranslations. One is "negotiates throughresolveBundleLocale…" and the other is "asks the service once per read, and never through t()". The#35384flow/position sourceLocale describe now also covers the step label.plugin-approvals/src/no-approver-note.test.ts: its local renderer narrows the widenedApprovalTextParamunion. TS2339 came fromcheck:test-typecheck, and no assertion changed.Tests
Readings
i18n-resolver.test.tsdescriberesolveFlowApprovalStepLabel(5 cases: locale +zhladder, declared chain, authored locale sourceLocale en / default zh-CN, literal and empty-bundle fallbacks, own keys). service-messagingkeyed-notification-text.integration.test.tsdescribe#35384(7 cases on a real ObjectQL + SqlDriver: precondition, inline fan-out, SQL outbox + dispatcher, renamed packaged object with/meta'stranslateMetadataDocumentas oracle, inbox reader en / en-US / zh-CN,t()-only service, closed shape). plugin-approvalsapproval-notification-keyed-text.integration.test.tsdescribe[#35384](real ApprovalService plus real MessagingService: an en approver readsDeal, a zh-CN approver reads商机, a renamed object reads its rename).2dfa8720(the code head; the later merge oforigin/maintouched no file in these packages):@objectstack/service-messagingTest Files 80 passed (80), Tests 1084 passed (1084);@objectstack/plugin-approvalsTest Files 127 passed (127), Tests 1883 passed (1883);@objectstack/spec(on9d5362af, spec unchanged after) Test Files 880 passed (880), Tests 28058 passed, 1 todo. Typecheck of all three packages, including spec'scheck:test-typecheckand approvals'check:test-typecheck: exit 0.object, atcfce553f:pnpm exec turbo run buildof both closures (40/40 tasks), then the typecheck of service-messaging and plugin-approvals (includingcheck:test-typecheck) exited 0.@objectstack/service-messagingTest Files 80 passed (80), Tests 1084 passed (1084).@objectstack/plugin-approvalsTest Files 127 passed (127), Tests 1883 passed (1883). The closed-shape pin still refuses{ object, fallback, key }. Spec is unchanged in round 2.scripts/ablation-replace.mjsplus a trap restore; every subject resolves fromsrc/, so there is no dist leg; each leg's anchor went x1 to x0 and was restored with blob equal to HEAD andgit diff HEADempty):t(): 5 failed / 7 of the#35384describe.packagedBase: 1 failed / 7 (the rename case). The first attempt was refused by the tool as a no-op (the replacement text already existed elsewhere), so it was re-run with a distinct replacement.stepLabelback ont(): 5 failed / 37.subjectParamsback to{ key }: 2 failed / 8 (both end-to-end[#35384]cases).Acceptance notes
Version skew: an older
service-messagingrefuses{ object, fallback }atemit(). Both packages are in the changesetfixedgroup, and the changeset says to upgrade them together.A
t()-only i18n double (nogetTranslations) now gets thefallbackfor the typed param, not thet()row.II18nService.getTranslationsis a required member, so every served service hands its translations over.Other producers that name an object through
{ key: 'objects.OBJECT.label' }keep thet()reading until they adopt the typed param. Only plugin-approvals emits it today (git grep objectLabelKeyunder packages/services and packages/plugins).CI on the round-1 head
0b91c34b: Test UI, Lint & Repo Gates and TypeScript Type Check read red, and none of them is a test or type failure. Run 45109434849 concludedcancelledat 04:07:57Z because the push ofcfce553f(committed 04:07:17Z; its CI run 45109928513 was created at 04:07:32Z) superseded it. Every Test UI, Test Core, Lint and Type Check lane on0b91c34bconcludedcancelledbetween 04:07:33Z and 04:07:57Z. The three rollups only report that: Test UI logged "the Test UI shards concluded 'cancelled'", Lint & Repo Gates logged "lint lane ... concludedcancelled" for four lanes, and TypeScript Type Check logged "type-check lane ... concludedcancelled" for three lanes, with noerror TSline. Nothing underui/**orexamples/**consumesNotificationTextParam,ApprovalTextParamor the storedkeyed_text(git grep). The only in-repo narrowing site wasno-approver-note.test.ts, fixed in round 1.Verification
Read first:
packages/services/service-messaging/src/notification-text.ts(renderWithand the privateobjectLabelresolver; risk: the validator's new branch),packages/spec/src/system/i18n-resolver.ts(resolveFlowApprovalStepLabel),packages/plugins/plugin-approvals/src/reader-locale-labels.ts(stepLabel).Two-minute check:
pnpm --filter @objectstack/service-messaging exec vitest run src/keyed-notification-text.integration.test.ts -t 35384should show 7 passed. The en recipient readsYour Opportunity D_1 awaits approval., and the renamed object readsDeal.https://claude.ai/code/session_01ADHkmQNmyLgnBbCoc2iFjL
🤖 Generated with Claude Code