@boyingliu01/xp-gate 0.38.2 → 0.38.4

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 (29) hide show
  1. package/gate-12-file-hygiene.sh +3 -2
  2. package/hooks/gate-12-file-hygiene.sh +3 -2
  3. package/hooks/gate-entries/gate-0-entry.sh +15 -2
  4. package/lib/delphi-channel.js +10 -1
  5. package/lib/gate-runner.js +23 -15
  6. package/lib/mattpocock-license-verdict.json +1 -1
  7. package/mock-policy/AGENTS.md +1 -1
  8. package/mutation/AGENTS.md +1 -1
  9. package/package.json +1 -1
  10. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  11. package/plugins/claude-code/skills/delphi-review/AGENTS.md +1 -1
  12. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +1 -1
  13. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +1 -1
  14. package/plugins/dsh/package.json +1 -1
  15. package/plugins/dsh/skills/delphi-review/AGENTS.md +1 -1
  16. package/plugins/dsh/skills/sprint-flow/AGENTS.md +1 -1
  17. package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +1 -1
  18. package/plugins/opencode/package.json +1 -1
  19. package/plugins/opencode/skills/delphi-review/AGENTS.md +1 -1
  20. package/plugins/opencode/skills/sprint-flow/AGENTS.md +1 -1
  21. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +1 -1
  22. package/plugins/qoder/plugin.json +1 -1
  23. package/plugins/qoder/skills/delphi-review/AGENTS.md +1 -1
  24. package/plugins/qoder/skills/sprint-flow/AGENTS.md +1 -1
  25. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +1 -1
  26. package/principles/AGENTS.md +1 -1
  27. package/skills/delphi-review/AGENTS.md +1 -1
  28. package/skills/sprint-flow/AGENTS.md +1 -1
  29. package/skills/test-specification-alignment/AGENTS.md +1 -1
@@ -140,10 +140,11 @@ fi
140
140
  # Runs in BOTH modes. Docs-only commits read the staged DIFF (hunk cost)
141
141
  # instead of every full blob — a marker line must be ADDED to matter, so
142
142
  # '^+' minus '+++' headers is the precise scope.
143
+ # Exactly 7 chars + a space/EOL boundary: longer runs (Maven `====` log separators, RST/setext underlines) are not conflicts.
143
144
  CONFLICT_MARKER_FILES=""
144
145
  if [ "${GATE_12_DOCS_ONLY:-false}" = true ]; then
145
146
  if git diff --cached --no-color --diff-filter=d 2>/dev/null \
146
- | grep -E '^\+' | grep -v '^+++' | grep -qE '^\+(<<<<<<<|=======|>>>>>>>)'; then
147
+ | grep -E '^\+' | grep -v '^+++' | grep -qE '^\+(<{7}|={7}|>{7})([[:space:]]|$)'; then
147
148
  CONFLICT_MARKER_FILES="$STAGED_FILES"
148
149
  fi
149
150
  else
@@ -154,7 +155,7 @@ while IFS= read -r file; do
154
155
  continue
155
156
  fi
156
157
  # Check for conflict markers in staged content
157
- if git show ":$file" 2>/dev/null | grep -qE '^(<<<<<<<|=======|>>>>>>>)'; then
158
+ if git show ":$file" 2>/dev/null | grep -qE '^(<{7}|={7}|>{7})([[:space:]]|$)'; then
158
159
  CONFLICT_MARKER_FILES="$CONFLICT_MARKER_FILES $file"
159
160
  fi
160
161
  done <<EOF
@@ -140,10 +140,11 @@ fi
140
140
  # Runs in BOTH modes. Docs-only commits read the staged DIFF (hunk cost)
141
141
  # instead of every full blob — a marker line must be ADDED to matter, so
142
142
  # '^+' minus '+++' headers is the precise scope.
143
+ # Exactly 7 chars + a space/EOL boundary: longer runs (Maven `====` log separators, RST/setext underlines) are not conflicts.
143
144
  CONFLICT_MARKER_FILES=""
144
145
  if [ "${GATE_12_DOCS_ONLY:-false}" = true ]; then
145
146
  if git diff --cached --no-color --diff-filter=d 2>/dev/null \
