sillyspec 3.28.9 → 3.28.10
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/.claude/full.json +1 -0
- package/package.json +1 -1
- package/src/change-list.js +73 -20
- package/src/config-schema.js +30 -0
- package/src/contract-matrix.js +84 -5
- package/src/cross-repo-reconcile.js +134 -0
- package/src/design-facts.js +56 -17
- package/src/index.js +18 -1
- package/src/knowledge-classify.js +20 -1
- package/src/probe7-anchor-check.js +69 -0
- package/src/quicklog.js +9 -4
- package/src/run/command.js +25 -2
- package/src/run/complete.js +70 -8
- package/src/run/gate-snapshot.js +110 -2
- package/src/run/gates.js +91 -7
- package/src/run/prompt.js +87 -6
- package/src/run/shared.js +71 -1
- package/src/scope-audit.js +101 -31
- package/src/stages/cmd-existence.js +9 -3
- package/src/stages/knowledge.js +24 -3
- package/src/stages/plan-postcheck.js +32 -5
- package/src/sync-noise.js +57 -1
- package/src/sync.js +8 -4
- package/src/task-review.js +75 -26
- package/src/verify-postcheck.js +192 -55
- package/src/verify-probes.js +390 -15
- package/src/worktree-apply.js +148 -5
- package/src/worktree-deps.js +24 -1
- package/src/worktree.js +274 -10
package/src/verify-probes.js
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* verify-probes.md 模板定义六个探针,agent 此前逐条手跑 grep/递归查找/git 对账再手工拼表格。
|
|
6
6
|
* 本模块把纯机械的四个探针命令化(语义判断的留 agent,输出里显式标注):
|
|
7
7
|
* 探针1 未实现标记扫描:design §6 清单的具体文件逐行 grep TODO/FIXME/尚未实现 等
|
|
8
|
-
* 探针3 测试覆盖:逐 task 按 allowed_paths 定位模块目录,递归找测试文件(co-located tests/
|
|
8
|
+
* 探针3 测试覆盖:逐 task 按 allowed_paths 定位模块目录,递归找测试文件(co-located tests/ 陷阱
|
|
9
|
+
* + JVM src/test/<lang> 同包镜像根——Maven/Gradle 布局测试与 main 侧永不 co-located)
|
|
9
10
|
* 探针5 API 契约对账:复用 contract-matrix.verifyApiParity(endpoints.json × 前端调用)+ 表格渲染
|
|
10
11
|
* 探针6 删除对账:git diff --name-status HEAD 的 D/R × design 声明操作三态判定
|
|
11
12
|
* 探针7 验收×测试覆盖矩阵:task 卡 acceptance 自解析(jsYaml,string/array 双形态)+ 双源结构
|
|
@@ -21,7 +22,7 @@
|
|
|
21
22
|
* 供事后独立复跑审计;重复 --init 覆盖为最近一次 init 快照)。
|
|
22
23
|
*/
|
|
23
24
|
import { existsSync, readFileSync, readdirSync, statSync, writeFileSync } from 'fs'
|
|
24
|
-
import { join, dirname, basename } from 'path'
|
|
25
|
+
import { join, dirname, basename, resolve, isAbsolute } from 'path'
|
|
25
26
|
import jsYaml from 'js-yaml'
|
|
26
27
|
import { gitQuiet } from './git-helper.js'
|
|
27
28
|
import {
|
|
@@ -29,13 +30,47 @@ import {
|
|
|
29
30
|
} from './verify-facts-schema.js'
|
|
30
31
|
import { parseFileChangeListDetailed } from './change-list.js'
|
|
31
32
|
import { parseDecisions } from './decision-distill.js'
|
|
32
|
-
import { parseAllowedPaths } from './stages/plan-postcheck.js'
|
|
33
|
+
import { parseAllowedPaths, parseRepo, parseRepoRegistry } from './stages/plan-postcheck.js'
|
|
33
34
|
import { verifyApiParity, _readWorktreeMeta } from './contract-matrix.js'
|
|
34
35
|
import { splitOwnVsForeignDiffFiles } from './foreign-declared.js'
|
|
35
36
|
import { resolveSpecDir, resolveRuntimeRoot, detectWorktreeSpecDrift } from './run/shared.js'
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
// 探针1 未实现标记匹配(坑 probe1-literal-false-positive,2026-09-15 复盘实证:16 命中全
|
|
39
|
+
// 字面误报——TODO_FLAG_TODO 业务常量、「XXX完成处置」中文占位模板)。口径分三级:
|
|
40
|
+
// - 尚未实现:中文短语高置信,保持子串匹配;
|
|
41
|
+
// - TODO/FIXME/HACK:ASCII 标识符边界匹配——TODO_FLAG_TODO / parseHackArgs 等标识符内部不再
|
|
42
|
+
// 命中(两侧任一边贴 [A-Za-z0-9_] 即视为标识符成分);
|
|
43
|
+
// - XXX:边界匹配且前或后紧邻 CJK 表意字符即排除——「XXX完成处置」「订单XXX号」类中文占位
|
|
44
|
+
// 模板不再命中(独立代码注释 `XXX:` / `// XXX fix` 紧邻标点空白,仍命中)。
|
|
45
|
+
const CJK_IDEOGRAPH_CLASS = '\\u4e00-\\u9fff\\u3400-\\u4dbf'
|
|
46
|
+
const TODO_ASCII_MARKER_RE = new RegExp(`(^|[^A-Za-z0-9_])(?:TODO|FIXME|HACK)(?![A-Za-z0-9_])`)
|
|
47
|
+
const XXX_MARKER_RE = new RegExp(`(^|[^A-Za-z0-9_${CJK_IDEOGRAPH_CLASS}])XXX(?![A-Za-z0-9_${CJK_IDEOGRAPH_CLASS}])`)
|
|
48
|
+
export function isUnimplementedMarkerLine(line) {
|
|
49
|
+
if (line.includes('尚未实现')) return true
|
|
50
|
+
if (TODO_ASCII_MARKER_RE.test(line)) return true
|
|
51
|
+
if (XXX_MARKER_RE.test(line)) return true
|
|
52
|
+
return false
|
|
53
|
+
}
|
|
54
|
+
// 测试文件名判定(坑 probe3-testname-false-positive,2026-09-15 EHS 生产实证:model 目录下
|
|
55
|
+
// TestData.java 数据夹具被旧 /test|spec/i 子串命中 → task-01 假绿「找到 1 个测试文件」;
|
|
56
|
+
// specification.md / contest.css 同族反向噪音)。三路命中,任一即测试文件:
|
|
57
|
+
// - 分隔符分词(按非字母数字切段)含 test/tests/spec/specs —— foo.test.js、test_utils.py、foo-spec.ts
|
|
58
|
+
// - 裸词文件名(去扩展名即上述词,大小写归一)—— test.js、Tests.java
|
|
59
|
+
// - 驼峰末段后缀 Test/Tests/Spec/Specs/IT(Java/Kotlin 惯例 FooTest/FooIT)——只认末位驼峰段:
|
|
60
|
+
// RpFlowEngineTest 命中;TestData/TestUtil/TestMain(Test 是首段=夹具命名惯势)不命中
|
|
61
|
+
// 取向:漏检罕见命名(FooTestCase/TestFoo 前缀式)→ ⚠️ 落 agent 手查(fail-visible 可接受);
|
|
62
|
+
// 假绿掩盖真缺测是 fail-hidden,更糟——宁紧勿松。
|
|
63
|
+
const TEST_NAME_TOKENS = new Set(['test', 'tests', 'spec', 'specs'])
|
|
64
|
+
const TEST_NAME_SUFFIXES = new Set(['Test', 'Tests', 'Spec', 'Specs', 'IT'])
|
|
65
|
+
export function isTestFileName(name) {
|
|
66
|
+
const stem = String(name || '').replace(/\.[^.]+$/, '')
|
|
67
|
+
if (!stem) return false
|
|
68
|
+
if (TEST_NAME_TOKENS.has(stem.toLowerCase())) return true
|
|
69
|
+
const tokens = stem.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)
|
|
70
|
+
if (tokens.some(t => TEST_NAME_TOKENS.has(t))) return true
|
|
71
|
+
const lastHump = stem.match(/(?:[A-Z][a-z0-9]*|[A-Z]+)$/)
|
|
72
|
+
return !!lastHump && TEST_NAME_SUFFIXES.has(lastHump[0])
|
|
73
|
+
}
|
|
39
74
|
const PROBE1_MAX_MATCHES = 200
|
|
40
75
|
|
|
41
76
|
/**
|
|
@@ -89,7 +124,7 @@ function findTestFiles(rootDir, cwd, cap = 10) {
|
|
|
89
124
|
const full = join(d, e.name)
|
|
90
125
|
if (e.isDirectory()) {
|
|
91
126
|
if (!skip.has(e.name)) walk(full)
|
|
92
|
-
} else if (e.isFile() &&
|
|
127
|
+
} else if (e.isFile() && isTestFileName(e.name)) {
|
|
93
128
|
found.push(full.split('\\').join('/').replace(cwd.split('\\').join('/').replace(/\/$/, '') + '/', ''))
|
|
94
129
|
if (found.length >= cap) return
|
|
95
130
|
}
|
|
@@ -99,7 +134,179 @@ function findTestFiles(rootDir, cwd, cap = 10) {
|
|
|
99
134
|
return found
|
|
100
135
|
}
|
|
101
136
|
|
|
102
|
-
// ── 探针
|
|
137
|
+
// ── 探针 8(载荷字段契约对账,2026-09-16 EHS 二次独立复核驱动)常量与纯函数 ──
|
|
138
|
+
// 5 个 P1 里 4 处是字段/载荷错位(leaderUserId↔rpLeaderUserId 三处 Jackson 静默丢弃、小程序
|
|
139
|
+
// 缺发 reportOrgId、sourceShdId↔safelyHiddenId、report_org_name NOT NULL 边界)——探针 5 只对
|
|
140
|
+
// 账 method+path(URL 级),载荷级错位零覆盖。本探针三面启发式比对(advisory,命中≠结论):
|
|
141
|
+
// 前端请求载荷键 × 后端 Java 字段(归一化覆盖)∪ 子串疑似错位配对 ∪ SQL NOT NULL 列缺送核对。
|
|
142
|
+
const PROBE8_HEADING = '#### 探针 8:载荷字段契约对账(advisory)'
|
|
143
|
+
// 服务端填充/标准列豁免(NOT NULL 但不该由前端送)
|
|
144
|
+
const PROBE8_SERVER_FILLED_RE = /^(id|create_by|create_date|update_by|update_date|remarks|dept_id|tenant_id|del_flag)$/i
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* 归一化键:小写 + 剥全部分隔线(snake/连字符)——两侧同构(rp_category / rpCategory /
|
|
148
|
+
* rp-category → rpcategory)。注意不能「小写后再 camel 化」(会单侧引入大写不对称)。
|
|
149
|
+
*/
|
|
150
|
+
const normFieldKey = (s) => String(s || '').trim().toLowerCase().replace(/[_-]/g, '')
|
|
151
|
+
|
|
152
|
+
/** Java private 字段名提取(全大写常量 TODO_FLAG_TODO 排除——EHS 探针1 同款教训) */
|
|
153
|
+
export function extractJavaFields(text) {
|
|
154
|
+
const names = new Set()
|
|
155
|
+
const re = /private\s+(?:static\s+|final\s+)*[\w.$<>[\]]+\s+([A-Za-z_][A-Za-z0-9_]*)\s*[;=]/g
|
|
156
|
+
let m
|
|
157
|
+
while ((m = re.exec(String(text || ''))) !== null) {
|
|
158
|
+
if (!/^[A-Z0-9_]+$/.test(m[1])) names.add(m[1])
|
|
159
|
+
}
|
|
160
|
+
return names
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** SQL CREATE TABLE 行的 NOT NULL 业务列(审计列豁免) */
|
|
164
|
+
export function extractSqlNotNullColumns(text) {
|
|
165
|
+
const cols = new Set()
|
|
166
|
+
for (const line of String(text || '').split('\n')) {
|
|
167
|
+
const m = line.match(/^\s*`?([a-zA-Z_][a-zA-Z0-9_]*)`?\s+(?:varchar|char|int|integer|bigint|decimal|datetime|date|timestamp|text|double|float)\b[^,]*NOT NULL\b/i)
|
|
168
|
+
if (m && !PROBE8_SERVER_FILLED_RE.test(m[1])) cols.add(m[1])
|
|
169
|
+
}
|
|
170
|
+
return cols
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* 请求载荷键提取:apiFetch/request/axios/$http/fetch( 调用行后 8 行窗口内的对象键
|
|
175
|
+
* (key: 后随值起始为字面量/对象/数组/null/undefined/负号——排除 case/三元等形态)。
|
|
176
|
+
* UI 本地态对象(请求区外)天然不收。
|
|
177
|
+
*/
|
|
178
|
+
export function extractPayloadKeys(text) {
|
|
179
|
+
const keys = new Set()
|
|
180
|
+
const lines = String(text || '').split('\n')
|
|
181
|
+
for (let i = 0; i < lines.length; i++) {
|
|
182
|
+
if (!/\b(apiFetch|request|axios|\$http|fetch)\s*\(/.test(lines[i])) continue
|
|
183
|
+
for (let j = i; j < Math.min(i + 8, lines.length); j++) {
|
|
184
|
+
for (const m of lines[j].matchAll(/(?:^|[{,(\s])([A-Za-z_][A-Za-z0-9]*)\s*:\s(?:["'`\d{[tfn-]|null\b|undefined\b)/g)) {
|
|
185
|
+
keys.add(m[1])
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return keys
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* 探针 8 主体:design 清单三面文件(Java/SQL/前端)→ 双根(主仓 ∪ worktree)∪ 跨仓注册仓根
|
|
194
|
+
* 读取 → 归一化比对。advisory:所有输出是「候选」不是结论(UI 本地态键/服务端填充列会自然
|
|
195
|
+
* 出现在差异里,agent 逐条复核——口径注记随渲染输出)。
|
|
196
|
+
* @param {{ specBase: string, cwd: string, wtRoot?: string|null, changeName: string }} args
|
|
197
|
+
* @returns {{applicable, backendFieldCount, feKeyCount, notNullCount, javaFileCount, sqlFileCount, feFileCount,
|
|
198
|
+
* mispairs: Array<{fe,be}>, feOnly: string[], missingNotNull: Array<{col}>, notes: string[]}}
|
|
199
|
+
*/
|
|
200
|
+
export function runProbe8PayloadParity({ specBase, cwd, wtRoot = null, changeName }) {
|
|
201
|
+
const out = {
|
|
202
|
+
applicable: false, backendFieldCount: 0, feKeyCount: 0, notNullCount: 0,
|
|
203
|
+
javaFileCount: 0, sqlFileCount: 0, feFileCount: 0,
|
|
204
|
+
mispairs: [], feOnly: [], missingNotNull: [], notes: [],
|
|
205
|
+
}
|
|
206
|
+
if (!specBase || !changeName) return out
|
|
207
|
+
const designPath = join(specBase, 'changes', changeName, 'design.md')
|
|
208
|
+
if (!existsSync(designPath)) return out
|
|
209
|
+
let registry = new Map()
|
|
210
|
+
try {
|
|
211
|
+
const yamlPath = join(specBase, 'local.yaml')
|
|
212
|
+
if (existsSync(yamlPath)) registry = parseRepoRegistry(readFileSync(yamlPath, 'utf8'))
|
|
213
|
+
} catch { /* 注册表不可读 → 跨仓条目落未注册注记 */ }
|
|
214
|
+
const detailed = parseFileChangeListDetailed(designPath, { repoKeys: [...registry.keys()] })
|
|
215
|
+
|
|
216
|
+
const readEntry = (e) => {
|
|
217
|
+
// NEW: 待建前缀剥离(坑 probe1-new-prefix-miss 同款):design 清单的 NEW: 是新建意图标记,
|
|
218
|
+
// 文件系统实体无前缀——按目标路径读。
|
|
219
|
+
const probePath = String(e.path).replace(/^NEW:\s*/, '')
|
|
220
|
+
// 未注册跨仓前缀兜底识别(change-list 只对注册 key 落 e.repo;未注册 key 整条 path 保留
|
|
221
|
+
// cross-repo: 前缀原样)——现身「未注册」注记而非静默不可读。
|
|
222
|
+
const crPrefix = probePath.match(/^cross-repo:([A-Za-z0-9_.\-]+):(.*)$/)
|
|
223
|
+
if (e.repo || crPrefix) {
|
|
224
|
+
const key = e.repo || (crPrefix && crPrefix[1])
|
|
225
|
+
const relPath = e.repo ? probePath : crPrefix[2]
|
|
226
|
+
const raw = registry.get(key)
|
|
227
|
+
if (!raw) { out.notes.push(`repo「${key}」未在 local.yaml repos 注册——该仓前端文件未进探针 8 比对`); return null }
|
|
228
|
+
const root = isAbsolute(raw) ? raw : resolve(cwd, raw)
|
|
229
|
+
try { return readFileSync(join(root, relPath), 'utf8') } catch { out.notes.push(`跨仓文件不可读:${key}:${relPath}`); return null }
|
|
230
|
+
}
|
|
231
|
+
// 主仓 ∪ worktree 双根(与探针 1 同款回退)
|
|
232
|
+
for (const base of [cwd, wtRoot].filter(Boolean)) {
|
|
233
|
+
try { return readFileSync(join(base, probePath), 'utf8') } catch { /* 试下一根 */ }
|
|
234
|
+
}
|
|
235
|
+
return null
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const backendFields = new Set()
|
|
239
|
+
const notNullCols = new Set()
|
|
240
|
+
const feKeys = new Set()
|
|
241
|
+
for (const e of detailed) {
|
|
242
|
+
if (!e.path || e.path.startsWith('.sillyspec/')) continue
|
|
243
|
+
const text = readEntry(e)
|
|
244
|
+
if (text == null) continue
|
|
245
|
+
if (e.path.endsWith('.java')) {
|
|
246
|
+
out.javaFileCount++
|
|
247
|
+
for (const f of extractJavaFields(text)) backendFields.add(f)
|
|
248
|
+
} else if (e.path.endsWith('.sql')) {
|
|
249
|
+
out.sqlFileCount++
|
|
250
|
+
for (const c of extractSqlNotNullColumns(text)) notNullCols.add(c)
|
|
251
|
+
} else if (/\.(js|jsx|ts|tsx)$/.test(e.path)) {
|
|
252
|
+
out.feFileCount++
|
|
253
|
+
for (const k of extractPayloadKeys(text)) feKeys.add(k)
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
// 后端零面(无 Java 无 SQL)→ 不适用(纯前端/文档变更不打扰)
|
|
257
|
+
if (out.javaFileCount === 0 && out.sqlFileCount === 0) return out
|
|
258
|
+
out.applicable = true
|
|
259
|
+
|
|
260
|
+
const backendNorm = new Map() // norm → 原名
|
|
261
|
+
for (const f of backendFields) backendNorm.set(normFieldKey(f), f)
|
|
262
|
+
const feNorm = new Map()
|
|
263
|
+
for (const k of feKeys) feNorm.set(normFieldKey(k), k)
|
|
264
|
+
// 配对 token(camelCase/snake 切词;单字符段只保留 id)——子串关系抓 leaderUserId⊂rpLeaderUserId,
|
|
265
|
+
// token 重叠(Jaccard≥0.6)抓语义近形 punishedDutyUserId↔punishedLeaderUserId(EHS 二次复核
|
|
266
|
+
// 两类实证形态)。并列取长度差最小者(leaderUserId 优先配 rpLeaderUserId 而非更长的
|
|
267
|
+
// punishedLeaderUserId)。
|
|
268
|
+
const fieldTokens = (s) => String(s).replace(/([a-z0-9])([A-Z])/g, '$1 $2').split(/[^A-Za-z0-9]+/)
|
|
269
|
+
.map(t => t.toLowerCase()).filter(t => t.length > 1 || t === 'id')
|
|
270
|
+
|
|
271
|
+
for (const [nk, original] of feNorm) {
|
|
272
|
+
if (backendNorm.has(nk)) continue // 归一化覆盖(rpCategory ↔ rp_category)
|
|
273
|
+
const feToks = fieldTokens(original)
|
|
274
|
+
let best = null
|
|
275
|
+
let bestScore = 0
|
|
276
|
+
let bestLenPenalty = Infinity
|
|
277
|
+
for (const [bn, beOrig] of backendNorm) {
|
|
278
|
+
let score = 0
|
|
279
|
+
if ((bn.includes(nk) || nk.includes(bn)) && Math.min(bn.length, nk.length) >= 4) score = 1
|
|
280
|
+
else if (feToks.length >= 2) {
|
|
281
|
+
const bt = fieldTokens(beOrig)
|
|
282
|
+
if (bt.length >= 2) {
|
|
283
|
+
const inter = feToks.filter(t => bt.includes(t)).length
|
|
284
|
+
const union = new Set([...feToks, ...bt]).size
|
|
285
|
+
if (union > 0) score = inter / union
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
if (score <= 0) continue
|
|
289
|
+
const lenPenalty = Math.abs(bn.length - nk.length)
|
|
290
|
+
if (score > bestScore || (score === bestScore && lenPenalty < bestLenPenalty)) {
|
|
291
|
+
bestScore = score
|
|
292
|
+
bestLenPenalty = lenPenalty
|
|
293
|
+
best = beOrig
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (best && bestScore >= 0.6) out.mispairs.push({ fe: original, be: best })
|
|
297
|
+
else out.feOnly.push(original)
|
|
298
|
+
}
|
|
299
|
+
for (const col of notNullCols) {
|
|
300
|
+
const nc = normFieldKey(col)
|
|
301
|
+
if (!feNorm.has(nc) && !backendNorm.has(nc)) out.missingNotNull.push({ col })
|
|
302
|
+
}
|
|
303
|
+
out.backendFieldCount = backendFields.size
|
|
304
|
+
out.feKeyCount = feKeys.size
|
|
305
|
+
out.notNullCount = notNullCols.size
|
|
306
|
+
return out
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
|
|
103
310
|
const PROBE7_HEADING = '#### 探针 7:验收×测试覆盖矩阵'
|
|
104
311
|
// execute run id 格式(与 task-review.js isValidExecuteRunId 同口径锚定,防提示词注入/路径穿越)
|
|
105
312
|
const PROBE7_EXEC_RUN_ID_RE = /^exec-\d{4}-\d{2}-\d{2}-\d{6}(?:-[a-z0-9]{1,8}){0,2}$/
|
|
@@ -137,7 +344,7 @@ export function parseTaskAcceptance(content) {
|
|
|
137
344
|
/**
|
|
138
345
|
* allowed_paths 条目是否测试形态(结构归属面):test/ 前缀,或文件名含 .test. / _test. / spec
|
|
139
346
|
* 惯例((?:^|[._-])test(?:[._-]|$) 覆盖 foo.test.mjs / foo_test.js / test-foo.js 三形)。
|
|
140
|
-
* 比探针 3 的存在性面(
|
|
347
|
+
* 比探针 3 的存在性面(isTestFileName 文件名形态判定,宽松存在性提示)严格——这是 3/7 口径差异的落点。
|
|
141
348
|
*/
|
|
142
349
|
function isProbe7TestPath(p) {
|
|
143
350
|
const posix = String(p).split('\\').join('/')
|
|
@@ -324,6 +531,11 @@ function renderProbe7Lines(p7) {
|
|
|
324
531
|
}
|
|
325
532
|
L.push('<!-- 口径注记:探针 3 = 模块目录递归存在性面(allowed_paths 目录附近有没有测试);探针 7 = allowed_paths ∪ review changedFiles 结构归属承接面(每条 acceptance 由哪些测试承接);两者并排冲突以 7 为准。判定枚举(四选一):covered / partial / uncovered / non-testable(文档/部署类显式逃生门)。关键词命中只是提示,命中≠判定。 -->')
|
|
326
533
|
L.push('<!-- 预填说明(ql-20260915-004):判定列为 CLI 机械预填,agent 逐格复核改写——规则:无归属→uncovered(文档/部署/doc/deploy/manual/config 类词→non-testable);有归属且命中≥1→covered;有归属零命中→partial。证据列给首命中 file:line 锚点或人工核验提示。预填≠结论:与事实不符的格子必须改写(枚举须保持 covered/partial/uncovered/non-testable 纯值,备注写在证据列)。 -->')
|
|
534
|
+
// 零自动化承接计数(坑 review-zero-coverage-unwalked,2026-09-16 EHS 二次复核实证:execute
|
|
535
|
+
// 期 review 走查面事实上跟着测试覆盖走——「新增-部门支线测试充分,编辑路径与相关方支线
|
|
536
|
+
// 零覆盖」恰是 5 个 P1 的藏身处。矩阵渲染时顺带计数零承接条目,verify 复核强制显式走查
|
|
537
|
+
// 这些路径并在「代码审查」节登记走查结论——把二次复核「提前兑现移交项」的打法固化)。
|
|
538
|
+
let zeroCoverage = 0
|
|
327
539
|
for (const t of (p7.tasks || [])) {
|
|
328
540
|
L.push('')
|
|
329
541
|
L.push(`**${t.task}**`)
|
|
@@ -342,9 +554,14 @@ function renderProbe7Lines(p7) {
|
|
|
342
554
|
? `${h.terms.map(x => mdEscapeCell(x)).join('、')}(${(h.files || []).map(f => `\`${f}\``).join('、')})`
|
|
343
555
|
: '—'
|
|
344
556
|
const pre = prefillMatrixCells(item, t.testFiles, h)
|
|
557
|
+
if (pre.verdict === 'uncovered' || pre.verdict === 'partial') zeroCoverage++
|
|
345
558
|
L.push(`| ${mdEscapeCell(item)} | ${attribCell} | ${hintCell} | ${pre.verdict} | ${pre.evidence} |`)
|
|
346
559
|
})
|
|
347
560
|
}
|
|
561
|
+
if (zeroCoverage > 0) {
|
|
562
|
+
L.push('')
|
|
563
|
+
L.push(`- ⚠️ 零/半自动化承接条目 ${zeroCoverage} 条——这些路径无测试兜底,verify 复核必须**显式走查**(尤其编辑/更新链路与非主分支流:二次复核实证它们正是 P1 藏身处),走查结论登记进「代码审查」节`)
|
|
564
|
+
}
|
|
348
565
|
return L
|
|
349
566
|
}
|
|
350
567
|
|
|
@@ -394,7 +611,7 @@ export function runVerifyProbes({ cwd, changeName, specDir = null }) {
|
|
|
394
611
|
const lines = readFileSync(abs, 'utf8').split('\n')
|
|
395
612
|
lines.forEach((line, i) => {
|
|
396
613
|
if (probe1.matches.length >= PROBE1_MAX_MATCHES) return
|
|
397
|
-
if (
|
|
614
|
+
if (isUnimplementedMarkerLine(line)) probe1.matches.push({ file: probePath, line: i + 1, content: line.trim().slice(0, 160) })
|
|
398
615
|
})
|
|
399
616
|
} catch {
|
|
400
617
|
probe1.skippedFiles.push(e.path)
|
|
@@ -409,8 +626,23 @@ export function runVerifyProbes({ cwd, changeName, specDir = null }) {
|
|
|
409
626
|
let allowed = []
|
|
410
627
|
if (existsSync(cardPath)) allowed = parseAllowedPaths(readFileSync(cardPath, 'utf8'))
|
|
411
628
|
const moduleDirs = [...new Set(allowed.map(p => dirname(p.split('\\').join('/'))).filter(d => d && d !== '.'))]
|
|
412
|
-
|
|
629
|
+
// JVM 镜像测试根(坑 probe3-java-mirror-blind,2026-09-15 EHS 生产实证 task-02~06 五连
|
|
630
|
+
// 假⚠️):Maven/Gradle 布局测试在 src/test/<lang> 同包镜像树,与 src/main 侧永不
|
|
631
|
+
// co-located——只递归 allowed_paths 目录(全在 main 侧)必然落空。对命中 src/main/<lang>
|
|
632
|
+
// 的目录补推镜像目录进扫描集(主仓或 worktree 任一侧存在才列/才扫——不存在的镜像根=
|
|
633
|
+
// 该包真无测试,保持 ⚠️ 真信号)。
|
|
634
|
+
const mirrorDirs = []
|
|
413
635
|
for (const d of moduleDirs) {
|
|
636
|
+
const m = d.match(/^(.*\/src\/)main(\/(?:java|kotlin|scala|groovy)(?:\/.*)?)$/)
|
|
637
|
+
if (!m) continue
|
|
638
|
+
const mirror = `${m[1]}test${m[2]}`
|
|
639
|
+
if (mirrorDirs.includes(mirror) || moduleDirs.includes(mirror)) continue
|
|
640
|
+
if (existsSync(join(cwd, mirror)) || (wtRoot && wtRoot !== cwd && existsSync(join(wtRoot, mirror)))) {
|
|
641
|
+
mirrorDirs.push(mirror)
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
const testFiles = []
|
|
645
|
+
for (const d of [...moduleDirs, ...mirrorDirs]) {
|
|
414
646
|
// 双根并集扫描(坑 probe3-worktree-test-false-negative,2026-09-10 驾驭小结第五批②,
|
|
415
647
|
// 用户实证 5 条假 warning):apply 前新测试文件只在 worktree(untracked),而模块目录在
|
|
416
648
|
// 主仓**已存在**——旧「主仓目录缺失才回退 worktree」条件不触发,探针 3 报「未找到测试
|
|
@@ -428,6 +660,7 @@ export function runVerifyProbes({ cwd, changeName, specDir = null }) {
|
|
|
428
660
|
probe3.tasks.push({
|
|
429
661
|
task: taskId,
|
|
430
662
|
moduleDirs,
|
|
663
|
+
mirrorDirs,
|
|
431
664
|
testFiles: testFiles.slice(0, 10),
|
|
432
665
|
testFileCount: testFiles.length,
|
|
433
666
|
hasTest: testFiles.length > 0,
|
|
@@ -438,6 +671,19 @@ export function runVerifyProbes({ cwd, changeName, specDir = null }) {
|
|
|
438
671
|
// ── 探针 5:API 契约对账(复用 verifyApiParity:endpoints.json × 前端调用)──
|
|
439
672
|
const runtimeRoot = resolveRuntimeRoot({ specRoot: specDir }, specBase)
|
|
440
673
|
const probe5 = verifyApiParity(specBase, cwd, runtimeRoot, changeName)
|
|
674
|
+
// 跨仓 task 卡计数(坑 probe5-cross-repo-scope-blindness,2026-09-15 复盘:跨仓仓的前端
|
|
675
|
+
// 调用不在 parity 扫描根内,「frontend 0 调用」会被误读为漏配——渲染侧显式注记扫描面
|
|
676
|
+
// 边界。计数失败按 0(不渲染注记,零新增失败面)。
|
|
677
|
+
try {
|
|
678
|
+
const tasksDir = join(changeDir, 'tasks')
|
|
679
|
+
if (changeName && existsSync(tasksDir)) {
|
|
680
|
+
let crossRepoCardCount = 0
|
|
681
|
+
for (const f of readdirSync(tasksDir).filter(n => /^task-\d+\.md$/.test(n))) {
|
|
682
|
+
if (parseRepo(readFileSync(join(tasksDir, f), 'utf8'))) crossRepoCardCount++
|
|
683
|
+
}
|
|
684
|
+
if (crossRepoCardCount > 0) probe5.crossRepoCardCount = crossRepoCardCount
|
|
685
|
+
}
|
|
686
|
+
} catch { /* tasks 目录不可读 → 不注记 */ }
|
|
441
687
|
|
|
442
688
|
// ── 探针 6:代码删除对账(git diff --name-status HEAD 的 D/R × design 声明三态)──
|
|
443
689
|
const probe6 = { deletions: [], unavailable: false, note: '以 git 事实为准(真实 > 声明);是否 FAIL blocker 由 agent 诚实判定' }
|
|
@@ -510,7 +756,16 @@ export function runVerifyProbes({ cwd, changeName, specDir = null }) {
|
|
|
510
756
|
}
|
|
511
757
|
}
|
|
512
758
|
|
|
513
|
-
|
|
759
|
+
// ── 探针 8:载荷字段契约对账(advisory;2026-09-16 EHS 二次复核驱动——字段错位族 4 处
|
|
760
|
+
// P1 是 URL 级 parity 的真空带)。fail-soft:内部全兜,异常降级 not-applicable 不炸整体。──
|
|
761
|
+
let probe8 = { applicable: false, mispairs: [], feOnly: [], missingNotNull: [], notes: [] }
|
|
762
|
+
try {
|
|
763
|
+
probe8 = runProbe8PayloadParity({ specBase, cwd, wtRoot, changeName })
|
|
764
|
+
} catch (e) {
|
|
765
|
+
probe8.notes = [`探针 8 执行失败(fail-soft 跳过):${e && e.message ? e.message : e}`]
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
return { probe1, probe3, probe5, probe6, probe7, probe8 }
|
|
514
769
|
}
|
|
515
770
|
|
|
516
771
|
/**
|
|
@@ -543,9 +798,13 @@ export function renderVerifyProbesReport(result) {
|
|
|
543
798
|
if (!t.located) {
|
|
544
799
|
L.push(`- ⚠️ ${t.task}: 无 task 卡/allowed_paths,无法定位模块目录(agent 手查)`)
|
|
545
800
|
} else if (t.hasTest) {
|
|
546
|
-
|
|
801
|
+
const mirrorNote = (t.mirrorDirs && t.mirrorDirs.length > 0)
|
|
802
|
+
? `;JVM 镜像测试根(${t.mirrorDirs.join('、')})` : ''
|
|
803
|
+
L.push(`- ✅ ${t.task}: 模块目录(${t.moduleDirs.join('、')})${mirrorNote}找到 ${t.testFileCount} 个测试文件(${t.testFiles.slice(0, 5).join('、')}${t.testFileCount > 5 ? ' …' : ''})`)
|
|
547
804
|
} else {
|
|
548
|
-
|
|
805
|
+
const mirrorNote = (t.mirrorDirs && t.mirrorDirs.length > 0)
|
|
806
|
+
? '(含 co-located tests/ 与 JVM src/test 镜像根)' : '(含 co-located tests/)'
|
|
807
|
+
L.push(`- ⚠️ ${t.task}: 模块目录(${t.moduleDirs.join('、')})递归未找到测试文件${mirrorNote}`)
|
|
549
808
|
}
|
|
550
809
|
}
|
|
551
810
|
}
|
|
@@ -564,6 +823,9 @@ export function renderVerifyProbesReport(result) {
|
|
|
564
823
|
|
|
565
824
|
L.push('#### 探针 5:API Contract Parity')
|
|
566
825
|
L.push(`- ${probe5.summary || `backend ${probe5.backendCount ?? 0} 端点 / frontend ${probe5.frontendCount ?? 0} 调用`}`)
|
|
826
|
+
if (probe5.crossRepoCardCount > 0) {
|
|
827
|
+
L.push(`- ℹ️ parity 扫描面只含主仓——另有 ${probe5.crossRepoCardCount} 张跨仓 task 卡的仓不在扫描根内,跨仓前端调用/端点请到对应仓核对(D-004 跨仓对账不在本变更范围)`)
|
|
828
|
+
}
|
|
567
829
|
if ((probe5.scanRoots || []).length > 1) {
|
|
568
830
|
L.push(`- ℹ️ 后端端点比对集为多根并集(主仓既有 ∪ worktree 新增 ∪ 存量 artifact),共扫 ${probe5.scanRoots.length} 个根`)
|
|
569
831
|
}
|
|
@@ -581,7 +843,16 @@ export function renderVerifyProbesReport(result) {
|
|
|
581
843
|
L.push('- ❌ contract gap 是真实集成缺陷——诚实判 FAIL 并回 execute 补端点(CLI 仅 advisory 不硬阻断)')
|
|
582
844
|
}
|
|
583
845
|
if ((probe5.unusedBackend || []).length > 0) {
|
|
584
|
-
|
|
846
|
+
// unused 分层展示(probe5-unused-stock-noise):本变更相关(artifact 端点集内)逐条列出,
|
|
847
|
+
// 存量其余折叠计数——EHS 实证 490 个存量端点刷屏淹没了真信号。旧字段形态(无分层)零回归全列。
|
|
848
|
+
const relevant = Array.isArray(probe5.unusedChangeRelevant) && probe5.unusedChangeRelevant.length >= 0
|
|
849
|
+
? probe5.unusedChangeRelevant : probe5.unusedBackend
|
|
850
|
+
const stock = typeof probe5.unusedStockCount === 'number' ? probe5.unusedStockCount : 0
|
|
851
|
+
L.push(`- ⚠️ ${relevant.length} 个本变更端点前端未调用(warning 不阻断):${relevant.slice(0, 5).map(u => `${u.method} ${u.path}`).join('、')}${relevant.length > 5 ? ' …' : ''}`)
|
|
852
|
+
if (stock > 0) L.push(`- ℹ️ 另有 ${stock} 个存量端点未调用(他模块存量噪音,已折叠不逐条列出)`)
|
|
853
|
+
}
|
|
854
|
+
if ((probe5.crossRepoNotes || []).length > 0) {
|
|
855
|
+
for (const n of probe5.crossRepoNotes.slice(0, 5)) L.push(`- ℹ️ ${n}`)
|
|
585
856
|
}
|
|
586
857
|
L.push('')
|
|
587
858
|
|
|
@@ -596,9 +867,43 @@ export function renderVerifyProbesReport(result) {
|
|
|
596
867
|
}
|
|
597
868
|
}
|
|
598
869
|
L.push(`- ℹ️ ${probe6.note}`)
|
|
870
|
+
L.push('')
|
|
871
|
+
L.push(...(renderProbe8Lines(result.probe8 || { applicable: false, mispairs: [], feOnly: [], missingNotNull: [], notes: [] })))
|
|
599
872
|
return L.join('\n')
|
|
600
873
|
}
|
|
601
874
|
|
|
875
|
+
/**
|
|
876
|
+
* 渲染探针 8 段(advisory 口径注记随段输出——命中≠结论,agent 逐条复核)。
|
|
877
|
+
* @param {{applicable: boolean, backendFieldCount?: number, feKeyCount?: number, notNullCount?: number,
|
|
878
|
+
* javaFileCount?: number, sqlFileCount?: number, feFileCount?: number,
|
|
879
|
+
* mispairs: Array<{fe,be}>, feOnly: string[], missingNotNull: Array<{col}>, notes: string[]}} p8
|
|
880
|
+
* @returns {string[]} 行数组(含段标题)
|
|
881
|
+
*/
|
|
882
|
+
function renderProbe8Lines(p8) {
|
|
883
|
+
const L = [PROBE8_HEADING]
|
|
884
|
+
if (!p8 || !p8.applicable) {
|
|
885
|
+
L.push('- 不适用(清单无 Java/SQL 后端面,或 design.md 缺失)')
|
|
886
|
+
for (const n of (p8 && p8.notes) || []) L.push(`- ℹ️ ${n}`)
|
|
887
|
+
return L
|
|
888
|
+
}
|
|
889
|
+
L.push('<!-- 口径注记:静态启发式对账——前端请求载荷键(apiFetch/request/axios/fetch 调用邻近对象键)× 后端 Java private 字段(归一化覆盖)∪ 疑似错位配对 ∪ SQL NOT NULL 列缺送。命中≠结论:UI 本地态键/服务端填充列会自然出现在差异里,agent 逐条复核(2026-09-16 EHS 二次复核实证:leaderUserId↔rpLeaderUserId 字段错位致相关方支线三端不可用、缺发 reportOrgId 致小程序开立被拒——URL 级 parity 抓不住载荷级错位)。 -->')
|
|
890
|
+
L.push(`- ℹ️ 比对面:前端载荷键 ${p8.feKeyCount ?? 0}(${p8.feFileCount ?? 0} 前端文件)× 后端字段 ${p8.backendFieldCount ?? 0}(${p8.javaFileCount ?? 0} Java 文件)+ NOT NULL 列 ${p8.notNullCount ?? 0}(${p8.sqlFileCount ?? 0} SQL 文件)`)
|
|
891
|
+
if ((p8.mispairs || []).length > 0) {
|
|
892
|
+
L.push(`- ⚠️ 疑似字段错位配对(前后端名近形,人工核实一对一映射):${p8.mispairs.slice(0, 8).map(p => `${p.fe} ↔ ${p.be}`).join('、')}${p8.mispairs.length > 8 ? ` …共 ${p8.mispairs.length} 对` : ''}`)
|
|
893
|
+
}
|
|
894
|
+
if ((p8.feOnly || []).length > 0) {
|
|
895
|
+
L.push(`- ℹ️ 前端独有键(候选 UI 本地态/字段错位/跨层无关):${p8.feOnly.slice(0, 10).join('、')}${p8.feOnly.length > 10 ? ` …共 ${p8.feOnly.length} 个` : ''}`)
|
|
896
|
+
}
|
|
897
|
+
if ((p8.missingNotNull || []).length > 0) {
|
|
898
|
+
L.push(`- ⚠️ NOT NULL 列前端未见(候选必填缺送/服务端填充):${p8.missingNotNull.slice(0, 8).map(c => c.col).join('、')}${p8.missingNotNull.length > 8 ? ` …共 ${p8.missingNotNull.length} 个` : ''}`)
|
|
899
|
+
}
|
|
900
|
+
if ((p8.mispairs || []).length === 0 && (p8.missingNotNull || []).length === 0) {
|
|
901
|
+
L.push('- ✅ 载荷字段面零疑似差异(归一化覆盖 + NOT NULL 全见)')
|
|
902
|
+
}
|
|
903
|
+
for (const n of p8.notes || []) L.push(`- ℹ️ ${n}`)
|
|
904
|
+
return L
|
|
905
|
+
}
|
|
906
|
+
|
|
602
907
|
/**
|
|
603
908
|
* 从 runVerifyProbes 结果构造 verify-facts.json 机器底稿对象(P3b 可复跑审计底稿)。
|
|
604
909
|
* 命令行统一 `sillyspec verify-probes --change <name>`;指标 fail-soft——字段不可得时少列
|
|
@@ -617,6 +922,7 @@ export function buildVerifyFacts(result, { changeName, now } = {}) {
|
|
|
617
922
|
const p3 = (result && result.probe3) || {}
|
|
618
923
|
const p5 = (result && result.probe5) || {}
|
|
619
924
|
const p6 = (result && result.probe6) || {}
|
|
925
|
+
const p8 = (result && result.probe8) || {}
|
|
620
926
|
// v2(2026-09-08-ir-verify-facts):probes 机器段原样;conclusion/tests/requiredEvidence/
|
|
621
927
|
// runtimeEvidence/factsConsistency 五段是 slot-backfill/实测回填段(D-001@v2),--init 快照
|
|
622
928
|
// 不落键(writeVerifyFacts 分段合并时保留既有固化段),由 backfillFactsFromMdAndTests 填。
|
|
@@ -655,6 +961,16 @@ export function buildVerifyFacts(result, { changeName, now } = {}) {
|
|
|
655
961
|
unavailable: typeof p6.unavailable === 'boolean' ? p6.unavailable : undefined,
|
|
656
962
|
}),
|
|
657
963
|
},
|
|
964
|
+
probe8: {
|
|
965
|
+
command,
|
|
966
|
+
metrics: defined({
|
|
967
|
+
mispairs: len(p8.mispairs),
|
|
968
|
+
feOnly: len(p8.feOnly),
|
|
969
|
+
missingNotNull: len(p8.missingNotNull),
|
|
970
|
+
feKeys: num(p8.feKeyCount),
|
|
971
|
+
backendFields: num(p8.backendFieldCount),
|
|
972
|
+
}),
|
|
973
|
+
},
|
|
658
974
|
},
|
|
659
975
|
}
|
|
660
976
|
}
|
|
@@ -717,6 +1033,36 @@ export function writeVerifyFacts(changeDir, result, changeName, opts = {}) {
|
|
|
717
1033
|
* @param {{ verifyMd: string, testCheckResult?: object|null }} opts
|
|
718
1034
|
* @returns {{ facts: object, conclusion: string|null, evidenceCount: number, receiptCount: number, testsBackfilled: boolean }}
|
|
719
1035
|
*/
|
|
1036
|
+
// 移交项结构化(坑 handover-only-in-prose,2026-09-15/16 EHS 生产实证):verify 结论
|
|
1037
|
+
// PASS WITH NOTES 的移交条目(环境阻断复跑/人工验收/待执行脚本)此前只活在结论槽正文
|
|
1038
|
+
// 叙述——后续独立复核发现被环境阻断 deferred 的集成测试里正藏着 5 个 P1;「移交项没有
|
|
1039
|
+
// 结构化清单 = 没人兜」。骨架新增「## 移交项(结构化)」章节(三列表格 + 类型枚举注释),
|
|
1040
|
+
// 本函数解析其表行为机器可读 items(facts.handover 回填 + advisory 判定用)。
|
|
1041
|
+
// 容错:占位行(<待填…)跳过;类型归一小写连字符(ENV-BLOCKED→env-blocked);未知类型
|
|
1042
|
+
// 保留原值(advisory 面向 agent 复核,不静默丢弃);非表格行(prose/注释)忽略。
|
|
1043
|
+
const HANDOVER_HEADING_RE = /^## 移交项(结构化)[^\n]*$/m
|
|
1044
|
+
export function parseHandoverRows(md) {
|
|
1045
|
+
const text = String(md || '').replace(/\r\n/g, '\n')
|
|
1046
|
+
const m = text.match(HANDOVER_HEADING_RE)
|
|
1047
|
+
if (!m) return []
|
|
1048
|
+
const after = text.slice(m.index + m[0].length)
|
|
1049
|
+
const nextSection = after.match(/\n## /)
|
|
1050
|
+
const section = nextSection ? after.slice(0, nextSection.index) : after
|
|
1051
|
+
const items = []
|
|
1052
|
+
for (const line of section.split('\n')) {
|
|
1053
|
+
const row = line.match(/^\|\s*([^|]+?)\s*\|\s*([^|]+?)\s*\|\s*([^|]*?)\s*\|\s*$/)
|
|
1054
|
+
if (!row) continue
|
|
1055
|
+
const type = row[1].trim()
|
|
1056
|
+
const item = row[2].trim()
|
|
1057
|
+
const condition = row[3].trim()
|
|
1058
|
+
if (type === '类型' || /^-{2,}$/.test(type.replace(/\|/g, ''))) continue // 表头/分隔行
|
|
1059
|
+
if (type.startsWith('<') || item.startsWith('<')) continue // 骨架占位行
|
|
1060
|
+
if (!type || !item) continue
|
|
1061
|
+
items.push({ type: type.toLowerCase().replace(/[\s_]+/g, '-'), item, condition })
|
|
1062
|
+
}
|
|
1063
|
+
return items
|
|
1064
|
+
}
|
|
1065
|
+
|
|
720
1066
|
export function backfillFactsFromMdAndTests(factsPath, { verifyMd, testCheckResult = null, conclusion = null }) {
|
|
721
1067
|
let facts = null
|
|
722
1068
|
try { facts = JSON.parse(readFileSync(factsPath, 'utf8')) } catch { /* 缺失见下 */ }
|
|
@@ -744,6 +1090,17 @@ export function backfillFactsFromMdAndTests(factsPath, { verifyMd, testCheckResu
|
|
|
744
1090
|
if (slots.hasReceiptSlot && slots.runtimeEvidence.length > 0) {
|
|
745
1091
|
facts.runtimeEvidence = slots.runtimeEvidence
|
|
746
1092
|
}
|
|
1093
|
+
// 移交项结构化回填(handover-only-in-prose):有有效行 → facts.handover 落盘(机器可读);
|
|
1094
|
+
// PASS WITH NOTES 零有效行 → advisory 警告(不阻断——存量 PASS WITH NOTES 无此章节是常态,
|
|
1095
|
+
// 渐进采纳)。EHS 实证:被环境阻断 deferred 的集成测试里藏着 5 个 P1,清单化才有
|
|
1096
|
+
// 「谁兜、怎么复跑」的可追溯面。
|
|
1097
|
+
const handoverItems = parseHandoverRows(verifyMd || '')
|
|
1098
|
+
if (handoverItems.length > 0) {
|
|
1099
|
+
facts.handover = { count: handoverItems.length, items: handoverItems }
|
|
1100
|
+
}
|
|
1101
|
+
if (conclusionSlot === 'PASS WITH NOTES' && handoverItems.length === 0) {
|
|
1102
|
+
console.warn('⚠️ 结论=PASS WITH NOTES 但「移交项(结构化)」章节零有效行——正文叙述的移交项(环境阻断复跑条件/人工验收步骤/待执行脚本)请结构化进 ## 移交项(结构化) 表格(类型枚举 env-blocked/manual-acceptance/db-script/other),避免移交项只活在 prose 里没人兜(2026-09-15 EHS 实证:被环境阻断 deferred 的集成测试里藏着 5 个 P1)。')
|
|
1103
|
+
}
|
|
747
1104
|
let testsBackfilled = false
|
|
748
1105
|
if (testCheckResult && testCheckResult.status && testCheckResult.status !== 'skipped') {
|
|
749
1106
|
facts.tests = {
|
|
@@ -961,11 +1318,21 @@ export function generateVerifyResultSkeleton(result) {
|
|
|
961
1318
|
'',
|
|
962
1319
|
'> 探针结果已机械预填;其余章节把 `<!--TODO-->` 替换为真实内容。**结论只认「结论枚举:」槽行**——',
|
|
963
1320
|
'> 槽行留「<待填:三选一>」会被 gate 判不过(fail-closed),正文其他位置的 PASS/FAIL 字样不参与判定。',
|
|
1321
|
+
'>',
|
|
1322
|
+
'> 「层」=证据可核验性分层(非执行者声明):「人工判断」指本节为语义判断,由执行 agent 填写、',
|
|
1323
|
+
'> CLI 不机械复跑(gate 抽查 + 人类审批点复核兜底);「可复跑探针/确定性检查/CLI 一致性校验」= gate 可机械复核段。',
|
|
964
1324
|
'',
|
|
965
1325
|
'## 结论 [层:人工判断]',
|
|
966
1326
|
'',
|
|
967
1327
|
'结论枚举:`<待填:三选一>`(把尖括号占位整体替换为 PASS / PASS WITH NOTES / FAIL 之一;一句话理由写在枚举后同行或下一行)',
|
|
968
1328
|
'',
|
|
1329
|
+
'## 移交项(结构化) [层:人工判断——CLI 清单核验]',
|
|
1330
|
+
'<!-- 结论=PASS WITH NOTES 时本节必填(prose 移交叙述转结构化,复跑/验收有据可查、agent 可恢复复跑);结论=PASS/FAIL 写「无」 -->',
|
|
1331
|
+
'<!-- 类型枚举:env-blocked(环境阻断,条件列必填复跑口径)/ manual-acceptance(人工验收,条件列必填验收步骤)/ db-script(待执行脚本,条件列必填执行环境与顺序)/ other -->',
|
|
1332
|
+
'| 类型 | 条目 | 复跑/验收条件 |',
|
|
1333
|
+
'|---|---|---|',
|
|
1334
|
+
'| <待填:env-blocked / manual-acceptance / db-script / other> | <待填:移交条目> | <待填:复跑/验收条件> |',
|
|
1335
|
+
'',
|
|
969
1336
|
'## 证据账(cannot_verify 任务) [层:人工判断——CLI 核验]',
|
|
970
1337
|
'<!-- 无 cannot_verify 任务时本节写「无」;有则逐 task 一行 -->',
|
|
971
1338
|
'- task-NN: <待填:三选一> | verifiedFiles: <精确路径,逗号分隔>(satisfied 必填;豁免时填 missing 并加(豁免:<一句话理由>)后缀)',
|
|
@@ -999,7 +1366,15 @@ export function generateVerifyResultSkeleton(result) {
|
|
|
999
1366
|
'<!--TODO: 关键命令输出/时间戳/commit hash 证据链;integration/deployment-critical 必填,按实际触碰的运行时组件写(启动命令/端点/请求响应/日志片段/生命周期终态断言/失败模式排除),未涉及的行写「不涉及」-->',
|
|
1000
1367
|
'',
|
|
1001
1368
|
'## 代码审查 [层:人工判断]',
|
|
1002
|
-
'<!--TODO: 问题列表 +
|
|
1369
|
+
'<!--TODO: 问题列表 + 总体评价。走查清单(零覆盖路径必查——探针 7 ⚠️ 条目即定向面):',
|
|
1370
|
+
' ① 编辑/更新链路(回显、字段映射、残留态)——非新增主链路,实证盲区;',
|
|
1371
|
+
' ② 非主分支流(相关方/旁路支线等未走查路径);',
|
|
1372
|
+
' ③ 守卫一致性:同资源端点的操作人/权限校验模式对比(实证 doSubmit 无操作人校验而 delete/withdraw 有——越权);',
|
|
1373
|
+
' ④ 载荷字段契约(探针 8 ⚠️ 配对逐条核实);',
|
|
1374
|
+
' ⑤ 分页/并发/事务原子性(无测试基建端的纯逻辑面)-->',
|
|
1375
|
+
'',
|
|
1376
|
+
'## 独立复核(可选回流槽) [层:人工判断——复核后追加]',
|
|
1377
|
+
'<!-- verify 完成后的深度复核(独立子代理/二次审查)结论回流至此:缺陷分级(P1 功能不可用 / P2 需求子项 / P3 建议修)+ 修复证据链 + 对「结论枚举」的影响改写。无复核时本节写「无」或删除。复核结论不再只活在聊天记录(2026-09-16 EHS 二次复核实证:5 个 P1 只有聊天可查,变更档案仍写 PASS WITH NOTES)。 -->',
|
|
1003
1378
|
'',
|
|
1004
1379
|
]
|
|
1005
1380
|
return L.join('\n')
|