@boyingliu01/xp-gate 0.14.2 → 0.14.3

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.
Files changed (28) hide show
  1. package/mock-policy/AGENTS.md +2 -2
  2. package/mutation/AGENTS.md +2 -2
  3. package/package.json +1 -1
  4. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  5. package/plugins/claude-code/skills/delphi-review/AGENTS.md +2 -2
  6. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +2 -2
  7. package/plugins/claude-code/skills/sprint-flow/SKILL.md +14 -6
  8. package/plugins/claude-code/skills/sprint-flow/references/phase-5-ship.md +42 -0
  9. package/plugins/claude-code/skills/sprint-flow/references/phase-6-close.md +42 -1
  10. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +2 -2
  11. package/plugins/opencode/package.json +1 -1
  12. package/plugins/opencode/skills/delphi-review/AGENTS.md +2 -2
  13. package/plugins/opencode/skills/sprint-flow/AGENTS.md +2 -2
  14. package/plugins/opencode/skills/sprint-flow/SKILL.md +14 -6
  15. package/plugins/opencode/skills/sprint-flow/references/phase-5-ship.md +42 -0
  16. package/plugins/opencode/skills/sprint-flow/references/phase-6-close.md +42 -1
  17. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +2 -2
  18. package/plugins/qoder/plugin.json +1 -1
  19. package/plugins/qoder/skills/delphi-review/AGENTS.md +2 -2
  20. package/plugins/qoder/skills/sprint-flow/AGENTS.md +2 -2
  21. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +2 -2
  22. package/principles/AGENTS.md +2 -2
  23. package/skills/delphi-review/AGENTS.md +2 -2
  24. package/skills/sprint-flow/AGENTS.md +2 -2
  25. package/skills/sprint-flow/SKILL.md +14 -6
  26. package/skills/sprint-flow/references/phase-5-ship.md +42 -0
  27. package/skills/sprint-flow/references/phase-6-close.md +42 -1
  28. package/skills/test-specification-alignment/AGENTS.md +2 -2
@@ -1,9 +1,9 @@
1
1
  # SRC/MOCK-POLICY KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-09
4
- **Commit:** 744def0
4
+ **Commit:** a09c009
5
5
  **Branch:** main
6
- **Version:** 0.14.2.0
6
+ **Version:** 0.14.3.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Mock layering policy enforcement — Gate M3 of pre-push hook. Ensures integration tests use real implementations for internal dependencies, mock external dependencies, and annotate pending mocks with removal plans. Combines project scope scanning, mock decision engine, and per-file validation into a single pipeline.
@@ -1,9 +1,9 @@
1
1
  # SRC/MUTATION KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-09
4
- **Commit:** 744def0
4
+ **Commit:** a09c009
5
5
  **Branch:** main
6
- **Version:** 0.14.2.0
6
+ **Version:** 0.14.3.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **Gate M** (incremental mutation testing) + **Gate M2** helpers (test-layer detection used by `src/mock-policy/`). Pre-push quality gate. TypeScript-only; uses Stryker.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boyingliu01/xp-gate",
3
- "version": "0.14.2",
3
+ "version": "0.14.3",
4
4
  "description": "AI-driven development workflow: 6 quality gates + Delphi review + Sprint Flow",
