@boyingliu01/xp-gate 0.38.15 → 0.38.16

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/gate-3.sh CHANGED
@@ -547,6 +547,19 @@ CC_POP_EOF
547
547
  RATCHET_VERDICT=$(printf '%s\n' "$CC_CSV" | evaluate_ccn_ratchet ".ccn-baseline.json")
548
548
  CC_VIOLATIONS=$(printf '%s\n' "$RATCHET_VERDICT" | grep -c '^BLOCK ' || true)
549
549
  CC_LOWER=$(printf '%s\n' "$RATCHET_VERDICT" | grep -c '^LOWER ' || true)
550
+ # #683 landed on the flat-threshold arm below and not here. The library
551
+ # emits a third kind of line -- UNVERIFIED -- for "no parsable CCN row at
552
+ # all", and this arm counted only BLOCK lines. An UNVERIFIED verdict
553
+ # therefore arrived as CC_VIOLATIONS=0 and took the PASS branch:
554
+ #
555
+ # UNVERIFIED no parsable CCN row (lizard produced no measurable function)
556
+ # ✅ PASSED - Complexity within ratchet baseline.
557
+ #
558
+ # Measured live in this repo: both lines came from one run, with
559
+ # issues_found=0 in the journal. The library's own comment states the
560
+ # rule this branch was breaking -- "'unverified' means never 'clean'".
561
+ # The ratchet cannot claim a verdict over rows it could not read.
562
+ CC_UNVERIFIED=$(printf '%s\n' "$RATCHET_VERDICT" | grep -c '^UNVERIFIED' || true)
550
563
  printf '%s\n' "$RATCHET_VERDICT" | grep -v '^OK ' || true
551
564
  if [ "${CC_LOWER:-0}" -gt 0 ]; then
552
565
  echo "ℹ️ $CC_LOWER function(s) improved below baseline — refresh with: node scripts/ccn-report.cjs --write-baseline"
@@ -557,6 +570,17 @@ CC_POP_EOF
557
570
  echo "❌ BLOCKED - $CC_VIOLATIONS function(s) violate the complexity ratchet (.ccn-baseline.json)."
558
571
  echo "Revert the increase, or refactor; refresh the baseline only via ccn-baseline-refresh commits."
559
572
  exit 1
573
+ elif [ "${CC_UNVERIFIED:-0}" -gt 0 ]; then
574
+ # WARN, not BLOCK: a tool that could not answer is an environment
575
+ # fault, and the convention for a missing tool is SKIP/WARN. What it
576
+ # must not be is a pass.
577
+ echo "⚠️ WARN - complexity ratchet could not grade the change set; nothing was verified."
578
+ echo " Run 'npx lizard --csv <files>' by hand to see why the rows are missing."
579
+ GATE_3_STATUS="WARN"
580
+ # Consumed by the sourcing parent (pre-commit report JSON), not here.
581
+ # shellcheck disable=SC2034
582
+ GATE_3_REASON="ratchet_no_parsable_rows"
583
+ GATE_3_DETAIL="mode=ratchet unverified=1"
560
584
  else
561
585
  echo "✅ PASSED - Complexity within ratchet baseline."
562
586
  GATE_3_STATUS="PASS"
package/hooks/gate-3.sh CHANGED
@@ -547,6 +547,19 @@ CC_POP_EOF
547
547
  RATCHET_VERDICT=$(printf '%s\n' "$CC_CSV" | evaluate_ccn_ratchet ".ccn-baseline.json")
548
548
  CC_VIOLATIONS=$(printf '%s\n' "$RATCHET_VERDICT" | grep -c '^BLOCK ' || true)
549
549
  CC_LOWER=$(printf '%s\n' "$RATCHET_VERDICT" | grep -c '^LOWER ' || true)
550
+ # #683 landed on the flat-threshold arm below and not here. The library
551
+ # emits a third kind of line -- UNVERIFIED -- for "no parsable CCN row at
552
+ # all", and this arm counted only BLOCK lines. An UNVERIFIED verdict
553
+ # therefore arrived as CC_VIOLATIONS=0 and took the PASS branch:
554
+ #
555
+ # UNVERIFIED no parsable CCN row (lizard produced no measurable function)
556
+ # ✅ PASSED - Complexity within ratchet baseline.
557
+ #
558
+ # Measured live in this repo: both lines came from one run, with
559
+ # issues_found=0 in the journal. The library's own comment states the
560
+ # rule this branch was breaking -- "'unverified' means never 'clean'".
561
+ # The ratchet cannot claim a verdict over rows it could not read.
562
+ CC_UNVERIFIED=$(printf '%s\n' "$RATCHET_VERDICT" | grep -c '^UNVERIFIED' || true)
550
563
  printf '%s\n' "$RATCHET_VERDICT" | grep -v '^OK ' || true
