Repository navigation
fix(objectql,approvals,audit): rule messages, approval object labels and activity-summary labels read as /meta serves them in a declared sourceLocale - #36464
Conversation
…le message through translateObject (wip) Claude-Session: https://claude.ai/code/session_01QsR2jTyyBmoPBsURQjeJGq Co-authored-by: Claude <noreply@anthropic.com>
…h labelTranslation; sourceLocale pin Claude-Session: https://claude.ai/code/session_01QsR2jTyyBmoPBsURQjeJGq Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTyyBmoPBsURQjeJGq Co-authored-by: Claude <noreply@anthropic.com>
…abels through translateObject Claude-Session: https://claude.ai/code/session_01QsR2jTyyBmoPBsURQjeJGq Co-authored-by: Claude <noreply@anthropic.com>
…s through translateObject Claude-Session: https://claude.ai/code/session_01QsR2jTyyBmoPBsURQjeJGq Co-authored-by: Claude <noreply@anthropic.com>
…tring option reads as /meta serves it Claude-Session: https://claude.ai/code/session_01QsR2jTyyBmoPBsURQjeJGq Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 16 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 — 32 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 f068f4423f2425fac2e6082aae1acb427f4bd063 && git checkout f068f4423f2425fac2e6082aae1acb427f4bd063
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 9abc732132a2f723627d585b049e2cc10869db19 44c8fc39f4c0a3bbed44d384b86345590bb6fd11 && git checkout -B drift-repro 9abc732132a2f723627d585b049e2cc10869db19 && git merge --no-ff 44c8fc39f4c0a3bbed44d384b86345590bb6fd11
node scripts/docs-audit/affected-docs.mjs --json 9abc732132a2f723627d585b049e2cc10869db19
|
…age over through its translations Claude-Session: https://claude.ai/code/session_01QsR2jTyyBmoPBsURQjeJGq Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTyyBmoPBsURQjeJGq Final green head · 2026-11-22T13:32Z |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jSpi3g1dQNTvN6zEuH 席位核对L1 (L1-e) on head Landing condition. Both new readers hand
Read
|
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTyyBmoPBsURQjeJGq
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTyyBmoPBsURQjeJGq Landing · 2026-11-22T15:40Z · head
Ready + auto-merge in this stroke. The PR says |
…es before it picks a pack (objectstack-ai#36561) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi92ncfFpPUpTD8314otX5oaG)_ Fixes objectstack-ai#36466 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:应用以英文编写、默认面向中文用户、并持有英文语言包时,浏览器语言为美式英语等地区写法的用户,在对象元数据接口里看到的对象名称由中文变为英文原文,和同一请求下保存报错里的名称一致;没有对应语言包的语言仍按默认语言显示。 - 为什么做:多语言标签统一的后续:让元数据接口和服务端各处读者用同一种方式把地区语言写法对到已有语言包。 - 出错会怎样:最坏情况是某个地区语言写法的用户看到的对象名称语言不对,不影响数据和权限,合并后可直接回退。 - 要你做什么:无 ## What changes The card's ruling, quoted: "Make the `/meta` read (`packages/rest/src/meta-item-read-gate.ts`) negotiate the request tag the way the other readers do before it picks a pack. No spec change." - `metaTranslateOptions` (the `ResolveOptions` every metadata-document translation builds) now carries `locale` as the request tag negotiated against the locales the i18n service reports: `resolveBundleLocale` (`@objectstack/spec/system`, the platform's one locale ladder) over `getLocales()`. That is the question objectql's `negotiatedMessageLocale` and plugin-approvals' `negotiatedReaderLocale` already ask, over the same set. Neither of those is importable from `@objectstack/rest` without a new export (objectql does not export it; plugin-approvals is downstream), so a private helper beside it (`negotiatedTranslationLocale`) repeats only the offered-set plumbing and calls the shared rule. It adds no second rule and no new export. - The tag passes through untouched when there is nothing to negotiate against: no service, no `getLocales`, a throwing, empty or non-array answer, or no match. So a locale the deployment holds no pack for still walks the declared chain to the default locale. - Reach: `metaTranslateOptions` is the one builder, so the item read and the list read on both transports (`RestServer` and the runtime dispatcher, which share `translateMetaDocument` / `translateMetaList`), the view container, the stale-plural rule, the `GET /meta` types listing and the public form's object labels (`translateOptionsFor` delegates here) all read the negotiated tag. The doc locale collapse (`resolveDocLocale`) and `extractLocale`'s other callers (export, import template) are untouched. - No `packages/spec` change. ## Tests New top-level describe `objectstack-ai#36466 §7` in `packages/rest/src/meta-i18n-declared-fallback-chain.test.ts`, the shared harness of the `/meta` i18n pins (§6 is this deployment's `sourceLocale` case). The fixture is `sourceLocale: 'en'`, `defaultLocale: 'zh-CN'`, the chain collapsed to `zh-CN`, a `zh-CN` pack, and an `en` pack that holds no `account` rows. - Card pin 1: an `en-US` request with only an `en` pack reads `Account` from `/meta` (item read, list read, and bare `en` agree). - Card pin 2: a request for a locale with no pack at all (`fr-FR`), and a header-less request, still read the default locale (`客户`). - Control: with no `en` locale held, `en-US` has nothing to negotiate to and walks to `客户`; `zh` still reads the `zh-CN` pack. - Acceptance parity: for `en-US` and `fr-FR`, `/meta`'s label and the label objectql's `DELETE_RESTRICTED` (code and status asserted) names on the same i18n service are the same (`Account` and `客户`), and the other one is absent. - Cached arm (`getMetaItemCached`, the default door): `en-US` is served `Account` and `en` the same body; the `en-US` validator revalidates its own request (`304`); sent with `zh-CN` or `fr-FR` it answers `200` with `客户`, never a `304` for the English body. ## Acceptance notes - **Cache key (measured, unchanged here).** The cached arm's validator is the protocol's hash of the untranslated document folded with the tag the request SENT (`extractLocale`, `meta-item-read-routes.ts`, objectstack-ai#1319). Translation runs after it with the negotiated tag. So within a running server each sent tag maps to one body: `en-US` and `en` get separate validators over identical bodies (fewer shared `304`s, never a wrong one), and a validator never crosses languages (pinned above). Keying the validator on the negotiated tag would need `meta-item-read-routes.ts`, outside this card's file surface, so it is raised as a question in the report. Not pinned, because it is already true of any pack edit: the validator hashes no translation input, so a client that cached an `en-US` body before this deploy can be answered `304` on the old `客户` body until the document changes. - **plugin-security does not negotiate (measured; the card's premise holds for objectql and the objectstack-ai#36464 readers only).** Reading taken with a scratch copy of `controlled-by-parent-master-edit-user-message.test.ts` (deleted, not committed) on an i18n service with `sourceLocale: 'en'`, `defaultLocale`/fallback `zh-CN` and an `en` pack: the master-detail refusal's `userMessage` names the master `Contract` for `en`, `合同` for `en-US`, and `Contract` for `fr-FR`. `denialLocaleOf` returns the raw request tag and `denialLabels` hands it to `translateObject` as written. So after this PR, `/meta` (`Contract`) and plugin-security (`合同`) still disagree for `en-US`, and for `fr-FR` (`/meta` serves `合同`, plugin-security falls back to an `en` sentence naming `Contract`). This is reported for the seat to file, not fixed here. - The public form and the `GET /meta` types listing negotiate too, because they read the same builder. That is the same defect class on the same function; no pin was added for them. ## Verification Two-minute check: `pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2 src/meta-i18n-declared-fallback-chain.test.ts`. Expect 30 passed, including `objectstack-ai#36466 §7 … an en-US request with only an en pack reads Account`. Read first: 1. `packages/rest/src/meta-item-read-gate.ts`, the `metaTranslateOptions` hunk (`locale: negotiatedTranslationLocale(service, locale)`) and the new helper below it. 2. `packages/rest/src/meta-i18n-declared-fallback-chain.test.ts`, the `objectstack-ai#36466 §7` describe (the parity and cached-arm cases). <details><summary>Test readings (head 5555e3e)</summary> - `pnpm --filter @objectstack/rest test && pnpm --filter @objectstack/rest typecheck` under the verify lock: Test Files 427 passed (427), Tests 8788 passed, 351 skipped (9139); `tsc --noEmit` and `check:test-typecheck` OK (0 files in debt). Lock VERDICT command-exit 0. - New describe alone: Test Files 1 passed (1), Tests 30 passed (30). Lock VERDICT command-exit 0. - Dependency closure built first: `pnpm --workspace-concurrency=2 --filter '@objectstack/rest^...' build`, lock VERDICT command-exit 0. The parity case reads `@objectstack/objectql` from that build. </details> <details><summary>Ablation (fix committed first)</summary> `node scripts/ablation-replace.mjs --file packages/rest/src/meta-item-read-gate.ts --anchor 'locale: negotiatedTranslationLocale(service, locale),' --replacement 'locale, /* ABLATION-36466 */' -- …vitest run … meta-i18n-declared-fallback-chain.test.ts`: anchor 1 to 0, marker 0 to 1, blob 3b1e091 to e2c5192f903c. The test imports `./rest-server.js` from source, so no dist step is involved. Result: 3 failed, 27 passed. Red: `an en-US request with only an en pack reads Account`, `for the same request, /meta and objectql name the object with the same label`, and the cached-arm case. The no-pack, no-en and `zh` controls stayed green. Restore: blob equals HEAD (3b1e091), and `git diff HEAD` is empty. </details> <details><summary>Gates</summary> Derived with `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` at 5555e3e: 69 commands (3 changed paths). Each was run with stdin closed and its exit captured before any pipe. - 69 of 69 exit 0. Two needed a second pass. `check:type-check-debt` hit the per-command 420 s cap (exit 124) on the first pass; re-run alone, it reported `OK — 0 ledger entr(ies) re-measured … 0 raw tsc error(s)`, exit 0. `check:dual-build-cjs-loads` exited 3 (PREREQUISITE NOT MET, no full build); after `pnpm turbo run build --concurrency=2 --filter='!@objectstack/docs'` (lock VERDICT command-exit 0, 120/120 tasks) it reported `124 published require entry point(s) across 72 package(s) load`, exit 0. - `--ran` reconciliation: `69 derived famil(ies) accounted for — 69 run, 0 NOT-MEASURED`. - `node scripts/pm/overlap-check.mjs --branch=HEAD`: `VERDICT clean exit 0` (merges cleanly with origin/main d463c46; no open PR head shares a file). - CI at 5555e3e: all 53 check-runs completed, each success or skipped. Among them: Lint & Repo Gates, TypeScript Type Check, Test Core (10/10), Build Core, Governed Surface Queue Guard, Live E2E UI, Test UI, Dogfood Regression Gate, Check Changeset. </details> --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm <!-- signed: repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm --> --------- Co-authored-by: Claude <noreply@anthropic.com>
… read as /meta serves them (objectstack-ai#36620) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9DD8XEF1VwrqXiQzo8zQCjY)_ Fixes objectstack-ai#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 objectstack-ai#34030): "resolve the label through `translateObject` with the same resolve options `/meta` builds, so `t()` carries messages only". This PR delivers the card's two remaining items (items 2 and 3 landed in objectstack-ai#36464 and objectstack-ai#36598). **1. Approval notification object label (service-messaging, plugin-approvals).** - `NotificationTextKeys.params` accepts a new value, `{ object: 'OBJECT_API_NAME', fallback }` (`NotificationObjectLabelParam`, exported from `@objectstack/service-messaging`). `renderWith` resolves it through `translateObject` (`@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 declared `sourceLocale` else `defaultLocale`, inlined as `reader-locale-labels.ts` does (one exported builder is objectstack-ai#36467). `fallback` is delivered when nothing resolves. - The inline fan-out, the dispatcher (claimed rows and digests) and the inbox reader (`renderForReader`) all go through `renderWith`, so all four paths resolve the label the same way. - Widening, not replacement: `{ key, fallback }` is still accepted and still renders through `t()`, 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 missing `fallback`, 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. - plugin-approvals `subjectParams` now emits `{ object: objectName, fallback }`. **2. Approval step label (spec, plugin-approvals).** - New spec export `resolveFlowApprovalStepLabel(bundle, flowName, nodeId, literal?, opts?)` in `packages/spec/src/system/i18n-resolver.ts`. It is the one reading of `flows.FLOW.approvals.NODE_ID.label`, using the same locale chain and the same bundle-then-literal order as `resolveFlowScreenTitle`. - `reader-locale-labels.ts` `stepLabel` resolves through it with the `/meta` resolve options it already builds for the flow, object and position labels. No key is asked of `t()` any more. - `translateFlow` is unchanged and stays unregistered in `translateMetadataDocument`. - Liveness `flows.approvals.label` evidence is re-anchored on the spec resolver. ### Export choice (seat ruling, premise measured) The seat ruled: overlay the step label inside `translateFlow` if the step-label read points already hold or read the flow document; otherwise use `resolveFlowApprovalStepLabel`. Measured at `aff34baea`: - `reader-locale-labels.ts:405-410` (`localizeRequestLabels`) has only `process_name` and `current_step` from 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 hands `translateFlow` a stub, `{ name: flowName }`. So do the other `translateFlow` callers in the tree: `ui/packages/app-shell/src/views/FlowRunner.tsx:445` and `ui/packages/plugin-detail/src/stageChangeStarts.tsx:106` both pass `{ name, label }`. - Only the single-read enrichment holds the document (`approval-service.ts:11340` `requestFlow`, used by `attachFlowSteps` `:11350` and `attachFlowRoute` `:11407`). The premise does not hold at the main read point, so this PR takes `resolveFlowApprovalStepLabel`. `translateFlow` and 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 stays `NotificationObjectLabelParam`. Three reasons: - The member holds the object's API name, not a label. - In the spec, the word `object` always means an object's API name. - The sibling `{ key, fallback }` is also named for what it holds. The first round built it as `objectLabel` and 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 a `t()`-only double were re-triaged onto `getTranslations`. One is "negotiates through `resolveBundleLocale`…" and the other is "asks the service once per read, and never through t()". The `objectstack-ai#35384` flow/position sourceLocale describe now also covers the step label. - `plugin-approvals/src/no-approver-note.test.ts`: its local renderer narrows the widened `ApprovalTextParam` union. TS2339 came from `check:test-typecheck`, and no assertion changed. ## Tests <details><summary>Readings</summary> - New pins: spec `i18n-resolver.test.ts` describe `resolveFlowApprovalStepLabel` (5 cases: locale + `zh` ladder, declared chain, authored locale sourceLocale en / default zh-CN, literal and empty-bundle fallbacks, own keys). service-messaging `keyed-notification-text.integration.test.ts` describe `objectstack-ai#35384` (7 cases on a real ObjectQL + SqlDriver: precondition, inline fan-out, SQL outbox + dispatcher, renamed packaged object with `/meta`'s `translateMetadataDocument` as oracle, inbox reader en / en-US / zh-CN, `t()`-only service, closed shape). plugin-approvals `approval-notification-keyed-text.integration.test.ts` describe `[objectstack-ai#35384]` (real ApprovalService plus real MessagingService: an en approver reads `Deal`, a zh-CN approver reads `商机`, a renamed object reads its rename). - Full suites on `2dfa8720` (the code head; the later merge of `origin/main` touched no file in these packages): `@objectstack/service-messaging` Test Files 80 passed (80), Tests 1084 passed (1084); `@objectstack/plugin-approvals` Test Files 127 passed (127), Tests 1883 passed (1883); `@objectstack/spec` (on `9d5362af`, spec unchanged after) Test Files 880 passed (880), Tests 28058 passed, 1 todo. Typecheck of all three packages, including spec's `check:test-typecheck` and approvals' `check:test-typecheck`: exit 0. - Round 2, the rename of the member to `object`, at `cfce553f`: `pnpm exec turbo run build` of both closures (40/40 tasks), then the typecheck of service-messaging and plugin-approvals (including `check:test-typecheck`) exited 0. `@objectstack/service-messaging` Test Files 80 passed (80), Tests 1084 passed (1084). `@objectstack/plugin-approvals` Test Files 127 passed (127), Tests 1883 passed (1883). The closed-shape pin still refuses `{ object, fallback, key }`. Spec is unchanged in round 2. - Ablation (round 1; one lock call each, `scripts/ablation-replace.mjs` plus a trap restore; every subject resolves from `src/`, so there is no dist leg; each leg's anchor went x1 to x0 and was restored with blob equal to HEAD and `git diff HEAD` empty): - Leg 1a, messaging object label read through `t()`: 5 failed / 7 of the `objectstack-ai#35384` describe. - Leg 1b, no `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. - Leg 2, approvals `stepLabel` back on `t()`: 5 failed / 37. - Leg 3, spec resolver walking the declared chain for the authored locale: 1 failed / 5. - Leg 4, approvals `subjectParams` back to `{ key }`: 2 failed / 8 (both end-to-end `[objectstack-ai#35384]` cases). </details> ## Acceptance notes - Version skew: an older `service-messaging` refuses `{ object, fallback }` at `emit()`. Both packages are in the changeset `fixed` group, and the changeset says to upgrade them together. - A `t()`-only i18n double (no `getTranslations`) now gets the `fallback` for the typed param, not the `t()` row. `II18nService.getTranslations` is a required member, so every served service hands its translations over. - Other producers that name an object through `{ key: 'objects.OBJECT.label' }` keep the `t()` reading until they adopt the typed param. Only plugin-approvals emits it today (`git grep objectLabelKey` under 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 concluded `cancelled` at 04:07:57Z because the push of `cfce553f` (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 on `0b91c34b` concluded `cancelled` between 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 ... concluded `cancelled`" for four lanes, and TypeScript Type Check logged "type-check lane ... concluded `cancelled`" for three lanes, with no `error TS` line. Nothing under `ui/**` or `examples/**` consumes `NotificationTextParam`, `ApprovalTextParam` or the stored `keyed_text` (`git grep`). The only in-repo narrowing site was `no-approver-note.test.ts`, fixed in round 1. ## Verification Read first: `packages/services/service-messaging/src/notification-text.ts` (`renderWith` and the private `objectLabel` resolver; 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 35384` should show 7 passed. The en recipient reads `Your Opportunity D_1 awaits approval.`, and the renamed object reads `Deal`. https://claude.ai/code/session_01ADHkmQNmyLgnBbCoc2iFjL 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- signed: repo:objectstack#2 · os-steve · session_01ADHkmQNmyLgnBbCoc2iFjL --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steedos · project thread
Part of #35384 — this PR moves three of the card's readers onto the
/metaresolve path. The approval NOTIFICATION subject param stays open: it is resolved per recipient at delivery by service-messaging's general keyed-param path, so it is left for the area to file (see Acceptance notes).Clause-②: no
Metadata-protocol: none
维护者速读
What changes
The #34030 rule, quoted from the card: "resolve the label through
translateObjectwith the same resolve options/metabuilds, sot()carries messages only."validation/rule-validator.ts,authoredRuleMessage): an author-written rule message (objects.OBJECT._validations.RULE.message) now resolves throughtranslatedLabelsoverValidationMessageContext.labelTranslation. That is the bundle plusResolveOptionsthat the same refusal's field, option and object labels already read (i18n: validation and refusal messages read field, option and object labels through t(), so a declared i18n.sourceLocale request still names the field with the defaultLocale row #34030), so this half adds no copy of the options. The ADR-0029 D9.2a tenant-rewrite check is unchanged.translate(that is,t()) now carries only the built-in messages.reader-locale-labels.ts,readerLabelsFor().objectLabel): the object label resolves throughtranslateObjectover every locale the service holds, with the metadata route's options: the negotiated reader locale, the declared fallback chain, andsourceLocaleelsedefaultLocale. This one change covers the inbox row, the request page, the generic data door's request rows and the two lifecycle refusals that name an object. Flow, step and position labels and the catalog sentences stay ont().activity-summary-message.ts):readerSummaryLocalehands the composer the object definition thattranslateObjectput in the reader's language. The object, field and select-option labels are read off that definition and no longer come fromt()keys. The writer's stored sentence is unchanged, because its locale already reads only authored labels.getLocales()/getTranslations()) no longer gets these labels translated throught(): the authored text stands. Every service the platform ships implements both.Tests
engine-label-source-locale.test.ts: new top-level describe for the authored rule message undersourceLocale: 'en'/defaultLocale: 'zh-CN'. Anenwrite reads the authored sentence. Controls: azh-CNwrite reads the zh-CN row, and with nosourceLocaleanenwrite walks to the zh-CN row.validation/rule-validator.test.ts(i18n: three authored display surfaces have no bundle key at all (bulk-action defs, custom validation messages, dataset labels) #14253 and D9.2a describes) moved fromtranslatedoubles tolabelTranslation. The first case wires at()decoy beside it, so a regression back tot()turns it red.engine-validation-locale-negotiation.test.tsandengine-validation-tenant-rewrite.test.ts: the served-adapter doubles gaingetTranslations/getFallbackLocale, whichFileI18nAdapterhas. The threet()-locale probes in the negotiation suite now trip a built-inmax_lengthmessage, the sentence thet()bridge still carries.reader-locale-labels.test.tsand plugin-auditactivity-summary-message.test.ts: a new[#35384]describe in each. Each covers the real in-memory service and the served-adapter shape, and asserts thatt()itself answers the zh-CN row at the same service, so the defect's precondition is measured and not assumed. Also covered: the two controls, at()-only service, and a throwinggetTranslations./meta's half of the same scenario is pinned inpackages/rest/src/meta-i18n-declared-fallback-chain.test.ts§6.Acceptance notes
approval-notification-text.tssubjectParams,{ key: objects.OBJECT.label, fallback }). It is resolved at delivery bypackages/services/service-messaging/src/notification-text.ts(renderWith:lookup(i18n, param.key, locale) ?? param.fallback, throught()). The producer holds no recipient locale at emit, so it cannot hand over a resolved label. The only messaging fix would parse the key shape inside the per-delivery param resolver that every producer's keyed params share, which goes past the narrow widening the area allowed. Routed (seat): this is the i18n: approval and audit texts still read object and option labels through t(), so a declared i18n.sourceLocale reader is shown the defaultLocale row (follow-up to #34030) #35384 remainder, released back topm:queueon merge as a typed object-label param inNotificationTextKeysthat service-messaging resolves throughtranslateObject(domain:server), together withreaderLabelsFor's flow, step and position labels.translateObjectthe metadata route's resolve options but not its packaged base. plugin-approvalsobjectLabelpasses{ name }alone, and plugin-audittranslatedObjectDefpasses nopackagedBase. So for a renamed object (a served label that diverged from the packaged one) they read the translation of the old label, where/metaserves the rename. This is not a regression:t('objects.<o>.label')did the same. The fix is thegetPackagedObjectBaseread fix(share-links): the share page names the object by its label and leaves off hidden fields #36460 threads for the share-link label. Until then, the docblocks' "as/metaresolves it" holds for the resolve options only.en-USundersourceLocale: 'en'./metahandstranslateObjectthe request tag as written. objectql (i18n: validation and refusal messages read field, option and object labels through t(), so a declared i18n.sourceLocale request still names the field with the defaultLocale row #34030) and now these readers hand it the tag negotiated against the service's locales. When the service holds anenlocale (anyencatalog), anen-USrequest gets客户(the defaultLocale row) from/metaandAccountfrom objectql. With noenlocale held, both give客户. Reading taken withtranslateObjectfrom this branch's@objectstack/specdist at c0111e2. Raised as a decision; not changed here. Filed: rest: /meta does not negotiate the request locale, so en-US reads the default locale while other readers read en #36466 (/metanegotiates the request locale first; no spec change).metaTranslateOptionsis not a dependency, and objectql'slabelTranslationOfis private. So each plugin carries the same few lines that plugin-security and objectql inlined in i18n: validation and refusal messages read field, option and object labels through t(), so a declared i18n.sourceLocale request still names the field with the defaultLocale row #34030, with a docblock namingmetaTranslateOptions. Filed: spec: one exported builder for the translateObject options /meta uses, instead of nine inline copies #36467 (one exported spec builder, contract tier).Verification
Two-minute check:
pnpm --filter @objectstack/plugin-approvals exec vitest run --maxWorkers=2 src/reader-locale-labels.test.ts. Expect every case to pass, including[#35384] … an en reader picks no defaultLocale row.Read first:
packages/plugins/plugin-audit/src/activity-summary-message.ts, thereaderSummaryLocale/translatedObjectDefhunk (the reader's definitions are now the translated ones).packages/objectql/src/validation/rule-validator.ts, theauthoredRuleMessagehunk.packages/plugins/plugin-approvals/src/reader-locale-labels.ts, theobjectLabelhunk.Test readings (b815112 unless stated; fix round at final head 67d23af first)
packages/services/service-automation/src/flow-write-refusal-locale.integration.test.ts, whose i18n double held the rule message only as at()key, so the bundle read now returned the authored English). The double's zh-CN bundle gainsobjects.crm_deal._validations.amount_not_negative.message. It is a fixture change of spelling only: no assertion changed and nothing was skipped. In that file, Tests 8 passed (8).@objectstack/service-automation290/290 files, 4222/4222 tests.@objectstack/plugin-approvals126/126 files, 1853/1853.@objectstack/plugin-audit109/109 files, 1800/1800. Lock VERDICT command-exit 0. overlap-check at 67d23af is clean. A sweep of the other tests that combine validations, an i18n service and a non-en locale found no further consumer.pnpm --filter @objectstack/objectql testat 8be4929 (objectql is unchanged after it): Test Files 628 passed (628), Tests 14286 passed (14286); lock VERDICT command-exit 0.pnpm --filter @objectstack/plugin-audit testat b61713e: 107/109 files, 1798/1800 tests. Two failures: the new pin's expected list wording, and the bare-string option case (triaged below). After the fix, those two files at b815112: Tests 31 passed (31).pnpm --filter @objectstack/plugin-approvals testat b61713e: 125/126 files, 1846/1853 tests. Seven failures, all inrecord-lock-user-facing-message.test.ts, whose doubles answered labels throught()only. After those doubles gainedgetTranslations, that file andreader-locale-labels.test.tsat b815112: Tests 41 passed (41).ObjectLikeannotation.options: ['p1', 'p2']is not aSelectOptionSchema(strict object withlabel).translateObject, and so/meta, serves it as written. The plugin-audit: select option labels insys_activity.summaryare never localized — the same defect class as #7230, one line over indisplayFieldValue#7289 case now pinsp1as/metaserves it, where it used to pin thet()row.Reverse verification (each fixed source file put back to origin/main, its pins run, then restored)
At b61713e, under one lock call, the scratch script used
git restore --source=BASE(tree only), checked the BASE blob hash on disk, thengit checkout HEAD --and checked the HEAD blob hash. Pins resolvesrc/directly, so no dist step is involved.rule-validator.tsat BASE:engine-label-source-locale.test.ts1 failed / 8 (an en write reads the authored English sentence).reader-locale-labels.tsat BASE:reader-locale-labels.test.ts4 failed / 22 (bothen reader picks no defaultLocale rowcases, the inbox-row case, and thet()-only case).activity-summary-message.tsat BASE:activity-summary-message.test.ts4 failed / 18 (bothen readercases, thet()-only case, and the throwing-translations case).git diff HEADwas empty.Gates
node scripts/pm/dispatch-gates.mjs --commandsderived 74 families; reconciliation with--ranreported 74 derived, 74 run.check:type-check-debt(a PREREQUISITE exit 3 on the first pass, while a sibling build held dist),check:type-check-coverage,check:cross-package-test-inputs,check:test-source-alias,check:undeclared-dep-imports,check:nul-bytes,check:engine-double-contract,check:doc-authoring,check:issue-citations.check:i18n(needs the built CLI closure),check:dual-build-cjs-loads(needs a full build), andcheck-plugin-teardown-shape --self-test(needs a commit this shallow clone does not have).overlap-check --branch=HEAD: clean against origin/main and feat(audit): the activity stream shows each changed field's old → new values by default, served only for fields the reader may read #36399.Generated by Claude Code