Docs: update zh-CN translations and pipeline

What:
- update zh-CN glossary, TM, and translator prompt
- regenerate zh-CN docs and apply targeted fixes
- add zh-CN AGENTS pipeline guidance

Why:
- address terminology/spacing feedback from #6995

Tests:
- pnpm build && pnpm check && pnpm test
This commit is contained in:
Josh Palmer
2026-02-03 13:23:00 -08:00
parent 9f03791aa9
commit a3ec2d0734
228 changed files with 10651 additions and 10475 deletions
+36 -36
View File
@@ -1,12 +1,12 @@
---
read_when:
- 设计或实现配置验证行为
- 处理配置迁移或 doctor 工作流
- 处理插件配置 schema 或插件加载控制时
summary: 严格配置验证 + 仅通过 doctor 行迁移
- 设计或实现配置验证行为
- 处理配置迁移或 doctor 工作流
- 处理插件配置 schema 或插件加载
summary: 严格配置验证 + 仅通过 doctor 行迁移
title: 严格配置验证
x-i18n:
generated_at: "2026-02-01T21:36:38Z"
generated_at: "2026-02-03T10:08:51Z"
model: claude-opus-4-5
provider: pi
source_hash: 5bc7174a67d2234e763f21330d8fe3afebc23b2e5c728a04abcc648b453a91cc
@@ -14,28 +14,28 @@ x-i18n:
workflow: 15
---
# 严格配置验证(仅通过 doctor 行迁移)
# 严格配置验证(仅通过 doctor 行迁移)
## 目标
- **在所有层级(根级 + 嵌套级)拒绝未知配置键**
- **在所有地方拒绝未知配置键**(根级 + 嵌套)
- **拒绝没有 schema 的插件配置**;不加载该插件。
- **移除加载时的遗留自动迁移**;迁移仅通过 doctor 行。
- **启动时自动运行 doctordry-run 模式**;如果配置无效,阻止非诊断命令。
- **移除加载时的旧版自动迁移**;迁移仅通过 doctor 行。
- **启动时自动运行 doctor(dry-run)**;如果无效,阻止非诊断命令。
## 非目标
- 加载时的向后兼容性(遗留键不会自动迁移)。
- 静默丢弃识别的键。
- 加载时的向后兼容性(旧版键不会自动迁移)。
- 静默丢弃无法识别的键。
## 严格验证规则
- 配置必须在每个层级精确匹配 schema。
- 未知键是验证错误(根级嵌套级均不允许透传)。
- `plugins.entries.<id>.config` 必须由插件的 schema 进行验证。
- 如果插件缺少 schema,**拒绝插件加载**并显示明确的错误信息
- 未知键是验证错误(根级嵌套不允许透传)。
- `plugins.entries.<id>.config` 必须由插件的 schema 验证。
- 如果插件缺少 schema,**拒绝插件加载**并显示清晰的错误。
- 未知的 `channels.<id>` 键是错误,除非插件清单声明了该渠道 id。
- 所有插件都必须提供插件清单(`openclaw.plugin.json`)。
- 所有插件都需要插件清单(`openclaw.plugin.json`)。
## 插件 schema 强制执行
@@ -44,26 +44,26 @@ x-i18n:
1. 解析插件清单 + schema`openclaw.plugin.json`)。
2. 根据 schema 验证配置。
3. 如果缺少 schema 或配置无效:阻止插件加载,记录错误。
- 错误息包括:
- 错误息包括:
- 插件 id
- 原因(缺少 schema / 配置无效)
- 验证失败的路径
- 禁用的插件保留其配置,但 Doctor + 日志会显示警告。
- 禁用的插件保留其配置,但 Doctor + 日志会显示警告。
## Doctor 流程
- 每次加载配置时都会运行 Doctor(默认 dry-run 模式)。
- 每次加载配置时都会运行 Doctor(默认 dry-run)。
- 如果配置无效:
- 打印摘要 + 可操作的错误信息
- 示:`openclaw doctor --fix`
- 打印摘要 + 可操作的错误。
- 示:`openclaw doctor --fix`
- `openclaw doctor --fix`
- 应用迁移。
- 移除未知键。
- 写入更新后的配置。
## 命令控制(配置无效时)
## 命令门控(当配置无效时)
允许执行(仅诊断命令):
允许的命令(仅诊断):
- `openclaw doctor`
- `openclaw logs`
@@ -72,29 +72,29 @@ x-i18n:
- `openclaw status`
- `openclaw gateway status`
其他所有命令必须直接失败并示:"Config invalid. Run `openclaw doctor --fix`."
其他所有命令必须失败并示:"Config invalid. Run `openclaw doctor --fix`."
## 错误用户体验格式
- 单个摘要标题。
- 分组展示
- 分组部分
- 未知键(完整路径)
- 遗留键 / 需要迁移
- 旧版键/需要迁移
- 插件加载失败(插件 id + 原因 + 路径)
## 实现涉及的文件
## 实现接触点
- `src/config/zod-schema.ts`:移除根级 passthrough;所有对象使用 strict 模式
- `src/config/zod-schema.providers.ts`:确保渠道 schema 为 strict 模式
- `src/config/validation.ts`遇到未知键时失败;不应用遗留迁移。
- `src/config/io.ts`:移除遗留自动迁移;始终运行 doctor dry-run。
- `src/config/legacy*.ts`:将用法迁移到仅限 doctor 使用
- `src/plugins/*`:添加 schema 注册表 + 加载控制
- `src/cli` 中的 CLI 命令控
- `src/config/zod-schema.ts`:移除根级透传;所有地方使用严格对象
- `src/config/zod-schema.providers.ts`:确保严格的渠道 schema。
- `src/config/validation.ts`:未知键时失败;不应用旧版迁移。
- `src/config/io.ts`:移除旧版自动迁移;始终运行 doctor dry-run。
- `src/config/legacy*.ts`:将用法移至仅 doctor。
- `src/plugins/*`:添加 schema 注册表 + 门控
- `src/cli` 中的 CLI 命令控。
## 测试
- 未知键拒绝(根级 + 嵌套)。
- 插件缺少 schema → 插件加载被阻止并显示明确错误。
- 配置无效 → Gateway网关启动被阻止,诊断命令除外。
- 未知键拒绝(根级 + 嵌套)。
- 插件缺少 schema → 插件加载被阻止并显示清晰错误。
- 无效配置 → Gateway 网关启动被阻止,诊断命令除外。
- Doctor dry-run 自动运行;`doctor --fix` 写入修正后的配置。