@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
@@ -377,34 +377,35 @@ describe('sync-package-content subprocess invocation', () => {
377
377
  'to-issues',
378
378
  ];
379
379
 
380
- function cleanupPackageDirectories() {
381
- // Clean up if they exist
382
- ['skills', 'plugins', 'adapters'].forEach(dir => {
383
- const fullPath = path.join(PKG_ROOT, dir);
384
- if (fs.existsSync(fullPath)) {
385
- fs.rmSync(fullPath, { recursive: true, force: true });
386
- }
380
+ /**
381
+ * afterAll: Ensure package directories are restored after all tests.
382
+ * Prevents race condition where other test files (e.g. doctor.test.js)
383
+ * read from src/npm-package/adapters/ while sync tests temporarily delete it.
384
+ */
385
+ afterAll(() => {
386
+ const syncScript = path.join(WORKTREE_PATH, 'src', 'npm-package', 'scripts', 'sync-package-content.js');
387
+ spawnSync(process.execPath, [syncScript], {
388
+ cwd: WORKTREE_PATH,
389
+ stdio: 'pipe',
387
390
  });
388
- }
389
-
390
- function restorePackageDirectories() {
391
- // Restore from backup if they existed before test
392
- // Since we just tested them being empty, just ensure they exist after sync
393
- }
391
+ });
394
392
 
395
393
  it('sync-package-content.js copies skills from repo to package', () => {
396
394
  const syncScript = path.join(WORKTREE_PATH, 'src', 'npm-package', 'scripts', 'sync-package-content.js');
397
395
  const nodeExe = process.execPath;
398
396
 
399
- // Ensure skills directory is empty first
400
- cleanupPackageDirectories();
401
-
402
- // Run sync as subprocess
397
+ // Run sync as subprocess (overwrites existing files — no need to delete first)
403
398
  const result = spawnSync(nodeExe, [syncScript], {
404
399
  cwd: WORKTREE_PATH,
405
400
  stdio: 'pipe',
401
+ timeout: 15000,
406
402
  });
407
403
 
404
+ if (result.status !== 0) {
405
+ console.error('sync stderr:', result.stderr?.toString() || '(empty)');
406
+ console.error('sync stdout:', result.stdout?.toString() || '(empty)');
407
+ }
408
+
408
409
  expect(result.status).toBe(0, 'sync script should exit with status 0');
409
410
 
410
411
  // Verify skills were copied from repo to package
@@ -432,8 +433,14 @@ describe('sync-package-content subprocess invocation', () => {
432
433
  const result = spawnSync(nodeExe, [syncScript], {
433
434
  cwd: WORKTREE_PATH,
434
435
  stdio: 'pipe',
436
+ timeout: 15000,
435
437
  });
436
438
 
439
+ if (result.status !== 0) {
440
+ console.error('sync stderr:', result.stderr?.toString() || '(empty)');
441
+ console.error('sync stdout:', result.stdout?.toString() || '(empty)');
442
+ }
443
+
437
444
  expect(result.status).toBe(0, 'sync script should exit with status 0');
438
445
 
439
446
  // Verify plugin manifests were copied
@@ -454,8 +461,14 @@ describe('sync-package-content subprocess invocation', () => {
454
461
  const result = spawnSync(nodeExe, [syncScript], {
455
462
  cwd: WORKTREE_PATH,
456
463
  stdio: 'pipe',
464
+ timeout: 15000,
457
465
  });
458
466
 
467
+ if (result.status !== 0) {
468
+ console.error('sync stderr:', result.stderr?.toString() || '(empty)');
469
+ console.error('sync stdout:', result.stdout?.toString() || '(empty)');
470
+ }
471
+
459
472
  expect(result.status).toBe(0, 'sync script should exit with status 0');
460
473
 
461
474
  // Verify adapters directory exists and has files
@@ -480,8 +493,14 @@ describe('sync-package-content subprocess invocation', () => {
480
493
  const result = spawnSync(nodeExe, [syncScript], {
481
494
  cwd: WORKTREE_PATH,
482
495
  stdio: 'pipe',
496
+ timeout: 15000,
483
497
  });
484
498
 
499
+ if (result.status !== 0) {
500
+ console.error('sync stderr:', result.stderr?.toString() || '(empty)');
501
+ console.error('sync stdout:', result.stdout?.toString() || '(empty)');
502
+ }
503
+
485
504
  expect(result.status).toBe(0, 'sync script should exit with status 0');
486
505
 
487
506
  // Verify package.json dependencies remained empty