Files
uncle6me-web 7bd7b4b26a SDD 生命週期鐵律遷移:單一活性制度上線(portal-auth=active,其餘 paused/draft)
- 鋪檔(自 system-dev-template v1.15.0):SDD-LIFECYCLE.md+pending-changes.md
  +sdd-guard.sh(覆蓋舊版,加單一活性檢查)+sdd-check.md+sdd-active-check.sh
- settings.json PreToolUse(Write|Edit|MultiEdit)掛上 sdd-guard.sh
- 全部 SDD design.md 掛 frontmatter:portal-auth=active(現行 portal 線,
  #61 demo 四件套剛 merge);artifact-sharing=draft(零任務動工);
  其餘 16 份=paused(皆有未完成任務,無明顯死件,不硬 close)
- CLAUDE.md 加「SDD 生命週期鐵律」段(指向 SDD-LIFECYCLE.md+濃縮五條)
  +SDD 速查表改以 frontmatter status: active 為現行判準
- 驗證:sdd-active-check exit 0(恰 1 份 active);guard pipe-test code 檔
  exit 0 帶現行 SDD 提示;反向測試(造 2 份 active)guard exit 2/check exit 1 全擋

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 17:03:16 +08:00

56 lines
3.3 KiB
Markdown
Raw Permalink 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.
---
status: paused
superseded_by: ""
---
# search-console — arcrun 自帶搜尋/控制台頁(Gitea Arcrun#3 授權新建)
> 授權:Gitea `Leo/Arcrun#3`leo 2026-07-02 拍板「本 issue 即 leo 授權」)。
> 位於既有白名單 `docs/3-specs/arcrun/` 之下(pre-write-guard 4.3 已涵蓋,無需改 hook)。
> 本 SDD 是追認式補件:v0 與 hardening 已由 cloud-worker 實作(無 docs 環境無法落地 SDD),
> 詳細實作記錄與客觀證據在 issue #3 comment 串(真相源),此處只固定設計要點。
## 1. 定位
裝了 arcrun(含 KBDB)就有的一頁式控制台:知識庫 / workflows / components & recipes 搜尋
config 唯讀狀態(vectorize)+ 駕駛艙 dashboard。**wow factor = 安裝完第一眼體驗**。
## 2. 設計鐵律(rule 07 薄殼)
- 落點:`cypher-executor/src/routes/console*.ts`,單檔 HTML + 原生 JS,無框架、無 build step。
- 頁面零業務邏輯,只 fetch 既有 API;缺端點 → 補 API 或發 issue,不准在 UI 拼裝。
- 聚合類能力(如 dashboard-data 的燈號判定)長在 API 端點(能力一次),頁面純渲染。
- components 打「同帳號」registryWORKER_SUBDOMAIN 現算),禁硬編清單(parts.ts stale 教訓)。
- 讀 KBDB 一律走 `kbdbBase()` HTTP(同 kbdb-proxy 慣例),不新增 binding、不直碰 D1/SQL。
## 3. 認證模型
- console 查詢頁:簡單 email+password 登入(`console-auth.ts`,單一管理員帳密存 SESSIONS_KV
首次設定制、不可覆蓋、reset 需舊密碼)。登入只擋外人看頁面;查詢用固定租戶字串
`CONSOLE_TENANT`(預設 `leo`self-hosted 明碼 namespace,非註冊制 key)。
- dashboard(駕駛艙):**無需登入**——唯讀聚合、不吐機敏值(燈號/任務標題/計數)。
## 4. 駕駛艙 dashboardT-cockpit ②,2026-07-04
- `GET /console/dashboard-data`:聚合 KBDB 四種 entry_type(租戶 = CONSOLE_TENANT):
- `dash_beat` `{"actor","event":"start|done","note"}` → 每 actor 最新一筆。
- `dash_task` `{"title","status":"done|doing|todo|blocked","order","scope":"today|week"}`
→ 同 title 後寫蓋前寫(created 最新)。
- `dash_wait` `{"title","status":"open|closed"}` → 同 title 取最新,只回 open。
- `inbox` `{"text","status":"new|done"}` → 未處理計數(status !== done)。
- 燈號:red = 任一 blocked 或最新心跳 >240 分(僅台北 09:0022:00 判定);
yellow = 有 blocked 以外的落後標記(非標準 status 值);green = 其餘。
- `GET /console/dashboard`:手機優先、一屏、兩格(狀態燈+完成度橫條 / 今日路線+等你的事+
收件匣數),每 60 秒自動刷新,無互動功能。
## 5. 部署(強制)
**禁 `acr update`**(部署源綁 GitHub codeloadD20 紅線+會蓋掉 Gitea 改動=假綠,mistakes #23)。
用手工複刻 `injectWranglerConfig` 注入法:CF API 查真實資源 id → 暫寫 wrangler.toml →
`wrangler deploy --dry-run` 核對 binding 與線上一致 → 真部署 → 立即 restore toml。
全程 `CLOUDFLARE_ACCOUNT_ID=51a01bfa…`leo21c)蓋掉 repo `.env` 的官方 id。
## 6. 明確不做(v1 再議)
真寫入 config 開關/漂亮設計/官方 SaaS 多租戶/獨立前端 repodashboard 互動功能。