dsh-workplan 1.12.3 → 2.0.2
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/CHANGELOG.md +99 -0
- package/README.en.md +17 -2
- package/README.md +41 -3
- package/docs/cc/ADV-FSP-FUNCTIONAL-SPEC.md +3 -1
- package/docs/cc/AVA-VULNERABILITY-ANALYSIS.md +9 -0
- package/docs/cc/SECURITY-TARGET.md +3 -1
- package/docs/collaboration.md +29 -2
- package/docs/release-notes-2.0.1.md +58 -0
- package/docs/release-notes-2.0.2.md +49 -0
- package/docs/release-record-2.0.1-20261105.md +113 -0
- package/lib/host.js +195 -2
- package/lib/lessons.js +378 -0
- package/lib/plan.js +37 -5
- package/lib/runtime.js +178 -2
- package/lib/three-phase.js +289 -0
- package/package.json +1 -1
- package/src/host.ts +202 -2
- package/src/lessons.ts +445 -0
- package/src/plan.ts +37 -4
- package/src/runtime.ts +184 -1
- package/src/three-phase.ts +344 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [1.13.0] 三阶段工作法:部门 Agent 的强制执行顺序。
|
|
3
|
+
*
|
|
4
|
+
* 用户要求(2026-11-05):每个部门人员收到分配的工作后,必须
|
|
5
|
+
* 1. 先全面、深入梳理「要解决的问题」;
|
|
6
|
+
* 2. 再全面、深入思考,整理出能完美完成自身工作的完整、可执行思路;
|
|
7
|
+
* 3. 只有前两步完成后,才按思路执行与验证。
|
|
8
|
+
* 全过程按先后顺序分为三个阶段:规划阶段 → 执行阶段 → 验证阶段。
|
|
9
|
+
* 阶段三允许用 dsh_workplan_verify 核验;缺 planning/execution 证据时返回 PHASE_GATE。
|
|
10
|
+
* 注意(2.0.2 更正):2026-11-05 的「第一、二阶段禁用插件」只是当次优化会话的
|
|
11
|
+
* 过程约束,不是对所有后续会话的产品规则;插件不全局禁用。
|
|
12
|
+
*
|
|
13
|
+
* 这个模块只做纯函数与常量,不依赖 harness 服务:
|
|
14
|
+
* - 校验子 Agent 回报的 `phases` 证据(缺一阶段就判未完成);
|
|
15
|
+
* - 生成阶段摘要(写进结果与日志);
|
|
16
|
+
* - 生成提示词段落(由 `buildChildPrompt` 拼进子 Agent 的提示词)。
|
|
17
|
+
*
|
|
18
|
+
* 为什么用「结构化证据」而不是只写一句提示:
|
|
19
|
+
* 只写提示词时,模型可以直接动手、最后补一句「我已规划」。把规划内容变成
|
|
20
|
+
* 收尾证据的一部分后,缺规划/缺验证的结果无法被记成 done,主 Agent 和
|
|
21
|
+
* 回放日志都能看到每个部门到底梳理了什么、按什么思路做、验证了什么。
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { type Retrospective, validateRetrospective } from './lessons.js'
|
|
25
|
+
|
|
26
|
+
/** 三阶段顺序不可颠倒;这里也是结果块里 `phases` 的键名。 */
|
|
27
|
+
export const THREE_PHASE_IDS = Object.freeze(['planning', 'execution', 'verification'] as const)
|
|
28
|
+
export const THREE_PHASE_VERSION = 1
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 「全面、深入」无法由代码度量,但可以给一个不可忽略的下限:
|
|
32
|
+
* 问题梳理与可执行思路各至少 40 个字符,避免一个词就冒充规划。
|
|
33
|
+
*/
|
|
34
|
+
export const MIN_PLANNING_PROBLEM_CHARS = 40
|
|
35
|
+
export const MIN_PLANNING_APPROACH_CHARS = 40
|
|
36
|
+
export const MAX_PHASE_LIST_ITEMS = 20
|
|
37
|
+
export const MAX_PHASE_ITEM_CHARS = 800
|
|
38
|
+
export const MAX_PHASE_TOTAL_CHARS = 6000
|
|
39
|
+
|
|
40
|
+
export type PhaseCheck = {
|
|
41
|
+
criterion: string
|
|
42
|
+
method: string
|
|
43
|
+
evidence: string
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type PlanningPhase = {
|
|
47
|
+
problemAnalysis: string[]
|
|
48
|
+
constraints: string[]
|
|
49
|
+
unknowns: string[]
|
|
50
|
+
approach: string[]
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type ExecutionPhase = {
|
|
54
|
+
steps: string[]
|
|
55
|
+
deviations: string[]
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type VerificationPhase = {
|
|
59
|
+
allPassed: boolean
|
|
60
|
+
checks: PhaseCheck[]
|
|
61
|
+
requirementCheck: string
|
|
62
|
+
/**
|
|
63
|
+
* [2.0.0] 阶段三的自我学习复盘(用户 2026-11-05 强制要求)。
|
|
64
|
+
*
|
|
65
|
+
* 三阶段仍是「规划 → 执行 → 验证」三个阶段:复盘不是第四个阶段,而是
|
|
66
|
+
* 验证阶段收尾的必填项 —— 完成之后、报 done 之前,必须把本次全过程遇到的
|
|
67
|
+
* 问题、弯路、解决方式与防再犯规则说清楚,并由 lessons.ts 落盘成永久记忆。
|
|
68
|
+
*/
|
|
69
|
+
retrospective: Retrospective
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type ThreePhases = {
|
|
73
|
+
version: number
|
|
74
|
+
planning: PlanningPhase
|
|
75
|
+
execution: ExecutionPhase
|
|
76
|
+
verification: VerificationPhase
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type PhaseValidation = {
|
|
80
|
+
ok: boolean
|
|
81
|
+
phases: ThreePhases | null
|
|
82
|
+
errors: string[]
|
|
83
|
+
/** 错误落在哪个阶段:'planning' | 'execution' | 'verification' | 'shape' */
|
|
84
|
+
failedPhase: 'planning' | 'execution' | 'verification' | 'shape' | null
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function isRecord(value: any): value is Record<string, any> {
|
|
88
|
+
return !!value && typeof value === 'object' && !Array.isArray(value)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function readTextList(
|
|
92
|
+
value: any,
|
|
93
|
+
field: string,
|
|
94
|
+
errors: string[],
|
|
95
|
+
options: { required: boolean; minItems?: number },
|
|
96
|
+
) {
|
|
97
|
+
if (value === undefined || value === null) {
|
|
98
|
+
if (options.required) errors.push(`${field} 缺失`)
|
|
99
|
+
return []
|
|
100
|
+
}
|
|
101
|
+
if (!Array.isArray(value)) {
|
|
102
|
+
errors.push(`${field} 必须是数组`)
|
|
103
|
+
return []
|
|
104
|
+
}
|
|
105
|
+
const items = value
|
|
106
|
+
.map((item: any) => (typeof item === 'string' ? item.trim() : ''))
|
|
107
|
+
.filter(Boolean)
|
|
108
|
+
if (options.required && items.length < (options.minItems ?? 1)) {
|
|
109
|
+
errors.push(`${field} 至少需要 ${options.minItems ?? 1} 条非空内容`)
|
|
110
|
+
return items.slice(0, MAX_PHASE_LIST_ITEMS)
|
|
111
|
+
}
|
|
112
|
+
if (items.length > MAX_PHASE_LIST_ITEMS) {
|
|
113
|
+
errors.push(`${field} 超过 ${MAX_PHASE_LIST_ITEMS} 条上限`)
|
|
114
|
+
}
|
|
115
|
+
return items.slice(0, MAX_PHASE_LIST_ITEMS).map((item: string) => item.slice(0, MAX_PHASE_ITEM_CHARS))
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function totalChars(items: string[]) {
|
|
119
|
+
return items.reduce((sum, item) => sum + item.length, 0)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Same matching rules as `src/plan.ts#acceptanceCoverage` (Q6 / U-16):
|
|
124
|
+
* stable A1…An numbering, exact full text, or a longer text containing the
|
|
125
|
+
* full criterion. A partial copy must not count as coverage.
|
|
126
|
+
*
|
|
127
|
+
* Kept local to avoid importing plan.ts (which imports this module); the
|
|
128
|
+
* rules are pinned by tests on both sides.
|
|
129
|
+
*/
|
|
130
|
+
function normaliseCriterion(value: any) {
|
|
131
|
+
return String(value ?? '')
|
|
132
|
+
.toLowerCase()
|
|
133
|
+
.replace(/[\s,。;、,.;::!!??"'“”‘’()()\[\]【】《》<>]/g, '')
|
|
134
|
+
.replace(/^(必须|需要|应当|应该|请|务必)/, '')
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function missingCriteria(expected: any, checks: PhaseCheck[]) {
|
|
138
|
+
const want = (Array.isArray(expected) ? expected : []).map(normaliseCriterion)
|
|
139
|
+
const got = checks.map((check) => normaliseCriterion(check.criterion)).filter(Boolean)
|
|
140
|
+
const missing: string[] = []
|
|
141
|
+
for (const [index, criterion] of want.entries()) {
|
|
142
|
+
if (!criterion) continue
|
|
143
|
+
const id = new RegExp(`(^|[^a-z0-9])a${index + 1}([^0-9]|$)`)
|
|
144
|
+
const covered = got.some((row) => {
|
|
145
|
+
if (row === criterion) return true
|
|
146
|
+
if (id.test(row)) return true
|
|
147
|
+
if (Math.min(row.length, criterion.length) < 6) return false
|
|
148
|
+
return row.includes(criterion)
|
|
149
|
+
})
|
|
150
|
+
if (!covered) missing.push(`A${index + 1}`)
|
|
151
|
+
}
|
|
152
|
+
return missing
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Parse + validate the `phases` object from a child's evidence block.
|
|
157
|
+
*
|
|
158
|
+
* `expectedAcceptance` is the plan's own acceptance table. When present, every
|
|
159
|
+
* criterion must have a verification check; a shorter list is treated as an
|
|
160
|
+
* incomplete phase-3 verification rather than "some checks are better than none".
|
|
161
|
+
*/
|
|
162
|
+
export function validatePhaseEvidence(value: any, expectedAcceptance: any = []): PhaseValidation {
|
|
163
|
+
const errors: string[] = []
|
|
164
|
+
let failedPhase: PhaseValidation['failedPhase'] = null
|
|
165
|
+
const fail = (phase: NonNullable<PhaseValidation['failedPhase']>, message: string) => {
|
|
166
|
+
errors.push(message)
|
|
167
|
+
if (failedPhase === null) failedPhase = phase
|
|
168
|
+
}
|
|
169
|
+
if (!isRecord(value)) {
|
|
170
|
+
return {
|
|
171
|
+
ok: false,
|
|
172
|
+
phases: null,
|
|
173
|
+
errors: ['phases 缺失:必须提交 planning / execution / verification 三阶段证据'],
|
|
174
|
+
failedPhase: 'shape',
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
const planningRaw = isRecord(value.planning) ? value.planning : null
|
|
178
|
+
if (!planningRaw) fail('planning', 'phases.planning 缺失(阶段一:先梳理问题,再形成可执行思路)')
|
|
179
|
+
const executionRaw = isRecord(value.execution) ? value.execution : null
|
|
180
|
+
if (!executionRaw) fail('execution', 'phases.execution 缺失(阶段二:按阶段一的思路执行)')
|
|
181
|
+
const verificationRaw = isRecord(value.verification) ? value.verification : null
|
|
182
|
+
if (!verificationRaw) fail('verification', 'phases.verification 缺失(阶段三:逐条验证)')
|
|
183
|
+
|
|
184
|
+
const planning: PlanningPhase = {
|
|
185
|
+
problemAnalysis: readTextList(planningRaw?.problemAnalysis, 'phases.planning.problemAnalysis', errors, {
|
|
186
|
+
required: !!planningRaw,
|
|
187
|
+
minItems: 1,
|
|
188
|
+
}),
|
|
189
|
+
constraints: readTextList(planningRaw?.constraints, 'phases.planning.constraints', errors, { required: false }),
|
|
190
|
+
unknowns: readTextList(planningRaw?.unknowns, 'phases.planning.unknowns', errors, { required: false }),
|
|
191
|
+
approach: readTextList(planningRaw?.approach, 'phases.planning.approach', errors, {
|
|
192
|
+
required: !!planningRaw,
|
|
193
|
+
minItems: 1,
|
|
194
|
+
}),
|
|
195
|
+
}
|
|
196
|
+
if (errors.some((item) => item.startsWith('phases.planning.problemAnalysis'))) failedPhase ||= 'planning'
|
|
197
|
+
if (errors.some((item) => item.startsWith('phases.planning.approach'))) failedPhase ||= 'planning'
|
|
198
|
+
if (planning.problemAnalysis.length > 0 && totalChars(planning.problemAnalysis) < MIN_PLANNING_PROBLEM_CHARS) {
|
|
199
|
+
fail('planning', `phases.planning.problemAnalysis 太薄(合计 ${totalChars(planning.problemAnalysis)} 字,至少 ${MIN_PLANNING_PROBLEM_CHARS} 字):要逐条写清现状、约束、未知与主要矛盾`)
|
|
200
|
+
}
|
|
201
|
+
if (planning.approach.length > 0 && totalChars(planning.approach) < MIN_PLANNING_APPROACH_CHARS) {
|
|
202
|
+
fail('planning', `phases.planning.approach 太薄(合计 ${totalChars(planning.approach)} 字,至少 ${MIN_PLANNING_APPROACH_CHARS} 字):要写出完整可执行的步骤,而不是一句目标`)
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const execution: ExecutionPhase = {
|
|
206
|
+
steps: readTextList(executionRaw?.steps, 'phases.execution.steps', errors, {
|
|
207
|
+
required: !!executionRaw,
|
|
208
|
+
minItems: 1,
|
|
209
|
+
}),
|
|
210
|
+
deviations: readTextList(executionRaw?.deviations, 'phases.execution.deviations', errors, { required: false }),
|
|
211
|
+
}
|
|
212
|
+
if (errors.some((item) => item.startsWith('phases.execution'))) failedPhase ||= 'execution'
|
|
213
|
+
|
|
214
|
+
const retroCheck = validateRetrospective(verificationRaw?.retrospective)
|
|
215
|
+
for (const error of retroCheck.errors) fail('verification', error)
|
|
216
|
+
const verification: VerificationPhase = {
|
|
217
|
+
allPassed: verificationRaw?.allPassed === true,
|
|
218
|
+
checks: [],
|
|
219
|
+
requirementCheck: typeof verificationRaw?.requirementCheck === 'string'
|
|
220
|
+
? verificationRaw.requirementCheck.trim().slice(0, MAX_PHASE_ITEM_CHARS)
|
|
221
|
+
: '',
|
|
222
|
+
retrospective: retroCheck.retrospective,
|
|
223
|
+
}
|
|
224
|
+
if (verificationRaw && verificationRaw.allPassed !== true) {
|
|
225
|
+
fail('verification', 'phases.verification.allPassed 必须为 true:只要有一条验收标准未通过或未验证,就不得报 done')
|
|
226
|
+
}
|
|
227
|
+
if (!Array.isArray(verificationRaw?.checks)) {
|
|
228
|
+
if (verificationRaw) fail('verification', 'phases.verification.checks 必须是数组')
|
|
229
|
+
} else {
|
|
230
|
+
verification.checks = verificationRaw.checks
|
|
231
|
+
.slice(0, MAX_PHASE_LIST_ITEMS)
|
|
232
|
+
.map((item: any, index: number): PhaseCheck => {
|
|
233
|
+
if (!isRecord(item)) {
|
|
234
|
+
fail('verification', `phases.verification.checks[${index}] 必须是对象(criterion / method / evidence)`)
|
|
235
|
+
return { criterion: '', method: '', evidence: '' }
|
|
236
|
+
}
|
|
237
|
+
const check: PhaseCheck = {
|
|
238
|
+
criterion: typeof item.criterion === 'string' ? item.criterion.trim().slice(0, MAX_PHASE_ITEM_CHARS) : '',
|
|
239
|
+
method: typeof item.method === 'string' ? item.method.trim().slice(0, MAX_PHASE_ITEM_CHARS) : '',
|
|
240
|
+
evidence: typeof item.evidence === 'string' ? item.evidence.trim().slice(0, MAX_PHASE_ITEM_CHARS) : '',
|
|
241
|
+
}
|
|
242
|
+
if (!check.criterion) fail('verification', `phases.verification.checks[${index}].criterion 不能为空`)
|
|
243
|
+
if (!check.method) fail('verification', `phases.verification.checks[${index}].method 不能为空(用什么方式验证)`)
|
|
244
|
+
if (!check.evidence) fail('verification', `phases.verification.checks[${index}].evidence 不能为空(命令输出/文件/引用)`)
|
|
245
|
+
return check
|
|
246
|
+
})
|
|
247
|
+
if (verification.checks.length === 0) {
|
|
248
|
+
fail('verification', 'phases.verification.checks 至少需要一条逐项验证记录')
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
const expected = Array.isArray(expectedAcceptance) ? expectedAcceptance.filter(Boolean) : []
|
|
252
|
+
if (expected.length > 0 && verification.checks.length < expected.length) {
|
|
253
|
+
fail(
|
|
254
|
+
'verification',
|
|
255
|
+
`phases.verification.checks 只验证了 ${verification.checks.length} 项,少于验收标准的 ${expected.length} 项:每条验收标准都要有验证记录`,
|
|
256
|
+
)
|
|
257
|
+
}
|
|
258
|
+
if (expected.length > 0) {
|
|
259
|
+
const missing = missingCriteria(expected, verification.checks)
|
|
260
|
+
if (missing.length > 0) {
|
|
261
|
+
fail(
|
|
262
|
+
'verification',
|
|
263
|
+
`phases.verification.checks 未逐条覆盖验收标准:缺少 ${missing.join('、')}(可按 A1/A2 编号对号入座,或写完整原文;只写一部分不算覆盖)`,
|
|
264
|
+
)
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const phases: ThreePhases = {
|
|
269
|
+
version: THREE_PHASE_VERSION,
|
|
270
|
+
planning,
|
|
271
|
+
execution,
|
|
272
|
+
verification,
|
|
273
|
+
}
|
|
274
|
+
const total = [
|
|
275
|
+
...planning.problemAnalysis,
|
|
276
|
+
...planning.constraints,
|
|
277
|
+
...planning.unknowns,
|
|
278
|
+
...planning.approach,
|
|
279
|
+
...execution.steps,
|
|
280
|
+
...execution.deviations,
|
|
281
|
+
verification.requirementCheck,
|
|
282
|
+
].reduce((sum, item) => sum + item.length, 0)
|
|
283
|
+
if (total > MAX_PHASE_TOTAL_CHARS) {
|
|
284
|
+
fail('shape', `phases 合计超过 ${MAX_PHASE_TOTAL_CHARS} 字,请压缩到可核对的事实,不要粘贴大段日志`)
|
|
285
|
+
}
|
|
286
|
+
return { ok: errors.length === 0, phases: errors.length === 0 ? phases : null, errors, failedPhase }
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Which stage a caller is allowed to be in, judged only by the evidence it sent.
|
|
291
|
+
*
|
|
292
|
+
* Used by `dsh_workplan_verify`: planning/execution gaps mean the caller is
|
|
293
|
+
* still in phase 1 or 2, where the plugin is disabled by the user's rule.
|
|
294
|
+
*/
|
|
295
|
+
export function phaseGateFromErrors(errors: string[]): 'phase-1-2' | 'verification' {
|
|
296
|
+
return errors.some((item) => /^phases(\.| 缺失)/.test(item) && /planning|execution/.test(item))
|
|
297
|
+
? 'phase-1-2'
|
|
298
|
+
: 'verification'
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/** One-line, model-readable summary of what the three phases contain. */
|
|
302
|
+
export function phaseSummaryLine(phases: ThreePhases): string {
|
|
303
|
+
const deviations = phases.execution.deviations.length
|
|
304
|
+
return [
|
|
305
|
+
`阶段一 规划(问题梳理 ${phases.planning.problemAnalysis.length} 条 / 可执行思路 ${phases.planning.approach.length} 步)`,
|
|
306
|
+
`阶段二 执行(${phases.execution.steps.length} 步${deviations ? ` / 偏离 ${deviations} 处` : ''})`,
|
|
307
|
+
`阶段三 验证(${phases.verification.checks.length} 项${phases.verification.allPassed ? ',全部通过' : ',未全部通过'};`
|
|
308
|
+
+ `复盘 ${phases.verification.retrospective.problems.length} 个问题 / `
|
|
309
|
+
+ `${phases.verification.retrospective.detours.length} 条弯路 / `
|
|
310
|
+
+ `${phases.verification.retrospective.prevention.length} 条防再犯规则)`,
|
|
311
|
+
].join(';')
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Prompt paragraphs injected into every department child.
|
|
316
|
+
*
|
|
317
|
+
* Kept in this module so the wording and the validator above are one contract:
|
|
318
|
+
* changing what is demanded without changing what is checked would make the
|
|
319
|
+
* prompt lie about completion.
|
|
320
|
+
*/
|
|
321
|
+
export function threePhasePromptLines(): string[] {
|
|
322
|
+
return [
|
|
323
|
+
'三阶段工作法(用户强制要求;顺序不可颠倒,阶段一没有产出思路之前禁止动手执行):',
|
|
324
|
+
'【阶段一 · 规划阶段】',
|
|
325
|
+
' 1) 先全面、深入梳理要解决的问题:逐条写清现状与已知事实、约束条件、未知/待确认项、主要矛盾、工作边界;',
|
|
326
|
+
' 2) 再全面、深入思考,整理出能完美完成本子任务的完整、可执行思路:每一步做什么、产出什么、依赖什么、风险与对策、如何证明做对了;',
|
|
327
|
+
' 3) 自检:任何一条验收标准或用户原要求没有落在思路上,就回到第 1 步重做;思路不完整不得进入阶段二。',
|
|
328
|
+
'【阶段二 · 执行阶段】',
|
|
329
|
+
' 严格按阶段一整理出的思路执行。出现新事实需要偏离时,必须记录偏离原因、证据与调整后的做法,不得静默改道。',
|
|
330
|
+
'【阶段三 · 验证阶段】',
|
|
331
|
+
' 执行完成后逐条验证验收标准与用户原要求:每条都要有可复核的证据(命令输出/文件/引用);验证未通过不得报 done,无法确认写 unverified。',
|
|
332
|
+
'【阶段三收尾 · 自我学习复盘(强制)】',
|
|
333
|
+
' 报 done 之前必须把 phases.verification.retrospective 写全,四项缺一不可:',
|
|
334
|
+
' 1) problems:本次全过程遇到的所有问题(现象 + 根因),至少 1 条;',
|
|
335
|
+
' 2) detours:走过的弯路、返工与无效尝试(确实没有就写空数组 [],不要编造);',
|
|
336
|
+
' 3) resolutions:最终是如何解决上述问题的,至少 1 条,可与 problems 一一对应;',
|
|
337
|
+
' 4) prevention:以后如何预防再犯,至少 1 条,必须写成「遇到…先…」的可执行硬规则。',
|
|
338
|
+
' 插件会在完成判定时复核这四项,并在通过后把复盘写入永久记忆文件;下次派发同类任务时,历史教训会自动出现在提示词里。',
|
|
339
|
+
'插件使用说明(三阶段证据门禁):',
|
|
340
|
+
' - 阶段一、二:先把问题梳理、可执行思路与执行记录写全;此时不要调用 dsh_workplan_verify,它会因缺少前两阶段证据返回 PHASE_GATE 与待补项(这是证据门禁,不是禁用插件)。',
|
|
341
|
+
' - 阶段三:可以调用 dsh_workplan_verify 让插件做最终核验:提交 planning / execution / verification 三阶段证据,插件返回 passed 或仍需补齐的 gaps;未通过先修复再回报。遇阻时可用 dsh_workplan_escalate 上报,它是安全通道,不属于三阶段产物。',
|
|
342
|
+
' - 结果块里的 phases 是必填项:缺任一阶段、内容为空、或验证未全部通过,插件都会判为未完成,不能用 done 收尾。',
|
|
343
|
+
]
|
|
344
|
+
}
|