@lmzhen/dsh-evolution-maintenance 0.3.10 → 0.3.12

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.
@@ -1,4 +1,4 @@
1
- import { HEALTH_STAMP_RE, computeDedupGroups, computePrefixClusters, duplicateHeadings, missingSupportPointers, narrowNameMatches, overlongLines, parseFrontmatter, usageObserved } from "@lmzhen/dsh-evolution-core";
1
+ import { HEALTH_STAMP_RE, computeDedupGroups, computePrefixClusters, duplicateHeadings, frontmatterYamlUnsafeValues, missingSupportPointers, narrowNameMatches, overlongLines, parseFrontmatter, usageObserved } from "@lmzhen/dsh-evolution-core";
2
2
  //#region lib/types/drift-scan.js
3
3
  /**
4
4
  * Skill-library snapshot assembly for drift scanning.
@@ -24,7 +24,9 @@ async function snapshotFromLibrary(library, options = {}) {
24
24
  body,
25
25
  description: options.descriptions?.get(entry.name),
26
26
  supportFiles: options.supportFiles?.get(entry.name),
27
- quality: options.quality?.get(entry.name)
27
+ quality: options.quality?.get(entry.name),
28
+ ...options.protected?.get(entry.name) !== void 0 ? { protected: options.protected.get(entry.name) } : {},
29
+ ...options.catalogInvalid?.get(entry.name) === true ? { catalogInvalid: true } : {}
28
30
  });
29
31
  }
30
32
  return snapshots;
@@ -90,7 +92,12 @@ function computeProbe(signal, target, snapshots) {
90
92
  case "overlong_line": return result(signal, overlongLines(body).map((line) => `line ${line.lineNo}: ${line.chars} chars`), target);
91
93
  case "pointer_missing": return result(signal, missingSupportPointers(body, snapshot.supportFiles ?? []).map((path) => `no body reference: ${path}`), target);
92
94
  case "narrow_name": return result(signal, narrowNameMatches(snapshot.name).map((shape) => `narrow shape: ${shape}`), target);
93
- case "description_chars": return result(signal, [`description=${snapshot.description === void 0 ? "missing" : `${snapshot.description.length} chars`}`], target);
95
+ case "description_chars": {
96
+ const desc = snapshot.description;
97
+ if (desc === void 0) return result(signal, ["description=missing"], target);
98
+ const text = desc.length > 160 ? `${desc.slice(0, 160)}…(truncated: ${desc.length} total)` : desc;
99
+ return result(signal, [`description=${desc.length} chars`, `desc-text: ${text}`], target);
100
+ }
94
101
  case "quality_low": {
95
102
  const quality = snapshot.quality;
96
103
  return result(signal, [quality === null || quality === void 0 ? "quality=unknown" : `quality=${quality.toFixed(2)}`], target);
@@ -115,10 +122,15 @@ async function buildEnrichment(ctx, library) {
115
122
  const descriptions = /* @__PURE__ */ new Map();
116
123
  const supportFiles = /* @__PURE__ */ new Map();
117
124
  const quality = /* @__PURE__ */ new Map();
125
+ const protectedMap = /* @__PURE__ */ new Map();
126
+ const catalogInvalid = /* @__PURE__ */ new Map();
118
127
  for (const entry of await library.list()) {
128
+ if (entry.protectedBy) protectedMap.set(entry.name, entry.protectedBy);
119
129
  const body = await library.read(entry.name);
120
130
  if (body === null) continue;
121
- const description = parseFrontmatter(body)?.frontmatter.description;
131
+ const parsed = parseFrontmatter(body);
132
+ if (frontmatterYamlUnsafeValues(body).length > 0) catalogInvalid.set(entry.name, true);
133
+ const description = parsed?.frontmatter.description;
122
134
  if (typeof description === "string" && description.trim().length > 0) descriptions.set(entry.name, description);
123
135
  const files = await library.listSupportFiles(entry.name);
124
136
  if (files.length > 0) supportFiles.set(entry.name, files);
@@ -129,7 +141,9 @@ async function buildEnrichment(ctx, library) {
129
141
  descriptions,
130
142
  supportFiles,
131
143
  quality,
132
- usageObservedValue
144
+ usageObservedValue,
145
+ protected: protectedMap,
146
+ catalogInvalid
133
147
  };
134
148
  }
135
149
  //#endregion
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as snapshotFromLibrary, n as PROBE_SIGNALS, r as computeProbe, t as buildEnrichment } from "./enrichment-DxCdaJaQ.js";
1
+ import { i as snapshotFromLibrary, n as PROBE_SIGNALS, r as computeProbe, t as buildEnrichment } from "./enrichment-ePcRn3GX.js";
2
2
  import { AUTHORING_DESCRIPTION_BAR, DEFAULT_HEALTH_THRESHOLDS, DRIFT_MAX_LINE_CHARS, DRIFT_SIGNALS_VERSION, DRIFT_SIGNAL_NOUNS, LOW_QUALITY_THRESHOLD, MAINTAIN_PROMPT, PROMPT_BUNDLE, PROMPT_BUNDLE_ID, computeDriftSignals, findDriftSignal, redactSecrets, verifyPromptBundle } from "@lmzhen/dsh-evolution-core";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  //#region lib/types/render-facts.js
