gsd-pi 2.60.0-dev.2580e65 → 2.60.0-dev.d9052f5

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 (196) hide show
  1. package/dist/resources/extensions/ask-user-questions.js +4 -7
  2. package/dist/resources/extensions/gsd/auto/phases.js +7 -15
  3. package/dist/resources/extensions/gsd/auto-dashboard.js +8 -21
  4. package/dist/resources/extensions/gsd/auto-dispatch.js +3 -6
  5. package/dist/resources/extensions/gsd/auto-model-selection.js +9 -58
  6. package/dist/resources/extensions/gsd/auto-post-unit.js +2 -3
  7. package/dist/resources/extensions/gsd/auto-prompts.js +20 -36
  8. package/dist/resources/extensions/gsd/auto-recovery.js +18 -37
  9. package/dist/resources/extensions/gsd/auto-start.js +5 -9
  10. package/dist/resources/extensions/gsd/auto-timers.js +5 -11
  11. package/dist/resources/extensions/gsd/auto-unit-closeout.js +3 -5
  12. package/dist/resources/extensions/gsd/auto-verification.js +2 -3
  13. package/dist/resources/extensions/gsd/auto-worktree.js +55 -120
  14. package/dist/resources/extensions/gsd/auto.js +17 -39
  15. package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +3 -6
  16. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +2 -2
  17. package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +10 -4
  18. package/dist/resources/extensions/gsd/bootstrap/journal-tools.js +1 -2
  19. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +0 -7
  20. package/dist/resources/extensions/gsd/bootstrap/system-context.js +10 -11
  21. package/dist/resources/extensions/gsd/commands/catalog.js +0 -2
  22. package/dist/resources/extensions/gsd/commands-codebase.js +21 -48
  23. package/dist/resources/extensions/gsd/commands-inspect.js +1 -2
  24. package/dist/resources/extensions/gsd/commands-maintenance.js +19 -32
  25. package/dist/resources/extensions/gsd/complexity-classifier.js +4 -8
  26. package/dist/resources/extensions/gsd/custom-verification.js +2 -3
  27. package/dist/resources/extensions/gsd/gsd-db.js +13 -33
  28. package/dist/resources/extensions/gsd/guided-flow.js +9 -19
  29. package/dist/resources/extensions/gsd/init-wizard.js +0 -12
  30. package/dist/resources/extensions/gsd/markdown-renderer.js +9 -11
  31. package/dist/resources/extensions/gsd/md-importer.js +4 -5
  32. package/dist/resources/extensions/gsd/milestone-actions.js +2 -3
  33. package/dist/resources/extensions/gsd/milestone-ids.js +1 -2
  34. package/dist/resources/extensions/gsd/model-router.js +121 -156
  35. package/dist/resources/extensions/gsd/parallel-merge.js +3 -5
  36. package/dist/resources/extensions/gsd/parallel-orchestrator.js +14 -26
  37. package/dist/resources/extensions/gsd/preferences-types.js +0 -1
  38. package/dist/resources/extensions/gsd/preferences-validation.js +0 -45
  39. package/dist/resources/extensions/gsd/preferences.js +3 -15
  40. package/dist/resources/extensions/gsd/prompt-loader.js +2 -3
  41. package/dist/resources/extensions/gsd/prompts/rethink.md +1 -1
  42. package/dist/resources/extensions/gsd/rule-registry.js +6 -7
  43. package/dist/resources/extensions/gsd/safe-fs.js +8 -6
  44. package/dist/resources/extensions/gsd/tools/complete-milestone.js +2 -3
  45. package/dist/resources/extensions/gsd/tools/complete-slice.js +2 -3
  46. package/dist/resources/extensions/gsd/tools/complete-task.js +2 -3
  47. package/dist/resources/extensions/gsd/tools/plan-milestone.js +2 -3
  48. package/dist/resources/extensions/gsd/tools/plan-slice.js +2 -3
  49. package/dist/resources/extensions/gsd/tools/plan-task.js +1 -2
  50. package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +4 -4
  51. package/dist/resources/extensions/gsd/tools/reopen-slice.js +1 -2
  52. package/dist/resources/extensions/gsd/tools/reopen-task.js +1 -2
  53. package/dist/resources/extensions/gsd/tools/replan-slice.js +1 -2
  54. package/dist/resources/extensions/gsd/tools/validate-milestone.js +1 -2
  55. package/dist/resources/extensions/gsd/triage-resolution.js +4 -11
  56. package/dist/resources/extensions/gsd/workflow-events.js +1 -2
  57. package/dist/resources/extensions/gsd/workflow-logger.js +4 -37
  58. package/dist/resources/extensions/gsd/workflow-migration.js +12 -14
  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 +14 -26
  62. package/dist/resources/extensions/shared/interview-ui.js +1 -3
  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 +0 -5
  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 +1 -2
  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 +0 -16
  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 +0 -26
  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 +1 -6
  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/src/core/extensions/loader.ts +0 -6
  110. package/packages/pi-coding-agent/src/core/extensions/runner.ts +0 -19
  111. package/packages/pi-coding-agent/src/core/extensions/types.ts +0 -26
  112. package/packages/pi-coding-agent/src/core/lsp/config.ts +1 -7
  113. package/packages/pi-coding-agent/src/core/lsp/defaults.json +2 -2
  114. package/src/resources/extensions/ask-user-questions.ts +3 -7
  115. package/src/resources/extensions/gsd/auto/phases.ts +7 -17
  116. package/src/resources/extensions/gsd/auto-dashboard.ts +8 -22
  117. package/src/resources/extensions/gsd/auto-dispatch.ts +3 -7
  118. package/src/resources/extensions/gsd/auto-model-selection.ts +15 -77
  119. package/src/resources/extensions/gsd/auto-post-unit.ts +4 -4
  120. package/src/resources/extensions/gsd/auto-prompts.ts +20 -37
  121. package/src/resources/extensions/gsd/auto-recovery.ts +18 -38
  122. package/src/resources/extensions/gsd/auto-start.ts +9 -10
  123. package/src/resources/extensions/gsd/auto-timers.ts +5 -12
  124. package/src/resources/extensions/gsd/auto-unit-closeout.ts +2 -6
  125. package/src/resources/extensions/gsd/auto-verification.ts +6 -3
  126. package/src/resources/extensions/gsd/auto-worktree.ts +55 -121
  127. package/src/resources/extensions/gsd/auto.ts +17 -40
  128. package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +3 -4
  129. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +2 -2
  130. package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +16 -4
  131. package/src/resources/extensions/gsd/bootstrap/journal-tools.ts +1 -2
  132. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +0 -8
  133. package/src/resources/extensions/gsd/bootstrap/system-context.ts +10 -11
  134. package/src/resources/extensions/gsd/commands/catalog.ts +0 -2
  135. package/src/resources/extensions/gsd/commands-codebase.ts +20 -52
  136. package/src/resources/extensions/gsd/commands-inspect.ts +1 -2
  137. package/src/resources/extensions/gsd/commands-maintenance.ts +19 -28
  138. package/src/resources/extensions/gsd/complexity-classifier.ts +4 -9
  139. package/src/resources/extensions/gsd/custom-verification.ts +2 -3
  140. package/src/resources/extensions/gsd/gsd-db.ts +14 -12
  141. package/src/resources/extensions/gsd/guided-flow.ts +8 -9
  142. package/src/resources/extensions/gsd/init-wizard.ts +0 -12
  143. package/src/resources/extensions/gsd/markdown-renderer.ts +17 -11
  144. package/src/resources/extensions/gsd/md-importer.ts +4 -5
  145. package/src/resources/extensions/gsd/milestone-actions.ts +2 -3
  146. package/src/resources/extensions/gsd/milestone-ids.ts +1 -2
  147. package/src/resources/extensions/gsd/model-router.ts +173 -199
  148. package/src/resources/extensions/gsd/parallel-merge.ts +3 -5
  149. package/src/resources/extensions/gsd/parallel-orchestrator.ts +14 -18
  150. package/src/resources/extensions/gsd/preferences-types.ts +0 -13
  151. package/src/resources/extensions/gsd/preferences-validation.ts +0 -45
  152. package/src/resources/extensions/gsd/preferences.ts +3 -16
  153. package/src/resources/extensions/gsd/prompt-loader.ts +2 -3
  154. package/src/resources/extensions/gsd/prompts/rethink.md +1 -1
  155. package/src/resources/extensions/gsd/rule-registry.ts +6 -7
  156. package/src/resources/extensions/gsd/safe-fs.ts +5 -6
  157. package/src/resources/extensions/gsd/tests/codebase-generator.test.ts +0 -63
  158. package/src/resources/extensions/gsd/tests/complexity-classifier.test.ts +2 -27
  159. package/src/resources/extensions/gsd/tests/db-path-worktree-symlink.test.ts +4 -4
  160. package/src/resources/extensions/gsd/tests/model-router.test.ts +3 -403
  161. package/src/resources/extensions/gsd/tests/preferences.test.ts +0 -62
  162. package/src/resources/extensions/gsd/tests/remote-questions.test.ts +0 -21
  163. package/src/resources/extensions/gsd/tests/workflow-logger.test.ts +6 -6
  164. package/src/resources/extensions/gsd/tools/complete-milestone.ts +6 -3
  165. package/src/resources/extensions/gsd/tools/complete-slice.ts +6 -3
  166. package/src/resources/extensions/gsd/tools/complete-task.ts +6 -3
  167. package/src/resources/extensions/gsd/tools/plan-milestone.ts +6 -3
  168. package/src/resources/extensions/gsd/tools/plan-slice.ts +6 -3
  169. package/src/resources/extensions/gsd/tools/plan-task.ts +3 -2
  170. package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +6 -4
  171. package/src/resources/extensions/gsd/tools/reopen-slice.ts +3 -2
  172. package/src/resources/extensions/gsd/tools/reopen-task.ts +3 -2
  173. package/src/resources/extensions/gsd/tools/replan-slice.ts +3 -2
  174. package/src/resources/extensions/gsd/tools/validate-milestone.ts +3 -2
  175. package/src/resources/extensions/gsd/triage-resolution.ts +4 -11
  176. package/src/resources/extensions/gsd/types.ts +0 -1
  177. package/src/resources/extensions/gsd/workflow-events.ts +1 -2
  178. package/src/resources/extensions/gsd/workflow-logger.ts +5 -52
  179. package/src/resources/extensions/gsd/workflow-migration.ts +12 -14
  180. package/src/resources/extensions/gsd/workflow-projections.ts +2 -2
  181. package/src/resources/extensions/gsd/workflow-reconcile.ts +2 -2
  182. package/src/resources/extensions/gsd/worktree-manager.ts +14 -16
  183. package/src/resources/extensions/shared/interview-ui.ts +1 -3
  184. package/packages/pi-coding-agent/dist/core/lsp/lsp-legacy-alias.test.d.ts +0 -2
  185. package/packages/pi-coding-agent/dist/core/lsp/lsp-legacy-alias.test.d.ts.map +0 -1
  186. package/packages/pi-coding-agent/dist/core/lsp/lsp-legacy-alias.test.js +0 -47
  187. package/packages/pi-coding-agent/dist/core/lsp/lsp-legacy-alias.test.js.map +0 -1
  188. package/packages/pi-coding-agent/src/core/lsp/lsp-legacy-alias.test.ts +0 -70
  189. package/src/resources/extensions/gsd/tests/capability-router.test.ts +0 -347
  190. package/src/resources/extensions/gsd/tests/integration/state-machine-edge-cases.test.ts +0 -1188
  191. package/src/resources/extensions/gsd/tests/integration/state-machine-runtime-failures.test.ts +0 -841
  192. package/src/resources/extensions/gsd/tests/silent-catch-diagnostics.test.ts +0 -284
  193. package/src/resources/extensions/gsd/tests/workflow-logger-audit.test.ts +0 -120
  194. package/src/resources/extensions/shared/tests/interview-notes-loop.test.ts +0 -144
  195. /package/dist/web/standalone/.next/static/{ogyMN7M-3bGGuRY08L5HR → JVkoVYumy0cDhOQISEYdG}/_buildManifest.js +0 -0
  196. /package/dist/web/standalone/.next/static/{ogyMN7M-3bGGuRY08L5HR → JVkoVYumy0cDhOQISEYdG}/_ssgManifest.js +0 -0
