gsd-pi 2.60.0-dev.d9052f5 → 2.61.0-dev.7aed0bf

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 (198) hide show
  1. package/dist/resources/extensions/ask-user-questions.js +7 -4
  2. package/dist/resources/extensions/gsd/auto/phases.js +15 -7
  3. package/dist/resources/extensions/gsd/auto-dashboard.js +21 -8
  4. package/dist/resources/extensions/gsd/auto-dispatch.js +6 -3
  5. package/dist/resources/extensions/gsd/auto-model-selection.js +58 -9
  6. package/dist/resources/extensions/gsd/auto-post-unit.js +3 -2
  7. package/dist/resources/extensions/gsd/auto-prompts.js +36 -20
  8. package/dist/resources/extensions/gsd/auto-recovery.js +37 -18
  9. package/dist/resources/extensions/gsd/auto-start.js +9 -5
  10. package/dist/resources/extensions/gsd/auto-timers.js +11 -5
  11. package/dist/resources/extensions/gsd/auto-unit-closeout.js +5 -3
  12. package/dist/resources/extensions/gsd/auto-verification.js +3 -2
  13. package/dist/resources/extensions/gsd/auto-worktree.js +120 -55
  14. package/dist/resources/extensions/gsd/auto.js +39 -17
  15. package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +6 -3
  16. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +2 -2
  17. package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +4 -10
  18. package/dist/resources/extensions/gsd/bootstrap/journal-tools.js +2 -1
  19. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +7 -0
  20. package/dist/resources/extensions/gsd/bootstrap/system-context.js +11 -10
  21. package/dist/resources/extensions/gsd/commands/catalog.js +2 -0
  22. package/dist/resources/extensions/gsd/commands-codebase.js +48 -21
  23. package/dist/resources/extensions/gsd/commands-inspect.js +2 -1
  24. package/dist/resources/extensions/gsd/commands-maintenance.js +32 -19
  25. package/dist/resources/extensions/gsd/complexity-classifier.js +8 -4
  26. package/dist/resources/extensions/gsd/custom-verification.js +3 -2
  27. package/dist/resources/extensions/gsd/gsd-db.js +33 -13
  28. package/dist/resources/extensions/gsd/guided-flow.js +19 -9
  29. package/dist/resources/extensions/gsd/init-wizard.js +12 -0
  30. package/dist/resources/extensions/gsd/markdown-renderer.js +11 -9
  31. package/dist/resources/extensions/gsd/md-importer.js +5 -4
  32. package/dist/resources/extensions/gsd/milestone-actions.js +3 -2
  33. package/dist/resources/extensions/gsd/milestone-ids.js +2 -1
  34. package/dist/resources/extensions/gsd/model-router.js +156 -121
  35. package/dist/resources/extensions/gsd/parallel-merge.js +5 -3
  36. package/dist/resources/extensions/gsd/parallel-orchestrator.js +26 -14
  37. package/dist/resources/extensions/gsd/preferences-types.js +1 -0
  38. package/dist/resources/extensions/gsd/preferences-validation.js +45 -0
  39. package/dist/resources/extensions/gsd/preferences.js +15 -3
  40. package/dist/resources/extensions/gsd/prompt-loader.js +3 -2
  41. package/dist/resources/extensions/gsd/prompts/rethink.md +1 -1
  42. package/dist/resources/extensions/gsd/rule-registry.js +7 -6
  43. package/dist/resources/extensions/gsd/safe-fs.js +6 -8
  44. package/dist/resources/extensions/gsd/tools/complete-milestone.js +3 -2
  45. package/dist/resources/extensions/gsd/tools/complete-slice.js +3 -2
  46. package/dist/resources/extensions/gsd/tools/complete-task.js +3 -2
  47. package/dist/resources/extensions/gsd/tools/plan-milestone.js +3 -2
  48. package/dist/resources/extensions/gsd/tools/plan-slice.js +3 -2
  49. package/dist/resources/extensions/gsd/tools/plan-task.js +2 -1
  50. package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +4 -4
  51. package/dist/resources/extensions/gsd/tools/reopen-slice.js +2 -1
  52. package/dist/resources/extensions/gsd/tools/reopen-task.js +2 -1
  53. package/dist/resources/extensions/gsd/tools/replan-slice.js +2 -1
  54. package/dist/resources/extensions/gsd/tools/validate-milestone.js +2 -1
  55. package/dist/resources/extensions/gsd/triage-resolution.js +11 -4
  56. package/dist/resources/extensions/gsd/workflow-events.js +2 -1
  57. package/dist/resources/extensions/gsd/workflow-logger.js +37 -4
  58. package/dist/resources/extensions/gsd/workflow-migration.js +14 -12
  59. package/dist/resources/extensions/gsd/workflow-projections.js +2 -2
  60. package/dist/resources/extensions/gsd/workflow-reconcile.js +2 -2
  61. package/dist/resources/extensions/gsd/worktree-manager.js +26 -14
  62. package/dist/resources/extensions/shared/interview-ui.js +3 -1
  63. package/dist/web/standalone/.next/BUILD_ID +1 -1
  64. package/dist/web/standalone/.next/app-path-routes-manifest.json +19 -19
  65. package/dist/web/standalone/.next/build-manifest.json +2 -2
  66. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  67. package/dist/web/standalone/.next/server/app/_global-error.html +2 -2
  68. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  69. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  70. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  71. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  72. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  73. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  74. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  75. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  76. package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
  77. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  78. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  79. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  80. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  81. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  82. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  83. package/dist/web/standalone/.next/server/app/index.html +1 -1
  84. package/dist/web/standalone/.next/server/app/index.rsc +1 -1
  85. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  86. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
  87. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  88. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
  89. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  90. package/dist/web/standalone/.next/server/app-paths-manifest.json +19 -19
  91. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  92. package/dist/web/standalone/.next/server/pages/500.html +2 -2
  93. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  94. package/package.json +1 -1
  95. package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
  96. package/packages/pi-coding-agent/dist/core/extensions/loader.js +5 -0
  97. package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
  98. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +2 -1
  99. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
  100. package/packages/pi-coding-agent/dist/core/extensions/runner.js +16 -0
  101. package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
  102. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +26 -0
  103. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  104. package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  105. package/packages/pi-coding-agent/dist/core/lsp/config.d.ts.map +1 -1
  106. package/packages/pi-coding-agent/dist/core/lsp/config.js +6 -1
  107. package/packages/pi-coding-agent/dist/core/lsp/config.js.map +1 -1
  108. package/packages/pi-coding-agent/dist/core/lsp/defaults.json +2 -2
  109. package/packages/pi-coding-agent/dist/core/lsp/lsp-legacy-alias.test.d.ts +2 -0
  110. package/packages/pi-coding-agent/dist/core/lsp/lsp-legacy-alias.test.d.ts.map +1 -0
  111. package/packages/pi-coding-agent/dist/core/lsp/lsp-legacy-alias.test.js +47 -0
  112. package/packages/pi-coding-agent/dist/core/lsp/lsp-legacy-alias.test.js.map +1 -0
  113. package/packages/pi-coding-agent/package.json +1 -1
  114. package/packages/pi-coding-agent/src/core/extensions/loader.ts +6 -0
  115. package/packages/pi-coding-agent/src/core/extensions/runner.ts +19 -0
  116. package/packages/pi-coding-agent/src/core/extensions/types.ts +26 -0
  117. package/packages/pi-coding-agent/src/core/lsp/config.ts +7 -1
  118. package/packages/pi-coding-agent/src/core/lsp/defaults.json +2 -2
  119. package/packages/pi-coding-agent/src/core/lsp/lsp-legacy-alias.test.ts +70 -0
  120. package/pkg/package.json +1 -1
  121. package/src/resources/extensions/ask-user-questions.ts +7 -3
  122. package/src/resources/extensions/gsd/auto/phases.ts +17 -7
  123. package/src/resources/extensions/gsd/auto-dashboard.ts +22 -8
  124. package/src/resources/extensions/gsd/auto-dispatch.ts +7 -3
  125. package/src/resources/extensions/gsd/auto-model-selection.ts +77 -15
  126. package/src/resources/extensions/gsd/auto-post-unit.ts +4 -4
  127. package/src/resources/extensions/gsd/auto-prompts.ts +37 -20
  128. package/src/resources/extensions/gsd/auto-recovery.ts +38 -18
  129. package/src/resources/extensions/gsd/auto-start.ts +10 -9
  130. package/src/resources/extensions/gsd/auto-timers.ts +12 -5
  131. package/src/resources/extensions/gsd/auto-unit-closeout.ts +6 -2
  132. package/src/resources/extensions/gsd/auto-verification.ts +3 -6
  133. package/src/resources/extensions/gsd/auto-worktree.ts +121 -55
  134. package/src/resources/extensions/gsd/auto.ts +40 -17
  135. package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +4 -3
  136. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +2 -2
  137. package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +4 -16
  138. package/src/resources/extensions/gsd/bootstrap/journal-tools.ts +2 -1
  139. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +8 -0
  140. package/src/resources/extensions/gsd/bootstrap/system-context.ts +11 -10
  141. package/src/resources/extensions/gsd/commands/catalog.ts +2 -0
  142. package/src/resources/extensions/gsd/commands-codebase.ts +52 -20
  143. package/src/resources/extensions/gsd/commands-inspect.ts +2 -1
  144. package/src/resources/extensions/gsd/commands-maintenance.ts +28 -19
  145. package/src/resources/extensions/gsd/complexity-classifier.ts +9 -4
  146. package/src/resources/extensions/gsd/custom-verification.ts +3 -2
  147. package/src/resources/extensions/gsd/gsd-db.ts +12 -14
  148. package/src/resources/extensions/gsd/guided-flow.ts +9 -8
  149. package/src/resources/extensions/gsd/init-wizard.ts +12 -0
  150. package/src/resources/extensions/gsd/markdown-renderer.ts +11 -17
  151. package/src/resources/extensions/gsd/md-importer.ts +5 -4
  152. package/src/resources/extensions/gsd/milestone-actions.ts +3 -2
  153. package/src/resources/extensions/gsd/milestone-ids.ts +2 -1
  154. package/src/resources/extensions/gsd/model-router.ts +199 -173
  155. package/src/resources/extensions/gsd/parallel-merge.ts +5 -3
  156. package/src/resources/extensions/gsd/parallel-orchestrator.ts +18 -14
  157. package/src/resources/extensions/gsd/preferences-types.ts +13 -0
  158. package/src/resources/extensions/gsd/preferences-validation.ts +45 -0
  159. package/src/resources/extensions/gsd/preferences.ts +16 -3
  160. package/src/resources/extensions/gsd/prompt-loader.ts +3 -2
  161. package/src/resources/extensions/gsd/prompts/rethink.md +1 -1
  162. package/src/resources/extensions/gsd/rule-registry.ts +7 -6
  163. package/src/resources/extensions/gsd/safe-fs.ts +6 -5
  164. package/src/resources/extensions/gsd/tests/capability-router.test.ts +347 -0
  165. package/src/resources/extensions/gsd/tests/codebase-generator.test.ts +63 -0
  166. package/src/resources/extensions/gsd/tests/complexity-classifier.test.ts +27 -2
  167. package/src/resources/extensions/gsd/tests/db-path-worktree-symlink.test.ts +4 -4
  168. package/src/resources/extensions/gsd/tests/integration/state-machine-edge-cases.test.ts +1188 -0
  169. package/src/resources/extensions/gsd/tests/integration/state-machine-runtime-failures.test.ts +841 -0
  170. package/src/resources/extensions/gsd/tests/model-router.test.ts +403 -3
  171. package/src/resources/extensions/gsd/tests/preferences.test.ts +62 -0
  172. package/src/resources/extensions/gsd/tests/remote-questions.test.ts +21 -0
  173. package/src/resources/extensions/gsd/tests/silent-catch-diagnostics.test.ts +284 -0
  174. package/src/resources/extensions/gsd/tests/workflow-logger-audit.test.ts +120 -0
  175. package/src/resources/extensions/gsd/tests/workflow-logger.test.ts +6 -6
  176. package/src/resources/extensions/gsd/tools/complete-milestone.ts +3 -6
  177. package/src/resources/extensions/gsd/tools/complete-slice.ts +3 -6
  178. package/src/resources/extensions/gsd/tools/complete-task.ts +3 -6
  179. package/src/resources/extensions/gsd/tools/plan-milestone.ts +3 -6
  180. package/src/resources/extensions/gsd/tools/plan-slice.ts +3 -6
  181. package/src/resources/extensions/gsd/tools/plan-task.ts +2 -3
  182. package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +4 -6
  183. package/src/resources/extensions/gsd/tools/reopen-slice.ts +2 -3
  184. package/src/resources/extensions/gsd/tools/reopen-task.ts +2 -3
  185. package/src/resources/extensions/gsd/tools/replan-slice.ts +2 -3
  186. package/src/resources/extensions/gsd/tools/validate-milestone.ts +2 -3
  187. package/src/resources/extensions/gsd/triage-resolution.ts +11 -4
  188. package/src/resources/extensions/gsd/types.ts +1 -0
  189. package/src/resources/extensions/gsd/workflow-events.ts +2 -1
  190. package/src/resources/extensions/gsd/workflow-logger.ts +52 -5
  191. package/src/resources/extensions/gsd/workflow-migration.ts +14 -12
  192. package/src/resources/extensions/gsd/workflow-projections.ts +2 -2
  193. package/src/resources/extensions/gsd/workflow-reconcile.ts +2 -2
  194. package/src/resources/extensions/gsd/worktree-manager.ts +16 -14
  195. package/src/resources/extensions/shared/interview-ui.ts +3 -1
  196. package/src/resources/extensions/shared/tests/interview-notes-loop.test.ts +144 -0
  197. /package/dist/web/standalone/.next/static/{JVkoVYumy0cDhOQISEYdG → b7FOoMHaUb3FPoLNbxar4}/_buildManifest.js +0 -0
  198. /package/dist/web/standalone/.next/static/{JVkoVYumy0cDhOQISEYdG → b7FOoMHaUb3FPoLNbxar4}/_ssgManifest.js +0 -0
