Skip to content

fix(cli): hide platform i18n baseline from os lint by default#3102

Merged
os-zhuang merged 1 commit into
mainfrom
fix/lint-platform-noise
Jul 17, 2026
Merged

fix(cli): hide platform i18n baseline from os lint by default#3102
os-zhuang merged 1 commit into
mainfrom
fix/lint-platform-noise

Conversation

@os-zhuang

@os-zhuang os-zhuang commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

问题(15.1 第三方评估 P2 #2)

os lint 在 create-objectstack 新项目上开箱报 848 个错误(现版 821),全部是 i18n/missing-metadataForm —— 平台内置元数据表单(email_template 等)的翻译键,来自 lint 无条件遍历静态注册表(DEFAULT_METADATA_TYPE_REGISTRY + METADATA_FORM_REGISTRY)。这些翻译平台包(packages/platform-objects 的 4 个 locale bundle)在运行时本来就提供,对用户项目纯属噪声,把用户自己的 lint 信号完全淹没。

修复

「给平台补翻译」不适用——翻译已存在,只是 lint 把平台基线错算到用户项目头上。故收敛 lint 作用域:

  • 新增 foldCoverageIssues():source === 'metadataForm'(lint 时唯一且充分的平台判据,静态注册表遍历是它唯一来源)的问题默认隐藏并计数
  • 新 flag --include-platform 恢复全量审计
  • 人类输出加一行 dim 摘要:platform built-ins: N i18n issue(s) hidden — rerun with --include-platform to audit them
  • --json 输出加 hiddenPlatform 字段
  • 用户 authored 元数据(object/field/view/action)的 i18n 覆盖报告不变

真机验证(脚手架新项目)

命令 结果
发布版 npx os lint 821 error(s),全是 metadataForm 噪声(复现)
补丁版默认 4 error(s)(用户自己对象的真实 i18n 信号)+ platform built-ins: 817 i18n issue(s) hidden
补丁版 --include-platform 821 error(s)
补丁版 --json hiddenPlatform: 817,total: 4

单测:新增 lint-platform-fold.test.ts;pnpm --filter @objectstack/cli test 516 → 519 全绿(新增 lint-platform-fold 3 例);tsc build 干净。

注:blank 模板自身还有 4 条真实的用户侧 i18n 缺口(模板不带翻译 bundle),属于另一个模板 DX 问题,不在本 PR 扩散——已单独记 issue。

🤖 Generated with Claude Code

A fresh create-objectstack project reported 800+ errors out of the box,
every one i18n/missing-metadataForm — translation keys for platform
built-in metadata forms collected from the static registries
(DEFAULT_METADATA_TYPE_REGISTRY + METADATA_FORM_REGISTRY). The platform
packages already ship those translations at runtime, so for a user
project they are pure noise that drowns the user's own i18n signal
(15.1 third-party eval, P2).

- fold i18n coverage through foldCoverageIssues(): metadataForm-source
  issues are hidden by default and counted
- new --include-platform flag surfaces them for a full audit
- human output gains a dim summary line; --json gains hiddenPlatform
- user-authored coverage (object/field/view/action) reported unchanged

Verified against a real scaffold: stock CLI 821 errors -> patched CLI
4 user-signal errors + 'platform built-ins: 817 i18n issue(s) hidden',
--include-platform restores 821, --json reports hiddenPlatform: 817.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jul 17, 2026 7:47am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling size/m labels Jul 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

17 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/self-hosting.mdx (via @objectstack/cli)
  • content/docs/getting-started/cli.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)

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.

@os-zhuang
os-zhuang merged commit 878c1ed into main Jul 17, 2026
16 checks passed
@os-zhuang
os-zhuang deleted the fix/lint-platform-noise branch July 17, 2026 11:28
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.

1 participant