@@ -103,7 +103,6 @@ export const KNOWN_PREFERENCE_KEYS = new Set<string>([
103
103
  "stale_commit_threshold_minutes",
104
104
  "context_management",
105
105
  "experimental",
106
- "codebase",
107
106
  ]);
108
107
 
109
108
  /** Canonical list of all dispatch unit types. */
@@ -212,16 +211,6 @@ export interface ExperimentalPreferences {
212
211
  rtk?: boolean;
213
212
  }
214
213
 
215
- /** Configuration for the codebase map generator (/gsd codebase). */
216
- export interface CodebaseMapPreferences {
217
- /** Additional directory/file patterns to exclude (e.g. ["docs/", "fixtures/"]). Merged with built-in defaults. */
218
- exclude_patterns?: string[];
219
- /** Max files to include in the map. Default: 500. */
220
- max_files?: number;
221
- /** Files-per-directory threshold before collapsing to a summary line. Default: 20. */
222
- collapse_threshold?: number;
223
- }
224
-
225
214
  export interface GSDPreferences {
226
215
  version?: number;
227
216
  mode?: WorkflowMode;
@@ -286,8 +275,6 @@ export interface GSDPreferences {
286
275
  * See the preferences reference for details on each feature.
287
276
  */
288
277
  experimental?: ExperimentalPreferences;
289
- /** Configuration for the codebase map generator (/gsd codebase). */
290
- codebase?: CodebaseMapPreferences;
291
278
  }
292
279
 
293
280
  export interface LoadedGSDPreferences {
@@ -857,50 +857,5 @@ export function validatePreferences(preferences: GSDPreferences): {
857
857
  }
858
858
  }
859
859
 
860
- // ─── Codebase Map ──────────────────────────────────────────────────
861
- if (preferences.codebase !== undefined) {
862
- if (typeof preferences.codebase === "object" && preferences.codebase !== null) {
863
- const cb = preferences.codebase as Record<string, unknown>;
864
- const validCb: import("./preferences-types.js").CodebaseMapPreferences = {};
865
-
866
- if (cb.exclude_patterns !== undefined) {
867
- if (Array.isArray(cb.exclude_patterns) && cb.exclude_patterns.every((p: unknown) => typeof p === "string")) {
868
- validCb.exclude_patterns = cb.exclude_patterns as string[];
869
- } else {
870
- errors.push("codebase.exclude_patterns must be an array of strings");
871
- }
872
- }
873
- if (cb.max_files !== undefined) {
874
- const mf = typeof cb.max_files === "number" ? cb.max_files : Number(cb.max_files);
875
- if (Number.isFinite(mf) && mf >= 1) {
876
- validCb.max_files = Math.floor(mf);
877
- } else {
878
- errors.push("codebase.max_files must be a positive integer");
879
- }
880
- }
881
- if (cb.collapse_threshold !== undefined) {
882
- const ct = typeof cb.collapse_threshold === "number" ? cb.collapse_threshold : Number(cb.collapse_threshold);
883
- if (Number.isFinite(ct) && ct >= 1) {
884
- validCb.collapse_threshold = Math.floor(ct);
885
- } else {
886
- errors.push("codebase.collapse_threshold must be a positive integer");
887
- }
888
- }
889
-
890
- const knownCbKeys = new Set(["exclude_patterns", "max_files", "collapse_threshold"]);
891
- for (const key of Object.keys(cb)) {
892
- if (!knownCbKeys.has(key)) {
893
- warnings.push(`unknown codebase key "${key}" — ignored`);
894
- }
895
- }
896
-
897
- if (Object.keys(validCb).length > 0) {
898
- validated.codebase = validCb;
899
- }
900
- } else {
901
- errors.push("codebase must be an object");
902
- }
903
- }
904
-
905
860
  return { preferences: validated, errors, warnings };
906
861
  }
