@boyingliu01/xp-gate 0.32.2 → 0.32.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 (47) hide show
  1. package/adapters/gate-3.sh +483 -28
  2. package/adapters/gate-4.sh +20 -0
  3. package/adapters/gate-7.sh +4 -0
  4. package/bin/xp-gate.js +48 -2
  5. package/gate-4.sh +8 -0
  6. package/hooks/gate-4.sh +8 -0
  7. package/hooks/post-commit +82 -0
  8. package/hooks/pre-commit +19 -0
  9. package/hooks/pre-push +21 -2
  10. package/lib/__tests__/doctor-audit-ledger.test.js +61 -0
  11. package/lib/__tests__/gate-audit.test.ts +144 -0
  12. package/lib/__tests__/shared-utils.test.js +22 -0
  13. package/lib/doctor.js +59 -1
  14. package/lib/gate-audit.ts +215 -7
  15. package/lib/mattpocock-license-verdict.json +1 -1
  16. package/lib/shared-utils.js +4 -1
  17. package/mock-policy/AGENTS.md +2 -2
  18. package/mutation/AGENTS.md +2 -2
  19. package/package.json +1 -1
  20. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  21. package/plugins/claude-code/skills/delphi-review/AGENTS.md +2 -2
  22. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +2 -2
  23. package/plugins/claude-code/skills/sprint-flow/references/phase-3-build.md +21 -0
  24. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +2 -2
  25. package/plugins/dsh/package.json +1 -1
  26. package/plugins/dsh/scripts/copy-client.cjs +6 -1
  27. package/plugins/dsh/skills/delphi-review/AGENTS.md +2 -2
  28. package/plugins/dsh/skills/sprint-flow/AGENTS.md +2 -2
  29. package/plugins/dsh/skills/sprint-flow/references/phase-3-build.md +21 -0
  30. package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +2 -2
  31. package/plugins/dsh/src/contract.test.ts +25 -1
  32. package/plugins/opencode/package.json +1 -1
  33. package/plugins/opencode/skills/delphi-review/AGENTS.md +2 -2
  34. package/plugins/opencode/skills/sprint-flow/AGENTS.md +2 -2
  35. package/plugins/opencode/skills/sprint-flow/references/phase-3-build.md +21 -0
  36. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +2 -2
  37. package/plugins/qoder/plugin.json +1 -1
  38. package/plugins/qoder/skills/delphi-review/AGENTS.md +2 -2
  39. package/plugins/qoder/skills/sprint-flow/AGENTS.md +2 -2
  40. package/plugins/qoder/skills/sprint-flow/references/phase-3-build.md +21 -0
  41. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +2 -2
  42. package/principles/AGENTS.md +2 -2
  43. package/scripts/sync-package-content.js +1 -1
  44. package/skills/delphi-review/AGENTS.md +2 -2
  45. package/skills/sprint-flow/AGENTS.md +2 -2
  46. package/skills/sprint-flow/references/phase-3-build.md +21 -0
  47. package/skills/test-specification-alignment/AGENTS.md +2 -2
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 78786c3f
4
+ **Commit:** e5ca7d9d
5
5
  **Branch:** main
6
- **Version:** 0.32.2.0
6
+ **Version:** 0.32.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.
@@ -236,6 +236,27 @@ Without these events, the Harness can only infer changes from file diffs and has
236
236
 
237
237
  ---
238
238
 
239
+ ## 工具调用效率自检(P2 硬性 — 2026-10-30 诊断)
240
+
241
+ > BUILD 阶段是工具调用最密集的阶段,也是"等待时间长"的主要来源。依据
242
+ > `docs/plans/2026-10-30-dev-speed-diagnosis.md`:工具延迟占总耗时 58%,其中 32.7% 的
243
+ > shell 调用是纯读取/搜索、calls/step 仅 1.03、`job_output` 阻塞 66.5 h。以下四条在 BUILD
244
+ > 期间是硬性自检项,不满足不得宣称 REQ 完成。
245
+
246
+ | ❌ 低效做法 | ✅ 正确做法 |
247
+ |------------|------------|
248
+ | `cat` / `Get-Content` / `sed -n` / `head` 读文件 | 用 `read` 原生工具(毫秒级,可并发) |
249
+ | `grep` / `rg` / `Select-String` / `findstr` 搜内容 | 用 `grep` 原生工具 |
250
+ | `find` / `ls` / `Get-ChildItem` 找文件 | 用 `glob` 原生工具 |
251
+ | 一个一个发独立调用(改完再想下一个) | 多个互不依赖的调用放进**同一步**并发发出 |
252
+ | 用 `job_output wait:true` / `sleep` 反复阻塞等长任务 | `run_in_background` + 完成通知,需要时短超时取一次 |
253
+ | 打包/发布/插件改动只靠 CI 发现契约破坏 | 先写契约测试(`plugins/dsh/src/contract.test.ts` 范式),本地先红 |
254
+
255
+ **验收目标**:纯读取 shell 占比 <5%(现 32.7%);calls/step ≥2.0(现 1.03);`job_output`
256
+ 调用数下降 ≥50%。这三项在 `xp-gate retro` 的 activity 统计里可复查。
257
+
258
+ ---
259
+
239
260
  ## Blind Review — Read-Only Subagent Convention (v0.18.0+, 证据型标准步骤)
