-- Supervisor 只在 Compose 內網,不要對 LAN 開埠
-- 畫面走已登入 API,VNC 密碼不進瀏覽器 URL
-- 區網請走 HTTPS;終端是 HTTPS 時設 `LAZYBOY_SECURE_COOKIE=true`
-- API 綁非本機時 `LAZYBOY_APP_TOKEN` 至少 32 字;supervisor 拒絕空白、過短、`dev-token`
-- 保險箱用 `LAZYBOY_VAULT_KEY`;換登入 token 時這把 key 要留著
-- 模型看不到密碼本文;2FA/CAPTCHA 一定要人在**它的**畫面上處理
+用自然語言交代工作,保留看得見、接得回來的控制權。
+
+
diff --git a/docs/bug-improvement-plan.md b/docs/bug-improvement-plan.md
deleted file mode 100644
index b9631dc..0000000
--- a/docs/bug-improvement-plan.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# Bug 檢查與改善計劃
-
-檢查日期:2026-09-05。範圍為目前工作目錄的前端、排程與 VNC 剪貼簿整合;不是全專案完整稽核。保留原有未提交修改。
-
-## 本次已修正
-
-- 頭像:縮小聊天氣泡 span 選擇器範圍,固定頭像尺寸,群聊頂欄改以實際 32px 計算堆疊位置,移除額外縮放。
-- 綠點:恢復頭像本身的 presence,取消側欄額外偽元素,限制綠點大小;未讀仍以右上藍點區別。
-- 排程:補齊表單、checkbox、換行及按鈕配置;由整個電腦側欄負責捲動,避免列表與編輯器壓縮預覽。聊天排程卡片與文字採上下排列。
-- 等待動畫:電腦採獨立薄荷色機器人、呼吸光環與琥珀軌道;聊天只依工作中的對話顯示思考,不再因電腦啟動/連線而出現。排除 null session ID 互相比較產生假忙碌。
-- 剪貼簿:在 noVNC 接收前攔截 Ctrl/Cmd+V,讀取本機文字後只送出一次遠端貼上;權限不足時開啟手動貼上框。延遲貼上期間換連線或變唯讀就取消。父子訊息驗證來源視窗,避免舊 iframe 更新目前狀態。
-
-## 計劃項目完成狀態
-
-| 優先 | 項目 | 實作與驗證 |
-| --- | --- | --- |
-| P1 | 固定間隔排程 | 改用 `@every Nm/Nh/Nd`,一天固定 24 小時;跨月、DST、漏跑相位測試通過。舊 cron 保留原文 |
-| P1 | Cron 編輯不失真 | 僅五欄及合法範圍轉換預設;未知格式保留 Advanced,空值禁止儲存;修正 Unix/Rust 星期編號差異 |
-| P1 | 電腦啟動失敗恢復 | 失敗立即刷新狀態,刷新失敗回復前值;回應只更新原本的 bot |
-| P1 | 遠端貼上同步 | 後端確認 X11 剪貼簿內容後才貼上;終端使用 Ctrl+Shift+V,連續貼上依序處理 |
-| P2 | 複製與權限提示 | 顯示同步結果、權限失敗退路;macOS Cmd+C 交由後端判斷終端快捷鍵 |
-| P2 | CSS 拆分 | Avatar、Chat、Computer、Schedule 分檔,響應式規則集中最後載入 |
-| P2 | 主 JS 過大 | 動畫改為 lazy import;主檔約 446 kB,動畫 chunk 約 318 kB,消除 500 kB chunk 警告 |
-
-## 驗證與限制
-
-- 前端 TypeScript、正式打包、5 個 Node 回歸測試、3 個 Python 控制測試通過;Rust 驗證詳見[安全與 Harness 檢查](security-and-harness-review.md)。
-- 瀏覽器工具回報沒有可用瀏覽器,尚未完成視覺截圖與真實 VNC 端到端驗收。這些項目已完成程式修正,不能等同所有畫面已實機驗收。
-- 待實機驗收:1440×900、1280×720、390×844;群聊、長排程、多筆排程、開機與聊天各自獨立、權限拒絕、中文/emoji/多行與重連。
-- 剪貼簿支援純文字;圖片、檔案不在此次實作範圍。Lottie 上游 eval 提醒仍存在;未量測首屏時間。
diff --git a/docs/diagrams.html b/docs/diagrams.html
deleted file mode 100644
index e966325..0000000
--- a/docs/diagrams.html
+++ /dev/null
@@ -1,925 +0,0 @@
-
-
-
-
diff --git a/docs/readme-hero.png b/docs/readme-hero.png
index 3c9c7a4..3ded218 100644
Binary files a/docs/readme-hero.png and b/docs/readme-hero.png differ
diff --git a/docs/security-and-harness-review.md b/docs/security-and-harness-review.md
deleted file mode 100644
index 58572b3..0000000
--- a/docs/security-and-harness-review.md
+++ /dev/null
@@ -1,62 +0,0 @@
-# 安全、Harness 與 Docker 檢查
-
-日期:2026-09-05。檢查第一方 Rust workspace、前端、控制腳本及容器設定;保留工作目錄原有修改。這是程式與依賴檢查,不是完整滲透測試;reference 第三方專案未逐行稽核。
-
-## 已修正的安全問題
-
-| 風險 | 問題與修正 | 主要位置 |
-| --- | --- | --- |
-| 高 | 桌面原本持有 supervisor 主 token;改為依 home key 衍生的 HMAC token,管理路由驗證容器歸屬 | crates/supervisor/src/docker.rs、main.rs |
-| 高 | 可提供任意 home 路徑及透過 symlink 越界;限定 DATA_DIR/homes/key,附件改用 cap-std 目錄能力讀寫 | supervisor/docker.rs、api/attachments.rs |
-| 高 | 已儲存密碼可能填入不相符網站;現在強制指定 hostname 與 HTTPS,不自動送出;DOM 觀察遮蔽密碼類欄位 | api/tools.rs、control/cdp.py |
-| 高 | 桌面提供的 JavaScript 可能在 API 同源執行;noVNC 靜態程式改由 API 可信映像提供 | api/screen_proxy.rs、image/api/Dockerfile |
-| 中 | 固定登入 cookie 無法個別撤銷;改為隨機 session、伺服器期限及登出撤銷,加入 Origin/Fetch Metadata 與本機 Host 檢查 | api/auth.rs |
-| 中 | MCP 子程序繼承服務秘密;改為環境白名單及明確設定 | api/mcp.rs |
-| 中 | 工具輸出可能進入記錄;移除輸出摘錄;附件隨機儲存名稱避免覆寫 | api/runs.rs、attachments.rs |
-
-Session 目前放在單一 API 記憶體,重啟失效;不適用多副本共用登入。已建立的 WebSocket 不會因 cookie 撤銷立即關閉。MCP 仍是同 UID 的可信子程序,環境白名單不等於作業系統沙箱。
-
-## Harness 與電腦控制
-
-- 修正 observe 對 POST-only 端點誤用 GET,消除正常路徑每次失敗再 fallback。
-- 移除有副作用操作失敗後的自動重播;執行前落盤 toolsStarted,完成批次保存上下文 checkpoint。worker 在不確定操作是否執行的狀態中斷,會標記失敗而非重做。
-- 模型暫時失敗採有限次重試與退避;各工具及程序有期限與輸出上限。Checkpoint 移除截圖並限制 1 MiB;超限保留不確定狀態以避免盲目重播。這不是 exactly-once 保證。
-- 使用 websocket-client 處理 CDP framing、控制訊框與 timeout;限制 Chromium 除錯介面為 loopback,移除 wildcard Origin。
-- DOM snapshot 使用每次唯一 selector,降低舊觀察誤點新元素風險;點擊前檢查可見、啟用、遮擋,動作後等待有限畫面更新。
-- 指標/視窗觀察並行;終端剪貼簿使用正確快捷鍵,確認 X11 文字一致後再貼上。
-- 排程以交易與 SKIP LOCKED 避免多 worker 重複派發,入列與下次時間一併提交。Unix 星期轉換已有回歸測試。DOM 與 DOW 同時受限的 cron 明確拒絕,避免不同 cron 引擎的 OR/AND 語意差異。
-
-這些改動減少多餘往返與重播風險,尚未進行真實桌面延遲 benchmark,沒有速度倍數保證。DOM 優先、需要時使用桌面操作仍是本專案適合的路徑;沒有為了換框架重寫整個控制層。
-
-## Docker 改善與升級
-
-已加入 cargo/npm 建置 cache、cargo --locked、npm ci、直接 MCP 套件版本固定、API 非 root、capabilities 限縮、健康檢查、restart/init、程序與日誌上限。資料庫/控制網路獨立;預設只在 127.0.0.1:3101 開放 API,Postgres 不對主機映射。開發資料庫使用 make postgres 的額外 Compose 設定。
-
-新安裝執行 make env,產生四組獨立秘密與隨機資料庫密碼,檔案權限 0600。既有 .env 不會被覆寫。
-
-既有安裝更新時:
-
-1. 備份資料庫、data 與 .env。此次僅建置映像,沒有重啟你的正式服務、旋轉秘密或刪除既有桌面。
-2. 保留原本 vault key。若之前未設定 LAZYBOY_VAULT_KEY,先把原本 LAZYBOY_APP_TOKEN 的值保存為 LAZYBOY_VAULT_KEY,才能旋轉 app token;否則舊密碼可能無法解密。
-3. 舊桌面曾取得 supervisor 主 token,更新時應更換 LAZYBOY_SUPERVISOR_TOKEN 並重建所有舊桌面容器(保留 home 資料)。新版 controlVersion 會使舊容器在重新 provision 時重建。
-4. API 改為 UID 1000。檢查既有 API 資料與快取目錄是否可由 UID 1000 存取;只調整確定需要的目錄,勿遞迴改動所有使用者 home。HOST_DATA_DIR 必須對應正確的主機資料目錄。
-5. 既有 Postgres volume 不會因改 .env 自動換密碼;密碼輪替須同時更新資料庫角色與連線設定。API 重啟後重新登入。
-
-Supervisor 仍掌握 Docker socket,可控制 Docker 主機;cap_drop 不能消除此權限。較強隔離方案是專用 Docker daemon/VM。桌面 Chromium 既有 --no-sandbox 與可信 MCP 的執行邊界仍需納入威脅模型。基底映像尚未固定 digest,未做完整 OS image CVE 掃描;直接套件固定版本不代表所有下載資產都可完全重現。
-
-## 驗證與剩餘告警
-
-- Rust workspace:114 個測試通過,含隔離 PostgreSQL 測試;前端 Node 5 個、Python 3 個測試通過。
-- 前端 typecheck、production build、程式碼 diff 空白檢查(不含 README 的 Markdown 換行空白)、Compose config 驗證通過;三個 Docker 映像實際建置成功。
-- 隔離 API smoke test:未登入拒絕、跨站登入拒絕、合法登入可存取 API、可信 noVNC asset 可用、登出後舊 cookie 被拒絕;均使用最後建置的映像驗證。
-- npm audit:0。cargo-audit:RUSTSEC-2023-0071(rsa 0.9.10,無修補版本)仍在 lockfile,但目前啟用依賴樹 cargo tree -i rsa 無結果;不能把未使用的 lockfile 告警說成已移除。
-- paste 1.0.15 有停止維護告警 RUSTSEC-2024-0436,由 fastembed/影像相關上游引入,仍需追蹤替代版本。
-- 未完成瀏覽器視覺驗收、真實 VNC 剪貼簿端到端、故障注入/負載測試。Lottie eval 提醒仍存在。
-
-## 方法參考
-
-- [Docker 安全與 daemon 信任邊界](https://docs.docker.com/engine/security/)、[Docker socket 保護](https://docs.docker.com/engine/security/protect-access/)、[建置快取](https://docs.docker.com/build/cache/optimize/)
-- [Playwright actionability](https://playwright.dev/docs/actionability):參考動作前狀態檢查原則,並未導入 Playwright runtime。
-- [長時間 agent harness](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents):持久化進度與恢復的設計參考。
-- [CDP 協定](https://chromedevtools.github.io/devtools-protocol/)、[websocket-client 用法](https://websocket-client.readthedocs.io/en/latest/examples.html)
-- [RSA advisory](https://rustsec.org/advisories/RUSTSEC-2023-0071.html)、[paste advisory](https://rustsec.org/advisories/RUSTSEC-2024-0436.html)
diff --git a/docs/workflow.html b/docs/workflow.html
new file mode 100644
index 0000000..9fbe403
--- /dev/null
+++ b/docs/workflow.html
@@ -0,0 +1,14847 @@
+
+
+
+
+
+
+
LazyBoy:從一句話到完成任務 Diagram
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Guided views
+
+
+
+
+
Explore this system
+
Step through curated paths without changing the source diagram.
+
+
+ Beat
+
+
+
+ Next
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Ready
+ Chapter 01 / 01
+
+
+ Guided chapter
+
+
+
+
+
+
+
+
+ Diagram guide
+ Explore this system
+
+
+
+
Inspecting compiled semantics
+
+
+
+
+
+
+
+
+
+ E ExportT ThemeS Style0 Reset+ Zoom in- Zoom outEsc Close
+
+
+
+
+
+ Find a node
+
+
+
+ ⌕
+
+ /
+
+
+
No matching nodes
+
+
+
+
+
+
Semantic passport
+
+
+
+
+
+
+
+
+
+
+
+
+
Authored reach
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Route probe
+ Choose a start node
+
+
+
+
+
+
+
+
+ Pick two semantic nodes on the diagram
+
+
+
+
+
+
+
+
Choose the source, then the destination. Direction matters.
+
+
+
+
+ Semantic lens
+ Compare system roles
+
+
+
+
Choose up to two semantic kinds. One reveals its real traffic; two compare only direct authored relationships.
+
+
Choose a kind to inspect its nodes and touching relationships.
+
+
+
+
+
+
+
+
+
+ Semantic radar
+ Building overview
+
+
+
+
+
+
Click nodeDrag to pan
+
+
Semantic radar needs more MAP space.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - • 即時觀看 Agent 桌面與目前步驟
+ - • 需要時由使用者接管,再交還給 Agent
+
+
+
+
+
+
+ - • 示範操作可整理成可重用技能
+ - • 排程、長期記憶與 MCP 延伸工作能力
+
+
+
+
+
+
+
+
+
diff --git a/docs/workflow.json b/docs/workflow.json
new file mode 100644
index 0000000..d428430
--- /dev/null
+++ b/docs/workflow.json
@@ -0,0 +1,90 @@
+{
+ "schema_version": 2,
+ "diagram_type": "workflow",
+ "meta": {
+ "title": "LazyBoy:從一句話到完成任務",
+ "quality_profile": "showcase",
+ "views": [
+ {
+ "id": "task-flow",
+ "label": "任務主流程",
+ "focus": ["workspace", "api", "supervisor", "desktop", "result"],
+ "note": "沿著主路徑查看指令如何成為可觀察、可接管的桌面操作。"
+ },
+ {
+ "id": "memory-schedule",
+ "label": "記憶與排程",
+ "focus": ["api", "memory", "schedule"],
+ "note": "長期記憶與排程會在需要時補充情境並重新啟動任務。"
+ },
+ {
+ "id": "safety",
+ "label": "隔離與憑證",
+ "focus": ["vault", "supervisor", "desktop"],
+ "note": "登入資料經加密保存,桌面工作負載在獨立容器中執行。"
+ }
+ ]
+ },
+ "lanes": [
+ { "id": "flow", "label": "任務主流程" },
+ { "id": "automation", "label": "持續自動化" },
+ { "id": "data", "label": "資料與安全", "variant": "exception" }
+ ],
+ "phases": [
+ { "id": "intent", "label": "說明目標", "fromCol": 0, "toCol": 1 },
+ { "id": "orchestrate", "label": "理解與編排", "fromCol": 2, "toCol": 3, "variant": "emphasis" },
+ { "id": "operate", "label": "執行與回傳", "fromCol": 4, "toCol": 5, "variant": "dashed" }
+ ],
+ "groups": [
+ { "id": "agent_core", "label": "Rust Agent Runtime", "lane": "flow", "fromCol": 1, "toCol": 2, "variant": "emphasis" },
+ { "id": "sandbox_boundary", "label": "Docker 隔離邊界", "lane": "flow", "fromCol": 2, "toCol": 3, "variant": "security" },
+ { "id": "durable_context", "label": "排程、記憶與登入資料", "lane": "data", "fromCol": 1, "toCol": 3, "variant": "dashed" }
+ ],
+ "mainPath": ["workspace", "api", "supervisor", "desktop", "result"],
+ "semanticChecks": {
+ "allowedRoots": ["workspace", "schedule", "vault"],
+ "allowedTerminals": ["result", "memory"],
+ "requiredPaths": [
+ { "from": "workspace", "to": "result" },
+ { "from": "schedule", "to": "desktop" },
+ { "from": "vault", "to": "desktop" }
+ ]
+ },
+ "nodes": [
+ { "id": "workspace", "lane": "flow", "col": 0, "type": "frontend", "label": "React 工作空間", "sublabel": "對話・電腦・記憶", "tag": "zh-TW / EN", "width": 150 },
+ { "id": "api", "lane": "flow", "col": 1, "type": "backend", "label": "API + Agent", "sublabel": "模型、工具與技能", "tag": "Rust / Axum", "width": 146 },
+ { "id": "supervisor", "lane": "flow", "col": 2, "type": "security", "label": "Supervisor", "sublabel": "資源限制與生命週期", "width": 146 },
+ { "id": "desktop", "lane": "flow", "col": 3, "type": "cloud", "label": "隔離電腦", "sublabel": "瀏覽器、檔案與輸入", "tag": "noVNC", "width": 146 },
+ { "id": "result", "lane": "flow", "col": 4, "type": "frontend", "label": "即時結果", "sublabel": "畫面、訊息與狀態", "width": 142 },
+ { "id": "schedule", "lane": "automation", "col": 1, "type": "messagebus", "label": "排程", "sublabel": "到點自動執行", "width": 130 },
+ { "id": "memory", "lane": "data", "col": 1, "type": "database", "label": "記憶與事件", "sublabel": "PostgreSQL + pgvector", "width": 154 },
+ { "id": "vault", "lane": "data", "col": 3, "type": "security", "label": "加密憑證庫", "sublabel": "網站登入資料", "width": 142 }
+ ],
+ "edges": [
+ { "id": "workspace-api", "from": "workspace", "to": "api", "label": "HTTP / WebSocket", "variant": "emphasis", "role": "main" },
+ { "id": "api-supervisor", "from": "api", "to": "supervisor", "label": "受控工具呼叫", "variant": "security", "role": "main" },
+ { "id": "supervisor-desktop", "from": "supervisor", "to": "desktop", "label": "啟動・暫停・恢復", "variant": "security", "role": "main" },
+ { "id": "desktop-result", "from": "desktop", "to": "result", "label": "螢幕與事件", "variant": "emphasis", "role": "return" },
+ { "id": "schedule-api", "from": "schedule", "to": "api", "label": "Cron 觸發", "variant": "dashed", "role": "async" },
+ { "id": "api-memory", "from": "api", "to": "memory", "label": "檢索與寫入", "variant": "dashed", "role": "branch" },
+ { "id": "vault-desktop", "from": "vault", "to": "desktop", "label": "僅匹配 HTTPS 網域", "variant": "security", "role": "branch" }
+ ],
+ "cards": [
+ {
+ "dot": "emerald",
+ "title": "看得見,也接得回來",
+ "items": [
+ "即時觀看 Agent 桌面與目前步驟",
+ "需要時由使用者接管,再交還給 Agent"
+ ]
+ },
+ {
+ "dot": "violet",
+ "title": "從一次任務到持續自動化",
+ "items": [
+ "示範操作可整理成可重用技能",
+ "排程、長期記憶與 MCP 延伸工作能力"
+ ]
+ }
+ ]
+}
diff --git a/reference/rakazo b/reference/rakazo
deleted file mode 160000
index 0f5c4ce..0000000
--- a/reference/rakazo
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 0f5c4cefd59cdbe440deb7e05fd3f503164a6068