@lmzhen/dsh-evolution-maintenance 0.3.26 → 0.3.28
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 +17 -10
- package/lib/tools.js +2 -2
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -111,9 +111,12 @@ function validateAndNormalizeMaintainPlan(raw, report, validSignals) {
|
|
|
111
111
|
const forcedHuman = [];
|
|
112
112
|
const protectedNames = /* @__PURE__ */ new Set();
|
|
113
113
|
const factNames = /* @__PURE__ */ new Set();
|
|
114
|
+
const canonicalByName = /* @__PURE__ */ new Map();
|
|
114
115
|
for (const skill of report.skills) {
|
|
115
|
-
|
|
116
|
-
factNames.add(
|
|
116
|
+
const key = skill.name.trim().toLowerCase();
|
|
117
|
+
factNames.add(key);
|
|
118
|
+
canonicalByName.set(key, skill.name);
|
|
119
|
+
if (skill.protected) protectedNames.add(key);
|
|
117
120
|
}
|
|
118
121
|
if (!isRecord(raw)) return {
|
|
119
122
|
ok: false,
|
|
@@ -140,13 +143,17 @@ function validateAndNormalizeMaintainPlan(raw, report, validSignals) {
|
|
|
140
143
|
continue;
|
|
141
144
|
}
|
|
142
145
|
if (typeof item.kind !== "string" || !KINDS.has(item.kind)) errors.push(`${path}.kind: invalid`);
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
const
|
|
149
|
-
errors.push(`${path}.names: references
|
|
146
|
+
const rawNames = Array.isArray(item.names) ? item.names : [];
|
|
147
|
+
let namesOut = [];
|
|
148
|
+
if (rawNames.length === 0 || !rawNames.every(isNonEmptyString)) errors.push(`${path}.names: non-empty string array required`);
|
|
149
|
+
else {
|
|
150
|
+
namesOut = rawNames.map((nm) => canonicalByName.get(nm.trim().toLowerCase()) ?? nm.trim());
|
|
151
|
+
const missing = namesOut.find((nm) => !factNames.has(nm.toLowerCase()));
|
|
152
|
+
if (missing !== void 0) errors.push(`${path}.names: references skill "${missing}" not in the facts report — names must come from the scanned skill set`);
|
|
153
|
+
else {
|
|
154
|
+
const hit = namesOut.find((nm) => protectedNames.has(nm.toLowerCase()));
|
|
155
|
+
if (hit !== void 0) errors.push(`${path}.names: references protected skill "${hit}" — §7 forbids recommendations for bundled/hub-installed/pinned skills`);
|
|
156
|
+
}
|
|
150
157
|
}
|
|
151
158
|
if (!isNonEmptyString(item.rule)) errors.push(`${path}.rule: required`);
|
|
152
159
|
if (typeof item.finding !== "string" || item.finding.trim().length === 0) errors.push(`${path}.finding: required`);
|
|
@@ -169,7 +176,7 @@ function validateAndNormalizeMaintainPlan(raw, report, validSignals) {
|
|
|
169
176
|
const evidence = validateEvidence(item.evidence, validSignals, errors, path);
|
|
170
177
|
plan.push({
|
|
171
178
|
kind: isNonEmptyString(item.kind) ? item.kind : "skill-level",
|
|
172
|
-
names:
|
|
179
|
+
names: namesOut,
|
|
173
180
|
rule: str(item.rule, ""),
|
|
174
181
|
evidence,
|
|
175
182
|
finding: str(item.finding, ""),
|
package/lib/tools.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as snapshotFromLibrary, n as PROBE_SIGNALS, r as computeProbe, t as buildEnrichment } from "./enrichment-Di8Y4kev.js";
|
|
2
|
-
import { SkillLibrary, redactSecrets } from "@lmzhen/dsh-evolution-core";
|
|
2
|
+
import { SkillLibrary, redactSecrets, resolveSkillsRoot } from "@lmzhen/dsh-evolution-core";
|
|
3
3
|
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
4
4
|
//#region lib/types/tools.js
|
|
5
5
|
/**
|
|
@@ -59,7 +59,7 @@ function apply(ctx, rawConfig = {}) {
|
|
|
59
59
|
detail: ["evolution-io registry not mounted"],
|
|
60
60
|
...target ? { target } : {}
|
|
61
61
|
};
|
|
62
|
-
const library = new SkillLibrary(config.skillsRoot, ioRegistry.provider());
|
|
62
|
+
const library = new SkillLibrary(resolveSkillsRoot({ root: config.skillsRoot }), ioRegistry.provider());
|
|
63
63
|
const enrichment = await buildEnrichment(ctx, library);
|
|
64
64
|
const probe = computeProbe(signal, target, await snapshotFromLibrary(library, {
|
|
65
65
|
descriptions: enrichment.descriptions,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-maintenance",
|
|
3
3
|
"description": "Deterministic maintenance-scan surface: skill-library snapshot assembly, drift signals and mechanical-facts rendering (design 011) (community build)",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.28",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
],
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@lmzhen/dsh-evolution-core": "^0.3.
|
|
37
|
+
"@lmzhen/dsh-evolution-core": "^0.3.28"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
|