docs(wiki): Mira Console 完整版收尾——mistakes #24 三層跳脫驗證法+DELETE 假綠缺口、status 更新 (Arcrun#3 console 系)

This commit is contained in:
uncle6me-web
2026-07-04 17:51:25 +08:00
parent f9e44abc59
commit 9cc29f5dfb
2 changed files with 28 additions and 1 deletions
+8 -1
View File
@@ -15,7 +15,14 @@ metadata:
## 📍 當前位置
> **2026-07-02 本 session雲端工人 T-loop1dArcrun#3 搜尋/控制台頁 v0,跨多 repo 第二次壓測**
> **2026-07-04 本 sessionMira Console 完整版 UIArcrun#3 console 系,總管派工**
> - **實作(commit f9e44ab**`/console` 依 claude design 定稿(紙感暖黑「2a」,`system-dev/docs/6-user/Mira Console 設計規劃/` 於頂層 repo)+ brief 8 頁資訊架構全面重寫成單檔 SPA(hash routing、零外部資源、手機優先+≥1024px 側欄+底部五 tab)。`/console/dashboard` 免登入獨立頁同步換視覺(呼吸球「安/趕/滯」)。
> - **後端小補(全唯讀/薄殼)**:① `GET /credentials/catalog`D1 目錄 metadata list,絕不回密文,D19)② `GET /console/inbox-data`inbox 清單,session 鎖——訊息原文屬機敏,計數才免登入)③ `GET /kbdb/graph/neighbors/:name`cypher 代轉 kbdb-graph-plugintoken 只在 server 側;plugin base = `KBDB_GRAPH_URL` 或 `kbdb-graph-plugin.<subdomain>.workers.dev` 現算)④ types 加 `KBDB_GRAPH_URL?`。
> - **誠實分層**:語意搜尋未啟用→banner 讀 search 降級訊號(不假結果);搜尋 chips 用 entry_typeKBDB 真能篩的欄位,不編造「電腦筆記/手機筆記」分類);憑證「刪除」標即將開通(DELETE 仍舊 KV 路徑,接了會假綠,見 mistakes #24);設定頁 vectorize「開關」標即將開通(需部署端 kbdb_embed);關聯查無 triplet →「尚無關聯資料」。v0 零件/recipes 查詢區收進工作流頁折疊區(不砍功能)。
> - **驗證(本機,未部署)**tsc exit 0vitest 26/271 失敗 stash 複驗=pre-existing「不存在的零件回傳失敗」);`wrangler deploy --dry-run` 打包過;inline JS 求值後 `node --check` + 純函式行為測試全過(XSS escape/時間容錯,驗證法固化 mistakes #24)。
> - **部署注意(留總管)**:不跑 acr updatemistakes #23 codeload 陷阱),走 leo21c wrangler 直推 cypher-executor 單 worker;關聯視圖需 leo21c 有部署 kbdb-graph-plugin(沒部署→前端誠實顯示不可達,不擋其他頁);`CONSOLE_TENANT`/`WORKER_SUBDOMAIN` 沿既有注入。SDD 缺口沿 07-02 未解(search-console SDD 未建,rule 4.3 需 richblack 確認,本次照派工先實作、誠實記錄)。
>
> **2026-07-02 上個 session(雲端工人 T-loop1dArcrun#3 搜尋/控制台頁 v0,跨多 repo 第二次壓測)**:
> - **實作**`cypher-executor/src/routes/console.ts`GET /console,單檔 HTML+原生 JS 薄殼)+ `index.ts` 掛載。三查詢區全打既有端點:`/kbdb/search`、`/workflows/search`(同源,X-Arcrun-API-Key)、components 打「同帳號」`arcrun-registry.<subdomain>.workers.dev`WORKER_SUBDOMAIN 現算,不硬打官方 registry.arcrun.dev)、recipes 打 `/public-recipes`(公庫免 auth)。vectorize 狀態直接讀 KBDB search 回應的 `mode`/`capability_hint`,沒開新端點。tsc/vitest 綠(既有 1 個無關失敗,`不存在的零件回傳失敗` 測試,stash 驗證 pre-existing)。commit `981dc25` 已 push Gitea main。
> - **框架級發現(mistakes #23**`acr update` 部署源永遠是 GitHub codeload tarball`uncle6me-web/Arcrun` main),跟本地/Gitea checkout 完全脫鉤——雲端工人只能碰 Gitea(D20),照 issue 字面指示跑 `acr update` 會部署到蓋掉自己剛做的改動的舊版,回報成功卻是假綠。本次改用手工複刻 `injectWranglerConfig` 注入邏輯(CF API 查真實 KV id 對齊 dry-run)、直接 `wrangler deploy` 單一 workercypher-executor),避免碰 GitHub 又讓改動真的上線;部署後立刻 restore `wrangler.toml`,不留帳號 id 進 git。**此路只適合單 worker 小改動**;牽動多 worker 時的正解懸而未決,留 leo 裁(部署繞開 GitHub 鐵律 vs acr CLI 硬綁 codeload.github.com 的結構性衝突)。
> - **端到端驗證(leo21ccurl 證據)**`GET /console` 200`GET /kbdb/search?mode=semantic` 200(誠實降級 keyword + capability_hint,該帳號 KBDB 目前 0 entries,真實狀態非 bug);`GET /workflows/search` 2000 筆,該帳號無 named workflow);`GET /public-recipes?q=telegram` 200 真回 `telegram_send` 紀錄;`GET arcrun-registry.leo21c.workers.dev/components/search` 200。Playwright 瀏覽器點擊測試因沙盒 outbound proxy policy 擋 registry.arcrun.dev/workers.dev 連線未能跑通(環境限制,非部署問題),改以 curl 逐端點驗證 + 手動覆閱 JS 邏輯替代。