SuperPortia 的資料流分為五大關鍵路徑。每條路徑都有明確的擁有者、寫入權限、審批門、和回滾方式。
Agent 發現知識
→ ingest_fragment() [Zone 1/2]
→ UB Dock (entries table) — 即時可查詢
→ MTAAA Pipeline 分類 (boiler_grandpa, 每 5 分鐘)
→ /ub/promote [Cloud Worker]
→ classified_entries (正區) — 完整分類
| 屬性 | 值 |
|---|
| 擁有者 | Cloud UB Worker |
| 寫入權限 | Zone 0/1/2/4 (不含 Zone 3) |
| 審批門 | 無(自動流程) |
| 回滾方式 | archive_message() 或 D1 直接刪除 (Zone 0) |
任務識別
→ create_work_order() [Zone 1/2]
→ status: pending
→ accept + in_progress [Zone 1/2]
→ implementation complete
→ submit_for_review [Zone 1/2]
→ status: review
→ approve/reject [Zone 0 — 夏哥專屬]
→ status: approved / back to pending
| 屬性 | 值 |
|---|
| 擁有者 | Cloud UB Worker (WO system) |
| 寫入權限 | create/update: Zone 1/2; approve: Zone 0 only |
| 審批門 | review → approved 必須夏哥 HITL |
| 回滾方式 | 狀態可回退至 pending(Zone 0 操作) |
代碼開發
→ git commit + push [Zone 1/2]
→ wrangler deploy --dry-run [Zone 1 — 自主]
→ 夏哥審查 dry-run 結果
→ wrangler deploy (production) [Zone 0 — HITL]
→ 或:git push → CF Pages auto-deploy [cloud-static 項目]
| 屬性 | 值 |
|---|
| 擁有者 | 部署目標各自的 CF 帳號 |
| 寫入權限 | preview: Zone 1; production: Zone 0 only |
| 審批門 | deploy-gate.sh PreToolUse Hook DENY (非 —dry-run) |
| 回滾方式 | CF Pages: 點擊 rollback; Workers: wrangler rollback |
SRE 定時執行
→ 健康檢查 (每 5 分鐘)
→ Scout Worker RSS 抓取 (每小時)
→ Email Intake 解析 (觸發式)
→ 結果寫入 UB
→ Captain's Bridge 推送摘要
| 屬性 | 值 |
|---|
| 擁有者 | SRE + Scout Worker + Email Intake |
| 寫入權限 | Zone 4 (Cloud Workers + launchd daemons) |
| 審批門 | 無(全自動) |
| 回滾方式 | 停止 launchd service;刪除錯誤 UB 入庫 |
Gmail 收信
→ Email Intake Worker 解析
→ 分類 (propfirm / intel / personal / trading-alert)
→ 寫入 email_intel D1 table
→ 高優先級 → 即時推送 Bridge
→ 定時 → 晨間 / 午間 / 晚間摘要
| 屬性 | 值 |
|---|
| 擁有者 | Email Intake Worker |
| 寫入權限 | Zone 4 (cloud-serverless) |
| 審批門 | 無(自動分類) |
| 回滾方式 | D1 直接刪除 (Zone 0) |
| 資料存放區 | SSoT 位置 | 寫入者 | 讀取者 | 備份策略 |
|---|
| UB entries | Cloudflare D1 (prod) | Zone 0-2, 4 | All | D1 自動備份 |
| UB classified_entries | Cloudflare D1 (prod) | boiler_grandpa, promote API | All | D1 自動備份 |
| Work Orders | Cloudflare D1 (prod) | Zone 0-2 | Zone 0-2 | D1 自動備份 |
| Obsidian Vault | ~/2026_SuperPortia/ | Zone 0-2 | Zone 0-2 | iCloud Sync |
| .claude/ config | superportia-ops repo | Zone 0 | All agents | Git history |
| Cloudflare Workers code | GitHub repos | Zone 0-2 | All | Git history |
| Local filesystem | SS1 Mac | Zone 0-2 | Zone 0-2 | Time Machine |
| Email intel | D1 email_intel | Email Intake | Zone 0-1 | D1 自動備份 |
規則 1: UB → Obsidian (單向)
Cloud UB 是 primary knowledge SSoT
Obsidian Vault 是 local mirror
資料從 UB 複製到 Vault,永不逆流
規則 2: superportia-ops → 所有 repos (單向)
.claude/ config 從 ops 流向各 repo symlink
各 repo 本地 .claude/ 不可改,改 ops 後 sync
規則 3: GitHub → Cloudflare (單向)
代碼從 git push 觸發 CF Pages deploy
或從 wrangler deploy 命令推送
CF 不會自動寫回 GitHub
規則 4: Cloud Worker → D1 (單向)
Worker.js ingest → entries table
promote API → classified_entries table
D1 不觸發 Worker
規則 5: SS1 → CF (單向)
本地 build artifacts 推送至 CF Workers (local-build-cloud 模式)
CF 回傳 deployment URL,不寫回本地