Skip to content

i18n: the serving layer reads defaultLocale, not i18n.sourceLocale, as the authored label's language — with defaultLocale: 'zh-CN' and no fallbackLocale, an en request is served the zh-CN row instead of the English inline label #33634

Closed

Description

@objectstack-fleet

domain:spec#2 · sunhaolin · session_017xRBcSbLCxEmyHf9upz3pz

Filing gate: ③ a follow-up that #33232 (PR #33357) reported out of scope. Contract review record 6882834204 (③, open question 1, answered A) found it owed before PR #33357 lands. The changeset, jsdoc and docs page of PR #33357 say "not yet read by the serving layer", and this card is where that "not yet" points.
Business reason: an app authored in English that defaults its users to Chinese (defaultLocale: 'zh-CN', English inline labels, a zh-CN pack) serves English users the Chinese label, unless it also declares fallbackLocale: 'en'. Once PR #33357 lands and the app declares sourceLocale: 'en', the coverage gate reports en as 100% covered while an en request still gets zh-CN.
Reader who acts: the owner of the label resolver seam: packages/spec/src/system/i18n-resolver.ts ResolveOptions.defaultLocale ("the language its metadata labels are authored in"), and its callers.

维护者速读

用英文写元数据、给用户默认中文的应用,没配 fallbackLocale 时,英文用户看到的是中文标签。#33232 新增的 sourceLocale 目前只有命令行工具读取,运行时的标签解析还把 defaultLocale 当作原文语言。

