@boyingliu01/xp-gate 0.38.43 → 0.38.45

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.
@@ -33,7 +33,11 @@ if ! gate_enabled 6; then
33
33
  echo "⏭️ SKIPPED - Gate 6: Architecture & tech debt (not selected by XP_GATE_ONLY_GATE)"
34
34
  GATE_6_STATUS="SKIP"
35
35
  GATE_6_DETAIL="not_selected"
36
- record_gate_audit "gate-6" "architecture-boy-scout" "$GATE_6_STATUS" "0" "$(gate_start_ms)"
36
+ # GATE_6_DETAIL used to be assigned here and then dropped: record_gate_audit
37
+ # was called with five arguments, so the reason never reached the journal and
38
+ # the variable read as dead (shellcheck SC2034). Passing it is the fix; deleting
39
+ # the assignment would have kept the audit line reasonless.
40
+ record_gate_audit "gate-6" "architecture-boy-scout" "$GATE_6_STATUS" "0" "$(gate_start_ms)" "$GATE_6_DETAIL"
37
41
  return 0
38
42
  fi
39
43
 
@@ -42,8 +46,9 @@ fi
42
46
  GATE_6_START=$(gate_start_ms)
43
47
 
44
48
  # First Part: Architecture Validation (previously Gate 9)
45
- 2>&1 echo " └─ Architecture validation:"
46
-
49
+ # shellcheck disable=SC2153 # PROJECT_LANG is set by gate-0-entry.sh and reaches
50
+ # this file through the driver; shellcheck analyses one file at a time, so the
51
+ # note is a false positive. The variable is required.
47
52
  if [ "$PROJECT_LANG" = "documentation-only" ]; then
48
53
  echo " ✅ Skipped (documentation project)."
49
54
 
@@ -92,7 +97,6 @@ else
92
97
  # scope at least still checks something.
93
98
  # ---------------------------------------------------------------------------
94
99
  GATE_6_STAGED_SNAPSHOT=""
95
- GATE_6_STAGED_SNAPSHOT_AVAILABLE=0
96
100
 
97
101
  _gate6_snapshot() {
98
102
  local _tree _commit
@@ -103,7 +107,6 @@ else
103
107
  _commit=$(git -C "$PROJECT_ROOT" commit-tree "$_tree" -m "xp-gate: staged snapshot for Gate 6" 2>/dev/null) || return 1
104
108
  [ -n "$_commit" ] || return 1
105
109
  GATE_6_STAGED_SNAPSHOT="$_commit"
106
- GATE_6_STAGED_SNAPSHOT_AVAILABLE=1
107
110
  return 0
108
111
  }
109
112
 
@@ -190,6 +193,24 @@ else
190
193
  GATE_6_LAYER_REASON="layer_checker_missing"
191
194
  echo " ⚠️ [WARN:LAYER_CHECKER_MISSING] gate-6-layers.sh not found — layer boundaries NOT checked."
192
195
  fi
196
+ # GATE_6_LAYER_STATUS is the layer dimension's own verdict, and until now
197
+ # nothing read it. `grep -c GATE_6_LAYER_STATUS` found 6 assignments and 0
198
+ # reads anywhere in the repository -- shellcheck SC2034 was reporting a real
199
+ # defect, not a false positive, which is the more interesting half of this
200
+ # find.
201
+ #
202
+ # Consequence: the FAIL and BLOCK cases set GATE_6_STATUS themselves, but the
203
+ # WARN case ("the layer checker is missing, so layer boundaries are NOT
204
+ # checked") set only this variable. It printed a warning line and the gate
205
+ # could still finish PASS -- an unmeasured dimension scored as a measured one.
206
+ #
207
+ # The flag is consumed at the FINAL verdict (~line 634), not here: an earlier
208
+ # attempt assigned GATE_6_STATUS at this point and was silently overwritten by
209
+ # the `GATE_6_STATUS="PASS"` upgrade further down. Order matters, and reading
210
+ # only the local block would not have shown it.
211
+ if [ "$GATE_6_LAYER_STATUS" = "WARN" ]; then
212
+ GATE_6_LAYERS_WARNED=1
213
+ fi
193
214
  if [ "${GATE_6_LAYER_CRASHED:-0}" = "1" ]; then
