@lmzhen/dsh-evolution-replay 0.3.74 → 0.3.76

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/README.md CHANGED
@@ -22,3 +22,5 @@ Independent of request-prefix construction. This package does not alter the asse
22
22
 
23
23
 
24
24
  - No known durable consumer gaps at this time. Runtime contracts are covered by package and boundary tests.
25
+
26
+ **Runtime invariant:** No companion is published. The platform auto-assembles nothing and the family mounts no `<pkg>/invariant` cordis row, so a companion here would never execute (v37 S2.1 / I-3).
package/lib/index.js CHANGED
@@ -86,7 +86,7 @@ function comparePlans(plans, weights = DEFAULT_WEIGHTS) {
86
86
  winner: winner.plan.policyId,
87
87
  margin,
88
88
  plans,
89
- report: scored.map(({ plan, score }) => `${plan.policyId}: ${score.toFixed(1)} (${plan.acceptedOps} accepted, ${plan.rejectedOps} rejected${(plan.executionFailures ?? 0) > 0 ? `, ${plan.executionFailures} failed${plan.executionError !== void 0 ? `: ${plan.executionError}` : ""}` : ""})`).join("\n") + singleNote
89
+ report: scored.map(({ plan, score }) => `${plan.policyId}: ${score.toFixed(1)} (${plan.acceptedOps} accepted, ${plan.rejectedOps} rejected${(plan.skippedUnread ?? 0) > 0 ? `, ${plan.skippedUnread} op(s) skipped (skill not read this session)` : ""}${(plan.executionFailures ?? 0) > 0 ? `, ${plan.executionFailures} failed${plan.executionError !== void 0 ? `: ${plan.executionError}` : ""}` : ""})`).join("\n") + singleNote
90
90
  };
91
91
  }
92
92
  var EvolutionReplayDriver = class EvolutionReplayDriver {
@@ -152,13 +152,15 @@ var EvolutionReplayDriver = class EvolutionReplayDriver {
152
152
  skillOps: skillApplied,
153
153
  evidenceQuotes: countOr(plan.evidenceQuotes, memoryApplied + skillApplied),
154
154
  estimatedInputChars: count(plan.estimatedInputChars),
155
+ skippedUnread: count(plan.skippedUnread),
155
156
  executionFailures: count(plan.executionFailures),
156
157
  ...typeof plan.executionError === "string" ? { executionError: plan.executionError } : {}
157
158
  };
158
159
  }
159
160
  /**
160
- * V25-01 (v25): backfill the leaderboard from the activity sidecar, ONCE
161
- * per driver instance. The inject callback that loads the sidecar re-runs
161
+ * V25-01 (v25): backfill the leaderboard from the activity sidecar — once
162
+ * per driver instance, and only for a load that carried records (an empty
163
+ * read is not evidence, see below). The inject callback that loads the sidecar re-runs
162
164
  * whenever the `evolutionIo` dependency is replaced (cordis derived-fiber
163
165
  * reload — plugin restart / HMR) while THIS driver survives at the apply
164
166
  * scope, so the dedupe guard must live here, not in the callback: without
@@ -167,6 +169,7 @@ var EvolutionReplayDriver = class EvolutionReplayDriver {
167
169
  */
168
170
  backfill(items) {
169
171
  if (this.backfilled) return;
172
+ if (items.length === 0) return;
170
173
  this.backfilled = true;
171
174
  const fresh = items.filter((item) => !this.preBackfillIds.has(item.planId));
172
175
  this.preBackfillIds.clear();
@@ -28,6 +28,9 @@ export interface ReplayPlan {
28
28
  skillOps: number;
29
29
  evidenceQuotes: number;
30
30
  estimatedInputChars: number;
31
+ /** R-03: ops skipped because the session never read the named skill — a plan
32
+ * whose ops were all skipped must not read as a clean "0/0" either. */
33
+ skippedUnread?: number | undefined;
31
34
  /** V6-10 (0.3.36): execution-layer failures — a plan must not read as a
32
35
  * clean "0/0" when its ops all failed at execution (V5-19 payload). */
33
36
  executionFailures?: number | undefined;
@@ -99,8 +102,9 @@ export declare class EvolutionReplayDriver {
99
102
  */
100
103
  private toPlan;
101
104
  /**
102
- * V25-01 (v25): backfill the leaderboard from the activity sidecar, ONCE
103
- * per driver instance. The inject callback that loads the sidecar re-runs
105
+ * V25-01 (v25): backfill the leaderboard from the activity sidecar — once
106
+ * per driver instance, and only for a load that carried records (an empty
107
+ * read is not evidence, see below). The inject callback that loads the sidecar re-runs
104
108
  * whenever the `evolutionIo` dependency is replaced (cordis derived-fiber
105
109
  * reload — plugin restart / HMR) while THIS driver survives at the apply
106
110
  * scope, so the dedupe guard must live here, not in the callback: without
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.74",
4
+ "version": "0.3.76",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -18,10 +18,6 @@
18
18
  "types": "./lib/types/index.d.ts",
19
19
  "default": "./lib/index.js"
20
20
  },
21
- "./invariant": {
22
- "types": "./lib/types/invariant.d.ts",
23
- "default": "./lib/invariant.js"
24
- },
25
21
  "./package.json": "./package.json"
26
22
  },
27
23
  "files": [
@@ -31,16 +27,14 @@
31
27
  "license": "MIT",
32
28
  "dependencies": {
33
29
  "@deepseek-ai/schemastery": "^3.18.1",
34
- "@lmzhen/dsh-evolution-activity": "^0.3.74",
35
- "@lmzhen/dsh-evolution-core": "^0.3.74"
30
+ "@lmzhen/dsh-evolution-activity": "^0.3.76",
31
+ "@lmzhen/dsh-evolution-core": "^0.3.76"
36
32
  },
37
33
  "peerDependencies": {
38
- "@deepseek-ai/cordis": "^4.0.1",
39
- "@deepseek-ai/dsh-invariants": "^0.1.5-rc.2"
34
+ "@deepseek-ai/cordis": "^4.0.1"
40
35
  },
41
36
  "devDependencies": {
42
- "@deepseek-ai/dsh-invariants": "^0.1.5-rc.2",
43
- "@lmzhen/dsh-evolution-activity": "^0.3.74",
44
- "@lmzhen/dsh-evolution-core": "^0.3.74"
37
+ "@lmzhen/dsh-evolution-activity": "^0.3.76",
38
+ "@lmzhen/dsh-evolution-core": "^0.3.76"
45
39
  }
46
40
  }
package/lib/invariant.js DELETED
@@ -1,8 +0,0 @@
1
- //#region lib/types/invariant.js
2
- const PACKAGE_NAME = "@lmzhen/dsh-evolution-replay";
3
- const name = "evolution-replay-invariant";
4
- const inject = ["invariants"];
5
- const install = () => {};
6
- const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
7
- //#endregion
8
- export { apply, inject, name };
@@ -1,5 +0,0 @@
1
- import type { Context } from '@deepseek-ai/cordis';
2
- export declare const name = "evolution-replay-invariant";
3
- export declare const inject: string[];
4
- export declare const apply: (ctx: Context) => Promise<() => void>;
5
- //# sourceMappingURL=invariant.d.ts.map