@lmzhen/dsh-evolution-learning-graph 0.3.65 → 0.3.66

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 +6 -4
  2. package/package.json +3 -3
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { effectiveSessionPolicy } from "@lmzhen/dsh-evolution-approval";
2
2
  import z from "@deepseek-ai/schemastery";
3
- import { SKILL_NAME_RE, SkillLibrary, evolutionIoAdapter, relatedSkillNames, resolveOrigins, resolveSkillsRoot } from "@lmzhen/dsh-evolution-core";
3
+ import { SKILL_NAME_RE, SkillLibrary, contentHash, evolutionIoAdapter, relatedSkillNames, resolveOrigins, resolveSkillsRoot } from "@lmzhen/dsh-evolution-core";
4
4
  //#region lib/types/index.js
5
5
  /**
6
6
  * Learning graph over skills and memory, plus node-level commands
@@ -297,6 +297,7 @@ function apply(ctx, rawConfig = {}) {
297
297
  const stagesForeground = approval.stageForeground !== false;
298
298
  if (approval.isEnabled !== false && sessionPolicyEdit !== "never" && (origins.approval === "background_review" || stagesForeground) && !approval.hasRunner("skill")) return err("Graph skill write cannot be staged: no skill replay runner is registered — mount the tool-skill-manage row (evolution-agent preset) or disable evolution-approval.");
299
299
  const sessionPolicy = sessionPolicyEdit;
300
+ const stageCurrent = await withSkills().read(parsed.name).catch(() => null);
300
301
  const decision = await approval.request({
301
302
  kind: "skill",
302
303
  summary: `graph edit ${parsed.name}`,
@@ -304,7 +305,8 @@ function apply(ctx, rawConfig = {}) {
304
305
  operation: {
305
306
  action: "update",
306
307
  name: parsed.name,
307
- content
308
+ content,
309
+ ...stageCurrent !== null ? { staged_from_sha256: contentHash(stageCurrent) } : {}
308
310
  },
309
311
  origin: origins.approval,
310
312
  libraryOrigin: origins.library
@@ -326,7 +328,7 @@ function apply(ctx, rawConfig = {}) {
326
328
  if (memoryApproval) {
327
329
  const originsM = resolveOrigins(session?.header?.origin);
328
330
  const sessionPolicyM = effectiveSessionPolicy(ctx, session);
329
- if (memoryApproval.isEnabled !== false && sessionPolicyM !== "never" && (originsM.approval === "background_review" || memoryApproval.stageForeground !== false) && !memoryApproval.hasRunner("memory")) return err("Graph memory write cannot be staged: no memory replay runner is registered — mount the tool-memory row (evolution-host/evolution-all bundle) or disable evolution-approval.");
331
+ if (memoryApproval.isEnabled !== false && sessionPolicyM !== "never" && (originsM.approval === "background_review" || memoryApproval.stageForeground !== false) && !memoryApproval.hasRunner("memory")) return err("Graph memory write cannot be staged: no memory replay runner is registered — mount the tool-memory row (evolution-all bundle, or the evolution-preset overlay; the host bundle does not carry it) or disable evolution-approval.");
330
332
  const decision = await memoryApproval.request({
331
333
  kind: "memory",
332
334
  summary: `graph edit memory:${parsed.source}:${parsed.index}`,
@@ -389,7 +391,7 @@ function apply(ctx, rawConfig = {}) {
389
391
  if (memoryApproval) {
390
392
  const origins = resolveOrigins(session?.header?.origin);
391
393
  const sessionPolicy = effectiveSessionPolicy(ctx, session);
392
- if (memoryApproval.isEnabled !== false && sessionPolicy !== "never" && (origins.approval === "background_review" || memoryApproval.stageForeground !== false) && !memoryApproval.hasRunner("memory")) return err("Graph memory delete cannot be staged: no memory replay runner is registered — mount the tool-memory row (evolution-host/evolution-all bundle) or disable evolution-approval.");
394
+ if (memoryApproval.isEnabled !== false && sessionPolicy !== "never" && (origins.approval === "background_review" || memoryApproval.stageForeground !== false) && !memoryApproval.hasRunner("memory")) return err("Graph memory delete cannot be staged: no memory replay runner is registered — mount the tool-memory row (evolution-all bundle, or the evolution-preset overlay; the host bundle does not carry it) or disable evolution-approval.");
393
395
  const decision = await memoryApproval.request({
394
396
  kind: "memory",
395
397
  summary: `graph delete memory:${parsed.source}:${parsed.index}`,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-learning-graph",
3
3
  "description": "Learning graph over skills and memory (community build)",
4
- "version": "0.3.65",
4
+ "version": "0.3.66",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -31,8 +31,8 @@
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
33
  "@deepseek-ai/schemastery": "^3.18.1",
34
- "@lmzhen/dsh-evolution-approval": "^0.3.65",
35
- "@lmzhen/dsh-evolution-core": "^0.3.65"
34
+ "@lmzhen/dsh-evolution-approval": "^0.3.66",
35
+ "@lmzhen/dsh-evolution-core": "^0.3.66"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",