5
5
  "bin": {
6
6
  "xp-gate": "./bin/xp-gate.js"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xp-gate",
3
- "version": "0.14.2",
3
+ "version": "0.14.3",
4
4
  "displayName": "XP-Gate",
5
5
  "description": "Extreme Programming quality gates + AI workflow skills for Claude Code. Includes 10 quality gates (Gate 0-9), Sprint Flow (11 phases), and Delphi multi-expert review (>=90% consensus).",
6
6
  "author": {
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-09
4
- **Commit:** 744def0
4
+ **Commit:** a09c009
5
5
  **Branch:** main
6
- **Version:** 0.14.2.0
6
+ **Version:** 0.14.3.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, 3 experts from ≥2 providers, domestic models only). Supports design + code-walkthrough modes.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-09
4
- **Commit:** 744def0
4
+ **Commit:** a09c009
5
5
  **Branch:** main
6
- **Version:** 0.14.2.0
6
+ **Version:** 0.14.3.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
@@ -193,8 +193,8 @@ Phase 6/6: CLOSE → USER ACCEPTANCE (⚠️ 人工) → emergent issues → cle
193
193
  - **Phase 2/6 DESIGN**: brainstorming 设计未 APPROVED (HARD-GATE) → 用户修改 → APPROVED 后继续;autoplan taste_decisions → 用户确认;delphi-review 未 APPROVED → 修复 → APPROVED → specification.yaml
194
194
  - **Phase 3/6 BUILD**: DELPHI-GATE 未通过 → BLOCK;验证失败 > max3 → 用户决策修复/放弃;成本超阈值 → 用户确认
195
195
  - **Phase 4/6 VERIFY**: delphi code-walkthrough REQUEST_CHANGES → 用户处理 → 重新评审;browse 发现问题 → 回退 Phase 3(不暂停)
196
- - **Phase 5/6 SHIP**: finishing-a-development-branch (4选项) → 确认;ship PR → 用户确认合并;land-and-deploy 完成/失败 → 用户确认
197
- - **Phase 6/6 CLOSE**: USER ACCEPTANCE ⚠️ 必须人工验收 → 用户确认后继续;cleanup 完成/失败 → 用户确认 → 结束流程
196
+ - **Phase 5/6 SHIP**: finishing-a-development-branch (4选项) → 确认;ship PR → 用户确认合并;land-and-deploy 完成/失败 → 用户确认;⚠️ SHIP must complete merge to main + release before Phase 6
197
+ - **Phase 6/6 CLOSE**: SHIP→CLOSE GATE (校验 merge 已完成 + git status clean + 当前在 main) → Backup sprint-state → USER ACCEPTANCE ⚠️ 必须人工验收 → 用户确认后继续;cleanup 完成/失败 → 用户确认 → 结束流程
198
198
 
199
199
  ---
200
200
 
@@ -206,18 +206,21 @@ Phase 6/6: CLOSE → USER ACCEPTANCE (⚠️ 人工) → emergent issues → cle
206
206
  | 2 | **2/6** | **DESIGN** | brainstorming → autoplan → delphi-review (HARD-GATE ≥90% consensus) → to-issues → specification.yaml | specification.yaml + slices-manifest.json |
207
207
  | 3 | **3/6** | **BUILD** | GITHOOKS-GATE → DELPHI-GATE → ralph-loop (default) or parallel → TDD → freeze → blind review → verification | MVP code |
208
208
  | 4 | **4/6** | **VERIFY** | delphi-review --mode code-walkthrough → test-specification-alignment → browse QA → benchmark (optional) → learn + retro | Review report + feedback-log.md |
209
- | 5 | **5/6** | **SHIP** | finishing-a-development-branch → ship (create PR) → land-and-deploy → merge + CI + canary | PR URL + deploy status |
210
- | 6 | **6/6** | **CLOSE** | USER ACCEPTANCE (⚠️ mandatory manual) → Capture emergent issues → Cleanup worktree + branch → Sprint summary | Emergent issues list + cleanup report |
209
+ | 5 | **5/6** | **SHIP** | VERSION-GATE → finishing-a-development-branch → ship (create PR) → land-and-deploy → merge to main + CI + canary → release | PR URL + deploy status + merge confirmation |
210
+ | 6 | **6/6** | **CLOSE** | SHIP→CLOSE GATE (merge + release verified) → Backup sprint-state → USER ACCEPTANCE (⚠️ mandatory manual) → Capture emergent issues → Cleanup worktree + branch → Sprint summary | Emergent issues list + cleanup report |
211
211
 
212
212
  **Phase Flow**:
213
213
  ```
214
- PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
214
+ PREP → DESIGN → BUILD → VERIFY → SHIP (merge to main + release) → CLOSE
215
+
216
+ SHIP→CLOSE GATE
217
+ (merge verified + main clean)
215
218
  ```
216
219
 
217
220
  **Hard Gates**:
218
221
  - **Phase 2/6 → 3/6 (DESIGN → BUILD)**: Design must be APPROVED by delphi-review (≥90% consensus) + GITHOOKS-GATE (hooks installed) + DELPHI-GATE (spec APPROVED)
219
222
  - **Phase 4/6 → 5/6 (VERIFY → SHIP)**: feedback-log.md must exist (HARD-GATE)
220
- - **Phase 5/6 → 6/6 (SHIP → CLOSE)**: User acceptance must be completed (mandatory manual step)
223
+ - **Phase 5/6 → 6/6 (SHIP → CLOSE)**: PR must be merged to main + release completed (HARD-GATE). See `references/phase-6-close.md#ship--close-gate`.
221
224
 
222
225
  ---
223
226
 
@@ -349,6 +352,7 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
349
352
  - **GITHOOKS-GATE**: 验证 hooks 完整性,缺失则 `githooks/install.sh`
350
353
  - **LAND**: `land-and-deploy` — merge PR → 等待 CI (10min) → 等待 Deploy (10min) → Canary Health Check (5min)
351
354
  - **回滚**: `git revert` 最后一次 merge commit
355
+ - ⚠️ **SHIP COMPLETION**: Phase 5/6 结束前必须确认 PR 已 merge 到 main + release 已创建。未完成 merge 不得进入 Phase 6/6。详见 `references/phase-5-ship.md#ship-completion-gate`。
352
356
 
353
357
  **⚠️ VERSION-GATE 必须在 finishing-a-development-branch 之前执行。顺序反了会导致 PR 不含版本变更 → CI release workflow 不触发 → 无新版本发布。**
354
358
 
@@ -359,6 +363,8 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
359
363
  **详细指令**: 参见 `references/phase-6-close.md` — UAT checklist, emergent issues capture, cleanup procedure.
360
364
 
361
365
  **快速参考**:
366
+ - **SHIP→CLOSE GATE (MANDATORY — v0.14.3+)**: 校验 PR 已 merge、当前在 main 分支、`git status --porcelain` 为空。详见 `references/phase-6-close.md#ship--close-gate`。
367
+ - **Backup sprint-state**(MANDATORY): Phase 6 开始前将 `.sprint-state/` 备份到 repo 追踪路径,防止 worktree 清理后状态丢失。详见 `references/phase-6-close.md#backup-sprint-state`。
362
368
  - **USER ACCEPTANCE**: ⚠️ **MUST NOT be automated, skipped, or bypassed.** 即使用户说"赶时间"、"跳过验收"、"直接发布",也必须暂停等待用户确认。使用 `@templates/emergent-issues-template.md` 检查清单
363
369
  - **CLEANUP**: 保存分支信息 → `git worktree remove <worktree_path>`(精确路径,禁止通配符)→ 删除本地分支 + 远程分支 → 关闭遗留 OPEN PR → 更新 sprint-state.json → 释放 Sprint Lock
364
370
  - 输出 Cleanup Report + Sprint Summary
@@ -526,6 +532,8 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
526
532
  | DESIGN 阶段跳过 Delphi 评审直接 BUILD | 所有需求级别(轻量/标准/复杂)必须经过 autoplan + delphi-review;未 APPROVED 禁止编码 |
527
533
  | 跳过 TDD 直接实现代码 | Phase 3/6 BUILD 必须遵循 RED → GREEN → REFACTOR,测试与实现一起交付 |
528
534
  | 跳过用户验收直接 Ship | Phase 6/6 CLOSE USER ACCEPTANCE 必须人工完成;不得自动化、跳过或伪造 |
535
+ | SHIP 未完成 merge 即进入 CLOSE | Phase 5/6 SHIP 必须完成 merge to main + release 后才能进入 Phase 6/6 CLOSE,否则 worktree 清理残留 + UAT 验收的是未合并版本 |
536
+ | CLOSE 清理前未备份 sprint-state | `.sprint-state/` 在 worktree 内,worktree 删除后丢失。CLOSE 第一步必须先备份到 repo 追踪路径 |
529
537
  | 验证失败后继续追加随机修改 | 最多 3 次修复循环;仍失败则 BLOCK 并请求用户决策 |
530
538
  | 未生成 Phase Summary 就进入下一阶段 | 每个 Phase 必须写入 `.sprint-state/phase-outputs/phase-{N}-summary.md` 并通过 transition gate |
531
539
 
@@ -93,3 +93,45 @@
93
93
  **条件跳过**: 无部署配置时仅 merge + CI
94
94
 
95
95
  **输出**: 部署状态 (success/failure/skipped), Canary 报告
96
+
97
+ ---
98
+
99
+ ## SHIP COMPLETION GATE (MANDATORY — v0.14.3+)
100
+
101
+ **Purpose**: Ensure merge to main + release is complete before Phase 6/6 CLOSE. Without this gate, worktree cleanup fails (uncommitted changes + unmerged branch) and UAT happens on the wrong version (PR branch, not main).
102
+
103
+ **Execution** (BEFORE transitioning to Phase 6/6):
104
+
105
+ ```
106
+ 1. Verify PR is merged:
107
+ gh pr list --head <sprint-branch> --state merged --json number
108
+ → If no merged PR: BLOCK. Do NOT proceed to Phase 6/6.
109
+
110
+ 2. Verify current branch is main:
111
+ CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
112
+ → If not main/master: BLOCK. Switch to main first.
113
+
114
+ 3. Verify git status is clean:
115
+ git status --porcelain
116
+ → If not empty: BLOCK. Stash or commit changes first.
117
+
118
+ 4. Verify release exists:
119
+ gh release view v<X.Y.Z> --json tagName
120
+ → If not found: WARNING (manual release may have failed). Ask user.
121
+
122
+ 5. Pull latest main:
123
+ git checkout main && git pull
124
+ ```
125
+
126
+ **GATE CHECK** (BEFORE Phase 6/6 CLOSE):
127
+ ```
128
+ [SHIP→CLOSE GATE] PR merged ✓ # PR is in merged state
129
+ [SHIP→CLOSE GATE] on main branch ✓ # Current branch is main/master
130
+ [SHIP→CLOSE GATE] clean status ✓ # No uncommitted changes
131
+ [SHIP→CLOSE GATE] release exists ✓ # GitHub Release created
132
+ [SHIP→CLOSE GATE] main up-to-date ✓ # Pulled latest
133
+ ```
134
+
135
+ **IF GATE FAILS**: Orchestrator MUST complete the merge/release steps BEFORE proceeding to Phase 6/6. Do NOT skip to CLOSE.
136
+
137
+ **Output**: SHIP completion confirmation, ready for Phase 6/6.
@@ -1,12 +1,53 @@
1
1
  # Phase 6/6: CLOSE(收尾 — ⚠️ 人工验收 + 清理)
2
2
 
3
- **执行时机**: Phase 5/6 SHIP 完成后。
3
+ **执行时机**: Phase 5/6 SHIP 完成后(merge to main + release 已完成)。
4
4
  **对应旧模型**: Phase 7 USER ACCEPTANCE + Phase 8 CLEANUP
5
5
 
6
6
  **NETWORK-RESILIENCE**: 与 Phase 5/6 相同,GitHub API 在大中华区存在间歇性超时。CLEANUP 中的 `gh pr list` 和 `git push --delete` 需容忍重试。详见 `phase-5-ship.md` NETWORK-RESILIENCE 指南。
7
7
 
8
8
  ---
9
9
 
10
+ ## ⚠️ HARD-GATE: SHIP→CLOSE GATE (MANDATORY — v0.14.3+)
11
+
12
+ **Purpose**: Verify that Phase 5/6 SHIP fully completed (merge to main + release) before entering Phase 6/6 CLOSE. This gate prevents:
13
+ - Worktree cleanup failure (uncommitted changes prevent `git worktree remove`)
14
+ - UAT on wrong version (PR branch instead of merged main)
15
+
16
+ **Execution**: Before ANY Phase 6/6 step, run the SHIP→CLOSE GATE checks defined in `phase-5-ship.md#ship-completion-gate`.
17
+
18
+ **If gate fails**: Return to Phase 5/6 SHIP to complete merge/release. Do NOT proceed with CLOSE.
19
+
20
+ ---
21
+
22
+ ## Backup Sprint State (MANDATORY — v0.14.3+)
23
+
24
+ **Purpose**: `.sprint-state/` is gitignored and lives inside the worktree. When the worktree is removed during CLEANUP, all sprint state is lost. This step copies it into the main repository before cleanup.
25
+
26
+ **Execution** (immediately after SHIP→CLOSE GATE passes):
27
+
28
+ ```bash
29
+ # 1. Read sprint ID
30
+ SPRINT_ID=$(cat .sprint-state/sprint-state.json | grep '"id"' | head -1 | sed 's/.*"id": *"\([^"]*\)".*/\1/')
31
+
32
+ # 2. Backup to repo-tracked path (.sprint-history is NOT in .gitignore)
33
+ BACKUP_DIR=".sprint-history/${SPRINT_ID}"
34
+ mkdir -p "$BACKUP_DIR"
35
+ cp -r .sprint-state/* "$BACKUP_DIR/"
36
+
37
+ # 3. Verify backup
38
+ ls "$BACKUP_DIR/sprint-state.json" && echo "✅ Sprint state backed up to $BACKUP_DIR"
39
+ ```
40
+
41
+ **GATE CHECK**:
42
+ ```
43
+ [BACKUP] sprint-state.json copied ✓
44
+ [BACKUP] phase-outputs/ preserved ✓
45
+ ```
46
+
47
+ **Output**: `.sprint-history/<sprint-id>/` contains full sprint state, safely outside the worktree.
48
+
49
+ ---
50
+
10
51
  ## Part A: USER ACCEPTANCE(⚠️ 人工验收)
11
52
 
12
53
  ### 目标
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-09
4
- **Commit:** 744def0
4
+ **Commit:** a09c009
5
5
  **Branch:** main
6
- **Version:** 0.14.2.0
6
+ **Version:** 0.14.3.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boyingliu01/opencode-plugin",
3
- "version": "0.14.2",
3
+ "version": "0.14.3",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "description": "XP-Gate quality gates + AI workflow skills + Sprint Flow TUI sidebar for OpenCode",
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-09
4
- **Commit:** 744def0
4
+ **Commit:** a09c009
5
5
  **Branch:** main
6
- **Version:** 0.14.2.0
6
+ **Version:** 0.14.3.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, 3 experts from ≥2 providers, domestic models only). Supports design + code-walkthrough modes.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-09
4
- **Commit:** 744def0
4
+ **Commit:** a09c009
5
5
  **Branch:** main
6
- **Version:** 0.14.2.0
6
+ **Version:** 0.14.3.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
@@ -193,8 +193,8 @@ Phase 6/6: CLOSE → USER ACCEPTANCE (⚠️ 人工) → emergent issues → cle
193
193
  - **Phase 2/6 DESIGN**: brainstorming 设计未 APPROVED (HARD-GATE) → 用户修改 → APPROVED 后继续;autoplan taste_decisions → 用户确认;delphi-review 未 APPROVED → 修复 → APPROVED → specification.yaml
194
194
  - **Phase 3/6 BUILD**: DELPHI-GATE 未通过 → BLOCK;验证失败 > max3 → 用户决策修复/放弃;成本超阈值 → 用户确认
195
195
  - **Phase 4/6 VERIFY**: delphi code-walkthrough REQUEST_CHANGES → 用户处理 → 重新评审;browse 发现问题 → 回退 Phase 3(不暂停)
196
- - **Phase 5/6 SHIP**: finishing-a-development-branch (4选项) → 确认;ship PR → 用户确认合并;land-and-deploy 完成/失败 → 用户确认
197
- - **Phase 6/6 CLOSE**: USER ACCEPTANCE ⚠️ 必须人工验收 → 用户确认后继续;cleanup 完成/失败 → 用户确认 → 结束流程
196
+ - **Phase 5/6 SHIP**: finishing-a-development-branch (4选项) → 确认;ship PR → 用户确认合并;land-and-deploy 完成/失败 → 用户确认;⚠️ SHIP must complete merge to main + release before Phase 6
197
+ - **Phase 6/6 CLOSE**: SHIP→CLOSE GATE (校验 merge 已完成 + git status clean + 当前在 main) → Backup sprint-state → USER ACCEPTANCE ⚠️ 必须人工验收 → 用户确认后继续;cleanup 完成/失败 → 用户确认 → 结束流程
198
198
 
