docs: 功能地圖的長度改看 Bot 讀到的——Bot 那一份 6,000、整份 9,000;例行任務的桌面截圖只寫示範資料看得到的

使用者同意:anybot_guide 給 Bot 的是去掉前提、步驟、自動測試和(驗證)陷阱的那一份,6,000 字的上限
改看那一份;整份檔(含驗證步驟)放到 9,000 字。README 的規定和怎麼維護跟著改。

審查(2063934)的 P1:routines 第二張桌面截圖是示範資料,示範的例行任務沒有暫停原因、完成條件、執行紀錄,
看到改成只寫畫面上真的有的,三樣靠前面的步驟和 cargo test routines::。順手:
- routines 詳細資訊「有三條」補上 wait-api 檢查;
- cards 的 ⋯ 捲回頂端、computers 沒有 Docker 時「離線」但照樣能用:使用者會碰到的事,拿掉(驗證)讓 Bot 看得到;
- verify-anybot 的 ctl procs 照實寫看不到 /bin、/usr/bin 系統程式;
- Bot 讀到的那一份也不能有「假模型」。

已驗證: featuremap:: 11 通過;全部 cargo test(不帶金鑰、DOCKER_HOST 指到不存在)668 通過;clippy -D warnings 乾淨;
  lint-sh;routines 照 md 原文冷跑全過(target/verify-anybot/20261118-164438)
未驗證: 桌面截圖(desktop-shot)沒跑——要使用者同意開視窗

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
王性驊 2026-11-18 16:46:00 +08:00
parent 2063934228
commit 4c6f0a07e2
6 changed files with 14 additions and 10 deletions

View File

@ -107,7 +107,7 @@ $CTL api GET '/api/state?since=0' --jq '.bots[0].goal' # --jq:只印這個
$CTL wait-api '/api/state?since=0' '.approvals == []' 60 # 一直 GET,等 jq 條件成立(非同步的事:目標一輪輪跑、卡片出現…);時間到結束碼 1 $CTL wait-api '/api/state?since=0' '.approvals == []' 60 # 一直 GET,等 jq 條件成立(非同步的事:目標一輪輪跑、卡片出現…);時間到結束碼 1
$CTL botfile hello.txt # Bot 的電腦(scratch 裡 ~/AnyBot 工作區/bot-1)上的檔案;--absent 要不存在、--bot N 換 Bot $CTL botfile hello.txt # Bot 的電腦(scratch 裡 ~/AnyBot 工作區/bot-1)上的檔案;--absent 要不存在、--bot N 換 Bot
$CTL datafile hooks/hooks.json # scratch 資料夾(ANYBOT_DATA_DIR)裡的檔案;金鑰、保險庫不給讀 $CTL datafile hooks/hooks.json # scratch 資料夾(ANYBOT_DATA_DIR)裡的檔案;金鑰、保險庫不給讀
$CTL procs --none process.env.MCP_JS # 這次 scratch 開的程式(環境帶著 scratch 的 HOME,留下的孤兒也算);--none:一個都不准有 $CTL procs --none process.env.MCP_JS # 這次 scratch 開的程式(環境帶著 scratch 的 HOME,留下的孤兒也算——但 macOS 的 ps 印不出 /bin、/usr/bin 系統程式的環境,sh、sleep、curl 這類看不到);--none:一個都不准有
``` ```
每次呼叫的請求、狀態碼、回應(密碼、token 遮掉)存在 `api/NN-方法-路徑.txt`。狀態碼 ≥ 400 時結束碼是 1,除非用 `--expect`。 每次呼叫的請求、狀態碼、回應(密碼、token 遮掉)存在 `api/NN-方法-路徑.txt`。狀態碼 ≥ 400 時結束碼是 1,除非用 `--expect`。

View File

