@lmzhen/dsh-evolution-core 0.3.38 → 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
@@ -647,7 +647,12 @@ const MAX_SKILL_FILE_BYTES = 1048576;
647
647
  const DEFAULT_REVIEW_MEMORY_INTERVAL = 10;
648
648
  const DEFAULT_REVIEW_SKILL_INTERVAL = 10;
649
649
  /** Skill-review completion channel trigger mode: 'cadence' | 'completion' | 'both'. */
650
- const DEFAULT_SKILL_REVIEW_TRIGGER = "both";
650
+ /** Skill-review completion channel trigger mode: 'cadence' | 'completion' | 'both'.
651
+ * 0.3.39 (V6-53 follow-up): default is 'cadence' — since 0.3.38 the cadence
652
+ * channel's review is executed at conversation END (deferred), so 'both' would
653
+ * inject a second (task-complete) prompt at the same boundary; the cadence
654
+ * deferral alone IS the end-of-conversation summary. */
655
+ const DEFAULT_SKILL_REVIEW_TRIGGER = "cadence";
651
656
  /** Cumulative session tool calls before a session counts as "proven long" for the completion channel. */
652
657
  const DEFAULT_SKILL_REVIEW_COMPLETION_MIN_TOOL_CALLS = 20;
653
658
  const DEFAULT_SUBSTANTIVE_MIN_TOOL_CALLS = 3;
@@ -2821,17 +2826,20 @@ function advanceReview(state, turn, signal, config) {
2821
2826
  state.turnsSinceSkill += signal.skillSignal ? 1 : Math.max(1, signal.toolCalls);
2822
2827
  const memoryDue = state.turnsSinceMemory >= config.memoryInterval;
2823
2828
  const skillDue = state.turnsSinceSkill >= config.skillInterval;
2824
- if (memoryDue && skillDue) {
2829
+ const zero = () => {
2825
2830
  state.turnsSinceMemory = 0;
2826
2831
  state.turnsSinceSkill = 0;
2832
+ };
2833
+ if (memoryDue && skillDue) {
2834
+ if (config.resetOnFire !== false) zero();
2827
2835
  return "combined";
2828
2836
  }
2829
2837
  if (memoryDue) {
2830
- state.turnsSinceMemory = 0;
2838
+ if (config.resetOnFire !== false) state.turnsSinceMemory = 0;
2831
2839
  return "memory";
2832
2840
  }
2833
2841
  if (skillDue) {
2834
- state.turnsSinceSkill = 0;
2842
+ if (config.resetOnFire !== false) state.turnsSinceSkill = 0;
2835
2843
  return "skill";
2836
2844
  }
2837
2845
  return null;
@@ -34,7 +34,12 @@ export declare const MAX_SKILL_FILE_BYTES = 1048576;
34
34
  export declare const DEFAULT_REVIEW_MEMORY_INTERVAL = 10;
35
35
  export declare const DEFAULT_REVIEW_SKILL_INTERVAL = 10;
36
36
  /** Skill-review completion channel trigger mode: 'cadence' | 'completion' | 'both'. */
37
- export declare const DEFAULT_SKILL_REVIEW_TRIGGER: "both";
37
+ /** Skill-review completion channel trigger mode: 'cadence' | 'completion' | 'both'.
38
+ * 0.3.39 (V6-53 follow-up): default is 'cadence' — since 0.3.38 the cadence
39
+ * channel's review is executed at conversation END (deferred), so 'both' would
40
+ * inject a second (task-complete) prompt at the same boundary; the cadence
41
+ * deferral alone IS the end-of-conversation summary. */
42
+ export declare const DEFAULT_SKILL_REVIEW_TRIGGER: "cadence";
38
43
  /** Cumulative session tool calls before a session counts as "proven long" for the completion channel. */
39
44
  export declare const DEFAULT_SKILL_REVIEW_COMPLETION_MIN_TOOL_CALLS = 20;
40
45
  export declare const DEFAULT_SUBSTANTIVE_MIN_TOOL_CALLS = 3;
@@ -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.38",
4
+ "version": "0.3.40",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },