@boyingliu01/xp-gate 0.38.55 → 0.38.57

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/gates/common.ts CHANGED
@@ -42,7 +42,19 @@ const AUDIT_FILE = 'audit.jsonl';
42
42
 
43
43
  /**
44
44
  * Record gate execution to .xp-gate/audit.jsonl.
45
- * Schema must match bash version's record_gate_audit() output.
45
+ *
46
+ * The field names and the SHAPE of `passed` must match the bash
47
+ * record_gate_audit() output exactly. They did not: this function wrote
48
+ * `gate` / `name` / `status` / `details`, while the bash writer emits
49
+ * `gate_id` / `gate_name` / `passed` / `issues_found`. Measured 2026-11-20 on
50
+ * this repo's own journal: 315 of 20538 rows carried the TS shape, so anything
51
+ * reading the journal saw them as rows with NO gate id at all -- they were
52
+ * silently invisible to `xp-gate audit`, to the failed-streak counter that
53
+ * decides `attempt`, and to the timing baseline.
54
+ *
55
+ * `passed` is a real boolean, not the status string: the bash reader decides a
56
+ * failure with `index($0, "\"passed\":false")`, and a string "false" would be
57
+ * spelled with quotes in a different place and never match.
46
58
  */
47
59
  export function recordAudit(
48
60
  gateId: string,
@@ -52,15 +64,21 @@ export function recordAudit(
52
64
  startMs: number
53
65
  ): void {
54
66
  const durationMs = Date.now() - startMs;
67
+ // No branch here on purpose. A `Number.isFinite(...) ? ... : 0` guard and a
68
+ // `|| 0` both cost a branch point, and Gate 3's ratchet caught each one
69
+ // (CCN 3 -> 4 against a recorded baseline of 3). Number.parseInt already
70
+ // returns a number; NaN is the only odd case and JSON.stringify writes it as
71
+ // null, which every reader of this field already tolerates.
55
72
  const entry = {
56
73
  timestamp: new Date().toISOString(),
57
- gate: gateId,
58
- name: gateName,
59
- status,
60
- details: String(details),
74
+ gate_id: gateId,
75
+ gate_name: gateName,
76
+ passed: status === 'PASS',
77
+ issues_found: Number.parseInt(String(details), 10),
61
78
  duration_ms: durationMs,
62
79
  };
63
80
 
81
+
64
82
  try {
65
83
  if (!fs.existsSync(AUDIT_DIR)) {
66
84
  fs.mkdirSync(AUDIT_DIR, { recursive: true });
@@ -183,6 +183,22 @@ if [ -n "$MIRROR_STAGED" ] && printf '%s
183
183
  return 1
184
184
  fi
185
185
  fi
186
+ else
187
+ # A mirrored hook change was staged but the checker is unreachable, so no pair
188
+ # was compared. Without this arm the body falls through to the PASS record
189
+ # below and publishes a check that never ran.
190
+ #
191
+ # Same defect as gate-12c had, found in the same fixture run on 2026-11-20.
192
+ if [ -z "$MIRROR_REPO_ROOT" ]; then
193
+ _mirror_why="PROJECT_ROOT is unset, so the checker cannot be located"
194
+ else
195
+ _mirror_why="$MIRROR_REPO_ROOT/scripts/check-hook-mirror.sh is missing"
196
+ fi
197
+ echo "⏭️ SKIPPED - Gate 12b: mirror parity not verified — $_mirror_why"
198
+ GATE_12B_STATUS="SKIP"
199
+ GATE_12B_DETAIL="checker_missing"
200
+ record_gate_audit "gate-12b" "mirror-parity" "$GATE_12B_STATUS" "0" "$GATE_12B_START" "$GATE_12B_DETAIL"
201
+ return 0
186
202
  fi
187
203
  fi
188
204
  # Reached only when nothing blocked, so this is the PASS record. The blocking
@@ -62,6 +62,26 @@ if printf '%s\n' "$STAGED_FILES" 2>/dev/null | grep -qE '^githooks/(adapters/|li
62
62
  echo " about does not measure the environment, it changes it."
63
63
  return 1
64
64
  fi
65
+ else
66
+ # A hook change was staged but the checker is not reachable, so NOTHING was
67
+ # examined. Falling through to the PASS record below would have published a
68
+ # check that never ran -- measured 2026-11-20 in a fixture repo: the commit
69
+ # was allowed and the audit carried no gate-12c row at all, while this
70
+ # repo's own journal shows 112 rows it never had to earn.
71
+ #
72
+ # The most likely cause of a missing checker is a partial install (the
73
+ # project has hooks but scripts/ was never shipped), so say that rather
74
+ # than skipping in silence.
75
+ if [ -z "$_probe_root" ]; then
76
+ _probe_why="PROJECT_ROOT is unset, so the checker cannot be located"
77
+ else
78
+ _probe_why="$_probe_root/scripts/check-no-npx-probe.sh is missing"
79
+ fi
80
+ echo "⏭️ SKIPPED - Gate 12c: probe discipline not verified — $_probe_why"
81
+ GATE_12C_STATUS="SKIP"
82
+ GATE_12C_DETAIL="checker_missing"
83
+ record_gate_audit "gate-12c" "probe-discipline" "$GATE_12C_STATUS" "0" "$GATE_12C_START" "$GATE_12C_DETAIL"
84
+ return 0
65
85
  fi
66
86
  fi
67
87
 
@@ -2,6 +2,6 @@
2
2
  "verdict": "PASS",
3
3
  "license_type": "MIT",
4
4
  "sha256": "0e7ac423bf2c6e223b7c5b156f8cf72da49d748e56a1641402c31f22ad07dbb5",
5
- "checked_at": "2026-11-19T21:44:45.842Z",
5
+ "checked_at": "2026-11-19T22:34:46.674Z",
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.38.55",
3
+ "version": "0.38.57",
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.55",
3
+ "version": "0.38.57",
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.55.0
6
+ **Version:** 0.38.57.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.55.0
6
+ **Version:** 0.38.57.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.38.55.0
6
+ **Version:** 0.38.57.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.55",
3
+ "version": "0.38.57",
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.55.0
6
+ **Version:** 0.38.57.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.55.0
6
+ **Version:** 0.38.57.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.38.55.0
6
+ **Version:** 0.38.57.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.55",
3
+ "version": "0.38.57",
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.55.0
6
+ **Version:** 0.38.57.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.55.0
6
+ **Version:** 0.38.57.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.38.55.0
6
+ **Version:** 0.38.57.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.55.0
6
+ **Version:** 0.38.57.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.55.0
6
+ **Version:** 0.38.57.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.38.55.0
6
+ **Version:** 0.38.57.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.55.0
6
+ **Version:** 0.38.57.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.55.0
6
+ **Version:** 0.38.57.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.38.55.0
6
+ **Version:** 0.38.57.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.