dsh-dev-plan-presets 0.3.0 → 0.4.0
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 +15 -8
- package/client.js +628 -90
- package/cordis.patch.yml +2 -0
- package/detail.md +12 -4
- package/docs/v0.4-perf-optimization-plan.md +349 -0
- package/guard.js +189 -6
- package/index.js +112 -24
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +1 -1
- package/preset.js +253 -267
- package/scripts/verify-presets.mjs +357 -153
- package/settings.js +34 -0
- package/test/plugin.test.mjs +525 -81
|
@@ -80,25 +80,6 @@ const findTool = (definition, toolName) =>
|
|
|
80
80
|
(row) => row?.name === '@deepseek-ai/dsh-tool-subagent' && row?.config?.toolName === toolName,
|
|
81
81
|
)
|
|
82
82
|
|
|
83
|
-
const extractTemplate = (text, name) => {
|
|
84
|
-
if (typeof text !== 'string') return null
|
|
85
|
-
const expression = new RegExp(
|
|
86
|
-
`^[ \\t]*=+ ROLE-TEMPLATE:${name}:BEGIN =+[ \\t]*\\r?\\n([\\s\\S]*?)^[ \\t]*=+ ROLE-TEMPLATE:${name}:END =+[ \\t]*$`,
|
|
87
|
-
'm',
|
|
88
|
-
)
|
|
89
|
-
const match = expression.exec(text)
|
|
90
|
-
return match ? match[1] : null
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const numberedRules = (text) => {
|
|
94
|
-
const rules = new Map()
|
|
95
|
-
for (const line of String(text ?? '').split(/\r?\n/)) {
|
|
96
|
-
const match = /^\s*(\d+)\.\s+(.+?)\s*$/.exec(line)
|
|
97
|
-
if (match) rules.set(Number(match[1]), match[2])
|
|
98
|
-
}
|
|
99
|
-
return rules
|
|
100
|
-
}
|
|
101
|
-
|
|
102
83
|
const globCovers = (pattern, rel) => {
|
|
103
84
|
if (!pattern.includes('*')) {
|
|
104
85
|
const directory = pattern.replace(/\/+$/, '')
|
|
@@ -142,14 +123,64 @@ export async function loadSurface() {
|
|
|
142
123
|
presets: [{ id: 'dev-plan', name: '开发规划与交付' }],
|
|
143
124
|
catalogChecked: true,
|
|
144
125
|
})
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
126
|
+
const scoutSelfMode = modules.preset.resolveDevelopMode({
|
|
127
|
+
requestedMode: 'dev-plan-scout',
|
|
128
|
+
presets: [{ id: 'dev-plan-scout' }],
|
|
129
|
+
catalogChecked: true,
|
|
130
|
+
})
|
|
131
|
+
const scribeSelfMode = modules.preset.resolveDevelopMode({
|
|
132
|
+
requestedMode: 'dev-plan-scribe',
|
|
133
|
+
presets: [{ id: 'dev-plan-scribe' }],
|
|
134
|
+
catalogChecked: true,
|
|
135
|
+
})
|
|
136
|
+
const internalActive = { scout: false, scribe: false }
|
|
137
|
+
const standard = modules.preset.buildPresetDefinition({
|
|
138
|
+
settings: base,
|
|
139
|
+
mode: standardMode,
|
|
140
|
+
internalPresets: internalActive,
|
|
141
|
+
})
|
|
142
|
+
const standardFallbackSub = modules.preset.buildPresetDefinition({
|
|
143
|
+
settings: base,
|
|
144
|
+
mode: standardMode,
|
|
145
|
+
internalPresets: { scout: false, scribe: false },
|
|
146
|
+
})
|
|
147
|
+
const noneMode = modules.preset.buildPresetDefinition({
|
|
148
|
+
settings: { ...base, mainToolMode: 'none' },
|
|
149
|
+
mode: standardMode,
|
|
150
|
+
internalPresets: internalActive,
|
|
151
|
+
})
|
|
152
|
+
const readonlyMode = modules.preset.buildPresetDefinition({
|
|
153
|
+
settings: { ...base, mainToolMode: 'readonly' },
|
|
154
|
+
mode: standardMode,
|
|
155
|
+
internalPresets: internalActive,
|
|
156
|
+
})
|
|
157
|
+
const askEditMode = modules.preset.buildPresetDefinition({
|
|
158
|
+
settings: { ...base, mainToolMode: 'ask-edit' },
|
|
159
|
+
mode: standardMode,
|
|
160
|
+
internalPresets: internalActive,
|
|
161
|
+
})
|
|
162
|
+
const fallback = modules.preset.buildPresetDefinition({
|
|
163
|
+
settings: base,
|
|
164
|
+
mode: fallbackMode,
|
|
165
|
+
internalPresets: internalActive,
|
|
166
|
+
})
|
|
167
|
+
const deepPtc = modules.preset.buildPresetDefinition({
|
|
168
|
+
settings: base,
|
|
169
|
+
mode: deepPtcMode,
|
|
170
|
+
internalPresets: internalActive,
|
|
171
|
+
})
|
|
172
|
+
const custom = modules.preset.buildPresetDefinition({
|
|
173
|
+
settings: base,
|
|
174
|
+
mode: customMode,
|
|
175
|
+
internalPresets: internalActive,
|
|
176
|
+
})
|
|
149
177
|
const withEffort = modules.preset.buildPresetDefinition({
|
|
150
178
|
settings: { ...base, childReasoningEffort: 'high' },
|
|
151
179
|
mode: standardMode,
|
|
180
|
+
internalPresets: internalActive,
|
|
152
181
|
})
|
|
182
|
+
const scoutPreset = modules.preset.buildScoutPresetDefinition()
|
|
183
|
+
const scribePreset = modules.preset.buildScribePresetDefinition()
|
|
153
184
|
return {
|
|
154
185
|
root: ROOT,
|
|
155
186
|
pkg: pkgRead.value,
|
|
@@ -163,13 +194,23 @@ export async function loadSurface() {
|
|
|
163
194
|
files,
|
|
164
195
|
modules,
|
|
165
196
|
standard,
|
|
197
|
+
standardFallbackSub,
|
|
198
|
+
noneMode,
|
|
199
|
+
readonlyMode,
|
|
200
|
+
askEditMode,
|
|
201
|
+
scoutPreset,
|
|
202
|
+
scribePreset,
|
|
166
203
|
fallback,
|
|
167
204
|
deepPtc,
|
|
168
205
|
custom,
|
|
169
206
|
selfFallback: selfMode,
|
|
207
|
+
scoutSelfFallback: scoutSelfMode,
|
|
208
|
+
scribeSelfFallback: scribeSelfMode,
|
|
170
209
|
withEffort,
|
|
171
210
|
constants: {
|
|
172
211
|
presetId: modules.preset.PRESET_ID,
|
|
212
|
+
scoutPresetId: modules.preset.SCOUT_PRESET_ID,
|
|
213
|
+
scribePresetId: modules.preset.SCRIBE_PRESET_ID,
|
|
173
214
|
presetName: modules.preset.PRESET_NAME,
|
|
174
215
|
order: modules.preset.PRESET_ORDER,
|
|
175
216
|
deepPtcId: modules.preset.DEEP_PTC_PRESET_ID,
|
|
@@ -181,12 +222,30 @@ export async function loadSurface() {
|
|
|
181
222
|
export function checksFor(surface) {
|
|
182
223
|
const results = []
|
|
183
224
|
const check = (ok, label, detail = '') => results.push({ ok: Boolean(ok), label, detail: String(detail) })
|
|
184
|
-
const {
|
|
225
|
+
const {
|
|
226
|
+
pkg,
|
|
227
|
+
pkgError,
|
|
228
|
+
files,
|
|
229
|
+
standard,
|
|
230
|
+
standardFallbackSub,
|
|
231
|
+
noneMode,
|
|
232
|
+
readonlyMode,
|
|
233
|
+
askEditMode,
|
|
234
|
+
scoutPreset,
|
|
235
|
+
scribePreset,
|
|
236
|
+
fallback,
|
|
237
|
+
deepPtc,
|
|
238
|
+
custom,
|
|
239
|
+
withEffort,
|
|
240
|
+
readme,
|
|
241
|
+
detail,
|
|
242
|
+
locale,
|
|
243
|
+
} = surface
|
|
185
244
|
|
|
186
245
|
// ── 打包层 ────────────────────────────────────────────────────────────────
|
|
187
246
|
check(pkgError === null, 'package.json 是合法 JSON', pkgError ?? '')
|
|
188
247
|
check(pkg?.name === 'dsh-dev-plan-presets', 'package.json name', pkg?.name)
|
|
189
|
-
check(pkg?.version === '0.
|
|
248
|
+
check(pkg?.version === '0.4.0', 'package.json version=0.4.0', pkg?.version)
|
|
190
249
|
check(pkg?.type === 'module', 'package.json type=module')
|
|
191
250
|
check(pkg?.private === false, 'package.json private=false(可开源发布)', String(pkg?.private))
|
|
192
251
|
check(pkg?.license === 'MIT', 'package.json license=MIT', pkg?.license)
|
|
@@ -246,6 +305,8 @@ export function checksFor(surface) {
|
|
|
246
305
|
check(/developMode:\s*standard/.test(patchText), '根补丁默认 developMode=standard')
|
|
247
306
|
check(/modelGuardMode:\s*pin/.test(patchText), '根补丁默认 modelGuardMode=pin')
|
|
248
307
|
check(/guardAllSubagents:\s*false/.test(patchText), '根补丁默认 guardAllSubagents=false')
|
|
308
|
+
check(/mainToolMode:\s*ask-edit/.test(patchText), '根补丁默认 mainToolMode=ask-edit')
|
|
309
|
+
check(/mainStepWarnThreshold:\s*6/.test(patchText), '根补丁默认 mainStepWarnThreshold=6')
|
|
249
310
|
check(/childProvider:\s*dsh-opencode-go/.test(patchText), '根补丁默认 provider=dsh-opencode-go')
|
|
250
311
|
check(/childModel:\s*deepseek-v4\.1-flash/.test(patchText), '根补丁默认 model=deepseek-v4.1-flash')
|
|
251
312
|
|
|
@@ -266,7 +327,10 @@ export function checksFor(surface) {
|
|
|
266
327
|
}
|
|
267
328
|
check(/ctx\.inject\(\['agentPresets'\]/.test(indexSource), 'index.js 通过 ctx.inject 等待 agentPresets')
|
|
268
329
|
check(/registry\.register\(definition\)/.test(indexSource), 'index.js 真的调用 agentPresets.register')
|
|
269
|
-
check(/
|
|
330
|
+
check(/releaseAll/.test(indexSource) && /child\.effect/.test(indexSource), '动态 preset disposer 交还给 ctx.effect')
|
|
331
|
+
check(/stateVersion/.test(indexSource) && /bumpState/.test(indexSource) && /etag/i.test(indexSource) && /304/.test(indexSource), 'index.js 支持 stateVersion + ETag 304')
|
|
332
|
+
check(/state\.mode\?\.fallback === true \|\| state\.presets\.checked !== true/.test(indexSource), 'index.js scheduleVerification 跳过已命中目标时的冗余二次全量探测')
|
|
333
|
+
check(/prewarmModelCatalog/.test(indexSource) && /installMainStepBudget/.test(indexSource), 'index.js 包含模型目录空闲预热与主窗步数软提醒')
|
|
270
334
|
check(/agent\/created/.test(guardSource), '模型守门监听 agent/created')
|
|
271
335
|
check(/agent\/pre-step/.test(guardSource), '模型守门监听 agent/pre-step')
|
|
272
336
|
check(/kind:\s*'reject'/.test(guardSource), '模型守门越界返回 reject')
|
|
@@ -274,6 +338,8 @@ export function checksFor(surface) {
|
|
|
274
338
|
check(/parent\?\.inject|parent\.inject/.test(guardSource), '模型守门通知父会话')
|
|
275
339
|
check(/parentSession/.test(guardSource) && /origin === 'subagent'/.test(guardSource), '模型守门只认子代理 header')
|
|
276
340
|
check(/agent\/disposed/.test(guardSource), '模型守门监听 agent/disposed 清理 step guard')
|
|
341
|
+
check(/installMainStepBudget/.test(guardSource) && /mainToolMode/.test(guardSource), 'guard.js 提供主窗步数预算软提醒(永不 select/cancel)')
|
|
342
|
+
check(/onDispose/.test(guardSource) && /if \(stopped\) return \{ kind: 'reject' \}/.test(guardSource), 'guard.js 支持 effect 同步清理 steps 与 stopped 前置短路')
|
|
277
343
|
check(
|
|
278
344
|
/guardAllSubagents !== true/.test(guardSource) && /presetForSession/.test(guardSource),
|
|
279
345
|
'guard 默认按父会话 dev-plan 限制,并优先用 presetForSession',
|
|
@@ -320,9 +386,12 @@ export function checksFor(surface) {
|
|
|
320
386
|
check(/fetch\(API \+ '\/state'/.test(clientSource), 'client 读取 Host state 路由')
|
|
321
387
|
check(/fetch\(API \+ '\/config'/.test(clientSource) && /method:\s*'POST'/.test(clientSource), 'client 通过 Host 路由保存配置')
|
|
322
388
|
check(!/subagent-model-pin/.test(clientSource), 'client 不复用旧插件 id/路由')
|
|
323
|
-
for (const marker of ['developMode', 'childProvider', 'childModel', 'childReasoningEffort', 'modelGuardMode', 'killOnViolation', 'honorExplicit', 'audit', 'guardAllSubagents']) {
|
|
389
|
+
for (const marker of ['developMode', 'childProvider', 'childModel', 'childReasoningEffort', 'modelGuardMode', 'killOnViolation', 'honorExplicit', 'audit', 'guardAllSubagents', 'mainToolMode', 'mainStepWarnThreshold']) {
|
|
324
390
|
check(clientSource.includes(marker), `client 设置页包含字段 ${marker}`)
|
|
325
391
|
}
|
|
392
|
+
check(/if-none-match/.test(clientSource) && /304/.test(clientSource) && /stateVersion/.test(clientSource), 'client 支持 ETag/304 与 stateVersion 跳过重渲染')
|
|
393
|
+
check(/FAST_POLL_MS = 700/.test(clientSource) && /IDLE_POLL_MS = 30000/.test(clientSource) && /visibilitychange/.test(clientSource) && !/setInterval\(/.test(clientSource), 'client 使用自适应轮询与不可见暂停')
|
|
394
|
+
check(/React\.useMemo/.test(clientSource) && /timersRef/.test(clientSource) && /AbortController/.test(clientSource), 'client 使用 useMemo 与定时器/请求清理')
|
|
326
395
|
check(/state.presets/.test(clientSource) && /presetRows/.test(clientSource), 'client 从 /state 动态列出预设')
|
|
327
396
|
check(!/value: *'deep-ptc'/.test(clientSource), 'client 不再硬编码 deep-ptc 选项')
|
|
328
397
|
check(
|
|
@@ -392,7 +461,7 @@ export function checksFor(surface) {
|
|
|
392
461
|
check(/放弃修改并刷新/.test(clientSource), 'client dirty 时刷新明确标记为放弃修改')
|
|
393
462
|
check(/设置路由未注册/.test(clientSource) && /settings route is not registered/i.test(clientSource), 'client 404 给出可执行指引')
|
|
394
463
|
check(/stopped\.current/.test(clientSource), 'client 连续 404 停止自动轮询')
|
|
395
|
-
check(/
|
|
464
|
+
check(/scheduleRefresh\(600\)/.test(clientSource) && /scheduleRefresh\(1800\)/.test(clientSource), 'client 保存后可在 HMR 404 后重试回读')
|
|
396
465
|
check(/registration === 'pending'/.test(clientSource) && /registration === 'failed'/.test(clientSource) && /registration === 'switching'/.test(clientSource), 'client 显示 pending/failed/switching 状态')
|
|
397
466
|
check(/施工方式/.test(clientSource) && /守门方式/.test(clientSource), 'client 两个模式 label 已区分')
|
|
398
467
|
check(/只记录,不阻止/.test(clientSource) && /记录详细日志/.test(clientSource), 'client 区分守门 audit 与审计日志开关')
|
|
@@ -410,8 +479,25 @@ export function checksFor(surface) {
|
|
|
410
479
|
check(typeof standard?.description === 'string' && standard.description.length > 0, 'preset 有动态 description')
|
|
411
480
|
check(/standard/.test(standard?.description ?? ''), '默认 description 写明 standard')
|
|
412
481
|
|
|
482
|
+
const noneModeRows = flattenPlugins(noneMode?.plugins)
|
|
413
483
|
for (const forbidden of surface.modules.preset.FORBIDDEN_MAIN_PLUGINS) {
|
|
414
|
-
check(!
|
|
484
|
+
check(!noneModeRows.some((row) => row?.name === forbidden), `主窗(none)不挂载 ${forbidden}`)
|
|
485
|
+
}
|
|
486
|
+
for (const neverMain of [
|
|
487
|
+
'@deepseek-ai/dsh-tool-bash',
|
|
488
|
+
'@deepseek-ai/dsh-tool-pwsh',
|
|
489
|
+
'@deepseek-ai/dsh-tool-workflow',
|
|
490
|
+
'@deepseek-ai/dsh-tool-jobs',
|
|
491
|
+
'@deepseek-ai/dsh-tool-schedule',
|
|
492
|
+
'@deepseek-ai/dsh-tool-goal',
|
|
493
|
+
'@deepseek-ai/dsh-tool-skill',
|
|
494
|
+
'@deepseek-ai/dsh-tool-todo',
|
|
495
|
+
'@deepseek-ai/dsh-tool-present',
|
|
496
|
+
'@deepseek-ai/dsh-tool-subagent-fork',
|
|
497
|
+
'@deepseek-ai/dsh-skill-filesystem',
|
|
498
|
+
'@deepseek-ai/dsh-plan-mode',
|
|
499
|
+
]) {
|
|
500
|
+
check(!standardRows.some((row) => row?.name === neverMain), `主窗默认(ask-edit)不挂载 ${neverMain}`)
|
|
415
501
|
}
|
|
416
502
|
for (const required of [
|
|
417
503
|
'@deepseek-ai/dsh-persona',
|
|
@@ -435,9 +521,71 @@ export function checksFor(surface) {
|
|
|
435
521
|
for (const name of ['recon', 'review', 'scribe']) {
|
|
436
522
|
check(
|
|
437
523
|
toolRows.find((row) => row?.config?.toolName === name)?.config?.agentPreset === 'standard',
|
|
438
|
-
`${name}
|
|
524
|
+
`${name} 使用 standard(避免在预设下拉暴露额外选项)`,
|
|
439
525
|
)
|
|
440
526
|
}
|
|
527
|
+
|
|
528
|
+
// ── mainToolMode 三档与内部轻量子预设插件面 ─────────────────────────────
|
|
529
|
+
const forbiddenSubagentPkgs = [
|
|
530
|
+
'@deepseek-ai/dsh-tool-bash',
|
|
531
|
+
'@deepseek-ai/dsh-tool-pwsh',
|
|
532
|
+
'@deepseek-ai/dsh-tool-workflow',
|
|
533
|
+
'@deepseek-ai/dsh-tool-jobs',
|
|
534
|
+
'@deepseek-ai/dsh-tool-schedule',
|
|
535
|
+
'@deepseek-ai/dsh-tool-goal',
|
|
536
|
+
'@deepseek-ai/dsh-tool-skill',
|
|
537
|
+
'@deepseek-ai/dsh-tool-todo',
|
|
538
|
+
'@deepseek-ai/dsh-tool-subagent',
|
|
539
|
+
'@deepseek-ai/dsh-plan-mode',
|
|
540
|
+
]
|
|
541
|
+
const scoutRows = flattenPlugins(scoutPreset?.plugins)
|
|
542
|
+
const scribeRows = flattenPlugins(scribePreset?.plugins)
|
|
543
|
+
for (const pkgName of forbiddenSubagentPkgs) {
|
|
544
|
+
check(!scoutRows.some((r) => r?.name === pkgName), `dev-plan-scout 不含 ${pkgName}`)
|
|
545
|
+
check(!scribeRows.some((r) => r?.name === pkgName), `dev-plan-scribe 不含 ${pkgName}`)
|
|
546
|
+
}
|
|
547
|
+
check(
|
|
548
|
+
scoutRows.find((r) => r?.name === '@deepseek-ai/dsh-tool-fs')?.config?.applyPatch === false &&
|
|
549
|
+
scoutRows.find((r) => r?.name === '@deepseek-ai/dsh-tool-fs-search')?.config?.sampleOverCapGlobResults === false &&
|
|
550
|
+
scoutRows.find((r) => r?.name === '@deepseek-ai/dsh-tool-web')?.config?.fetch === true,
|
|
551
|
+
'dev-plan-scout 仅挂载只读 fs/search/web 且带宿主必需配置',
|
|
552
|
+
)
|
|
553
|
+
const scribeCompaction = (scribePreset?.plugins ?? []).find((r) => r?.id === 'compaction')
|
|
554
|
+
check(
|
|
555
|
+
scribeCompaction?.group === true &&
|
|
556
|
+
scribeCompaction?.isolate?.compaction === true &&
|
|
557
|
+
scribeRows.find((r) => r?.name === '@deepseek-ai/dsh-tool-fs')?.config?.applyPatch === false &&
|
|
558
|
+
!scribeRows.some((r) => r?.name === '@deepseek-ai/dsh-tool-fs-search') &&
|
|
559
|
+
!scribeRows.some((r) => r?.name === '@deepseek-ai/dsh-tool-web'),
|
|
560
|
+
'dev-plan-scribe 仅挂载 tool-fs 且 compaction 带 isolate 隔离组',
|
|
561
|
+
)
|
|
562
|
+
|
|
563
|
+
const readonlyRows = flattenPlugins(readonlyMode?.plugins)
|
|
564
|
+
const askEditRows = flattenPlugins(askEditMode?.plugins)
|
|
565
|
+
check(
|
|
566
|
+
readonlyRows.find((r) => r?.name === '@deepseek-ai/dsh-tool-fs-search')?.config?.sampleOverCapGlobResults === false &&
|
|
567
|
+
!readonlyRows.some((r) => r?.name === '@deepseek-ai/dsh-tool-fs'),
|
|
568
|
+
'mainToolMode=readonly 仅新增带有效配置的 tool-fs-search,不含 tool-fs',
|
|
569
|
+
)
|
|
570
|
+
check(
|
|
571
|
+
askEditRows.find((r) => r?.name === '@deepseek-ai/dsh-tool-fs')?.config?.applyPatch === false &&
|
|
572
|
+
askEditRows.find((r) => r?.name === '@deepseek-ai/dsh-tool-fs-search')?.config?.sampleOverCapGlobResults === false,
|
|
573
|
+
'mainToolMode=ask-edit 仅新增 tool-fs(applyPatch:false) + 带有效配置的 tool-fs-search',
|
|
574
|
+
)
|
|
575
|
+
for (const pkgName of [
|
|
576
|
+
'@deepseek-ai/dsh-tool-bash',
|
|
577
|
+
'@deepseek-ai/dsh-tool-pwsh',
|
|
578
|
+
'@deepseek-ai/dsh-tool-workflow',
|
|
579
|
+
'@deepseek-ai/dsh-tool-jobs',
|
|
580
|
+
'@deepseek-ai/dsh-tool-schedule',
|
|
581
|
+
'@deepseek-ai/dsh-tool-goal',
|
|
582
|
+
'@deepseek-ai/dsh-tool-skill',
|
|
583
|
+
'@deepseek-ai/dsh-tool-todo',
|
|
584
|
+
'@deepseek-ai/dsh-plan-mode',
|
|
585
|
+
]) {
|
|
586
|
+
check(!readonlyRows.some((r) => r?.name === pkgName), `readonly 永不挂载 ${pkgName}`)
|
|
587
|
+
check(!askEditRows.some((r) => r?.name === pkgName), `ask-edit 永不挂载 ${pkgName}`)
|
|
588
|
+
}
|
|
441
589
|
for (const row of toolRows) {
|
|
442
590
|
const cfg = row.config ?? {}
|
|
443
591
|
const name = cfg.toolName
|
|
@@ -482,15 +630,19 @@ export function checksFor(surface) {
|
|
|
482
630
|
)
|
|
483
631
|
check(/团队施工/.test(custom?.description ?? ''), '自定义 preset 名称进入 description')
|
|
484
632
|
check(
|
|
485
|
-
surface.selfFallback.fallback === true &&
|
|
633
|
+
surface.selfFallback.fallback === true && /递归派工|内部预设/.test(surface.selfFallback.reason ?? ''),
|
|
486
634
|
'dev-plan 自身被拒绝,避免递归',
|
|
487
635
|
)
|
|
636
|
+
check(
|
|
637
|
+
surface.scoutSelfFallback?.fallback === true && surface.scribeSelfFallback?.fallback === true,
|
|
638
|
+
'dev-plan-scout 与 dev-plan-scribe 也被拒绝作 developMode',
|
|
639
|
+
)
|
|
488
640
|
check(
|
|
489
641
|
surface.modules.settings.DEFAULT_SETTINGS.guardAllSubagents === false,
|
|
490
642
|
'默认 guardAllSubagents=false(只守 dev-plan 子代理)',
|
|
491
643
|
)
|
|
492
644
|
check(/已回退 standard/.test(findPresetPlugin(fallback, 'persona')?.config?.prefix ?? ''), '回退 persona 写明「已回退 standard」')
|
|
493
|
-
check(
|
|
645
|
+
check(/回退显式可见/.test(findPresetPlugin(fallback, 'persona')?.config?.prefix ?? ''), '回退说明显式可见')
|
|
494
646
|
check(
|
|
495
647
|
JSON.stringify(findTool(withEffort, 'develop')?.config?.agentOptions) ===
|
|
496
648
|
JSON.stringify({ provider: 'dsh-opencode-go', model: 'deepseek-v4.1-flash', reasoningEffort: 'high' }),
|
|
@@ -514,38 +666,44 @@ export function checksFor(surface) {
|
|
|
514
666
|
)
|
|
515
667
|
|
|
516
668
|
const personaRow = findPresetPlugin(standard, 'persona')
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
|
|
669
|
+
const personaPrefix = personaRow?.config?.prefix ?? ''
|
|
670
|
+
const personaSuffix = personaRow?.config?.suffix ?? ''
|
|
671
|
+
const persona = `${personaPrefix}${personaSuffix}`
|
|
672
|
+
const personaLength = personaPrefix.length + personaSuffix.length
|
|
673
|
+
check(
|
|
674
|
+
typeof personaPrefix === 'string' && personaPrefix.length > 1000 && personaLength <= 6000,
|
|
675
|
+
'persona 长度在性能预算内(1000 < total <= 6000 字符)',
|
|
676
|
+
`${personaLength} chars`,
|
|
677
|
+
)
|
|
678
|
+
check(
|
|
679
|
+
!personaPrefix.includes('ROLE-TEMPLATE:SCOUT:BEGIN') && !personaPrefix.includes('ROLE-TEMPLATE:SCRIBE:BEGIN'),
|
|
680
|
+
'主窗 prefix 不再使用旧的千字长模板',
|
|
681
|
+
)
|
|
682
|
+
check(
|
|
683
|
+
personaPrefix.includes('仅给子代理用') &&
|
|
684
|
+
personaPrefix.includes('【仅子代理用 · 侦察/复核约束】') &&
|
|
685
|
+
personaPrefix.includes('【仅子代理用 · 文书落盘约束】'),
|
|
686
|
+
'主窗 persona 嵌入紧凑版子代理模板并标注仅给子代理用',
|
|
687
|
+
)
|
|
688
|
+
check(typeof personaSuffix === 'string' && personaSuffix.length > 100, 'persona.suffix 非空(不遮蔽部署级 suffix)')
|
|
520
689
|
check(!/\{\{/.test(persona), 'persona 不含模板变量')
|
|
521
|
-
check(!/不是[\u201c"]被要求不要用/.test(persona), 'persona 没有错误的硬保证')
|
|
522
690
|
|
|
691
|
+
const nonePersonaPrefix = findPresetPlugin(noneMode, 'persona')?.config?.prefix ?? ''
|
|
692
|
+
check(nonePersonaPrefix.includes('永不亲自读写仓库、写代码或跑 Shell'), 'persona(none) 说明主窗永不亲自写代码')
|
|
523
693
|
for (const [marker, label] of [
|
|
524
|
-
['
|
|
525
|
-
['
|
|
694
|
+
['永远禁止跑 Shell/测试命令(无 Shell 工具)', 'persona(默认 ask-edit) 严禁跑 Shell/测试命令'],
|
|
695
|
+
['必须先获用户本轮明确同意“主窗直接改”', 'persona(默认 ask-edit) 写改必须先获用户同意'],
|
|
696
|
+
['默认只规划与复核', 'persona 说明默认只规划/复核'],
|
|
697
|
+
['开工/施工/修复', 'persona 只在用户明确开工时派 develop'],
|
|
526
698
|
['name=developer', 'persona 固定 developer'],
|
|
527
699
|
['send_message', 'persona 用 send_message 续派'],
|
|
528
|
-
['
|
|
700
|
+
['不反复请示', 'persona 普通实现不反复请示'],
|
|
529
701
|
['独立 review', 'persona 施工后可派独立 review'],
|
|
530
|
-
['
|
|
531
|
-
['不依赖双窗按钮', 'persona 返工不依赖双窗按钮'],
|
|
532
|
-
['扩大范围、越权改动、不可逆风险', 'persona 只在扩大范围/越权/不可逆风险时问用户'],
|
|
533
|
-
['不要再次请求同一个开工批准', 'persona 不重复请求开工批准'],
|
|
702
|
+
['仅范围扩大、风险变化或宿主权限要求', 'persona 仅范围/风险/权限变化重确认'],
|
|
534
703
|
['不向人类提问', 'develop 不向人类提问'],
|
|
535
|
-
['
|
|
536
|
-
['
|
|
537
|
-
|
|
538
|
-
['非目标:', '任务书含非目标'],
|
|
539
|
-
['验收标准:', '任务书含验收标准'],
|
|
540
|
-
['允许改动路径:', '任务书含允许改动路径'],
|
|
541
|
-
['完成定义:', '任务书含完成定义'],
|
|
542
|
-
['汇报格式:', '任务书含汇报格式'],
|
|
543
|
-
['1. 改动:', '汇报格式含改动'],
|
|
544
|
-
['2. 真实命令与输出:', '汇报格式含真实命令与输出'],
|
|
545
|
-
['3. 自验收:', '汇报格式含自验收'],
|
|
546
|
-
['4. 风险:', '汇报格式含风险'],
|
|
547
|
-
['5. 假设与未验证项:', '汇报格式含假设与未验证项'],
|
|
548
|
-
// P0 流程提效
|
|
704
|
+
['不得把子代理自述当自己跑过测试', 'persona 禁止把子代理自述当成自己运行测试'],
|
|
705
|
+
['同一任务严禁混用 develop 与 rework_task/ask_worker', '双通道互斥'],
|
|
706
|
+
// P0 流程提效与单契约复用
|
|
549
707
|
['快速路径', 'P0 风险路由含快速路径'],
|
|
550
708
|
['标准路径', 'P0 风险路由含标准路径'],
|
|
551
709
|
['高风险路径', 'P0 风险路由含高风险路径'],
|
|
@@ -553,53 +711,50 @@ export function checksFor(surface) {
|
|
|
553
711
|
['影响面', 'P0 判定维度含影响面'],
|
|
554
712
|
['可逆性', 'P0 判定维度含可逆性'],
|
|
555
713
|
['可验证性', 'P0 判定维度含可验证性'],
|
|
556
|
-
['
|
|
557
|
-
['
|
|
558
|
-
['
|
|
559
|
-
['
|
|
560
|
-
['
|
|
714
|
+
['必须升级路径', 'P0 证据不足时提高风险等级'],
|
|
715
|
+
['绝不因验证困难降级', 'P0 绝不因验证困难降级'],
|
|
716
|
+
['分层变更证据', 'P0 完工必须附分层变更证据'],
|
|
717
|
+
['只有文件清单或口头摘要不算审过 diff', 'P0 不能只给文件清单'],
|
|
718
|
+
['不得声称核对过 diff', 'P0 摘要不得冒充 diff 审查'],
|
|
561
719
|
['补证据', 'P0 缺证据要同一 developer 补证据'],
|
|
562
|
-
['
|
|
563
|
-
['
|
|
720
|
+
['开工契约', 'P0 一次性开工契约'],
|
|
721
|
+
['目标', '任务书含目标'],
|
|
722
|
+
['非目标', '任务书含非目标'],
|
|
723
|
+
['允许与禁止改动路径', '任务书含允许改动路径'],
|
|
724
|
+
['接口与兼容约束', '任务书含接口/依赖'],
|
|
725
|
+
['验收标准', '任务书含验收标准'],
|
|
564
726
|
['检查命令', '任务书含检查命令'],
|
|
565
|
-
['
|
|
566
|
-
['普通文件编辑和实现细节不反复等待批准', 'P0 普通实现不反复等待批准'],
|
|
567
|
-
['只有范围扩大、风险变化或宿主权限要求', 'P0 仅范围/风险/权限变化重确认'],
|
|
727
|
+
['风险', '任务书含风险/回退'],
|
|
568
728
|
['最小切片', 'P0 验收前置含最小切片'],
|
|
569
729
|
['语法/静态契约', 'P0 验收排序含语法/静态契约'],
|
|
570
730
|
['针对性测试', 'P0 验收排序含针对性测试'],
|
|
571
|
-
['必要运行/GUI
|
|
572
|
-
['
|
|
731
|
+
['必要运行/GUI', 'P0 验收排序含必要运行/GUI'],
|
|
732
|
+
['静态检查/单测不等于真实运行验收', 'P0 禁止静态检查冒充真实验证'],
|
|
573
733
|
['非阻塞协作', 'P0 非阻塞协作'],
|
|
574
734
|
['不轮询', 'P0 主窗不轮询'],
|
|
575
|
-
['
|
|
735
|
+
['不 `sleep`', 'P0 主窗不忙等'],
|
|
576
736
|
['不重复施工', 'P0 主窗不重复施工'],
|
|
577
|
-
['
|
|
578
|
-
['developer
|
|
579
|
-
['verified
|
|
580
|
-
['
|
|
581
|
-
['
|
|
582
|
-
['
|
|
583
|
-
['
|
|
584
|
-
['recon:只在缺少事实', 'P0 recon 仅缺事实'],
|
|
585
|
-
['review:只在高风险', 'P0 review 仅高风险/需要'],
|
|
586
|
-
['scribe:只在文档属于验收范围', 'P0 scribe 仅验收/用户需要'],
|
|
737
|
+
['读写 developer 正在改的文件', 'P0 主窗不重复读取 developer 文件'],
|
|
738
|
+
['developer 仅在阻塞、范围冲突或关键契约决策时打断', 'P0 developer 打断边界'],
|
|
739
|
+
['verified|partial|failed|未验证', 'P0 汇报含验证状态分级'],
|
|
740
|
+
['阻塞', 'P0 阻塞问题返工'],
|
|
741
|
+
['不无限打磨', 'P0 非阻塞建议不无限打磨'],
|
|
742
|
+
['review 不替代主窗最终审查', 'P0 最终审查责任不外包'],
|
|
743
|
+
['name=scout', 'recon 首次固定 name=scout 复用上下文'],
|
|
587
744
|
['文本不是派工', 'P0 文本不是派工'],
|
|
588
|
-
['
|
|
589
|
-
['
|
|
590
|
-
['
|
|
591
|
-
['任务书是 develop 的 prompt 参数', 'P0 任务书是工具参数不是聊天交付'],
|
|
592
|
-
['不得停在计划、前言或任务书文本', 'P0 授权后不得停在任务书文本'],
|
|
745
|
+
['实际调用 develop', 'P0 授权后必须实际调用 develop'],
|
|
746
|
+
['已派出 developer', 'P0 工具接受后才可称已派出'],
|
|
747
|
+
['未派工:原因', 'P0 未派工如实报告'],
|
|
593
748
|
['实际调用 send_message', 'P0 返工必须实际 send_message'],
|
|
594
749
|
// 施工目录/权限防护
|
|
595
|
-
['
|
|
596
|
-
['工具创建参数', 'persona 要求用创建参数指定真实施工目录'],
|
|
750
|
+
['施工目录边界', 'persona 写明施工目录与权限'],
|
|
597
751
|
['cwd', 'persona 明确 cwd 参数'],
|
|
598
752
|
['可写工作区', 'persona 派工前检查可写工作区'],
|
|
599
|
-
['
|
|
600
|
-
['
|
|
601
|
-
['
|
|
602
|
-
['
|
|
753
|
+
['已存在的父目录', 'persona 允许工作区内未建子目录以父目录 cwd 派工自建'],
|
|
754
|
+
['working_directory', 'persona 禁止先建后 cd'],
|
|
755
|
+
['父会话事后提权不扩大已有子代理权限', 'persona 不假设权限会扩大'],
|
|
756
|
+
['沙箱', 'persona 权限失败记录沙箱模式'],
|
|
757
|
+
['原错', 'persona 权限失败记录真实错误'],
|
|
603
758
|
]) {
|
|
604
759
|
check(persona.includes(marker), label, marker)
|
|
605
760
|
}
|
|
@@ -616,30 +771,16 @@ export function checksFor(surface) {
|
|
|
616
771
|
'P0 没有“文本任务书即视为已派工”的错误说法',
|
|
617
772
|
)
|
|
618
773
|
|
|
619
|
-
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
const scoutAllow = scoutAllowMatch ? scoutAllowMatch[1].split(/[、,,]/).map((item) => item.trim()).filter(Boolean) : []
|
|
774
|
+
const scoutPersona = findPresetPlugin(scoutPreset, 'persona')?.config?.prefix ?? ''
|
|
775
|
+
const scribePersona = findPresetPlugin(scribePreset, 'persona')?.config?.prefix ?? ''
|
|
776
|
+
check(
|
|
777
|
+
['read', 'read_image', 'glob', 'grep', 'web_search', 'web_fetch'].every((tool) => scoutPersona.includes(tool)),
|
|
778
|
+
'dev-plan-scout 内置 persona 声明六项只读工具',
|
|
779
|
+
)
|
|
626
780
|
check(
|
|
627
|
-
|
|
628
|
-
'
|
|
629
|
-
scoutAllow.join(', ') || '空',
|
|
781
|
+
scribePersona.includes('read、write、edit') && scribePersona.includes('超出文书子代理职责'),
|
|
782
|
+
'dev-plan-scribe 内置 persona 限定只写规划/复核文档',
|
|
630
783
|
)
|
|
631
|
-
const scribeRules = numberedRules(scribeTemplate ?? '')
|
|
632
|
-
check(scribeRules.size === 6, '文书模板保留 6 条编号规则', [...scribeRules.keys()].join(', '))
|
|
633
|
-
check(/^只允许写规划与复核类文档/.test(scribeRules.get(3) ?? '') && /超出文书子代理职责/.test(scribeRules.get(3) ?? ''), '文书规则 3 限定文档范围')
|
|
634
|
-
check(/^不使用\s*Shell、Web、搜索与委派工具,也不要尝试替代。/.test(scribeRules.get(5) ?? ''), '文书规则 5 精确禁止 Shell/Web/搜索/委派')
|
|
635
|
-
check(/^config_\*、working_directory 以及任何未声明的工具都不得调用。/.test(scribeRules.get(6) ?? ''), '文书规则 6 精确禁止 config_*/working_directory')
|
|
636
|
-
const boundary = 'standard 的工具、persona、项目 AGENTS.md 或技能目录即使出现更多能力,也不得据此扩大本角色边界'
|
|
637
|
-
const conflict = '若更高优先级指令与本模板的角色边界冲突,停止相关动作,并在回传里向主代理报告冲突,不擅自越界执行'
|
|
638
|
-
check((scoutTemplate ?? '').includes(boundary) && (scribeTemplate ?? '').includes(boundary), '两个模板禁止因 standard/AGENTS/skills 扩大边界')
|
|
639
|
-
check((scoutTemplate ?? '').includes(conflict) && (scribeTemplate ?? '').includes(conflict), '两个模板要求高层指令冲突时停止并报告')
|
|
640
|
-
check(/recon\s*与\s*review[^\n]*侦察\/复核角色模板/.test(persona), '派遣指令绑定 recon/review 与侦察模板')
|
|
641
|
-
check(/scribe[^\n]*文书角色模板/.test(persona), '派遣指令绑定 scribe 与文书模板')
|
|
642
|
-
check(/每次调用都完整附带/.test(persona) && /不能写「同上」/.test(persona) && /以模板为准/.test(persona), '派遣纪律要求逐字附带模板')
|
|
643
784
|
|
|
644
785
|
// ── locale / README / detail ─────────────────────────────────────────────
|
|
645
786
|
for (const [name, value, error] of [
|
|
@@ -669,10 +810,12 @@ export function checksFor(surface) {
|
|
|
669
810
|
}
|
|
670
811
|
|
|
671
812
|
for (const marker of [
|
|
672
|
-
'0.
|
|
813
|
+
'0.4.0',
|
|
673
814
|
'develop',
|
|
674
815
|
'standard',
|
|
675
816
|
'deep-ptc',
|
|
817
|
+
'仅给子代理用',
|
|
818
|
+
'mainToolMode',
|
|
676
819
|
'ctx.agentPresets.register',
|
|
677
820
|
'cordis.patch.yml 只挂根插件',
|
|
678
821
|
'模型守门',
|
|
@@ -706,9 +849,6 @@ export function checksFor(surface) {
|
|
|
706
849
|
'接口/依赖',
|
|
707
850
|
'检查命令',
|
|
708
851
|
'风险/回退',
|
|
709
|
-
'P1',
|
|
710
|
-
'P2',
|
|
711
|
-
'不新增设置项',
|
|
712
852
|
]) {
|
|
713
853
|
check(String(readme ?? '').includes(marker), `README 含 P0 说明:${marker}`)
|
|
714
854
|
}
|
|
@@ -722,10 +862,12 @@ export function checksFor(surface) {
|
|
|
722
862
|
}
|
|
723
863
|
|
|
724
864
|
for (const marker of [
|
|
725
|
-
'0.
|
|
865
|
+
'0.4.0',
|
|
726
866
|
'develop',
|
|
727
867
|
'standard',
|
|
728
868
|
'deep-ptc',
|
|
869
|
+
'仅给子代理用',
|
|
870
|
+
'mainToolMode',
|
|
729
871
|
'模型守门',
|
|
730
872
|
'已回退 standard',
|
|
731
873
|
'未验证',
|
|
@@ -798,8 +940,13 @@ async function behaviorChecks() {
|
|
|
798
940
|
try {
|
|
799
941
|
index.apply(ctx.ctx, { ...modules.settings.DEFAULT_SETTINGS }, { verificationDelayMs: 0 })
|
|
800
942
|
await ctx.flush()
|
|
801
|
-
check(
|
|
802
|
-
|
|
943
|
+
check(
|
|
944
|
+
registry.definitions.length === 1 &&
|
|
945
|
+
registry.definitions[0]?.id === 'dev-plan',
|
|
946
|
+
'apply 只动态注册 1 个 preset(dev-plan,不在公开列表暴露内部子预设)',
|
|
947
|
+
registry.definitions.map((d) => d.id).join(','),
|
|
948
|
+
)
|
|
949
|
+
check(registry.definitions.some((d) => d.id === 'dev-plan'), '动态注册 id=dev-plan')
|
|
803
950
|
check(typeof webServer.handlers.get === 'function', 'webServer 路由注册接口存在')
|
|
804
951
|
const stateHandler = webServer.handlers.get('/plugins/dev-plan-presets/state')
|
|
805
952
|
check(typeof stateHandler === 'function', '注册 /plugins/dev-plan-presets/state')
|
|
@@ -807,6 +954,9 @@ async function behaviorChecks() {
|
|
|
807
954
|
check(state.code === 200, 'state 路由 GET 200', String(state.code))
|
|
808
955
|
check(state.body?.effectiveMode === 'standard', 'state 默认 effectiveMode=standard', String(state.body?.effectiveMode))
|
|
809
956
|
check(state.body?.fallback?.active === false, 'state 默认无回退')
|
|
957
|
+
check(typeof state.headers?.etag === 'string' && state.headers.etag.length > 0, 'state 响应头带 etag')
|
|
958
|
+
const state304 = await callRoute(stateHandler, 'GET', undefined, { 'if-none-match': state.headers.etag })
|
|
959
|
+
check(state304.code === 304 && state304.body === null, 'state 命中 If-None-Match 返回 304 空体', String(state304.code))
|
|
810
960
|
|
|
811
961
|
const configHandler = webServer.handlers.get('/plugins/dev-plan-presets/config')
|
|
812
962
|
check(typeof configHandler === 'function', '注册 /plugins/dev-plan-presets/config')
|
|
@@ -874,7 +1024,7 @@ async function behaviorChecks() {
|
|
|
874
1024
|
})
|
|
875
1025
|
index.apply(entryCtx.ctx, { ...modules.settings.DEFAULT_SETTINGS, developMode: 'deep-ptc' }, { verificationDelayMs: 0 })
|
|
876
1026
|
await entryCtx.flush()
|
|
877
|
-
const entryDefinition = entryRegistry.definitions
|
|
1027
|
+
const entryDefinition = entryRegistry.definitions.find((d) => d.id === 'dev-plan')
|
|
878
1028
|
check(
|
|
879
1029
|
entryDefinition?.plugins.find((row) => row.id === 'tool-subagent-develop')?.config?.agentPreset === 'standard',
|
|
880
1030
|
'只有 loader entry(LOADING)时保守回退 standard',
|
|
@@ -889,14 +1039,14 @@ async function behaviorChecks() {
|
|
|
889
1039
|
const goodCtx = createFakeContext({ registry: goodRegistry })
|
|
890
1040
|
index.apply(goodCtx.ctx, { ...modules.settings.DEFAULT_SETTINGS, developMode: 'deep-ptc' }, { verificationDelayMs: 0 })
|
|
891
1041
|
await goodCtx.flush()
|
|
892
|
-
const goodDefinition = goodRegistry.definitions
|
|
1042
|
+
const goodDefinition = goodRegistry.definitions.find((d) => d.id === 'dev-plan')
|
|
893
1043
|
check(
|
|
894
1044
|
goodDefinition?.plugins.find((row) => row.id === 'tool-subagent-develop')?.config?.agentPreset === 'deep-ptc',
|
|
895
1045
|
'registry 中存在 deep-ptc 时 develop 使用 deep-ptc',
|
|
896
1046
|
)
|
|
897
1047
|
check(
|
|
898
1048
|
goodDefinition?.plugins.find((row) => row.id === 'tool-subagent-recon')?.config?.agentPreset === 'standard',
|
|
899
|
-
'deep-ptc 时 recon
|
|
1049
|
+
'deep-ptc 时 recon 仍使用 standard',
|
|
900
1050
|
)
|
|
901
1051
|
await goodCtx.dispose()
|
|
902
1052
|
}
|
|
@@ -978,7 +1128,11 @@ async function behaviorChecks() {
|
|
|
978
1128
|
}
|
|
979
1129
|
{
|
|
980
1130
|
const ctx4 = createFakeContext({ registry: createFakeRegistry() })
|
|
981
|
-
index.apply(
|
|
1131
|
+
index.apply(
|
|
1132
|
+
ctx4.ctx,
|
|
1133
|
+
{ ...modules.settings.DEFAULT_SETTINGS, modelGuardMode: 'off', mainToolMode: 'none' },
|
|
1134
|
+
{ verificationDelayMs: 0 },
|
|
1135
|
+
)
|
|
982
1136
|
await ctx4.flush()
|
|
983
1137
|
check(!ctx4.listeners.get('agent/created'), 'off 模式不注册 agent/created')
|
|
984
1138
|
await ctx4.dispose()
|
|
@@ -1107,18 +1261,26 @@ const MUTATIONS = [
|
|
|
1107
1261
|
},
|
|
1108
1262
|
},
|
|
1109
1263
|
{
|
|
1110
|
-
name: '
|
|
1111
|
-
expect: '
|
|
1264
|
+
name: '主窗(none)被加回 fs 工具',
|
|
1265
|
+
expect: '主窗(none)不挂载',
|
|
1112
1266
|
mutate(surface) {
|
|
1113
|
-
surface.
|
|
1267
|
+
surface.noneMode.plugins.push({ id: 'tool-fs', name: '@deepseek-ai/dsh-tool-fs' })
|
|
1114
1268
|
},
|
|
1115
1269
|
},
|
|
1116
1270
|
{
|
|
1117
|
-
name: 'persona 删掉“永不亲自写代码”',
|
|
1118
|
-
expect: 'persona 说明主窗永不亲自写代码',
|
|
1271
|
+
name: 'persona(none) 删掉“永不亲自写代码”',
|
|
1272
|
+
expect: 'persona(none) 说明主窗永不亲自写代码',
|
|
1273
|
+
mutate(surface) {
|
|
1274
|
+
const row = findPresetPlugin(surface.noneMode, 'persona')
|
|
1275
|
+
row.config.prefix = row.config.prefix.replaceAll('永不亲自读写仓库、写代码或跑 Shell', '应当亲自写代码')
|
|
1276
|
+
},
|
|
1277
|
+
},
|
|
1278
|
+
{
|
|
1279
|
+
name: 'persona(默认 ask-edit) 删掉“必须先获用户本轮明确同意”',
|
|
1280
|
+
expect: 'persona(默认 ask-edit) 写改必须先获用户同意',
|
|
1119
1281
|
mutate(surface) {
|
|
1120
1282
|
const row = findPresetPlugin(surface.standard, 'persona')
|
|
1121
|
-
row.config.prefix = row.config.prefix.replaceAll('
|
|
1283
|
+
row.config.prefix = row.config.prefix.replaceAll('必须先获用户本轮明确同意“主窗直接改”', '可以直接改代码')
|
|
1122
1284
|
},
|
|
1123
1285
|
},
|
|
1124
1286
|
{
|
|
@@ -1191,14 +1353,41 @@ const MUTATIONS = [
|
|
|
1191
1353
|
},
|
|
1192
1354
|
},
|
|
1193
1355
|
{
|
|
1194
|
-
name: '
|
|
1195
|
-
expect: '
|
|
1356
|
+
name: 'persona 超过 6000 字符预算',
|
|
1357
|
+
expect: 'persona 长度在性能预算内',
|
|
1196
1358
|
mutate(surface) {
|
|
1197
1359
|
const row = findPresetPlugin(surface.standard, 'persona')
|
|
1198
|
-
row.config.prefix
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1360
|
+
row.config.prefix += '冗余文本'.repeat(1000)
|
|
1361
|
+
},
|
|
1362
|
+
},
|
|
1363
|
+
{
|
|
1364
|
+
name: '主窗重新内联 ROLE-TEMPLATE 长模板',
|
|
1365
|
+
expect: '主窗 prefix 不再使用旧的千字长模板',
|
|
1366
|
+
mutate(surface) {
|
|
1367
|
+
const row = findPresetPlugin(surface.standard, 'persona')
|
|
1368
|
+
row.config.prefix += '\n===== ROLE-TEMPLATE:SCOUT:BEGIN =====\n'
|
|
1369
|
+
},
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
name: '子代理模板缺少“仅给子代理用”标注',
|
|
1373
|
+
expect: '主窗 persona 嵌入紧凑版子代理模板并标注仅给子代理用',
|
|
1374
|
+
mutate(surface) {
|
|
1375
|
+
const row = findPresetPlugin(surface.standard, 'persona')
|
|
1376
|
+
row.config.prefix = row.config.prefix.replaceAll('仅给子代理用', '给主窗用')
|
|
1377
|
+
},
|
|
1378
|
+
},
|
|
1379
|
+
{
|
|
1380
|
+
name: 'dev-plan-scout 混入 bash 工具',
|
|
1381
|
+
expect: 'dev-plan-scout 不含 @deepseek-ai/dsh-tool-bash',
|
|
1382
|
+
mutate(surface) {
|
|
1383
|
+
surface.scoutPreset.plugins.push({ id: 'tool-bash', name: '@deepseek-ai/dsh-tool-bash' })
|
|
1384
|
+
},
|
|
1385
|
+
},
|
|
1386
|
+
{
|
|
1387
|
+
name: 'ask-edit 混入 bash 工具',
|
|
1388
|
+
expect: 'ask-edit 永不挂载 @deepseek-ai/dsh-tool-bash',
|
|
1389
|
+
mutate(surface) {
|
|
1390
|
+
surface.askEditMode.plugins.push({ id: 'tool-bash', name: '@deepseek-ai/dsh-tool-bash' })
|
|
1202
1391
|
},
|
|
1203
1392
|
},
|
|
1204
1393
|
{
|
|
@@ -1207,7 +1396,7 @@ const MUTATIONS = [
|
|
|
1207
1396
|
mutate(surface) {
|
|
1208
1397
|
const row = findPresetPlugin(surface.standard, 'persona')
|
|
1209
1398
|
row.config.prefix = row.config.prefix.replaceAll(
|
|
1210
|
-
'
|
|
1399
|
+
'同一任务严禁混用 develop 与 rework_task/ask_worker',
|
|
1211
1400
|
'可以同时使用 develop 和 rework_task',
|
|
1212
1401
|
)
|
|
1213
1402
|
},
|
|
@@ -1240,10 +1429,10 @@ const MUTATIONS = [
|
|
|
1240
1429
|
},
|
|
1241
1430
|
{
|
|
1242
1431
|
name: 'P0 完工证据退化为改动摘要',
|
|
1243
|
-
expect: 'P0
|
|
1432
|
+
expect: 'P0 完工必须附分层变更证据',
|
|
1244
1433
|
mutate(surface) {
|
|
1245
1434
|
const row = findPresetPlugin(surface.standard, 'persona')
|
|
1246
|
-
row.config.prefix = row.config.prefix.replaceAll('
|
|
1435
|
+
row.config.prefix = row.config.prefix.replaceAll('分层变更证据', '改动摘要')
|
|
1247
1436
|
},
|
|
1248
1437
|
},
|
|
1249
1438
|
{
|
|
@@ -1251,7 +1440,7 @@ const MUTATIONS = [
|
|
|
1251
1440
|
expect: 'P0 不能只给文件清单',
|
|
1252
1441
|
mutate(surface) {
|
|
1253
1442
|
const row = findPresetPlugin(surface.standard, 'persona')
|
|
1254
|
-
row.config.prefix = row.config.prefix.replaceAll('
|
|
1443
|
+
row.config.prefix = row.config.prefix.replaceAll('只有文件清单或口头摘要不算审过 diff', '只给文件清单也可以作为证据')
|
|
1255
1444
|
},
|
|
1256
1445
|
},
|
|
1257
1446
|
{
|
|
@@ -1402,10 +1591,8 @@ const MUTATIONS = [
|
|
|
1402
1591
|
expect: 'P0 工具接受后才可称已派出',
|
|
1403
1592
|
mutate(surface) {
|
|
1404
1593
|
const row = findPresetPlugin(surface.standard, 'persona')
|
|
1405
|
-
row.config.prefix = row.config.prefix.replaceAll(
|
|
1406
|
-
|
|
1407
|
-
'没有调用也可以说已派出 developer',
|
|
1408
|
-
)
|
|
1594
|
+
row.config.prefix = row.config.prefix.replaceAll('已派出 developer', '已直接派出')
|
|
1595
|
+
row.config.suffix = row.config.suffix.replaceAll('已派出 developer', '已直接派出')
|
|
1409
1596
|
},
|
|
1410
1597
|
},
|
|
1411
1598
|
{
|
|
@@ -1413,8 +1600,8 @@ const MUTATIONS = [
|
|
|
1413
1600
|
expect: 'P0 未派工如实报告',
|
|
1414
1601
|
mutate(surface) {
|
|
1415
1602
|
const row = findPresetPlugin(surface.standard, 'persona')
|
|
1416
|
-
row.config.prefix = row.config.prefix.replaceAll('
|
|
1417
|
-
row.config.suffix = row.config.suffix.replaceAll('
|
|
1603
|
+
row.config.prefix = row.config.prefix.replaceAll('未派工:原因', '已派工')
|
|
1604
|
+
row.config.suffix = row.config.suffix.replaceAll('未派工:原因', '已派工')
|
|
1418
1605
|
},
|
|
1419
1606
|
},
|
|
1420
1607
|
{
|
|
@@ -1461,7 +1648,7 @@ const MUTATIONS = [
|
|
|
1461
1648
|
expect: '任务书含接口/依赖',
|
|
1462
1649
|
mutate(surface) {
|
|
1463
1650
|
const row = findPresetPlugin(surface.standard, 'persona')
|
|
1464
|
-
row.config.prefix = row.config.prefix.replaceAll('
|
|
1651
|
+
row.config.prefix = row.config.prefix.replaceAll('接口与兼容约束', '接口')
|
|
1465
1652
|
},
|
|
1466
1653
|
},
|
|
1467
1654
|
{
|
|
@@ -1469,7 +1656,7 @@ const MUTATIONS = [
|
|
|
1469
1656
|
expect: 'P0 禁止静态检查冒充真实验证',
|
|
1470
1657
|
mutate(surface) {
|
|
1471
1658
|
const row = findPresetPlugin(surface.standard, 'persona')
|
|
1472
|
-
row.config.prefix = row.config.prefix.replaceAll('
|
|
1659
|
+
row.config.prefix = row.config.prefix.replaceAll('静态检查/单测不等于真实运行验收', '静态检查可以代表真实验证')
|
|
1473
1660
|
},
|
|
1474
1661
|
},
|
|
1475
1662
|
{
|
|
@@ -1485,7 +1672,7 @@ const MUTATIONS = [
|
|
|
1485
1672
|
expect: 'P0 汇报含验证状态分级',
|
|
1486
1673
|
mutate(surface) {
|
|
1487
1674
|
const row = findPresetPlugin(surface.standard, 'persona')
|
|
1488
|
-
row.config.prefix = row.config.prefix.replaceAll('verified
|
|
1675
|
+
row.config.prefix = row.config.prefix.replaceAll('verified|partial|failed|未验证', '通过/失败')
|
|
1489
1676
|
},
|
|
1490
1677
|
},
|
|
1491
1678
|
{
|
|
@@ -1493,14 +1680,31 @@ const MUTATIONS = [
|
|
|
1493
1680
|
expect: 'P0 最终审查责任不外包',
|
|
1494
1681
|
mutate(surface) {
|
|
1495
1682
|
const row = findPresetPlugin(surface.standard, 'persona')
|
|
1496
|
-
row.config.prefix = row.config.prefix.replaceAll('
|
|
1683
|
+
row.config.prefix = row.config.prefix.replaceAll('review 不替代主窗最终审查', '主窗最终审查可外包给 review')
|
|
1497
1684
|
},
|
|
1498
1685
|
},
|
|
1499
1686
|
{
|
|
1500
1687
|
name: '版本号未更新',
|
|
1501
|
-
expect: 'version=0.
|
|
1688
|
+
expect: 'version=0.4.0',
|
|
1689
|
+
mutate(surface) {
|
|
1690
|
+
surface.pkg.version = '0.3.0'
|
|
1691
|
+
},
|
|
1692
|
+
},
|
|
1693
|
+
{
|
|
1694
|
+
name: 'index 恢复冗余二次复检条件',
|
|
1695
|
+
expect: 'index.js scheduleVerification 跳过已命中目标时的冗余二次全量探测',
|
|
1696
|
+
mutate(surface) {
|
|
1697
|
+
surface.files['index.js'] = String(surface.files['index.js']).replace(
|
|
1698
|
+
'state.mode?.fallback === true || state.presets.checked !== true',
|
|
1699
|
+
"settings.developMode !== 'standard' || state.presets.checked !== true",
|
|
1700
|
+
)
|
|
1701
|
+
},
|
|
1702
|
+
},
|
|
1703
|
+
{
|
|
1704
|
+
name: 'client 删除 mainToolMode 控件',
|
|
1705
|
+
expect: 'client 设置页包含字段 mainToolMode',
|
|
1502
1706
|
mutate(surface) {
|
|
1503
|
-
surface.
|
|
1707
|
+
surface.files['client.js'] = String(surface.files['client.js']).replaceAll('mainToolMode', 'removedMode')
|
|
1504
1708
|
},
|
|
1505
1709
|
},
|
|
1506
1710
|
{
|
|
@@ -1542,7 +1746,7 @@ const MUTATIONS = [
|
|
|
1542
1746
|
expect: 'persona 禁止先建后 cd',
|
|
1543
1747
|
mutate(surface) {
|
|
1544
1748
|
const row = findPresetPlugin(surface.standard, 'persona')
|
|
1545
|
-
row.config.prefix = row.config.prefix.replaceAll('
|
|
1749
|
+
row.config.prefix = row.config.prefix.replaceAll('working_directory', 'other_dir')
|
|
1546
1750
|
},
|
|
1547
1751
|
},
|
|
1548
1752
|
{
|