Skip to content

docs: fix broken heading numbering in zh-CN plugin specs - #2003

Closed
Goldloli wants to merge 1 commit into
vastsa:mainfrom
Goldloli:docs/fix-zh-heading-numbering
Closed

Goldloli wants to merge 1 commit into
vastsa:mainfrom
Goldloli:docs/fix-zh-heading-numbering

Conversation

@Goldloli

Copy link
Copy Markdown

Related to #2000

范围

按 issue 的 P0「机械修复」,只修正中文规格里被写坏的标题编号(3. 1 → 3.1 这类),不重排结构、不改正文内容、不碰英文源文件。对照对象是英文源规格 docs/spec/07-plugins/ 中同名文件的标题编号序列。

核对文档:docs/zh-CN/spec/07-plugins/ 下的 01-plugin-system.md、02-plugin-manifest-schema.md、04-plugin-security.md、05-plugin-lifecycle.md、12-plugin-ipc-and-host-services.md(另检查了 06-plugin-packaging.md,见下)。
对照文件:docs/spec/07-plugins/ 同名英文规格(仅作编号参照,未修改)。

改动(5 个文件,14 处编辑)

01-plugin-system.md(7 处)

  • L202 ### 6. 1 主机主 → ### 6.1 主机主
  • L208 ### 6. 2 插件运行时(受限) → ### 6.2 插件运行时(受限)
  • L220 ### 6. 3 插件面板用户界面 → ### 6.3 插件面板用户界面
  • L467/L468 ### 12. 1 激活范围控制 重复出现两行 → 合并为一处 ### 12.1 激活范围控制(重复标题也会让锚点失效)
  • L485 ### 12. 2 设置 > 智能体中的 MCP 管理 → ### 12.2 设置 > 智能体中的 MCP 管理
  • L517 ### 12. 3 设置 > 智能体中的技能管理 → ### 12.3 设置 > 智能体中的技能管理

02-plugin-manifest-schema.md(2 处)

  • L453 ## 5. 1 总线主题语法 → ## 5.1 总线主题语法
  • L618 ## 9. 1 示例:能力贡献 → ## 9.1 示例:能力贡献

04-plugin-security.md(4 处)

  • L50 ## 3. 1 贡献主题CSS → ## 3.1 贡献主题 CSS(issue 示例要求的编号与中英文间空格)
  • L110 ## 5. 1 插件间消息总线 → ## 5.1 插件间消息总线
  • L192 ## 7. 1 到达代理的技能和 MCP 工具 → ## 7.1 到达代理的技能和 MCP 工具
  • L263 ## 8. 1 MCP 服务器出口和凭证 → ## 8.1 MCP 服务器出口和凭证

05-plugin-lifecycle.md(1 处)

  • L64 ## 3. 1 居民服务 → ## 3.1 居民服务

12-plugin-ipc-and-host-services.md(1 处)

  • L85 ## 4. 1 事件(主机→插件进程) → ## 4.1 事件(主机→插件进程)

与 issue 统计的差异

issue 写的是「6 个文件共 17 处」,分布 01(7)、02(2)、04(4)、05(1)、06(2)、12(1)。我在当前 main(97cc04d)上复现:

grep -rnE '^#{1,6} [0-9]+\. [0-9]+' docs/zh-CN/spec/07-plugins/

实测为 5 个文件共 15 处:01(7,含 12.1 重复一次)、02(2)、04(4)、05(1)、12(1);06-plugin-packaging.md 共 9 个标题,与英文 9 个标题的编号序列完全一致,没有坏编号。另外在 01 发现 12.1 重复标题一处(上面已合并)。以实际可复现结果为准,未改动 06。

验证

# 1) 修复后坏编号 0、重复标题 0,且编号序列对照英文
#    01/02/05/06/12:中文编号序列与英文完全一致
#    04:中文是英文编号序列的子序列(英文有 3.2、6.4 等整节,中文缺译,见下),本 PR 不改结构
# 2) 内部锚点:5 个文件内所有 [](#...) 链接均可解析到本文件标题锚点
# 3) git diff --check
git diff --check          # 无空白错误
# 4) 文档检查脚本(与 main 基线一致)
node docs/scripts/check-locales.mjs   # Verified 86 English/Chinese documentation pairs.
node docs/scripts/check-docs.mjs      # Verified 598 documentation pages.
# 5) PR base gate
node scripts/check-pr-base-main.mjs   # PR base check passed