199
199
  ---
200
200
 
@@ -206,18 +206,21 @@ Phase 6/6: CLOSE → USER ACCEPTANCE (⚠️ 人工) → emergent issues → cle
206
206
  | 2 | **2/6** | **DESIGN** | brainstorming → autoplan → delphi-review (HARD-GATE ≥90% consensus) → to-issues → specification.yaml | specification.yaml + slices-manifest.json |
207
207
  | 3 | **3/6** | **BUILD** | GITHOOKS-GATE → DELPHI-GATE → ralph-loop (default) or parallel → TDD → freeze → blind review → verification | MVP code |
208
208
  | 4 | **4/6** | **VERIFY** | delphi-review --mode code-walkthrough → test-specification-alignment → browse QA → benchmark (optional) → learn + retro | Review report + feedback-log.md |
209
- | 5 | **5/6** | **SHIP** | finishing-a-development-branch → ship (create PR) → land-and-deploy → merge + CI + canary | PR URL + deploy status |
210
- | 6 | **6/6** | **CLOSE** | USER ACCEPTANCE (⚠️ mandatory manual) → Capture emergent issues → Cleanup worktree + branch → Sprint summary | Emergent issues list + cleanup report |
209
+ | 5 | **5/6** | **SHIP** | VERSION-GATE → finishing-a-development-branch → ship (create PR) → land-and-deploy → merge to main + CI + canary → release | PR URL + deploy status + merge confirmation |
210
+ | 6 | **6/6** | **CLOSE** | SHIP→CLOSE GATE (merge + release verified) → Backup sprint-state → USER ACCEPTANCE (⚠️ mandatory manual) → Capture emergent issues → Cleanup worktree + branch → Sprint summary | Emergent issues list + cleanup report |
211
211
 
212
212
  **Phase Flow**:
213
213
  ```
214
- PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
214
+ PREP → DESIGN → BUILD → VERIFY → SHIP (merge to main + release) → CLOSE
215
+
216
+ SHIP→CLOSE GATE
217
+ (merge verified + main clean)
215
218
  ```
216
219
 
217
220
  **Hard Gates**:
218
221
  - **Phase 2/6 → 3/6 (DESIGN → BUILD)**: Design must be APPROVED by delphi-review (≥90% consensus) + GITHOOKS-GATE (hooks installed) + DELPHI-GATE (spec APPROVED)
219
222
  - **Phase 4/6 → 5/6 (VERIFY → SHIP)**: feedback-log.md must exist (HARD-GATE)
220
- - **Phase 5/6 → 6/6 (SHIP → CLOSE)**: User acceptance must be completed (mandatory manual step)
223
+ - **Phase 5/6 → 6/6 (SHIP → CLOSE)**: PR must be merged to main + release completed (HARD-GATE). See `references/phase-6-close.md#ship--close-gate`.
221
224
 
222
225
  ---
223
226
 
@@ -349,6 +352,7 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
349
352
  - **GITHOOKS-GATE**: 验证 hooks 完整性,缺失则 `githooks/install.sh`
350
353
  - **LAND**: `land-and-deploy` — merge PR → 等待 CI (10min) → 等待 Deploy (10min) → Canary Health Check (5min)
351
354
  - **回滚**: `git revert` 最后一次 merge commit
355
+ - ⚠️ **SHIP COMPLETION**: Phase 5/6 结束前必须确认 PR 已 merge 到 main + release 已创建。未完成 merge 不得进入 Phase 6/6。详见 `references/phase-5-ship.md#ship-completion-gate`。
352
356
 
353
357
  **⚠️ VERSION-GATE 必须在 finishing-a-development-branch 之前执行。顺序反了会导致 PR 不含版本变更 → CI release workflow 不触发 → 无新版本发布。**
354
358
 
@@ -359,6 +363,8 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
359
363
  **详细指令**: 参见 `references/phase-6-close.md` — UAT checklist, emergent issues capture, cleanup procedure.
360
364
 
361
365
  **快速参考**:
366
+ - **SHIP→CLOSE GATE (MANDATORY — v0.14.3+)**: 校验 PR 已 merge、当前在 main 分支、`git status --porcelain` 为空。详见 `references/phase-6-close.md#ship--close-gate`。
367
+ - **Backup sprint-state**(MANDATORY): Phase 6 开始前将 `.sprint-state/` 备份到 repo 追踪路径,防止 worktree 清理后状态丢失。详见 `references/phase-6-close.md#backup-sprint-state`。
362
368
  - **USER ACCEPTANCE**: ⚠️ **MUST NOT be automated, skipped, or bypassed.** 即使用户说"赶时间"、"跳过验收"、"直接发布",也必须暂停等待用户确认。使用 `@templates/emergent-issues-template.md` 检查清单
363
369
  - **CLEANUP**: 保存分支信息 → `git worktree remove <worktree_path>`(精确路径,禁止通配符)→ 删除本地分支 + 远程分支 → 关闭遗留 OPEN PR → 更新 sprint-state.json → 释放 Sprint Lock
364
370
  - 输出 Cleanup Report + Sprint Summary
@@ -526,6 +532,8 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
526
532
  | DESIGN 阶段跳过 Delphi 评审直接 BUILD | 所有需求级别(轻量/标准/复杂)必须经过 autoplan + delphi-review;未 APPROVED 禁止编码 |
527
533
  | 跳过 TDD 直接实现代码 | Phase 3/6 BUILD 必须遵循 RED → GREEN → REFACTOR,测试与实现一起交付 |
528
534
  | 跳过用户验收直接 Ship | Phase 6/6 CLOSE USER ACCEPTANCE 必须人工完成;不得自动化、跳过或伪造 |
535
+ | SHIP 未完成 merge 即进入 CLOSE | Phase 5/6 SHIP 必须完成 merge to main + release 后才能进入 Phase 6/6 CLOSE,否则 worktree 清理残留 + UAT 验收的是未合并版本 |
536
+ | CLOSE 清理前未备份 sprint-state | `.sprint-state/` 在 worktree 内,worktree 删除后丢失。CLOSE 第一步必须先备份到 repo 追踪路径 |
529
537
  | 验证失败后继续追加随机修改 | 最多 3 次修复循环;仍失败则 BLOCK 并请求用户决策 |
530
538
  | 未生成 Phase Summary 就进入下一阶段 | 每个 Phase 必须写入 `.sprint-state/phase-outputs/phase-{N}-summary.md` 并通过 transition gate |
531
539
 
@@ -93,3 +93,45 @@
93
93
  **条件跳过**: 无部署配置时仅 merge + CI
94
94
 
95
95
  **输出**: 部署状态 (success/failure/skipped), Canary 报告
96
+
97
+ ---
98
+
99
+ ## SHIP COMPLETION GATE (MANDATORY — v0.14.3+)
100
+
101
+ **Purpose**: Ensure merge to main + release is complete before Phase 6/6 CLOSE. Without this gate, worktree cleanup fails (uncommitted changes + unmerged branch) and UAT happens on the wrong version (PR branch, not main).
102
+
103
+ **Execution** (BEFORE transitioning to Phase 6/6):
104
+
105
+ ```
106
+ 1. Verify PR is merged:
107
+ gh pr list --head <sprint-branch> --state merged --json number
108
+ → If no merged PR: BLOCK. Do NOT proceed to Phase 6/6.
109
+
110
+ 2. Verify current branch is main:
111
+ CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
112
+ → If not main/master: BLOCK. Switch to main first.
113
+
114
+ 3. Verify git status is clean:
115
+ git status --porcelain
116
+ → If not empty: BLOCK. Stash or commit changes first.
117
+
118
+ 4. Verify release exists:
119
+ gh release view v<X.Y.Z> --json tagName
120
+ → If not found: WARNING (manual release may have failed). Ask user.
121
+
122
+ 5. Pull latest main:
123
+ git checkout main && git pull
124
+ ```
125
+
126
+ **GATE CHECK** (BEFORE Phase 6/6 CLOSE):
127
+ ```
128
+ [SHIP→CLOSE GATE] PR merged ✓ # PR is in merged state
129
+ [SHIP→CLOSE GATE] on main branch ✓ # Current branch is main/master
130
+ [SHIP→CLOSE GATE] clean status ✓ # No uncommitted changes
131
+ [SHIP→CLOSE GATE] release exists ✓ # GitHub Release created
132
+ [SHIP→CLOSE GATE] main up-to-date ✓ # Pulled latest
133
+ ```
134
+
135
+ **IF GATE FAILS**: Orchestrator MUST complete the merge/release steps BEFORE proceeding to Phase 6/6. Do NOT skip to CLOSE.
136
+
137
+ **Output**: SHIP completion confirmation, ready for Phase 6/6.
@@ -1,12 +1,53 @@
1
1
  # Phase 6/6: CLOSE(收尾 — ⚠️ 人工验收 + 清理)
2
2
 
3
- **执行时机**: Phase 5/6 SHIP 完成后。
3
+ **执行时机**: Phase 5/6 SHIP 完成后(merge to main + release 已完成)。
4
4
  **对应旧模型**: Phase 7 USER ACCEPTANCE + Phase 8 CLEANUP
5
5
 
6
6
  **NETWORK-RESILIENCE**: 与 Phase 5/6 相同,GitHub API 在大中华区存在间歇性超时。CLEANUP 中的 `gh pr list` 和 `git push --delete` 需容忍重试。详见 `phase-5-ship.md` NETWORK-RESILIENCE 指南。
7
7
 
8
8
  ---
9
9
 
