dsh-continual-evolve 0.10.0 → 0.10.1

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
@@ -7,7 +7,7 @@
7
7
  [![CI](https://github.com/ZK-Andy/dsh-continual-evolve/actions/workflows/ci.yml/badge.svg)](https://github.com/ZK-Andy/dsh-continual-evolve/actions/workflows/ci.yml)
8
8
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
9
9
  [![Node](https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-339933)](package.json)
10
- [![Tests](https://img.shields.io/badge/tests-1046%20passing-brightgreen)]()
10
+ [![Tests](https://img.shields.io/badge/tests-1051%20passing-brightgreen)]()
11
11
  [![Coverage · statements](https://img.shields.io/badge/coverage_statements-98%25-brightgreen)]()
12
12
  [![Coverage · branches](https://img.shields.io/badge/coverage_branches-92%25-green)]()
13
13
  [![Coverage · functions](https://img.shields.io/badge/coverage_functions-99%25-brightgreen)]()
@@ -142,7 +142,7 @@ before aborting.
142
142
 
143
143
  ```bash
144
144
  pnpm install && pnpm build # deps + tsc -> lib/
145
- pnpm test # vitest (1046 tests)
145
+ pnpm test # vitest (1051 tests)
146
146
  pnpm test:coverage # v8 coverage, thresholds enforced in CI
147
147
  pnpm coverage:gaps # locate uncovered lines per file (read-only)
148
148
  pnpm lint # oxlint src test
@@ -152,7 +152,7 @@ Project layout:
152
152
 
153
153
  ```
154
154
  ├── src/ # engine, tools, commands, memory agent, recall, projection, gate, fate, benchmark, injection + token usage…
155
- ├── test/ # vitest suites (55 files)
155
+ ├── test/ # vitest suites (56 files)
156
156
  ├── lib/ # build output (tsc)
157
157
  ├── docs/
158
158
  │ ├── design.md # full design doc (hardening matrix)
package/README.zh.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![CI](https://github.com/ZK-Andy/dsh-continual-evolve/actions/workflows/ci.yml/badge.svg)](https://github.com/ZK-Andy/dsh-continual-evolve/actions/workflows/ci.yml)
8
8
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
9
9
  [![Node](https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-339933)](package.json)
10
- [![Tests](https://img.shields.io/badge/tests-1046%20passing-brightgreen)]()
10
+ [![Tests](https://img.shields.io/badge/tests-1051%20passing-brightgreen)]()
11
11
  [![Coverage · statements](https://img.shields.io/badge/coverage_statements-98%25-brightgreen)]()
12
12
  [![Coverage · branches](https://img.shields.io/badge/coverage_branches-92%25-green)]()
13
13
  [![Coverage · functions](https://img.shields.io/badge/coverage_functions-99%25-brightgreen)]()
@@ -126,7 +126,7 @@ profile patch 示例:
126
126
 
127
127
  ```bash
128
128
  pnpm install && pnpm build # 依赖 + tsc -> lib/
129
- pnpm test # vitest(1046 例)
129
+ pnpm test # vitest(1051 例)
130
130
  pnpm test:coverage # v8 覆盖率,CI 强制阈值
131
131
  pnpm coverage:gaps # 定位各文件未覆盖行(只读)
132
132
  pnpm lint # oxlint src test
@@ -136,7 +136,7 @@ pnpm lint # oxlint src test
136
136
 
137
137
  ```
138
138
  ├── src/ # 引擎、工具、命令、memory Agent、召回、投影、门禁、fate、benchmark、注入 + token 用量…
139
- ├── test/ # vitest 测试套件(55 个文件)
139
+ ├── test/ # vitest 测试套件(56 个文件)
140
140
  ├── lib/ # 构建产物(tsc)
141
141
  ├── docs/
142
142
  │ ├── design.md # 完整设计文档(硬化矩阵)
package/lib/approval.d.ts CHANGED
@@ -36,6 +36,20 @@ export declare function questionServiceOf(ctx: Context): QuestionService | undef
36
36
  * Ask once for a persistent-scope edit. Only a unique, explicit approval
37
37
  * choice is accepted. A missing/ambiguous/unknown answer throws so callers
38
38
  * never interpret a lost or malformed dialog as a durable rejection.
39
+ *
40
+ * Copy follows the headline → details → impact shape: the first line names
41
+ * the target store, the middle carries the (truncated) edit summary, and the
42
+ * last line states visibility/reversibility. Option labels stay literal
43
+ * ("批准"/"拒绝") for parser compatibility; human guidance lives in
44
+ * `description`.
45
+ *
46
+ * @param ctx Cordis context carrying the userQuestions service.
47
+ * @param agent Agent prompting the question, if any.
48
+ * @param signal Abort signal for the question, if any.
49
+ * @param scope Target persistent scope.
50
+ * @param what Edit summary; truncated to 300 chars with "…" when longer.
51
+ * @returns "approved" when the user picks "批准", otherwise "declined".
52
+ * @throws When the service is missing or the answer is not unique/explicit.
39
53
  */
40
54
  export declare function requestScopeApproval(ctx: Context, agent: Agent | undefined, signal: AbortSignal | undefined, scope: "project" | "global", what: string): Promise<ScopeApprovalDecision>;
41
55
  /**
package/lib/approval.js CHANGED
@@ -10,6 +10,20 @@ export function questionServiceOf(ctx) {
10
10
  * Ask once for a persistent-scope edit. Only a unique, explicit approval
11
11
  * choice is accepted. A missing/ambiguous/unknown answer throws so callers
12
12
  * never interpret a lost or malformed dialog as a durable rejection.
13
+ *
14
+ * Copy follows the headline → details → impact shape: the first line names
15
+ * the target store, the middle carries the (truncated) edit summary, and the
16
+ * last line states visibility/reversibility. Option labels stay literal
17
+ * ("批准"/"拒绝") for parser compatibility; human guidance lives in
18
+ * `description`.
19
+ *
20
+ * @param ctx Cordis context carrying the userQuestions service.
21
+ * @param agent Agent prompting the question, if any.
22
+ * @param signal Abort signal for the question, if any.
23
+ * @param scope Target persistent scope.
24
+ * @param what Edit summary; truncated to 300 chars with "…" when longer.
25
+ * @returns "approved" when the user picks "批准", otherwise "declined".
26
+ * @throws When the service is missing or the answer is not unique/explicit.
13
27
  */
14
28
  export async function requestScopeApproval(ctx, agent, signal, scope, what) {
15
29
  const userQuestions = questionServiceOf(ctx);
@@ -17,12 +31,20 @@ export async function requestScopeApproval(ctx, agent, signal, scope, what) {
17
31
  throw new Error("global evolution edits require the userQuestions service (load @deepseek-ai/dsh-user-questions)");
18
32
  }
19
33
  const storeLabel = scope === "project" ? "本项目跨会话 store" : "跨会话全局 store";
34
+ const compactWhat = what.length > 300 ? `${what.slice(0, 300)}…` : what;
35
+ const impact = scope === "project" ? "影响:仅本项目会话可见,可回滚。" : "影响:所有会话可见,可回滚。";
20
36
  const answer = await userQuestions.ask({
21
37
  questions: [
22
38
  {
23
39
  id: "approve-global-evolve",
24
- question: `批准写入${storeLabel}?\n\n${what}`,
25
- options: [{ label: "批准" }, { label: "拒绝" }],
40
+ question: `写入${storeLabel}?\n${compactWhat}\n${impact}`,
41
+ options: [
42
+ {
43
+ label: "批准",
44
+ description: scope === "project" ? "写入,仅本项目会话可见" : "写入,所有会话可见",
45
+ },
46
+ { label: "拒绝", description: "不写入,本次跳过" },
47
+ ],
26
48
  },
27
49
  ],
28
50
  ...(agent ? { agent } : {}),
package/lib/auto.js CHANGED
@@ -744,8 +744,11 @@ export async function consultSkillEdits(ctx, agent, skillEdits, gate) {
744
744
  questions: [
745
745
  {
746
746
  id: "evolve-skill-consult",
747
- question: `自进化检测到反复出现的流程/技能候选,建议沉淀:\n\n${description}\n\n是否固化?`,
748
- options: [{ label: "固化" }, { label: "不固化" }],
747
+ question: `发现可复用的流程,建议固化为技能\n${description}\n\n固化后以后同类任务自动复用,可回滚。是否固化?`,
748
+ options: [
749
+ { label: "固化", description: "生成技能,以后复用" },
750
+ { label: "不固化", description: "本次跳过,10 回合内不再打扰" },
751
+ ],
749
752
  },
750
753
  ],
751
754
  agent,
package/lib/fate.js CHANGED
@@ -92,7 +92,10 @@ export async function consultLocalFates(ctx, agent, plan, gate) {
92
92
  {
93
93
  id: "evolve-fate-consult",
94
94
  question: consultQuestion(plan),
95
- options: [{ label: "执行" }, { label: "不执行" }],
95
+ options: [
96
+ { label: "执行", description: "提升写全局,归档隐藏本地(均可恢复)" },
97
+ { label: "不执行", description: "全部保留,10 回合内不再打扰" },
98
+ ],
96
99
  },
97
100
  ],
98
101
  agent,
@@ -112,7 +115,7 @@ function consultQuestion(plan) {
112
115
  const byKey = new Map(plan.candidates.map((candidate) => [candidateKey(candidate.kind, candidate.id), candidate]));
113
116
  const lines = [];
114
117
  if (plan.promotable.length > 0 || plan.splits.length > 0) {
115
- lines.push("【提升到跨会话全局 store】");
118
+ lines.push("【提升到全局(写入全局 store)】");
116
119
  for (const item of plan.promotable) {
117
120
  lines.push(`- ${item.key}「${byKey.get(item.key)?.title ?? item.key}」 — ${item.reason}`);
118
121
  }
@@ -121,15 +124,15 @@ function consultQuestion(plan) {
121
124
  }
122
125
  }
123
126
  if (plan.reviewArchives.length > 0) {
124
- lines.push("【归档(未被全局覆盖且源自真实对话,需确认)】");
127
+ lines.push("【归档(本地隐藏,可恢复)】");
125
128
  for (const item of plan.reviewArchives) {
126
129
  lines.push(`- ${item.key}「${byKey.get(item.key)?.title ?? item.key}」 — ${item.reason}`);
127
130
  }
128
131
  }
129
132
  return [
130
- "自进化门禁检测到本会话的 local 条目需要归宿处理(提升条目将写入跨会话全局 store,归档条目隐藏但可恢复):",
133
+ "自进化门禁:本会话 local 条目需要归宿处理",
131
134
  ...lines,
132
- "是否执行?",
135
+ "提升写入后所有会话可见,归档隐藏但可恢复。是否执行?",
133
136
  ].join("\n");
134
137
  }
135
138
  /**
@@ -190,8 +190,11 @@ export async function executeWrapupCommand(ctx, engine, invocation, policy = DEF
190
190
  questions: [
191
191
  {
192
192
  id: questionId,
193
- question: `wrapup:条目「${candidate.title}」未被全局覆盖且源自真实对话,直接归档会隐藏它(数据保留、可恢复)。确认归档?`,
194
- options: [{ label: "归档" }, { label: "保留" }],
193
+ question: `wrapup 确认归档:条目「${candidate.title}」\n未被全局覆盖且源自真实对话。归档后不再注入,数据保留、可恢复。`,
194
+ options: [
195
+ { label: "归档", description: "隐藏但可恢复" },
196
+ { label: "保留", description: "继续注入" },
197
+ ],
195
198
  },
196
199
  ],
197
200
  agent: invocation.agent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-continual-evolve",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Continual self-evolution plugin for DeepSeek Harness: versioned, auditable, rollback-safe harness state (prompt notes, memories, skills, subagent specs) refined from session trajectories.",
5
5
  "license": "MIT",
6
6
  "repository": {