@ -58,12 +58,12 @@ $CTL down # 每次結束都跑,失敗的嘗試也是;它印出的 leftov
Bot 讀得到的是開頭、子功能、使用者怎麼到、Bot 那一行和沒標(驗證)的陷阱:這幾處只寫 AnyBot 本身的行為,不寫 scratch、假模型、`$CTL`、`[[call]]` 這類驗證的事(`cargo test featuremap::` 會擋)。 Bot 讀得到的是開頭、子功能、使用者怎麼到、Bot 那一行和沒標(驗證)的陷阱:這幾處只寫 AnyBot 本身的行為,不寫 scratch、假模型、`$CTL`、`[[call]]` 這類驗證的事(`cargo test featuremap::` 會擋)。
範例:[goal](goal.md)。整份不超過 6,000 字:太長先把句子寫短、把同一個畫面上的檢查併成一步(不刪事實);還是太長就拆成兩區(`AREAS`、下面的索引、互相的連結一起改)。地圖只寫使用者的路、穩定的把手、要的狀態、指令和看得到的證明,不寫程式內部。 範例:[goal](goal.md)。Bot 讀到的那一份(去掉前提、步驟、自動測試和(驗證)陷阱之後)不超過 6,000 字,整份檔不超過 9,000 字:太長先把句子寫短、把同一個畫面上的檢查併成一步(不刪事實);還是太長就拆成兩區(`AREAS`、下面的索引、互相的連結一起改)。地圖只寫使用者的路、穩定的把手、要的狀態、指令和看得到的證明,不寫程式內部。
## 怎麼維護 ## 怎麼維護
- 這份地圖和程式碼放在一起,當程式碼維護:行為改了,同一個 commit 改對應的那一份,連同它的步驟和看到的結果。 - 這份地圖和程式碼放在一起,當程式碼維護:行為改了,同一個 commit 改對應的那一份,連同它的步驟和看到的結果。
- `cargo test featuremap::` 會擋:Bot 能拿到的每個工具、`browser` 和 `computer` 的每個動作、設定視窗的每個分頁和區塊、Bot 能改的設定,都要寫進地圖;每一份照上面的規定(四段、Bot 那一行、前提、步驟、自動測試、代號不重複),而且不超過 6,000 字。 - `cargo test featuremap::` 會擋:Bot 能拿到的每個工具、`browser` 和 `computer` 的每個動作、設定視窗的每個分頁和區塊、Bot 能改的設定,都要寫進地圖;每一份照上面的規定(四段、Bot 那一行、前提、步驟、自動測試、代號不重複),而且 Bot 讀到的不超過 6,000 字、整份不超過 9,000 字。
- 用 pstack 的 `/pstack:maintain-verification-skill` 整理時,要先告訴它:功能地圖在 `docs/feature-map/`(不在 skill 資料夾裡的 `features/`),harness 是 `.claude/skills/verify-anybot/`,格式照這一份的「每份檔的規定」(中文,四段的名字不換)。 - 用 pstack 的 `/pstack:maintain-verification-skill` 整理時,要先告訴它:功能地圖在 `docs/feature-map/`(不在 skill 資料夾裡的 `features/`),harness 是 `.claude/skills/verify-anybot/`,格式照這一份的「每份檔的規定」(中文,四段的名字不換)。
- Bot 在用的時候發現地圖不對或少寫,記成「待改進」([garden](garden.md)),由改 AnyBot 的人補。 - Bot 在用的時候發現地圖不對或少寫,記成「待改進」([garden](garden.md)),由改 AnyBot 的人補。

View File

@ -39,5 +39,6 @@ Bot 在聊天裡放的東西:要你決定或補資料時的問題卡,查到
- `react` 按在使用者最近一則自己寫的訊息上;例行任務、別的 Bot 叫醒的訊息不算。 - `react` 按在使用者最近一則自己寫的訊息上;例行任務、別的 Bot 叫醒的訊息不算。
- `look_image` 要帳號裡有看得懂圖的模型。對話太長時 AnyBot 會先把圖片拿掉(「對話太長了,先拿掉 N 張截圖再試一次…」),拿掉的看不回來,要重新截圖或請使用者再傳。 - `look_image` 要帳號裡有看得懂圖的模型。對話太長時 AnyBot 會先把圖片拿掉(「對話太長了,先拿掉 N 張截圖再試一次…」),拿掉的看不回來,要重新截圖或請使用者再傳。
- 生活卡片的 link 要是 http 或 https 開頭才會顯示。 - 生活卡片的 link 要是 http 或 https 開頭才會顯示。
- (驗證)手機上,打開聊天之後才來的回答按 ⋯,聊天會捲回最上面(`#scroller` 的 scrollTop 變 0,是手機頁面的毛病):表情那張截圖拍到的是頂端。 - 手機上,打開聊天之後才來的回答按 ⋯,聊天會捲回最上面(手機頁面的毛病;重新打開聊天就不會)。
- (驗證)所以表情那張截圖拍到的是頂端(`#scroller` 的 scrollTop 變 0)。
- (驗證)卡片和選單會滑進來:等 `wait`/`wait-text` 看到再按;`.meta:has([data-regen])` 是最後一個回答的那排按鈕。 - (驗證)卡片和選單會滑進來:等 `wait`/`wait-text` 看到再按;`.meta:has([data-regen])` 是最後一個回答的那排按鈕。

View File

@ -48,5 +48,5 @@
- 螢幕電腦的 AnyBot 比大腦舊時,在它上面按允許卡片都不算(舊版說不出是哪一張卡),大腦的聊天寫「螢幕電腦上的回答沒有用上…」:在那台 設定 › 更新 換新版,或在大腦、手機上答。 - 螢幕電腦的 AnyBot 比大腦舊時,在它上面按允許卡片都不算(舊版說不出是哪一張卡),大腦的聊天寫「螢幕電腦上的回答沒有用上…」:在那台 設定 › 更新 換新版,或在大腦、手機上答。
- 帳號裡的其他電腦:看畫面、操作畫面各自要使用者允許(可以一律允許);改檔案和指令照 SSH 電腦的規則問。 - 帳號裡的其他電腦:看畫面、操作畫面各自要使用者允許(可以一律允許);改檔案和指令照 SSH 電腦的規則問。
- `send_to_device`:工作資料夾外的檔案先問,機密檔案不傳;從使用者的其他電腦拿檔案最多 20 MB。沒登入帳號就找不到其他裝置。 - `send_to_device`:工作資料夾外的檔案先問,機密檔案不傳;從使用者的其他電腦拿檔案最多 20 MB。沒登入帳號就找不到其他裝置。
- (驗證)沒有 Docker 時 Bot 自己的電腦在手機上是「離線」,首頁「電腦 0/1」;它照樣能用(封閉資料夾、沙盒裡跑指令)。 - 沒有 Docker 時,Bot 自己的電腦在手機上是「離線」、首頁「電腦 0/1」;它照樣能用(封閉資料夾、沙盒裡跑指令)。
- (驗證)「傳送到其他裝置」的「驗證用 AnyBot」就是 scratch 的大腦:真的傳過去,會在跑驗證的這台 Mac 跳系統通知,只打開不送。 - (驗證)「傳送到其他裝置」的「驗證用 AnyBot」就是 scratch 的大腦:真的傳過去,會在跑驗證的這台 Mac 跳系統通知,只打開不送。

View File

