@lmzhen/dsh-evolution-curator 0.1.0-rc.15 → 0.1.0-rc.17

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 +20 -3
  2. package/package.json +7 -7
package/lib/index.js CHANGED
@@ -3,7 +3,7 @@ import { randomUUID } from "node:crypto";
3
3
  import { join } from "node:path";
4
4
  import { BlockAssembler, createUserMessage } from "@deepseek-ai/dsh-llm";
5
5
  import z from "@deepseek-ai/schemastery";
6
- import { CURATOR_DRY_RUN_BANNER, CURATOR_PROMPT, DEFAULT_ARCHIVE_AFTER_DAYS, DEFAULT_CURATOR_INTERVAL_HOURS, DEFAULT_MIN_IDLE_HOURS, DEFAULT_STALE_AFTER_DAYS, SkillLibrary, buildCuratorRunReport, computeLifecycleTransitions, emptyRecord, evolutionHome, evolutionIoAdapter, loadSuppressedNames, loadUsage, parseCuratorNominations, saveSuppressedNames, saveUsage } from "@lmzhen/dsh-evolution-core";
6
+ import { CURATOR_DRY_RUN_BANNER, CURATOR_PROMPT, DEFAULT_ARCHIVE_AFTER_DAYS, DEFAULT_CURATOR_INTERVAL_HOURS, DEFAULT_MIN_IDLE_HOURS, DEFAULT_STALE_AFTER_DAYS, SkillLibrary, buildCuratorRunReport, computeLifecycleTransitions, computeQualityScores, emptyRecord, evolutionHome, evolutionIoAdapter, loadSuppressedNames, loadUsage, parseCuratorNominations, saveSuppressedNames, saveUsage } from "@lmzhen/dsh-evolution-core";
7
7
  //#region lib/types/index.js
8
8
  /**
9
9
  * Deterministic skill lifecycle curator with interval gate and archive.
@@ -197,6 +197,19 @@ var EvolutionCurator = class extends Service {
197
197
  suppressedNames,
198
198
  referencedSkillNames: this.referencedSkillNames
199
199
  });
200
+ const supportDirs = /* @__PURE__ */ new Map();
201
+ for (const name of treeNames) supportDirs.set(name, await this.skills.countSupportDirs(name));
202
+ const quality = computeQualityScores({
203
+ usage,
204
+ supportDirs
205
+ });
206
+ for (const [name, score] of quality) {
207
+ const record = usage.get(name);
208
+ if (record) {
209
+ record.quality_score = score.score;
210
+ record.quality_warn = score.warn;
211
+ }
212
+ }
200
213
  const errors = [];
201
214
  const archivedSkills = [];
202
215
  const nominations = this.llmReview ? await this.recommend(result.markStale, { dryRun }) : {
@@ -257,7 +270,11 @@ var EvolutionCurator = class extends Service {
257
270
  } catch {
258
271
  this.ctx.logger.warn("evolution-curator: failed to persist suppressed names; archived built-ins may re-enter the lifecycle");
259
272
  }
260
- await saveUsage(root, usage, this.io);
273
+ try {
274
+ await saveUsage(root, usage, this.io);
275
+ } catch {
276
+ this.ctx.logger.warn("evolution-curator: failed to persist usage sidecar");
277
+ }
261
278
  }
262
279
  if (!dryRun) this.lastRun = Date.now();
263
280
  const report = buildCuratorRunReport({
@@ -268,7 +285,7 @@ var EvolutionCurator = class extends Service {
268
285
  llmNominations,
269
286
  archiveCandidates,
270
287
  archived: archivedSkills,
271
- failed: archiveCandidates.filter((name) => errors.some((error) => error.startsWith(`${name}:`))).map((name) => {
288
+ failed: [...new Set([...archiveCandidates, ...nominations.consolidations.map((item) => item.from)])].filter((name) => errors.some((error) => error.startsWith(`${name}:`))).map((name) => {
272
289
  return {
273
290
  name,
274
291
  reason: errors.find((item) => item.startsWith(`${name}:`))?.slice(name.length + 2) ?? "unknown"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-curator",
3
3
  "description": "Deterministic skill lifecycle and recovery (community build)",
4
- "version": "0.1.0-rc.15",
4
+ "version": "0.1.0-rc.17",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -33,20 +33,20 @@
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
35
  "@deepseek-ai/schemastery": "^3.18.1",
36
- "@lmzhen/dsh-evolution-core": "^0.1.0-rc.15"
36
+ "@lmzhen/dsh-evolution-core": "^0.1.0-rc.17"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@deepseek-ai/cordis": "^4.0.1",
40
40
  "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
41
41
  "@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
42
- "@lmzhen/dsh-evolution-io": "^0.1.0-rc.15",
43
- "@lmzhen/dsh-evolution-state": "^0.1.0-rc.15"
42
+ "@lmzhen/dsh-evolution-io": "^0.1.0-rc.17",
43
+ "@lmzhen/dsh-evolution-state": "^0.1.0-rc.17"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
47
47
  "@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
48
- "@lmzhen/dsh-evolution-core": "^0.1.0-rc.15",
49
- "@lmzhen/dsh-evolution-io": "^0.1.0-rc.15",
50
- "@lmzhen/dsh-evolution-state": "^0.1.0-rc.15"
48
+ "@lmzhen/dsh-evolution-core": "^0.1.0-rc.17",
49
+ "@lmzhen/dsh-evolution-io": "^0.1.0-rc.17",
50
+ "@lmzhen/dsh-evolution-state": "^0.1.0-rc.17"
51
51
  }
52
52
  }