Skip to content

feat(i18n): serve labels by i18n.sourceLocale as the authored language - #34025

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/project-thread-6v36u4
Nov 15, 2026
Merged

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

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #33634
Clause-②: yes
Metadata-protocol: semantic
Skills-docs: follow-up #34053

维护者速读

  • 改了什么:运行时现在读取 i18n.sourceLocale,把它当作元数据内联标签的原文语言;i18n 服务契约新增可选的 getSourceLocale / setSourceLocale。
  • 为什么改:英文写元数据、默认给用户中文的应用,没配 fallbackLocale 时,英文请求拿到的是中文标签;工具已把 en 报成 100% 覆盖,运行时却不这么服务。
  • 风险与回滚:只影响声明了 sourceLocale 的应用;没声明的应用答案逐字不变(每个入口都有对照测试)。回滚即 revert 本 PR。
  • 先看:packages/spec/src/contracts/i18n-service.ts(新契约方法的语义)、packages/rest/src/meta-item-read-gate.ts(元数据读取的取值顺序)、packages/runtime/src/app-plugin.ts(声明如何注入服务)。
  • 两分钟验证:pnpm --filter @objectstack/rest exec vitest run src/meta-i18n-declared-fallback-chain.test.ts,预期 25 个测试全绿,其中 §6 六个是本卡的钉子。
  • 需要你做的:无,席位落地。

What changes

