@lmzhen/dsh-evolution-core 0.3.39 → 0.3.40

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
@@ -2826,17 +2826,20 @@ function advanceReview(state, turn, signal, config) {
2826
2826
  state.turnsSinceSkill += signal.skillSignal ? 1 : Math.max(1, signal.toolCalls);
2827
2827
  const memoryDue = state.turnsSinceMemory >= config.memoryInterval;
2828
2828
  const skillDue = state.turnsSinceSkill >= config.skillInterval;
2829
- if (memoryDue && skillDue) {
2829
+ const zero = () => {
2830
2830
  state.turnsSinceMemory = 0;
2831
2831
  state.turnsSinceSkill = 0;
2832
+ };
2833
+ if (memoryDue && skillDue) {
2834
+ if (config.resetOnFire !== false) zero();
2832
2835
  return "combined";
2833
2836
  }
2834
2837
  if (memoryDue) {
2835
- state.turnsSinceMemory = 0;
2838
+ if (config.resetOnFire !== false) state.turnsSinceMemory = 0;
2836
2839
  return "memory";
2837
2840
  }
2838
2841
  if (skillDue) {
2839
- state.turnsSinceSkill = 0;
2842
+ if (config.resetOnFire !== false) state.turnsSinceSkill = 0;
2840
2843
  return "skill";
2841
2844
  }
2842
2845
  return null;
@@ -13,6 +13,12 @@ export interface SignalConfig {
13
13
  substantiveMinToolCalls: number;
14
14
  substantiveMinUserChars: number;
15
15
  substantiveMinAgentChars: number;
16
+ /** 0.3.40 (user decision): the counting window restarts at the INJECTION, not
17
+ * at the threshold fire. `false` keeps the counters MONOTONIC across fires
18
+ * (the `>=` check still returns the kind; the caller resets the counters at
19
+ * its own injection point). Default `true` preserves the historical
20
+ * fire-resets window for existing callers/tests. */
21
+ resetOnFire?: boolean;
16
22
  }
17
23
  export interface TurnSignals {
18
24
  substantive: boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-core",
3
3
  "description": "Shared stores, prompts, signals and lifecycle logic for the dsh-evolution plugin family (community build)",
4
- "version": "0.3.39",
4
+ "version": "0.3.40",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },