@lmzhen/dsh-evolution-learning-graph 0.3.74 → 0.3.77

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
@@ -30,3 +30,5 @@ Independent of request-prefix construction. This package does not alter the asse
30
30
 
31
31
  - The memory drift snapshot covers only the node label (first line, first 80 chars): a change confined to a later line of the same entry is not detected, because the rendered node label is the comparison anchor.
32
32
  - A hand-typed bare `memory:<source>:<index>` id has no snapshot and skips the drift check (legacy path; the rendered ids always carry the snapshot).
33
+
34
+ **Runtime invariant:** No companion is published. The platform auto-assembles nothing and the family mounts no `<pkg>/invariant` cordis row, so a companion here would never execute (v37 S2.1 / I-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, contentHash, evolutionIoAdapter, relatedSkillNames, resolveOrigins, resolveSkillsRoot } from "@lmzhen/dsh-evolution-core";
3
+ import { SKILL_NAME_RE, contentHash, evolutionIoAdapter, newSkillLibrary, relatedSkillNames, resolveOrigins } 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
@@ -220,7 +220,6 @@ function capRenderedLines(lines) {
220
220
  return [...lines.slice(0, 200), `…${lines.length - 200} more`].join("\n");
221
221
  }
222
222
  function apply(ctx, rawConfig = {}) {
223
- const graphSkillsRoot = resolveSkillsRoot(rawConfig);
224
223
  ctx.inject(["commands"], (commandCtx) => {
225
224
  const commands = commandCtx.commands;
226
225
  const graphCommand = {
@@ -301,9 +300,12 @@ function apply(ctx, rawConfig = {}) {
301
300
  return nodeBlock + "\n\n" + edgeBlock + densityLine;
302
301
  }
303
302
  function withSkills() {
304
- return new SkillLibrary(graphSkillsRoot, evolutionIoAdapter(() => io.provider()), void 0, (event) => {
305
- ctx.emit("evolution/skill-mutated", event);
306
- }, void 0, [...rawConfig.threatExemptLabels ?? []]);
303
+ return newSkillLibrary({
304
+ config: rawConfig,
305
+ io: evolutionIoAdapter(() => io.provider()),
306
+ ctx,
307
+ threatExemptLabels: rawConfig.threatExemptLabels
308
+ });
307
309
  }
308
310
  async function nodeDetail(id) {
309
311
  const parsed = parseGraphNodeId(id);
@@ -325,7 +327,7 @@ function apply(ctx, rawConfig = {}) {
325
327
  const stagesForeground = approval.stageForeground !== false;
326
328
  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.");
327
329
  const sessionPolicy = sessionPolicyEdit;
328
- const stageCurrent = await withSkills().read(parsed.name).catch(() => null);
330
+ const stageCurrent = await withSkills().read(parsed.name).catch(() => void 0);
329
331
  const decision = await approval.request({
330
332
  kind: "skill",
331
333
  summary: `graph edit ${parsed.name}`,
@@ -334,7 +336,7 @@ function apply(ctx, rawConfig = {}) {
334
336
  action: "update",
335
337
  name: parsed.name,
336
338
  content,
337
- ...stageCurrent !== null ? { staged_from_sha256: contentHash(stageCurrent) } : {}
339
+ staged_from_sha256: typeof stageCurrent === "string" ? contentHash(stageCurrent) : "absent"
338
340
  },
339
341
  origin: origins.approval,
340
342
  libraryOrigin: origins.library
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.74",
4
+ "version": "0.3.77",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -18,10 +18,6 @@
18
18
  "types": "./lib/types/index.d.ts",
19
19
  "default": "./lib/index.js"
20
20
  },
21
- "./invariant": {
22
- "types": "./lib/types/invariant.d.ts",
23
- "default": "./lib/invariant.js"
24
- },
25
21
  "./package.json": "./package.json"
26
22
  },
27
23
  "files": [
@@ -31,16 +27,14 @@
31
27
  "license": "MIT",
32
28
  "dependencies": {
33
29
  "@deepseek-ai/schemastery": "^3.18.1",
34
- "@lmzhen/dsh-evolution-approval": "^0.3.74",
35
- "@lmzhen/dsh-evolution-core": "^0.3.74"
30
+ "@lmzhen/dsh-evolution-approval": "^0.3.77",
31
+ "@lmzhen/dsh-evolution-core": "^0.3.77"
36
32
  },
37
33
  "peerDependencies": {
38
34
  "@deepseek-ai/dsh-commands": "^0.1.5-rc.2",
39
- "@deepseek-ai/dsh-invariants": "^0.1.5-rc.2",
40
35
  "@deepseek-ai/cordis": "^4.0.1"
41
36
  },
42
37
  "devDependencies": {
43
- "@deepseek-ai/dsh-commands": "^0.1.5-rc.2",
44
- "@deepseek-ai/dsh-invariants": "^0.1.5-rc.2"
38
+ "@deepseek-ai/dsh-commands": "^0.1.5-rc.2"
45
39
  }
46
40
  }
package/lib/invariant.js DELETED
@@ -1,8 +0,0 @@
1
- //#region lib/types/invariant.js
2
- const PACKAGE_NAME = "@lmzhen/dsh-evolution-learning-graph";
3
- const name = "evolution-learning-graph-invariant";
4
- const inject = ["invariants"];
5
- const install = () => {};
6
- const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
7
- //#endregion
8
- export { apply, inject, name };
@@ -1,5 +0,0 @@
1
- import type { Context } from '@deepseek-ai/cordis';
2
- export declare const name = "evolution-learning-graph-invariant";
3
- export declare const inject: string[];
4
- export declare const apply: (ctx: Context) => Promise<() => void>;
5
- //# sourceMappingURL=invariant.d.ts.map