@zhuan-ai/zhuanspec 2.11.11 → 2.11.13
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/dist/core/hooks/init.js
CHANGED
|
@@ -21,7 +21,9 @@ async function checkVersionUpdate() {
|
|
|
21
21
|
const pkgPath = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', '..', '..', 'package.json');
|
|
22
22
|
const pkgContent = JSON.parse(await fs.promises.readFile(pkgPath, 'utf-8'));
|
|
23
23
|
const current = pkgContent.version;
|
|
24
|
-
|
|
24
|
+
// 显式指定公共 npm registry,避免受用户本地 registry 或私有源同步延迟影响
|
|
25
|
+
// --cache-min=0 强制绕过本地 metadata 缓存,确保拿到真正的 latest
|
|
26
|
+
const { stdout } = await execAsync('npm view @zhuan-ai/zhuanspec version --registry https://registry.npmjs.org/ --cache-min=0', { timeout: 5000 });
|
|
25
27
|
const latest = stdout.trim();
|
|
26
28
|
if (!latest || !current)
|
|
27
29
|
return null;
|
|
@@ -527,12 +527,18 @@ const archiveSteps = `**前置检查**:
|
|
|
527
527
|
|
|
528
528
|
**步骤**
|
|
529
529
|
0. **检查知识库**:运行 \`rg "[关键词]" zhuanspec/knowledge/\` 搜索是否有需要沉淀的知识。阅读 \`zhuanspec/knowledge/index.md\` 了解项目级知识摘要。
|
|
530
|
-
1.
|
|
530
|
+
1. **切换 Phase 到 archive(第一步,必须立即执行)**:
|
|
531
531
|
- 如果此提示已包含特定的变更 ID(例如在由斜杠命令参数填充的 \`<ChangeId>\` 块内),请在修剪空白后使用该值。
|
|
532
532
|
- 如果对话中松散地引用了变更(例如通过标题或摘要),运行 \`zhuanspec list\` 以显示可能的 ID,分享相关候选,并确认用户意图是哪一个。
|
|
533
|
-
-
|
|
534
|
-
-
|
|
535
|
-
-
|
|
533
|
+
- 如果仍然无法识别单个变更 ID,请停止并告诉用户还无法归档任何内容。
|
|
534
|
+
- **必须立即运行**:\`zhuanspec progress set-phase <change-id> archive\`
|
|
535
|
+
- 执行后运行 \`zhuanspec progress show <change-id>\` 或 \`cat zhuanspec/changes/<change-id>/metrics/progress.json | jq '.phase'\` 确认 \`phase=archive\`
|
|
536
|
+
- ✅ 确认成功后才能进入下一步;❗ 未完成 Phase 切换前,禁止执行 \`zhuanspec archive\`
|
|
537
|
+
|
|
538
|
+
⚠️ **CHECKPOINT [PHASE-SWITCHED-TO-ARCHIVE]**:
|
|
539
|
+
- \`progress.phase\` 必须从 \`review\` 变为 \`archive\`
|
|
540
|
+
- \`progress.phaseTransitions\` 必须新增一条 \`{from:'review', to:'archive'}\`
|
|
541
|
+
- \`progress.phaseDurations\` 必须关闭 review 段并开启 archive 段
|
|
536
542
|
2. 通过运行 \`zhuanspec list\`(或 \`zhuanspec show <id>\`)验证变更 ID,如果变更缺失、已归档或尚未准备好归档,则停止。
|
|
537
543
|
3. **验证 Review 门禁**:确认上述四个结果文件存在且全部通过。
|
|
538
544
|
4. 运行 \`zhuanspec archive <id> --yes\`,以便 CLI 移动变更并应用规范更新,无需提示(仅对仅工具类工作使用 \`--skip-specs\`)。
|
|
@@ -603,10 +609,17 @@ const reviewGuardrails = `${baseGuardrails}\n- **门禁审查阶段**:review
|
|
|
603
609
|
- **强制审查**:所有变更在归档前必须通过三轨门禁,确保代码质量、测试覆盖与 Spec-Code 一致性。
|
|
604
610
|
- **Skill 触发要求**:必须触发 \`code-review-expert\`(代码审查轨)与 \`generate-mockito-unit-test\`(单测轨)。`;
|
|
605
611
|
const reviewSteps = `**步骤**
|
|
606
|
-
1.
|
|
607
|
-
- 如果此提示已包含特定的变更 ID
|
|
608
|
-
-
|
|
609
|
-
-
|
|
612
|
+
1. **切换 Phase 到 review(第一步,必须立即执行)**:
|
|
613
|
+
- 如果此提示已包含特定的变更 ID,请使用该值;否则运行 \`zhuanspec list\` 显示活跃变更并询问用户要审查哪个
|
|
614
|
+
- **必须立即运行**:\`zhuanspec progress set-phase <change-id> review\`
|
|
615
|
+
- 执行后运行 \`zhuanspec progress show <change-id>\` 或 \`cat zhuanspec/changes/<change-id>/metrics/progress.json | jq '.phase'\` 确认 \`phase=review\`
|
|
616
|
+
- ✅ 确认成功后才能进入下一步;❗ 未完成 Phase 切换前,禁止触发任何 skill 或运行 \`zhuanspec review\`
|
|
617
|
+
|
|
618
|
+
⚠️ **CHECKPOINT [PHASE-SWITCHED-TO-REVIEW]**:
|
|
619
|
+
- \`progress.phase\` 必须从 \`apply\` 变为 \`review\`
|
|
620
|
+
- \`progress.phaseTransitions\` 必须新增一条 \`{from:'apply', to:'review'}\`
|
|
621
|
+
- \`progress.phaseDurations\` 必须关闭 apply 段并开启 review 段
|
|
622
|
+
- 三者任一缺失,说明 set-phase 未生效,必须排查后重试,禁止继续
|
|
610
623
|
2. **执行三轨并行校验(强制)**:
|
|
611
624
|
- **轨道 A:Code Review 轨**
|
|
612
625
|
- 使用 Skill 工具调用 \`code-review-expert\` skill
|