146
- | grep -E '^\+' | grep -v '^+++' | grep -qE '^\+(<<<<<<<|=======|>>>>>>>)'; then
147
+ | grep -E '^\+' | grep -v '^+++' | grep -qE '^\+(<{7}|={7}|>{7})([[:space:]]|$)'; then
147
148
  CONFLICT_MARKER_FILES="$STAGED_FILES"
148
149
  fi
149
150
  else
@@ -154,7 +155,7 @@ while IFS= read -r file; do
154
155
  continue
155
156
  fi
156
157
  # Check for conflict markers in staged content
157
- if git show ":$file" 2>/dev/null | grep -qE '^(<<<<<<<|=======|>>>>>>>)'; then
158
+ if git show ":$file" 2>/dev/null | grep -qE '^(<{7}|={7}|>{7})([[:space:]]|$)'; then
158
159
  CONFLICT_MARKER_FILES="$CONFLICT_MARKER_FILES $file"
159
160
  fi
160
161
  done <<EOF
@@ -17,6 +17,20 @@
17
17
  # on - there is no copy left in the hook.
18
18
  # ============================================================================
19
19
 
20
+ # #809: Windows caps one env var at 32767 chars. A large merge's staged list can
21
+ # exceed that; exporting it then makes Windows-native children (pytest+syrupy
22
+ # restoring os.environ) raise ValueError, which Gate 5 misreads as Tests FAILED.
23
+ # XP_STAGED_ACM is only the #640 fork cache and every consumer falls back to
24
+ # `git diff --cached` when it is unset -- so export only when it fits, else drop.
25
+ export_staged_acm_cache() {
26
+ if [ "${#1}" -le 32767 ]; then
27
+ XP_STAGED_ACM="$1"
28
+ export XP_STAGED_ACM
29
+ else
30
+ unset XP_STAGED_ACM
31
+ fi
32
+ }
33
+
20
34
  # ============================================================================
21
35
  # Gate 0: Version Consistency Check (Protected Branches)
22
36
  # ============================================================================
@@ -88,8 +102,7 @@ has_changelog_change=false
88
102
  # A cache that is only warm on some branches is not a cache, it is a branch-wide
89
103
  # behaviour difference. Assign it before anything can branch.
90
104
  STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM)
91
- XP_STAGED_ACM="$STAGED_FILES"
92
- export XP_STAGED_ACM
105
+ export_staged_acm_cache "$STAGED_FILES"
93
106
 
94
107
  if [ "$is_protected" = "true" ]; then
95
108
  # Env var bypass: SKIP_VERSION_CHECK=1 skips Gate 0 entirely
@@ -89,7 +89,16 @@ function normaliseChannels(raw) {
89
89
  * @returns {{ config?: object, error?: string }}
90
90
  */
91
91
  function readMachineConfig(home) {
92
- const root = home || os.homedir();
92
+ // Resolve through HOME first, exactly like shared-paths' resolveHomeDir().
93
+ // `os.homedir()` DELIBERATELY ignores process.env.HOME on Windows (it reads
94
+ // USERPROFILE instead -- measured: pointing HOME at a temp dir leaves
95
+ // os.homedir() unchanged), so a caller that sandboxed a test by setting HOME
96
+ // still read the developer's REAL ~/.config here. That made a real machine's
97
+ // `channels: ["external"]` leak into tests: nativeEnabled went false, Qoder
98
+ // deployment was skipped, and three assertions failed for a reason unrelated
99
+ // to the code under test. Same precedence as shared-paths keeps ONE answer to
100
+ // "where is home" in this package.
101
+ const root = home || process.env.HOME || process.env.USERPROFILE || os.homedir();
93
102
  const file = path.join(root, '.config', 'xp-gate', '.delphi-config.json');
94
103
  if (!fs.existsSync(file)) return {};
95
104
  try {
@@ -847,6 +847,28 @@ function getAllGates() {
847
847
  }));
848
848
  }
849
849
 
