@lmzhen/dsh-evolution-plan-validator 0.17.0 → 0.18.0

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 +3 -4
  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, SKILL_ACTION_REQUIRED_FIELDS, 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, payloadText, validateRestructureTarget } from "@lmzhen/dsh-evolution-core";
2
2
  //#region lib/types/index.js
3
3
  /**
4
4
  * Deterministic validator for model-produced evolution plans.
@@ -121,8 +121,7 @@ const MEMORY_PLAN_RULES = [
121
121
  id: "PAYLOAD",
122
122
  run: ({ op, index }) => {
123
123
  const action = op.action ?? "add";
124
- const text = (op.facts ?? op.content ?? "").trim();
125
- return action !== "remove" && text.length === 0 ? `memory op ${index}: ${action} requires facts/content` : null;
124
+ return action !== "remove" && payloadText(op).length === 0 ? `memory op ${index}: ${action} requires facts/content` : null;
126
125
  }
127
126
  },
128
127
  {
@@ -135,7 +134,7 @@ const MEMORY_PLAN_RULES = [
135
134
  {
136
135
  id: "BUDGET",
137
136
  run: ({ op, index, context }) => {
138
- const text = (op.facts ?? op.content ?? "").trim();
137
+ const text = payloadText(op);
139
138
  const budget = op.target === "user" ? context.maxUserChars ?? DEFAULT_USER_CHAR_LIMIT : context.maxMemoryChars ?? DEFAULT_MEMORY_CHAR_LIMIT;
140
139
  return text.length > budget ? `memory op ${index}: content exceeds ${op.target === "user" ? "user" : "memory"} budget` : null;
141
140
  }
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.17.0",
4
+ "version": "0.18.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -26,6 +26,6 @@
26
26
  ],
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
- "@lmzhen/dsh-evolution-core": "^0.17.0"
29
+ "@lmzhen/dsh-evolution-core": "^0.18.0"
30
30
  }
31
31
  }