@lmzhen/dsh-evolution-curator 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 +16 -7
  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_HEALTH_THRESHOLDS, DEFAULT_MIN_IDLE_HOURS, DEFAULT_STALE_AFTER_DAYS, EvolutionGateSet, SkillLibrary, buildCuratorRunReport, clampedNumber, computeDedupGroups, computeLifecycleTransitions, computePrefixClusters, computeQualityScores, computeScopeView, emptyRecord, evolutionHome, evolutionIoAdapter, foldCuratorFields, loadSuppressedNames, loadUsage, markerEntryName, mutateUsage, parseCuratorNominations, relatedSkillNames, renderCuratorReportMarkdown, updateSuppressedNames, usageObserved } from "@lmzhen/dsh-evolution-core";
6
+ import { CURATOR_DRY_RUN_BANNER, CURATOR_PROMPT, DEFAULT_ARCHIVE_AFTER_DAYS, DEFAULT_CURATOR_INTERVAL_HOURS, DEFAULT_HEALTH_THRESHOLDS, DEFAULT_MIN_IDLE_HOURS, DEFAULT_STALE_AFTER_DAYS, EvolutionGateSet, SkillLibrary, buildCuratorRunReport, clampedNumber, computeDedupGroups, computeLifecycleTransitions, computePrefixClusters, computeQualityScores, computeScopeView, emptyRecord, evolutionHome, evolutionIoAdapter, foldCuratorFields, loadSuppressedNames, loadUsage, markerEntryName, mutateUsage, parseCuratorNominations, parseFrontmatter, relatedSkillNames, renderCuratorReportMarkdown, updateSuppressedNames, usageObserved } 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.
@@ -201,7 +201,8 @@ var EvolutionCurator = class extends Service {
201
201
  async recommend(candidates, options = {}) {
202
202
  const empty = {
203
203
  prunings: [],
204
- consolidations: []
204
+ consolidations: [],
205
+ warnings: []
205
206
  };
206
207
  if (candidates.length === 0) return empty;
207
208
  const llm = this.ctx.get("llm");
@@ -242,7 +243,8 @@ var EvolutionCurator = class extends Service {
242
243
  const parsed = parseCuratorNominations(assembler.blocks().filter((block) => block.type === "text").map((block) => block.text).join("\n"));
243
244
  return {
244
245
  prunings: parsed.prunings.filter((name) => candidates.includes(name)),
245
- consolidations: parsed.consolidations.filter((item) => candidates.includes(item.from))
246
+ consolidations: parsed.consolidations.filter((item) => candidates.includes(item.from)),
247
+ warnings: parsed.warnings
246
248
  };
247
249
  } catch (error) {
248
250
  this.ctx.logger.warn(`evolution-curator: LLM nomination pass failed: ${error instanceof Error ? error.message : String(error)}`);
@@ -412,7 +414,8 @@ var EvolutionCurator = class extends Service {
412
414
  const recommendPool = [...new Set([...result.markStale, ...dedupMembers])];
413
415
  const nominations = this.llmReview ? await this.recommend(recommendPool, { dryRun }) : {
414
416
  prunings: [],
415
- consolidations: []
417
+ consolidations: [],
418
+ warnings: []
416
419
  };
417
420
  const gatedNominations = {
418
421
  ...nominations,
@@ -451,7 +454,8 @@ var EvolutionCurator = class extends Service {
451
454
  }),
452
455
  consolidated,
453
456
  ...snapshotPath === void 0 ? {} : { snapshotPath },
454
- llmReviewEnabled: this.llmReview
457
+ llmReviewEnabled: this.llmReview,
458
+ ...gatedNominations.warnings.length > 0 ? { nominationsWarnings: gatedNominations.warnings } : {}
455
459
  });
456
460
  const reportsRoot = join(evolutionHome(), "reports");
457
461
  try {
@@ -567,9 +571,14 @@ var EvolutionCurator = class extends Service {
567
571
  try {
568
572
  wasBundled = await this.io.exists(join(this.skills.root, ".archive", name, markerEntryName("bundled")));
569
573
  if (!wasBundled) {
570
- const archiveEntries = await this.io.list(join(this.skills.root, ".archive")).catch(() => []);
571
- for (const entry of archiveEntries) if (entry.startsWith(`${name}-`)) {
574
+ const archiveEntries = await this.io.list(join(this.skills.root, ".archive"));
575
+ for (const entry of archiveEntries) {
576
+ if (!new RegExp(`^${name}-\\d{14}(-[0-9a-z]{1,6})?$`).test(entry)) continue;
572
577
  wasBundled = await this.io.exists(join(this.skills.root, ".archive", entry, markerEntryName("bundled")));
578
+ if (wasBundled) {
579
+ const archivedBody = await this.io.readText(join(this.skills.root, ".archive", entry, "SKILL.md")).catch(() => null);
580
+ if (archivedBody !== null && parseFrontmatter(archivedBody)?.frontmatter.name !== name) wasBundled = false;
581
+ }
573
582
  if (wasBundled) break;
574
583
  }
575
584
  }
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.3.35",
4
+ "version": "0.3.37",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -31,20 +31,20 @@
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
33
  "@deepseek-ai/schemastery": "^3.18.1",
34
- "@lmzhen/dsh-evolution-core": "^0.3.35"
34
+ "@lmzhen/dsh-evolution-core": "^0.3.37"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@deepseek-ai/cordis": "^4.0.1",
38
38
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
39
39
  "@deepseek-ai/dsh-llm": "^0.1.1-rc.2",
40
- "@lmzhen/dsh-evolution-io": "^0.3.35",
41
- "@lmzhen/dsh-evolution-state": "^0.3.35"
40
+ "@lmzhen/dsh-evolution-io": "^0.3.37",
41
+ "@lmzhen/dsh-evolution-state": "^0.3.37"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
45
45
  "@deepseek-ai/dsh-llm": "^0.1.1-rc.2",
46
- "@lmzhen/dsh-evolution-core": "^0.3.35",
47
- "@lmzhen/dsh-evolution-io": "^0.3.35",
48
- "@lmzhen/dsh-evolution-state": "^0.3.35"
46
+ "@lmzhen/dsh-evolution-core": "^0.3.37",
47
+ "@lmzhen/dsh-evolution-io": "^0.3.37",
48
+ "@lmzhen/dsh-evolution-state": "^0.3.37"
49
49
  }
50
50
  }