Skip to content

test(docs): terminology checker fixtures and allowlist audit - #161

Merged
yesme merged 1 commit into
mainfrom
grok/r3-docs-toolchain-tests
Sep 3, 2026
Merged

yesme merged 1 commit into
mainfrom
grok/r3-docs-toolchain-tests

Conversation

@yesme

@yesme yesme commented Sep 3, 2026

Copy link
Copy Markdown
Owner

定位与重述

这是四轴评审任务书三针对 Codex PR 甲(#156)的测试 PR,位置在文档构建与机械检查层,不是设计正文施工。要解决的问题:#156 把四个检查器和 PR 门写进了 CI,但只拿当前文档树当绿测,误报、漏报、豁免表和「重命名/移动算不算自建」都没有夹具。本 PR 补上这些对抗样本,并逐条核豁免表——结论是 first_use_terms.allowlist 46 条全部是把规则豁免掉了,不是正文不该带对照。对照补回是写作改动,留给 Fable;本 PR 不改 docs/design/**。

本地验收:

  • bash src/build/docs/check_docs_toolchain_fixtures.sh 通过
  • cd src && ./buck2 test root//build/docs:check_docs_toolchain_fixtures 通过
  • perl -c src/build/docs/doc_style_lint.pl 与 git diff --check 通过

当前生效约束集

  • 指令累积;本 PR 只执行任务书三第 1 项(文档工具链测试),不混入运行时测试。
  • 讨论阶段不提交;本任务书是显式开工指令,一轮打包成一个 PR。
  • Buck2 是唯一测试入口;夹具走已有 sh_test,消费 repo//:docs_tree 与检查器本身,不另建平行构建入口。
  • 禁用「张力」;位置引用写文件 §节名。
  • 不改变合同语义,不新增领域概念或第三方依赖。
  • 豁免表核验只记录分类,不把 46 处首现对照改写成括注(那是写作层)。

业界方案调研

本 PR 新增一个测试驱动脚本 src/build/docs/check_docs_toolchain_fixtures.sh(不是产品检查器)。

  • 检查器误报/漏报:业界默认用夹具(LLVM lit、eslint rule fixtures、vale fixtures)。不引入 lit/pytest/vale——本仓库检查器已是 Perl,CI 与本机都有系统 Perl;夹具直接调用 doc_style_lint.pl,与 docs/research/docs-lint.md 已采用的「自写脚本 + Buck2 sh_test」一致。
  • PR 门阈值:Git 原生 --find-renames 让纯移动保持 0/0,build(docs): enforce terminology rules in CI #156 已写进 .github/workflows/pr-contract.yml。本测试复制同一 awk 并在临时仓库里验证 rename/move/净增 101 行,不改 workflow,也不自建第二套 diff 解析器。
  • 不把夹具做成新的文档门:live tree 检查仍是原来的 check_* 目标;本目标只锁检查器语义和豁免表与现状的一一对应。

任务书三第一项:给四个检查器补误报/漏报夹具,核对 PR 门对重命名
与移动的净增长,并逐条核豁免表。first_use 46 条全部是规则豁免。
@yesme
yesme enabled auto-merge (squash) September 3, 2026 21:30
@yesme
yesme merged commit 74e0330 into main Sep 3, 2026
12 checks passed
@yesme
yesme deleted the grok/r3-docs-toolchain-tests branch September 10, 2026 05:06
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.

1 participant