docs-only,不改变任何行为,因此不需要 spec/E2E 文档更新;未改代码、未改英文、未重排结构。

另发现(不在本 PR,留作后续 P0/P1)

  • 04-plugin-security.md 中文缺英文的 3.2 Session collaboration boundary、6.4 Dropped-file grants 等整节(issue「一、1」已列出)。
  • 01-plugin-system.md 的 6.1 主机主 标题疑似被截断(英文对应小节标题为 Host main),本 PR 只修编号、未猜写正文。
  • docs/plugin-development.md 指向 07-plugins/03-plugin-api.md#projects-workspace-fs 的锚点在当前 main 上不存在(既有失效链接,与本 PR 无关)。

@Goldloli

Copy link
Copy Markdown
Author

和 #2002 撞车了:同一个 issue、同样 5 个文件、同样这 15 处编号(含 12.1 重复行与 贡献主题 CSS 的空格),#2002 早 11 分钟创建。按避免重复的原则,关闭本 PR,不占维护者重复 review 的时间。

两处可以给 #2002 参考的验证结果已贴到那边评论:修复后 5 个文件的坏编号与重复标题均为 0;01/02/05/06/12 的中文编号序列与英文源一致,04 是英文编号序列的子序列(英文 3.2/6.4 等整节缺译,属另一个 P0 方向,不在本 PR);node docs/scripts/check-locales.mjs、node docs/scripts/check-docs.mjs、git diff --check 在 main 上均通过。另:issue 写的是 6 个文件 17 处,实测是 5 个文件 15 处,06 没有坏编号。

@Tioit-Wang

Copy link
Copy Markdown
Collaborator

Closed as a duplicate of #2002, which covered the same five files and the same fixes 11 minutes earlier. Not merged.

Thanks for checking before pushing #2002 onward rather than letting the two compete — and for the three out-of-scope findings you posted there. Two of them were correct and are worth recording:

  • 04-plugin-security.md missing whole sections — independently confirmed and since fixed by docs(zh-CN): add missing plugin security sections #2005 (宿主渲染的场景化设置 :45, 3.2 会话协作边界 :49, Provider OAuth 凭据边界 :139, 6.4 拖放文件授权 :201, 8.2 桌面控制与设备访问 :318).
  • 01-plugin-system.md 6.1 possibly truncated — still present on current main; nobody has picked it up.
  • The plugin-development.md anchor finding is also unresolved.

Two smaller notes. The issue asked for 17 broken headings across six files; the real count on main was 15 across five, and you measured that rather than accepting the issue text — that is the right instinct. And the remaining anomaly in 07-plugins today is 03-plugin-api.md:415 ###代理 (no space after ###), which no PR caught because it does not match the ### 3. 1 pattern; if you want a genuinely uncontested follow-up, that plus the 6.1 truncation would be it.

@Tioit-Wang

Copy link
Copy Markdown
Collaborator

Correction to my previous comment: I said the 01-plugin-system.md 6.1 truncation was "still present" — I had checked the heading text but not the body. Having now compared both, ### 6.1 主机主 carries exactly the same four items as English ### 6.1 Host Main, so the body is intact.

What is worth a look is the heading text alone. 主机主 reads like a mangled merge of 主机 with a following 主进程; a natural rendering would be 主机主进程. That is a translation-wording defect, not truncation. My earlier phrasing overstated it.

The other two findings stand as you reported them:

  • 04-plugin-security.md whole-section gaps — fixed by docs(zh-CN): add missing plugin security sections #2005.
  • docs/plugin-development.md:493 links to spec/07-plugins/03-plugin-api.md#projects-workspace-fs. English has ### projects / workspace / fs at :340, but Chinese only has ### 工作区/fs at :300, so the cross-reference has no matching anchor and remains broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants