repowiki-cli 0.7.0__tar.gz → 0.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/PKG-INFO +26 -18
  2. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/README.md +25 -17
  3. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/pyproject.toml +1 -1
  4. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/catalog.py +3 -3
  5. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/dispatch.py +2 -2
  6. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/i18n.py +86 -2
  7. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/skills/repowiki/SKILL.en.md +6 -3
  8. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/skills/repowiki/SKILL.md +1 -1
  9. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/tasks.py +11 -1
  10. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/en/STYLE.md +9 -2
  11. repowiki_cli-0.8.0/src/repowiki/templates/en/api_template.md +92 -0
  12. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/en/catalog_task.md +7 -1
  13. repowiki_cli-0.8.0/src/repowiki/templates/en/data_template.md +109 -0
  14. repowiki_cli-0.8.0/src/repowiki/templates/en/event_template.md +85 -0
  15. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/en/flow_template.md +7 -5
  16. repowiki_cli-0.8.0/src/repowiki/templates/en/layer_template.md +113 -0
  17. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/en/overview_task.md +1 -0
  18. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/en/page_template.md +10 -6
  19. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/site/app.js +72 -2
  20. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/site.html +48 -14
  21. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/zh/STYLE.md +9 -2
  22. repowiki_cli-0.8.0/src/repowiki/templates/zh/api_template.md +92 -0
  23. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/zh/catalog_task.md +7 -1
  24. repowiki_cli-0.8.0/src/repowiki/templates/zh/data_template.md +109 -0
  25. repowiki_cli-0.8.0/src/repowiki/templates/zh/event_template.md +85 -0
  26. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/zh/flow_template.md +7 -5
  27. repowiki_cli-0.8.0/src/repowiki/templates/zh/layer_template.md +113 -0
  28. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/zh/overview_task.md +1 -0
  29. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/zh/page_template.md +10 -6
  30. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/validate.py +13 -2
  31. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki_cli.egg-info/PKG-INFO +26 -18
  32. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki_cli.egg-info/SOURCES.txt +9 -0
  33. repowiki_cli-0.8.0/tests/test_archetypes.py +216 -0
  34. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/tests/test_flow.py +3 -3
  35. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/tests/test_i18n.py +3 -3
  36. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/tests/test_validate.py +2 -2
  37. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/LICENSE +0 -0
  38. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/setup.cfg +0 -0
  39. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/__init__.py +0 -0
  40. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/cli.py +0 -0
  41. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/coverage.py +0 -0
  42. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/errors.py +0 -0
  43. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/gitutil.py +0 -0
  44. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/knowledge.py +0 -0
  45. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/llms.py +0 -0
  46. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/metadata.py +0 -0
  47. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/output.py +0 -0
  48. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/paths.py +0 -0
  49. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/plan.py +0 -0
  50. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/scanner.py +0 -0
  51. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/site.py +0 -0
  52. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/skill_install.py +0 -0
  53. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/state.py +0 -0
  54. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/en/knowledge_card_task.md +0 -0
  55. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/en/knowledge_card_update_task.md +0 -0
  56. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/en/knowledge_module_task.md +0 -0
  57. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/en/knowledge_module_update_task.md +0 -0
  58. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/en/knowledge_task.md +0 -0
  59. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/en/overview_update_task.md +0 -0
  60. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/en/page_task.md +0 -0
  61. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/en/update_task.md +0 -0
  62. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/zh/knowledge_card_task.md +0 -0
  63. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/zh/knowledge_card_update_task.md +0 -0
  64. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/zh/knowledge_module_task.md +0 -0
  65. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/zh/knowledge_module_update_task.md +0 -0
  66. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/zh/knowledge_task.md +0 -0
  67. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/zh/overview_update_task.md +0 -0
  68. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/zh/page_task.md +0 -0
  69. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates/zh/update_task.md +0 -0
  70. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/templates.py +0 -0
  71. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/updater.py +0 -0
  72. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/vendor/marked.min.js +0 -0
  73. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki/vendor/mermaid.min.js +0 -0
  74. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki_cli.egg-info/dependency_links.txt +0 -0
  75. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki_cli.egg-info/entry_points.txt +0 -0
  76. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki_cli.egg-info/requires.txt +0 -0
  77. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/src/repowiki_cli.egg-info/top_level.txt +0 -0
  78. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/tests/test_coverage.py +0 -0
  79. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/tests/test_output.py +0 -0
  80. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/tests/test_paths_catalog.py +0 -0
  81. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/tests/test_robustness.py +0 -0
  82. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/tests/test_scanner.py +0 -0
  83. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/tests/test_site.py +0 -0
  84. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/tests/test_skill_install.py +0 -0
  85. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/tests/test_stale.py +0 -0
  86. {repowiki_cli-0.7.0 → repowiki_cli-0.8.0}/tests/test_state.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: repowiki-cli
3
- Version: 0.7.0
3
+ Version: 0.8.0
4
4
  Summary: Deterministic repo wiki build system, driven by any coding agent. Output language follows the repository (zh/en).
5
5
  Author: luomsis
6
6
  License-Expression: MIT