551
564
  if [ "${CC_LOWER:-0}" -gt 0 ]; then
552
565
  echo "ℹ️ $CC_LOWER function(s) improved below baseline — refresh with: node scripts/ccn-report.cjs --write-baseline"
@@ -557,6 +570,17 @@ CC_POP_EOF
557
570
  echo "❌ BLOCKED - $CC_VIOLATIONS function(s) violate the complexity ratchet (.ccn-baseline.json)."
558
571
  echo "Revert the increase, or refactor; refresh the baseline only via ccn-baseline-refresh commits."
559
572
  exit 1
573
+ elif [ "${CC_UNVERIFIED:-0}" -gt 0 ]; then
574
+ # WARN, not BLOCK: a tool that could not answer is an environment
575
+ # fault, and the convention for a missing tool is SKIP/WARN. What it
576
+ # must not be is a pass.
577
+ echo "⚠️ WARN - complexity ratchet could not grade the change set; nothing was verified."
578
+ echo " Run 'npx lizard --csv <files>' by hand to see why the rows are missing."
579
+ GATE_3_STATUS="WARN"
580
+ # Consumed by the sourcing parent (pre-commit report JSON), not here.
581
+ # shellcheck disable=SC2034
582
+ GATE_3_REASON="ratchet_no_parsable_rows"
583
+ GATE_3_DETAIL="mode=ratchet unverified=1"
560
584
  else
561
585
  echo "✅ PASSED - Complexity within ratchet baseline."
562
586
  GATE_3_STATUS="PASS"
@@ -104,16 +104,52 @@ EOF_CHANGED
104
104
  python)
105
105
  if command -v pylint &> /dev/null; then
106
106
  echo "Running pylint duplicate detection..."
107
- pylint --disable=all --enable=duplicate-code $(echo "$CHANGED_FILES" | grep "\.py$")
108
- DUPLICATE_EXIT=$?
109
- if [ "$DUPLICATE_EXIT" -ne 0 ]; then
110
- echo "ℹ️ pylint found duplicate code (warning, not typically blocking)"
107
+ # Array, not an unquoted substitution: with no .py file in the change set the
108
+ # old form expanded to zero arguments and pylint was invoked on the whole
109
+ # cwd; with a path containing a space it expanded to two bogus paths. The
110
+ # `if ! require` guard keeps this arm from running on an empty list.
111
+ PYLINT_FILES=()
112
+ while IFS= read -r _pf; do
113
+ [ -n "$_pf" ] || continue
114
+ PYLINT_FILES+=("$_pf")
115
+ done <<PYLINT_LIST
116
+ $(echo "$CHANGED_FILES" | grep "\.py$" || true)
117
+ PYLINT_LIST
118
+ if [ "${#PYLINT_FILES[@]}" -eq 0 ]; then
119
+ echo "ℹ️ No .py files in this change set — nothing to scan."
111
120
  else
112
- echo "✅ PASSED - pylint found no duplicates."
121
+ pylint --disable=all --enable=duplicate-code "${PYLINT_FILES[@]}"
122
+ DUPLICATE_EXIT=$?
123
+ if [ "$DUPLICATE_EXIT" -ne 0 ]; then
124
+ # pylint's exit status is a BITMASK (1 fatal, 2 error, 4 warning,
125
+ # 8 refactor, 16 convention, 32 usage error). duplicate-code is a
126
+ # REFACTOR message, so "found duplicates" is bit 8 -- and a fatal error
127
+ # or a crash also exits non-zero. The old code treated every non-zero as
128
+ # "found duplicates (warning)" and every zero as "✅ PASSED", so a pylint
129
+ # that could not even start still reached the PASS line below.
130
+ if [ $(( DUPLICATE_EXIT & 1 )) -ne 0 ]; then
131
+ echo "⏭️ SKIPPED - Duplicate code (pylint fatal error, exit $DUPLICATE_EXIT)"
132
+ GATE_2_STATUS="SKIP"
133
+ GATE_2_DETAIL="pylint_fatal"
134
+ elif [ $(( DUPLICATE_EXIT & 32 )) -ne 0 ]; then
135
+ echo "⏭️ SKIPPED - Duplicate code (pylint usage error, exit $DUPLICATE_EXIT)"
136
+ GATE_2_STATUS="SKIP"
137
+ GATE_2_DETAIL="pylint_usage_error"
138
+ elif [ $(( DUPLICATE_EXIT & 8 )) -ne 0 ]; then
139
+ echo "ℹ️ pylint found duplicate code (warning, not typically blocking)"
140
+ else
141
+ echo "ℹ️ pylint reported other messages (exit $DUPLICATE_EXIT); duplicate-code was not among them."
142
+ fi
143
+ else
144
+ echo "✅ PASSED - pylint found no duplicates."
145
+ fi
113
146
  fi
