@boyingliu01/opencode-plugin 0.9.4 → 0.9.5

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/index.ts CHANGED
@@ -150,7 +150,6 @@ function readXpGateConfig(): { autoUpgrade?: boolean } | null {
150
150
  return null
151
151
  }
152
152
  }
153
-
154
153
  // ── OpenCode plugin version check (notification only) ──
155
154
 
156
155
  async function checkPluginUpdate(pluginDir: string): Promise<void> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boyingliu01/opencode-plugin",
3
- "version": "0.9.4",
3
+ "version": "0.9.5",
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
- **Generated:** 2026-06-19
4
- **Commit:** b67f7f9
3
+ **Generated:** 2026-06-21
4
+ **Commit:** 1050a30
5
5
  **Branch:** main
6
- **Version:** 0.9.4.0
6
+ **Version:** 0.9.5.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,6 +1,7 @@
1
1
  ---
2
2
  name: delphi-review
3
3
  description: "Use when asked to review a design, plan, or architecture; before implementation starts; or when multi-expert consensus is needed. Triggers: 'review this design', '评审这个需求', 'design review', '多专家评审', 'consensus review', 'code walkthrough', 'push review', 'architecture review', 'PR review', or any request for multi-expert evaluation of requirements, design docs, or PRs."
4
+ auto_continue: true
4
5
  ---
5
6
 
6
7
  # Delphi Consensus Review
@@ -109,6 +110,39 @@ Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
109
110
 
110
111
  **Automatic re-review**: 对于常见可控问题(措辞模糊、AC 缺失、格式问题),subagent 应自行修复后自动重评审,无需等待用户。
111
112
 
113
+ ### ⭐ 自动延续规则(MANDATORY — 防止流程卡住)
114
+
115
+ 当 Delphi Review 启动多轮评审(Round 2+)时,**orchestrator 必须自动延续流程,不得等待用户输入**。
116
+
117
+ **触发条件**:
118
+ - Round N 完成,但未达到终止条件(100% approved + ≥90% consensus + 所有 Critical/Major 已处理)
119
+ - 存在待处理的背景任务(subagent dispatched tasks)
120
+
121
+ **自动延续动作**:
122
+ 1. **收集背景任务结果**:等待 `<system-reminder>` 通知后,立即调用 `background_output(task_id="bg_...")` 获取所有 subagent 输出
123
+ 2. **合成 Round N 总结**:汇总专家意见、共识度、待处理问题
124
+ 3. **自动启动 Round N+1**:立即 dispatch 新一轮 subagent 任务,携带上一轮总结作为上下文
125
+ 4. **循环直至终止**:重复步骤 1-3,直到达到终止条件
126
+
127
+ **终止条件**(满足全部):
128
+ - ✅ 所有专家状态 = APPROVED
129
+ - ✅ 共识度 ≥ 90%
130
+ - ✅ 所有 Critical 级别问题已解决
131
+ - ✅ 所有 Major 级别问题已处理(或已记录为已知问题)
132
+
133
+ **例外情况**(直接输出,不进入下一轮):
134
+ - Round 1 即达到 100% approved + 100% consensus → 直接输出最终报告
135
+ - 已达最大轮数(5 轮)→ 输出"未达成共识"报告,标记为 PROCESS_BLOCK
136
+
137
+ **禁止行为**:
138
+ - ❌ 询问用户"要继续吗?"
139
+ - ❌ 等待用户手动触发 Round N+1
140
+ - ❌ 在未达到终止条件时停止流程
141
+
142
+ **错误处理**:
143
+ - 背景任务超时(>10min)→ 标记为 TIMEOUT,输出部分结果并终止
144
+ - 背景任务失败(subagent 错误)→ 重试 1 次,仍失败则输出错误报告并终止
145
+
112
146
  ---
113
147
 
114
148
  ## 修复与重新评审
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-06-19
4
- **Commit:** b67f7f9
3
+ **Generated:** 2026-06-21
4
+ **Commit:** 1050a30
5
5
  **Branch:** main
6
- **Version:** 0.9.4.0
6
+ **Version:** 0.9.5.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **11-phase** development pipeline: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → USER ACCEPTANCE → FEEDBACK → SHIP → LAND → CLEANUP. Phase 2 default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE in Phase 1: design must pass Delphi review (≥90% consensus) before any coding.
@@ -408,6 +408,58 @@ Sprint Flow: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW
408
408
 
409
409
  ---
410
410
 
