@a9i5k4/dsh-auto-memory 2.4.1 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,137 @@
1
+ # 待办总表 · dsh-auto-memory(2026-09-13 汇总)
2
+
3
+ > 用途:**唯一待办入口**。跨会话/跨工具(DSH、ZCode)通用 —— 不依赖任何一方的工作记忆,全部写路径与判据。
4
+ > 状态约定:🔴 阻塞或高优先 / 🟡 应做但可排期 / ⚪ 可选或长期 / ✅ 已关闭(留在 §J 备查,别重复劳动)
5
+ > 事实基线(2026-09-13 实测):npm latest = **2.4.2**;pre 线 `D:\dsh-auto-memory` HEAD = `e55a0ec`,已跟踪文件无未提交改动;REL = tag `v2.4.2` = GitHub main = `243dee1`。
6
+
7
+ ---
8
+
9
+ ## 0. 一分钟看板
10
+
11
+ | 优先级 | 事项 | 归属 | 参考 |
12
+ | --- | --- | --- | --- |
13
+ | 🔴 | 大排期三件套(界面 / 文档 / 首页)**等用户拍板 6 点 + 给 3 样输入** | 用户 → 执行方 | `DESIGN-OVERHAUL-PRE-RESEARCH.md` §8 |
14
+ | 🟡 | **v2.5.0 待发版**:B 区三项深改已全部落地(2026-09-13),等用户令按 RELEASE-PROCESS 角色分工派子代理执行 | 执行方 | `NEXT-VERSION-TODO.md` 状态行 |
15
+ | 🟡 | **procedure 记忆机制整体重构**(沿用 Hermes、社区褒贬不一;等用户统一拍板整体逻辑,期间不动引擎) | 用户 → 执行方 | 本表 §A 末条 |
16
+ | 🟡 | 群反馈·日报 CI 的**安全与运维**收口(密钥/签名/成本/告警) | ZCode | `.github/`、`docs/internal/GROUP-*.md` |
17
+ | 🟡 | 冷启动闭环(公开用户"装上没反应") | 执行方 | 本表 §C |
18
+ | 🟡 | 分发瘦身 + 对外元数据(npm 包 11 MB 里 86% 是 docs) | 执行方 | 本表 §D |
19
+ | ⚪ | 界面技术债(令牌层/组件层/i18n)——属大排期主体 | 执行方 | `DESIGN-OVERHAUL-PRE-RESEARCH.md` §2.6 |
20
+
21
+ ---
22
+
23
+ ## A. 阻塞在用户决策上(不点头无法开工)
24
+
25
+ - [ ] 🔴 **大排期的 6 个拍板点**(`docs/internal/DESIGN-OVERHAUL-PRE-RESEARCH.md` §8):①首页托管(htmlpreview vs GitHub Pages)②设计主张(面板靠 DSH 原生 / 首页留品牌色,接受"两种语境"?)③浮层面板是否降级为"状态+快捷入口"④`associativeMemoryEnabled` 是否改出厂默认(**建议保持 false + 向导明说并一键开启**)⑤docs 是否分层出包 ⑥排期节奏(P0-P6 顺序 vs 先集中做界面)。
26
+ - [ ] 🔴 **大排期开工需要的 3 样输入**(`docs/internal/ART-DIRECTION-WIREFRAME.md` §8):①官方 DSH 网页的 URL/截图(全网只搜到第三方介绍文)②角色基准(默认用 `docs/banner.jpg` 的水彩版做线稿化,或用户另给设定图)③风格探针许可(需用户在 Ark9 生图面板点批准)。
27
+ - [ ] 🟡 **是否解除 `docs/PROJECT-FREEZE-AND-ROADMAP.md:8`「大版本完成前禁止改 README」**的冻结(本次排期就是那个大版本)。
28
+ - [ ] 🟡 **procedure 记忆机制整体逻辑重构(等用户统一拍板,期间不动引擎)**:现状 = 插件的 procedure store(`lib/procedure-store-pre.js`:observed→candidate→validated→active 晋升状态机、M6 六级渐进激活、`renderChecklist` 渲染进动态快照)整体沿用 **Hermes 的记忆方式**;而 Hermes 的记忆工具在社区里**褒贬不一**,用户对这套机制整体不满,届时**统一重构整体逻辑**,不做零敲碎打。审计补充(2026-09-13):①数据层从未产出过任何 active procedure(全机 7 个工作区均无 `procedures.json`)②`renderChecklist` 语义是"主对话自己照步骤执行",无"执行类流程派子代理"出口 ③`memory_recall` 无 procedures scope(只能被动注入)。此前提议的两个小改点(delegate 出口 + procedures scope)**并入**这次统一重构,不单独做。过渡期执行类流程的固化走**仓库任务书通道**(`docs/prompts/*-AGENT.md` + 角色分工,主对话派子代理)。用户更详细的不满与改进建议见 **QQ 群反馈与 GitHub issues**(发版后的反馈核查任务要专门检索 procedure/技能/记忆/skill 相关条目)。
29
+
30
+ ---
31
+
32
+ ## B. 下一版代码改动(3 项,均已定位到行,详见 `docs/internal/NEXT-VERSION-TODO.md`)
33
+
34
+ > **✅ 2026-09-13 状态:三项已全部落地 v2.5.0(未发版,等用户令)**。全量回归 70/70 绿;细节与验收见 `NEXT-VERSION-TODO.md` 顶部状态行与 §J 存档。以下原文保留备查(文中行号为落地前观测值)。
35
+
36
+ - [ ] 🔴 **水位判据口径**:现触发用 `effectiveWin = win − reserve` 当分母(`lib/index.js:1900`,本机 1,048,576 − 384,000 = 664,576)→ 上下文**刚过半就触发接续**,比官方压缩点(≈80% ≈ 83.9 万)早约 45%。
37
+ **改法**:正常触发线改用官方声明窗口(或 `min(win, hardWin)`)为分母,阈值 0.75–0.78;`reserve` 只留"距硬墙余量"展示 + 硬判据(`estTokens + reserve > win` 才硬触发)。**加反向锁**:断言"不得把 reserve 计入分母"。
38
+ 验收:阈值 0.75 时触发点 ≈ 78.6 万(而非 ≈46 万);`water-window` / `water-hard-trigger` / `autocont-host` / `water-step` 全绿。
39
+ - [ ] 🔴 **接续序号**:`contSeq = handoff 目录里 prev-session-*.md 文件数 + 1`(`lib/index.js:2646-2648`)→ 落盘失败 / 跨工作区 / carry 复用缓存时会**不递增、重复或为空**(为空即不 rename,标题退回自动生成)。
40
+ **改法**:持久计数器 `handoff/cont-seq.json`(键 = workspaceId),缺失时从现有 `接续 #N` 标题/包名解析最大值 +1 兼容老数据;序号分配与包落盘同序事务;三条入口(面板一键 / 宿主兜底 / 重启后)全覆盖。
41
+ 验收:连做 3 次接续得到 `#N → #N+1 → #N+2`,跨工作区不重复;新增 smoke 覆盖计数器持久化与"落盘失败不跳号"。
42
+ - [ ] 🟡 **固定流程外包给子代理**:主对话只做三件事(开闸前确认前置门 / 放行或中止 / 失败时处置),子代理按检查表全跑、出错即停、回报 `{ ok, version, pre_sha, rel_sha, tag, npm_latest, failed_step, error_tail }`。
43
+ 落地物:①`docs/prompts/RELEASE-AGENT.md`(自包含任务书,**尚未创建**)②`docs/internal/RELEASE-PROCESS.md` 顶部加「角色分工」段 ③同类流程(全量回归 / 双语对账 / 痕迹巡检)各配任务书。
44
+ 已知约束:当前工具面**不能给 subagent 指定思考强度**(`subagent` 只收 description/prompt/run_in_background;`workflow.agent()` 显式拒绝 effort)→ 要压到 low/off 得靠 DSH 侧配路由默认强度,或由插件自身 spawn(插件已有 `subagentReasoningEffort: off|low|high|max`)。
45
+
46
+ ---
47
+
48
+ ## C. 冷启动与上手(公开用户"装上没反应"的根治)
49
+
50
+ 来自冷启动审计(`docs/internal/DESIGN-OVERHAUL-PRE-RESEARCH.md` §2.5)。**除最后一条外均未修**:
51
+
52
+ - [ ] 🔴 **首启向导无兜底触发**:只有 `update-check` 成功返回 `current` 才分发首启弹窗(`lib/client.js:4439`)→ **断网/代理环境下零引导零提示**。改法:请求失败/超时也用本地条件(版本号或 localStorage)照常 dispatch;清掉死键 `firstRunDone`(只读无写)。
53
+ - [ ] 🔴 **卖点功能与向导显示不一致**:`associativeMemoryEnabled` 出厂 `false`(`lib/index.js:349`),而向导把它渲染成「推荐 + 默认开」(`lib/client.js:3229/3303` 用 `tg.def !== false` 显示 ON)→ 用户不点 = 看到 ON 实际 OFF(幻觉 ON)。
54
+ 改法(不动后端默认值):向导如实显示"出厂关,这里帮你打开",点击即写入;同时修 `client.js:163` 与代码矛盾的"默认关"提示。
55
+ - [ ] 🟡 **引擎步自动下 129MB 且失败无重试**:进入引擎步即 `semanticDownload start`(`client.js:3168-3175`),失败态(`:3287`)只有报错没有重试按钮(`:3425-3439` 无重试分支)。改法:改为"点『安装』才下载"+ 加重试按钮(复用设置页 `semActionRetry` 同源逻辑)。
56
+ - [ ] 🟡 **`welcomeTourEnabled` 是死键**:host 从不读(`lib/index.js:317` 仅定义),所以设置里关掉也拦不住首启自动播放。改法:host 读该键并下发,client 在 `dispatchStartupDialog` 的 freshInstall 分支加门闸。
57
+ - [ ] 🟡 **术语改写 Top5**(走客户端 i18n,中英同步):水位 → 上下文余量;接续 → 换窗口续做;锚定 → 记忆索引;白板 PLAN/账本 → 项目看板/交接记录;唤起·固化·晋升 → 想起来/记下来/变成技能。
58
+ - [ ] ⚪ **装完给一句"她在工作"的反馈**:现在唯一信号是侧栏多了个「记忆」按钮;自动沉淀有 240 字符门槛,头几句闲聊会被跳过且无任何提示。
59
+
60
+ ---
61
+
62
+ ## D. 分发与门面(npm / GitHub 对外)
63
+
64
+ - [ ] 🟡 **npm 包瘦身**:`files` 含整个 `docs`(同日实测 **11.0 MB / 167 文件**,其中 `docs/screenshots` 约占 7.9 MB、内部工程文档 101/106 个 md)。改法:`docs/internal/**` 与 `docs/prompts/**` 移出包;**必须保留** `docs/screenshots/**` + 3 篇论文 + `system-map.html`(README/USER-GUIDE 的图片走相对路径,整目录删会让 npm 页图全断)。
65
+ - [ ] 🟡 **`package.json` 对外字段**:缺 `homepage`(README 现在挂的是 htmlpreview 伪首页)、缺 `scripts`(无 `test` 入口,陌生人无法一条命令验证)、缺 `engines`(Node 版本无约束);`description` 331 字符被 npm 截到 255(中文段全丢)。
66
+ - [ ] 🟡 **首页托管**:`docs/landing/index.html`(1,745 行自包含单文件)目前只在 `preview` 分支,靠第三方 `htmlpreview.github.io` 代理渲染(README.md:9)→ 单点依赖。建议改 GitHub Pages(`.github/workflows/` 现在已存在,可加 `pages.yml`)或至少加 `gh-pages` 分支。
67
+ - [ ] ⚪ **.github 门面件**:`issue 模板 / CONTRIBUTING / SECURITY / CODE_OF_CONDUCT` 仍缺(`.github/` 目前只有 CI 与云函数)。已有真实外部贡献(PR #12、Issue #10),却无模板与指南。
68
+ - [ ] ⚪ **`CHANGELOG.md` 不在 tarball 里**,而 README 末尾链接指向它 → npm 视图是死链。二选一:把 CHANGELOG 加进 `files`,或改链接。
69
+
70
+ ---
71
+
72
+ ## E. 文档体系
73
+
74
+ - [ ] 🟡 **README 大改**(490 行 / 说明书式内容占 30%):落地 `docs/NEXT-MAJOR-README-DRAFT.zh.md` 前必须先修 —— 它沿用「十个页签」旧错(实为 12)、含违反 `PROMO-STYLE-GUIDE.md:70` 的句式、`memory_search` 工具名不存在(实为 `memory_recall`)、安装位置反而更靠后。目标 ≤120 行五段式。
75
+ - [ ] 🟡 **USER-GUIDE 改任务导向**(现各 382 行、页面导向、61 个配置键):目标 ≤260 行;删 `-pre` 期命名泄漏与不可用命令(`node tools/subagent-gc.mjs` —— `tools/` 根本没打包)。
76
+ - [ ] 🟡 **6 处事实性错误**:①handoff「默认开启」写 4 处(实为 false)②「Ten tabs」实为 12 ③`memory_search` 实为 `memory_recall` ④`README.md:294` 的 `/n/n` ⑤英文 README 的 H1 是中文 ⑥配置路径写成非 `-pre` 名(`dsh-auto-memory.json` vs 实际 `dsh-auto-memory-pre.json`)。
77
+ - [ ] 🟡 **双语对账脚本**(`tools/check-readme-parity.mjs`):锁标题序列 + 命令块 + 关键数字(0GB/130MB/563MB、0.75/0.80、8000/200000)逐字符一致 —— 现在只靠人工纪律,已漏过。
78
+ - [ ] ⚪ **27 张配图重拍**(22 张界面图 + 7 张六幕宣传图,旧 29 张中部分已不再被引用):必须在 UI 定稿后做,顺序为"UI 冻结 → 重拍 → 改文"。
79
+
80
+ ---
81
+
82
+ ## F. 界面技术债(= 大排期主体,量化见预研 §2.6)
83
+
84
+ - [ ] 🔴 **令牌层**:硬编码颜色 **320 处 / 132 种**;圆角 **25 种**、padding **47 种**、gap 14 种、字号 19 种、阴影 20 种、毛玻璃 **8 套配方**;同一个 `--dam-accent` 有 **5 个不同 fallback**;**3 个幽灵令牌**(`--dsw-alias-text-primary` / `-warn` / `-danger` 上游根本不存在,9 处永久走 fallback)。
85
+ 目标:颜色/边框 **100% 走 `--dsw-*`**;自建 `--dam-*` 度量令牌(间距 4/8/12/16/24、圆角 4/8/12、字号 11/12/13/15/18);向导美术隔离到 `--dam-tour-*`。
86
+ - [ ] 🔴 **组件层**:内联 style **228 个** vs `className` **4 处**;**6 套卡片**、4 种"表格"宽度、4 种标题写法、4 套浮层、2 套页签并存。目标:抽 `Card / Row / Field / Badge / Tabs / Modal / Toolbar` 七个原语。
87
+ - [ ] 🟡 **巨型函数**:`SettingsPage` **582 行**(8 分组+目录浏览器+模型抽屉+环境检测+向导挂载+更新检查+调试中心)、`DialogHost` **478 行**(7 种弹窗+首启向导状态机)。
88
+ - [ ] 🟡 **状态与可访问性**:`:focus` / `:focus-visible` **各 0 条**;`aria-*` 仅 9 个、`tabIndex` 0;危险操作 `window.confirm` **0 次**(`StorageTab` 删除是**单击即删**)。
89
+ - [ ] 🟡 **i18n 双机制**:`I18N` 字典 + **约 354 处内联 `locale === 'zh' ? … : …`**;`t()` 的兜底是中文 → 英文 UI 必然中英混杂。
90
+ - [ ] ⚪ **幽灵配置键 `pythonGpu`**:`lib/client.js` 会写、`lib/index.js` **零引用**(宿主从不读)→ 删客户端那一处即可。
91
+ - [ ] 🟡 **IA 重排**:12 个页签塞进 **440×560 浮层**(拖到 300px 时表单控件只剩 ~48px)。DSH 有约 58 个原生插槽可用(`sidebar.panellist` / `sidebar.right.tab.document` / `conversation.session.header.utilities` …),`slots.inject/register` 是通用 API —— **挂原生位不需要改后端**。开工第一步:向 `sidebar.panellist` 注册一个空面板做 spike,失败则回退为"保留浮层但按三组重排"。
92
+
93
+ ---
94
+
95
+ ## G. 群反馈 / 日报 CI(2026-09-12~13 新建,ZCode 线)
96
+
97
+ **已有资产**:`.github/cloud/qq-webhook/`(腾讯 SCF 云函数:`index.js` / `index.zip` / `scf_bootstrap`)、`.github/scripts/{group-digest,group-listener,qq-capture-openid,qq-send,report-sync}.mjs`、`.github/workflows/{group-digest,group-report-status}.yml`、`.github/digest/{NOTES,PREVIEW}.md`、说明文档 `docs/internal/GROUP-{LISTENER,DIGEST,WEBHOOK}-SETUP.md`;插件侧新增按需报告端点 `?report=N`(`9461cea`)。
98
+
99
+ - [ ] 🟡 **安全面收口(待确认)**:webhook 公网入口是否校验签名/时间戳与来源白名单?是否限流防重放?密钥是否只存 GitHub Secrets / SCF 环境变量(**绝不入库**)?
100
+ - [ ] 🟡 **运维面(待确认)**:定时班时区与失败告警(现在 11:40/20:40 + 55 分兜底重试);SCF 免费额度/成本;`index.zip` 这类二进制是否应入库(建议改为构建产物,不入 git)。
101
+ - [ ] ⚪ **文档化**:把三份 `GROUP-*-SETUP.md` 合并成一份"从零部署"清单(含所需 secrets 名、验证命令、回滚方式)。
102
+ - [ ] ⚪ **与插件的关系**:`.github/**` 不在 npm `files` 里(不会随包发布)—— 保持这样;若日报内容要面向用户,走 `docs/` 或 landing,不要塞进包。
103
+
104
+ ---
105
+
106
+ ## H. 插件功能侧遗留
107
+
108
+ - [ ] ⚪ **子代理通知无法跨会话继承**:durable 侧 `SessionHeader.parentSession` 是 readonly,`coldResume → authorizeLineage` 抛 UNAUTHORIZED,服务契约无 re-parent/transfer/attach → 新会话**收不到旧会话的子代理完成通知**。可选路线见 `docs/internal/SUBAGENT-REPORT-ROUTING-PRE-RESEARCH.md`。
109
+ - [ ] ⚪ **上下文桥不推子代理会话的 context**:被观测的子代理会话 runtime 从未 `capturePaths`(整段 drop);本机已做 30s 窗口限流 + 首条附 runtime key,**工作区归属改造未做**。
110
+ - [ ] ⚪ **两个"界面零引用"端点不可删**:`/activation-inbox-pre`(契约测试 + 注入入口)、`/subagent-gc`(CLI `tools/subagent-gc.mjs`)—— 已有白名单锁守着,新增宿主独有端点必须更新白名单并注明消费者。
111
+
112
+ ---
113
+
114
+ ## I. 长期纪律(违反会直接出事故)
115
+
116
+ - **发布必须获用户明确授权**;未经要求不 `npm publish` / push / 打 tag。
117
+ - **不重启 dsh web 宿主**(会截断用户会话);host 改完只改文件 + 提示用户重启。
118
+ - **写任何文件禁 BOM**(BOM 会让 dsh web 起不来,历史事故)。
119
+ - **`release.mjs` 的源就是工作区**:脏树整体进包且不可回溯 → 发版前核实 `git status` 范围 + 全量回归(`tests/smoke` 69 套件)。
120
+ - **凭据只走行内 URL / 环境变量**,绝不写进任何会上传 GitHub 或 npm 的文件(凭据位置见 `RELEASE-PROCESS.md`)。
121
+ - **发版 10 步唯一检查表**:`docs/internal/RELEASE-PROCESS.md`;其中「改 CHANGELOG + 同步软件内版本标识」由 `tools/release.mjs` §5.05 闸门强制。
122
+ - **npm 相关两个坑**:本机 `.npmrc` 是 npmmirror(查询/发布必须显式 `--registry=https://registry.npmjs.org`);`npm view` 命中本地缓存(判定用 registry `/latest` 或 `--prefer-update`/`--prefer-online`)。
123
+
124
+ ---
125
+
126
+ ## J. ✅ 已关闭(存档,别重复劳动)
127
+
128
+ - ✅ **55 份未入 git 的 docs 已收编**(`f83e144`)—— 此前"npm tarball 是唯一副本"的数据丢失风险解除。
129
+ - ✅ **`.github/` 从不存在到就位**(2026-09-12~13 建起 CI + 云函数)。
130
+ - ✅ **v2.4.1 / v2.4.2 已发布**,三处一致(npm latest = 2.4.2 / main = tag = `243dee1`)。
131
+ - ✅ **`autoContinueEnabled` 出厂默认改 `false` + 反向锁**(v2.4.2;用户本机也已关)。
132
+ - ✅ **界面路径表一致性锁**(`tests/smoke/smoke-test-api-paths-pre.mjs`:客户端 ⊆ 宿主、表外零裸字面量)。
133
+ - ✅ **发版版本标识闸门**(`release.mjs` §5.05:缺 CHANGELOG 小节 / 应用内更新说明条目 / 界面指纹行即拒绝构建)。
134
+ - ✅ **第 0 步止血**:写配置 4 条路径 → `saveConfigPatch()`;10 处重复的语义刷新 → `refreshSem()`。
135
+ - ✅ **`smoke-test-m53-pre.mjs` 顺序敏感 flake**(固定 `sleep(900)` → 有界轮询)。
136
+ - ✅ **真实自动接续实机验证通过**(修复后首次 `auto-continue host-executed`)。
137
+ - ✅ **B 区三项深改落地 v2.5.0**(2026-09-13,未发版):①水位口径——分母改官方声明窗口(`min(win, hardWin)`),reserve 退出分母只留"距硬墙余量"展示与预测性硬墙判据(`estTokens + reserve > 判定窗`),反向锁断言"不得把 reserve 计入分母";②接续序号——`~/.dsh/memory/cont-seq.json` 持久计数器(全局单调、跨工作区不重号、写包失败回滚不跳号、历史标题扫描兜底),新增 `smoke-test-contseq-pre.mjs`(20 断言);③流程外包——四份自包含任务书(`docs/prompts/{RELEASE,REGRESSION,DOCS-AUDIT,TRACE-PATROL}-AGENT.md`)+ `RELEASE-PROCESS.md` 角色分工(主对话派活后只读等待)。全量回归 70 套件 0 失败。
@@ -0,0 +1,32 @@
1
+ # DOCS-AUDIT-AGENT · 双语文档对账子代理任务书
2
+
3
+ > **给使用者的说明**:一整段投喂(自包含)。用途:README / 用户说明书双语发版前对账、大改文档后的漂移盘点。**默认只读**;修复要等主对话拿着对账单裁决后另行派发。
4
+
5
+ ---
6
+
7
+ 你是 dsh-auto-memory 的文档对账子代理。工作目录:`D:\dsh-auto-memory`。对象四份:`README.md` ↔ `README.zh-CN.md`、`docs/USER-GUIDE.en.md` ↔ `docs/USER-GUIDE.zh-CN.md`。**默认禁止改任何文件**,产出对账单即完成。
8
+
9
+ ## 对账维度(逐条执行,逐条给证据)
10
+
11
+ 1. **结构对齐**:两两对比章节标题序列(`^#{1,3} `),列出单侧多出/缺失/改名的小节。
12
+ 2. **事实一致性**:以下数字与键名在四份文档里必须同值,逐一摘录出处(`文件:行号`):
13
+ - 配置键名与默认值(以 `lib/index.js` 配置表为准,如 `waterLevelThreshold: 0.75`、`autoContinueEnabled: false`)
14
+ - 端点/路由数(46)、工具数(14)、冒烟套件数(`ls tests/smoke/*.mjs | wc -l`)
15
+ - 版本号引用(`package.json` 为准)
16
+ - 触发口径类描述(水位分母=官方声明窗口、阈值 0.75、官方 80% 压缩——2026-09-13 起的口径)
17
+ 3. **链接与资源**:相对路径引用(如 `docs/screenshots/…`)逐一验证目标文件存在;外链只查格式不访问。
18
+ 4. **文风黑名单**(`docs/PROMO-STYLE-GUIDE.md`):厂商腔("赋能""引领""革命性")、夸大承诺、逐字模板腔;产品拟人称"她"是否被误改成"它/该产品"。
19
+ 5. **代码块可运行性抽查**:安装/命令类代码块里的包名 `@a9i5k4/dsh-auto-memory`、registry 提示(npmmirror 坑)、pnpm `minimumReleaseAge` 拦 24h 新版的提示是否存在且未过期。
20
+
21
+ ## 回报格式(原样 JSON + 附表)
22
+
23
+ ```json
24
+ { "ok": true, "files": ["README.md", "README.zh-CN.md", "docs/USER-GUIDE.en.md", "docs/USER-GUIDE.zh-CN.md"], "structure_diffs": [], "fact_mismatches": [], "broken_links": [], "style_violations": [], "summary": "一句话总评" }
25
+ ```
26
+
27
+ 每条 finding 格式:`"文件:行号 — 问题 — 建议改法(不执行)"`。零问题也要回报空数组,不许省略维度。
28
+
29
+ ## 边界
30
+
31
+ - 文档里"待大改"的方向性内容(界面×文档×首页排期)不属于对账范围,不要评论设计。
32
+ - 发现疑似代码与文档都不一致时,以**代码为准**记录,不改代码。
@@ -63,6 +63,10 @@
63
63
  | `P10-importance-calibration.md` | importance 效应定标:`0.5+w×imp` 可配置 + 真实查询翻转率实测 | **P9 结论后** | `lib/index.js` dense 臂一行 + 配置项 | 低 |
64
64
  | `P11-silent-catch-observability.md` | fail-soft 空 catch 统一加 diag(**只加日志不改行为**,可与 P9 并行) | 无 | `lib/index.js` catch 行 | 低 |
65
65
  | **`FIX-AGENT-P11.md`** | **⭐ 复制即投喂:静默 catch 可观测(自包含,可与 P9 并行给另一 Agent)** | 无 | `lib/index.js` catch 行 | 低 |
66
+ | **`RELEASE-AGENT.md`** | **⭐ 复制即投喂:发版执行子代理(自包含;主对话=决策者只做开闸/放行/处置,见 `docs/internal/RELEASE-PROCESS.md` 顶部角色分工)** | 前置门已过 | `CHANGELOG.md` + `lib/client.js` 版本标识三处 | 高(单向门) |
67
+ | **`REGRESSION-AGENT.md`** | **⭐ 复制即投喂:全量回归执行(只读;失败套件单跑复验规则)** | 无 | 无(只跑不改) | 无 |
68
+ | **`DOCS-AUDIT-AGENT.md`** | **⭐ 复制即投喂:README/USER-GUIDE 双语对账(只读,产出对账单)** | 无 | 无(只读) | 无 |
69
+ | **`TRACE-PATROL-AGENT.md`** | **⭐ 复制即投喂:子代理痕迹巡检(只读盘点 + GC 备份区 + 残留风险)** | 无 | 无(只读) | 无 |
66
70
  | `EXEC-ORDER.md` | 执行顺序与冲突提示 | — | — | — |
67
71
 
68
72
  ---
@@ -0,0 +1,42 @@
1
+ # REGRESSION-AGENT · 全量回归执行子代理任务书
2
+
3
+ > **给使用者的说明**:一整段投喂(自包含)。用途:发版前置门、大改后的体检、接手陌生工作区时的基线盘点。**只读任务:不得改任何文件。**
4
+
5
+ ---
6
+
7
+ 你是 dsh-auto-memory 的回归执行子代理。工作目录:`D:\dsh-auto-memory`(Node.js 项目,零运行时依赖)。任务:**跑完全量冒烟回归并回报结构化结果**。禁止改任何文件、禁止 `git add/commit`、禁止重启 dsh web。
8
+
9
+ ## 步骤
10
+
11
+ 1. 记录基线:`git log --oneline -3` 与 `git status --short`(只记录,不处理)。
12
+ 2. 逐个运行全部套件(PowerShell):
13
+
14
+ ```powershell
15
+ cd D:\dsh-auto-memory
16
+ $results = @()
17
+ Get-ChildItem tests\smoke -File -Filter *.mjs | ForEach-Object {
18
+ $out = node $_.FullName 2>&1
19
+ $code = $LASTEXITCODE
20
+ $results += [pscustomobject]@{ name = $_.Name; code = $code; tail = ($out | Select-Object -Last 3) -join ' | ' }
21
+ }
22
+ $results | Where-Object code -ne 0
23
+ $results | Measure-Object | Select-Object -ExpandProperty Count
24
+ ```
25
+
26
+ 3. **失败套件单跑复验一次**:批量连跑受机器负载影响(历史案例:`smoke-test-m53-*` 连跑误报、单跑全绿)。复验仍失败才算真失败,回报里注明"连跑 FAIL / 单跑 FAIL"两行。
27
+ 4. 附带静态检查:`node --check lib\index.js; node --check lib\client.js`;对改动过的文件抽查前三字节非 `EF BB BF`(BOM 会让 dsh web 起不来)。
28
+
29
+ ## 回报格式(原样 JSON)
30
+
31
+ ```json
32
+ { "ok": true, "total": 70, "failed": [], "flaky": [], "node_check": "ok", "bom": "ok", "head": "<git log -3 首行>", "dirty": ["<git status --short 逐条>"], "durationMs": 0, "error_tail": "" }
33
+ ```
34
+
35
+ - `failed`:`["<套件名>: <失败断言行摘要≤120字符>"]`;`flaky`:连跑挂但单跑绿的套件名。
36
+ - `dirty` 原样列出——**脏树范围核实是主对话的决策项**,子代理只如实上报。
37
+ - 有任何套件既非 0 也非 1 的退出码、或套件文件无法运行 → `ok:false` + `error_tail`(≤20 行)。
38
+
39
+ ## 边界
40
+
41
+ - 不诊断根因、不修东西——那是主对话/修复子代理的事。
42
+ - 测试会创建临时目录(`os.tmpdir()` 下的 `dam-*`),跑完不清理不算失败;但**不得**去清理 `D:\dsh-auto-memory` 仓库内任何文件。
@@ -0,0 +1,119 @@
1
+ # RELEASE-AGENT · 发版执行子代理任务书
2
+
3
+ > **给使用者的说明**:**本任务书由主对话读取、填入版本号后原文派发给执行子代理**;用户不必、也不要绕过主对话直接投喂(两条入口并存才会产生并发冲突)。自包含,无需 `_COMMON.md`。
4
+ > 出错即停:任何一步失败或前置不满足,**立即停下回报**,绝不允许跳步、重试超过 1 次、或"先做完再说"。
5
+ > ⚠️ 子代理**不得重启 dsh web**;发布后宿主半边的生效由用户自己重启。
6
+
7
+ ---
8
+
9
+ 你是 dsh-auto-memory 的发版执行子代理。工作目录:`D:\dsh-auto-memory`(pre 线;发布基座在 `D:\dsh_debug\_publish_dsh-auto-memory`,下称 REL)。**本次要发布的版本号:`<ver>`(由主对话填入,形如 2.5.0)。**
10
+
11
+ ## 硬性禁令(违反任何一条=任务失败)
12
+
13
+ 1. **版本标识闸门未过 → 不得真构建;dry-run 未过 → 不得真构建;未真构建 → 不得提交 REL / push / publish。** 单向门按顺序开。
14
+ 2. **只允许改动**:`CHANGELOG.md`、`lib/client.js`(仅版本标识三处:CHANGELOG 字典、指纹行)、`package.json`(由 release.mjs 回写)。**其余任何文件出现改动立即停止回报。**
15
+ 3. **凭据纪律**:PAT 与 npm token 只从 `~/.dsh/memory/workspaces/--D--dsh_debug--/MEMORY.md` 里读,只拼进行内 URL/命令行;**严禁写进任何文件、日志、回报**(回报里凭据一律以 `<redacted>` 代替)。该记忆文件明确「只存本地,严禁写入任何会上传 GitHub/npm 的文件」。
16
+ 4. **不得 push 除非 PAT 读取成功**;**不得 `npm publish` 除非 push 成功且 tag 已打**。
17
+ 5. 全程**不得重启 dsh web**、不得动 `~/.dsh` 下运行中宿主的任何文件、不得并发跑第二个写盘任务。
18
+
19
+ ## 阶段 0 · 前置门(任一不满足 → 停,回报 `failed_step: 0`)
20
+
21
+ ```powershell
22
+ cd D:\dsh-auto-memory
23
+ Get-ChildItem tests\smoke -File -Filter *.mjs | ForEach-Object { node $_.FullName > $null 2>&1; if ($LASTEXITCODE -ne 0) { "FAIL: " + $_.Name } }
24
+ node --check lib\index.js; node --check lib\client.js
25
+ git status --short
26
+ git log --oneline -3
27
+ ```
28
+
29
+ - 全量回归 **0 失败**(批量连跑受负载影响的个别套件允许**单跑复验一次**,以单跑为准)。
30
+ - **脏树范围核实**:`release.mjs` 只复制 `lib/ tests/ python/ docs/ .github/` 与顶层白名单文件,仓库根下与发版无关的**未跟踪**杂项(`artifacts/`、`canvas-local/` 等)不进包,**记录即可继续**。必须停下回报的是:①任何**已跟踪**文件出现主对话告知的预期清单之外的改动 ②`lib/ tests/ docs/ .github/` 内出现预期外的新文件 ③删除型改动。
31
+ - **凭据读取**在阶段 6/7 才需要;读取失败就到那时再停,阶段 0-5 不需要碰凭据。
32
+
33
+ ## 阶段 1 · CHANGELOG(第 1 笔)
34
+
35
+ - `CHANGELOG.md` 顶部新增 `## [<ver>] — <日期> · <一句话主题>` 小节。内容要点由主对话提供;主对话没给 → 停,回报缺输入。
36
+ - 闸门会校验文件里出现 `## [<ver>]`,缺失即拒绝构建。
37
+
38
+ ## 阶段 2 · 软件内版本标识(第 2 笔,`lib/client.js`)
39
+
40
+ - `var CHANGELOG = { ... }` 顶部新增 `'<ver>': { zh: [...], en: [...] }`(应用内"更新说明"弹窗,文案取自 CHANGELOG 小节)。
41
+ - 第 10 行指纹行改为 `console.log('[dsh-auto-memory] client v<ver> fingerprint: ...')`(fingerprint 短语沿用当版,可顺手换新词)。
42
+ - `package.json.version` 不手改(release.mjs 构建时回写)。
43
+
44
+ ```powershell
45
+ node --check lib\client.js
46
+ git add lib tests docs CHANGELOG.md tools\release.mjs
47
+ git -c user.name="Aik358" -c user.email="aik358@users.noreply.github.com" commit -m "v<ver>: <一句话>"
48
+ ```
49
+
50
+ (`git status --short` 核对已暂存清单与主对话给的预期一致后才 commit;仓库根的无关未跟踪杂项**不要** `git add -A` 进来。)
51
+
52
+ ## 阶段 3 · dry-run 验闸门
53
+
54
+ ```powershell
55
+ node tools\release.mjs <ver> --dry-run
56
+ ```
57
+
58
+ 必须看到:`版本标识一致性: OK(CHANGELOG / 应用内更新说明 / 界面指纹行)` + `语法 ✓ BOM ✓ 无 pre/dev 残留 ✓` + `python/ 运行时完整 ✓ bench 已排除 ✓`。否则**停**,回报 `failed_step: 5.05` + 闸门原文(error_tail)。
59
+
60
+ ## 阶段 4 · 真构建
61
+
62
+ ```powershell
63
+ node tools\release.mjs <ver>
64
+ ```
65
+
66
+ 复核输出含 `开发树版本回写: … → <ver>`。构建会写 REL 树。
67
+
68
+ ## 阶段 5 · REL 提交 + tag
69
+
70
+ ```powershell
71
+ cd D:\dsh_debug\_publish_dsh-auto-memory
72
+ git add -A -- . ':(exclude).github/cloud/qq-webhook/index.zip'
73
+ git -c user.name="Aik358" -c user.email="aik358@users.noreply.github.com" commit -m "v<ver>: <一句话>"
74
+ git tag -f v<ver>
75
+ ```
76
+
77
+ (index.zip 是 SCF 部署产物,不入库——这是群日报会话定下的先例;REL 树里若再出现其他构建产物同样排除。)
78
+
79
+ ## 阶段 6 · push(带 PAT 行内 URL)
80
+
81
+ 从凭据记忆文件读 PAT 后(读取失败 → 停,`failed_step: 8`):
82
+
83
+ ```powershell
84
+ git -c credential.helper= push https://x-access-token:<PAT>@github.com/Aik358/dsh-auto-memory.git main --tags --force
85
+ ```
86
+
87
+ ## 阶段 7 · npm publish(单向门,最后一步)
88
+
89
+ npm token 同样从凭据记忆文件读(需 bypass-2FA 的那个):
90
+
91
+ ```powershell
92
+ npm publish . --registry=https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=<token> --access public
93
+ ```
94
+
95
+ **坑**:本机 `~/.npmrc` 指向 npmmirror;`npm view` 会命中本地缓存回读旧版本。判定一律用权威接口:
96
+
97
+ ```powershell
98
+ Invoke-RestMethod 'https://registry.npmjs.org/@a9i5k4%2Fdsh-auto-memory/latest' | Select-Object -ExpandProperty version
99
+ ```
100
+
101
+ ## 阶段 8 · 三处复核(缺一不算发完)
102
+
103
+ 1. registry `/latest` 的 version = `<ver>`(用上面的权威接口)
104
+ 2. `git ls-remote https://github.com/Aik358/dsh-auto-memory.git refs/heads/main`
105
+ 3. `git ls-remote https://github.com/Aik358/dsh-auto-memory.git refs/tags/v<ver>`
106
+
107
+ 三者一致才算 ok。
108
+
109
+ ## 回报格式(原样 JSON,不追加散文)
110
+
111
+ ```json
112
+ { "ok": true, "version": "<ver>", "pre_sha": "<pre 线 commit 短 sha>", "rel_sha": "<REL commit 短 sha>", "tag": "v<ver>", "npm_latest": "<ver>", "failed_step": "", "error_tail": "" }
113
+ ```
114
+
115
+ 失败时:`ok:false`,`failed_step` 填阶段号(0/1/2/3/4/5/6/7/8;dry-run 闸门不过记 3),`error_tail` 贴**最后 ≤20 行**原始报错(凭据替换为 `<redacted>`)。已知会出现且**不算失败**的情况:无。任何意外都按失败回报,由主对话决定处置。
116
+
117
+ ---
118
+
119
+ *回滚提示(供主对话,子代理不执行):未 push/publish 前一切可回滚(pre 线 `git reset`、REL 线 `git reset` + `git tag -d`);publish 后不可撤,只能发 patch。*
@@ -0,0 +1,29 @@
1
+ # TRACE-PATROL-AGENT · 子代理痕迹巡检任务书
2
+
3
+ > **给使用者的说明**:一整段投喂(自包含)。用途:定期盘点 DSH 全机子代理会话痕迹与本插件 GC 回收状况(背景:实测全机 686 个子代理会话中 638 个来自本插件,数量上千后拖慢会话列表加载——见 `lib/subagent-gc-pre.js` 头注)。**只读巡检**;回收动作由插件自身在运行时做,巡检子代理不得手动移动/删除任何会话目录。
4
+
5
+ ---
6
+
7
+ 你是 dsh-auto-memory 的痕迹巡检子代理。宿主数据根:`~/.dsh`(Windows = `C:\Users\<user>\.dsh`)。**禁止写/删/移动任何文件,禁止重启 dsh web。**
8
+
9
+ ## 巡检项(逐项产出数字与证据)
10
+
11
+ 1. **会话总量盘点**:`~/.dsh/sessions/<工作区>/<会话目录>/` 逐层统计:
12
+ - 会话目录总数、`session-*` 前缀(普通会话)数、裸 uuid(子代理)数。
13
+ - 子代理判别:读会话目录下 `session.jsonl[.zstd]` 首行 header,`origin==='subagent'`;`descriptor.label` 以 `auto-memory-` 开头(`PLUGIN_LABEL_PREFIX`)即本插件产物。zstd 文件可跳过首行解压、只统计目录名(裸 uuid + 无 `session-` 前缀),并在回报里注明"未解压判定"的比例。
14
+ 2. **GC 备份区**:`~/.dsh/subagent-gc-backup/`(`recycleSessions` 的 backupRoot)统计已回收数与目录体积;`_projcache/` 子目录单独计数。
15
+ 3. **残留风险**:`origin==='subagent'` 且 label 以 `auto-memory-` 开头、mtime 超过 `subagentGcKeepDays`(默认 3 天,`lib/index.js` 配置表)却仍在 sessions 目录的——列前 20 条(工作区/会话名/mtime)。这是"任务结束即回收"路径的漏网指标。
16
+ 4. **投影缓存**:`~/.dsh/` 下投影缓存目录(`*_projcache*` 类名样,实际以 `~/.dsh` 顶层目录列表为准)的文件数与体积;超过 2,000 文件标记 `warn`。
17
+ 5. **配置核对**:读 `~/.dsh/dsh-auto-memory-pre.json`(**注意 `-pre` 后缀**,别读成非 pre 的),摘 `subagentGcEnabled` / `subagentGcKeepDays` 实际值。
18
+
19
+ ## 回报格式(原样 JSON)
20
+
21
+ ```json
22
+ { "ok": true, "sessions_total": 0, "sessions_normal": 0, "subagent_total": 0, "subagent_plugin": 0, "backup": { "count": 0, "projcache": 0 }, "stale_over_keepdays": 0, "stale_sample": [], "projcache_files": 0, "warn": [], "config": { "subagentGcEnabled": true, "subagentGcKeepDays": 3 }, "summary": "一句话总评" }
23
+ ```
24
+
25
+ ## 边界
26
+
27
+ - 大目录统计用流式计数,不要把会话文件内容整读进内存。
28
+ - 若 `~/.dsh/sessions` 结构与上述不符(宿主版本变更),停下回报实际结构,禁止猜。
29
+ - 发现宿主正在写某会话文件(mtime < 5 分钟)→ 跳过该条并在 `warn` 注明,避免与运行中会话竞争。
package/lib/client.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * 3. settings.section — 自动记忆设置页(存储位置、注入、反思风格)
8
8
  * Data flows over /api/dsh-auto-memory/* (loopback-only host routes).
9
9
  */
10
- console.log('[dsh-auto-memory] client v2.4.1 fingerprint: drawer-summary-ok')
10
+ console.log('[dsh-auto-memory] client v2.5.0 fingerprint: official-window-water')
11
11
  window.__ModuleLoader__.load({
12
12
  id: '@a9i5k4/dsh-auto-memory',
13
13
  factory: (require) => {
@@ -275,7 +275,7 @@ window.__ModuleLoader__.load({
275
275
  fWaterWindow: '水位估计窗口(token)', fWaterWindowHint: '会话消息按官方公式(4 字符≈1 token)估算达到该值即视为上下文将满;0=关闭。默认 65536(128K 窗口的保守半量),按所用模型调整。',
276
276
  fWaterAdvisory: '水位交接建议', fWaterAdvisoryHint: '水位越阈时在动态快照注入交接建议(写账本/刷新白板/建议开新窗);无人值守时静默。',
277
277
  fWaterAuto: '水位自动骨架账本', fWaterAutoHint: '越阈时自动写一篇系统骨架账本(每会话一次),防止模型忽视建议时交接材料缺失。',
278
- fWaterThreshold: '水位建议阈值', fWaterThresholdHint: '水位比例超过该值(0.1-1.5)即触发交接建议/骨架账本;默认 0.75——官方自动压缩阈值是 80%,必须留出余量才来得及走完交接。',
278
+ fWaterThreshold: '水位建议阈值', fWaterThresholdHint: '水位比例 = 上下文实占 ÷ 官方声明窗口(不再扣预留输出);超过该值(0.1-1.5)即触发交接建议/骨架账本;默认 0.75——官方自动压缩阈值是 80%,必须留出余量才来得及走完交接。',
279
279
  fHandoffPlan: '白板注入预算(字符)', fHandoffPlanHint: 'PLAN.md 全貌注入动态快照的硬截断预算;全文可经 memory_read 或面板白板页查看。默认 1200。',
280
280
  fHandoffLedger: '账本注入预算(字符)', fHandoffLedgerHint: '最新一篇交接账本注入动态快照的硬截断预算。默认 800。',
281
281
  fConsSchedule: '定时做梦式固化', fConsScheduleHint: '每天到点自动读最近日志发散提炼长期要点,写入项目笔记/用户级记忆(等价 memory_consolidate)。',
@@ -283,8 +283,8 @@ window.__ModuleLoader__.load({
283
283
  fConsScheduleDays: '固化回看天数', fConsScheduleDaysHint: '定时固化读取最近 N 天日志;默认 7。',
284
284
  fMaintSchedule: '定时 30 天蒸馏', fMaintScheduleHint: '每天到点自动把超过 30 天的旧日志蒸馏归档(等价 memory_maintain);无旧日志时零成本跳过。',
285
285
  fMaintScheduleTime: '蒸馏触发时间', fMaintScheduleTimeHint: 'HH:MM,默认 10:00(与固化时间错开)。',
286
- waterCardTitle: '上下文水位', waterAutoSrc: '自动检测', waterManualSrc: '手动设定', waterOfficialSrc: '官方路由容量', waterFallbackSrc: '回退默认值', waterNotMeasured: '本会话尚未测量(发送一轮后自动更新)', waterMeterOfficial: '官方计量', waterMeterHeuristic: '启发式降级', waterThresholdHint: '水位达到 {t} 时注入交接建议并自动补写账本;计量优先用官方 token-meter(与聊天框 context ring 同源),不可用时降级启发式估算;窗口优先取官方路由容量(request/context 的 contextWindow),其次按当前模型查 settings.yaml contextWindow,也可在下方手动覆盖。',
287
- autoContTitle: '自动接续', autoContHint: '开启后:水位达到阈值、且旧会话已空闲(harness 权威 running 位在轮次边界转为 false,取代旧「两轮水位持平」)时,弹出确认卡——同意=立即接续,拒绝=本轮跳过(同一边界不再提示),30-40 秒无操作视为挂机自动接续;接续前先让旧 Agent 刷新白板 PLAN 与交接账本,再建新会话(沿用工作区/模型/思考档位)并注入分层交接材料;触发后默认 30 分钟内不重复。', autoContOn: '自动接续:开', autoContOff: '自动接续:关', autoContThreshold: '阈值', autoContCountdown: '⏳ {s} 秒后自动接续…', autoContCancel: '取消', autoContConfirm: '本会话「可用额度」已用 {p}%(小圈读数见下行),旧会话已空闲(轮次边界)——现在接续到新会话?', autoContAgree: '同意接续', autoContReject: '拒绝', autoContTimeout: '{s} 秒后自动接续(视为挂机)', autoContRejected: '已跳过本次接续(下一个轮次边界再提醒)',
286
+ waterCardTitle: '上下文水位', waterAutoSrc: '自动检测', waterManualSrc: '手动设定', waterOfficialSrc: '官方路由容量', waterFallbackSrc: '回退默认值', waterNotMeasured: '本会话尚未测量(发送一轮后自动更新)', waterMeterOfficial: '官方计量', waterMeterHeuristic: '启发式降级', waterThresholdHint: '水位达到 {t} 时注入交接建议并自动补写账本;计量优先用官方 token-meter(与聊天框 context ring 同源),不可用时降级启发式估算;窗口优先取官方路由容量(request/context 的 contextWindow),其次按当前模型查 settings.yaml contextWindow,也可在下方手动覆盖;触发分母=官方声明窗口(provider 自报过硬限时取较小值),预留输出不参与扣减。',
287
+ autoContTitle: '自动接续', autoContHint: '开启后:水位达到阈值、且旧会话已空闲(harness 权威 running 位在轮次边界转为 false,取代旧「两轮水位持平」)时,弹出确认卡——同意=立即接续,拒绝=本轮跳过(同一边界不再提示),30-40 秒无操作视为挂机自动接续;接续前先让旧 Agent 刷新白板 PLAN 与交接账本,再建新会话(沿用工作区/模型/思考档位)并注入分层交接材料;触发后默认 30 分钟内不重复。', autoContOn: '自动接续:开', autoContOff: '自动接续:关', autoContThreshold: '阈值', autoContCountdown: '⏳ {s} 秒后自动接续…', autoContCancel: '取消', autoContConfirm: '本会话上下文已用 {p}%(按官方声明窗口计,官方约 80% 才压缩),旧会话已空闲(轮次边界)——现在接续到新会话?', autoContAgree: '同意接续', autoContReject: '拒绝', autoContTimeout: '{s} 秒后自动接续(视为挂机)', autoContRejected: '已跳过本次接续(下一个轮次边界再提醒)',
288
288
  continueCardTitle: '一键接续', continueCardHint: '写好交接账本→创建新会话→把交接材料作为首条消息预载,并自动切换到新会话继续任务(接续材料含白板节选+最新账本;当前工作区无账本时自动取全局最近一篇)。', continueBtn: '一键接续到新会话', continueBusy: '处理中…',
289
289
  fStyle: '反思风格', fStyleHint: '生活化 / 专业性 / 由内容决定。',
290
290
  fLocale: '界面语言', fLocaleHint: '默认跟随 DSH 系统语言;也可手动指定中文 / English。', followSystem: '跟随系统语言',
@@ -426,7 +426,7 @@ window.__ModuleLoader__.load({
426
426
  fWaterWindow: 'Water-level window (tokens)', fWaterWindowHint: 'Session messages priced with the official meter (4 chars ≈ 1 token); past this, context is considered nearly full; 0 disables. Default 65536 — a conservative half of a 128K window.',
427
427
  fWaterAdvisory: 'Water-level handoff advisory', fWaterAdvisoryHint: 'Injects a handoff advisory past the threshold (write ledger / refresh plan / suggest a new window); silent in unattended mode.',
428
428
  fWaterAuto: 'Auto skeleton ledger', fWaterAutoHint: 'Past the threshold, auto-writes one system skeleton ledger per session as a safety net if the model ignores the advisory.',
429
- fWaterThreshold: 'Water-level threshold', fWaterThresholdHint: 'Inject the handoff advisory / skeleton ledger once the ratio passes this value (0.1-1.5); default 0.75 — the official auto-compaction threshold is 80%, so a 5% margin is needed to finish the handoff first.',
429
+ fWaterThreshold: 'Water-level threshold', fWaterThresholdHint: 'The ratio counts session tokens against the official declared window (the reserved output budget is no longer deducted); past this value (0.1-1.5) the handoff advisory / skeleton ledger fires; default 0.75 — the official auto-compaction threshold is 80%, so a 5% margin is needed to finish the handoff first.',
430
430
  fHandoffPlan: 'Plan injection budget (chars)', fHandoffPlanHint: 'Hard truncation budget for injecting the PLAN.md snapshot into the dynamic memory; full text via memory_read or the Whiteboard tab. Default 1200.',
431
431
  fHandoffLedger: 'Ledger injection budget (chars)', fHandoffLedgerHint: 'Hard truncation budget for injecting the latest handoff ledger. Default 800.',
432
432
  fConsSchedule: 'Scheduled deep consolidation', fConsScheduleHint: 'Once a day at the set time, read recent logs and distill long-term value into project notes / user memory (same flow as memory_consolidate).',
@@ -434,8 +434,8 @@ window.__ModuleLoader__.load({
434
434
  fConsScheduleDays: 'Consolidation lookback (days)', fConsScheduleDaysHint: 'How many recent days of logs the scheduled consolidation reads; default 7.',
435
435
  fMaintSchedule: 'Scheduled 30-day distill', fMaintScheduleHint: 'Once a day at the set time, distill & archive logs older than 30 days (same flow as memory_maintain); zero cost when nothing to archive.',
436
436
  fMaintScheduleTime: 'Distill time', fMaintScheduleTimeHint: 'HH:MM, default 10:00 (staggered from the consolidation time).',
437
- waterCardTitle: 'Context water level', waterAutoSrc: 'auto-detected', waterManualSrc: 'manual', waterOfficialSrc: 'route capacity', waterFallbackSrc: 'fallback default', waterNotMeasured: 'Not measured for this session yet (updates after the next turn)', waterMeterOfficial: 'official meter', waterMeterHeuristic: 'heuristic fallback', waterThresholdHint: 'Past {t} of the window, the handoff advisory is injected and the skeleton ledger is backfilled; metering prefers the official token-meter (same source as the chat context ring), falling back to the heuristic when unavailable; the window prefers the official route capacity (request/context contextWindow), then the active model in settings.yaml, or your manual override below.',
438
- autoContTitle: 'Auto continue', autoContHint: 'When on: once the water level passes the threshold AND the old session is idle (the authoritative harness running bit flipped to false at a turn boundary, replacing the old "level unchanged across two polls"), a confirm card appears — Agree = continue now, Decline = skip this boundary (no re-prompt for it), no answer for 30-40s = unattended, continue automatically. Before continuing, the old agent refreshes PLAN + ledger; the new session keeps workspace/model/reasoning effort and receives layered handoff material; suppressed for 30 minutes after each run.', autoContOn: 'Auto continue: on', autoContOff: 'Auto continue: off', autoContThreshold: 'Threshold', autoContCountdown: '⏳ Auto-continue in {s}s…', autoContCancel: 'Cancel', autoContConfirm: 'Water level at {p}% and the old session is idle (turn boundary) — continue into a new session now?', autoContAgree: 'Continue', autoContReject: 'Decline', autoContTimeout: 'auto-continue in {s}s (unattended)', autoContRejected: 'Skipped this handoff (will ask again at the next turn boundary)',
437
+ waterCardTitle: 'Context water level', waterAutoSrc: 'auto-detected', waterManualSrc: 'manual', waterOfficialSrc: 'route capacity', waterFallbackSrc: 'fallback default', waterNotMeasured: 'Not measured for this session yet (updates after the next turn)', waterMeterOfficial: 'official meter', waterMeterHeuristic: 'heuristic fallback', waterThresholdHint: 'Past {t} of the window, the handoff advisory is injected and the skeleton ledger is backfilled; metering prefers the official token-meter (same source as the chat context ring), falling back to the heuristic when unavailable; the window prefers the official route capacity (request/context contextWindow), then the active model in settings.yaml, or your manual override below; the trigger denominator is the official declared window (min with any provider-reported hard limit) — the reserved output budget is not deducted.',
438
+ autoContTitle: 'Auto continue', autoContHint: 'When on: once the water level passes the threshold AND the old session is idle (the authoritative harness running bit flipped to false at a turn boundary, replacing the old "level unchanged across two polls"), a confirm card appears — Agree = continue now, Decline = skip this boundary (no re-prompt for it), no answer for 30-40s = unattended, continue automatically. Before continuing, the old agent refreshes PLAN + ledger; the new session keeps workspace/model/reasoning effort and receives layered handoff material; suppressed for 30 minutes after each run.', autoContOn: 'Auto continue: on', autoContOff: 'Auto continue: off', autoContThreshold: 'Threshold', autoContCountdown: '⏳ Auto-continue in {s}s…', autoContCancel: 'Cancel', autoContConfirm: 'Context at {p}% of the official declared window (official compaction starts ~80%) and the old session is idle (turn boundary) — continue into a new session now?', autoContAgree: 'Continue', autoContReject: 'Decline', autoContTimeout: 'auto-continue in {s}s (unattended)', autoContRejected: 'Skipped this handoff (will ask again at the next turn boundary)',
439
439
  continueCardTitle: 'One-click continue', continueCardHint: 'Writes the handoff ledger → creates a new session → injects the handoff material as the first message → switches to the new session automatically (material = PLAN excerpt + latest ledger; falls back to the most recent global ledger when this workspace has none).', continueBtn: 'Continue in a new session', continueBusy: 'Working…',
440
440
  fStyle: 'Reflection style', fStyleHint: 'Life-style / Professional / Auto.',
441
441
  fLocale: 'UI language', fLocaleHint: 'Follows the DSH system language by default; you can also pin Chinese / English.', followSystem: 'Follow system language',
@@ -567,6 +567,28 @@ window.__ModuleLoader__.load({
567
567
 
568
568
  // ───────────────────────── 更新弹窗 / 首次指导 ─────────────────────────
569
569
  var CHANGELOG = {
570
+ '2.5.0': { zh: [
571
+ '★ 水位口径修正:触发分母改用**官方声明窗口**(不再扣预留输出)——阈值 0.75 的触发点从约 46 万 token 后移到约 78.6 万,与官方「约 80% 才压缩」同一条线,不再"刚过半就接续"。',
572
+ '★ 新增预测性硬墙:上下文实占 + 预留输出 > 窗口(下一次请求必被拒,即 400 事故边界)时立即硬触发;压缩/溢出硬触发不变。本机这类大预留路由会由硬墙率先兜底,属"最后一格"而非浪费。',
573
+ '★ 接续序号改持久计数器(~/.dsh/memory/cont-seq.json):全局单调、换工作区不重号、转写包落盘失败自动回滚不跳号;计数器缺失时从历史「接续 #N」标题解析兜底。新窗口的接续标题不再错乱/丢失。',
574
+ '修复:接续序号为空时新会话标题退回自动生成的问题(宿主与浏览器两条路径现在都保证有序号);浏览器路径 rename 失败不再静默。',
575
+ '流程:发版/回归/双语对账/痕迹巡检四份子代理任务书固化(docs/prompts),主对话只做决策——对你无感,只是发版更稳。',
576
+ '注:自动接续出厂默认仍为关;新口径验证满意后你可以在设置里打开,或等下一版评估翻回默认。',
577
+ ], en: [
578
+ '★ Water-level caliber fixed: the trigger denominator is now the officially declared window (the reserved output budget is no longer deducted) — at threshold 0.75 the trigger point moves from ~460K to ~786K tokens on a 1M window, aligning with the official ~80% compaction point.',
579
+ '★ Predictive hard wall added: when session tokens + reserved output exceed the window (the next request would be rejected — the exact 400-incident boundary), continue immediately; compaction / overflow hard triggers unchanged.',
580
+ '★ Continue sequence numbers now use a persistent counter (~/.dsh/memory/cont-seq.json): globally monotonic, no duplicates across workspaces, automatic rollback when the transcript pack fails to write (no skipped numbers), and a title-scan fallback for pre-existing data.',
581
+ 'Fix: empty sequence numbers no longer skip the session rename (both host and browser paths guarantee one); browser-side rename failures are no longer silent.',
582
+ 'Process: four self-contained subagent task books (release / regression / docs audit / trace patrol) — invisible to you, just steadier releases.',
583
+ 'Note: auto-continue factory default stays off; after verifying the new caliber, turn it on in settings (or wait for the next release to re-evaluate the default).',
584
+ ] },
585
+ '2.4.2': { zh: [
586
+ '变更:自动接续改为**出厂默认关闭**(老用户已落盘的显式设置不受影响)。原因:现有水位判据把「预留输出」从分母里扣掉,实测在上下文刚过半时就触发接续,与官方「约 80% 才压缩」相差约 45%,对不熟悉的人就是白烧 token —— 先默认关,等判据改成与官方压缩同一坐标系后再评估翻回。',
587
+ '想用的人可以在「白板 / 接续」页签里手动打开(开关一直没动,只是默认值变了)。',
588
+ ], en: [
589
+ 'Change: auto-continue is now OFF by default (explicit values already saved by existing users are unaffected). Reason: the current water-level ratio subtracts the route\'s reserved output from the denominator, so it fired when the context was barely half full — about 45% earlier than the official compaction point (~80%). Defaulting off stops burning tokens until the ratio is aligned with the official coordinate system.',
590
+ 'You can still turn it on yourself from the Whiteboard / Handoff tab; only the default changed.',
591
+ ] },
570
592
  '2.4.1': { zh: [
571
593
  '修复:已接续过的会话会被再次触发接续(重复建窗口)。新增「已接续闩锁」并落盘(session id 为键、重启有效):宿主路径在交接材料投料成功后落闩,浏览器路径在新会话真建成后落闩,失败不落闩以便重试。',
572
594
  '修复:宿主已完成接续后,确认卡仍停在「同意接续/拒绝」并与「已自动接续到新会话」并存;arm 状态改为按会话过滤,不再在其他窗口弹「本会话水位已达」。',
@@ -2150,7 +2172,7 @@ window.__ModuleLoader__.load({
2150
2172
  // 接续序号标题:让用户一眼区分新会话 vs 延续会话
2151
2173
  if (d.contSeq && rf.session.rename && typeof rf.session.rename === 'function') {
2152
2174
  var contTitle = (locale === 'zh' ? '接续 #' : 'Cont.#') + String(d.contSeq) + (d.wsBase ? ' · ' + d.wsBase : '')
2153
- try { await rf.session.rename({ sessionId: newId, title: contTitle }) } catch (eRen) {}
2175
+ try { await rf.session.rename({ sessionId: newId, title: contTitle }) } catch (eRen) { try { console.warn('[dsh-auto-memory] rename failed: ' + ((eRen && eRen.message) || eRen)) } catch (eRen2) {} }
2154
2176
  }
2155
2177
  // 沿用旧会话模型(provider/model/reasoningEffort 由 host 从旧会话 request/header 折叠而来;不可用则静默回退路由默认)
2156
2178
  if (d.provider && d.model && typeof rf.session.selectModel === 'function') {