@boyingliu01/xp-gate 0.14.31 → 0.15.0

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 (76) hide show
  1. package/adapter-common.sh +0 -0
  2. package/adapters/cpp.sh +0 -0
  3. package/adapters/dart.sh +0 -0
  4. package/adapters/flutter.sh +0 -0
  5. package/adapters/go.sh +0 -0
  6. package/adapters/iac.sh +0 -0
  7. package/adapters/java.sh +33 -4
  8. package/adapters/kotlin.sh +0 -0
  9. package/adapters/objectivec.sh +0 -0
  10. package/adapters/plugins/book299-20132-python/scripts/install-gradle.sh +0 -0
  11. package/adapters/plugins/book299-20132-python/scripts/install-maven.sh +0 -0
  12. package/adapters/plugins/book299-4081-c/scripts/install-gradle.sh +0 -0
  13. package/adapters/plugins/book299-4081-c/scripts/install-maven.sh +0 -0
  14. package/adapters/plugins/book299-4083-javascriptes5/scripts/install-gradle.sh +0 -0
  15. package/adapters/plugins/book299-4083-javascriptes5/scripts/install-maven.sh +0 -0
  16. package/adapters/powershell.sh +0 -0
  17. package/adapters/python.sh +0 -0
  18. package/adapters/shell.sh +0 -0
  19. package/adapters/swift.sh +0 -0
  20. package/adapters/typescript.sh +0 -0
  21. package/bin/xp-gate.js +0 -0
  22. package/gate-3.sh +0 -0
  23. package/gate-4.sh +0 -0
  24. package/gate-7.sh +0 -0
  25. package/gate-8.sh +0 -0
  26. package/gate-9.sh +22 -48
  27. package/hooks/adapter-common.sh +0 -0
  28. package/hooks/gate-3.sh +0 -0
  29. package/hooks/gate-4.sh +0 -0
  30. package/hooks/gate-7.sh +0 -0
  31. package/hooks/gate-8.sh +0 -0
  32. package/hooks/gate-9.sh +22 -48
  33. package/hooks/pre-commit +102 -44
  34. package/hooks/pre-push +1 -33
  35. package/lib/__tests__/doctor.test.js +34 -31
  36. package/lib/__tests__/phase-transition.test.js +272 -272
  37. package/lib/__tests__/sprint-audit.test.js +207 -207
  38. package/lib/detect-deps.js +12 -0
  39. package/lib/phase-transition.js +249 -249
  40. package/lib/sprint-audit.js +235 -235
  41. package/mock-policy/AGENTS.md +3 -3
  42. package/mutation/AGENTS.md +3 -3
  43. package/package.json +1 -1
  44. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  45. package/plugins/claude-code/bin/delphi-review-guard.sh +0 -0
  46. package/plugins/claude-code/bin/xp-gate-check +0 -0
  47. package/plugins/claude-code/skills/delphi-review/AGENTS.md +3 -3
  48. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +3 -3
  49. package/plugins/claude-code/skills/sprint-flow/SKILL.md +1 -0
  50. package/plugins/claude-code/skills/sprint-flow/references/phase-3-build.md +71 -0
  51. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +3 -3
  52. package/plugins/opencode/package.json +1 -1
  53. package/plugins/opencode/skills/delphi-review/AGENTS.md +3 -3
  54. package/plugins/opencode/skills/sprint-flow/AGENTS.md +3 -3
  55. package/plugins/opencode/skills/sprint-flow/SKILL.md +1 -0
  56. package/plugins/opencode/skills/sprint-flow/references/phase-3-build.md +71 -0
  57. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +3 -3
  58. package/plugins/qoder/agents/delphi-architecture.md +48 -48
  59. package/plugins/qoder/agents/delphi-feasibility.md +48 -48
  60. package/plugins/qoder/agents/delphi-technical.md +48 -48
  61. package/plugins/qoder/bin/sprint-flow-guard.sh +0 -0
  62. package/plugins/qoder/bin/xp-gate-check +0 -0
  63. package/plugins/qoder/plugin.json +1 -1
  64. package/plugins/qoder/skills/delphi-review/AGENTS.md +3 -3
  65. package/plugins/qoder/skills/sprint-flow/AGENTS.md +3 -3
  66. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +3 -3
  67. package/principles/AGENTS.md +3 -3
  68. package/principles/adapters/python.ts +39 -6
  69. package/scripts/__tests__/sync-package-content.test.js +36 -17
  70. package/scripts/delphi-external-review.cjs +432 -432
  71. package/scripts/sync-package-content.js +5 -4
  72. package/skills/delphi-review/AGENTS.md +3 -3
  73. package/skills/sprint-flow/AGENTS.md +3 -3
  74. package/skills/sprint-flow/SKILL.md +1 -0
  75. package/skills/sprint-flow/references/phase-3-build.md +71 -0
  76. package/skills/test-specification-alignment/AGENTS.md +3 -3
@@ -299,10 +299,7 @@ describe('doctor', () => {
299
299
  expect(logSpy).toHaveBeenCalledWith(expect.stringContaining('All checks passed'));
300
300
  });
301
301
 
