@moonquake2004/dsh-doctor 0.4.28 → 0.4.29
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/dsh-doctor.mjs +23 -4
- package/package.json +1 -1
package/dsh-doctor.mjs
CHANGED
|
@@ -1326,10 +1326,29 @@ function checkSession(targetPath) {
|
|
|
1326
1326
|
// ② surfaceOp 为 replace 形态({op:'replace', start/end} 或 startSeq/endSeq),
|
|
1327
1327
|
// 但引用的位置在本日志里解析不到。
|
|
1328
1328
|
{
|
|
1329
|
-
const
|
|
1329
|
+
const rawRows = [];
|
|
1330
1330
|
for (const ln of String(text).split('\n')) {
|
|
1331
1331
|
if (!ln.trim()) continue;
|
|
1332
|
-
try {
|
|
1332
|
+
try { rawRows.push(JSON.parse(ln)); } catch { /* 解析失败由 S11/SS4 报 */ }
|
|
1333
|
+
}
|
|
1334
|
+
// **判定对象必须是"打开时真正被投影的那条流"**:对需要迁移的日志(v0/v1/v2),
|
|
1335
|
+
// 缺消息体可能是在**迁移过程中**产生的,磁盘行上看不出来。所以这里优先走真实迁移链取"迁移后的视图"。
|
|
1336
|
+
// (2026-09 自查:初版只看磁盘行,会漏掉报告者 #6686 的实际病例。)
|
|
1337
|
+
let rows = rawRows;
|
|
1338
|
+
let view = '磁盘原始行';
|
|
1339
|
+
const hdr = rawRows[0];
|
|
1340
|
+
if (hdr && hdr.type === 'session' && hdr.version !== 3 && FORMAT_CATALOG) {
|
|
1341
|
+
try {
|
|
1342
|
+
const r = FORMAT_CATALOG.createRestore(hdr, { validation: 'current', recovery: 'strict' });
|
|
1343
|
+
const decoded = [];
|
|
1344
|
+
for (let i = 1; i < rawRows.length; i++) {
|
|
1345
|
+
const d = r.decodeRow(rawRows[i]);
|
|
1346
|
+
decoded.push((d && d.type) ? d : (d && d.event) ? d.event : rawRows[i]);
|
|
1347
|
+
}
|
|
1348
|
+
r.finish();
|
|
1349
|
+
rows = decoded;
|
|
1350
|
+
view = `迁移后视图(v${hdr.version} → v3,走真实迁移链)`;
|
|
1351
|
+
} catch { /* 迁移被拒由 S12 报;这里退回磁盘行并注明 */ view = '磁盘原始行(迁移链未走通,见 S12)'; }
|
|
1333
1352
|
}
|
|
1334
1353
|
const seqs = new Set(rows.map((r) => r.seq).filter((x) => typeof x === 'number'));
|
|
1335
1354
|
const probs = [];
|
|
@@ -1351,13 +1370,13 @@ function checkSession(targetPath) {
|
|
|
1351
1370
|
}
|
|
1352
1371
|
if (probs.length) {
|
|
1353
1372
|
report('session', 'S14', false,
|
|
1354
|
-
`检测到 ${probs.length} 处会让会话**打不开**的事件体/引用不完整(#6686:迁移成功但 project
|
|
1373
|
+
`检测到 ${probs.length} 处会让会话**打不开**的事件体/引用不完整(#6686:迁移成功但 project 抛错;判定视图:${view}):\n `
|
|
1355
1374
|
+ probs.slice(0, 6).join('\n ')
|
|
1356
1375
|
+ (probs.length > 6 ? `\n …另有 ${probs.length - 6} 处` : ''),
|
|
1357
1376
|
'这类会话在 GUI 里点开会报 failed to project session;上游修法(可选链 + 中性兜底)见 #6686;'
|
|
1358
1377
|
+ '在那之前可先把该会话目录移出 sessions/ 隔离,避免它影响会话列表');
|
|
1359
1378
|
} else {
|
|
1360
|
-
report('session', 'S14', true, `投影安全性预检通过(${rows.length} 个事件:消息体完整、replace
|
|
1379
|
+
report('session', 'S14', true, `投影安全性预检通过(${rows.length} 个事件:消息体完整、replace 引用可解析;判定视图:${view})`);
|
|
1361
1380
|
}
|
|
1362
1381
|
}
|
|
1363
1382
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonquake2004/dsh-doctor",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.29",
|
|
4
4
|
"description": "Offline diagnostic for DeepSeek Harness — 28 built-in + 5 catalog checks across env/profile/session (Layer A checks-as-data), self-update (Layer B), and a semi-automatic LLM observer (Layer C, --observe); Doctor panel in web UI settings.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|