@lmzhen/dsh-evolution-curator 0.10.0 → 0.11.2
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 +12 -4
- package/lib/types/index.d.ts +4 -1
- 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_BOOT_GRACE_SECONDS, DEFAULT_CURATOR_INTERVAL_HOURS, DEFAULT_CURATOR_MODEL, DEFAULT_CURATOR_REVIEW_MAX_TOKENS, DEFAULT_HEALTH_THRESHOLDS, DEFAULT_MIN_IDLE_HOURS, DEFAULT_SKILL_LIMITS, DEFAULT_STALE_AFTER_DAYS, EvolutionGateSet, INSTANCE_KEYS, MAX_TIMER_DELAY_MS, SKILL_NAME_RE, buildCuratorRunReport, claimInstance, clampedNumber, computeDedupGroups, computeLifecycleTransitions, computePrefixClusters, computeQualityScores, computeScopeView, contentHash, emptyRecord, evolutionHome, evolutionIoAdapter, foldCuratorFields, installParamSection, isPresent, isUnknown, loadSuppressedNames, loadUsage, markerEntryName, mutateUsage, newSkillLibrary, paramNamespace, parseCuratorNominations, parseFrontmatter, policyStageLimits, probeList, probeMtime, readNumberParam, relatedSkillNames, releaseInstance, renderCuratorReportMarkdown, transactIo, 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_SKILL_LIMITS, DEFAULT_STALE_AFTER_DAYS, EvolutionGateSet, INSTANCE_KEYS, MAX_TIMER_DELAY_MS, SKILL_NAME_RE, buildCuratorRunReport, claimInstance, clampedNumber, computeDedupGroups, computeLifecycleTransitions, computePrefixClusters, computeQualityScores, computeScopeView, contentHash, emptyRecord, evolutionHome, evolutionIoAdapter, foldCuratorFields, installParamSection, isPresent, isUnknown, loadSuppressedNames, loadUsage, markerEntryName, mutateUsage, newSkillLibrary, paramNamespace, parseCuratorNominations, parseFrontmatter, policyStageLimits, probeList, probeMtime, readNumberParam, relatedSkillNames, releaseInstance, renderCuratorReportMarkdown, transactIo, updateSuppressedNames, usageObserved, versionTarget } 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.
|
|
@@ -1377,6 +1377,11 @@ var EvolutionCurator = class extends Service {
|
|
|
1377
1377
|
message: `Version v${target} of "${name}" is not in the recorded history (recorded: ${listed === "" ? "none" : listed}).`
|
|
1378
1378
|
};
|
|
1379
1379
|
}
|
|
1380
|
+
const entry = versions.find((candidate) => candidate.v === target);
|
|
1381
|
+
if (entry !== void 0 && versionTarget(entry.action) === "support") return {
|
|
1382
|
+
ok: false,
|
|
1383
|
+
message: `Version v${target} of "${name}" was written by '${entry.action}' and holds a SUPPORT FILE's bytes, not this skill's SKILL.md — undo restores the body only. The recorded bytes stay in the history store; copy the blob back over that file to restore them.`
|
|
1384
|
+
};
|
|
1380
1385
|
const content = await this.skills.readVersion(name, target);
|
|
1381
1386
|
if (content === null) return {
|
|
1382
1387
|
ok: false,
|
|
@@ -1399,16 +1404,19 @@ var EvolutionCurator = class extends Service {
|
|
|
1399
1404
|
* Every entry written from 0.10.0 on carries `beforeHash`, read under the content lock, so the link
|
|
1400
1405
|
* survives two writers of one skill appending their versions out of order. The tail scan stays for
|
|
1401
1406
|
* entries written before the link existed and for a live body no version recorded (a hand-edited
|
|
1402
|
-
* tree): the newest version whose content differs from the live bytes.
|
|
1407
|
+
* tree): the newest version whose content differs from the live bytes.
|
|
1408
|
+
*
|
|
1409
|
+
* Support-file versions are skipped in both branches: undo restores the skill BODY, and a version
|
|
1410
|
+
* holding a support file's bytes is not a state the body was ever in (0.10.1). */
|
|
1403
1411
|
previousVersionOf(versions, liveHash) {
|
|
1404
1412
|
const live = [...versions].reverse().find((entry) => entry.hash === liveHash);
|
|
1405
1413
|
if (live?.beforeHash !== void 0) {
|
|
1406
1414
|
const predecessor = [...versions].reverse().find((entry) => entry.hash === live.beforeHash);
|
|
1407
|
-
if (predecessor !== void 0) return predecessor.v;
|
|
1415
|
+
if (predecessor !== void 0 && versionTarget(predecessor.action) !== "support") return predecessor.v;
|
|
1408
1416
|
}
|
|
1409
1417
|
for (let index = versions.length - 1; index >= 0; index -= 1) {
|
|
1410
1418
|
const entry = versions[index];
|
|
1411
|
-
if (entry !== void 0 && entry.hash !== liveHash) return entry.v;
|
|
1419
|
+
if (entry !== void 0 && entry.hash !== liveHash && versionTarget(entry.action) !== "support") return entry.v;
|
|
1412
1420
|
}
|
|
1413
1421
|
}
|
|
1414
1422
|
};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -446,7 +446,10 @@ export declare class EvolutionCurator extends Service {
|
|
|
446
446
|
* Every entry written from 0.10.0 on carries `beforeHash`, read under the content lock, so the link
|
|
447
447
|
* survives two writers of one skill appending their versions out of order. The tail scan stays for
|
|
448
448
|
* entries written before the link existed and for a live body no version recorded (a hand-edited
|
|
449
|
-
* tree): the newest version whose content differs from the live bytes.
|
|
449
|
+
* tree): the newest version whose content differs from the live bytes.
|
|
450
|
+
*
|
|
451
|
+
* Support-file versions are skipped in both branches: undo restores the skill BODY, and a version
|
|
452
|
+
* holding a support file's bytes is not a state the body was ever in (0.10.1). */
|
|
450
453
|
private previousVersionOf;
|
|
451
454
|
}
|
|
452
455
|
export default EvolutionCurator;
|
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.
|
|
4
|
+
"version": "0.11.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,20 +27,20 @@
|
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
30
|
-
"@lmzhen/dsh-evolution-core": "^0.
|
|
30
|
+
"@lmzhen/dsh-evolution-core": "^0.11.2"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
34
34
|
"@deepseek-ai/dsh-llm": "^0.1.5-rc.2",
|
|
35
35
|
"@deepseek-ai/dsh-session": "^0.1.5-rc.2",
|
|
36
|
-
"@lmzhen/dsh-evolution-io": "^0.
|
|
37
|
-
"@lmzhen/dsh-evolution-state": "^0.
|
|
36
|
+
"@lmzhen/dsh-evolution-io": "^0.11.2",
|
|
37
|
+
"@lmzhen/dsh-evolution-state": "^0.11.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@deepseek-ai/dsh-llm": "^0.1.5-rc.2",
|
|
41
41
|
"@deepseek-ai/dsh-session": "^0.1.5-rc.2",
|
|
42
|
-
"@lmzhen/dsh-evolution-core": "^0.
|
|
43
|
-
"@lmzhen/dsh-evolution-io": "^0.
|
|
44
|
-
"@lmzhen/dsh-evolution-state": "^0.
|
|
42
|
+
"@lmzhen/dsh-evolution-core": "^0.11.2",
|
|
43
|
+
"@lmzhen/dsh-evolution-io": "^0.11.2",
|
|
44
|
+
"@lmzhen/dsh-evolution-state": "^0.11.2"
|
|
45
45
|
}
|
|
46
46
|
}
|