@boyingliu01/xp-gate 0.31.0 → 0.31.1

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.
@@ -81,6 +81,11 @@ _find_powershell_files() {
81
81
  local entry
82
82
  while IFS= read -r entry; do
83
83
  entry="${entry%$'\r'}"
84
+ # #578: strip a UTF-8 BOM before anything else. PowerShell 5.1's
85
+ # `Set-Content -Encoding UTF8` writes one, and it glues itself to the first
86
+ # line -- so the first directory name would silently never match, and a
87
+ # leading '#' comment would stop looking like a comment.
88
+ entry="${entry#$'\xEF\xBB\xBF'}"
84
89
  # Strip surrounding whitespace, then the ./ prefix and trailing / a repo
85
90
  # may reasonably write; -name matches a bare directory name.
86
91
  entry="${entry#"${entry%%[![:space:]]*}"}"
@@ -89,6 +94,30 @@ _find_powershell_files() {
89
94
  entry="${entry#./}"
90
95
  entry="${entry%/}"
91
96
  [ -n "$entry" ] || continue
97
+
98
+ # #574: discovery feeds THREE denominators at once (test discovery,
99
+ # coverage, static-analysis scope), so a bad entry does not merely fail to
100
+ # prune -- it silently shrinks all three while the file still looks
101
+ # reasonable.
102
+ # -name '*' matches EVERY directory -> prunes the whole tree -> the
103
+ # gate analyses nothing and still exits 0.
104
+ # -name 'a/b' matches nothing (names have no separators) -> a silent
105
+ # no-op that reads as working config.
106
+ # Only bare directory NAMES are honoured; anything else is reported and
107
+ # ignored. Reported, not silently dropped: an ignored entry is a config
108
+ # error the operator has to see.
109
+ case "$entry" in
110
+ */*|*\\*|*'*'*|*'?'*|*'['*)
111
+ echo " ⚠️ $prune_file: ignoring invalid entry '$entry' (must be a bare directory name, no separators or glob metacharacters)" >&2
112
+ continue
113
+ ;;
114
+ .|..)
115
+ echo " ⚠️ $prune_file: ignoring invalid entry '$entry'" >&2
116
+ continue
117
+ ;;
118
+ esac
119
+
120
+ echo " ℹ️ pruning directory name '$entry' (from $prune_file)" >&2
92
121
  prune_args[${#prune_args[@]}]=-o
93
122
  prune_args[${#prune_args[@]}]=-name
94
123
  prune_args[${#prune_args[@]}]="$entry"
@@ -109,6 +138,10 @@ _find_powershell_files() {
109
138
  -name .workbuddy -o \
110
139
  -name .sprint-state -o \
111
140
  -name wrc-drill -o \
141
+ -name .xp-gate -o \
142
+ -name .vscode -o \
143
+ -name .idea -o \
144
+ -name .qoder -o \
112
145
  -path './plugins/claude-code/skills' -o \
113
146
  -path './plugins/opencode/skills' -o \
114
147
  -path './plugins/qoder/skills' -o \
@@ -155,6 +188,7 @@ run_static_analysis() {
155
188
  local PSSA_OUT
156
189
  local scope_file=".xp-gate-powershell-analysis-paths"
157
190
  local analysis_targets=()
191
+ local scope_missing=0
158
192
 
159
193
  # #571: repo-local analysis scope. Pester test files legitimately trip
160
194
  # dozens of rule warnings under the Pester execution model, so a whole-repo
@@ -175,6 +209,12 @@ run_static_analysis() {
175
209
  local declared=0
176
210
  while IFS= read -r target_line; do
177
211
  target_line="${target_line%$'\r'}"
212
+ # #578: a UTF-8 BOM (PowerShell 5.1's `Set-Content -Encoding UTF8` writes
213
+ # one) glues itself to the FIRST line. On a path that manufactures a
214
+ # nonexistent entry -- and since #576 that returns 3, so a perfectly valid
215
+ # scope file would fail closed on every commit. On the '#' header it turns
216
+ # a comment into a phantom path. Strip it before classifying.
217
+ target_line="${target_line#$'\xEF\xBB\xBF'}"
178
218
  # Strip surrounding whitespace before classifying: a line of spaces is
179
219
  # not a path, and `case` alone would treat it as one — measured, a
180
220
  # whitespace-only line became an "analysis path not found" entry.
@@ -186,6 +226,7 @@ run_static_analysis() {
186
226
  # shellcheck disable=SC2004 # explicit index arithmetic on an array
187
227
  analysis_targets[${#analysis_targets[@]}]="$target_line"
188
228
  else
229
+ scope_missing=$((scope_missing + 1))
189
230
  echo " ℹ️ analysis path not found (skipped): $target_line"
190
231
  echo "XP_G1_REASON: analysis-path-missing:$target_line"
191
232
  fi
@@ -218,13 +259,18 @@ run_static_analysis() {
218
259
  try { Import-Module PSScriptAnalyzer -ErrorAction Stop | Out-Null } catch { exit 3 }
219
260
  \$settings = Join-Path (Get-Location) 'PSScriptAnalyzerSettings.psd1'
220
261
  \$all = @()
221
- foreach (\$p in $target_array) {
222
- \$recurse = [System.IO.Directory]::Exists(\$p)
223
- if (Test-Path -LiteralPath \$settings) {
224
- \$all += @(Invoke-ScriptAnalyzer -Path \$p -Recurse:\$recurse -Severity Error,Warning -Settings \$settings -ErrorAction Stop)
225
- } else {
226
- \$all += @(Invoke-ScriptAnalyzer -Path \$p -Recurse:\$recurse -Severity Error,Warning -ErrorAction Stop)
262
+ try {
263
+ foreach (\$p in $target_array) {
264
+ \$recurse = [System.IO.Directory]::Exists(\$p)
265
+ if (Test-Path -LiteralPath \$settings) {
266
+ \$all += @(Invoke-ScriptAnalyzer -Path \$p -Recurse:\$recurse -Severity Error,Warning -Settings \$settings -ErrorAction Stop)
267
+ } else {
268
+ \$all += @(Invoke-ScriptAnalyzer -Path \$p -Recurse:\$recurse -Severity Error,Warning -ErrorAction Stop)
269
+ }
227
270
  }
271
+ } catch {
272
+ Write-Output ('PSSA_RUN_ERROR: ' + \$_.Exception.Message)
273
+ exit 3
228
274
  }
229
275
  if (\$all) {
230
276
  \$all | Format-Table -AutoSize
@@ -258,11 +304,32 @@ run_static_analysis() {
258
304
  echo "XP_G1_REASON: PSScriptAnalyzer module not installed (Install-Module PSScriptAnalyzer)"
259
305
  return 3
260
306
  fi
307
+ # #576: a scope entry that vanished means product code may have ESCAPED
308
+ # the gate. The reason line was emitted above, but pre-commit switches on
309
+ # the RETURN CODE and only uses the reason for the message text -- so
310
+ # returning 0 here made the reason dead weight and Gate 1 printed
311
+ # PASSED. Measured before this fix: "RETURN CODE = 0". The scan being
312
+ # clean does not make an incomplete scope a pass.
313
+ if [ "$scope_missing" -gt 0 ]; then
314
+ echo " ⚠️ $scope_missing scope entry(ies) did not exist - product code may have escaped the gate"
315
+ return 3
316
+ fi
261
317
  return 0
262
318
  ;;
263
319
  1)
264
320
  return 1 # real findings -> BLOCK upstream
265
321
  ;;
322
+ 3)
323
+ # #576: the PowerShell fragment exits 3 when the scan itself raised. That
324
+ # is "could not verify", not "found violations" -- pwsh would exit 1 for
325
+ # findings, so mapping this to 1 would report an analysis crash as lint
326
+ # errors. Surface the actual exception where the fragment captured one.
327
+ echo "XP_G1_REASON: PSScriptAnalyzer raised an error during the run"
328
+ printf '%s\n' "$PSSA_OUT" | grep '^PSSA_RUN_ERROR: ' | sed 's/^PSSA_RUN_ERROR: //' | head -3 | while IFS= read -r _ps_err; do
329
+ echo " ⚠️ $_ps_err"
330
+ done
331
+ return 2 # unusable -> fail closed upstream
332
+ ;;
266
333
  *)
267
334
  echo "XP_G1_REASON: PSScriptAnalyzer run failed (exit $PSSA_RC)"
268
335
  return 2 # unusable -> fail closed upstream
@@ -2,6 +2,6 @@
2
2
  "verdict": "PASS",
3
3
  "license_type": "MIT",
4
4
  "sha256": "0e7ac423bf2c6e223b7c5b156f8cf72da49d748e56a1641402c31f22ad07dbb5",
5
- "checked_at": "2026-10-22T06:57:22.941Z",
5
+ "checked_at": "2026-10-22T08:31:44.285Z",
6
6
  "source": "network"
7
7
  }
@@ -1,9 +1,9 @@
1
1
  # SRC/MOCK-POLICY KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.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-10-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.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.31.0",
3
+ "version": "0.31.1",
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.31.0",
3
+ "version": "0.31.1",
4
4
  "displayName": "XP-Gate",
5
5
  "description": "Extreme Programming quality gates + AI workflow skills for Claude Code. Includes 12 pre-commit gates (Gate 0-11), 8 pre-push gates, Sprint Flow (6 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-10-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.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-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.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-10-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.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/dsh-plugin-xp-gate",
3
- "version": "0.31.0",
3
+ "version": "0.31.1",
4
4
  "description": "XP-Gate deterministic quality gates + AI workflow skills as a DeepSeek Harness (DSH) native plugin: gate-check / gate-principles / gate-arch tools + 12 SKILL.md skills",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.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-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.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-10-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.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.31.0",
3
+ "version": "0.31.1",
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-10-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.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-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.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-10-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.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.31.0",
3
+ "version": "0.31.1",
4
4
  "displayName": "XP-Gate",
5
5
  "description": "Extreme Programming quality gates + AI workflow skills for Qoder. Includes 12 pre-commit gates (Gate 0-11), 8 pre-push gates, Sprint Flow (6 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-10-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.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-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.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-10-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.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-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.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-10-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.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-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.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-10-22
4
- **Commit:** fcd717af
4
+ **Commit:** 0678b903
5
5
  **Branch:** main
6
- **Version:** 0.31.0.0
6
+ **Version:** 0.31.1.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.