302
- // TODO: Test infrastructure needed after async/execWithTimeout refactor
303
- // This test fails because doctor.js now uses execAsync (util.promisify(exec))
304
- // but the test mocks execSync. Need to update mock strategy to handle both.
305
- it.skip('AC-05: doctor reports all checks passed for healthy global install', async () => {
302
+ it('AC-05: doctor reports all checks passed for healthy global install', async () => {
306
303
  setupGlobalInstall();
307
304
  ensureTuiRegistered();
308
305
  seedVersionCache();
@@ -319,10 +316,7 @@ describe('doctor', () => {
319
316
 
320
317
  // === AC-08: partial uninstall detection ===
321
318
 
322
- // TODO: Test infrastructure needed after async/execWithTimeout refactor
323
- // This test fails because doctor.js now uses execAsync (util.promisify(exec))
324
- // but the test mocks execSync. Need to update mock strategy to handle both.
325
- it.skip('AC-08: doctor detects missing hooks in partial install', async () => {
319
+ it('AC-08: doctor detects missing hooks in partial install', async () => {
326
320
  setupLocalInstall();
327
321
  seedVersionCache();
328
322
  // Remove hooks to simulate partial state
@@ -368,10 +362,7 @@ describe('doctor', () => {
368
362
  );
369
363
  });
370
364
 
371
- // TODO: Test infrastructure needed after async/execWithTimeout refactor
372
- // This test fails because doctor.js now uses execAsync (util.promisify(exec))
373
- // but the test mocks execSync. Need to update mock strategy to handle both.
374
- it.skip('AC-08: doctor detects missing adapters', async () => {
365
+ it('AC-08: doctor detects missing adapters', async () => {
375
366
  setupLocalInstall();
376
367
  seedVersionCache();
377
368
  // Remove adapters dir
@@ -390,12 +381,10 @@ describe('doctor', () => {
390
381
  );
391
382
  });
392
383
 
393
- // TODO: Test infrastructure needed after async/execWithTimeout refactor
394
- // This test fails because doctor.js now uses execAsync (util.promisify(exec))
395
- // but the test mocks execSync. Need to update mock strategy to handle both.
396
- it.skip('AC-08: doctor detects wrong core.hooksPath in global mode', async () => {
384
+ it('AC-08: doctor detects wrong core.hooksPath in global mode', async () => {
397
385
  setupGlobalInstall();
398
386
  seedVersionCache();
387
+ // Custom mock: returns wrong hooksPath to trigger detection
399
388
  cp.execSync = (cmd) => {
400
389
  if (cmd.includes('git config --global core.hooksPath')) {
401
390
  if (cmd.includes('--unset')) {
@@ -417,6 +406,32 @@ describe('doctor', () => {
417
406
  }
418
407
  return '';
419
408
  };
409
+ // Async mock matching execSync above
410
+ const mockAsyncExec = (cmd, opts, callback) => {
411
+ if (typeof opts === 'function') { callback = opts; opts = {}; }
412
+ if (cmd.includes('git config --global core.hooksPath')) {
413
+ callback(null, cmd.includes('--unset') ? '' : '/wrong/path\n', '');
414
+ } else if (cmd === 'git rev-parse --git-dir') {
415
+ callback(null, path.join(tmpProject, '.git') + '\n', '');
416
+ } else if (cmd === 'node --version') {
417
+ callback(null, 'v20.0.0\n', '');
418
+ } else if (cmd === 'git --version') {
419
+ callback(null, 'git version 2.39.0\n', '');
420
+ } else if (cmd === 'bash --version') {
421
+ callback(null, 'GNU bash, version 5.1.16\n', '');
422
+ } else {
423
+ callback(null, '', '');
424
+ }
425
+ };
426
+ mockAsyncExec[util.promisify.custom] = (cmd, options) => {
427
+ return new Promise((resolve, reject) => {
428
+ mockAsyncExec(cmd, options, (err, stdout, stderr) => {
429
+ if (err) { err.stdout = stdout || ''; err.stderr = stderr || ''; reject(err); }
430
+ else { resolve({ stdout, stderr }); }
431
+ });
432
+ });
433
+ };
434
+ cp.exec = mockAsyncExec;
420
435
  const { doctor } = require('../doctor');
421
436
  const result = await doctor([]);
422
437
  expect(result).toBe(1);
@@ -551,11 +566,7 @@ describe('doctor', () => {
551
566
  expect(result).toBe(1);
552
567
  });
553
568
 
554
- // TODO: Test infrastructure needed after async/execWithTimeout refactor
555
- // This test fails because doctor.js now uses execAsync (util.promisify(exec))
556
- // to detect missing environment dependencies, but the test mocks execSync.
557
- // Need to update mock strategy to handle asynchronous environment checks.
558
- it.skip('detects missing environment dependencies', async () => {
569
+ it('detects missing environment dependencies', async () => {
559
570
  setupLocalInstall();
560
571
  seedVersionCache();
561
572
  mockExecFail();
@@ -772,11 +783,7 @@ describe('doctor', () => {
772
783
 
773
784
  // === Issue #186: --fix syncs global hooks from package source ===
774
785
 
775
- // TODO: Test infrastructure needed after async/execWithTimeout refactor
776
- // This test fails because doctor.js now uses execAsync (util.promisify(exec))
777
- // for --fix operations, but the test mocks execSync. Need to update mock
778
- // strategy to handle asynchronous fix operations.
779
- it.skip('--fix syncs global hooks when they are outdated', async () => {
786
+ it('--fix syncs global hooks when they are outdated', async () => {
780
787
  setupGlobalInstall();
781
788
  seedVersionCache();
782
789
  // Write an outdated pre-commit hook (different content)
@@ -961,11 +968,7 @@ describe('doctor', () => {
961
968
  );
962
969
  });
963
970
 
964
- // TODO: Test infrastructure needed after async/execWithTimeout refactor
965
- // This test fails because doctor.js now uses execAsync (util.promisify(exec))
966
- // to check gate scripts, but the test mocks execSync. Need to update mock
967
- // strategy to handle asynchronous gate script validation.
968
- it.skip('gate scripts: FAIL when gate scripts are missing', async () => {
971
+ it('gate scripts: FAIL when gate scripts are missing', async () => {
969
972
  setupLocalInstall();
970
973
  seedVersionCache();
971
974
  // Clear adapters dir and create with only language adapters, no gate scripts