dsh-session-superagent 0.9.220 → 0.9.222

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,74 @@
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.222] - 2026-11-05 —— 又三条审计脚本「换个写法就绕过去」
6
+
7
+ ### ① `audit-readme-tests.mjs` 只看第一处
8
+
9
+ `readme.match(/N 项单测/)` 只取**第一个**匹配 —— README 里第二处写错也看不见。
10
+ 两处数字不一致本身就是最危险的状态(读者不知道信哪个)。现在全部收集,要求一致。
11
+
12
+ ### ② `audit-syntax.mjs` 清单写死 6 个文件
13
+
14
+ 新增 `lib/xxx.js` 语法坏掉也 PASS。改成**扫描**:`lib/*.js` + `client.js` + `scripts/*.mjs`(门禁自己也会坏)。
15
+
16
+ 实测从 6 个文件变成 **63 个** —— 门禁的覆盖面一下子大了十倍。
17
+
18
+ ### ③ `audit-tmp-dirs.mjs` 只认一种拼写
19
+
20
+ 只匹配 `mkdtempSync(join(tmpdir()`。换个写法(`tmpdir() + sep`、先 `const t = tmpdir()`、
21
+ `path.join(tmpdir(), ...)`)就全逃逸。
22
+
23
+ 改成按**行为**判定:这个文件里既有 `mkdtempSync(` 又用到 `tmpdir(`,却没走 `tempDir()` 就算违规。
24
+
25
+ ### 为什么这类「换个写法就绕过」最危险
26
+
27
+ 它不像「脚本坏了」那么明显 —— 脚本跑得好好的、输出 PASS、退出码 0,
28
+ **只是它检查的东西已经不是真实存在的东西了**。上一轮那个「术语表永远不红」是同一个病,只是那一条更极端。
29
+
30
+ ### 证据
31
+
32
+ ```
33
+ node --test → 369/369
34
+ preflight --fast → 全部通过(38 项)
35
+ audit-syntax → PASS 语法 node --check 63 个文件(原 6 个)
36
+ ```
37
+
38
+ ## [0.9.221] - 2026-11-05 —— 让测试桩「脏」起来,才抓得住真机上的脏数据
39
+
40
+ ### ① T26 的教训做成了夹具
41
+
42
+ > `panel-harness.mjs` 的桩比**真 /state** 干净:`intervalSec: 30` 恒存在、`goal: null` 恒为空、`gh` 根本不在桩里。
43
+ > 于是「假数据造出来的正确」掩盖了「真数据下的错误」。
44
+
45
+ 新增 `dirtyWatcher()` / `dirtyState()`:按**后端真实形状**造 —— `goal` 是对象(`goalView()` 的返回)、
46
+ `intervalSec` 缺失、`gh.ok` 是 `null`、`repoAccess` 全 red、`filters`/`priority`/`history` 全是 `null`。
47
+
48
+ 宁可脏,也不要干净 —— 干净会让测试变成装饰。
49
+
50
+ ### ② 新用例一上线就抓到一个真 bug
51
+
52
+ ```
53
+ 节点: "未命名会话 · acme/d1 · 每 undefineds · 轮询 —"
54
+ ```
55
+
56
+ 面板行直接拼 `watcher.intervalSec`,而**弹层那边有 `(Number() || 60)` 兜底** —— 同一个值两条路径、只有一条有兜底。
57
+ 老条目 / 迁移过来的守缺这个字段时,行里就显示「每 undefineds」。
58
+
59
+ (这正是 T26 的 W3 条目,当时判为「值得修」,现在被测试自己抓出来了。)
60
+
61
+ ### ③ 用例扫四个页签
62
+
63
+ 一个页签干净不代表别的页签干净。`overview / queue / trigger / settings` 全扫,
64
+ 断言不出现 `undefined` / `NaN` / `[object Object]`。
65
+
66
+ ### 证据
67
+
68
+ ```
69
+ node --test → 369/369(新增 1 条:脏数据四页签渲染)
70
+ ui-audit → 11/11(100 分)
71
+ ```
72
+
5
73
  ## [0.9.220] - 2026-11-05 —— 契约漂移:`gh.ok` 是三态,`goal` 是对象
6
74
 
7
75
  ### ① `body.gh.ok` 三态被当二态用
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.220-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.222-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
  [![awesome](https://img.shields.io/badge/awesome-dsh--plugin-%E2%9C%93-success.svg)](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
@@ -145,7 +145,7 @@ Gitee 私有仓库要在「设置 → 凭证」填私人令牌;公开仓库不
145
145
  ## 开发
146
146
 
147
147
  ```sh
148
- node --test # 368 项单测
148
+ node --test # 369 项单测
149
149
  ```
150
150
 
151
151
  ### 工具输出:文本给人和 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.220'
17
+ const CLIENT_VERSION = '0.9.222'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
@@ -1310,7 +1310,7 @@ window.__ModuleLoader__.load({
1310
1310
  // 标题行已经写了仓库名;这里只补「会话 + 间隔」,并把最近一次结果并进来
1311
1311
  // (原来这一行和下面那行各占 20px,其实说的是同一件事:这个守在干什么、最近怎么样)
1312
1312
  h('div', { className: 'dt-ticket-note' },
1313
- (watcher.title || '未命名会话') + ' · ' + sessionTag(watcher.sessionId) + ' · 每 ' + watcher.intervalSec + 's'
1313
+ (watcher.title || '未命名会话') + ' · ' + sessionTag(watcher.sessionId) + ' · 每 ' + (Number(watcher.intervalSec) || 60) + 's'
1314
1314
  + ' · 轮询 ' + ageText(watcher.lastPoll)),
1315
1315
  watcher.lastWake
1316
1316
  ? h('div', { className: 'dt-ticket-note' },
package/lib/index.js CHANGED
@@ -43,7 +43,7 @@ import {
43
43
 
44
44
  export const name = 'dsh-session-superagent'
45
45
  /** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
46
- export const SERVER_VERSION = '0.9.220'
46
+ export const SERVER_VERSION = '0.9.222'
47
47
  export const inject = ['tools', 'agents', 'webServer']
48
48
  /** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
49
49
  // 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.9.220",
3
+ "version": "0.9.222",
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",