@@ -19,7 +19,6 @@ import { parse as parseYaml } from "yaml";
19
19
  import type { PostUnitHookConfig, PreDispatchHookConfig, TokenProfile } from "./types.js";
20
20
  import type { DynamicRoutingConfig } from "./model-router.js";
21
21
  import { normalizeStringArray } from "../shared/format-utils.js";
22
- import { logWarning } from "./workflow-logger.js";
23
22
  import { resolveProfileDefaults as _resolveProfileDefaults } from "./preferences-models.js";
24
23
 
25
24
  import {
@@ -49,7 +48,6 @@ export type {
49
48
  AutoSupervisorConfig,
50
49
  RemoteQuestionsConfig,
51
50
  CmuxPreferences,
52
- CodebaseMapPreferences,
53
51
  GSDPreferences,
54
52
  LoadedGSDPreferences,
55
53
  SkillResolution,
@@ -239,7 +237,7 @@ function parseFrontmatterBlock(frontmatter: string): GSDPreferences {
239
237
  }
240
238
  return parsed as GSDPreferences;
241
239
  } catch (e) {
242
- logWarning("guided", `YAML parse error in frontmatter block: ${(e as Error).message}`);
240
+ console.error("[parseFrontmatterBlock] YAML parse error:", e);
243
241
  return {} as GSDPreferences;
244
242
  }
245
243
  }
