@boyingliu01/xp-gate 0.12.12 → 0.12.14
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/adapters/iac.sh +51 -24
- package/adapters/typescript.sh +5 -2
- package/bin/xp-gate.js +2 -2
- package/build-integrity/__tests__/ccn-refactor-gate10.test.ts +133 -0
- package/build-integrity/gate-10.ts +111 -123
- package/hooks/gate-3.sh +68 -0
- package/hooks/gate-4.sh +80 -0
- package/hooks/gate-7.sh +45 -0
- package/hooks/gate-8.sh +56 -0
- package/hooks/pre-commit +15 -3
- package/lib/init.js +74 -4
- package/mock-policy/AGENTS.md +3 -3
- package/mutation/AGENTS.md +3 -3
- package/package.json +1 -1
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/opencode/package.json +1 -1
- package/plugins/opencode/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/qoder/plugin.json +1 -1
- package/plugins/qoder/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +3 -3
- package/principles/AGENTS.md +3 -3
- package/principles/lint-baseline.ts +35 -40
- package/skills/delphi-review/AGENTS.md +3 -3
- package/skills/sprint-flow/AGENTS.md +3 -3
- package/skills/test-specification-alignment/AGENTS.md +3 -3
package/hooks/gate-4.sh
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# ============================================================================
|
|
2
|
+
# GATE 4: Principles Checker (Clean Code + SOLID)
|
|
3
|
+
# Reuses existing principles checker logic
|
|
4
|
+
# ============================================================================
|
|
5
|
+
|
|
6
|
+
2>&1 echo ""
|
|
7
|
+
2>&1 echo "→ Gate 4: Principles checker (Clean Code + SOLID)..."
|
|
8
|
+
GATE_4_START=$(gate_start_ms)
|
|
9
|
+
|
|
10
|
+
GATE_4_STATUS=""
|
|
11
|
+
|
|
12
|
+
if [ "$PROJECT_LANG" = "documentation-only" ]; then
|
|
13
|
+
echo "⏭️ SKIPPED - Principles check (documentation project)."
|
|
14
|
+
GATE_4_STATUS="SKIP"
|
|
15
|
+
|
|
16
|
+
else
|
|
17
|
+
# Get source files to check against principles
|
|
18
|
+
PRINCIPLES_FILES=$(echo "$CHANGED_FILES" | grep -E '\.(ts|tsx|js|jsx|py|go|java|kt|dart|swift|cpp|c|hpp|h|m|mm)$' || true)
|
|
19
|
+
|
|
20
|
+
if [ -n "$PRINCIPLES_FILES" ]; then
|
|
21
|
+
# Check for principles checker in installed modules first, then project src/
|
|
22
|
+
PRINCIPLES_DIR=""
|
|
23
|
+
if [ -d ".xp-gate/modules/principles" ]; then
|
|
24
|
+
PRINCIPLES_DIR=".xp-gate/modules/principles"
|
|
25
|
+
elif [ -f "src/principles/index.ts" ]; then
|
|
26
|
+
PRINCIPLES_DIR="src/principles"
|
|
27
|
+
elif [ -d "$HOME/.config/xp-gate/modules/principles" ]; then
|
|
28
|
+
PRINCIPLES_DIR="$HOME/.config/xp-gate/modules/principles"
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
if [ -n "$PRINCIPLES_DIR" ]; then
|
|
32
|
+
echo "Checking Clean Code + SOLID principles..."
|
|
33
|
+
|
|
34
|
+
if command -v npx > /dev/null 2>&1; then
|
|
35
|
+
# Run principles checker and store results
|
|
36
|
+
if npx tsx $PRINCIPLES_DIR/index.ts --files $PRINCIPLES_FILES --format json > /tmp/principles-output.json 2>/dev/null; then
|
|
37
|
+
# Check severity levels
|
|
38
|
+
ERROR_COUNT=$(grep -c '"severity":"error"' /tmp/principles-output.json 2>/dev/null || true)
|
|
39
|
+
ERROR_COUNT=${ERROR_COUNT:-0}
|
|
40
|
+
WARNING_COUNT=$(grep -c '"severity":"warning"' /tmp/principles-output.json 2>/dev/null || true)
|
|
41
|
+
WARNING_COUNT=${WARNING_COUNT:-0}
|
|
42
|
+
|
|
43
|
+
if [ "$ERROR_COUNT" -gt 0 ]; then
|
|
44
|
+
echo ""
|
|
45
|
+
echo "❌ BLOCKED - $ERROR_COUNT principle ERROR(S) found"
|
|
46
|
+
echo "Critical violations must be fixed before commit:"
|
|
47
|
+
echo " - error-handling violations"
|
|
48
|
+
echo " - SOLID principle violations"
|
|
49
|
+
echo " - architectural violations"
|
|
50
|
+
npx tsx $PRINCIPLES_DIR/index.ts --files $PRINCIPLES_FILES --format console
|
|
51
|
+
GATE_4_STATUS="FAIL"
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
echo "✅ PASSED - Principles checker (no errors found)."
|
|
56
|
+
GATE_4_STATUS="PASS"
|
|
57
|
+
if [ "$WARNING_COUNT" -gt 0 ]; then
|
|
58
|
+
echo "ℹ️ $WARNING_COUNT warnings found (will be handled by Boy Scout Rule)."
|
|
59
|
+
fi
|
|
60
|
+
else
|
|
61
|
+
echo "⚠️ Warning: Principles checker execution failed"
|
|
62
|
+
echo "⏭️ SKIPPED - Principles check (execution issue)"
|
|
63
|
+
GATE_4_STATUS="SKIP"
|
|
64
|
+
fi
|
|
65
|
+
else
|
|
66
|
+
echo "ℹ️ npx not available - skipping principles check"
|
|
67
|
+
echo "⏭️ SKIPPED - Principles check (no Node.js/npx)"
|
|
68
|
+
GATE_4_STATUS="SKIP"
|
|
69
|
+
fi
|
|
70
|
+
else
|
|
71
|
+
echo "ℹ️ Principles checker not found in project - skipping"
|
|
72
|
+
echo "⏭️ SKIPPED - Principles check (checker not in project)"
|
|
73
|
+
GATE_4_STATUS="SKIP"
|
|
74
|
+
fi
|
|
75
|
+
else
|
|
76
|
+
echo "⏭️ SKIPPED - Principles check (no matching source files changed)"
|
|
77
|
+
GATE_4_STATUS="SKIP"
|
|
78
|
+
fi
|
|
79
|
+
fi
|
|
80
|
+
record_gate_audit "gate-4" "principles" "$GATE_4_STATUS" "${WARNING_COUNT:-0}" "$GATE_4_START"
|
package/hooks/gate-7.sh
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# ============================================================================
|
|
2
|
+
# GATE 7: IaC Security Scanning (Terraform, Kubernetes, Docker)
|
|
3
|
+
# Detects security issues in Infrastructure as Code files
|
|
4
|
+
# Tools: checkov (recommended), hadolint, kube-score, tflint
|
|
5
|
+
# ============================================================================
|
|
6
|
+
|
|
7
|
+
2>&1 echo ""
|
|
8
|
+
2>&1 echo "→ Gate 7: IaC Security Scanning (Terraform, Kubernetes, Docker)..."
|
|
9
|
+
GATE_7_START=$(gate_start_ms)
|
|
10
|
+
|
|
11
|
+
# Check if any IaC files are changed
|
|
12
|
+
IAC_FILES=$(git diff --cached --name-only --diff-filter=ACM 2>/dev/null | grep -E "\.(tf|yaml|yml)$|Dockerfile" || true)
|
|
13
|
+
if [ -z "$IAC_FILES" ]; then
|
|
14
|
+
echo "✅ PASSED - No IaC files detected in changes."
|
|
15
|
+
GATE_7_STATUS="PASS"
|
|
16
|
+
else
|
|
17
|
+
# Run IaC adapter
|
|
18
|
+
if [ -f "githooks/adapters/iac.sh" ]; then
|
|
19
|
+
# shellcheck source=githooks/adapters/iac.sh
|
|
20
|
+
source "githooks/adapters/iac.sh"
|
|
21
|
+
|
|
22
|
+
# Run static analysis for IaC files
|
|
23
|
+
IAC_OUTPUT=$(run_static_analysis "$IAC_FILES" 2>&1)
|
|
24
|
+
IAC_EXIT=$?
|
|
25
|
+
|
|
26
|
+
echo "$IAC_OUTPUT"
|
|
27
|
+
|
|
28
|
+
if [ $IAC_EXIT -eq 0 ]; then
|
|
29
|
+
echo "✅ PASSED - IaC security scan."
|
|
30
|
+
GATE_7_STATUS="PASS"
|
|
31
|
+
else
|
|
32
|
+
echo ""
|
|
33
|
+
echo "❌ BLOCKED - IaC security issues detected"
|
|
34
|
+
echo "Fix the security issues above before committing."
|
|
35
|
+
echo "Tip: Install checkov for comprehensive IaC scanning: pip install checkov"
|
|
36
|
+
GATE_7_STATUS="FAIL"
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
else
|
|
40
|
+
echo "ℹ️ SKIP - IaC adapter not found"
|
|
41
|
+
echo "⏭️ SKIPPED - IaC security (no IaC adapter found)"
|
|
42
|
+
GATE_7_STATUS="SKIP"
|
|
43
|
+
fi
|
|
44
|
+
fi
|
|
45
|
+
record_gate_audit "gate-7" "iac-security" "$GATE_7_STATUS" "0" "$GATE_7_START"
|
package/hooks/gate-8.sh
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# ============================================================================
|
|
2
|
+
# GATE 8: Secret Scanning (gitleaks)
|
|
3
|
+
# Detects secrets (API keys, passwords, tokens) in staged files
|
|
4
|
+
# Tool: gitleaks -- https://github.com/gitleaks/gitleaks
|
|
5
|
+
# ============================================================================
|
|
6
|
+
|
|
7
|
+
2>&1 echo ""
|
|
8
|
+
2>&1 echo "→ Gate 8: Secret scanning (gitleaks)..."
|
|
9
|
+
GATE_8_START=$(gate_start_ms)
|
|
10
|
+
|
|
11
|
+
# Gitleaks availability check
|
|
12
|
+
GITLEAKS_CMD=""
|
|
13
|
+
if command -v gitleaks >/dev/null 2>&1; then
|
|
14
|
+
GITLEAKS_CMD="gitleaks"
|
|
15
|
+
elif [ -f "$HOME/.local/bin/gitleaks" ]; then
|
|
16
|
+
GIBLEAKS_CMD="$HOME/.local/bin/gitleaks"
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
if [ -n "$GITLEAKS_CMD" ]; then
|
|
20
|
+
GITLEAKS_CONFIG=""
|
|
21
|
+
if [ -f ".gitleaks.toml" ]; then
|
|
22
|
+
GITLEAKS_CONFIG="--config=.gitleaks.toml"
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
# Run gitleaks on staged changes only (pre-commit mode for speed)
|
|
26
|
+
GITLEAKS_OUTPUT=$($GITLEAKS_CMD git --pre-commit --redact --no-banner $GITLEAKS_CONFIG --report-format=json --report-path=/tmp/gitleaks-report.json 2>&1)
|
|
27
|
+
GITLEAKS_EXIT=$?
|
|
28
|
+
|
|
29
|
+
if [ "$GITLEAKS_EXIT" -eq 0 ]; then
|
|
30
|
+
echo " ✅ PASSED - No secrets detected."
|
|
31
|
+
GATE_8_STATUS="PASS"
|
|
32
|
+
elif [ "$GITLEAKS_EXIT" -eq 1 ]; then
|
|
33
|
+
# Secrets found — output details
|
|
34
|
+
echo "$GITLEAKS_OUTPUT"
|
|
35
|
+
echo ""
|
|
36
|
+
echo "❌ BLOCKED - Secrets detected in staged files."
|
|
37
|
+
echo ""
|
|
38
|
+
echo "Remediation options:"
|
|
39
|
+
echo " 1. Remove the secret and use environment variables instead"
|
|
40
|
+
echo " 2. Add a false positive to .gitleaks.toml allowlist"
|
|
41
|
+
echo " 3. Use git secret or vault for sensitive data"
|
|
42
|
+
echo ""
|
|
43
|
+
echo "See: https://github.com/gitleaks/gitleaks"
|
|
44
|
+
exit 1
|
|
45
|
+
else
|
|
46
|
+
echo " ⚠️ gitleaks exited with code $GITLEAKS_EXIT - skipping gate"
|
|
47
|
+
echo " ✅ Secret Scanning (SKIP, gitleaks error)"
|
|
48
|
+
GATE_8_STATUS="SKIP"
|
|
49
|
+
fi
|
|
50
|
+
else
|
|
51
|
+
echo " ℹ️ gitleaks not installed — secret scanning unavailable"
|
|
52
|
+
echo " Install: brew install gitleaks (macOS) | winget install gitleaks (Windows) | scripts/install-gitleaks.sh (Linux)"
|
|
53
|
+
echo " ⏭️ SKIPPED - Secret scanning (gitleaks not installed)"
|
|
54
|
+
GATE_8_STATUS="SKIP"
|
|
55
|
+
fi
|
|
56
|
+
record_gate_audit "gate-8" "secret-scanning" "$GATE_8_STATUS" "0" "$GATE_8_START"
|
package/hooks/pre-commit
CHANGED
|
@@ -1555,6 +1555,11 @@ else
|
|
|
1555
1555
|
# Stage 2: UNCONDITIONAL coverage percentage enforcement
|
|
1556
1556
|
# Always attempt to parse coverage from available sources. If percentage
|
|
1557
1557
|
# can be determined and is < 80% → BLOCK. If no data found → warn.
|
|
1558
|
+
#
|
|
1559
|
+
# NOTE: When only a subset of test files were run (smart selection, Issue #286),
|
|
1560
|
+
# coverage data reflects only the tested subset. In that case we warn but don't
|
|
1561
|
+
# block, because the full suite coverage may be ≥80% even though the subset
|
|
1562
|
+
# coverage is lower.
|
|
1558
1563
|
# ============================================================================
|
|
1559
1564
|
COVERAGE_ENFORCED=false
|
|
1560
1565
|
|
|
@@ -1571,10 +1576,17 @@ else
|
|
|
1571
1576
|
" 2>/dev/null)
|
|
1572
1577
|
if [ "$COVERAGE_PERCENT" != "parse_error" ] && [ -n "$COVERAGE_PERCENT" ]; then
|
|
1573
1578
|
if [ "$COVERAGE_PERCENT" -lt 80 ]; then
|
|
1574
|
-
|
|
1575
|
-
|
|
1579
|
+
# If only subset of tests ran, warn instead of block
|
|
1580
|
+
if [ -n "${CHANGED_TEST_FILE_COUNT:-}" ] && [ "${CHANGED_TEST_FILE_COUNT:-0}" -gt 0 ] 2>/dev/null; then
|
|
1581
|
+
echo "⚠️ Partial coverage ${COVERAGE_PERCENT}% (subset test run, not full suite)."
|
|
1582
|
+
echo " Run 'npx vitest run --coverage' for full coverage check."
|
|
1583
|
+
else
|
|
1584
|
+
echo "❌ BLOCKED - TypeScript coverage ${COVERAGE_PERCENT}% below 80% threshold"
|
|
1585
|
+
exit 1
|
|
1586
|
+
fi
|
|
1587
|
+
else
|
|
1588
|
+
echo "TypeScript coverage: ${COVERAGE_PERCENT}% ✅ (≥ 80%)"
|
|
1576
1589
|
fi
|
|
1577
|
-
echo "TypeScript coverage: ${COVERAGE_PERCENT}% ✅ (≥ 80%)"
|
|
1578
1590
|
else
|
|
1579
1591
|
echo "⚠️ Could not parse TypeScript coverage from coverage/coverage-summary.json"
|
|
1580
1592
|
fi
|
package/lib/init.js
CHANGED
|
@@ -279,13 +279,75 @@ function printCliToolStatus() {
|
|
|
279
279
|
console.log(`CLI tools: ${available.length}/${GATE_CLI_TOOLS.length} available`);
|
|
280
280
|
if (missing.length > 0) {
|
|
281
281
|
console.log(` Missing: ${missing.join(', ')}`);
|
|
282
|
-
console.log(' Quality gates using these tools will silently SKIP until they are installed
|
|
283
|
-
console.log(` Run 'xp-gate bootstrap' to install all missing tools, or 'xp-gate doctor' for details.\n`);
|
|
282
|
+
console.log(' Quality gates using these tools will silently SKIP until they are installed.\n');
|
|
284
283
|
} else {
|
|
285
284
|
console.log('');
|
|
286
285
|
}
|
|
287
286
|
}
|
|
288
287
|
|
|
288
|
+
/**
|
|
289
|
+
* Ask the user for confirmation via stdin.
|
|
290
|
+
* @param {string} question - The yes/no question to display
|
|
291
|
+
* @returns {Promise<boolean>} true if user answered yes
|
|
292
|
+
*/
|
|
293
|
+
function askYesNo(question) {
|
|
294
|
+
return new Promise((resolve) => {
|
|
295
|
+
const rl = require('readline').createInterface({
|
|
296
|
+
input: process.stdin,
|
|
297
|
+
output: process.stdout,
|
|
298
|
+
});
|
|
299
|
+
rl.question(`${question} (Y/n) `, (answer) => {
|
|
300
|
+
rl.close();
|
|
301
|
+
const normalized = answer.trim().toLowerCase();
|
|
302
|
+
// Empty (just Enter) or y/yes → yes; anything else → no
|
|
303
|
+
resolve(normalized === '' || normalized === 'y' || normalized === 'yes');
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Prompt the user to auto-install missing CLI quality-gate tools.
|
|
310
|
+
* Called after installation completes. Interactive only when TTY is available.
|
|
311
|
+
* Skips silently when no tools are missing.
|
|
312
|
+
*
|
|
313
|
+
* @param {boolean} autoYes - If true, skip prompt and auto-install
|
|
314
|
+
* @returns {Promise<number>} 0 on success or skipped, 1 on failure
|
|
315
|
+
*/
|
|
316
|
+
async function promptBootstrap(autoYes) {
|
|
317
|
+
const { bootstrap } = require('./bootstrap.js');
|
|
318
|
+
|
|
319
|
+
// Check what's missing without printing a full header
|
|
320
|
+
const missing = [];
|
|
321
|
+
for (const entry of GATE_CLI_TOOLS) {
|
|
322
|
+
const result = checkCliTool(entry.tool);
|
|
323
|
+
if (!result.available) {
|
|
324
|
+
missing.push(entry.tool);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
if (missing.length === 0) return 0;
|
|
329
|
+
|
|
330
|
+
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
331
|
+
console.log(' Quality Gate CLI Tools');
|
|
332
|
+
console.log('');
|
|
333
|
+
console.log(` ${missing.length} tool(s) required by quality gates are not installed:`);
|
|
334
|
+
for (const tool of missing) {
|
|
335
|
+
console.log(` ✗ ${tool}`);
|
|
336
|
+
}
|
|
337
|
+
console.log('');
|
|
338
|
+
console.log(' Without these tools, the corresponding quality gates will');
|
|
339
|
+
console.log(' silently SKIP during git commits — you may miss issues.');
|
|
340
|
+
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
341
|
+
|
|
342
|
+
if (autoYes || (process.stdin.isTTY && await askYesNo('\nInstall missing tools now?'))) {
|
|
343
|
+
console.log('');
|
|
344
|
+
return bootstrap([]);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
console.log('\n Skipped. Run "xp-gate bootstrap" later to install them.');
|
|
348
|
+
return 0;
|
|
349
|
+
}
|
|
350
|
+
|
|
289
351
|
async function init(args) {
|
|
290
352
|
console.log('XP-Gate Initialization');
|
|
291
353
|
console.log('====================\n');
|
|
@@ -384,7 +446,10 @@ async function installLocal(args) {
|
|
|
384
446
|
|
|
385
447
|
console.log('\nInstallation complete!');
|
|
386
448
|
console.log('Run git commit to trigger quality gates');
|
|
387
|
-
|
|
449
|
+
|
|
450
|
+
// Auto-install missing CLI tools (prompt user)
|
|
451
|
+
const autoYes = args.includes('--yes') || args.includes('--auto-install');
|
|
452
|
+
await promptBootstrap(autoYes);
|
|
388
453
|
console.log('━━━ FIRST-CLASS TEST QUALITY ━━━');
|
|
389
454
|
console.log('XP-Gate treats test code as a first-class citizen:');
|
|
390
455
|
console.log(' • TypeScript: test files are type-checked, not excluded from tsconfig.json');
|
|
@@ -455,6 +520,11 @@ async function setupGlobal(args) {
|
|
|
455
520
|
console.log('\nGlobal setup complete!');
|
|
456
521
|
console.log('All git repositories will now use xp-gate quality gates.');
|
|
457
522
|
console.log('Per-project adapters can still override by creating <repo>/githooks/');
|
|
523
|
+
|
|
524
|
+
// Auto-install missing CLI tools (prompt user)
|
|
525
|
+
const autoYes = args.includes('--yes') || args.includes('--auto-install');
|
|
526
|
+
await promptBootstrap(autoYes);
|
|
527
|
+
|
|
458
528
|
console.log('');
|
|
459
529
|
console.log('━━━ FIRST-CLASS TEST QUALITY ━━━');
|
|
460
530
|
console.log('XP-Gate treats test code as a first-class citizen:');
|
|
@@ -556,4 +626,4 @@ function injectKarpathyPrinciples(projectRoot) {
|
|
|
556
626
|
}
|
|
557
627
|
}
|
|
558
628
|
|
|
559
|
-
module.exports = { init };
|
|
629
|
+
module.exports = { init, promptBootstrap };
|
package/mock-policy/AGENTS.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SRC/MOCK-POLICY KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-07
|
|
4
|
+
**Commit:** 2e4e578
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.14.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.
|
package/mutation/AGENTS.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SRC/MUTATION KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-07
|
|
4
|
+
**Commit:** 2e4e578
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.14.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": "xp-gate",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.14",
|
|
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-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-07
|
|
4
|
+
**Commit:** 2e4e578
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.14.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-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-07
|
|
4
|
+
**Commit:** 2e4e578
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.14.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
**11-phase** development pipeline: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → SHIP → LAND → USER ACCEPTANCE → FEEDBACK → 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-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-07
|
|
4
|
+
**Commit:** 2e4e578
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.14.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
|
# SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-07
|
|
4
|
+
**Commit:** 2e4e578
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.14.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-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-07
|
|
4
|
+
**Commit:** 2e4e578
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.14.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
**11-phase** development pipeline: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → SHIP → LAND → USER ACCEPTANCE → FEEDBACK → 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-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-07
|
|
4
|
+
**Commit:** 2e4e578
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.14.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.12.
|
|
3
|
+
"version": "0.12.14",
|
|
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": {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-07
|
|
4
|
+
**Commit:** 2e4e578
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.14.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-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-07
|
|
4
|
+
**Commit:** 2e4e578
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.14.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-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-07
|
|
4
|
+
**Commit:** 2e4e578
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.14.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
|
package/principles/AGENTS.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# PRINCIPLES CHECKER MODULE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-07
|
|
4
|
+
**Commit:** 2e4e578
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.14.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.
|
|
@@ -290,58 +290,47 @@ export interface LintDeltaResult {
|
|
|
290
290
|
* Compare current lint state against a baseline entry for a single file.
|
|
291
291
|
* Used by the pre-commit hook to determine if new lint errors were introduced.
|
|
292
292
|
*/
|
|
293
|
+
function countErrors(entry: BaselineEntry): number {
|
|
294
|
+
return (entry.eslint?.errors || 0) +
|
|
295
|
+
(entry.ruff?.errors || 0) +
|
|
296
|
+
(entry.golangci?.errors || 0) +
|
|
297
|
+
(entry.shellcheck?.errors || 0);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
function deltaPass(reduction: number, message: string): LintDeltaResult {
|
|
301
|
+
return { enforcement: 'PASS', newWarnings: 0, newErrors: 0, reduction, message };
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function deltaBlock(warnings: number, errors: number, message: string): LintDeltaResult {
|
|
305
|
+
return { enforcement: 'BLOCK', newWarnings: warnings, newErrors: errors, reduction: 0, message };
|
|
306
|
+
}
|
|
307
|
+
|
|
293
308
|
export function computeLintDelta(
|
|
294
309
|
baseline: BaselineEntry | null,
|
|
295
310
|
current: BaselineEntry,
|
|
296
311
|
): LintDeltaResult {
|
|
297
312
|
if (!baseline) {
|
|
298
|
-
return
|
|
299
|
-
enforcement: 'PASS',
|
|
300
|
-
newWarnings: 0,
|
|
301
|
-
newErrors: 0,
|
|
302
|
-
reduction: 0,
|
|
303
|
-
message: 'New file — baseline created. No comparison needed.',
|
|
304
|
-
};
|
|
313
|
+
return deltaPass(0, 'New file — baseline created. No comparison needed.');
|
|
305
314
|
}
|
|
306
315
|
|
|
307
316
|
const oldW = baseline.totalWarnings;
|
|
308
|
-
const oldE = (baseline
|
|
309
|
-
(baseline.ruff?.errors || 0) +
|
|
310
|
-
(baseline.golangci?.errors || 0) +
|
|
311
|
-
(baseline.shellcheck?.errors || 0);
|
|
317
|
+
const oldE = countErrors(baseline);
|
|
312
318
|
const newW = current.totalWarnings;
|
|
313
|
-
const newE = (current
|
|
314
|
-
(current.ruff?.errors || 0) +
|
|
315
|
-
(current.golangci?.errors || 0) +
|
|
316
|
-
(current.shellcheck?.errors || 0);
|
|
319
|
+
const newE = countErrors(current);
|
|
317
320
|
|
|
318
321
|
if (newW > oldW) {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
newErrors: newE > oldE ? newE - oldE : 0,
|
|
323
|
-
reduction: 0,
|
|
324
|
-
message: `Lint debt increased by ${newW - oldW} warnings (${oldW} → ${newW}). Fix new errors before committing.`,
|
|
325
|
-
};
|
|
322
|
+
const delta = newW - oldW;
|
|
323
|
+
return deltaBlock(delta, newE > oldE ? newE - oldE : 0,
|
|
324
|
+
`Lint debt increased by ${delta} warnings (${oldW} → ${newW}). Fix new errors before committing.`);
|
|
326
325
|
}
|
|
327
326
|
|
|
328
327
|
if (newW < oldW) {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
newErrors: 0,
|
|
333
|
-
reduction: oldW - newW,
|
|
334
|
-
message: `Lint debt reduced by ${oldW - newW} warnings (${oldW} → ${newW}). Good job!`,
|
|
335
|
-
};
|
|
328
|
+
const delta = oldW - newW;
|
|
329
|
+
return deltaPass(delta,
|
|
330
|
+
`Lint debt reduced by ${delta} warnings (${oldW} → ${newW}). Good job!`);
|
|
336
331
|
}
|
|
337
332
|
|
|
338
|
-
return
|
|
339
|
-
enforcement: 'PASS',
|
|
340
|
-
newWarnings: 0,
|
|
341
|
-
newErrors: 0,
|
|
342
|
-
reduction: 0,
|
|
343
|
-
message: 'No change in lint debt.',
|
|
344
|
-
};
|
|
333
|
+
return deltaPass(0, 'No change in lint debt.');
|
|
345
334
|
}
|
|
346
335
|
|
|
347
336
|
// ── Formatting ────────────────────────────────────────────
|
|
@@ -370,16 +359,22 @@ export function formatBaselineSummary(baseline: Record<string, BaselineEntry>):
|
|
|
370
359
|
if (entry.shellcheck) shellcheckFiles++;
|
|
371
360
|
}
|
|
372
361
|
|
|
362
|
+
const toolLines = [
|
|
363
|
+
[eslintFiles, 'ESLint'],
|
|
364
|
+
[ruffFiles, 'Ruff'],
|
|
365
|
+
[golangciFiles, 'golangci-lint'],
|
|
366
|
+
[shellcheckFiles, 'ShellCheck'],
|
|
367
|
+
] as const;
|
|
368
|
+
|
|
373
369
|
const lines: string[] = [
|
|
374
370
|
`Lint Baseline Summary:`,
|
|
375
371
|
` Files tracked: ${files.length}`,
|
|
376
372
|
` Total warnings: ${totalWarnings}`,
|
|
377
373
|
];
|
|
378
374
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
if (shellcheckFiles > 0) lines.push(` ShellCheck: ${shellcheckFiles} files`);
|
|
375
|
+
for (const [count, name] of toolLines) {
|
|
376
|
+
if (count > 0) lines.push(` ${name}: ${count} files`);
|
|
377
|
+
}
|
|
383
378
|
|
|
384
379
|
return lines.join('\n');
|
|
385
380
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-07
|
|
4
|
+
**Commit:** 2e4e578
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.14.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.
|