feat(kbdb): POST /embed/query 語義查詢端點(薄殼暴露既有 semanticSearch)——Arcrun#7 A2
- routes/embed.ts 加 /embed/query:q 必填、owner_id/source/entry_type/topK 通用 filter - 模組未開回 409+capability_hint(不假綠)、缺q回400;能力不重寫(rule07 薄殼) - tests/embed-query.test.ts 4例、tasks 12.6 標x;tsc 0 error、vitest 9/9
This commit is contained in:
@@ -200,6 +200,11 @@
|
||||
當 next-step 回給 AI(語義/關鍵字同一 KBDB MCP,D17 邊界)。薄殼模式不變(kbdbFetch)。mcp tsc exit 0。
|
||||
- [x] 12.5 **CC 幫開 vectorize(T2.4d,第一版)**:路徑=CC 寫 config `kbdb_embed:true` + `acr update`(已接 kbdbEmbed
|
||||
→ 建 index + 注入 binding redeploy)。base 查詢回應的 `capability_hint` 是發現入口。Pages 設定頁不做(leo 排未來)。
|
||||
- [x] 12.6 **語義查詢 HTTP 端點(薄殼暴露,issue#7「POST /search 或 /embed/query」)**:`kbdb/src/routes/embed.ts`
|
||||
加 `POST /embed/query`(body `{q必填, owner_id?, source?, entry_type?, topK?(預設20上限100)}`)→ 呼叫既有
|
||||
`semanticSearch`(rule 07 薄殼:route 不重寫任何 embedding/query 邏輯);模組未開→409+OFF_HINT(不假綠);
|
||||
q 缺/空→400;回 `{success, query, hits}`。與 GET /entries/search?mode=semantic 同底層能力、另一薄殼暴露。
|
||||
測試 `kbdb/tests/embed-query.test.ts`(模組開回 hits/未開 409/缺 q 400/空白 q 400)。kbdb tsc exit 0、vitest 9 綠。
|
||||
- [ ] 12.V **端到端驗收 ⏳ 待 leo21c 部署驗**(需官方/leo21c 帳號開 Vectorize index):開 kbdb_embed → acr update →
|
||||
寫一筆帶 `metadata.embed:true` 的 entry → `?mode=semantic` 搜回;未開時 `?mode=semantic` 回 keyword+capability_hint。
|
||||
本次只到 **tsc exit 0(kbdb/cypher/cli/mcp 全綠)+ toml 注入 dry-run 驗證**,不假裝端到端綠(mindset §7)。
|
||||
|
||||
Reference in New Issue
Block a user