@lmzhen/dsh-evolution-review 0.3.35 → 0.3.37

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.
Files changed (2) hide show
  1. package/lib/index.js +29 -2
  2. package/package.json +10 -10
package/lib/index.js CHANGED
@@ -80,7 +80,11 @@ function apply(ctx, rawConfig) {
80
80
  await runOnTurnEnd(session, event);
81
81
  } catch (error) {
82
82
  ctx.logger.warn(`dsh-evolution-review: turn-end review pipeline failed: ${error instanceof Error ? error.message : String(error)}`);
83
- ctx.emit("evolution/review-error", { sessionId: session.id });
83
+ try {
84
+ ctx.emit("evolution/review-error", { sessionId: session.id });
85
+ } catch (emitError) {
86
+ ctx.logger.warn(`dsh-evolution-review: review-error emit failed: ${emitError instanceof Error ? emitError.message : String(emitError)}`);
87
+ }
84
88
  }
85
89
  }
86
90
  async function runOnTurnEnd(session, event) {
@@ -250,6 +254,29 @@ function apply(ctx, rawConfig) {
250
254
  } catch (injectError) {
251
255
  ctx.logger.warn(`dsh-evolution-review: result notice inject failed: ${injectError instanceof Error ? injectError.message : String(injectError)}`);
252
256
  }
257
+ } else try {
258
+ const reasons = [];
259
+ if (validation.rejected.length > 0) reasons.push(`${validation.rejected.length} op(s) rejected by validation`);
260
+ if (skippedUnread > 0) reasons.push(`${skippedUnread} op(s) skipped (skill not read this session)`);
261
+ if (executed.failedOps.length > 0) reasons.push(`${executed.failedOps.length} op(s) failed at execution: ${executed.failedOps.join("; ")}`);
262
+ if (executed.aborted !== void 0) reasons.push(`execution aborted: ${executed.aborted}`);
263
+ if (reasons.length === 0) reasons.push("the review plan contained nothing executable");
264
+ let text = `💾 Self-improvement review: 0 ops landed. ${reasons.join(" ")}`;
265
+ if (text.length > 500) text = `${text.slice(0, 497)}…`;
266
+ agent.inject(createUserMessage({
267
+ content: [{
268
+ type: "text",
269
+ text
270
+ }],
271
+ source: {
272
+ kind: "plugin",
273
+ plugin: "dsh-evolution-review",
274
+ form: "notice",
275
+ summary: "self-improvement review"
276
+ }
277
+ }));
278
+ } catch (injectError) {
279
+ ctx.logger.warn(`dsh-evolution-review: zero-landing notice inject failed: ${injectError instanceof Error ? injectError.message : String(injectError)}`);
253
280
  }
254
281
  try {
255
282
  ctx.emit("evolution/plan-applied", {
@@ -502,7 +529,7 @@ function filterUnreadSkillOps(ops, readNames) {
502
529
  for (let index = ops.length - 1; index >= 0; index -= 1) {
503
530
  const op = ops[index];
504
531
  if (!op) continue;
505
- if (op.action !== void 0 && READ_REQUIRED.includes(op.action) && op.name && !readNames.has(op.name)) {
532
+ if (op.name && READ_REQUIRED.includes(op.action ?? "patch") && !readNames.has(op.name)) {
506
533
  ops.splice(index, 1);
507
534
  dropped += 1;
508
535
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-review",
3
3
  "description": "Background review orchestration (community build)",
4
- "version": "0.3.35",
4
+ "version": "0.3.37",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -31,9 +31,9 @@
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
33
  "@deepseek-ai/schemastery": "^3.18.1",
34
- "@lmzhen/dsh-evolution-approval": "^0.3.35",
35
- "@lmzhen/dsh-evolution-core": "^0.3.35",
36
- "@lmzhen/dsh-evolution-plan-validator": "^0.3.35"
34
+ "@lmzhen/dsh-evolution-approval": "^0.3.37",
35
+ "@lmzhen/dsh-evolution-core": "^0.3.37",
36
+ "@lmzhen/dsh-evolution-plan-validator": "^0.3.37"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@deepseek-ai/cordis": "^4.0.1",
@@ -42,8 +42,8 @@
42
42
  "@deepseek-ai/dsh-llm": "^0.1.1-rc.2",
43
43
  "@deepseek-ai/dsh-session": "^0.1.1-rc.2",
44
44
  "@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
45
- "@lmzhen/dsh-evolution-state": "^0.3.35",
46
- "@lmzhen/dsh-evolution-policy": "^0.3.35"
45
+ "@lmzhen/dsh-evolution-state": "^0.3.37",
46
+ "@lmzhen/dsh-evolution-policy": "^0.3.37"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@deepseek-ai/dsh-agent": "^0.1.1-rc.2",
@@ -54,9 +54,9 @@
54
54
  "@deepseek-ai/dsh-session-persistence": "^0.1.1-rc.2",
55
55
  "@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.1-rc.2",
56
56
  "@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
57
- "@lmzhen/dsh-evolution-approval": "^0.3.35",
58
- "@lmzhen/dsh-evolution-core": "^0.3.35",
59
- "@lmzhen/dsh-evolution-plan-validator": "^0.3.35",
60
- "@lmzhen/dsh-evolution-state": "^0.3.35"
57
+ "@lmzhen/dsh-evolution-approval": "^0.3.37",
58
+ "@lmzhen/dsh-evolution-core": "^0.3.37",
59
+ "@lmzhen/dsh-evolution-plan-validator": "^0.3.37",
60
+ "@lmzhen/dsh-evolution-state": "^0.3.37"
61
61
  }
62
62
  }