@@ -298,8 +296,8 @@ function parseHeadingListFormat(content: string): GSDPreferences {
298
296
  }
299
297
 
300
298
  typed[targetSection] = value;
301
- } catch (e) {
302
- logWarning("guided", `preferences section parse failed: ${(e as Error).message}`);
299
+ } catch {
300
+ /* malformed section skip */
303
301
  }
304
302
  }
305
303
 
@@ -373,17 +371,6 @@ function mergePreferences(base: GSDPreferences, override: GSDPreferences): GSDPr
373
371
  service_tier: override.service_tier ?? base.service_tier,
374
372
  forensics_dedup: override.forensics_dedup ?? base.forensics_dedup,
375
373
  show_token_cost: override.show_token_cost ?? base.show_token_cost,
376
- codebase: (base.codebase || override.codebase)
377
- ? {
378
- ...(base.codebase ?? {}),
379
- ...(override.codebase ?? {}),
380
- // Merge exclude_patterns arrays rather than overriding
381
- exclude_patterns: [
382
- ...((base.codebase?.exclude_patterns) ?? []),
383
- ...((override.codebase?.exclude_patterns) ?? []),
384
- ].filter(Boolean),
385
- }
386
- : undefined,
387
374
  };
388
375
  }
389
376
 
@@ -22,7 +22,6 @@ import { GSDError, GSD_PARSE_ERROR } from "./errors.js";
22
22
  import { join, dirname } from "node:path";