@@ -18,7 +18,7 @@ import { createWorktree, removeWorktree, resolveGitDir, worktreePath, } from "./
18
18
  import { detectWorktreeName, nudgeGitBranchCache, } from "./worktree.js";
19
19
  import { MergeConflictError, readIntegrationBranch, RUNTIME_EXCLUSION_PATHS } from "./git-service.js";
20
20
  import { debugLog } from "./debug-logger.js";
21
- import { logWarning } from "./workflow-logger.js";
21
+ import { logWarning, logError } from "./workflow-logger.js";
22
22
  import { loadEffectiveGSDPreferences } from "./preferences.js";
23
23
  import { nativeGetCurrentBranch, nativeDetectMainBranch, nativeWorkingTreeStatus, nativeAddAllWithExclusions, nativeCommit, nativeCheckoutBranch, nativeMergeSquash, nativeConflictFiles, nativeCheckoutTheirs, nativeAddPaths, nativeRmForce, nativeBranchDelete, nativeBranchExists, nativeDiffNumstat, nativeUpdateRef, nativeIsAncestor, nativeMergeAbort, } from "./native-git-bridge.js";
24
24
  const gsdHome = process.env.GSD_HOME || join(homedir(), ".gsd");
@@ -53,7 +53,8 @@ function isSamePath(a, b) {
53
53
  try {
54
54
  return realpathSync(a) === realpathSync(b);
55
55
  }
56
- catch {
56
+ catch (e) {
57
+ logWarning("worktree", `isSamePath failed: ${e.message}`);
57
58
  return false;
58
59
  }
59
60
  }
@@ -102,18 +103,21 @@ function forceOverwriteAssessmentsWithVerdict(srcMilestoneDir, dstMilestoneDir)
102
103
  mkdirSync(dstSliceDir, { recursive: true });
103
104
  safeCopy(srcFile, join(dstSliceDir, fileEntry.name), { force: true });
104
105
  }
105
- catch {
106
+ catch (err) {
106
107
  /* non-fatal per file */
108
+ logWarning("worktree", `assessment force-copy failed: ${err instanceof Error ? err.message : String(err)}`);
107
109
  }
108
110
  }
109
111
  }
110
- catch {
112
+ catch (err) {
111
113
  /* non-fatal per slice */
114
+ logWarning("worktree", `assessment slice scan failed: ${err instanceof Error ? err.message : String(err)}`);
112
115
  }
113
116
  }
114
117
  }
115
- catch {
118
+ catch (err) {
116
119
  /* non-fatal */
120
+ logWarning("worktree", `assessment sync failed: ${err instanceof Error ? err.message : String(err)}`);
117
121
  }
118
122
  }
119
123
  // ─── Module State ──────────────────────────────────────────────────────────
@@ -130,8 +134,9 @@ function clearProjectRootStateFiles(basePath, milestoneId) {
130
134
  try {
131
135
  unlinkSync(file);
132
136
  }
133
- catch {
137
+ catch (err) {
134
138
  /* non-fatal — file may not exist */
139
+ logWarning("worktree", `file unlink failed: ${err instanceof Error ? err.message : String(err)}`);
135
140
  }
136
141
  }
137
142
  // Clean up entire synced milestone directory and runtime/units.
@@ -154,15 +159,17 @@ function clearProjectRootStateFiles(basePath, milestoneId) {
154
159
  try {
155
160
  unlinkSync(join(basePath, f));
156
161
  }
157
- catch {
162
+ catch (err) {
158
163
  /* non-fatal */
164
+ logWarning("worktree", `untracked file unlink failed: ${err instanceof Error ? err.message : String(err)}`);
159
165
  }
160
166
  }
161
167
  }
162
168
  }
163
169
  }
164
- catch {
170
+ catch (err) {
165
171
  /* non-fatal — git command may fail if not in repo */
172
+ logWarning("worktree", `untracked file cleanup failed: ${err instanceof Error ? err.message : String(err)}`);
166
173
  }
167
174
  }
168
175
  }
@@ -234,8 +241,9 @@ export function syncProjectRootToWorktree(projectRoot, worktreePath_, milestoneI
234
241
  }
235
242
  }
236
243
  }
237
- catch {
244
+ catch (err) {
238
245
  /* non-fatal */
246
+ logWarning("worktree", `worktree DB cleanup failed: ${err instanceof Error ? err.message : String(err)}`);
239
247
  }
240
248
  }
241
249
  /**
@@ -286,7 +294,8 @@ export function readResourceVersion() {
286
294
  ? manifest.gsdVersion
287
295
  : null;
288
296
  }
289
- catch {
297
+ catch (e) {
298
+ logWarning("worktree", `readResourceVersion failed: ${e.message}`);
290
299
  return null;
291
300
  }
292
301
  }
@@ -346,8 +355,9 @@ export function escapeStaleWorktree(base) {
346
355
  try {
347
356
  process.chdir(projectRoot);
348
357
  }
349
- catch {
358
+ catch (e) {
350
359
  // If chdir fails, return the original — caller will handle errors downstream
360
+ logWarning("worktree", `escapeStaleWorktree chdir failed: ${e.message}`);
351
361
  return base;
352
362
  }
353
363
  return projectRoot;
@@ -376,14 +386,16 @@ export function cleanStaleRuntimeUnits(gsdRootPath, hasMilestoneSummary) {
376
386
  unlinkSync(join(runtimeUnitsDir, file));
377
387
  cleaned++;
378
388
  }
379
- catch {
389
+ catch (err) {
380
390
  /* non-fatal */
391
+ logWarning("worktree", `stale runtime unit unlink failed (${file}): ${err instanceof Error ? err.message : String(err)}`);
381
392
  }
382
393
  }
383
394
  }
384
395
  }
385
- catch {
396
+ catch (err) {
386
397
  /* non-fatal */
398
+ logWarning("worktree", `stale runtime unit cleanup failed: ${err instanceof Error ? err.message : String(err)}`);
387
399
  }
388
400
  return cleaned;
389
401
  }
@@ -420,8 +432,9 @@ export function syncGsdStateToWorktree(mainBasePath, worktreePath_) {
420
432
  cpSync(src, dst);
421
433
  synced.push(f);
422
434
  }
423
- catch {
435
+ catch (err) {
424
436
  /* non-fatal */
437
+ logWarning("worktree", `file copy failed (${f}): ${err instanceof Error ? err.message : String(err)}`);
425
438
  }
426
439
  }
427
440
  }
