Skip to content

[#3110] 已落地聊天壳、设置、搜索与历史命中的收口 #3114

Open

Description

@Birfy

范围

收口已经在隔离树实现、并由 #3112 提交审查的聊天与设置能力,并补上该切片仍缺的部分。本包不重复实现 PR 里已有的代码,也不把 PR 合并写成 #3110 完成。

已在 #3112 范围、需跟审查/合入的包括:外观与发送快捷键、消息折叠/文档卡、记忆目录与搜索、建群弹层、会话筛选与手动未读、消息菜单、本地 Bot 历史搜索与只读命中、社交冻结分享人话、grant_request 中文、#1751 日报去重回填、定时任务时区。测试记录:core 3367/3367、social 721/721、project 148/148;无浏览器点击验收。旧 flybot-preview 截图是手写 HTML mockup。

任务

依赖

与「管理面 + 容器生命周期」可并行。群/远程检索的数据路径在管理面接口就绪后要对齐权限。不阻塞 #3112 继续 review。

验收

关联


父 issue:#3110
产品定位:开源版 Teamily,完整功能对等;品牌保持 FlyBot。阶段性 PR 可合并,但不得关闭 #3110。
安全边界:不依赖 Teamily 私有服务;不复制专有代码/商标/资产;密钥与会话令牌不得写入仓库或日志;多用户/多工作区必须权限隔离;不绕过平台防火墙或把实例端口暴露到公网。
仓库:优先在 ThinkFlowLab/FlyBot 扩展(可跨 bot-social 改动时在本 issue 说明并另提 Birfy/bot-social 的关联 PR)。不另建仓库,不使用 Cloud Coding Sessions。

Activity

  1. Birfy commented on Nov 16, 2026

    @Birfy
    CollaboratorAuthor

    查重(读取时间 2026-11-16T08:09:16Z,全仓 75 张开放 issue 对照标题与正文,含本批 11 张互比):

    标签:area:ui + area:automation + enhancement。理由:area:ui(聊天壳、设置、会话列表/消息菜单/搜索弹层的界面收口是主战场)+ area:automation(历史检索扩展、资源预算与分页 API 属服务端能力)。

    边界:本包收口已落地的聊天壳、设置、搜索与 #3112 的合入,不重做 #3112 的代码;记忆图谱与画像是 #3118,群与工作区相关的数据路径等 #3117 权限模型就绪后再对齐。

    本轮只加 area 与 enhancement,未打 agent-ready、hold、risk:T*:开工顺序由 owner 定,风险等级由 controller 按 diff 算。

    Written-by: Triage

  2. added
    needs-humanThe agent loop stopped; a person must decide (reason in the last comment)
    on Nov 16, 2026
  3. Birfy commented on Nov 16, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage

    状态判定:needs-human(本批 #3113–#3123 的开工顺序等 owner 定,本单不进 agent-ready)。判据是 AGENTS.md 第 138–146 行的第 2、3 条;第 1 条已由 #3110 的服务端架构结论覆盖。

    缺什么:正文只到功能/页面级范围,还没有「要改哪些文件 + 一条可执行验收命令」的切片粒度;这 11 包的启动顺序与第一刀也还没定。
    谁能给:owner(#3110 的排期人)—— 定顺序、把第一刀切成文件级范围加验收命令;定下后把该切片写成独立小单即可转 agent-ready。

    相邻边界:与 #3118(图谱/画像)、#3119(作品)分界:本包只收口目录、搜索、总览与 #3112 的合入,不重写 #3112 的代码;定时任务的表单层在本包,#3116 管引擎真执行。

    查重与标签结论见上一条评论(2026-11-16T08:09Z,Triage 署名):全仓 75 张开放 issue 无整单重复。本评论只补状态依据,状态标签只加了 needs-human,未碰 agent-ready、hold、risk:T*。

  4. Birfy commented on Nov 18, 2026

    @Birfy
    CollaboratorAuthor

    第一刀切片(Chief 定的 B 方向:不救 #3112,按包切)

    Written-by: Chief(2026-11-18T08:14Z 读,main a306e3c)

    本包先切会话筛选(全部/群聊/单聊/未读)。依据:main a306e3c362 上手动未读已经落地(core/src/client/sidebar.js L24–L30(注释 L24、函数 L25–L30)useMarkedUnread、L347 markedUnread = useUi(value => value.unread)),但完全没有筛选——列表只有「全部」。所以这一刀是新增能力,不是重做 #3112。

    选中的文件(11 个:手写 5,generate/build 产物 6;手写 +131/−5,生成产物 +608/−186)

    行数口径(08:44Z scratch 复算,不入库、不开分支):11 个文件合起来 git diff --stat 是 +739/−191 = 930,其中 608 行是机械重算的 client.js、patches/ds-bot/*.patch(嵌套 diff 会膨胀)和 files/ 镜像。600 行上限按「作者手写」算才有意义(131 行 ≤600);要按全量 stat 算,请 owner 先定这条口径。

    手写:

    • core/src/shared/session-list-filter.js — 新增(照取 Add staged Teamily-style chat tools and owner-scoped history search #3112 整文件,+36):SESSION_FILTERS = ['all','group','direct','unread']、sessionStatusOf(map,id)、sessionIsUnread(entry,statusMap,markedUnread)、matchesSessionFilter(entry,filter,unread)。纯函数,无 React、无 DOM、无 host 调用。
    • core/test/session-list-filter.test.js — 新增(照取 Add staged Teamily-style chat tools and owner-scoped history search #3112 整文件,+50),4 个 test()。
    • core/src/client/sidebar.js — 加筛选条与筛选后的可见列表。main 行号锚点:
      • L341–L343:TreeNode 的收尾 } 与 export function TeamSidebar 之间,插入 SessionFilter 组件(radiogroup,4 个 bt-session-filter-btn)。
      • L381–L388:structure = useSidebarStructure() 到 const tree = ...,tree 只在 sessionFilter === 'all' || 'direct' 时构建(showTree)。
      • L354–L366:order 的 useMemo 不动;在其后新增 unreadIds 的 useMemo 与 visibleOrder = order.filter(... matchesSessionFilter ...)。
      • L389:useListGlide(listRef, wide, order.map(...)) 改用 [showMain ? main.id : null, ...visibleOrder.map(...)]。
      • L414–L423:ProjectsNav 之后(L414)插入筛选条;L418–L422(order.filter(...).map(...))换成 visibleOrder.map(...),L417 的 Main Bot 行不动;L423 的 FlyBotSections 加 sessionFilter === 'all' 前置;列表末尾补筛选空态占位(本刀留空,见「不做的」)。
      • L744–L756:export const SIDEBAR_CSS 内插 4 条 .bt-session-filter / .bt-session-filter-btn / [aria-checked=true] / .bt-session-filter-empty 规则。
      • 不动 BotRow(L46–L113) / RoomRow(L151) / AgentRow(L243) 内各自的未读表达式——行自己的 marked && !active 保持原样,本刀只加「按筛选隐藏行」。
    • core/src/client/i18n.js — ZH 表补 3 个键(main 锚点 L648–L651,// Settings dialog 那一簇):'Session filter'、'Direct chats'、'Unread'。All(L252)与 'Group chats'(L651)已在,不重加。
    • changelog.d/teamily-group-and-session-filter.added.md — 新增一行片段(用户可见改动,AGENTS.md 第 29 行要求)。

    生成(node scripts/ds-bot-patches.mjs generate + node core/scripts/build-client.mjs):

    • core/client.js
    • patches/ds-bot/files/src/shared/session-list-filter.js
    • patches/ds-bot/files/test/session-list-filter.test.js
    • patches/ds-bot/0003-flybot-api-client.patch(src/client/sidebar.js 归这条线,topics.json 已列,无需改)
    • patches/ds-bot/0001-core-fixes.patch(src/client/i18n.js 归这条线)
    • patches/ds-bot/0008-client-bundle.patch(client.js 归这条线)

    patches/ds-bot/topics.json 不用动:三个上游已有的文件都已在各自 topic 里,两个新文件走 files/、按惯例不进 topic。

    红先测试

    • 新增 core/test/session-list-filter.test.js,4 个用例:
      1. the public filters are all, group, direct, and unread
      2. all keeps every row; group is rooms; direct is Bots and the coding agent
      3. unread keeps only rows already marked unread, and never invents a read chip(断言 SESSION_FILTERS 里没有 'read')
      4. unread follows completion, a pending bot interaction, or a manual mark(Map 与普通对象两种 statusMap,外加 sessionStatusOf(null,'chief') === undefined)
    • 先红:只提交测试、不提交 core/src/shared/session-list-filter.js,跑
      cd core && node --import ./test/harness-resolve.mjs --test test/session-list-filter.test.js
      预期 ERR_MODULE_NOT_FOUND: Cannot find module '<repo>/core/src/shared/session-list-filter.js'。
    • 再绿:补上模块后同一命令 4/4 通过。

    验收

    node core/scripts/build-client.mjs --check          # exit 0:client.js 与 src/client 一致
    cd core && node --import ./test/harness-resolve.mjs --test test/session-list-filter.test.js   # 4/4 pass
    cd .. && node scripts/ds-bot-patches.mjs check      # exit 0:pin 一致、patch 依次可应用、结果等于 core/
    node scripts/ds-bot-patches.mjs canonical           # exit 0:generate 不再改写 patches/
    npm run verify                                      # 仓库根:CI 同序(core lint + arch-docs + 插件 lint + 上面两项 + core 测试)全绿
    

    08:44Z 已在 scratch 副本按本切片复算(只读验证,不入库、不开分支):build-client --check exit 0;test/session-list-filter.test.js 4/4 pass;ds-bot-patches check ok(10 个 patch 依次可应用、结果等于 core/;pin 因副本无 git 跳过)。

    人眼一次(无浏览器点击验收也至少要这一次 DOM 断言或截图):宽栏侧栏出现「全部 / 群聊 / 单聊 / 未读」四个 chip;点「群聊」只剩房间行,点「单聊」只剩 Bot 与 DSH Agent 行,点「未读」只剩带未读点的行;aria-checked 只有当前项为 true;窄栏(bt-rail)不画这一条。

    风险档依据:只动客户端呈现层 + 一个纯函数模块 + 3 个文案键,不碰 host 权限白名单、存储、协议、gate 文件;预期 risk:T2,最终由 controller 按 diff 定。

    参照与排除

    这一刀不做的

    • 同包其余 10 条线各自单独一刀:外观与发送快捷键、消息折叠/文档卡、记忆目录与搜索、建群弹层、消息菜单、本地 Bot 历史搜索与只读命中、社交冻结分享人话、grant_request 中文、Project Assistant 09:00 digest is never scheduled if Automation tasks were off at project-create #1751 日报去重回填、定时任务时区。本刀一条都不混。
    • shouldClearManualUnread 抽取:main 的 useMarkedUnread(L24–L29)保持原样,避免为一行函数改三处调用点。
    • 筛选空态文案(No group chats / No direct chats / No unread chats,3 个额外 i18n 键):为守住 ≤600 行上限留到第二刀;本刀筛到空就是空列表。
    • 侧栏筛选的 UI 断言测试(Add staged Teamily-style chat tools and owner-scoped history search #3112 的 core/test/sidebar-session-filter.test.js,175 行):单这一个文件就吃掉预算的 29%,随第二刀一起进;本刀先用上面的单元测试 + npm run verify 兜住。
    • 历史检索的 host 侧(src/host/message-search.js、authz.js 的 search-messages/history-hit 白名单)、检索物化预算/分页 API、群/远程/Agent 历史切面的权限测试:全部属于「本地 Bot 历史搜索」那条线,不进本刀。
  5. reopened this on Nov 18, 2026
  6. Birfy commented on Nov 18, 2026

    @Birfy
    CollaboratorAuthor

    Reopened by Chief (2026-11-18T10:05Z) — the umbrella is not done.

    #3162 was written with Fixes #3114, so the merge closed this issue at 09:48:10Z. That merge landed only the first slice of the split plan in #3110: the wide-sidebar session filter (All / Group chats / Direct chats / Unread).

    State at 10:05Z:

    Rule from here: slice PRs reference this issue with Refs #3114 instead of Fixes #3114; the umbrella closes only when the last slice lands or the owner says stop.

    Written-by: Chief

  7. Birfy commented on Nov 18, 2026

    @Birfy
    CollaboratorAuthor

    第三刀切片:消息菜单(main cdd02c6)

    Written-by: Chief(2026-11-18T11:26Z 读,main cdd02c6)

    先回答「要不要换目标」:不换。 main 上消息菜单是半套,不是完整,也不是没有——回复气泡有一个 hover 工具条(表情 / 回复 / 更多→复制、下载),但右键什么都没有;用户自己的气泡只有一个复制按钮;只读窗口里 Reply 照画;复制失败完全无声。这四条里三条是用户每天摸得到的缺口,所以按原计划切消息菜单。core/src/client/context-menu.js 是侧栏行菜单(Bot / 群 / DSH Agent 会话),不是消息菜单,不复用它。

    1. 现状(main cdd02c6e8c 实读)

    • core/src/client/context-menu.js 120 行:ContextMenu 只在 menu.kind === 'agent' | 'agent-session' 之外按 roster.byId[menu.id] / roomsById[menu.id] 取 Bot 或群;菜单项是 Pin / 标未读 / Bot 设置 / 群设置 / 重命名 / 复制对话 ID / 隐藏 / 删除。没有任何消息维度。
    • core/src/client/cells.js L137–L173 MessageTools:L166 Add reaction、L167 Reply→actions.quote(sessionId,text)、L168 More message actions、L169–L170 .bt-react-strip(6 个表情)、L171–L172 .bt-menu 里只有 Copy / Download。它只在 L94 挂载:live ? null : h(MessageTools, …),即只在回复气泡、且不在流式中。
    • 右键:onContextMenu 全仓只在 sidebar.js、projects-nav.js、plugins/social|workflow/client.js;cells.js 与 user-message.js 0 处。
    • core/src/client/user-message.js L158–L164 CopyButton、L206 h('div',{className:'bt-utools'}, h(CopyButton,{text})):用户自己的消息没有 Reply、没有更多菜单。
    • 只读:MessageTools 不读 roster,所以 roster.readOnly 非空时 Reply 仍会画出来(写进 composer 是 host 会拒的写)。已有三处同一读法可照抄:context-menu.js L36 与 L91 的 locked、schedules.js L147 导出的 lockedWindow(roster)(读的都是 roster.readOnly 非空串)。
    • 复制失败无声:cells.js L155–L157 与 user-message.js L160–L162 都是 void navigator.clipboard?.writeText(text).then(…)。缺 navigator.clipboard 时可选链把整条链短路(连 .then 一起),点了没反应;写被拒时 promise 被 void 掉,也是没反应。
    • 样式:styles.js L655–L657 .bt-tools 靠 :hover / :focus-within / [data-open] 显形;L681–L690 已有 .bt-menu、.bt-menu-sep、.bt-menu-hint——本刀不用改 styles.js。
    • 文案:i18n.js 已有 Add reaction / Reply / More message actions / More / Reactions / Message actions / Copy / Download / Copied / You(L171 You,L854–L862 一簇);缺 Clipboard unavailable、Could not copy message、Could not download message。
    • 生成线:patches/ds-bot/topics.json 里 src/client/cells.js、src/client/user-message.js 在 0003;src/client/i18n.js 同时在 0001 和 0018,topicOf 取 topics 顺序第一个命中 → 0001;新文件进 patches/ds-bot/files/,topics.json 不用动。
    • 已有测试不能破:core/test/earlier-message-actions.test.js(3 例,同一套 vm harness 点 Add reaction / Reply)、core/test/exchange-read.test.js L111(点 More message actions → 点 Copy,断言剪贴板写的是清洗后的原文)。

    2. 文件级切片(12 个:手写 6,生成 6;手写 +483 / −66)

    手写:

    1. core/src/client/message-tools.js — 新增 +155。把 cells.js 的 MessageTools / useDismiss / 反应表搬出来,并加三样 main 没有的:isLockedRoster、messageActionIds(只返回 reply / copy / download / react 这几个客户端真能跑的 id)、onMessageContextMenu(右键落到光标处,链接/输入框/已开菜单不抢)。复制失败给 role="status" 一句;菜单支持 ↓/↑/Home/End 焦点移动。
    2. core/src/client/cells.js — +9/−56。删本地 useDismiss(L122–L135)、MessageTools(L137–L173)、REACTIONS(L104)与随之不用的 createPortal 和 5 个图标导入(L1–L9);改从新模块引入。L83–L97:.bt-msg 行加 onContextMenu(live 时不挂),L81 加 contextAt state,L94 传 roster 与 contextAt。
    3. core/src/client/user-message.js — +7/−10。删 CopyButton(L158–L164);L206 换成同一个 MessageTools(className:'bt-utools',name = 对方名字 / You);根 div 加 onContextMenu(空文本不挂);CSS L231 的显形规则补 .bt-utools[data-open]。
    4. core/src/client/i18n.js — +3:Clipboard unavailable / Could not copy message / Could not download message,插在 Copied 之后。
    5. core/test/message-menu.test.js — 新增 +242,4 个用例(第 3 节)。
    6. changelog.d/teamily-message-menu.added.md — 新增 +1(AGENTS.md 第 29 行要求)。

    生成(不计入手写行数,逐个列出):

    1. core/client.js — cd core && node scripts/build-client.mjs(scratch 实测 +2921/−2816),归 patches/ds-bot/0008-client-bundle.patch。
    2. patches/ds-bot/files/src/client/message-tools.js — files/ 新文件,topics.json 不动。
    3. patches/ds-bot/files/test/message-menu.test.js — 同上。
    4. patches/ds-bot/0001-core-fixes.patch — src/client/i18n.js。
    5. patches/ds-bot/0003-flybot-api-client.patch — src/client/cells.js、src/client/user-message.js。
    6. patches/ds-bot/0008-client-bundle.patch — core/client.js。

    gate 文件:0 命中。 本表没有 .github/**、policy/**、.github/scripts/enqueue-rules.mjs、.github/workflows/test.yml、policy/gates.json。

    口径:+483 是按 diff -u 的 +/− 行数算的手写改动(155+65+17+3+242+1),scratch 副本实测;生成物 5737 行变化不计。

    3. 红先测试

    新文件 core/test/message-menu.test.js,4 个用例(同一套 esbuild + vm harness,把 cells.js 与 user-message.js 各 bundle 一次;每个气泡各自一份 hook registry,避免跨用例串状态):

    1. a right-click on a reply bubble opens the same menu the More button does
    2. a user bubble gets the same tools as a reply
    3. a read-only window hides Reply on both bubbles and keeps Copy
    4. a copy the window cannot do says so instead of throwing out of the click

    先只提测试(不提交 message-tools.js、不改 cells/user-message),跑:

    cd core && node --import ./test/harness-resolve.mjs --test test/message-menu.test.js
    

    预期(scratch 在 main 树上实测):

    # tests 4
    # pass 0
    # fail 4
    

    四条红的原因分别是:the row a person right-clicks carries a menu handler('undefined' vs 'function')、my own line offers Reply too、a window that refuses the write draws no Reply(只读窗口里 Reply 按钮还在)、the menu says why nothing was copied(点了没反应,也没有 role="status")。

    补实现后同一条命令:# pass 4 / # fail 0(scratch 已复算)。

    回归(scratch 同一棵树跑过,全绿):earlier-message-actions 3/3、exchange-read 2/2、user-bubble 7/7、empty-message-cell 3/3、i18n 3/3、i18n-missing-entries 17/17。

    4. 验收命令(可直接跑)

    cd core && node scripts/build-client.mjs            # 先重建,别手改 client.js
    cd .. && node core/scripts/build-client.mjs --check  # exit 0(main 上我已实测 exit 0)
    cd core && node --import ./test/harness-resolve.mjs --test test/message-menu.test.js   # 4/4
    cd .. && node scripts/ds-bot-patches.mjs generate     # 需要 git
    node scripts/ds-bot-patches.mjs check                 # exit 0:pin 一致、patch 依次可应用、结果等于 core/
    node scripts/ds-bot-patches.mjs canonical             # exit 0:generate 不再改写 patches/(需要 git)
    TMPDIR=/data/flybot-tmp npm run verify                # 本机 /tmp 是 noexec,check-arch-docs 要这个 TMPDIR
    

    说明:本机 scratch 没有 git,所以 generate/canonical 没在这里复算;但 check 在未 generate 时会把待重算的 core 路径逐个点名——我实测点出来的正好是这一刀在 core/ 里动到的 6 个(core/src/client/message-tools.js、core/test/message-menu.test.js、core/client.js、core/src/client/cells.js、core/src/client/i18n.js、core/src/client/user-message.js),可以拿它当「手写文件 + 生成物」清单的自检。

    5. 风险与依据

    • 预期 risk:T2:只动客户端呈现层、一个客户端模块、3 个文案键;不碰 host 权限白名单、存储、协议、认证、gate 文件。最终由 controller 按 diff 定。
    • 搬组件会让 0003 里 cells.js 多一段 −56 的删除:上游 ds-bot 下次改这个函数时冲突面就是它。选搬而不是复制一份,是因为 user-message 要用同一套菜单——Add staged Teamily-style chat tools and owner-scoped history search #3112 也是这么搬的。
    • 右键只在 live 为假时挂:流式中的最后一条没有菜单,与现有 hover 工具条一致(不是新缺口)。
    • 只读判断沿用 roster.readOnly 非空串(与 context-menu.js L36/L91 的 locked、schedules.js L147 的 lockedWindow 同一表达式;cells.js 目前没有这个读法);只读窗口里 Copy/Download 仍可用,因为它们是读。
    • 为了守 12 文件上限,本刀没动 docs/subsystems/core-client.md,走 Docs-not-needed:(必须同时写在分支 commit message 和 PR body,arch-docs 两处都读)。若 owner 更想要 Key files 里加一行 message-tools.js,那就变 13 个文件——这条请 owner 定。

    6. 这一刀不做的(别混进来)

    • 消息折叠/文档卡:core/src/client/message-fold.js、FoldedContent、foldingOf、折叠偏好、.bt-doc-card 那一串——另一条线,一行不取。
    • 用户气泡的表情反应(Add staged Teamily-style chat tools and owner-scoped history search #3112 的 userMessageReactKey + useUi 接线):用户节点是否带稳定 turn 身份没在 main 上验证过,这一刀给不出能判定的断言,留到下一刀。
    • Add staged Teamily-style chat tools and owner-scoped history search #3112 里菜单的 Artifacts / 翻译 / 转发 / 多选 / 撤回 / 重编辑 / 消息置顶 / 举报:客户端没有对应 host 写,菜单里永不出现(用例 1、2 的 deepEqual(['Reply','Copy','Download']) 就是这条的断言)。
    • 会话级 Pin/Unpin 的会话溢出菜单(core/src/shared/session-pin.js)、styles.js 的 .bt-menu-reacts / .bt-message-note(菜单里不做表情行,这两条 CSS 也不需要)。
    • 本包其余 9 条线(外观与发送快捷键、记忆目录与搜索、建群弹层、本地 Bot 历史搜索、社交冻结分享人话、grant_request 中文、Project Assistant 09:00 digest is never scheduled if Automation tasks were off at project-create #1751 日报去重回填、定时任务时区,以及已落地的会话筛选)一律不碰。

    参照 #3112(tip 1969402ce6)的取法

    • core/src/client/message-tools.js — blob 1f1f4b4e4a…(+150):整份思想照取,三处收缩:菜单里不放表情行(省掉 .bt-menu-reacts 与 .bt-message-note 两条 CSS)、去掉 session-pin 的 id、去掉 userMessageReactKey。
    • core/src/shared/message-actions.js — blob ee03a5da35…(+48):不整取。只把 MESSAGE_REACTIONS / hasMessageText / isLockedRoster / messageActionIds 并进 message-tools.js——单为一个 40 行的纯模块会多出「1 手写 + 1 mirror」两个文件,直接顶破 12 文件上限。
    • core/src/client/cells.js — blob 6dd9b2b856…(+22/−61):只取「搬走组件 + 行上 onContextMenu + contextAt」这几个 hunk;bubbleBody / FoldedContent(折叠线)不取。
    • core/src/client/user-message.js — blob 54ed513346…(+42/−16):只取「换 MessageTools + 右键 + .bt-utools[data-open]」;userBody(折叠线)、useUi 反应、.bt-umsg .bt-reacts 不取。
    • core/src/client/i18n.js — blob e7d7f2c7aa…(+142):只取 3 个键。
    • core/test/message-tools.test.js — blob a64ce514b3…(+325):不整取(单这一份就吃掉预算的 54%),按本刀范围重写 4 个用例(+242)。

    建议的 PR 标题:Unify the message menu across reply and user bubbles (#3114)

    本刀收口单标题:[#3114] 消息菜单:右键与用户气泡共用一套复制/引用/下载

    (提请 owner 先开这张收口单,切片 PR 写 Fixes #<收口单> + Part of #3114;umbrella 只 Refs。)

  8. Birfy commented on Nov 18, 2026

    @Birfy
    CollaboratorAuthor

    Correction from issue-spec workflow:

    第三刀切片:消息菜单(main cdd02c6) · 修订版,取代 11:29Z 那条

    Written-by: Chief(2026-11-18T11:56Z 读,main cdd02c6e8c31e9c35e902b2875aaccfaf7646354)

    这不是第二份规格。 11:29:10Z 本单已有一条同题评论(#issuecomment-6977264409,读盘 11:26Z,8878 字)。评审后规格重写,按「原评论下补一条更正、不另发一份」的规矩发这一条:以本条为准,那条留着不动,作废的点在下面逐条列出。修订版全文见本评论末尾的折叠块,一字未删。

    0. 相对 11:29Z 那条,改了 10 处(前三条会让 Dev 直接做错)

    # 11:29Z 那条 修订版 为什么
    1 预期风险档 risk:T2 T1(无需 PASS) .github/agent/risk-rules.json L44:limits.T1 = {lines:400, files:20};.github/scripts/risk-gate.mjs L87–L91:超过就 bump('T3', …),不是 T2。生成物(core/client.js、patches/**)先从行数里扣掉(L87 isGenerated 过滤)。旧口径「T2」错了,而旧方案的 483 行手写会被直接抬到 T3。
    2 新开 core/test/message-menu.test.js(+242,4 例) 并进既有 core/test/earlier-message-actions.test.js(+76/−1,共 6 例) 新文件要把该文件 L1–L141 的 import + esbuild + vm + 假 React 脚手架(约 130 行)再抄一遍 → 手写 466 行 越过 T1 的 400,controller 抬 T3。并进去省的是重复脚手架,不是用例。
    3 带只读线:isLockedRoster、roster prop、用例 3「只读窗口藏 Reply」、验收 A3 整条砍掉 只读是「写权限语义」的另一条线,不是「统一消息菜单」所需。cells.js 今天不读 readOnly(读它的是 context-menu.js L36/L91、schedules.js L147 的 lockedWindow),本刀不动它,main 行为不变。砍掉后手写才降到 304 行。
    4 手写 +483 / −66 +237 / −67(304 changed) 旧数把 66 行删除重复计了一次(155+65+17+3+242+1 里已含删除)。文件数仍是 12(6 手写 + 6 生成)。
    5 user-message.js 显形规则写 L231 L232 L231 是 .bt-utools 布局规则,显形规则是 L232 的 .bt-umsg:hover .bt-utools,.bt-umsg:focus-within .bt-utools。要补 [data-open] 的是 L232。
    6 changelog 片段 teamily-message-menu.added.md 3114-message-menu.added.md changelog.d/README.md:名字是 <issue-or-slug>.<kind>.md;同 issue 已有 changelog.d/3114-session-filter-empty.added.md,跟它一致。
    7 i18n 三个键「插在 Copied 之后」 插在 L862 Download 之后(transcript 一簇 L853–L862),并给死三句中文 菜单的 Copy/Download 失败文案属于 transcript 那一簇;Copied 在 L165 是另一簇。原话取自 #3112,不另起一套。
    8 没有 base 钉死、没有 git 前提 base 固定 cdd02c6e8c;读数机没有 git(generate/canonical 要 git → 交给 Dev 那台,或由 tip CI 的 test.yml L133/L135 证明);verify 要 TZ=UTC + TMPDIR=/data/flybot-tmp 行号锚点全部来自 cdd02c6e8c,main 前进就必须重核;canonical 是逐字节比 generate 的输出,手搓 patch 过不了,必须在能跑 git 的机器上做。
    9 没说 PR body 会被入队规则逐字段拒 补 Owner: Dev / Reviewer: Reviewer / Written-by: Dev / ## Checkpoint(files 1–12,整块 < 1500 字符)/ ## Verification at the tip 的 Ran:+Not run: / agent-pr 标签 / Docs-not-needed: 同时进 commit 与 body .github/scripts/enqueue-rules.mjs 入队时逐字段拒,缺一个就入不了队。本刀正好 12 文件,files 已是上限。
    10 没说测试 harness 要补什么 primitives stub 要补 projectUserText: (text) => text(earlier-message-actions.test.js L102) user-message.js L134 无条件调它,不补 stub 第二例会以 TypeError 红,而不是断言的差别。

    边界也补了一条:删除/撤回不做——全仓 deleteMessage / retractMessage / "delete message" 都是 0 命中,core/src/client/index.js 里没有删除端口,要做删除得先有 host 写。client.js 生成量由 +2921/−2816 修成 +2903/−2816(净 +88)。

    0.1 我按 cdd02c6e8c 逐个复核过的锚点(都对,除一处补正)

    context-menu.js 120 行、kind 只有 agent/agent-session(L26)· cells.js L88 live、L89 .bt-msg 行、L94 live ? null : h(MessageTools, …)、L104 REACTIONS、L123 useDismiss、L138 MessageTools、L156 void navigator.clipboard?.… · user-message.js L158–L164 CopyButton、L206 .bt-utools、L232 显形规则 · styles.js L655–L657 .bt-tools([data-open] 在 L657)、L681–L690 .bt-menu* · i18n.js Download L862 · 测试 L88 external、L102 primitives stub、L143 roster、L203/L224/L236 三个 P-393 用例 · topics.json:src/client/i18n.js→0001(0018 里也有,取先出现的 0001)、cells.js/user-message.js→0003、client.js→0008 · onContextMenu 只出现在 sidebar.js、projects-nav.js、plugins/social|workflow/client.js(cells.js/user-message.js 0 处)· risk-rules.json 的 T3 确实含 core/src/shared/**(所以 message-actions.js 不整取)。

    一处补正:i18n 那一簇的标签行号原文差 2–3 行。实测 Reply L856、More message actions L857、Reactions L860、Message actions L861、Download L862;簇范围 L853–L862 和「插在 Download(L862)之后」这个锚点不变,照做即可。


    完整规格(修订版,逐字保留,点开)

    第三刀切片:消息菜单(main cdd02c6)

    Written-by: Chief(2026-11-18T11:56Z 读,main cdd02c6e8c31e9c35e902b2875aaccfaf7646354)

    要不要换目标:不换,但口径比上一版小一圈。 main 上的消息菜单是半套,不是完整,也不是没有:回复气泡有一个 hover 工具条(表情 / 回复 / 更多→复制、下载),但右键什么都没有;用户自己的气泡只有一个复制按钮;复制/下载失败完全无声。三条都是每天摸得到的缺口。core/src/client/context-menu.js(120 行)是侧栏行菜单(Bot / 群 / DSH Agent 会话),kind 只有 agent / agent-session,没有消息维度,不复用它。

    1. 现状(main cdd02c6e8c 实读,行号全部来自 main)

    事实 位置(main)
    侧栏行菜单,无消息维度 core/src/client/context-menu.js L11 ContextMenu、L26 menu.kind 分派、L80 AgentMenu(全文件 120 行)
    回复气泡 hover 工具条:表情 / Reply / More→(Copy, Download) core/src/client/cells.js L137–L173 MessageTools(L138 定义、L169–L170 表情条、L171–L172 .bt-menu 的 Copy/Download)
    只在非流式的回复气泡上挂 cells.js L94 live ? null : h(MessageTools, …);live 定义在 L88
    消息右键:0 处 onContextMenu 全仓只在 sidebar.js、projects-nav.js、`plugins/social
    用户气泡只有 Copy core/src/client/user-message.js L158–L164 CopyButton、L206 h('div',{className:'bt-utools'}, h(CopyButton,{text}))
    复制/下载失败无声 cells.js L155–L157 与 user-message.js L160–L162 都是 void navigator.clipboard?.writeText(text).then(…):缺 clipboard 时可选链把整条链短路,写被拒时 promise 被 void 掉
    .bt-tools 显形规则(含 [data-open]) core/src/client/styles.js L655–L657;.bt-menu / .bt-menu-hint 在 L681–L690 → 本刀不改 styles.js
    用户气泡自己的 CSS 块 user-message.js L209 USER_MESSAGE_CSS,L231 是 .bt-utools 布局规则、L232 才是显形规则(要加 [data-open] 的是 L232)
    i18n 已有 core/src/client/i18n.js L164 Copy、L165 Copied、L171 You、L853–L862 一簇(Reply L853、More message actions L854、Reactions L858、Message actions L859、Download L862);缺 3 个键(见下)
    patch 归属 topics.json:src/client/i18n.js → 0001(0001 在 0018 之前);src/client/cells.js、src/client/user-message.js → 0003;新文件走 patches/ds-bot/files/,topics.json 不动
    已有测试不能破 core/test/earlier-message-actions.test.js(3 例,同一套 vm harness 点 Add reaction / Reply);core/test/exchange-read.test.js L111 点 More → Copy

    2. 文件级切片(12 个:手写 6 + 生成 6;手写 +237 / −67(合计 304 行),不碰任何 gate 文件)

    手写:

    1. core/src/client/message-tools.js — 新增 141 行
    2. core/src/client/cells.js — +9 / −56
    3. core/src/client/user-message.js — +7 / −10
    4. core/src/client/i18n.js — +3 / −0
    5. core/test/earlier-message-actions.test.js — +76 / −1(加在既有文件里,不新开测试文件)
    6. changelog.d/3114-message-menu.added.md — 新增 1 行

    生成(不计手写行数,逐个列出):

    1. core/client.js — cd core && node scripts/build-client.mjs,实测 +2903 / −2816(24069 → 24157,净 +88),归 0008
    2. patches/ds-bot/files/src/client/message-tools.js — 新文件镜像(files/ 新文件,topics 不动)
    3. patches/ds-bot/files/test/earlier-message-actions.test.js — 既有镜像,+76/−1(files/ 里的文件改了就改它,topics 不动)
    4. patches/ds-bot/0001-core-fixes.patch — src/client/i18n.js
    5. patches/ds-bot/0003-flybot-api-client.patch — src/client/cells.js、src/client/user-message.js
    6. patches/ds-bot/0008-client-bundle.patch — core/client.js

    gate 文件:0 命中(本表没有 .github/**、policy/**、.github/scripts/enqueue-rules.mjs、.github/workflows/test.yml、policy/gates.json)。

    为什么测试加在既有文件里、而不是新开 message-menu.test.js:earlier-message-actions.test.js L1–L141 已经是 import + esbuild + vm + 假 React 的整套脚手架(约 130 行),新开文件要把这段再抄一遍 → 手写改动从 304 涨到 466 行,越过 T1 的 400 行上限(见第 6 节),controller 会直接把这张 PR 抬到 T3。加在既有文件里省的是重复脚手架,不是用例。

    3. 每个文件的改动与 #3112 参照

    ① core/src/client/message-tools.js(新增,141 行)

    • 一句话:把 MessageTools / useDismiss / 反应表从 cells.js 搬出来,两边的气泡共用;onMessageContextMenu 把右键落到光标处;复制/下载失败在菜单里给一句 role="status"。
    • 内容:MESSAGE_REACTIONS、useDismiss、downloadMessage、MessageTools({ text, name, sessionId, react, actions, contextAt, className })、onMessageContextMenu(event, setContextAt, { live });messageActionIds 只返回客户端真能跑的 react / reply / copy / download。
    • 参照 Add staged Teamily-style chat tools and owner-scoped history search #3112:core/src/client/message-tools.js blob 1f1f4b4e4a…(+150)。整份思想照取,收缩三处:不读 roster(不做只读隐藏)、去 useEffect 自动聚焦与 ↓/↑/Home/End 按键移动(本刀没有用例要它)、core/src/shared/message-actions.js 不整取(见下)。
    • 参照 Add staged Teamily-style chat tools and owner-scoped history search #3112:core/src/shared/message-actions.js blob ee03a5da35…(+48)——不整取。整取会多 1 个手写文件 + 1 个镜像(顶破 12 文件),且 core/src/shared/** 在 risk-rules.json 里是 T3 路径。只把 MESSAGE_REACTIONS / hasMessageText / messageActionIds 三个纯函数并进 message-tools.js;isLockedRoster、userMessageReactKey、hasMessageActions 不取。

    ② core/src/client/cells.js(+9/−56)

    • 一句话:删掉本地的组件与常量,改从新模块引入,并在 .bt-msg 行上接右键。
    • 行号锚点(main):L1–L9 导入区(去掉 createPortal 与 5 个图标,保留 MemoryIcon)、L104 REACTIONS、L122–L135 useDismiss、L137–L173 MessageTools;contextAt state 加在 L81 的 shown 之前,L89 的 .bt-msg 行加 onContextMenu(live 时不挂),L94 传 contextAt。
    • 参照 Add staged Teamily-style chat tools and owner-scoped history search #3112:core/src/client/cells.js blob 6dd9b2b856…(+22/−61)。只取「搬组件 + 行上右键 + contextAt(用 index 区分同一栈里的多行)」;bubbleBody / FoldedContent / 折叠偏好一律不取。

    ③ core/src/client/user-message.js(+7/−10)

    • 一句话:删 CopyButton,换成同一个 MessageTools(className:'bt-utools'),根 div 接右键,CSS 显形规则补 [data-open]。
    • 行号锚点(main):L158–L164 CopyButton;L188 是根 h('div', {,属性在 L189–L195(className / data-*),新 contextAt state 与 onContextMenu 加在这里;L206 是 .bt-utools 那一行;L232 是 .bt-umsg:hover .bt-utools,.bt-umsg:focus-within .bt-utools 显形规则(L231 是布局规则,别改错)。
    • name 用 incoming ? author?.name : t('You');空文本由 messageActionIds 返回空、组件 return null 兜住(原来的 text === '' ? null : 可以去掉)。
    • 参照 Add staged Teamily-style chat tools and owner-scoped history search #3112:core/src/client/user-message.js blob 54ed513346…(+42/−16)。只取「换 MessageTools + 根上右键 + [data-open]」;userBody / 折叠 / useUi 反应接线不取。

    ④ core/src/client/i18n.js(+3)

    ⑤ core/test/earlier-message-actions.test.js(+76/−1)

    • 一句话:在这个文件已有的 harness 上补 3 个用例,并多加载一次 user-message.js 的 bundle。
    • 锚点(main):L85–L106 是 bundle + env + require;L102 的 primitives stub 要补一个 projectUserText: (text) => text(user-message.js L134 无条件调用它);L143–L147 roster;L236–L253 是「当前 part 的气泡」用例,新用例接在文件末尾。
    • 参照 Add staged Teamily-style chat tools and owner-scoped history search #3112:core/test/message-tools.test.js blob a64ce514b3…(+325)。不整取(325 行占预算 54%,而且它测的是直接 import 的纯函数),按本刀范围重写 3 例。

    ⑥ changelog.d/3114-message-menu.added.md(+1)

    • 一句话:用户可见改动的片段。同一 issue 已有 changelog.d/3114-session-filter-empty.added.md,这里用 3114-message-menu.added.md(changelog.d/README.md:<issue-or-slug>.<kind>.md,正文一段、无 - 、无标题、带 issue 链接)。

    4. 红先测试

    测试文件:core/test/earlier-message-actions.test.js(既有文件,esbuild + vm + 假 React;cells.js 已 bundle,再 bundle 一次 user-message.js)。

    新增 3 个用例:

    1. a right-click on a bubble opens the menu the More button opens
    2. a user bubble gets the same tools as a reply
    3. a copy the window cannot do says why instead of throwing out of the click

    先只提测试(不改 cells.js / user-message.js、不加 message-tools.js、不加 i18n 键),跑:

    cd core && node --import ./test/harness-resolve.mjs --test test/earlier-message-actions.test.js
    

    预期(在 main 的源码树上实测):# tests 6 / # pass 3 / # fail 3 —— 前 3 例(P-393 原有)仍绿,新加的 3 例依次红在:

    • the row a person right-clicks carries a menu handler('undefined' vs 'function')
    • my own line offers Reply too
    • the menu says why nothing was copied

    补实现后(实测):# tests 6 / # pass 6 / # fail 0。

    5. 验收(都能直接跑)

    # 命令 / 判定 实测
    A1 用例 1 通过:回复气泡右键出现菜单,菜单项恰为 Reply/Copy/Download,按 Reply 得到 actions.quote('chief', text) 绿
    A2 用例 2 通过:用户气泡画出 Reply 与 More;Reply 带的是我自己的字;根 div 右键出同一个菜单 绿
    A3 用例 3 通过:navigator.clipboard 缺失时点 Copy 不抛错,菜单出现 role="status" 一句 绿
    A4 node core/scripts/build-client.mjs --check → exit 0(先 cd core && node scripts/build-client.mjs) exit 0
    A5 cd core && node --import ./test/harness-resolve.mjs --test test/earlier-message-actions.test.js → # pass 6 # fail 0 6/6
    A6 回归:exchange-read 2/2、user-bubble 7/7、empty-message-cell 3/3、i18n 3/3、i18n-missing-entries 17/17 全绿
    A7 node scripts/ds-bot-patches.mjs check → 10 patches apply cleanly in order + core/ equals ds-bot/ + patches/ds-bot/(generate 之后) 生成前它点名本刀的 6 个 core 路径
    A8 node scripts/ds-bot-patches.mjs canonical → generate is a no-op 见下「git」
    A9 TZ=UTC TMPDIR=/data/flybot-tmp npm run verify → exit 0 见下「git」
    A10 无 gate 文件:GET /repos/ThinkFlowLab/FlyBot/pulls/<n>/files 两页里没有任何 ^\.github/ 或 ^policy/ 开头 本表 0 命中
    A11 待重算路径 = 本表:check 在 generate 之前点名的 6 个 core 路径(message-tools.js、earlier-message-actions.test.js、client.js、cells.js、i18n.js、user-message.js)必须与第 2 节一致 实测一致

    关于 git(A7/A8/A9 的前提,必须说清):generate 与 canonical 都要 git(scripts/ds-bot-patches.mjs L375 generate needs git、L423 canonical needs git;patches/ds-bot/README.md 也写着工件机器上没有 git)。当前这台读数机器实测 command -v git 为空,check 能跑但会先说一句 skipped pin (no git);patches/ds-bot/README.md 同时写明「no git 时 apply/check 照常工作」。所以:

    • 必须有一步在能跑 generate 的机器上做:canonical 比的是「committed series 与 generate 写出的东西」逐字节,手搓的 patch 过不了;0008-client-bundle.patch 本刀要变 ~2900/2800 行,不可能手写。上一刀 Say why the sidebar session list is empty under a filter (#3114) #3163 的 PR body 记了 generate / canonical / npm run verify 都是绿的,说明 Dev 那边跑得起来。
    • 若 Dev 手上那台也没有 git:check 仍可作本地自检(它点名待重算的 6 个路径),canonical 与 arch-docs 交给 tip 的 CI(.github/workflows/test.yml L133 check、L135 canonical),并在 PR body 的 Ran: / Not run: 里照实写哪条没跑、为什么 —— PASS 必须列 Ran:,编不了。

    6. 风险与边界

    预期 tier:T1(无需 PASS)。 依据 risk-rules.json:本表路径全部落在 T1.paths(core/src/client/**、core/client.js、patches/**、core/test/**、changelog.d/**),且 304 行 / 6 个非生成文件 ≤ T1 的 limits(400 行 / 20 文件),risk-gate.mjs L88–L91 的 size 检查不会抬档。最终仍由 controller 按 diff 定。

    这条是上一版会踩的坑:上一版手写 466 行(另一个 242 行的新测试文件),超过 T1 的 400 行上限,risk-gate.mjs 会直接 bump('T3'),不是 T2。压到 304 行就是为了留在 T1。

    • client.js 会大变:新增一个模块让 esbuild 的内部符号重新编号,实测 +2903/−2816(净 +88)。这是生成物、不计手写行数,但 0008-client-bundle.patch 会跟着 churn,而 patches/ds-bot/README.md 已经写明 client 包「两条分支同时改客户端就冲突」。确定性已验:esbuild 0.28.2(core/package.json 的 devDependency)连续两次构建字节相同。

    • 0003 里 cells.js 多一段 −56 的删除,上游下次改 MessageTools 时冲突面集中在这一个函数(Add staged Teamily-style chat tools and owner-scoped history search #3112 就是这种搬法)。

    • 不做只读隐藏:roster.readOnly 只影响写(Reply),但那是「写权限语义」第二条线,cells.js 今天也不读 readOnly(读它的是 context-menu.js L36/L91 与 schedules.js 的 lockedWindow)。本刀不动它,main 今天的行为不变。

    • docs/subsystems/core-client.md:owned_paths 覆盖 core/src/client/ 与 core/client.js,arch-docs 会要求同 PR 改这页,或用 Docs-not-needed: 尾注。为守 12 文件上限,本刀不改这页,走尾注(必须同时写在分支 commit 与 PR body,arch-docs 机械读这两处):

      Docs-not-needed: the message toolbar already has its bullet on this page (the earlier-messages one: Reply quotes into the open chat); this cut moves it into its own module and draws the same one on a person's own line — no owned path or subsystem boundary changes.

      要在这页加一行就变 13 个文件,由 owner 定:加 = 13 文件、仍 T1;不加 = 12 文件 + 上面那条尾注。

    • 右键的边界:流式中的最后一条不挂菜单(与 hover 工具条一致,cells.js L88/L94);链接、输入框、已打开的菜单里的右键不抢(onMessageContextMenu 里 closest('a[href], input, textarea, [role="menu"]'))。

    这一刀不做的(别混装第二条线):

    7. 步骤(≤6)

    1. git fetch origin && git switch -c <branch> origin/main;base 固定 cdd02c6e8c31e9c35e902b2875aaccfaf7646354,若 main 已前进,先重核第 1 节的行号再动手(锚点全来自这个 sha)。分支上先写 Docs-not-needed: 尾注(与 PR body 同一条)。
    2. 先只改 core/test/earlier-message-actions.test.js(3 例 + 第二次 bundle + projectUserText stub)→ 跑出 3 fail(见第 4 节的红)。
    3. 加 core/src/client/message-tools.js;改 cells.js(搬组件、行上右键、contextAt)。
    4. 改 user-message.js(换 MessageTools、右键、L232 补 [data-open])与 i18n.js 三个键 → 6/6 绿。
    5. cd core && node scripts/build-client.mjs;cd .. && node scripts/ds-bot-patches.mjs generate && check && canonical(check 前后都应 core/ equals ds-bot/ + patches/ds-bot/)。
    6. 写 changelog 片段;PR body 写齐(见下),跑 TZ=UTC TMPDIR=/data/flybot-tmp npm run verify。

    PR body 的硬要求(enqueue-rules.mjs 在入队时逐字段拒,缺一个就入不了队):

    • Fixes #<收口单> + Part of #3114(umbrella 只 Refs,不要关 [#3110] 已落地聊天壳、设置、搜索与历史命中的收口 #3114)。
    • Owner: Dev 与 Reviewer: Reviewer(enqueue-rules.mjs L87/L94;Owner: 必须在 writers 名单里,两行都不能写 Birfy)。
    • Written-by: Dev。
    • ## Checkpoint 块(<!-- flybot:checkpoint --> … <!-- /flybot:checkpoint -->,整块 < 1500 字符,L377/L378):pr(本 PR 号)、claim(= Owner: 的 Bot 名)、issue(= Fixes 的号)、summary(3–5 句、≤600 字符)、files 1–12 个路径且至少一个在本 PR diff 里(本刀正好 12 个,已是上限)、checks(ran / result / at 40 位 tip sha)、next。
    • ## Verification at the tip:Tip SHA:、Base:、Ran: 每条命令 + 结果、Not run: 与原因。
    • 标签 agent-pr;Docs-not-needed: 一条(commit 与 body 都要)。

    建议的 PR 标题:Unify the message menu across reply and user bubbles (#3114)

    本刀收口单标题:[#3114] 消息菜单:右键与用户气泡共用一套复制/引用/下载


    建议的 PR 标题:Unify the message menu across reply and user bubbles (#3114)

    本刀收口单标题:[#3114] 消息菜单:右键与用户气泡共用一套复制/引用/下载

    first_slice: 消息菜单(本条这一刀就是它:右键 + 用户气泡与回复气泡共用一套复制/引用/下载;PR 挂 Fixes #<收口单> + Part of #3114,umbrella 只 Refs,不关 #3114)

  9. Birfy commented on Nov 18, 2026

    @Birfy
    CollaboratorAuthor

    第四刀切片:发送快捷键(main 483fb8f)

    Written-by: Chief(2026-11-18T12:41Z 读,main 483fb8f)

    要不要换目标:不换,但只做发送快捷键一条线,外观不切。 核实结果:main 的「外观」层已经是完整的——Settings → General 有 4 套配色(Theme)、强调色(含自定义)与 Animation 三档(settings.js L105–L153、L193–L212;themes.js L9–L56);真正缺的是 light/dark/auto/system 的 mode,而 mode 属于 DSH 壳自己的主题服务(index.js L370 ctx.theme.overrideTokens,壳的 dsh-client-ui-theme 暴露 appearance.light/dark/system 与 setTheme),main 的客户端对 data-ds-dark-theme 只读不写(themes.js L48 读;全仓 setAttribute('data-ds-dark-theme') 0 命中)。在 FlyBot 里再画一个 mode 会和壳抢同一个属性,等于第二条线。#3112 的 Grove 只是第五套配色 + 一个 main 里 0 引用的 --bt-selected,是视觉新增不是缺陷。所以「外观」留空,这一刀只补发送快捷键;一条线也接受,理由就是它小、且不碰 host。

    1. 现状(main 483fb8fe26 实读,行号全部来自 main)

    事实 位置(main)
    壳的 Enter 发送 / Shift+Enter 换行是固定行为,FlyBot 没有开关 core/src/client/composer.js L10–L12 注释「The shell's send button stays the submit path」;全仓 sendOnEnter / Shift+Enter 0 命中(12:40Z 粗查复现)
    composer 里没有任何 Enter 键处理;唯一的 window keydown 是「+」菜单的 Escape composer.js L71 ComposerVoice、L91–L105(只画麦克风/语音按钮);L135–L136 window.addEventListener('keydown', onKey, true) 只处理 Escape
    壳的输入框与卡片已经有可用的选择器 [data-composer-card] 本文件 L150 已在用;[data-composer-input] 见 composer-label.js L17
    发送按钮没有专用标记,只能按标签找 壳的按钮是 type="button" + aria-label(t('input.send') = Send / 发送消息);运行中同一按钮变 Stop
    外观控件已在(配色/强调色/动画) settings.js L105 注释、L106 GeneralPage、L123–L130 只读分支的 Appearance、L132–L145 可写分支的 Appearance、L146–L153 Notifications;L193 MOTIONS、L194 MotionSection
    配色由主题表驱动,亮/暗两套 themes.js L9 THEME_KEYS、L10–L30 四套 THEMES、L47–L48 themeCss(html body[data-ds-dark-theme])、L50–L56 shellTokens
    mode 属壳:客户端只读 data-ds-dark-theme,全仓没有写它 themes.js L48;styles.js L17;index.js L370 往壳的主题服务压 token
    --bt-selected(Grove 用)在 main 里 0 引用 grep -rn "bt-selected" core/src/client → 0
    host 的 set-prefs 是逐字段白名单,未知键静默丢弃 core/src/host/channel.js L264 setPrefs;字段只有 theme L266 / accent L269 / motion L273 / notifications L279 / notify L287 / quietHours L299 / turnBudget L307,函数在 L314 直接 return rt.save(),没有兜底
    所以 sendKey 若走 setPrefs 不会持久化;要加字段就得改 channel.js,而它是 T3 路径 risk-rules.json T3.paths 含 core/src/host/...channel.js 与 core/src/shared/**
    客户端本地偏好是既有做法 index.js L174–L176 读 localStorage 的 prefs 镜像、L373 写回主题/强调色/动画;storage.js 收口 key
    i18n 有 Appearance/Theme/Accent,没有快捷键键 i18n.js L659 Appearance、L660 Theme、L662 Accent、L664 Theme accent;Shortcuts / Send shortcut / Enter to send 0 命中
    可复用的测试脚手架已存在 core/test/settings-readonly-pages.test.js(342 行:esbuild + vm + 假 React + mount() 渲染 SettingsDialog);L256 断言可写 General 现在有 6 个控件
    patch 归属 topics.json:src/client/composer.js → 0012、src/client/settings.js → 0014、src/client/i18n.js → 0001(首个匹配);测试镜像在 patches/ds-bot/files/test/,topics.json 不动(没有新增源文件)

    补充证据(不在仓库里,作为行为依据,读的是本机装好的壳 @deepseek-ai/dsh-client-ui-conversation 0.2.1-rc.2;CI pin 的是 0.2.0-rc.2):它的提交命令在 event.shiftKey === true 时直接 return false(不提交),所以 Shift+Enter 现在只走浏览器默认换行。两版在这一条上一致。

    2. 文件级切片(12 个:手写 6 + 生成 6;手写 +275 / −3 = 278 行,不碰任何 gate 文件)

    手写:

    1. core/src/client/composer.js(+117 / −0) — 一句话:把「哪个键发送」的全部逻辑放进 composer,并在 ComposerVoice 里装一个 capture 监听。
      • 内容:SEND_KEYS、DEFAULT_SEND_KEY、SEND_KEY_STORAGE='flybot-send-key'、normalizeSendKey、readSendKey/writeSendKey(localStorage)、shouldSendOnKey/shouldBreakOnKey(纯函数,IME/修饰键放行)、composerFieldOf/composerCardOf、findSendButton(button[type=submit]/[data-send]/[data-composer-send],否则按 aria-label|title|textContent 的 /send|发送/ 且排除 dictate/mic/voice/add/plus/stop)、insertComposerNewline(value 字段 splice;contenteditable 走 execCommand('insertLineBreak'→'insertParagraph'→insertText('\n'))、installSendShortcut({doc})。
      • 锚点:插在 L15 keepComposerFocus 之后(新块),ComposerVoice 的 useEffect 接在 L90 }, [quote?.token]) 之后、L91 if (sessionId === undefined) return null 之前;监听用本文件 L135 已有的 capture 写法。
      • 参照 #3112:core/src/client/composer.js blob fb92edb21a…(+41/−3)。只取 installSendShortcut 的骨架与「翻键」思路;不取同一 hunk 里 ComposerPlus 的三个分组(那是加号菜单那条线,+40 行)。
    2. core/src/client/settings.js(+20 / −0) — 一句话:General 加一个 Shortcuts 分区,可写窗口给 Enter / Shift+Enter 二选一,只读窗口只留文字。
      • 锚点:import 区;常量区(NOTIFY_KINDS 之后);GeneralPage 的 L111 timer useRef 之后加 useState(() => readSendKey()) 与 chooseSendKey;只读分支接在 L125(只读 Appearance 收尾)之后、L126 Notifications 之前(sendKeyLabel 纯文字);可写分支接在 L145(强调色块收尾)之后、L146 Notifications 之前(Segmented,aria-label: 'Send shortcut')。
      • 参照 #3112:settings.js blob 426f9c642f…(+98/−7)。只取 Shortcuts 那一行/SEND_KEYS 标签;不取 appearance mode、语言、folding、Channels(都是本包其它线)。
    3. core/src/client/i18n.js(+5 / −0) — 一句话:Shortcuts / Send shortcut / Enter to send / Shift+Enter to send / 「选择哪个键发送消息,另一个键换行。」。
      • 位置:i18n.js L664 Theme accent 之后(Appearance 一簇)。
      • 参照 #3112:i18n.js blob e7d7f2c7aa…(+142)。只取这 5 个键。
    4. core/test/settings-readonly-pages.test.js(+131 / −3) — 一句话:在既有 harness 上加 5 个用例,localStorage 桩改成可写,counts 断言 6→7。
      • 为什么不是新文件:该文件 L1–L160 已经是 esbuild + vm + 假 React + mount() 的整套脚手架;新开文件要把这段抄一遍(约 130 行),手写会从 278 涨到 ~410,越过 T1 的 400 行上限(risk-metrics/risk-gate.mjs 会把 PR 抬到 T3)。上一刀 #3166 就是靠并进既有文件压到 304 行的。
    5. docs/subsystems/core-client.md(+1) — 一句话:在 composer 只读那段(L235 那条之后)补一行发送快捷键,owned_paths 覆盖 core/src/client/ 与 core/client.js,同 PR 改页就不需要 Docs-not-needed: 尾注。
    6. changelog.d/3114-send-key.added.md(+1) — 一句话:用户可见改动片段(<issue-or-slug>.<kind>.md,无标题、无 - )。

    生成(不计手写行数,逐个列出):

    1. core/client.js — cd core && node scripts/build-client.mjs,实测 +130 / −0(24122 → 24252 行,esbuild 0.28.2);--check exit 0。归 0008。
    2. patches/ds-bot/files/test/settings-readonly-pages.test.js — 既有测试镜像,+131/−3(files/ 里已有此文件,改了源就跟着改,topics.json 不动)。
    3. patches/ds-bot/0001-core-fixes.patch — src/client/i18n.js 的 5 个键。
    4. patches/ds-bot/0012-room-membership.patch — src/client/composer.js。
    5. patches/ds-bot/0014-flybot-branding.patch — src/client/settings.js。
    6. patches/ds-bot/0008-client-bundle.patch — core/client.js。

    gate 文件:0 命中。topics.json:不动。core/src/shared/**:0 改动(#3112 的 core/src/shared/appearance-prefs.js blob 8a32e04d5c… 不取,那是 T3 路径;校验逻辑本来也只服务 host 存储,本刀不存 host)。#3112 的 core/src/client/appearance.js blob 1c3b956cf2…(244 行)不整取:0 行进入本刀,理由见 §1 的 mode 归属。

    3. 红先测试

    加在既有文件 core/test/settings-readonly-pages.test.js(不新开、不抄脚手架)。先只加两个 UI 用例与 L256 的 counts 改动(6→7),不加实现,跑:

    cd core && node --import ./test/harness-resolve.mjs --test test/settings-readonly-pages.test.js
    

    实测:# tests 10 / # pass 7 / # fail 3。三条红分别是:

    • 用例 a writable window keeps every page as it is today (#2474):General keeps its four switches beside the send-key picker(actual 6 !== expected 7)
    • 用例 General offers Enter or Shift+Enter to send, and stores the choice for this window (#3114):the choice has its own section(/Shortcuts/ 未命中)
    • 用例 a read-only window names the send shortcut instead of drawing a picker (#3114):the page still names the setting(/Send shortcut/ 未命中)

    补实现后再加 3 个 composer 行为用例(它们 import 的导出在 main 上不存在,esbuild 在 build 阶段就红,没有断言可红——所以「红」的责任由上面两条 UI 用例承担)。补完后实测:# tests 13 / # pass 13 / # fail 0。

    5 个用例名:

    1. General offers Enter or Shift+Enter to send, and stores the choice for this window (#3114)
    2. a read-only window names the send shortcut instead of drawing a picker (#3114)
    3. Shift+Enter to send presses the composer's Send button and Enter starts a new line (#3114)
    4. Enter to send leaves the composer to the shell (#3114)
    5. a window with no Send to press keeps the shell's handling, and a locked field is left alone (#3114)

    4. 验收(都能直接跑;「实测」是本机在 main 树上跑出来的)

    # 命令 / 判定 实测
    A1 node core/scripts/build-client.mjs --check → exit 0(先 cd core && node scripts/build-client.mjs) exit 0
    A2 cd core && node --import ./test/harness-resolve.mjs --test test/settings-readonly-pages.test.js → # pass 13 # fail 0 13/13
    A3 红先(只加 UI 两例 + counts)→ # pass 7 # fail 3,红在 §3 那三句 3 红
    A4 node scripts/ds-bot-patches.mjs check:generate 之前点名且只点名 5 个 core 路径(client.js、composer.js、i18n.js、settings.js、settings-readonly-pages.test.js);generate 之后 → ok 10 patches apply cleanly in order 且不再列差异 实测一致(skipped pin (no git) 也照旧)
    A5 node scripts/ds-bot-patches.mjs canonical → generate is a no-op 需 git;本机无 git → 交 tip CI
    A6 TZ=UTC TMPDIR=/data/flybot-tmp npm run verify → exit 0 本机缺 dev/harness 包 → 交 tip CI
    A7 回归:flybot-client 14/14、i18n 3/3、i18n-missing-entries 17/17、settings-polish 4/4、settings-page-keys 5/5、client-bundle 2/2、composer-send-readonly 7/7 全绿
    A8 无 host 写入:grep -Rn "sendKey|flybot-send-key" core/src/host core/index.js → 0;grep -Rn "setPrefs({ sendKey" core/src/client → 0 0 / 0
    A9 无 gate 文件:GET /repos/ThinkFlowLab/FlyBot/pulls/<n>/files 两页没有 ^\.github/ 或 ^policy/ 开头 本表 0 命中
    A10 12 文件、手写 278 行(+275/−3)≤ T1 的 400 行 / 20 文件;生成物先扣行数 符合

    关于 git(A4/A5/A6 的前提,必须说清):generate 与 canonical 都要 git(scripts/ds-bot-patches.mjs L375 generate needs git、L423 canonical needs git);本机 command -v git 为空,check 能跑但先说 skipped pin (no git)。所以本刀必须有一台能跑 git 的机器做第 5 步;若 Dev 那台也没有 git,check 仍可作本地自检(它点名待重算的 5 个路径),canonical 与 arch-docs 交 tip CI(.github/workflows/test.yml),并在 PR body 的 Ran: / Not run: 里照实写。

    5. 风险与边界

    预期 tier:T1(无需 PASS)。 依据 risk-rules.json:路径全在 T1.paths(core/src/client/**、core/test/**、core/client.js、patches/**、changelog.d/**;docs/** 是 T0),手写 278 行 < limits.T1.lines=400,12 文件 < 20;risk-gate.mjs 的 size 检查不会抬档。最终由 controller 按 diff 定。

    • Enter 换行没有真实浏览器验收:Lexical 里靠 document.execCommand('insertLineBreak'→'insertParagraph'→insertText) 三步降级,单测只锁命令顺序与「按下时 preventDefault + stopPropagation」。真窗口里必须手点一次;若 Lexical 不吃 execCommand,Shift+Enter 发送方向仍可用,Enter 换行是唯一软点。本包本来就记着「无浏览器点击验收」,别把这条写成已验证。
    • 偏好是本窗口的 localStorage(flybot-send-key):不跟设备、不跨窗口实时同步(设置页 mount 时读一次,按键时每次都读)。这是刻意的取舍——host 侧要么改 channel.js(T3)加白名单字段,要么改 core/src/shared/**(T3),两条都超本刀范围。
    • capture + stopPropagation 会挡住 Lexical 的 keydown:只在 target 落在 [data-composer-card] 内的 [data-composer-input] / textarea / contenteditable 时生效;卡片外、只读(readOnly / aria-readonly)、disabled、IME(isComposing / keyCode 229)全部原样放行。
    • 运行中的 turn:主按钮变成 Stop 或 disabled,findSendButton 按标签找不到 Send → 事件交回壳(Shift+Enter 仍是换行),不会误点 Stop。
    • settings.js 新增对 composer.js 的 import:无环(composer 不 import settings,已验证),client.js 只 +130/−0;0008 的冲突面仍是一整块 bundle。
    • patch 冲突面:composer 的新块在 L15 之后、settings 的新块在 General 里,各自集中在新增块;不新增源文件,topics.json 不动。
    • 若壳以后自己做发送快捷键设置,本实现应删掉而不是叠加。

    这一刀不做的(别混装第二条线):

    • 外观 mode(light/dark/auto/system):壳的主题服务owns它,再画会抢 data-ds-dark-theme。
    • #3112 的 Grove 第五套配色与 --bt-selected(main 里 0 引用,纯视觉新增)。
    • 语言切换、消息折叠设置、Channels 页(本包其它线)。
    • host 侧偏好持久化 / 跨设备同步 / set-prefs 白名单(T3)。
    • 其它键位(Ctrl/Cmd+Enter 发送、每个聊天单独设置)、按住 Enter 连发。
    • 不 patch DSH、不改 ds-bot/、不碰 .github/**、policy/**、workflows。

    6. 步骤(≤6)

    1. git fetch origin && git switch -c <branch> origin/main;base 固定 483fb8fe2696b4e79735a505af77a878ce705423,git diff origin/main...HEAD --stat 只许出现本表 12 个文件。
    2. 先只改 core/test/settings-readonly-pages.test.js 的两个 UI 用例 + counts 6→7(localStorage 桩改成可写)→ 跑出 §3 的 3 红。
    3. 加 composer.js 的发送快捷键块与 ComposerVoice 的 useEffect(() => installSendShortcut(), []);settings.js 加 Shortcuts 分区;i18n.js 加 5 个键。
    4. 加 3 个 composer 行为用例 → 13/13;cd core && node scripts/build-client.mjs,再 --check。
    5. 在能跑 git 的机器上 node scripts/ds-bot-patches.mjs generate && node scripts/ds-bot-patches.mjs check && node scripts/ds-bot-patches.mjs canonical(本机无 git 会拒绝,理由见 §4)。
    6. 写 changelog 与 docs 那一行;PR body 写齐,跑 TZ=UTC TMPDIR=/data/flybot-tmp npm run verify。

    PR body 的硬要求(enqueue-rules.mjs 逐字段拒):Fixes #<收口单> + Part of #3114(umbrella 只 Refs,不要关 #3114);Owner: Dev、Reviewer: Reviewer、Written-by: Dev;## Checkpoint 块(pr / claim / issue / summary / files 1–12 个且至少一个在本 PR diff / checks / next,整块 < 1500 字符);## Verification at the tip(Tip SHA:、Base:、Ran: 每条命令 + 结果、Not run: 与原因);标签 agent-pr。

    7. 标题

    建议的 PR 标题:Add a send-key shortcut: Shift+Enter to send, stored for this window (#3114)

    本刀收口单标题:[#3114] 发送快捷键:General → 快捷键 可在 Enter 与 Shift+Enter 发送之间切换(本窗口本地偏好)

    收口单正文用 Fixes #<收口单>,本 PR 写 Part of #3114。

  10. Birfy commented on Nov 18, 2026

    @Birfy
    CollaboratorAuthor

    Correction from issue-spec workflow:

    第四刀切片:发送快捷键(main 483fb8f) · 勘误,就地取代 12:55Z 那条的下列段落

    Written-by: Chief(2026-11-18T13:08Z 复核,main 483fb8fe2696b4e79735a505af77a878ce705423;行号取自 main 树,下面标「实测」的数字是在 main 树上真跑出来的)

    12:55Z 那条(#issuecomment-6979176591)的判定与骨架不变、继续有效:不换目标,只做发送快捷键一条线,外观不切(light/dark/auto/system 的 mode 归壳的主题服务,客户端只读 data-ds-dark-theme,setAttribute('data-ds-dark-theme') 全仓 0 命中);12 个文件(手写 6 + 生成 6);手写 +275/−3 = 278 行,T1;不碰 gate / .github/** / policy/** / core/src/shared/**。凡与本节冲突的,以本节为准。

    A. 必须改的事实(锚点、路径、归属)

    A1. §4「关于 git」那一句是错的,别照抄。 原文「若 Dev 那台也没有 git,check 仍可作本地自检…canonical 与 arch-docs 交 tip CI」不成立:canonical 在库里就是 CI 硬步骤——.github/workflows/test.yml 的 package job(L121)L133 node scripts/ds-bot-patches.mjs check、L135 node scripts/ds-bot-patches.mjs canonical;根 package.json 的 verify 也串了 node scripts/ds-bot-patches.mjs canonical。所以改成:没有 git 就做不完这一刀——generate 之后 canonical 必须本机绿(scripts/ds-bot-patches.mjs L375 generate needs git、L423 canonical needs git);只跑 check 会点名 5 个待重算路径,但那样提交上去 tip CI 的红是 check/canonical 自己给的,不是「交给 CI 替你跑」。

    A2. §1 里两处只写 index.js 要补全路径。 L174–L176(PREFS_KEY = STORAGE.prefs、读 localStorage 的 prefs 镜像)、L370 ctx.theme.overrideTokens('ds-bot', shellTokens(...))、L373 写回主题/强调色/动画,三处都只在 core/src/client/index.js(1133 行);core/index.js 只有 103 行,overrideTokens|localStorage 在那里 0 命中。不补全,Dev 会先去翻错文件。

    A3. §2.2 settings.js 的插入锚点与 main 不符(改错会把注释挂错段)。

    • const [sendKey, setSendKey] = useState(() => readSendKey()) 与 chooseSendKey 插在 L110 [custom, setCustom] 之后、L111 const timer = useRef(0) 之前(不是「L111 之后」)。
    • 可写分支的 Shortcuts 段插在 L144(强调色块收尾,input type="color" 那一行的 )))))之后、L145 之前。L145 是注释 // One switch for every system notification (#353), then one per kind (#469).——按原锚点插会把这条注释挂到 Shortcuts 上,和它注释的 Notifications 分开。
    • 只读分支不变:L125(只读 Appearance 的 Accent 行)之后、L126(Notifications 段)之前。
    • 附带:settings.js 从 composer 取的是 SEND_KEYS, readSendKey, writeSendKey 三个导出(composer.js 要 export 它们),不是只取 SEND_KEYS。

    A4. 三处范围数字要收窄/补尾。 Animation 段是 L193–L207(L193 MOTIONS、L194–L207 MotionSection;L209 起已是 BotsPage),不是 L193–L212;可写分支 Notifications 到 L155(L146 SetSection … L155 }))),),不是 L153;themes.js 的 shellTokens 是 L50–L57,不是 L50–L56。另:General 整段是 L105 注释 + L106–L157,原文的「L105–L153」两头都差。

    A5. §1 的 host setPrefs 锚点整体落在错行,统一挪到块首 if。 core/src/host/channel.js:L264 function setPrefs(body);theme L265 / accent L269 / motion L274 / notifications L280 / notify L286 / quietHours L300 / turnBudget L308;收尾是 L313 return rt.save()(L314 是 })。原文的 266/269/273/279/287/299/307 分别落在条件体、注释、const kinds 上,L314 是 } 不是 return。结论不变:逐字段白名单、未知键静默丢、没有兜底——所以 sendKey 走 setPrefs 不会持久化。

    A6. 补充证据里 CI pin 写反了。 test.yml L102 DSH: 0.2.1-rc.2(L61 的 job 名还留着 … DSH 0.2.0-rc.2,只是名字没跟着改);core/dev/harness/package.json L6 也是 0.2.1-rc.2;README.zh.md L108 明说 CI 跑的就是这一版。结论(本机与 CI 在这条行为上一致)不变,但别写成「CI pin 的是 0.2.0-rc.2 / 两版不同」。

    B. 红先那一步必须同时改的两处(否则红在别处、或直接死在 build)

    B1. localStorage 桩要同时改成可写。 core/test/settings-readonly-pages.test.js L64 现在是 localStorage: { getItem: () => null, setItem() {} }。只加两条 UI 用例而不动桩,它们会红在 stores is not defined,不是 /Shortcuts/、/Send shortcut/ 未命中。同一步加:const stores = new Map() 与 const storage = { getItem: key => (stores.has(key) ? stores.get(key) : null), setItem: (key, value) => { stores.set(key, String(value)) } },并把 L64 换成 localStorage: storage。

    B2. §2.4 漏了测试脚手架自己的两处改动(都在那 +131 里;不改 esbuild 直接报 No matching export,红先会先死在 build 上,没有断言可红):虚拟入口 L16–L22 要加一行 "export { installSendShortcut, shouldBreakOnKey, shouldSendOnKey } from './src/client/composer.js'";L73 的解构 const { SettingsDialog, InlineText, SwitchRow, Segmented, ModelMenu, FolderMenu } = module.exports 同步加这三个名字(改完这一行落到 L81)。

    C. 本次复核的实测(main 树上可复现,代替原文的「实测」)

    • 红先(只加 B1 的桩 + 两条 UI 用例 + counts 6→7,不加实现):# tests 10 / # pass 7 / # fail 3,三条红正是
      • a writable window keeps every page as it is today (#2474) → General keeps its four switches beside the send-key picker,6 !== 7
      • General offers Enter or Shift+Enter to send, and stores the choice for this window (#3114) → the choice has its own section
      • a read-only window names the send shortcut instead of drawing a picker (#3114) → the page still names the setting
    • 补实现后(含 B2 与 3 条 composer 行为用例):# tests 13 / # pass 13 / # fail 0。
    • node core/scripts/build-client.mjs --check → exit 0(core/client.js 24122 → 24252 行,+130/−0)。
    • 手写行数复核:composer +117 / settings +20 / i18n +5 / 测试 +131−3 / docs +1 / changelog +1 = +275 / −3 = 278,与原文一致(≤ T1 的 400)。

    D. PR body 口径修正(enqueue-rules.mjs 逐字段拒的部分)

    D1. Checkpoint 块必须带两行标记 <!-- flybot:checkpoint --> 与 <!-- /flybot:checkpoint -->,且各自独占一行(.github/scripts/enqueue-rules.mjs L371–L372;解析按整行比对,L376 markerAt)。只写 ## Checkpoint + 一个 JSON 会被判 no checkpoint。

    D2. 硬上限原文说得太松,逐条是:整块 < 1500 字符(L378)、summary ≤ 600 字符(L379,不是「3–5 句」就够)、next ≤ 300(L380)、files 1–12 个(L381)、checks.result ∈ green|red|none(L382)、checks.at 必须是完整 40 位 sha(L383 SHA40)。

    D3. 反向也要收一句:## Verification at the tip(.github/pull_request_template.md L6)与 Not run (and why):(L9)是模板字段,不是 enqueue 的逐字段拒——Not run: 早已不检查(.github/scripts/merge-gate.test.mjs L517)。照模板写齐即可,别把这两条并进「enqueue-rules 逐字段拒」。

    E. §5 的手点清单补一条(本刀最吃结构假设、且完全没被单测覆盖的地方)

    E1. 主路径依赖「在 [data-composer-card] 里按 aria-label|title|textContent 找到那个 Send 按钮」——单测里的 card 是 mock,这条没有被单测覆盖。手点清单必须写:真卡片里找得到 Send、Shift+Enter 按下后确实发出、Enter 换行。否则这条线坏了只会表现为「静默不发送」,不是报错。原文只把「Enter 换行」列为软点,那份清单不够。

    其余段落(§2 的文件级切片与生成物归属、§3 的 5 个用例名、§4 的 A1–A10 命令、§5 的边界、§6 的 6 步、§7 的两个标题)照 12:55Z 那条执行,只把本节的 A1–A6 / B1–B2 / C / D1–D3 / E1 覆盖上去。

    first_slice: 第四刀(发送快捷键)——本轮只切这一条线;外观 mode、Grove 配色、语言/折叠/Channels、host 持久化都不进本 PR。

  11. 60 remaining items

  12. Birfy commented on Nov 20, 2026

    @Birfy
    CollaboratorAuthor

    第三十四刀切片:项目看板 › 决策行「决策文件已不在」(main dd7599d)

    Written-by: Triage · Part of #3114 · 只出规格,不含实现;收口单由实现 PR 自己开
    基线 main dd7599d315bd762daa143e68cf622923dceca8ec(2026-11-20T09:26Z 两次 GET /repos/ThinkFlowLab/FlyBot/commits/main 相隔 2.5 s 同 sha,committer date 08:08:41Z;成稿前 09:42Z 复核仍是同 sha)。第三十三刀 §12 把这一句列为「下一刀候选」,本刀取它、不换项,可达性已按 §1 核到底(这本是一份新规格,不取代 09:09Z 的第三十三刀那条 7035287622)。
    读法:tarball/dd7599d3 全树取到 runs/i3114-cut34/repo;红树 runs/i3114-cut34/g(只放测试)、绿树 runs/i3114-cut34/gd(测试+实现+生成物)上实跑,数字见 §5/§6/§7。
    今天树上的行数:core/src/client/project-board.js 1225、core/src/client/i18n.js 1905、core/test/project-board-view.test.js 1037、core/client.js 的字典键在 :1645、画点在 :12831。

    0 目标(一句)

    中文窗口里,项目看板上「已决定的会议、但决策文件已经不在了」那一行读「决策文件已不在」;同一行的会议问题、@发言人、以及文件还在时显示的路径原样不译,英文窗口一字不变。

    1 选定项与可达性(先证打得到,再谈改法)

    画点:core/src/client/project-board.js:650-652

    meeting.path === ''
      ? h('span', { className: 'bt-project-missing' }, 'decision file gone')   // ← 裸字面量,没走 t()
      : h('span', { className: 'bt-project-path' }, meeting.path)

    这条键是给谁写的:core/src/client/i18n.js:1598-1602 的「看板记录」那一段,Decisions / Meetings / Not decided 与 'decision file gone': '决策文件已不在' 挨着写在一起——#1767 把这一屏搬进字典时就把这句一起写进去了,但画点一直没接 t()。所以今天这条键在字典里、在生成物 core/client.js:1645 里都有,grep 全仓只有 i18n.js:1602(键)与 project-board.js:651(裸画)两处,没有任何 t() 调用点是它的。

    path 从哪来、哪一步让它变成空串(一路读到界面):

    1. 宿主读:plugins/project/src/project-board.js:399-427。meetingsOf 先按 Project 过滤 rt.state.meetings;对 status === 'decided' 的会议取 meeting.decisionFile,在 decisions.files 的 known 表里找;找不到且不在本读的去重集 decisions.known 里(pastCut,:415-418)→ path: ''(:425)。
    2. known 表怎么来:decisionsOf(:277-382)先读 Project 工作目录(:281-295),再把每个 decided 会议自己记的 decisionDir 单文件读进来(archivedOf,:261-275)。文件夹读不出来时(:288-291,unreadable: …)直接返回 files: [] 且没有 known,于是该 Project 所有 decided 会议都落到 path: ''。
    3. path 不变地传:core/src/host/store.js:882-892(project-board 端点把 meetings 原样回给页面)→ core/src/client/project-board.js:195-224 的 meetingOf(path: text(meeting.path),:206)→ :250-285 的 projectBoardRecord 组装 meetings.decided → :643-652 的 decidedRows 画那一格。
    4. 今天宿主已经有测试证明这一步真的会发生:plugins/project/test/project-board.test.js:987-999——rmSync(join(teamDir, named)) 之后再读,断言 board.meetings.decided.map(entry => [entry.id, entry.path]) 是 [[id, '']],注释写的正是 a file that really was deleted still reads decision file gone。

    用户能走到的复现路径(中文窗口):

    1. 左侧酒单打开 Projects 列表(projects-nav.js:74 的 ProjectList),选一个 Project,进入看板(#project=<id>,project-board.js:1072 的 ProjectBoardOverlay;:1060 PROJECT_BOARD_POLL_MS = 5000,:1150 每 5 s 轮询)。
    2. 看板底部「决策 / 会议」记录区(project-board.js:672-688,ProjectBoardRecord)里,一个 data-status="decided" 的会议行右侧显示 decisions/YYYY-MM-DD-<slug>.md。
    3. 在文件管理器里删掉(或改名、移走)那个 .md;或者把这个 Project 的工作文件夹整个改名/移走(走 §1 第 2 步的 unreadable 分支,所有 decided 行一起变空)。
    4. 不关页面,等下一拍(≤5 s)或切走再切回:decisions 区变成空,会议行不会消失,那一格从路径变成 decision file gone(project-board.js:648-649 的注释:missing path 让读者看见文件不在了,而不是整行跟着文件消失)。
    5. 中文窗口里,这一格今天是英文 decision file gone;本刀之后读「决策文件已不在」。

    反面说明(免得误收):文件只是「老到掉出 200 行上限」时不是这个分支——:415-418 的 pastCut 会把名字当路径填回去,仍然画路径。所以这句只指「文件真的不在了/那个文件夹这一读拿不到」。

    2 同屏顺带核对,但不扩容

    同屏(project-board.js 的看板记录区)其余句子全部已经走 t(),逐条列键与字典行:

    屏上位置 键 字典 画点 状态
    记录区标题 Decisions i18n.js:1599 :679 t() 已译
    记录区标题 Meetings :1600 :682 t() 已译
    三个小标题 Not decided :1601 :685 t() 已译
    决策区空行 no decision file in {dir}/decisions :1678 :671 emptyLine → t() 已译
    决策区空行 no working folder: this Project names none :1679 :671 已译
    决策区空行 no decision file in any folder the record names :1680 :671 已译
    会议区空行 no meeting of this Project is recorded :1681 :282/:671 已译
    截断行 {count} more not shown :368 :667 t() 已译
    打开决策时 Reading the decision… / not listed 字典有 :613/:616 t() 已译
    团队块 Not set / No one in this pool yet. 字典有 :733/:754/:813 t() 已译

    同文件里没有第二处「字典有键、却裸画」的字面量:用仓里的扫描器 bareCopy(scripts/i18n-usage.mjs)扫 core/src/client/project-board.js,改动前恰好一条 651 "decision file gone",改动后 0 条;missingCopy 只剩 :433-438 的 {}s/{}m/{}h/{}d(时间单位,不是句子,见 §11)。所以下一刀候选不写同屏第二句,写的是别的屏(§12)。

    3 现状与改法(只改画点)

    • 字典条目已存在:core/src/client/i18n.js:1602 'decision file gone': '决策文件已不在',(生成物 core/client.js:1645 同)。
    • 英文原句不改:t() 在没有 locale 服务时原样返回 key(i18n.js:1882-1884),所以英文窗口仍是 decision file gone。
    • 唯一改动(core/src/client/project-board.js:651):
    -      ? h('span', { className: 'bt-project-missing' }, 'decision file gone')
    +      ? h('span', { className: 'bt-project-missing' }, t('decision file gone'))

    t 已经在文件头 import(project-board.js:6:import { dateLocale, hostText, language, t } from './i18n.js'),不需要新 import、不需要新组件、不需要新的 hostText 包装。

    4 改动范围(逐文件 +N/−M,在真树 g/gd 上实测)

    文件 +/− 什么
    core/src/client/project-board.js +1/−1 :651 一个字面量换成 t() 的实参
    core/test/project-board-view.test.js +34/−0 文件末尾第 38 例 + 两个局部辅助
    changelog.d/3114-cut-34-decision-file-gone.fixed.md +1/−0 一条 .fixed
    手写合计 +36/−1 = 37 行 / 3 文件
    生成物(跑 build + generate 之后自动产生,不许手改) +/−
    core/client.js +1/−1
    patches/ds-bot/0008-client-bundle.patch +1/−1
    patches/ds-bot/files/src/client/project-board.js +1/−1
    patches/ds-bot/files/test/project-board-view.test.js +34/−0
    生成合计 4 路径 / +37/−3
    • core/test/project-board-view.test.js 在 files/ 里是整文件镜像(上游 ds-bot 没有这个文件):实测 patches/ds-bot/files/test/project-board-view.test.js 由 1037 行变 1071 行(+34),而 patches/ds-bot/0001-core-fixes.patch 与 main 逐字节相同。所以本刀没有 0001 hunk,只有 files/ 镜像 + 0008。
    • patches/ds-bot/topics.json 逐字节不动。

    5 生成物与命令顺序(在 gd 里实跑,rc 全 0)

    test -d core/node_modules/esbuild && echo "esbuild present"   # 本机 core/node_modules 符号链接到 /data/esinst/node_modules;别跑 npm ci
    export TMPDIR=/data/flybot-tmp
    export PATH=/data/dsh/bot/workspace/tools/git/bin:$PATH
    export GIT_EXEC_PATH=/data/dsh/bot/workspace/tools/git/libexec/git-core
    (cd core && npm run build)                        # core/client.js
    node scripts/ds-bot-patches.mjs generate          # patches/ds-bot/*
    git add -A
    node scripts/ds-bot-patches.mjs generate          # 第二遍确认幂等(实测零 diff)
    git add -A
    git commit -m "Read the missing decision file in the window's language (#3114)" \
               -m "Docs-not-needed: one copy line in the Project board; no component structure changes."
    node scripts/ds-bot-patches.mjs canonical         # ok   patches/ds-bot/ is what generate writes (generate is a no-op)
    node scripts/ds-bot-patches.mjs check             # 三行 ok
    node core/scripts/build-client.mjs --check        # rc 0

    顺序:所有 core/ 改动落盘之后再 build + generate;颠倒会报 core/… : committed but not produced by the patches。
    坑:core/node_modules 这个符号链接会被 git add -A 当文件、被 generate 当目录 cpSync,本机实测两条路都踩过(ERR_FS_EISDIR);写进 .git/info/exclude 并 git rm --cached core/node_modules。

    6 测试(红先 → 绿,实测三数)

    加在哪、复用哪个辅助:core/test/project-board-view.test.js 文件末尾(main 1037 行之后)。复用同文件现成的 installLocale(:62 从 bundle 导出)、fakeLocale(active)(:706,三个钩子 register/bind/getLocale 齐全)、all(:98)、textOf(:109);只新增两个局部常量 goneRecord()(造一个 decisions: {files: []} + 一个 path: '' 的 decided 会议)与 missingSpan()。不新增 locale 辅助——该文件只有一个 fakeLocale,再写一个同名会 SyntaxError。

    用例名(第 38 例):#3114 cut 34: a decided meeting whose file is gone reads in the window language

    断言(一条用例内,顺序即红先顺序):

    1. 未装 locale:textOf(missingSpan()) === 'decision file gone'(英文窗口一字不变;实现前就是绿的)。
    2. 装 fakeLocale('zh') 后:textOf(missingSpan()) === '决策文件已不在'(红先唯一红的一条)。
    3. 同一行仍是 data-status="decided";行文本仍含 Which board carries the record? 与 @Chief(会议问题、发言人是宿主数据,不译);行文本含 决策文件已不在。

    一个必须写进测试的坑: .bt-project-missing 这个 class 在屏幕上出现 4 次(:651、:733、:754、:813),后三个画 t('Not set') / t('No one in this pool yet.')。直接 all(...).find(className === 'bt-project-missing') 会先命中 Not set(本机第一次红先的 actual 就是 Not set)。必须先按 data-status === 'decided' 找到决策行,再在行内找 span——规格里的 missingSpan() 就是这么写的。

    红先实测(g=干净 dd7599d3 + 只放新测试;(cd core && TZ=UTC node --test test/project-board-view.test.js)):

    not ok 38 - #3114 cut 34: a decided meeting whose file is gone reads in the window language
      expected: '决策文件已不在'
      actual: 'decision file gone'
    # tests 38 / # pass 37 / # fail 1
    

    补实现后实测(gd):# tests 38 / # pass 38 / # fail 0。干净 main 单文件是 37/37/0。
    五道 i18n 门(test/i18n.test.js + 四道):红树、绿树都 39/39/0(本刀不新增/不改字典,门数不变)。

    环境基线:本机 plugins/project/test/* 跑不了(缺 @deepseek-ai/dsh-llm,ERR_MODULE_NOT_FOUND),core/test/project-board-panels.test.js 同样因宿主 harness 缺失而红;这些不计入本刀,可判定的门都在 core/test/ 的纯 client 用例里。

    7 验收(每条一条可复制命令 + 一句断言)

    • A1 红先:git checkout $(git merge-base HEAD origin/main) -- core/src/client/project-board.js && (cd core && TZ=UTC node --test test/project-board-view.test.js) → # tests 38 / # pass 37 / # fail 1,失败断言 expected: '决策文件已不在' / actual: 'decision file gone';随后 git checkout HEAD -- core/src/client/project-board.js 复原。
    • A2 绿:(cd core && TZ=UTC node --test test/project-board-view.test.js) → 38 / 38 / 0。
    • A3 中文整句逐字:A2 的例 38 通过(zh 下 textOf 逐字等于 决策文件已不在)。
    • A4 英文一字不变(画出来的字):同一例第 1 条断言通过;git diff origin/main...HEAD -- core/src/client/project-board.js | grep '^+' | grep -c 'decision file gone' → 1(字面量只是变成 t() 的实参,字符未改)。
    • A5 只改画点:git diff origin/main...HEAD -- core/src/client/project-board.js | grep -c '^-[^-]' → 1;... | grep -c '^+[^+]' → 1;把两侧的 t(...) 拆掉后必须塌成同一行:git diff -U0 origin/main...HEAD -- core/src/client/project-board.js | grep '^[-+]' | grep -v '^\(---\|+++\)' | sed "s/^-//; s/^+//; s/t('decision file gone')/'decision file gone'/" | sort -u | wc -l → 1(class、prop、缩进都没动,只有子节点从字面量变成 t() 的实参)。
    • A6 裸字面量归零:grep -c "t('decision file gone')" core/src/client/project-board.js → 1;grep -c "}, 'decision file gone'" core/src/client/project-board.js → 0;grep -o 'decision file gone' core/src/client/project-board.js | wc -l → 1。注意:Chief 给的 grep -c "decision file gone" 改前改后都是 1,按字面判不了(键文本留着当实参),用上面三条代替。
    • A7 字典一行不动:git diff --name-only origin/main...HEAD | grep -c 'core/src/client/i18n.js' → 0;grep -c "'decision file gone': '决策文件已不在'" core/src/client/i18n.js → 1。
    • A8 五道 i18n 门:(cd core && TZ=UTC node --test test/i18n.test.js test/i18n-missing-entries.test.js test/i18n-template-draws.test.js test/i18n-plugins.test.js test/i18n-plugins-missing-zh.test.js) → 39 / 39 / 0。
    • A9 三基线未动:§7 末尾那条 node -e 命令 → 12 ok / 9 ok / 46 ok。
    • A10 生成物自洽:node core/scripts/build-client.mjs --check rc 0;提交后 git diff --exit-code -- core/client.js rc 0。
    • A11 patch 自洽:node scripts/ds-bot-patches.mjs check → 三行全 ok(ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5)、ok 10 patches apply cleanly in order、ok core/ equals ds-bot/ + patches/ds-bot/);canonical → ok patches/ds-bot/ is what generate writes (generate is a no-op);git status --porcelain 为空。
    • A12 topics.json 不动:git diff --name-only origin/main...HEAD | grep -c 'topics.json' → 0。
    • A13 changelog:node .github/scripts/changelog.mjs check → changelog: 14 fragment(s) in changelog.d/ are well formed(main 13,本刀 +1)。
    • A14 编码:node .github/scripts/check-mojibake.mjs --check 首行 mojibake: ok — 0 occurrences of U+FFFD in 1783 text file(s)(main 1782,本刀 +1 个 changelog),rc 0。
    • A15 档位(断言字段):见 §9 的内联命令 → T1 0 37 3 4。
    • A16 预算:git diff --numstat origin/main...HEAD | awk '$3 !~ /^(core\/client\.js|patches\/)/ {s+=$1+$2; f++} END {print s, f}' → 37 3。
    • A17 文档门:分支 commit 与 PR 正文各一条 Docs-not-needed: one copy line in the Project board; no component structure changes.;ARCH_DOCS_BASE=origin/main node core/scripts/check-arch-docs.mjs → arch-docs: OK (7 changed file(s)),rc 0(本机在含 7 条改动路径的树上实测;缺 trailer 会红)。
    • A18 禁改面零改动:git diff --name-only origin/main...HEAD | grep -cE '^(core/src/host/|core/src/client/about\.js|core/src/client/capability-settings\.js|patches/ds-bot/topics\.json|core/test/i18n-.*\.baseline\.json)$' → 0。

    A9 的那条命令:

    node -e 'for (const [f,w] of [["core/test/i18n-plugins.baseline.json",12],["core/test/i18n-template-draws.baseline.json",9],["core/test/i18n-missing-entries.baseline.json",46]]) { const n = JSON.parse(require("fs").readFileSync(f,"utf8")).entries.length; console.log(f, n, n===w?"ok":"MISMATCH") }'

    8 changelog 片段正文

    changelog.d/3114-cut-34-decision-file-gone.fixed.md(一条,.fixed):

    A decided meeting whose decision file is gone now says so in a Chinese window instead of drawing the English words decision file gone (#3114).

    9 createGate 实测档位

    node --input-type=module -e 'import{createGate,loadRules}from"./.github/scripts/risk-gate.mjs";const r=createGate(loadRules("./.github/agent/risk-rules.json")).judge([{filename:"core/src/client/project-board.js",additions:1,deletions:1},{filename:"core/test/project-board-view.test.js",additions:34,deletions:0},{filename:"changelog.d/3114-cut-34-decision-file-gone.fixed.md",additions:1,deletions:0},{filename:"core/client.js",additions:1,deletions:1},{filename:"patches/ds-bot/0008-client-bundle.patch",additions:1,deletions:1},{filename:"patches/ds-bot/files/src/client/project-board.js",additions:1,deletions:1},{filename:"patches/ds-bot/files/test/project-board-view.test.js",additions:34,deletions:0}]);console.log(r.tier,r.why.length,r.lines,r.files,r.generated)'

    → T1 0 37 3 4(实测;why.length 为 0,lines/files/generated 依次 37/3/4)。T1 的依据:三个手写路径全在 T1 名单(core/src/client/**、core/test/**、changelog.d/**),生成物走 generatedPaths;diffPatterns/diffPatternsNotInTests 0 命中。T1 不需要 PASS:tip 上 tests-ok 绿 + mergeable + 设计合规即可入队。

    10 分步(≤6 步)

    1. 从 live main(开工时重读 /git/ref/heads/main)切分支;先只加测试:core/test/project-board-view.test.js 末尾追加 §6 的 34 行 → 实测 38 / 37 / 1。
    2. 改 core/src/client/project-board.js:651 为 t('decision file gone')(+1/−1)→ 同一条命令实测 38 / 38 / 0;跑 A8(39/39/0)与 A9(12/9/46)。
    3. 加 changelog 片段(§8),changelog.mjs check → 14 片段。
    4. 按 §5 的顺序:确认 esbuild 在 → npm run build → generate → 再 generate → commit → canonical → check → build-client --check(rc 全 0);确认 topics.json 没进 diff、git status 干净。
    5. 跑 A15 档位(T1 0 37 3 4)、A16 预算(37 3)、A14 编码(1783 文件 0 处 U+FFFD);PR 正文与分支 commit 各写一条 Docs-not-needed:。
    6. 开收口单(bug area:ui)与 PR:Fixes #<收口单> + Part of #3114(绝不把关闭关键字指向伞号 [#3110] 已落地聊天壳、设置、搜索与历史命中的收口 #3114)+ Owner: / Reviewer: / ## Checkpoint + tip sha + 红绿三数。

    11 建议标题

    • PR 标题:Read the missing decision file in the window's language (#3114)
    • 收口单标题:项目看板:决策文件已不在的行按窗口语言显示(Cut 34)
    • 本评论标题:## 第三十四刀切片:项目看板 › 决策行「决策文件已不在」(main dd7599d3)

    12 下一刀候选(本刀不夹带)

    1. about.js:97 的 'Star' + core/src/host/dsh-update.js:142/143(一条,不是两条):按钮裸画 Star,同屏 No DSH update is available / This DSH updates with its app 也裸着;译名要 owner 定(i18n.js:788 的 Star: '星星' 已被角色形状占用,不能直接复用),放 needs-human。
    2. 能力页剩下的两处:capability-settings.js:14 的 Could not connect: {error}(已在 t() 里)与 BotCapabilitiesCard 的状态行;{error} 是第三方/MCP 的连接原话,译到什么程度要 owner 定,needs-human。
    3. sidebar.js:281/286 的 DSH Agent(palette.js:97/101 同串):产品实体名,不按句子处理,除非 owner 明确要本地化产品名。
    4. project-board.js:433-438 的 {}s/{}m/{}h/{}d:时间单位不是句子;missingCopy 会报,但那是数据形状,Cut 33 §12.5 已决定不本地化单位。
    5. 同屏已无第二处「有键裸画」(§2 的扫描实测 0 条),所以这一屏在本刀收口;下一刀应换屏,不要在这份 PR 里顺手加句。

    13 风险 / 不做的事

    • 不碰 core/src/host/:一行不改;宿主把 path 置空的行为保持原样(本刀只改画点)。
    • 不碰 about.js:97 的 Star(译名要 owner 定,needs-human)、不碰 capability-settings.js:14 的 Could not connect: {error}。
    • 不改字典:core/src/client/i18n.js 0 行改动(条目 :1602 是既有的);不改英文原句、不改大小写、不加句号。
    • 不改三基线(12/9/46)、不改 patches/ds-bot/topics.json、不手改 files/ 镜像与 core/client.js。
    • 不动 bt-project-missing 的样式与 prop(:46 的 CSS 一行不动);path 的数据不参与翻译(非空分支原样画路径)。
    • 不再包一次 hostText:这句是页面自己的拷贝,不是宿主消息,直接 t()。
    • 不跑 npm ci、不 git add core/node_modules 符号链接(会 ERR_FS_EISDIR)。
    • 不做纯 UX 调整、不加配置键、不合并成一条“顺手”的 i18n 清理。

    first_slice:整刀就是第一刀——3 个手写文件 / 37 行(产品 +1/−1、测试 +34、changelog 1 行)+ 4 个生成路径(core/client.js +1/−1、0008 +1/−1、files/src +1/−1、files/test +34),只把 :651 一个字面量换成 t() 的实参,可独立成 PR(Fixes #<收口单> + Part of #3114)。预算余 313 行 / 17 文件,档位 T1(T1 0 37 3 4,实测)。


    Part of #3114 · first_slice:整刀就是第一刀 —— 1 行产品 + 34 行测试 + 1 行 changelog,t('decision file gone') 一个改动,可独立成 PR。

  13. Birfy commented on Nov 20, 2026

    @Birfy
    CollaboratorAuthor

    第三十四刀切片:项目看板 › 决策行「决策文件已不在」(main 422a672)

    Written-by: Triage · Part of #3114 · 只出规格,不含实现;收口单由实现 PR 自己开
    基线 main 422a672c6e277ae741f08744f63e3073f7da9657(2026-11-20T10:19Z 两次 GET /repos/ThinkFlowLab/FlyBot/commits/main 相隔 2.5 s 同 sha;10:08Z 的两次读取也是这个 sha。committer date 2026-11-20T10:00:05Z:这是把第三十三刀(能力页带名拒绝句)合进来的 #3262)。注意:09:57Z 审规格时的基线 dd7599d3 已被这一刀顶掉,本稿的行号/计数全部在 422a672c 上重测(core/src/client/project-board.js、core/test/project-board-view.test.js 两文件与 dd7599d3 逐字节相同,故画点仍是 :651;i18n.js 只在其 :1738 之后加了 7 行,本刀引用的键全部在 :1602-1681,行号不变)。
    读法:tarball/422a672c 全树取到 runs/i3114-cut34/n2base;红树 runs/i3114-cut34/n2(只放测试)、绿树 runs/i3114-cut34/n2g(测试+实现+生成物)上实跑,数字见 §5/§6/§7;旧基线 dd7599d3 的 repo/g/gd 只留作对照。
    今天树上的行数:core/src/client/project-board.js 1225、core/src/client/i18n.js 1912、core/test/project-board-view.test.js 1037、core/client.js 的字典键在 :1645、画点在 :12838(dd7599d3 上画点是 :12831,cut 33 的 7 行把 bundle 推后了)。

    0 目标(一句)

    中文窗口里,项目看板上「已决定的会议、但决策文件已经不在了」那一行读「决策文件已不在」;同一行的会议问题、@发言人、以及文件还在时显示的路径原样不译,英文窗口一字不变。

    1 选定项与可达性(先证打得到,再谈改法)

    画点:core/src/client/project-board.js:650-652

    meeting.path === ''
      ? h('span', { className: 'bt-project-missing' }, 'decision file gone')   // ← 裸字面量,没走 t()
      : h('span', { className: 'bt-project-path' }, meeting.path)

    这条键是给谁写的:core/src/client/i18n.js:1598-1602 的「看板记录」那一段,Decisions / Meetings / Not decided 与 'decision file gone': '决策文件已不在' 挨着写在一起——#1767 把这一屏搬进字典时就把这句一起写进去了,但画点一直没接 t()。所以今天这条键在字典里、在生成物 core/client.js:1645 里都有。grep -rn "decision file gone"(未生成树,去掉 node_modules)命中 7 个文件,其中源文件只有两处:core/src/client/i18n.js:1602(键)与 core/src/client/project-board.js:651(裸画)——没有任何 t() 调用点用它。其余五处都是派生或上下文,不许手改:镜像 patches/ds-bot/files/src/client/project-board.js:651、生成物 core/client.js:1645 与 :12838、patches/ds-bot/0001-core-fixes.patch(字典 hunk 的新增行)、patches/ds-bot/0008-client-bundle.patch(bundle 里的字典行与画点行),以及宿主测试 plugins/project/test/project-board.test.js:885/962/987 的注释与断言文案。CHANGELOG.md:602 是历史记录,不算。

    path 从哪来、哪一步让它变成空串(一路读到界面):

    1. 宿主读:plugins/project/src/project-board.js:399-427。meetingsOf 先按 Project 过滤 rt.state.meetings;对 status === 'decided' 的会议取 meeting.decisionFile,在 decisions.files 的 known 表里找;找不到且不在本读的去重集 decisions.known 里(pastCut,:415-418)→ path: ''(:425)。
    2. known 表怎么来:decisionsOf(:277-382)先读 Project 工作目录(:281-295),再把每个 decided 会议自己记的 decisionDir 单文件读进来(archivedOf,:261-275)。文件夹读不出来时(catch 在 :288,unreadable: 的 return 在 :289,块到 :290)直接返回 files: [] 且没有 known,于是该 Project 所有 decided 会议都落到 path: ''。
    3. path 不变地传:core/src/host/store.js:882-892(project-board 端点把 meetings 原样回给页面)→ core/src/client/project-board.js:195-224 的 meetingOf(path: text(meeting.path),:206)→ :250-285 的 projectBoardRecord 组装 meetings.decided → :643-652 的 decidedRows 画那一格。
    4. 今天宿主已经有测试证明这一步真的会发生:plugins/project/test/project-board.test.js:975-993(#1809: a default install lists the team-folder decision, and a real delete still reads gone)——:989 rmSync(join(teamDir, named)) 之后再读,:991 断言 board.meetings.decided.map(entry => [entry.id, entry.path]) 是 [[id, '']],:987 注释写的正是 a file that really was deleted still reads decision file gone;:999 已经是下一个测试,不算在内。

    用户能走到的复现路径(中文窗口):

    1. 左侧酒单打开 Projects 列表(projects-nav.js:74 的 ProjectList),选一个 Project,进入看板(#project=<id>,project-board.js:1072 的 ProjectBoardOverlay;:1060 PROJECT_BOARD_POLL_MS = 5000,:1150 每 5 s 轮询)。
    2. 看板底部「决策 / 会议」记录区(ProjectBoardRecord 定义在 :598,它 return 的记录区 <section> 在 :672-688)里,一个 data-status="decided" 的会议行右侧显示 decisions/YYYY-MM-DD-<slug>.md。
    3. 在文件管理器里删掉(或改名、移走)那个 .md;或者把这个 Project 的工作文件夹整个改名/移走(走 §1 第 2 步的 unreadable 分支,所有 decided 行一起变空)。
    4. 不关页面,等下一拍(≤5 s)或切走再切回:decisions 区变成空,会议行不会消失,那一格从路径变成 decision file gone(project-board.js:648-649 的注释:missing path 让读者看见文件不在了,而不是整行跟着文件消失)。
    5. 中文窗口里,这一格今天是英文 decision file gone;本刀之后读「决策文件已不在」。

    反面说明(免得误收):文件只是「老到掉出 200 行上限」时不是这个分支——:415-418 的 pastCut 会把名字当路径填回去,仍然画路径。所以这句只指「文件真的不在了/那个文件夹这一读拿不到」。

    2 同屏顺带核对,但不扩容

    同屏(project-board.js 的看板记录区)里已译的句子逐条列键与状态如下;但这一屏不是全译——表格之后单列的两处没有走字典,本刀不碰,写进 §12 当下一刀候选:

    屏上位置 键 字典 画点 状态
    记录区标题 Decisions i18n.js:1599 :679 t() 已译
    记录区标题 Meetings :1600 :682 t() 已译
    三个小标题 Not decided :1601 :685 t() 已译
    决策区空行 no decision file in {dir}/decisions :1678 :671 emptyLine → t() 已译
    决策区空行 no working folder: this Project names none :1679 :671 已译
    决策区空行 no decision file in any folder the record names :1680 :671 已译
    会议区空行 no meeting of this Project is recorded :1681 :282/:671 已译
    截断行 {count} more not shown :368 :667 t() 已译
    打开决策时 Reading the decision… / not listed 字典有 :613/:616 t() 已译
    团队块 Not set / No one in this pool yet. 字典有 :733/:754/:813 t() 已译

    同屏还没有译的两处(都在「未决定」那一段,本刀一行不改;理由见 §12.1/§12.2):

    屏上位置 今天画什么 字典 / 画点 为什么不是本刀
    :663 span.bt-project-status meeting.status 裸画 open / deliberating / blocked 字典没有这三个键(同屏 not-started / in-progress / done 在 i18n.js:1609-1611 是有键的);画点 :663 没包 t() 要先定三个键与译名,还要动 i18n.js 与 4 个生成物——不是「一个 t()」
    :661 span.bt-project-paused meeting.advance.reason,宿主 advanceRefusal 的英文句子(plugins/project/src/host.js:54 绑定) 画点 :661 直接画,没走 hostText 宿主句子走 hostText 还是走键、以及 advanceRefusal 的措辞,要 owner 定;还要 host 侧用例

    「字典有键、却裸画」的字面量在本文件里仍然只有 :651 这一条:用仓里的扫描器 bareCopy(scripts/i18n-usage.mjs)扫 core/src/client/project-board.js,改动前恰好一条 651 "decision file gone",改动后 0 条;missingCopy 只剩 :433-438 的 {}s/{}m/{}h/{}d(时间单位,不是句子,见 §12.6)。但扫描器只认字面量,漏掉上表两处动态值,所以「这一屏已经全译」不成立——本刀只收 :651 一句,不夹带。

    3 现状与改法(只改画点)

    • 字典条目已存在:core/src/client/i18n.js:1602 'decision file gone': '决策文件已不在',(生成物 core/client.js:1645 同)。
    • 英文原句不改:t() 在没有 locale 服务时原样返回 key(i18n.js:1882-1884),所以英文窗口仍是 decision file gone。
    • 唯一改动(core/src/client/project-board.js:651):
    -      ? h('span', { className: 'bt-project-missing' }, 'decision file gone')
    +      ? h('span', { className: 'bt-project-missing' }, t('decision file gone'))

    t 已经在文件头 import(project-board.js:6:import { dateLocale, hostText, language, t } from './i18n.js'),不需要新 import、不需要新组件、不需要新的 hostText 包装。

    4 改动范围(逐文件 +N/−M,在真树 n2/n2g 上实测)

    文件 +/− 什么
    core/src/client/project-board.js +1/−1 :651 一个字面量换成 t() 的实参
    core/test/project-board-view.test.js +34/−0 文件末尾第 38 例 + 两个局部辅助
    changelog.d/3114-cut-34-decision-file-gone.fixed.md +1/−0 一条 .fixed
    手写合计 +36/−1 = 37 行 / 3 文件
    生成物(跑 build + generate 之后自动产生,不许手改) +/−
    core/client.js +1/−1
    patches/ds-bot/0008-client-bundle.patch +1/−1
    patches/ds-bot/files/src/client/project-board.js +1/−1
    patches/ds-bot/files/test/project-board-view.test.js +34/−0
    生成合计 4 路径 / +37/−3
    • core/test/project-board-view.test.js 在 files/ 里是整文件镜像(上游 ds-bot 没有这个文件):实测 patches/ds-bot/files/test/project-board-view.test.js 由 1037 行变 1071 行(+34),而 patches/ds-bot/0001-core-fixes.patch 与 main 逐字节相同。所以本刀没有 0001 hunk,只有 files/ 镜像 + 0008。
    • patches/ds-bot/topics.json 逐字节不动。

    5 生成物与命令顺序(在 n2g 里实跑,rc 全 0)

    test -d core/node_modules/esbuild && echo "esbuild present"   # 本机 core/node_modules 符号链接到 /data/esinst/node_modules;别跑 npm ci
    export TMPDIR=/data/flybot-tmp
    export PATH=/data/dsh/bot/workspace/tools/git/bin:$PATH
    export GIT_EXEC_PATH=/data/dsh/bot/workspace/tools/git/libexec/git-core
    (cd core && npm run build)                        # core/client.js
    node scripts/ds-bot-patches.mjs generate          # patches/ds-bot/*
    git add -A
    node scripts/ds-bot-patches.mjs generate          # 第二遍确认幂等(实测零 diff)
    git add -A
    git commit -m "Read the missing decision file in the window's language (#3114)" \
               -m "Docs-not-needed: one copy line in the Project board; no component structure changes."
    node scripts/ds-bot-patches.mjs canonical         # ok   patches/ds-bot/ is what generate writes (generate is a no-op)
    node scripts/ds-bot-patches.mjs check             # 三行 ok
    node core/scripts/build-client.mjs --check        # rc 0

    顺序:所有 core/ 改动落盘之后再 build + generate;颠倒会报 core/… : committed but not produced by the patches。
    坑:core/node_modules 这个符号链接会被 git add -A 当文件、被 generate 当目录 cpSync,本机实测两条路都踩过(ERR_FS_EISDIR);写进 .git/info/exclude 并 git rm --cached core/node_modules。

    6 测试(红先 → 绿,实测三数)

    加在哪、复用哪个辅助:core/test/project-board-view.test.js 文件末尾(main 1037 行之后)。复用同文件现成的 installLocale(:62 从 bundle 导出)、fakeLocale(active)(:706,三个钩子 register/bind/getLocale 齐全)、all(:98)、textOf(:109);只新增两个局部常量 goneRecord()(造一个 decisions: {files: []} + 一个 path: '' 的 decided 会议)与 missingSpan()。不新增 locale 辅助——该文件只有一个 fakeLocale,再写一个同名会 SyntaxError。

    用例名(第 38 例):#3114 cut 34: a decided meeting whose file is gone reads in the window language

    断言(一条用例内,顺序即红先顺序):

    1. 未装 locale:textOf(missingSpan()) === 'decision file gone'(英文窗口一字不变;实现前就是绿的)。
    2. 装 fakeLocale('zh') 后:textOf(missingSpan()) === '决策文件已不在'(红先唯一红的一条)。
    3. 同一行仍是 data-status="decided";行文本仍含 Which board carries the record? 与 @Chief(会议问题、发言人是宿主数据,不译);行文本含 决策文件已不在。

    一个必须写进测试的坑: .bt-project-missing 这个 class 在屏幕上出现 4 次(:651、:733、:754、:813),后三个画 t('Not set') / t('No one in this pool yet.')。直接 all(...).find(className === 'bt-project-missing') 会先命中 Not set(本机第一次红先的 actual 就是 Not set)。必须先按 data-status === 'decided' 找到决策行,再在行内找 span——规格里的 missingSpan() 就是这么写的。

    红先实测(n2=干净 422a672c + 只放新测试;(cd core && TZ=UTC node --test test/project-board-view.test.js)):

    not ok 38 - #3114 cut 34: a decided meeting whose file is gone reads in the window language
      expected: '决策文件已不在'
      actual: 'decision file gone'
    # tests 38 / # pass 37 / # fail 1
    

    补实现后实测(n2g):# tests 38 / # pass 38 / # fail 0。干净 422a672c 单文件是 37/37/0。
    五道 i18n 门(test/i18n.test.js + 四道):红树、绿树都 41/41/0(422a672c 上 cut 33 加了两例,门数从 39 变 41;本刀不新增/不改字典,红绿同数)。

    环境基线:本机 plugins/project/test/* 跑不了(缺 @deepseek-ai/dsh-llm,ERR_MODULE_NOT_FOUND),core/test/project-board-panels.test.js 同样因宿主 harness 缺失而红;这些不计入本刀,可判定的门都在 core/test/ 的纯 client 用例里。

    7 验收(每条一条可复制命令 + 一句断言)

    • A1 红先:git checkout $(git merge-base HEAD origin/main) -- core/src/client/project-board.js && (cd core && TZ=UTC node --test test/project-board-view.test.js) → # tests 38 / # pass 37 / # fail 1,失败断言 expected: '决策文件已不在' / actual: 'decision file gone';随后 git checkout HEAD -- core/src/client/project-board.js 复原。
    • A2 绿:(cd core && TZ=UTC node --test test/project-board-view.test.js) → 38 / 38 / 0。
    • A3 中文整句逐字:A2 的例 38 通过(zh 下 textOf 逐字等于 决策文件已不在)。
    • A4 英文一字不变(画出来的字):同一例第 1 条断言通过;git diff origin/main...HEAD -- core/src/client/project-board.js | grep '^+' | grep -c 'decision file gone' → 1(字面量只是变成 t() 的实参,字符未改)。
    • A5 只改画点:git diff origin/main...HEAD -- core/src/client/project-board.js | grep -c '^-[^-]' → 1;... | grep -c '^+[^+]' → 1;把两侧的 t(...) 拆掉后必须塌成同一行:git diff -U0 origin/main...HEAD -- core/src/client/project-board.js | grep '^[-+]' | grep -v '^\(---\|+++\)' | sed "s/^-//; s/^+//; s/t('decision file gone')/'decision file gone'/" | sort -u | wc -l → 1(class、prop、缩进都没动,只有子节点从字面量变成 t() 的实参)。
    • A6 裸字面量归零:grep -c "t('decision file gone')" core/src/client/project-board.js → 1;grep -c "}, 'decision file gone'" core/src/client/project-board.js → 0;grep -o 'decision file gone' core/src/client/project-board.js | wc -l → 1;更直接的一条:grep -n 'decision file gone' core/src/client/project-board.js | grep -v "t('decision file gone')" | wc -l → 0(删掉那行 t() 之后什么都不剩)。注意:Chief 给的 grep -c "decision file gone" 改前改后都是 1,按字面判不了(键文本留着当实参),用上面四条代替。
    • A7 字典一行不动:git diff --name-only origin/main...HEAD | grep -c 'core/src/client/i18n.js' → 0;grep -c "'decision file gone': '决策文件已不在'" core/src/client/i18n.js → 1。
    • A8 五道 i18n 门:(cd core && TZ=UTC node --test test/i18n.test.js test/i18n-missing-entries.test.js test/i18n-template-draws.test.js test/i18n-plugins.test.js test/i18n-plugins-missing-zh.test.js) → 41 / 41 / 0(红树、绿树实测同数)。
    • A9 三基线未动:§7 末尾那条 node -e 命令 → 12 ok / 9 ok / 46 ok。
    • A10 生成物自洽:node core/scripts/build-client.mjs --check rc 0;提交后 git diff --exit-code -- core/client.js rc 0。
    • A11 patch 自洽:node scripts/ds-bot-patches.mjs check → 三行全 ok(ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5)、ok 10 patches apply cleanly in order、ok core/ equals ds-bot/ + patches/ds-bot/);canonical → ok patches/ds-bot/ is what generate writes (generate is a no-op);git status --porcelain 为空。
    • A12 topics.json 不动:git diff --name-only origin/main...HEAD | grep -c 'topics.json' → 0。
    • A13 changelog:node .github/scripts/changelog.mjs check → changelog: 15 fragment(s) in changelog.d/ are well formed(main 14——422a672c 已含 cut 33 的片段,本刀 +1)。
    • A14 编码:node .github/scripts/check-mojibake.mjs --check 的首行以 mojibake: ok — 0 occurrences of U+FFFD in 1784 text file(s) 开头,rc 0(main 1783,本刀 +1 个 changelog)。实测这行后面还跟着 (23 skipped as binary: core/test/fixtures/usage-sample.sqlite, docs/assets/wechat-group.png, docs/images/demo-face.gif, +20 more)——别照抄整行,否则会假红;断言只看前缀与 rc。
    • A15 档位(断言字段):见 §9 的内联命令 → T1 0 37 3 4。
    • A16 预算:git diff --numstat origin/main...HEAD | awk '$3 !~ /^(core\/client\.js|patches\/)/ {s+=$1+$2; f++} END {print s, f}' → 37 3。
    • A17 文档门:分支 commit 与 PR 正文各一条 Docs-not-needed: one copy line in the Project board; no component structure changes.;ARCH_DOCS_BASE=origin/main node core/scripts/check-arch-docs.mjs → arch-docs: OK (7 changed file(s)),rc 0(本机在含 7 条改动路径的树上实测;缺 trailer 会红)。
    • A18 禁改面零改动:git diff --name-only origin/main...HEAD | grep -cE '^(core/src/host/|core/src/client/about\.js$|core/src/client/capability-settings\.js$|patches/ds-bot/topics\.json$|core/test/i18n-.*\.baseline\.json$)' → 0;再加一条不依赖组合正则的:git diff --name-only origin/main...HEAD | grep -c '^core/src/host/' → 0。正控(证明这道门真能打中):printf 'core/src/host/store.js\ncore/src/client/about.js\ncore/src/client/project-board.js\n' | grep -cE '^(core/src/host/|core/src/client/about\.js$|core/src/client/capability-settings\.js$|patches/ds-bot/topics\.json$|core/test/i18n-.*\.baseline\.json$)' → 2。旧写法是坏门:^(core/src/host/|…)$ 把 host/ 用 $ 钉死,同一输入只回 1(host 文件永远匹配不到),所以本条必须带上正控,否则「0」证明不了任何事。

    A9 的那条命令:

    node -e 'for (const [f,w] of [["core/test/i18n-plugins.baseline.json",12],["core/test/i18n-template-draws.baseline.json",9],["core/test/i18n-missing-entries.baseline.json",46]]) { const n = JSON.parse(require("fs").readFileSync(f,"utf8")).entries.length; console.log(f, n, n===w?"ok":"MISMATCH") }'

    8 changelog 片段正文

    changelog.d/3114-cut-34-decision-file-gone.fixed.md(一条,.fixed):

    A decided meeting whose decision file is gone now says so in a Chinese window instead of drawing the English words decision file gone (#3114).

    9 createGate 实测档位

    node --input-type=module -e 'import{createGate,loadRules}from"./.github/scripts/risk-gate.mjs";const r=createGate(loadRules("./.github/agent/risk-rules.json")).judge([{filename:"core/src/client/project-board.js",additions:1,deletions:1},{filename:"core/test/project-board-view.test.js",additions:34,deletions:0},{filename:"changelog.d/3114-cut-34-decision-file-gone.fixed.md",additions:1,deletions:0},{filename:"core/client.js",additions:1,deletions:1},{filename:"patches/ds-bot/0008-client-bundle.patch",additions:1,deletions:1},{filename:"patches/ds-bot/files/src/client/project-board.js",additions:1,deletions:1},{filename:"patches/ds-bot/files/test/project-board-view.test.js",additions:34,deletions:0}]);console.log(r.tier,r.why.length,r.lines,r.files,r.generated)'

    → T1 0 37 3 4(实测;why.length 为 0,lines/files/generated 依次 37/3/4)。T1 的依据:三个手写路径全在 T1 名单(core/src/client/**、core/test/**、changelog.d/**),生成物走 generatedPaths;diffPatterns/diffPatternsNotInTests 0 命中。T1 不需要 PASS:tip 上 tests-ok 绿 + mergeable + 设计合规即可入队。

    10 分步(≤6 步)

    1. 从 live main(开工时重读 /git/ref/heads/main)切分支;先只加测试:core/test/project-board-view.test.js 末尾追加 §6 的 34 行 → 实测 38 / 37 / 1。
    2. 改 core/src/client/project-board.js:651 为 t('decision file gone')(+1/−1)→ 同一条命令实测 38 / 38 / 0;跑 A8(41/41/0)与 A9(12/9/46)。
    3. 加 changelog 片段(§8),changelog.mjs check → 15 片段(main 14)。
    4. 按 §5 的顺序:确认 esbuild 在 → npm run build → generate → 再 generate → commit → canonical → check → build-client --check(rc 全 0);确认 topics.json 没进 diff、git status 干净。
    5. 跑 A15 档位(T1 0 37 3 4)、A16 预算(37 3)、A14 编码(1784 文件 0 处 U+FFFD);PR 正文与分支 commit 各写一条 Docs-not-needed:。
    6. 开收口单(bug area:ui)与 PR:Fixes #<收口单> + Part of #3114(绝不把关闭关键字指向伞号 [#3110] 已落地聊天壳、设置、搜索与历史命中的收口 #3114)+ Owner: / Reviewer: / ## Checkpoint + tip sha + 红绿三数。

    11 建议标题

    • PR 标题:Read the missing decision file in the window's language (#3114)
    • 收口单标题:项目看板:决策文件已不在的行按窗口语言显示(Cut 34)
    • 本评论标题:## 第三十四刀切片:项目看板 › 决策行「决策文件已不在」(main 422a672c)

    12 下一刀候选(本刀不夹带)

    1. 同屏 · 未决定行的状态(§2 第一处):core/src/client/project-board.js:663 的 span.bt-project-status 裸画 meeting.status(open / deliberating / blocked),字典没有这三个键(同屏 not-started / in-progress / done 在 i18n.js:1609-1611 是有键的)。要加三个键 + 动 i18n.js 与 4 个字典生成物,还得给中文译名,属另一刀(仍 T1,但比本刀大一档)。
    2. 同屏 · 未决定行的暂停原因(§2 第二处)::661 的 span.bt-project-paused 裸画 meeting.advance.reason——宿主 advanceRefusal 的英文句子(plugins/project/src/host.js:54 绑定,plugins/project/src/project-board.js:226-227 拼进 advance.reason),没走 hostText。走 hostText 还是走键、措辞由谁定,要 owner 拍板(needs-human),还要一条 host 侧用例。
    3. about.js:97 的 'Star' + core/src/host/dsh-update.js:142/143(一条,不是两条):按钮裸画 Star,同屏 No DSH update is available / This DSH updates with its app 也裸着;译名要 owner 定(i18n.js:788 的 Star: '星星' 已被角色形状占用,不能直接复用),放 needs-human。
    4. 能力页剩下的两处:capability-settings.js:14 的 Could not connect: {error}(已在 t() 里)与 BotCapabilitiesCard 的状态行;{error} 是第三方/MCP 的连接原话,译到什么程度要 owner 定,needs-human。
    5. sidebar.js:281/286 的 DSH Agent(palette.js:97/101 同串):产品实体名,不按句子处理,除非 owner 明确要本地化产品名。
    6. project-board.js:433-438 的 {}s/{}m/{}h/{}d:时间单位不是句子;missingCopy 会报,但那是数据形状,Cut 33 §12.5 已决定不本地化单位。
    7. 这一屏没有全收口:本刀只把 :651 收进 t();同屏还剩 §12.1/§12.2 两处未译(都不是字面量,bareCopy 扫不到),下一刀可以继续在这一屏,但要先定键/译名,不要塞进这份 PR。

    13 风险 / 不做的事

    • 不碰 core/src/host/:一行不改;宿主把 path 置空的行为保持原样(本刀只改画点)。
    • 不碰 about.js:97 的 Star(译名要 owner 定,needs-human)、不碰 capability-settings.js:14 的 Could not connect: {error}。
    • 不改字典:core/src/client/i18n.js 0 行改动(条目 :1602 是既有的);不改英文原句、不改大小写、不加句号。
    • 不改三基线(12/9/46)、不改 patches/ds-bot/topics.json、不手改 files/ 镜像与 core/client.js。
    • 不动 bt-project-missing 的样式与 prop(:46 的 CSS 一行不动);path 的数据不参与翻译(非空分支原样画路径)。
    • 不再包一次 hostText:这句是页面自己的拷贝,不是宿主消息,直接 t()。
    • 不碰同屏那两处未译::663 的 meeting.status 与 :661 的 meeting.advance.reason(§2 与 §12.1/§12.2);本 PR 只动 :651,这两处留给下一刀。
    • 不跑 npm ci、不 git add core/node_modules 符号链接(会 ERR_FS_EISDIR)。
    • 不做纯 UX 调整、不加配置键、不合并成一条“顺手”的 i18n 清理。

    first_slice:整刀就是第一刀——3 个手写文件 / 37 行(产品 +1/−1、测试 +34、changelog 1 行)+ 4 个生成路径(core/client.js +1/−1、0008 +1/−1、files/src +1/−1、files/test +34),只把 :651 一个字面量换成 t() 的实参,可独立成 PR(Fixes #<收口单> + Part of #3114)。预算余 313 行 / 17 文件,档位 T1(T1 0 37 3 4,实测)。

    14 修订记录(针对 09:57Z 审规格 14c6 的 7 条)

    7 条全部采纳(每条都先在树上重跑过才改,不是照抄):

    # 意见 处理
    1 A18 正则 ^(core/src/host/|…)$ 是坏门(host 永远匹配不到) 已改:每个分支各自锚 $;加正控 `printf 'core/src/host/store.js\ncore/src/client/about.js\ncore/src/client/project-board.js\n' | grep -cE '^(core/src/host/
    2 §1「全仓只有两处」不成立 已改:源文件两处 + 5 个派生/上下文文件(共 7 个),逐个点名——整文件镜像、client.js 两行、0001/0008 两个 patch、宿主测试的注释/断言文案
    3 §1 第 4 条 :987-999 错 已改 :975-993(:989 删文件、:991 断言、:987 注释;:999 已是下一个测试)
    4 §1 第 2 条 :288-291、ProjectBoardRecord 位置 已改 :288-290(unreadable: 的 return 在 :289);ProjectBoardRecord 定义在 :598,:672-688 是它 return 的记录区 <section>
    5 §2「其余全部走 t()」与 §12.5「本屏收口」不成立 已改:§2 新增「同屏还没有译的两处」小表(:663 的 meeting.status、:661 的 meeting.advance.reason);§12 增列 1/2 两条候选,并删掉「这一屏在本刀收口」
    6 A14 首行后面还跟着 (23 skipped as binary: …) 已改成断言「首行以前缀开头」,并把实测后缀写进 A14,免得照抄整行假红
    7 A6 建议再加一条直判 已加 grep -n 'decision file gone' core/src/client/project-board.js | grep -v "t('decision file gone')" | wc -l → 0

    不在意见里、但必须报的一件事:10:00Z main 从 dd7599d3 走到 422a672c(cut 33 的 #3262 合入)。本稿全部数字在 422a672c 上重测:project-board.js 与视图测试逐字节不变(画点仍 :651);i18n.js 只在 :1738 之后加了 7 行(本刀引用的键都在 :1598-1681,行号不变);core/client.js 的字典键仍在 :1645、画点从 :12831 推到 :12838。计数随之变:i18n 门 41/41/0(原 39)、changelog 15(main 14)、mojibake 1784 文件(main 1783)。红/绿 38/37/1 → 38/38/0、T1 0 37 3 4、三基线 12/9/46、预算 37/3、canonical/check/build-client --check rc 0,全部在 n2/n2g 复跑过。

    本评论取代 09:45Z 发的同题草稿 7036312252(那份的 A18 是坏门、§1 三处行号错、§2 漏两处未译)。


    Part of #3114 · first_slice:整刀就是第一刀 —— 1 行产品 + 34 行测试 + 1 行 changelog,t('decision file gone') 一个改动,可独立成 PR。

  14. Birfy commented on Nov 20, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage

    Cut 34 规格以 7037067194 为准

    • 规格全文:评论 7037067194(21882 字符,2026-11-20T10:21:10Z,基线 main 422a672c6e277ae741f08744f63e3073f7da9657)。
    • 同一 issue 上 09:45:28Z 的 7036312252 是草稿,已被取代:它按旧基线 dd7599d3 写,A18 的禁改面正则是坏门(core/src/host/ 后紧跟 $,永远匹配不到 host 文件),§1 三处行号错(宿主证据 :975-993、unreadable: 的 return 在 :289、ProjectBoardRecord 在 :598),§2 漏了同屏两处未译(:663 的 meeting.status、:661 的 meeting.advance.reason)。实现与评审只按 7037067194。
    • 10:24Z 在 live main 上复核(两次 GET /repos/ThinkFlowLab/FlyBot/commits/main 相隔 2.5 s 同 sha 422a672c):画点 core/src/client/project-board.js:651 仍是裸字面量 'decision file gone'、字典 core/src/client/i18n.js:1602 仍在、core/test/project-board-view.test.js 1037 行、project-board.js 1225 行、i18n.js 1912 行——与规格里的数字一致,不需要按新基线重算。
    • 本刀仍未开工:无实现 PR、无收口单;动手时仍要按规格 §10 第 1 步重读 /git/ref/heads/main。
  15. Birfy commented on Nov 20, 2026

    @Birfy
    CollaboratorAuthor

    第三十五刀切片:项目看板 › 会议状态三键(main 641faf1)

    Written-by: Triage · Part of #3114 · 只出规格,不含实现;收口单由实现 PR 自己开
    基线 main 641faf101bcbebe5bbc946c95ef6b16b2f4e1f9b(GET /repos/ThinkFlowLab/FlyBot/commits/main 读于 2026-11-20T11:16Z、11:26:19Z、11:31:06Z 三次同 sha;committer date 2026-11-20T11:01:33Z,即 cut 34 的 #3264)。
    读法:tarball/641faf10 全树取到 runs/i3114-cut35/repo;红树 runs/i3114-cut35/red(干净 641faf1 + 只放新测试)、绿树 runs/i3114-cut35/repo2(+ 实现 + 生成物)上实跑。下面每个计数都带「读于 <UTC> / 基线 641faf1」。
    今天树上的行数(读于 11:16Z / 641faf1):core/src/client/project-board.js 1225、core/src/client/i18n.js 1912、core/test/project-board-view.test.js 1071、core/client.js 25097(字典插入点 :1658、画点 :12849)。改完:i18n 1917、测试 1109、bundle 25102(字典 :1659-1663、画点 :12854)。
    修订(读于 2026-11-20T11:41–11:48Z / 同基线 641faf1):§7 的三基线、档位两条与 §8 的 A5 / A9 / A14 / A15 / A17 补成可直接复制的命令(A5 原稿用 … 代指前半条命令)(原稿留了 <9 条改动文件>、<同一条正则> 两个占位符,且基线只写数字没有命令);A14 的编码门改成「干净归档树」口径(worktree 的 .git 是文件,会被计成一个文本文件)。产品改动面、译名、红绿三数、其余门不变。

    0 目标(一句)

    中文窗口里,项目看板「未决定」那一段的会议状态读「待讨论 / 讨论中 / 待答复」,不再裸画宿主的 open / deliberating / blocked;data-status 属性、会议问题、发言人、层级与英文窗口一字不变。

    1 选定项与可达性(先证打得到)

    画点:core/src/client/project-board.js:663(641faf10 上仍是裸值)

    h('span', { className: 'bt-project-status' }, meeting.status)))

    这一格的值只有三个,且同源于 :656 的 data-status:

    1. 宿主的会议生命周期:core/src/host/meetings.js:1-3 的注释就是 open → deliberating → decided | blocked;:278 建会写 status: 'open';:307/:321 第一次记位(含记为 silent)后 open → deliberating;:443 decide 写 decided;:531 block 写 blocked 且必带一句 blocking question(:529-532);:545 resume 把 blocked 送回 deliberating。OPEN_STATES = ['open','deliberating'](:25)。
    2. 读模型只把三个未决状态放进 pending:plugins/project/src/project-board.js:432 的 if (meeting.status === 'open' || … === 'deliberating' || … === 'blocked')(原文三个或),:437 status: meeting.status 原样带出;decided 在 :409 走另一支。:430-431 的注释就是这条约定。
    3. 端点原样回:core/src/host/store.js:881-892(meetings: sections.meetings ?? …)。
    4. 客户端:core/src/client/project-board.js:254 meetingOf(item, item?.status ?? 'deliberating') → :656 'data-status': meeting.status → :663 画同一个字段。decided 行走 :643('data-status': 'decided'),永远不经过 :663。

    所以「旧记录里的别的 status」不会漏进来:读模型在 :432 就把不是这三个的挡掉了;客户端只有 :254 一个缺省(没有 status 时按 deliberating)。新用例另加一条 on-hold(宿主不会发)证明客户端不猜形状、原样透传。

    data-status 属性不许翻译:它是给测试与样式用的 id,同屏的旧用例已经在按 id 断言 —— core/test/project-board-view.test.js:256-257 断言 data-status 恰好是 ['decided','deliberating']。本刀的新用例也断言四个 data-status 都是宿主 id。

    这三个串在客户端源码里的语义(读于 11:16–11:31Z / 641faf1,grep -rn "'open'\|'blocked'\|'deliberating'" core/src/client/):

    命中 语义 是否进 t()
    project-board.js:254 ?? 'deliberating' 会议状态缺省 之后进 :663
    project-board.js:360 { group: 'blocked', label: 'Blocked' } 队列分组 id / 大写标签 标签走 t('Blocked')(大写键,另一个键)
    kanban.js:142 case 'blocked': return t('Blocked') 卡片状态 大写键
    kanban.js:287、inbox.js:297 卡片状态比较,不画 否
    speech.js:55 captureError('blocked') 麦克风错误码 否(画的是失败句)

    结论:小写 t('open') / t('blocked') / t('deliberating') 全仓 0 处;blocked 另有卡片语义,但那条路走大写键与 STATUSES[...].label 间接表,不落进小写键。

    2 键名:用裸键 open / deliberating / blocked(实测三条依据)

    1. 没有既存冲突:全仓 grep -rn "t('open')\|t('blocked')\|t('deliberating')"(去 node_modules)→ 0 命中;字典里也没有同名键(grep -nE "^ *(open|blocked|deliberating):" core/src/client/i18n.js → 0)。注意 i18n.js:1614-1615 的 running/stalled 是卡片租约语义,与本刀无关,也不复用。
    2. 动态 t(<expr>) 的取值域不重叠:core/src/client 里所有 t(标识符) 调用逐条核对过,这一屏只有四处把宿主 id 喂进 t(),值域互不相交 —— :396 t(row.column) 是看板列(not-started/in-progress/done,:1609-1611 已有键);:550 t(row.status) 只可能是 claimed/working(plugins/project/src/project-metrics.js:114-116 的 runningOf 只放这两类);:570 t(row.state) 只可能是 running/stalled(project-board.js:353 的三元);:642 t(meeting.level) 只可能是 ordinary/major/severe(core/src/host/meetings.js:25 的 CLASSES)。
    3. 不会动基线:基线都是插件扫描的(plugins/*/client.js,四份里前三份即本刀三基线)。node scripts/i18n-usage.mjs → 12 bare draws、--missing → 46 drawn copy strings,逐条查过没有 open/deliberating/blocked(读于 11:16–11:31Z / 641faf1)。加三个裸键后重跑:五道 i18n 门仍 41/41/0、四份基线仍 12 / 9 / 46 / 2(§7 实测)。
    4. 先例:这一屏本来就是「id 当键」—— done: '已完成'(:1611,done 是个更泛的词)、running/stalled(:1614-1615,注释 :1612-1613 明写 "so the ids that read emits are keys of their own")、ordinary/major/severe(:1604-1606),并且 t(meeting.level) / t(row.state) / t(row.status) 就是同一种写法。

    为什么不用前缀键(如 meeting open):那要在画点现造键(t(\meeting ${meeting.status}`))或加一张三行映射表,等于在唯一调用点发明一个本屏没有的约定;而本屏已有三个同样的「id 即键」。裸键的代价是一条写进 §11 的推论:将来谁写 t(task.status),blocked会读成「待答复」—— 但done` 今天就是这个风险,且真有冲突时改法仍是「字典换前缀键 + 一个映射」,不是正则。

    3 中文译名(建议 + 一句 A/B)

    id 建议 依据
    open 待讨论 会议已建、还没有人记位(meetings.js:278 之后第一次 position 才转 deliberating);与 未开始/进行中/已完成 同语域,但不复用 未开始——那是看板列,不是会议
    deliberating 讨论中 与 运行中 同形(动词 + 中),且这是唯一「人正在说」的状态
    blocked 待答复 宿主在 blocked 时必须给一句 blocking question,resume 用答复把它送回 deliberating(meetings.js:527-545),所以它是「等人答」;不写「阻塞」这种工程词

    需要 owner 拍板的一句(A/B,不卡本刀):blocked 读「待答复」(默认,贴合宿主「必须给一句 blocker、答复后回到讨论中」)还是「已搁置」(更强调停在这里)?两者都只改字典一个值 + 测试一处字符串,本刀按默认写。

    4 改动面(逐文件 +N/−M,在绿树 repo2 上 git diff --numstat 实测,读于 11:16–11:31Z / 641faf1)

    文件 +/− 具体改什么
    core/src/client/project-board.js +1/−1 :663 子节点 meeting.status → t(meeting.status)(t 已在 :6 import,无新 import、无新组件)
    core/src/client/i18n.js +5/−0 :1616 之前插入 2 行注释 + open: '待讨论' / deliberating: '讨论中' / blocked: '待答复'(紧跟 running/stalled 那一块,:1612-1615)
    core/test/project-board-view.test.js +38/−0 文件末尾第 39 例 + 局部辅助(pendingRecord() / pendingRow() / statusOf())
    changelog.d/3114-cut-35-meeting-status.fixed.md +1/−0 一条 .fixed(正文见 §10)
    手写合计 +45/−1 = 46 行 / 4 文件
    生成物(npm run build + generate 之后产生,不许手改) +/−
    core/client.js +6/−1(字典 5 行落在 :1659-1663,画点 :12849 → :12854)
    patches/ds-bot/0001-core-fixes.patch +6/−1(i18n.js 是上游文件,走 patch;hunk 头 @@ -838,6 +838,94 @@ → 99,另加 5 行新增行)
    patches/ds-bot/0008-client-bundle.patch +7/−2(bundle 的字典与画点两处 hunk)
    patches/ds-bot/files/src/client/project-board.js +1/−1(整文件镜像)
    patches/ds-bot/files/test/project-board-view.test.js +38/−0(整文件镜像)
    生成合计 5 路径 / +58/−5 = 63 行
    • patches/ds-bot/files/src/client/i18n.js 不存在(i18n.js 是上游文件,靠 0001 的 hunk 进去;实测 ls 报 No such file),所以本刀没有 i18n 的 files/ 镜像。
    • patches/ds-bot/topics.json 逐字节不动(git diff --name-only | grep -c topics.json → 0,实测)。
    • 整刀合计 9 路径 / 109 行(git diff --shortstat HEAD~1 → 9 files changed, 103 insertions(+), 6 deletions(-))。

    5 生成顺序与命令(在 repo2 实跑,rc 全 0)

    test -d core/node_modules/esbuild && echo "esbuild present"   # 本机符号链接到 /data/esinst/node_modules;别跑 npm ci
    export TMPDIR=/data/flybot-tmp
    export PATH=/data/dsh/bot/workspace/tools/git/bin:$PATH        # 本机 git 在 tools/ 下;正常 clone 不需要
    export GIT_EXEC_PATH=/data/dsh/bot/workspace/tools/git/libexec/git-core
    (cd core && npm run build)                        # core/client.js
    node scripts/ds-bot-patches.mjs generate          # patches/ds-bot/*
    git add -A
    node scripts/ds-bot-patches.mjs generate          # 第二遍确认幂等(实测零 diff)
    git add -A
    git commit -m "Read a meeting's state in the window's language (#3114)" \
               -m "Docs-not-needed: three dictionary keys and one t() in the Project board; no component structure changes."
    node scripts/ds-bot-patches.mjs canonical         # ok   patches/ds-bot/ is what generate writes (generate is a no-op)
    node scripts/ds-bot-patches.mjs check             # 三行 ok
    node core/scripts/build-client.mjs --check        # rc 0

    顺序:所有 core/ 改动落盘之后再 build + generate;颠倒会报 core/… : committed but not produced by the patches。坑同 cut 34:core/node_modules 这个符号链接会被 git add -A 当文件、被 generate 当目录 cpSync(ERR_FS_EISDIR)—— 写进 .git/info/exclude,别让它进 index。

    6 红先 → 绿(实测三数,读于 11:19–11:31Z / 641faf1)

    加在哪:core/test/project-board-view.test.js 文件末尾(main 1071 行之后),复用现成的 installLocale(:62 从 bundle 导出)、fakeLocale(active)(:706)、all(:98)、textOf(:109);不新增 locale 辅助(该文件只有一个 fakeLocale,再写一个同名会 SyntaxError)。

    用例名:#3114 cut 35: a meeting still open, deliberating or blocked reads its state in the window language

    四个状态行(pendingRecord()):open/ordinary、deliberating/major、blocked/severe + blockingQuestion、以及宿主不会发的 on-hold(兜底)。

    断言(顺序即红先顺序):

    1. 未装 locale:statusOf('meeting-b') === 'blocked'(英文窗口一字不变;实现前就是绿的)。
    2. 装 fakeLocale('zh'):open → 待讨论(红先命中的第一条)、deliberating → 讨论中、blocked → 待答复。
    3. on-hold 仍读 on-hold(不猜形状、原样透传)。
    4. 四行的 data-status 分别是 open/deliberating/blocked/on-hold(属性不译)。
    5. 行文本仍含 Which stream carries it?(宿主 blocking question 原话)与 严重(层级仍走 t())。

    红先实测(红树 = 干净 641faf1 + 只放新测试;(cd core && TZ=UTC node --test test/project-board-view.test.js)):

    not ok 39 - #3114 cut 35: a meeting still open, deliberating or blocked reads its state in the window language
      error: an open meeting
      'open' !== '待讨论'
      expected: '待讨论'
      actual: 'open'
    # tests 39 / # pass 38 / # fail 1
    

    (另外两条中文断言同形,红先停在第一条;绿树一次全过。)

    补实现 + 生成物后实测(绿树):# tests 39 / # pass 39 / # fail 0。干净 641faf1 单文件是 38/38/0。

    五道 i18n 门(test/i18n.test.js + 四道)红树、绿树都 41/41/0(本刀给字典加键,但不动 i18n.test.js)。

    7 五道门 / 四份基线 / 档位 / 预算(全部实测,读于 11:19–11:48Z / 641faf1)

    • i18n 五件套:(cd core && TZ=UTC node --test test/i18n.test.js test/i18n-missing-entries.test.js test/i18n-template-draws.test.js test/i18n-plugins.test.js test/i18n-plugins-missing-zh.test.js) → 41 / 41 / 0(改前改后同数;红树、绿树各跑一遍,读于 11:30Z / 11:45Z)。

    • 基线(四份 core/test/i18n-*.baseline.json,本刀要的是前三份):条数用这条命令读,别用 wc/grep 数行:

      node -e "for (const f of ['i18n-plugins','i18n-template-draws','i18n-missing-entries','i18n-plugins-missing-zh']) console.log(f, require('./core/test/'+f+'.baseline.json').entries.length)"

      实测(读于 11:44–11:45Z / 641faf1 干净树,entries.length):i18n-plugins 12、i18n-template-draws 9、i18n-missing-entries 46、i18n-plugins-missing-zh 2 → 改后同四数(git diff --name-only origin/main...HEAD | grep -c 'baseline.json' → 0)。前三个就是任务说的三基线 12 / 9 / 46,第四个 i18n-plugins-missing-zh(2 条)同样是基线、同样不许手改,别漏。
      每一份的唯一生成命令(本刀实测四条都 +0/-0、文件逐字节不变,所以一条都不用跑):

      node scripts/i18n-usage.mjs --write core/test/i18n-plugins.baseline.json                       # wrote 12 entries (+0/-0)
      node scripts/i18n-usage.mjs --missing --write core/test/i18n-missing-entries.baseline.json     # wrote 46 entries (+0/-0)
      node scripts/i18n-usage.mjs --template-draws --write core/test/i18n-template-draws.baseline.json # wrote 9 entries (+0/-0)
      node core/test/i18n-plugins-missing-zh.test.js --write                                          # wrote 2 entries (+0/-0)

      第四份不在 i18n-usage.mjs 的 CLI 里(那个脚本只有默认 / --missing / --template-draws 三种扫描),它在自己的测试文件里 --write;writeBaseline 默认拒绝变大(要 --force)。本刀一份都不变,所以一条 --write 都不跑;若将来某份必须变,写清是哪条命令产生的、并只提交该命令写出的文件。

    • changelog.mjs check:main 15 → 本刀 16(changelog: 16 fragment(s) in changelog.d/ are well formed)。

    • check-mojibake.mjs --check:main 1784 文件 / 0 处 U+FFFD → 本刀 1785 / 0,rc 0。实测首行后面还跟着 (23 skipped as binary: …),别照抄整行。口径必须是「干净检出」:scanTree 只跳过目录 .git,而 git worktree 的 .git 是普通文件,会被算成一个文本文件 —— 同一棵本刀树,归档检出测到 1785,worktree 里测到 1786。所以先在干净归档上量:

      rm -rf /tmp/mj-branch && mkdir -p /tmp/mj-branch && git archive HEAD | tar -x -C /tmp/mj-branch
      (cd /tmp/mj-branch && node .github/scripts/check-mojibake.mjs --check | head -1)   # → 1785 text file(s)
      rm -rf /tmp/mj-main && mkdir -p /tmp/mj-main && git archive origin/main | tar -x -C /tmp/mj-main
      (cd /tmp/mj-main && node .github/scripts/check-mojibake.mjs --check | head -1)     # → 1784 text file(s)

      等价断言:本刀 = main 归档实测数 + 本刀新增的文本文件数(本刀只多 1 个 changelog.d/…fixed.md,所以 1785)。在 worktree 里跑请自行减掉那个 .git。

    • build-client.mjs --check rc 0;ds-bot-patches check 三行 ok(ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5) / ok 10 patches apply cleanly in order / ok core/ equals ds-bot/ + patches/ds-bot/);canonical ok;第二遍 generate 零 diff。

    • 档位(实测 T1 0 46 4 5 —— tier T1、why.length 0、lines 46、files 4、generated 5)。judge() 吃的是 PR files 对象({filename, additions, deletions, changes, patch}),不是文件名数组:直接喂 9 个字符串实测 T0 0 0 9 0(低一档、照抄会静默过关),喂 9 个对象但不带 patch 实测 T3 4 46 4 5(4 条 diff not inspectable:)。所以照抄这一段:

      BASE=origin/main node --input-type=module -e "
      import { createGate, loadRules } from './.github/scripts/risk-gate.mjs'
      import { execFileSync } from 'node:child_process'
      const base = process.env.BASE
      const raw = execFileSync('git', ['diff', '--numstat', base + '...HEAD'], { encoding: 'utf8' }).trim().split('\n')
      const files = raw.map((l) => { const [a, d, p] = l.split('\t'); return { filename: p, additions: +a, deletions: +d, changes: +a + +d } })
      for (const f of files) if (f.changes > 0) f.patch = execFileSync('git', ['diff', base + '...HEAD', '--', f.filename], { encoding: 'utf8' })
      const r = createGate(loadRules('.github/agent/risk-rules.json')).judge(files)
      console.log(r.tier, r.why.length, r.lines, r.files, r.generated)
      "
      # → T1 0 46 4 5

      在 runs/i3114-cut35/repo2(该树的 base 是本地提交 42e96e6 = 干净 641faf1)上以 BASE=42e96e6 实跑,输出同上(读于 11:44Z)。
      告警:只 console.log(r.tier, r.why.length, r.lines, r.files, r.generated),不要 console.log(gate.judge(files))(会打印整个对象,把 basis 等内部字段带进 CI 日志)。

    • 预算:T1 上限 400 行 / 20 文件(.github/agent/risk-rules.json 的 limits.T1),本刀手写 46 行 / 4 文件 → 余 354 行 / 16 文件。

    • 文档门:分支 commit 与 PR 正文各一条 Docs-not-needed: three dictionary keys and one t() in the Project board; no component structure changes.;ARCH_DOCS_BASE=origin/main node core/scripts/check-arch-docs.mjs → arch-docs: OK (9 changed file(s)),rc 0(缺 trailer 会红,本机实测 rc 1)。

    8 验收清单(每条一个 $ 命令或一个断言)

    • A1 红先:git checkout $(git merge-base HEAD origin/main) -- core/src/client/i18n.js core/src/client/project-board.js && (cd core && TZ=UTC node --test test/project-board-view.test.js) → # tests 39 / # pass 38 / # fail 1,失败断言 expected: '待讨论' / actual: 'open';随后 git checkout HEAD -- core/src/client/i18n.js core/src/client/project-board.js 复原。

    • A2 绿:(cd core && TZ=UTC node --test test/project-board-view.test.js) → 39 / 39 / 0。

    • A3 中文逐字:A2 的例 39 通过(zh 下三个 span 逐字等于 待讨论 / 讨论中 / 待答复)。

    • A4 英文一字不变:同一例第 1 条断言通过;git diff origin/main...HEAD -- core/src/client/project-board.js | grep '^+' | grep -c 'meeting.status' → 1。

    • A5 只改画点:git diff origin/main...HEAD -- core/src/client/project-board.js | grep -c '^-[^-]' → 1;git diff origin/main...HEAD -- core/src/client/project-board.js | grep -c '^+[^+]' → 1;把 t(...) 拆掉必须塌成同一行:git diff -U0 origin/main...HEAD -- core/src/client/project-board.js | grep '^[-+]' | grep -v '^\(---\|+++\)' | sed 's/^[-+]//; s/t(meeting.status)/meeting.status/' | sort -u | wc -l → 1。

    • A6 字典只加不改:git diff origin/main...HEAD -- core/src/client/i18n.js | grep -c '^-[^-]' → 0;grep -cE "^ (open|deliberating|blocked): '" core/src/client/i18n.js → 3。

    • A7 属性不译:grep -c "'data-status': meeting.status" core/src/client/project-board.js → 1;grep -c "bt-project-status' }, meeting.status" core/src/client/project-board.js → 0。

    • A8 五道 i18n 门:§7 的命令 → 41 / 41 / 0。

    • A9 四份基线未动(前三份即三基线):
      git diff --name-only origin/main...HEAD | grep -c 'baseline.json' → 0;
      node -e "for (const f of ['i18n-plugins','i18n-template-draws','i18n-missing-entries','i18n-plugins-missing-zh']) console.log(f, require('./core/test/'+f+'.baseline.json').entries.length)" → i18n-plugins 12 / i18n-template-draws 9 / i18n-missing-entries 46 / i18n-plugins-missing-zh 2(改前改后同四数,读于 11:44Z)。四份都由 §7 列的那四条 --write 命令生成,不许手改。

    • A10 生成物自洽:node core/scripts/build-client.mjs --check rc 0;提交后 git diff --exit-code -- core/client.js rc 0。

    • A11 patch 自洽:node scripts/ds-bot-patches.mjs check 三行 ok;canonical ok;git status --porcelain 为空。

    • A12 topics.json 不动:git diff --name-only origin/main...HEAD | grep -c 'topics.json' → 0。

    • A13 changelog:node .github/scripts/changelog.mjs check → changelog: 16 fragment(s) in changelog.d/ are well formed(main 15)。

    • A14 编码(干净归档树口径;worktree 会多算 .git 这个文件):
      rm -rf /tmp/mj-branch && mkdir -p /tmp/mj-branch && git archive HEAD | tar -x -C /tmp/mj-branch && (cd /tmp/mj-branch && node .github/scripts/check-mojibake.mjs --check | head -1) 首行以 mojibake: ok — 0 occurrences of U+FFFD in 1785 text file(s) 开头,rc 0;同法对 origin/main 归档 → 1784。本机实测:归档 HEAD 1785、归档 main 1784、worktree HEAD 1786(多 1 = .git 文件)。

    • A15 档位:§7 的内联片段(BASE=origin/main … judge(files),对象带 patch)→ T1 0 46 4 5;同片段把 files 换成 9 个文件名字符串应为 T0 0 0 9 0(低一档的陷阱),不带 patch 应为 T3 4 46 4 5。

    • A16 预算:git diff --numstat origin/main...HEAD | awk '$3 !~ /^(core\/client\.js|patches\/)/ {s+=$1+$2; f++} END {print s, f}' → 46 4。

    • A17 禁改面零改动 + 正控:把同一条正则原样写两遍(grep -c 计数为 0 时退出码是 1,那是「零改动」的正常结果,不是失败):

      RE='^(core/src/host/|core/src/client/about\.js$|core/src/client/capability-settings\.js$|core/src/client/sidebar\.js$|patches/ds-bot/topics\.json$|core/test/i18n-.*\.baseline\.json$)'
      git diff --name-only origin/main...HEAD | grep -cE "$RE"     # → 0(rc 1)
      printf 'core/src/host/store.js\ncore/src/client/about.js\ncore/src/client/sidebar.js\ncore/src/client/project-board.js\n' | grep -cE "$RE"   # → 3(正控:同一条正则真能打中)

      实测(读于 11:44Z / runs/i3114-cut35/repo2,base 42e96e6):改动面 0(rc 1)、正控 3(rc 0)。

    • A18 文档门:PR 正文与分支 commit 各一条 Docs-not-needed: …;ARCH_DOCS_BASE=origin/main node core/scripts/check-arch-docs.mjs → arch-docs: OK (9 changed file(s)),rc 0。

    • A19 整刀大小:git diff --shortstat origin/main...HEAD → 9 files changed, 103 insertions(+), 6 deletions(-)。

    9 分步(≤6 步)

    1. 从 live main(开工时重读 /git/ref/heads/main)切分支;先只加测试:core/test/project-board-view.test.js 末尾追加 §6 的 38 行 → 实测 39 / 38 / 1。
    2. 改 core/src/client/project-board.js:663 为 t(meeting.status)(+1/−1),并在 core/src/client/i18n.js 的 running/stalled 之后插 5 行(2 行注释 + 3 条键)→ 实测 39 / 39 / 0;跑 A8(41/41/0)与 A9(四份基线 12 / 9 / 46 / 2,命令见 §8)。
    3. 加 changelog 片段(§10),changelog.mjs check → 16 片段(main 15)。
    4. 按 §5 的顺序:确认 esbuild 在 → npm run build → generate → 再 generate → commit(带 Docs-not-needed:)→ canonical → check → build-client --check(rc 全 0);确认 topics.json 没进 diff、git status 干净。
    5. 跑 A15 档位(§7 片段 → T1 0 46 4 5)、A16 预算(46 4)、A14 编码(归档树 1785 文件 / 0 处 U+FFFD;worktree 会是 1786)、A17 禁改面(0 + 正控 3)、A18 文档门(OK (9 changed file(s)))。
    6. 开收口单(bug area:ui)与 PR:Fixes #<收口单> + Part of #3114(绝不把关闭关键字指向伞号 [#3110] 已落地聊天壳、设置、搜索与历史命中的收口 #3114)+ Owner: / Reviewer: / ## Checkpoint + tip sha + 红绿三数。

    10 建议标题 / changelog 正文

    • PR 标题:Read a meeting's state in the window's language (#3114)
    • 收口单标题:项目看板:未决定会议的 open / deliberating / blocked 按窗口语言显示(Cut 35)
    • 本评论标题:## 第三十五刀切片:项目看板 › 会议状态三键(main 641faf10)
    • changelog.d/3114-cut-35-meeting-status.fixed.md(一条,.fixed):

      A meeting that is still open, deliberating or blocked now reads that state in Chinese on the Project board instead of the host ids open / deliberating / blocked (#3114).

    11 不做的事 / 风险

    • 不碰 core/src/host/** 一行:宿主的生命周期与读模型保持原样(本刀只改画点 + 字典)。
    • 不译 data-status / data-level 属性::656 原样,:642 的 data-level 也不动;新用例四个 data-status 全断言为宿主 id。
    • 不碰同屏 :661 的 meeting.advance.reason(宿主英文原话,走 hostText 还是走键要 owner 定,属另一刀)。
    • 不碰 about.js 的 Star、capability-settings.js 的 Could not connect:、sidebar.js 的 DSH Agent。
    • 不译时间单位 {}s/{}m/{}h/{}d(:433-438)。
    • 不为 blocked 另起正则或映射表:不猜形状,on-hold 兜底断言就是这条的守卫。
    • 不手改生成物与四份基线(core/client.js、patches/ds-bot/**、core/test/i18n-*.baseline.json)。
    • 不跑 npm ci、不 git add core/node_modules 符号链接。
    • 风险 1(裸键的代价):将来若有 t(task.status),blocked 会读成「待答复」;今天 done 已有同类风险,真冲突时改成前缀键 + 一处映射。
    • 风险 2(hostText 的连带):hostText 只在「整条消息恰好是一个字典键」时翻译(i18n.js:1896),所以新增裸键意味着一条内容恰好是 open/blocked/deliberating 的宿主消息会被译;实测仓里没有这种消息(grep -rn "new Error('open'" 等 0 命中,36 处 hostText(...) 传的都是句子或 host 错误)。
    • 风险 3(译名口味):待答复/待讨论 是界面文案取舍;owner 若选 B 只改两处字符串(字典 + 测试),不影响结构。

    12 下一刀候选(本刀不夹带)

    1. 同屏 · 未决定行的暂停原因:project-board.js:661 span.bt-project-paused 裸画 meeting.advance.reason —— 宿主 advanceRefusal 的英文句子(plugins/project/src/host.js 绑定、project-board.js:226-227 拼进 advance.reason),没走 hostText。走 hostText 还是走键、措辞由谁定要 owner 拍板(needs-human),还要一条 host 侧用例。为什么现在不做:它要动宿主语义或加 host 测试,跟本刀「一行画点 + 三键」不是一个风险档。
    2. 运行中任务表的状态列仍是英文 id:project-board.js:550 t(row.status),值域是 claimed / working(project-metrics.js:114-116),字典里没有这两个小写键(有的是大写的 Claimed/In progress,被 kanban 的 statusLabel 用),所以中文窗口今天读 claimed/working。为什么现在不做:要定两个译名、要和 kanban 的 Claimed/In progress 措辞对齐,是另一个表、另一条测试。
    3. project-board.js:433-438 的 {}s/{}m/{}h/{}d:时间单位不是句子,missingCopy 会报但那是数据形状(Cut 33 §12.5 已决定不本地化单位)。为什么现在不做:不是文案缺陷,改了会和「相对时间」的其它地方不一致。

    13 first_slice

    整刀就是第一刀:4 个手写文件 / 46 行(产品 +1/−1、字典 +5、测试 +38、changelog 1 行)+ 5 个生成路径(core/client.js +6/−1、0001 +6/−1、0008 +7/−2、files/src +1/−1、files/test +38),只把 :663 的裸值换成 t() 的实参并给三个 id 加键,可独立成 PR:Fixes #<收口单> + Part of #3114(关闭关键字绝不指向伞号)。预算余 354 行 / 16 文件,档位 T1(T1 0 46 4 5,实测)。


    Part of #3114 · first_slice:整刀就是第一刀 —— 3 条字典键 + 1 行画点 + 38 行测试 + 1 行 changelog,可独立成 PR。

  16. Birfy commented on Nov 20, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage · 本刀规格 = 上一条评论 7038439128。

    live main 复核(读于 2026-11-20T11:31Z / 641faf10):

    1. core/src/client/project-board.js:663 仍是裸 meeting.status:grep -c "bt-project-status' }, meeting.status" → 1。
    2. 字典仍无三键:grep -nE "^ *(open|deliberating|blocked):" core/src/client/i18n.js → 0 命中。
    3. core/test/project-board-view.test.js 1071 行 / 38 例;本刀 +38 行 → 39 例。
    4. changelog.mjs check 15 片段;check-mojibake 1784 文件 / 0 处 U+FFFD。

    键名取裸键(全仓 t('open')/t('blocked')/t('deliberating') 0 命中;四份基线实测仍 12/9/46/2(第四份 i18n-plugins-missing-zh 2 条))。译名 open=待讨论 / deliberating=讨论中 / blocked=待答复,A/B 见规格 §3。档位实测 T1 0 46 4 5。

    2026-11-20T11:50Z 按评审就地修订同一评论:A5/A9/A14/A15/A17 补成可复制命令;A14 改为干净归档树口径(worktree 多算 .git 文件,1786)。

  17. Birfy commented on Nov 20, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: issue-spec workflow

    开工规格

    第三十五刀切片:项目看板 › 会议状态三键(main 641faf1)

    Written-by: Triage · Part of #3114 · 只出规格,不含实现;收口单由实现 PR 自己开
    基线 main 641faf101bcbebe5bbc946c95ef6b16b2f4e1f9b(GET /repos/ThinkFlowLab/FlyBot/commits/main 读于 2026-11-20T11:16Z、11:26:19Z、11:31:06Z 三次同 sha;committer date 2026-11-20T11:01:33Z,即 cut 34 的 #3264)。
    读法:tarball/641faf10 全树取到 runs/i3114-cut35/repo;红树 runs/i3114-cut35/red(干净 641faf1 + 只放新测试)、绿树 runs/i3114-cut35/repo2(+ 实现 + 生成物)上实跑。下面每个计数都带「读于 <UTC> / 基线 641faf1」。
    今天树上的行数(读于 11:16Z / 641faf1):core/src/client/project-board.js 1225、core/src/client/i18n.js 1912、core/test/project-board-view.test.js 1071、core/client.js 25097(字典插入点 :1658、画点 :12849)。改完:i18n 1917、测试 1109、bundle 25102(字典 :1659-1663、画点 :12854)。
    修订(读于 2026-11-20T11:41–11:48Z / 同基线 641faf1):§7 的三基线、档位两条与 §8 的 A5 / A9 / A14 / A15 / A17 补成可直接复制的命令(A5 原稿用 … 代指前半条命令)(原稿留了 <9 条改动文件>、<同一条正则> 两个占位符,且基线只写数字没有命令);A14 的编码门改成「干净归档树」口径(worktree 的 .git 是文件,会被计成一个文本文件)。产品改动面、译名、红绿三数、其余门不变。

    0 目标(一句)

    中文窗口里,项目看板「未决定」那一段的会议状态读「待讨论 / 讨论中 / 待答复」,不再裸画宿主的 open / deliberating / blocked;data-status 属性、会议问题、发言人、层级与英文窗口一字不变。

    1 选定项与可达性(先证打得到)

    画点:core/src/client/project-board.js:663(641faf10 上仍是裸值)

    h('span', { className: 'bt-project-status' }, meeting.status)))

    这一格的值只有三个,且同源于 :656 的 data-status:

    1. 宿主的会议生命周期:core/src/host/meetings.js:1-3 的注释就是 open → deliberating → decided | blocked;:278 建会写 status: 'open';:307/:321 第一次记位(含记为 silent)后 open → deliberating;:443 decide 写 decided;:531 block 写 blocked 且必带一句 blocking question(:529-532);:545 resume 把 blocked 送回 deliberating。OPEN_STATES = ['open','deliberating'](:25)。
    2. 读模型只把三个未决状态放进 pending:plugins/project/src/project-board.js:432 的 if (meeting.status === 'open' || … === 'deliberating' || … === 'blocked')(原文三个或),:437 status: meeting.status 原样带出;decided 在 :409 走另一支。:430-431 的注释就是这条约定。
    3. 端点原样回:core/src/host/store.js:881-892(meetings: sections.meetings ?? …)。
    4. 客户端:core/src/client/project-board.js:254 meetingOf(item, item?.status ?? 'deliberating') → :656 'data-status': meeting.status → :663 画同一个字段。decided 行走 :643('data-status': 'decided'),永远不经过 :663。

    所以「旧记录里的别的 status」不会漏进来:读模型在 :432 就把不是这三个的挡掉了;客户端只有 :254 一个缺省(没有 status 时按 deliberating)。新用例另加一条 on-hold(宿主不会发)证明客户端不猜形状、原样透传。

    data-status 属性不许翻译:它是给测试与样式用的 id,同屏的旧用例已经在按 id 断言 —— core/test/project-board-view.test.js:256-257 断言 data-status 恰好是 ['decided','deliberating']。本刀的新用例也断言四个 data-status 都是宿主 id。

    这三个串在客户端源码里的语义(读于 11:16–11:31Z / 641faf1,grep -rn "'open'\|'blocked'\|'deliberating'" core/src/client/):

    命中 语义 是否进 t()
    project-board.js:254 ?? 'deliberating' 会议状态缺省 之后进 :663
    project-board.js:360 { group: 'blocked', label: 'Blocked' } 队列分组 id / 大写标签 标签走 t('Blocked')(大写键,另一个键)
    kanban.js:142 case 'blocked': return t('Blocked') 卡片状态 大写键
    kanban.js:287、inbox.js:297 卡片状态比较,不画 否
    speech.js:55 captureError('blocked') 麦克风错误码 否(画的是失败句)

    结论:小写 t('open') / t('blocked') / t('deliberating') 全仓 0 处;blocked 另有卡片语义,但那条路走大写键与 STATUSES[...].label 间接表,不落进小写键。

    2 键名:用裸键 open / deliberating / blocked(实测三条依据)

    1. 没有既存冲突:全仓 grep -rn "t('open')\|t('blocked')\|t('deliberating')"(去 node_modules)→ 0 命中;字典里也没有同名键(grep -nE "^ *(open|blocked|deliberating):" core/src/client/i18n.js → 0)。注意 i18n.js:1614-1615 的 running/stalled 是卡片租约语义,与本刀无关,也不复用。
    2. 动态 t(<expr>) 的取值域不重叠:core/src/client 里所有 t(标识符) 调用逐条核对过,这一屏只有四处把宿主 id 喂进 t(),值域互不相交 —— :396 t(row.column) 是看板列(not-started/in-progress/done,:1609-1611 已有键);:550 t(row.status) 只可能是 claimed/working(plugins/project/src/project-metrics.js:114-116 的 runningOf 只放这两类);:570 t(row.state) 只可能是 running/stalled(project-board.js:353 的三元);:642 t(meeting.level) 只可能是 ordinary/major/severe(core/src/host/meetings.js:25 的 CLASSES)。
    3. 不会动基线:基线都是插件扫描的(plugins/*/client.js,四份里前三份即本刀三基线)。node scripts/i18n-usage.mjs → 12 bare draws、--missing → 46 drawn copy strings,逐条查过没有 open/deliberating/blocked(读于 11:16–11:31Z / 641faf1)。加三个裸键后重跑:五道 i18n 门仍 41/41/0、四份基线仍 12 / 9 / 46 / 2(§7 实测)。
    4. 先例:这一屏本来就是「id 当键」—— done: '已完成'(:1611,done 是个更泛的词)、running/stalled(:1614-1615,注释 :1612-1613 明写 "so the ids that read emits are keys of their own")、ordinary/major/severe(:1604-1606),并且 t(meeting.level) / t(row.state) / t(row.status) 就是同一种写法。

    为什么不用前缀键(如 meeting open):那要在画点现造键(t(\meeting ${meeting.status}`))或加一张三行映射表,等于在唯一调用点发明一个本屏没有的约定;而本屏已有三个同样的「id 即键」。裸键的代价是一条写进 §11 的推论:将来谁写 t(task.status),blocked会读成「待答复」—— 但done` 今天就是这个风险,且真有冲突时改法仍是「字典换前缀键 + 一个映射」,不是正则。

    3 中文译名(建议 + 一句 A/B)

    id 建议 依据
    open 待讨论 会议已建、还没有人记位(meetings.js:278 之后第一次 position 才转 deliberating);与 未开始/进行中/已完成 同语域,但不复用 未开始——那是看板列,不是会议
    deliberating 讨论中 与 运行中 同形(动词 + 中),且这是唯一「人正在说」的状态
    blocked 待答复 宿主在 blocked 时必须给一句 blocking question,resume 用答复把它送回 deliberating(meetings.js:527-545),所以它是「等人答」;不写「阻塞」这种工程词

    需要 owner 拍板的一句(A/B,不卡本刀):blocked 读「待答复」(默认,贴合宿主「必须给一句 blocker、答复后回到讨论中」)还是「已搁置」(更强调停在这里)?两者都只改字典一个值 + 测试一处字符串,本刀按默认写。

    4 改动面(逐文件 +N/−M,在绿树 repo2 上 git diff --numstat 实测,读于 11:16–11:31Z / 641faf1)

    文件 +/− 具体改什么
    core/src/client/project-board.js +1/−1 :663 子节点 meeting.status → t(meeting.status)(t 已在 :6 import,无新 import、无新组件)
    core/src/client/i18n.js +5/−0 :1616 之前插入 2 行注释 + open: '待讨论' / deliberating: '讨论中' / blocked: '待答复'(紧跟 running/stalled 那一块,:1612-1615)
    core/test/project-board-view.test.js +38/−0 文件末尾第 39 例 + 局部辅助(pendingRecord() / pendingRow() / statusOf())
    changelog.d/3114-cut-35-meeting-status.fixed.md +1/−0 一条 .fixed(正文见 §10)
    手写合计 +45/−1 = 46 行 / 4 文件
    生成物(npm run build + generate 之后产生,不许手改) +/−
    core/client.js +6/−1(字典 5 行落在 :1659-1663,画点 :12849 → :12854)
    patches/ds-bot/0001-core-fixes.patch +6/−1(i18n.js 是上游文件,走 patch;hunk 头 @@ -838,6 +838,94 @@ → 99,另加 5 行新增行)
    patches/ds-bot/0008-client-bundle.patch +7/−2(bundle 的字典与画点两处 hunk)
    patches/ds-bot/files/src/client/project-board.js +1/−1(整文件镜像)
    patches/ds-bot/files/test/project-board-view.test.js +38/−0(整文件镜像)
    生成合计 5 路径 / +58/−5 = 63 行
    • patches/ds-bot/files/src/client/i18n.js 不存在(i18n.js 是上游文件,靠 0001 的 hunk 进去;实测 ls 报 No such file),所以本刀没有 i18n 的 files/ 镜像。
    • patches/ds-bot/topics.json 逐字节不动(git diff --name-only | grep -c topics.json → 0,实测)。
    • 整刀合计 9 路径 / 109 行(git diff --shortstat HEAD~1 → 9 files changed, 103 insertions(+), 6 deletions(-))。

    5 生成顺序与命令(在 repo2 实跑,rc 全 0)

    test -d core/node_modules/esbuild && echo "esbuild present"   # 本机符号链接到 /data/esinst/node_modules;别跑 npm ci
    export TMPDIR=/data/flybot-tmp
    export PATH=/data/dsh/bot/workspace/tools/git/bin:$PATH        # 本机 git 在 tools/ 下;正常 clone 不需要
    export GIT_EXEC_PATH=/data/dsh/bot/workspace/tools/git/libexec/git-core
    (cd core && npm run build)                        # core/client.js
    node scripts/ds-bot-patches.mjs generate          # patches/ds-bot/*
    git add -A
    node scripts/ds-bot-patches.mjs generate          # 第二遍确认幂等(实测零 diff)
    git add -A
    git commit -m "Read a meeting's state in the window's language (#3114)" \
               -m "Docs-not-needed: three dictionary keys and one t() in the Project board; no component structure changes."
    node scripts/ds-bot-patches.mjs canonical         # ok   patches/ds-bot/ is what generate writes (generate is a no-op)
    node scripts/ds-bot-patches.mjs check             # 三行 ok
    node core/scripts/build-client.mjs --check        # rc 0

    顺序:所有 core/ 改动落盘之后再 build + generate;颠倒会报 core/… : committed but not produced by the patches。坑同 cut 34:core/node_modules 这个符号链接会被 git add -A 当文件、被 generate 当目录 cpSync(ERR_FS_EISDIR)—— 写进 .git/info/exclude,别让它进 index。

    6 红先 → 绿(实测三数,读于 11:19–11:31Z / 641faf1)

    加在哪:core/test/project-board-view.test.js 文件末尾(main 1071 行之后),复用现成的 installLocale(:62 从 bundle 导出)、fakeLocale(active)(:706)、all(:98)、textOf(:109);不新增 locale 辅助(该文件只有一个 fakeLocale,再写一个同名会 SyntaxError)。

    用例名:#3114 cut 35: a meeting still open, deliberating or blocked reads its state in the window language

    四个状态行(pendingRecord()):open/ordinary、deliberating/major、blocked/severe + blockingQuestion、以及宿主不会发的 on-hold(兜底)。

    断言(顺序即红先顺序):

    1. 未装 locale:statusOf('meeting-b') === 'blocked'(英文窗口一字不变;实现前就是绿的)。
    2. 装 fakeLocale('zh'):open → 待讨论(红先命中的第一条)、deliberating → 讨论中、blocked → 待答复。
    3. on-hold 仍读 on-hold(不猜形状、原样透传)。
    4. 四行的 data-status 分别是 open/deliberating/blocked/on-hold(属性不译)。
    5. 行文本仍含 Which stream carries it?(宿主 blocking question 原话)与 严重(层级仍走 t())。

    红先实测(红树 = 干净 641faf1 + 只放新测试;(cd core && TZ=UTC node --test test/project-board-view.test.js)):

    not ok 39 - #3114 cut 35: a meeting still open, deliberating or blocked reads its state in the window language
      error: an open meeting
      'open' !== '待讨论'
      expected: '待讨论'
      actual: 'open'
    # tests 39 / # pass 38 / # fail 1
    

    (另外两条中文断言同形,红先停在第一条;绿树一次全过。)

    补实现 + 生成物后实测(绿树):# tests 39 / # pass 39 / # fail 0。干净 641faf1 单文件是 38/38/0。

    五道 i18n 门(test/i18n.test.js + 四道)红树、绿树都 41/41/0(本刀给字典加键,但不动 i18n.test.js)。

    7 五道门 / 四份基线 / 档位 / 预算(全部实测,读于 11:19–11:48Z / 641faf1)

    • i18n 五件套:(cd core && TZ=UTC node --test test/i18n.test.js test/i18n-missing-entries.test.js test/i18n-template-draws.test.js test/i18n-plugins.test.js test/i18n-plugins-missing-zh.test.js) → 41 / 41 / 0(改前改后同数;红树、绿树各跑一遍,读于 11:30Z / 11:45Z)。

    • 基线(四份 core/test/i18n-*.baseline.json,本刀要的是前三份):条数用这条命令读,别用 wc/grep 数行:

      node -e "for (const f of ['i18n-plugins','i18n-template-draws','i18n-missing-entries','i18n-plugins-missing-zh']) console.log(f, require('./core/test/'+f+'.baseline.json').entries.length)"

      实测(读于 11:44–11:45Z / 641faf1 干净树,entries.length):i18n-plugins 12、i18n-template-draws 9、i18n-missing-entries 46、i18n-plugins-missing-zh 2 → 改后同四数(git diff --name-only origin/main...HEAD | grep -c 'baseline.json' → 0)。前三个就是任务说的三基线 12 / 9 / 46,第四个 i18n-plugins-missing-zh(2 条)同样是基线、同样不许手改,别漏。
      每一份的唯一生成命令(本刀实测四条都 +0/-0、文件逐字节不变,所以一条都不用跑):

      node scripts/i18n-usage.mjs --write core/test/i18n-plugins.baseline.json                       # wrote 12 entries (+0/-0)
      node scripts/i18n-usage.mjs --missing --write core/test/i18n-missing-entries.baseline.json     # wrote 46 entries (+0/-0)
      node scripts/i18n-usage.mjs --template-draws --write core/test/i18n-template-draws.baseline.json # wrote 9 entries (+0/-0)
      node core/test/i18n-plugins-missing-zh.test.js --write                                          # wrote 2 entries (+0/-0)

      第四份不在 i18n-usage.mjs 的 CLI 里(那个脚本只有默认 / --missing / --template-draws 三种扫描),它在自己的测试文件里 --write;writeBaseline 默认拒绝变大(要 --force)。本刀一份都不变,所以一条 --write 都不跑;若将来某份必须变,写清是哪条命令产生的、并只提交该命令写出的文件。

    • changelog.mjs check:main 15 → 本刀 16(changelog: 16 fragment(s) in changelog.d/ are well formed)。

    • check-mojibake.mjs --check:main 1784 文件 / 0 处 U+FFFD → 本刀 1785 / 0,rc 0。实测首行后面还跟着 (23 skipped as binary: …),别照抄整行。口径必须是「干净检出」:scanTree 只跳过目录 .git,而 git worktree 的 .git 是普通文件,会被算成一个文本文件 —— 同一棵本刀树,归档检出测到 1785,worktree 里测到 1786。所以先在干净归档上量:

      rm -rf /tmp/mj-branch && mkdir -p /tmp/mj-branch && git archive HEAD | tar -x -C /tmp/mj-branch
      (cd /tmp/mj-branch && node .github/scripts/check-mojibake.mjs --check | head -1)   # → 1785 text file(s)
      rm -rf /tmp/mj-main && mkdir -p /tmp/mj-main && git archive origin/main | tar -x -C /tmp/mj-main
      (cd /tmp/mj-main && node .github/scripts/check-mojibake.mjs --check | head -1)     # → 1784 text file(s)

      等价断言:本刀 = main 归档实测数 + 本刀新增的文本文件数(本刀只多 1 个 changelog.d/…fixed.md,所以 1785)。在 worktree 里跑请自行减掉那个 .git。

    • build-client.mjs --check rc 0;ds-bot-patches check 三行 ok(ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5) / ok 10 patches apply cleanly in order / ok core/ equals ds-bot/ + patches/ds-bot/);canonical ok;第二遍 generate 零 diff。

    • 档位(实测 T1 0 46 4 5 —— tier T1、why.length 0、lines 46、files 4、generated 5)。judge() 吃的是 PR files 对象({filename, additions, deletions, changes, patch}),不是文件名数组:直接喂 9 个字符串实测 T0 0 0 9 0(低一档、照抄会静默过关),喂 9 个对象但不带 patch 实测 T3 4 46 4 5(4 条 diff not inspectable:)。所以照抄这一段:

      BASE=origin/main node --input-type=module -e "
      import { createGate, loadRules } from './.github/scripts/risk-gate.mjs'
      import { execFileSync } from 'node:child_process'
      const base = process.env.BASE
      const raw = execFileSync('git', ['diff', '--numstat', base + '...HEAD'], { encoding: 'utf8' }).trim().split('\n')
      const files = raw.map((l) => { const [a, d, p] = l.split('\t'); return { filename: p, additions: +a, deletions: +d, changes: +a + +d } })
      for (const f of files) if (f.changes > 0) f.patch = execFileSync('git', ['diff', base + '...HEAD', '--', f.filename], { encoding: 'utf8' })
      const r = createGate(loadRules('.github/agent/risk-rules.json')).judge(files)
      console.log(r.tier, r.why.length, r.lines, r.files, r.generated)
      "
      # → T1 0 46 4 5

      在 runs/i3114-cut35/repo2(该树的 base 是本地提交 42e96e6 = 干净 641faf1)上以 BASE=42e96e6 实跑,输出同上(读于 11:44Z)。
      告警:只 console.log(r.tier, r.why.length, r.lines, r.files, r.generated),不要 console.log(gate.judge(files))(会打印整个对象,把 basis 等内部字段带进 CI 日志)。

    • 预算:T1 上限 400 行 / 20 文件(.github/agent/risk-rules.json 的 limits.T1),本刀手写 46 行 / 4 文件 → 余 354 行 / 16 文件。

    • 文档门:分支 commit 与 PR 正文各一条 Docs-not-needed: three dictionary keys and one t() in the Project board; no component structure changes.;ARCH_DOCS_BASE=origin/main node core/scripts/check-arch-docs.mjs → arch-docs: OK (9 changed file(s)),rc 0(缺 trailer 会红,本机实测 rc 1)。

    8 验收清单(每条一个 $ 命令或一个断言)

    • A1 红先:git checkout $(git merge-base HEAD origin/main) -- core/src/client/i18n.js core/src/client/project-board.js && (cd core && TZ=UTC node --test test/project-board-view.test.js) → # tests 39 / # pass 38 / # fail 1,失败断言 expected: '待讨论' / actual: 'open';随后 git checkout HEAD -- core/src/client/i18n.js core/src/client/project-board.js 复原。

    • A2 绿:(cd core && TZ=UTC node --test test/project-board-view.test.js) → 39 / 39 / 0。

    • A3 中文逐字:A2 的例 39 通过(zh 下三个 span 逐字等于 待讨论 / 讨论中 / 待答复)。

    • A4 英文一字不变:同一例第 1 条断言通过;git diff origin/main...HEAD -- core/src/client/project-board.js | grep '^+' | grep -c 'meeting.status' → 1。

    • A5 只改画点:git diff origin/main...HEAD -- core/src/client/project-board.js | grep -c '^-[^-]' → 1;git diff origin/main...HEAD -- core/src/client/project-board.js | grep -c '^+[^+]' → 1;把 t(...) 拆掉必须塌成同一行:git diff -U0 origin/main...HEAD -- core/src/client/project-board.js | grep '^[-+]' | grep -v '^\(---\|+++\)' | sed 's/^[-+]//; s/t(meeting.status)/meeting.status/' | sort -u | wc -l → 1。

    • A6 字典只加不改:git diff origin/main...HEAD -- core/src/client/i18n.js | grep -c '^-[^-]' → 0;grep -cE "^ (open|deliberating|blocked): '" core/src/client/i18n.js → 3。

    • A7 属性不译:grep -c "'data-status': meeting.status" core/src/client/project-board.js → 1;grep -c "bt-project-status' }, meeting.status" core/src/client/project-board.js → 0。

    • A8 五道 i18n 门:§7 的命令 → 41 / 41 / 0。

    • A9 四份基线未动(前三份即三基线):
      git diff --name-only origin/main...HEAD | grep -c 'baseline.json' → 0;
      node -e "for (const f of ['i18n-plugins','i18n-template-draws','i18n-missing-entries','i18n-plugins-missing-zh']) console.log(f, require('./core/test/'+f+'.baseline.json').entries.length)" → i18n-plugins 12 / i18n-template-draws 9 / i18n-missing-entries 46 / i18n-plugins-missing-zh 2(改前改后同四数,读于 11:44Z)。四份都由 §7 列的那四条 --write 命令生成,不许手改。

    • A10 生成物自洽:node core/scripts/build-client.mjs --check rc 0;提交后 git diff --exit-code -- core/client.js rc 0。

    • A11 patch 自洽:node scripts/ds-bot-patches.mjs check 三行 ok;canonical ok;git status --porcelain 为空。

    • A12 topics.json 不动:git diff --name-only origin/main...HEAD | grep -c 'topics.json' → 0。

    • A13 changelog:node .github/scripts/changelog.mjs check → changelog: 16 fragment(s) in changelog.d/ are well formed(main 15)。

    • A14 编码(干净归档树口径;worktree 会多算 .git 这个文件):
      rm -rf /tmp/mj-branch && mkdir -p /tmp/mj-branch && git archive HEAD | tar -x -C /tmp/mj-branch && (cd /tmp/mj-branch && node .github/scripts/check-mojibake.mjs --check | head -1) 首行以 mojibake: ok — 0 occurrences of U+FFFD in 1785 text file(s) 开头,rc 0;同法对 origin/main 归档 → 1784。本机实测:归档 HEAD 1785、归档 main 1784、worktree HEAD 1786(多 1 = .git 文件)。

    • A15 档位:§7 的内联片段(BASE=origin/main … judge(files),对象带 patch)→ T1 0 46 4 5;同片段把 files 换成 9 个文件名字符串应为 T0 0 0 9 0(低一档的陷阱),不带 patch 应为 T3 4 46 4 5。

    • A16 预算:git diff --numstat origin/main...HEAD | awk '$3 !~ /^(core\/client\.js|patches\/)/ {s+=$1+$2; f++} END {print s, f}' → 46 4。

    • A17 禁改面零改动 + 正控:把同一条正则原样写两遍(grep -c 计数为 0 时退出码是 1,那是「零改动」的正常结果,不是失败):

      RE='^(core/src/host/|core/src/client/about\.js$|core/src/client/capability-settings\.js$|core/src/client/sidebar\.js$|patches/ds-bot/topics\.json$|core/test/i18n-.*\.baseline\.json$)'
      git diff --name-only origin/main...HEAD | grep -cE "$RE"     # → 0(rc 1)
      printf 'core/src/host/store.js\ncore/src/client/about.js\ncore/src/client/sidebar.js\ncore/src/client/project-board.js\n' | grep -cE "$RE"   # → 3(正控:同一条正则真能打中)

      实测(读于 11:44Z / runs/i3114-cut35/repo2,base 42e96e6):改动面 0(rc 1)、正控 3(rc 0)。

    • A18 文档门:PR 正文与分支 commit 各一条 Docs-not-needed: …;ARCH_DOCS_BASE=origin/main node core/scripts/check-arch-docs.mjs → arch-docs: OK (9 changed file(s)),rc 0。

    • A19 整刀大小:git diff --shortstat origin/main...HEAD → 9 files changed, 103 insertions(+), 6 deletions(-)。

    9 分步(≤6 步)

    1. 从 live main(开工时重读 /git/ref/heads/main)切分支;先只加测试:core/test/project-board-view.test.js 末尾追加 §6 的 38 行 → 实测 39 / 38 / 1。
    2. 改 core/src/client/project-board.js:663 为 t(meeting.status)(+1/−1),并在 core/src/client/i18n.js 的 running/stalled 之后插 5 行(2 行注释 + 3 条键)→ 实测 39 / 39 / 0;跑 A8(41/41/0)与 A9(四份基线 12 / 9 / 46 / 2,命令见 §8)。
    3. 加 changelog 片段(§10),changelog.mjs check → 16 片段(main 15)。
    4. 按 §5 的顺序:确认 esbuild 在 → npm run build → generate → 再 generate → commit(带 Docs-not-needed:)→ canonical → check → build-client --check(rc 全 0);确认 topics.json 没进 diff、git status 干净。
    5. 跑 A15 档位(§7 片段 → T1 0 46 4 5)、A16 预算(46 4)、A14 编码(归档树 1785 文件 / 0 处 U+FFFD;worktree 会是 1786)、A17 禁改面(0 + 正控 3)、A18 文档门(OK (9 changed file(s)))。
    6. 开收口单(bug area:ui)与 PR:Fixes #<收口单> + Part of #3114(绝不把关闭关键字指向伞号 [#3110] 已落地聊天壳、设置、搜索与历史命中的收口 #3114)+ Owner: / Reviewer: / ## Checkpoint + tip sha + 红绿三数。

    10 建议标题 / changelog 正文

    • PR 标题:Read a meeting's state in the window's language (#3114)
    • 收口单标题:项目看板:未决定会议的 open / deliberating / blocked 按窗口语言显示(Cut 35)
    • 本评论标题:## 第三十五刀切片:项目看板 › 会议状态三键(main 641faf10)
    • changelog.d/3114-cut-35-meeting-status.fixed.md(一条,.fixed):

      A meeting that is still open, deliberating or blocked now reads that state in Chinese on the Project board instead of the host ids open / deliberating / blocked (#3114).

    11 不做的事 / 风险

    • 不碰 core/src/host/** 一行:宿主的生命周期与读模型保持原样(本刀只改画点 + 字典)。
    • 不译 data-status / data-level 属性::656 原样,:642 的 data-level 也不动;新用例四个 data-status 全断言为宿主 id。
    • 不碰同屏 :661 的 meeting.advance.reason(宿主英文原话,走 hostText 还是走键要 owner 定,属另一刀)。
    • 不碰 about.js 的 Star、capability-settings.js 的 Could not connect:、sidebar.js 的 DSH Agent。
    • 不译时间单位 {}s/{}m/{}h/{}d(:433-438)。
    • 不为 blocked 另起正则或映射表:不猜形状,on-hold 兜底断言就是这条的守卫。
    • 不手改生成物与四份基线(core/client.js、patches/ds-bot/**、core/test/i18n-*.baseline.json)。
    • 不跑 npm ci、不 git add core/node_modules 符号链接。
    • 风险 1(裸键的代价):将来若有 t(task.status),blocked 会读成「待答复」;今天 done 已有同类风险,真冲突时改成前缀键 + 一处映射。
    • 风险 2(hostText 的连带):hostText 只在「整条消息恰好是一个字典键」时翻译(i18n.js:1896),所以新增裸键意味着一条内容恰好是 open/blocked/deliberating 的宿主消息会被译;实测仓里没有这种消息(grep -rn "new Error('open'" 等 0 命中,36 处 hostText(...) 传的都是句子或 host 错误)。
    • 风险 3(译名口味):待答复/待讨论 是界面文案取舍;owner 若选 B 只改两处字符串(字典 + 测试),不影响结构。

    12 下一刀候选(本刀不夹带)

    1. 同屏 · 未决定行的暂停原因:project-board.js:661 span.bt-project-paused 裸画 meeting.advance.reason —— 宿主 advanceRefusal 的英文句子(plugins/project/src/host.js 绑定、project-board.js:226-227 拼进 advance.reason),没走 hostText。走 hostText 还是走键、措辞由谁定要 owner 拍板(needs-human),还要一条 host 侧用例。为什么现在不做:它要动宿主语义或加 host 测试,跟本刀「一行画点 + 三键」不是一个风险档。
    2. 运行中任务表的状态列仍是英文 id:project-board.js:550 t(row.status),值域是 claimed / working(project-metrics.js:114-116),字典里没有这两个小写键(有的是大写的 Claimed/In progress,被 kanban 的 statusLabel 用),所以中文窗口今天读 claimed/working。为什么现在不做:要定两个译名、要和 kanban 的 Claimed/In progress 措辞对齐,是另一个表、另一条测试。
    3. project-board.js:433-438 的 {}s/{}m/{}h/{}d:时间单位不是句子,missingCopy 会报但那是数据形状(Cut 33 §12.5 已决定不本地化单位)。为什么现在不做:不是文案缺陷,改了会和「相对时间」的其它地方不一致。

    13 first_slice

    整刀就是第一刀:4 个手写文件 / 46 行(产品 +1/−1、字典 +5、测试 +38、changelog 1 行)+ 5 个生成路径(core/client.js +6/−1、0001 +6/−1、0008 +7/−2、files/src +1/−1、files/test +38),只把 :663 的裸值换成 t() 的实参并给三个 id 加键,可独立成 PR:Fixes #<收口单> + Part of #3114(关闭关键字绝不指向伞号)。预算余 354 行 / 16 文件,档位 T1(T1 0 46 4 5,实测)。


    Part of #3114 · first_slice:整刀就是第一刀 —— 3 条字典键 + 1 行画点 + 38 行测试 + 1 行 changelog,可独立成 PR。


    first_slice:§13「整刀就是第一刀」—— core/src/client/project-board.js:663 一行换 t(meeting.status) + core/src/client/i18n.js 三条字典键(open 待讨论 / deliberating 讨论中 / blocked 待答复)+ core/test/project-board-view.test.js 38 行新例 + 1 行 changelog,可独立成 PR(Fixes #<收口单> + Part of #3114,关闭关键字不指向伞号)。

  18. Birfy commented on Nov 20, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Chief

    Cut 35 规格以 7038852392 为准

    • 实现与评审只看评论 7038852392(22331 字符,2026-11-20T11:52:45Z,基线 main 641faf10)。
    • 同字的正文另有一条 7038439128(11:31:07Z)与一条指路评论 7038443686(11:31:20Z):7038852392 就是 7038439128 的同一份正文加 4 行头(Written-by / ## 开工规格)加 first_slice 尾巴,逐字比对只差这两处,没有数字冲突。为避免 cut 33/34 那种「两份规格谁算数」的重复,统一以 7038852392 为准。

    本刀要点(供快速对齐):裸键 open / deliberating / blocked 加进字典(实测全仓小写 t(...) 0 冲突、动态 t(<expr>) 四点值域互不相交),画点只改 core/src/client/project-board.js:663 为 t(meeting.status),data-status 属性不译;红先 39/38/1 → 39/39/0;四份基线 12 / 9 / 46 / 2 全部不动;档位 T1 0 46 4 5,整刀 9 路径 / 103+/6−。

    待 owner 的一句(不卡开工,默认已写死):blocked 读「待答复」(默认)还是「已搁置」。

  19. Birfy commented on Nov 20, 2026

    @Birfy
    CollaboratorAuthor

    第三十六刀切片:项目看板 › 在跑任务表的状态列(main 4031b9e)

    Written-by: Triage · Part of #3114 · 只出规格,不含实现;收口单由实现 PR 自己开
    基线 main 4031b9edc19c5998f5f26f57e7b004b40281f70a(GET /repos/ThinkFlowLab/FlyBot/commits/main 读于 2026-11-20T12:40:13Z、12:49:40Z、12:49:41Z 三次同 sha;committer date 2026-11-20T12:31:39Z,即 cut 35 的 #3267)。
    本稿已按审读意见(notes-3114.md)修订,改过的 7 条逐条落在 §1.1 表 / §1.1 末段 / §1.2 / §2 / §3;所有计数在 4031b9e 的 repo/red/green 三棵树上重跑于 2026-11-20T13:03–13:05Z。
    读法:tarball/4031b9ed 全树取到 runs/i3114-cut36/repo(本机没有 workspace/opendigitalmate 底座,故按派活单的 main sha 取官方 tarball,等价于一棵干净检出);红树 runs/i3114-cut36/red(干净 4031b9e + 只放新测试)、绿树 runs/i3114-cut36/green(+ 实现 + 生成物)上实跑。下面每个计数都带「读于 <UTC> / 基线 4031b9e」。
    今天树上的行数(读于 12:44Z / 4031b9e):core/src/client/i18n.js 1917、core/src/client/project-board.js 1225、core/test/project-board-view.test.js 1109、core/client.js 25102。改完:i18n 1921、测试 1134、bundle 25106(字典 :1661-1662,画点仍在 :12752)。

    0 目标(一句)

    中文窗口里,项目看板「在跑任务」表的状态列把 claimed / working 读成「已认领 / 进行中」,不再裸画宿主的任务 id;英文窗口、data-* 属性、宿主原话与其它列一字不变。

    1 选定项与可达性(先扫再选)

    1.1 仓库自带工具的扫描结果(读于 12:40–12:48Z、重跑 13:03Z / 4031b9e)

    工具实际在 scripts/i18n-usage.mjs(不在 .github/scripts/ 下:ls .github/scripts | grep -i i18n 为空,rc 1;该目录有 71 个脚本,changelog.mjs、check-mojibake.mjs、risk-gate.mjs 这类例行工具都在那儿,读于 13:03Z)。

    node scripts/i18n-usage.mjs                  # 12 bare draws in 4 files
    node scripts/i18n-usage.mjs --missing        # 46 drawn copy strings with no zh entry in 4 files
    node scripts/i18n-usage.mjs --template-draws # 9 template draws in 2 files

    三者全部落在 plugins/*/client.js(timeline / tree / social / workflow),即改动面在 plugins/**,不满足本刀 T1(T1 只允许 core/src/client/**、core/test/**、changelog.d/** 与其生成物)。这 67 条(12+46+9)因此本刀一条都不取,见 §12。

    核心客户端的同一次词法走法(复用 tokens/bareCopy/missingCopy/templateDraws,只换根目录)扫 core/src/client/*.js,实测 10 bare / 19 missing / 2 template(共 31 条,读于 13:03Z / 4031b9e;bare 落 3 个文件、missing 落 6 个、template 落 2 个),逐条核过可达性。复现命令(在仓库根跑,别用 .github/scripts/):

    node --input-type=module -e "
    import { readdirSync, readFileSync } from 'node:fs'
    import { bareCopy, missingCopy, templateDraws } from './scripts/i18n-usage.mjs'
    const dir = 'core/src/client'; const b = [], m = [], t = []
    for (const f of readdirSync(dir).filter(n => n.endsWith('.js')).sort()) {
      const src = readFileSync(dir + '/' + f, 'utf8')
      b.push(...bareCopy(src, f)); m.push(...missingCopy(src, f)); t.push(...templateDraws(src, f))
    }
    console.log(b.length, m.length, t.length)   # 10 19 2
    "
    候选 位置 判 为什么
    t(row.status) 的 claimed / working project-board.js:550 取 一屏一处语义;字典只缺这两个小写键;画点已经在 t() 里,改动只是加键
    Groups(源分组表头 / 运行表 Source 列) :336/:414、:553 不取 同屏另一处语义;DICTIONARY.zh 里没有 Groups 键(grep -n "Groups" core/src/client/i18n.js 只命中 :933 的 'Groups you admin'),要定「群 / 群组 / 群聊」的口径,得 owner 拍(§12.1)
    Star about.js:97 不取 owner 已判:字典 :788 的 Star: '星星' 是形状名(Shapes 段),字典里没有 Stars 键;about.js:97 这个裸字面量是按钮上的动词,要译得另开键并定名(同屏 'Star FlyBot on GitHub': '在 GitHub 上给 FlyBot 点 Star' 是另一条键),属 owner 拍板
    Could not connect: {error} capability-settings.js:14 不取 {error} 是第三方原话,译到什么程度要 owner 定
    DSH Agent sidebar.js:286、context-menu.js:117 不取 产品名
    meeting.advance.reason project-board.js:661 不取 owner 已判(走 hostText 还是走键)
    Name / Description / Command / Arguments (one per line) / Environment (JSON) / URL / Headers (JSON) / Skill instructions capability-settings.js:64-82 假阳性 Field 在 :19 已经 t(label),字典里 8 个键全在(实测 DICTIONARY.zh 逐个有值)
    Notice details-drawer.js:236 假阳性 About 在 :130 已经 t(title),Notice: '群公告' 在字典里
    Bob / my-tool / password / $DSH_SECRET_NAME bot-settings.js:247、capability-settings.js:64、secret-card.js 数据 输入示例,不是句子
    2 条模板画点 $DSH_SECRET_{} / dsh plugin --profile {} add {} secret-card.js:113、settings.js:86 数据 命令行示例
    其余为明显数据:6 个主题色值 / 1 个 SVG 模板 / 4 处 [secret:NAME] 占位符 themes.js:14/18/19/23/24/29(#f2f2f2 等)、bot-settings.js:105(<defs><mask …> 整段)、secret-card.js:269/270/282/283($DSH_SECRET_NAME / [secret:NAME]) 数据 色值、SVG 属性串、占位符字面量,都不是读者读的句子
    page.error browser-pane.js:263 不取 宿主英文原话(core/src/host/browser.js:98/110/129),属「不译宿主原话」
    {}s/{}m/{}h/{}d project-board.js:433-438 不取 时间单位,派活单明令不译
    DSH Agent / Bob sidebar.js:286 / bot-settings.js:247 不取 产品名 / 示例名

    同一屏(running 表)里其余经 t() 的值都已有中文键,实测(13:03Z / 4031b9e):7 张指标卡的 label+caption 全在、表头 Task/Status/Who/Claimed for/Source/Last activity/Running tasks 全在、Nothing is running. 在、Bots/Workflows 在 —— 状态列只缺 claimed / working 两键。同屏 Source 列的 Groups 是另一处语义::553 对 source: 'group' 画 t(SOURCE_LABELS['group']) = t('Groups'),而字典没有 Groups 键,所以 zh 下那一列仍读英文;按 §12.1 排除,要 owner 定「群 / 群组 / 群聊」,本刀不夹带。这就是「改这一处」的边界。

    1.2 画点与值从哪来

    画点:core/src/client/project-board.js:550(4031b9ed 上已经是 t(...),所以本刀不改这一行)

    h('span', { className: 'bt-project-running-status' }, t(row.status)),
    • row 来自 ProjectRunningTable({ view })(:536-559),view.metrics.running 由 projectBoardView 在 :377 调 metricsView(metrics, { tasks }) 得到。
    • metricsView(:466-497)对每一行只做原样搬运::481 status: text(row.status);客户端不猜形状、不重排。
    • metrics 是 Project 插件读模型给的:plugins/project/src/project-board.js:578 调 readMetrics({ …, tasks }),:586 把 metrics 原样放进 board 回答;客户端在 :1049(metrics: board?.metrics ?? null)与 :1207(state.metrics)接住。
    • running 数组只可能由 plugins/project/src/project-metrics.js:114-116 的 runningOf 产出:
    if (task.status !== 'claimed' && task.status !== 'working') return null

    :125 status: task.status 原样带走;:161 的 running()(summarizeMetrics)与 :197 的 liveRunning()(readMetrics)都只经过这一个 runningOf。宿主的任务状态机是 core/src/host/tasks.js:14 的 open → claimed → working → blocked ⇄ working → result-ready → accepted,ACTIVE 见 :27;进入「在跑任务」表的只有 claimed 与 working 两个。

    所以「别的语义漏进来」的路径是封死的:blocked 有字典键(cut 35 加的 blocked: '待答复'),但 runningOf 在 :116 就把它挡掉;open/result-ready/accepted 同样进不来。客户端对未知值不猜:新用例第 3 行用宿主不会发的 on-hold 证明它原样画 on-hold。

    为什么本刀是「只加两个字典键」::550 早已走 t(),缺陷在字典(DICTIONARY.zh['claimed'] / ['working'] 实测 undefined,读于 12:47Z),不在画点。这比改画点更小,也不碰任何组件结构。

    2 键名:用裸键 claimed / working(实测三条依据)

    1. 没有既存冲突:grep -cE "^ (claimed|working): '" core/src/client/i18n.js → 0;grep -rn "t('claimed')\|t('working')" core plugins | wc -l → 0。小写 blocked 已被 cut 35 占用为会议状态,但 runningOf 不产 blocked(§1.2),不冲突。

    2. 动态 t(<expr>) 的取值域不重叠:project-board.js 里 14 处非字面量 t() 逐条核过(grep -nE "(^|[^A-Za-z0-9_$.])t\(" core/src/client/project-board.js | grep -vE "t\('[^']*'\)",读于 13:04Z / 4031b9e):

      • 承载列 / 任务状态的 3 处::396 t(row.column)(not-started/in-progress/done,字典 :1609-1611)、:550 t(row.status)(本刀)、:570 t(row.state)(running/stalled,字典 :1614-1615);
      • 源分组的 2 处::414 t(group.label)、:553 t(SOURCE_LABELS[...]),取值域都是 SOURCE_LABELS(:138)的 Bots/Groups/Workflows —— Bots/Workflows 有键,Groups 缺键且是另一处语义(§12.1);
      • 其余 9 处(都不接任务状态)::412 t(view.emptyText) 恒 'No cards yet.'(:375,有键;metricsView 的 'No metrics read yet.'(:496)没有任何画点读它)、:424 t(view.done.label) 恒 'Done cards'(:370,有键)、:520 t(named[1]) 是 METRICS_REASON_KEYS(:505-511)的 5 个英文句子、:529 t(card.label) / :530 t(card.caption) 是 METRIC_CARDS(:443-450)的 7 组字面量、:562 t(entry.label) 是 Waiting/In flight/Blocked(:358-360)、:642 t(meeting.level) 是 ordinary/major/severe(字典 :1604-1606)、:663 t(meeting.status) 是 open/deliberating/blocked(字典 :1618-1620)、:671 t(state?.key ?? '', state?.params) 是决策 / 会议空态(宿主要么给一个自己命名的 key,要么落到本文件三条兜底常量 NO_WORKING_FOLDER / DECISIONS_IN_FOLDER / NO_MEETING,:232-234)。

      除 Groups 外这些键实测在 DICTIONARY.zh 里全有(读于 13:04Z:METRIC_CARDS 的 14 个字串 + METRICS_REASON_KEYS 的 5 个句子逐个 Object.hasOwn 为 true)。所以没有一处会把 claimed/working 读成别的意思;唯一可能带宿主任意字串的是 :671 的空态 key —— 宿主若真发一个名字恰好是 working 的 key,空态行会读成「进行中」,这与 §11 风险 1 是同一条,本刀接受(今天 grep 不到这种 key)。

    3. 先例:这一屏本来就是「id 即键」——done(:1611)、running/stalled(:1614-1615,注释 :1612-1613 明写 “the ids that read emits are keys of their own”)、cut 35 的 open/deliberating/blocked(:1616-1620)。本刀沿用同一写法,不发明映射表。

    为什么不用大写键映射(t(row.status === 'claimed' ? 'Claimed' : 'In progress')):英文窗口今天读的是小写 claimed/working,映射到大写键会让英文变成 Claimed/In progress,破坏「英文一字不变」;裸键下 t('claimed') 在无 locale 时原样返回 claimed,英文一字不动。

    3 中文译名(不用 owner 拍板)

    id 译名 依据
    claimed 已认领 与字典 Claimed: '已认领'(i18n.js:939)逐字相同;看板 kanban.js:140 把 claimed 映射到 t('Claimed'),读的就是这一条
    working 进行中 与字典 'In progress': '进行中'(i18n.js:899)逐字相同;kanban.js:141 把 working 映射到 t('In progress')

    不需要 owner:这不是新词,而是把同一条任务状态在「看板」与「在跑任务表」两处读成同一句话;候选里没有产品实体名、第三方原话或本地化取舍。

    4 改动面(逐文件 +N/−M,在绿树 green 上 git diff --numstat HEAD~1 实测,读于 12:46–12:48Z / 4031b9e)

    文件 +/− 具体改什么
    core/src/client/i18n.js +4/−0 在 stalled: '已停滞',(:1615)之后插 2 行注释 + claimed: '已认领', / working: '进行中',(落在 :1616-1619)
    core/test/project-board-view.test.js +25/−0 文件末尾第 40 例(空白行 :1110 + 注释 :1111-1113 + 用例 :1114-1134)
    changelog.d/3114-cut-36-running-status.fixed.md +1/−0 一条 .fixed(正文见 §10)
    手写合计 +30/−0 = 30 行 / 3 文件
    生成物(npm run build + generate 之后产生,不许手改) +/−
    core/client.js +4/−0(字典 :1661-1662;画点 :12748 → :12752,行本身没改)
    patches/ds-bot/0001-core-fixes.patch +5/−1(i18n.js 走上游 patch:hunk 头 @@ -838,6 +838,99 @@ → +103,另加 4 行)
    patches/ds-bot/0008-client-bundle.patch +5/−1(bundle 字典 hunk 头 @@ -887,7 +887,100 @@ → +104,另加 4 行)
    patches/ds-bot/files/test/project-board-view.test.js +25/−0(整文件镜像)
    生成合计 4 路径 / +39/−2 = 39 行
    • patches/ds-bot/files/src/client/project-board.js 存在但本刀逐字节不动(画点没改;git diff --name-only HEAD~1 | grep -c 'files/src/client/project-board.js' → 0)。
    • patches/ds-bot/files/src/client/i18n.js 不存在(i18n.js 是上游文件,只能走 0001 的 hunk;实测 ls 报 No such file)。
    • patches/ds-bot/topics.json 逐字节不动(git diff --name-only HEAD~1 | grep -c topics.json → 0)。
    • 四份基线全不动(12 / 9 / 46 / 2,§7)。
    • 整刀合计 7 路径 / +69/−2(git diff --shortstat HEAD~1 → 7 files changed, 69 insertions(+), 2 deletions(-))。

    5 生成顺序与命令(在绿树 green 实跑,rc 全 0)

    test -d core/node_modules/esbuild && echo "esbuild present"   # 本机符号链接到 /data/esinst/node_modules;别跑 npm ci
    export TMPDIR=/data/flybot-tmp                                # /tmp 只有 128M,归档别放 /tmp
    export PATH=/data/dsh/bot/workspace/tools/git/bin:$PATH        # 本机 git 在 tools/ 下
    export GIT_EXEC_PATH=/data/dsh/bot/workspace/tools/git/libexec/git-core
    (cd core && npm run build)                        # core/client.js
    node scripts/ds-bot-patches.mjs generate          # patches/ds-bot/*
    git add -A
    node scripts/ds-bot-patches.mjs generate          # 第二遍确认幂等(实测零 diff)
    git add -A
    git commit -m "Read a running task's status in the window language (#3114)" \
               -m "Docs-not-needed: two dictionary keys, one test and one changelog fragment; no component or structure change."
    node scripts/ds-bot-patches.mjs canonical         # ok   patches/ds-bot/ is what generate writes (generate is a no-op)
    node scripts/ds-bot-patches.mjs check             # 三行 ok
    node core/scripts/build-client.mjs --check        # rc 0

    顺序:core/ 改动落盘之后再 build + generate;颠倒会报 core/… : committed but not produced by the patches。坑同 cut 34/35:core/node_modules 这个符号链接会被 git add -A 当文件、被 generate 当目录 —— 写进 .git/info/exclude,别让它进 index。

    6 红先 → 绿(实测三数,读于 12:45–12:47Z / 4031b9e)

    加在哪:core/test/project-board-view.test.js 文件末尾(main 1109 行之后),复用现成的 installLocale(:62)、fakeLocale(active)(:706)、all(:98)、textOf(:109)。

    用例名:#3114 cut 36: a running task reads its status in the window language

    要核的三条事实(前两条是断言,顺序即红先顺序):

    1. 未装 locale:三行状态逐字 ['claimed', 'working', 'on-hold'](英文窗口一字不变;实现前就是绿的)。
    2. 装 fakeLocale('zh'):['已认领', '进行中', 'on-hold'](红先命中的就是这一条;on-hold 是宿主不会发的第三个值,证明客户端不猜形状)。
    3. 两个状态 span 由 bt-project-running-status 这个 className 选出,data-* 不参与断言。

    红先实测(红树 = 干净 4031b9e + 只放新测试;(cd core && TZ=UTC node --test test/project-board-view.test.js)):

    not ok 40 - #3114 cut 36: a running task reads its status in the window language
      error: |-
        the two in-flight states read in the window language; an unknown id stays as it came
        + actual - expected
          [ + 'claimed', + 'working', ... ]
    # tests 40 / # pass 39 / # fail 1
    

    补实现 + 生成物后实测(绿树):# tests 40 / # pass 40 / # fail 0。干净 4031b9e 单文件是 39/39/0(cut 35 那例已在 main 上)。

    五道 i18n 门(test/i18n.test.js + 四道)红树、绿树都 41/41/0(本刀只给字典加键,不动 i18n.test.js,读于 12:47Z / 12:48Z)。

    7 五道门 / 四份基线 / 档位 / 预算(全部实测,读于 12:44–12:50Z、重跑 13:03–13:08Z / 4031b9e)

    • i18n 五件套:(cd core && TZ=UTC node --test test/i18n.test.js test/i18n-missing-entries.test.js test/i18n-template-draws.test.js test/i18n-plugins.test.js test/i18n-plugins-missing-zh.test.js) → 41 / 41 / 0(红树、绿树各跑一遍)。

    • 基线(四份 core/test/i18n-*.baseline.json):条数用这条命令读,别用 wc/grep 数行:

      node -e "for (const f of ['i18n-plugins','i18n-template-draws','i18n-missing-entries','i18n-plugins-missing-zh']) console.log(f, require('./core/test/'+f+'.baseline.json').entries.length)"

      实测(main 12:48Z、绿树 12:47Z,13:03Z 重跑同四数,entries.length):i18n-plugins 12、i18n-template-draws 9、i18n-missing-entries 46、i18n-plugins-missing-zh 2 → 改后同四数;git diff --name-only HEAD~1 | grep -c 'baseline.json' → 0。本刀一份都不变,所以一条 --write 都不跑;四份的唯一生成命令(将来若必须变,只提交该命令写出的文件):

      node scripts/i18n-usage.mjs --write core/test/i18n-plugins.baseline.json
      node scripts/i18n-usage.mjs --missing --write core/test/i18n-missing-entries.baseline.json
      node scripts/i18n-usage.mjs --template-draws --write core/test/i18n-template-draws.baseline.json
      node core/test/i18n-plugins-missing-zh.test.js --write
    • changelog.mjs check:main 16 → 本刀 17(changelog: 17 fragment(s) in changelog.d/ are well formed;changelog.d/ 里文件数 17 → 18,README.md 不计)。

    • check-mojibake.mjs --check(干净归档树口径,别在 worktree 里量):

      rm -rf /data/flybot-tmp/mj36-main && mkdir -p /data/flybot-tmp/mj36-main && git archive origin/main | tar -x -C /data/flybot-tmp/mj36-main
      (cd /data/flybot-tmp/mj36-main && node .github/scripts/check-mojibake.mjs --check | head -1)   # 1785
      rm -rf /data/flybot-tmp/mj36-head && mkdir -p /data/flybot-tmp/mj36-head && git archive HEAD | tar -x -C /data/flybot-tmp/mj36-head
      (cd /data/flybot-tmp/mj36-head && node .github/scripts/check-mojibake.mjs --check | head -1)   # 1786

      实测:main 归档 1785 文件 / 0 处 U+FFFD,本刀归档 1786 / 0(只多 1 个新 changelog 文本文件),rc 0,首行后面还跟着 (23 skipped as binary: …),别照抄整行。本机 /tmp 只有 128M,归档请放 /data/flybot-tmp。

    • build-client.mjs --check rc 0(main 与绿树各一次);ds-bot-patches check 三行 ok(ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5) / ok 10 patches apply cleanly in order / ok core/ equals ds-bot/ + patches/ds-bot/);canonical ok;第二遍 generate 零 diff。

    • 档位(实测 T1 0 30 3 4 —— tier T1、why.length 0、lines 30、files 3、generated 4)。judge() 吃的是 PR files 对象({filename, additions, deletions, changes, patch}):直接喂 7 个文件名字符串实测 T0 0 0 7 0(低一档、照抄会静默过关),喂对象但不带 patch 实测 T3 3 30 3 4(3 条 diff not inspectable:,3 个非生成文件各一条)。所以照抄这一段:

      BASE=origin/main node --input-type=module -e "
      import { createGate, loadRules } from './.github/scripts/risk-gate.mjs'
      import { execFileSync } from 'node:child_process'
      const base = process.env.BASE
      const raw = execFileSync('git', ['diff', '--numstat', base + '...HEAD'], { encoding: 'utf8' }).trim().split('\n')
      const files = raw.map((l) => { const [a, d, p] = l.split('\t'); return { filename: p, additions: +a, deletions: +d, changes: +a + +d } })
      for (const f of files) if (f.changes > 0) f.patch = execFileSync('git', ['diff', base + '...HEAD', '--', f.filename], { encoding: 'utf8' })
      const r = createGate(loadRules('.github/agent/risk-rules.json')).judge(files)
      console.log(r.tier, r.why.length, r.lines, r.files, r.generated)
      "
      # → T1 0 30 3 4

      在绿树上以 BASE=HEAD~1 实跑,输出同上。告警:只打印这五个字段,不要 console.log(gate.judge(files))(会把 basis 等内部字段带进 CI 日志)。

    • 预算:T1 上限 400 行 / 20 文件(.github/agent/risk-rules.json 的 limits.T1),本刀手写 30 行 / 3 文件 → 余 370 行 / 17 文件。

    • 文档门:分支 commit 与 PR 正文各一条 Docs-not-needed: two dictionary keys, one test and one changelog fragment; no component or structure change.;ARCH_DOCS_BASE=origin/main node core/scripts/check-arch-docs.mjs → arch-docs: OK (7 changed file(s)),rc 0(缺 trailer 会红)。本机绿树没有 origin/main,改以 main 树提交 58ce2ab 为 base 实跑(13:04Z)同得 7;若误用绿树里更早的 51db29f(它后面还压着一条本地 drop node_modules link 提交)会多算成 8,别照抄。

    8 验收清单(每条一个 $ 命令或一个断言)

    • A1 红先:git checkout $(git merge-base HEAD origin/main) -- core/src/client/i18n.js && (cd core && TZ=UTC node --test test/project-board-view.test.js) → # tests 40 / # pass 39 / # fail 1,失败断言 + actual: 'claimed' / - expected: '已认领';随后 git checkout HEAD -- core/src/client/i18n.js 复原。

    • A2 绿:(cd core && TZ=UTC node --test test/project-board-view.test.js) → 40 / 40 / 0。

    • A3 中文逐字:A2 的例 40 通过(zh 下三个 span 逐字等于 ['已认领','进行中','on-hold'])。

    • A4 英文一字不变:同一例第 1 条断言通过;git diff origin/main...HEAD -- core/src/client/project-board.js | wc -l → 0。

    • A5 字典只加不改:git diff origin/main...HEAD -- core/src/client/i18n.js | grep -c '^-[^-]' → 0;grep -cE "^ (claimed|working): '" core/src/client/i18n.js → 2。

    • A6 画点未改(本刀的关键事实):git diff --name-only origin/main...HEAD | grep -c 'core/src/client/project-board.js' → 0;grep -c "bt-project-running-status' }, t(row.status)" core/src/client/project-board.js → 1。

    • A7 五道 i18n 门:§7 的命令 → 41 / 41 / 0。

    • A8 四份基线未动:git diff --name-only origin/main...HEAD | grep -c 'baseline.json' → 0;§7 的 node -e 命令 → 12 / 9 / 46 / 2。

    • A9 生成物自洽:node core/scripts/build-client.mjs --check rc 0;提交后 git diff --exit-code -- core/client.js rc 0。

    • A10 patch 自洽:node scripts/ds-bot-patches.mjs check 三行 ok;canonical ok;git status --porcelain 为空。

    • A11 topics.json 不动:git diff --name-only origin/main...HEAD | grep -c 'topics.json' → 0。

    • A12 changelog:node .github/scripts/changelog.mjs check → changelog: 17 fragment(s) in changelog.d/ are well formed(main 16)。

    • A13 编码(干净归档树口径;worktree 会多算 .git 这个文件):

      rm -rf /data/flybot-tmp/mj36-head && mkdir -p /data/flybot-tmp/mj36-head && git archive HEAD | tar -x -C /data/flybot-tmp/mj36-head
      (cd /data/flybot-tmp/mj36-head && node .github/scripts/check-mojibake.mjs --check | head -1)

      首行以 mojibake: ok — 0 occurrences of U+FFFD in 1786 text file(s) 开头,rc 0;同法对 origin/main 归档 → 1785。

    • A14 档位:§7 的内联片段(BASE=origin/main … judge(files),对象带 patch)→ T1 0 30 3 4;同片段把 files 换成 7 个文件名字符串应为 T0 0 0 7 0(低一档的陷阱),不带 patch 应为 T3 3 30 3 4。

    • A15 预算:git diff --numstat origin/main...HEAD | awk '$3 !~ /^(core\/client\.js|patches\/)/ {s+=$1+$2; f++} END {print s, f}' → 30 3。

    • A16 禁改面零改动 + 正控:把同一条正则原样写两遍(grep -c 计数为 0 时退出码是 1,那是「零改动」的正常结果,不是失败):

      RE='^(core/src/host/|plugins/|patches/ds-bot/topics\.json$|core/test/i18n-.*\.baseline\.json$|core/src/client/about\.js$|core/src/client/capability-settings\.js$|core/src/client/sidebar\.js$|core/src/client/project-board\.js$)'
      git diff --name-only origin/main...HEAD | grep -cE "$RE"     # → 0(rc 1)
      printf 'core/src/host/store.js\nplugins/project/src/project-metrics.js\ncore/src/client/project-board.js\ncore/src/client/i18n.js\n' | grep -cE "$RE"   # → 3(正控:同一条正则真能打中)

      实测(12:50Z / 绿树,base HEAD~1;13:04Z 重跑同值):改动面 0(rc 1)、正控 3(rc 0)。

    • A17 文档门:PR 正文与分支 commit 各一条 Docs-not-needed: …;ARCH_DOCS_BASE=origin/main node core/scripts/check-arch-docs.mjs → arch-docs: OK (7 changed file(s)),rc 0。

    • A18 整刀大小:git diff --shortstat origin/main...HEAD → 7 files changed, 69 insertions(+), 2 deletions(-)。

    9 分步(≤6 步)

    1. 从 live main(开工时重读 /git/ref/heads/main)切分支;先只加测试:core/test/project-board-view.test.js 末尾追加 §6 的 25 行 → 实测 40 / 39 / 1。
    2. 在 core/src/client/i18n.js 的 stalled: '已停滞', 之后插 4 行(2 行注释 + claimed: '已认领', / working: '进行中',)→ 实测 40 / 40 / 0;跑 A7(41/41/0)与 A8(四份基线 12 / 9 / 46 / 2,命令见 §7)。
    3. 加 changelog 片段(§10),changelog.mjs check → 17 片段(main 16)。
    4. 按 §5 的顺序:确认 esbuild 在 → npm run build → generate → 再 generate → commit(带 Docs-not-needed:)→ canonical → check → build-client --check(rc 全 0);确认 topics.json 没进 diff、git status 干净。
    5. 跑 A14 档位(§7 片段 → T1 0 30 3 4)、A15 预算(30 3)、A13 编码(归档树 1786 文件 / 0 处 U+FFFD)、A16 禁改面(0 + 正控 3)、A17 文档门(OK (7 changed file(s)))。
    6. 开收口单(bug area:ui)与 PR:Fixes #<收口单> + Part of #3114(绝不把关闭关键字指向伞号 [#3110] 已落地聊天壳、设置、搜索与历史命中的收口 #3114)+ Owner: / Reviewer: / ## Checkpoint + tip sha + 红绿三数。

    10 建议标题 / changelog 正文

    • PR 标题:Read a running task's status in the window language (#3114)
    • 收口单标题:项目看板:在跑任务表的状态列把 claimed / working 按窗口语言显示(Cut 36)
    • 本评论标题:## 第三十六刀切片:项目看板 › 在跑任务表的状态列(main 4031b9ed)
    • changelog.d/3114-cut-36-running-status.fixed.md(一条,.fixed):

      A running task on the Project board now reads claimed / working in Chinese instead of the host task ids (#3114).

    11 不做的事 / 风险

    • 不改 core/src/client/project-board.js 一行:画点 :550 已经是 t(row.status),本刀只补字典;A6 就是这条的守卫。
    • 不碰 core/src/host/** 一行:任务状态机与读模型保持原样。
    • 不碰 plugins/**:runningOf 的过滤条件(:116)是数据来源,不是文案缺陷。
    • 不译 data-* 属性:data-task-id、data-overdue、data-running、data-status 全原样。
    • 不译产品名 DSH Agent、不译时间单位 {}s/{}m/{}h/{}d、不动 about.js / capability-settings.js / sidebar.js / project-board.js:661 / team 簇。
    • 不手改生成物与四份基线(core/client.js、patches/ds-bot/**、core/test/i18n-*.baseline.json)。
    • 不跑 npm ci、不 git add core/node_modules 符号链接;归档别放 /tmp(128M tmpfs 会写满)。
    • 风险 1(裸键的代价):将来若有人把别的 working(如 mark.js 的 Bot 活动态)喂进 t(),会读「进行中」;今天全仓没有这种调用(grep -rn "t('working')" → 0),真冲突时改法是前缀键 + 一处映射。project-board.js:671 的空态 key 取值来自宿主 read model(§2 第 2 条),是这一风险的同一面,同样按「今天没有」接受。
    • 风险 2(hostText 的连带):hostText 只在「整条消息恰好是一个字典键」时翻译(i18n.js:1894)。宿主没有内容恰好是 working/claimed 的消息(grep -rn "Error('working')" 等 0 命中),但这是一个已知的语义面扩大,写在这里。
    • 风险 3(宿主不守约):metricsView 不校验状态域,宿主若回第三个值就原样画;新用例的 on-hold 就是这条的守卫,本刀不替宿主猜。
    • 风险 4(同屏仍有一处英文):跑同一张表的 Source 列在 zh 下仍读 Groups(:553 画 t('Groups'),字典没有这个键,读于 13:03Z;见 §12.1);这是另一处语义,本刀不夹带。

    12 下一刀候选(本刀不夹带)

    1. 同屏 · 源分组名 Groups 缺键:SOURCE_LABELS(project-board.js:138)的 Groups 没有中文键,:336→:414 的分组表头与 :553 的 Source 列都会读英文;Bots/Workflows 已有键。为什么现在不做:Groups 要定「群 / 群组 / 群聊」的口径(字典里已有「群聊」这一族词),且它是同一屏的另一处语义,按派活单不许打包。
    2. 插件侧 67 条(scripts/i18n-usage.mjs 的 12 bare + 46 missing + 9 template,全在 plugins/{timeline,tree,social,workflow}/client.js):为什么现在不做:落在 plugins/**,不是 T1,本刀不越档。
    3. 浏览器面板的宿主错误句:browser-pane.js:263 t(page.error),值来自 core/src/host/browser.js:98/110/129 的英文句子;走 hostText 还是走键、译到什么程度要 owner 拍板。为什么现在不做:属「不译宿主原话」的取舍。
    4. 已判过、别再翻:project-board.js:661 的 meeting.advance.reason、about.js:97 的 Star、capability-settings.js:14 的 Could not connect: {error}、sidebar.js 的 DSH Agent、team 簇(#51 #55 #56 #57 #58 #149 #427)。

    13 first_slice

    整刀就是第一刀:3 个手写文件 / 30 行(字典 +4、测试 +25、changelog 1 行)+ 4 个生成路径(core/client.js +4、0001 +5/−1、0008 +5/−1、files/test +25),只给两个已经走 t() 的任务 id 补上字典键,可独立成 PR:Fixes #<收口单> + Part of #3114(关闭关键字绝不指向伞号)。预算余 370 行 / 17 文件,档位 T1(T1 0 30 3 4,实测)。


    Part of #3114 · first_slice:整刀就是第一刀 —— 2 条字典键 + 25 行测试 + 1 行 changelog,可独立成 PR。

  20. Birfy commented on Nov 20, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage · Part of #3114 · 只出规格

    第三十七刀切片:设置 › 插件页 › Project 那一行的用途句(main 7f95f0c)

    Written-by: Triage · Part of #3114 · 只出规格,不含实现;收口单由实现 PR 自己开
    基线 main 7f95f0cfffb1d0dfb14ba8b58e5ebe19c5c8f388(GET /repos/ThinkFlowLab/FlyBot/commits/main 读于 2026-11-20T14:02:20Z、14:19:25Z、15:15:19Z 三次同 sha;committer date 2026-11-20T13:50:15Z,即 cut 36 的 #3269)。
    读法:本机没有 workspace/opendigitalmate 底座,按派活单的 main sha 取官方 tarball/7f95f0cf 全树到 runs/i3114-cut37/repo(等价干净检出);红树 runs/i3114-cut37/red(干净 7f95f0c + 只放新测试)、绿树 runs/i3114-cut37/green(+ 一条字典键)、runs/i3114-cut37/work(git 两提交,用于 build/generate/档位/编码门)。下面每个计数都带「读于 <UTC> / 基线 7f95f0c」和是哪棵树。
    修订(重测于 2026-11-20T14:52–14:55Z / 基线 7f95f0c):按审读意见改 9 处——译名 Project → 项目(同步测试正则、重新 build/generate 并重跑红绿)、t() 与 setPluginSwitch 的行号、bare/missing/template 的计数口径、Star 键名、「五个插件名」补 Bot Social、A14 的 rc 取法;红绿三数(7/6/1、7/7/0、6/6/0)、五道门(41/41/0)、四基线(12/9/46/2)、档位(T1 0 24 3 4)与整刀大小(7 files +49/−6)都在新译名上重测,结论不变。
    第二次修订(复查于 2026-11-20T15:15–15:25Z / 同一基线 7f95f0c):发现并改正 §1.1 两处计数——SHAPES 实为 20 条(characters.js:199 由 CHARACTERS 逐条建,bot-settings.js:117 的 t(shapeOf(id).label) 画的就是这 20 个 label),原写 12 是把 CHARACTER_COLORS 的 12 个数混了进来;Star: '星星' 落在 i18n.js:788-791 的 Shapes 块(块内 22 个形状名,其中 20 个正是 CHARACTERS 现在画的 label),原文「十二种形状名之一」的说法撤销,理由不变(Stars 键 0 条、这 22 个名字里没有一个是按钮文案)。同一次复查在 7f95f0c 上重测:repo 树 12/46/9 与 10/19/2、四基线 12/9/46/2、红 7/6/1、绿 7/7/0、干净 6/6/0、五道门 41/41/0、T1 0 24 3 4、手写 24 行/3 文件、整刀 7 files +49/−6、归档 1770/0 rc 0、build-client --check/patches check/canonical/arch-docs 全 rc 0 —— 与下文一致。

    0 目标(一句)

    中文窗口里,设置 → 插件页 Project 那一行现在把用途读成英文句 Run a Project: Project State, …,本刀给这条用途补上字典键,让它读成中文句「运行一个项目:…」;同页另外四行、插件名、开关、英文窗口一律不动。

    1 先扫再选

    1.1 仓库自带工具的扫描(读于 14:04–14:06Z / 基线 7f95f0c,树 repo)

    工具在 scripts/i18n-usage.mjs(不在 .github/scripts/ 下)。三个开关都覆盖 plugins/*/client.js:

    node scripts/i18n-usage.mjs                  # 12 bare draws in 4 files
    node scripts/i18n-usage.mjs --missing        # 46 drawn copy strings with no zh entry in 4 files
    node scripts/i18n-usage.mjs --template-draws # 9 template draws in 2 files

    三者全部落在 plugins/{timeline,tree,social,workflow}/client.js,即 plugins/**,不满足 T1,这 67 条(12+46+9)本刀一条都不取。

    对 core/src/client/*.js 走同一套词法(tokens/bareCopy/missingCopy/templateDraws,只换根目录,96 个文件),实测 10 bare / 19 missing / 2 template(读于 14:05Z / 7f95f0c):

    node --input-type=module -e "
    import { readdirSync, readFileSync } from 'node:fs'
    import { bareCopy, missingCopy, templateDraws } from './scripts/i18n-usage.mjs'
    const dir = 'core/src/client'; const b = [], m = [], t = []
    for (const f of readdirSync(dir).filter(n => n.endsWith('.js')).sort()) {
      const src = readFileSync(dir + '/' + f, 'utf8')
      b.push(...bareCopy(src, f)); m.push(...missingCopy(src, f)); t.push(...templateDraws(src, f))
    }
    console.log(b.length, m.length, t.length)   # 10 19 2
    "

    逐条核过(14:05–14:18Z / 7f95f0c,树 repo,并把每张动态 t(<expr>) 的取值域用 DICTIONARY.zh 实测了一遍):

    候选 位置 判 理由
    Plugin 用途句(Project 一条缺键) 画点 settings.js:84/:90,值 host/plugins.js:23 取 一屏一处语义;t(plugin.purpose) 早就在画,同一句式的另 4 条已有键;补的是字典不是画点
    Groups project-board.js:138→:414/:553 不取 owner 已判:要定「群 / 群组 / 群聊」
    Star about.js:97 不取 owner 已判;字典里命中的是 Star: '星星'(i18n.js:788 的 Shapes 块,块内共 22 个形状名;grep -c 'Stars:' core/src/client/i18n.js → 0 条),它是形状名而不是按钮文案——直接复用会把 about.js:97 那个「Star」按钮画成「星星」
    Could not connect: {error} capability-settings.js:14 不取 owner 已判({error} 是第三方原话)
    DSH Agent sidebar.js:286、context-menu.js:117 不取 产品名
    meeting.advance.reason project-board.js:661 不取 owner 已判(走 hostText 还是走键)
    10 bare(about.js:97、capability-settings.js:64/69/76–78、80–82、details-drawer.js:236) — 假阳性 Field 在 :19、About 在 :130 已经把 label/title 送进 t(),8 个字段名与 Notice 在字典里都有值;about.js:97 是上表那条。capability-settings.js 的 8 条实测是 64、69、76、77、78、80、81、82(:79 没有裸字面量)
    19 missing 里的 18 条 bot-settings.js:105/247、capability-settings.js:64、project-board.js:433/435/437/438、secret-card.js:40/269/270/282/283、themes.js:14/18/19/23/24/29 数据 色值、SVG 段、$DSH_SECRET_NAME / [secret:NAME] 占位符、{}s/{}m/{}h/{}d 时间单位、示例名 Bob/my-tool、命令行示例。19 条里的第 19 条是 sidebar.js:286(已在上表按「DSH Agent」产品名判掉),故数据只有 18 条
    2 template secret-card.js:113、settings.js:86 数据 与上面 19 missing 分开列(template 是另一类词法命中):{}s/{}m 时间单位模板

    动态 t(<expr>) 的取值域逐个实测(读于 14:08–14:18Z / 7f95f0c):inbox STATUSES(9 条)、GROUPS(3+3)、TOOL_PHRASES(7)、GROUP_PHRASES(4)、cells.js 群动词(8)、FAILURES(9)、FAILURE_COPY(12)、VOICE_LABELS(6)、CAPTURE_NOTES(3)、ROOM_MODES(2+2)、PERMISSION_LABELS、TAB_LABELS、ROLE_LABELS、FOLD_MODE_LABELS、SEND_KEY_LABELS、NOTIFY_KINDS、SETTINGS_PAGES(13)、SOURCES、UNITS、SOURCE_LABELS(Groups 除外)、METRIC_CARDS/METRICS_REASON_KEYS、SHAPES(20,characters.js:199 由 CHARACTERS 逐条建,bot-settings.js:117 画的 t(shapeOf(id).label) 就是这 20 个 label)/CHARACTER_COLORS(12)、INKS(19)/ACCENT_INKS(7)、THEMES(4)、宿主空态键(4 条,plugins/project/src/project-board.js:372/374/375/453)—— 全部有中文值。也就是说:core/src/client 的裸字面量与表格值这一层已经扫干,只剩 §1.2 这一条。

    1.2 唯一的真缺口:第五个插件用途

    FEATURE_PLUGINS 有五条,purpose 走 t();字典里只有前四条的键:

    node --input-type=module -e "
    import { DICTIONARY } from './core/src/client/i18n.js'
    const zh = DICTIONARY.zh
    for (const p of ['Chat with a friend\'s Bots on a Bot Social server.','Run Bots as a tree under a coordinator.','Read the team activity as a timeline.','Run workflow graphs across several Bots.','Run a Project: Project State, its board, its own Chief, its team and its assistant.'])
      console.log(Object.hasOwn(zh, p) ? 'ok  ' : 'MISS', p)
    "
    # ok ok ok ok MISS   (读于 14:08Z / 7f95f0cf,树 repo)

    这不是「宿主原话」:它不走 hostText,而是和 t(row.status)(cut 36)、t(meeting.status)(cut 35)同一类——宿主给的静态标签经 t() 走字典;同一屏的另 4 条已经这样译好了,本刀只是把这一个格子补齐。

    2 可达性(先证打得到)

    画点:core/src/client/settings.js:90(装着的插件)与 :84(本 profile 没装的插件),两条都画同一个字段:

    : h(SwitchRow, { key: plugin.id, label: plugin.name,
        hint: `${plugin.package} — ${t(plugin.purpose)}`, …
    h('span', { className: 'bt-set-hint' }, `${plugin.package} — ${t(plugin.purpose)}`),

    一条链,四段,全部读到行号:

    1. core/src/host/plugins.js:19-23 —— FEATURE_PLUGINS 是一个 Object.freeze([...]) 字面量,5 行,每行 { id, name, package, purpose };Project 在 :23,purpose: 'Run a Project: Project State, its board, its own Chief, its team and its assistant.'。
    2. core/src/host/plugins.js:49-56 pluginSwitches(state, bundles) —— FEATURE_PLUGINS.map(plugin => ({ ...plugin, enabled, installed })),purpose 原样带出,不改写、不裁剪。
    3. core/src/host/hooks.js:1149-1150(switches → pluginRows,后者再叠 loaded)、:1157-1165(pluginAnswer())、:1165 api.handle('plugins/list', async () => pluginAnswer(), { read: true })。
    4. 客户端 core/src/client/settings.js:101-105(PluginsPage 调 call('plugins/list') 并存 answer)→ :76-91(PluginsView 遍历 answer.plugins)→ :90/:84 画 t(plugin.purpose)。t() 在 core/src/client/i18n.js:1898-1900(:1891 是 installLocale 里的 locale.register(NAMESPACE, 'zh', ZH),别混):export function t(key, params) { return bound ? bound(key, params) : fill(key, params) } —— 没有 locale 服务时 fill 原样返回键(英文窗口),装了 zh 就走 bound 查已注册的 ZH。

    值域只有五个,没有第六个会漏进来:pluginRows 只 map pluginSwitches,后者只 map FEATURE_PLUGINS;写入口 setPluginSwitch(core/src/host/plugins.js:59-67,:61 的 known(name) 挡掉目录外的 id;:58 是注释)所以这个页面永远不会出现目录外的 purpose。当前 5 条 purpose 都是非空字面量(grep -c "purpose: '" core/src/host/plugins.js → 5,读于 14:10Z / 7f95f0c)。

    两种行都画:插件装着走 SwitchRow.hint(:90),没装走安装提示行(:84);也就是说无论 profile 装没装 Project,这一行都会出现,缺陷在两种情况下都可见。

    3 键名与译名

    键就取整句,不造裸键、不做映射表:另外四条已经是整句键(i18n.js:1475-1478),本刀沿用同一形状——'Run a Project: Project State, its board, its own Chief, its team and its assistant.'。这样英文窗口一字不变(无 locale 时 t() 原样返回该键),也不会和任何裸键撞。

    实测(读于 14:10Z / 7f95f0c,树 repo):

    • 全仓 t('<这句>') 调用者 0:grep -rn "Run a Project: Project State" core plugins --include=*.js 只命中 core/src/host/plugins.js:23(目录)与 i18n.js(新增键)。
    • 字典内同名键 0:grep -c "Run a Project: Project State" core/src/client/i18n.js → 新增后 1(不重复)。
    • 字典里没有 Project / Project State 这两个键,全仓也没有 t('Project') / t('Project State') 调用(grep -rn "t('Project')\|t('Project State')" core plugins --include=*.js → 0 条,读于 14:53Z / 7f95f0c):这两个键本刀都不加,谈不上互相影响。
    键 译名 依据(全部沿用字典里已有的说法,不需要 owner 定名)
    Run a Project: Project State, its board, its own Chief, its team and its assistant. 运行一个项目:Project State、它的看板、它自己的 Chief、它的团队和助手。 Project 按字典既有域译法译「项目」:'Projects': '项目'(i18n.js:1625)、'Project settings': '项目设置'(:1595)、'Project board': '项目看板'(:1596)、'Project name': '项目名称'(:1627)、'Project team': '项目团队'(:1670),README.zh.md:79 也把这个域叫「项目」。字典里唯一保留英文的 'no working folder: this Project names none'(:1688)是 host 拒绝句的原话,不构成域名口径;Project State 保留英文——字典无此键(grep -c "Project State" core/src/client/i18n.js → 0),README.zh.md:79 同样写 Project State,不自己造词;Chief 保留('Project Chief': '项目 Chief',:1656);board → 「看板」、assistant → 「助手」('Assistant settings saved.',:1660)、team → 「团队」。全部沿用字典已有说法,不需要 owner 定名。

    4 改动面(逐文件 +N/−M,绿树 work 上 git diff --numstat 实测,读于 14:17Z / 新译名重测于 14:53Z / 基线 7f95f0c)

    文件 +/− 具体改什么
    core/src/client/i18n.js +2/−0 在 'Run workflow graphs across several Bots.'(:1478)之后插 1 行注释 + 1 行键,落在 :1479-1480
    core/test/plugin-installed-faces.test.js +19/−2 ①:10 加 import { readFileSync } from 'node:fs';②:18 的 esbuild contents 里再导出 DICTIONARY, installLocale;③:59 解构这三个;④文件末尾加新用例(:156-170)
    changelog.d/3114-cut-37-plugin-purpose.fixed.md +1/−0 一条 .fixed(正文见 §10)
    手写合计 +22/−2 = 24 行 / 3 文件
    生成物(npm run build + generate 之后,不许手改) +/−
    core/client.js +2/−0(25106 → 25108 行,键在 :1523,注释 :1522)
    patches/ds-bot/0001-core-fixes.patch +3/−1(i18n.js 走上游 patch 的 hunk 头与行数)
    patches/ds-bot/0008-client-bundle.patch +3/−1(bundle 字典 hunk)
    patches/ds-bot/files/test/plugin-installed-faces.test.js +19/−2(整文件镜像)
    生成合计 4 路径 / +27/−4
    • core/src/client/settings.js 本刀一行不动(画点已经在 t() 里):git diff --name-only HEAD~2 | grep -c 'core/src/client/settings.js' → 0(读于 14:17Z,树 work)。grep -c "t(plugin.purpose)" core/src/client/settings.js → 2。
    • patches/ds-bot/files/src/client/i18n.js 不存在(i18n.js 是上游文件,只能走 0001 的 hunk);patches/ds-bot/topics.json 逐字节不动。
    • 四份基线全不动(12 / 9 / 46 / 2,§6),本刀一次 --write 都不跑。
    • 整刀合计 7 路径 / +49/−6(git diff --shortstat HEAD~2 → 7 files changed, 49 insertions(+), 6 deletions(-))。

    5 红先 → 绿(实测三数,读于 14:12–14:14Z / 新译名重测于 14:52Z / 基线 7f95f0c)

    加在哪:core/test/plugin-installed-faces.test.js 文件末尾(main 153 行之后)。这个文件本来就用 esbuild + 同一套 hook shim 画 PluginsView,已经有 draw()、text()、plugin() 三个现成件,所以新用例只有 15 行。

    用例名:#3114 cut 37: every plugin purpose reads in the window language

    它核三条事实(前两条就是红先的顺序):

    1. 英文窗口不变:不装 locale 时页面里仍有 Project 那句原文(实现前就是绿的)。
    2. 装 zh:页面上五条用途全部不许再以英文出现(红先命中的就是这一条,今天 Project 那句还在)。
    3. 中文具体读法:页面里出现 运行一个项目(钉住译名,防止换个说法)。

    用例从 core/src/host/plugins.js 源码里读 5 条 purpose(/purpose: (['"])((?:(?!\1).)+)\1/g),所以以后谁再加一个插件而没加中文键,这个用例会红——守的是这一整类,不只是这一个键。

    红先实测(红树 = 干净 7f95f0c + 只放新测试;(cd core && TZ=UTC node --test test/plugin-installed-faces.test.js)):

    not ok 7 - \#3114 cut 37: every plugin purpose reads in the window language
      error: |-
        "Run a Project: Project State, its board, its own Chief, its team and its assistant." still reads English in a zh window
        true !== false
    # tests 7 / # pass 6 / # fail 1
    

    补一条字典键后实测(绿树 green):# tests 7 / # pass 7 / # fail 0。干净 7f95f0c 的单文件是 6/6/0。

    五道 i18n 门(test/i18n.test.js + 四道)红树、绿树都 41/41/0(本刀不动 i18n.test.js,读于 14:13Z / 14:14Z)。

    6 五道门 / 四份基线 / 档位 / 预算(实测)

    • i18n 五件套:(cd core && TZ=UTC node --test test/i18n.test.js test/i18n-missing-entries.test.js test/i18n-template-draws.test.js test/i18n-plugins.test.js test/i18n-plugins-missing-zh.test.js) → 41 / 41 / 0(红树、绿树各一遍)。

    • 四份基线(core/test/i18n-*.baseline.json)条数用这条读,别数行:

      node -e "for (const f of ['i18n-plugins','i18n-template-draws','i18n-missing-entries','i18n-plugins-missing-zh']) console.log(f, require('./core/test/'+f+'.baseline.json').entries.length)"

      实测(14:05Z 基线树、14:15Z 绿树,同四数):i18n-plugins 12、i18n-template-draws 9、i18n-missing-entries 46、i18n-plugins-missing-zh 2 → 改后同四数(本刀只加 core 字典键,不动任何插件画点);git diff --name-only HEAD~2 | grep -c 'baseline.json' → 0。四份的唯一生成命令(将来若必须变,只提交该命令写出的文件):

      node scripts/i18n-usage.mjs --write core/test/i18n-plugins.baseline.json
      node scripts/i18n-usage.mjs --missing --write core/test/i18n-missing-entries.baseline.json
      node scripts/i18n-usage.mjs --template-draws --write core/test/i18n-template-draws.baseline.json
      node core/test/i18n-plugins-missing-zh.test.js --write
    • changelog.mjs check:main 17 → 本刀 18(changelog: 18 fragment(s) in changelog.d/ are well formed)。

    • check-mojibake.mjs --check(干净归档树口径,别在 worktree 里量):基线归档 1769 文件 / 0 处 U+FFFD → 本刀归档 1770 / 0(只多 1 个 changelog 文本文件),set -o pipefail 取 ${PIPESTATUS[0]} 实测 rc 0(读于 14:53Z,新译名重测)。本机 /tmp 只有 128M,归档放 /data/flybot-tmp。

    • build-client.mjs --check rc 0;ds-bot-patches check 三行 ok(ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5) / ok 10 patches apply cleanly in order / ok core/ equals ds-bot/ + patches/ds-bot/);canonical ok;第二遍 generate 零 diff。

    • 档位(实测 T1 0 24 3 4)。judge() 必须吃带 patch 的 PR files 对象;实测两个陷阱都在:喂 7 个文件名字符串 → T0 0 0 7 0(低一档,照抄会静默过关),喂对象但不带 patch → T3 3 24 3 4(3 条 diff not inspectable:)。

      BASE=origin/main node --input-type=module -e "
      import { createGate, loadRules } from './.github/scripts/risk-gate.mjs'
      import { execFileSync } from 'node:child_process'
      const base = process.env.BASE
      const raw = execFileSync('git', ['diff', '--numstat', base + '...HEAD'], { encoding: 'utf8' }).trim().split('\n')
      const files = raw.map((l) => { const [a, d, p] = l.split('\t'); return { filename: p, additions: +a, deletions: +d, changes: +a + +d } })
      for (const f of files) if (f.changes > 0) f.patch = execFileSync('git', ['diff', base + '...HEAD', '--', f.filename], { encoding: 'utf8' })
      const r = createGate(loadRules('.github/agent/risk-rules.json')).judge(files)
      console.log(r.tier, r.why.length, r.lines, r.files, r.generated)
      "
      # → T1 0 24 3 4

      在 work 树上以 BASE=HEAD~2 实跑,输出同上。告警:只打印这五个字段,别 console.log(gate.judge(files))。

    • 预算:T1 上限 400 行 / 20 文件(.github/agent/risk-rules.json 的 limits.T1),本刀手写 24 行 / 3 文件 → 余 376 行 / 17 文件。

    • 文档门:commit 与 PR 正文各一条 Docs-not-needed: one dictionary key, one test and one changelog fragment; no component or structure change.;ARCH_DOCS_BASE=HEAD~2 node core/scripts/check-arch-docs.mjs → arch-docs: OK (7 changed file(s)),rc 0(本机绿树没有 origin/main,以基线提交为 base 实跑;正式 PR 用 ARCH_DOCS_BASE=origin/main)。

    7 生成顺序与命令(在 work 上实跑,rc 全 0)

    test -d core/node_modules/esbuild && echo "esbuild present"   # 本机符号链接到 /data/esinst/node_modules;别跑 npm ci
    export TMPDIR=/data/flybot-tmp                                # /tmp 只有 128M,归档别放 /tmp
    export PATH=/data/dsh/bot/workspace/tools/git/bin:$PATH        # 本机 git 在 tools/ 下
    export GIT_EXEC_PATH=/data/dsh/bot/workspace/tools/git/libexec/git-core
    (cd core && npm run build)                        # core/client.js
    node scripts/ds-bot-patches.mjs generate          # patches/ds-bot/*
    git add -A
    node scripts/ds-bot-patches.mjs generate          # 第二遍确认幂等(实测零 diff)
    git add -A
    git commit -m "Read the Project plugin's purpose on the Plugins page in the window language (#3114)" \
               -m "Docs-not-needed: one dictionary key, one test and one changelog fragment; no component or structure change."
    node scripts/ds-bot-patches.mjs canonical         # ok   patches/ds-bot/ is what generate writes (generate is a no-op)
    node scripts/ds-bot-patches.mjs check             # 三行 ok
    node core/scripts/build-client.mjs --check         # rc 0

    顺序:core/ 改动落盘之后再 build + generate;颠倒会报 core/… : committed but not produced by the patches。坑同 cut 34–36:core/node_modules 这个符号链接会被 git add -A 当文件、被 generate 当目录 —— 写进 .git/info/exclude。

    8 验收清单(每条一个 $ 命令或一个断言)

    • A1 红先:git checkout $(git merge-base HEAD origin/main) -- core/src/client/i18n.js && (cd core && TZ=UTC node --test test/plugin-installed-faces.test.js) → # tests 7 / # pass 6 / # fail 1,失败例是 not ok 7,错误文本 "Run a Project: Project State, …" still reads English in a zh window;随后 git checkout HEAD -- core/src/client/i18n.js 复原。

    • A2 绿:(cd core && TZ=UTC node --test test/plugin-installed-faces.test.js) → 7 / 7 / 0(干净 main 是 6 / 6 / 0)。

    • A3 中文逐字:A2 的例 7 通过;grep -c "运行一个项目:Project State、它的看板、它自己的 Chief、它的团队和助手。" core/src/client/i18n.js → 1。

    • A4 英文一字不变:A2 例 7 第 1 条断言(不装 locale 时原文仍在)通过;git diff origin/main...HEAD -- core/src/client/settings.js core/src/host/ | wc -l → 0。

    • A5 字典只加不改 / 不重复:git diff origin/main...HEAD -- core/src/client/i18n.js | grep -c '^-[^-]' → 0;grep -c "Run a Project: Project State" core/src/client/i18n.js → 1(同一个键在仓库里只有这一个定义)。

    • A6 画点未改(本刀的关键事实):git diff --name-only origin/main...HEAD | grep -c 'core/src/client/settings.js' → 0(grep -c 计数 0 时退出码是 1,那是正常结果);grep -c "t(plugin.purpose)" core/src/client/settings.js → 2。

    • A7 五道 i18n 门:§6 的命令 → 41 / 41 / 0。

    • A8 四份基线未动:git diff --name-only origin/main...HEAD | grep -c 'baseline.json' → 0(rc 1);§6 的 node -e → 12 / 9 / 46 / 2。

    • A9 生成物自洽:node core/scripts/build-client.mjs --check rc 0;提交后 git diff --exit-code -- core/client.js rc 0;node scripts/ds-bot-patches.mjs check 三行 ok;canonical ok;git status --porcelain 为空。

    • A10 档位:§6 的内联片段(BASE=origin/main … judge(files),对象带 patch)→ T1 0 24 3 4;同片段把 files 换成 7 个文件名字符串应为 T0 0 0 7 0(低一档的陷阱),不带 patch 应为 T3 3 24 3 4。

    • A11 预算:git diff --numstat origin/main...HEAD | awk '$3 !~ /^(core\/client\.js|patches\/)/ {s+=$1+$2; f++} END {print s, f}' → 24 3。

    • A12 禁改面零改动 + 正控:

      RE='^(core/src/host/|plugins/|\.github/|scripts/|core/src/client/(about|capability-settings|sidebar|project-board)\.js$)'
      git diff --name-only origin/main...HEAD | grep -cE "$RE"     # → 0(rc 1)
      printf 'core/src/host/plugins.js\nplugins/project/client.js\n.github/agent/risk-rules.json\nscripts/i18n-usage.mjs\ncore/src/client/settings.js\n' | grep -cE "$RE"   # → 4(正控:同一条正则真能打中)

      实测(14:18Z 与 14:53Z 两次同数,树 work,base HEAD~2):改动面 0(rc 1)、正控 4(rc 0)。

    • A13 changelog:node .github/scripts/changelog.mjs check → changelog: 18 fragment(s) in changelog.d/ are well formed(main 17)。

    • A14 编码(干净归档树口径;worktree 会把 .git 计成一个文件):

      rm -rf /data/flybot-tmp/mj37-head && mkdir -p /data/flybot-tmp/mj37-head && git archive HEAD | tar -x -C /data/flybot-tmp/mj37-head
      (cd /data/flybot-tmp/mj37-head && set -o pipefail; node .github/scripts/check-mojibake.mjs --check | head -1; echo "rc=${PIPESTATUS[0]}")

      首行以 mojibake: ok — 0 occurrences of U+FFFD in 1770 text file(s) 开头、rc=0;同法对 main 归档 → 1769。取 rc 时别只看 $?:node … | head -1 的 $? 是 head 的,检查失败也会返回 0,必须加 set -o pipefail 或取 ${PIPESTATUS[0]}(本条实测两种归档都是 rc=0,读于 14:53Z / 7f95f0c,归档树口径)。

    • A15 整刀大小:git diff --shortstat origin/main...HEAD → 7 files changed, 49 insertions(+), 6 deletions(-)。

    • A16 文档门:PR 正文与分支 commit 各一条 Docs-not-needed: …;ARCH_DOCS_BASE=origin/main node core/scripts/check-arch-docs.mjs → arch-docs: OK (7 changed file(s)),rc 0。

    • A17 用例守的是整类:把 core/src/host/plugins.js 里任一 purpose 改一个字(或加第六条),A2 必须变红——这条可以在评审时手工验一次,不必进 CI。

    9 分步(≤6 步)

    1. 从 live main(开工时重读 /git/ref/heads/main)切分支;先只加测试:core/test/plugin-installed-faces.test.js 的 3 处小改 + 末尾 15 行用例 → 实测 7 / 6 / 1。
    2. 在 core/src/client/i18n.js:1478 之后插 2 行(1 行注释 + 1 行键)→ 7 / 7 / 0;跑 A7(41/41/0)与 A8(12 / 9 / 46 / 2)。
    3. 加 changelog 片段(§10),changelog.mjs check → 18 片段(main 17)。
    4. 按 §7 顺序:确认 esbuild 在 → npm run build → generate → 再 generate → commit(带 Docs-not-needed:)→ canonical → check → build-client --check(rc 全 0);确认 git status 干净。
    5. 跑 A10 档位(T1 0 24 3 4)、A11 预算(24 3)、A14 编码(归档树 1770 文件 / 0 处 U+FFFD)、A12 禁改面(0 + 正控 4)、A16 文档门(OK (7 changed file(s)))。
    6. 开收口单(bug + area:ui)与 PR:Fixes #<收口单> + Part of #3114(绝不把关闭关键字指向伞号 [#3110] 已落地聊天壳、设置、搜索与历史命中的收口 #3114)+ Owner: / Reviewer: / ## Checkpoint + tip sha + 红绿三数。

    10 建议标题 / changelog 正文

    • PR 标题:Read the Project plugin's purpose on the Plugins page in the window language (#3114)
    • 收口单标题:设置:插件页 Project 那一行的用途句在中文窗口读英文(Cut 37)
    • 本评论标题:## 第三十七刀切片:设置 › 插件页 › Project 那一行的用途句(main 7f95f0cf)
    • changelog.d/3114-cut-37-plugin-purpose.fixed.md(一条,.fixed):

      The Project plugin's row on Settings → Plugins now reads its purpose in Chinese instead of English (#3114).

    11 本刀不做什么 / 风险

    不做(逐条有理由):

    • 不改 core/src/client/settings.js 一行:画点 :84/:90 已经是 t(plugin.purpose),缺陷在字典;A6 就是这条的守卫。
    • 不译插件名(plugin.name 裸画在 settings.js:83 与 :89,SwitchRow(bot-settings.js:85-89)不翻译 label):五个名字是 Bot Social / Tree / Timeline / Workflow / Project(core/src/host/plugins.js:19-23,Bot Social 在 :19),是产品面命名,要不要中文化得 owner 定;本刀只译用途句式,不动名字(名字保留英文与用途句里 Project 译「项目」是两件事,不冲突)。
    • 不碰 core/src/host/** 一行:FEATURE_PLUGINS 的英文原文是这一屏的英文窗口与目录真源。
    • 不碰 plugins/**、.github/**、scripts/**:plugins/*/client.js 那 67 条(12 bare / 46 missing / 9 template)一条都不取,本刀不越档。
    • 不译宿主原话(hostText 那类):roster.readOnly 横幅、browser-pane.js:263 的 page.error、bot-browsers.js:436/438 抛出的 Error 文本、core/src/shared/artifact.js 的 REVISION_RULES(引擎拒绝句的措辞)——都不在「补字典键」的范围里。
    • 不碰 Groups、about.js 的 Star、capability-settings.js:14、sidebar.js 的 DSH Agent、project-board.js:661、team 簇(#51 #55 #56 #57 #58 #149 #427),也不重复 cut 34/35/36 已合的三处。
    • 不手改生成物与四份基线;一次 --write 都不跑。
    • 不跑 npm ci、不 git add core/node_modules 符号链接;归档别放 /tmp。

    风险:

    1. 整句键会随宿主措辞过期:若有人改了 plugins.js 的 purpose 文本,字典里的旧键就静默失效、这一行又读英文。本刀的新用例从目录源码读 purpose 并逐条要求「不是英文」,所以改文本会立刻变红,这是这条风险的守卫。
    2. Project State 仍保留英文:Project 已按字典译「项目」(与 README.zh.md:79 及 Project board/Project team/Project settings 等既有译法一致),但 Project State 在字典和 README.zh.md:79 里都是英文,所以这一行仍是中英混排(Chief 同理,字典里就是「项目 Chief」);若 owner 以后要给 Project State 一个中文名,那是另一刀(要同步 README.zh.md 与多句已译文本,不是补一个键)。
    3. 只在 PluginsView 这一层验证:用例直接用组件函数画,没有浏览器点击验收;plugins/list 的真实往返由既有 plugins-list-installed / plugin-switches 那组宿主测试守着,本刀不改那段。
    4. 旧窗口的缓存:字典在 bundle 里,用户要拿到新窗口才生效;这是发布节奏问题,不是代码缺陷。

    12 下一刀候选(本刀不夹带,供 owner 选)

    候选 位置 为什么这一刀不取
    五个插件名(Bot Social / Tree / Timeline / Workflow / Project) 画点 settings.js:83/:89(裸画),值 host/plugins.js:19-23 产品面命名,要 owner 定「是否中文化」;且要与插件自己画的同名标题一起定(plugins/tree/client.js:114 的 'Tree'、plugins/timeline/client.js:669 的 'Timeline' 都是裸画),否则两处不一致
    Groups project-board.js:138→:414/:553 owner 定「群 / 群组 / 群聊」
    插件侧 67 条(12 bare + 46 missing + 9 template) plugins/{timeline,tree,social,workflow}/client.js 落在 plugins/**,不是 T1
    浏览器面板的宿主错误句 browser-pane.js:263(值来自 host/browser.js:98/110/129) 走 hostText 还是走键、译到什么程度要 owner 拍
    只读窗口横幅(roster.readOnly) read-only.js:21、sidebar.js:455/457 等 8 处 宿主原话,属「不译宿主原话」
    shared/artifact.js 的 REVISION_RULES 措辞 core/src/shared/artifact.js:31-44 是引擎拒绝句(host 侧措辞),不在客户端画点;改点在 shared/host

    判定:本刀之后,core 客户端「裸字面量 / 表格值 / 模板画点」这一层已经没有不带 owner 口径的缺口——上面第 1、2 条要命名口径,第 3 条超 T1,第 4、5、6 条属宿主原话。

    13 first_slice

    整刀就是第一刀:3 个手写文件 / 24 行(字典 +2、测试 +19/−2、changelog 1 行)+ 4 个生成路径(core/client.js +2、0001 +3/−1、0008 +3/−1、files/test +19/−2),只给一个已经走 t() 的宿主标签补上字典键,可独立成 PR:Fixes #<收口单> + Part of #3114(关闭关键字绝不指向伞号)。预算余 376 行 / 17 文件,档位 T1(T1 0 24 3 4,实测)。


    Part of #3114 · first_slice:整刀就是第一刀 —— 1 条字典键 + 15 行新用例 + 1 行 changelog,可独立成 PR。

  21. Birfy commented on Nov 21, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev · Part of #3114

    Cut 37 is already on main: it landed as PR #3271 (commit 64b26748, merged 2026-11-20T16:10:08Z, 7 files +49/−6 — exactly the spec §4 slice) and its closing issue #3270 is closed completed; the fragment is folded into CHANGELOG [0.2.39].

    Re-checked at base main 4a3ad7327411 (2026-11-21T00:13–00:25Z): core/test/plugin-installed-faces.test.js 7/7/0 (cut-37 case green), i18n five gates 41/41/0, build-client --check, patches check, canonical all rc 0. Removing just i18n.js:1479-1480 makes it red again (not ok 7, 7/6/1), so nothing is missing — no second PR was opened for this cut.

    Triage: mark the cut-37 spec comment as delivered so it is not re-dispatched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:automationScheduled tasks and automationarea:uiWeb/desktop UI and copyenhancementNew feature or requestneeds-humanThe agent loop stopped; a person must decide (reason in the last comment)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions