dsh-session-superagent 0.9.203 → 0.9.204

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,41 @@
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.204] - 2026-11-05 —— 门禁把「没跑」记成 PASS(假绿)+ 静默改回别人的改动
6
+
7
+ ### M6 · 抢不到锁 = 假绿
8
+ `audit-pack` 抢不到锁时打印 `SKIP …本次跳过` 但 **exit 0** —— 而 preflight 的 `record(..., res.status === 0)`
9
+ 把它记成 **PASS**,汇总「全部通过(N 项检查)」里含一项**根本没跑**的检查。
10
+ 同一个实验里 `regression-cases` 反而是未捕获 `GATE_BUSY` 抛栈 + exit 1(假红)。语义完全不一致。
11
+
12
+ 改法:跳过用独立退出码 **3**;`record()` 支持第三种状态 `skip`(打印 `SKIP`、不进「全部通过」、
13
+ 汇总单独说「通过 N 项,跳过 M 项(跳过的没跑,不算通过)」)。
14
+
15
+ ### M5 · `.gate-recover` 无条件写回,把别人的合法改动静默改回
16
+ 真机复现:门禁被强杀后把版本改成 `0.9.x(示例)`,**下一次门禁把它改回 `0.9.203`**,退出码 0、`git status` 干净 ——
17
+ 最坏的是没人会注意到。
18
+ 现在 **fail-closed**:只要盘上内容与快照不一致,就不覆盖,列出文件并 `exit 1`;
19
+ 确认要还原得显式设 `SUPERAGENT_GATE_FORCE_RECOVER=1`。
20
+
21
+ ### M4 · 恢复清单写错路径,重跑也不还原
22
+ `regression-list.mjs` 声明 `docs/模式差异.md`(不存在),实际改的是 `docs/preflight-modes.md` ——
23
+ 于是该文件**不在 manifest 里**,强杀后永远不自愈。已改正。
24
+
25
+ ### M1 · 安装副本被门禁注入污染(已修)
26
+ `write fileSync` 是原地写,仓库与安装副本本来是**同一 inode**:门禁注入**直通安装副本**,
27
+ 进程被杀就永久留下;随后任何 `git checkout` 会换 inode,把断链固化。已 `sync-profile --repair` 修回(断链 1 → 0)。
28
+
29
+ ### 未修(登记)
30
+ **M2**(门禁锁只覆盖 2/39 项,`verify-gates` 改 14 个路径零持锁)与 **M3**(`verify-gates` 无落盘恢复凭据)
31
+ 需要把锁提到 `preflight` 入口 + 给 `verify-gates` 加 manifest,改动面大,单独立项。
32
+
33
+ ### 证据
34
+ ```
35
+ node --test → 351/351
36
+ preflight --fast → 全部通过(37 项检查)
37
+ audit-docs-all → 工具/路由/版本/路径 四项全 PASS
38
+ sync-profile --check → 缺失 0 / 断链 0 / 陈旧 0
39
+ ```
5
40
  ## [0.9.203] - 2026-11-05 —— 行内编辑器保存会把别处刚改的值写回旧快照(lost update)
6
41
 
7
42
  ### M2 · 全量 PUT + 打开那一刻的快照 = 静默覆盖
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.203-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.204-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
 
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.203'
17
+ const CLIENT_VERSION = '0.9.204'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
@@ -1084,41 +1084,41 @@ window.__ModuleLoader__.load({
1084
1084
  const saveEdit = (watcher) => run(async () => {
1085
1085
  await call('/watch', {
1086
1086
  method: 'POST',
1087
- // 审核 M2:只发**真的改过**的字段(打开编辑器后没动过的键一律不发,服务端保持原值)。
1088
- // 以前是全量 PUT:别处刚改的 intervalSec / goal 会被打开那一刻的旧快照静默覆盖。
1089
- body: JSON.stringify((() => {
1090
- const full = {
1091
- repo: watcher.repo,
1092
- sessionId: watcher.sessionId,
1093
- intervalSec: Number(draft.intervalSec) || watcher.intervalSec,
1094
- filters: {
1095
- labels: String(draft.labels || '').split(',').map((v) => v.trim()).filter(Boolean),
1096
- onlyAssigned: !!draft.onlyAssigned,
1097
- },
1098
- activeHours: draft.activeHours || '',
1099
- goal: draft.goal || '',
1100
- isolated: !!draft.isolated,
1101
- workdir: draft.workdir || '',
1102
- observe: !!draft.observe,
1103
- isolateKeepDays: Number(draft.isolateKeepDays) || undefined,
1104
- maxIsolated: Number(draft.maxIsolated) || undefined,
1105
- priority: {
1106
- reopened: draft.priorityReopened !== false,
1107
- comments: draft.priorityComments !== false,
1108
- labels: draft.priorityLabels !== false,
1109
- unassigned: draft.priorityUnassigned === true,
1110
- stale: draft.priorityStale === true,
1111
- },
1112
- batchLimit: Number(draft.batchLimit) || undefined,
1113
- maxWakesPerHour: Number(draft.maxWakesPerHour) || undefined,
1114
- sessionMaxWakes: Number(draft.sessionMaxWakes) || undefined,
1115
- }
1116
- const out = { repo: full.repo, sessionId: full.sessionId }
1117
- for (const key of touchedRef.current) {
1118
- if (Object.prototype.hasOwnProperty.call(full, key)) out[key] = full[key]
1119
- }
1120
- return out
1121
- })()),
1087
+ // 审核 M2:只发**真的改过**的字段(打开编辑器后没动过的键一律不发,服务端保持原值)。
1088
+ // 以前是全量 PUT:别处刚改的 intervalSec / goal 会被打开那一刻的旧快照静默覆盖。
1089
+ body: JSON.stringify((() => {
1090
+ const full = {
1091
+ repo: watcher.repo,
1092
+ sessionId: watcher.sessionId,
1093
+ intervalSec: Number(draft.intervalSec) || watcher.intervalSec,
1094
+ filters: {
1095
+ labels: String(draft.labels || '').split(',').map((v) => v.trim()).filter(Boolean),
1096
+ onlyAssigned: !!draft.onlyAssigned,
1097
+ },
1098
+ activeHours: draft.activeHours || '',
1099
+ goal: draft.goal || '',
1100
+ isolated: !!draft.isolated,
1101
+ workdir: draft.workdir || '',
1102
+ observe: !!draft.observe,
1103
+ isolateKeepDays: Number(draft.isolateKeepDays) || undefined,
1104
+ maxIsolated: Number(draft.maxIsolated) || undefined,
1105
+ priority: {
1106
+ reopened: draft.priorityReopened !== false,
1107
+ comments: draft.priorityComments !== false,
1108
+ labels: draft.priorityLabels !== false,
1109
+ unassigned: draft.priorityUnassigned === true,
1110
+ stale: draft.priorityStale === true,
1111
+ },
1112
+ batchLimit: Number(draft.batchLimit) || undefined,
1113
+ maxWakesPerHour: Number(draft.maxWakesPerHour) || undefined,
1114
+ sessionMaxWakes: Number(draft.sessionMaxWakes) || undefined,
1115
+ }
1116
+ const out = { repo: full.repo, sessionId: full.sessionId }
1117
+ for (const key of touchedRef.current) {
1118
+ if (Object.prototype.hasOwnProperty.call(full, key)) out[key] = full[key]
1119
+ }
1120
+ return out
1121
+ })()),
1122
1122
  })
1123
1123
  setEditing(null)
1124
1124
  }, '已保存:' + watcher.repo)
@@ -1227,7 +1227,7 @@ window.__ModuleLoader__.load({
1227
1227
  h('button', {
1228
1228
  type: 'button', className: 'dt-open', title: '展开或收起这条主理鱼的设置',
1229
1229
  'aria-expanded': editing === key, onClick: () => {
1230
- setEditing(editing === key ? null : key)
1230
+ setEditing(editing === key ? null : key)
1231
1231
  touchedRef.current = new Set()
1232
1232
  setDraft({
1233
1233
  intervalSec: String(watcher.intervalSec ?? 60),
package/lib/index.js CHANGED
@@ -42,7 +42,7 @@ import {
42
42
 
43
43
  export const name = 'dsh-session-superagent'
44
44
  /** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
45
- export const SERVER_VERSION = '0.9.203'
45
+ export const SERVER_VERSION = '0.9.204'
46
46
  export const inject = ['tools', 'agents', 'webServer']
47
47
  /** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
48
48
  // 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.9.203",
3
+ "version": "0.9.204",
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",