Skip to content

docs(skills): teach the five-step locale ladder resolveLocaleAmong runs - #30700

Merged
os-zhuang merged 1 commit into
mainfrom
claude/project-thread-on5got
Nov 6, 2026
Merged

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

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

Fixes #30603

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:objectstack-i18n 技能里讲内存兜底语言匹配顺序的那一句,从旧的四步改成代码实际跑的五步,并点名 resolveLocaleAmong,给出 zh-TW → zh-Hant 的例子。
  • 为什么改:PR fix(spec,core): resolve locales through the platform table's read aliases, so a zh-TW / zh-HK reader gets zh-Hant #30601 让两个服务端解析器共用 resolveLocaleAmong,在大小写不敏感和基础语言之间加了“平台语言表”一步;旧句子会让 AI 以为 zh-TW 落到第一个注册的 zh-*(可能是简体)。
  • 风险与回滚:只改一句文档加一个 changeset,不动代码;回滚即 revert 本 PR。
  • 先看:skills/objectstack-i18n/SKILL.md 第 376–379 行那一处 hunk。
  • 两分钟验证:node scripts/check-skills-token-ratchet.mjs | grep objectstack-i18n/SKILL,预期 5718 tokens(上限 6333,未抬上限)。
  • 需要你做的:Tier H(skills/**),请在席位契约复核通过后审批合并。

What changes

skills/objectstack-i18n/SKILL.md: the sentence on the in-memory fallback's locale matching now names the ladder resolveLocaleAmong (@objectstack/spec/system) runs, the one resolveBundleLocale also runs, in the code's order: exact, case-insensitive, same platform-table language (zh-TW → zh-Hant), base language, first registered variant. One root changeset, '@objectstack/skills': patch. No other skill text changes; no eval case added (the eval fixtures carry no locale-ladder case, and the card scopes the sentence alone).

The five steps are read off origin/main b77c160a: packages/spec/src/system/i18n-resolver.ts (resolveLocaleAmong, steps 1 to 5) and its test resolveLocaleAmong answers the same over a list (zh-TW among en, zh-CN, zh-Hant answers zh-Hant); core's resolveLocale in packages/core/src/fallbacks/memory-i18n.ts returns resolveLocaleAmong directly.

Tests

Docs-only diff under skills/**; no package code or test changes, so no package test or typecheck owed.

Acceptance notes

  • Token readings (ceil(utf8 bytes / 4), release-stamp line excluded), whole file: skills/objectstack-i18n/SKILL.md 5673 → 5718 tokens (+45), ceiling 6333 unchanged, headroom 660 → 615. Lines 520 → 522; bytes 22712 → 22891.
  • Whole package: bundle total (whole shipped tree) 226234 → 226279 tokens (+45); all SKILL.md files summed 4534 → 4536 lines.
  • The +45 is paid inside the existing ceiling's headroom; no ceiling raised. The dispatch pins "no other skill text changes", so no same-file deletion elsewhere in the skill was made.

Verification

Every reading below is on head d9c1c6b4 (base origin/main b77c160a).

  • node scripts/pm/dispatch-gates.mjs --ran: 44 derived families accounted for, 44 run, 0 NOT-MEASURED, 0 UNRUN; every family exit 0.
  • pnpm lint: exit 0.
  • node scripts/check-skills-token-ratchet.mjs: exit 0; skills/objectstack-i18n/SKILL.md is 5718 tokens (ceiling 6333; headroom 615).
  • node scripts/check-commit-card-trailers.mjs --range origin/main..HEAD: exit 0.
  • Five families first exited 3 (prerequisite: no dist): check:doc-formula-expressions, check:dts-closure, check:dual-build-cjs-loads, check:lean-entry-closure, check:sourcemap-no-sources-content. After a whole-tree turbo run build under os-verify-lock.sh (VERDICT command-exit 0), all five exit 0; those are the recorded codes.
Per-family exit codes
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-doc-route-spelling.mjs --advisory :: exit 0
node scripts/check-doc-route-spelling.mjs --self-test :: exit 0
node scripts/check-dts-emitted.mjs --self-test :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-skills-token-ratchet.mjs :: exit 0
node scripts/check-skills-token-ratchet.mjs --self-test :: exit 0
node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/spec run check:skill-docs :: exit 0
pnpm check:agent-test-spelling :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:corpus-claim-drift :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:merge-driver :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pm-skill-id-lint :: exit 0
pnpm check:published-files :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:role-word :: exit 0
pnpm check:skill-compatibility :: exit 0
pnpm check:skill-frame-sync :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm check:dts-closure :: exit 0
pnpm check:dual-build-cjs-loads :: exit 0
pnpm check:lean-entry-closure :: exit 0
pnpm check:sourcemap-no-sources-content :: exit 0
pnpm lint :: exit 0

Generated by Claude Code

The objectstack-i18n skill still taught the in-memory fallback's old
four-step ladder. Both server resolvers now share resolveLocaleAmong,
which maps the request through the platform locale table between the
case-insensitive and base-language steps, so zh-TW reaches a registered
zh-Hant bundle. The sentence now names the five steps in code order,
names resolveLocaleAmong, and gives the zh-TW to zh-Hant example.

Claude-Session: https://claude.ai/code/session_016WV4czZcAEZpkY6CfBWJY7
Co-authored-by: Claude <noreply@anthropic.com>
@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 5, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-elon-musk · session_016WV4d1mkgEris4MHHLjtnk

Contract-review-claim: session_016WV4d1mkgEris4MHHLjtnk · head d9c1c6b · 2026-11-05T22:41Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-elon-musk · session_016WV4d1mkgEris4MHHLjtnk

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: d9c1c6b4fb7f49c04fa20511bcad2d0910b9db91
Local-runs: none
Scope: skills/objectstack-i18n/SKILL.md (hits) + .changeset/30603-i18n-skill-locale-ladder.md; cited packages/spec/src/system/i18n-resolver.ts, i18n-resolver.test.ts, platform-locales.ts, packages/spec/export-origins/system.json, packages/core/src/fallbacks/memory-i18n.ts, fallbacks.test.ts, scripts/check-skills-token-ratchet.mjs, packages/skills/package.json, skills/objectstack-i18n/evals/bundles-locales-coverage.json, skills/objectstack-i18n/references/_index.md

① Derived judgments

  • Two files: SKILL.md (+4/−2, L376-379) and a root changeset. No packages/**; no accept set moves. Clause-②: no correct.
  • One ladder: resolveBundleLocale returns resolveLocaleAmong after an exact fast path (i18n-resolver.ts:521-527); core's resolveLocale imports and returns it (memory-i18n.ts:3, :51-53); exported (export-origins/system.json:861). Unchanged between b77c160a and origin/main 788715ef.
  • Five steps in the code's order (i18n-resolver.ts:560-584): exact, case-insensitive, platformLocaleTagOf (:568-575, platform-locales.ts:115-118), base language (:577-580), first registered variant (:582-584). The skill matches exactly.
  • zh-TW → zh-Hant is pinned by i18n-resolver.test.ts:1100-1101 and fallbacks.test.ts:306-307 (both registration orders); the kept zh-CN → zh and zh → zh-CN examples match steps 4 and 5.
  • No other sentence in the skill or its references teaches the old ladder.

② Semver level

'@objectstack/skills': patch with Clause-②: no / Metadata-protocol: none line-initial; not skip-changeset. Matches the PR body.

③ Boundary flags

  • PR author objectstack-fleet[bot]. open_questions: none. Fixes #30603 present.
  • Deviation "+45 tokens from headroom": the order pins no other text change; ceiling 6333 unchanged (check-skills-token-ratchet.mjs:515), 5673 → 5718. Accepted.
  • Deviation "no eval case": no convention requires one per corrected rule (skills/README.md:74-75); accepted.
  • Check-runs at 2026-11-05T22:56Z: 41 runs, all success or skipped, none in progress.

④ Design judgment

  • skills/objectstack-i18n/SKILL.md L376-379: states exactly the ladder resolveLocaleAmong runs, names both resolvers and the import path, and gives the zh-TW → zh-Hant example; satisfies the card's Wanted clause and its scenario. Nothing else in the skill contradicts it.
  • must-fix: none. should-fix: none.

Implemented-by: claude/project-thread-on5got
Reviewed-by: session_016WV4d1mkgEris4MHHLjtnk

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-elon-musk · session_016WV4d1mkgEris4MHHLjtnk

维护者速读

  • 改了什么:objectstack-i18n 技能里讲内存兜底语言匹配顺序的那一句,从旧的四步改成代码实际跑的五步(精确 → 大小写不敏感 → 平台语言表同语言 → 基础语言 → 第一个注册的变体),点名两个解析器共用的 resolveLocaleAmong,并给出 zh-TW → zh-Hant 的例子。
  • 为什么改:PR fix(spec,core): resolve locales through the platform table's read aliases, so a zh-TW / zh-HK reader gets zh-Hant #30601 让两个服务端解析器共用 resolveLocaleAmong,并加了“平台语言表”一步;旧句子会让 AI 以为 zh-TW 落到第一个注册的 zh-*(可能是简体)。
  • 风险与回滚:只改一句技能文档加一个 changeset,不动代码;回滚即 revert 本 PR。
  • 先看:skills/objectstack-i18n/SKILL.md 第 376–379 行。
  • 两分钟验证:node scripts/check-skills-token-ratchet.mjs | grep objectstack-i18n/SKILL,预期 5718 tokens(上限 6333,未抬)。
  • 需要你做的:批准并合并(skills/** 为 Tier H)。契约复核 PASS 评论 6671733547,Head-sha d9c1c6b4fb7f49c04fa20511bcad2d0910b9db91。
  • 席位意见:可合。

席位核对 — ACCEPT · head d9c1c6b

  • 形态:2 文件 +12/−2(SKILL.md 一句 + 根 changeset '@objectstack/skills': patch)。governed skills/**(Tier H),14 行 ≤ 3000。Fixes #30603,draft,目标 main,作者 objectstack-fleet[bot]。
  • 契约:Clause-② no,Metadata-protocol none,与认领 6670616394 一致;无 Skills-docs: 行欠。
  • 前提实测:dev 报告 6671428078;五步顺序与例子逐条对 i18n-resolver.ts:560-584 及两份测试核过(复核记录 ①)。
  • 门禁 check-runs:head 上 41 个,28 success,13 skipped,0 红。
  • 接受的偏差:+45 tokens 用余量付(派发单不许改其他技能文字,上限未抬);未加 eval(无约定要求)。
  • 范围外去向:无。
  • 落地条款:Tier H,等 governed 审批人批准;批准后席位经中继 pr_ready + automerge_enable,合并后核 skills/objectstack-i18n: the in-memory fallback's locale ladder omits the platform locale table step that PR #30601 adds #30603 已关、摘 pm:dispatched。

@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 5, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 6, 2026 00:57
@os-zhuang
os-zhuang enabled auto-merge November 6, 2026 00:57
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 254f2ec Nov 6, 2026
47 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-on5got branch November 6, 2026 01:16
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: the in-memory fallback's locale ladder omits the platform locale table step that PR #30601 adds

2 participants