init: kbdb-ingest-plugin 骨架

KBDB 堆疊的餵食器(最薄一層):拉 GitHub repo → 採取/萃取三元組 →
餵 graph 寫入端 → 織跨 vault 的圖。

- CLAUDE.md:上游指針 + ingest 鐵律(純餵食器/不碰儲存/不算向量/
  不帶查詢 MCP/部署繞 Actions/三守則)
- README:定位 + 護城河命題(跨 vault 的圖)
- contracts/ingest-candidate.json:凍結 envelope 契約(與 graph repo 同份)
- docs/3-specs/ingest-pipeline/:SDD 三件式骨架(藍圖指向 InkStoneCo mira-dissolve)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-26 12:43:26 +08:00
commit dffefdcdc2
7 changed files with 313 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
# ingest pipeline — Design
> 對應 requirements.md。**架構設計(envelope 契約、職責切割、normalize 歸屬、MCP 邊界、模型策略)在 InkStoneCo `docs/3-specs/mira-dissolve/design.md`。本檔只放 ingest 內部設計。**
## 1. 資料流
```
GitHub repo MD(精耕 LLM Wiki
│ commit / content-hash 變動
SourceAdapter(拉 + content-hash
├─ 路徑 A:本地已建三元組+gloss → 採取(拉)
└─ 路徑 B:裸原文 → extract(text, model) → 候選 (s,p,o)+gloss
▼ 跨 repo 匯總(織跨庫關聯)
▼ POST envelopecontracts/ingest-candidate.json
graph 寫入端 POST /triplets/ingest
```
## 2. envelope= contracts/ingest-candidate.json
形狀與職責切割見 InkStoneCo design §3。ingest 給:原始 s/p/o + source.* + extractor.* + nodes[].gloss/type + confidence。**禁送**id / clusters / bridge_score / 時間戳 / 邊上 typegraph 算)。
## 3. extract 模型策略
見 InkStoneCo design §6.6:用戶選意圖非型號、品質門檻白名單(深層暗示+中文)、預設 Haiku、深萃 Claude via CC、難度隨來源分層(AI 報告弱模型夠/人類 vault 須好模型)。
## 4. 觸發
被 KBDB MCP `refresh` 代轉(人發起,非自動 fan-out)。flag 紅線見 InkStoneCo design §6.7:禁 Actions/webhook 自動觸發。
## 5. cherry-pick 來源
- `polaris/mira/tools/_kbdb_client.py` → 純餵食器 client。
- `polaris/mira/arcrun/wiki_synthesis.yaml` classify 節點 → extract。
- 兩個 KBDB skill block(精耕規則 prompt)。
詳 InkStoneCo requirements §6。