@boyingliu01/xp-gate 0.8.17 → 0.8.18

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.
@@ -214,17 +214,17 @@ describe('check-version.js — REQ-001-01', () => {
214
214
 
215
215
  it('returns safe defaults (outdated:false) without network', async () => {
216
216
  // Mock https to return the SAME version as local → outdated=false, no network dependency
217
- const result = await withMockedHttps('0.8.17', async (m) => m.checkUpgrade('@nonexistent/pkg-test-only'));
217
+ const result = await withMockedHttps('0.8.18', async (m) => m.checkUpgrade('@nonexistent/pkg-test-only'));
218
218
  expect(result.outdated).toBe(false);
219
- expect(result.local).toBe('0.8.17');
220
- expect(result.remote).toBe('0.8.17');
219
+ expect(result.local).toBe('0.8.18');
220
+ expect(result.remote).toBe('0.8.18');
221
221
  expect(result.lagDays).toBe(0);
222
222
  });
223
223
 
224
224
  it('returns outdated=true when remote > local', async () => {
225
225
  const result = await withMockedHttps('99.99.99', async (m) => m.checkUpgrade('@nonexistent/pkg-test-only'));
226
226
  expect(result.outdated).toBe(true);
227
- expect(result.local).toBe('0.8.17');
227
+ expect(result.local).toBe('0.8.18');
228
228
  expect(result.remote).toBe('99.99.99');
229
229
  });
230
230
  });
@@ -1,9 +1,9 @@
1
1
  # SRC/MOCK-POLICY KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-06-16
4
- **Commit:** d3a0242
3
+ **Generated:** 2026-06-17
4
+ **Commit:** d1b11ce
5
5
  **Branch:** main
6
- **Version:** 0.8.17.0
6
+ **Version:** 0.8.18.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
- **Generated:** 2026-06-16
4
- **Commit:** d3a0242
3
+ **Generated:** 2026-06-17
4
+ **Commit:** d1b11ce
5
5
  **Branch:** main
6
- **Version:** 0.8.17.0
6
+ **Version:** 0.8.18.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.8.17",
3
+ "version": "0.8.18",
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.8.17",
3
+ "version": "0.8.18",
4
4
  "displayName": "XP-Gate",
5
5
  "description": "Extreme Programming quality gates + AI workflow skills for Claude Code. Includes 10 quality gates (Gate 0-9), Sprint Flow (11 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
- **Generated:** 2026-06-16
4
- **Commit:** d3a0242
3
+ **Generated:** 2026-06-17
4
+ **Commit:** d1b11ce
5
5
  **Branch:** main
6
- **Version:** 0.8.17.0
6
+ **Version:** 0.8.18.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, 3 experts from ≥2 providers, domestic models only). Supports design + code-walkthrough modes.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-06-16
4
- **Commit:** d3a0242
3
+ **Generated:** 2026-06-17
4
+ **Commit:** d1b11ce
5
5
  **Branch:** main
6
- **Version:** 0.8.17.0
6
+ **Version:** 0.8.18.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **11-phase** development pipeline: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → USER ACCEPTANCE → FEEDBACK → SHIP → LAND → CLEANUP. Phase 2 default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE in Phase 1: 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
- **Generated:** 2026-06-16
4
- **Commit:** d3a0242
3
+ **Generated:** 2026-06-17
4
+ **Commit:** d1b11ce
5
5
  **Branch:** main
6
- **Version:** 0.8.17.0
6
+ **Version:** 0.8.18.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.8.17",
3
+ "version": "0.8.18",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "description": "XP-Gate quality gates + AI workflow skills for OpenCode",
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-06-16
4
- **Commit:** d3a0242
3
+ **Generated:** 2026-06-17
4
+ **Commit:** d1b11ce
5
5
  **Branch:** main
6
- **Version:** 0.8.17.0
6
+ **Version:** 0.8.18.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, 3 experts from ≥2 providers, domestic models only). Supports design + code-walkthrough modes.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-06-16
4
- **Commit:** d3a0242
3
+ **Generated:** 2026-06-17
4
+ **Commit:** d1b11ce
5
5
  **Branch:** main
6
- **Version:** 0.8.17.0
6
+ **Version:** 0.8.18.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **11-phase** development pipeline: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → USER ACCEPTANCE → FEEDBACK → SHIP → LAND → CLEANUP. Phase 2 default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE in Phase 1: 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
- **Generated:** 2026-06-16
4
- **Commit:** d3a0242
3
+ **Generated:** 2026-06-17
4
+ **Commit:** d1b11ce
5
5
  **Branch:** main
6
- **Version:** 0.8.17.0
6
+ **Version:** 0.8.18.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
@@ -0,0 +1,68 @@
1
+ #!/bin/bash
2
+ # sprint-flow-guard.sh — Qoder PreToolUse Hook Guard
3
+ #
4
+ # PURPOSE: Physically prevent LLM from editing/writing code before
5
+ # delphi-review is APPROVED. Blocks Edit/Write/ApplyEdit tools.
6
+ #
7
+ # INTEGRATION: Registered in plugins/qoder/hooks/hooks.json
8
+ # as a PreToolUse hook.
9
+ #
10
+ # MECHANISM:
11
+ # - Reads .sprint-state/delphi-reviewed.json
12
+ # - If file missing or verdict != "APPROVED" → deny
13
+ # - If verdict == "APPROVED" → allow
14
+ #
15
+ # GRACEFUL DEGRADATION:
16
+ # - If .sprint-state/ directory doesn't exist → ALLOW (not a sprint project)
17
+ # - If jq not available → ALLOW with warning (zero degradation for existing projects)
18
+
19
+ # Check if this is a sprint project
20
+ SPRINT_STATE_DIR="$(git rev-parse --show-toplevel 2>/dev/null)/.sprint-state"
21
+ APPROVED_FILE="$SPRINT_STATE_DIR/delphi-reviewed.json"
22
+
23
+ # If no .sprint-state directory, this isn't a sprint project → allow
24
+ if [ ! -d "$SPRINT_STATE_DIR" ]; then
25
+ exit 0
26
+ fi
27
+
28
+ # If delphi-reviewed.json doesn't exist, delphi-review hasn't completed → DENY
29
+ if [ ! -f "$APPROVED_FILE" ]; then
30
+ echo '{"decision":"deny","reason":"delphi-review not APPROVED. Complete Phase 1 delphi-review before any code modification. Run: /delphi-review"}'
31
+ exit 1
32
+ fi
33
+
34
+ # Check jq availability
35
+ if ! command -v jq &> /dev/null; then
36
+ # jq not available → warn but allow (degradation for existing project)
37
+ echo '{"decision":"allow","warning":"jq not available, cannot verify delphi-review verdict. Install jq for full protection."}'
38
+ exit 0
39
+ fi
40
+
41
+ # Validate JSON
42
+ if ! jq empty "$APPROVED_FILE" 2>/dev/null; then
43
+ echo '{"decision":"deny","reason":"delphi-reviewed.json is not valid JSON. Re-run: /delphi-review"}'
44
+ exit 1
45
+ fi
46
+
47
+ # Check verdict
48
+ VERDICT=$(jq -r '.verdict' "$APPROVED_FILE" 2>/dev/null)
49
+ MODE=$(jq -r '.mode' "$APPROVED_FILE" 2>/dev/null)
50
+
51
+ if [ "$VERDICT" != "APPROVED" ]; then
52
+ DENY_MSG="{\"decision\":\"deny\",\"reason\":\"delphi-review verdict is '${VERDICT}', not APPROVED. Fix issues and re-run: /delphi-review\"}"
53
+ echo "$DENY_MSG"
54
+ exit 1
55
+ fi
56
+
57
+ # APPROVED → allow
58
+ if [ "$MODE" = "design" ]; then
59
+ SPEC_PATH=$(jq -r '.specification_path // "not found"' "$APPROVED_FILE" 2>/dev/null)
60
+ echo "{\"decision\":\"allow\",\"message\":\"delphi-review design APPROVED. specification: ${SPEC_PATH}\"}"
61
+ elif [ "$MODE" = "code-walkthrough" ]; then
62
+ COMMIT=$(jq -r '.commit // "unknown"' "$APPROVED_FILE" 2>/dev/null)
63
+ echo "{\"decision\":\"allow\",\"message\":\"delphi-review code-walkthrough APPROVED. commit: ${COMMIT}\"}"
64
+ else
65
+ echo '{"decision":"allow","message":"delphi-review APPROVED"}'
66
+ fi
67
+
68
+ exit 0
@@ -0,0 +1,47 @@
1
+ #!/bin/bash
2
+ # xp-gate-check: Quality gate wrapper for Qoder plugin
3
+ # Usage: xp-gate-check <file_path>
4
+ #
5
+ # Graceful degradation: if xp-gate CLI unavailable, logs warning to stderr and exits 0.
6
+ # This script always exits 0 to avoid blocking Qoder sessions.
7
+
8
+ set -euo pipefail
9
+
10
+ FILE_PATH="${1:-}"
11
+
12
+ if [ -z "$FILE_PATH" ]; then
13
+ exit 0
14
+ fi
15
+
16
+ # Skip if file doesn't exist
17
+ [ -f "$FILE_PATH" ] || exit 0
18
+
19
+ # Skip non-source files
20
+ case "$FILE_PATH" in
21
+ *.ts|*.tsx|*.js|*.jsx|*.py|*.go|*.java|*.kt|*.rb|*.rs)
22
+ ;;
23
+ *)
24
+ exit 0
25
+ ;;
26
+ esac
27
+
28
+ # Resolve repo root from script location (avoids dependence on QODER_PLUGIN_ROOT env var)
29
+ # Plugin is at plugins/qoder/bin/, repo root is 3 dirname calls up:
30
+ # bin/ → qoder/ → plugins/ → repo-root/
31
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
32
+ REPO_ROOT="$(dirname "$(dirname "$(dirname "$SCRIPT_DIR")")")"
33
+
34
+ if command -v xp-gate >/dev/null 2>&1; then
35
+ # xp-gate globally installed — run principles check on the file
36
+ npx -y tsx "${REPO_ROOT}/src/principles/index.ts" --files "$FILE_PATH" --format console 2>&1 || true
37
+ elif [ -f "${REPO_ROOT}/src/principles/index.ts" ]; then
38
+ # Fallback: run principles checker directly from repo source
39
+ echo "[XP-Gate] Running principles check (xp-gate CLI not installed)" >&2
40
+ npx -y tsx "${REPO_ROOT}/src/principles/index.ts" --files "$FILE_PATH" --format console 2>&1 || true
41
+ else
42
+ # Graceful degradation: log once per session
43
+ echo "[XP-Gate] Quality check skipped: xp-gate not installed. Run 'npm install -g @boyingliu01/xp-gate'" >&2
44
+ fi
45
+
46
+ # Always exit 0 to avoid blocking the Qoder session
47
+ exit 0
@@ -0,0 +1,46 @@
1
+ {
2
+ "hooks": {
3
+ "PreToolUse": [
4
+ {
5
+ "matcher": "Edit|Write|ApplyEdit",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "\"$QODER_PLUGIN_ROOT\"/bin/sprint-flow-guard.sh"
10
+ }
11
+ ]
12
+ }
13
+ ],
14
+ "PostToolUse": [
15
+ {
16
+ "matcher": "Edit|Write",
17
+ "hooks": [
18
+ {
19
+ "type": "command",
20
+ "command": "\"$QODER_PLUGIN_ROOT\"/bin/xp-gate-check \"${TOOL_INPUT_FILE}\""
21
+ }
22
+ ]
23
+ },
24
+ {
25
+ "matcher": ".*",
26
+ "hooks": [
27
+ {
28
+ "type": "command",
29
+ "command": "\"$QODER_PLUGIN_ROOT\"/bin/xp-gate-version-check.sh"
30
+ }
31
+ ]
32
+ }
33
+ ],
34
+ "Stop": [
35
+ {
36
+ "matcher": ".*",
37
+ "hooks": [
38
+ {
39
+ "type": "command",
40
+ "command": "echo \"[XP-Gate] Session complete. Run 'xp-gate init' for full git hook integration.\""
41
+ }
42
+ ]
43
+ }
44
+ ]
45
+ }
46
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xp-gate",
3
- "version": "0.8.8",
3
+ "version": "0.8.17",
4
4
  "displayName": "XP-Gate",
