Skip to content

docs(skills): the i18n skill says what the locales read answers about the default and source locale - #37614

Merged
os-zhuang merged 1 commit into
mainfrom
claude/project-thread-gvxx96-36873
Nov 26, 2026
Merged

os-zhuang merged 1 commit into
mainfrom
claude/project-thread-gvxx96-36873

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

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

维护者速读

  • 用户能看到什么变化:AI 助手照多语言技能文档写客户端时,现在知道 GET /api/v1/i18n/locales 的应答里除了标出默认语言,还会给出 sourceLocale,也就是界面上直接写的文字是哪种语言。以前文档只说了有这个接口,没说它返回什么。
  • 为什么做:这个字段已经由 feat(i18n): a design-mode menu rename outside the source language is stored as that language's translation #36858 加到接口里,技能文档还没跟上,是那张卡欠下的技能说明。
  • 出错会怎样:只改技能文字,不动产品。写错的话助手可能把译文写到错误的语言上,撤回这次改动即可。为了不让文档变长,同一文件里压缩了两处说法,没有删掉任何事实。
  • 要你做什么:这是受管的技能文件,需要审批人批准后才能合并。

What changes

skills/objectstack-i18n/SKILL.md, plus a patch changeset for @objectstack/skills.

  • Registration (the sentence that names the plugin's routes). Before: "It self-registers GET /api/v1/i18n/locales, /translations/:locale and /labels/:object/:locale." After, it adds: "the locales answer marks the default locale (isDefault) and names sourceLocale (the declared one, else the default)". Checked against GetLocalesResponseSchema in packages/spec/src/api/protocol.zod.ts.
  • Paid in the same file, no fact removed, net line count unchanged:
    • The note that the contract's .ts source does not ship is now one line ("Only src/**/*.zod.ts ships, so the contract's .ts source is not in node_modules to read.").
    • The optional-methods sentence drops "Treat them as" ("… that no shipped implementation provides: extension points for a custom workbench or TMS adapter.").

Small calls made here (no card):

  • The clause sits at the Registration sentence rather than the sourceLocale config-table row, because that is where a client author meets the route.
  • It does not say the member is absent when the server knows neither a declared source locale nor a default (the schema's .describe()), nor name the answer's other optional member, fallbackChain. The card asks for one clause on sourceLocale only.

Why

PR #36858 (#36504) made GET /api/v1/i18n/locales name 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.md is 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 --tier requires for skills/**, and reviewed and narrowed here.

Contract review (L2) is owed before landing: skills/** is a governed surface (Tier H).

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed (not touched).
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj


Generated by Claude Code

… the default and source locale

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 911e5701cb0e85f1c16a14ffa74f2619ff244a1e
Local-runs: none
Scope: skills/objectstack-i18n/SKILL.md + none
Security-touching: no

Inputs read: card #36873 (body and its three comments: triage, unlock, claim), PR #37614 (body, file list, net diff against main), and the check-runs on this head. Code on origin/main (54d6726c09) was read to judge the prose, never reviewed. The diff is two files: the skill (6 lines replaced by 6, no new paragraph) and one changeset. Nothing in the diff implements or enforces the skill, so the scope is the hits file alone; the changeset is outside the review face.

① Derived judgments

  • Accept set: unchanged. No schema, validator, gate or generated file is in the diff. Right.
  • Public surface: three sentences of skills/objectstack-i18n/SKILL.md, which ships verbatim in @objectstack/skills. One sentence gains a clause, two are compressed. Each was checked against main:
    • Added clause, "the locales answer marks the default locale (isDefault) and names sourceLocale (the declared one, else the default)". Right. GetLocalesResponseSchema (packages/spec/src/api/protocol.zod.ts) carries locales[].isDefault and a top-level optional sourceLocale. The one producer of the answer, packages/runtime/src/domains/i18n.ts, builds the descriptors with toLocaleDescriptors(getLocales(), getDefaultLocale()) (isDefault is code === defaultLocale) and sets sourceLocale to getSourceLocale() || defaultLocale. AppPlugin threads the declared i18n.sourceLocale into the service, and both shipped providers (FileI18nAdapter, core's in-memory fallback) implement both accessors. The clause agrees with the skill's own config-table row ("optional, defaults to defaultLocale").
    • Compressed, "(Only src/**/*.zod.ts ships, so the contract's .ts source is not in node_modules to read.)". Right in substance. packages/spec/package.json files lists src/**/*.zod.ts as the only src entry, and the contract is src/contracts/i18n-service.ts. No fact of the old sentence is dropped. See N2 for the wording.
    • Compressed, "The contract declares optional methods — getFieldLabels, getCoverage, suggestTranslations — that no shipped implementation provides: extension points for a custom workbench or TMS adapter." Right. The three are optional on II18nService and no provider in packages/ defines any of them; the dispatcher's labels route probes getFieldLabels and takes the bundle derivation. Dropping "also" and "Treat them as" removes no fact.
  • Gate verdicts: every check-run on this head concluded success or skipped, the skills gates (inside "Lint · repo & tooling gates"), "Check Changeset" and "Governed Surface Queue Guard" included.

② Semver level

'@objectstack/skills': patch matches what the diff publishes: prose in a published skill, the level every other skills-only changeset on main uses. Clause-②: no is right, on the PR body and the changeset alike: the diff changes no accept set and narrows nothing, it names a member the route already answers on main. Metadata-protocol: none is right, the member was added by PR #36858.

③ Boundary flags

  • Dev flag, placement: the clause sits at the Registration sentence, not beside the sourceLocale config row. Answered: the card's To-do 1 allows either place, and the route sentence is where a client author meets the answer.
  • Dev flag, omissions: the clause does not say the member can be absent, and does not name fallbackChain. Answered, accepted. The wording is the card's To-do 1 verbatim. On main the member is absent only when the i18n provider reports neither a declared source locale nor a default locale; both shipped providers always report a default, so the answer under os serve always carries it. A custom provider that implements neither accessor is the one case, and the SDK's response type already marks the member optional. fallbackChain is outside the card.
  • open_questions: none on the card or the PR.
  • Card To-do 2 (keep the line budget, replace words, no new paragraph): held, 6 lines out and 6 in.
  • Author: the PR's user.login is objectstack-fleet[bot], no relay note is owed.
  • SQL push-down: not applicable, the diff carries no code.

④ Design judgment

skills/objectstack-i18n/SKILL.md, judged against the card's scenario (an agent building a client that must write translations in the right language gets a pointer to the served source locale) and the spec and producer on main. The change holds. The reader now learns, at the one place the skill names the route, that the answer marks the default locale and names the source locale, and both statements are true of the only code path that serves the route. Tried to break it on: a second producer answering in another shape (there is none; toLocaleDescriptors has one caller and the HTTP mount dispatches into the same domain), the in-memory fallback not reporting a declared source locale (it does), the collapse order (declared first, then default, as written), and a contradiction with the skill's other sourceLocale statements (none).

No must-fix, no should-fix.

  • N1 (nit) — pre-existing, not introduced by this diff, on the sentence the new clause is appended to: "It self-registers GET /api/v1/i18n/locales, …" names I18nServicePlugin as the registrant. On main that plugin mounts no HTTP route (its class docblock says so, since runtime/service-i18n: the i18n paths have two owners, and the likely live one (the dispatcher) relays an undeclared 5xx's caught text unless it reads like SQL, so #23174's plugin-mount withholding may be shadowed (read from source, not yet measured) #23347); the dispatcher bridge (createDispatcherPlugin, packages/runtime/src/dispatcher-plugin.ts) mounts the three paths and answers them from whichever provider fills the i18n slot. No effect on this change or on a builder under os serve: the routes are mounted and answer as the clause says. A builder composing a kernel by hand would read it wrong. Best carried by a follow-up card (one sentence, same file) rather than widened into this PR.
  • N2 (nit) — "Only src/**/*.zod.ts ships" now leads its sentence, where the old text scoped the same words under "the contract's source .ts is not part of the published package". Read alone it can be taken as the whole published file set, and dist (where the import one line above resolves) ships too. The src/ prefix keeps the intended reading the likely one. Accepted deviation, or a wording fix on this prose face.

Implemented-by: claude/project-thread-gvxx96-36873
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

@objectstack-fleet objectstack-fleet Bot mentioned this pull request Nov 26, 2026
3 tasks
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — ACCEPT · head 911e570 · card #36873 · area s2-ux-T · 2026-11-26T16:02Z

L1 checklist

  • Shape and relation: l1-face.mjs --pr 37614 CLEAN on 13 items. At 911e570 every check-run is success or an expected skip, with 0 pending. 22 changed lines.
  • Fixes #36873 is right. The card asks for one clause saying the GET /api/v1/i18n/locales answer marks the default locale (isDefault) and names sourceLocale (the declared one, else the default), with words replaced and no paragraph added. That clause is at the Registration sentence, which the card allows.
  • Scope: 2 files, skills/objectstack-i18n/SKILL.md (+6 / −6) and the changeset (@objectstack/skills patch).
    • Two compressions pay for the clause under the token ratchet: the line on which .ts sources ship, and the optional-methods sentence. L2 checked both against main, and neither drops a fact.
    • The thread narrowed the drafting subagent's wider rewrite, which had dropped the self-registration fact, back to these hunks.
  • Built at the mandated tier: the edit was drafted by a CONTRACT_REVIEW_TIER subagent at effort medium, as the claim's Container & model line prescribes, and checked by the area thread.
  • Sentence-by-sentence read of the changeset: it matches the hunks. Clause-②: no and Metadata-protocol: none are right for published prose only.
  • L2: the Contract review record 7197064778 at CONTRACT_REVIEW_TIER on this head is a PASS with no must-fix and no should-fix. Security-touching: no.
    • N1: the sentence the clause joins still names the i18n service as the route's registrant, which predates this PR. It goes to follow-up review follow-ups of PR #37614 #37625, with the two spec comments that repeat it.
    • N2: "Only src/**/*.zod.ts ships" leads its sentence. It is accepted as a deviation, since the src/ prefix keeps the reading.
  • Overlap: skills: objectstack-i18n lists the object translation sub-keys but not _milestones.<field>.<value>.summary once PR #37582 lands #37585 edits the same file (object-translation rows, different hunks) and is pm:blocked behind feat(spec,plugin-audit): an activity milestone's timeline row reads in the reader's language #37582; whichever lands second re-measures the ratchet.
  • Governed: Tier H (skills/**).

Tier: H. Landing: hand-off to the approver by the next stroke; ⛔ the seat does not merge.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Tier H hand-off · 2026-11-26T16:03Z · head 911e570 · approver os-zhuang

维护者速读

  • 改了什么:对外发布的翻译技能(objectstack-i18n)里讲语言列表接口的那句话,补上了接口返回的两样信息:哪个语言是默认语言,以及应用的原文语言(声明了就是声明的,没声明就是默认语言)。接口在 main 上早就返回这两项,只是技能没写。为了不超出技能篇幅上限,同一文件里有两句压缩了措辞,没有删掉任何事实。
  • 影响:照技能写客户端的 AI 能知道服务器会告诉它原文是什么语言,翻译不会写错方向。代码和平台行为都不变。
  • 审核:席位 L1 ACCEPT(本评论前一条);契约审核档 L2 PASS 7197064778,没有必须改或建议改的项。一条旧问题(同一句里说路由由翻译服务自己注册,实际是分发器注册)已立后续卡 review follow-ups of PR #37614 #37625。
  • 要你做什么:这是受管的 skills/** 面,需要你批准后才能合并。撤回这一次合并即可恢复原文。

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 26, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 26, 2026 16:23
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 2eadf56 Nov 26, 2026
50 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-gvxx96-36873 branch November 26, 2026 16:57
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 pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/s tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skills: objectstack-i18n names GET /api/v1/i18n/locales but not the sourceLocale member PR #36858 adds to its answer

3 participants