10
+ ## ⚠️ HARD-GATE: SHIP→CLOSE GATE (MANDATORY — v0.14.3+)
11
+
12
+ **Purpose**: Verify that Phase 5/6 SHIP fully completed (merge to main + release) before entering Phase 6/6 CLOSE. This gate prevents:
13
+ - Worktree cleanup failure (uncommitted changes prevent `git worktree remove`)
14
+ - UAT on wrong version (PR branch instead of merged main)
15
+
16
+ **Execution**: Before ANY Phase 6/6 step, run the SHIP→CLOSE GATE checks defined in `phase-5-ship.md#ship-completion-gate`.
17
+
18
+ **If gate fails**: Return to Phase 5/6 SHIP to complete merge/release. Do NOT proceed with CLOSE.
19
+
20
+ ---
21
+
22
+ ## Backup Sprint State (MANDATORY — v0.14.3+)
23
+
24
+ **Purpose**: `.sprint-state/` is gitignored and lives inside the worktree. When the worktree is removed during CLEANUP, all sprint state is lost. This step copies it into the main repository before cleanup.
25
+
26
+ **Execution** (immediately after SHIP→CLOSE GATE passes):
27
+
28
+ ```bash
29
+ # 1. Read sprint ID
30
+ SPRINT_ID=$(cat .sprint-state/sprint-state.json | grep '"id"' | head -1 | sed 's/.*"id": *"\([^"]*\)".*/\1/')
31
+
32
+ # 2. Backup to repo-tracked path (.sprint-history is NOT in .gitignore)
33
+ BACKUP_DIR=".sprint-history/${SPRINT_ID}"
34
+ mkdir -p "$BACKUP_DIR"
35
+ cp -r .sprint-state/* "$BACKUP_DIR/"
36
+
37
+ # 3. Verify backup
38
+ ls "$BACKUP_DIR/sprint-state.json" && echo "✅ Sprint state backed up to $BACKUP_DIR"
39
+ ```
40
+
41
+ **GATE CHECK**:
42
+ ```
43
+ [BACKUP] sprint-state.json copied ✓
44
+ [BACKUP] phase-outputs/ preserved ✓
45
+ ```
46
+
47
+ **Output**: `.sprint-history/<sprint-id>/` contains full sprint state, safely outside the worktree.
48
+
49
+ ---
50
+
10
51
  ## Part A: USER ACCEPTANCE(⚠️ 人工验收)
11
52
 
12
53
  ### 目标
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-09
4
- **Commit:** 744def0
4
+ **Commit:** a09c009
5
5
  **Branch:** main
6
- **Version:** 0.14.2.0
6
+ **Version:** 0.14.3.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xp-gate",
3
- "version": "0.14.2",
3
+ "version": "0.14.3",
4
4
  "displayName": "XP-Gate",
5
5
  "description": "Extreme Programming quality gates + AI workflow skills for Qoder. Includes 10 quality gates (Gate 0-9), Sprint Flow (11 phases), and Delphi multi-expert review (>=90% consensus).",
6
6
  "author": {
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-09
4
- **Commit:** 744def0
4
+ **Commit:** a09c009
5
5
  **Branch:** main
6
- **Version:** 0.14.2.0
6
+ **Version:** 0.14.3.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, 3 experts from ≥2 providers, domestic models only). Supports design + code-walkthrough modes.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-09
4
- **Commit:** 744def0
4
+ **Commit:** a09c009
5
5
  **Branch:** main
6
- **Version:** 0.14.2.0
6
+ **Version:** 0.14.3.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-09
4
- **Commit:** 744def0
4
+ **Commit:** a09c009
5
5
  **Branch:** main
6
- **Version:** 0.14.2.0
6
+ **Version:** 0.14.3.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
@@ -1,9 +1,9 @@
1
1
  # PRINCIPLES CHECKER MODULE
2
2
 
3
3
  **Generated:** 2026-07-09
4
- **Commit:** 744def0
4
+ **Commit:** a09c009
5
5
  **Branch:** main
6
- **Version:** 0.14.2.0
6
+ **Version:** 0.14.3.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Clean Code & SOLID principles checker — **Gate 4** of pre-commit. 14 rules × 9 language adapters, SARIF 2.1.0 output. Houses the **Boy Scout Rule** enforcement engine (Gate 6) and warning-baseline storage.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-09
4
- **Commit:** 744def0
4
+ **Commit:** a09c009
5
5
  **Branch:** main
6
- **Version:** 0.14.2.0
6
+ **Version:** 0.14.3.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, 3 experts from ≥2 providers, domestic models only). Supports design + code-walkthrough modes.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-09
4
- **Commit:** 744def0
4
+ **Commit:** a09c009
5
5
  **Branch:** main
6
- **Version:** 0.14.2.0
6
+ **Version:** 0.14.3.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
@@ -193,8 +193,8 @@ Phase 6/6: CLOSE → USER ACCEPTANCE (⚠️ 人工) → emergent issues → cle
193
193
  - **Phase 2/6 DESIGN**: brainstorming 设计未 APPROVED (HARD-GATE) → 用户修改 → APPROVED 后继续;autoplan taste_decisions → 用户确认;delphi-review 未 APPROVED → 修复 → APPROVED → specification.yaml
194
194
  - **Phase 3/6 BUILD**: DELPHI-GATE 未通过 → BLOCK;验证失败 > max3 → 用户决策修复/放弃;成本超阈值 → 用户确认
195
195
  - **Phase 4/6 VERIFY**: delphi code-walkthrough REQUEST_CHANGES → 用户处理 → 重新评审;browse 发现问题 → 回退 Phase 3(不暂停)
196
- - **Phase 5/6 SHIP**: finishing-a-development-branch (4选项) → 确认;ship PR → 用户确认合并;land-and-deploy 完成/失败 → 用户确认
197
- - **Phase 6/6 CLOSE**: USER ACCEPTANCE ⚠️ 必须人工验收 → 用户确认后继续;cleanup 完成/失败 → 用户确认 → 结束流程
196
+ - **Phase 5/6 SHIP**: finishing-a-development-branch (4选项) → 确认;ship PR → 用户确认合并;land-and-deploy 完成/失败 → 用户确认;⚠️ SHIP must complete merge to main + release before Phase 6
197
+ - **Phase 6/6 CLOSE**: SHIP→CLOSE GATE (校验 merge 已完成 + git status clean + 当前在 main) → Backup sprint-state → USER ACCEPTANCE ⚠️ 必须人工验收 → 用户确认后继续;cleanup 完成/失败 → 用户确认 → 结束流程
198
198
 
