dsh-session-superagent 0.9.51 → 0.9.53

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,37 @@
2
2
 
3
3
  格式参照 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
4
4
 
5
+ ## [0.9.53] - 2026-11-02 —— 演练脚本补上"有跳过"分支(那个 bug 藏了两小时的原因)
6
+
7
+ ### 学到的(知识库第 73 条追加)
8
+ 演练脚本如果只跑主路径,它就只是"主路径回放",不是演练。
9
+
10
+ ### 做了什么
11
+ `first-run.mjs` 新增第 3b 段:用真实过滤数据(已关闭 × 2、机器人 × 1、已 ack × 1)演示
12
+ "有跳过时的同一条消息",并纳入文案快照(47 → 50 行)。
13
+
14
+ ```
15
+ 【为什么是这几条】本轮共 7 条变化;按「最近更新」取前 2 条;本轮跳过 4 条(已关闭 × 2、机器人 × 1、已 ack × 1)
16
+ ```
17
+
18
+ ### 为什么值得
19
+ 0.9.52 修的那个"累计冒充本轮"的 bug 之所以藏了很久,就是因为这行**从来没被演练出来过**。
20
+
21
+ ## [0.9.52] - 2026-11-02 —— "跳过"那一行原来是累计值,而且不报总数
22
+
23
+ ### 发现(两个都是真的)
24
+ 1. **累计冒充本轮**:`filterCounts` 从创建守起一直累加,而唤醒消息写的是"同时跳过 …",
25
+ 读起来像本轮 —— 跑一上午之后这条数字会大得离谱;
26
+ 2. **只报原因不报总数**:只列前 3 个原因,`已 ack × 1` 这种被截掉的完全看不见,
27
+ 读者会以为"就跳过了这几条"。
28
+
29
+ ### 改法
30
+ - 每轮开始重置 `filterCounts`(语义改成"本轮");
31
+ - 消息里改成 `本轮跳过 9 条(已关闭 × 5、机器人 × 2、草稿 PR × 1 等)` —— 有总数、有前三个原因、有"等"。
32
+
33
+ ### 测试
34
+ - 新增 1 例(总数 = 9、前三个原因都在、第四个不列、标"等"、没有跳过时不出现该行)。合计 **185 例**。
35
+
5
36
  ## [0.9.51] - 2026-11-02 —— 验收清单的证据本身也被校验(抓到 4 条假引用)
6
37
 
7
38
  ### 学到的(知识库第 96 条追加)
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <img src="assets/icon-180.png" width="88" height="88" alt="">
4
4
 
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
- [![Version](https://img.shields.io/badge/version-0.9.51-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.53-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
7
7
  [![npm](https://img.shields.io/npm/v/dsh-session-superagent.svg)](https://www.npmjs.com/package/dsh-session-superagent)
8
8
  [![dsh](https://img.shields.io/badge/DeepSeek%20Harness-plugin-orange.svg)](https://github.com/topics/dsh-plugin)
9
9
 
@@ -121,7 +121,7 @@ dsh plugin install /path/to/dsh-session-superagent
121
121
  ## 开发
122
122
 
123
123
  ```sh
124
- node --test # 184 项单测
124
+ node --test # 185 项单测
125
125
  ```
126
126
 
127
127
  ### 工具输出:文本给人和 agent,JSON 给程序
package/client.js CHANGED
@@ -14,7 +14,7 @@ window.__ModuleLoader__.load({
14
14
  const { useCallback, useEffect, useRef, useState } = React
15
15
 
16
16
  // 客户端版本探针:每次模块加载写一次,用来确认浏览器里跑的是哪一版
17
- const CLIENT_VERSION = '0.9.51'
17
+ const CLIENT_VERSION = '0.9.53'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
package/lib/index.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
 
41
41
  export const name = 'dsh-session-superagent'
42
42
  /** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
43
- export const SERVER_VERSION = '0.9.51'
43
+ export const SERVER_VERSION = '0.9.53'
44
44
  export const inject = ['tools', 'agents', 'webServer']
45
45
  /** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
46
46
  const DEFAULT_SESSION_WAKES = 12
@@ -900,6 +900,8 @@ async function pollOnce(ctx, entry, baseMs) {
900
900
  const ackLabel = entry.ackLabel || DEFAULT_ACK_LABEL
901
901
  // 幂等痕迹留在 GitHub 上:带 ack 标签的条目直接跳过(换机器、删状态都不会重报)
902
902
  const considered = []
903
+ // 每轮重置:这行要被读成「本轮跳过多少」,累计值会越滚越大、误导客户
904
+ entry.filterCounts = {}
903
905
  for (const item of items) {
904
906
  if (hasAckLabel(item, ackLabel)) {
905
907
  entry.filteredLog = pushFiltered(entry.filteredLog, { at: entry.lastPoll, number: item.number, title: String(item.title || '').slice(0, 80), reason: '已 ack' })
package/lib/watch.js CHANGED
@@ -143,7 +143,12 @@ export function formatWatchText(repo, fresh, options = {}) {
143
143
  const skipped = options.skippedReasons && typeof options.skippedReasons === 'object'
144
144
  ? Object.entries(options.skippedReasons).filter(([, n]) => Number(n) > 0).slice(0, 3)
145
145
  : []
146
- if (skipped.length > 0) parts.push('同时跳过 ' + skipped.map(([reason, n]) => reason + ' × ' + n).join('、'))
146
+ if (skipped.length > 0) {
147
+ // 只说「前三个原因」会让人以为只有这些;把总数也报出来
148
+ const total = Object.values(options.skippedReasons).reduce((sum, n) => sum + (Number(n) || 0), 0)
149
+ const more = Object.keys(options.skippedReasons).length > skipped.length ? ' 等' : ''
150
+ parts.push('本轮跳过 ' + total + ' 条(' + skipped.map(([reason, n]) => reason + ' × ' + n).join('、') + more + ')')
151
+ }
147
152
  return parts.length > 0 ? String.fromCharCode(10) + '【为什么是这几条】' + parts.join(';') : ''
148
153
  })()
149
154
  // 完成标准要「可观测」:只说"做好它"等于没说。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.9.51",
3
+ "version": "0.9.53",
4
4
  "description": "Session-level superagent for DeepSeek Harness: watch a GitHub repository and wake a session when something needs doing. Credentials never reach the model.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",