@ -29,9 +29,9 @@ Bot 照排程(每天、每週、每月、只一次)或某件事發生時(P
- **建三條**(covers `routines-schedule`、`routines-target`):首頁「例行任務」›「新增例行任務」建一條每天的;建一個 Bot「同事」,在 Bot 1 的聊天請它建兩條要送 1 則的。指令:`$CTL phone click '[data-q="routines"]' && $CTL phone click '#rt-new' && $CTL phone type '#rt-title' 早報 && $CTL phone type '#rt-prompt' 整理重點 && $CTL phone click '#rt-ok' && $CTL phone wait-text '每天 09:00' --in '#list' && $CTL phone open --listed && $CTL phone click '#b-newbot' && $CTL phone click '#sheet-in .opt' --text '建立 Bot' && $CTL phone type '#ask-in' 同事 && $CTL phone click '#ask-ok' && $CTL phone wait-text 同事 --in '#isl-name' && $CTL phone open --listed && $CTL phone click '.row[data-bot="1"]' && $CTL phone send '[[call create_routine {"title":"回覆","prompt":"回一則","schedule":{"frequency":"weekly","daysOfWeek":["MO","WE"],"time":"10:00"},"target_sends":1}]]' && $CTL phone wait-text '已建立例行任務 #2' --in '#msgs' && $CTL phone send '[[call create_routine {"title":"打招呼","prompt":"跟同事說早安","schedule":{"frequency":"monthly","monthDay":1,"time":"08:00"},"target_sends":1}]]' && $CTL phone wait-text '已建立例行任務 #3' --in '#msgs' && $CTL api GET /api/bots/1/detail --jq '[.routines[] | "\(.title) \(.repeat) \(.when) \(.target)"]'`。看到:「每天 09:00 · 下次 …」;「已建立例行任務 #2 「回覆」:每週…」;三條的排程,後兩條「完成條件:送出 1 則」。 - **建三條**(covers `routines-schedule`、`routines-target`):首頁「例行任務」›「新增例行任務」建一條每天的;建一個 Bot「同事」,在 Bot 1 的聊天請它建兩條要送 1 則的。指令:`$CTL phone click '[data-q="routines"]' && $CTL phone click '#rt-new' && $CTL phone type '#rt-title' 早報 && $CTL phone type '#rt-prompt' 整理重點 && $CTL phone click '#rt-ok' && $CTL phone wait-text '每天 09:00' --in '#list' && $CTL phone open --listed && $CTL phone click '#b-newbot' && $CTL phone click '#sheet-in .opt' --text '建立 Bot' && $CTL phone type '#ask-in' 同事 && $CTL phone click '#ask-ok' && $CTL phone wait-text 同事 --in '#isl-name' && $CTL phone open --listed && $CTL phone click '.row[data-bot="1"]' && $CTL phone send '[[call create_routine {"title":"回覆","prompt":"回一則","schedule":{"frequency":"weekly","daysOfWeek":["MO","WE"],"time":"10:00"},"target_sends":1}]]' && $CTL phone wait-text '已建立例行任務 #2' --in '#msgs' && $CTL phone send '[[call create_routine {"title":"打招呼","prompt":"跟同事說早安","schedule":{"frequency":"monthly","monthDay":1,"time":"08:00"},"target_sends":1}]]' && $CTL phone wait-text '已建立例行任務 #3' --in '#msgs' && $CTL api GET /api/bots/1/detail --jq '[.routines[] | "\(.title) \(.repeat) \(.when) \(.target)"]'`。看到:「每天 09:00 · 下次 …」;「已建立例行任務 #2 「回覆」:每週…」;三條的排程,後兩條「完成條件:送出 1 則」。
- **立即執行、紀錄**(covers `routines-now`、`routines-runs`、`routines-fresh`):點「早報」›「立即執行」,重新整理再點開。指令:`$CTL phone open --listed && $CTL phone click '[data-q="routines"]' && $CTL phone click '[data-rt="1:1"]' && $CTL phone click '#sheet-in .opt' --text 立即執行 && $CTL wait-api /api/bots/1/detail '.routines[0].runs[0].line | test("完成")' && $CTL phone open --listed && $CTL phone click '[data-q="routines"]' && $CTL phone click '[data-rt="1:1"]' && $CTL phone wait-text 最近執行 --in '#sheet-in' && $CTL phone shot routines-run && $CTL api GET /api/bots/1 --jq '[.messages[] | select(.wake) | .text]'`。看到:Bot 1 收到「[例行任務]「早報」時間到了:整理重點」;「最近執行」一行「…完成:FAKE-MODEL 回答:…」、「上次 今天 …」。 - **立即執行、紀錄**(covers `routines-now`、`routines-runs`、`routines-fresh`):點「早報」›「立即執行」,重新整理再點開。指令:`$CTL phone open --listed && $CTL phone click '[data-q="routines"]' && $CTL phone click '[data-rt="1:1"]' && $CTL phone click '#sheet-in .opt' --text 立即執行 && $CTL wait-api /api/bots/1/detail '.routines[0].runs[0].line | test("完成")' && $CTL phone open --listed && $CTL phone click '[data-q="routines"]' && $CTL phone click '[data-rt="1:1"]' && $CTL phone wait-text 最近執行 --in '#sheet-in' && $CTL phone shot routines-run && $CTL api GET /api/bots/1 --jq '[.messages[] | select(.wake) | .text]'`。看到:Bot 1 收到「[例行任務]「早報」時間到了:整理重點」;「最近執行」一行「…完成:FAKE-MODEL 回答:…」、「上次 今天 …」。
- **不到數算失敗、兩次就暫停、繼續**(covers `routines-target`、`routines-pause`、`routines-carry`、`routines-runs`):「回覆」立即執行兩次,再按「繼續」。指令:`$CTL phone click '[data-back]' && $CTL api POST /api/act/app '{"name":"run_routine_now","args":{"id":2},"bot":1}' && $CTL wait-api /api/bots/1/detail '.routines[1].runs[0].bad' && $CTL api POST /api/act/app '{"name":"run_routine_now","args":{"id":2},"bot":1}' && $CTL wait-api /api/bots/1/detail '.routines[1].paused' && $CTL phone open --listed && $CTL phone click '.row[data-bot="1"]' && $CTL phone wait-text '連續 2 次失敗,AnyBot 先暫停了' --in '#msgs' && $CTL phone click '#island' && $CTL phone click '[data-tab="routines"]' && $CTL phone wait-text 打招呼 --in '#details' && $CTL api GET /api/bots/1 --jq '[.messages[] | select(.wake) | .text][-1]' && $CTL phone open --listed && $CTL phone click '[data-q="routines"]' && $CTL phone click '[data-rt="1:2"]' && $CTL phone wait-text '只送出 0/1 則(系統計數)' --in '#sheet-in' && $CTL phone click '#sheet-in .opt' --text 繼續 && $CTL wait-api /api/bots/1/detail '.routines[1] | (.paused | not) and .paused_why == ""'`。看到:兩次都是「失敗:只送出 0/1 則(系統計數):…」;第二次的任務訊息多「(上一次執行沒有成功:只送出 0/1 則…)」;聊天「例行任務「回覆」連續 2 次失敗,AnyBot 先暫停了。…按繼續。」;詳細資訊的「例行任務」有三條;按繼續後不再暫停、原因清掉。 - **不到數算失敗、兩次就暫停、繼續**(covers `routines-target`、`routines-pause`、`routines-carry`、`routines-runs`):「回覆」立即執行兩次,再按「繼續」。指令:`$CTL phone click '[data-back]' && $CTL api POST /api/act/app '{"name":"run_routine_now","args":{"id":2},"bot":1}' && $CTL wait-api /api/bots/1/detail '.routines[1].runs[0].bad' && $CTL api POST /api/act/app '{"name":"run_routine_now","args":{"id":2},"bot":1}' && $CTL wait-api /api/bots/1/detail '.routines[1].paused' && $CTL phone open --listed && $CTL phone click '.row[data-bot="1"]' && $CTL phone wait-text '連續 2 次失敗,AnyBot 先暫停了' --in '#msgs' && $CTL phone click '#island' && $CTL phone click '[data-tab="routines"]' && $CTL phone wait-text 打招呼 --in '#details' && $CTL wait-api /api/bots/1/detail '.routines | length == 3' && $CTL api GET /api/bots/1 --jq '[.messages[] | select(.wake) | .text][-1]' && $CTL phone open --listed && $CTL phone click '[data-q="routines"]' && $CTL phone click '[data-rt="1:2"]' && $CTL phone wait-text '只送出 0/1 則(系統計數)' --in '#sheet-in' && $CTL phone click '#sheet-in .opt' --text 繼續 && $CTL wait-api /api/bots/1/detail '.routines[1] | (.paused | not) and .paused_why == ""'`。看到:兩次都是「失敗:只送出 0/1 則(系統計數):…」;第二次的任務訊息多「(上一次執行沒有成功:只送出 0/1 則…)」;聊天「例行任務「回覆」連續 2 次失敗,AnyBot 先暫停了。…按繼續。」;詳細資訊的「例行任務」有三條;按繼續後不再暫停、原因清掉。
- **送到了、送出證據**(covers `routines-target`、`routines-runs`):「打招呼」立即執行,它傳訊息給同事。指令:`$CTL model-reply '「打招呼」時間到了' '[[call message_bot {"bot":"同事","text":"早安"}]] 送了' && $CTL api POST /api/act/app '{"name":"run_routine_now","args":{"id":3},"bot":1}' && $CTL wait-api /api/bots/1/detail '.routines[2].runs[0].line | test("完成")' && $CTL api GET /api/bots/1/detail --jq '.routines[2].runs[0]' && $CTL api GET /api/bots/2 --jq '[.messages[].text]'`。看到:「完成(1 步,系統記到送出 1 次):送了」,送出證據一行(message_bot…);同事收到「[來自 Bot]「驗證小幫手」:早安」。 - **送到了、送出證據**(covers `routines-target`、`routines-runs`):「打招呼」立即執行,它傳訊息給同事。指令:`$CTL model-reply '「打招呼」時間到了' '[[call message_bot {"bot":"同事","text":"早安"}]] 送了' && $CTL api POST /api/act/app '{"name":"run_routine_now","args":{"id":3},"bot":1}' && $CTL wait-api /api/bots/1/detail '.routines[2].runs[0].line | test("完成")' && $CTL api GET /api/bots/1/detail --jq '.routines[2].runs[0]' && $CTL api GET /api/bots/2 --jq '[.messages[].text]'`。看到:「完成(1 步,系統記到送出 1 次):送了」,送出證據一行(message_bot…);同事收到「[來自 Bot]「驗證小幫手」:早安」。
- **桌面的例行任務視窗**(covers `routines-runs`、`routines-now`):指令:要開視窗——`$CTL stop && ABV_ALLOW_WINDOW=1 $CTL desktop-shot routines ANYBOT_SHOT_REAL=1 ANYBOT_SHOT_VIEW=panel && ABV_ALLOW_WINDOW=1 $CTL desktop-shot routines-demo ANYBOT_SHOT_VIEW=routines`(第二張是示範資料:真資料的截圖開不了例行任務視窗)。看到:右側面板「例行任務」列出這次建的;示範視窗的卡片有暫停原因、完成條件、「執行紀錄」。 - **桌面的例行任務視窗**(covers `routines-runs`、`routines-now`):指令:要開視窗——`$CTL stop && ABV_ALLOW_WINDOW=1 $CTL desktop-shot routines ANYBOT_SHOT_REAL=1 ANYBOT_SHOT_VIEW=panel && ABV_ALLOW_WINDOW=1 $CTL desktop-shot routines-demo ANYBOT_SHOT_VIEW=routines`(第二張是示範資料:真資料的截圖開不了例行任務視窗)。看到:右側面板「例行任務」列出這次建的(標題、時間或「已暫停」);示範視窗只有一張「AI 新聞早報」卡——示範資料沒有暫停原因、完成條件、執行紀錄,這三樣靠上面的步驟和 `cargo test routines::`。
- **事件觸發**(covers `routines-trigger`):指令:走不到——GitHub、Slack…要真的帳號;webhook 聽在 127.0.0.1:8792 起,ctl 沒有打它的指令(使用者真的 AnyBot 也可能在 8792)。看到:最接近的真路是 `create_routine` 帶 trigger 建得起來、沒有「下次執行時間」,和自動測試。 - **事件觸發**(covers `routines-trigger`):指令:走不到——GitHub、Slack…要真的帳號;webhook 聽在 127.0.0.1:8792 起,ctl 沒有打它的指令(使用者真的 AnyBot 也可能在 8792)。看到:最接近的真路是 `create_routine` 帶 trigger 建得起來、沒有「下次執行時間」,和自動測試。
- 自動測試:`cargo test routines::`、`cargo test appctl::`、`cargo test a_routines_runs_are_kept_and_two_failures_pause_it`、`cargo test a_routine_run_starts_fresh_for_the_model`、`cargo test triggers::`、`cargo test garden::`。 - 自動測試:`cargo test routines::`、`cargo test appctl::`、`cargo test a_routines_runs_are_kept_and_two_failures_pause_it`、`cargo test a_routine_run_starts_fresh_for_the_model`、`cargo test triggers::`、`cargo test garden::`。

View File

@ -223,8 +223,11 @@ mod tests {
assert!(a.text.contains("- Bot:"), "{}.md: 怎麼操作 needs a 「- Bot:」 line (what a bot inside AnyBot uses)", a.slug); assert!(a.text.contains("- Bot:"), "{}.md: 怎麼操作 needs a 「- Bot:」 line (what a bot inside AnyBot uses)", a.slug);
assert!(a.text.starts_with(&format!("# {}", a.title)), "{}.md should start with 「# {}」", a.slug, a.title); assert!(a.text.starts_with(&format!("# {}", a.title)), "{}.md should start with 「# {}」", a.slug, a.title);
assert!(INDEX.contains(&format!("({}.md)", a.slug)), "README.md doesn't list {}.md", a.slug); assert!(INDEX.contains(&format!("({}.md)", a.slug)), "README.md doesn't list {}.md", a.slug);
// Short enough to read in one go (her rule: behaviour-level, no source needed). // What a bot reads is short enough to take in one go (her rule: behaviour-level, no
assert!(a.text.chars().count() < 6000, "{}.md is too long ({} chars): tighten it (README 「每份檔的規定」)", a.slug, a.text.chars().count()); // source needed); the whole file, recipe included, stays readable too.
let bot = bot_view(a.text).chars().count();
assert!(bot < 6000, "{}.md: what a bot reads is too long ({bot} chars): tighten it or split the area (README 「每份檔的規定」)", a.slug);
assert!(a.text.chars().count() < 9000, "{}.md is too long ({} chars): tighten it or split the area (README 「每份檔的規定」)", a.slug, a.text.chars().count());
} }
} }
@ -403,7 +406,7 @@ mod tests {
} }
// Harness-only words stay out of the parts a bot reads (子功能, 使用者怎麼到, the Bot line, // Harness-only words stay out of the parts a bot reads (子功能, 使用者怎麼到, the Bot line,
// the traps): mark a verification-only trap 「(驗證)」, keep the rest in 前提 or a step. // the traps): mark a verification-only trap 「(驗證)」, keep the rest in 前提 or a step.
for harness in ["$CTL", "前提:", "指令:", "看到:", "自動測試", "(驗證)", "model-reply", "[[call", "scratch", "verify-anybot"] { for harness in ["$CTL", "前提:", "指令:", "看到:", "自動測試", "(驗證)", "model-reply", "[[call", "scratch", "verify-anybot", "假模型"] {
assert!(!v.contains(harness), "what a bot reads of {}.md has 「{harness}」 — a verification detail, not AnyBot:\n{}", a.slug, v.lines().find(|l| l.contains(harness)).unwrap_or("")); assert!(!v.contains(harness), "what a bot reads of {}.md has 「{harness}」 — a verification detail, not AnyBot:\n{}", a.slug, v.lines().find(|l| l.contains(harness)).unwrap_or(""));
} }
// Every sub-feature and every trap but the verification ones are still there. // Every sub-feature and every trap but the verification ones are still there.