23
23
  import { fileURLToPath } from "node:url";
24
24
  import { homedir } from "node:os";
25
- import { logWarning } from "./workflow-logger.js";
26
25
 
27
26
  /**
28
27
  * Resolve the GSD extension directory.
@@ -73,7 +72,7 @@ function warmCache(): void {
73
72
  // prompts/ may not exist in test environments — lazy loading still works.
74
73
  // Emit a diagnostic when running outside tests so wrong-path bugs are visible.
75
74
  if (!process.env.VITEST && !process.env.NODE_TEST) {
76
- logWarning("prompt", `warmCache: prompts dir not found: ${promptsDir}`);
75
+ process.stderr.write(`[gsd:prompt-loader] warmCache: prompts dir not found: ${promptsDir}\n`);
77
76
  }
78
77
  }
79
78
 
@@ -88,7 +87,7 @@ function warmCache(): void {
88
87
  } catch {
89
88
  // templates/ may not exist in test environments — lazy loading still works.
90
89
  if (!process.env.VITEST && !process.env.NODE_TEST) {
91
- logWarning("prompt", `warmCache: templates dir not found: ${templatesDir}`);
90
+ process.stderr.write(`[gsd:prompt-loader] warmCache: templates dir not found: ${templatesDir}\n`);
92
91
  }
93
92
  }
94
93
  }
@@ -48,7 +48,7 @@ Remove the `{ID}-PARKED.md` file from the milestone directory to reactivate it.
48
48
  ### Skip a slice
49
49
  Mark a slice as skipped so auto-mode advances past it without executing. Use the `gsd_skip_slice` tool:
50
50
  ```
51
- gsd_skip_slice({ milestoneId: "M003", sliceId: "S02", reason: "Descoped — feature moved to M005" })
51
+ gsd_skip_slice({ milestone_id: "M003", slice_id: "S02", reason: "Descoped — feature moved to M005" })
52
52
  ```
53
53
  Skipped slices are treated as closed by the state machine (like "complete" but distinct). Use when a slice is no longer needed or has been superseded. The slice data is preserved for reference.
54
54
 
@@ -6,7 +6,6 @@
6
6
  //
7
7
  // A module-level singleton accessor allows existing code to migrate incrementally.
8
8
 
9
- import { logWarning } from "./workflow-logger.js";
10
9
  import type { UnifiedRule, RulePhase } from "./rule-types.js";
11
10
  import type { DispatchAction, DispatchContext, DispatchRule } from "./auto-dispatch.js";
12
11
  import type {
@@ -388,8 +387,8 @@ export class RuleRegistry {
388
387
  const dir = join(basePath, ".gsd");
389
388
  if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
390
389
  writeFileSync(this._hookStatePath(basePath), JSON.stringify(state, null, 2), "utf-8");
391
- } catch (e) {
392
- logWarning("registry", `failed to persist hook state: ${(e as Error).message}`);
390
+ } catch {
391
+ // Non-fatal state is recreatable from artifacts
393
392
  }
394
393
  }
395
394
 
@@ -408,8 +407,8 @@ export class RuleRegistry {
408
407
  }
409
408
  }
410
409
  }
411
- } catch (e) {
412
- logWarning("registry", `failed to restore hook state: ${(e as Error).message}`);
410
+ } catch {
411
+ // Non-fatal fresh state is fine
413
412
  }
414
413
  }
415
414
 
@@ -424,8 +423,8 @@ export class RuleRegistry {
424
423
  "utf-8",
425
424
  );
426
425
  }
427
- } catch (e) {
428
- logWarning("registry", `failed to clear hook state: ${(e as Error).message}`);
426
+ } catch {
427
+ // Non-fatal
429
428
  }
430
429
  }
431
430
 
@@ -1,24 +1,23 @@
1
1
  import { existsSync, mkdirSync, cpSync, type CopySyncOptions } from "node:fs"
2
2
  import { dirname } from "node:path"
3
- import { logWarning } from "./workflow-logger.js"
4
3
 
5
4
  /**
6
5
  * Safely creates a directory. Returns true if successful, false on error.
7
- * Logs warnings via workflow-logger on failure.
6
+ * Logs to stderr when GSD_DEBUG is set.
8
7
  */
