@lmzhen/dsh-evolution-curator 0.3.66 → 0.3.68

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
@@ -33,7 +33,7 @@ Independent of request-prefix construction. This package does not alter the asse
33
33
  - `archive` never deletes: skills move to `.archive/` with a `.archive-reason` marker.
34
34
  - `restore(name)` (service) / `/evolution skill restore <name>` brings one archived skill back to the active root and resets its usage state.
35
35
  - `consolidate(target, sources)` (service) / `/evolution consolidate` merges source bodies into the target, archives the sources with an absorbed-into marker, and folds their usage records into `archived` state. Both operations snapshot the full state first (`pre-consolidate` / `pre-restore`).
36
- - `restoreSnapshot` (service) / `/evolution restore` rolls the FULL state back to the latest snapshot: active tree, usage/suppression sidecars, `.archive/` and the curator state carried in the snapshot (`curator-state.json`), so the interval gate does not immediately re-fire after a rollback. The restore itself is undoable — the pre-rollback safety snapshot preserves the current tree plus its state.
36
+ - `restoreSnapshot` (service) / `/evolution restore` rolls the state back to the latest snapshot: active tree, usage/suppression sidecars, `.archive/` and the curator state carried in the snapshot (`curator-state.json`), so the interval gate does not immediately re-fire after a rollback. Skills that were skipped at snapshot time (a live writer held their lock; recorded in the manifest's `skipped` list) are NOT restored — the restore result names them, and `.backups` may hold a copy. The restore itself is undoable — the pre-rollback safety snapshot preserves the current tree plus its state.
37
37
 
38
38
  ## Automatic scheduling
39
39
 
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_BOOT_GRACE_SECONDS, DEFAULT_CURATOR_INTERVAL_HOURS, DEFAULT_CURATOR_REVIEW_MAX_TOKENS, DEFAULT_HEALTH_THRESHOLDS, DEFAULT_MIN_IDLE_HOURS, DEFAULT_STALE_AFTER_DAYS, EvolutionGateSet, SKILL_NAME_RE, SkillLibrary, buildCuratorRunReport, clampedNumber, computeDedupGroups, computeLifecycleTransitions, computePrefixClusters, computeQualityScores, computeScopeView, emptyRecord, evolutionHome, evolutionIoAdapter, foldCuratorFields, loadSuppressedNames, loadUsage, markerEntryName, mutateUsage, parseCuratorNominations, parseFrontmatter, relatedSkillNames, renderCuratorReportMarkdown, resolveSkillsRoot, updateSuppressedNames, usageObserved } from "@lmzhen/dsh-evolution-core";
6
+ import { CURATOR_DRY_RUN_BANNER, CURATOR_PROMPT, DEFAULT_ARCHIVE_AFTER_DAYS, DEFAULT_CURATOR_BOOT_GRACE_SECONDS, DEFAULT_CURATOR_INTERVAL_HOURS, DEFAULT_CURATOR_MODEL, DEFAULT_CURATOR_REVIEW_MAX_TOKENS, DEFAULT_HEALTH_THRESHOLDS, DEFAULT_MIN_IDLE_HOURS, DEFAULT_STALE_AFTER_DAYS, EvolutionGateSet, MAX_TIMER_DELAY_MS, SKILL_NAME_RE, SkillLibrary, buildCuratorRunReport, clampedNumber, computeDedupGroups, computeLifecycleTransitions, computePrefixClusters, computeQualityScores, computeScopeView, emptyRecord, evolutionHome, evolutionIoAdapter, foldCuratorFields, loadSuppressedNames, loadUsage, markerEntryName, mutateUsage, parseCuratorNominations, parseFrontmatter, relatedSkillNames, renderCuratorReportMarkdown, resolveSkillsRoot, 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.
@@ -17,7 +17,6 @@ const DEFAULT_QUALITY_WARN_STALE_AFTER_DAYS = 7;
17
17
  * 120s matches the review subagent default; the 32-bit ceiling is Node's
18
18
  * timer-delay limit (`AbortSignal.timeout` throws above it). */
19
19
  const DEFAULT_CURATOR_REVIEW_TIMEOUT_MS = 12e4;
20
- const MAX_TIMER_DELAY_MS = 2147483647;
21
20
  /**
22
21
  * Block LLM-nominated consolidations that would touch a gate-protected name:
23
22
  * exclude / referenced / suppressed skills must never merge (neither as the
@@ -255,7 +254,7 @@ var EvolutionCurator = class extends Service {
255
254
  if (candidates.length === 0) return empty;
256
255
  const llm = this.ctx.get("llm");
257
256
  if (!llm) return empty;
258
- const model = this.ctx.get("evolutionPolicy")?.get()?.curatorModel ?? "deepseek-v4-pro";
257
+ const model = this.ctx.get("evolutionPolicy")?.get()?.curatorModel ?? DEFAULT_CURATOR_MODEL;
259
258
  const clusters = computePrefixClusters(candidates);
260
259
  const clusterLines = clusters.length === 0 ? ["Prefix clusters observed in the candidate list: (none)"] : ["Prefix clusters observed in the candidate list (orientation only — verify against the names above; you may also flag additional clusters):", ...clusters.map((cluster) => `- '${cluster.key}': ${cluster.members.join(", ")}`)];
261
260
  const prompt = [
@@ -566,6 +565,15 @@ var EvolutionCurator = class extends Service {
566
565
  reason: errors.find((item) => item.startsWith(`${name}:`))?.slice(name.length + 2) ?? "unknown"
567
566
  };
568
567
  }),
568
+ ...(() => {
569
+ const attributed = new Set([...archiveCandidates, ...gatedNominations.consolidations.map((item) => item.from)]);
570
+ const loose = errors.filter((error) => ![...attributed].some((name) => error.startsWith(`${name}:`)));
571
+ const abort = loose.find((error) => error.startsWith("run aborted"));
572
+ return {
573
+ ...abort === void 0 ? {} : { aborted: abort.slice(13) },
574
+ ...loose.length === 0 ? {} : { unattributed: loose }
575
+ };
576
+ })(),
569
577
  consolidated,
570
578
  ...snapshotPath === void 0 ? {} : { snapshotPath },
571
579
  llmReviewEnabled: this.llmReview,
@@ -815,12 +823,6 @@ var EvolutionCurator = class extends Service {
815
823
  } catch {
816
824
  this.ctx.logger.warn("evolution-curator: failed to persist usage sidecar");
817
825
  }
818
- const usageRegistry = this.ctx.get("skillUsage");
819
- try {
820
- await usageRegistry?.invalidate?.();
821
- } catch (error) {
822
- this.ctx.logger.warn(`evolution-curator: skillUsage cache invalidate failed after curation: ${error instanceof Error ? error.message : String(error)}`);
823
- }
824
826
  return {
825
827
  archivedSkills,
826
828
  errors,
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.66",
4
+ "version": "0.3.68",
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.66"
34
+ "@lmzhen/dsh-evolution-core": "^0.3.68"
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.66",
41
- "@lmzhen/dsh-evolution-state": "^0.3.66"
40
+ "@lmzhen/dsh-evolution-io": "^0.3.68",
41
+ "@lmzhen/dsh-evolution-state": "^0.3.68"
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.66",
47
- "@lmzhen/dsh-evolution-io": "^0.3.66",
48
- "@lmzhen/dsh-evolution-state": "^0.3.66"
46
+ "@lmzhen/dsh-evolution-core": "^0.3.68",
47
+ "@lmzhen/dsh-evolution-io": "^0.3.68",
48
+ "@lmzhen/dsh-evolution-state": "^0.3.68"
49
49
  }
50
50
  }