Files
ewoooc/docs/adr/README.md
OoO 4e82acc0f5 feat(p10)+docs(adr): MCP 自建 Stack docker-compose + ADR-031
Operation Ollama-First v5.0 / Phase 10 + Phase 12 收尾

docker-compose.mcp.yml — 4+3 容器 MCP stack
- postgres-mcp (port 3001): Claude 直連 momo_pro DB read-only RBAC
- mcp-omnisearch (3003): Tavily 主 + Exa 備(取代 Gemini Grounding)
  避開 Brave(2026-02 取消免費 tier)
- firecrawl-self (3002): 自建爬蟲,SPA 反爬蟲
- filesystem-mcp (3004): 跨主機檔案 read-only

護欄 #2 落地(Owen v5.0 鐵律 / ADR-033):
  firecrawl-self mem_limit:2g + cpus:1.5
  PLAYWRIGHT_BROWSER_POOL_MAX=3
  chrome-reaper sidecar 每小時清 Chrome zombies

安全設計:
- 全部 127.0.0.1 暴露(不外網)
- read-only volume mount(filesystem 只能讀)
- postgres-mcp RBAC mcp_readonly role 限 SELECT 6 熱表
- API key 全走 env var 不寫死

ADR-031 — MCP 自建 Stack 治理決策
- 取代 Gemini Grounding 唯一通路(多供應商策略)
- 預期 70%+ grounding 流量走免費 Tavily
- 188 主機資源 +4-5GB RAM 可控
- Migration Plan:6 步驟(含 Tavily/Exa key 申請 + mcp_readonly role 預建)

啟用前置(待統帥):
1. .env 加 TAVILY_API_KEY / EXA_API_KEY / MCP_POSTGRES_PASSWORD / FIRECRAWL_AUTH_KEY
2. momo-db 建 mcp_readonly role + GRANT SELECT
3. ssh wooo@110 → ssh ollama@188 → docker compose -f docker-compose.mcp.yml up -d

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 09:02:07 +08:00

