@boyingliu01/xp-gate 0.41.60 → 0.41.62

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.
@@ -92,9 +92,30 @@ run_static_analysis() {
92
92
  fi
93
93
  fi
94
94
  if [ "$linted" -eq 0 ] && command -v detekt &>/dev/null; then
95
- detekt --input . 2>&1 | sed -n '1,20p; 20q'
96
- lint_rc=${PIPESTATUS[0]}
97
- linted=1
95
+ # #706: `linted=1` used to be assigned the moment detekt was INVOKED, without
96
+ # looking at whether it delivered a verdict. On a machine with a detekt
97
+ # launcher but no usable JVM the launcher prints
98
+ # Error: Could not find or load main class io.gitlab.arturbosch.detekt.cli.Main
99
+ # and exits 1; the gate then recorded "detekt ran", had no lint verdict of its
100
+ # own, and reported whatever the BUILD said -- so a tool that never started
101
+ # was presented as a code failure. The ktlint branch above already applies the
102
+ # right rule ("a non-zero exit is only a verdict if some non-noise line
103
+ # survives"); detekt did not, and this is that inconsistency closed.
104
+ #
105
+ # What counts as "ran": exit 0 (clean), or a non-zero exit whose output names
106
+ # a real finding. 126/127 are explicitly "cannot execute".
107
+ local detekt_out=""
108
+ detekt_out=$(detekt --input . 2>&1)
109
+ lint_rc=$?
110
+ printf '%s\n' "$detekt_out" | sed -n '1,20p'
111
+ if [ "$lint_rc" -ne 127 ] && [ "$lint_rc" -ne 126 ] \
112
+ && ! printf '%s\n' "$detekt_out" | grep -qE 'Could not find or load main class|No such file or directory|command not found'; then
113
+ linted=1
114
+ else
115
+ # Say WHY it did not count. Silence here is what let the defect hide: the
116
+ # only remaining line in the log was the build failure.
117
+ echo "⚠️ detekt is installed but did not run (exit $lint_rc) — no Kotlin lint verdict was produced."
118
+ fi
98
119
  fi
99
120
  if [ "$linted" -eq 0 ]; then
100
121
  echo "No Kotlin lint tools (ktlint/detekt)"
@@ -23,6 +23,69 @@
23
23
  # Gate body. `return` is used instead of `exit` so the driver decides to
24
24
  # stop: see scripts/wrap-gate-entries.cjs for why the two are equivalent
25
25
  # here, and why sub-shell exits are deliberately left as `exit`.
26
+ # Locate gate-6-layers.sh, falling through per FILE rather than per directory.
27
+ #
28
+ # WHY THIS IS NOT A TWO-BRANCH if (#819)
29
+ # The old lookup tried `$GATE_DIR/gate-6-layers.sh` and then the repo root, and
30
+ # stopped. `GATE_DIR` is resolved PROJECT-FIRST on purpose (a vendored copy must
31
+ # be able to win), but "this directory exists" does not mean "this one file is in
32
+ # it". A consumer repo that vendors a handful of gate scripts -- but not the layer
33
+ # checker -- made GATE_DIR point at that partial directory, and a complete global
34
+ # install was then invisible: the gate printed
35
+ #
36
+ # WARN:LAYER_CHECKER_MISSING ... layer boundaries NOT checked
37
+ #
38
+ # with `architecture.yaml` sitting in the repo root declaring layers.
39
+ #
40
+ # Each candidate is probed for THAT FILE, so a directory can win the gate suite
41
+ # and still lose this one file. Order: the project/vendored dir, the global
42
+ # adapter dir (or the installed package's own copy), then the repo root, then
43
+ # the hook's own directory -- the same tier order `hook-module-resolution.js`
44
+ # publishes for every other module.
45
+ #
46
+ # @returns the path on stdout, or nothing when no tier carries it.
47
+ _g6_find_layer_checker() {
48
+ local _repo_root _hook_dir _cand
49
+ _repo_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
50
+ _hook_dir="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" 2>/dev/null && pwd || true)"
51
+ for _cand in \
52
+ "${GATE_DIR:-}/gate-6-layers.sh" \
53
+ "${ADAPTER_DIR:-}/gate-6-layers.sh" \
54
+ "${GLOBAL_ADAPTER_DIR:-}/gate-6-layers.sh" \
55
+ "${_repo_root:+$_repo_root/githooks/gate-6-layers.sh}" \
56
+ "${_hook_dir:+$_hook_dir/gate-6-layers.sh}" \
57
+ "${_hook_dir:+$_hook_dir/../gate-6-layers.sh}"; do
58
+ [ -n "$_cand" ] || continue
59
+ if [ -f "$_cand" ]; then
60
+ printf '%s' "$_cand"
61
+ return 0
62
+ fi
63
+ done
64
+ return 0
65
+ }
66
+
67
+ # Did this project DECLARE a layer config?
68
+ #
69
+ # The same test `gate-6-layers.sh` uses to decide "nothing to check": the file at
70
+ # $XP_GATE_LAYER_CONFIG (default architecture.yaml) exists. Both sides must read
71
+ # the same knob, or the gate and the checker can disagree about whether layers
72
+ # were promised -- and the disagreement is exactly what #819 reported (the gate
73
+ # said "not configured" about a repo that had architecture.yaml).
74
+ #
75
+ # Existence is the right threshold here, not parseability: an UNPARSEABLE config
76
+ # is already exit 2 -> BLOCK from the checker, and that path is only reachable
77
+ # when the checker exists.
78
+ #
79
+ # @returns 0 when a layer config is declared
80
+ _g6_layers_declared() {
81
+ local _cfg="${XP_GATE_LAYER_CONFIG:-architecture.yaml}"
82
+ # Relative paths are resolved against the project, not the hook's CWD.
83
+ case "$_cfg" in
84
+ /*) [ -f "$_cfg" ] ;;
85
+ *) [ -f "${PROJECT_ROOT:-.}/$_cfg" ] ;;
86
+ esac
87
+ }
88
+
26
89
  gate_6_run() {
27
90
  # #852: reset the layer verdict channel. These are plain globals, not `local`,
28
91
  # so a second invocation in the same shell inherits the first one's values --
@@ -170,12 +233,7 @@ else
170
233
  # checked directly. The checker always builds the whole-repo import graph —
171
234
  # a layer violation is an edge between two directories, so an incremental
172
235
  # per-directory scan structurally cannot see one.
173
- LAYER_CHECKER=""
174
- if [ -f "$GATE_DIR/gate-6-layers.sh" ]; then
175
- LAYER_CHECKER="$GATE_DIR/gate-6-layers.sh"
176
- elif [ -f "$(git rev-parse --show-toplevel 2>/dev/null)/githooks/gate-6-layers.sh" ]; then
177
- LAYER_CHECKER="$(git rev-parse --show-toplevel)/githooks/gate-6-layers.sh"
178
- fi
236
+ LAYER_CHECKER="$(_g6_find_layer_checker)"
179
237
  if [ -n "$LAYER_CHECKER" ]; then
180
238
  LAYER_OUT=$(cd "$PROJECT_ROOT" && bash "$LAYER_CHECKER" 2>&1)
181
239
  LAYER_RC=$?
@@ -223,11 +281,28 @@ else
223
281
  fi
224
282
  unset _g6_reason_from_out
225
283
  else
226
- # The checker is missing, so the dimension is unmeasured — say so rather
227
- # than letting the gate look like it covered layers.
228
- GATE_6_LAYER_STATUS="WARN"
229
- GATE_6_LAYER_REASON="layer_checker_missing"
230
- echo " ⚠️ [WARN:LAYER_CHECKER_MISSING] gate-6-layers.sh not found — layer boundaries NOT checked."
284
+ # The checker is missing. Whether that is a WARN or a BLOCK depends on ONE
285
+ # question: did the project DECLARE a layer config?
286
+ #
287
+ # declared the repo promised layers it must uphold, and nothing can
288
+ # measure them -> fail closed. Reporting SKIP here scored an
289
+ # unmeasured dimension as a measured one, and the reason string
290
+ # ("architecture_not_configured") was factually wrong about a
291
+ # repo that had an architecture.yaml (#819).
292
+ # not nothing to check, so blocking every project that never
293
+ # configured layers would make the gate unusable -- the
294
+ # opposite error, and the one that teaches people to skip it.
295
+ if _g6_layers_declared; then
296
+ GATE_6_LAYER_STATUS="BLOCK"
297
+ GATE_6_STATUS="FAIL"
298
+ GATE_6_LAYER_REASON="layer_checker_missing_config_declared"
299
+ echo " ❌ [BLOCK:LAYER_CHECKER_MISSING] layer config declared, but gate-6-layers.sh was not found."
300
+ echo " Layers were NOT checked. A declared architecture has to be measured or refused."
301
+ else
302
+ GATE_6_LAYER_STATUS="WARN"
303
+ GATE_6_LAYER_REASON="layer_checker_missing"
304
+ echo " ⚠️ [WARN:LAYER_CHECKER_MISSING] gate-6-layers.sh not found — layer boundaries NOT checked."
305
+ fi
231
306
  fi
232
307
  # GATE_6_LAYER_STATUS is the layer dimension's own verdict, and until now
233
308
  # nothing read it. `grep -c GATE_6_LAYER_STATUS` found 6 assignments and 0
@@ -2,6 +2,6 @@
2
2
  "verdict": "PASS",
3
3
  "license_type": "MIT",
4
4
  "sha256": "0e7ac423bf2c6e223b7c5b156f8cf72da49d748e56a1641402c31f22ad07dbb5",
5
- "checked_at": "2026-12-01T23:06:55.842Z",
5
+ "checked_at": "2026-12-01T23:45:53.707Z",
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.41.60",
3
+ "version": "0.41.62",
4
4
  "description": "Deterministic quality gates for AI-generated code: 15 gates, Delphi review, sprint flow. Works with Claude Code, OpenCode, Qoder.",
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.41.60",
3
+ "version": "0.41.62",
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.41.60.0
6
+ **Version:** 0.41.62.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.41.60.0
6
+ **Version:** 0.41.62.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.41.60.0
6
+ **Version:** 0.41.62.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.41.60",
3
+ "version": "0.41.62",
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.41.60.0
6
+ **Version:** 0.41.62.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.41.60.0
6
+ **Version:** 0.41.62.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.41.60.0
6
+ **Version:** 0.41.62.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.41.60",
3
+ "version": "0.41.62",
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.41.60.0
6
+ **Version:** 0.41.62.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.41.60.0
6
+ **Version:** 0.41.62.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.41.60.0
6
+ **Version:** 0.41.62.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.41.60",
3
+ "version": "0.41.62",
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.41.60.0
6
+ **Version:** 0.41.62.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.41.60.0
6
+ **Version:** 0.41.62.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.41.60.0
6
+ **Version:** 0.41.62.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.41.60.0
6
+ **Version:** 0.41.62.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.41.60.0
6
+ **Version:** 0.41.62.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.41.60.0
6
+ **Version:** 0.41.62.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.