5
5
  "description": "Extreme Programming quality gates + AI workflow skills for Qoder. Includes 10 quality gates (Gate 0-9), Sprint Flow (11 phases), and Delphi multi-expert review (>=90% consensus).",
6
6
  "author": {
@@ -16,5 +16,6 @@
16
16
  "xp",
17
17
  "ai-development"
18
18
  ],
19
- "skills": "./skills/"
19
+ "skills": "./skills/",
20
+ "hooks": "./hooks/hooks.json"
20
21
  }
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-06-16
4
- **Commit:** d3a0242
3
+ **Generated:** 2026-06-17
4
+ **Commit:** d1b11ce
5
5
  **Branch:** main
6
- **Version:** 0.8.17.0
6
+ **Version:** 0.8.18.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, 3 experts from ≥2 providers, domestic models only). Supports design + code-walkthrough modes.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-06-16
4
- **Commit:** d3a0242
3
+ **Generated:** 2026-06-17
4
+ **Commit:** d1b11ce
5
5
  **Branch:** main
6
- **Version:** 0.8.17.0
6
+ **Version:** 0.8.18.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **11-phase** development pipeline: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → USER ACCEPTANCE → FEEDBACK → SHIP → LAND → CLEANUP. Phase 2 default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE in Phase 1: 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
- **Generated:** 2026-06-16
4
- **Commit:** d3a0242
3
+ **Generated:** 2026-06-17
4
+ **Commit:** d1b11ce
5
5
  **Branch:** main