9
8
  export function safeMkdir(dirPath: string): boolean {
10
9
  try {
11
10
  mkdirSync(dirPath, { recursive: true })
12
11
  return true
13
12
  } catch (err) {
14
- logWarning("fs", `mkdir failed: ${dirPath}: ${(err as Error).message}`)
13
+ if (process.env.GSD_DEBUG) console.error(`[gsd] mkdir failed: ${dirPath}`, err)
15
14
  return false
16
15
  }
17
16
  }
18
17
 
19
18
  /**
20
19
  * Safely copies src to dst. Returns true if successful, false if src doesn't exist or copy fails.
21
- * Logs warnings via workflow-logger on failure.
20
+ * Logs to stderr when GSD_DEBUG is set.
22
21
  */
23
22
  export function safeCopy(src: string, dst: string, opts?: CopySyncOptions): boolean {
24
23
  if (!existsSync(src)) return false
@@ -26,7 +25,7 @@ export function safeCopy(src: string, dst: string, opts?: CopySyncOptions): bool
26
25
  cpSync(src, dst, opts)
27
26
  return true
28
27
  } catch (err) {
29
- logWarning("fs", `copy failed: ${src} → ${dst}: ${(err as Error).message}`)
28
+ if (process.env.GSD_DEBUG) console.error(`[gsd] copy failed: ${src} → ${dst}`, err)
30
29
  return false
31
30
  }
