Repository navigation
docs(skills): the i18n skill says what the locales read answers about the default and source locale - #37614
Conversation
… the default and source locale Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: Inputs read: card #36873 (body and its three comments: triage, unlock, claim), PR #37614 (body, file list, net diff against ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
No must-fix, no should-fix.
Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head 911e570 · card #36873 · area s2-ux-T · 2026-11-26T16:02ZL1 checklist
Tier: H. Landing: hand-off to the approver by the next stroke; ⛔ the seat does not merge. |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Tier H hand-off · 2026-11-26T16:03Z · head 911e570 · approver 维护者速读
|
objectstack-ai#37675) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuPE7uyDAJyqjwwMzomWv5ff)_ Fixes objectstack-ai#37625 Clause-②: no (published prose and comments only; no behaviour changes) Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:多语言技能文档里,「语言接口由翻译服务自己注册」这句话改成了「由运行时的 HTTP 分发器挂载,数据来自翻译服务」,同时在方法清单里补上 `getSourceLocale()` / `setSourceLocale()`。两处 spec 代码注释也做了同样的更正。代码和平台行为都不变。 - 为什么做:objectstack-ai#37614 的审核发现这句话与 main 不符:翻译服务从 objectstack-ai#23347 起就不再挂任何 HTTP 路由。自己手工组装内核的开发者照旧文档做,会以为装了翻译服务就有这三个接口,实际上没有。 - 出错会怎样:只改文字,撤回即可。为了不超出技能篇幅上限,同一文件里压缩了四处措辞,没有删掉事实。 - 要你做什么:这是受管的技能文件,需要审批人批准后才能合并。 ## What changes - **`skills/objectstack-i18n/SKILL.md`, Registration.** Before: "It self-registers `GET /api/v1/i18n/locales`, `/translations/:locale` and `/labels/:object/:locale`; …". After: "The runtime's HTTP dispatcher, which `os serve` composes, mounts `GET /api/v1/i18n/locales`, `/translations/:locale` and `/labels/:object/:locale`, served from the i18n service; …". The rest of the sentence (the `isDefault` / `sourceLocale` clause) is unchanged. Checked on `main`: `packages/services/service-i18n/src/i18n-service-plugin.ts:27-39` ("It mounts NO HTTP route", naming `createDispatcherPlugin` the one owner); `packages/runtime/src/dispatcher-plugin.ts:1752`, `:1761`, `:1770` mount the three paths; `packages/cli/src/commands/serve.ts` composes `createDispatcherPlugin`. - **Same file, methods list (the card's optional item).** The `getLocales()` bullet gains `getSourceLocale()` / `setSourceLocale()`: both shipped implementations provide them (`file-i18n-adapter.ts:302`, `:307`; `core/src/fallbacks/memory-i18n.ts:275`, `:280`). `getFallbackLocale()` is left out: the file adapter has it (`:285`) but the in-memory fallback deliberately does not (its docblock at `:254`), and the list is "methods both shipped adapters implement". - **Paid in the same file, no fact removed** (6306 → 6333 tokens, ceiling 6333): "is not in `node_modules` to read" → "is not in `node_modules`"; "Methods implemented by both shipped adapters" → "Methods both shipped adapters implement"; "full snapshot for a locale" → "a locale's full snapshot"; "You do not wire this plugin" → "Don't wire this plugin". - **Spec comments.** The `GetLocalesResponseSchema` docblock (`packages/spec/src/api/protocol.zod.ts`) said the descriptor helper is shared by the dispatcher's `/i18n` domain "and `service-i18n`'s autonomous route"; it now names the dispatcher as the route's one owner (`service-i18n` mounts none since objectstack-ai#23347). The `toLocaleDescriptors` comment (`packages/spec/src/system/i18n-resolver.ts`) now says both once served the route and the dispatcher owns it. Comments only: no schema, describe or export changes. - **Changeset**: `@objectstack/skills` and `@objectstack/spec` patch. Small calls made here (no card): the skill names "the runtime's HTTP dispatcher, which `os serve` composes" rather than the internal `createDispatcherPlugin` name, which a client author cannot act on. ## Why Review N1 of PR objectstack-ai#37614 (contract record 7197064778): a shipped skill stated a wrong fact about where the i18n routes come from. ## Verification Run at `a359107dd`, each exit 0: - `node scripts/check-skills-token-ratchet.mjs` (`skills/objectstack-i18n/SKILL.md` 6333/6333). - `node scripts/check-skill-links.mjs`, `node scripts/check-skill-identifier-liveness.mjs`, `node scripts/check-skill-top-level-keys.mjs`. - `pnpm --filter @objectstack/spec check:skill-refs`, `check:skill-docs`. - `node scripts/pm/overlap-check.mjs`: clean (objectstack-ai#37422 and objectstack-ai#37366 share `i18n-resolver.ts` and merge cleanly). The skill edit was drafted by a contract-tier subagent, as `dispatch-gates --tier` requires for `skills/**`, and checked here against the cited lines; the spec comments were edited here. Contract review (L2) is owed before landing: `skills/**` is a governed surface (Tier H). ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed (comments only; none change). - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgUpnvPnJ1hR74pUrVj --> Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
Fixes #36873
Clause-②: no (published prose only; names a member the locales read already returns on main)
Metadata-protocol: none
维护者速读
GET /api/v1/i18n/locales的应答里除了标出默认语言,还会给出sourceLocale,也就是界面上直接写的文字是哪种语言。以前文档只说了有这个接口,没说它返回什么。What changes
skills/objectstack-i18n/SKILL.md, plus apatchchangeset for@objectstack/skills.GET /api/v1/i18n/locales,/translations/:localeand/labels/:object/:locale." After, it adds: "the locales answer marks the default locale (isDefault) and namessourceLocale(the declared one, else the default)". Checked againstGetLocalesResponseSchemainpackages/spec/src/api/protocol.zod.ts..tssource does not ship is now one line ("Onlysrc/**/*.zod.tsships, so the contract's.tssource is not innode_modulesto read.").Small calls made here (no card):
sourceLocaleconfig-table row, because that is where a client author meets the route..describe()), nor name the answer's other optional member,fallbackChain. The card asks for one clause onsourceLocaleonly.Why
PR #36858 (#36504) made
GET /api/v1/i18n/localesname the source locale. The skill named the route and said nothing about its answer, so an agent building a client that writes translations had no pointer to it.Verification
Run at
911e5701c, each exit 0:node scripts/check-skills-token-ratchet.mjs:skills/objectstack-i18n/SKILL.mdis 6306 tokens, ceiling 6333.node scripts/check-skill-links.mjs.node scripts/check-skill-identifier-liveness.mjs.node scripts/check-skill-top-level-keys.mjs.pnpm --filter @objectstack/spec check:skill-refs: 10 generated files in sync.pnpm --filter @objectstack/spec check:skill-docs: in sync.node scripts/pm/overlap-check.mjs.The sentence was drafted by a contract-tier subagent, as
dispatch-gates --tierrequires forskills/**, and reviewed and narrowed here.Contract review (L2) is owed before landing:
skills/**is a governed surface (Tier H).Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed (not touched).content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
Generated by Claude Code