194
215
  echo " ❌ [BLOCK:LAYER_CHECKER_CRASHED] gate-6-layers.sh exited $LAYER_RC without a verdict."
195
216
  echo " A checker that did not finish has not checked anything — fail closed."
@@ -234,6 +255,7 @@ else
234
255
  else
235
256
  echo " ❌ BLOCKED - archlint not installed"
236
257
  echo " Install with: npm install --save-dev @archlinter/cli"
258
+ GATE_6_STATUS="FAIL"
237
259
  return 1
238
260
  fi
239
261
  echo " Running archlint for TypeScript..."
@@ -303,6 +325,7 @@ else
303
325
  echo "Fix the architecture violations above before committing."
304
326
  echo "Or generate a baseline for gradual adoption: npx @archlinter/cli snapshot -o .architecture-baseline.json"
305
327
  fi
328
+ GATE_6_STATUS="FAIL"
306
329
  return 1
307
330
  fi
308
331
  if [ -f "$PROJECT_ROOT/.architecture-baseline.json" ]; then
@@ -326,12 +349,14 @@ else
326
349
  echo ""
327
350
  echo "❌ BLOCKED - Python architecture contract violations (import-linter)"
328
351
  echo "Fix the broken contracts above before committing."
352
+ GATE_6_STATUS="FAIL"
329
353
  return 1
330
354
  fi
331
355
  echo " ✅ Python architecture validation completed."
332
356
  else
333
357
  echo " ❌ BLOCKED - import-linter not installed"
334
358
  echo " Install with: pip install import-linter"
359
+ GATE_6_STATUS="FAIL"
335
360
  return 1
336
361
  fi
337
362
  else
@@ -367,12 +392,14 @@ else
367
392
  echo "❌ BLOCKED - Go architecture contract violations (arch-go, exit $_go_arch_rc)"
368
393
  echo "Fix the layering violation(s) above before committing."
369
394
  GATE_6_REASON_BY_LANG["$CURRENT_LANG"]="architecture_tests_failed"
395
+ GATE_6_STATUS="FAIL"
370
396
  return 1
371
397
  fi
372
398
  echo " ✅ Go architecture validation completed."
373
399
  else
374
400
  echo " ❌ BLOCKED - arch-go not installed"
375
401
  echo " Install with: go install github.com/arch-go/arch-go@latest"
402
+ GATE_6_STATUS="FAIL"
376
403
  return 1
377
404
  fi
378
405
  else
@@ -451,6 +478,7 @@ JAVAARCHROOTS
451
478
  echo "❌ BLOCKED - Java architecture test(s) failed (exit $_java_arch_rc)"
452
479
  echo "Fix the layering violation(s) above before committing."
453
480
  GATE_6_REASON_BY_LANG["$CURRENT_LANG"]="architecture_tests_failed"
481
+ GATE_6_STATUS="FAIL"
454
482
  return 1
455
483
  fi
456
484
  echo " ✅ Java architecture validation completed."
@@ -516,6 +544,7 @@ CSARCHPROJ
516
544
  if [ "${BASH_VERSINFO[0]:-0}" -ge 4 ]; then
517
545
  GATE_6_REASON_BY_LANG["$CURRENT_LANG"]="architecture_tests_failed"
518
546
  fi
547
+ GATE_6_STATUS="FAIL"
519
548
  return 1
520
549
  fi
521
550
  echo " ✅ C# architecture validation completed."
@@ -601,6 +630,14 @@ CSARCHPROJ
601
630
  if [ -z "$GATE_6_LANG_REASONS" ] && [ -n "$PROJECT_LANGS" ]; then
602
631
  GATE_6_STATUS="PASS"
603
632
  fi