6
- **Version:** 0.8.17.0
6
+ **Version:** 0.8.18.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
- **Generated:** 2026-06-16
4
- **Commit:** d3a0242
3
+ **Generated:** 2026-06-17
4
+ **Commit:** d1b11ce
5
5
  **Branch:** main
6
- **Version:** 0.8.17.0
6
+ **Version:** 0.8.18.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
- **Generated:** 2026-06-16
4
- **Commit:** d3a0242
3
+ **Generated:** 2026-06-17
4
+ **Commit:** d1b11ce
5
5
  **Branch:** main
6
- **Version:** 0.8.17.0
6
+ **Version:** 0.8.18.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, 3 experts from ≥2 providers, domestic models only). Supports design + code-walkthrough modes.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-06-16
4
- **Commit:** d3a0242
3
+ **Generated:** 2026-06-17
4
+ **Commit:** d1b11ce
5
5
  **Branch:** main
6
- **Version:** 0.8.17.0
6
+ **Version:** 0.8.18.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **11-phase** development pipeline: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → USER ACCEPTANCE → FEEDBACK → SHIP → LAND → CLEANUP. Phase 2 default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE in Phase 1: 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
- **Generated:** 2026-06-16
4
- **Commit:** d3a0242
3
+ **Generated:** 2026-06-17
4
+ **Commit:** d1b11ce
5
5
  **Branch:** main
6
- **Version:** 0.8.17.0
6
+ **Version:** 0.8.18.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.