32
31
  }
@@ -42,7 +41,7 @@ export function safeCopyRecursive(src: string, dst: string, opts?: Omit<CopySync
42
41
  cpSync(src, dst, { ...opts, recursive: true })
43
42
  return true
44
43
  } catch (err) {
45
- logWarning("fs", `recursive copy failed: ${src} → ${dst}: ${(err as Error).message}`)
44
+ if (process.env.GSD_DEBUG) console.error(`[gsd] recursive copy failed: ${src} → ${dst}`, err)
46
45
  return false
47
46
  }
48
47
  }
@@ -486,66 +486,3 @@ test("getCodebaseMapStats: reads total file count from header for accuracy with
486
486
  cleanup(base);
487
487
  }
488
488
  });
489
-
490
- // ─── excludePatterns from options ────────────────────────────────────────
491
-
492
- test("generateCodebaseMap: custom excludePatterns filters additional directories", () => {
493
- const base = makeTmpRepo();
494
- try {
495
- addFile(base, "src/main.ts");
496
- addFile(base, "src/utils.ts");
497
- addFile(base, ".cache-data/data/index.lance");
498
- addFile(base, "docs/guide.md");
499
-
500
- const result = generateCodebaseMap(base, {
501
- excludePatterns: [".cache-data/", "docs/"],
502
- });
503
- assert.ok(result.content.includes("`src/main.ts`"));
504
- assert.ok(result.content.includes("`src/utils.ts`"));
505
- assert.ok(!result.content.includes(".cache-data"));
506
- assert.ok(!result.content.includes("guide.md"));
507
- assert.equal(result.fileCount, 2);
508
- } finally {
509
- cleanup(base);
510
- }
511
- });
512
-
513
- test("generateCodebaseMap: collapseThreshold option overrides default", () => {
514
- const base = makeTmpRepo();
515
- try {
516
- // Create 10 files in one directory — below default threshold (20)
517
- // but above a custom threshold of 5
518
- for (let i = 0; i < 10; i++) {
519
- addFile(base, `src/comp${i}.ts`);
520
- }
521
-
522
- // With default threshold (20), files should NOT collapse
523
- const expanded = generateCodebaseMap(base);
524
- assert.ok(expanded.content.includes("`src/comp0.ts`"));
525
-
526
- // With custom threshold (5), files SHOULD collapse
527
- const collapsed = generateCodebaseMap(base, { collapseThreshold: 5 });
528
- assert.ok(collapsed.content.includes("10 files"));
529
- assert.ok(!collapsed.content.includes("`src/comp0.ts`\n"));
530
- } finally {
531
- cleanup(base);
532
- }
533
- });
534
-
535
- test("updateCodebaseMap: respects excludePatterns option", () => {
536
- const base = makeTmpRepo();
537
- try {
538
- addFile(base, "src/main.ts");
539
- addFile(base, "vendor-extra/lib.js");
540
-
541
- const initial = generateCodebaseMap(base);
542
- writeCodebaseMap(base, initial.content);
543
-
544
- // Update with exclusion should remove vendor-extra files
545
- const result = updateCodebaseMap(base, { excludePatterns: ["vendor-extra/"] });
546
- assert.ok(result.content.includes("`src/main.ts`"));
547
- assert.ok(!result.content.includes("vendor-extra"));
548
- } finally {
549
- cleanup(base);
550
- }
551
- });
@@ -1,7 +1,7 @@
1
- import test, { describe } from "node:test";
1
+ import test from "node:test";
2
2
  import assert from "node:assert/strict";
