@lmzhen/dsh-evolution-plan-validator 0.3.19 → 0.3.21

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 CHANGED
@@ -131,9 +131,13 @@ function validateSkillOp(op, context, index) {
131
131
  if ((action === "create" || action === "edit" || action === "update") && !(op.content ?? "").trim()) return `skill op ${index}: ${action} requires content`;
132
132
  if (action === "patch" && !(op.old_string ?? "")) return `skill op ${index}: patch requires old_string`;
133
133
  if (action === "delete" && !(op.absorbed_into ?? "").trim()) return `skill op ${index}: delete requires absorbed_into`;
134
- const writeContent = op.file_content ?? op.content ?? op.new_string ?? "";
135
- if (action === "write_file" && !writeContent.trim()) return `skill op ${index}: write_file requires file_content`;
136
- if (writeContent.length > (context.maxSkillContentChars ?? DEFAULT_SKILL_CONTENT_CHARS)) return `skill op ${index}: content exceeds skill budget`;
134
+ const writeBytes = [
135
+ op.file_content ?? "",
136
+ op.content ?? "",
137
+ op.new_string ?? ""
138
+ ].reduce((max, value) => Math.max(max, value.length), 0);
139
+ if (action === "write_file" && !(op.file_content ?? op.content ?? "").trim()) return `skill op ${index}: write_file requires file_content`;
140
+ if (writeBytes > (context.maxSkillContentChars ?? DEFAULT_SKILL_CONTENT_CHARS)) return `skill op ${index}: content exceeds skill budget`;
137
141
  if (action === "restructure") {
138
142
  if (!Array.isArray(op.restructure) || op.restructure.length === 0) return `skill op ${index}: restructure requires a non-empty restructure list`;
139
143
  if (op.restructure.length > MAX_RESTRUCTURE_MOVES) return `skill op ${index}: restructure exceeds ${MAX_RESTRUCTURE_MOVES} moves`;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Deterministic validator for model-produced evolution plans.
3
3
  * The validator never calls the model and never mutates state.
4
- * @module @deepseek-ai/dsh-evolution-plan-validator
4
+ * @module @lmzhen/dsh-evolution-plan-validator
5
5
  */
6
6
  export interface MemoryOp {
7
7
  target?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-plan-validator",
3
3
  "description": "Deterministic validator for model-produced evolution plans (community build)",
4
- "version": "0.3.19",
4
+ "version": "0.3.21",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -25,15 +25,13 @@
25
25
  "./package.json": "./package.json"
26
26
  },
27
27
  "files": [
28
- "lib/index.js",
29
- "lib/invariant.js",
30
- "lib/types/**/*.d.ts",
31
- "lib/types/invariant.d.ts"
28
+ "lib/*.js",
29
+ "lib/types/**/*.d.ts"
32
30
  ],
33
31
  "license": "MIT",
34
32
  "dependencies": {
35
33
  "@deepseek-ai/schemastery": "^3.18.1",
36
- "@lmzhen/dsh-evolution-core": "^0.3.19"
34
+ "@lmzhen/dsh-evolution-core": "^0.3.21"
37
35
  },
38
36
  "peerDependencies": {
39
37
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",