@lmzhen/dsh-evolution-curator 0.1.0-rc.4 → 0.1.0-rc.6
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 +8 -1
- package/lib/index.js +36 -0
- package/lib/types/index.d.ts +12 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -21,4 +21,11 @@ Independent of request-prefix construction. This package does not alter the asse
|
|
|
21
21
|
## Known Limitations and Deferred Work
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
-
|
|
24
|
+
- LLM nomination pass is advisory and disabled by default; deterministic lifecycle remains authoritative.
|
|
25
|
+
- Consolidation is control-plane only (`/evolution consolidate <target> <source...>`): no LLM pass proposes merge groups yet, and merged source bodies are appended verbatim rather than rewritten into a synthesized skill.
|
|
26
|
+
|
|
27
|
+
## Recovery and consolidation
|
|
28
|
+
|
|
29
|
+
- `archive` never deletes: skills move to `.archive/` with a `.archive-reason` marker.
|
|
30
|
+
- `restore(name)` (service) / `/evolution skill restore <name>` brings one archived skill back to the active root and resets its usage state.
|
|
31
|
+
- `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 skill tree first (`pre-consolidate` / `pre-restore`).
|
package/lib/index.js
CHANGED
|
@@ -247,6 +247,42 @@ var EvolutionCurator = class extends Service {
|
|
|
247
247
|
return null;
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* Control-plane consolidation: merge source skill bodies into `target`,
|
|
252
|
+
* archive the sources with an absorbed-into marker, and fold their usage
|
|
253
|
+
* records into `archived` state. Snapshot-then-mutate, never a hard delete.
|
|
254
|
+
*/
|
|
255
|
+
async consolidate(target, sources) {
|
|
256
|
+
const blocked = [...this.excludeSkillNames].filter((name) => name === target || sources.includes(name));
|
|
257
|
+
if (blocked.length > 0) return {
|
|
258
|
+
ok: false,
|
|
259
|
+
message: `Skill(s) excluded from lifecycle management: ${blocked.join(", ")}`
|
|
260
|
+
};
|
|
261
|
+
await this.skills.snapshotAll("pre-consolidate");
|
|
262
|
+
const result = await this.skills.consolidate(target, sources);
|
|
263
|
+
if (!result.ok) return result;
|
|
264
|
+
const usage = await loadUsage(this.skills.root, this.io);
|
|
265
|
+
for (const source of sources) {
|
|
266
|
+
const record = usage.get(source);
|
|
267
|
+
if (record) record.state = "archived";
|
|
268
|
+
}
|
|
269
|
+
await saveUsage(this.skills.root, usage, this.io);
|
|
270
|
+
return result;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Control-plane restore: bring one archived skill back to the active root
|
|
274
|
+
* and reset its usage state, keeping the recoverable-archive invariant.
|
|
275
|
+
*/
|
|
276
|
+
async restore(name) {
|
|
277
|
+
await this.skills.snapshotAll("pre-restore");
|
|
278
|
+
const result = await this.skills.restoreFromArchive(name);
|
|
279
|
+
if (!result.ok) return result;
|
|
280
|
+
const usage = await loadUsage(this.skills.root, this.io);
|
|
281
|
+
const record = usage.get(name);
|
|
282
|
+
if (record) record.state = "active";
|
|
283
|
+
await saveUsage(this.skills.root, usage, this.io);
|
|
284
|
+
return result;
|
|
285
|
+
}
|
|
250
286
|
};
|
|
251
287
|
//#endregion
|
|
252
288
|
export { EvolutionCurator, EvolutionCurator as default };
|
package/lib/types/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Context, Service } from '@deepseek-ai/cordis';
|
|
6
6
|
import type Schema from '@deepseek-ai/schemastery';
|
|
7
7
|
import { SkillLibrary } from '@deepseek-ai/dsh-evolution-core';
|
|
8
|
-
import { type CuratorRunReport } from '@deepseek-ai/dsh-evolution-core';
|
|
8
|
+
import { type CuratorRunReport, type SkillActionResult } from '@deepseek-ai/dsh-evolution-core';
|
|
9
9
|
declare module '@deepseek-ai/cordis' {
|
|
10
10
|
interface Context {
|
|
11
11
|
evolutionCurator: EvolutionCurator;
|
|
@@ -69,6 +69,17 @@ export declare class EvolutionCurator extends Service {
|
|
|
69
69
|
}>;
|
|
70
70
|
private recentSessionActive;
|
|
71
71
|
latestReport(): Promise<CuratorRunReport | null>;
|
|
72
|
+
/**
|
|
73
|
+
* Control-plane consolidation: merge source skill bodies into `target`,
|
|
74
|
+
* archive the sources with an absorbed-into marker, and fold their usage
|
|
75
|
+
* records into `archived` state. Snapshot-then-mutate, never a hard delete.
|
|
76
|
+
*/
|
|
77
|
+
consolidate(target: string, sources: string[]): Promise<SkillActionResult>;
|
|
78
|
+
/**
|
|
79
|
+
* Control-plane restore: bring one archived skill back to the active root
|
|
80
|
+
* and reset its usage state, keeping the recoverable-archive invariant.
|
|
81
|
+
*/
|
|
82
|
+
restore(name: string): Promise<SkillActionResult>;
|
|
72
83
|
}
|
|
73
84
|
export default EvolutionCurator;
|
|
74
85
|
//# sourceMappingURL=index.d.ts.map
|
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.6",
|
|
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.6"
|
|
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.6",
|
|
43
|
+
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.6"
|
|
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.6",
|
|
49
|
+
"@lmzhen/dsh-evolution-io": "^0.1.0-rc.6",
|
|
50
|
+
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.6"
|
|
51
51
|
}
|
|
52
52
|
}
|