3
3
 
4
- import { classifyUnitComplexity, tierLabel, tierOrdinal, extractTaskMetadata } from "../complexity-classifier.js";
4
+ import { classifyUnitComplexity, tierLabel, tierOrdinal } from "../complexity-classifier.js";
5
5
  import type { ComplexityTier, TaskMetadata } from "../complexity-classifier.js";
6
6
 
7
7
  // ─── tierLabel ───────────────────────────────────────────────────────────────
@@ -179,28 +179,3 @@ test("execute-task with few code blocks stays standard", () => {
179
179
  const result = classifyUnitComplexity("execute-task", "M001/S01/T01", "/tmp/fake", undefined, metadata);
180
180
  assert.equal(result.tier, "standard");
181
181
  });
182
-
183
- // ─── ClassificationResult taskMetadata passthrough ───────────────────────────
184
-
185
- describe("ClassificationResult taskMetadata", () => {
186
- test("classifyUnitComplexity for execute-task returns result with taskMetadata populated", () => {
187
- const metadata: TaskMetadata = { fileCount: 3, tags: ["docs"] };
188
- const result = classifyUnitComplexity("execute-task", "M001/S01/T01", "/tmp/fake", undefined, metadata);
189
- assert.ok(result.taskMetadata !== undefined, "taskMetadata should be populated for execute-task");
190
- assert.equal(result.taskMetadata!.tags?.[0], "docs");
191
- });
192
-
193
- test("classifyUnitComplexity for hook/xyz returns result with taskMetadata undefined", () => {
194
- const result = classifyUnitComplexity("hook/verify", "M001/S01/T01", "/tmp/fake");
195
- assert.equal(result.taskMetadata, undefined, "taskMetadata should be undefined for hook units");
196
- });
197
-
198
- test("classifyUnitComplexity for plan-slice returns result with taskMetadata undefined", () => {
199
- const result = classifyUnitComplexity("plan-slice", "M001/S01", "/tmp/fake");
200
- assert.equal(result.taskMetadata, undefined, "taskMetadata should be undefined for plan-slice");
201
- });
202
-
203
- test("extractTaskMetadata is importable as a named export and is a function", () => {
204
- assert.equal(typeof extractTaskMetadata, "function", "extractTaskMetadata should be a callable function");
205
- });
206
- });
@@ -94,11 +94,11 @@ const dynamicToolsSrc = readFileSync(
94
94
  "utf-8",
95
95
  );
96
96
 
97
- // ensureDbOpen should surface diagnostic context, not just boolean false
98
- // Check that the catch block logs error details via workflow-logger
97
+ // ensureDbOpen should return a structured result, not just boolean false
98
+ // Check that the catch block provides diagnostic information
99
99
  assertTrue(
100
- dynamicToolsSrc.includes("ensureDbOpen failed") && dynamicToolsSrc.includes("logWarning"),
101
- "ensureDbOpen catch block surfaces diagnostic information via logWarning instead of bare false (#2517)",
100
+ dynamicToolsSrc.includes("resolvedPath") || dynamicToolsSrc.includes("diagnostic"),
101
+ "ensureDbOpen catch block surfaces diagnostic information (resolvedPath or diagnostic) instead of bare false (#2517)",
102
102
  );
103
103
 
104
104
  // ── Part 3: post-unit does NOT artifact-retry on db_unavailable ──────────