199
199
  ---
200
200
 
@@ -206,18 +206,21 @@ Phase 6/6: CLOSE → USER ACCEPTANCE (⚠️ 人工) → emergent issues → cle
206
206
  | 2 | **2/6** | **DESIGN** | brainstorming → autoplan → delphi-review (HARD-GATE ≥90% consensus) → to-issues → specification.yaml | specification.yaml + slices-manifest.json |
207
207
  | 3 | **3/6** | **BUILD** | GITHOOKS-GATE → DELPHI-GATE → ralph-loop (default) or parallel → TDD → freeze → blind review → verification | MVP code |
208
208
  | 4 | **4/6** | **VERIFY** | delphi-review --mode code-walkthrough → test-specification-alignment → browse QA → benchmark (optional) → learn + retro | Review report + feedback-log.md |
209
- | 5 | **5/6** | **SHIP** | finishing-a-development-branch → ship (create PR) → land-and-deploy → merge + CI + canary | PR URL + deploy status |
210
- | 6 | **6/6** | **CLOSE** | USER ACCEPTANCE (⚠️ mandatory manual) → Capture emergent issues → Cleanup worktree + branch → Sprint summary | Emergent issues list + cleanup report |
209
+ | 5 | **5/6** | **SHIP** | VERSION-GATE → finishing-a-development-branch → ship (create PR) → land-and-deploy → merge to main + CI + canary → release | PR URL + deploy status + merge confirmation |
210
+ | 6 | **6/6** | **CLOSE** | SHIP→CLOSE GATE (merge + release verified) → Backup sprint-state → USER ACCEPTANCE (⚠️ mandatory manual) → Capture emergent issues → Cleanup worktree + branch → Sprint summary | Emergent issues list + cleanup report |
211
211
 
212
212
  **Phase Flow**:
213
213
  ```
214
- PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
214
+ PREP → DESIGN → BUILD → VERIFY → SHIP (merge to main + release) → CLOSE
215
+
216
+ SHIP→CLOSE GATE
217
+ (merge verified + main clean)
215
218
  ```
216
219
 
217
220
  **Hard Gates**:
218
221
  - **Phase 2/6 → 3/6 (DESIGN → BUILD)**: Design must be APPROVED by delphi-review (≥90% consensus) + GITHOOKS-GATE (hooks installed) + DELPHI-GATE (spec APPROVED)
219
222
  - **Phase 4/6 → 5/6 (VERIFY → SHIP)**: feedback-log.md must exist (HARD-GATE)
220
- - **Phase 5/6 → 6/6 (SHIP → CLOSE)**: User acceptance must be completed (mandatory manual step)
223
+ - **Phase 5/6 → 6/6 (SHIP → CLOSE)**: PR must be merged to main + release completed (HARD-GATE). See `references/phase-6-close.md#ship--close-gate`.
221
224
 
222
225
  ---
223
226
 
@@ -349,6 +352,7 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
349
352
  - **GITHOOKS-GATE**: 验证 hooks 完整性,缺失则 `githooks/install.sh`
350
353
  - **LAND**: `land-and-deploy` — merge PR → 等待 CI (10min) → 等待 Deploy (10min) → Canary Health Check (5min)
351
354
  - **回滚**: `git revert` 最后一次 merge commit
355
+ - ⚠️ **SHIP COMPLETION**: Phase 5/6 结束前必须确认 PR 已 merge 到 main + release 已创建。未完成 merge 不得进入 Phase 6/6。详见 `references/phase-5-ship.md#ship-completion-gate`。
352
356
 
353
357
  **⚠️ VERSION-GATE 必须在 finishing-a-development-branch 之前执行。顺序反了会导致 PR 不含版本变更 → CI release workflow 不触发 → 无新版本发布。**
354
358
 
@@ -359,6 +363,8 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
359
363
  **详细指令**: 参见 `references/phase-6-close.md` — UAT checklist, emergent issues capture, cleanup procedure.
360
364
 
361
365
  **快速参考**:
366
+ - **SHIP→CLOSE GATE (MANDATORY — v0.14.3+)**: 校验 PR 已 merge、当前在 main 分支、`git status --porcelain` 为空。详见 `references/phase-6-close.md#ship--close-gate`。
367
+ - **Backup sprint-state**(MANDATORY): Phase 6 开始前将 `.sprint-state/` 备份到 repo 追踪路径,防止 worktree 清理后状态丢失。详见 `references/phase-6-close.md#backup-sprint-state`。
362
368
  - **USER ACCEPTANCE**: ⚠️ **MUST NOT be automated, skipped, or bypassed.** 即使用户说"赶时间"、"跳过验收"、"直接发布",也必须暂停等待用户确认。使用 `@templates/emergent-issues-template.md` 检查清单
363
369
  - **CLEANUP**: 保存分支信息 → `git worktree remove <worktree_path>`(精确路径,禁止通配符)→ 删除本地分支 + 远程分支 → 关闭遗留 OPEN PR → 更新 sprint-state.json → 释放 Sprint Lock
364
370
  - 输出 Cleanup Report + Sprint Summary
@@ -526,6 +532,8 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
526
532
  | DESIGN 阶段跳过 Delphi 评审直接 BUILD | 所有需求级别(轻量/标准/复杂)必须经过 autoplan + delphi-review;未 APPROVED 禁止编码 |
527
533
  | 跳过 TDD 直接实现代码 | Phase 3/6 BUILD 必须遵循 RED → GREEN → REFACTOR,测试与实现一起交付 |
528
534
  | 跳过用户验收直接 Ship | Phase 6/6 CLOSE USER ACCEPTANCE 必须人工完成;不得自动化、跳过或伪造 |
535
+ | SHIP 未完成 merge 即进入 CLOSE | Phase 5/6 SHIP 必须完成 merge to main + release 后才能进入 Phase 6/6 CLOSE,否则 worktree 清理残留 + UAT 验收的是未合并版本 |
536
+ | CLOSE 清理前未备份 sprint-state | `.sprint-state/` 在 worktree 内,worktree 删除后丢失。CLOSE 第一步必须先备份到 repo 追踪路径 |
529
537
  | 验证失败后继续追加随机修改 | 最多 3 次修复循环;仍失败则 BLOCK 并请求用户决策 |