@@ -440,8 +453,9 @@ export function syncGsdStateToWorktree(mainBasePath, worktreePath_) {
440
453
  cpSync(src, dst);
441
454
  synced.push(file);
442
455
  }
443
- catch {
456
+ catch (err) {
444
457
  /* non-fatal */
458
+ logWarning("worktree", `preferences copy failed (${file}): ${err instanceof Error ? err.message : String(err)}`);
445
459
  }
446
460
  break;
447
461
  }
@@ -468,8 +482,9 @@ export function syncGsdStateToWorktree(mainBasePath, worktreePath_) {
468
482
  cpSync(srcDir, dstDir, { recursive: true });
469
483
  synced.push(`milestones/${mid}/`);
470
484
  }
471
- catch {
485
+ catch (err) {
472
486
  /* non-fatal */
487
+ logWarning("worktree", `milestone copy failed (${mid}): ${err instanceof Error ? err.message : String(err)}`);
473
488
  }
474
489
  }
475
490
  else {
@@ -488,8 +503,9 @@ export function syncGsdStateToWorktree(mainBasePath, worktreePath_) {
488
503
  synced.push(`milestones/${mid}/${f}`);
489
504
  }
490
505
  }
491
- catch {
506
+ catch (err) {
492
507
  /* non-fatal */
508
+ logWarning("worktree", `milestone file copy failed (${mid}/${f}): ${err instanceof Error ? err.message : String(err)}`);
493
509
  }
494
510
  }
495
511
  }
@@ -501,8 +517,9 @@ export function syncGsdStateToWorktree(mainBasePath, worktreePath_) {
501
517
  cpSync(srcSlicesDir, dstSlicesDir, { recursive: true });
502
518
  synced.push(`milestones/${mid}/slices/`);
503
519
  }
504
- catch {
520
+ catch (err) {
505
521
  /* non-fatal */
522
+ logWarning("worktree", `slices copy failed (${mid}): ${err instanceof Error ? err.message : String(err)}`);
506
523
  }
507
524
  }
508
525
  else if (existsSync(srcSlicesDir) && existsSync(dstSlicesDir)) {
@@ -520,21 +537,24 @@ export function syncGsdStateToWorktree(mainBasePath, worktreePath_) {
520
537
  cpSync(srcSlice, dstSlice, { recursive: true });
521
538
  synced.push(`milestones/${mid}/slices/${sid}/`);
522
539
  }
523
- catch {
540
+ catch (err) {
524
541
  /* non-fatal */
542
+ logWarning("worktree", `slice copy failed (${mid}/${sid}): ${err instanceof Error ? err.message : String(err)}`);
525
543
  }
526
544
  }
527
545
  }
528
546
  }
529
547
  }
530
- catch {
548
+ catch (err) {
531
549
  /* non-fatal */
550
+ logWarning("worktree", `milestone file sync failed: ${err instanceof Error ? err.message : String(err)}`);
532
551
  }
533
552
  }
534
553
  }
535
554
  }
536
- catch {
555
+ catch (err) {
537
556
  /* non-fatal */
557
+ logWarning("worktree", `milestone directory sync failed: ${err instanceof Error ? err.message : String(err)}`);
538
558
  }
539
559
  }
540
560
  return { synced };
@@ -580,8 +600,9 @@ export function syncWorktreeStateBack(mainBasePath, worktreePath, milestoneId) {
580
600
  reconcileWorktreeDb(mainDb, wtLocalDb);
581
601
  synced.push("gsd.db (pre-upgrade reconcile)");
582
602
  }
583
- catch {
603
+ catch (err) {
584
604
  // Non-fatal — file sync below is the fallback
605
+ logError("worktree", `DB reconciliation failed: ${err instanceof Error ? err.message : String(err)}`);
585
606
  }
586
607
  }
587
608
  // ── 1. Sync root-level .gsd/ files back ──────────────────────────────
@@ -598,8 +619,9 @@ export function syncWorktreeStateBack(mainBasePath, worktreePath, milestoneId) {
598
619
  cpSync(src, dst, { force: true });
599
620
  synced.push(f);
600
621
  }
601
- catch {
622
+ catch (err) {
602
623
  /* non-fatal */
624
+ logWarning("worktree", `state file copy-back failed (${f}): ${err instanceof Error ? err.message : String(err)}`);
603
625
  }
604
626
  }
605
627
  }
@@ -618,8 +640,9 @@ export function syncWorktreeStateBack(mainBasePath, worktreePath, milestoneId) {
618
640
  syncMilestoneDir(wtGsd, mainGsd, mid, synced);
619
641
  }
620
642
  }
621
- catch {
643
+ catch (err) {
622
644
  /* non-fatal */
645
+ logWarning("worktree", `milestone sync-back failed: ${err instanceof Error ? err.message : String(err)}`);
623
646
  }
624
647
  return { synced };
625
648
  }
@@ -637,13 +660,15 @@ function syncDirFiles(srcDir, dstDir, filter, synced, prefix) {
637
660
  cpSync(join(srcDir, entry.name), join(dstDir, entry.name), { force: true });
638
661
  synced.push(`${prefix}${entry.name}`);
639
662
  }
640
- catch {
663
+ catch (err) {
641
664
  /* non-fatal */
665
+ logWarning("worktree", `file copy failed (${prefix}${entry.name}): ${err instanceof Error ? err.message : String(err)}`);
642
666
  }
643
667
  }
644
668
  }
645
- catch {
669
+ catch (err) {
646
670
  /* non-fatal — srcDir may not be readable */
671
+ logWarning("worktree", `directory read failed: ${err instanceof Error ? err.message : String(err)}`);
647
672
  }
648
673
  }
649
674
  function syncMilestoneDir(wtGsd, mainGsd, mid, synced) {
@@ -677,8 +702,9 @@ function syncMilestoneDir(wtGsd, mainGsd, mid, synced) {
677
702
  }
678
703
  }
679
704
  }
680
- catch {
705
+ catch (err) {
681
706
  /* non-fatal */
707
+ logWarning("worktree", `milestone slice sync failed (${mid}): ${err instanceof Error ? err.message : String(err)}`);
682
708
  }
683
709
  }
684
710
  // ─── Worktree Post-Create Hook (#597) ────────────────────────────────────────
@@ -708,7 +734,9 @@ export function runWorktreePostCreateHook(sourceDir, worktreeDir, hookPath) {
708
734
  try {
709
735
  resolved = realpathSync.native(resolved);
710
736
  }
711
- catch { /* keep original */ }
737
+ catch (err) { /* keep original */
738
+ logWarning("worktree", `realpath failed: ${err instanceof Error ? err.message : String(err)}`);
739
+ }
712
740
  }
713
741
  try {
714
742
  // .bat/.cmd files on Windows require shell mode — execFileSync cannot
@@ -785,8 +813,9 @@ function reconcilePlanCheckboxes(projectRoot, wtPath, milestoneId) {
785
813
  }
786
814
  }
787
815
  }
788
- catch {
816
+ catch (err) {
789
817
  /* non-fatal */
818
+ logWarning("worktree", `walkMd directory read failed: ${err instanceof Error ? err.message : String(err)}`);
790
819
  }
791
820
  return results;
792
821
  }
@@ -801,7 +830,8 @@ function reconcilePlanCheckboxes(projectRoot, wtPath, milestoneId) {
801
830
  srcContent = readFileSync(srcFile, "utf-8");
802
831
  dstContent = readFileSync(dstFile, "utf-8");
803
832
  }
804
- catch {
833
+ catch (e) {
834
+ logWarning("worktree", `reconcilePlanCheckboxes read failed: ${e.message}`);
805
835
  continue;
806
836
  }
807
837
  if (srcContent === dstContent)
@@ -829,8 +859,9 @@ function reconcilePlanCheckboxes(projectRoot, wtPath, milestoneId) {
829
859
  try {
830
860
  atomicWriteSync(dstFile, updated, "utf-8");
831
861
  }
832
- catch {
862
+ catch (err) {
833
863
  /* non-fatal */
864
+ logWarning("worktree", `plan checkbox reconcile write failed: ${err instanceof Error ? err.message : String(err)}`);
834
865
  }
835
866
  }
836
867
  }
@@ -979,8 +1010,9 @@ export function teardownAutoWorktree(originalBasePath, milestoneId, opts = {}) {
979
1010
  try {
980
1011
  rmSync(wtDir, { recursive: true, force: true });
981
1012
  }
982
- catch {
1013
+ catch (err) {
983
1014
  // Non-fatal — the warning above tells the user how to clean up
1015
+ logWarning("worktree", `worktree directory removal failed: ${err instanceof Error ? err.message : String(err)}`);
984
1016
  }
985
1017
  }
986
1018
  }
@@ -1021,7 +1053,8 @@ export function getAutoWorktreePath(basePath, milestoneId) {
1021
1053
  if (!content.startsWith("gitdir: "))
1022
1054
  return null;
1023
1055
  }
1024
- catch {
1056
+ catch (e) {
1057
+ logWarning("worktree", `getAutoWorktreePath .git read failed: ${e.message}`);
1025
1058
  return null;
1026
1059
  }
1027
1060
  return p;
@@ -1148,8 +1181,9 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1148
1181
  reconcileWorktreeDb(mainDbPath, worktreeDbPath);
1149
1182
  }
1150
1183
  }
1151
- catch {
1184
+ catch (err) {
1152
1185
  /* non-fatal */
1186
+ logError("worktree", `DB reconciliation failed: ${err instanceof Error ? err.message : String(err)}`);
1153
1187
  }
1154
1188
  }
1155
1189
  // 2. Get completed slices for commit message
@@ -1285,9 +1319,10 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1285
1319
  stashed = true;
1286
1320
  }
1287
1321
  }
1288
- catch {
1322
+ catch (err) {
1289
1323
  // Stash failure is non-fatal — proceed without stash and let the merge
1290
1324
  // report the dirty tree if it fails.
1325
+ logWarning("worktree", `git stash failed: ${err instanceof Error ? err.message : String(err)}`);
1291
1326
  }
1292
1327
  // 7a. Shelter queued milestone directories before the squash merge (#2505).
1293
1328
  // The milestone branch may contain copies of queued milestone dirs (via
@@ -1308,12 +1343,16 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1308
1343
  mkdirSync(milestonesDir, { recursive: true });
1309
1344
  cpSync(join(shelterDir, dirName), join(milestonesDir, dirName), { recursive: true, force: true });
1310
1345
  }
1311
- catch { /* best-effort */ }
1346
+ catch (err) { /* best-effort */
1347
+ logError("worktree", `shelter restore failed: ${err instanceof Error ? err.message : String(err)}`);
1348
+ }
1312
1349
  }
1313
1350
  try {
1314
1351
  rmSync(shelterDir, { recursive: true, force: true });
1315
1352
  }
1316
- catch { /* best-effort */ }
1353
+ catch (err) { /* best-effort */
1354
+ logWarning("worktree", `shelter cleanup failed: ${err instanceof Error ? err.message : String(err)}`);
1355
+ }
1317
1356
  };
1318
1357
  try {
1319
1358
  if (existsSync(milestonesDir)) {
@@ -1332,14 +1371,16 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1332
1371
  rmSync(srcDir, { recursive: true, force: true });
1333
1372
  shelteredDirs.push(entry.name);
1334
1373
  }
1335
- catch {
1374
+ catch (err) {
1336
1375
  // Non-fatal — if shelter fails, the merge may still succeed
1376
+ logWarning("worktree", `milestone shelter failed (${entry.name}): ${err instanceof Error ? err.message : String(err)}`);
1337
1377
  }
1338
1378
  }
1339
1379
  }
1340
1380
  }
1341
- catch {
1381
+ catch (err) {
1342
1382
  // Non-fatal — proceed with merge; untracked files may block it
1383
+ logWarning("worktree", `milestone shelter operation failed: ${err instanceof Error ? err.message : String(err)}`);
1343
1384
  }
1344
1385
  // 7b. Clean up stale merge state before attempting squash merge (#2912).
1345
1386
  // A leftover MERGE_HEAD (from a previous failed merge, libgit2 native path,
@@ -1354,7 +1395,9 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1354
1395
  unlinkSync(p);
1355
1396
  }
1356
1397
  }
1357
- catch { /* best-effort */ }
1398
+ catch (err) { /* best-effort */
1399
+ logError("worktree", `merge state cleanup failed: ${err instanceof Error ? err.message : String(err)}`);
1400
+ }
1358
1401
  // 8. Squash merge — auto-resolve .gsd/ state file conflicts (#530)
1359
1402
  const mergeResult = nativeMergeSquash(originalBasePath_, milestoneBranch);
1360
1403
  if (!mergeResult.success) {
@@ -1372,7 +1415,9 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1372
1415
  unlinkSync(p);
1373
1416
  }
1374
1417
  }
1375
- catch { /* best-effort */ }
1418
+ catch (err) { /* best-effort */
1419
+ logError("worktree", `merge state cleanup failed: ${err instanceof Error ? err.message : String(err)}`);
1420
+ }
1376
1421
  // Pop stash before throwing so local work is not lost.
1377
1422
  if (stashed) {
1378
1423
  try {
@@ -1382,7 +1427,9 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1382
1427
  encoding: "utf-8",
1383
1428
  });
1384
1429
  }
1385
- catch { /* stash pop conflict is non-fatal */ }
1430
+ catch (err) { /* stash pop conflict is non-fatal */
1431
+ logWarning("worktree", `git stash pop failed: ${err instanceof Error ? err.message : String(err)}`);
1432
+ }
1386
1433
  }
1387
1434
  restoreShelter();
1388
1435
  // Restore cwd so the caller is not stranded on the integration branch
@@ -1413,9 +1460,10 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1413
1460
  nativeCheckoutTheirs(originalBasePath_, [safeFile]);
1414
1461
  nativeAddPaths(originalBasePath_, [safeFile]);
1415
1462
  }
1416
- catch {
1463
+ catch (e) {
1417
1464
  // If checkout --theirs fails, try removing the file from the merge
1418
1465
  // (it's a runtime file that shouldn't be committed anyway)
1466
+ logWarning("worktree", `checkout --theirs failed for ${safeFile}, removing: ${e.message}`);
1419
1467
  nativeRmForce(originalBasePath_, [safeFile]);
1420
1468
  }
1421
1469
  }
@@ -1428,7 +1476,9 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1428
1476
  try {
1429
1477
  nativeMergeAbort(originalBasePath_);
1430
1478
  }
1431
- catch { /* best-effort */ }
1479
+ catch (err) { /* best-effort */
1480
+ logError("worktree", `git merge-abort failed: ${err instanceof Error ? err.message : String(err)}`);
1481
+ }
1432
1482
  try {
1433
1483
  const gitDir_ = resolveGitDir(originalBasePath_);
1434
1484
  for (const f of ["SQUASH_MSG", "MERGE_MSG", "MERGE_HEAD"]) {
@@ -1437,7 +1487,9 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1437
1487
  unlinkSync(p);
1438
1488
  }
1439
1489
  }
1440
- catch { /* best-effort */ }
1490
+ catch (err) { /* best-effort */
1491
+ logError("worktree", `merge state file cleanup failed: ${err instanceof Error ? err.message : String(err)}`);
1492
+ }
1441
1493
  // Pop stash before throwing so local work is not lost (#2151).
1442
1494
  if (stashed) {
1443
1495
  try {
@@ -1447,7 +1499,9 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1447
1499
  encoding: "utf-8",
1448
1500
  });
1449
1501
  }
1450
- catch { /* stash pop conflict is non-fatal */ }
1502
+ catch (err) { /* stash pop conflict is non-fatal */
1503
+ logWarning("worktree", `git stash pop failed: ${err instanceof Error ? err.message : String(err)}`);
1504
+ }
1451
1505
  }
1452
1506
  restoreShelter();
1453
1507
  throw new MergeConflictError(codeConflicts, "squash", milestoneBranch, mainBranch);
@@ -1472,7 +1526,9 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1472
1526
  unlinkSync(p);
1473
1527
  }
1474
1528
  }
1475
- catch { /* best-effort */ }
1529
+ catch (err) { /* best-effort */
1530
+ logError("worktree", `post-commit merge state cleanup failed: ${err instanceof Error ? err.message : String(err)}`);
1531
+ }
1476
1532
  // 9a-ii. Restore stashed files now that the merge+commit is complete (#2151).
1477
1533
  // Pop after commit so stashed changes do not interfere with the squash merge
1478
1534
  // or the commit content. Conflict on pop is non-fatal — the stash entry is
@@ -1485,7 +1541,8 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1485
1541
  encoding: "utf-8",
1486
1542
  });
1487
1543
  }
1488
- catch {
1544
+ catch (e) {
1545
+ logWarning("worktree", `git stash pop failed, attempting conflict resolution: ${e.message}`);
1489
1546
  // Stash pop after squash merge can conflict on .gsd/ state files that
1490
1547
  // diverged between branches. Left unresolved, these UU entries block
1491
1548
  // every subsequent merge. Auto-resolve them the same way we handle
@@ -1505,8 +1562,9 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1505
1562
  });
1506
1563
  nativeAddPaths(originalBasePath_, [f]);
1507
1564
  }
1508
- catch {
1565
+ catch (e) {
1509
1566
  // Last resort: remove the conflicted state file
1567
+ logWarning("worktree", `checkout HEAD failed for ${f}, removing: ${e.message}`);
1510
1568
  nativeRmForce(originalBasePath_, [f]);
1511
1569
  }
1512
1570
  }
@@ -1520,7 +1578,9 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1520
1578
  encoding: "utf-8",
1521
1579
  });
1522
1580
  }
1523
- catch { /* stash may already be consumed */ }
1581
+ catch (err) { /* stash may already be consumed */
1582
+ logWarning("worktree", `git stash drop failed: ${err instanceof Error ? err.message : String(err)}`);
1583
+ }
1524
1584
  }
1525
1585
  else {
1526
1586
  // Non-.gsd conflicts remain — leave stash for manual resolution
@@ -1557,8 +1617,9 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1557
1617
  const mergedFiles = nativeDiffNumstat(originalBasePath_, "HEAD~1", "HEAD");
1558
1618
  codeFilesChanged = mergedFiles.some((entry) => !entry.path.startsWith(".gsd/"));
1559
1619
  }
1560
- catch {
1620
+ catch (e) {
1561
1621
  // If HEAD~1 doesn't exist (first commit), assume code was changed
1622
+ logWarning("worktree", `diff numstat failed (assuming code changed): ${e.message}`);
1562
1623
  codeFilesChanged = true;
1563
1624
  }
1564
1625
  }
@@ -1574,8 +1635,9 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1574
1635
  });
1575
1636
  pushed = true;
1576
1637
  }
1577
- catch {
1638
+ catch (err) {
1578
1639
  // Push failure is non-fatal
1640
+ logWarning("worktree", `git push failed: ${err instanceof Error ? err.message : String(err)}`);
1579
1641
  }
1580
1642
  }
1581
1643
  // 9b. Auto-create PR if enabled (#2302: no longer gated on pushed/auto_push)
@@ -1604,8 +1666,9 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1604
1666
  });
1605
1667
  prCreated = true;
1606
1668
  }
1607
- catch {
1669
+ catch (err) {
1608
1670
  // PR creation failure is non-fatal — gh may not be installed or authenticated
1671
+ logWarning("worktree", `PR creation failed: ${err instanceof Error ? err.message : String(err)}`);
1609
1672
  }
1610
1673
  }
1611
1674
  // 11. Guard removed — step 9b (#1792) now handles this with a smarter check:
@@ -1642,15 +1705,17 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1642
1705
  deleteBranch: false,
1643
1706
  });
1644
1707
  }
1645
- catch {
1708
+ catch (err) {
1646
1709
  // Best-effort -- worktree dir may already be gone
1710
+ logWarning("worktree", `worktree removal failed: ${err instanceof Error ? err.message : String(err)}`);
1647
1711
  }
1648
1712
  // 13. Delete milestone branch (after worktree removal so ref is unlocked)
1649
1713
  try {
1650
1714
  nativeBranchDelete(originalBasePath_, milestoneBranch);
1651
1715
  }
1652
- catch {
1716
+ catch (err) {
1653
1717
  // Best-effort
1718
+ logWarning("worktree", `git branch-delete failed: ${err instanceof Error ? err.message : String(err)}`);
1654
1719
  }
1655
1720
  // 14. Clear module state
1656
1721
  originalBase = null;