From 0be9898b2aef01653c5ba12f1ac0147941e80749 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 15 Nov 2026 21:02:57 +0000 Subject: [PATCH] =?UTF-8?q?T-1263=20Cry=20Bot=EF=BC=9A=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=20wire.ts/place-view.ts=20=E9=87=8C=E4=BB=8D=E5=86=99=E3=80=8C?= =?UTF-8?q?=E7=BC=BA=E7=9C=81=E5=8D=B3=20Boat=E3=80=8D=E7=9A=84=E5=85=AC?= =?UTF-8?q?=E5=85=B1=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- .../T-1200/T-1263-boat-comments/brief.md | 21 +++++++++++++++++++ shared/place-view.ts | 5 ++--- shared/wire.ts | 6 +++--- 3 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 docs/tasks/T-1200/T-1263-boat-comments/brief.md diff --git a/docs/tasks/T-1200/T-1263-boat-comments/brief.md b/docs/tasks/T-1200/T-1263-boat-comments/brief.md new file mode 100644 index 00000000..dc9a5071 --- /dev/null +++ b/docs/tasks/T-1200/T-1263-boat-comments/brief.md @@ -0,0 +1,21 @@ +## 运行环境(云沙箱,必读) +- 开工先在 worktree 根目录运行 依赖准备脚本(镜像自带,把预装依赖链进 node_modules),之后 `pnpm exec tsc` 才可用。 +- 这里没有 systemd、Docker,`systemd-run --scope ... --` 前缀一律去掉直接运行;一次只跑一个测试文件。 +- 报告只写三样:改了什么(文件列表与 git status 一致)、为什么、测试命令与结果摘要。 +- 不提交 git。 +- 本仓库是公开仓库:代码、注释、报告里不得出现内部域名、IP、邮箱、人名、真实钥匙、沙箱主目录绝对路径。 + +# T-1263:同步公共注释里仍写「缺省即 Boat」的地方 + +## 背景 +T-1252 把机器人云电脑后端的缺省值改成了 (以 T-1252 合并后的 main 为准)。T-1252 第 4 轮审核指出,公共类型注释还写着缺省是 Boat,和实际行为不符。 + +## 要改的(只改注释,不改任何代码行为) +1. 先确认当前 main 上 `cloudBackend` 缺省时实际落到哪个后端:看 `server/cloud-backend.ts` 的 `cloudKindOf` / `cloudPolicyKindOf` 以及 T-1252 引入的缺省逻辑。注释按实际行为写,不要照本说明猜。 +2. `shared/wire.ts` 两处 `/** Which cloud computer backs computer: "cloud"; absent means Boat. */`(约 61 行 type CloudBackend 上方、约 326 行 cloudBackend 字段上方)改成与实际缺省一致的说法。 +3. `shared/place-view.ts` 约 86–90 行、约 332 行描述云电脑来源/提供方的注释,如仍把 Boat 说成唯一或缺省来源,改成与现状一致(现有后端:、Boat、自有服务器 VPS)。 +4. 用 `git grep -n -i "absent means boat\|defaults to boat\|default.*boat"` 在 shared/、server/、src/ 里再扫一遍同类过时注释,一并改;界面文案字符串(locales、place.view.* 文案)不在本任务范围,不改。 + +## 验收 +- 只有注释变化:`git diff` 里没有任何非注释行改动。 +- `pnpm exec tsc -p .`(或仓库现有的类型检查命令)通过。 diff --git a/shared/place-view.ts b/shared/place-view.ts index 4a08bd41..f797df19 100644 --- a/shared/place-view.ts +++ b/shared/place-view.ts @@ -85,11 +85,11 @@ export interface PlaceFacts { bot: string; /** Desktop only: signed in to a paid Cry Bot Cloud plan (the desktop bridge). */ plan?: boolean; - /** Where cloud computers come from here: the plan's, the person's own Boat key, or nowhere. */ + /** Cloud access: the plan's Boat computers, a personal InstaBox or Boat key, or none. */ boat: "included" | "own-key" | "none"; /** Boat desktops are unavailable in provider-locked installations. */ providerLock?: boolean; - /** The cloud computer's provider: Boat, or the person's own server. */ + /** The cloud computer's provider: InstaBox, Boat, or the person's own server (VPS). */ backend?: "box" | "vps" | "instabox"; engine: { name: string; @@ -334,7 +334,6 @@ export function placeState(facts: PlaceFacts): { state: PlaceState; params: Plac if (facts.place === "vm") { return facts.engine.computer ? { state: "vm", params: { bot } } : { state: "vm-cannot", params: { bot, model } }; } - // On the person's own server (VPS) or on Boat, one rule for both. const vps = facts.backend === "vps"; if (!facts.engine.computer) return { state: "cc-cannot", params: { bot, model } }; if (!facts.toolsAllowComputer) return { state: "cc-tools-off", params: { bot } }; diff --git a/shared/wire.ts b/shared/wire.ts index b73ea304..670aac53 100644 --- a/shared/wire.ts +++ b/shared/wire.ts @@ -58,10 +58,10 @@ export interface ModelSelection { variant?: string; } -/** Which cloud computer backs computer: "cloud"; absent means Boat. */ +/** Which cloud computer backs computer: "cloud"; absent means InstaBox. Team computers use Boat. */ export type CloudBackend = "box" | "vps" | "instabox"; -/** A place a bot can act. `cloud` covers both cloud backends. */ +/** A place a bot can act. `cloud` covers InstaBox, Boat, and self-hosted VPS computers. */ export type Surface = "cloud" | "vm" | "local" | "browser"; export const BOT_COLOR_NAMES = [ @@ -323,7 +323,7 @@ export interface WireBot extends DefaultBotFields, BotAccessFields { modelSelection: ModelSelection; /** where the bot works ("Works on"). Unset = auto. */ computer?: Surface | "off"; - /** Which cloud computer backs computer: "cloud"; absent means Boat. */ + /** Which cloud computer backs computer: "cloud"; absent means InstaBox. Team computers use Boat. */ cloudBackend?: CloudBackend; /** Auto mode may prepare/start this bot's managed VPS container. */ autoStartVps?: boolean;