@lmzhen/dsh-evolution-replay 0.3.62 → 0.3.64

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
@@ -96,7 +96,8 @@ var EvolutionReplayDriver = class {
96
96
  }
97
97
  }
98
98
  record(plan) {
99
- const count = (value) => typeof value === "number" && Number.isFinite(value) ? value : 0;
99
+ const count = (value) => typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : 0;
100
+ const countOr = (value, fallback) => typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : fallback;
100
101
  const memoryApplied = count(plan.memoryApplied);
101
102
  const skillApplied = count(plan.skillApplied);
102
103
  this.plans.push({
@@ -105,9 +106,9 @@ var EvolutionReplayDriver = class {
105
106
  rejectedOps: count(plan.rejectedOps),
106
107
  memoryOps: memoryApplied,
107
108
  skillOps: skillApplied,
108
- evidenceQuotes: typeof plan.evidenceQuotes === "number" ? plan.evidenceQuotes : memoryApplied + skillApplied,
109
- estimatedInputChars: typeof plan.estimatedInputChars === "number" ? plan.estimatedInputChars : 0,
110
- executionFailures: typeof plan.executionFailures === "number" ? plan.executionFailures : 0,
109
+ evidenceQuotes: countOr(plan.evidenceQuotes, memoryApplied + skillApplied),
110
+ estimatedInputChars: count(plan.estimatedInputChars),
111
+ executionFailures: count(plan.executionFailures),
111
112
  ...typeof plan.executionError === "string" ? { executionError: plan.executionError } : {}
112
113
  });
113
114
  if (this.plans.length > this.maxPlans) this.plans.shift();
@@ -118,12 +119,13 @@ var EvolutionReplayDriver = class {
118
119
  * as a read/inspection window. Kept by declaration (same posture as the
119
120
  * skill-usage `invalidate()` V6-44 declaration), so it is documented intent
120
121
  * rather than undeclared dead code.
122
+ * @internal Exported for this package's own tests only.
121
123
  */
122
124
  plansSnapshot() {
123
125
  return [...this.plans];
124
126
  }
125
127
  compare(weights = this.weights) {
126
- return comparePlans(this.plans, weights);
128
+ return comparePlans([...this.plans], clampReplayWeights(weights, this.weights));
127
129
  }
128
130
  };
129
131
  const name = "evolution-replay";
@@ -70,6 +70,7 @@ export declare class EvolutionReplayDriver {
70
70
  * as a read/inspection window. Kept by declaration (same posture as the
71
71
  * skill-usage `invalidate()` V6-44 declaration), so it is documented intent
72
72
  * rather than undeclared dead code.
73
+ * @internal Exported for this package's own tests only.
73
74
  */
74
75
  plansSnapshot(): ReplayPlan[];
75
76
  compare(weights?: ReplayWeights): ReplayResult;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-replay",
3
3
  "description": "Replay/A-B evaluation primitives for evolution plans (community build)",
4
- "version": "0.3.62",
4
+ "version": "0.3.64",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -31,7 +31,7 @@
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
33
  "@deepseek-ai/schemastery": "^3.18.1",
34
- "@lmzhen/dsh-evolution-core": "^0.3.62"
34
+ "@lmzhen/dsh-evolution-core": "^0.3.64"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@deepseek-ai/cordis": "^4.0.1",
@@ -39,6 +39,6 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
42
- "@lmzhen/dsh-evolution-core": "^0.3.62"
42
+ "@lmzhen/dsh-evolution-core": "^0.3.64"
43
43
  }
44
44
  }