240
261
 
241
262
  **Purpose**: Code review by an isolated subagent with read-only tool access. Replaces the former `freeze/unfreeze` mechanism.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 78786c3f
4
+ **Commit:** e5ca7d9d
5
5
  **Branch:** main
6
- **Version:** 0.32.2.0
6
+ **Version:** 0.32.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-10-30
4
- **Commit:** 78786c3f
4
+ **Commit:** e5ca7d9d
5
5
  **Branch:** main
6
- **Version:** 0.32.2.0
6
+ **Version:** 0.32.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.
@@ -221,7 +221,7 @@ function syncHooks() {
221
221
 
222
222
  // #505: hook-module-resolution.sh is GENERATED, but it must still ship beside
223
223
  // pre-commit — the hook aborts with FATAL when it is missing, by design.
224
- const HOOK_FILES = ['pre-commit', 'pre-push', 'post-merge', 'adapter-common.sh', 'hook-module-resolution.sh'];
224
+ const HOOK_FILES = ['pre-commit', 'pre-push', 'post-commit', 'post-merge', 'adapter-common.sh', 'hook-module-resolution.sh'];
225
225
  let copied = 0;
226
226
 
227
227
  for (const name of HOOK_FILES) {
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 78786c3f
4
+ **Commit:** e5ca7d9d
5
5
  **Branch:** main
6
- **Version:** 0.32.2.0
6
+ **Version:** 0.32.3.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, exactly 3 experts with distinct executable model IDs). Supports design, requirements, and code-walkthrough modes.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 78786c3f
4
+ **Commit:** e5ca7d9d
5
5
  **Branch:** main
6
- **Version:** 0.32.2.0
6
+ **Version:** 0.32.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.
@@ -236,6 +236,27 @@ Without these events, the Harness can only infer changes from file diffs and has
236
236
 
237
237
  ---
238
238
 
239
+ ## 工具调用效率自检(P2 硬性 — 2026-10-30 诊断)
240
+
241
+ > BUILD 阶段是工具调用最密集的阶段,也是"等待时间长"的主要来源。依据
242
+ > `docs/plans/2026-10-30-dev-speed-diagnosis.md`:工具延迟占总耗时 58%,其中 32.7% 的
243
+ > shell 调用是纯读取/搜索、calls/step 仅 1.03、`job_output` 阻塞 66.5 h。以下四条在 BUILD
244
+ > 期间是硬性自检项,不满足不得宣称 REQ 完成。
245
+
246
+ | ❌ 低效做法 | ✅ 正确做法 |
247
+ |------------|------------|
248
+ | `cat` / `Get-Content` / `sed -n` / `head` 读文件 | 用 `read` 原生工具(毫秒级,可并发) |
249
+ | `grep` / `rg` / `Select-String` / `findstr` 搜内容 | 用 `grep` 原生工具 |
250
+ | `find` / `ls` / `Get-ChildItem` 找文件 | 用 `glob` 原生工具 |
251
+ | 一个一个发独立调用(改完再想下一个) | 多个互不依赖的调用放进**同一步**并发发出 |
252
+ | 用 `job_output wait:true` / `sleep` 反复阻塞等长任务 | `run_in_background` + 完成通知,需要时短超时取一次 |
253
+ | 打包/发布/插件改动只靠 CI 发现契约破坏 | 先写契约测试(`plugins/dsh/src/contract.test.ts` 范式),本地先红 |
254
+
255
+ **验收目标**:纯读取 shell 占比 <5%(现 32.7%);calls/step ≥2.0(现 1.03);`job_output`
256
+ 调用数下降 ≥50%。这三项在 `xp-gate retro` 的 activity 统计里可复查。
257
+
258
+ ---
259
+
239
260
  ## Blind Review — Read-Only Subagent Convention (v0.18.0+, 证据型标准步骤)
240
261
 
241
262
  **Purpose**: Code review by an isolated subagent with read-only tool access. Replaces the former `freeze/unfreeze` mechanism.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 78786c3f
4
+ **Commit:** e5ca7d9d
5
5
  **Branch:** main
6
- **Version:** 0.32.2.0
6
+ **Version:** 0.32.3.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.