Skip to content

fix(i18n): approval step label and approval notification object label read as /meta serves them - #36620

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-xn01j3
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-xn01j3

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

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 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 #36464 and #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 spec: one exported builder for the translateObject options /meta uses, instead of nine inline copies #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 #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

Readings
  • 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 #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 [#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 #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 [#35384] cases).

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

… 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>
@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 23, 2026
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/plugin-approvals, @objectstack/service-messaging, @objectstack/spec, touching 35 documentable anchor(s). ⚠️ 4 changed file(s) yielded no anchor (packages/services/service-messaging/src/index.ts, packages/spec/api-surface/system.json, packages/spec/export-origins/system.json, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

20 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 27895d7ff60b64b30e48cbecdc35889b50c3096a.

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

What this run could not see
  • 4 changed file(s) yielded no anchor (packages/services/service-messaging/src/index.ts, packages/spec/api-surface/system.json, packages/spec/export-origins/system.json, …) — pages documenting those are invisible to this run
  • 4 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 — 176 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 27895d7ff60b64b30e48cbecdc35889b50c3096a → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 83426b7b126c7371c05408aa1d6c3b6ee3ff0564 — the merge of head cfce553f641ece82053a0eb1997a8958accecdd2 into base 27895d7ff60b64b30e48cbecdc35889b50c3096a, 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 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

⚠️ 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 27895d7ff60b64b30e48cbecdc35889b50c3096a → 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

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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih

Contract-review-claim: session_01ADHkmT4eA4YqtxfiPyLPih · head cfce553 · 2026-11-23T04:54Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmQNmyLgnBbCoc2iFjL

席位核对

ACCEPT — PR #36620 @ cfce553f641ece82053a0eb1997a8958accecdd2 · card #35384 (remainder: item 1 and the approval step label) · L1 by the seat's card thread · 2026-11-23T04:54Z

  • Shape (l1-face --pr 36620): draft, base main, first line Fixes #35384. Fixes is right: items 2–3 landed in PR fix(approvals,audit): flow and position labels, and a renamed object's label, read as the metadata translators serve them #36598, item 1 of fix(objectql,approvals,audit): rule messages, approval object labels and activity-summary labels read as /meta serves them in a declared sourceLocale #36464, and this PR carries the last two (release 7082136476, partial landing 7090254542). No other card is bound. Clause-②: yes (widening) · Metadata-protocol: none; Skills-docs: not owed, present as none. One changeset covers all three published packages. Checks at this head (pr-state): 60 success · 13 expected skip · 0 failed · 0 pending; mergeable clean. The three reds on the earlier head 0b91c34 are cancelled (superseded by this push): no action.
  • Diff read: spec adds resolveFlowApprovalStepLabel(bundle, flowName, nodeId, literal?, opts?) beside resolveFlowScreenTitle. It walks localeChain(opts) over flows.<flow>.approvals.<node_id>.label, own keys only, and answers literal on a miss. translateFlow is untouched. api-surface/system.json and export-origins/system.json move by one line each. The flows.approvals.*.label liveness evidence now cites the resolver. service-messaging accepts { object, fallback } (NotificationObjectLabelParam, re-exported): a closed member set, and the API name checked against one catalog-key segment. A mixed { object, key } shape is refused. renderWith resolves it with translateObject over getSchema(name) and registry.getPackagedObjectBase(name) off the data engine, with the /meta options (negotiated locale, declared fallback, sourceLocale else defaultLocale), built once per render and throw-safe, falling back to fallback. { key, fallback } still goes through t(), so stored rows render as before. plugin-approvals subjectParams emits the typed param and stepLabel calls the spec resolver; t() now carries catalog sentences only.
  • Seat rulings applied: option A (a spec export, not a copied locale chain). Naming 7091274184: the member is object, the type NotificationObjectLabelParam, the export resolveFlowApprovalStepLabel. The premise reading that ruled out a translateFlow overlay is in the PR body: the read points hold only process_name and current_step.
  • Tests: the service-messaging and plugin-approvals integration tests run on a real ObjectQL over SqlDriver. The spec resolver has its own cases (locale chain, authored locale, literal fallback, empty bundle, prototype keys). Five-leg ablation in the os-dev-report: 1a 5/7, 1b 1/7, 2 5/37, 3 1/5, 4 2/8 red, each restored to the HEAD blob; the rename round changes no behaviour. Suites: service-messaging 80 files / 1084, plugin-approvals 127 / 1883, spec 880 / 28058. Typecheck exit 0 across the three packages. 97/97 gate families exit 0 at this head (35384-item1-gates-ran-r2.txt, 0 NOT-MEASURED).
  • Changeset read sentence by sentence: patch for @objectstack/spec, @objectstack/service-messaging and @objectstack/plugin-approvals. The three bullets match the diff, and so does the closing upgrade-together line: an older messaging service refuses { object } at emit().
  • Accepted deviations: a t()-only i18n service (no getTranslations) gets the param's fallback (the fix(objectql,approvals,audit): rule messages, approval object labels and activity-summary labels read as /meta serves them in a declared sourceLocale #36464 precedent; getTranslations is a required II18nService member). Patch-level changesets under Metadata-protocol: none. The worktree was pushed from a local branch name, because the shared checkout holds the thread branch.
  • Out of scope: none filed; no ADR sentence to carry (0 hits in docs/adr). Security: none. spec: one exported builder for the translateObject options /meta uses, instead of nine inline copies #36467 (one options builder) is not folded in; this PR adds one more inline copy of the options, in service-messaging, and that card's census should count it.
  • Owed: an L2 contract review (Clause-②: yes: a new spec export and a widened service-messaging accept set), requested from l2-review#4 at this head. Landing goes to the seat; this thread does not land.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: cfce553f641ece82053a0eb1997a8958accecdd2
Local-runs: none
Scope: packages/spec/src/system/i18n-resolver.ts + packages/services/service-messaging/src/notification-text.ts, packages/services/service-messaging/src/index.ts, packages/plugins/plugin-approvals/src/approval-notification-text.ts, packages/plugins/plugin-approvals/src/reader-locale-labels.ts

PR #36620 (card #35384), net diff against merge base c6075a78, 14 files. Read: the card body and all 16 comments, the PR body and its 4 comments, the net diff of the five scope files plus the changeset and the three spec baselines, and the check-runs on this head (73 runs: 60 success, 13 skipped, 0 failed, 0 pending; Test Core, Test UI, Build Core, Lint and Repo Gates, TypeScript Type Check, Type Check UI, Check Changeset, Spec property liveness, Governed Surface Queue Guard all success). Tests, the three generated baselines and the changeset prose are the lane's ACCEPT; the changeset is read for ② only.

① Derived judgments

  • New spec export resolveFlowApprovalStepLabel(bundle, flowName, nodeId, literal?, opts?) from @objectstack/spec/system: a public-surface widening, additive. api-surface/system.json and export-origins/system.json each gain exactly that one row. Right.
  • translateFlow, translateObject, ResolveOptions, localeChain and pickData are untouched; no existing spec export changes meaning. Right.
  • service-messaging accept set: NotificationTextKeys.params values widen from string | { key, fallback } to also { object, fallback }. problemOf admits the new arm with a closed member set and refuses { object, fallback, key }, a non-string fallback, and an object that is not one identifier segment. The { key, fallback } arm is byte-for-byte the same judgement as on main. Widening only. Right.
  • OBJECT_NAME_SHAPE ([A-Za-z0-9_-]+) against real object API names: ObjectSchema.name on this head is ^[a-z_][a-z0-9_]*$ (packages/spec/src/data/object.zod.ts:4056), a strict subset, so no authorable object name is refused. An object name carries no dot, so nothing the old objects.NAME.label key could spell is lost. Right.
  • service-messaging exported types: NotificationObjectLabelParam is newly exported from the package index, NotificationTextParam gains a union arm, and NotificationTextI18n gains four optional members (getTranslations, getFallbackLocale, getSourceLocale, getDefaultLocale). All additive; the optional members are not named in the changeset, which is acceptable for optional structural members a real II18nService already has. Right.
  • Stored-row compatibility, both directions. A row written by this head with { object, fallback } and read by an older readNotificationTextKeys: the older problemOf reports an undeclared member, the reader returns no keys, and the stored literal is delivered (graceful). A row written by an older emitter with { key, fallback } and read by this head: unchanged t() path. Right.
  • Version skew: a new plugin-approvals over an older messaging service is refused at emit(); ApprovalService.notify catches and warns (approval-service.ts near 2586), so an approval never fails, the notification is lost. All three packages are in the one changeset fixed group (.changeset/config.json), so they version together, and the changeset states the upgrade-together rule. Right.
  • plugin-approvals: ApprovalTextParam, ApprovalObjectLabelParam and ApprovalSubjectParams are module-level types not re-exported from the package index and have no consumer outside the package (git grep over packages, ui, examples). No published surface moves there. Right.
  • Liveness row flows.approvals.label re-anchors its evidence on the spec resolver; the gate Spec property liveness is success on this head.

② Semver level

Clause-②: yes (widening) — present line-initial in the PR body and in the changeset body, with Metadata-protocol: none beside it in both. Confirmed against the diff: one new spec export and one widened service-messaging accept set, no narrowing arm anywhere.

Metadata-protocol: none holds: nothing a metadata author can write changes. The translation key flows.FLOW.approvals.NODE_ID.label was already declared in translation.zod.ts; the notification param is a runtime producer contract, not authored metadata. Under AGENTS.md Post-Task step 3 the kind none takes patch, and a non-protocol widening ships patch. The changeset carries patch on @objectstack/spec, @objectstack/service-messaging and @objectstack/plugin-approvals, the three packages the diff moves. Check Changeset is success on this head. The level is right.

③ Boundary flags

  • Dev deviation, export choice: seat ruling 7090334812 preferred an overlay inside translateFlow, conditional on the read point holding the flow document. Verified in the tree: localizeRequestLabels reads only process_name and current_step off the row, and flowLabel hands translateFlow a name-only stub. The premise fails as the dev measured, and seat ruling 7091274184 item 1 accepts resolveFlowApprovalStepLabel. Answered.
  • Seat ruling 7091274184 item 2, member object, type NotificationObjectLabelParam: applied. No stale objectLabel spelling of the param remains in shipped code, docblocks, validator messages, tests under service-messaging/src, or the changeset. The remaining hits are the renderer's private method objectLabel(...) and the subjectParams(objectName, objectLabel, record) parameter, which does hold a label. Answered.
  • Dev deviation, patch not minor: right, see ②.
  • Dev deviation, a t()-only i18n double receives the param's fallback: accepted. II18nService.getTranslations and getLocales are required members of the contract, and the fallback is the schema label the producer already holds.
  • Dev deviation, forced test edits and the worktree branch name: lane matters, no contract effect.
  • open_questions: none in the two reports on this PR. Earlier ones are carried by rest: /meta does not negotiate the request locale, so en-US reads the default locale while other readers read en #36466 (landed: /meta now negotiates the request locale, read on main) and spec: one exported builder for the translateObject options /meta uses, instead of nine inline copies #36467 (one options builder; this PR adds one more inlined copy in service-messaging, already noted for that card's census by the L1 comment).
  • SQL push-down (Prime Directive 5): no new query, id materialisation or in-app join. The object-label path reads the in-memory registry (getSchema is registry.getObject; registry.getPackagedObjectBase) and the i18n service's in-memory maps; the only database read on the render path is the existing one sys_user locale read per recipient. No N+1 against a store. Nothing to flag.
  • Security: the label of an object was already carried to every recipient as the param's fallback and through t(); resolving it through the registry exposes nothing new. No finding.

④ Design judgment

No must-fix, no should-fix.

packages/spec/src/system/i18n-resolver.ts (hits), against seat rulings 7090334812 and 7091274184 and its first consumer reader-locale-labels.ts:

  • Key shape flows[flowName].approvals[nodeId].label matches translation.zod.ts (the approvals group, addressed by FlowNode.id at any depth), the lint rung in validate-translation-references.ts (approval node ids, any depth) and the UI reader ui/packages/i18n/src/flowLabels.ts.
  • Locale chain is localeChain(opts) through pickData, the same pair lookupFlowLabel and lookupFlowScreenCopy use: requested locale, then the declared chain, skipped when the requested locale is the authored one. The docblock says exactly this.
  • Own-key guard on the node id is real (hasOwnProperty on the approvals map); a flow name such as constructor reaches a function whose approvals is undefined and is skipped. An empty-string entry is skipped and the walk continues, as the sibling lookups do. literal (here none) answers a miss.
  • Row shape verified: openNodeRequest stores current_step: input.nodeId and snapshots the node label as current_step_label; flowNameOfProcess strips the flow: prefix. Node ids are unique across a flow at every depth (flow.zod.ts refuses a duplicate id by location), so a region's approval node cannot collide.
  • The docblock's reason for not folding into translateFlow agrees with translateFlow's own docblock (the node label is not overlaid).

packages/services/service-messaging/src/notification-text.ts, sentence by sentence against "resolved as GET /meta/object/:name serves it" (packages/rest/src/meta-item-read-gate.ts on main):

  • Options: metaLabelTranslation builds the bundle as translationBundleOf does and the options as metaTranslateOptions does (negotiated locale via resolveBundleLocale over getLocales(), [getFallbackLocale()], getSourceLocale() else getDefaultLocale()). Since rest: /meta does not negotiate the request locale, so en-US reads the default locale while other readers read en #36466 the meta door negotiates the same way, so an en-US recipient and an en-US request agree.
  • Packaged base: registry.getPackagedObjectBase(name) is the body the protocol accessor reads (protocol-discovery-and-bases.ts:851).
  • Pair bundle: none is passed, and none is owed. servedOverrideBaseOf answers undefined for type object (extended, never replaced, ADR-0146 D10; table in served-override.ts), so the meta door hands the object translator no pairBundle either. patchBundles feed field slots only and cannot move the object label.
  • Label rule: translateObject decides label from doc.label, packagedBase.label, the bundle and the options alone, so the { name, label } stub is sufficient input for the label.
  • Served definition: getSchema is registry.getObject, the fold /meta serves for a code extension's rename, and stored object rows are registered into the same registry at hydration. This is the same source reader-locale-labels.ts reads since fix(approvals,audit): flow and position labels, and a renamed object's label, read as the metadata translators serve them #36598.
  • Throw safety: every read is wrapped; a failure yields the param's fallback, never a lost delivery. The validator and the renderer agree on the discriminant ('object' in param).

packages/services/service-messaging/src/index.ts: one type re-export, matching the changeset.

packages/plugins/plugin-approvals/src/approval-notification-text.ts: subjectParams emits { object: objectName, fallback }; interpolate still renders the literal from fallback for every non-string param, so the stored literal text is unchanged. The docblock agrees with the code.

packages/plugins/plugin-approvals/src/reader-locale-labels.ts: stepLabel resolves through the spec resolver with the options already built once per read, memoised per flow and node; no flow document is read per row, and attachFlowSteps shares the same pick. t() now carries catalog sentences only, as the module docblock says.

N1 (nit) — The changeset calls the new export "the one reading of" the key, while ui/packages/i18n/src/flowLabels.ts (outside the diff) still reads bundle[language].flows[flow].approvals[id].label directly, with no locale chain. The spec docblock and the plugin docblock say "the spec's one reading", which is accurate. Left as a follow-up: the UI reader could adopt the resolver; no effect on this PR's contract.

N2 (nit) — renderWith builds the locale bundle once per rendered item, so a digest of M items for one recipient builds it M times (in-memory map reads only, no store read). The docblock's "once" is per render, which is what the code does. Left as an accepted deviation; hoisting to renderAllFor can ride #36467.

N3 (nit) — packagedBaseOf in messaging has no getPackagedObjectOwner(name)?.definition fallback for a registry that predates getPackagedObjectBase, which the protocol accessor keeps. It answers "no baseline known" there, the same as the approvals reader merged in #36598. Left as an accepted deviation.

Implemented-by: claude/project-thread-xn01j3
Reviewed-by: session_01ADHkmT4eA4YqtxfiPyLPih

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY

维护者速读

  • 改了什么:审批步骤名、审批通知里的对象名按用户语言显示(和 /meta 读到的一致),不再固定原文。
  • 风险:非受管面,707 行;spec 只加导出(widening),名字席位已定(7090334812、7091274184)。
  • 要你做什么:无,席位落地。

ACCEPT → PR #36620 comment 7091970619 · Contract review PASS → comment 7092046163 · Head-sha cfce553f641ece82053a0eb1997a8958accecdd2 · check-runs 60 success, 13 skipped, 0 failed · check-governed-merges --pr 36620: not governed.

Review nits: N1 (console flowLabels.ts reads the step-label key without the locale chain) → #36633; N2 (digest rebuilds the bundle per item) rides #36467; N3 (no old-registry fallback in messaging) accepted, as on #36598.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 23, 2026 05:02
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 45115439638 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test UI (13/16) — 失败步骤: Run the ui tests (shard 13/16)

    × leaving the Actions tab keeps the hold, and the held line names the action 1100ms
    × "Show me" reopens the action with its text, and fixing it there releases the hold 4074ms
    FAIL   dom  packages/app-shell/src/views/studio-design/DataPillar.panelHold-27629.test.tsx > DataPillar — an action predicate that does not parse holds with the draft (objectstack#27629) > leaving the
      ↳ 失败原因: AssertionError: expected "vi.fn()" to not be called at all, but actually been called 1 times
    FAIL   dom  packages/app-shell/src/views/studio-design/DataPillar.panelHold-27629.test.tsx > DataPillar — an action predicate that does not parse holds with the draft (objectstack#27629) > "Show me" r
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 11 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

Merged via the queue into main with commit 99ece3c Nov 23, 2026
74 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-xn01j3 branch November 23, 2026 05:53
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

2 participants