Commit e2b625d5 by 黄南光

新增优化文档

1 parent 9a953037
Showing 372 changed files with 33 additions and 1 deletions
......@@ -4,9 +4,19 @@
| 文件 | 说明 |
|---|---|
| `Wiki_RAG智能知识平台版本迭代报告.html` | **最终报告**(单文件自包含,1.06 MB)。19 章 / 46 张内联 SVG / 54 张表格 / 100 个小节。直接双击用浏览器打开即可 |
| `Wiki_RAG智能知识平台版本迭代报告.html` | **最终报告**(单文件自包含,1.07 MB)。19 章 / 46 张内联 SVG / 54 张表格 / 100 个小节。直接双击用浏览器打开即可 |
| `试用期述职汇报_Wiki与RAG智能知识平台.pptx` | **汇报用 PPTX**(16:9,59 页,17.3 MB)。全篇按 A–F 六部分搭好,其中 B3「Wiki / RAG 智能知识平台」为写实内容(36 页,含报告里的 36 张图),A / B1 / B2 / C / D / E / F 为待填写模板页 |
| `事实底稿.md` | 写报告前的源码与 git 核查底稿。每条结论标注可回查的源码路径或 commit,正文只使用这里已核实的事实 |
### 章节顺序
叙述顺序为:Wiki 主线(1–6)→ Skills 瘦身(7)→ RAG 主线(8–11)→ **Wiki × RAG 综合对比(12)**
→ 工程深化:长文档 MapReduce / 原子提交 / Context 编排(13–15)→ 平台治理(16–18)→ 总结(19)。
章号只在 `_build/build_report.py` 的 `SECTIONS` 列表里定义。调整顺序后必须跑一次
`python _build/renumber.py`,它会把各章片段里的小节号(`8.3 xxx`)、图题(`图 8-2`)
与交叉引用(`第 8 章`)同步过来,幂等可重复执行。
## 目录结构
```
......@@ -24,6 +34,11 @@
│ ├── dia_memory.py ← 第 17 章图
│ ├── dia_final.py ← 第 18–19 章图
│ ├── build_report.py ← 组装器(章节片段 + 内联 SVG → 单文件 HTML)
│ ├── renumber.py ← 章节顺序变更后同步小节号 / 图号 / 交叉引用
│ ├── shot.py ← SVG → PNG(headless Chrome);--hi 出 2× 高清图
│ ├── deck_kit.py ← PPTX 版式工具箱(配色字体与 HTML 报告同源)
│ ├── make_pptx.py ← 述职 PPTX 生成器(A–F 全篇结构 + B3 写实内容)
│ ├── _shots_hi/ ← 46 张 3200px 宽 SVG 截图,供 PPTX 内嵌
│ └── sections/c1.html … c19.html ← 19 章正文片段
├── scripts/ ← 量化脚本(均可复跑)
│ ├── bench_query_headtohead.py ← Wiki × RAG 同题同环境实测
......@@ -81,7 +96,21 @@ cd scripts && $PY bench_answer_models.py --models deepseek-v4-flash,qwen-flash,q
# 重画全部 SVG + 重新组装报告
cd _build && for f in dia_core dia_wiki dia_wiki2 dia_rag dia_rag2 dia_platform dia_memory dia_final; do $PY $f.py; done
$PY _build/renumber.py # 只在改过 SECTIONS 顺序后需要
$PY _build/build_report.py
# 重新生成汇报 PPTX(图从 SVG 重新截,所以改完图直接重跑即可)
$PY _build/shot.py --hi
$PY _build/make_pptx.py
```
### 版式自查
`shot.py`(不带 `--hi`)会把 46 张 SVG 渲染成 1280px 宽的 PNG 到 `_build/_shots/`,
用来逐张检查有没有文字出框、连线压字。PPTX 侧可以用 LibreOffice 转 PDF 后逐页导图核对:
```bash
soffice --headless --convert-to pdf --outdir _build/_pdf 试用期述职汇报_Wiki与RAG智能知识平台.pptx
```
## 报告口径
......
<meta charset="utf-8"><style>html,body{margin:0;padding:0;background:#fff}svg{display:block;width:1280px}</style><svg xmlns="http://www.w3.org/2000/svg" viewBox="14.0 -6.0 1428.0 480.6" width="100%" preserveAspectRatio="xMidYMid meet" role="img" aria-label="跨页表格拼接"><rect x="14.0" y="-6.0" width="1428.0" height="480.6" fill="#FCFAF6"/><defs><filter id="soft" x="-30%" y="-30%" width="170%" height="170%"><feDropShadow dx="0" dy="2.5" stdDeviation="4" flood-color="#8A7460" flood-opacity=".16"/></filter><marker id="ar_E0930F" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6.4" markerHeight="6.4" orient="auto-start-reverse"><path d="M0.6 1L9.4 5L0.6 9L2.6 5z" fill="#E0930F"/></marker></defs><rect x="40.0" y="22.0" width="6.0" height="30.0" rx="3" fill="#D9622B"/><text x="58.0" y="42.0" text-anchor="start" style="font:800 22px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#2F2A24">跨页表格:模型负责标注延续关系,程序负责确定性拼接</text><text x="58.0" y="66.0" text-anchor="start" style="font:400 13px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">跨页表格在每页重复表头,却不一定显式写「续表」;靠字符串相似度硬猜会错拼两张不相关的表</text><rect x="46.0" y="118.0" width="210.0" height="250.0" rx="10" fill="#E2D6C4" opacity="0.30"/><rect x="40.0" y="112.0" width="210.0" height="250.0" rx="10" fill="#FFFFFF" stroke="#E2D6C4" stroke-width="1.4" filter="url(#soft)"/><text x="54.0" y="138.0" text-anchor="start" style="font:800 13.4px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">第 3 页</text><text x="54.0" y="164.0" text-anchor="start" style="font:600 11.6px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#655F57">| 品牌 | 产品 | 价格 |</text><text x="54.0" y="186.0" text-anchor="start" style="font:600 11.6px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#655F57">| --- | --- | --- |</text><text x="54.0" y="208.0" text-anchor="start" style="font:600 11.6px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#655F57">| 问界 | 整车延保 | 6,800 |</text><text x="54.0" y="230.0" text-anchor="start" style="font:600 11.6px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#655F57">| 问界 | 电池延保 | 3,200 |</text><text x="54.0" y="252.0" text-anchor="start" style="font:600 11.6px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#655F57">…(表格未结束)</text><rect x="54.0" y="316.0" width="182.0" height="32.0" rx="7" fill="#E0930F" opacity="0.9"/><text x="145.0" y="337.0" text-anchor="middle" style="font:800 11.6px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#fff">&lt;!--table-continues--&gt;</text><rect x="326.0" y="118.0" width="210.0" height="250.0" rx="10" fill="#E2D6C4" opacity="0.30"/><rect x="320.0" y="112.0" width="210.0" height="250.0" rx="10" fill="#FFFFFF" stroke="#E2D6C4" stroke-width="1.4" filter="url(#soft)"/><text x="334.0" y="138.0" text-anchor="start" style="font:800 13.4px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">第 4 页</text><text x="334.0" y="164.0" text-anchor="start" style="font:600 11.6px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#655F57">| 品牌 | 产品 | 价格 |</text><text x="334.0" y="186.0" text-anchor="start" style="font:600 11.6px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#655F57">| --- | --- | --- |</text><text x="334.0" y="208.0" text-anchor="start" style="font:600 11.6px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#655F57">| 智界 | 整车延保 | 7,200 |</text><text x="334.0" y="230.0" text-anchor="start" style="font:600 11.6px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#655F57">| 智界 | 轮胎保障 | 1,800 |</text><path d="M256.0 237.0L308.0 237.0" fill="none" stroke="#E0930F" stroke-width="2.2" stroke-linejoin="round" marker-end="url(#ar_E0930F)"/><rect x="586.0" y="118.0" width="450.0" height="250.0" rx="12" fill="#2F8781" opacity="0.30"/><rect x="580.0" y="112.0" width="450.0" height="250.0" rx="12" fill="#FFFFFF" stroke="#2F8781" stroke-width="1.4" filter="url(#soft)"/><text x="598.0" y="142.0" text-anchor="start" style="font:800 14.4px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#1F625E">_stitch_continued_tables() 的判定</text><text x="598.0" y="170.0" text-anchor="start" style="font:600 11.6px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">1. 遍历全部块,遇到带 table_continues 标记的表格块</text><text x="598.0" y="194.0" text-anchor="start" style="font:600 11.6px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">2. 取紧邻的下一个 table 块作为续表候选</text><text x="598.0" y="218.0" text-anchor="start" style="font:600 11.6px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">3. _merge_table_markdown:比较两表首行</text><text x="598.0" y="242.0" text-anchor="start" style="font:500 11.6px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57"> · 首行相同 → 判定续表重复了表头,跳过其前两行再拼</text><text x="598.0" y="266.0" text-anchor="start" style="font:500 11.6px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57"> · 首行不同 → 判定续表没写表头,保留其首行数据后再拼</text><text x="598.0" y="290.0" text-anchor="start" style="font:600 11.6px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">4. 把 page_end 改写成续表所在页,标记 continued_table</text><text x="598.0" y="314.0" text-anchor="start" style="font:600 11.6px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">5. 若续表自身也带标记 → while 循环继续拼下一页</text><text x="598.0" y="340.0" text-anchor="start" style="font:700 11.6px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#1F625E">证据不足时保持分页 —— 误拼两张不相关的表比分开更难被发现</text><rect x="1056.0" y="118.0" width="360.0" height="250.0" rx="12" fill="#4F8A3D" opacity="0.30"/><rect x="1050.0" y="112.0" width="360.0" height="250.0" rx="12" fill="#FFFFFF" stroke="#4F8A3D" stroke-width="1.4" filter="url(#soft)"/><text x="1068.0" y="142.0" text-anchor="start" style="font:800 14.4px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#39662B">拼接结果(单个块)</text><text x="1068.0" y="170.0" text-anchor="start" style="font:600 11.6px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#655F57">| 品牌 | 产品 | 价格 |</text><text x="1068.0" y="194.0" text-anchor="start" style="font:600 11.6px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#655F57">| --- | --- | --- |</text><text x="1068.0" y="218.0" text-anchor="start" style="font:600 11.6px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#655F57">| 问界 | 整车延保 | 6,800 |</text><text x="1068.0" y="242.0" text-anchor="start" style="font:600 11.6px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#655F57">| 问界 | 电池延保 | 3,200 |</text><text x="1068.0" y="266.0" text-anchor="start" style="font:700 11.6px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#39662B">| 智界 | 整车延保 | 7,200 |</text><text x="1068.0" y="290.0" text-anchor="start" style="font:700 11.6px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#39662B">| 智界 | 轮胎保障 | 1,800 |</text><text x="1068.0" y="340.0" text-anchor="start" style="font:700 11.6px 'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;fill:#39662B">metadata: page_start=3, page_end=4, continued_table=true</text><rect x="40.0" y="388.0" width="1290.0" height="60.6" rx="9" fill="#FDF3DE" stroke="#E0930F" stroke-width="1.1" opacity="0.95"/><rect x="40.0" y="388.0" width="4" height="60.6" rx="2" fill="#E0930F"/><text x="55.0" y="406.0" text-anchor="start" style="font:800 12.7px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#E0930F">可靠性边界</text><text x="55.0" y="424.9" text-anchor="start" style="font:500 12.2px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">这个机制依赖模型在提示词约束下正确标注延续关系(提示词第 7 条)。它比纯启发式(列数相近 / 宽度相近 / 表头相似)更可靠,因为模型看得到「这张表在页面底部被截断了」这个视觉事实;但它同样会漏标——因此代码的兜底策</text><text x="55.0" y="443.2" text-anchor="start" style="font:500 12.2px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">略是「没有标记就不拼」,宁可保留分页也不误拼。另外 _is_table_row 特意不只判断行首竖线:VLM 对跨页续表常省略行首 `|`,只看 startswith(&#x27;|&#x27;) 会把整段续表数据当成普通段落。</text></svg>
\ No newline at end of file
<meta charset="utf-8"><style>html,body{margin:0;padding:0;background:#fff}svg{display:block;width:1280px}</style><svg xmlns="http://www.w3.org/2000/svg" viewBox="14.0 -6.0 1389.0 646.0" width="100%" preserveAspectRatio="xMidYMid meet" role="img" aria-label="Wiki 的三个动作与共同契约"><rect x="14.0" y="-6.0" width="1389.0" height="646.0" fill="#FCFAF6"/><defs><filter id="soft" x="-30%" y="-30%" width="170%" height="170%"><feDropShadow dx="0" dy="2.5" stdDeviation="4" flood-color="#8A7460" flood-opacity=".16"/></filter><marker id="ar_7A5EA8" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6.4" markerHeight="6.4" orient="auto-start-reverse"><path d="M0.6 1L9.4 5L0.6 9L2.6 5z" fill="#7A5EA8"/></marker><marker id="ar_2F8781" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6.4" markerHeight="6.4" orient="auto-start-reverse"><path d="M0.6 1L9.4 5L0.6 9L2.6 5z" fill="#2F8781"/></marker><marker id="ar_E0930F" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6.4" markerHeight="6.4" orient="auto-start-reverse"><path d="M0.6 1L9.4 5L0.6 9L2.6 5z" fill="#E0930F"/></marker><marker id="ar_918878" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6.4" markerHeight="6.4" orient="auto-start-reverse"><path d="M0.6 1L9.4 5L0.6 9L2.6 5z" fill="#918878"/></marker></defs><rect x="40.0" y="22.0" width="6.0" height="30.0" rx="3" fill="#D9622B"/><text x="58.0" y="42.0" text-anchor="start" style="font:800 22px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#2F2A24">Wiki 的三个动作围绕同一份权威页面闭环</text><text x="58.0" y="66.0" text-anchor="start" style="font:400 13px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">摄入产生资产,查询消费资产,维护修正资产;三者共享同一套 slug / Frontmatter / 来源标记契约</text><rect x="117.0" y="167.0" width="380.0" height="150.0" rx="14" fill="#7A5EA8" opacity="0.30"/><rect x="110.0" y="160.0" width="380.0" height="150.0" rx="14" fill="#FFFFFF" stroke="#7A5EA8" stroke-width="1.4" filter="url(#soft)"/><rect x="110.0" y="160.0" width="380" height="5.5" rx="2.7" fill="#7A5EA8"/><text x="300.0" y="196.0" text-anchor="middle" style="font:800 18px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#7A5EA8">摄入 Ingest</text><text x="300.0" y="226.0" text-anchor="middle" style="font:500 12.5px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">md / txt / docx / xlsx / pptx / pdf</text><text x="300.0" y="250.0" text-anchor="middle" style="font:500 12.5px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">→ 页面拓扑 + 12 字段头 + 正文</text><text x="300.0" y="274.0" text-anchor="middle" style="font:700 12.5px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#7A5EA8">成功 = 契约通过且一次性提交</text><rect x="557.0" y="167.0" width="380.0" height="150.0" rx="14" fill="#2F8781" opacity="0.30"/><rect x="550.0" y="160.0" width="380.0" height="150.0" rx="14" fill="#FFFFFF" stroke="#2F8781" stroke-width="1.4" filter="url(#soft)"/><rect x="550.0" y="160.0" width="380" height="5.5" rx="2.7" fill="#2F8781"/><text x="740.0" y="196.0" text-anchor="middle" style="font:800 18px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#2F8781">查询 Query</text><text x="740.0" y="226.0" text-anchor="middle" style="font:500 12.5px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">问题 → index.md 地图定位 slug</text><text x="740.0" y="250.0" text-anchor="middle" style="font:500 12.5px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">→ 直读 ≤3 页 + related 二跳</text><text x="740.0" y="274.0" text-anchor="middle" style="font:700 12.5px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#2F8781">答案必须带可点击的页面引用</text><rect x="997.0" y="167.0" width="380.0" height="150.0" rx="14" fill="#E0930F" opacity="0.30"/><rect x="990.0" y="160.0" width="380.0" height="150.0" rx="14" fill="#FFFFFF" stroke="#E0930F" stroke-width="1.4" filter="url(#soft)"/><rect x="990.0" y="160.0" width="380" height="5.5" rx="2.7" fill="#E0930F"/><text x="1180.0" y="196.0" text-anchor="middle" style="font:800 18px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#E0930F">维护 Maintain</text><text x="1180.0" y="226.0" text-anchor="middle" style="font:500 12.5px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">编辑 / lint / 重新摄入</text><text x="1180.0" y="250.0" text-anchor="middle" style="font:500 12.5px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">按来源摄出 + 字段归属重算</text><text x="1180.0" y="274.0" text-anchor="middle" style="font:700 12.5px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#E0930F">删一个来源不能误伤其他来源</text><rect x="418.0" y="438.0" width="660.0" height="176.0" rx="16" fill="#D9622B" opacity="0.30"/><rect x="410.0" y="430.0" width="660.0" height="176.0" rx="16" fill="#F4EDE2" stroke="#D9622B" stroke-width="1.4" filter="url(#soft)"/><text x="740.0" y="464.0" text-anchor="middle" style="font:800 16.5px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#A8461A">五项共同契约(三个动作都必须遵守)</text><text x="434.0" y="486.0" text-anchor="start" style="font:800 12.8px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#2F2A24">▸ slug / WikiType</text><text x="624.0" y="486.0" text-anchor="start" style="font:500 12.3px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">摄入定路径 · 查询定位 · 维护同步重命名</text><text x="434.0" y="509.0" text-anchor="start" style="font:800 12.8px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#2F2A24">▸ 12 字段 Frontmatter</text><text x="624.0" y="509.0" text-anchor="start" style="font:500 12.3px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">摄入落盘前校验 · 查询按字段防串味 · lint 复检</text><text x="434.0" y="532.0" text-anchor="start" style="font:800 12.8px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#2F2A24">▸ sources + field_sources</text><text x="624.0" y="532.0" text-anchor="start" style="font:500 12.3px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">摄入写账本 · 查询告知依据 · 摄出只撤销对应贡献</text><text x="434.0" y="555.0" text-anchor="start" style="font:800 12.8px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#2F2A24">▸ SOURCE_START/END</text><text x="624.0" y="555.0" text-anchor="start" style="font:500 12.3px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">包围来源正文块,使按来源精确删除成为可能</text><text x="434.0" y="578.0" text-anchor="start" style="font:800 12.8px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#2F2A24">▸ index.md</text><text x="624.0" y="578.0" text-anchor="start" style="font:500 12.3px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">入库后确定性重建 · 查询侧稳定前缀 · 维护保证一致</text><path d="M300.0 310.0L300.0 372.7L555.2 372.7L555.2 424.0" fill="none" stroke="#7A5EA8" stroke-width="1.9" stroke-linejoin="round" marker-end="url(#ar_7A5EA8)"/><path d="M740.0 310.0L740.0 372.7L740.0 372.7L740.0 424.0" fill="none" stroke="#2F8781" stroke-width="1.9" stroke-linejoin="round" marker-end="url(#ar_2F8781)"/><path d="M1180.0 310.0L1180.0 372.7L924.8 372.7L924.8 424.0" fill="none" stroke="#E0930F" stroke-width="1.9" stroke-linejoin="round" marker-end="url(#ar_E0930F)"/><path d="M492.0 235.0L548.0 235.0" fill="none" stroke="#918878" stroke-width="2.0" stroke-linejoin="round" marker-end="url(#ar_918878)"/><rect x="482.0" y="223.0" width="76.0" height="23.0" rx="11.5" fill="#FCFAF6" stroke="#918878" stroke-width="1.0" opacity="0.98"/><text x="520.0" y="239.3" text-anchor="middle" style="font:700 12px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#918878">页面即接口</text><path d="M932.0 235.0L988.0 235.0" fill="none" stroke="#918878" stroke-width="2.0" stroke-linejoin="round" marker-end="url(#ar_918878)"/><rect x="916.0" y="223.0" width="88.0" height="23.0" rx="11.5" fill="#FCFAF6" stroke="#918878" stroke-width="1.0" opacity="0.98"/><text x="960.0" y="239.3" text-anchor="middle" style="font:700 12px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#918878">反馈驱动修正</text><path d="M1180.0 150.0L1180.0 114.0L300.0 114.0L300.0 150.0" fill="none" stroke="#918878" stroke-width="2.0" stroke-linejoin="round" marker-end="url(#ar_918878)" stroke-dasharray="7,5"/><text x="740.0" y="106.0" text-anchor="middle" style="font:700 12.5px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">维护结果重新进入摄入:知识只增不减是不可维护的</text></svg>
\ No newline at end of file
<meta charset="utf-8"><style>html,body{margin:0;padding:0;background:#fff}svg{display:block;width:1280px}</style><svg xmlns="http://www.w3.org/2000/svg" viewBox="14.0 -6.0 1367.0 802.0" width="100%" preserveAspectRatio="xMidYMid meet" role="img" aria-label="三阶段摄入时序"><rect x="14.0" y="-6.0" width="1367.0" height="802.0" fill="#FCFAF6"/><defs><filter id="soft" x="-30%" y="-30%" width="170%" height="170%"><feDropShadow dx="0" dy="2.5" stdDeviation="4" flood-color="#8A7460" flood-opacity=".16"/></filter><marker id="ar_3B6FB5" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6.4" markerHeight="6.4" orient="auto-start-reverse"><path d="M0.6 1L9.4 5L0.6 9L2.6 5z" fill="#3B6FB5"/></marker><marker id="ar_7A5EA8" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6.4" markerHeight="6.4" orient="auto-start-reverse"><path d="M0.6 1L9.4 5L0.6 9L2.6 5z" fill="#7A5EA8"/></marker><marker id="ar_2F8781" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6.4" markerHeight="6.4" orient="auto-start-reverse"><path d="M0.6 1L9.4 5L0.6 9L2.6 5z" fill="#2F8781"/></marker><marker id="ar_E0930F" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6.4" markerHeight="6.4" orient="auto-start-reverse"><path d="M0.6 1L9.4 5L0.6 9L2.6 5z" fill="#E0930F"/></marker><marker id="ar_4F8A3D" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6.4" markerHeight="6.4" orient="auto-start-reverse"><path d="M0.6 1L9.4 5L0.6 9L2.6 5z" fill="#4F8A3D"/></marker></defs><rect x="40.0" y="22.0" width="6.0" height="30.0" rx="3" fill="#D9622B"/><text x="58.0" y="42.0" text-anchor="start" style="font:800 22px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#2F2A24">一次短文档摄入的完整时序</text><text x="58.0" y="66.0" text-anchor="start" style="font:400 13px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">重点看两处:共享前缀在每次调用中逐字节一致;所有磁盘副作用集中在最后一段临界区</text><rect x="55.0" y="110.0" width="190.0" height="46.0" rx="10" fill="#FFFFFF" stroke="#3B6FB5" stroke-width="1.6"/><text x="150.0" y="130.0" text-anchor="middle" style="font:800 13.2px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#3B6FB5">接口层</text><text x="150.0" y="147.0" text-anchor="middle" style="font:500 11.6px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#918878">run_ingest_agent</text><line x1="150.0" y1="156.0" x2="150.0" y2="770.0" stroke="#E2D6C4" stroke-width="1.6" stroke-linecap="round" stroke-dasharray="5,6"/><rect x="325.0" y="110.0" width="190.0" height="46.0" rx="10" fill="#FFFFFF" stroke="#7A5EA8" stroke-width="1.6"/><text x="420.0" y="130.0" text-anchor="middle" style="font:800 13.2px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#7A5EA8">Planner</text><text x="420.0" y="147.0" text-anchor="middle" style="font:500 11.6px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#918878">qwen3.7-plus</text><line x1="420.0" y1="156.0" x2="420.0" y2="770.0" stroke="#E2D6C4" stroke-width="1.6" stroke-linecap="round" stroke-dasharray="5,6"/><rect x="605.0" y="110.0" width="190.0" height="46.0" rx="10" fill="#FFFFFF" stroke="#2F8781" stroke-width="1.6"/><text x="700.0" y="130.0" text-anchor="middle" style="font:800 13.2px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#2F8781">Writers ×N</text><text x="700.0" y="147.0" text-anchor="middle" style="font:500 11.6px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#918878">信号量 ≤20</text><line x1="700.0" y1="156.0" x2="700.0" y2="770.0" stroke="#E2D6C4" stroke-width="1.6" stroke-linecap="round" stroke-dasharray="5,6"/><rect x="885.0" y="110.0" width="190.0" height="46.0" rx="10" fill="#FFFFFF" stroke="#E0930F" stroke-width="1.6"/><text x="980.0" y="130.0" text-anchor="middle" style="font:800 13.2px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#E0930F">契约校验器</text><text x="980.0" y="147.0" text-anchor="middle" style="font:500 11.6px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#918878">ingest_contract</text><line x1="980.0" y1="156.0" x2="980.0" y2="770.0" stroke="#E2D6C4" stroke-width="1.6" stroke-linecap="round" stroke-dasharray="5,6"/><rect x="1160.0" y="110.0" width="190.0" height="46.0" rx="10" fill="#FFFFFF" stroke="#4F8A3D" stroke-width="1.6"/><text x="1255.0" y="130.0" text-anchor="middle" style="font:800 13.2px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#4F8A3D">磁盘 / DB</text><text x="1255.0" y="147.0" text-anchor="middle" style="font:500 11.6px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#918878">staging→正式</text><line x1="1255.0" y1="156.0" x2="1255.0" y2="770.0" stroke="#E2D6C4" stroke-width="1.6" stroke-linecap="round" stroke-dasharray="5,6"/><path d="M150.0 192.0L420.0 192.0" fill="none" stroke="#3B6FB5" stroke-width="1.9" stroke-linejoin="round" marker-end="url(#ar_3B6FB5)"/><text x="285.0" y="184.0" text-anchor="middle" style="font:700 11.8px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#3B6FB5">① 组装共享前缀:Skill + Schema 契约 + 原文(逐字节固定)</text><path d="M420.0 238.0L150.0 238.0" fill="none" stroke="#7A5EA8" stroke-width="1.9" stroke-linejoin="round" marker-end="url(#ar_7A5EA8)"/><text x="285.0" y="230.0" text-anchor="middle" style="font:700 11.8px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#7A5EA8">② 返回页面计划 JSON:type / slug / 路径 / global_dims / pages[]</text><path d="M156.0 284.0L214.0 284.0L214.0 314.0L162.0 314.0" fill="none" stroke="#3B6FB5" stroke-width="1.9" stroke-linejoin="round" marker-end="url(#ar_3B6FB5)"/><text x="224.0" y="303.0" text-anchor="start" style="font:600 11.8px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#3B6FB5">③ 结构校验:字段齐全?slug 冲突?路径合法?失败回喂错误重规划(≤2 次)</text><path d="M150.0 340.0L700.0 340.0" fill="none" stroke="#3B6FB5" stroke-width="1.9" stroke-linejoin="round" marker-end="url(#ar_3B6FB5)"/><text x="425.0" y="332.0" text-anchor="middle" style="font:700 11.8px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#3B6FB5">④ 扇出:同一份共享前缀 + 各自的页面任务(前缀之后才分叉)</text><path d="M700.0 386.0L980.0 386.0" fill="none" stroke="#2F8781" stroke-width="1.9" stroke-linejoin="round" marker-end="url(#ar_2F8781)"/><text x="840.0" y="378.0" text-anchor="middle" style="font:700 11.8px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#2F8781">⑤ 每页产出 Frontmatter + 正文,逐页送校验</text><path d="M980.0 432.0L700.0 432.0" fill="none" stroke="#E0930F" stroke-width="1.9" stroke-linejoin="round" marker-end="url(#ar_E0930F)"/><text x="840.0" y="424.0" text-anchor="middle" style="font:700 11.8px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#E0930F">⑥ 缺 required_extra / 枚举越界 → 带具体错误重试该页(≤4 次)</text><path d="M700.0 478.0L150.0 478.0" fill="none" stroke="#2F8781" stroke-width="1.9" stroke-linejoin="round" marker-end="url(#ar_2F8781)"/><text x="425.0" y="470.0" text-anchor="middle" style="font:700 11.8px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#2F8781">⑦ 全部页面通过;fail-fast:任一页异常立即中止整批</text><path d="M150.0 524.0L1255.0 524.0" fill="none" stroke="#3B6FB5" stroke-width="1.9" stroke-linejoin="round" marker-end="url(#ar_3B6FB5)"/><text x="702.5" y="516.0" text-anchor="middle" style="font:700 11.8px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#3B6FB5">⑧ 写 staging 临时目录 + 备份已存在的同名页面</text><path d="M150.0 570.0L1255.0 570.0" fill="none" stroke="#4F8A3D" stroke-width="1.9" stroke-linejoin="round" marker-end="url(#ar_4F8A3D)"/><text x="702.5" y="562.0" text-anchor="middle" style="font:700 11.8px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#4F8A3D">⑨ 全部 staging 成功 → 逐个 shutil.move 到正式路径</text><path d="M150.0 616.0L1255.0 616.0" fill="none" stroke="#4F8A3D" stroke-width="1.9" stroke-linejoin="round" marker-end="url(#ar_4F8A3D)"/><text x="702.5" y="608.0" text-anchor="middle" style="font:700 11.8px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#4F8A3D">⑩ 重建 index.md(全量,非追加)+ 追加 log.md + 落库任务状态</text><rect x="50.0" y="668.0" width="1305.0" height="74.0" rx="11" fill="#FBEAED" stroke="#B54A5B" stroke-width="1.3" stroke-dasharray="7,5"/><text x="70.0" y="694.0" text-anchor="start" style="font:800 13.5px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#8A3444">异常分支(⑧⑨ 任一步失败)</text><text x="70.0" y="718.0" text-anchor="start" style="font:500 12.2px 'Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,'Segoe UI',sans-serif;fill:#655F57">把备份 shutil.move 回原路径 → finally 清空 staging 目录 → 正式仓库观察到的仍是完整旧版本,绝不出现「一半新一半旧」</text></svg>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!