fix(kbdb): 藏書地圖加 entry_count——triplet_count=0 不再被誤讀成「沒有知識」(Arcrun#87 三次收尾) #117
Reference in New Issue
Block a user
Delete Branch "fix/library-map-triplet-vs-entry-honesty-87"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
目的(Arcrun#87 三次收尾)
kbdb_get_map過去只回triplet_count——kb 以外幾乎全部庫顯示「0 triplets」,讀起來像空庫,AI 一開場看到就放棄查詢。實際上那些庫的 entries(原始 ingest 內容)都在,只是三元組萃取從沒對它們跑過。改了什麼
kbdb/src/actions/library-map.ts:新增liveEntryCountsByLibrary(即時統計 entries,排除entry_type='value'存儲細節與library_map自己的 block),entry_count並排triplet_count回傳(全館listLibraryMaps+ 單庫getLibraryMapDetail)。mcp/src/lib/library-map.ts:renderLibraryMapLines(MCP instructions 首屏文字)在triplet_count=0 且 entry_count>0時明講「有內容、只是還沒萃取,kbdb_search 查得到」,不再讓 0 觸目即誤讀成空庫。mcp/src/tools/kbdb_map.ts:kbdb_get_map全館視圖的 hints 會點名「entry-only」的庫;單庫詳圖在 triplet_count=0/entry_count>0 時附同款提示。console-ui/public/console/index.html:看板卡片同步顯示「N 筆原始內容(尚未萃取)」。kbdb/tests/library-map.test.ts(entry_count 計數口徑)、mcp/tests/unit/tools/kbdb-map.test.ts(hints 內容、渲染文字、舊部署缺欄位容錯)。驗證
kbdb_get_map回應 JSON(見 PR 討論留言),確認 hints 會明講「triplet_count=0 但 entry_count>0 的庫別當空庫」部署(未做,需 leo 手動觸發,兩支 worker + 一個靜態站)
merge 後,leo 自己在對應目錄下跑既有的發佈指令即可(kbdb worker、mcp worker、console-ui 靜態站各一次)。CLI 未變更,不需要重新打包。
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.