@boyingliu01/xp-gate 0.41.65 → 0.41.66

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.
@@ -158,6 +158,9 @@ const GATE_DISPLAY_NAME = {
158
158
 
159
159
  const BOY_SCOUT_GATE = 6;
160
160
 
161
+ /** Gate 3 is the complexity gate, and the only one that carries a second baseline. */
162
+ const COMPLEXITY_GATE = 3;
163
+
161
164
  /**
162
165
  * Read `.xp-gate/quality-status/<branch>.json` if present.
163
166
  *
@@ -274,9 +277,8 @@ function buildCoverageRows(artifact, ctx) {
274
277
  row.status = STATUS.PASS;
275
278
  return row;
276
279
  }).map((row) => {
277
- // Boy Scout debt does not appear as a gate status at all: Gate 6 reports
278
- // PASS because it "did not increase", while 129 warnings sit in the
279
- // baseline. Reading only statuses shows a clean PASS and hides the debt.
280
+ // Boy Scout debt is invisible in the gate status: Gate 6 reports PASS because
281
+ // it "did not increase" while warnings sit in the baseline.
280
282
  if (row.gate === BOY_SCOUT_GATE && context.boyScout && context.boyScout.warnings > 0) {
281
283
  return {
282
284
  ...row,
@@ -286,7 +288,25 @@ function buildCoverageRows(artifact, ctx) {
286
288
  };
287
289
  }
288
290
  return row;
289
- });
291
+ }).map((row) => applyCognitiveDimension(row, context.cognitive));
292
+ }
293
+
294
+
295
+ /**
296
+ * Fold the cognitive dimension into Gate 3's row (#750).
297
+ *
298
+ * Kept OUT of `buildCoverageRows`'s map for the same reason the Boy Scout
299
+ * dimension is a separate map: the two dimensions are independent questions, and
300
+ * inlining this one pushed that function past the length limit. See
301
+ * `withCognitiveDebt` for the state table.
302
+ *
303
+ * @param {object} row
304
+ * @param {object|undefined} cognitive
305
+ * @returns {object}
306
+ */
307
+ function applyCognitiveDimension(row, cognitive) {
308
+ if (row.gate !== COMPLEXITY_GATE || !cognitive) return row;
309
+ return withCognitiveDebt(row, cognitive);
290
310
  }
291
311
 
292
312
  /**
@@ -414,6 +434,42 @@ function readHookCoverageFloor(repoRoot) {
414
434
  * single total is un-actionable: clearing every real finding barely moves it, and a
415
435
  * number that cannot express progress cannot direct work.
416
436
  */
437
+ /**
438
+ * Fold the cognitive verdict into Gate 3's row (#750).
439
+ *
440
+ * The four states are deliberately kept apart: a language without the nesting
441
+ * penalty is SKIP with its reason, over-baseline is DEBT with the value, a
442
+ * ceiling breach is FAIL, and everything else leaves Gate 3's own verdict alone.
443
+ *
444
+ * @param {object} row
445
+ * @param {{status: string, value?: number|null, baseline?: number, reason?: string, counts?: object}} cog
446
+ * @returns {object}
447
+ */
448
+ function withCognitiveDebt(row, cog) {
449
+ if (cog.status === 'SKIP') {
450
+ // SKIP here means this DIMENSION could not be compared, not that the gate did
451
+ // not run. It is reported as its own state WITH its reason -- collapsing it
452
+ // into the gate's existing status would make "not comparable" invisible, and
453
+ // collapsing it into PASS would be the defect this repo keeps closing.
454
+ return { ...row, status: STATUS.SKIP, reason: cog.reason };
455
+ }
456
+ if (cog.status === 'FAIL') {
457
+ return { ...row, status: STATUS.FAIL, debt: `cognitive complexity ${cog.value}: ${cog.reason}` };
458
+ }
459
+ if (cog.status === 'DEBT') {
460
+ // DEBT is an ESCALATION of a passing gate, never a downgrade: when Gate 3
461
+ // itself was SKIP or FAIL, that verdict stands and the cognitive number is
462
+ // attached as detail. The dimension cannot make a skipped gate look graded.
463
+ return {
464
+ ...row,
465
+ status: row.status === STATUS.PASS ? STATUS.DEBT : row.status,
466
+ debt: cog.debt ? `cognitive complexity: ${cog.debt}` : `cognitive complexity ${cog.value} (baseline ${cog.baseline})`,
467
+ evidence: '.cognitive-baseline.json',
468
+ };
469
+ }
470
+ return row;
471
+ }
472
+
417
473
  function describeBoyScoutDebt(boyScout) {
418
474
  const breakdown = boyScout.breakdown;
419
475
  if (!breakdown) return `${boyScout.warnings} warning(s) / ${boyScout.files} file(s)`;
@@ -2,6 +2,6 @@
2
2
  "verdict": "PASS",
3
3
  "license_type": "MIT",
4
4
  "sha256": "0e7ac423bf2c6e223b7c5b156f8cf72da49d748e56a1641402c31f22ad07dbb5",
5
- "checked_at": "2026-12-02T08:08:57.554Z",
5
+ "checked_at": "2026-12-02T10:35:05.445Z",
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.41.65",
3
+ "version": "0.41.66",
4
4
  "description": "Deterministic quality gates for AI-generated code: 15 gates, Delphi review, sprint flow. Works with Claude Code, OpenCode, Qoder.",
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.41.65",
3
+ "version": "0.41.66",
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.41.65.0
6
+ **Version:** 0.41.66.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.41.65.0
6
+ **Version:** 0.41.66.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.41.65.0
6
+ **Version:** 0.41.66.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.41.65",
3
+ "version": "0.41.66",
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.41.65.0
6
+ **Version:** 0.41.66.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.41.65.0
6
+ **Version:** 0.41.66.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.41.65.0
6
+ **Version:** 0.41.66.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.41.65",
3
+ "version": "0.41.66",
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.41.65.0
6
+ **Version:** 0.41.66.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.41.65.0
6
+ **Version:** 0.41.66.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.41.65.0
6
+ **Version:** 0.41.66.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.41.65",
3
+ "version": "0.41.66",
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.41.65.0
6
+ **Version:** 0.41.66.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.41.65.0
6
+ **Version:** 0.41.66.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.41.65.0
6
+ **Version:** 0.41.66.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.41.65.0
6
+ **Version:** 0.41.66.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.41.65.0
6
+ **Version:** 0.41.66.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.41.65.0
6
+ **Version:** 0.41.66.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.