530
538
  | 未生成 Phase Summary 就进入下一阶段 | 每个 Phase 必须写入 `.sprint-state/phase-outputs/phase-{N}-summary.md` 并通过 transition gate |
531
539
 
@@ -93,3 +93,45 @@
93
93
  **条件跳过**: 无部署配置时仅 merge + CI
94
94
 
95
95
  **输出**: 部署状态 (success/failure/skipped), Canary 报告
96
+
97
+ ---
98
+
99
+ ## SHIP COMPLETION GATE (MANDATORY — v0.14.3+)
100
+
101
+ **Purpose**: Ensure merge to main + release is complete before Phase 6/6 CLOSE. Without this gate, worktree cleanup fails (uncommitted changes + unmerged branch) and UAT happens on the wrong version (PR branch, not main).
102
+
103
+ **Execution** (BEFORE transitioning to Phase 6/6):
104
+
105
+ ```
106
+ 1. Verify PR is merged:
107
+ gh pr list --head <sprint-branch> --state merged --json number
108
+ → If no merged PR: BLOCK. Do NOT proceed to Phase 6/6.
109
+
110
+ 2. Verify current branch is main:
111
+ CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
112
+ → If not main/master: BLOCK. Switch to main first.
113
+
114
+ 3. Verify git status is clean:
115
+ git status --porcelain
116
+ → If not empty: BLOCK. Stash or commit changes first.
117
+
118
+ 4. Verify release exists:
119
+ gh release view v<X.Y.Z> --json tagName
120
+ → If not found: WARNING (manual release may have failed). Ask user.
121
+
122
+ 5. Pull latest main:
123
+ git checkout main && git pull
124
+ ```
125
+
126
+ **GATE CHECK** (BEFORE Phase 6/6 CLOSE):
127
+ ```
128
+ [SHIP→CLOSE GATE] PR merged ✓ # PR is in merged state
129
+ [SHIP→CLOSE GATE] on main branch ✓ # Current branch is main/master
130
+ [SHIP→CLOSE GATE] clean status ✓ # No uncommitted changes
131
+ [SHIP→CLOSE GATE] release exists ✓ # GitHub Release created
132
+ [SHIP→CLOSE GATE] main up-to-date ✓ # Pulled latest
133
+ ```
134
+
135
+ **IF GATE FAILS**: Orchestrator MUST complete the merge/release steps BEFORE proceeding to Phase 6/6. Do NOT skip to CLOSE.
136
+
137
+ **Output**: SHIP completion confirmation, ready for Phase 6/6.
@@ -1,12 +1,53 @@
1
1
  # Phase 6/6: CLOSE(收尾 — ⚠️ 人工验收 + 清理)
2
2
 
3
- **执行时机**: Phase 5/6 SHIP 完成后。
3
+ **执行时机**: Phase 5/6 SHIP 完成后(merge to main + release 已完成)。
4
4
  **对应旧模型**: Phase 7 USER ACCEPTANCE + Phase 8 CLEANUP
5
5
 
6
6
  **NETWORK-RESILIENCE**: 与 Phase 5/6 相同,GitHub API 在大中华区存在间歇性超时。CLEANUP 中的 `gh pr list` 和 `git push --delete` 需容忍重试。详见 `phase-5-ship.md` NETWORK-RESILIENCE 指南。
7
7
 
8
8
  ---
9
9
 
10
+ ## ⚠️ HARD-GATE: SHIP→CLOSE GATE (MANDATORY — v0.14.3+)
11
+
12
+ **Purpose**: Verify that Phase 5/6 SHIP fully completed (merge to main + release) before entering Phase 6/6 CLOSE. This gate prevents:
13
+ - Worktree cleanup failure (uncommitted changes prevent `git worktree remove`)
14
+ - UAT on wrong version (PR branch instead of merged main)
15
+
16
+ **Execution**: Before ANY Phase 6/6 step, run the SHIP→CLOSE GATE checks defined in `phase-5-ship.md#ship-completion-gate`.
17
+
18
+ **If gate fails**: Return to Phase 5/6 SHIP to complete merge/release. Do NOT proceed with CLOSE.
19
+
20
+ ---
21
+
22
+ ## Backup Sprint State (MANDATORY — v0.14.3+)
23
+
24
+ **Purpose**: `.sprint-state/` is gitignored and lives inside the worktree. When the worktree is removed during CLEANUP, all sprint state is lost. This step copies it into the main repository before cleanup.
25
+
26
+ **Execution** (immediately after SHIP→CLOSE GATE passes):
27
+
28
+ ```bash
29
+ # 1. Read sprint ID
30
+ SPRINT_ID=$(cat .sprint-state/sprint-state.json | grep '"id"' | head -1 | sed 's/.*"id": *"\([^"]*\)".*/\1/')
31
+
32
+ # 2. Backup to repo-tracked path (.sprint-history is NOT in .gitignore)
33
+ BACKUP_DIR=".sprint-history/${SPRINT_ID}"
34
+ mkdir -p "$BACKUP_DIR"
35
+ cp -r .sprint-state/* "$BACKUP_DIR/"
36
+
37
+ # 3. Verify backup
38
+ ls "$BACKUP_DIR/sprint-state.json" && echo "✅ Sprint state backed up to $BACKUP_DIR"
39
+ ```
40
+
41
+ **GATE CHECK**:
42
+ ```
43
+ [BACKUP] sprint-state.json copied ✓
44
+ [BACKUP] phase-outputs/ preserved ✓
45
+ ```
46
+
47
+ **Output**: `.sprint-history/<sprint-id>/` contains full sprint state, safely outside the worktree.
48
+
49
+ ---
50
+
10
51
  ## Part A: USER ACCEPTANCE(⚠️ 人工验收)
11
52
 
12
53
  ### 目标
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-09
4
- **Commit:** 744def0
4
+ **Commit:** a09c009
5
5
  **Branch:** main
6
- **Version:** 0.14.2.0
6
+ **Version:** 0.14.3.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.