411
+ ### ⭐ Phase State Persistence(阶段状态持久化 — MANDATORY)
412
+
413
+ **编排器必须在每个 Phase 完成后更新 `.sprint-state/sprint-state.json`**:
414
+
415
+ 1. **Phase 完成后立即更新**(每个 Phase 结束前):
416
+ - `phase`: 更新为当前 Phase 编号(如 `0`, `1`, `2`...)
417
+ - `status`: 更新为 `"completed"`(已完成 Phase)
418
+ - `phase_history`: 追加新条目
419
+
420
+ 2. **`phase_history` 数组条目 schema**:
421
+ ```json
422
+ {
423
+ "phase": 0,
424
+ "phase_name": "THINK",
425
+ "status": "completed",
426
+ "timestamp": "2026-06-20T10:30:00Z"
427
+ }
428
+ ```
429
+
430
+ 3. **检查点**:
431
+ - `--status` 参数读取 `sprint-state.json` 并渲染进度看板
432
+ - TUI panel 显示当前 Phase 和历史
433
+ - `--resume-from` 校验 `phase_history` 中的最后完成 Phase
434
+
435
+ 4. **完整 sprint-state.json 示例**:
436
+ ```json
437
+ {
438
+ "id": "sprint-2026-06-20-01",
439
+ "phase": 2,
440
+ "status": "in_progress",
441
+ "phase_history": [
442
+ {"phase": -1, "phase_name": "ISOLATE", "status": "completed", "timestamp": "2026-06-20T10:00:00Z"},
443
+ {"phase": -0.5, "phase_name": "AUTO-ESTIMATE", "status": "completed", "timestamp": "2026-06-20T10:05:00Z"},
444
+ {"phase": 0, "phase_name": "THINK", "status": "completed", "timestamp": "2026-06-20T10:15:00Z"},
445
+ {"phase": 1, "phase_name": "PLAN", "status": "completed", "timestamp": "2026-06-20T10:30:00Z"}
446
+ ],
447
+ "isolation": {
448
+ "worktree_path": "/home/boyingliu01/projects/xp-gate/.worktrees/sprint/sprint-2026-06-20-01",
449
+ "branch": "sprint/2026-06-20-01"
450
+ },
451
+ "outputs": {
452
+ "pain_document": "phase-outputs/phase-0-summary.md",
453
+ "specification": "phase-outputs/specification.yaml"
454
+ },
455
+ "metrics": {
456
+ "coverage_pct": 85.5
457
+ }
458
+ }
459
+ ```
460
+
461
+ ---
462
+
411
463
  ## 使用示例
412
464
 
413
465
  | 场景 | 命令 | 说明 |
@@ -447,7 +499,7 @@ See [Output Contract](#output-contract) below for the canonical machine-readable
447
499
 
448
500
  **Phase Summary** (每个 Phase 必须输出 YAML frontmatter): `phase/N`, `phase_name`, `status`, `outputs[]`, `decisions[]`, `next_phase_context` + markdown body (≤50 lines)
449
501
 
450
- **Sprint State JSON**: `{id, phase, status, isolation {worktree_path, branch}, outputs, metrics}` — 存储于 `.sprint-state/sprint-state.json`
502
+ **Sprint State JSON**: `{id, phase, status, phase_history[], isolation {worktree_path, branch}, outputs, metrics}` — 存储于 `.sprint-state/sprint-state.json`
451
503
 
452
504
  **Final User-Facing Output**: Phase/status, file paths, validation results, next user decision, PR URL or cleanup report
453
505
 
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-06-19
4
- **Commit:** b67f7f9
3
+ **Generated:** 2026-06-21
4
+ **Commit:** 1050a30
5
5
  **Branch:** main
6
- **Version:** 0.9.4.0
6
+ **Version:** 0.9.5.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
package/tui-plugin.ts CHANGED
@@ -101,6 +101,12 @@ function renderBuildReqs(history: SprintPhaseHistory): string[] {
101
101
  .map(([id, r]) => ` ${statusSymbol(r.status, id, undefined)} ${r.name}`)
102
102
  }
103
103
 
104
+ function appendBuildReqs(lines: string[], key: string, history: SprintPhaseHistory | undefined): void {
105
+ if (key === "2" && history?.reqs) {
106
+ lines.push(...renderBuildReqs(history))
107
+ }
108
+ }
109
+
104
110
  function renderPhaseLines(
105
111
  historyByPhase: Record<string, SprintPhaseHistory>,
106
112
  currentPhase: string | number | undefined,
@@ -110,9 +116,7 @@ function renderPhaseLines(
110
116
  const history = historyByPhase[key]
111
117
  if (!history && String(currentPhase) !== key) continue
112
118
  lines.push(renderPhaseLine(key, history, currentPhase))
113
- if (key === "2" && history?.reqs) {
114
- lines.push(...renderBuildReqs(history))
115
- }
119
+ appendBuildReqs(lines, key, history)
116
120
  }
117
121
  return lines
118
122
  }