@@ -18,7 +18,8 @@ function renderFacts(report, options) {
18
18
  lines.push(`<<<MECHANICAL_FACTS v=${options.signalsVersion} sig=${options.signature}>>>`);
19
19
  for (const signal of report.library) lines.push(...renderSignal(signal, redact));
20
20
  for (const skill of report.skills) {
21
- lines.push(`# skill=${skill.name}`);
21
+ const meta = [`protected=${skill.protected ?? "none"}`, `catalog=${skill.catalogInvalid === true ? "yaml-invalid" : "visible"}`];
22
+ lines.push(`# skill=${skill.name} (${meta.join(" ")})`);
22
23
  for (const signal of skill.signals) lines.push(...renderSignal(signal, redact));
23
24
  }
24
25
  lines.push("<<<END FACTS>>>");
@@ -316,7 +317,9 @@ async function runMaintain(runtime, options = {}) {
316
317
  const snapshots = await snapshotFromLibrary(runtime.library, {
317
318
  supportFiles: options.supportFiles ? options.supportFiles() : void 0,
318
319
  descriptions: options.descriptions ? options.descriptions() : void 0,
319
- quality: options.quality ? options.quality() : void 0
320
+ quality: options.quality ? options.quality() : void 0,
321
+ protected: options.protected ? options.protected() : void 0,
322
+ catalogInvalid: options.catalogInvalid ? options.catalogInvalid() : void 0
320
323
  });
321
324
  if (snapshots.length === 0) return {
322
325
  ok: true,
package/lib/tools.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as snapshotFromLibrary, n as PROBE_SIGNALS, r as computeProbe, t as buildEnrichment } from "./enrichment-DxCdaJaQ.js";
1
+ import { i as snapshotFromLibrary, n as PROBE_SIGNALS, r as computeProbe, t as buildEnrichment } from "./enrichment-ePcRn3GX.js";
2
2
  import { SkillLibrary, redactSecrets } from "@lmzhen/dsh-evolution-core";
3
3
  import { defineTool } from "@deepseek-ai/dsh-tools";
4
4
  //#region lib/types/tools.js
@@ -63,7 +63,9 @@ function apply(ctx, rawConfig = {}) {
63
63
  const probe = computeProbe(signal, target, await snapshotFromLibrary(library, {
64
64
  descriptions: enrichment.descriptions,
65
65
  supportFiles: enrichment.supportFiles,
66
- quality: enrichment.quality
66
+ quality: enrichment.quality,
67
+ protected: enrichment.protected,
68
+ catalogInvalid: enrichment.catalogInvalid
67
69
  }));
68
70
  const redacted = redactSecrets(probe.detail.join("\n"));
69
71
  return {
@@ -22,6 +22,10 @@ export interface SnapshotOptions {
22
22
  descriptions?: ReadonlyMap<string, string> | undefined;
23
23
  /** Quality score per skill name, when the caller computed it. */
24
24
  quality?: ReadonlyMap<string, number> | undefined;
25
+ /** Protection marker per skill name (0.3.11). */
26
+ protected?: ReadonlyMap<string, string> | undefined;
27
+ /** Skills whose frontmatter the strict-YAML catalog cannot load (0.3.11). */
28
+ catalogInvalid?: ReadonlyMap<string, boolean> | undefined;
25
29
  }
26
30
  /**
27
31
  * Assemble drift snapshots from a library reader and optional enrichment.
@@ -13,6 +13,10 @@ export interface Enrichment {
13
13
  supportFiles: ReadonlyMap<string, readonly string[]>;
14
14
  quality: ReadonlyMap<string, number>;
15
15
  usageObservedValue: boolean | undefined;
16
+ /** Protection marker per skill (list().protectedBy — single source). */
17
+ protected: ReadonlyMap<string, string>;
18
+ /** Skills whose frontmatter the strict-YAML platform catalog cannot load. */
19
+ catalogInvalid: ReadonlyMap<string, boolean>;
16
20
  }
17
21
  export declare function buildEnrichment(ctx: Context, library: SkillLibrary): Promise<Enrichment>;
18
22
  //# sourceMappingURL=enrichment.d.ts.map
@@ -28,6 +28,8 @@ export interface MaintainOptions {
28
28
  supportFiles?: () => ReadonlyMap<string, readonly string[]>;
29
29
  descriptions?: () => ReadonlyMap<string, string>;
30
30
  quality?: () => ReadonlyMap<string, number>;
31
+ protected?: () => ReadonlyMap<string, string>;
32
+ catalogInvalid?: () => ReadonlyMap<string, boolean>;
31
33
  usageObserved?: () => boolean | undefined;
32
34
  }
33
35
  export interface MaintainOutcome {
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.10",
4
+ "version": "0.3.12",
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.10"
37
+ "@lmzhen/dsh-evolution-core": "^0.3.12"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",