@lmzhen/dsh-evolution-plan-validator 0.3.71 → 0.3.72

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.
Files changed (2) hide show
  1. package/lib/index.js +6 -1
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { DEFAULT_MAX_OPS_PER_PLAN, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_SKILL_CONTENT_CHARS, DEFAULT_USER_CHAR_LIMIT, FORBIDDEN_CONTROL_KEYS, MAX_RESTRUCTURE_MOVES, validateRestructureTarget } from "@lmzhen/dsh-evolution-core";
1
+ import { DEFAULT_MAX_OPS_PER_PLAN, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_SKILL_CONTENT_CHARS, DEFAULT_USER_CHAR_LIMIT, FORBIDDEN_CONTROL_KEYS, MAX_RESTRUCTURE_MOVES, SKILL_ACTION_REQUIRED_FIELDS, validateRestructureTarget } from "@lmzhen/dsh-evolution-core";
2
2
  //#region lib/types/index.js
3
3
  /**
4
4
  * Deterministic validator for model-produced evolution plans.
@@ -197,6 +197,11 @@ function validateSkillOp(op, context, index) {
197
197
  if (!hasValidEvidence(op.evidence, context.sessionSeq)) return `skill op ${index}: evidence is required and must reference a valid session seq`;
198
198
  const action = op.action ?? "patch";
199
199
  if (!SKILL_ACTIONS.has(action)) return `skill op ${index}: unknown action ${action}`;
200
+ const requiredFields = SKILL_ACTION_REQUIRED_FIELDS[action];
201
+ if (requiredFields !== void 0) {
202
+ const record = op;
203
+ for (const field of requiredFields) if (record[field] === void 0 || record[field] === null) return `skill op ${index}: ${action} requires ${field}`;
204
+ }
200
205
  if ((action === "create" || action === "edit" || action === "update") && !(op.content ?? "").trim()) return `skill op ${index}: ${action} requires content`;
201
206
  if (action === "patch" && !(op.old_string ?? "")) return `skill op ${index}: patch requires old_string`;
202
207
  if (action === "delete" && !(op.absorbed_into ?? "").trim()) return `skill op ${index}: delete requires absorbed_into`;
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.71",
4
+ "version": "0.3.72",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -30,7 +30,7 @@
30
30
  ],
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
- "@lmzhen/dsh-evolution-core": "^0.3.71"
33
+ "@lmzhen/dsh-evolution-core": "^0.3.72"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@deepseek-ai/dsh-invariants": "^0.1.5-rc.2",