633
+ # ...unless the layer dimension itself was unmeasured. This is where
634
+ # GATE_6_LAYER_STATUS finally reaches a verdict; see the long note beside its
635
+ # assignment. The upgrade above is the reason the flag exists instead of an
636
+ # inline assignment: anything set earlier is overwritten here.
637
+ if [ "${GATE_6_LAYERS_WARNED:-0}" = "1" ] && [ "$GATE_6_STATUS" = "PASS" ]; then
638
+ GATE_6_STATUS="WARN"
639
+ GATE_6_REASON="${GATE_6_REASON:-${GATE_6_LAYER_REASON:-layers_not_measured}}"
640
+ fi
604
641
  else
605
642
  # Architecture config is REQUIRED — BLOCK if missing
606
643
  if [ -f "$PROJECT_ROOT/.architecture-skip" ]; then
@@ -636,6 +673,24 @@ CSARCHPROJ
636
673
  echo ""
637
674
  echo " After creating the config, retry the commit."
638
675
  echo " (To skip with warning, create .architecture-skip file)"
676
+ # The status must be set BEFORE returning.
677
+ #
678
+ # This branch printed "COMMIT BLOCKED" and returned 1, which does block the
679
+ # commit -- but it never assigned GATE_6_STATUS, so the value stayed at the
680
+ # "SKIP" it was initialised with. Measured 2026-11-19 on a Kotlin fixture
681
+ # with XP_GATE_ONLY_GATE=6:
682
+ #
683
+ # stdout : ARCHITECTURE CONFIG MISSING - COMMIT BLOCKED
684
+ # rc : 1 (the commit really was refused)
685
+ # report : gate6_arch_boyscout.status = "SKIP", reason ""
686
+ # overall.gatesFailed = 0, failedGates = []
687
+ #
688
+ # Same shape as the Gate 9 defect fixed in e9cf2e23, one file over: the
689
+ # behaviour was right and the record said something else. The reason string
690
+ # is set too, because a SKIP with no reason is itself a defect here -- and a
691
+ # FAIL with no reason is no better.
692
+ GATE_6_STATUS="FAIL"
693
+ GATE_6_REASON="architecture_config_missing"
639
694
  return 1
640
695
  fi
641
696
  fi
@@ -700,6 +755,7 @@ else
700
755
  echo " - NEW files: must have zero warnings"
701
756
  echo " - MODIFIED files: cannot increase warnings from baseline"
702
757
  echo " - Files with ≤5 warnings: must clear to zero"
758
+ GATE_6_STATUS="FAIL"
703
759
  return 1
704
760
  fi
705
761
 
@@ -710,6 +766,7 @@ else
710
766
  echo "$BOY_SCOUT_OUTPUT"
711
767
  echo ""
712
768
  echo "❌ BLOCKED - Boy Scout Rule violations detected ($VIOLATION_COUNT)"
769
+ GATE_6_STATUS="FAIL"
713
770
  return 1
714
771
  fi
715
772
 
@@ -269,7 +269,29 @@ elif [ -f "package.json" ] && [ -f "tsconfig.json" ]; then
269
269
  echo "❌ BLOCKED - Gate 9: Build integrity check failed"
270
270
  echo "Fix type errors, broken imports, or package manifest issues before committing."
271
271
  rm -f "$GATE_9_OUTPUT"