64 lines
5.8 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.
# Architecture Decision Records (ADR)
> 本目錄記錄 **EwoooC**(原 MOMO Pro System的所有重大架構決策。
> 專案範圍:`momo-pro-system` 目錄(不含 AWOOOI / WOOO AIOps SaaS Platform
> 遵循本專案的 Codex 工作規則:`AGENTS.md`(入口)+ `CONSTITUTION.md`(紅線)+ ADR決策+ Memory輕量索引
## 編號規則
- 格式:`ADR-XXX-kebab-case-title.md`
- 編號連續遞增,已撤銷的 ADR 保留編號(標記 `Status: Superseded by ADR-YYY`
## 狀態
| 狀態 | 說明 |
|---|---|
| `Proposed` | 提案中,尚未實作 |
| `Accepted` | 已批准,正在實作或已實作 |
| `Deprecated` | 已被取代,但保留歷史 |
| `Superseded` | 被新 ADR 完全取代 |
## 索引
| ADR | 標題 | 狀態 | 日期 |
|---|---|---|---|
| [001](ADR-001-three-agent-self-learning-division.md) | 三 Agent 自主學習分工Hermes/NemoTron/OpenClaw | Accepted | 2026-04-18 |
| [002](ADR-002-pgvector-as-sole-km-store.md) | pgvector 作為唯一 KM 向量庫 | Accepted | 2026-04-18 |
| [003](ADR-003-local-embedding-on-ollama.md) | Embedding 本地化到 Ollama 主機 | Accepted | 2026-04-18 |
| [004](ADR-004-nemotron-fallback-chain.md) | NemoTron 配額耗盡 fallback 至 Hermes Rule-based | Accepted | 2026-04-18 |
| [005](ADR-005-quality-score-time-decay.md) | KM 品質分數加入時間衰減 | Accepted | 2026-04-18 |
| [006](ADR-006-project-rename-to-ewoooc.md) | 專案正名 MOMO Pro System → EwoooC | Accepted | 2026-04-18 |
| [007](ADR-007-ai-learning-dual-write.md) | AI 學習雙寫規範DB + KM 同步寫入) | Accepted | 2026-04-18 |
| [008](ADR-008-actual-runtime-on-188.md) | 正式運行環境確認 — 188 Docker Compose(非 110 K3s) | Accepted | 2026-04-18 |
| [009](ADR-009-embedding-retry-queue-persistence.md) | Embedding Retry Queue 持久化DB-backed | Accepted | 2026-04-19 |
| [010](ADR-010-gitea-cicd-pipeline.md) | EwoooC Gitea CI/CD PipelineGitea Actions + Docker Compose | Accepted | 2026-04-19 |
| [011](ADR-011-cross-project-resource-isolation.md) | 跨專案資源隔離與 Container 管理原則188 多專案共存邊界) | Accepted | 2026-04-19 |
| [012](ADR-012-agent-action-ladder.md) | Agent Action LadderAI Agent 事件介入與自動修復三級信任邊界 L0/L1/L2/L3 | Accepted | 2026-04-19 |
| [013](ADR-013-aiops-autoheal.md) | AIOps 自動修復閉環架構(七步閉環 + SSH Jump Executor | Accepted | 2026-04-19 |
| [014](ADR-014-ppt-report-system-v2.md) | PPT 簡報系統 V2 — 原生圖表 + 9 種報告類型 | Accepted | 2026-04-20 |
| [015](ADR-015-telegram-bot-menu-restoration.md) | Telegram Bot 完整菜單系統恢復 | Accepted | 2026-04-20 |
| [016](ADR-016-daily-sales-cache-fingerprint.md) | daily_sales cache fingerprintgunicorn 多 worker 一致性) | Accepted | 2026-04-29 |
| [017](ADR-017-modularization-cleanup-roadmap.md) | 模組化收尾路線圖Phase 3f | Accepted | 2026-04-29 |
| [018](ADR-018-four-agent-ai-automation-control-plane.md) | 四 AI Agent 自動化控制面Hermes/NemoTron/OpenClaw/ElephantAlpha | Accepted | 2026-04-29 |
| [019](ADR-019-telegram-bot-agentic-conversation-layer.md) | Telegram Bot Agentic Conversation Layer菜單→Agent 決策統一入口) | Accepted | 2026-05-02 |
| [020](ADR-020-code-review-full-autoheal.md) | Code Review 全自動修復政策(局部覆寫 ADR-012 HITL | Accepted | 2026-05-02 |
| [021](ADR-021-ea-hitl-prefetch-and-alert-impact.md) | EA HITL Pre-fetch + 競價告警必填金額影響量化 | Accepted | 2026-05-03 |
| [022](ADR-022-ppt-system-v3-redesign.md) | PPT v3 — 暖紙風 + matplotlib 專業圖表 + 模板版本快取 | Accepted | 2026-05-02/03 |
| [023](ADR-023-ppt-system-expansion-wave1.md) | PPT 系統 Wave 1 擴展 — 廠商 / 期間回顧 / 品類深度 / 客戶分析8 種新報表) | Accepted | 2026-05-03 |
| [024](ADR-024-ppt-system-wave2-forecast-and-deprecations.md) | PPT 系統 Wave 2 — 檔期前瞻 / 多活動比較 + bcg/growth 廢除 | Accepted | 2026-05-03 |
| [025](ADR-025-ppt-system-wave3-new-product-and-market-intel.md) | PPT 系統 Wave 3 — 新品 30 天追蹤 + 市場情報週報 | Accepted | 2026-05-03 |
| [026](ADR-026-ppt-system-price-elasticity-and-final-roadmap.md) | PPT 系統 — 價格彈性報告 + 完整戰役收尾路線圖 | Accepted | 2026-05-03 |
| [027](ADR-027-primary-ollama-on-gcp.md) | Primary Ollama 遷移至 GCP 高效能主機v5.0 戰役後追加附錄:三主機架構 / 4 fallback 鏈 / 廢止 188 Ollama | Accepted | 2026-05-03 |
| [028](ADR-028-llm-routing-unified-principles.md) | LLM 路由統一準則 — Ollama-First 五大支柱(補述 ADR-027 | Accepted | 2026-05-03 |
| [029](ADR-029-hermes-first-twin-tower.md) | Hermes-First 雙塔分工(戰術主塔 / 戰略副塔Gemini 月支出 -23% | Accepted | 2026-05-03 |
| [030](ADR-030-frontier-multi-vendor-strategy.md) | Frontier 多供應商策略Anthropic + Google + OpenRouterPhase 7 Code Review 升 Claude Opus 4.7 | Accepted | 2026-05-03 |
| [031](ADR-031-mcp-self-hosted-stack.md) | MCP 自建 Stackpostgres + omnisearch + firecrawl + filesystem含 Owen 護欄 #2 Firecrawl 2g 限制) | Accepted | 2026-05-04 |
| [032](ADR-032-rag-autonomous-learning-loop.md) | RAG 自主學習迴圈 — Distiller + PromotionGate + 反饋環Phase 11 | Accepted | 2026-05-03 |
| [033](ADR-033-rag-three-guardrails.md) | RAG 治理三護欄 — Promotion Gate / Firecrawl 資源 / BGE-M3 一致性Owen v5.0 鐵律) | Accepted | 2026-05-03 |
## 規範
1. **任何重大架構決策**(影響三條產品線之一、改動資料結構、引入新依賴)必須建 ADR
2. **每份 ADR 包含**Context背景→ Decision決策→ Alternatives Considered替代方案→ Consequences後果
3. **建立後同步更新**:本 README 索引、相關 SOT 文件、`docs/memory/README.md`(若有新的長期記憶入口)