850
+ /**
851
+ * Report a gate that only runs during `git commit`, and return the sentinel.
852
+ *
853
+ * #778: returns GATE_NOT_RUN, NOT 0. The inline version of this branch used to
854
+ * `return 0` while the branch 340 lines above returns GATE_NOT_RUN for the same
855
+ * meaning ("nothing ran"). bin/xp-gate.js maps the sentinel to exit 2 precisely
856
+ * so a gate that never executed cannot exit like a gate that ran clean -- and
857
+ * that branch walked straight past the guarantee for seven of the fourteen
858
+ * pre-commit gates. One file, two opposite answers to one question.
859
+ *
860
+ * Callers that legitimately treat "not run" as success (check.js, for a gate
861
+ * with nothing to analyse) already coerce the sentinel explicitly; making the
862
+ * coercion visible at each call site is the point, not an inconvenience.
863
+ */
864
+ function reportPreCommitOnly(gateId, gate) {
865
+ console.log(`━━━ Gate ${gateId}: ${gate.name} ━━━`);
866
+ console.log(`⏭️ SKIPPED - ${gate.reason}`);
867
+ console.log(' This gate runs automatically during git commit.');
868
+ console.log(' Run: git commit to trigger all gates.');
869
+ return GATE_NOT_RUN;
870
+ }
871
+
850
872
  async function runGate(gateId, targetPath, opts = {}) {
851
873
  const gate = GATE_REGISTRY[String(gateId)];
852
874
  if (!gate) {
@@ -856,21 +878,7 @@ async function runGate(gateId, targetPath, opts = {}) {
856
878
  }
857
879
 
858
880
  if (gate.preCommitOnly) {
859
- console.log(`━━━ Gate ${gateId}: ${gate.name} ━━━`);
860
- console.log(`⏭️ SKIPPED - ${gate.reason}`);
861
- console.log(' This gate runs automatically during git commit.');
862
- console.log(' Run: git commit to trigger all gates.');
863
- // #778: return the sentinel, NOT 0. This branch used to `return 0` while the
864
- // branch 340 lines above returns GATE_NOT_RUN for the same meaning ("nothing
865
- // ran"). bin/xp-gate.js then maps the sentinel to exit 2 precisely so a gate
866
- // that never executed cannot exit like a gate that ran clean -- and this
867
- // branch walked straight past that guarantee for seven of the fourteen
868
- // pre-commit gates. One file, two opposite answers to one question.
869
- //
870
- // Callers that legitimately treat "not run" as success (check.js, for a gate
871
- // with nothing to analyse) already coerce the sentinel explicitly; making the
872
- // coercion visible at each call site is the point, not an inconvenience.
873
- return GATE_NOT_RUN;
881
+ return reportPreCommitOnly(gateId, gate);
874
882
  }
875
883
 
876
884
  if (gate.run) {
@@ -2,6 +2,6 @@
2
2
  "verdict": "PASS",
3
3
  "license_type": "MIT",
4
4
  "sha256": "0e7ac423bf2c6e223b7c5b156f8cf72da49d748e56a1641402c31f22ad07dbb5",
5
- "checked_at": "2026-11-14T10:25:50.301Z",
5
+ "checked_at": "2026-11-14T23:06:48.655Z",
6
6
  "source": "network"
7
7
  }
@@ -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.2.0
6
+ **Version:** 0.38.4.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.
@@ -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.2.0
6
+ **Version:** 0.38.4.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.38.2",
3
+ "version": "0.38.4",
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.2",
3
+ "version": "0.38.4",
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.2.0
6
+ **Version:** 0.38.4.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.2.0
6
+ **Version:** 0.38.4.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.
@@ -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.2.0
6
+ **Version:** 0.38.4.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.2",
3
+ "version": "0.38.4",
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.2.0
6
+ **Version:** 0.38.4.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.2.0
6
+ **Version:** 0.38.4.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.
@@ -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.2.0
6
+ **Version:** 0.38.4.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.2",
3
+ "version": "0.38.4",
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.2.0
6
+ **Version:** 0.38.4.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.2.0
6
+ **Version:** 0.38.4.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.
@@ -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.2.0
6
+ **Version:** 0.38.4.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.2",
3
+ "version": "0.38.4",
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.2.0
6
+ **Version:** 0.38.4.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.2.0
6
+ **Version:** 0.38.4.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.
@@ -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.2.0
6
+ **Version:** 0.38.4.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.2.0
6
+ **Version:** 0.38.4.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.
@@ -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.2.0
6
+ **Version:** 0.38.4.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.2.0
6
+ **Version:** 0.38.4.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.
@@ -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.2.0
6
+ **Version:** 0.38.4.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.