From 10dda9e6f5dd87592a5468bba998ac8050c7c82a Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 19 Jul 2026 09:34:28 +0000 Subject: [PATCH] =?UTF-8?q?feat(console):=20library-map=20M5=20=E2=80=94?= =?UTF-8?q?=20=E7=B8=BD=E5=BA=AB=E6=90=9C=E5=B0=8B=E9=A0=81=E8=97=8F?= =?UTF-8?q?=E6=9B=B8=E5=9C=B0=E5=9C=96=E9=A6=96=E9=A0=81=E5=8D=80=E5=A1=8A?= =?UTF-8?q?=EF=BC=88R4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit library-map SDD M5(Arcrun#39):console 首頁從空白搜尋框變全館地圖。 落點裁定:console 是 hash-routing 單頁殼,home 隨 profile(full=駕駛艙、 rag=總庫搜尋)——地圖放總庫搜尋頁搜尋框上方:rag profile 該頁即首頁; full profile 它是全館入口,「點庫卡片→進該庫搜尋」動線同頁最短,一份實作 兩 profile 全吃。 - console.ts:藏書地圖區塊(lm-section)——每庫一張卡(庫名+narrative+ top entities 前 5 帶 degree+triplet_count+commit_hash/updated 更新時間感)、 跨庫 bridges 有資料才列一小區;兩段式渲染(全館列表先出卡,逐庫詳圖補 degree/bridges,詳圖失敗維持名字版不擋);點庫卡片=設 library filter (/kbdb/search 既有 library 參數,不新造)進庫搜尋,附清除鈕搜回全館; /map 空陣列或錯誤=誠實空狀態(指引 POST /map/recompute backfill), 不擋搜尋等其他功能。品牌沿 CONSOLE_BRAND 變數(#21),零外部庫。 - kbdb-proxy.ts:GET /kbdb/map+/kbdb/map/:library 純轉發(rule 07,聚合真身 在 kbdb base M2)。owner_id 不強制注入只選擇性透傳(同 M4 MCP kbdb_get_map 語意;現行 backfill map block owner=NULL,強制注入租戶=首頁永遠假空狀態); 仍要求 X-Arcrun-API-Key 同閘;KBDB 不可達誠實 502。 - 測試:kbdb-map-proxy.test.ts 9 測(租戶閘/轉發/owner 透傳/空陣列/404/502)+ console-library-map-page.test.ts 6 測(route 200/區塊在搜尋框上方/資料源接線/ library 參數/誠實空狀態文案/品牌變數)——15/15 過。 - 誠實回報:tsc 16 行 ExecutionContext.tracing 錯誤與 executor.test 1 失敗= main 基線既有(git stash 對照實證),非本分支引入。 merge 後需 gated redeploy cypher-executor(leo 閘)。關聯 #39。 Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01JUmjwkHLVBHM3ydhT1WSW3 --- cypher-executor/src/routes/console.ts | 132 ++++++++++++++++- cypher-executor/src/routes/kbdb-proxy.ts | 38 +++++ .../tests/console-library-map-page.test.ts | 57 ++++++++ cypher-executor/tests/kbdb-map-proxy.test.ts | 134 ++++++++++++++++++ system-dev/wiki/status.md | 11 ++ 5 files changed, 369 insertions(+), 3 deletions(-) create mode 100644 cypher-executor/tests/console-library-map-page.test.ts create mode 100644 cypher-executor/tests/kbdb-map-proxy.test.ts diff --git a/cypher-executor/src/routes/console.ts b/cypher-executor/src/routes/console.ts index 7426669..bf12c5c 100644 --- a/cypher-executor/src/routes/console.ts +++ b/cypher-executor/src/routes/console.ts @@ -17,7 +17,12 @@ * - 總庫搜尋:GET /kbdb/search(mode=semantic 未開 Vectorize 會誠實降級 + capability_hint; * chips 用 entry_type——KBDB 真能篩的欄位,不編造「電腦筆記/手機筆記」等不存在的分類); * 頭部統計來自 GET /console/kb-scale-data(精耕層 wiki 卡/三元組/已嵌入——leo 2026-07-07 - * 裁:45.8 萬 14-E 搬遷遺產 deprecated 不再當招牌數字;搜尋本身仍搜全庫) + * 裁:45.8 萬 14-E 搬遷遺產 deprecated 不再當招牌數字;搜尋本身仍搜全庫); + * 搜尋框上方=藏書地圖(library-map SDD M5/R4,Arcrun#39):GET /kbdb/map 全館庫卡片 + * (narrative+top entities+triplet 數+更新時間感),逐庫 GET /kbdb/map/:library 補 + * degree/跨庫 bridges/commit_hash(詳圖拉不到就維持名字版,不擋渲染);點庫卡片= + * 設 library filter(/kbdb/search 既有 library 參數)進該庫搜尋;/map 空陣列或錯誤= + * 誠實空狀態(指引 POST /map/recompute backfill),不擋搜尋等其他功能 * - 卡片詳頁:GET /kbdb/entries/:id;關聯視圖走 GET /kbdb/graph/neighbors/:name * (cypher 代轉 kbdb-graph-plugin,kbdb-proxy.ts;查無 triplet → 「尚無關聯資料」) * - 工作流:GET /webhooks/named(list)+ POST /webhooks/named/:name/trigger(手動觸發) @@ -394,14 +399,22 @@ function renderConsoleHtml(registryBase: string, brand: string, profile: string) - +