Skip to content

test(cli): pin the plugin-carried Setup pages against their translations (#3589) - #3679

Merged
os-zhuang merged 2 commits into
mainfrom
claude/custom-system-page-i18n-6ni3f8
Jul 27, 2026
Merged

test(cli): pin the plugin-carried Setup pages against their translations (#3589)#3679
os-zhuang merged 2 commits into
mainfrom
claude/custom-system-page-i18n-6ni3f8

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

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.

translatePage applies the bundle for every locale, en included. So an en entry that has drifted from the metadata literal does not fall back to the literal — it overrides it. Someone edits properties.subtitle in 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

  1. All three pages are reachable through the plugins' UI bundles (catches a page being dropped from a bundle).
  2. Every page has an en translation entry.
  3. The en bundle is byte-identical to the metadata literals — the actual drift guard.
  4. The pages key set is identical across every shipped locale (en / zh-CN / ja-JP / es-ES) — the same partial-coverage bug that left nav_cloud_connection zh-CN-only.
  5. End-to-end: translatePage puts zh-CN copy into page:header, icon survives 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 behind os 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/cli is 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 to test/i18n-extract.test.ts. The alternatives don't work: platform-objects must not depend on plugins (wrong direction), qa/downstream-contract is a deliberately frozen spec consumer, and qa/dogfood / verify carry none of the three.

Verification

Mutation-tested rather than trusted on a green run: changing one en subtitle so it drifts from the plugin metadata fails assertion 3 with the stale value in the diff; restoring it passes. @objectstack/cli suite green (272 tests, 30 files), ESLint clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TubWYdWquVkS9dj733sDmC


Generated by Claude Code

…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
@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Jul 27, 2026 2:24pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/cli.

18 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/ai/skills-reference.mdx (via packages/cli)
  • content/docs/api/client-sdk.mdx (via @objectstack/cli)
  • content/docs/api/data-flow.mdx (via @objectstack/cli)
  • content/docs/api/environment-routing.mdx (via @objectstack/cli)
  • content/docs/api/error-catalog.mdx (via @objectstack/cli)
  • content/docs/automation/hook-bodies.mdx (via packages/cli)
  • content/docs/deployment/backup-restore.mdx (via @objectstack/cli)
  • content/docs/deployment/cli.mdx (via @objectstack/cli)
  • content/docs/deployment/self-hosting.mdx (via @objectstack/cli)
  • content/docs/getting-started/your-first-project.mdx (via @objectstack/cli)
  • content/docs/kernel/runtime-services/data-service.mdx (via packages/cli)
  • content/docs/kernel/runtime-services/index.mdx (via packages/cli)
  • content/docs/permissions/authentication.mdx (via @objectstack/cli)
  • content/docs/plugins/packages.mdx (via @objectstack/cli)
  • content/docs/protocol/kernel/plugin-spec.mdx (via @objectstack/cli)
  • content/docs/protocol/kernel/realtime-protocol.mdx (via @objectstack/cli)
  • content/docs/releases/implementation-status.mdx (via @objectstack/cli)
  • content/docs/releases/v16.mdx (via @objectstack/cli)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

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
@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling labels Jul 27, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review July 27, 2026 14:42
@os-zhuang
os-zhuang merged commit c2603b9 into main Jul 27, 2026
16 checks passed
@os-zhuang
os-zhuang deleted the claude/custom-system-page-i18n-6ni3f8 branch July 27, 2026 14:43
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 size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants