@boyingliu01/xp-gate 0.35.9 → 0.35.10

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 (28) hide show
  1. package/lib/__tests__/coverage-threshold.test.js +80 -0
  2. package/lib/coverage-threshold.js +88 -0
  3. package/lib/gate-coverage.js +72 -0
  4. package/lib/mattpocock-license-verdict.json +1 -1
  5. package/mock-policy/AGENTS.md +2 -2
  6. package/mutation/AGENTS.md +2 -2
  7. package/package.json +1 -1
  8. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  9. package/plugins/claude-code/skills/delphi-review/AGENTS.md +2 -2
  10. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +2 -2
  11. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +2 -2
  12. package/plugins/dsh/package.json +1 -1
  13. package/plugins/dsh/skills/delphi-review/AGENTS.md +2 -2
  14. package/plugins/dsh/skills/sprint-flow/AGENTS.md +2 -2
  15. package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +2 -2
  16. package/plugins/opencode/package.json +1 -1
  17. package/plugins/opencode/skills/delphi-review/AGENTS.md +2 -2
  18. package/plugins/opencode/skills/sprint-flow/AGENTS.md +2 -2
  19. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +2 -2
  20. package/plugins/qoder/plugin.json +1 -1
  21. package/plugins/qoder/skills/delphi-review/AGENTS.md +2 -2
  22. package/plugins/qoder/skills/sprint-flow/AGENTS.md +2 -2
  23. package/plugins/qoder/skills/sprint-flow/references/phase-3-build.md +14 -1
  24. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +2 -2
  25. package/principles/AGENTS.md +2 -2
  26. package/skills/delphi-review/AGENTS.md +2 -2
  27. package/skills/sprint-flow/AGENTS.md +2 -2
  28. package/skills/test-specification-alignment/AGENTS.md +2 -2