@@ -54,20 +54,27 @@ Wiki 产出语言自动跟随目标仓库(中文仓库 → `zh/`,英文仓
54
54
 
55
55
  ## 为什么是 repowiki
56
56
 
57
- 给仓库生成 wiki 的现成方案主要有两条路:云端 AI wiki 服务(代码要上传、按量付费、产出是黑盒),
58
- 或者让一个 agent 直接通读仓库现写(大仓库上下文装不下、中断即前功尽弃、难以并行)。
59
- repowiki 走第三条路:**读代码、写 wiki 的智能留给任意 agent,其余一切——任务规划、原子认领、
60
- 产出校验、自动修复、断点续跑——做成确定性构建系统。**
61
-
62
- | | 云端 AI wiki 服务 | 让 agent 直接读仓库 | repowiki |
63
- |---|---|---|---|
64
- | 智能来源 | 内置 LLM(不可换) | 你的 agent(任选) | 你的 agent(任选) |
65
- | 代码出域 | 是 | 否 | 否 |
66
- | API Key / 网络 | 需要 | 视 agent 而定 | repowiki 本身零依赖 |
67
- | 大仓库 | 受服务方配额限制 | 上下文装不下 | 任务切分,逐页生成 |
68
- | 中断 / 崩溃 | — | 从头再来 | 状态落盘,断点续跑 |
69
- | 并行加速 | — | 难协调 | 多 worker 原子认领,天然并行 |
70
- | 产出质量 | 黑盒 | 靠 agent 自觉 | 模板强制 + 程序化校验 + 自动修复 |
57
+ 给仓库生成 wiki 的现成方案不少,但各有各的锁:
58
+ DeepWiki 一类**云端 AI wiki 服务**,代码要上传出域、按服务付费、产出是黑盒;
59
+ Qoder Repo Wiki、ZCode 仓库 Wiki 一类**IDE / 工具内置能力**,好用但锁在单一工具生态——
60
+ 生成计费(Credits / token)、wiki 或存于本机用户目录(难以进 CI、无版本历史)或依赖厂商平台、
61
+ 大仓库受限(如 Qoder 单项目上限 1 万文件);或者让一个 agent 直接通读仓库现写
62
+ (大仓库上下文装不下、中断即前功尽弃、难以并行)。
63
+ repowiki 走另一条路:**读代码、写 wiki 的智能留给任意 agent,其余一切——任务规划、原子认领、
64
+ 产出校验、自动修复、断点续跑——做成确定性构建系统。**wiki 以 markdown + mermaid + 源码引用
65
+ 形态进你的仓库(wiki-as-code),可评审、可增量更新、可被 CI 门禁拦截过期。
66
+
67
+ | | 云端 AI wiki 服务 | IDE / 工具内置(Qoder、ZCode 等) | 让 agent 直接读仓库 | repowiki |
68
+ |---|---|---|---|---|
69
+ | 智能来源 | 内置 LLM(不可换) | 工具绑定的模型服务 | 你的 agent(任选) | 你的 agent(任选) |
70
+ | 代码出域 | 是(上传托管平台) | 上下文发给所选模型服务 | 否 | 否 |
71
+ | 费用 | 按服务付费 | Credits / token 计费 | 视 agent 而定 | repowiki 本身零成本 |
72
+ | wiki 归属 | 厂商平台 | 本机用户目录或 `.qoder/` 等,不入库/弱入库 | 一次性产物 | 你的仓库(wiki-as-code)+ 离线站点 |
73
+ | CI 门禁 / 增量 | — | 工具内自动刷新为主,无独立门禁 | — | `stale --fail-if-stale` 拦截过期 PR,`update` 按 git diff 增量 |
74
+ | 大仓库 | 受服务方配额限制 | 有上限(如 Qoder 1 万文件) | 上下文装不下 | 任务切分,逐页生成 |
75
+ | 中断 / 崩溃 | — | 工具内闭环 | 从头再来 | 状态落盘,断点续跑 |
76
+ | 并行加速 | — | — | 难协调 | 多 worker 原子认领,天然并行 |
77
+ | 产出质量 | 黑盒 | 工具内闭环,无程序化校验 | 靠 agent 自觉 | 模板强制 + 程序化校验 + 自动修复 |
71
78
 
72
79
  一句话:**agent 负责聪明,repowiki 负责靠谱。**
73
80
 
@@ -79,7 +86,7 @@ repowiki 走第三条路:**读代码、写 wiki 的智能留给任意 agent,
79
86
  - **单文件离线站点 + agent 索引**:`site` 产出约 5 MB 自包含 HTML(导航、搜索、mermaid、源码弹层,双击即看),同时导出 `llms.txt` / `llms-full.txt`([llmstxt.org](https://llmstxt.org/) 约定),任何 agent / IDE 按索引直接读,无需 MCP;
80
87
  - **强校验,自动修复**:模板强制 + 程序化校验;锚点 / 行号 / H1 / 路径分隔符自动修复,只有语义缺陷才判失败;
81
88
  - **双语产出,跨平台**:语言自动跟随目标仓库(zh / en);macOS / Linux / Windows 原生支持(无需 WSL),CI 三平台 × Python 3.10-3.13 矩阵回归;
82
- - **知识卡片与页面原型**:机制卡片 / 模块文档,类别可整表自定义(`--categories`);页面按主题选 module(结构型,默认)/ flow(流程型)两种模板。
89
+ - **知识卡片与页面原型**:机制卡片 / 模块文档,类别可整表自定义(`--categories`);页面按主题选六种原型模板:module 结构型(默认)/ flow 流程型 / layer 分层型 / data 数据模型型 / api 接口型 / event 事件型。
83
90
 
84
91
  ## 目录
85
92
 
@@ -138,8 +145,9 @@ repowiki skill status # 查看已装版本、是否过期
138
145
  - 幂等可重跑:finalize、update 或手动改了页面之后随时重新执行 `repowiki site` 重建;
139
146
  - 执行过 `repowiki clean` 也能重建(此时章节顺序退化为目录序,内容不受影响)。
140
147
 
141
- 页面按 **module(结构型,默认)/ flow(流程型)** 两种原型撰写,模板与文风规范由校验器
142
- 按语言强制;每节末尾「Section sources/章节来源」、每图后「Diagram sources/图表来源」,
148
+ 页面按 **module 结构型(默认)/ flow 流程型 / layer 分层型 / data 数据模型型 / api 接口型 /
149
+ event 事件型** 六种原型撰写,规划时按页面主题选择(无法确认时回退 module),模板与文风规范由
150
+ 校验器按语言强制;每节末尾「Section sources/章节来源」、每图后「Diagram sources/图表来源」,
143
151
  引用格式 `[path:Lx-Ly](file://path#Lx-Ly)`,页间零链接(正因如此所有页面任务可完全并行)。
144
152
  完整小节结构见 [docs/zh/USAGE.md](docs/zh/USAGE.md)。
145
153
 
@@ -24,20 +24,27 @@ Wiki 产出语言自动跟随目标仓库(中文仓库 → `zh/`,英文仓
24
24
 
25
25
  ## 为什么是 repowiki
26
26
 
27
- 给仓库生成 wiki 的现成方案主要有两条路:云端 AI wiki 服务(代码要上传、按量付费、产出是黑盒),
28
- 或者让一个 agent 直接通读仓库现写(大仓库上下文装不下、中断即前功尽弃、难以并行)。
29
- repowiki 走第三条路:**读代码、写 wiki 的智能留给任意 agent,其余一切——任务规划、原子认领、
30
- 产出校验、自动修复、断点续跑——做成确定性构建系统。**
31
-
32
- | | 云端 AI wiki 服务 | 让 agent 直接读仓库 | repowiki |
33
- |---|---|---|---|
34
- | 智能来源 | 内置 LLM(不可换) | 你的 agent(任选) | 你的 agent(任选) |
35
- | 代码出域 | 是 | 否 | 否 |
36
- | API Key / 网络 | 需要 | 视 agent 而定 | repowiki 本身零依赖 |
37
- | 大仓库 | 受服务方配额限制 | 上下文装不下 | 任务切分,逐页生成 |
38
- | 中断 / 崩溃 | — | 从头再来 | 状态落盘,断点续跑 |
39
- | 并行加速 | — | 难协调 | 多 worker 原子认领,天然并行 |
40
- | 产出质量 | 黑盒 | 靠 agent 自觉 | 模板强制 + 程序化校验 + 自动修复 |
27
+ 给仓库生成 wiki 的现成方案不少,但各有各的锁:
28
+ DeepWiki 一类**云端 AI wiki 服务**,代码要上传出域、按服务付费、产出是黑盒;
29
+ Qoder Repo Wiki、ZCode 仓库 Wiki 一类**IDE / 工具内置能力**,好用但锁在单一工具生态——
30
+ 生成计费(Credits / token)、wiki 或存于本机用户目录(难以进 CI、无版本历史)或依赖厂商平台、
31
+ 大仓库受限(如 Qoder 单项目上限 1 万文件);或者让一个 agent 直接通读仓库现写
32
+ (大仓库上下文装不下、中断即前功尽弃、难以并行)。
33
+ repowiki 走另一条路:**读代码、写 wiki 的智能留给任意 agent,其余一切——任务规划、原子认领、
34
+ 产出校验、自动修复、断点续跑——做成确定性构建系统。**wiki 以 markdown + mermaid + 源码引用
35
+ 形态进你的仓库(wiki-as-code),可评审、可增量更新、可被 CI 门禁拦截过期。
36
+
37
+ | | 云端 AI wiki 服务 | IDE / 工具内置(Qoder、ZCode 等) | 让 agent 直接读仓库 | repowiki |
38
+ |---|---|---|---|---|
39
+ | 智能来源 | 内置 LLM(不可换) | 工具绑定的模型服务 | 你的 agent(任选) | 你的 agent(任选) |
40
+ | 代码出域 | 是(上传托管平台) | 上下文发给所选模型服务 | 否 | 否 |
41
+ | 费用 | 按服务付费 | Credits / token 计费 | 视 agent 而定 | repowiki 本身零成本 |
42
+ | wiki 归属 | 厂商平台 | 本机用户目录或 `.qoder/` 等,不入库/弱入库 | 一次性产物 | 你的仓库(wiki-as-code)+ 离线站点 |
43
+ | CI 门禁 / 增量 | — | 工具内自动刷新为主,无独立门禁 | — | `stale --fail-if-stale` 拦截过期 PR,`update` 按 git diff 增量 |
44
+ | 大仓库 | 受服务方配额限制 | 有上限(如 Qoder 1 万文件) | 上下文装不下 | 任务切分,逐页生成 |
45
+ | 中断 / 崩溃 | — | 工具内闭环 | 从头再来 | 状态落盘,断点续跑 |
46
+ | 并行加速 | — | — | 难协调 | 多 worker 原子认领,天然并行 |
47
+ | 产出质量 | 黑盒 | 工具内闭环,无程序化校验 | 靠 agent 自觉 | 模板强制 + 程序化校验 + 自动修复 |
41
48
 
42
49
  一句话:**agent 负责聪明,repowiki 负责靠谱。**
43
50
 
@@ -49,7 +56,7 @@ repowiki 走第三条路:**读代码、写 wiki 的智能留给任意 agent,
49
56
  - **单文件离线站点 + agent 索引**:`site` 产出约 5 MB 自包含 HTML(导航、搜索、mermaid、源码弹层,双击即看),同时导出 `llms.txt` / `llms-full.txt`([llmstxt.org](https://llmstxt.org/) 约定),任何 agent / IDE 按索引直接读,无需 MCP;
50
57
  - **强校验,自动修复**:模板强制 + 程序化校验;锚点 / 行号 / H1 / 路径分隔符自动修复,只有语义缺陷才判失败;
51
58
  - **双语产出,跨平台**:语言自动跟随目标仓库(zh / en);macOS / Linux / Windows 原生支持(无需 WSL),CI 三平台 × Python 3.10-3.13 矩阵回归;
52
- - **知识卡片与页面原型**:机制卡片 / 模块文档,类别可整表自定义(`--categories`);页面按主题选 module(结构型,默认)/ flow(流程型)两种模板。
59
+ - **知识卡片与页面原型**:机制卡片 / 模块文档,类别可整表自定义(`--categories`);页面按主题选六种原型模板:module 结构型(默认)/ flow 流程型 / layer 分层型 / data 数据模型型 / api 接口型 / event 事件型。
53
60
 
54
61
  ## 目录
55
62
 
@@ -108,8 +115,9 @@ repowiki skill status # 查看已装版本、是否过期
108
115
  - 幂等可重跑:finalize、update 或手动改了页面之后随时重新执行 `repowiki site` 重建;
109
116
  - 执行过 `repowiki clean` 也能重建(此时章节顺序退化为目录序,内容不受影响)。
110
117
 
111
- 页面按 **module(结构型,默认)/ flow(流程型)** 两种原型撰写,模板与文风规范由校验器
112
- 按语言强制;每节末尾「Section sources/章节来源」、每图后「Diagram sources/图表来源」,
118
+ 页面按 **module 结构型(默认)/ flow 流程型 / layer 分层型 / data 数据模型型 / api 接口型 /
119
+ event 事件型** 六种原型撰写,规划时按页面主题选择(无法确认时回退 module),模板与文风规范由
120
+ 校验器按语言强制;每节末尾「Section sources/章节来源」、每图后「Diagram sources/图表来源」,
113
121
  引用格式 `[path:Lx-Ly](file://path#Lx-Ly)`,页间零链接(正因如此所有页面任务可完全并行)。
114
122
  完整小节结构见 [docs/zh/USAGE.md](docs/zh/USAGE.md)。
115
123
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "repowiki-cli"
7
- version = "0.7.0"
7
+ version = "0.8.0"
8
8
  description = "Deterministic repo wiki build system, driven by any coding agent. Output language follows the repository (zh/en)."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -16,7 +16,7 @@ from .validate import PLACEHOLDER_RE
16
16
 
17
17
  SLUG_RE = re.compile(r"^[a-z0-9]+(-[a-z0-9]+)*$")
18
18
  MAX_DEPTH = 4 # root chapters are depth 1
19
- ARCHETYPES = ("module", "flow") # page templates; default "module"
19
+ ARCHETYPES = ("module", "flow", "layer", "data", "api", "event") # page templates; default "module"
20
20
 
21
21
 
22
22
  @dataclass
@@ -31,7 +31,7 @@ class FlatNode:
31
31
  parent_id: str | None
32
32
  depth: int
33
33
  output: str # relative to .repowiki/, e.g. zh/content/Overview/Overview.md
34
- archetype: str = "module" # page template shape: "module" | "flow"
34
+ archetype: str = "module" # page template shape, one of ARCHETYPES
35
35
 
36
36
  def chapter_path(self, by_id: dict[str, "FlatNode"]) -> str:
37
37
  parts = [self.title]
@@ -107,7 +107,7 @@ def validate_catalog(data, known_paths: set[str]) -> tuple[list[str], list[str]]
107
107
  archetype = node.get("archetype", "module")
108
108
  if archetype not in ARCHETYPES:
109
109
  errors.append(
110
- f"{where}({title or nid}): archetype 必须是 module 或 flow(可省略,默认 module),得到 {archetype!r}"
110
+ f"{where}({title or nid}): archetype 必须是 {'/'.join(ARCHETYPES)} 之一(可省略,默认 module),得到 {archetype!r}"
111
111
  )
112
112
  archetype = "module"
113
113
  brief = node.get("page_brief")
@@ -11,7 +11,7 @@ import json
11
11
  import os
12
12
  import socket
13
13
 
14
- from .catalog import flatten, validate_catalog
14
+ from .catalog import ARCHETYPES, flatten, validate_catalog
15
15
  from .errors import ConflictError, UsageError
16
16
  from .output import emit
17
17
  from .paths import WikiPaths
@@ -274,7 +274,7 @@ def _node_archetype(paths: WikiPaths, node_id: str) -> str:
274
274
  if not isinstance(n, dict):
275
275
  continue
276
276
  if n.get("id") == node_id:
277
- return n.get("archetype") if n.get("archetype") in ("module", "flow") else "module"
277
+ return n.get("archetype") if n.get("archetype") in ARCHETYPES else "module"
278
278
  stack.extend(n.get("children") or [])
279
279
  return "module"
280
280
 
@@ -42,8 +42,48 @@ STRINGS: dict[str, dict] = {
42
42
  ("故障", "prefix"),
43
43
  ("结论", "exact"),
44
44
  ],
45
+ "layer_sections": [
46
+ ("简介", "exact"),
47
+ ("分层总览", "exact"),
48
+ ("各层职责", "exact"),
49
+ ("层间依赖与调用规则", "exact"),
50
+ ("纵向切片", "prefix"),
51
+ ("横切关注点", "exact"),
52
+ ("故障", "prefix"),
53
+ ("结论", "exact"),
54
+ ],
55
+ "data_sections": [
56
+ ("简介", "exact"),
57
+ ("数据模型总览", "exact"),
58
+ ("核心实体分析", "exact"),
59
+ ("状态机", "exact"),
60
+ ("存储与序列化", "exact"),
61
+ ("数据生命周期", "exact"),
62
+ ("故障", "prefix"),
63
+ ("结论", "exact"),
64
+ ],
65
+ "api_sections": [
66
+ ("简介", "exact"),
67
+ ("接口清单与分组", "exact"),
68
+ ("请求处理时序", "exact"),
69
+ ("接口契约与错误码", "exact"),
70
+ ("鉴权与访问控制", "exact"),
71
+ ("配额", "prefix"),
72
+ ("故障", "prefix"),
73
+ ("结论", "exact"),
74
+ ],
75
+ "event_sections": [
76
+ ("简介", "exact"),
77
+ ("事件清单", "exact"),
78
+ ("事件流拓扑", "exact"),
79
+ ("事件契约", "exact"),
80
+ ("消费端处理", "exact"),
81
+ ("可靠性保障", "exact"),
82
+ ("故障", "prefix"),
83
+ ("结论", "exact"),
84
+ ],
45
85
  "overview_h1_suffix": "Wiki 总览",
46
- "overview_sections": ("章节导航", "如何使用本 Wiki"),
86
+ "overview_sections": ("章节导航", "如何使用本 Wiki", "术语表"),
47
87
  "module_required_files": ["概述.md", "技术栈.md", "架构设计.md"],
48
88
  "card_sections": ["体系概览", "关键文件与包", "架构与设计约定", "开发者应遵循的规则"],
49
89
  "card_update_extra": "更新摘要",
@@ -54,6 +94,8 @@ STRINGS: dict[str, dict] = {
54
94
  "search_placeholder": "搜索 Wiki…",
55
95
  "no_results": "无匹配结果",
56
96
  "snippet_missing": "源文件不存在或已删除,无法展示片段。",
97
+ "copy_label": "复制片段",
98
+ "copied_label": "已复制",
57
99
  "theme_label": "切换深色/浅色主题",
58
100
  "menu_label": "打开/收起目录",
59
101
  "close_label": "关闭 (Esc)",
@@ -85,8 +127,48 @@ STRINGS: dict[str, dict] = {
85
127
  ("Troubleshooting", "prefix"),
86
128
  ("Conclusion", "exact"),
87
129
  ],
130
+ "layer_sections": [
131
+ ("Introduction", "exact"),
132
+ ("Layer Overview", "exact"),
133
+ ("Layer Responsibilities", "exact"),
134
+ ("Layer Dependencies and Call Rules", "exact"),
135
+ ("Vertical Slice", "prefix"),
136
+ ("Cross-Cutting Concerns", "exact"),
137
+ ("Troubleshooting", "prefix"),
138
+ ("Conclusion", "exact"),
139
+ ],
140
+ "data_sections": [
141
+ ("Introduction", "exact"),
142
+ ("Data Model Overview", "exact"),
143
+ ("Core Entity Analysis", "exact"),
144
+ ("State Machine", "exact"),
145
+ ("Storage and Serialization", "exact"),
146
+ ("Data Lifecycle", "exact"),
147
+ ("Troubleshooting", "prefix"),
148
+ ("Conclusion", "exact"),
149
+ ],
150
+ "api_sections": [
151
+ ("Introduction", "exact"),
152
+ ("Endpoint Inventory and Grouping", "exact"),
153
+ ("Request Handling Sequence", "exact"),
154
+ ("API Contracts and Error Codes", "exact"),
155
+ ("Authentication and Access Control", "exact"),
156
+ ("Quotas", "prefix"),
157
+ ("Troubleshooting", "prefix"),
158
+ ("Conclusion", "exact"),
159
+ ],
160
+ "event_sections": [
161
+ ("Introduction", "exact"),
162
+ ("Event Inventory", "exact"),
163
+ ("Event Flow Topology", "exact"),
164
+ ("Event Contracts", "exact"),
165
+ ("Consumer Handling", "exact"),
166
+ ("Reliability Guarantees", "exact"),
167
+ ("Troubleshooting", "prefix"),
168
+ ("Conclusion", "exact"),
169
+ ],
88
170
  "overview_h1_suffix": "Wiki Overview",
89
- "overview_sections": ("Section Navigation", "How to Use This Wiki"),
171
+ "overview_sections": ("Section Navigation", "How to Use This Wiki", "Glossary"),
90
172
  "module_required_files": ["overview.md", "tech-stack.md", "architecture.md"],
91
173
  "card_sections": [
92
174
  "System Overview", "Key Files and Packages",
@@ -100,6 +182,8 @@ STRINGS: dict[str, dict] = {
100
182
  "search_placeholder": "Search wiki…",
101
183
  "no_results": "No matches",
102
184
  "snippet_missing": "Source file missing or deleted; snippet unavailable.",
185
+ "copy_label": "Copy snippet",
186
+ "copied_label": "Copied",
103
187
  "theme_label": "Toggle dark/light theme",
104
188
  "menu_label": "Toggle table of contents",
105
189
  "close_label": "Close (Esc)",
@@ -45,9 +45,12 @@ repowiki site <repo> # 7. build the single-file offline site .repowiki/
45
45
  After an incremental update or any post-finalize page rewrites, re-run
46
46
  `repowiki site <repo>` anytime to rebuild the site (idempotent).
47
47
 
48
- Task types: `catalog` (section-tree planning, produces state/catalog.json; process- or
49
- mechanism-themed pages may set the optional `"archetype": "flow"` field to use the flow
50
- template — default `module` is structural) → `page` (one page each) → `overview`;
48
+ Task types: `catalog` (section-tree planning, produces state/catalog.json; pages may set
49
+ the optional `"archetype"` field to pick one of six skeleton templates: `module`
50
+ (structural, default) / `flow` (process) / `layer` (layered) / `data` (data model) /
51
+ `api` (interface) / `event` (event-driven) — chosen by theme, falling back to `module`
52
+ when unsure; non-default archetypes require evidence in page_brief) → `page` (one page
53
+ each) → `overview`;
51
54
  optional: `repowiki knowledge <repo> [--categories <file>]` (knowledge cards; the
52
55
  category list can be replaced wholesale), `repowiki update <repo> [--dirty]`
53
56
  (git-diff-based incremental update; rewrites affected pages and the overview with an
@@ -40,7 +40,7 @@ repowiki site <repo> # 7. 生成单文件离线查看站点 .repowiki/<
40
40
 
41
41
  增量更新或 finalize 后重跑了页面,都可随时重跑 `repowiki site <repo>` 重建站点(幂等)。
42
42
 
43
- 任务类型:`catalog`(目录树规划,产出 state/catalog.json;流程/机制主题页可设可选字段 `"archetype": "flow"` 选用流程型模板,默认 module 结构型)→ `page`(逐页撰写)→ `overview`(总览);
43
+ 任务类型:`catalog`(目录树规划,产出 state/catalog.json;页面可用可选字段 `"archetype"` 选六种原型模板:module 结构型(默认)/ flow 流程型 / layer 分层型 / data 数据模型型 / api 接口型 / event 事件型,按主题选型、无法确认时回退 module,非默认原型须在 page_brief 给出证据)→ `page`(逐页撰写)→ `overview`(总览);
44
44
  可选:`repowiki knowledge <repo> [--categories <file>]`(知识卡片,类别清单可整表自定义)、`repowiki update <repo> [--dirty]`(基于 git diff 的增量更新,重写受影响页与总览页并附「更新摘要/Update Summary」小节;`--dirty` 纳入未提交/未跟踪变更)、`repowiki stale <repo> [--fail-if-stale]`(只读过期报告:哪些页面/卡片/模块会过期,不创建任务——CI 门禁用)、`repowiki coverage <repo>`(只读覆盖率报告:wiki 从未引用的仓库文件)。
45
45
  产出语言由 plan 时确定(README 权重最高的自动检测,或 `--locale zh|en`),持久化于 `state/locale`,规格中的模板即对应语言。
46
46
 
@@ -80,8 +80,18 @@ def build_catalog_task(paths: WikiPaths, inv: Inventory) -> dict:
80
80
 
81
81
  # --- phase 2: pages ---
82
82
 
83
+ _PAGE_TEMPLATE_BY_ARCHETYPE = {
84
+ "module": "page_template.md",
85
+ "flow": "flow_template.md",
86
+ "layer": "layer_template.md",
87
+ "data": "data_template.md",
88
+ "api": "api_template.md",
89
+ "event": "event_template.md",
90
+ }
91
+
92
+
83
93
  def _page_template_name(node: FlatNode) -> str:
84
- return "flow_template.md" if node.archetype == "flow" else "page_template.md"
94
+ return _PAGE_TEMPLATE_BY_ARCHETYPE.get(node.archetype, "page_template.md")
85
95
 
86
96
 
87
97
  def build_page_tasks(paths: WikiPaths, nodes: list[FlatNode], inv: Inventory, max_pages: int | None = None) -> list[dict]:
@@ -2,7 +2,13 @@
2
2
 
3
3
  ## Language
4
4
  - Write plain English; keep code identifiers, class names, file paths, and config keys verbatim.
5
- - Objective, factual tone — no marketing language. No emoji. No tables (unless a config listing truly needs one).
5
+ - Objective, factual tone — no marketing language. No emoji. Narrative prose uses no tables; enumerated lists with multiple attributes per item (e.g. entity|type|constraint, component|key files|responsibility, dependency|min version|role, error code|meaning|trigger) should be rendered as tables, with one sentence before each table explaining how to read it.
6
+
7
+ ## Body density (content quality, mandatory)
8
+ - Every body section first explains in 2~4 sentences of prose (what it is, how it works, where the boundaries are), then uses bullets only for enumerable facts; a section that is a single sentence or a single bullet fails the bar.
9
+ - Before each mermaid diagram, one sentence states what it shows and why it is worth reading; after the diagram, one sentence interprets the takeaway — diagrams never replace prose.
10
+ - Rewrite one-item lists as prose. Each section carries at least ~3 lines of body text (excluding diagrams and source lists).
11
+ - Grounding discipline: when evidence runs thin, write the section honestly short with the conceptual-statement disclaimer; never invent files, line numbers, or behavior — fewer sections beats fabricated content.
6
12
 
7
13
  ## Section Sources & Diagram Sources (citation format, mandatory)
8
14
  - Every body section ends with a "Section sources" list; every mermaid diagram is followed by a "Diagram sources" list.
@@ -14,7 +20,8 @@
14
20
  - If a section has no corresponding code, write: `[This section is conceptual; no specific files are analyzed, hence no "Section sources"]`
15
21
 
16
22
  ## Mermaid diagram style
17
- - Structure diagrams use `graph TB`, dependency/relationship diagrams `graph LR`, interaction flows `sequenceDiagram`, type relationships `classDiagram`.
23
+ - Structure diagrams use `graph TB`, dependency/relationship diagrams `graph LR`, interaction flows `sequenceDiagram`, type relationships `classDiagram`, entity relations `erDiagram`, state transitions `stateDiagram-v2`. Diagram types should match the page archetype (data pages favor `erDiagram`/`stateDiagram-v2`, layer pages favor a layered `graph TB`).
24
+ - Syntax notes: node labels in `graph`/`flowchart` must be double-quoted; `stateDiagram-v2` transition labels are written `stateA --> stateB : "trigger"`, with display names via `state "Label" as id` aliases; `erDiagram` entity names use ASCII identifiers, relation labels go inside quotes.
18
25
  - Node labels must be wrapped in double quotes; wrap long labels with `<br/>` and keep the key identifier visible:
19
26
 
20
27
  ```mermaid
@@ -0,0 +1,92 @@
1
+ # {{TITLE}}
2
+
3
+ ## Contents
4
+ 1. [Introduction](#introduction)
5
+ 2. [Endpoint Inventory and Grouping](#endpoint-inventory-and-grouping)
6
+ 3. [Request Handling Sequence](#request-handling-sequence)
7
+ 4. [API Contracts and Error Codes](#api-contracts-and-error-codes)
8
+ 5. [Authentication and Access Control](#authentication-and-access-control)
9
+ 6. [Quotas, Idempotency and Rate Limits](#quotas-idempotency-and-rate-limits)
10
+ 7. [Troubleshooting Guide](#troubleshooting-guide)
11
+ 8. [Conclusion](#conclusion)
12
+
13
+ ## Introduction
14
+ <One paragraph: who these interfaces serve (external callers / CLI users / other processes), what problem they solve, and where they live in the repository.>
15
+
16
+ ## Endpoint Inventory and Grouping
17
+ <The interface inventory grouped by functional domain (bullets: interface name → one-line purpose), with a grouping diagram.>
18
+
19
+ ```mermaid
20
+ graph TB
21
+ subgraph "Project domain"
22
+ P1["Create project<br/>projects.py"]
23
+ P2["Query project<br/>projects.py"]
24
+ end
25
+ subgraph "Task domain"
26
+ T1["Create task<br/>tasks.py"]
27
+ end
28
+ ```
29
+
30
+ Diagram sources
31
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
32
+
33
+ Section sources
34
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
35
+
36
+ ## Request Handling Sequence
37
+ <Pick one representative call: the full handling path from client request to response.>
38
+
39
+ ```mermaid
40
+ sequenceDiagram
41
+ participant C as "Caller"
42
+ participant MW as "Middleware"
43
+ participant H as "Handler"
44
+ participant S as "Service layer"
45
+ C->>MW : "send request"
46
+ MW->>H : "validate and route"
47
+ H->>S : "invoke business logic"
48
+ S-->>H : "result"
49
+ H-->>C : "response"
50
+ ```
51
+
52
+ Diagram sources
53
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
54
+
55
+ Section sources
56
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
57
+
58
+ ## API Contracts and Error Codes
59
+ First a short prose paragraph on the contract style; with ≥3 error codes use a table (| Code | Meaning | Trigger |), and attach a file:// citation to each interface in the inventory section.
60
+
61
+ Section sources
62
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
63
+
64
+ ## Authentication and Access Control
65
+ <Authentication method, where permission checks land in the code, and how anonymous vs authorized behavior differs (bullets); without auth, state the current situation and its boundary.>
66
+
67
+ Section sources
68
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
69
+
70
+ ## Quotas, Idempotency and Rate Limits
71
+ <Rate limits, idempotency keys, retry semantics (bullets); without them, state the current situation and what callers must guard themselves against.>
72
+
73
+ Section sources
74
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
75
+
76
+ ## Troubleshooting Guide
77
+ - <common error codes/symptoms → cause → how to locate → relevant code location.>
78
+
79
+ Section sources
80
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
81
+
82
+ ## Conclusion
83
+ <One paragraph: the interface surface's positioning, correct usage, and caveats.>
84
+
85
+ Section sources
86
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
87
+
88
+ <cite>
89
+ **Files referenced**
90
+ - [<file name>](file://<repo-relative path>)
91
+ - [<file name>](file://<repo-relative path>)
92
+ </cite>
@@ -58,7 +58,13 @@ Write every human-readable field (`title`, `summary`, `page_brief`) in **English
58
58
  5. `page_brief` states the concrete points the page must cover — it becomes the prompt for the page-writing task, so be specific (which modules/classes/flows/configs).
59
59
  6. Coverage expectations (mirroring wikis of comparable projects): project overview, quick start, core concepts, main features/SDK usage, configuration, deployment/operations, API reference, examples/contributing — trim to what this repository actually contains; do not force sections that do not apply.
60
60
  7. `slug` is lowercase English and hyphens (e.g. `project-overview`, `quick-start`).
61
- 8. (Optional) page nodes may set `archetype` to pick the page template: mechanism/process-themed pages (e.g. "lifecycle of a request", "build & release pipeline", "event loop") use `"archetype": "flow"` (Flow Overview / Key Steps / Involved Components / Data and State Changes); all other structural themes default to `"archetype": "module"` (Project Structure / Core Components / Architecture Overview / Dependency Analysis). The field may be omitted (same as module); every flow page should state the flow's start and end in its page_brief.
61
+ 8. (Optional) page nodes may set `archetype` to pick the page skeleton: one of `module` / `flow` / `layer` / `data` / `api` / `event` (omitted = `module`). Choose by the page's topic; **when in doubt, use `module`**. Every non-default archetype has admission criteria, and choosing one requires corresponding evidence in page_brief, or the page will fail validation:
62
+ - `flow`: end-to-end process/mechanism topics (e.g. "lifecycle of a request", "build & release pipeline"). Admission: a fully traceable start and end exists. Evidence: page_brief states the flow's start and end.
63
+ - `layer`: layered-architecture / calling-convention topics (e.g. "layered architecture and dependency direction"). Admission: the code has a clear layering with call-direction rules. Evidence: page_brief lists the layers.
64
+ - `data`: data-model / entity / state-machine topics (e.g. "data model and storage", "order state machine"). Admission: explicit data structures and/or state transitions exist. Evidence: page_brief names the core entities.
65
+ - `api`: outward-facing interface / command-surface topics (e.g. "CLI reference", "REST API"). Admission: a stable caller-facing interface surface exists. Evidence: page_brief states the endpoint grouping / inventory source.
66
+ - `event`: event / message / pub-sub topics (e.g. "event bus", "message flow"). Admission: an event or message mechanism exists. Evidence: page_brief states where the event inventory comes from.
67
+ - `module` (structure, default): component / structure / dependency topics (Project Structure / Core Components / Architecture Overview / Dependency Analysis).
62
68
 
63
69
  ## Self-check (before writing the file)
64
70
  - [ ] JSON parses (re-read the file after writing to confirm)
@@ -0,0 +1,109 @@
1
+ # {{TITLE}}
2
+
3
+ ## Contents
4
+ 1. [Introduction](#introduction)
5
+ 2. [Data Model Overview](#data-model-overview)
6
+ 3. [Core Entity Analysis](#core-entity-analysis)
7
+ 4. [State Machine](#state-machine)
8
+ 5. [Storage and Serialization](#storage-and-serialization)
9
+ 6. [Data Lifecycle](#data-lifecycle)
10
+ 7. [Troubleshooting Guide](#troubleshooting-guide)
11
+ 8. [Conclusion](#conclusion)
12
+
13
+ ## Introduction
14
+ <One paragraph: which data/entities/states this page covers, why they matter, and where they live in the repository.>
15
+
16
+ ## Data Model Overview
17
+ <One paragraph sketching the core entities and their relations, with an ER diagram (entity names in English).>
18
+
19
+ ```mermaid
20
+ erDiagram
21
+ USER ||--o{ ITEM : "creates"
22
+ ITEM ||--o{ TAG : "owns"
23
+ ITEM {
24
+ int id
25
+ string name
26
+ string status
27
+ }
28
+ ```
29
+
30
+ Diagram sources
31
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
32
+
33
+ Section sources
34
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
35
+
36
+ ## Core Entity Analysis
37
+ ### <Entity 1>
38
+ - Fields: <key fields and types; with many fields prefer a table: | Field | Type | Constraint/Notes |>
39
+ - Constraints: <uniqueness / nullability / referential integrity>
40
+ - Invariants: <conditions that must always hold>
41
+
42
+ Section sources
43
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
44
+
45
+ ### <Entity 2>
46
+ - ...
47
+
48
+ Section sources
49
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
50
+
51
+ ## State Machine
52
+ <If there is a status field: list every state and its transition triggers in a stateDiagram-v2 (use `state "Label" as id` aliases for display names); without an explicit state machine, describe the implicit data-state progression.>
53
+
54
+ ```mermaid
55
+ stateDiagram-v2
56
+ state "Draft" as draft
57
+ state "Published" as published
58
+ state "Archived" as archived
59
+ [*] --> draft
60
+ draft --> published : "publish"
61
+ published --> archived : "archive"
62
+ archived --> [*]
63
+ ```
64
+
65
+ Diagram sources
66
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
67
+
68
+ Section sources
69
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
70
+
71
+ ## Storage and Serialization
72
+ First a short prose paragraph on the storage landscape, then bullets: where data lives (memory / files / database), formats, and serialization/deserialization code points.
73
+
74
+ Section sources
75
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
76
+
77
+ ## Data Lifecycle
78
+ <The full path from creation through usage/update to archival/cleanup, with a lifecycle diagram.>
79
+
80
+ ```mermaid
81
+ graph LR
82
+ A["Create"] --> B["Use / Update"]
83
+ B --> C["Archive"]
84
+ C --> D["Cleanup"]
85
+ ```
86
+
87
+ Diagram sources
88
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
89
+
90
+ Section sources
91
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
92
+
93
+ ## Troubleshooting Guide
94
+ - <common data problems (inconsistency / dirty data / concurrency conflicts) → cause → how to locate → relevant code location.>
95
+
96
+ Section sources
97
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
98
+
99
+ ## Conclusion
100
+ <One paragraph: the data model's positioning, correct usage, and caveats.>
101
+
102
+ Section sources
103
+ - [<path>:<from>-<to>](file://<path>#L<from>-L<to>)
104
+
105
+ <cite>
106
+ **Files referenced**
107
+ - [<file name>](file://<repo-relative path>)
108
+ - [<file name>](file://<repo-relative path>)
109
+ </cite>