An app authored in English that defaults its users to zh-CN (defaultLocale: 'zh-CN', sourceLocale: 'en', no fallbackLocale, a zh-CN pack) used to serve an en request the Chinese row: every caller that builds the label resolver's options passed getDefaultLocale() as ResolveOptions.defaultLocale (the authored language), so en was not "the authored one" and walked the fallback chain (zh-CN, the boot paths' collapse) ahead of the inline text. Route A of the census report (issuecomment 6894743586), chosen by the seat:

  • Contract (packages/spec/src/contracts/i18n-service.ts): optional getSourceLocale(): string | undefined and setSourceLocale(locale): void. Same stance as the fallback pair: implementing one does not oblige the other (per-value); the getter answers only what was declared and never derives defaultLocale — that collapse is the caller's. The getDefaultLocale jsdoc no longer claims it is always the authored language.
  • Producers: AppPlugin.loadTranslations threads i18n.sourceLocale beside setDefaultLocale / setFallbackLocale, guarded on "declared something" (a sibling app on the same kernel keeps its value). FileI18nAdapter and the kernel's in-memory fallback implement both halves. Measured: os serve and plugin-dev construct I18nServicePlugin with defaultLocale / fallbackLocale only, and AppPlugin then calls the setters on the adapter it built, so neither boot path needed a new option (serve.ts, dev-i18n.ts untouched).
  • The five option builders, each now getSourceLocale() (non-empty) else getDefaultLocale() as ResolveOptions.defaultLocale, fallback chain untouched: rest metaTranslateOptions (also behind RestServer.translateOptionsFor, form-routes.ts and the runtime dispatcher's list translation), objectql formula-option-labels.ts, plugin-email option-label-table.ts, service-analytics translateSelectOptions, service-storage record-file-access.ts labelsIn. The census re-run on 895783a1 (every non-test fallbackChain / getDefaultLocale reader under packages/) found no sixth builder; the only other fallbackChain site is ui/packages/i18n/src/utils/spec-formatters.ts, a client formatter fed from its own config, not from II18nService (noted below).
  • Users'-default readers unchanged: service-messaging recipient locale and notification text, runtime domains/i18n.ts, discovery, AppPlugin seed locale, extractLocale (a header-less request still falls to defaultLocale), plugin-auth (not touched).
  • Prose made false, corrected in the same PR: TranslationConfigSchema.sourceLocale jsdoc and .describe ("Not yet read by the serving layer"), ResolveOptions.defaultLocale jsdoc and the resolver header, the RestServer.translateOptionsFor docblock, the regenerated content/docs/references/system/translation.mdx, and three hand-written doc pages that described the old rule or told authors to add fallbackLocale: 'en' as a workaround. Shared read helper: inline (five 3-line copies); no new @objectstack/spec/system export.

Tests

Each builder has a pin with defaultLocale: 'zh-CN', sourceLocale: 'en', no fallbackLocale (collapsed to zh-CN): an en request answers the inline English label, a zh-CN request the zh-CN row, and a CONTROL with no sourceLocale keeps today's answer (zh-CN row for en).

  • rest meta-i18n-declared-fallback-chain.test.ts §6: single read, list read, header-less request (falls to zh-CN), a third locale (ja-JP walks the chain to zh-CN), controls with the accessor absent and answering undefined.
  • objectql engine-formula-option-label.test.ts, plugin-email template-option-labels.integration.test.ts (booted kernel), service-analytics picklist-dimension-label-i18n.test.ts (both strategies), service-storage record-file-access.integration.test.ts (the upload-link page, English and Chinese).
  • Producers: fallbacks.test.ts (memory provider), file-i18n-adapter.test.ts, app-plugin.test.ts (threads, does not call when undeclared, skips a provider without the setter), spec i18n-service.test.ts.
  • Forced test edits: none. Two harness widenings to reach the pins: the rest file's protocol() / makeRest() take an optional document map, and the plugin-email AppFixture takes accessor overrides; every existing case runs with the defaults it had.
Readings (local, shared container; packages built at the head the suites ran on)
  • Full suites, the nine consumer packages (downstream direction: the packages that read the widened contract), one locked run: spec 842 files / 26958 tests, core 147 / 3404, objectql 596 / 13174, service-i18n 4 / 73, plugin-email 53 / 1020, service-analytics 215 / 5220 (335 skipped), service-storage 86 / 1652 (1 skipped), rest 412 / 8448 (332 skipped), runtime 605 / 10961 (19 skipped): all passed. Typecheck green in all nine (runtime's test layer after building driver-turso, a devDependency outside the first build closure).
  • Ablation, one per changed builder plus the producer (scripts/ablation-replace.mjs, mutation proven on disk, file restored to its HEAD blob each time): rest source read removed → 2 of 25 red (§6 single and list read); objectql → 1 of 9 red; plugin-email → 1 of 4 red; service-analytics → 2 of 30 red (one per strategy); service-storage → 1 of 90 red; AppPlugin setSourceLocale call removed → 1 of 39 red. Each test file imports the source under test, so no rebuild was needed for the legs.
  • pnpm --filter @objectstack/spec check:generated: one stale artifact (content/docs/references/system/translation.mdx), regenerated; api-surface unchanged (an optional interface member).

Acceptance notes

  • ui/packages/i18n/src/utils/spec-formatters.ts builds a fallbackChain from its own client config, not from II18nService; it is outside this route (the Console's own locale config). 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 (case-insensitive), the same as it always did for defaultLocale. Unchanged by this PR; noted, not filed.

Verification

Verification head: b63efd08, a merge-only commit of origin/main (e71ecc1b, 15 commits past the previous merge) made under the seat's K ≥ 15 landing rule; CI on this head is the landing verdict. No file this PR changes moved on main's side. The local readings below were taken at 5156e558 (suites, ablations, derived gates, HTTP door) and 74a2954d (the first merge of main: full rebuild, check:generated green with nothing to regenerate).

HTTP door, booted

The todo example in a side worktree at this head, set to defaultLocale: 'zh-CN', sourceLocale: 'en', no fallbackLocale, and its en bundle dropped (so English can only come from the inline labels); pnpm dev --fresh, signed in as the dev admin, GET /api/v1/meta/object/todo_task:

  • Accept-Language: en → Task / Tasks / field Subject (inline English)
  • Accept-Language: zh-CN → 任务 / 任务 / 主题
  • Accept-Language: ja-JP → タスク / タスク / 件名
  • no header → 任务 (the users' default)
  • CONTROL, same stack without sourceLocale: en → 任务 / 任务 / 主题 (the card's defect, unchanged for a stack that declares nothing).

The example edits lived only in that throwaway worktree; it was removed after both servers were stopped.

Derived gates (head 5156e55)

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack on head 5156e558: 130 commands, all run, all exit 0; --ran reconciliation: 130 derived, 130 run, 0 NOT-MEASURED, 0 UNRUN. The first round (head 75656a8b) found one real red, check:test-source-alias on the edited rest test (the routes reach @objectstack/objectql through a dynamic import inside a case's clock); fixed in 5156e558 with a module-top import '@objectstack/objectql', the shape the package's other door tests use. Its other two non-zero exits were environment: check-plugin-teardown-shape --self-test exit 3 until its pinned commit was fetched into the shallow clone, and check:generated's embedded check:test-typecheck tsc run failing without diagnostics at the default heap (green at the CI heap, 4096 MB).

II18nService gains an optional getSourceLocale/setSourceLocale pair,
shaped like the fallback pair. AppPlugin threads the declared
i18n.sourceLocale into the service; FileI18nAdapter and the kernel's
in-memory fallback implement both. Every document-translator option
builder (rest metaTranslateOptions, objectql formula labels, email
option holes, analytics select options, storage upload-link labels)
passes getSourceLocale, else getDefaultLocale, as
ResolveOptions.defaultLocale. The spec prose that said the serving
layer does not read the key is corrected.

Claude-Session: https://claude.ai/code/session_01ADHkmRFB7DnbZ57susY8Uv
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 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head 5156e55 · 2026-11-15T16:33Z

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 9 package(s): @objectstack/core, @objectstack/objectql, @objectstack/plugin-email, @objectstack/rest, @objectstack/runtime, @objectstack/service-analytics, @objectstack/service-i18n, @objectstack/service-storage, @objectstack/spec, touching 21 documentable anchor(s).

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

  • content/docs/automation/email-templates.mdx (via II18nService (symbol, a top-level interface))
  • content/docs/kernel/services-checklist.mdx (via FileI18nAdapter (symbol, a top-level class), II18nService (symbol, a top-level interface), createMemoryI18n (symbol, a top-level function), getSourceLocale (symbol, a field of interface OptionLabelI18n; a method of class FileI18nAdapter; a method of interface II18nService), i18nService (symbol, a field of class ObjectQL), setSourceLocale (symbol, a method of class FileI18nAdapter; a method of interface II18nService), getDefaultLocale (literal, a string literal in Partial), getSourceLocale (literal, a string literal in Partial))
  • content/docs/plugins/packages.mdx (via AnalyticsServicePlugin (symbol, a top-level class))
  • content/docs/protocol/kernel/http-protocol.mdx (via getDefaultLocale (literal, a string literal in Partial))
  • content/docs/protocol/kernel/i18n-standard.mdx (via II18nService (symbol, a top-level interface), TranslationConfigSchema (symbol, a top-level const), loadTranslations (symbol, a method of class AppPlugin), sourceLocale (symbol, a field of class FileI18nAdapter))
  • content/docs/protocol/kernel/index.mdx (via II18nService (symbol, a top-level interface))
  • content/docs/ui/translations.mdx (via sourceLocale (symbol, a field of class FileI18nAdapter))

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

  • content/docs/releases/implementation-status.mdx (via RestServer (symbol, a top-level class))
  • content/docs/releases/v12.mdx (via RestServer (symbol, a top-level class))
  • content/docs/releases/v16.mdx (via RestServer (symbol, a top-level class))
  • content/docs/releases/v17/17-1.mdx (via II18nService (symbol, a top-level interface))
  • content/docs/releases/v17/17-3.mdx (via RestServer (symbol, a top-level class))
  • content/docs/releases/v17/17-5.mdx (via RestServer (symbol, a top-level class))
  • content/docs/releases/v17/17-6.mdx (via AnalyticsServicePlugin (symbol, a top-level class))
  • content/docs/releases/v18/18-3.mdx (via RestServer (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 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 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; 123 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 — 190 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 e71ecc1b32cca6a8c56ae1d949c0b9100465475e → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json e71ecc1b32cca6a8c56ae1d949c0b9100465475e

⚠️ 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 e71ecc1b32cca6a8c56ae1d949c0b9100465475e → 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

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 5156e558473a5450ca6b845b79a6a13982e45ed5
Local-runs: none
Scope: packages/spec/src/contracts/i18n-service.ts, packages/spec/src/system/i18n-resolver.ts, packages/spec/src/system/translation.zod.ts + packages/runtime/src/app-plugin.ts, packages/core/src/fallbacks/memory-i18n.ts, packages/services/service-i18n/src/file-i18n-adapter.ts, packages/rest/src/meta-item-read-gate.ts, packages/rest/src/rest-server.ts, packages/objectql/src/formula-option-labels.ts, packages/objectql/src/engine.ts, packages/objectql/src/engine-references-and-master-detail.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

Read: card #33634 (body and all 7 comments, incl. 6894743586, 6894767686, 6895278811, both claims, 6897697194), PR #34025 body and file list (28 files, +562/-70), the net diff against the merge base, and the head tree for the census. The remaining 14 files (tests, changeset, four content/docs pages) are the lane seat's ACCEPT at TIER_DEFAULT.

Check-runs on this head at review time: 14 completed success (Check Changeset, Governed Surface Queue Guard, Spec property liveness, PR-body guards, Lint · PM dispatch-gates, Lint · scoped · tooling self-tests, Dogfood Regression Gate, Check Documentation Links, Check PR Size, Flag docs affected by code changes, Auto Label, Plan Test Core shards, Plan Test UI shards, filter); 9 skipped (opt-in or queue-only jobs); 0 failed. STILL IN PROGRESS, no verdict yet: Build Core, Build Docs, Build UI Deps, Test Core 1/8 to 8/8, Type Check · workspace / source gates / consumer gates / debt ledger, Lint · ESLint, Lint · docs & code guards, Lint · repo & tooling gates, Lint · CI, release & engine gates, Lint · scoped · query-options erasure, Lint · scoped · slot lookup & corpus, Live E2E UI. This PASS is the design verdict; every type, test, generated-artifact and api-surface claim rests on those runs concluding green, and none of them was re-run here.

① Derived judgments

  • Public surface: II18nService gains optional getSourceLocale(): string | undefined and setSourceLocale(locale: string): void. RIGHT. Both optional, so no existing provider or consumer breaks; the shape copies the fallback pair, the precedent the card named.
  • Accept-set: none moves. TranslationConfigSchema.sourceLocale keeps its LocaleSchema.optional() type; only its jsdoc and .describe text change (regenerated references/system/translation.mdx follows). RIGHT.
  • Served answer: for a stack that declares i18n.sourceLocale different from defaultLocale, a request in the source locale now skips the fallback chain and a request in defaultLocale now walks it. RIGHT, and it is the card's ask. A stack with no sourceLocale, or with sourceLocale equal to defaultLocale, passes the same value as before at all five inline reads (traced: each reads getSourceLocale first and falls to the unchanged getDefaultLocale expression).
  • ResolveOptions.defaultLocale keeps its name while its meaning widens to "authored language". RIGHT as a no-rename: the resolver code is untouched (prose only in i18n-resolver.ts), and the jsdoc says why the name stayed.
  • Structural i18n slices in objectql (engine.ts twice, engine-references-and-master-detail.ts), plugin-email OptionLabelI18n, storage UploadLinkLabelI18n gain the optional getter. RIGHT: without them the engine's stored service type would hide the method from readerOptionLabels.

② Semver level

  • Changeset: minor on spec, core, runtime, service-i18n, rest, objectql, plugin-email, service-analytics, service-storage. Matches the diff: spec publishes two optional interface members (additive); core and service-i18n publish two new provider methods; the other six change a served answer only behind a newly honoured, optional declaration. No package in the diff is missing and none is listed without a source change. Check Changeset is green.
  • Clause-②: yes — correct; a published contract widens. PR body and changeset agree. The bare yes with no direction arm copies the claim line; the widening direction is what the diff shows.
  • Metadata-protocol: semantic — correct; no key is added or narrowed, and what a declared sourceLocale makes the server answer changes. PR body and changeset agree.

③ Boundary flags

  • Open question (inline read vs a shared helper): answered A, inline. Five 3-line reads in five packages with their own structural slices; a helper would be a further @objectstack/spec/system export for no behaviour. Accepted. The cost is visible in the tree and is a nit: four copies test typeof source === 'string' and length > 0, storage tests truthiness (source || ...). Equivalent for every string the contract allows.
  • Deviation (surface beyond the claim): rest-server.ts (docblock only), engine.ts and engine-references-and-master-detail.ts (one optional type member each), three content/docs pages. Accepted: each is prose or a type the change would otherwise leave false, and none carries behaviour. plugin-auth/** is untouched, as the claim required.
  • serve.ts and dev-i18n.ts left untouched: confirmed in the tree. Both construct I18nServicePlugin with defaultLocale / fallbackLocale only, and AppPlugin.loadTranslations reads bundle.i18n (else the manifest's) and calls the setters on whichever service is registered.
  • Dev out-of-scope note 1 (en-US against sourceLocale: 'en' is not the authored locale, exact-tag compare): pre-existing in isDefaultLocale, unchanged. Not escalated; a follow-up card if the lane wants base-language matching.
  • Dev out-of-scope note 2 (ui/packages/i18n/src/utils/spec-formatters.ts builds its chain from client config): outside this route and not measured by this review. Not escalated here; see N1 for the related server-side reader.
  • Security: no hits path is under skills/**; nothing here teaches auth or permission behaviour. No security label owed.

④ Design judgment

No must-fix, no should-fix.

Scenario traced on the head (defaultLocale: 'zh-CN', sourceLocale: 'en', no fallbackLocale, which os serve collapses to zh-CN): options become { locale, fallbackChain: ['zh-CN'], defaultLocale: 'en' }. An en request is the authored one: own bundle, then the inline English label. A zh-CN request: the zh-CN row, then the chain, then inline. ja-JP: own bundle, zh-CN, inline, as before. A header-less request still falls to getDefaultLocale() in extractLocale (zh-CN), correctly not switched. No sourceLocale: defaultLocale: 'zh-CN', unchanged.

Per hits file:

  • contracts/i18n-service.ts — holds. The getter's "report, never invent" rule and the caller-side collapse are what all five readers implement. One half only: a provider with only the setter leaves callers on getDefaultLocale (the old answer, as the jsdoc says); one with only the getter works. sourceLocale equal to defaultLocale is a no-op. The t() sentence ("the value changes no t() lookup") is true in both in-repo providers: neither t() reads the new field.
  • system/i18n-resolver.ts — holds. Prose only; isDefaultLocale and the chain builder are unchanged and already do what the new sentences say.
  • system/translation.zod.ts — holds for the document translators. "A request in defaultLocale (when the two differ) walks the chain like any other translated locale" is true on the traced options. See N1 for the limit of the .describe sentence.

Census re-run on the head tree (every non-test reader of getDefaultLocale and every caller of the document translators under packages/):

  • Authored-language readers that build resolver options: metaTranslateOptions (behind RestServer.translateOptionsFor, form-routes.ts twice, the list, single, view-container and plural-pair reads), objectql readerOptionLabels, plugin-email servedOptionFields, analytics translateSelectOptions, storage labelsIn. All five switched. No sixth builder exists.
  • Users'-default readers, correctly NOT switched: extractLocale (rest), runtime domains/i18n.ts, discovery in metadata-protocol and http-dispatcher, service-messaging (recipient locale, notification text, push), plugin-auth email locale, the I18nServicePlugin log line.
  • Translator callers that pass no authored language by design: protocol-translated-echo.ts (reads every locale to detect an echo; no chain, no default) and lint-duplicate-field-labels.ts (authoring tool).
  • Coverage gate vs serving: i18n-coverage.ts reads sourceLocale, else defaultLocale; the five serving reads now use the same order. They agree on every document-translator surface.

Implementing files against the contract: app-plugin.ts (threads only a declared value, feature-detects the setter, placed beside the other two), memory-i18n.ts and file-i18n-adapter.ts (getter answers only what the setter was told, undefined otherwise, t() untouched), the five readers (source first, non-empty, else default; chain untouched), the objectql type slices — all agree, sentence by sentence.

Nits (no effect on this diff's correctness or the contract; none is to be fixed in code on this head):

  • N1 (nit, follow-up card owed) — a class of label reader the census on the card and in the dev report does not list reads metadata labels through t(), not through ResolveOptions: objectql resolveFieldLabel (validation/record-validator.ts), resolveOptionLabel (validation/rule-validator.ts), objectDisplayLabel (engine-validation-messages.ts), and their users in duplicate-record-error.ts and engine-delete-cascade.ts. Read, not run: in the card's scenario t('objects.X.fields.Y.label', 'en') misses in en, falls to the collapsed fallback zh-CN, and returns the zh-CN row ahead of the declared English label — so an en write refusal still names the field in Chinese. This is pre-existing, outside the diff, and the same shape existed for defaultLocale after [Decision] the default locale's text — is the authored label the default-locale source (a default-locale request stops there), or must every supported locale ship a bundle? os i18n check says the former, localeChain does the latter; the resolver's literal ['en'] default rides on the answer #15711; the contract deliberately keeps t() unchanged, and closing it needs a ruling (does t()-based label lookup learn the authored language, or do these readers move to the resolver). It does limit two new sentences: the .describe text "a request in this locale is answered from the inline text" and content/docs/ui/translations.mdx "what the gate counts as covered is what gets served" hold for metadata reads, formula label(), email option holes, analytics and the upload-link page, not for validation and refusal messages. The seat should file the follow-up; the dev's HTTP boot covered GET /meta only.
  • N2 (nit, accepted deviation) — the service holds one source locale per kernel and it can be set but never cleared. defaultLocale is required, so every AppPlugin resets it; sourceLocale is optional, so with several AppPlugins on one kernel an app that declares none inherits a sibling's value, and its served answer can change although it declared nothing. Same property as the fallback pair, and the comment in app-plugin.ts states the guard is deliberate; the changeset's "a stack that declares no sourceLocale is served exactly as before" is exact for a single-app kernel only.
  • N3 (nit) — rest-server.ts translateOptionsFor docblock: the edit now reads "All are feature-detected" beside the older parenthetical "both methods are optional ...; the core in-memory fallback declares neither", which was already inexact (the fallback declares getDefaultLocale) and now also omits that it declares getSourceLocale.

Implemented-by: claude/project-thread-6v36u4
Reviewed-by: session_01ADHkmQjrEpxMVxEiDUJHqC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head 74a2954 · 2026-11-15T17:21Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 74a2954d3240f2502a1dca09f9664b1ead81c51a
Local-runs: none
Scope: round 2, the merge delta on round 1's scope (record 6897767543, head 5156e558473a5450ca6b845b79a6a13982e45ed5): packages/spec/src/contracts/i18n-service.ts, packages/spec/src/system/i18n-resolver.ts, packages/spec/src/system/translation.zod.ts + packages/runtime/src/app-plugin.ts, packages/core/src/fallbacks/memory-i18n.ts, packages/services/service-i18n/src/file-i18n-adapter.ts, packages/rest/src/meta-item-read-gate.ts, packages/rest/src/rest-server.ts, packages/objectql/src/formula-option-labels.ts, packages/objectql/src/engine.ts, packages/objectql/src/engine-references-and-master-detail.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

Read: round 1's record in full; PR #34025 body, labels and comment list at this head; the commit range 5156e558..74a2954d (42 commits); the PR's diff against each head's merge base; the merge commit's remerge diff; main's side of the range (895783a1..b4ce310b) for the two files it shares with the PR, for service-analytics, for skills/objectstack-i18n, and for plugin-security's new denial message; the census greps on both head trees; PR #33934 body and card #33635's comments; card #34030's body; the check-runs on this head. Nothing was built or run.

Commits between the two heads. One commit is on the branch's first-parent line; the other 41 are main's and arrive through it.

Check-runs on this head (GET commits/74a2954d/check-runs, 68 runs, all completed): 58 success, 10 skipped, 0 failed, 0 in progress. Success: Build Core, Build Docs, Build UI Deps, Build & E2E UI, Test Core and its 8 shards, Test UI and its 16 shards, TypeScript Type Check with workspace / source gates / consumer gates / debt ledger, Type Check UI, Lint & Repo Gates, Lint · ESLint, Lint · docs & code guards, Lint · repo & tooling gates, Lint · CI, release & engine gates, Lint · PM dispatch-gates, the three scoped lints, Live E2E UI, Dogfood Regression Gate, Check Changeset, Check Documentation Links, Check PR Size, Flag docs affected by code changes, Governed Surface Queue Guard, PR-body guards, Spec property liveness, Auto Label, Plan Test Core shards, Plan Test UI shards, filter. Skipped: 18.x upgrade harness (opt-in), Packed-tarball smoke (opt-in), Borrowed queue verdict, Queue verdict, Schedule gate, Dogfood Regression Gate shard matrix, Dogfood Verify CLI, Lint UI, Temporal Conformance, UI Published Artifacts. Round 1's open condition (the runs then in progress) is closed on this head. The PR is a draft, mergeable_state: clean, no auto-merge.

① Derived judgments

  • The PR's own diff: UNCHANGED. git diff 895783a1 5156e558 and git diff b4ce310b 74a2954d are the same 1109 lines once blob ids and hunk offsets are dropped; both are 28 files, +562/-70, as the API reports. Every round 1 judgment on the diff stands as written.
  • Blob identity: 26 of the 28 PR files are byte-identical between the two heads. The two that differ, record-file-access.ts and record-file-access.integration.test.ts, differ only by main's fix(service-storage)!: every upload bound resolves by one precedence, and unset never means unlimited #33883 hunks. Read on the merged tree: the UploadLinkLabelI18n slice carries getSourceLocale, and labelsIn reads getSourceLocale() first, else getDefaultLocale(), chain untouched (lines 514, 1349-1350).
  • Public surface, accept-set, served answer, the no-rename of ResolveOptions.defaultLocale, the structural slices: RIGHT, unchanged from round 1.
  • Analytics: translateSelectOptions in plugin.ts is identical at both heads (source first at line 1194, default at 1197). fix(service-analytics)!: query_dataset refuses measures and dimensions the dataset does not declare #33958 does not reach it.

② Semver level

  • Changeset: unchanged, minor on the same nine packages. Check Changeset is green on this head. Main added other changesets (among them '@objectstack/skills': patch for docs(skills): objectstack-i18n teaches i18n.sourceLocale #33934); none names this PR's packages in a way that conflicts.
  • Clause-②: yes — still correct. A published contract widens; the diff is the same.
  • Metadata-protocol: semantic — still correct. No key added or narrowed; a declared sourceLocale changes the served answer.

③ Boundary flags

④ Design judgment

No must-fix on the diff. One should-fix, on the PR body and a follow-up card; it needs no push and does not move the head.

Census re-run on this head's tree, against round 1's:

  • Readers of getDefaultLocale / getSourceLocale under packages/ and ui/packages/ (non-test): the same set as round 1. A per-file count of getDefaultLocale, getSourceLocale, fallbackChain, translateObject, translateMetadataDocument, translateView and resolveLabel is identical between the two head trees, file for file. The list of non-test files that take the i18n service (getService('i18n'), setI18nService, getFallbackLocale) is identical too, 53 files.
  • The five builders on the merged tree, each reading getSourceLocale first: rest meta-item-read-gate.ts 3292/3295, objectql formula-option-labels.ts 160/163, plugin-email option-label-table.ts 137/140, analytics plugin.ts 1194/1197, storage record-file-access.ts 1349/1350. Main added no sixth builder of i18n ResolveOptions, and no new getDefaultLocale reader.
  • Users'-default readers, still not switched and still correct: extractLocale, runtime domains/i18n.ts, discovery in metadata-protocol and http-dispatcher, service-messaging, plugin-auth, the I18nServicePlugin log line.
  • fix(service-analytics)!: query_dataset refuses measures and dimensions the dataset does not declare #33958 (dataset-tools.ts): labels a dataset through resolveI18nLabel(label, locale), the inline I18nLabel object resolver. It takes no II18nService, builds no ResolveOptions, and reads no default locale. No interaction with translateSelectOptions or with this contract.
  • fix(service-storage)!: every upload bound resolves by one precedence, and unset never means unlimited #33883 (storage): no i18n line; labelsIn is intact after the merge.

Scenario from round 1 (defaultLocale: 'zh-CN', sourceLocale: 'en', no fallbackLocale): the traced options and answers are unchanged, since all five readers and both providers are byte-identical to the round 1 head apart from main's unrelated storage hunks.

Nits (none is to be fixed in code on this head):

Implemented-by: claude/project-thread-6v36u4
Reviewed-by: session_01ADHkmQjrEpxMVxEiDUJHqC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head b63efd0 · 2026-11-15T17:31Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: b63efd08913228c8b7b3ba3368e7e28a0512eaa6
Local-runs: none
Scope: round 3, the merge delta on round 2's scope (record 6898397912, head 74a2954d3240f2502a1dca09f9664b1ead81c51a): the same 28 PR files, the five reader sites, the two providers, II18nService, and the contracts api-surface ledger.

Read: round 2's record in full; the commit range 74a2954d..b63efd08; the merge commit's remerge diff; the PR diff against each head's merge base; main's side of the range (b4ce310b..e71ecc1b, 15 commits, 71 files) by file list and by added/removed lines carrying an i18n token; packages/spec/api-surface/contracts.json on both sides; the census greps on both head trees; the PR body and PR state as served at 2026-11-15T17:32Z (PR updated_at 17:31:54Z); card #34053; the check-runs on this head. Nothing was built or run.

① Derived judgments

  • Commits not on main between the two heads: exactly one, b63efd0891 — Merge remote-tracking branch 'origin/main' into claude/project-thread-6v36u4, parents 74a2954d and e71ecc1b32 (main's tip, and the PR's base sha now). No other branch commit.
  • The merge is content-neutral: RIGHT. git show --remerge-diff is empty (0 bytes): no conflict, no hand edit. git diff b4ce310b 74a2954d and git diff e71ecc1b b63efd08 are byte-identical, blob ids and hunk offsets included (same sha1); both are 28 files, +562/-70, as the API reports. All 28 PR files have the same blob at both heads; main's range touches none of them.
  • Every round 1 and round 2 judgment on the diff stands as written.

② Semver level

  • Unchanged: minor on the same nine packages, Clause-②: yes, Metadata-protocol: semantic. Main added ten changesets; none is for this PR's change. Check Changeset is still running on this head (see ④).

③ Boundary flags

  • Main b4ce310b..e71ecc1b vs the i18n contract: NO INTERACTION. No added or removed line under packages/, ui/packages/, skills/ or content/ carries getDefaultLocale, getSourceLocale, ResolveOptions, fallbackChain, sourceLocale, II18nService or getFallbackLocale. So: no new getDefaultLocale reader, no new builder of i18n ResolveOptions.
  • The five readers (rest meta-item-read-gate.ts, objectql formula-option-labels.ts, plugin-email option-label-table.ts, analytics plugin.ts, storage record-file-access.ts) and the two providers (memory-i18n.ts, file-i18n-adapter.ts): untouched by main; same blobs as round 2. Source-first reads on the merged tree at rest 3292, objectql 160, plugin-email 137, analytics 1194, storage 1349. The per-file census count (round 2's token list plus the service-taking tokens) is identical between the two head trees.
  • packages/spec/src/contracts/i18n-service.ts: untouched by main. Main's only edits under packages/spec/src/contracts/ are automation-service.ts and a new automation-dry-run.pin.test.ts (feat(spec): IAutomationService.dryRun contract, a dry run of an unpublished flow definition #33799).
  • Contracts api-surface ledger: main's one change is feat(spec): IAutomationService.dryRun contract, a dry run of an unpublished flow definition #33799, which adds 14 FlowDryRun* rows. The ledger lists exports by name (II18nService (interface), line 188), not members, so the PR's optional members add no row. The file is the same blob at this head and at main's tip; the PR does not touch it. The body's "api-surface unchanged" still holds.
  • PR body as served at 17:32Z:

④ Design judgment

No must-fix on the diff; the diff is the one round 2 passed. Nothing new from main.

  • S1 (should-fix, owed before ACCEPT, carried from round 2) — rewrite the body line to Skills-docs: follow-up #34053. A body edit only; it does not move the head. Not a FAIL of the diff.
  • N4 (nit, carried) — "six" → "five"; give the gates block a head line that is true of this head, or say it reports 5156e558 and that the two merges since are content-neutral.
  • N1–N3, N5: stand as written.

Check-runs on this head (GET commits/b63efd08/check-runs, 37 runs reported at 17:32Z): 11 success, 9 skipped, 17 in_progress, 0 failed. Success: Auto Label, Check Documentation Links, Check PR Size, Dogfood Regression Gate, Flag docs affected by code changes, Governed Surface Queue Guard, Lint · PM dispatch-gates, Lint · scoped · tooling self-tests, PR-body guards, Spec property liveness, filter. In progress: Build Core, Build Docs, Build UI Deps, Check Changeset, Lint · CI/release/engine gates, Lint · ESLint, Lint · docs & code guards, Lint · repo & tooling gates, the two other scoped lints, Live E2E UI, Plan Test Core shards, Plan Test UI shards, and the four Type Check jobs. The Test Core / Test UI shards have not been created yet. The PR is a draft, mergeable_state: blocked, no auto-merge.

CI is still running. This PASS is the design verdict only; landing waits for a green run on b63efd08, and ACCEPT waits for S1.

Implemented-by: claude/project-thread-6v36u4
Reviewed-by: session_01ADHkmQjrEpxMVxEiDUJHqC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

ACCEPT · PR #34025 (#33634) · head b63efd08913228c8b7b3ba3368e7e28a0512eaa6 · 2026-11-15T18:06Z

席位核对

  • 形态: 28 files, read from the PR's file list (+562 / −70).
    • Spec contract: II18nService gains optional getSourceLocale / setSourceLocale. Prose changes in i18n-resolver.ts and translation.zod.ts.
    • Two providers: memory-i18n.ts and file-i18n-adapter.ts.
    • AppPlugin threading.
    • Five readers, each source-first: rest, objectql, plugin-email, analytics, storage.
    • Two objectql type slices.
    • Tests beside each reader.
    • Four content/docs pages, plus the regenerated translation.mdx reference.
    • One changeset: minor on nine packages.
    • check-governed-merges.mjs --pr 34025: NOT governed, ≤ 3000 lines. A contract path is hit, so the contract review applies. Tier S, so the ACCEPT is the seat's own.
  • 前提实测: the seat read the remainder at TIER_DEFAULT.
    • The changeset gives the before/now of the card's scenario and the provider-author rule ("answer undefined, never defaultLocale"). It also says that a stack with no sourceLocale is served exactly as before.
    • The tests pin each reader's source-first read beside its existing chain test.
  • 契约复审: at CONTRACT_REVIEW_TIER, all rounds PASS:
    • r1 6897767543 @5156e558;
    • r2 6898397912 @74a2954d (main merge; S1 on the PR body);
    • r3 6898485597 @ this head (main merge; the three-dot diff and all 28 blobs are byte-identical).
    • S1 is closed: the seat re-read the body after the 17:32Z patch, and it now reads Skills-docs: follow-up #34053. N4 is also closed ("five option builders", plus a head line for b63efd08).
  • 门禁 check-runs: latest attempt on this head 72 runs: 60 success, 12 skipped, 0 failed, 0 cancelled.
  • 接受的偏差:
    • Inline source-first reads instead of a shared helper (open question answered A).
    • Surface beyond the claim (rest-server.ts docblock, two objectql type members, docs pages): prose or types only.
    • N2: one source locale per kernel, set but never cleared; same property as the fallback pair.
    • Both main merges were made under the seat's K ≥ 15 landing rule.
    • Clause-②: yes / Metadata-protocol: semantic.
  • 范围外去向:
  • 落地条款: ready + auto-merge now, under the maintainer's standing orders 「按照 pm-dispatch 规则复核过的都授权」 (2026-10-25T11:35Z) and 「你应该使用 pm-dispatch 技能审核和落地pr」 (2026-11-07T16:59Z). K = 2 first-parent commits on main past this head's merge base e71ecc1b (< 15).

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

Copy link
Copy Markdown
Contributor

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

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

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

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

  • Test Core (7/8) — 失败步骤: Run this shard's tests

    @objectstack/scenarios:test:  FAIL  test/runner/run-date.test.ts > every dated card, rebased onto each run date > run on 2028-03-31: today is the run date, every date moves as the card's rebase says, 
      ↳ 失败原因: @objectstack/scenarios:test: Error: Test timed out in 5000ms.
    

↳ 失败原因 是判读的关键:超时(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 队列共有 9 个失败构建(不含本次)。

分诊清单:

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

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

@github-actions

Copy link
Copy Markdown
Contributor

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

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

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

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

  • Test Core (7/8) — 失败步骤: Run this shard's tests

    @objectstack/scenarios:test:  FAIL  test/runner/run-date.test.ts > every dated card, rebased onto each run date > run on 2028-02-29: today is the run date, every date moves as the card's rebase says, 
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    @objectstack/scenarios:test:  FAIL  test/runner/run-date.test.ts > every dated card, rebased onto each run date > run on 2028-03-31: today is the run date, every date moves as the card's rebase says, 
      ↳ 失败原因: @objectstack/scenarios:test: Error: Test timed out in 5000ms.
    

↳ 失败原因 是判读的关键:超时(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 已在队列失败 2 次(不含本次)。 内容未变而反复失败 ⇒ 高度怀疑 flaky 测试或与同组 PR 的语义冲突,重排不解决。
  • 过去 24h 队列共有 27 个失败构建(不含本次)。

分诊清单:

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

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

@github-actions

Copy link
Copy Markdown
Contributor

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

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

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

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

  • Test Core (7/8) — 失败步骤: Run this shard's tests

    @objectstack/scenarios:test:  FAIL  test/runner/run-date.test.ts > every dated card, rebased onto each run date > run on 2028-02-28: today is the run date, every date moves as the card's rebase says, 
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    @objectstack/scenarios:test:  FAIL  test/runner/run-date.test.ts > every dated card, rebased onto each run date > run on 2028-02-29: today is the run date, every date moves as the card's rebase says, 
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    @objectstack/scenarios:test:  FAIL  test/runner/run-date.test.ts > every dated card, rebased onto each run date > run on 2028-03-31: today is the run date, every date moves as the card's rebase says, 
      ↳ 失败原因: @objectstack/scenarios:test: Error: Test timed out in 5000ms.
    

↳ 失败原因 是判读的关键:超时(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 已在队列失败 3 次(不含本次)。 内容未变而反复失败 ⇒ 高度怀疑 flaky 测试或与同组 PR 的语义冲突,重排不解决。
  • 过去 24h 队列共有 30 个失败构建(不含本次)。

分诊清单:

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

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Requeue · PR #34025 · head b63efd08913228c8b7b3ba3368e7e28a0512eaa6 · 2026-11-15T22:48Z

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 2068e03 Nov 15, 2026
73 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-6v36u4 branch November 15, 2026 23:21
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…ender adds, so /meta translates a dependent package's added fields (objectstack-ai#34156)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbSUQWB2j9eHYsRcrCiq1X1C)_

## 维护者速读

- **改了什么**:依赖包通过 `objectExtensions` 给基础包对象新增的字段(如 carbon 包给
`crm_account` 加的 `cb_market`),在中文等非默认语言下读 `/api/v1/meta/object`
时,字段名和选项名现在按该依赖包自己的翻译包显示,不再是英文。
-
**为什么改**:此前对象的"出厂基准"只算基础包自己声明的字段,依赖包加的字段被当成"后来手工改过",于是翻译一律不套用;新建记录表单读的就是这个接口,所以中文界面里出现英文选项。
- **风险与回滚**:只扩了基准里"基础包没声明、由代码依赖包新增"的字段;基础包自己的字段、对象名称、`fieldPatches`
改的文字、租户和 `.custom` 加的字段都按原样不动。回滚即 revert 本 PR。
- **先看**:`packages/objectql/src/registry.ts`(`packagedAddedFields` 与
`getPackagedObjectBase`,重写后的 ⛔
段)、`packages/objectql/src/protocol-packaged-object-base.test.ts`(边界钉子)、`packages/objectql/src/protocol-meta-effective-schema.test.ts`(中文读回再保存仍存英文原文)。
- **两分钟验证**:`pnpm --filter @objectstack/rest exec vitest run
--maxWorkers=2 src/meta-object-field-patch-i18n.test.ts`,预期 12
passed,其中新增组断言 zh-CN 下 `cb_market` 为「市场」、选项为「内销 / 出口」,基础包自己被改名的字段仍保持原文。
- **需要你做的**:无,席位落地。

Fixes objectstack-ai#33800

Half 2 of the card (a dependent package's `fieldPatches`
label/description getting its own translation) is out of this PR by
maintainer ruling 6896340775: D stands and it has its own card. Until
that card lands, patched text shows as written in every language.

Clause-②: no
Metadata-protocol: none

## What changes

**The defect, measured on `origin/main` 45dee17.** A select field
`cb_market` added by a dependent code package through
`objectExtensions`, with the zh-CN rows in that package's pack, was
served under zh-CN as `Market` / `Domestic` / `Export`. That held on the
item read and on the list read (`translateMetaDocument` /
`translateMetaList`, over a real `SchemaRegistry`). `translateObject`
worked as designed. Its input was the problem:
`SchemaRegistry.getPackagedObjectBase` returned the owner's declaration
alone, so the field had no packaged counterpart and every slot of it
counted as authored after the fact.

**Origin.** The label and option-label divergence checks came in with
objectstack-ai#29624 (59775a0, shipped in 18.3.0). It was not objectstack-ai#29948, and not 18.4.0:
the path is identical from 18.3.0 to 18.4.0 (measured:
`translateObject`, `packagedObjectField`, `valueOverridesPackagedBase`,
`getPackagedObjectBase` and `translateMetaDocument` agree at the 18.3.0
and 18.4.0 tags).

**The fix (seat ruling 6895879286, option A).** `getPackagedObjectBase`
now also carries every field that a CODE `extend` contributor adds under
a name the owner does not declare (`packagedAddedFields`). It uses the
same filter as `packagedRules` (`ownership === 'extend' &&
isCodeArtifactBody`). This extends objectstack-ai#27559's rule-name principle to field
names: the catalog rows for such a field can only translate what its
extender ships. Boundaries, each one pinned:
- An owner-declared field stays the owner's, even when an extender
redeclares it (objectstack-ai#8037).
- Same-name extenders resolve to the fold's winner (ascending priority).
- `fieldPatches` are not merged, and the scalars are untouched.
- Fields from a tenant overlay or a stored (`_provenance: 'org'`)
extension, the `.custom` pair's included, stay diverged.
- The ⛔ at the former registry.ts:8140 is rewritten and keeps the objectstack-ai#8037
reason.
- The base is returned BY REFERENCE only when no code extender ships a
rule or adds a field. No caller relies on reference equality: the
callers are `metadata-protocol`'s echo restore and base accessor, the
REST read gate, and objectql's `engine-validation-messages`, which reads
`.validations` only.

**The save door agrees with the read.** `restoreTranslatedObjectEchoes`
(objectstack-ai#29673) reads the same accessor. A zh-CN read of the added field,
echoed back by a PUT, is stored as the extender's source text (`Market`,
`Domestic`, `Export`), both over a stored row and with none.

**Extender-added `listViews`: not applicable, no card.**
`ObjectExtensionSchema` refuses `listViews` on an extension
(`packages/spec/src/data/object.zod.ts`, its guidance: "`listViews`
cannot be contributed through an object extension"). So
`translateObjectListViews` never sees a view an extender added.

**Stale comments rewritten:** the
`TranslateDocumentOptions.packagedBase` doc, the `packagedObjectField`
doc, the `translateObject` docblock sentence on undeclared fields, and
the `i18n-resolver.test.ts` comment on the undeclared-field pin. These
are comment-only changes in `@objectstack/spec`.

**Contract declaration.** `Clause-②: no`. No accept set, export, schema
or response shape changes, and nothing previously served is refused.
What changes is the label text that non-default-locale
`/api/v1/meta/object` reads serve for fields a code extender adds; the
changeset says so. Default-locale reads are unchanged. Not breaking, so
no `!`, banner or ADR-0087 marker, and the dogfood battery is not owed.

## Tests

- `packages/objectql/src/protocol-packaged-object-base.test.ts` (the
existing harness for `getPackagedObjectBase`, per ruling 6583487846): a
new top-level describe with 7 cases. The BY REFERENCE pin is flipped:
with the shared fixture's `loyalty_tier` extension the base is now a
copy that carries the field, and a label-only extension still returns
the owner by reference.
- `packages/rest/src/meta-object-field-patch-i18n.test.ts` (the existing
harness for the meta-object extension i18n exit): a new top-level
describe with 5 cases (item read, list read, base fields, owner field
redeclared, tenant-added field).
- `packages/objectql/src/protocol-meta-effective-schema.test.ts` (the
existing objectstack-ai#29673 door harness): a new top-level describe with 2 cases
(with and without a stored row).

Red before the fix (45dee17 + pins): objectql 4 failed / 9 passed; rest
4 failed / 8 passed (`expected 'Market' to be '市场'`).

## Acceptance notes

- **The reporter's package shape (seat item 2) was not measured
directly**: `steedos-labs/os-project-blackcat-crm` is not readable from
this session. The card's own facts point to a code package rather than a
stored `object_extension` row. The fields come in "through
`objectExtensions`" (the manifest key of a code package), they carry no
`__c` suffix, and the package "passes validate".
- Extender-added `listViews`: none can exist (the extension schema
refuses the key), so there is nothing to translate and no card to file.
- The seat ruling asks the reporter to confirm which page and version
their 18.3.0 Chinese reading came from. On this path 18.3.0 and 18.4.0
behave the same (objectstack-ai#29624 shipped in 18.3.0).

## Verification

All on head `ecffbe8d0` (origin/main `86350e125` merged), unless a line
names another head.

<details><summary>Pins, typecheck, generated artifacts (locked, final
head)</summary>

```
os-verify-lock: VERDICT command-exit 0 · held the lock 904s
closure   :: exit 0 :: pnpm --workspace-concurrency=2 --filter @objectstack/rest... build
pins-oql  :: exit 0 :: Test Files 2 passed (2) :: Tests 38 passed (38)
pins-rest :: exit 0 :: Test Files 1 passed (1) :: Tests 12 passed (12)
oql-tc    :: exit 0 :: pnpm --filter @objectstack/objectql typecheck
rest-tc   :: exit 0 :: pnpm --filter @objectstack/rest typecheck
spec-gen  :: exit 0 :: pnpm --filter @objectstack/spec check:generated
dts-closure / published-files / sourcemap-no-sources-content / lean-entry-closure / test-source-alias / nul-bytes / type-check-debt :: exit 0
```
</details>

<details><summary>Package suites (head c856cd3: the fix merged with
origin/main fb79d47; the final head adds only a test import and a main
merge that touches no package of this diff's behaviour)</summary>

```
oql-test  :: exit 0 :: Test Files 598 passed (598) :: Tests 13250 passed (13250)
mp-test   :: exit 0 :: Test Files 342 passed | 9 skipped (351) :: Tests 22923 passed | 43 skipped
rest-test :: exit 0 :: Test Files 413 passed (413) :: Tests 8459 passed | 332 skipped
spec-test :: exit 0 :: Test Files 843 passed (843) :: Tests 26966 passed | 1 todo
```
</details>

<details><summary>Ablations (each leg: ablation-replace, objectql build,
ablation-dist-preflight, pins, restore with blob == HEAD)</summary>

```
A1 drop the owner-declared guard     -> 3 red: BY REFERENCE (label-only/redeclare), owner's redeclared field (objectql), owner field redeclared (rest)
A2 drop the code-artifact filter     -> 1 red: carries nothing from a stored (tenant-provenance) extension
A3 fold code fieldPatches into base  -> 7 red: does not fold fieldPatches (objectql) + 6 of the published fieldPatches cases (rest)
final build exit 0 · absent-preflight exit 0 · every leg "restored == HEAD blob"
```
A3's first run was a no-op: the anchor sat inside its own replacement,
and ablation-replace refused it with a drop of 0. It was rerun with a
different anchor, and the line above is that rerun. A1's first run
failed the dts build (an unused binding) and was rerun clean.
</details>

<details><summary>Gate sweep and PR-body gates</summary>

`dispatch-gates --commands` derived 93 families. 92 were run locally
with exit codes recorded and exit 0, after one fix:
`check:test-source-alias` asked for a module-top `@objectstack/spec/ui`
import in the rest pin file, which is added.
`check:dual-build-cjs-loads` is left to CI. `pnpm lint` exit 0. Run with
this body: `check-changeset-no-major`, `check-adr-0087-registration`,
`check-closing-keyword-parity`, `check-partof-closing-keyword`, all exit
0. `git merge-tree --write-tree` is clean against origin/main, objectstack-ai#33821
(already merged) and objectstack-ai#34025 (the one open PR touching
`i18n-resolver.ts`).
</details>

---

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

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 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