# 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 envelope(contracts/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 / 時間戳 / 邊上 type(graph 算)。 ## 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。