docs(getting-started): 把 for-developers 的 src/ 目录树按实况重画,并让 docs-drift 守卫看得懂目录树 (#984) - #991
Merged
Merged
Conversation
…ty and teach docs-drift to read a tree diagram The developer page still drew an `agents/` branch, still listed `*.agent.ts` in the suffix table, and still closed the "Add an AI skill" recipe with "add the skill name to the relevant agent in `src/agents/`". The directory and the suffix went away with the two app-owned copilots — this app authors skills and the agent comes from the platform — so every one of those three sent a reader to a path that does not exist. The tree was then audited branch by branch: `hooks/`, `mappings/`, `docs/` and `interfaces/` are real and were missing, and each branch now states what it holds. All three locales move together. `test/docs-drift.test.ts` exists for this defect class and could not see it: its scan set was maintainer docs only, and its pattern required a literal `src/` prefix, which a tree diagram strips by drawing (`├── agents/`). Both axes are covered now — the product page is read for inline paths, and every doc that draws a `src/` tree has its branches resolved. The pre-existing maintainer-doc assertion is untouched; each new check fails loudly rather than vacuously when its input stops parsing. Refs #984 #512 #988 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VHrPAGEgFDoHjphqYG4BMa
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
The two-forms note said "the guard above" for a check that sits below it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VHrPAGEgFDoHjphqYG4BMa
yinlianghui
marked this pull request as ready for review
August 6, 2026 15:10
This was referenced Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #984
改了什么
① 文档:
getting-started/for-developers(三语同步)点名的两处残留(#512 删掉的 agents 面):
agents/分支删除 ——src/agents/不存在,find src -name '*.agent.ts'零命中。`*.agent.ts` | AI agent一行删除。src/agents/中对应的 agent」,这一步已不存在(从src/skills/index.ts导出即是全部接线),改写为实况;树后补一句说明 HotCRM 只写 skills 不写 agent,并内链到 AI Skills 页(zh 内链不带锚)。整棵树逐目录核对(不只改点名两处)—— 与真实
src/18 个目录对了一遍:agents/hooks/、mappings/、docs/、interfaces/objects/ actions/ flows/ skills/ apps/ views/ pages/ dashboards/ reports/ datasets/ profiles/ sharing/ translations/ data/补项的注释按实况写:
hooks/是把src/objects/*.hook.ts汇总交给 stack 的 barrel;mappings/是导入用的列到字段映射(config 里mappings:注册);docs/是 ADR-0046 收进dist/objectstack.json一起分发的应用文档;interfaces/目前只有版权头,写作「共享类型(目前是空 barrel)」而不是编一个用途。零回退:PR #987 刚落地的
dashboards/, reports/, datasets/一行原样未动(diff 可见)。边界:后缀表其余各行按 issue 边界不预判 —— 只删掉那一行幻影,
*.dataset.ts/*.mapping.ts/*.seed.ts等缺行不在本单范围内。树补缺项是因为 issue 的「缺项由 triage 定」已由派发裁定为「按 src/ 实况写实」;后缀表的「不预判」则是 issue 明写的边界,两者刻意不对称。src/零改动。② 守卫:
test/docs-drift.test.ts扩面两层盲区叠加,所以两条轴都补:
TREE_DOCS只有 9 个维护者文档,content/docs从不被看。新增PRODUCT_TREE_DOCS(本页三语)走同一条 inline 断言。src/前缀,而目录树把前缀画掉了(├── agents/)。新增treeSrcDirs()解析src/节点下的直接子项,TREE_DIAGRAM_DOCS覆盖所有画树的文档:README.md、AGENTS.md、docs/README.md以及本页三语(维护者文档的树此前同样看不见,只是今天恰好没有幻影)。解析器同时吃两种根:维护者文档根在
hotcrm/(src/是一个树节点),产品文档根就是src/本身(那一行没有分支符号);一行画多个(apps/, views/, pages/)按逗号/空格拆;#注释不算条目。既有断言零语义变化:原 describe 的文件集、正则、断言与报错文案都没动,只是把那条正则抽成
inlineSrcDirs()供两处共用。防空转:两条新断言各带一条 vacuity 断言 —— 解析结果为空时报错退出,而不是「什么都没匹配到所以绿」。
为什么是白名单而不是遍历
content/docs:customization/ai-skills.mdx:10正确地以否定式提到该路径(“there is no ... directory”),「列出即须存在」在任意产品散文上并不成立,所以按页逐个纳入。两阶段红→绿验证
方向是开工前就定的:旧文档 + 新守卫应当红(页面确实画着不存在的目录),6 条(3 语 × 2 条新断言),既有断言全绿。实测与预判一致。
红(stash 掉三个 mdx 的改动,只留守卫):
绿(恢复文档改动):
vacuity 反证(把树的制表符号换成 ASCII,模拟「树被重排、解析器失灵」):
即解析不到就红,不会静默变绿。验证后已还原。
六道门(本地,串行在共享 verify lock 内)
pnpm validatepnpm typecheckpnpm lintpnpm hygienepnpm buildpnpm test -- --maxWorkers=2控制字节:
pnpm hygiene的控制字节扫描覆盖 content 与 .changeset;另做自扫grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]',改动文件零命中。未起 dev server。范围外发现
customization/index的 src/ 目录树与后缀表同样画着 #512 删掉的agents/与*.agent.ts(#984 的同型孪生页) #988 ——customization/index.{mdx,zh-Hans,zh-Hant}的目录树与后缀表带着完全同型的agents/与*.agent.ts(该页树还缺datasets/)。按 issue 边界不在本 PR 修;守卫的两个列表里已留注释指向customization/index的 src/ 目录树与后缀表同样画着 #512 删掉的agents/与*.agent.ts(#984 的同型孪生页) #988,那页修好后把三语加进列表即被覆盖。Generated by Claude Code