test(cli): pin the plugin-carried Setup pages against their translations (#3589) - #3679
Merged
Merged
Conversation
…ons (#3589) The three Setup pages ship as metadata inside capability plugins (`@objectstack/cloud-connection`, `@objectstack/mcp`) while their translations live in `@objectstack/platform-objects` — two packages, edited independently. `translatePage` applies the bundle for EVERY locale including `en`, so an `en` entry that has drifted from the metadata literal silently *overrides* the newer authored copy instead of falling back to it: the edit appears to do nothing and nothing in the build notices. The English side of #3648 was aligned by hand, which is exactly the kind of alignment that rots. The pages are fed through the CLI's own `collectExpectedEntries` — the extractor behind `os i18n extract` / `coverage` — so this also dogfoods that tooling against the platform's own shipped metadata. Covers: all three pages reachable through the plugins' UI bundles; an `en` entry for each; the `en` bundle byte-identical to the metadata literals; the `pages` key set identical across every shipped locale; and an end-to-end `translatePage` pass asserting zh-CN copy reaches `page:header` while `icon` survives and the plugin's module-level page object is not mutated. Placement: `packages/cli` is the only package that already depends on all three, and it owns the i18n coverage tooling. `platform-objects` must not depend on plugins (wrong direction) and the qa contract packages carry none of them. Verified by mutation rather than a green run: drifting one `en` subtitle fails the guard, restoring it passes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TubWYdWquVkS9dj733sDmC
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 18 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
The Check Changeset gate requires a changeset on every PR and sanctions an empty one for changes that release nothing. This PR adds a test and ships no package change, so it takes that path — matching the existing docs/assessment changesets that carry empty frontmatter. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TubWYdWquVkS9dj733sDmC
os-zhuang
marked this pull request as ready for review
July 27, 2026 14:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #3648 (merged). Test-only — no behaviour change.
The drift this guards
The three Setup pages ship as metadata inside capability plugins (
@objectstack/cloud-connection,@objectstack/mcp) while their translations live in@objectstack/platform-objects. Two packages, edited independently by different people.translatePageapplies the bundle for every locale,enincluded. So anenentry that has drifted from the metadata literal does not fall back to the literal — it overrides it. Someone editsproperties.subtitlein the plugin, ships it, and the page keeps rendering the old text with nothing in the build complaining. I aligned the English side of #3648 by hand, which is precisely the kind of alignment that rots.What it asserts
entranslation entry.enbundle is byte-identical to the metadata literals — the actual drift guard.pageskey set is identical across every shipped locale (en/zh-CN/ja-JP/es-ES) — the same partial-coverage bug that leftnav_cloud_connectionzh-CN-only.translatePageputs zh-CN copy intopage:header,iconsurvives the overlay, and the plugin's module-level page object is not mutated (it is a singleton the kernel registers once).Assertion 3 runs the pages through the CLI's own
collectExpectedEntries— the extractor behindos i18n extract/coverage— so this doubles as a dogfood of that tooling against the platform's own shipped metadata, rather than re-implementing the walk in a test.Placement
packages/cliis the only package that already depends on all three, and it owns the i18n coverage tooling (i18n-extract.ts,i18n-coverage.ts), so this sits next totest/i18n-extract.test.ts. The alternatives don't work:platform-objectsmust not depend on plugins (wrong direction),qa/downstream-contractis a deliberately frozen spec consumer, andqa/dogfood/verifycarry none of the three.Verification
Mutation-tested rather than trusted on a green run: changing one
ensubtitle so it drifts from the plugin metadata fails assertion 3 with the stale value in the diff; restoring it passes.@objectstack/clisuite green (272 tests, 30 files), ESLint clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01TubWYdWquVkS9dj733sDmC
Generated by Claude Code