@lmzhen/dsh-evolution-curator 0.1.0-rc.43 → 0.1.0-rc.45
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/lib/index.js +8 -12
- package/package.json +7 -7
package/lib/index.js
CHANGED
|
@@ -3,12 +3,14 @@ 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,
|
|
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, computeScopeView, emptyRecord, evolutionHome, evolutionIoAdapter, loadSuppressedNames, loadUsage, parseCuratorNominations, relatedSkillNames, 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.
|
|
10
10
|
* @module @lmzhen/dsh-evolution-curator
|
|
11
11
|
*/
|
|
12
|
+
/** Quality-warned skills may turn stale after this many idle days (package-private tunable, P2-8). */
|
|
13
|
+
const DEFAULT_QUALITY_WARN_STALE_AFTER_DAYS = 7;
|
|
12
14
|
/**
|
|
13
15
|
* Block LLM-nominated consolidations that would touch a gate-protected name:
|
|
14
16
|
* exclude / referenced / suppressed skills must never merge (neither as the
|
|
@@ -28,7 +30,7 @@ var EvolutionCurator = class extends Service {
|
|
|
28
30
|
archiveAfterDays: z.number().default(DEFAULT_ARCHIVE_AFTER_DAYS),
|
|
29
31
|
llmReview: z.boolean().default(false),
|
|
30
32
|
curatorProvider: z.string().default("deepseek-official"),
|
|
31
|
-
qualityWarnStaleAfterDays: z.number().default(
|
|
33
|
+
qualityWarnStaleAfterDays: z.number().default(DEFAULT_QUALITY_WARN_STALE_AFTER_DAYS),
|
|
32
34
|
minIdleHours: z.number().default(DEFAULT_MIN_IDLE_HOURS),
|
|
33
35
|
excludeSkillNames: z.array(z.string()).default([]),
|
|
34
36
|
manageUnmanaged: z.boolean().default(false),
|
|
@@ -68,7 +70,7 @@ var EvolutionCurator = class extends Service {
|
|
|
68
70
|
this.archiveAfterDays = config.archiveAfterDays ?? DEFAULT_ARCHIVE_AFTER_DAYS;
|
|
69
71
|
this.llmReview = config.llmReview ?? false;
|
|
70
72
|
this.curatorProvider = config.curatorProvider ?? "deepseek-official";
|
|
71
|
-
this.qualityWarnStaleAfterDays = config.qualityWarnStaleAfterDays ??
|
|
73
|
+
this.qualityWarnStaleAfterDays = config.qualityWarnStaleAfterDays ?? DEFAULT_QUALITY_WARN_STALE_AFTER_DAYS;
|
|
72
74
|
this.minIdleHours = config.minIdleHours ?? DEFAULT_MIN_IDLE_HOURS;
|
|
73
75
|
this.excludeSkillNames = new Set(config.excludeSkillNames ?? []);
|
|
74
76
|
this.manageUnmanaged = config.manageUnmanaged ?? false;
|
|
@@ -389,12 +391,13 @@ var EvolutionCurator = class extends Service {
|
|
|
389
391
|
}
|
|
390
392
|
const llmHint = !this.llmReview && result.markStale.length > 0 ? " (llmReview: off - deterministic archive only; set llmReview: true for the LLM merge channel)" : "";
|
|
391
393
|
const summary = `${dryRun ? "dry-run" : "auto"}: stale:${result.markStale.length} archived:${archivedSkills.length} consolidated:${gatedNominations.consolidations.length}${llmHint}`;
|
|
394
|
+
const pausedNow = (await stateService?.loadCuratorState())?.paused ?? false;
|
|
392
395
|
await stateService?.saveCuratorState({
|
|
393
396
|
schemaVersion: 1,
|
|
394
397
|
lastRunAt: dryRun ? persisted?.lastRunAt ?? this.lastRun : this.lastRun,
|
|
395
398
|
runCount: dryRun ? persisted?.runCount ?? 0 : (persisted?.runCount ?? 0) + 1,
|
|
396
399
|
lastSummary: summary,
|
|
397
|
-
paused:
|
|
400
|
+
paused: pausedNow
|
|
398
401
|
});
|
|
399
402
|
return {
|
|
400
403
|
stale: result.markStale,
|
|
@@ -455,14 +458,7 @@ var EvolutionCurator = class extends Service {
|
|
|
455
458
|
for (const name of treeNames) {
|
|
456
459
|
const content = await this.skills.read(name);
|
|
457
460
|
if (!content) continue;
|
|
458
|
-
const
|
|
459
|
-
if (!parsed) continue;
|
|
460
|
-
const raw = parsed.frontmatter["related_skills"];
|
|
461
|
-
if (typeof raw !== "string") continue;
|
|
462
|
-
for (const match of Array.from(raw.matchAll(/[a-z0-9][a-z0-9-]*/g))) {
|
|
463
|
-
const target = match[0];
|
|
464
|
-
if (target && SKILL_NAME_RE.test(target) && target !== name) counts.set(target, (counts.get(target) ?? 0) + 1);
|
|
465
|
-
}
|
|
461
|
+
for (const target of relatedSkillNames(content, name)) counts.set(target, (counts.get(target) ?? 0) + 1);
|
|
466
462
|
}
|
|
467
463
|
return counts;
|
|
468
464
|
}
|
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.
|
|
4
|
+
"version": "0.1.0-rc.45",
|
|
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.
|
|
36
|
+
"@lmzhen/dsh-evolution-core": "^0.1.0-rc.45"
|
|
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.
|
|
43
|
-
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.
|
|
42
|
+
"@lmzhen/dsh-evolution-io": "^0.1.0-rc.45",
|
|
43
|
+
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.45"
|
|
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.
|
|
49
|
-
"@lmzhen/dsh-evolution-io": "^0.1.0-rc.
|
|
50
|
-
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.
|
|
48
|
+
"@lmzhen/dsh-evolution-core": "^0.1.0-rc.45",
|
|
49
|
+
"@lmzhen/dsh-evolution-io": "^0.1.0-rc.45",
|
|
50
|
+
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.45"
|
|
51
51
|
}
|
|
52
52
|
}
|