sillyspec 3.25.8 → 3.25.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/package.json +1 -1
- package/src/index.js +40 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -82,6 +82,7 @@ SillySpec CLI — 规范驱动开发工具包
|
|
|
82
82
|
sillyspec workflow list
|
|
83
83
|
sillyspec gate <stage> --change <name> [--json] 机器门控:阶段能否标记完成(只读)
|
|
84
84
|
sillyspec derive <facet> --change <name> [--json] 单项事实核验(facet: execute-evidence|verify-test|task-reviews|artifacts)
|
|
85
|
+
sillyspec backfill-reviews --change <name> [--json] 为手动补的 task 生成 review.json 草稿(cannot_verify,解 archive 客观完成度阻断)
|
|
85
86
|
|
|
86
87
|
sillyspec doctor [子命令] 进度库健康检查 + 修复(顶层命令,非 worktree doctor)
|
|
87
88
|
(无子命令) 跑诊断,列出问题
|
|
@@ -402,6 +403,44 @@ async function main() {
|
|
|
402
403
|
process.exitCode = exitCode;
|
|
403
404
|
break;
|
|
404
405
|
}
|
|
406
|
+
case 'backfill-reviews': {
|
|
407
|
+
// 手动补 task(reopen execute / 直接实现)缺 review.json 的官方入口(坑 verify-archive-flow-pitfalls 坑2)。
|
|
408
|
+
// 复用 generateTaskReviewDrafts(execute --done 同源兜底,幂等、fail-open):据 git diff base..head + working-tree
|
|
409
|
+
// 按 task allowed_paths 归属生成 cannot_verify 草稿,agent 复核后升级 pass/fail。execute 完成后手动补的 task
|
|
410
|
+
// 无子代理 review 落盘 → archive step1 客观完成度(真相源=review.json verdict)判缺 → 阻断归档;本命令补齐
|
|
411
|
+
// 缺失草稿,独立可随时跑(不必再 execute --done)。缺数据(无 tasks/ 目录 / 改动未 commit / 无 worktree meta)
|
|
412
|
+
// 时 generateTaskReviewDrafts 提前返回 reason,如实打印不报错。
|
|
413
|
+
const brChangeIdx = args.indexOf('--change');
|
|
414
|
+
const brChange = brChangeIdx >= 0 && args[brChangeIdx + 1] ? args[brChangeIdx + 1] : null;
|
|
415
|
+
if (!brChange) {
|
|
416
|
+
console.error('用法: sillyspec backfill-reviews --change <name> [--json] [--spec-dir <path>]\n 为手动补的 task 生成 review.json 草稿(cannot_verify),解 archive 客观完成度阻断');
|
|
417
|
+
process.exit(2);
|
|
418
|
+
}
|
|
419
|
+
const { generateTaskReviewDrafts } = await import('./task-review.js');
|
|
420
|
+
// --spec-dir 透传 platformOpts.specRoot(与 gate/derive 对称);不传走默认 join(cwd,'.sillyspec')。
|
|
421
|
+
const brPlatformOpts = {};
|
|
422
|
+
if (specDir) brPlatformOpts.specRoot = specDir;
|
|
423
|
+
const result = await generateTaskReviewDrafts({ changeName: brChange, cwd: dir, platformOpts: brPlatformOpts });
|
|
424
|
+
if (json) {
|
|
425
|
+
process.stdout.write(JSON.stringify({ ok: true, command: 'backfill-reviews', change: brChange, ...result }));
|
|
426
|
+
} else {
|
|
427
|
+
if (result.generated > 0) {
|
|
428
|
+
console.log('📄 已补写 ' + result.generated + ' 个 per-task review.json 草稿(cannot_verify,需 agent 复核后升级 pass/fail) [' + brChange + ']');
|
|
429
|
+
} else {
|
|
430
|
+
console.log('ℹ️ 无草稿可补 [' + brChange + ']' + (result.reason ? ':' + result.reason : ''));
|
|
431
|
+
}
|
|
432
|
+
if (result.skipped > 0) {
|
|
433
|
+
console.log(' 跳过 ' + result.skipped + ' 个 task(review.json 已存在 / 空 diff 无从归属)');
|
|
434
|
+
}
|
|
435
|
+
if (result.unattributed && result.unattributed.length > 0) {
|
|
436
|
+
console.warn(' ⚠️ ' + result.unattributed.length + ' 个变更文件未归属任何 task(顺带修复/非源码),草稿未覆盖:' + result.unattributed.join(', '));
|
|
437
|
+
}
|
|
438
|
+
if (result.executeRunId) {
|
|
439
|
+
console.log(' execute run id: ' + result.executeRunId);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
break;
|
|
443
|
+
}
|
|
405
444
|
case 'docs': {
|
|
406
445
|
const docsSubCmd = filteredArgs[1];
|
|
407
446
|
if (docsSubCmd === 'migrate') {
|
|
@@ -1309,7 +1348,7 @@ SillySpec modules — 模块文档管理
|
|
|
1309
1348
|
break;
|
|
1310
1349
|
}
|
|
1311
1350
|
default: {
|
|
1312
|
-
const topCommands = ['init', 'setup', 'run', 'progress', 'worktree', 'local', 'workflow', 'gate', 'derive', 'modules', 'change-rename', 'knowledge', 'platform', 'scan', 'brainstorm', 'plan', 'execute', 'verify', 'archive', 'quick', 'explore', 'status', 'doctor', 'auto', 'runtime'];
|
|
1351
|
+
const topCommands = ['init', 'setup', 'run', 'progress', 'worktree', 'local', 'workflow', 'gate', 'derive', 'backfill-reviews', 'modules', 'change-rename', 'knowledge', 'platform', 'scan', 'brainstorm', 'plan', 'execute', 'verify', 'archive', 'quick', 'explore', 'status', 'doctor', 'auto', 'runtime'];
|
|
1313
1352
|
const suggestion = didYouMean(command, topCommands);
|
|
1314
1353
|
console.error(`❌ 未知命令: ${command}`);
|
|
1315
1354
|
if (suggestion) console.error(` 你是想输入「${suggestion}」吗?`);
|