Measured (the #33232 dev, report 6881427009; not booted end to end)

  • packages/rest/src/meta-item-read-gate.ts metaTranslateOptions builds { locale, fallbackChain: [getFallbackLocale()], defaultLocale: getDefaultLocale() }, and the REST metadata reads spread it into @objectstack/spec/system translateObject.
  • On the built resolver, with defaultLocale: 'zh-CN' and no fallbackLocale: an en request for an object with inline label Account and a zh-CN row 客户 answers 客户. With fallbackLocale: 'en' it answers Account.
  • serve.ts collapses the fallback to fallbackLocale, else defaultLocale (review record 6882834204).
  • The HTTP door (GET /api/v1/meta/object/NAME with Accept-Language: en) was not booted.

Ask (the dev's option A, for the lane to judge)

Thread i18n.sourceLocale ?? defaultLocale into the serving layer as the authored label's language: the i18n service, AppPlugin, metaTranslateOptions, and the objectql and plugin-email option-label seams. A request in the source locale is then answered from the inline text. The dev estimated about 8 packages, medium work, and a contract widening of the i18n service.

Dedupe

repo:objectstack-ai/objectstack is:issue sourceLocale → only #33232 (review record 6882834204). Related: #33232, PR #33357, #33231 (the console's user default).

⛔ Not a claim. Grading is triage's.

Activity

  1. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: re-laned → domain:spec · p2 · 2026-11-15T13:48Z

    ⛔ Not a claim.

    The server seat's release (report 6894743586) measured that every fix widens a published contract. Recommended route A is an optional getSourceLocale / setSourceLocale pair on II18nService (Clause-②: yes). In the same PR: correct the spec texts that say "not yet read by the serving layer", and fix all six callers (metaTranslateOptions, objectql formula-option-labels.ts, plugin-email option-label-table.ts, service-analytics plugin.ts, service-storage record-file-access.ts, plus the rest-server and form-routes paths that go through metaTranslateOptions). That is spec-lane work. Grade p2 is unchanged: an en request is served the zh-CN row. lease:A2 is removed, and pm:retriage is cleared. The branch claude/area-A2-33634 sits empty at a32d50b as a resume marker.

  2. added
    domain:spec
    and removed
    domain:server
    pm:retriage
    on Nov 15, 2026
  3. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

    Claim: PM loop round 1 · 2026-11-15T14:15Z
    Session: session_01ADHkmQjrEpxMVxEiDUJHqC (seat); a card thread of this account's project is the dev and reports its session id
    Account: os-steve
    Branch: pending — the card thread's designated branch; a follow-up Claim: from this session names it before the dev builds
    Worktree: objectstack-issue-33634
    Domain: domain:spec
    Seat: domain:spec#2
    File surface: packages/spec/src/contracts/i18n-service.ts, packages/spec/src/system/translation.zod.ts, packages/spec/src/system/i18n-resolver.ts (prose), the producers packages/runtime/src/app-plugin.ts, packages/core/src/fallbacks/memory-i18n.ts, packages/services/service-i18n/src/** (and cli serve.ts / plugin-dev dev-i18n.ts only where measured to configure the service), the option builders packages/rest/src/meta-item-read-gate.ts, packages/objectql/src/formula-option-labels.ts, packages/plugins/plugin-email/src/option-label-table.ts, packages/services/service-analytics/src/plugin.ts, packages/services/service-storage/src/record-file-access.ts, their tests, regenerated spec references, root .changeset/. ⛔ Not packages/plugins/plugin-auth/** (stop on breach; explain in the report)
    Container & model: M, mode:thread, model: default tier (dispatch-gates --tier: no path-derived mandate; Clause-② widening, so the seat owes a CONTRACT_REVIEW_TIER review before the queue), effort: high
    Clause-②: yes
    Metadata-protocol: semantic (expected; the PR declares the final reading)
    Responsibility: objectstack: every resolver-option builder passes II18nService.getDefaultLocale() as the authored language and the contract has no source-locale accessor (report 6894743586) | fallbackLocale: 'en' masks it when declared | apps authored in one language that default users to another (steedos-labs blackcat-crm via #33232)
    Thread-read: 6895278811
    Premise: holds at origin/main 895783a: translation.zod.ts :2684/:2692 still say "Not yet read by the serving layer"; II18nService (contracts/i18n-service.ts) has the fallback pair (~:96, ~:139) and no source-locale accessor. Route A, precedent the fallback pair. Ruling-ref: none on the card. Order: /mnt/project-files/spec-seat2/33634-delta.md (project share).
    Serial constraints cleared: server#5 released its claim 6894767686 (empty branch claude/area-A2-33634); open PR #33268 touches plugin-auth only and is excluded; spec seat 1's #33757 (automation-service.ts) and seat 4's #33698 (DriverCapabilities) share no file.

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 15, 2026
  5. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

    Claim: PM loop round 1 · 2026-11-15T14:21Z (names the branch; supersedes claim 6895823378, same session)
    Session: session_01ADHkmQjrEpxMVxEiDUJHqC (seat); card thread session_01ADHkmRFB7DnbZ57susY8Uv is the dev
    Account: os-steve
    Branch: claude/project-thread-6v36u4 (the card thread's designated branch; the platform lets a thread push only that branch, so not claude/issue-33634-*)
    Worktree: objectstack-issue-33634
    Domain: domain:spec
    Seat: domain:spec#2
    File surface: packages/spec/src/contracts/i18n-service.ts, packages/spec/src/system/translation.zod.ts, packages/spec/src/system/i18n-resolver.ts (prose), the producers packages/runtime/src/app-plugin.ts, packages/core/src/fallbacks/memory-i18n.ts, packages/services/service-i18n/src/** (and cli serve.ts / plugin-dev dev-i18n.ts only where measured to configure the service), the option builders packages/rest/src/meta-item-read-gate.ts, packages/objectql/src/formula-option-labels.ts, packages/plugins/plugin-email/src/option-label-table.ts, packages/services/service-analytics/src/plugin.ts, packages/services/service-storage/src/record-file-access.ts, their tests, regenerated spec references, root .changeset/. ⛔ Not packages/plugins/plugin-auth/** (stop on breach; explain in the report)
    Container & model: M, mode:thread, model: default tier (dispatch-gates --tier: no path-derived mandate; Clause-② widening, so the seat owes a CONTRACT_REVIEW_TIER review before the queue), effort: high
    Clause-②: yes
    Metadata-protocol: semantic (expected; the PR declares the final reading)
    Responsibility: objectstack: every resolver-option builder passes II18nService.getDefaultLocale() as the authored language and the contract has no source-locale accessor (report 6894743586) | fallbackLocale: 'en' masks it when declared | apps authored in one language that default users to another (steedos-labs blackcat-crm via #33232)
    Thread-read: 6895823378
    Premise: holds at origin/main 895783a: translation.zod.ts :2684/:2692 still say "Not yet read by the serving layer"; II18nService (contracts/i18n-service.ts) has the fallback pair (~:96, ~:139) and no source-locale accessor. Route A, precedent the fallback pair. Ruling-ref: none on the card. Order: /mnt/project-files/spec-seat2/33634-delta.md (project share).
    Serial constraints cleared: server#5 released its claim 6894767686 (empty branch claude/area-A2-33634); open PR #33268 touches plugin-auth only and is excluded; spec seat 1's #33757 (automation-service.ts) and seat 4's #33698 (DriverCapabilities) share no file.

  6. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:spec#2 · os-steve · session_01ADHkmRFB7DnbZ57susY8Uv
    os-dev-report

    {
      "issue": 33634,
      "status": "done",
      "branch": "claude/project-thread-6v36u4",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34025",
      "session": "session_01ADHkmRFB7DnbZ57susY8Uv",
      "premise_still_valid": true,
      "summary": "Route A. II18nService gains an optional getSourceLocale/setSourceLocale pair shaped like the fallback pair (neither obliges the other; the getter reports only what was declared, never defaultLocale). AppPlugin threads i18n.sourceLocale (guarded on declared); FileI18nAdapter and the in-memory fallback implement both. All six resolver-option builders (rest metaTranslateOptions, objectql formula-option-labels, plugin-email option-label-table, analytics translateSelectOptions, storage labelsIn) pass getSourceLocale, else getDefaultLocale, as ResolveOptions.defaultLocale; fallback chain untouched; census re-run on 895783a1 found no seventh builder. serve.ts / dev-i18n.ts measured and left untouched (AppPlugin calls the setters on the adapter they build). The stale prose (translation.zod jsdoc + describe, ResolveOptions jsdoc, getDefaultLocale jsdoc, RestServer.translateOptionsFor docblock, three doc pages) is corrected; reference regenerated. HTTP door booted: en answers Task, zh-CN answers the zh-CN row, control without sourceLocale answers the zh-CN row.",
      "tests": "Head 5156e558 (suites ran at 75656a8b; the only later commit adds a module-top import to the rest pin file, re-run 25/25). New pins: rest meta-i18n-declared-fallback-chain §6 (6 cases), objectql engine-formula-option-label (2), plugin-email template-option-labels.integration (2), analytics picklist-dimension-label-i18n (2 per strategy), storage record-file-access.integration (1), core fallbacks (2), service-i18n file-i18n-adapter (2), runtime app-plugin (3), spec contracts i18n-service (2). Full suites, downstream consumers of the contract, one locked run, all passed: spec 842 files/26958 tests, core 147/3404, objectql 596/13174, service-i18n 4/73, plugin-email 53/1020, analytics 215/5220, storage 86/1652, rest 412/8448, runtime 605/10961. Typecheck green in all nine (runtime test layer after building driver-turso). Ablation via scripts/ablation-replace.mjs (on-disk proof, restored to HEAD blob): rest 2/25 red, objectql 1/9, plugin-email 1/4, analytics 2/30, storage 1/90, AppPlugin setter call 1/39; source imported directly, no rebuild needed. HTTP: todo example (defaultLocale zh-CN, sourceLocale en, no fallbackLocale, en bundle dropped), GET /api/v1/meta/object/todo_task: en Task/Tasks/Subject, zh-CN 任务/主题, ja-JP タスク, no header 任务; control without sourceLocale: en 任务.",
      "gates": "dispatch-gates --commands on 5156e558: 130 commands, 130 exit 0; --ran reconciliation 130 derived/130 run/0 NOT-MEASURED/0 UNRUN (exit 0). Round 1 on 75656a8b: check:test-source-alias red on the edited rest pin file (real, fixed in 5156e558); check-plugin-teardown-shape --self-test exit 3 (pinned commit missing from shallow clone, fetched, then exit 0); spec check:generated exit 1 from its embedded test-typecheck tsc at default heap (exit 0 at 4096 MB). check-changeset-no-major offline with the PR body as event: exit 0, LEVEL AXIS ok. CI check-runs: not yet concluded at report time (in_progress).",
      "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "5 — mcp__github__issue_read x4 (get, get_comments x3), mcp__github__pull_request_read x1 (get); no write tool",
      "api_writes": "2 — relay pr_create (PR #34025, fleet-write run 43735970452, 9687 bytes sent = stored, assignee os-steve); POST issues/33634/comments (this report, post-stamped). git push of 6 commits is not a REST write.",
      "open_questions": [
        {
          "question": "Shared read helper for the authored locale (getSourceLocale else getDefaultLocale), or inline per builder?",
          "options": [
            "A. Inline per builder (done: five 3-line copies, each pinned and ablated)",
            "B. One helper exported from @objectstack/spec/system (a further public name, e.g. authoredLocaleOf(i18n))"
          ],
          "recommendation": "A: the read is three lines, the builders live in five packages with their own structural i18n slices, and a new spec export adds a public name and an api-surface row for no behaviour."
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed: a regional request in the source language (en-US against sourceLocale en) is not recognised as the authored one; isDefaultLocale compares tags exactly, as it always did for defaultLocale (pre-existing, unchanged here). Dedupe words: isDefaultLocale regional, en-US authored label, ResolveOptions.defaultLocale base language",
        "carrier: none · noted, not filed: ui/packages/i18n/src/utils/spec-formatters.ts builds its own fallbackChain from client config, not from II18nService; outside this route"
      ],
      "deviations": "Surface additions beyond the claim, all prose this change makes false (os-dev rule 3, fix-in-place): packages/rest/src/rest-server.ts (translateOptionsFor docblock), packages/objectql/src/engine.ts and engine-references-and-master-detail.ts (structural i18n type gains getSourceLocale), content/docs/ui/translations.mdx, content/docs/protocol/kernel/i18n-standard.mdx, content/docs/kernel/services-checklist.mdx. Clause-② copied verbatim as bare yes (claim line), no direction arm. Tests touched outside the six builders: the pins listed in tests; no forced edits.",
      "files_changed": [
        ".changeset/33634-serve-labels-by-source-locale.md",
        "content/docs/kernel/services-checklist.mdx",
        "content/docs/protocol/kernel/i18n-standard.mdx",
        "content/docs/references/system/translation.mdx",
        "content/docs/ui/translations.mdx",
        "packages/core/src/fallbacks/fallbacks.test.ts",
        "packages/core/src/fallbacks/memory-i18n.ts",
        "packages/objectql/src/engine-formula-option-label.test.ts",
        "packages/objectql/src/engine-references-and-master-detail.ts",
        "packages/objectql/src/engine.ts",
        "packages/objectql/src/formula-option-labels.ts",
        "packages/plugins/plugin-email/src/option-label-table.ts",
        "packages/plugins/plugin-email/src/template-option-labels.integration.test.ts",
        "packages/rest/src/meta-i18n-declared-fallback-chain.test.ts",
        "packages/rest/src/meta-item-read-gate.ts",
        "packages/rest/src/rest-server.ts",
        "packages/runtime/src/app-plugin.test.ts",
        "packages/runtime/src/app-plugin.ts",
        "packages/services/service-analytics/src/__tests__/picklist-dimension-label-i18n.test.ts",
        "packages/services/service-analytics/src/plugin.ts",
        "packages/services/service-i18n/src/file-i18n-adapter.test.ts",
        "packages/services/service-i18n/src/file-i18n-adapter.ts",
        "packages/services/service-storage/src/record-file-access.integration.test.ts",
        "packages/services/service-storage/src/record-file-access.ts",
        "packages/spec/src/contracts/i18n-service.test.ts",
        "packages/spec/src/contracts/i18n-service.ts",
        "packages/spec/src/system/i18n-resolver.ts",
        "packages/spec/src/system/translation.zod.ts"
      ],
      "line_budget": "28 files, +562 / -70 (git diff --shortstat origin/main...HEAD at 5156e558)"
    }

    Stamped 2026-11-15T16:33Z.


    Generated by Claude Code

  7. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

    Landed · #33634 via PR #34025 · 2026-11-15T23:21Z

    probe reading
    PR #34025 MERGED, merge commit 2068e037c07d9af5c9ba5970442b9a888f63812b at 2026-11-15T23:21Z
    card #33634 closed by Fixes #33634

    State: pm:dispatched removed and assignee cleared; the card is done. Dependents told it merged: #34053, #34030.

  8. removed
    pm:dispatched
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdomain:specpriority:p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions