Commit Graph

21 Commits

Author SHA1 Message Date
王性驊 e755e5878d fix: 「教我做」帶附件的訊息、更新前的回合也學得到;稽核紀錄加不了新欄位時照樣寫
- 帶附件的訊息:送給模型的那一份會在使用者的字後面接上附件的說明(app.rs 組歷史時),工作紀錄記的
  就是那一份,所以短訊息的前 40 字對不上,只會說「找不到(只找得到 30 天內…)」。現在帶了 at 就只認
  時間(那則訊息本身),技能的名字和說明用 attach::typed_part 拿掉附件說明、只留使用者打的字;
  照字找的路(沒帶 at 的舊手機頁面)也先拿掉附件說明再比。
- 更新前的回合:那時的稽核紀錄沒記訊息時間(讀成 0),帶了 at 一定對不上。對不上時改在「沒記時間」
  的回合裡照字找最近一次——有記時間的回合不會被這樣找到,所以插話、重新產生的判斷不受影響;風險只有
  更新前 30 天內、插話剛好跟某一回合開頭一樣,跟舊手機頁面同一種,陷阱照實寫。
- 稽核紀錄:ALTER TABLE 失敗(例如另一個 AnyBot 正拿著寫入鎖)時,回合那一列原本因為指名 prompt_at
  而寫不進去,手機的稽核時間軸也跟著空掉。insert_turn 寫不進時改寫不帶 prompt_at 的版本;讀的時候沒有
  那一欄就當時間不知道。
- verify-anybot:phone 多一個 upload <css> <檔>(DOM.setFileInputFiles,代替系統的檔案選擇器),
  用來驗證聊天的附件;SKILL.md、ctl 的用法一起寫。
- 功能地圖 replay.md:陷阱補上「這一版以前做的回合照字找」;自動測試列上新測試。
- 沒改:學習步驟裡的 computer_use_show、當掉後「繼續」把一件事拆成兩回合——都不會讓 Bot 或使用者
  誤會到要寫進陷阱。

已驗證: 完整 cargo test(金鑰清空、DOCKER_HOST 指到不存在、ANYBOT_HF_BASE 連不到)全綠(678 過、46 ignored
  沒跑);cargo clippy --bin anybot --all-targets -- -D warnings 沒有警告;sh deploy/ci/lint-sh.sh 過。新測試
  memory::a_message_with_a_file_and_an_older_turn_can_be_taught、store::the_trail_keeps_writing_when_the_new_column_cannot_be_added
  (真的讓 ALTER 失敗:另一條連線 BEGIN IMMEDIATE 拿著寫入鎖)、attach::the_words_typed_come_back_from_the_models_copy。
  證明會擋:taught_turn 換回上一個 commit(2605445)的版本,帶附件的訊息「找不到」;拿掉沒記時間的
  照字找,更新前的回合「找不到」;拿掉不帶 prompt_at 的 insert 和讀法,回合一列都沒寫進去;放回去都過。
  verify-anybot 冷開照地圖寫的跑 replay.md 四步都過;另外用新的 upload 在手機選一個檔案(清單.txt)送
  「看這張」,假模型收到的是「看這張\n\n[附件「清單.txt」…]」,長按 › 教我做 存成技能「看這張」、說明
  「示範學會:看這張」、一步 echo 看過 >> seen.txt。
未驗證: 真的手機選檔案(用 DOM.setFileInputFiles 代替系統的檔案選擇器)和長按(用無頭 Chrome 的觸控事件);
  已經有舊 audit.db、而且裡面有更新前回合的真實資料夾——只用單元測試;ALTER 失敗的情況只在單元測試裡造出來;
  「網站地圖」照地圖寫的走不到(要真的模型)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5sXAsDLzxz6UZJgoC
2026-11-18 19:27:21 +08:00
王性驊 2605445564 fix: 「教我做」學的是聊天裡留著的那一次——稽核紀錄記下訊息的時間,重新產生後不再學到被換掉的那次
上一版用「訊息時間之後第一個開始的回合」找那一回合,但稽核紀錄沒存訊息自己的時間(還原時拿回合
開始的時間代替),而重新產生、重新傳送、重試是同一則訊息(同一個 at)再開一回合:最早的那次贏,
長按之後學到的是被換掉的第一次(審查者冷開重現:第一次 echo wrong、重新產生 echo right,教我做存了
echo wrong)。

- store:稽核紀錄的回合列多一欄 prompt_at(使用者那則訊息送出的時間);舊的 audit.db 開啟時
  ALTER TABLE 加上,舊列留 NULL(讀成 0,不會被當成任何一則訊息)。records() 拆成 turn_starts(只讀回合
  的第一行:說了什麼、什麼時候送的)和 turn_records(只讀選中的那一回合):原本是在畫面那條執行緒上、
  拿著稽核紀錄的鎖,把 30 天內每一步的參數都讀出來。
- memory:taught_turn 先選回合——有 at 就只認 prompt.at 剛好等於它的回合、取最後一個(聊天顯示的那一次),
  沒有就「找不到」,不再退回別的回合(插話的時間不會對上任何回合);沒帶 at 的舊手機頁面才取同樣的話
  開始的最近一回合。skillify 只把那一回合的步驟做成技能。
- 跟自動學(replay_steps)共用同一份「重播不做的步驟」(never_replayed):教我做原本會留下 use_skill、
  replay_skill、anybot_guide;computer_use_look、computer+action 是不存在的名字(工作紀錄記的是展開後的
  computer_use_*),換成真的 computer_use_show。
- appctl:learned() 自己換成主 Bot(home_of)。從 apply() 進來本來就已經換過,這是讓它不靠呼叫的人。
- 功能地圖 replay.md:多一步「重新產生之後教我做」(長按 › 教我做,存的是 echo right);Bot 讀得到的
  陷阱改寫:學的是那則訊息開始的、聊天裡留著的那一次,插話和 30 天以前的說找不到,舊手機頁面沒帶時間時
  學什麼;丟掉的步驟加上讀說明或技能、重播。自動測試列上新測試。

已驗證: 完整 cargo test(金鑰清空、DOCKER_HOST 指到不存在、ANYBOT_HF_BASE 連不到)全綠(675 過、46 ignored
  沒跑);cargo clippy --bin anybot --all-targets -- -D warnings 沒有警告;sh deploy/ci/lint-sh.sh 過。新測試
  appctl::after_regenerating_the_attempt_shown_is_learned、appctl::a_skill_learned_in_a_branch_is_the_main_bots、
  store::an_older_trail_learns_when_messages_were_sent;memory 的 the_message_pressed_is_the_turn_learned 改成
  重新產生和插話的情況、a_finished_turn_can_become_a_skill 加了 anybot_guide/use_skill/replay_skill、
  store 的 the_trail_keeps_the_story… 改讀 turn_starts/turn_records。證明會擋:兩個 appctl 測試放進上一個
  commit(4be6d3e)的程式碼跑都失敗(存了 echo wrong、主 Bot 沒拿到技能);把選回合改回「之後第一個、
  沒有就最近的」、把三個名字拿出共用清單,memory 兩個測試都失敗;拿掉 ALTER,遷移測試失敗(no such
  column: prompt_at);放回去都過。verify-anybot 冷開照地圖寫的跑 replay.md 四步:做五步學會、重播填空格、
  教我做(長按 › 選單)、重新產生之後教我做(手機按回答下面的「重新產生」,聊天只剩 echo right,存的
  技能 steps 是 echo right >> sign.txt;sign.txt 裡兩次都有,因為兩次都真的跑了)都過。
未驗證: 已經有舊 audit.db 的真實資料夾升級——只用單元測試建一份沒有 prompt_at 欄的表驗證;舊版手機頁面
  (不帶 at)只靠單元測試;「網站地圖」照地圖寫的走不到(要真的模型);真的手機的長按沒有測(用無頭
  Chrome 的觸控事件代替);garden.md 這輪沒有重跑(這輪沒動待改進)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5sXAsDLzxz6UZJgoC
2026-11-18 17:54:21 +08:00
王性驊 4be6d3e4d0 fix: 「教我做」讀 30 天的稽核紀錄,做完的回合也學得到;整理做法回報的問題進得了待改進
教我做(skillify)只讀那個 Bot 的工作紀錄(oplog),但一回合結束時工作紀錄就縮到只剩還在等的訊息
(通常整份刪掉)——長按的是自己早就做完的那則訊息,所以每次都回「那一回合沒有可重播的步驟」。
工作紀錄是給當掉後收尾用的,本來就只留進行中的那一回合;每一步的參數和結果另外照抄進 30 天的
稽核紀錄(oplog/audit.db,手機的稽核時間軸已經改讀它)。教我做要的正是「過去某一回合的步驟」,
所以改讀稽核紀錄,不是把工作紀錄留著。

整理做法(learn)在回答送出、這一回合 Done 之後才在背景跑(不讓使用者等),它回報的 AnyBot 自己的
問題(StreamEvent::Issues)卻排在「舊回合的零星事件一律丟掉」的檢查後面——紀錄寫了「Bot 回報了
2 個 AnyBot 自己的問題」,待改進還是空的。改成跟 Learned 一樣在那個檢查前面處理(事件的順序本來
就是 Done 在前,不能為了它讓使用者等整理做法)。

- store:records(bot) 把稽核紀錄裡 30 天內的回合和步驟還原成工作紀錄的格式(回合開頭帶使用者的話、
  每一步的參數和結果、回合結束排在步驟後面);KEEP_DAYS 公開給錯誤訊息用。
- appctl skillify:讀 store::records,稽核紀錄打不開才退回工作紀錄;把手機送的訊息時間 at 交下去。
- memory::skillify:
  - 學的是按的那則訊息開始的那一回合:同一句話可能做過好幾次(30 天內很常見),有 at 就取那個時間
    之後第一個開始的回合,沒有 at(或時鐘對不上)才取最近的。
  - 比對時兩邊都照手機 plain() 的規則整理(拿掉 * _ ` # >、連結只留字、換行併成空白)——手機送的是
    plain(m.text),原本訊息裡有 >、_ 或換行就對不上。技能的名字、說明、做法改用那一回合原本的字
    (併成一行),不用手機去過標記的字(teach_log.txt 不會變成 teachlog.txt)。
  - 回傳 Result,分開「找不到以「…」開始的那一回合(只找得到 30 天內、由一則訊息開始的回合;做事中途
    插的話不算)」和「沒有可重播的步驟」;「这件事」→「這件事」(整份 memory.rs 用 ICU Hans-Hant 掃過,
    只有這一個簡體字)。
- app drain_events:Issues 跟 Learned 一樣在回合結束後也收;記在主 Bot 名下(支線的算主 Bot 的)。
- 手機:教我做帶上訊息的 at;成功後呼叫的 again() 在那裡不是函式(全域的 again 是 loadChat 的旗標),
  按了會丟 TypeError,拿掉。
- verify-anybot:phone 多一個 long-press <css> [--text](觸控按住 0.8 秒),走得到長按的選單;
  SKILL.md、ctl 的用法一起寫。
- 功能地圖:replay.md 的「教我做」改走真的選單(長按 › 教我做),拿掉「走不到」那一步;陷阱補上學的是
  哪一回合、只找 30 天內、找不到時說什麼;garden.md、replay.md 的自動測試列上新測試。

已驗證: 完整 cargo test(金鑰清空、DOCKER_HOST 指到不存在、ANYBOT_HF_BASE 連不到)全綠(672 過、46 ignored
  沒跑);cargo clippy --bin anybot --all-targets -- -D warnings 沒有警告;sh deploy/ci/lint-sh.sh 過。新測試
  appctl::a_turn_that_has_ended_can_still_be_taught、memory::the_phones_plain_words_find_the_turn、
  memory::the_message_pressed_is_the_turn_learned、app::anybots_own_problems_found_after_the_turn_reach_the_list,
  store 的 the_trail_keeps_the_story… 加了 records、a_finished_turn_can_become_a_skill 加了「這件事」——把修正
  拿掉再跑都失敗(找不到那一回合、待改進是空的、簡體字、學到後來那一回合、說明變成去過標記的字),
  放回去都過。另外請一個乾淨脈絡的 Agent 照 replay.md、garden.md 審過 diff,它提的三點(同一句話學錯回合、
  技能的字被手機去掉標記、插話也說「30 天內」)都改了。verify-anybot 冷開照地圖寫的跑:replay.md 三步
  (做五步學會、重播填空格、教我做——長按 › 選單 › 「已存成技能」,那一回合已經做完、工作紀錄不在,技能
  steps 1、參數和說明都照原樣 echo 教 >> teach.txt;長按插話跳「找不到以「…」開始的那一回合…」)都過,修改前
  第三步是 HTTP 400;garden.md 沒事不報、/doctor 遮金鑰、待改進合併計次(browser_fill_contact 一條 count 2、
  bots 驗證小幫手,重開後還在)、版本都過,修改前第三步待改進是空的。
未驗證: garden.md 的「電腦版 設定 › 更新」要開桌面視窗(desktop-shot),沒跑;「有事的報告、當掉」和
  replay.md 的「網站地圖」照地圖寫的走不到(要明天 8:44、真的當掉、真的模型);garden.md 是在審查後那幾處
  修改之前的建置上跑的(那幾處只動 skillify 和手機的教我做,沒動待改進);真的手機的長按沒有測(用無頭
  Chrome 的觸控事件代替);超過 30 天的回合、別台裝置時鐘不準時的 at 只靠單元測試。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5sXAsDLzxz6UZJgoC
2026-11-18 17:33:43 +08:00
王性驊 f4911b1b7e feat: 技能帶參數:argument-hint/arguments($ARGUMENTS、$0…、$名字)、allowed-tools(這一輪只准用這些)、context: fork(在支線做)
- SKILL.md 開頭多四個欄位,寫法跟 Claude Code 一樣(一行逗號、[a, b]、或一行一個 - 都讀得懂),存回去也寫得回去。
- 「/名稱 參數」:技能有參數時,替模型加的那一行帶上參數,use_skill 多一個 arguments,讀到的做法裡換好(都沒寫就附在最後);沒參數的技能照舊。/ 清單顯示 argument-hint。
- allowed-tools 是限制不是放行:讀了這個技能之後這一輪只准用那些(Claude Code 的名字對到 AnyBot 的工具,Bash(git log:*) 是 shell(git log *),走 gate.rs 的固定樣式),別的步驟不執行;use_skill、read_result、ask_person 一定能用。裝來的技能不能替自己開權限。
- context: fork:打「/名稱 …」改開支線(跟 /btw 一樣);走 commands.rs 的 command_for,電腦和手機/螢幕一樣。

已驗證:cargo test 597 通過(欄位讀寫來回、參數代換含引號和 $5、名稱對照和樣式、真的一輪裡 use_skill 之後 edit_file 被擋、fork 技能變支線、沒參數的技能提示不變)、clippy -D warnings 乾淨。
未驗證:真的模型拿到參數和限制時的做法。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:51:07 +08:00
王性驊 d23ca7628d chore: clippy 全部清乾淨,CI 有新警告就失敗;make lint
工程基礎計畫 E6。33 個警告改掉,行為不變(測試全過):
- 順序一樣、寫法更直接:sort_by(b.cmp(a)) → sort_by_key(Reverse)(三處,都是穩定排序);chunks_exact(4) → as_chunks::<4>()(拿掉一個 unwrap);用 checked_div 取代先判斷 total > 0;兩個一樣的分支合成一個條件;計數迴圈用 enumerate;單一運算式的立即呼叫閉包改成區塊;回傳 () 的函式不再包在 Ok() 裡。
- 型別取名:VoicesAnswer、Vocab、Group。system_prompt 的 11 個參數留著(每個是指示的不同部分),標 allow 並寫理由。
- 小的:多餘的 clone、format!、vec!、into、借用;3_600_000 的分組;文件註解的縮排和空行;新檔案明說不截斷。
- .gitea/workflows/ci.yml:clippy 改成 `--all-targets -- -D warnings`(原本只報告)。make lint 跑一樣的檢查。
- 不加 rust-toolchain.toml:AnyBot 是使用者自己建的,釘版本會逼每個人和 make update-server 多下載一套 Rust;CI 映像本來就釘 1.98.1。

已驗證:cargo test 560 全過;cargo clippy --bin anybot --all-targets -- -D warnings 在這台 Mac 過。
未驗證:只在 Linux 編譯的程式(x11.rs、wl.rs、portal.rs…)的 clippy:這台 Mac 看不到,第一次 CI 跑會檢查,若有警告會擋下來。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:18:12 +08:00
王性驊 eb70608160 feat: AnyBot 功能地圖——Bot 用 anybot_guide 認識 AnyBot 本身;修好地圖整理時找到的七個問題
功能地圖(照 Lauren Tan 的 feature map,poteto/verification-skill-example)
- docs/feature-map/:20 區加索引,每區四段(子功能/使用者怎麼到/怎麼操作(Bot:、驗證:)/陷阱),內容逐條對照程式;索引寫共同前提、證據與略過的回報、全面檢查順序
- Bot 的系統提示多一行區塊目錄;新工具 anybot_guide 一次讀一區(唯讀)
- cargo test featuremap:: 擋漏寫:Bot 能拿到的每個工具、browser/computer 的每個動作、設定視窗每個分頁和區塊、update_settings 的鍵;每區要有四段、不能太長
- 自動學技能:AnyBot 本身怎麼用不抄進技能,地圖錯漏記成待改進;園丁在重複的待改進旁提醒補地圖
- CLAUDE.md:改功能時同一個 commit 一起改地圖
- 側邊欄「分區」工具的說明寫清楚:不是群組聊天

修正
1. 別人傳來的訊息(訊息管道、團隊成員)那一輪不給 AnyBot 瀏覽器、保險庫和已送紀錄(瀏覽器帶著使用者的登入);硬叫也擋下,公開網頁仍可 web_fetch
2. 自動學會的技能加進那個 Bot 自己的技能清單(支線的算主 Bot 的)
3. 按停止一併停掉這個 Bot 的互動終端機(一般背景指令照舊)
4. 設定 › 整合 › 技能、頁面的「刪除」要再按一次確定
5. update_bot 先跳確認卡片,列出每一項要改成什麼
6. Bot 範本的頭像形狀改成存在的形狀,並加測試
7. 文字:直接操作的提示改「設定 → 權限」、金鑰錯誤改「設定 → 模型」、等核准逾時照實說是什麼在等

Mac 490 個測試通過。

Refs: cl3xk7

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 11:15:09 +08:00
王性驊 c7f6da7fe8 feat: 發布關卡——已送帳本、發布前檢查、送出後讀頁面留證據、例行任務完成條件、重播可填空格
1. 已送帳本(publish.rs):Bot 用 AnyBot 瀏覽器送出前,系統先讀頁面,看是哪個帳號、回哪一篇(回覆對話框或文章裡的貼文網址、或頁面本身);同一帳號回過同一篇就擋下(記 60 天),頁面看不出回哪篇時只擋 24 小時內同頁同字。搜尋框按 Enter 不算送出。瀏覽器新增 sent 動作,直接從帳本列出帳號回過誰,不必每輪讀完網站的回覆頁
2. 發布前檢查:送出前請另一家供應商的快速模型照基本規則(簡體字、AI 腔、不該公開的內容)、這一輪讀過的技能與自訂規則檢查,沒過就不送並說原因;固定不變的放在系統提示最前面方便快取,同一段字一輪只問一次;設定可關、可加規則
3. 送出後的證據:系統重讀頁面,確認文字出現、輸入框清空,抓出留言自己的網址;寫進 Message.sent(頁面文字偽造不了),送出計數、例行任務紀錄、/goal 評審、手機頁面都以它為準;框裡還留著字就記為沒有送出
4. 完成條件:例行任務可設 target_sends,系統自己數:到數就不准再送,結束時不到算失敗,連續兩輪(50 步)沒有新的送出就停下;喚醒訊息與進展檢查都說明目前計數
5. 重播空格:自動學技能時把每次不同的內容(留言、貼文網址)存成 {{名稱}},replay_skill 用 values 填這次的內容,缺哪格就說哪格
6. 間隔從真正送出那一刻算起;送出後確認最多等 8 秒,框清空 4 秒仍沒看到就先記「還沒確認」

Mac 480 個測試通過;送出前後讀頁面在 Brave、Firefox 實機測試通過。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 01:48:13 +08:00
王性驊 98fc63e65b feat: 借鏡 pstack/Grok Bot——例行任務執行紀錄、完成看證據、教訓分流、園丁報告、減少操作步驟、網站地圖
1. 例行任務執行紀錄:每次執行記開始/結束、完成/失敗/被停止/中斷、步數與失敗步數、原因,保留最近 20 次(Grok Bot 官方規格);上次失敗或中斷的原因帶進下一次;連續失敗 2 次自動暫停並說明原因;設定頁、手機詳細頁、list_routines 都看得到,沒有紀錄時說「查不到」不說「沒跑過」
2. 完成看證據:evidence.rs 從步驟算出實際成功送出幾次,寫進例行任務紀錄;/goal 評審的摘錄把 Bot 的話標成「不是證據」並附系統統計,對不上以系統為準;評審優先用另一家供應商的模型,失敗退回原本的
3. 教訓分流:自動學技能時,AnyBot 自己的工具問題寫進 tool_issues → 「待改進」清單(同一工具合併計次),不寫進技能;設定 › 更新可看可清除
4. 園丁報告(garden.rs):平日 8:44 掃過去一天的失敗、走冤枉路的執行、自動暫停與重複出現的待改進;週一 8:49 列出失敗多或太耗時的例行任務;沒事不報,可在設定關掉
5. 減少步驟:browser type 多行文字一次放進欄位(先試貼上事件、檢查沒進再用 insertText,Firefox 也行)並回報欄位內容;點進輸入框回「游標已在…」不再說「沒有變化」;元素編號在同一頁重讀時不變;wait 的 after_send 從上次送出算間隔
6. 網站地圖:學技能時同一網站的操作知識整理進「<網站> 網站地圖」(功能/怎麼到/怎麼操作/陷阱),做事的技能只寫特有規則

Mac 465、Linux 469 個測試通過;多行輸入與編號實機測試在 Brave、Firefox 通過。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 23:52:44 +08:00
王性驊 3b8c4c3d3b Bot 之間溝通:ask_bot 問同事並等回答、群組 @點名、共用頁面/「關於你」記憶/教技能;修正插話丟附件、Enter 核准失效等
問同事(ask_bot)
- A 問 B 並等它回答:問題放進 B 自己的聊天,B 用自己的模型、工具、記憶和電腦做,最後的回覆交回 A
- 最多轉 3 手、不能互等(避免卡死)、對方忙就排隊(10 分鐘逾時)、停止 A 時 B 也停
- message_bot 也加轉手上限;別的 Bot 叫的不算使用者的話(改不了自己的設定)

群組 @點名
- 「@名字」只叫被點到的成員回答;成員在回覆裡 @ 別人就接著說(一輪最多 8 則)
- 電腦和手機的輸入框打 @ 會列出成員
- 修正:每個成員帶自己的記憶;成員回覆的每一步都記得是誰說的

共用資源
- Bot 可以讀其他 Bot 的頁面(只能讀,改要請作者改)
- 共用的「關於你」記憶:每個 Bot 都帶著,記憶頁可切換查看、編輯;外人的訊息不帶
- teach_skill:把自己會的技能教給同事(先問你);同事名冊列出每個 Bot 會的技能

修正
- 插話(Bot 工作中傳訊息)會帶附件:聊天有檔案卡片,模型看得到圖片;當機復原也帶著
- 輸入框有焦點、框是空的時 Enter 允許待核准的步驟(原本被當成空白送出吃掉)
- 大腦的螢幕連不到大腦時,引用、附件、記憶不會先被用掉
- 「還原上一個答案」存在 Bot 上:重開還在,連大腦的畫面和手機都能還原;停止的回合也留著
- Bot 忙時被叫醒(例行任務、message_bot、觸發器)改成排隊開自己的一輪,不再壓成純文字插話
- 停止時結果已回來的步驟標成完成;輸入法剛選字的那一格不送出

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3a7riWESpv471gDgC
2026-11-13 21:34:03 +08:00
王性驊 eb3157852a 安全、修正: harden sandboxes, approval gates, vault, relay roles, and fix protocol/UI bugs
- macOS 沙盒與工具 (tools.rs, policy.rs, docindex.rs): block AppleScript raw events and
  concatenation outside the sandbox; stop exposing ~/.ssh or localhost sockets in Sealed
  mode; deny writes to shell profiles, LaunchAgents and .git/hooks; expand secret-file
  ignores and enforce symlink/policy checks across SSH, device and document search.
- 電腦操作與遮罩 (computer.rs, agent.rs, marks.rs, desktop.rs, cloudbox.rs, portal.rs):
  forbid clicking or typing into AnyBot's own windows; extend the sensitive-action hard
  gate to raw coordinates, Return/Delete submits and remote devices; stop batch steps if
  the front app changes; black out secrets on zoom, show, >600-node trees, adjacent OTP
  labels, box screenshots and control text lists; preserve non-text Wayland clipboards.
- 保險庫與瀏覽器 (vault.rs, vault_store.rs, browser.rs, botbrowser.rs, web.rs, box/browser):
  verify tab host and HTTPS atomically at fill time; taint filled tabs against browser_eval
  and PDF export while masking card/CVC values and screenshots; remember sites only on
  always-allow; drop --remote-allow-origins=*; gate private URLs and block metadata/Docker
  ports, OrbStack 198.18/15 and IPv6 transition ranges.
- 帳號伺服器、同步與傳送 (relay/, remote.rs, mirror_ui.rs, share.rs, drops.rs): isolate
  paired hands hosts from brain sync, tickets, pairing and backup overwrites; redact
  routine trigger secrets and clear REDACTED when endpoints change; isolate channel and
  team-member turns from owner memories, appctl and grants; scrub shared bot exports and
  reset grants/routines on import; validate drop IDs and serialize chunk writes.
- 網路與協定穩定性 (httpd.rs, tunnel.rs, vnc.rs, Caddyfile*): fix chunked integer overflow
  and CRLF header injection; enforce Origin checks, connection/job caps, 200 MB backup
  reads, unique atomic temp files and ASCII hex guards; bound deflate unzip and VNC sniff
  buffers; move VNC stdin/text off the tunnel loop.
- 介面、排程、語言與其他修正 (app.rs, i18n.rs, providers.rs, skills.rs, routines.rs,
  setup.rs, store.rs, preview.rs, attach.rs, speech.rs, teams.rs, mcp.rs, voice.rs):
  wire up the delete-routine confirmation dialog and mirror run-now; preserve unsaved
  mirror edits across brief disconnects; give Chinese skills distinct folders and approval
  gates; convert parsed tool JSON fields without corrupting code fences, URLs or paths;
  fix Hourly DST offsets and time out unattended routine approvals; lock --install-skill,
  cap docx/xlsx unzip sizes, isolate test env keys, and tighten local file permissions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-12 14:34:10 +08:00
王性驊 41b6b7f465 技能: / in the input picks one; on a brain's screen the brain adds, installs and deletes them; 設定 › 整合's lists keep their buttons clear
- Typing / at the start of the input (computer and phone) lists the skills that are on: names that
  start with what is typed first, then names containing it, then descriptions (「/簡報」 finds
  pptx). A click, or ↑↓ and Enter/Tab, puts 「/name 」 in the input; Esc closes the list. Sent, the
  brain recognises 「/name」 and adds a line after the message telling the model to read that skill
  with use_skill first, so a phone or a message channel gets it too; a / that names no skill (a
  path) gets nothing. The phone asks the brain for the list again at each new /, so a skill added
  since is there.
- On a screen, 加入 / 安裝 / 刪除 ran on the screen's own disk and only the list entry reached the
  brain: a GitHub skill's scripts stayed on the screen's computer, an install also pushed every
  skill in that computer's folder into the brain's list, and a deleted skill's folder stayed on the
  brain and came back at its next start. These now go to the brain (/api/sync/skill, the phone's
  own 「skill」 action): it fetches an address itself, a folder or .md file on the screen's
  computer goes up whole with its files, and a delete takes the folder too. 「把這台的 Bot 搬到大腦」
  hands over skills the same way. A refused package leaves no folder behind.
- 技能, 技能市集 and 連接器市集 rows: a long description took the whole row and 開啟 / 檢視 / 刪除
  / 已加入 / 安裝 were drawn over it. The buttons are laid out first and the description ends in …
  before them (the whole of it on hover).
- Screenshot mode: ANYBOT_SHOT_KEYS="ArrowDown@60;Enter@64" presses keys at given frames.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 16:54:58 +08:00
王性驊 f9a261959c version_0_1_1-alpha 2026-11-11 16:19:06 +08:00
王性驊 b4ba710eb4 記憶: each bot keeps its own, remembers like a person, and decides for itself
- Each bot only sees its own memories (the shared "bot 0" layer is gone).
- A 做過的事 line is written only for a turn that really did something
  (or looked things up in 5+ steps); small talk and simple answers aren't kept.
- The bot judges on its own what is worth remembering and whether a new fact
  is the same as, replaces, or stands beside an old one (`separate`); it
  doesn't ask the person first.
- remember no longer refuses a different fact that shares a subject with an
  old one (likeness is counted both ways).
- Filler messages (謝謝, 繼續, ok…) carry no memories; `_` and `%` are no
  longer wildcards in the search.
- Team members no longer receive `memories` with messages, and picks are
  taken only from the owner and only when they are this bot's real memories.
- forget only retires 記得的事, never a 做過的事 line.
- Memory chips are hidden while the bot is working (desktop and phone).
- A reply made long after the message gets a 〔現在時間〕 line.
- The nightly tidy runs only on the brain; edits are capped at 500 chars.
- Model download: no total body time limit, only a 60 s stall limit.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3SYw9JJ9dXwaNvYh4
2026-11-11 09:35:59 +08:00
王性驊 28784232a5 記憶: a page to see it, a few lines picked while typing, a local model
The memory had grown into a list carried whole, a top-14 recalled by a
trigram index and pasted into the system prompt with the clock, and a
page that broke its own layout. Nobody could see what went to the
model, the prompt cache missed every message, and 「記住」 kept saying
the same thing twice. Rebuilt per the spec (docs/memory.md):

- Three kinds in memory.db: 記得的事 (fact), 做過的事 (event, a line per
  finished turn), 整理過的 (rollup). Each keeps pinned, uses,
  last_used, deleted, superseded_by, span. state.json keeps the facts
  as the copy that syncs; the page reads SQLite.
- Search: jieba words ∪ CJK bigrams in an FTS5 unicode61 table
  (Traditional text goes through Simplified first), weighted share of
  query terms hit; plus local vectors, vec = clamp((cos−0.35)/0.35).
  score = max + 0.15×min, events ×0.9. ≥0.15 suggested, ≥0.5 ticked,
  ≥0.55 carried when nobody chose (3 at most).
- What the model gets: the system prompt has the time zone and the
  pinned memories only, the same every turn. Each person message gets
  〔送出時間〕 and 〔相關記憶〕 from Message.memories, built in
  group_history into a transient Message.context, so the beginning of
  a chat reads the same next turn (cache hits) and the event log,
  skills and audit see only what was typed. A memory already carried
  in view isn't carried again; each carry counts a use.
- Picks travel with the message: Cmd::Send / POST send / sync act
  "memories" (empty = none; absent = the brain chooses, once, saved).
- remember finds the like one (cos ≥ 0.85 or the same words) and asks
  for `replaces`; the old one is superseded, never carried. A fact
  forgotten and remembered again comes back. New search_memory
  (query, kind), with dates; read-only.
- Nightly on the brain, no model: events past 30 days fold into a line
  per week (「11/3–11/9 做過的事(14 件):整理照片 ×3…」, ≤400 chars,
  like with like by words or vectors), weeks past 180 days into months;
  the folded go to 最近刪除 for 30 days. Facts are never removed. The
  page offers duplicates, facts unused for half a year, and what can
  fold now.
- Local model: minishlab/potion-multilingual-128M through m2v.rs (same
  token ids as model2vec-rs on 13/13 sentences, cos ≥ 0.9999, without
  tokenizers' 1.1 GB). Converted while downloading: vocab.bin,
  table.i8 (int8 + row scales), dims.json, 137 MB kept of 530 MB;
  ANYBOT_HF_BASE picks a mirror (now passed into the server's brain
  container too). Loaded when first needed (34 ms), let go after 10
  idle minutes. The brain loads it; a screen only with a document
  folder set; hands and phones never. 設定 › 一般 › 語意搜尋:
  本機模型/Ollama/關閉; a new engine clears every vector.
- Three files, three connections: memory.db (backed up nightly, 7
  kept), docs.db (a cache), oplog/audit.db (30 days). An old audit.db
  hands its memories and documents over once and shrinks (a real one:
  172 MB → 16 KB). docs_search scans every chunk now, vectors cached
  in RAM (it stopped at 8000); FTS optimize + VACUUM daily (260 MB of
  tombstones over 31 MB of text).
- API: POST /api/memory (owner) and /api/sync/memory (mirror). Reads
  answer on the HTTP thread; writes go through phone_act("memory").
- Screens: a memory dialog (Bot menu 記憶…, Bot settings 打開記憶) with
  counts, live search, filters, suggestions, per-item kind/date/uses
  and pin/edit/forget/restore; chips above the composer 300 ms after
  typing stops, with a token estimate; 「帶了 N 條記憶」 under person
  messages. The phone has the same as a 記憶 tab, chips and tag.

Checked: make test passes (app 297, relay 16), with new tests for the
scores and thresholds, Traditional Chinese segmentation, remember's
dedupe and replaces, two turns sending the same beginning, no double
carry, weekly/monthly folding and the trash, and the audit.db move.
Brain idle 37 MB as before, ~230 MB with the model loaded; search on
the brain 0.2–0.5 ms, 7–44 ms from the phone page. A deadlock found on
the way (stats re-taking the lock) is fixed and tested.

Docs: docs/memory.md has the whole design; FEATURES.md, protocol,
architecture (zh/en), multi-device and install say what changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3SYw9JJ9dXwaNvYh4
2026-11-11 07:46:50 +08:00
王性驊 a514b33fb3 Bug sweep: gates, relay 2FA, Windows input, snapshots, encodings
Permissions and reach
- a file leaving a computer passes the same questions as reading it;
  "looking" shell commands that do more than look ask first
- a symlink out of the work/sealed folder counts as outside it
  (real paths, not just lexical ones); the search walk skips links
- web_fetch and skill_install read the public web only: localhost, the
  LAN and cloud metadata are refused, at every redirect
- preview shows a file without running it; browser_upload may ask
- vault: logins no longer match across shared suffixes (pages.dev,
  com.tw, ...); registrable_domain knows public suffixes
- axwrite: found elements are retained (use-after-free)

Relay
- replacing or turning off 2FA needs the current code (rate-limited);
  new recovery codes only count once enrollment is verified
- a removed computer loses its socket and its `call` access
- a site name taken by another account answers 409
- RELAY_TRUST_PROXY: the login lock counts the caller's address, not
  the proxy's (compose files and README)
- httpd: half a body is not a request

Desktop
- sign-in, join and restore work with 2FA on (code field; --serve reads
  ANYBOT_ACCOUNT_CODE; the setup wizard points to a pairing code)
- Windows: text was typed twice; modifiers are held through click, drag
  and scroll; horizontal scroll; screen control is no longer refused
- a recording that hits the limit is transcribed, not thrown away
- bot's computer: a new home volume restores the snapshot; a snapshot
  is read through before the home is wiped; a failed volume removal
  stops reset/restore
- events of a stopped turn no longer land in the next one; each channel
  message gets a turn of its own
- saving a bot's settings keeps what it got meanwhile (three-way merge);
  a save file that cannot be read is kept
- pages in Big5/GBK/Shift_JIS are read in their own encoding
  (encoding_rs); osascript output past 64 KB no longer stalls
- pick_tab keeps a job's own non-http tab; pictures larger than the
  texture limit are fitted; the auto-update time field takes typing
- skills live in <data>/skills; memories are unnumbered in the prompt;
  the phone may skillify and skill_install

CI
- the test step fails when the tests fail (it piped into tail)

Tests: anybot 268 passed, 27 ignored; relay 16 passed; clippy unchanged.
Not run: Windows on a real machine (win.rs type-checked alone), the
Docker paths of the bot's computer, the live accessibility writes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-10 11:46:17 +08:00
AnyBot Dev 7d61de83a8 Skills you can hold in your hand: skill files, install, 示範即教學 (P7+C8)
- a skill is now a .md file (front matter + instructions + an optional
  steps fence): <data>/skills/ is read at every start, files win;
  install from the CLI (anybot --install-skill <path|url>) or from the
  phone (設定 › 整合 › 技能 › 從網址安裝), delete takes the file with it
- skillify (C8): long-press your own message in the chat → 教我做 —
  the last turn that answered it becomes a replayable skill from the
  oplog: only steps that succeeded, looking steps and numbered clicks
  filtered (numbers die with their screenshot)
- a browser replay step that doesn't fit gets one fresh page read
  before the bot takes over, same courtesy the screen steps had (C8)
- three example skills in skills/, the format guide in docs/skills.md
- the prompt lines that merges had eaten: menu_click/fill_form/wait_for
  (C3), memory recall + search_documents (P6) — the tools were there,
  the model just wasn't told about them
2026-11-09 20:46:02 +08:00
AnyBot Dev bbd677b050 Memory, searched not carried: FTS index + event log (P6, step 1)
- store.rs grows a memories table + FTS5 (trigram) index: bot facts and
  the person's shared lines (bot 0), no cap — state.json's 200-item list
  stays the source that mirrors sync and the 設定 list; the index is its
  searchable superset, best-effort as always
- queries answer in Chinese: phrase hits (FTS), then words inside lines —
  CJK queries cut into two-character windows, lines scored by how many
  they contain (「有没有靠窗」 finds 「我喜歡靠窗的座位」)
- every finished turn writes one event line (ask → answer) nobody's
  asked to write: 「我上個月說的那個報表」 answers from months back
- the turn's prompt carries the 14 memories that answer *this* request
  (no index yet: the list itself, the old behavior); remember/forget and
  the UI's 忘記 keep the index in step with the list
- embedding (Ollama) and document indexing land on this same table next
2026-11-09 18:15:24 +08:00
王性驊 1202de93ad Bots work like someone who knows the computer: they know each machine, reach what they see, plan, and hand the planned steps to a quick model
Measured on the bot's own box (8 tasks x 2, grok-4.7): 14/16 done, 120 steps, 1114 s before;
16/16, 102 steps, 574 s after (model time 1015 -> 471 s). A replayed skill: 49 s -> 15 s.

Knowing the machine
- facts.rs: 電腦現況 per computer (system, desktop, systemd, sudo, network, package manager,
  tools, apps, a fixed TZ), read once by a small read-only probe, kept 30 min, in the
  instructions at the start of a turn.
- The box's sudo is the bot's: only what follows sudo is checked against the always-denied
  list (it was refused outright, while the instructions said it could sudo), and commands with
  sudo run as the box's root (setuid does nothing under gVisor).
- Box image v8 drops ENV TZ=UTC (it overrode /etc/localtime). ANYBOT_BOX_IMAGE /
  ANYBOT_BOX_VOLUME give a throwaway box its own image and volume, never adopting the real one.
- Mac shell sandbox: App Store app CLIs (they carry their own app sandbox) and ps/top run
  outside it; plain `osascript -e` too, asked the first time even in direct mode, refusing do
  shell script, terminals, keystrokes, file reads, ObjC and the secret folders. A command the
  sandbox broke says so, instead of looking like a broken program.

Reaching what it sees
- The Mac menu bar's status icons are numbered (each app's AXExtrasMenuBar, named from inside
  for the system's own), computer_use_zoom looks closer at full sharpness.
- Numbers stay with their controls from look to look (they were reassigned every look, so a
  step's second click landed elsewhere); the box's front window is listed first; a control can
  be named instead of numbered (name "4").
- Web page numbering walks open shadow DOM (Chromium settings, web components).
- A box on a Docker host elsewhere retries the next port when the usual one is taken (a retry
  without it came up with no network).

Working like a person
- Instructions: pick the route, know what done looks like, one route, check once, say what's
  stuck instead of faking it with a substitute, ask before cutting the connection.
- StepPlan: the bot's model takes the first step, the step after trouble (failed, refused,
  repeated, nothing changed on screen, the quick model switching routes), one in four, and the
  final check; a quick model (Bot.step_model, auto: grok-4.20-0309-non-reasoning on xAI) does
  the planned steps in between, falling back to the bot's model if it can't be used.
- Skills keep the steps that worked (with what each acted on, not numbers); replay_skill does
  them again with no model in between, finding each control again, handing back on a mismatch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5F5gJt93t3yEx3XcS
2026-11-09 09:01:03 +08:00
王性驊 cbada6bdb1 Bots learn from what they did; the box's browser works with the box's own disk
- A job of five or more real steps is looked back on after the answer: the short way that
  worked becomes a skill (or improves the one it followed); the reply says so. The prompt has
  the bot check its skills before starting.
- Upload, download and PDF on Bot 的電腦's browser look for and save files in the box, not on
  the brain (a picture in a Threads post took 24 steps).
- The bot's browser keeps the six tabs used last (19 Threads tabs had filled the box's 2 GB).
- Words name the control, not the box around it: a form's 「Customer name:」, 「Large」 and
  「Submit order」 used to land on the <p> holding them and do nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2RVfSYmrhqNnqx9Z4
2026-11-06 23:12:53 +08:00
王性驊 3132f8ce91 Every computer goes by its own name; a server brain works on the computer the person uses
- A bot's own computer is 「<bot> 的電腦」; this one and the account's others go by their names.
  The server brain picked 你的電腦 by sorted host id, so a desktop left on the server won.
- 「我的電腦」 is the computer the person typed on (the relay names it); unknown means ask.
- A step moved back to the chosen computer tells the bot so.
- Composer chip and bot settings choose the computer by name; a screen asks the brain.
- A screen's 電腦 card and viewer show the brain's computer, not this one's box.
- A screen's chat copy that falls short asks for everything again instead of appending;
  清除聊天記錄 on a screen clears the brain's chat.
- Model requests to a private address go through the person's computer first.
- Phone typing on the box sends the text the tool reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 16:47:28 +08:00
王性驊 d7ee3f5db9 AnyBot: first commit of the working desktop app
Rust/egui rebuild of Grok Bot as of 2026-11-04: chat with streaming
providers (xAI, OpenAI, Claude, Gemini, OpenRouter, OpenCode Go, Ollama,
custom), tools and approvals, the bot's Docker computer, computer use on
macOS / Linux X11 / Wayland, AnyBot's browser with a full DevTools-based
toolset, the encrypted vault, pinned grid and sidebar sections, Markdown
with Mermaid diagrams, phone access through the relay, and the Linux
build and test scripts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3oEtWeHh58zA7ErHa
2026-11-04 16:51:51 +08:00