Skip to content

fix(approvals,audit): flow and position labels, and a renamed object's label, read as the metadata translators serve them - #36598

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-35384-approval-labels-remainder
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-35384-approval-labels-remainder

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Part of #35384

Clause-②: no
Metadata-protocol: none

维护者速读

  • 应用以英文编写、默认给用户中文的部署里,英文读者在审批收件箱、审批详情和时间线上看到的流程名与岗位名,从中文改回作者写的英文;被代码扩展改过名的对象,在审批和动态摘要里也显示新名字,与元数据接口一致。
  • 属于「标签按读者语言显示」的收尾工作,替英文读者和改过对象名的应用解决「看到默认语言或旧名字」的问题。
  • 出错时读者看到的是改动前的标签(中文或旧对象名),不影响数据,可直接撤回本改动。
  • 请决定审批步骤名是否另开一张卡:它暂时仍走旧的查词方式,需要规范包新增一个读取函数。

What changes

This is stage 2 of #35384: items 2 and 3 of the remainder in release comment 7082136476. Item 1 (the approval notification subject param in service-messaging) is not in this PR, and neither is the approval STEP label (see Acceptance notes). That is why this PR says Part of.

  • Item 2: flow and position labels in the approvals door (plugin-approvals/src/reader-locale-labels.ts). readerLabelsFor().flowLabel and .positionLabel no longer go through t(), which falls back to the defaultLocale row. Each now uses the spec translator for its type, over every locale the i18n service holds, with the resolve options the metadata route builds (the reader's negotiated locale, the declared fallback chain, and the authored language: sourceLocale, else defaultLocale):
    • position: translatePosition, which GET /meta/position serves through translateMetadataDocument;
    • flow: translateFlow. /meta serves a flow document untranslated: translateFlow is deliberately not in the dispatch table, and the flow runner applies it on the client. So translateFlow is the spec's one reading of flows.FLOW.label.
    • Callers that pick these up with no change: the inbox, the request page, the generic data door's request rows (reader-locale-labels-middleware.ts), and timeline position notes.
  • Item 3: a renamed packaged object. objectLabel (approvals) and translatedObjectDef (audit) now give translateObject the object's served definition and its packaged base as packagedBase. The base comes from the engine's registry (registry.getPackagedObjectBase(name)). That is the same body the metadata protocol's getPackagedObjectBase reads (engine.registry), and the protocol accessor is how /meta and fix(share-links): the share page names the object by its label and leaves off hidden fields #36460's share-link label get packagedBase.
    • approvals: readerLabelsFor takes an optional third argument, ReaderObjectSource (getSchema, registry). ApprovalService.readerLabels and the two lock-refusal sentences in lifecycle-hooks.ts pass the engine they already hold.
    • audit: installActivitySummaryLocale reads the base off the engine it is installed on, and readerSummaryLocale takes an optional getPackagedObjectBase.
  • No public surface moves. The changed functions and types are internal modules, not exported from either package's index. ApprovalServiceOptions and ApprovalEngine are unchanged. Nothing under packages/spec/src/** or packages/services/service-messaging/** is edited.

Tests

  • reader-locale-labels.test.ts (the shared harness), two new top-level describes:
    • Flow and position labels in a sourceLocale: 'en' / defaultLocale: 'zh-CN' deployment with an en pack. First the precondition: t() gives an en reader the zh-CN rows. Then en and en-US readers pick nothing, so the authored snapshot stands. A pin measures that en-US is negotiated to en. Controls: a zh-CN reader, an en pack entry, no sourceLocale declared, a t()-only service, and one bundle per read.
    • A renamed packaged object over a real SchemaRegistry (a packaged Opportunity that an extension renames Deal). en, en-US and zh-CN readers read Deal, and so does the oracle translateMetadataDocument('object', served, bundle, {...options, packagedBase}). Controls: an unrenamed object, a registry that throws, and a getSchema that throws.
    • Fixture triage (change of spelling): two older #24863 cases that used a t()-only double for flowLabel now ask stepLabel, the one label still on t().
  • activity-summary-message.test.ts: a new top-level describe drives the installed sys_activity middleware over a real SchemaRegistry. en, en-US and zh-CN readers get Deal, and the zh-CN field label still translates. Controls: an unrenamed object, and a registry whose base read throws.
Readings at head 0e31535
  • pnpm --filter @objectstack/plugin-approvals test: Test Files 127 passed (127), Tests 1880 passed (1880).
  • pnpm --filter @objectstack/plugin-audit test: Test Files 109 passed (109), Tests 1821 passed (1821).
  • pnpm --filter @objectstack/plugin-approvals --filter @objectstack/plugin-audit typecheck (tsc, scripts tsconfig, check:test-typecheck): lock VERDICT command-exit 0.
  • Ablation. One lock call, scripts/ablation-replace.mjs per leg, plus a trap restore. The subject resolves from src/ (relative import), so there is no dist leg.
    • leg 1, approvals objectLabel without packagedBase: 3 failed / 37 (the en, en-US and zh-CN rename cases).
    • leg 2, flowLabel back on t(): 3 failed / 37 (the en and en-US authored cases, and the t()-only case).
    • leg 3, positionLabel back on t(): 3 failed / 37 (the same three).
    • leg 4, audit translatedObjectDef without packagedBase: 3 failed / 24 (the en, en-US and zh-CN rename cases).
    • Each leg: anchor x1 to x0 on disk, then restored with blob equal to HEAD. Final hashes match HEAD, and git diff HEAD is empty.
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack @0e315358fa: 72 families. 70 exit 0. 2 NOT MEASURED (exit 3, PREREQUISITE NOT MET): check:dual-build-cjs-loads (needs a full build) and check:i18n (needs the built CLI closure); CI runs both. --ran: 72 derived, 70 run, 2 NOT-MEASURED, 0 UNRUN.
  • node scripts/pm/overlap-check.mjs --branch=HEAD @0e315358fa: VERDICT clean exit 0.

Acceptance notes

  • The approval step label (flows.FLOW.approvals.NODE.label) is still read through t(). No spec translator reads that key: translateFlow overlays the flow label, the toasts and screen copy only. Reading the bundle along the locale chain inside plugin-approvals would be a second resolver beside localeChain. A spec export would widen @objectstack/spec, which this slice may not do. So an en reader in such a deployment still sees the zh-CN step label next to the authored flow label. The fork goes to the seat as an open question in the report.
  • PM mechanism assumption, measured: /meta does not translate flows. GET /meta/flow serves the authored document, so the flow side uses translateFlow (the same translator, with the same resolve options), not a /meta read.
  • The packaged base comes from the engine's registry, not from the protocol service. It is the same body, the engine is already in hand at every caller, and ApprovalServiceOptions stays unchanged.
  • File surface: approval-service.ts (one argument) and lifecycle-hooks.ts (two arguments) are beyond the claim's listed files. They are the callers that hand objectLabel its engine.

Verification

Read first, by risk:

  1. packages/plugins/plugin-approvals/src/reader-locale-labels.ts: the readerLabelsFor body (translated, flowLabel, positionLabel, objectLabel).
  2. packages/plugins/plugin-audit/src/activity-summary-message.ts: translatedObjectDef and packagedObjectBaseReader.
  3. packages/plugins/plugin-approvals/src/lifecycle-hooks.ts: the two readerLabelsFor(service, locale, engine) calls.

Two-minute check: pnpm --filter @objectstack/plugin-approvals exec vitest run src/reader-locale-labels.test.ts should report 37 passed. The [#35384] describes cover en and en-US readers with authored flow and position labels, and the rename Deal in every locale.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmPTDM2MxHR8cvoMVUX

… label read as /meta serves them

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmPTDM2MxHR8cvoMVUX
…ls against the metadata translators

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

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/plugin-approvals, @objectstack/plugin-audit, touching 21 documentable anchor(s).

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

  • content/docs/ai/connect-mcp.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/api/wire-format.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/automation/approvals.mdx (via ApprovalService (symbol, a top-level class), /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/automation/flows.mdx (via ApprovalService (symbol, a top-level class))
  • content/docs/concepts/architecture.mdx (via getSchema (symbol, a method of interface ReaderObjectSource))
  • content/docs/concepts/metadata-lifecycle.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/data-modeling/currency.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/data-modeling/formulas.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/deployment/production-readiness.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/permissions/system-context.mdx (via bindApprovalLockHook (symbol, a top-level function), bindDetailRowLockHook (symbol, a top-level function), installActivitySummaryLocale (symbol, a top-level function))
  • content/docs/protocol/kernel/http-protocol.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/protocol/objectql/state-machine.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/ui/forms.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))

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

  • content/docs/releases/v17/17-0.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/releases/v17/17-1.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/releases/v17/17-6.mdx (via ApprovalService (symbol, a top-level class))
  • content/docs/releases/v17/17-7.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/releases/v18/18-1.mdx (via ApprovalService (symbol, a top-level class))

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

What this run could not see
  • 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 — 15 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 79d9c1435586d9b411b51a0ac395ea0c23dc3ddc → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 3e18145daca12e04b011a88f51f9d84c2dff0649 — the merge of head 0e315358fad43d34606a19ccb26b064a8c3ad684 into base 79d9c1435586d9b411b51a0ac395ea0c23dc3ddc, 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 3e18145daca12e04b011a88f51f9d84c2dff0649 && git checkout 3e18145daca12e04b011a88f51f9d84c2dff0649
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 79d9c1435586d9b411b51a0ac395ea0c23dc3ddc 0e315358fad43d34606a19ccb26b064a8c3ad684 && git checkout -B drift-repro 79d9c1435586d9b411b51a0ac395ea0c23dc3ddc && git merge --no-ff 0e315358fad43d34606a19ccb26b064a8c3ad684

node scripts/docs-audit/affected-docs.mjs --json 79d9c1435586d9b411b51a0ac395ea0c23dc3ddc

⚠️ 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 79d9c1435586d9b411b51a0ac395ea0c23dc3ddc → 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#2 · os-steve · session_01ADHkmPTDM2MxHR8cvoMVUX

席位核对

ACCEPT — PR #36598 @ 0e315358fad43d34606a19ccb26b064a8c3ad684 · card #35384 (items 2–3) · L1 by area s2-E · 2026-11-23T02:22Z

  • Shape (l1-face --pr 36598, CLEAN, 13 items): draft, base main, Part of #35384 (item 1 and the approval step label are left for the seat's card thread, so Part of is right); no other card bound; Clause-②: no · Metadata-protocol: none; changesets for @objectstack/plugin-approvals and @objectstack/plugin-audit; checks at this head 37 success · 16 expected skip · 0 failed · 0 pending; mergeable clean.
  • Diff read: readerLabelsFor now resolves flowLabel / positionLabel through spec's translateFlow / translatePosition over every held locale with the /meta resolve options (shared metaLabelTranslation, memoised, throw-safe); objectLabel hands translateObject the served definition (getSchema) and packagedBase (registry.getPackagedObjectBase, the reader objectql's engine-validation-messages already uses). Callers pass the engine (approval-service.ts readerLabels, both lock-hook refusals in lifecycle-hooks.ts). Audit readerSummaryLocale takes an optional packaged-base reader, wired from installActivitySummaryLocale. The step label stays on t() (declared in the changeset). No package-index export changes: neither module is re-exported.
  • Tests: approvals pins assert the defect precondition (t() answers en with the zh-CN rows), en/en-US reading authored flow and position labels, zh-CN control, en-pack control, no-sourceLocale control, once-per-read; rename pins assert the served Deal vs packaged Opportunity fixture, en/en-US/zh-CN reading Deal on the label and the served row, unrenamed and throwing-registry controls; audit pins the same for summaries (Created Deal "Acme", 创建了 Deal "Acme", field label still 金额). Four-leg ablation in the os-dev-report: each leg 3 red, restored to HEAD blob. Suites: approvals 127 files / 1880, audit 109 files / 1821.
  • Changeset read sentence by sentence: both packages patch; the three paragraphs match the diff, including the step-label carve-out.
  • Accepted deviations: approval-service.ts and lifecycle-hooks.ts outside the claim's listed files (they are the callers that hand the engine; not reachable otherwise); packaged base read off the engine registry rather than the protocol service (avoids widening exported ApprovalServiceOptions); check:dual-build-cjs-loads and check:i18n NOT MEASURED locally (exit 3), green in CI.
  • Out of scope: the step label, routed to the seat (option A, spec export, Clause-②: yes). Security: none. No contract face ⇒ no L2 owed.
  • Landing: not governed, 527 changed lines ≤ 3000 ⇒ area s2-E lands it; card 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 keeps pm:dispatched for the seat's item-1 thread.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmPTDM2MxHR8cvoMVUX

Landing — PR #36598 @ 0e315358fad43d34606a19ccb26b064a8c3ad684 · area s2-E · 2026-11-23T02:23Z

probe reading
check-governed-merges --pr 36598 NOT governed · 527 changed lines ≤ 3000
landing-k --pr 36598 K = 6 < 15 · no new locale pack under a label PR · no shared book moved

State: undraft + auto-merge through the queue; Part of #35384, so the card stays open with pm:dispatched for the seat's item-1 thread (item 1 + approval step label).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 23, 2026 02:23
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit aff34ba Nov 23, 2026
54 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-35384-approval-labels-remainder branch November 23, 2026 02:49
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
… 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/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