@@ -0,0 +1,80 @@
1
+ /**
2
+ * @test REQ-605 覆盖率阈值必须只有一个真相源,且"未声明"与"声明为默认"可区分
3
+ * @intent #605 指出阈值散落在 4+ 处。实测这里的问题比"散落"严重:同一个覆盖率
4
+ * 概念有**两条独立的闸门,读同样的数字,却给出不同的门槛**。
5
+ *
6
+ * githooks/pre-commit ${COVERAGE_THRESHOLD:-80} —— 平面 80%
7
+ * vitest.config.ts lines 60 / statements 60
8
+ * functions 81 / branches 79
9
+ *
10
+ * 而 vitest 侧那条的注释自己写着"这些数字是实测下限,不是 80% 目标"。
11
+ * 也就是说两条闸门对"这个仓库的覆盖率该是多少"给出了互相矛盾的答案,
12
+ * 而谁都没错——它们各自是本地合理决定的总和。
13
+ *
14
+ * **"散落"本身不是问题,"同一问题有多个互相矛盾的答案"才是。** 所以这里
15
+ * 不追求"把所有阈值塞进一个文件",而是保证:给定一个阈值概念,解析结果的
16
+ * (值, 来源) 是唯一确定且可解释的。
17
+ *
18
+ * 第二条要求是 #561 的教训:``COVERAGE_THRESHOLD:-80`` 让"没声明"和"声明
19
+ * 为 80"在行为上完全相同,于是文档说 80%、实际生效 60% 时没有任何东西会报警。
20
+ * 来源必须能让调用方区分这两种情况,否则"有效画像"还是一句空话。
21
+ * @covers AC-605-01, AC-605-02, AC-605-03
22
+ */
23
+ 'use strict';
24
+
25
+ const { resolveCoverageThreshold, describeThreshold } = require('../coverage-threshold');
26
+
27
+ describe('覆盖率阈值单一真相源 (#605)', () => {
28
+ it('AC-605-01: 未声明时标注为 implicit,并给出实际生效值', () => {
29
+ const r = resolveCoverageThreshold({});
30
+ expect(r.value).toBe(80);
31
+ expect(r.source).toBe('implicit');
32
+ expect(r.declared).toBe(false);
33
+ });
34
+
35
+ it('AC-605-02: 显式声明为同一个值时必须能与未声明区分', () => {
36
+ // The #561 failure shape: `:-80` made "nobody said" and "someone said 80"
37
+ // identical, so a doc claiming 80% while the live config said 60% raised no
38
+ // alarm anywhere. Same number, different meaning, must stay distinguishable.
39
+ const impl = resolveCoverageThreshold({});
40
+ const expl = resolveCoverageThreshold({ vitest: { lines: 80 } });
41
+ expect(impl.value).toBe(expl.value);
42
+ expect(impl.source).not.toBe(expl.source);
43
+ expect(expl.declared).toBe(true);
44
+ expect(expl.source).toBe('vitest.config.ts');
45
+ });
46
+
47
+ it('AC-605-03: 两条闸门矛盾时必须报告冲突,而不是静默取一个', () => {
48
+ // Measured state: vitest declares lines 60 while pre-commit defaults to 80.
49
+ // Picking either silently is how a repo ends up "enforcing 80%" in a doc and
50
+ // 60% in reality. Reporting the conflict is the only honest answer.
51
+ const r = resolveCoverageThreshold({
52
+ vitest: { lines: 60, statements: 60, functions: 81, branches: 79 },
53
+ preCommit: 80,
54
+ });
55
+ expect(r.conflict).toBeTruthy();
56
+ expect(r.conflict.hook).toBe(80);
57
+ expect(r.conflict.vitest).toBe(60);
58
+ });
59
+
60
+ it('AC-605-03: 两条闸门一致时不算冲突', () => {
61
+ const r = resolveCoverageThreshold({ vitest: { lines: 80 }, preCommit: 80 });
62
+ expect(r.conflict).toBeFalsy();
63
+ });
64
+
65
+ it('AC-605-02: 冲突时两端数值都可单独查询,便于决定改哪边', () => {
66
+ // The live state: `npx vitest run` goes green at 60% locally, then the commit
67
+ // is blocked at 80%. That ordering is the worst one -- it reads as "my change
68
+ // is fine" right up until it is rejected. Reporting both numbers lets the
69
+ // reader see which declaration to move.
70
+ const r = resolveCoverageThreshold({ vitest: { lines: 60 }, preCommit: 80 });
71
+ expect(r.conflict.hook).toBe(80);
72
+ expect(r.conflict.vitest).toBe(60);
73
+ expect(describeThreshold(r)).toContain('CONFLICT');
74
+ });
75
+
76
+ it('AC-605-01: describeThreshold 让来源可被人类核对', () => {
77
+ expect(describeThreshold(resolveCoverageThreshold({}))).toContain('implicit');
78
+ expect(describeThreshold(resolveCoverageThreshold({ vitest: { lines: 75 } }))).toContain('vitest.config.ts');
79
+ });
80
+ });
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Coverage-threshold resolution with an explicit provenance field (#605).
3
+ *
4
+ * #605 asks for a single machine-readable test profile because thresholds are
5
+ * scattered across 4+ files. Measured, the scattering is not the damaging part —
6
+ * the damaging part is that the same concept has two live gates that read the same
7
+ * number and disagree:
8
+ *
9
+ * githooks/pre-commit ${COVERAGE_THRESHOLD:-80} flat 80%
10
+ * vitest.config.ts lines 60 / statements 60
11
+ * functions 81 / branches 79
12
+ *
13
+ * The vitest block documents itself as "the measured floor, not the 80% target",
14
+ * so both are locally reasonable. The repo-wide consequence is that nobody can
15
+ * answer "what coverage does this repo require" without reading two files.
16
+ *
17
+ * This module does not try to collapse every threshold into one file. It makes the
18
+ * answer to that one question unique and explainable: given what each source
19
+ * declares, produce (value, source, declared) and report a conflict rather than
20
+ * silently preferring one side.
21
+ *
22
+ * The `declared` flag exists because of #561: `:-80` made "nobody declared a
23
+ * threshold" and "someone declared 80" indistinguishable, so a doc claiming 80%
24
+ * while the live config said 60% raised no alarm anywhere.
25
+ */
26
+ 'use strict';
27
+
28
+ /** What the hook assumes when no config declares a coverage floor. */
29
+ const IMPLICIT_COVERAGE_FLOOR = 80;
30
+
31
+ /**
32
+ * Resolve the coverage floor from the sources that actually declare one.
33
+ *
34
+ * @param {object} [sources]
35
+ * @param {{lines?: number, statements?: number, functions?: number, branches?: number}} [sources.vitest]
36
+ * @param {number} [sources.preCommit]
37
+ * @returns {{value: number, source: string, declared: boolean, conflict?: {hook: number, vitest: number, detail: string}}}
38
+ */
39
+ function resolveCoverageThreshold(sources) {
40
+ const src = sources || {};
41
+ const vitestLines = src.vitest && typeof src.vitest.lines === 'number' ? src.vitest.lines : null;
42
+ const hookValue = typeof src.preCommit === 'number' ? src.preCommit : null;
43
+
44
+ const conflict = detectConflict(vitestLines, hookValue);
45
+
46
+ if (vitestLines !== null) {
47
+ return {
48
+ value: vitestLines,
49
+ source: 'vitest.config.ts',
50
+ declared: true,
51
+ ...(conflict ? { conflict } : {}),
52
+ };
53
+ }
54
+
55
+ if (hookValue !== null) {
56
+ return { value: hookValue, source: 'pre-commit', declared: true, ...(conflict ? { conflict } : {}) };
57
+ }
58
+
59
+ // Nothing declared: the hook's fallback applies. `declared: false` is the whole
60
+ // point -- a caller must be able to tell "80 because someone chose 80" from
61
+ // "80 because nobody said anything".
62
+ return { value: IMPLICIT_COVERAGE_FLOOR, source: 'implicit', declared: false, ...(conflict ? { conflict } : {}) };
63
+ }
64
+
65
+ /**
66
+ * Two live gates disagreeing about the same number is a defect, not a preference.
67
+ * Reported, never resolved silently.
68
+ */
69
+ function detectConflict(vitestLines, hookValue) {
70
+ if (vitestLines === null || hookValue === null) return null;
71
+ if (vitestLines === hookValue) return null;
72
+ return {
73
+ hook: hookValue,
74
+ vitest: vitestLines,
75
+ detail: `pre-commit enforces ${hookValue}% while vitest.config.ts enforces ${vitestLines}%`,
76
+ };
77
+ }
78
+
79
+ /** One-line, human-checkable rendering of a resolved threshold. */
80
+ function describeThreshold(resolved) {
81
+ if (!resolved) return 'coverage threshold: unknown';
82
+ const parts = [`coverage threshold: ${resolved.value}%`, `source: ${resolved.source}`];
83
+ if (!resolved.declared) parts.push('not declared by any config — this is the hook fallback');
84
+ if (resolved.conflict) parts.push(`CONFLICT — ${resolved.conflict.detail}`);
85
+ return parts.join(' | ');
86
+ }
87
+
88
+ module.exports = { resolveCoverageThreshold, describeThreshold, IMPLICIT_COVERAGE_FLOOR };
@@ -199,6 +199,65 @@ function missingGateReason(spec) {
199
199
  : 'no result recorded — not run in the last report';
200
200
  }
201
201
 
202
+ /**
203
+ * Resolve the coverage floor from both gates and report disagreement (#605).
204
+ *
205
+ * Read from source rather than cached: both files are small, and a stale threshold
206
+ * report is worse than none -- it would assert the gates agree when they need not.
207
+ * Either side absent degrades to "unknown", never to "no conflict".
208
+ */
209
+ function readCoverageThresholdConflict(repoRoot) {
210
+ try {
211
+ const { resolveCoverageThreshold } = require('./coverage-threshold.js');
212
+ const sources = {};
213
+ const vitest = readVitestThresholds(repoRoot);
214
+ if (vitest) sources.vitest = vitest;
215
+ const hookFloor = readHookCoverageFloor(repoRoot);
216
+ if (hookFloor !== null) sources.preCommit = hookFloor;
217
+ const resolved = resolveCoverageThreshold(sources);
218
+ if (!vitest && hookFloor === null) return { ...resolved, sources: 'none readable' };
219
+ return resolved;
220
+ } catch {
221
+ return null;
222
+ }
223
+ }
224
+
225
+ /**
226
+ * `thresholds: { lines: N, ... }` from vitest.config.ts, or null when absent.
227
+ *
228
+ * Comments are stripped first. The file documents the #561 failure by quoting the
229
+ * old bad shape (`thresholds: { global: {...} }`) in prose, and a naive match reads
230
+ * that quote as the live config -- reporting a threshold the repo does not use,
231
+ * which is exactly the class of error #605 exists to stop.
232
+ */
233
+ function readVitestThresholds(repoRoot) {
234
+ try {
235
+ const raw = fs.readFileSync(path.join(repoRoot, 'vitest.config.ts'), 'utf8');
236
+ const code = raw.replace(/\/\*[\s\S]*?\*\//g, '').replace(/^\s*\/\/.*$/gm, '');
237
+ const block = code.match(/thresholds:\s*\{([\s\S]*?)\}/);
238
+ if (!block) return null;
239
+ const out = {};
240
+ for (const m of block[1].matchAll(/(lines|statements|functions|branches)\s*:\s*(\d+)/g)) {
241
+ out[m[1]] = Number(m[2]);
242
+ }
243
+ return Object.keys(out).length > 0 ? out : null;
244
+ } catch {
245
+ return null;
246
+ }
247
+ }
248
+
249
+ /** The flat floor the pre-commit hook applies, or null when it applies none. */
250
+ function readHookCoverageFloor(repoRoot) {
251
+ try {
252
+ const raw = fs.readFileSync(path.join(repoRoot, 'githooks', 'pre-commit'), 'utf8');
253
+ if (!/COVERAGE_THRESHOLD/.test(raw)) return null;
254
+ const m = raw.match(/COVERAGE_THRESHOLD:-?(\d+)/) || raw.match(/COVERAGE_THRESHOLD=(\d+)/);
255
+ return m ? Number(m[1]) : null;
256
+ } catch {
257
+ return null;
258
+ }
259
+ }
260
+
202
261
  /**
203
262
  * Describe Boy Scout debt by how much of it is worth fixing (#638).
204
263
  *
@@ -233,6 +292,16 @@ function renderGateCoverage(rows, opts) {
233
292
  lines.push(' Numbers below describe that commit, NOT the working tree.');
234
293
  }
235
294
 
295
+ if (options.coverageThreshold && options.coverageThreshold.conflict) {
296
+ // #605: two live gates enforcing different numbers for the same thing. Reported
297
+ // here rather than resolved silently -- picking one side is how a repo ends up
298
+ // documented at 80% and enforced at 60%.
299
+ lines.push('');
300
+ lines.push(` ⚠️ COVERAGE THRESHOLD CONFLICT — ${options.coverageThreshold.conflict.detail}`);
301
+ lines.push(' Both gates read the same number and disagree. Fix the declarations,');
302
+ lines.push(' not the reporting.');
303
+ }
304
+
236
305
  lines.push('');
237
306
  lines.push(` ${counts.PASS} PASS / ${counts.DEBT} DEBT / ${counts.SKIP} SKIP / ${counts.FAIL} FAIL`);
238
307
  if (counts.SKIP > 0) {
@@ -352,6 +421,7 @@ function main(argv, deps) {
352
421
  headCommit,
353
422
  boyScout: readBoyScoutDebt(repoRoot),
354
423
  });
424
+ const coverageThreshold = readCoverageThresholdConflict(repoRoot);
355
425
 
356
426
  if (args.includes('--json')) {
357
427
  process.stdout.write(`${JSON.stringify({
@@ -361,6 +431,7 @@ function main(argv, deps) {
361
431
  headCommit: headCommit || null,
362
432
  artifactFile: file,
363
433
  summary: rows.reduce((acc, r) => { acc[r.status] = (acc[r.status] || 0) + 1; return acc; }, {}),
434
+ coverageThreshold,
364
435
  gates: rows,
365
436
  }, null, 2)}\n`);
366
437
  return exitCodeFor(rows, { strict: args.includes('--strict') });
@@ -373,6 +444,7 @@ function main(argv, deps) {
373
444
  stale,
374
445
  headCommit,
375
446
  artifactCommit: artifact ? artifact.commit : null,
447
+ coverageThreshold,
376
448
  })}\n`);
377
449
  return exitCodeFor(rows, { strict: args.includes('--strict') });
378
450
  }
@@ -2,6 +2,6 @@
2
2
  "verdict": "PASS",
3
3
  "license_type": "MIT",
4
4
  "sha256": "0e7ac423bf2c6e223b7c5b156f8cf72da49d748e56a1641402c31f22ad07dbb5",
5
- "checked_at": "2026-10-30T19:32:07.981Z",
5
+ "checked_at": "2026-10-30T19:59:34.778Z",
6
6
  "source": "network"
7
7
  }
@@ -1,9 +1,9 @@
1
1
  # SRC/MOCK-POLICY KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.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
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.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.35.9",
3
+ "version": "0.35.10",
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.35.9",
3
+ "version": "0.35.10",
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": {
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.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.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.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.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.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.35.9",
3
+ "version": "0.35.10",
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",
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.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.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.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.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.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.35.9",
3
+ "version": "0.35.10",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "description": "XP-Gate quality gates + AI workflow skills + Sprint Flow TUI sidebar for OpenCode",
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.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.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.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.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.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.35.9",
3
+ "version": "0.35.10",
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": {
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.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.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.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.
@@ -34,12 +34,25 @@
34
34
  |---|------|------------------------------|----------|
35
35
  | 1 | **Gate 3 CCN** | 单函数圈复杂度 **>10 BLOCK**、**>5 WARN** | 拆函数 / 早返回 / 抽策略表;`xp-gate check 3 <file>` |
36
36
  | 2 | **Gate 6 Boy Scout** | **新文件 0 warning**;修改文件 warning 数不得高于 `.warnings-baseline.json`;**单函数 ≤50 行**;**嵌套 ≤4 层** | 新文件当"零容忍"写;改动前 `xp-gate check 6` 看基线 |
37
- | 3 | **Gate 2 重复代码** | jscpd 相似度 **>5% BLOCK** | 抽公共函数,别复制粘贴;`xp-gate check 2 <dir>` |
37
+ | 3 | **Gate 2 重复代码** | jscpd 报告重复**仅提示,不阻断** | 抽公共函数,别复制粘贴;`xp-gate check 2 <dir>` |
38
38
  | 4 | **Gate 4 Principles** | 14 条 Clean Code/SOLID 规则,任一 error/warning 即拦(按 `.principlesrc`) | `xp-gate check 4 <file>`;避免超长参数表、空 catch、`as any` |
39
39
  | 5 | **Gate 1 Lint** | 适配器 lint 任一 error | 提交前跑一次项目 lint;不要留未用变量/导入 |
40
40
  | 6 | **Gate 5 测试** | 测试全绿 + 覆盖率 ≥80%(新 .ts/.tsx 无测试直接 BLOCK) | 新代码先写测试(TDD);`npx vitest run <file>` |
41
41
  | 7 | **mirror/sync 纪律** | 改 `githooks/` 或 `skills/` 后必须 `node src/npm-package/scripts/sync-package-content.js --fix` 且 `bash scripts/check-hook-mirror.sh` 报 PASS | 忘了同步会在 pre-push 的 mirror 校验被打回 |
42
42
 
43
+ **权威清单用 `xp-gate gate-rules` 现取,不要背上面这张表。** 上表是手抄的,阈值真正定义在
44
+ `.principlesrc`、`jscpd.conf.json` 和 `githooks/pre-commit` 里。`xp-gate gate-rules` 从那些
45
+ 文件生成一份带**出处**的清单:
46
+
47
+ ```bash
48
+ xp-gate gate-rules # markdown 表:规则 / 严重度 / 阈值 / 出处
49
+ xp-gate gate-rules --json # 机器可读
50
+ ```
51
+
52
+ 为什么必须生成而不是手写:这张表原本写"jscpd 相似度 >5% BLOCK",而 Gate 2 实际只是提示、
53
+ 从不阻断——有人会去为一个永不触发的裁定重构代码。**一个说谎的自检清单比没有清单更糟**,
54
+ 它会让人按错误规则写,然后在提交时被告知另一套。改阈值时只需改配置,清单自动跟上。
55
+
43
56
  **一条命令抢先看**:`xp-gate check . --changed --brief` 只跑"本次 diff 会触发的门禁",
44
57
  一屏出 PASS/SKIP/BLOCK,目标 <5 s。把它放在 ralph-loop 每个 REQ 的 step 0,先看红不红,
45
58
  再决定是否继续写——而不是写到一半才被 `git commit` 拦下。
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.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
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.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
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.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.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.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.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** 35b9ec60
4
+ **Commit:** 6c9bcb78
5
5
  **Branch:** main
6
- **Version:** 0.35.9.0
6
+ **Version:** 0.35.10.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.