dsh-agent-board 1.9.7 → 1.9.9
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 +4 -3
- package/lib/client/dashboard.js +93 -5
- package/lib/client.js +93 -5
- package/lib/core.mjs +98 -19
- package/lib/dispatch.mjs +263 -20
- package/lib/lifecycle.mjs +91 -0
- package/lib/policy.mjs +41 -3
- package/lib/rpc.mjs +165 -18
- package/package.json +1 -1
- package/test/core.test.mjs +89 -4
- package/test/decompose.test.mjs +236 -3
- package/test/lane-gui-bysize.test.mjs +75 -0
- package/test/lane-models.test.mjs +501 -1
- package/test/lifecycle.test.mjs +759 -0
- package/test/readme-decompose-docs.test.mjs +4 -3
package/lib/core.mjs
CHANGED
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
// 「临时 HOME」可被自测注入——os.homedir() 进程内首次调用即缓存,晚改 env 无效。
|
|
6
6
|
import os from 'node:os'
|
|
7
7
|
import path from 'node:path'
|
|
8
|
+
// 生命周期状态转移表(lib/lifecycle.mjs,task-mwk47az1):状态推进点改 status 前查表断言,
|
|
9
|
+
// 非法转移开发期抛错(表上已注册全部合法转移,合法流零行为变化——纯结构化接线)。
|
|
10
|
+
import { assertTransition } from './lifecycle.mjs'
|
|
8
11
|
|
|
9
12
|
// ===== 常量 =====
|
|
10
13
|
export const MAX_CLAIMED = 3
|
|
@@ -355,12 +358,27 @@ export function depsCancelled(d, t) {
|
|
|
355
358
|
return t.dependsOn.some(function (id) { var x = d.tasks.find(function (y) { return y.id === id }); return x && x.status === 'cancelled' })
|
|
356
359
|
}
|
|
357
360
|
|
|
358
|
-
// ===== 管线分类(#19
|
|
361
|
+
// ===== 管线分类(#19):任务性质优先于验收脚本,规则先行,兜底 full(宁严勿漏)=====
|
|
362
|
+
// 引力井修复(task-mwk2enp8,用户 2026-11-17 实证):旧序是「先看 acceptance(有验收脚本→full)、
|
|
363
|
+
// 再看任务性质」,而「回归测试/写文档/巡检」恰恰是最该带验收命令的活,于是它们一挂 acceptance 就被
|
|
364
|
+
// 吸进 full——观测分布 full=234 / work=30 / direct=20(full 占 82%),实证误判「E2E:v1.8.3 全链回归」
|
|
365
|
+
// 与「README 补拆解官工作流指南」双双落 full。新序把判定颠倒过来:
|
|
366
|
+
// ① 主窗口亲办(问答/解释类)→ direct(问了就是问,不看 acceptance)
|
|
367
|
+
// ② 任务性质=回归/巡检/盘点/文档/整理/总结/报告/指南/白皮书/readme/分析文 → work(**不看 acceptance**)
|
|
368
|
+
// ③ 有验收脚本(acceptance 非空)→ full
|
|
369
|
+
// ④ 兜底 → full
|
|
370
|
+
// 边界一(只看 title,不读 description):词族只匹配 title。title 是任务性质的最强信号;description 里
|
|
371
|
+
// 提到「回归/文档」通常是附带动作而非任务本体——「修 planGate 圈号污染」的描述即便写了「回归验证」,
|
|
372
|
+
// 也不能因此被判 work(读 description 会把修 bug 的卡误判成回归卡)。
|
|
373
|
+
// 边界二(title 含「修」→ 优先 full):修 bug 才是本体。「巡检三连修:草稿发布预警」这类标题虽命中 work
|
|
374
|
+
// 词族(巡检),目的却是改代码,仍归 full;故「含『修』」时不走 work 分支(修/修复/修改/修订…同族)。
|
|
375
|
+
// work 词族本身不含「修」字,故该守卫只影响「修 + work 词」这种混装标题。
|
|
359
376
|
export function classifyPipeline(t) {
|
|
360
|
-
|
|
361
|
-
var text =
|
|
377
|
+
var title = String(t.title || '')
|
|
378
|
+
var text = title.toLowerCase()
|
|
362
379
|
if (/解释|为什么|是什么|区别|对比|说明一下|是什么意思|how to|what is|why /.test(text)) return 'direct'
|
|
363
|
-
if (
|
|
380
|
+
if (!/修/.test(title) && /回归|巡检|盘点|文档|调研|整理|总结|报告|指南|白皮书|readme|分析文/.test(text)) return 'work'
|
|
381
|
+
if (t.acceptance && String(t.acceptance).trim()) return 'full'
|
|
364
382
|
return 'full'
|
|
365
383
|
}
|
|
366
384
|
|
|
@@ -404,16 +422,42 @@ export var TASK_SIZES = ['light', 'standard', 'heavy']
|
|
|
404
422
|
// 适用面:create-task RPC / task_create 工具 / update-task publish / batch-op publish 四入口同文案拒写;
|
|
405
423
|
// 非 Team 板零约束零提示(缺字段=标档语义照旧,存量卡零迁移)。错误文案自带三档语义,便于自助修正。
|
|
406
424
|
export var TEAM_SIZE_REQUIRED_ERR = 'Team 模式板建卡/发布必须显式设力度档位 size:light=单点小改/文档/配置,standard=常规模块改动(缺省),heavy=跨模块/高风险/需强推理'
|
|
425
|
+
// ===== 复合槽位形态(task-mwkbmu9k):槽位值支持 {id, effort?} 对象(思考等级随槽位声明)=====
|
|
426
|
+
// 形态扩展:laneModels 槽位 string | {id,effort?} | (string|{id,effort?})[];workerModel/verifierModel
|
|
427
|
+
// string | {id,effort?};fallbackModels (string|{id,effort?})[]。纯字符串=不指定 effort(模型默认档,
|
|
428
|
+
// 零回归);对象形态归一为 {id, effort}(effort 省略/空串时不带该字段),其余键一律丢弃。
|
|
429
|
+
// 归一出口保持两种形态并存:字符串(老数据/未配 effort)或 {id, effort}(新配)——下游按形态取 effort。
|
|
430
|
+
// effort 合法性(该模型支不支持这档)是写路径校验的事(rpc.mjs set-board-config 查 list-models 的
|
|
431
|
+
// efforts 清单),归一层只做形态防御(id 非空 string、effort 非空 string)。
|
|
432
|
+
// 槽位对象归一:有效 → {id, effort?}(新对象,只含这两键);无效(非对象/数组/id 缺失或空)→ null。
|
|
433
|
+
export function normalizeSlotObj(v) {
|
|
434
|
+
if (!v || typeof v !== 'object' || Array.isArray(v)) return null
|
|
435
|
+
var id = typeof v.id === 'string' ? v.id.trim() : ''
|
|
436
|
+
if (!id) return null
|
|
437
|
+
var out = { id: id }
|
|
438
|
+
if (typeof v.effort === 'string' && v.effort.trim()) out.effort = v.effort.trim()
|
|
439
|
+
return out
|
|
440
|
+
}
|
|
441
|
+
// 单模型槽(workerModel/verifierModel)归一:字符串 → trim(空=清除);{id,effort?} 对象 → 归一对象;
|
|
442
|
+
// 其余(数字/布尔/null/无效对象)→ ''(清除——与旧「非字符串=清除」口径逐字一致;写路径有 fail-loud 前置)。
|
|
443
|
+
export function normalizeModelSlot(v) {
|
|
444
|
+
if (typeof v === 'string') return v.trim()
|
|
445
|
+
var o = normalizeSlotObj(v)
|
|
446
|
+
return o || ''
|
|
447
|
+
}
|
|
407
448
|
// 档位槽单槽归一(set-board-config 写入与读路径归一共用同一口径):
|
|
408
|
-
// 字符串 → trim 后非空则单元素数组、空串 →
|
|
449
|
+
// 字符串 → trim 后非空则单元素数组、空串 → 空数组(=清槽/继承下一级);对象 → 单元素数组(复合形态);
|
|
450
|
+
// 数组 → 逐项滤脏保序(字符串项/对象项各自归一,脏项丢弃);其他 → 空数组。
|
|
409
451
|
export function normalizeLaneSlot(v) {
|
|
410
452
|
if (typeof v === 'string') { var s = v.trim(); return s ? [s] : [] }
|
|
453
|
+
var o = normalizeSlotObj(v)
|
|
454
|
+
if (o) return [o]
|
|
411
455
|
if (!Array.isArray(v)) return []
|
|
412
456
|
var out = []
|
|
413
457
|
for (var i = 0; i < v.length; i++) {
|
|
414
|
-
if (typeof v[i]
|
|
415
|
-
var
|
|
416
|
-
if (
|
|
458
|
+
if (typeof v[i] === 'string') { var s2 = v[i].trim(); if (s2) { out.push(s2); continue } }
|
|
459
|
+
var oi = normalizeSlotObj(v[i])
|
|
460
|
+
if (oi) out.push(oi)
|
|
417
461
|
}
|
|
418
462
|
return out
|
|
419
463
|
}
|
|
@@ -434,16 +478,16 @@ export function normalizeLaneModels(v) {
|
|
|
434
478
|
// 原形事故:2026-10-24 glm 撞 5h 限额(429 带重置时间),重派还是 glm 继续撞——C5 只做了同表降档,
|
|
435
479
|
// 缺跨供应商备用链。语义:取模候选被判「冷却中/熔断中」时,先按本链顺序找第一个健康模型
|
|
436
480
|
// (同档替代,保住能力水位),链尽才走原降级路径(降档/降跳),最后 parent 兜底。
|
|
437
|
-
//
|
|
438
|
-
|
|
439
|
-
// get-tasks 透出、set-board-config 写入)只认这一个形态,不各自兜底。
|
|
481
|
+
// 形态固定为字符串或 {id,effort?} 复合对象的有序数组(provider/model 复合格式);缺省 [] = 不启用
|
|
482
|
+
//(行为与现状逐字一致)。脏值收敛:非数组→[];逐项字符串 trim 非空保留、复合对象归一 {id,effort?} 保留、
|
|
483
|
+
// 其余丢弃——消费面(spawnOneShot 取模链、get-tasks 透出、set-board-config 写入)只认这一个形态,不各自兜底。
|
|
440
484
|
export function normalizeFallbackModels(v) {
|
|
441
485
|
if (!Array.isArray(v)) return []
|
|
442
486
|
var out = []
|
|
443
487
|
for (var i = 0; i < v.length; i++) {
|
|
444
|
-
if (typeof v[i]
|
|
445
|
-
var
|
|
446
|
-
if (
|
|
488
|
+
if (typeof v[i] === 'string') { var s = v[i].trim(); if (s) { out.push(s); continue } }
|
|
489
|
+
var o = normalizeSlotObj(v[i])
|
|
490
|
+
if (o) out.push(o)
|
|
447
491
|
}
|
|
448
492
|
return out
|
|
449
493
|
}
|
|
@@ -477,7 +521,12 @@ export function normalizeProbeIntervalMin(v) {
|
|
|
477
521
|
export function configuredModelIds(d) {
|
|
478
522
|
d = d || {}
|
|
479
523
|
var c = cfg(d), out = [], seen = {}
|
|
480
|
-
function add(v) {
|
|
524
|
+
function add(v) {
|
|
525
|
+
var s = ''
|
|
526
|
+
if (typeof v === 'string') s = v.trim()
|
|
527
|
+
else if (v && typeof v === 'object' && !Array.isArray(v) && typeof v.id === 'string') s = v.id.trim() // 复合形态取 id(task-mwkbmu9k)
|
|
528
|
+
if (s && !seen[s]) { seen[s] = true; out.push(s) }
|
|
529
|
+
}
|
|
481
530
|
add(d.workerModel); add(d.verifierModel)
|
|
482
531
|
for (var i = 0; i < TASK_SIZES.length; i++) {
|
|
483
532
|
var lane = c.laneModels[TASK_SIZES[i]]
|
|
@@ -598,7 +647,7 @@ export function opsLogLine(o) {
|
|
|
598
647
|
|
|
599
648
|
// ===== 状态流转 =====
|
|
600
649
|
export function claimCheck(d, t, sid) { if (CLAIMABLE.indexOf(t.status) < 0) return 'cannot claim in ' + t.status; if (t.claimedBy && t.claimedBy !== sid && t.status === 'in-progress') return 'claimed by ' + t.claimedBy; if (d.boardMode === 'manual' || t.assignMode === 'manual') { if (t.assignee && t.assignee !== sid) return 'assigned to ' + t.assignee }; if (isb(t)) { var p = gpt(t, d.tasks); if (!p) return 'parent not found'; if (p.status !== 'in-progress' && p.status !== 'verifying') return 'parent not in-progress' }; var mc = d.tasks.filter(function (x) { return x.claimedBy === sid && (x.status === 'in-progress' || x.status === 'verifying') && !isb(x) }); if (!isb(t) && mc.length >= MAX_CLAIMED) return 'max ' + MAX_CLAIMED + ' active'; return null }
|
|
601
|
-
export function claimApply(d, t, sid, note) { var ps = t.status; t.status = 'in-progress'; t.claimedBy = sid; t.claimedAt = new Date().toISOString(); ah(t, ps, 'in-progress', sid, note) }
|
|
650
|
+
export function claimApply(d, t, sid, note) { var ps = t.status; assertTransition(ps, 'in-progress', 'claim'); t.status = 'in-progress'; t.claimedBy = sid; t.claimedAt = new Date().toISOString(); ah(t, ps, 'in-progress', sid, note) }
|
|
602
651
|
// 子任务「已了结」终态口径:resolved(已完成/已验收)+ cancelled(人主动放弃该子任务范围)
|
|
603
652
|
// + archived(归档=人的显式了结,与 childStats 进度口径同源)。
|
|
604
653
|
// 为什么 cancelled 也算:cancelled 是人的显式决定,该子任务范围已关闭;若不算,一张被取消的
|
|
@@ -634,6 +683,7 @@ export function maybeAutoCloseParent(d, childTask) {
|
|
|
634
683
|
if (pst !== 'done') {
|
|
635
684
|
p.hooks.post.pending = true // hook-post 幂等占用标记:poolCycle 见它才 spawn(spawn 后清除,失败再置回)
|
|
636
685
|
p.hooks.post.state = 'running'
|
|
686
|
+
assertTransition(p.status, p.status, 'parentAuto') // 同态维持(延迟收口挂闸门,不转 verifying)
|
|
637
687
|
ah(p, p.status, p.status, 'system', 'auto: all subtasks settled,post hook 收口未完成,延迟 verifying')
|
|
638
688
|
return p
|
|
639
689
|
}
|
|
@@ -648,12 +698,14 @@ export function maybeAutoCloseParent(d, childTask) {
|
|
|
648
698
|
// full/work 零变化:照旧推进 verifying 走验收(work 卡在 resolveApply 侧本就落 resolved,不经此分支)。
|
|
649
699
|
// 边界:只修推进侧不再把 direct 卡推进它够不到的状态;派发侧过滤闸(pickDispatch)一字不动。
|
|
650
700
|
if (p.pipeline === 'direct') {
|
|
701
|
+
assertTransition(p.status, 'resolved', 'parentAuto')
|
|
651
702
|
p.status = 'resolved'
|
|
652
703
|
p.resolvedAt = new Date().toISOString()
|
|
653
704
|
p.resolution = 'all subtasks resolved'
|
|
654
705
|
ah(p, 'in-progress', 'resolved', 'system', 'auto: all subtasks resolved(direct 父卡直接收口)')
|
|
655
706
|
return p
|
|
656
707
|
}
|
|
708
|
+
assertTransition(p.status, 'verifying', 'parentAuto')
|
|
657
709
|
p.status = 'verifying'
|
|
658
710
|
p.resolvedAt = new Date().toISOString()
|
|
659
711
|
p.resolution = 'all subtasks resolved'
|
|
@@ -662,8 +714,8 @@ export function maybeAutoCloseParent(d, childTask) {
|
|
|
662
714
|
}
|
|
663
715
|
// 兼容名:既有调用点(verifyApply)与 TEAM_SPLIT_RULE / README 的对外语义名保持不变,内部委托共享 helper。
|
|
664
716
|
export function checkParentAuto(d, t) { return maybeAutoCloseParent(d, t) }
|
|
665
|
-
export function resolveApply(d, t, sid, status, resolution, note) { var ps = t.status; if (status === 'verifying' && t.pipeline && t.pipeline !== 'full') { status = 'resolved' } t.status = status; t.resolution = resolution || null; t.resolvedAt = new Date().toISOString(); ah(t, ps, status, sid, note); var r = { ok: true, task: t }; var p = maybeAutoCloseParent(d, t); if (p) { r.parentUpdated = true }; return r }
|
|
666
|
-
export function verifyApply(d, t, sid, verdict, comment) { var ps = t.status; if (verdict === 'approved') { t.status = 'resolved'; t.verifiedAt = new Date().toISOString(); t.verifiedBy = sid; delete t.frozen; delete t.frozenAt; delete t.frozenBy; ah(t, ps, 'resolved', sid, 'approved' + (comment ? ': ' + comment : '')) } else { t.status = 'in-progress'; t.resolvedAt = null; t.resolution = null; ah(t, ps, 'in-progress', sid, 'rejected' + (comment ? ': ' + comment : '')) }; var r = { ok: true, task: t }; if (verdict === 'approved' && isb(t)) { var p = checkParentAuto(d, t); if (p) { r.parentUpdated = true } }; return r }
|
|
717
|
+
export function resolveApply(d, t, sid, status, resolution, note) { var ps = t.status; if (status === 'verifying' && t.pipeline && t.pipeline !== 'full') { status = 'resolved' } assertTransition(ps, status, 'resolve'); t.status = status; t.resolution = resolution || null; t.resolvedAt = new Date().toISOString(); ah(t, ps, status, sid, note); var r = { ok: true, task: t }; var p = maybeAutoCloseParent(d, t); if (p) { r.parentUpdated = true }; return r }
|
|
718
|
+
export function verifyApply(d, t, sid, verdict, comment) { var ps = t.status; assertTransition(ps, verdict === 'approved' ? 'resolved' : 'in-progress', 'verify'); if (verdict === 'approved') { t.status = 'resolved'; t.verifiedAt = new Date().toISOString(); t.verifiedBy = sid; delete t.frozen; delete t.frozenAt; delete t.frozenBy; ah(t, ps, 'resolved', sid, 'approved' + (comment ? ': ' + comment : '')) } else { t.status = 'in-progress'; t.resolvedAt = null; t.resolution = null; ah(t, ps, 'in-progress', sid, 'rejected' + (comment ? ': ' + comment : '')) }; var r = { ok: true, task: t }; if (verdict === 'approved' && isb(t)) { var p = checkParentAuto(d, t); if (p) { r.parentUpdated = true } }; return r }
|
|
667
719
|
// 归档落定(task_archive 工具与 archive-task RPC 共享,单一行为口径;门禁 archiveErr 留在
|
|
668
720
|
// rpc.mjs——活性判定依赖 index.mjs 注入的 hasActiveRun,core 保持纯函数):置 archived +
|
|
669
721
|
// 级联归档子卡 + 触发父卡自动收口。
|
|
@@ -849,7 +901,7 @@ export function preHookGate(epic) {
|
|
|
849
901
|
// (全子任务 resolved → 父 verifying 要求父卡在 in-progress,此前 pending 父卡永远到不了)。
|
|
850
902
|
// draft 父卡不动(草稿是刻意的人工态);已在 in-progress/verifying 的不重放(返回 null)。
|
|
851
903
|
// 返回被推进的父卡(无 parentId / 父卡不存在 / 父卡非 pending → null)。
|
|
852
|
-
export function parentKickOnDispatch(d, t) { if (!isb(t)) return null; var p = gpt(t, d.tasks); if (!p || p.status !== 'pending') return null; p.status = 'in-progress'; ah(p, 'pending', 'in-progress', 'system', '首个子任务派发,史诗进入推进态'); return p }
|
|
904
|
+
export function parentKickOnDispatch(d, t) { if (!isb(t)) return null; var p = gpt(t, d.tasks); if (!p || p.status !== 'pending') return null; assertTransition(p.status, 'in-progress', 'parentKick'); p.status = 'in-progress'; ah(p, 'pending', 'in-progress', 'system', '首个子任务派发,史诗进入推进态'); return p }
|
|
853
905
|
|
|
854
906
|
// childStats 聚合(get-tasks 返回体字段,按 tasks 现算零存储):
|
|
855
907
|
// { <parentId>: { total, settled, resolved, active, activeTitle } }
|
|
@@ -1207,6 +1259,24 @@ function hasSettledWorkerRun(t) {
|
|
|
1207
1259
|
for (var i = 0; i < t.runs.length; i++) { var r = t.runs[i]; if (r && r.role === 'worker' && r.outcome && r.outcome !== 'running') return true }
|
|
1208
1260
|
return false
|
|
1209
1261
|
}
|
|
1262
|
+
// ===== touches 边界清单注入(task-mwkc8jhi)=====
|
|
1263
|
+
// 实证根因(2026-11-17;task-mw368ovj / task-mwkbm37s 两次 Worker 上报「本卡 touches 只含第一个
|
|
1264
|
+
// 文件」,实际卡面均为多条):不是 Worker 看漏,而是 buildWorkerPrompt 从未注入 t.touches——
|
|
1265
|
+
// Worker 从始至终不知道本卡允许改哪些文件,只能凭描述猜、或凭自己改了什么反推;动了第一个文件
|
|
1266
|
+
// 就以为边界只有它(prompt 全文无边界清单是共同根因)。
|
|
1267
|
+
// 修法:把完整有效锁集(effectiveTouches:touches ∪ 仲裁扩权 extraTouches)在「开工计划闸口」
|
|
1268
|
+
// 段之前逐条注入,与闸口判定同读一份事实源(rpc.planGateApply 亦读 core.effectiveTouches)——
|
|
1269
|
+
// 只加 prompt 可见性,不改闸口判定逻辑(planGateApply 不动),零新语义。
|
|
1270
|
+
// 空 touches(无声明卡)返回 '' → 不注入该段,无声明卡 prompt 逐字不变;
|
|
1271
|
+
// 有 extraTouches 时加一行标注(仲裁扩权后的文件同为合法边界,Worker 应看到)。
|
|
1272
|
+
function touchesBoundaryText(t) {
|
|
1273
|
+
var eff = effectiveTouches(t)
|
|
1274
|
+
if (!eff.length) return ''
|
|
1275
|
+
var out = '本卡 touches(允许改动的文件边界,越界会被闸口拦截):'
|
|
1276
|
+
for (var i = 0; i < eff.length; i++) out += '\n - ' + eff[i]
|
|
1277
|
+
if (t && Array.isArray(t.extraTouches) && t.extraTouches.length) out += '\n(含仲裁扩权 extraTouches,已并入上述清单——这些都是本卡合法边界)'
|
|
1278
|
+
return out
|
|
1279
|
+
}
|
|
1210
1280
|
export function buildWorkerPrompt(t, pack, feedbackEnabled) {
|
|
1211
1281
|
var notes = histNotes(t)
|
|
1212
1282
|
var msgs = buildMessages(t)
|
|
@@ -1222,6 +1292,10 @@ export function buildWorkerPrompt(t, pack, feedbackEnabled) {
|
|
|
1222
1292
|
// 学习飞轮 v1 软召回(feedbackEnabled 关闭时不出现):只提示"先查历史教训",看板绝不代查——
|
|
1223
1293
|
// 环境里有没有笔记/记忆类工具、教训库长什么样,都是 Worker 自己判断的事(零耦合)。
|
|
1224
1294
|
if (feedbackEnabled !== false) p += '\n\n' + LESSON_RECALL_HINT
|
|
1295
|
+
// touches 边界清单(task-mwkc8jhi):动笔前先让 Worker 看到本卡能改哪些文件——闸口条款紧接其后,
|
|
1296
|
+
// 没有这份清单,闸口比对的「边界」对 Worker 是黑箱(它只能靠猜/靠已改文件反推,这正是两次误判的根因)。
|
|
1297
|
+
var boundaryW = touchesBoundaryText(t)
|
|
1298
|
+
if (boundaryW) p += '\n\n' + boundaryW
|
|
1225
1299
|
// 开工计划闸口(task-mvneoyba):防约束漂移——touches 边界在「动笔前」的零代价时刻拦截,
|
|
1226
1300
|
// 比提交后才发现越界返工便宜得多。语义三条缺一不可:时机=动笔前、格式=『计划改动:』前缀、
|
|
1227
1301
|
// 后果=越界会被纠正。host 侧比对接线在 rpc.mjs board_report progress 分支(只警示不阻断)。
|
|
@@ -1288,6 +1362,11 @@ export function buildVerifierPrompt(t, pack, userGuide) {
|
|
|
1288
1362
|
// 跑偏归因条款(调研遵循·host 三件套 ②):驳回理由注明「立单缺调研」——归因计入驳回热点统计,
|
|
1289
1363
|
// 供主窗口分诊「立单缺料 vs Worker 执行问题」,缺料占高了就该把建卡调研门禁拧紧。
|
|
1290
1364
|
p += '\n驳回归因:若 Worker 的产出明显因缺少调研上下文而跑偏/绕路,驳回时请在驳回理由里注明「立单缺调研」(归因会计入驳回热点统计)。'
|
|
1365
|
+
// touches 边界清单同补(task-mwkc8jhi):Verifier 的「改动范围基线」审计需要与 Worker 同一份清单——
|
|
1366
|
+
// 此前 prompt 只在文件纪律里提「任务声明的 touches」,却不给清单本体,Verifier 同样只能猜。
|
|
1367
|
+
// 空 touches 不注入(与 Worker 侧同口径)。
|
|
1368
|
+
var boundaryV = touchesBoundaryText(t)
|
|
1369
|
+
if (boundaryV) p += '\n\n' + boundaryV + '\n(上述清单即改动范围基线:Worker 交付的 diff 概要应落在这些文件内,越界一律驳回。)'
|
|
1291
1370
|
// 文件纪律(task-muy3gm03,用户口径「验收时可以写必要的测试文件,不要动工程代码」):
|
|
1292
1371
|
// 写死进 prompt 的硬纪律 + 事后兜底威慑(touches 审计:Worker 交付的 diff 概要与任务声明的
|
|
1293
1372
|
// touches 即改动范围基线,越界即驳回——这层审计对 verifier 自己同样生效)。
|