98b221b435
對應 issue #1(頂層 mira-dissolve T3)。 - contracts/ingest-candidate.json:ingest→graph 邊界契約(自頂層搬入) - contracts/README.md:標明候選(輸入)≠已存(triplet) - docs/3-specs/ingest-contract/design.md + tasks.md: - ensureTemplate 改 slot-diff 補丁(取代 early-return,免遷移腳本) - 補 KbdbClient.updateRecord(base PATCH /records/:id) - ingest 流程:驗證(422)→idempotency(uri+hash)→先 append 後 deprecate - triplet template 增 source_uri+content_hash slot 承載 idempotency - 跨 repo 協調點(3.6 圖工具併 KBDB MCP)明列需 arcrun 配合 總管已認可四個設計決定(issue #1 comment)。鐵律:零建表/零 SQL/零 migration。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2.4 KiB
2.4 KiB
ingest-contract — tasks
唯一進度來源,不靠對話記憶。對應 issue #1(頂層 mira-dissolve T3)。 完成一項即時打勾 + 註記證據。端到端需 leo21c 部署的,標「待部署驗」,不假綠。
A. 契約 + template slot
- 3.1 搬
contracts/ingest-candidate.json進本 repo +contracts/README.md標明候選≠已存(2026-06-26) - 3.2
ensureTemplate改 slot-diff 補丁(命中既有 → basePATCH /templates/:id補缺 slot,不再 early-return);TRIPLET_SLOTS加status+superseded_by+source_uri+content_hash - 3.2b
ENTITY_SLOTS加gloss(已核實現無) - 3.2c normalize 分層 fallback 接口:exact-only 先做;semantic 留接口(待 base embed,Arcrun #7)
B. 寫入端 + 取代(核心)
- 3.3a
KbdbClient.updateRecord(id, values)→ basePATCH /records/:id(已核實現無) - 3.3b
src/actions/triplet-ingest.ts:驗證 envelope(422 擋禁送欄位)→ idempotency(uri+hash)→ deprecate-then-append(先 append 後翻舊批 status)。<100 行純函式 - 3.3c
POST /triplets/ingestroute(只驗證 + 呼叫 action) - 3.4 測試(mock,不打真網路):正常 envelope / 同 hash no-op / 新 hash deprecate / 污染 envelope(帶 bridge_score) 422 / rollback(翻回 status)
- 3.5 查詢 active-only:traverse/search/neighbors 組圖前 filter
status==='active'(缺省視為 active,相容舊資料)
C. MCP(⚠️ 跨 repo,需 arcrun 配合 → issue 標清)
- 3.6 圖查詢 +
refreshHTTP API/邏輯備好(graph 端);MCP 註冊薄殼併入 arcrun KBDB MCP(協調後接,不另起 graph MCP) - 3.6b
refresh紅線:只人發起 MCP 觸發,禁排程/webhook 自動 - 3.6d 移除
search-query.ts代理 base 關鍵字那條(重複,歸 KBDB MCP) - 3.7
get_source端點(指回 source.uri + anchor) - 3.7b
graph CLI延後不做(人少用、AI 用不到 → 不誤導)
完成準則
- 全程 zero SQL / zero migration / 無 D1·Vectorize·AI 綁定(
wrangler deploy --dry-runbundle 乾淨) - 所有 action ≤100 行;
vitest run全綠(mock client) - 端到端 ingest→graph 走通需 base 上線 + ingest repo(T4)就緒 → 標「待部署驗」
- issue #1 留 open,待實證綠燈才結案