Skip to content

test(i18n): give the studio zh-only key families one home - #27289

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-qipkqe
Oct 28, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-qipkqe

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread

Fixes #27250

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:studio 命名空间里「只有中文、没有英文」的三个键族前缀,原先在 i18n 包和 app-shell 包的两个测试里各抄一份;现在只在 i18n 的一个测试辅助文件里写一次,app-shell 的测试断言自己那份理由清单的前缀与它完全相等。
  • 为什么改:两份清单各自都会拦住清单外的键,但互不对照,以后有人只改其中一份,两边就会对「哪些中文独有键是允许的」说法不一,却没有任何测试变红。
  • 风险与回滚:只动测试,不改任何运行时代码、不发布任何东西;回滚就是 revert 这一个提交。
  • 先看:ui/packages/app-shell/src/views/metadata-admin/inspectors/inspectorStrings.studioNamespace-25922.test.ts 新增的相等断言;ui/packages/i18n/src/__tests__/studio-zh-only-families.ts;ui/packages/i18n/src/__tests__/studio-namespace.test.ts。
  • 两分钟验证:在仓根跑 pnpm --dir ui exec vitest run packages/i18n/src/__tests__/studio-namespace.test.ts packages/app-shell/src/views/metadata-admin/inspectors/inspectorStrings.studioNamespace-25922.test.ts,应看到两个文件全绿;在任一清单里多加一个前缀,应只有「a reason is given for exactly the families the i18n pin allows」这一条变红。
  • 需要你做的:无,席位落地。

What changes

  • New test-support module ui/packages/i18n/src/__tests__/studio-zh-only-families.ts exports STUDIO_ZH_ONLY_FAMILIES, the three zh-only prefixes (engine.flowNode., engine.enum.type., engine.packages.form.help.). It sits under __tests__/, which the package's tsconfig.json excludes, so it is not in dist and nothing is added to @object-ui/i18n's exports map.
  • studio-namespace.test.ts drops its local ZH_ONLY_FAMILIES literal and reads the module.
  • inspectorStrings.studioNamespace-25922.test.ts imports the module by relative path (the dependency direction stays app-shell → i18n) and adds one case, "a reason is given for exactly the families the i18n pin allows", asserting the sorted ZH_ONLY_REASONS prefixes equal the sorted list. The reasons and citation anchors stay in app-shell, beside the files they cite.

Why

After the designer-table parity gate retired, the zh-only family list had two homes and nothing held them equal (triage's contract review of PR #27136). Route taken: one list on the i18n side plus an equality assertion, the dispatch's first option. Deriving ZH_ONLY_REASONS from the i18n list is not possible, because its reasons and anchors are app-shell facts.

Tests

  • Both pins: Test Files 2 passed (2), Tests 201 passed (201) (the new case is the 201st).
  • Ablation, two one-shot legs through scripts/ablation-replace.mjs, each with on-disk anchor counts and blob hashes, restored after:
    • fourth prefix added to STUDIO_ZH_ONLY_FAMILIES only: red, Tests 1 failed | 200 passed (201), the one failure being the new equality case.
    • fourth entry added to ZH_ONLY_REASONS only (with a valid citation anchor): red, Tests 1 failed | 201 passed (202), again only the new equality case.
    • After both legs git diff HEAD is empty and both files' blobs equal their HEAD blobs.

Acceptance notes

  • ZH_ONLY_FLOOR in the app-shell pin keys its floors by a coarser prefix, engine.enum. rather than engine.enum.type.. It holds counts, not the allowed set, so it is outside this card; noted only.
  • No changeset: the diff touches test files only, and the new module sits in a directory the build excludes, so no released package publishes anything new (skip-changeset).

Verification

Local readings on head 37238cc1 (merge base 1e8e5296). Exit codes captured before any pipe; CI owns every other family.

24 derived gate families: 24 run, all exit 0; dispatch-gates --ran reconciles 24/24, 0 NOT-MEASURED
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-sdui-manifest.mjs :: exit 0
node scripts/check-sdui-manifest.mjs --self-test :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0
Owed beyond the derived list: both package type-checks (each compiles its tests through tsconfig.test.json, so the cross-package import is type-checked) and the line-citation check
pnpm --filter @object-ui/i18n run type-check :: exit 0
pnpm --filter @object-ui/app-shell run type-check :: exit 0
pnpm --dir ui run check:new-line-citations :: exit 0

check:new-line-citations printed 0 new citation(s).

dispatch-gates --tier on this surface: no path-derived mandate (TIER_DEFAULT). Changed lines 34 (+26 / -8).

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (lint is CI's run)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset. (publishes nothing)
  • 6. packages/spec touched: n/a.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English (the 维护者速读 block is the dispatch-required Chinese summary).
  • The Before Submitting list in CONTRIBUTING.md is done.

Generated by Claude Code

The studio namespace pin and the app-shell ZH_ONLY_REASONS pin each held
their own copy of the three zh-only prefixes. The list now lives in an
i18n test-support module that the namespace pin reads, and the app-shell
pin asserts its reason prefixes equal it, so neither list can widen alone.

Claude-Session: https://claude.ai/code/session_01JQwxban7wCJnPiiSY4ULYz
Co-Authored-By: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对

ACCEPT · seat domain:ui#1 · session_01JQwxbZeBv2y91towxasSUT · head 37238cc1 · 2026-10-28T14:50Z

席位意见:studio 命名空间的 zh-only 键族列表现在只有一个家(i18n 包的测试辅助模块),i18n 那边的测试直接读它,app-shell 那边的测试断言 ZH_ONLY_REASONS 的前缀与它相等,两边谁也不能单独加宽。只改测试,无运行时变化。符合 #27250 和契约复核 6469007202 的 should-fix。

  1. Shape: Fixes #27250; 3 files, +26/−8: new ui/packages/i18n/src/__tests__/studio-zh-only-families.ts (test-support, under the build-excluded __tests__/, not a package export), studio-namespace.test.ts reads it, inspectorStrings.studioNamespace-25922.test.ts gains one equality case. skip-changeset.
  2. Premise measured: the one home is on the i18n side, as the dependency direction requires; app-shell imports it by relative path from the sibling package's __tests__/, the same idiom as plugin-designer's ../../../plugin-grid/src/__tests__/explainDouble. No public export added.
  3. Gates / check-runs: PR check-runs on 37238cc1: 44 success, 16 skipped, 0 failure; mergeable_state clean. Dev's local run: 24/24 derived gates exit 0 (--ran reconciled), i18n and app-shell type-checks exit 0; both ablation legs (a fourth prefix in one list only) red exactly the new case.
  4. Accepted deviations: the dev's install ran with --ignore-scripts (better-sqlite3's headers download kept aborting); the gates and type-checks this diff touches do not load that native module. Seat trial merge with origin/main is clean.
  5. Out of scope: none. Skills-docs: none — tests only.
  6. Landing: not Tier H; the seat readies and arms auto-merge.

Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 28, 2026 14:51
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 28, 2026 14:51
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit bf01226 Oct 28, 2026
61 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-qipkqe branch October 28, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

2 participants