@lmzhen/dsh-evolution-review 0.3.43 → 0.3.45

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
@@ -22,10 +22,32 @@ const Config = z.object({
22
22
  reviewMessageChars: z.number().min(1).default(2e3),
23
23
  reviewMaxDepth: z.number().min(1).default(1),
24
24
  reviewProvider: z.string(),
25
- skillReviewTrigger: z.string().default(DEFAULT_SKILL_REVIEW_TRIGGER),
25
+ skillReviewTrigger: z.union([
26
+ z.const("cadence"),
27
+ z.const("completion"),
28
+ z.const("both")
29
+ ]).default(DEFAULT_SKILL_REVIEW_TRIGGER),
26
30
  reviewWakeInject: z.boolean().default(true),
27
31
  skillReviewCompletionMinToolCalls: z.number().min(1).default(DEFAULT_SKILL_REVIEW_COMPLETION_MIN_TOOL_CALLS)
28
32
  });
33
+ /** V8-01 (0.3.45): the review subagent's structured-output contract. The
34
+ * `subagents.start` outputSchema is RAW JSON Schema validated by
35
+ * assertObjectJsonSchema (upstream dsh-tools json-schema.ts — SCHEMA_TYPES
36
+ * has no 'json'; 'json' is a defineTool-author DSL-only value). The arrays
37
+ * deliberately use `{ type: 'array' }` with NO items node — absent items
38
+ * accepts any JSON item (upstream semantics, json-schema.ts "Item schema
39
+ * (type: 'array' only); absent accepts any JSON item"), and plan-validator
40
+ * owns the per-op structure proof. The whitelist contract test (review.spec
41
+ * V8-01) forbids a DSL value slipping back in. */
42
+ const REVIEW_OUTPUT_SCHEMA = {
43
+ type: "object",
44
+ additionalProperties: false,
45
+ properties: {
46
+ memoryOps: { type: "array" },
47
+ skillOps: { type: "array" },
48
+ summary: { type: "string" }
49
+ }
50
+ };
29
51
  let statelessReviewStateWarned = false;
30
52
  /**
31
53
  * G3.1 (0.3.23): clamp the numeric review config at assembly so a 0/negative/
@@ -247,21 +269,7 @@ function apply(ctx, rawConfig) {
247
269
  agentOptions,
248
270
  persona: reviewPrompt(kind, "plan"),
249
271
  toolFilter: { allow: [...config.reviewToolAllow] },
250
- outputSchema: {
251
- type: "object",
252
- additionalProperties: false,
253
- properties: {
254
- memoryOps: {
255
- type: "array",
256
- items: { type: "json" }
257
- },
258
- skillOps: {
259
- type: "array",
260
- items: { type: "json" }
261
- },
262
- summary: { type: "string" }
263
- }
264
- }
272
+ outputSchema: REVIEW_OUTPUT_SCHEMA
265
273
  });
266
274
  try {
267
275
  const result = await run.result;
@@ -495,6 +503,10 @@ function apply(ctx, rawConfig) {
495
503
  turnStarts.clear();
496
504
  cumulativeToolCalls.clear();
497
505
  completionInjected.clear();
506
+ pendingCadenceReviews.clear();
507
+ pendingCadenceWarned.clear();
508
+ skipNextCadenceFire.clear();
509
+ cadenceResetWarned.clear();
498
510
  }, "dsh-evolution-review.cleanup");
499
511
  }
500
512
  /** Completion-channel decision: task finished normally AND the session is proven long. */
@@ -612,4 +624,4 @@ function buildReviewRequest(session, kind, signal, maxMessages, maxMessageChars)
612
624
  ].join("\n");
613
625
  }
614
626
  //#endregion
615
- export { Config, apply, clampReviewConfig, filterUnreadSkillOps, inject, name, shouldCompletionReview, sweepDeadSessionEntries };
627
+ export { Config, REVIEW_OUTPUT_SCHEMA, apply, clampReviewConfig, filterUnreadSkillOps, inject, name, shouldCompletionReview, sweepDeadSessionEntries };
@@ -29,7 +29,9 @@ export interface Config {
29
29
  /** LLM provider for review subagents. Omit to inherit the deployment default route. */
30
30
  reviewProvider?: string;
31
31
  /** Skill-review trigger: cadence (interval) | completion (once after a proven-long task) | both. */
32
- skillReviewTrigger?: string;
32
+ /** Which channel runs the end-of-conversation summary: the cadence latch
33
+ * ('cadence'), the long-session completion gate ('completion'), or both. */
34
+ skillReviewTrigger?: 'cadence' | 'completion' | 'both';
33
35
  /** Cumulative session tool calls before a session counts as proven-long for the completion channel. */
34
36
  skillReviewCompletionMinToolCalls?: number;
35
37
  /** 0.3.40: deliver the deferred review with a WAKING inject for a summary the
@@ -39,6 +41,30 @@ export interface Config {
39
41
  reviewWakeInject?: boolean;
40
42
  }
41
43
  export declare const Config: z<Config>;
44
+ /** V8-01 (0.3.45): the review subagent's structured-output contract. The
45
+ * `subagents.start` outputSchema is RAW JSON Schema validated by
46
+ * assertObjectJsonSchema (upstream dsh-tools json-schema.ts — SCHEMA_TYPES
47
+ * has no 'json'; 'json' is a defineTool-author DSL-only value). The arrays
48
+ * deliberately use `{ type: 'array' }` with NO items node — absent items
49
+ * accepts any JSON item (upstream semantics, json-schema.ts "Item schema
50
+ * (type: 'array' only); absent accepts any JSON item"), and plan-validator
51
+ * owns the per-op structure proof. The whitelist contract test (review.spec
52
+ * V8-01) forbids a DSL value slipping back in. */
53
+ export declare const REVIEW_OUTPUT_SCHEMA: {
54
+ readonly type: "object";
55
+ readonly additionalProperties: false;
56
+ readonly properties: {
57
+ readonly memoryOps: {
58
+ readonly type: "array";
59
+ };
60
+ readonly skillOps: {
61
+ readonly type: "array";
62
+ };
63
+ readonly summary: {
64
+ readonly type: "string";
65
+ };
66
+ };
67
+ };
42
68
  /**
43
69
  * G3.1 (0.3.23): clamp the numeric review config at assembly so a 0/negative/
44
70
  * NaN/±Infinity value falls back to the package default instead of folding as a
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-review",
3
3
  "description": "Background review orchestration (community build)",
4
- "version": "0.3.43",
4
+ "version": "0.3.45",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -31,9 +31,9 @@
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
33
  "@deepseek-ai/schemastery": "^3.18.1",
34
- "@lmzhen/dsh-evolution-approval": "^0.3.43",
35
- "@lmzhen/dsh-evolution-core": "^0.3.43",
36
- "@lmzhen/dsh-evolution-plan-validator": "^0.3.43"
34
+ "@lmzhen/dsh-evolution-approval": "^0.3.45",
35
+ "@lmzhen/dsh-evolution-core": "^0.3.45",
36
+ "@lmzhen/dsh-evolution-plan-validator": "^0.3.45"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@deepseek-ai/cordis": "^4.0.1",
@@ -42,8 +42,8 @@
42
42
  "@deepseek-ai/dsh-llm": "^0.1.1-rc.2",
43
43
  "@deepseek-ai/dsh-session": "^0.1.1-rc.2",
44
44
  "@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
45
- "@lmzhen/dsh-evolution-state": "^0.3.43",
46
- "@lmzhen/dsh-evolution-policy": "^0.3.43"
45
+ "@lmzhen/dsh-evolution-state": "^0.3.45",
46
+ "@lmzhen/dsh-evolution-policy": "^0.3.45"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@deepseek-ai/dsh-agent": "^0.1.1-rc.2",
@@ -54,9 +54,9 @@
54
54
  "@deepseek-ai/dsh-session-persistence": "^0.1.1-rc.2",
55
55
  "@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.1-rc.2",
56
56
  "@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
57
- "@lmzhen/dsh-evolution-approval": "^0.3.43",
58
- "@lmzhen/dsh-evolution-core": "^0.3.43",
59
- "@lmzhen/dsh-evolution-plan-validator": "^0.3.43",
60
- "@lmzhen/dsh-evolution-state": "^0.3.43"
57
+ "@lmzhen/dsh-evolution-approval": "^0.3.45",
58
+ "@lmzhen/dsh-evolution-core": "^0.3.45",
59
+ "@lmzhen/dsh-evolution-plan-validator": "^0.3.45",
60
+ "@lmzhen/dsh-evolution-state": "^0.3.45"
61
61
  }
62
62
  }