@boyingliu01/xp-gate 0.38.5 → 0.38.6

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 (43) hide show
  1. package/build-integrity/gate-10.ts +45 -27
  2. package/hooks/gate-entries/gate-10-entry.sh +7 -0
  3. package/hooks/gate-entries/gate-11-entry.sh +7 -0
  4. package/hooks/gate-entries/gate-12-entry.sh +7 -0
  5. package/hooks/gate-entries/gate-12b-entry.sh +7 -0
  6. package/hooks/gate-entries/gate-12c-entry.sh +7 -0
  7. package/hooks/gate-entries/gate-13-entry.sh +7 -0
  8. package/hooks/gate-entries/gate-5-entry.sh +48 -2
  9. package/hooks/gate-entries/gate-6-entry.sh +93 -2
  10. package/hooks/gate-entries/gate-7-entry.sh +7 -0
  11. package/hooks/gate-entries/gate-8-entry.sh +7 -0
  12. package/hooks/gate-entries/gate-9-entry.sh +7 -0
  13. package/lib/mattpocock-license-verdict.json +1 -1
  14. package/mock-policy/AGENTS.md +1 -1
  15. package/mutation/AGENTS.md +1 -1
  16. package/package.json +1 -1
  17. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  18. package/plugins/claude-code/skills/delphi-review/AGENTS.md +1 -1
  19. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +1 -1
  20. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +1 -1
  21. package/plugins/dsh/skills/delphi-review/AGENTS.md +1 -1
  22. package/plugins/dsh/skills/sprint-flow/AGENTS.md +1 -1
  23. package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +1 -1
  24. package/plugins/opencode/package.json +1 -1
  25. package/plugins/opencode/skills/delphi-review/AGENTS.md +1 -1
  26. package/plugins/opencode/skills/sprint-flow/AGENTS.md +1 -1
  27. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +1 -1
  28. package/plugins/qoder/skills/delphi-review/AGENTS.md +1 -1
  29. package/plugins/qoder/skills/sprint-flow/AGENTS.md +1 -1
  30. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +1 -1
  31. package/principles/AGENTS.md +1 -1
  32. package/scripts/generate-mirrors.cjs +85 -28
  33. package/scripts/sync-package-content.js +5 -0
  34. package/skills/delphi-review/AGENTS.md +1 -1
  35. package/skills/sprint-flow/AGENTS.md +1 -1
  36. package/skills/test-specification-alignment/AGENTS.md +1 -1
  37. package/build-integrity/__tests__/ccn-refactor-gate10.test.ts +0 -133
  38. package/build-integrity/__tests__/gate-10.test.ts +0 -340
  39. package/build-integrity/__tests__/import-resolver.test.ts +0 -747
  40. package/build-integrity/__tests__/orchestrator.test.ts +0 -302
  41. package/build-integrity/__tests__/quote-masker.test.ts +0 -177
  42. package/skills/sprint-flow/__tests__/sprint-flow.test.cjs +0 -457
  43. package/skills/sprint-flow/__tests__/verify-sprint-state.test.bats +0 -70
@@ -605,37 +605,55 @@ async function packPrecondition(projectRoot: string): Promise<string | null> {
605
605
  if (!pkgJson.files || !Array.isArray(pkgJson.files)) {
606
606
  return 'package.json has no files field — skipping pack check';
607
607
  }
608
- // #786: a `files` allowlist that names an output directory (`dist`, `lib`,
609
- // `build`) describes an artifact a BUILD produces, not something already in the
610
- // tree. With `noEmit` in tsconfig -- a normal choice when a bundler or a
611
- // separate build step owns the output -- nothing writes that directory, so
612
- // `npm pack` ships only package.json, `inspectPackedFiles` reports "only
613
- // package.json included", and the gate BLOCKS forever with no way out.
614
- //
615
- // Absent artifacts are therefore a SKIP with the reason spelled out, not a
616
- // FAIL. This gate's subject is build integrity, and it cannot judge a package
617
- // whose inputs were never built. The message also has to name the remedy --
618
- // "build first" is the whole fix, and the old text never said it.
619
- const declaredEntries = (pkgJson.files as unknown[]).filter(
608
+ return missingDeclaredArtifacts(projectRoot, pkgJson.files);
609
+ }
610
+
611
+ /**
612
+ * #786: a `files` allowlist that names an output directory (`dist`, `lib`,
613
+ * `build`) describes an artifact a BUILD produces, not something already in the
614
+ * tree. With `noEmit` in tsconfig -- a normal choice when a bundler or a separate
615
+ * build step owns the output -- nothing writes that directory, so `npm pack`
616
+ * ships only package.json, `inspectPackedFiles` reports "only package.json
617
+ * included", and the gate BLOCKS forever with no way out.
618
+ *
619
+ * Absent artifacts are therefore a SKIP with the reason spelled out, not a FAIL:
620
+ * this gate's subject is build integrity, and it cannot judge a package whose
621
+ * inputs were never built. The message also has to name the remedy -- "build
622
+ * first" is the whole fix, and the old text never said it.
623
+ *
624
+ * Extracted from packPrecondition rather than inlined: the inline version took
625
+ * that function to CCN=11 against a recorded 5 (block threshold 10), which Gate 3
626
+ * caught on CI. A ratchet that is satisfied by pushing one function over the line
627
+ * is not satisfied.
628
+ */
629
+ async function missingDeclaredArtifacts(
630
+ projectRoot: string,
631
+ files: unknown[]
632
+ ): Promise<string | null> {
633
+ const declaredEntries = files.filter(
620
634
  (entry): entry is string =>
621
635
  typeof entry === 'string' && entry !== '' && !entry.startsWith('!') && !entry.includes('*')
622
636
  );
623
- if (declaredEntries.length > 0) {
624
- const presence = await Promise.all(
625
- declaredEntries.map(async (entry) => {
626
- try {
627
- await fs.access(path.join(projectRoot, entry));
628
- return true;
629
- } catch {
630
- return false;
631
- }
632
- })
633
- );
634
- if (!presence.some(Boolean)) {
635
- return `package.json files entries (${declaredEntries.join(', ')}) do not exist on disk — run the build that produces them, then re-run`;
636
- }
637
+ if (declaredEntries.length === 0) {
638
+ return null;
639
+ }
640
+ const presence = await Promise.all(
641
+ declaredEntries.map((entry) => pathExists(path.join(projectRoot, entry)))
642
+ );
643
+ if (presence.some(Boolean)) {
644
+ return null;
645
+ }
646
+ return `package.json files entries (${declaredEntries.join(', ')}) do not exist on disk — run the build that produces them, then re-run`;
647
+ }
648
+
649
+ /** Existence probe that reports absence instead of throwing. */
650
+ async function pathExists(target: string): Promise<boolean> {
651
+ try {
652
+ await fs.access(target);
653
+ return true;
654
+ } catch {
655
+ return false;
637
656
  }
638
- return null;
639
657
  }
640
658
 
641
659
  interface PackFailure {
@@ -27,6 +27,13 @@
27
27
  # stop: see scripts/wrap-gate-entries.cjs for why the two are equivalent
28
28
  # here, and why sub-shell exits are deliberately left as `exit`.
29
29
  gate_10_run() {
30
+ if ! gate_enabled 10; then
31
+ echo "⏭️ SKIPPED - Gate 10: SAST security (not selected by XP_GATE_ONLY_GATE)"
32
+ GATE_10_STATUS="SKIP"
33
+ GATE_10_DETAIL="not_selected"
34
+ return 0
35
+ fi
36
+
30
37
  if any_changed_files_match "\.(ts|tsx|js|jsx|py|go|java|kt|cpp|c|swift|m|dart|sh|ps1|psm1|cs|csx|fs|vb|rs|php|rb|lua|pl)$"; then
31
38
  if [ -f "$GATE_DIR/gate-10.sh" ]; then
32
39
  source "$GATE_DIR/gate-10.sh"
@@ -26,6 +26,13 @@
26
26
  # stop: see scripts/wrap-gate-entries.cjs for why the two are equivalent
27
27
  # here, and why sub-shell exits are deliberately left as `exit`.
28
28
  gate_11_run() {
29
+ if ! gate_enabled 11; then
30
+ echo "⏭️ SKIPPED - Gate 11: Sprint flow (not selected by XP_GATE_ONLY_GATE)"
31
+ GATE_11_STATUS="SKIP"
32
+ GATE_11_DETAIL="not_selected"
33
+ return 0
34
+ fi
35
+
29
36
  GATE_11_START=$(gate_start_ms)
30
37
  GATE_11_STATUS="PASS"
31
38
 
@@ -27,6 +27,13 @@
27
27
  # stop: see scripts/wrap-gate-entries.cjs for why the two are equivalent
28
28
  # here, and why sub-shell exits are deliberately left as `exit`.
29
29
  gate_12_run() {
30
+ if ! gate_enabled 12; then
31
+ echo "⏭️ SKIPPED - Gate 12: File hygiene (not selected by XP_GATE_ONLY_GATE)"
32
+ GATE_12_STATUS="SKIP"
33
+ GATE_12_DETAIL="not_selected"
34
+ return 0
35
+ fi
36
+
30
37
  if [ -f "$GATE_DIR/gate-12-file-hygiene.sh" ]; then
31
38
  source "$GATE_DIR/gate-12-file-hygiene.sh"
32
39
  elif [ -f "$(git rev-parse --show-toplevel 2>/dev/null)/githooks/gate-12-file-hygiene.sh" ]; then
@@ -34,6 +34,13 @@
34
34
  # stop: see scripts/wrap-gate-entries.cjs for why the two are equivalent
35
35
  # here, and why sub-shell exits are deliberately left as `exit`.
36
36
  gate_12b_run() {
37
+ if ! gate_enabled 12b; then
38
+ echo "⏭️ SKIPPED - Gate 12b: Vendor exclusion (not selected by XP_GATE_ONLY_GATE)"
39
+ GATE_12B_STATUS="SKIP"
40
+ GATE_12B_DETAIL="not_selected"
41
+ return 0
42
+ fi
43
+
37
44
  MIRROR_STAGED=$(git diff --cached --name-only --diff-filter=ACMR 2>/dev/null || true)
38
45
  # `src/npm-package/` is in this filter because a mirror-only edit is the
39
46
  # dangerous direction, not the harmless one. Keying off the canonical paths
@@ -36,6 +36,13 @@ gate_12c_run() {
36
36
  # Scoped to commits that touch hook sources: the rule can only be broken by
37
37
  # editing one, and scanning 51 files on every docs-only commit is exactly the
38
38
  # fixed cost the input short-circuit convention exists to avoid.
39
+ if ! gate_enabled 12c; then
40
+ echo "⏭️ SKIPPED - Gate 12c: Worktree hygiene (not selected by XP_GATE_ONLY_GATE)"
41
+ GATE_12C_STATUS="SKIP"
42
+ GATE_12C_DETAIL="not_selected"
43
+ return 0
44
+ fi
45
+
39
46
  if printf '%s\n' "$STAGED_FILES" 2>/dev/null | grep -qE '^githooks/(adapters/|lib/|adapter-common\.sh|pre-commit|pre-push|post-commit|post-merge)'; then
40
47
  _probe_root="${PROJECT_ROOT:-}"
41
48
  if [ -n "$_probe_root" ] && [ -f "$_probe_root/scripts/check-no-npx-probe.sh" ]; then
@@ -509,6 +509,13 @@ ENDJSON
509
509
  }
510
510
 
511
511
  gate_13_run() {
512
+ if ! gate_enabled 13; then
513
+ echo "⏭️ SKIPPED - Gate 13: Compiler strictness (not selected by XP_GATE_ONLY_GATE)"
514
+ GATE_13_STATUS="SKIP"
515
+ GATE_13_DETAIL="not_selected"
516
+ return 0
517
+ fi
518
+
512
519
  GATE_13_STATUS="SKIP"
513
520
  if [ "${XP_GATE_DISABLE_13:-}" = "1" ]; then
514
521
  echo "⏭️ SKIPPED - Gate 13: Compiler Strictness (XP_GATE_DISABLE_13=1)"
@@ -895,7 +895,25 @@ else
895
895
  # staged 42% never reached the threshold. The skip now also requires that no
896
896
  # coverage evidence is present.
897
897
  GATE_5_COVERAGE_EVIDENCE=false
898
- if [ -f "coverage/coverage-summary.json" ] || [ -f "coverage/coverage-final.json" ]; then
898
+ # #821: evidence must come FROM THE COMMIT, not from the working tree.
899
+ #
900
+ # This used to be a bare `-f` on the two report paths, so ANY leftover report
901
+ # counted -- e.g. coverage/coverage-summary.json left behind by an earlier local
902
+ # run over a different tree. Measured 2026-11-16 in this repo: a commit staging
903
+ # one test file under the bundled mirror was blocked with
904
+ # ❌ BLOCKED - TypeScript coverage 2% below 78% threshold
905
+ # and the identical commit passed once the leftover coverage/ directory was
906
+ # removed. The percentage described neither this commit nor this tree, and the
907
+ # working tree additionally carried a second workstream's uncommitted source.
908
+ #
909
+ # A report is evidence for this commit when the commit carries it. This keeps
910
+ # #601 intact -- that issue is about a STAGED report being ignored, and its
911
+ # fixtures stage the artefact with `git add -f` -- while refusing to answer
912
+ # "how well is this change tested" with a stale measurement of something else.
913
+ # `git cat-file -e :<path>` asks the INDEX (the commit being built) for the
914
+ # blob; a plain `-f` asks the directory.
915
+ if git cat-file -e ":coverage/coverage-summary.json" 2>/dev/null \
916
+ || git cat-file -e ":coverage/coverage-final.json" 2>/dev/null; then
899
917
  GATE_5_COVERAGE_EVIDENCE=true
900
918
  fi
901
919
  if [ "${TESTS_SKIPPED:-false}" = "true" ] && [ "${TESTS_RAN_ANY:-false}" != "true" ] \
@@ -1268,7 +1286,35 @@ else
1268
1286
  # #570: the report file is absent, so nothing was measured. Warning and
1269
1287
  # continuing made "delete coverage/coverage-summary.json" an effective way
1270
1288
  # to switch this gate off.
1271
- if [ "${PARTIAL_TEST_RUN:-false}" = "true" ]; then
1289
+ #
1290
+ # #823: but "absent" has two causes and only one of them is a problem.
1291
+ # Measured 2026-11-16 committing a comment-only fix to a gate script --
1292
+ # Gate 5 printed, in this order,
1293
+ # ✅ PASSED - No test or source files changed, skipping test run.
1294
+ # ℹ️ No TypeScript tests were selected — no TS coverage to evaluate.
1295
+ # ❌ BLOCKED - coverage/coverage-summary.json not found.
1296
+ # The gate established twice that it had nothing to measure, then demanded
1297
+ # a measurement. PARTIAL_TEST_RUN did not cover it because that flag means
1298
+ # "some tests ran"; here NO test was selected, so a commit touching nothing
1299
+ # but shell reached the strict arm of #570 and could only land with a Gate 0
1300
+ # version bump or a fabricated report.
1301
+ #
1302
+ # #570 stays intact: tests SELECTED but producing no report is still the
1303
+ # off-switch this must block. Only "nothing was selected" is exempt.
1304
+ #
1305
+ # The exemption keys on TESTS_SKIPPED ALONE, deliberately. The obvious
1306
+ # pairing -- `TESTS_SKIPPED && !TESTS_RAN_ANY` -- does not work, and the
1307
+ # probe that proved it is worth recording: on the reproduction above the
1308
+ # two flags read `skipped=true ran=true` at the same moment. TESTS_RAN_ANY
1309
+ # is set by the IaC arm when its run_tests prints "IaC tests not configured"
1310
+ # and returns 0 (gate-5-entry.sh:850-853, #760), because a runner DID
1311
+ # execute -- it just had nothing to test. So `!TESTS_RAN_ANY` is false for
1312
+ # any repo declaring iac, which is every repo using this gate the way this
1313
+ # one does. TESTS_SKIPPED is the precise signal: it is set only where the
1314
+ # test section concluded there was nothing to run.
1315
+ if [ "${TESTS_SKIPPED:-false}" = "true" ]; then
1316
+ echo "ℹ️ No tests were selected, so no coverage report was expected — skipping the coverage floor."
1317
+ elif [ "${PARTIAL_TEST_RUN:-false}" = "true" ]; then
1272
1318
  echo "⚠️ coverage/coverage-summary.json not found (subset test run) — not blocking."
1273
1319
  else
1274
1320
  echo "❌ BLOCKED - coverage/coverage-summary.json not found."
@@ -24,6 +24,13 @@
24
24
  # stop: see scripts/wrap-gate-entries.cjs for why the two are equivalent
25
25
  # here, and why sub-shell exits are deliberately left as `exit`.
26
26
  gate_6_run() {
27
+ if ! gate_enabled 6; then
28
+ echo "⏭️ SKIPPED - Gate 6: Architecture & tech debt (not selected by XP_GATE_ONLY_GATE)"
29
+ GATE_6_STATUS="SKIP"
30
+ GATE_6_DETAIL="not_selected"
31
+ return 0
32
+ fi
33
+
27
34
  2>&1 echo ""
28
35
  2>&1 echo "→ Gate 6: Architecture & tech debt..."
29
36
  GATE_6_START=$(gate_start_ms)
@@ -50,6 +57,50 @@ else
50
57
  fi
51
58
  )
52
59
 
60
+ # ---------------------------------------------------------------------------
61
+ # Which tree does the verdict describe? The COMMIT, not the directory.
62
+ #
63
+ # `archlint diff <baseline>` makes its CURRENT argument default to "analyze the
64
+ # current working tree", so the pass/fail verdict included every uncommitted
65
+ # file in the checkout -- including files belonging to other work in progress.
66
+ # Measured 2026-11-11 in this repo: a worktree carrying 7 unstaged files put 217
67
+ # regressions / 122 files into the verdict, none of which the commit under
68
+ # review had touched. Two things then went wrong at once:
69
+ #
70
+ # 1. the block was attributed to the wrong author (a commit is blocked by
71
+ # someone else's editor buffer), and
72
+ # 2. the block message advised `archlint snapshot -o .architecture-baseline.json`
73
+ # -- correct for a genuine regression, but here it froze ANOTHER PERSON'S
74
+ # UNCOMMITTED WORK into the baseline as the accepted norm. Following the
75
+ # tool's own advice made the repo worse.
76
+ #
77
+ # A commit contains the index, so the index is the correct input. `git
78
+ # write-tree` + `git commit-tree` cheaply produce a commit object holding
79
+ # exactly the staged content; archlint accepts a git ref and analyzes a
80
+ # temporary worktree of it. The object is unreachable (no ref, no reflog entry)
81
+ # and is reclaimed by gc -- it never appears in the history being committed.
82
+ #
83
+ # Failure handling is deliberate: if the snapshot cannot be built, the gate
84
+ # falls back to the old worktree scan and SAYS SO, rather than skipping. A
85
+ # check that quietly stops checking is the #554/#562 lie; a wider-than-intended
86
+ # scope at least still checks something.
87
+ # ---------------------------------------------------------------------------
88
+ GATE_6_STAGED_SNAPSHOT=""
89
+ GATE_6_STAGED_SNAPSHOT_AVAILABLE=0
90
+
91
+ _gate6_snapshot() {
92
+ local _tree _commit
93
+ _tree=$(git -C "$PROJECT_ROOT" write-tree 2>/dev/null) || return 1
94
+ [ -n "$_tree" ] || return 1
95
+ # No parent: the content is all archlint reads, and a parentless commit
96
+ # cannot be confused with a real one if the object ever surfaces.
97
+ _commit=$(git -C "$PROJECT_ROOT" commit-tree "$_tree" -m "xp-gate: staged snapshot for Gate 6" 2>/dev/null) || return 1
98
+ [ -n "$_commit" ] || return 1
99
+ GATE_6_STAGED_SNAPSHOT="$_commit"
100
+ GATE_6_STAGED_SNAPSHOT_AVAILABLE=1
101
+ return 0
102
+ }
103
+
53
104
  # Check if architecture config exists (use $PROJECT_ROOT — hook may have cd'd to a subdir via ARCH-03)
54
105
  if [ -f "$PROJECT_ROOT/architecture.yaml" ] || [ -f "$PROJECT_ROOT/.architecturerc" ] || [ -f "$PROJECT_ROOT/.archlint.yaml" ]; then
55
106
  # #686: an `architecture.yaml` is NOT evidence that layer boundaries are
@@ -189,8 +240,48 @@ else
189
240
  ARCHLINT_OUTPUT=""
190
241
  ARCHLINT_EXIT=0
191
242
  elif [ -f "$PROJECT_ROOT/.architecture-baseline.json" ]; then
192
- ARCHLINT_OUTPUT=$(run_archlint diff .architecture-baseline.json --fail-on high 2>&1)
193
- ARCHLINT_EXIT=$?
243
+ # Scope the verdict to the COMMIT under review (see _gate6_snapshot).
244
+ if _gate6_snapshot; then
245
+ echo " 🔍 Scope: staged content (commit snapshot $(printf '%s' "$GATE_6_STAGED_SNAPSHOT" | cut -c1-8))"
246
+ ARCHLINT_OUTPUT=$(run_archlint diff .architecture-baseline.json "$GATE_6_STAGED_SNAPSHOT" --fail-on high 2>&1)
247
+ ARCHLINT_EXIT=$?
248
+ # #822: a snapshot that CANNOT BE ANALYSED is not a verdict.
249
+ #
250
+ # archlint analyzes a ref by creating a temporary worktree, and that
251
+ # step fails on its own: measured 2026-11-16, mid-commit, with other
252
+ # git processes holding the repo --
253
+ # error: Git command error: Failed to create worktree:
254
+ # fatal: Unable to create 'C:/Users/think/AppData/Local/Tem...'
255
+ # The exit code is non-zero for that, so the verdict branch below
256
+ # read it as "architecture violations detected" and printed advice to
257
+ # re-snapshot the baseline -- i.e. the tool never ran, and the gate
258
+ # blamed the author's code for it.
259
+ #
260
+ # Degrade to the worktree scan, exactly like a snapshot that could not
261
+ # be BUILT, and say so. Falling through to "violations" would be a
262
+ # false accusation; skipping silently would be a false pass.
263
+ #
264
+ # Matched on the MESSAGE, not on the exit code: measured 2026-11-16,
265
+ # archlint exits **1** for "Cannot resolve '<sha>'" and for
266
+ # "Failed to create worktree" alike, which is the same code it uses
267
+ # for real violations. There is no exit-code channel to tell "the
268
+ # analysis never ran" from "the analysis found problems", so the
269
+ # error text is the only usable signal. The project's exit>=2
270
+ # convention would be the right shape here, but archlint does not
271
+ # honour it and this gate cannot change that.
272
+ if printf '%s' "$ARCHLINT_OUTPUT" | grep -qE 'Failed to create worktree|Cannot resolve|Git command error'; then
273
+ echo " ⚠️ [WARN:SNAPSHOT_UNREADABLE] archlint could not materialise the snapshot worktree — retrying against the working tree."
274
+ ARCHLINT_OUTPUT=$(run_archlint diff .architecture-baseline.json --fail-on high 2>&1)
275
+ ARCHLINT_EXIT=$?
276
+ fi
277
+ else
278
+ # Snapshot unavailable (e.g. no git, or a read-only index). Fall back
279
+ # to the worktree scan rather than skipping: a wider scope still
280
+ # checks something, whereas a silent skip checks nothing.
281
+ echo " ⚠️ [WARN:SCOPED_TO_WORKTREE] could not snapshot the index — the verdict below covers the working tree, including uncommitted files that are NOT part of this commit."
282
+ ARCHLINT_OUTPUT=$(run_archlint diff .architecture-baseline.json --fail-on high 2>&1)
283
+ ARCHLINT_EXIT=$?
284
+ fi
194
285
  else
195
286
  ARCHLINT_OUTPUT=$(run_archlint scan . -f table --quiet 2>&1)
196
287
  ARCHLINT_EXIT=$?
@@ -26,6 +26,13 @@
26
26
  # stop: see scripts/wrap-gate-entries.cjs for why the two are equivalent
27
27
  # here, and why sub-shell exits are deliberately left as `exit`.
28
28
  gate_7_run() {
29
+ if ! gate_enabled 7; then
30
+ echo "⏭️ SKIPPED - Gate 7: IaC security (not selected by XP_GATE_ONLY_GATE)"
31
+ GATE_7_STATUS="SKIP"
32
+ GATE_7_DETAIL="not_selected"
33
+ return 0
34
+ fi
35
+
29
36
  if any_changed_files_match "\.tf$" "\.tfvars$" "Dockerfile" "\.kube/" "\.ya?ml$"; then
30
37
  source "$GATE_DIR/gate-7.sh"
31
38
  else
@@ -24,6 +24,13 @@
24
24
  # stop: see scripts/wrap-gate-entries.cjs for why the two are equivalent
25
25
  # here, and why sub-shell exits are deliberately left as `exit`.
26
26
  gate_8_run() {
27
+ if ! gate_enabled 8; then
28
+ echo "⏭️ SKIPPED - Gate 8: Secret scanning (not selected by XP_GATE_ONLY_GATE)"
29
+ GATE_8_STATUS="SKIP"
30
+ GATE_8_DETAIL="not_selected"
31
+ return 0
32
+ fi
33
+
27
34
  source "$GATE_DIR/gate-8.sh"
28
35
  return 0
29
36
  }
@@ -30,6 +30,13 @@ gate_9_run() {
30
30
  # project" -- which is exactly the silent-no-coverage path this sprint
31
31
  # removes. Verdict codes (mirror of the java.sh G1 contract):
32
32
  # 0=PASS 2=BLOCK(compile failed) 3=SKIP+WARN(reason printed)
33
+ if ! gate_enabled 9; then
34
+ echo "⏭️ SKIPPED - Gate 9: Build integrity (not selected by XP_GATE_ONLY_GATE)"
35
+ GATE_9_STATUS="SKIP"
36
+ GATE_9_DETAIL="not_selected"
37
+ return 0
38
+ fi
39
+
33
40
  resolve_build_integrity_timeout() {
34
41
  local file=".xp-gate/build-integrity-timeout" val=""
35
42
  if [ -f "$file" ]; then
@@ -2,6 +2,6 @@
2
2
  "verdict": "PASS",
3
3
  "license_type": "MIT",
4
4
  "sha256": "0e7ac423bf2c6e223b7c5b156f8cf72da49d748e56a1641402c31f22ad07dbb5",
5
- "checked_at": "2026-11-16T05:36:31.054Z",
5
+ "checked_at": "2026-11-16T11:06:36.263Z",
6
6
  "source": "network"
7
7
  }
@@ -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.5.0
6
+ **Version:** 0.38.6.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.
@@ -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.5.0
6
+ **Version:** 0.38.6.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.38.5",
3
+ "version": "0.38.6",
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.5",
3
+ "version": "0.38.6",
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.5.0
6
+ **Version:** 0.38.6.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.5.0
6
+ **Version:** 0.38.6.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.
@@ -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.5.0
6
+ **Version:** 0.38.6.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.5.0
6
+ **Version:** 0.38.6.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.5.0
6
+ **Version:** 0.38.6.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.
@@ -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.5.0
6
+ **Version:** 0.38.6.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.5",
3
+ "version": "0.38.6",
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.5.0
6
+ **Version:** 0.38.6.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.5.0
6
+ **Version:** 0.38.6.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.
@@ -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.5.0
6
+ **Version:** 0.38.6.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.5.0
6
+ **Version:** 0.38.6.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.5.0
6
+ **Version:** 0.38.6.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.
@@ -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.5.0
6
+ **Version:** 0.38.6.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.5.0
6
+ **Version:** 0.38.6.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.