272
- return 1
272
+ # DO NOT `return 1` here.
273
+ #
274
+ # This used to return immediately, which skipped the aggregation at the
275
+ # bottom of this file AND the record_gate_audit call below it. The commit
276
+ # was still blocked (the driver saw the non-zero return), but the run
277
+ # report kept GATE_9_STATUS at its initialised "SKIP" and the audit line
278
+ # recorded SKIP too.
279
+ #
280
+ # Measured 2026-11-19 on a TypeScript fixture with `const x: number =
281
+ # "not a number"`:
282
+ #
283
+ # stdout : tsc: FAIL TypeScript compilation failed with 1 error(s)
284
+ # BLOCKED - Gate 9: Build integrity check failed
285
+ # report : gate9_build_integrity.status = "SKIP"
286
+ # overall.gatesFailed = 0, failedGates = []
287
+ #
288
+ # So the gate blocked correctly and recorded the opposite. Every
289
+ # downstream reader -- the report, the audit journal, gate-coverage --
290
+ # saw a skip.
291
+ #
292
+ # The aggregation below turns GATE_9_TS_STATUS=BLOCK into
293
+ # GATE_9_STATUS=BLOCK, and gate_9_run returns non-zero from there, so the
294
+ # commit is still blocked; only now the record agrees with the behaviour.
273
295
  fi
274
296
  fi
275
297
  rm -f "$GATE_9_OUTPUT"
@@ -298,7 +320,10 @@ if echo "$CHANGED_FILES" | grep -q '\.java$'; then
298
320
  echo ""
299
321
  echo "❌ BLOCKED - Gate 9: Java build integrity check failed"
300
322
  echo "Fix the compile errors before committing."
301
- return 1
323
+ # Same defect as the TypeScript branch above: returning here skipped the
324
+ # aggregation and the audit record, so a blocked Java build was written to
325
+ # the report as SKIP. Falling through lets GATE_9_JAVA_STATUS=BLOCK reach
326
+ # the aggregation, which produces the non-zero return.
302
327
  ;;
303
328
  *)
304
329
  GATE_9_JAVA_STATUS="SKIP"
@@ -453,6 +478,18 @@ esac
453
478
  record_gate_audit "gate-9" "build-integrity" "$GATE_9_STATUS" "0" "$GATE_9_START" "${GATE_9_UNVERIFIED:-}"
454
479
  echo ""
455
480
  # ============================================================================
481
+ # Return what the aggregated status says.
482
+ #
483
+ # This was an unconditional `return 0` -- safe only because the two BLOCK
484
+ # branches bailed out with their own `return 1` before reaching here. Those
485
+ # early returns skipped the aggregation and the audit record, so the report and
486
+ # the journal recorded SKIP for a commit that was correctly blocked.
487
+ #
488
+ # Removing the early returns without changing this line would have been worse:
489
+ # the gate would have printed "BLOCKED" and returned success. Both halves move
490
+ # together, which is why the tests pin the RECORDED status and the RETURN CODE,
491
+ # not either one alone.
492
+ [ "$GATE_9_STATUS" = "BLOCK" ] && return 1
456
493
  return 0
457
494
  }
458
495
 
@@ -2,6 +2,6 @@
2
2
  "verdict": "PASS",
3
3
  "license_type": "MIT",
4
4
  "sha256": "0e7ac423bf2c6e223b7c5b156f8cf72da49d748e56a1641402c31f22ad07dbb5",
5
- "checked_at": "2026-11-19T16:55:02.170Z",
5
+ "checked_at": "2026-11-19T18:14:45.056Z",
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.43",
3
+ "version": "0.38.45",
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.43",
3
+ "version": "0.38.45",
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.43.0
6
+ **Version:** 0.38.45.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.43.0
6
+ **Version:** 0.38.45.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.43.0
6
+ **Version:** 0.38.45.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.43",
3
+ "version": "0.38.45",
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.43.0
6
+ **Version:** 0.38.45.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.43.0
6
+ **Version:** 0.38.45.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.43.0
6
+ **Version:** 0.38.45.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.43",
3
+ "version": "0.38.45",
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.43.0
6
+ **Version:** 0.38.45.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.43.0
6
+ **Version:** 0.38.45.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.43.0
6
+ **Version:** 0.38.45.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.43.0
6
+ **Version:** 0.38.45.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.43.0
6
+ **Version:** 0.38.45.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.43.0
6
+ **Version:** 0.38.45.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.43.0
6
+ **Version:** 0.38.45.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.43.0
6
+ **Version:** 0.38.45.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.43.0
6
+ **Version:** 0.38.45.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.