Repository navigation
feat(i18n): console flow labels follow the server's declared fallback chain - #36916
Conversation
… chain GET /i18n/locales names the declared chain (fallbackChain, from getFallbackLocale()); the console loader fetches the fallback locales' flows groups and the flow-label readers hand the spec resolvers the same fallbackChain and defaultLocale the server does. Claude-Session: https://claude.ai/code/session_01WGufzh1FMUQYf1PcEunaaK Co-Authored-By: Claude <noreply@anthropic.com>
… GetLocalesResponse.fallbackChain Claude-Session: https://claude.ai/code/session_01WGufzh1FMUQYf1PcEunaaK Co-Authored-By: Claude <noreply@anthropic.com>
…llbackLocale() Claude-Session: https://claude.ai/code/session_01WGufzh1FMUQYf1PcEunaaK Co-Authored-By: Claude <noreply@anthropic.com>
…ow-label readers and runner Claude-Session: https://claude.ai/code/session_01WGufzh1FMUQYf1PcEunaaK Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzh1FMUQYf1PcEunaaK Co-Authored-By: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 180 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 afe2101d716a0b9211a0f8c6d1195dcf7c2d424e && git checkout afe2101d716a0b9211a0f8c6d1195dcf7c2d424e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3f568c1a405854f99dc79f104b5dd89b61819d6d ee54ef8c65b4314ed1e3bcdf896ca146297d8ce0 && git checkout -B drift-repro 3f568c1a405854f99dc79f104b5dd89b61819d6d && git merge --no-ff ee54ef8c65b4314ed1e3bcdf896ca146297d8ce0
node scripts/docs-audit/affected-docs.mjs --json 3f568c1a405854f99dc79f104b5dd89b61819d6d
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzgv4KRPATgwPAzKKMU Contract-review-claim: session_01WGufzgv4KRPATgwPAzKKMU · head b276ff4 · 2026-11-24T09:14Z |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgv4KRPATgwPAzKKMU Contract reviewServed-tier: Read: card #36809 with all 7 comments (triage, both claims, the blocked reading 7124251692, the Release, seat route A 7124316383, the done report 7127078995), the PR body, the net diff ① Derived judgments
② Semver levelClause-②: yes (widening) — present on the PR body and in the changeset, and it matches the diff: one optional response member added, nothing removed or narrowed. The changeset declares ③ Boundary flags
④ Design judgment
M1 (must-fix) — the console compares its raw language tag to
N1 (nit) — "Absent when the server declares none" is looser than the tree.
Acceptance against the card: bullet 1 (declared fallback read in the console, matching the server) holds for a non-authored language; bullet 2 (no declared chain: unchanged) holds; bullet 3 (the Implemented-by: VERDICT: FAIL |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgv4KRPATgwPAzKKMU 席位核对 — REWORK · repo:objectstack#3 · head b276ff4 · 2026-11-24T09:20ZL1: REWORK Read
Checklist
Findings
DeltaThe M1 fix moves the head, so it owes a delta L1 and a delta L2 on the new head. S1 is closed by the amendment alone. |
…es before the authored check The server negotiates a request's tag against getLocales() before it resolves; the console now does the same against /i18n/locales codes, so a zh-Hans or zh console on a zh-CN-authored stack walks no chain. The fallbackChain describe now says it is absent when the i18n service reports none. Claude-Session: https://claude.ai/code/session_01WGufzh1FMUQYf1PcEunaaK Co-Authored-By: Claude <noreply@anthropic.com>
…describe Claude-Session: https://claude.ai/code/session_01WGufzh1FMUQYf1PcEunaaK Co-Authored-By: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-support-ai · session_01WGufzgv4KRPATgwPAzKKMU Contract-review-claim: session_01WGufzgv4KRPATgwPAzKKMU · head ee54ef8 · 2026-11-24T10:37Z |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgv4KRPATgwPAzKKMU Contract reviewServed-tier: Delta review of record 7127267955 (head ① Derived judgments
② Semver levelClause-②: yes (widening) — unchanged on the PR body and the changeset. The delta publishes nothing new on the wire: a describe string and jsdoc on the spec, one optional type member and one widened optional parameter on ③ Boundary flags
④ Design judgmentM1: closed N1 is the describe wording of record 7127267955, which the seat's L1 lists as N2. S1 is the seat's L1 finding, closed by claim amendment 7127305468, which names No must-fix, no should-fix. How M1 closes, against the server.
The negotiated tag reaches every reader. The four call sites on this head (
Pins. The new cases use alias tags on a N3 (nit) — Acceptance against the card: all three bullets hold on this head, the alias case included. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgv4KRPATgwPAzKKMU 席位核对 — ACCEPT · repo:objectstack#3 · head ee54ef8 · 2026-11-24T10:41ZL1: ACCEPT Read
Delta checklist
FindingsNo must-fix, no should-fix.
Note to the seat
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzh1FMUQYf1PcEunaaK Landing · 2026-11-24T10:42Z · delta ACCEPT 7129123693 (L1-b) at head ee54ef8
State: ready + auto-merge (area ux-D, not governed, ≤3000 lines). |
Requested by Yibo Wang · project thread
Fixes #36809
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: none — the new member is a response field the console reads, not something a metadata author writes; no skills/ page teaches
GET /i18n/localesor how the console resolves flow labels维护者速读
What changes
Carrier:
GET /api/v1/i18n/localesgainsfallbackChain(optionalstring[]), not discoverylocale. Why this door:sourceLocale(thedefaultLocalethe server hands the resolvers), so the console reads the wholeResolveOptionsdeclaration from one answer./i18ndomain). Discovery has two (HttpDispatcherandmetadata-protocol'sgetDiscovery), and adding it to one would let two machine-readable answers about one boot disagree.II18nService.getFallbackLocale(), read with the same feature-detected accessor and the same non-empty condition asmetaTranslateOptions(@objectstack/rest) uses for every server-side metadata translation. A service with no accessor (the core in-memory provider) or an empty answer serves no member: the server threads a declaration and never invents one.Console:
ui/apps/console/src/loadLanguage.tsreads the locale list next to the active language's bundle (in parallel). If a chain is declared and the language is notsourceLocale(the resolvers skip the chain for it), it fetches each fallback locale's bundle and keeps itsflowsgroup. It lays them next to the app namespace throughwithDeclaredFlowsFallback(@object-ui/i18n). With no declared chain, the answer is exactly what it was before. A failure in either extra read gives that same answer.ui/packages/i18n/src/flowsBundle.ts:activeFlowsBundlenow also returns the fallback locales' rows. The newflowsResolveOptionsreturns{ locale, fallbackChain, defaultLocale }, the options the server passes. The newflowsLocaleChaingives the order the spec's privatelocaleChainwalks, for the keys that no spec resolver reads. The module doc now describes what the code does.flowLabels.ts(flowLabelTranslationstakes the declared options;useFlowLabelTranslationspasses them),FlowRunner.tsx(flow name, field copy per key, option labels),flow-label-translations.tsx(Studio rail) andstageChangeStarts.tsx(stage confirm) pass the options totranslateFlow/resolveFlowApprovalStepLabel/resolveFlowScreenFieldOptions.content/docs/ui/translations.mdxnow covers what the console does.content/docs/references/api/protocol.mdxis regenerated with the new member, andpackages/spec/authorable-surface/api.jsonis regenerated (the+1key is theMetadata-protocol: added).Tests
New pins (files named for this card) and runs
packages/runtime/src/domains/i18n-locales-fallback-chain-36809.test.ts: the member comes fromgetFallbackLocale()(spy called, value followed). It is absent with no accessor, anundefinedanswer, an empty answer, or the core memory provider. The body parses asGetLocalesResponseSchema.ui/packages/i18n/src/__tests__/flowLabels-fallback-chain-36809.test.ts: with a declared fallback, the console answer equals the spec resolvers' answer with the server's options (flow label, approval step) and covers the plain node and untitled screen. No chain gives the old answer. An authored-language request walks no chain. The array survives the real i18next store.flowsLocaleChainvisits the same locales as the resolvers in 5 cases.ui/apps/console/src/loadLanguage.fallbackChain-36809.test.tsx: the real loader with URL-routed fetch. A declared chain reads the fallback text and matches the server. No chain means no extra bundle read. The authored language means no fallback read. A failed locale read degrades to the old answer.ui/packages/app-shell/src/views/__tests__/FlowRunner.fallbackChain-36809.test.tsx: the runner's flow name and field label come from the fallback, and the placeholder comes from the active language.ui/apps/console/src/loadLanguage.test.tsx(the session pin now expects the locale-list read next to the bundle read, both with the bearer).Runs (head
b276ff4e):@objectstack/runtime,@objectstack/spec,@object-ui/i18n,@object-ui/plugin-detail,@object-ui/console,@object-ui/app-shell: exit 0.Ablations (one-time, restored, `git diff HEAD` empty after each)
flowsResolveOptionsforced to{ locale }(viascripts/ablation-replace.mjs, anchor 1 to 0, blob39830597tofe1e4a35): 4 of 12 tests in the i18n pin went red. Restored, blob equals HEAD.fallbackChainspread deleted frompackages/runtime/src/domains/i18n.ts(blobca4e8bddtod1a26537): 2 of 6 tests in the runtime pin went red. Restored, blob equals HEAD.src(relative imports), so no dist preflight was needed.Acceptance notes
flowsLocaleChainmirrors the spec's privatelocaleChain. A parity pin holds it equal toresolveFlowApprovalStepLabel's walk. Exporting the spec's own helper would remove the copy, but that is a public spec export outside this claim (carrier: none, noted, not filed).fallbackLocale || defaultLocale || 'en'at boot, so a file-backed stack with nofallbackLocaleserves itsdefaultLocaleas the chain. The console now follows that too, as the server does.Verification
Local gates and two-minute check
node scripts/pm/dispatch-gates.mjs --commandsderived 120 families. All 120 ran locally. 116 exited 0. 3 exited 3 (prerequisite not met, so NOT MEASURED locally; CI runs them):check-plugin-teardown-shape --self-test(shallow clone cannot reach the pinned fixture),spec check:skill-examples(needs aclient-reactbuild),check:dual-build-cjs-loads(needs a full build).pnpm --dir ui exec vitest run scripts/had one timeout under shared-box load (js-comment-mask-returns-interpolation-9424); the file passed on its own (8/8).--ranreconciliation: 120 derived, 117 run, 3 NOT-MEASURED, 0 UNRUN.pnpm --filter @objectstack/spec check:generated: 14/14 up to date after--fixregeneratedcheck:docs.overlap-check --branch: VERDICT clean (merges cleanly with origin/main and with feat(spec): serve metadata list columns on /meta/types, hook first #36881 / feat(kanban): a lane's sum, avg, min and max cover every record of the lane, computed in the query #36857, which share files).ui/apps/console/src/loadLanguage.ts(the new reads),ui/packages/i18n/src/flowsBundle.ts(the reserved tree entry and the chain walk),packages/runtime/src/domains/i18n.ts(the producer hunk).pnpm --dir ui exec vitest run packages/i18n/src/__tests__/flowLabels-fallback-chain-36809.test.tsshould report 12 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzh1FMUQYf1PcEunaaK
Fix round 1 (L1 REWORK 7127286361 / contract review FAIL 7127267955 on b276ff4 → ee54ef8)
ui/apps/console/src/loadLanguage.tsnegotiates the console language against the same/i18n/localesanswer'slocales[].code(resolveLocaleAmong(lang, codes) ?? lang, the matchingnegotiatedTranslationLocaleruns) before the authored-language check, before the fallback filter and before the resolvers; the negotiated tag ridesDeclaredFlowsFallback.locale,flowsResolveOptionspasses it aslocale, andactiveFlowsBundle/flowLabelTranslationskey by it. Pins with alias tags inloadLanguage.fallbackChain-36809.test.tsx: azh-Hansand azhconsole on azh-CN-authored stack with fallbackenread the authored Chinese (equal to the server's answer for the negotiated request) and fetch noenbundle; ajaconsole on a stack holdingja-JPnegotiates toja-JPand still reads theenfallback. Ablation (raw tag instead of the negotiated one): 3 of 7 loader tests red, restored.ui/apps/console/src/loadLanguage.test.tsxandui/packages/i18n/src/index.ts.fallbackChaindescribe and jsdoc inpackages/spec/src/api/protocol.zod.tssay the member is absent when the i18n service reports no fallback, and that the request tag is negotiated againstlocales[].codefirst;content/docs/references/api/protocol.mdxregenerated,content/docs/ui/translations.mdxexplains the negotiation./i18n/localesread withloadLocales.tsneeds that file, outside the claimed surface; one extra request per language load, no correctness effect.Line budget: 18 files, +957/−77 = 1,034 changed lines (one PR for the card), under the 3,000-line line.