@kangyishuai/dsh-advisor 0.6.0 → 0.6.1

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/README.md CHANGED
@@ -167,10 +167,10 @@ This is the section to read before turning it on.
167
167
 
168
168
  ## Compatibility
169
169
 
170
- | DSH version | Status |
171
- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
172
- | 0.2.2-rc.2 | Verified 2026-11-12: unit tests + `pnpm probe:runtime` 67/67 + web `pnpm smoke:advisor` 13/13 on a throwaway DSH home (no model calls, ledger 0). Desktop read-only regression (live app over CDP): 18 passing + 1 skipped (the session had no advisor records). |
173
- | 0.2.2-rc.1 | Verified on this version: unit tests (settings clamping, route selection and pairing, budget guard, transcript rendering, redaction, output contract) and `pnpm probe:runtime`; the desktop read-only regression is `pnpm smoke:advisor-desktop`. Other DSH versions are not verified. |
170
+ | DSH version | Status |
171
+ | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
172
+ | 0.2.2-rc.2 | **0.6.0** (2026-11-14): adds the decision log `decisions.jsonl` plus `pnpm advisor:review`; settings moved to their own "Settings → Advisor" section (three-row summary + collapsed "More settings"). Verified: unit tests (20 of them cover the decision log) + `pnpm probe:runtime` 72/72 + web `pnpm smoke:advisor` **14/14** (throwaway DSH home, no model calls). The settings section was additionally checked on a live desktop build via read-only CDP (DOM + screenshot); the desktop read-only regression reports **19 PASS + 1 SKIP** (the SKIP is a session with no advisor record — the script never fabricates a consultation). |
173
+ | 0.2.2-rc.1 | Verified on this version: unit tests (settings clamping, route selection and pairing, budget guard, transcript rendering, redaction, output contract) and `pnpm probe:runtime`; the desktop read-only regression is `pnpm smoke:advisor-desktop`. Other DSH versions are not verified. |
174
174
 
175
175
  The plugin declares no `engines.dsh` and no `@deepseek-ai/*` peer range: DSH is pre-release and semver ranges over prereleases are unreliable (see [ADR 0005](../../docs/adr/0005-dsh-version-compatibility.md)). Treat this table as the compatibility statement. After a DSH upgrade run `pnpm probe:runtime`, `pnpm smoke:advisor-desktop` and the unit tests, then check `/advisor doctor`.
176
176
 
package/README.zh-CN.md CHANGED
@@ -157,10 +157,10 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-advisor-*.tgz
157
157
 
158
158
  ## 兼容性
159
159
 
160
- | 已验证的 DSH 版本 | 状态 |
161
- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
162
- | 0.2.2-rc.2 | 2026-11-12 已验证:单测 + `pnpm probe:runtime` 67/67 + Web `pnpm smoke:advisor` 13/13(临时 DSH home,不发起模型调用,账本 0)。桌面只读回归(live 桌面版,CDP):19 PASS + 1 SKIP(SKIP 是该会话没有顾问记录;冷启动实测)。 |
163
- | 0.2.2-rc.1 | 已在该版本验证:单测(81 条)与 `pnpm probe:runtime`;web 端到端冒烟 `pnpm smoke:advisor`、桌面端只读回归 `pnpm smoke:advisor-desktop`。其他 DSH 版本未验证。 |
160
+ | 已验证的 DSH 版本 | 状态 |
161
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
162
+ | 0.2.2-rc.2 | **0.6.0**(2026-11-14):新增决策日志 `decisions.jsonl` + `pnpm advisor:review` 复盘;设置搬到「设置 → 顾问」分节(首屏三行摘要 + 更多设置折叠)。已验证:单测(含 `decisions` 20 项、linter 全绿)+ `pnpm probe:runtime` 72/72 + web `pnpm smoke:advisor` **14/14**(临时 DSH home,不发起模型调用)。设置分节另有真机只读 CDP 核验(DOM + 截图:三行摘要、更多设置默认收起);桌面只读回归 **19 PASS + 1 SKIP**(SKIP 是该会话没有顾问记录,脚本不制造徵询)。 |
163
+ | 0.2.2-rc.1 | 已在该版本验证:单测(81 条)与 `pnpm probe:runtime`;web 端到端冒烟 `pnpm smoke:advisor`、桌面端只读回归 `pnpm smoke:advisor-desktop`。其他 DSH 版本未验证。 |
164
164
 
165
165
  插件不声明 `engines.dsh`,也不声明 `@deepseek-ai/*` 的 peer 范围:DSH 还在预发布阶段,semver 对预发布版本不可靠(见 [ADR 0005](../../docs/adr/0005-dsh-version-compatibility.md))。这张表就是兼容性声明。DSH 升级后请跑 `pnpm probe:runtime`、`pnpm smoke:advisor-desktop` 和单测,再看 `/advisor doctor`。
166
166
 
package/lib/decisions.js CHANGED
@@ -36,6 +36,10 @@ const SKIP_PATTERNS = [
36
36
  [/投递上限|会话上限|session.?cap/iu, "skipped-limit"],
37
37
  [/预算|额度|budget|quota/iu, "skipped-budget"],
38
38
  [/确认|confirm/iu, "skipped-needs-confirmation"],
39
+ // finishTurn 在非正常结束时会写「回合被中断 / 被阻塞」,
40
+ // 不加这两条就会归到 skipped-other(真实日志里踩到过)。
41
+ [/中断|abort/iu, "skipped-aborted"],
42
+ [/阻塞|blocked/iu, "skipped-blocked"],
39
43
  ];
40
44
 
41
45
  /**
@@ -83,14 +87,18 @@ export function turnFeatures(input) {
83
87
  export function buildDecision(input) {
84
88
  const advice = input.advice;
85
89
  const consulted = advice !== undefined && advice !== null;
90
+ const endKind = input.endKind ?? "completed";
91
+ // 结束原因本身就是最可靠的原因码来源;不要把它降级成「从人话里猜」。
92
+ const endKindCode =
93
+ endKind === "aborted" ? "skipped-aborted" : endKind === "blocked" ? "skipped-blocked" : null;
86
94
  return {
87
95
  at: input.at ?? new Date().toISOString(),
88
96
  sessionId: input.sessionId,
89
97
  turn: input.turn,
90
- endKind: input.endKind ?? "completed",
98
+ endKind,
91
99
  consulted,
92
100
  // 没徵询时给出原因码,复盘时先看这一列。
93
- skipCode: consulted ? null : classifySkip(input.skipReason),
101
+ skipCode: consulted ? null : (endKindCode ?? classifySkip(input.skipReason)),
94
102
  skipReason: consulted ? null : (input.skipReason ?? ""),
95
103
  ...turnFeatures(input.features ?? {}),
96
104
  adviceId: advice?.adviceId ?? null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kangyishuai/dsh-advisor",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Pair the main model with a stronger advisor model it consults at key moments: autonomous second opinion, cost ledger, and model picker",
5
5
  "keywords": [
6
6
  "dsh",