Files
Arcrun/system-dev/docs/3-specs/library-map/requirements.md

27 lines
2.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# library-map(藏書地圖)— Requirements
> 來源:Arcrun#39leo 2026-07-08 拍板立案,spec 全文在 issue`Leo/InkStoneCo` `6-user/kbdb-library-map-spec.md`)。
> SDD 出稿:雲端總管 2026-07-19(leo 當日催辦「說了好幾天還沒有 SDD?」)。
## 問題
KBDB 是純 pull 查詢引擎,MCP/GUI 都預設「查詢者已知道要查什麼」。新 LLM session 接上 MCP 看得到 query 工具,卻不知道館裡有哪些藏書——只能拿推理成本掃庫,換一張本可預先算好的地圖。GUI 首頁同樣是空白搜尋框,人也沒有定向層。
## 需求(R
- R1 每庫一張機械導出的地圖 block(庫名/一句話 narrativetop entitiesrelation 輪廓/跨庫橋接/規模/鮮度),**全部由 graph 統計算出,零 LLM 生成**。
- R2 ingest 完成後只對受本次 diff 影響的庫增量重算(新 block+舊標 superseded),無定時全量重算。
- R3 MCP:①全館地圖(每庫一行,數百 token 內)注入 server instructionsagent 開場即持有 ②新工具 `get_map`(無參數=全館;`library` 參數=該庫詳圖),description 註明「不確定查什麼先呼叫此工具」。
- R4 GUIconsole/portal 首頁改 render 全館地圖(有哪些庫、每庫講什麼、跨庫橋接),非空白搜尋框。
- R5 KBDB 三表不變量:新 Templateblocksslots,不建表不 ALTERD6)。
- R6 版本語意沿用 supersede/deprecate status slotcommit hash。
- R7 **與 D30 檢索治本連動**map block 的 narrativetop_entities 即「只 vectorize entities+一句話」的嵌入素材——semantic 路由層優先打 map 層(詳 design §5)。
## 明確不做(leo 原文)
❌ LLM 生成摘要當地圖 ❌ 獨立摘要樹結構 ❌ 無界 embedding ❌ 地圖必須先落檔才入庫(每庫 index.md 輸出=phase 2 optional)。
## 驗收
新開 claude.ai session 掛 MCP:開場 instructions 見全館地圖;`get_map("kb")` 回該庫詳圖;GUI 首頁見地圖;ingest 一筆新料後該庫地圖自動更新、他庫不動;全程零 LLM 呼叫、map block 數=庫數。