114
147
  else
115
148
  echo "ℹ️ pylint not found — skipping Python duplicate code check."
116
149
  echo " Install pylint: pip install pylint"
150
+ echo "⏭️ SKIPPED - Duplicate code (pylint not installed)"
151
+ GATE_2_STATUS="SKIP"
152
+ GATE_2_DETAIL="pylint_not_installed"
117
153
  fi
118
154
  ;;
119
155
 
@@ -133,10 +169,23 @@ EOF_CHANGED
133
169
  head -10 "$GO_JSCPD_TMP"
134
170
  rm -f "$GO_JSCPD_TMP"
135
171
  if [ "$JSCPD_GO_EXIT" -ne 0 ]; then
136
- echo "⚠️ jscpd (Go) exited with code $JSCPD_GO_EXIT"
172
+ # This used to print the warning and then fall through to "✅ PASSED -
173
+ # Go duplicate code check completed." below, unconditionally. Measured with
174
+ # a jscpd stub exiting 1:
175
+ # ⚠️ jscpd (Go) exited with code 1
176
+ # ✅ PASSED - Go duplicate code check completed.
177
+ # [audit] status=PASS
178
+ # A tool that failed to run is not a clean result, and the Go half is the
179
+ # one place in this gate that never consulted an outcome at all.
180
+ echo "⏭️ SKIPPED - Duplicate code (jscpd Go run error, exit $JSCPD_GO_EXIT)"
181
+ GATE_2_STATUS="SKIP"
182
+ GATE_2_DETAIL="jscpd_go_run_error"
183
+ elif [ "$GATE_2_STATUS" = "PASS" ]; then
184
+ echo "✅ PASSED - Go duplicate code check completed."
137
185
  fi
186
+ else
187
+ echo "ℹ️ No .go files in this change set — nothing to scan."
138
188
  fi
139
- echo "✅ PASSED - Go duplicate code check completed."
140
189
  ;;
141
190
 
142
191
  powershell)
@@ -176,10 +225,18 @@ EOF_GENERIC
176
225
  head -15 "$GENERIC_JSCPD_TMP" || true
177
226
  rm -f "$GENERIC_JSCPD_TMP"
178
227
  if [ "${GENERIC_JSCPD_EXIT:-0}" -ne 0 ]; then
179
- echo "⚠️ jscpd exited with code $GENERIC_JSCPD_EXIT (see output above)"
228
+ # Same shape as the Go arm: a warning, then an unconditional "✅ PASSED"
229
+ # on the next line. Measured with a jscpd stub exiting 2:
230
+ # ⚠️ jscpd exited with code 2 (see output above)
231
+ # ✅ PASSED - jscpd check completed.
232
+ echo "⏭️ SKIPPED - Duplicate code (jscpd run error, exit $GENERIC_JSCPD_EXIT)"
233
+ GATE_2_STATUS="SKIP"
234
+ GATE_2_DETAIL="jscpd_run_error"
180
235
  fi
181
236
  fi
182
- echo "✅ PASSED - jscpd check completed."
237
+ if [ "$GATE_2_STATUS" = "PASS" ]; then
238
+ echo "✅ PASSED - jscpd check completed."
239
+ fi
183
240
  else
184
241
  echo "✅ PASSED - No source files detected for duplicate checking."
185
242
  fi
@@ -2,6 +2,6 @@
2
2
  "verdict": "PASS",
3
3
  "license_type": "MIT",
4
4
  "sha256": "0e7ac423bf2c6e223b7c5b156f8cf72da49d748e56a1641402c31f22ad07dbb5",
5
- "checked_at": "2026-11-18T10:31:56.944Z",
5
+ "checked_at": "2026-11-18T11:27:48.544Z",
6
6
  "source": "network"
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boyingliu01/xp-gate",
3
- "version": "0.38.15",
3
+ "version": "0.38.16",
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.38.15",
3
+ "version": "0.38.16",
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": {
@@ -3,7 +3,7 @@
3
3
  **Generated:** 2026-11-04
4
4
  **Commit:** eb2097b0
5
5
  **Branch:** sprint/2026-11-03-02
