@lmzhen/dsh-evolution-curator 0.3.70 → 0.3.72

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 +23 -11
  2. package/package.json +7 -7
package/lib/index.js CHANGED
@@ -179,7 +179,7 @@ var EvolutionCurator = class extends Service {
179
179
  async setPaused(paused) {
180
180
  const stateService = this.curatorStateService();
181
181
  if (!stateService) {
182
- this.ctx.logger.warn("evolution-curator: curator state service absent; pause not persisted");
182
+ this.ctx.logger.warn("evolution-curator: curator state service absent pause NOT effective (not persisted, and this process keeps auto-running; mount the evolution-state stack to pause)");
183
183
  return;
184
184
  }
185
185
  await stateService.transactCuratorState((current) => ({
@@ -512,7 +512,7 @@ var EvolutionCurator = class extends Service {
512
512
  }
513
513
  const protectedNames = await this.protectedNameMap();
514
514
  const dedupMembers = [...new Set(computeDedupGroups({ contents }).filter((group) => group.length >= 2).flat())].filter((name) => !protectedNames.has(name));
515
- await this.scoreTree(usage, treeNames);
515
+ await this.scoreTree(usage, treeNames, contents);
516
516
  const result = computeLifecycleTransitions(usage, {
517
517
  staleAfterDays: lifecycle.staleAfterDays,
518
518
  archiveAfterDays: lifecycle.archiveAfterDays,
@@ -554,6 +554,22 @@ var EvolutionCurator = class extends Service {
554
554
  };
555
555
  }
556
556
  const snapshotPath = dryRun ? void 0 : await this.snapshotFull("pre-curator-run");
557
+ if (!ignoreGates && this.minIdleHours > 0 && this.recentSessionActive()) {
558
+ if (!dryRun) try {
559
+ await mutateUsage(root, this.io, (map) => {
560
+ for (const [name, record] of usage) if (!map.has(name)) map.set(name, { ...record });
561
+ });
562
+ } catch (error) {
563
+ this.ctx.logger.warn(`evolution-curator: failed to persist the seeded usage baseline on a session-blocked run (${error instanceof Error ? error.message : String(error)})`);
564
+ }
565
+ return {
566
+ stale: [],
567
+ archived: [],
568
+ errors: [],
569
+ report: this.skippedReport(runId, startedAt),
570
+ skipped: "active-session"
571
+ };
572
+ }
557
573
  const { archivedSkills, errors, consolidated } = await this.applyMutations({
558
574
  dryRun,
559
575
  archiveCandidates,
@@ -611,7 +627,7 @@ var EvolutionCurator = class extends Service {
611
627
  this.ctx.logger.warn(error);
612
628
  }
613
629
  const llmHint = !this.llmReview && result.markStale.length > 0 ? " (llmReview: off - deterministic archive only; set llmReview: true for the LLM merge channel)" : "";
614
- const summary = `${dryRun ? "dry-run" : "auto"}: stale:${result.markStale.length} archived:${archivedSkills.length} consolidated:${gatedNominations.consolidations.length}${llmHint}`;
630
+ const summary = `${dryRun ? "dry-run" : "auto"}: stale:${result.markStale.length} archived:${archivedSkills.length} consolidated:${consolidated.length}${llmHint}`;
615
631
  try {
616
632
  await stateService?.transactCuratorState((current) => {
617
633
  const pausedNow = current?.paused ?? false;
@@ -670,13 +686,13 @@ var EvolutionCurator = class extends Service {
670
686
  * flags, so overwriting feedback here is what used to make negative
671
687
  * feedback decision-irrelevant; field ownership on `UsageRecord`).
672
688
  */
673
- async scoreTree(usage, treeNames) {
689
+ async scoreTree(usage, treeNames, contents) {
674
690
  const supportDirs = /* @__PURE__ */ new Map();
675
691
  for (const name of treeNames) supportDirs.set(name, await this.skills.countSupportDirs(name));
676
692
  const quality = computeQualityScores({
677
693
  usage,
678
694
  supportDirs,
679
- referenceCounts: await this.referenceCounts(treeNames)
695
+ referenceCounts: this.referenceCounts(contents)
680
696
  });
681
697
  for (const [name, score] of quality) {
682
698
  const record = usage.get(name);
@@ -692,13 +708,9 @@ var EvolutionCurator = class extends Service {
692
708
  * other skill names counts as one reference to each of them, so hub skills
693
709
  * that are explicitly named by peers get a non-zero references factor.
694
710
  */
695
- async referenceCounts(treeNames) {
711
+ referenceCounts(contents) {
696
712
  const counts = /* @__PURE__ */ new Map();
697
- for (const name of treeNames) {
698
- const content = await this.skills.read(name);
699
- if (!content) continue;
700
- for (const target of relatedSkillNames(content, name)) counts.set(target, (counts.get(target) ?? 0) + 1);
701
- }
713
+ for (const [name, content] of contents) for (const target of relatedSkillNames(content, name)) counts.set(target, (counts.get(target) ?? 0) + 1);
702
714
  return counts;
703
715
  }
704
716
  /**
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.70",
4
+ "version": "0.3.72",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -31,22 +31,22 @@
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
33
  "@deepseek-ai/schemastery": "^3.18.1",
34
- "@lmzhen/dsh-evolution-core": "^0.3.70"
34
+ "@lmzhen/dsh-evolution-core": "^0.3.72"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@deepseek-ai/cordis": "^4.0.1",
38
38
  "@deepseek-ai/dsh-invariants": "^0.1.5-rc.2",
39
39
  "@deepseek-ai/dsh-llm": "^0.1.5-rc.2",
40
40
  "@deepseek-ai/dsh-session": "^0.1.5-rc.2",
41
- "@lmzhen/dsh-evolution-io": "^0.3.70",
42
- "@lmzhen/dsh-evolution-state": "^0.3.70"
41
+ "@lmzhen/dsh-evolution-io": "^0.3.72",
42
+ "@lmzhen/dsh-evolution-state": "^0.3.72"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@deepseek-ai/dsh-invariants": "^0.1.5-rc.2",
46
46
  "@deepseek-ai/dsh-llm": "^0.1.5-rc.2",
47
47
  "@deepseek-ai/dsh-session": "^0.1.5-rc.2",
48
- "@lmzhen/dsh-evolution-core": "^0.3.70",
49
- "@lmzhen/dsh-evolution-io": "^0.3.70",
50
- "@lmzhen/dsh-evolution-state": "^0.3.70"
48
+ "@lmzhen/dsh-evolution-core": "^0.3.72",
49
+ "@lmzhen/dsh-evolution-io": "^0.3.72",
50
+ "@lmzhen/dsh-evolution-state": "^0.3.72"
51
51
  }
52
52
  }