Files
kbdb-ingest-plugin/system-dev/wiki/principles.md
T
Leo 06e901f590 chore: template 1.9.x 知識庫遷移 → system-dev/
把 system-dev-template 1.9.x 的知識庫基建搬進 git(從功能 PR 拆出,獨立成筆):
- system-dev/wiki/:LLM 記憶系統(principles 鐵律 + 5 張 ingest 卡 + INDEX/TAXONOMY + status/mistakes)
- system-dev/docs/:SDD 新家(3-specs/ + 2-architecture/ + README/SKILL);ingest-pipeline SDD 從 docs/3-specs/ 搬來
- system-dev/scripts/:install/update
- .claude/:wiki/SDD harness(commands + hooks:session-recall / sdd-guard / wiki-secret-scan)

SDD 位置統一:docs/3-specs/ingest-pipeline → system-dev/docs/3-specs/ingest-pipeline
(對齊 SDD guard hook 預期路徑 + template 1.9.x 規約)。

純基建遷移,不含任何功能程式碼(src/tests/contracts 在功能 PR #3)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 20:45:18 +08:00

21 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# principles — 跨全局設計原則(push:CC 行動前必服從)
> 這個檔由 hook 在 session 開始**全文注入**,讓 CC 設計任何東西前都先看見這些準繩。
> 為什麼 push 而非寫成 card:原則是「會被遺忘的盲區」——沒推到眼前,CC 設計時很可能沒想到要服從就做了。
>
> 規則:**一行一條**,精煉成準繩(不是長篇論述)。≤15 條;超過代表某些該合併、或下放成 card。
> 發現新的跨全局原則 → append 一行。累積原則只改這個檔,**不必問用戶開新檔**。
> 區分:原則 = 反覆適用的準繩(這裡);單次選擇 = 決策(寫成 card);踩過的坑 = mistakes.md。
---
## 原則
- **純餵食器,不碰儲存**ingest 只 POST 候選 envelope 給 graph 寫入 API;不直連 base、不碰 D1/Vectorize/任何表。牆是「儲存」不是「運算」(准 LLM 萃取、不准碰儲存)。
- **不算向量 normalize**ingest 只「打標」哪些 node/謂詞要 embed,實際 embedding 歸 base embed 模組「讀標執行」(單檔視角算不準跨庫同義)。
- **不帶查詢 MCP**ingest 是 ambient 餵食器,沒人互動「問」它;只帶薄 ops CLI(人手動觸發重萃),重萃觸發由 KBDB MCP `refresh` 代轉。
- **三守則(無環/純 API/凍結契約)**:graph 永不回呼 ingest;只走 graph HTTP 寫入端不碰其內部;`contracts/ingest-candidate.json` 是唯一耦合面。
- **部署繞 GitHub Actions**:走 wrangler 部署(被 flag 教訓);runtime 用 GitHub API/webhook 拉 repo 是 runtime 行為、不衝突。
- **採取優先於萃取**:用了 system-dev-template 的 repo 有本地已建三元組+gloss → 直接拉取,不重萃(本地生產當下建的連結品質更好)。
- **不污染用戶根目錄**:工具產物收進專屬資料夾,不在用戶根目錄撒檔。