6
- **Version:** 0.38.15.0
6
+ **Version:** 0.38.16.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.
@@ -3,7 +3,7 @@
3
3
  **Generated:** 2026-11-04
4
4
  **Commit:** eb2097b0
5
5
  **Branch:** sprint/2026-11-03-02
6
- **Version:** 0.38.15.0
6
+ **Version:** 0.38.16.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; each REQ starts from a clean context instead of accumulating one across REQs). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
@@ -3,7 +3,7 @@
3
3
  **Generated:** 2026-11-04
4
4
  **Commit:** eb2097b0
5
5
  **Branch:** sprint/2026-11-03-02
6
- **Version:** 0.38.15.0
6
+ **Version:** 0.38.16.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.38.15",
3
+ "version": "0.38.16",
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",
@@ -3,7 +3,7 @@
3
3
  **Generated:** 2026-11-04
4
4
  **Commit:** eb2097b0
5
5
  **Branch:** sprint/2026-11-03-02
6
- **Version:** 0.38.15.0
6
+ **Version:** 0.38.16.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.
@@ -3,7 +3,7 @@
3
3
  **Generated:** 2026-11-04
4
4
  **Commit:** eb2097b0
5
5
  **Branch:** sprint/2026-11-03-02
6
- **Version:** 0.38.15.0
6
+ **Version:** 0.38.16.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; each REQ starts from a clean context instead of accumulating one across REQs). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
@@ -3,7 +3,7 @@
3
3
  **Generated:** 2026-11-04
4
4
  **Commit:** eb2097b0
5
5
  **Branch:** sprint/2026-11-03-02
6
- **Version:** 0.38.15.0
6
+ **Version:** 0.38.16.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.38.15",
3
+ "version": "0.38.16",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "description": "XP-Gate quality gates + AI workflow skills for OpenCode",
@@ -3,7 +3,7 @@
3
3
  **Generated:** 2026-11-04
4
4
  **Commit:** eb2097b0
5
5
  **Branch:** sprint/2026-11-03-02
6
- **Version:** 0.38.15.0
6
+ **Version:** 0.38.16.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.
@@ -3,7 +3,7 @@
3
3
  **Generated:** 2026-11-04
4
4
  **Commit:** eb2097b0
5
5
  **Branch:** sprint/2026-11-03-02
6
- **Version:** 0.38.15.0
6
+ **Version:** 0.38.16.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; each REQ starts from a clean context instead of accumulating one across REQs). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
@@ -3,7 +3,7 @@
3
3
  **Generated:** 2026-11-04
4
4
  **Commit:** eb2097b0
5
5
  **Branch:** sprint/2026-11-03-02
6
- **Version:** 0.38.15.0
6
+ **Version:** 0.38.16.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.38.15",
3
+ "version": "0.38.16",
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": {
@@ -3,7 +3,7 @@
3
3
  **Generated:** 2026-11-04
4
4
  **Commit:** eb2097b0
5
5
  **Branch:** sprint/2026-11-03-02
6
- **Version:** 0.38.15.0
6
+ **Version:** 0.38.16.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.
@@ -3,7 +3,7 @@
3
3
  **Generated:** 2026-11-04
4
4
  **Commit:** eb2097b0
5
5
  **Branch:** sprint/2026-11-03-02
6
- **Version:** 0.38.15.0
6
+ **Version:** 0.38.16.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; each REQ starts from a clean context instead of accumulating one across REQs). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
@@ -3,7 +3,7 @@
3
3
  **Generated:** 2026-11-04
4
4
  **Commit:** eb2097b0
5
5
  **Branch:** sprint/2026-11-03-02
6
- **Version:** 0.38.15.0
6
+ **Version:** 0.38.16.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
@@ -3,7 +3,7 @@
3
3
  **Generated:** 2026-11-04
4
4
  **Commit:** eb2097b0
5
5
  **Branch:** sprint/2026-11-03-02
6
- **Version:** 0.38.15.0
6
+ **Version:** 0.38.16.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.
@@ -3,7 +3,7 @@
3
3
  **Generated:** 2026-11-04
4
4
  **Commit:** eb2097b0
5
5
  **Branch:** sprint/2026-11-03-02
6
- **Version:** 0.38.15.0
6
+ **Version:** 0.38.16.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; each REQ starts from a clean context instead of accumulating one across REQs). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
@@ -3,7 +3,7 @@
3
3
  **Generated:** 2026-11-04
4
4
  **Commit:** eb2097b0
5
5
  **Branch:** sprint/2026-11-03-02
6
- **Version:** 0.38.15.0
6
+ **Version:** 0.38.16.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.