gsd-pi 2.48.0 → 2.49.0-dev.de3d9f6

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 (170) hide show
  1. package/dist/resources/extensions/gsd/auto-dispatch.js +17 -2
  2. package/dist/resources/extensions/gsd/auto-post-unit.js +17 -3
  3. package/dist/resources/extensions/gsd/auto-worktree.js +5 -2
  4. package/dist/resources/extensions/gsd/commands/handlers/auto.js +43 -3
  5. package/dist/resources/extensions/gsd/git-service.js +11 -10
  6. package/dist/resources/extensions/gsd/prompts/discuss-headless.md +223 -56
  7. package/dist/resources/extensions/gsd/prompts/run-uat.md +4 -4
  8. package/dist/resources/extensions/gsd/worktree-command.js +1 -1
  9. package/dist/web/standalone/.next/BUILD_ID +1 -1
  10. package/dist/web/standalone/.next/app-path-routes-manifest.json +14 -14
  11. package/dist/web/standalone/.next/build-manifest.json +3 -3
  12. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  13. package/dist/web/standalone/.next/required-server-files.json +3 -3
  14. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  15. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  16. package/dist/web/standalone/.next/server/app/_global-error.html +2 -2
  17. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  18. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  19. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  20. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  21. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  22. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  23. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  24. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  25. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  26. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  27. package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
  28. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  29. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  30. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  31. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  32. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  33. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  34. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  35. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  36. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  37. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  38. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  39. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  40. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  41. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  42. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  43. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  44. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  45. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  46. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  47. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  48. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  49. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  50. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  51. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  52. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  53. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  54. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  55. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  56. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  57. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  58. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  59. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  60. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  61. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  62. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  63. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  64. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  65. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  66. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  67. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  68. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  69. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  70. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  71. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  72. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  73. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  74. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  75. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  76. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  77. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  78. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +5 -5
  79. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  80. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  81. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  82. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  83. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  84. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  85. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  86. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  87. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  88. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  89. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  90. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  91. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  92. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  93. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  94. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  95. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  96. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  97. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  98. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
  99. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  100. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  101. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  102. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
  103. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  104. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +4 -4
  105. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  106. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  107. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  108. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  109. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  110. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  111. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  112. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  113. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  114. package/dist/web/standalone/.next/server/app/index.html +1 -1
  115. package/dist/web/standalone/.next/server/app/index.rsc +4 -4
  116. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  117. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
  118. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  119. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
  120. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  121. package/dist/web/standalone/.next/server/app/page.js +2 -2
  122. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  123. package/dist/web/standalone/.next/server/app-paths-manifest.json +14 -14
  124. package/dist/web/standalone/.next/server/chunks/229.js +1 -1
  125. package/dist/web/standalone/.next/server/chunks/471.js +3 -3
  126. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  127. package/dist/web/standalone/.next/server/middleware.js +2 -2
  128. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  129. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  130. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  131. package/dist/web/standalone/.next/server/pages/500.html +2 -2
  132. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  133. package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
  134. package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
  135. package/dist/web/standalone/.next/static/chunks/app/page-6654a8cca61a3d1c.js +1 -0
  136. package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
  137. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
  138. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  139. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  140. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  141. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
  142. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
  143. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
  144. package/dist/web/standalone/server.js +1 -1
  145. package/dist/worktree-cli.js +1 -1
  146. package/package.json +1 -1
  147. package/packages/pi-coding-agent/package.json +1 -1
  148. package/pkg/package.json +1 -1
  149. package/src/resources/extensions/github-sync/tests/commit-linking.test.ts +8 -4
  150. package/src/resources/extensions/gsd/auto-dispatch.ts +18 -1
  151. package/src/resources/extensions/gsd/auto-post-unit.ts +18 -3
  152. package/src/resources/extensions/gsd/auto-worktree.ts +4 -2
  153. package/src/resources/extensions/gsd/commands/handlers/auto.ts +46 -3
  154. package/src/resources/extensions/gsd/git-service.ts +12 -11
  155. package/src/resources/extensions/gsd/prompts/discuss-headless.md +223 -56
  156. package/src/resources/extensions/gsd/prompts/run-uat.md +4 -4
  157. package/src/resources/extensions/gsd/tests/all-milestones-complete-merge.test.ts +2 -2
  158. package/src/resources/extensions/gsd/tests/auto-stash-merge.test.ts +1 -1
  159. package/src/resources/extensions/gsd/tests/auto-worktree-milestone-merge.test.ts +14 -12
  160. package/src/resources/extensions/gsd/tests/feature-branch-lifecycle-integration.test.ts +1 -1
  161. package/src/resources/extensions/gsd/tests/git-service.test.ts +19 -9
  162. package/src/resources/extensions/gsd/tests/milestone-transition-worktree.test.ts +2 -2
  163. package/src/resources/extensions/gsd/tests/parallel-merge.test.ts +6 -6
  164. package/src/resources/extensions/gsd/tests/run-uat.test.ts +68 -0
  165. package/src/resources/extensions/gsd/worktree-command.ts +1 -1
  166. package/dist/web/standalone/.next/static/chunks/app/page-12dd5ece0df4badc.js +0 -1
  167. package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
  168. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
  169. /package/dist/web/standalone/.next/static/{zGWUKFTfjCQerNgsPpAbF → ceckLbAMjhzHaQ3RPtJnT}/_buildManifest.js +0 -0
  170. /package/dist/web/standalone/.next/static/{zGWUKFTfjCQerNgsPpAbF → ceckLbAMjhzHaQ3RPtJnT}/_ssgManifest.js +0 -0
@@ -1,10 +1,33 @@
1
1
  import type { ExtensionAPI, ExtensionCommandContext } from "@gsd/pi-coding-agent";
2
2
 
3
+ import { existsSync, readFileSync } from "node:fs";
4
+ import { resolve } from "node:path";
5
+
3
6
  import { enableDebug } from "../../debug-logger.js";
4
7
  import { getAutoDashboardData, isAutoActive, isAutoPaused, pauseAuto, startAuto, stopAuto, stopAutoRemote } from "../../auto.js";
5
8
  import { handleRate } from "../../commands-rate.js";
6
9
  import { guardRemoteSession, projectRoot } from "../context.js";
7
10
 
11
+ /**
12
+ * Parse --yolo flag and optional file path from the auto command string.
13
+ * Supports: `/gsd auto --yolo path/to/file.md` or `/gsd auto -y path/to/file.md`
14
+ */
15
+ function parseYoloFlag(trimmed: string): { yoloSeedFile: string | null; rest: string } {
16
+ const yoloRe = /(?:--yolo|-y)\s+("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\S+)/;
17
+ const match = trimmed.match(yoloRe);
18
+ if (!match) return { yoloSeedFile: null, rest: trimmed };
19
+
20
+ // Strip quotes if present
21
+ let filePath = match[1];
22
+ if ((filePath.startsWith('"') && filePath.endsWith('"')) ||
23
+ (filePath.startsWith("'") && filePath.endsWith("'"))) {
24
+ filePath = filePath.slice(1, -1);
25
+ }
26
+
27
+ const rest = trimmed.replace(match[0], "").replace(/\s+/g, " ").trim();
28
+ return { yoloSeedFile: filePath, rest };
29
+ }
30
+
8
31
  export async function handleAutoCommand(trimmed: string, ctx: ExtensionCommandContext, pi: ExtensionAPI): Promise<boolean> {
9
32
  if (trimmed === "next" || trimmed.startsWith("next ")) {
10
33
  if (trimmed.includes("--dry-run")) {
@@ -21,11 +44,31 @@ export async function handleAutoCommand(trimmed: string, ctx: ExtensionCommandCo
21
44
  }
22
45
 
23
46
  if (trimmed === "auto" || trimmed.startsWith("auto ")) {
24
- const verboseMode = trimmed.includes("--verbose");
25
- const debugMode = trimmed.includes("--debug");
47
+ const { yoloSeedFile, rest } = parseYoloFlag(trimmed);
48
+ const verboseMode = rest.includes("--verbose");
49
+ const debugMode = rest.includes("--debug");
26
50
  if (debugMode) enableDebug(projectRoot());
27
51
  if (!(await guardRemoteSession(ctx, pi))) return true;
28
- await startAuto(ctx, pi, projectRoot(), verboseMode);
52
+
53
+ if (yoloSeedFile) {
54
+ const resolved = resolve(projectRoot(), yoloSeedFile);
55
+ if (!existsSync(resolved)) {
56
+ ctx.ui.notify(`Yolo seed file not found: ${resolved}`, "error");
57
+ return true;
58
+ }
59
+ const seedContent = readFileSync(resolved, "utf-8").trim();
60
+ if (!seedContent) {
61
+ ctx.ui.notify(`Yolo seed file is empty: ${resolved}`, "error");
62
+ return true;
63
+ }
64
+ // Headless path: bootstrap project, dispatch non-interactive discuss,
65
+ // then auto-mode starts automatically via checkAutoStartAfterDiscuss
66
+ // when the LLM says "Milestone X ready."
67
+ const { showHeadlessMilestoneCreation } = await import("../../guided-flow.js");
68
+ await showHeadlessMilestoneCreation(ctx, pi, projectRoot(), seedContent);
69
+ } else {
70
+ await startAuto(ctx, pi, projectRoot(), verboseMode);
71
+ }
29
72
  return true;
30
73
  }
31
74
 
@@ -102,23 +102,25 @@ export interface TaskCommitContext {
102
102
 
103
103
  /**
104
104
  * Build a meaningful conventional commit message from task execution context.
105
- * Format: `{type}({sliceId}/{taskId}): {description}`
105
+ * Format: `{type}: {description}` (clean conventional commit — no GSD IDs in subject).
106
+ *
107
+ * GSD metadata is placed in a `GSD-Task:` git trailer at the end of the body,
108
+ * following the same convention as `Signed-off-by:` or `Co-Authored-By:`.
106
109
  *
107
110
  * The description is the task summary one-liner if available (it describes
108
111
  * what was actually built), falling back to the task title (what was planned).
109
112
  */
110
113
  export function buildTaskCommitMessage(ctx: TaskCommitContext): string {
111
- const scope = ctx.taskId; // e.g. "S01/T02" or just "T02"
112
114
  const description = ctx.oneLiner || ctx.taskTitle;
113
115
  const type = inferCommitType(ctx.taskTitle, ctx.oneLiner);
114
116
 
115
- // Truncate description to ~72 chars for subject line
116
- const maxDescLen = 68 - type.length - scope.length;
117
+ // Truncate description to ~72 chars for subject line (full budget without scope)
118
+ const maxDescLen = 70 - type.length;
117
119
  const truncated = description.length > maxDescLen
118
120
  ? description.slice(0, maxDescLen - 1).trimEnd() + "…"
119
121
  : description;
120
122
 
121
- const subject = `${type}(${scope}): ${truncated}`;
123
+ const subject = `${type}: ${truncated}`;
122
124
 
123
125
  // Build body with key files if available
124
126
  const bodyParts: string[] = [];
@@ -131,15 +133,14 @@ export function buildTaskCommitMessage(ctx: TaskCommitContext): string {
131
133
  bodyParts.push(fileLines);
132
134
  }
133
135
 
136
+ // Trailers: GSD-Task first, then Resolves
137
+ bodyParts.push(`GSD-Task: ${ctx.taskId}`);
138
+
134
139
  if (ctx.issueNumber) {
135
140
  bodyParts.push(`Resolves #${ctx.issueNumber}`);
136
141
  }
137
142
 
138
- if (bodyParts.length > 0) {
139
- return `${subject}\n\n${bodyParts.join("\n\n")}`;
140
- }
141
-
142
- return subject;
143
+ return `${subject}\n\n${bodyParts.join("\n\n")}`;
143
144
  }
144
145
 
145
146
  /**
@@ -538,7 +539,7 @@ export class GitServiceImpl {
538
539
 
539
540
  const message = taskContext
540
541
  ? buildTaskCommitMessage(taskContext)
541
- : `chore(${unitId}): auto-commit after ${unitType}`;
542
+ : `chore: auto-commit after ${unitType}\n\nGSD-Unit: ${unitId}`;
542
543
  nativeCommit(this.basePath, message, { allowEmpty: false });
543
544
  return message;
544
545
  }
@@ -1,86 +1,253 @@
1
1
  # Headless Milestone Creation
2
2
 
3
- You are creating a GSD milestone from a provided specification document. This is a **headless** (non-interactive) flow — do NOT ask the user any questions. Work entirely from the provided specification.
3
+ You are creating a GSD milestone from a provided specification document. This is a **headless** (non-interactive) flow — do NOT ask the user any questions. Wherever the interactive flow would ask the user, make your best-judgment call and document it as an assumption.
4
4
 
5
5
  ## Provided Specification
6
6
 
7
7
  {{seedContext}}
8
8
 
9
- ## Your Task
9
+ ## Reflection Step
10
10
 
11
- ### Step 1: Reflect
11
+ Summarize your understanding of the specification concretely — not abstractly:
12
12
 
13
- Summarize your understanding of the specification concretely:
14
- - What is being built
15
- - Major capabilities/features
16
- - Scope estimate (how many milestones × slices)
17
- - Any ambiguities or gaps you notice
13
+ 1. Summarize what is being built in your own words.
14
+ 2. Give an honest size read: roughly how many milestones, roughly how many slices in the first one. Base this on the actual work involved, not a classification label.
15
+ 3. Include scope honesty — a bullet list of the major capabilities: "Here's what I'm reading from the spec: [bullet list of major capabilities]."
16
+ 4. Note any ambiguities, gaps, or areas where the spec is vague.
18
17
 
19
- ### Step 2: Investigate (brief)
18
+ Print this reflection in chat. Do not skip this step.
20
19
 
21
- Quickly scout the codebase to understand what already exists — spend no more than 5-6 tool calls here:
22
- - `ls` the project root and key directories
23
- - Search for relevant existing code, patterns, dependencies
24
- - Check library docs if needed (`resolve_library` / `get_library_docs`)
20
+ ## Vision Mapping
25
21
 
26
- Then move on to writing artifacts. Do not explore exhaustively — the research phase will do deeper investigation later.
22
+ Decide the approach based on the actual scope:
27
23
 
28
- ### Step 3: Make Decisions
24
+ **If the work spans multiple milestones:** Map the full landscape:
25
+ 1. Propose a milestone sequence — names, one-line intents, rough dependencies
26
+ 2. Print this in chat as the working milestone sequence
29
27
 
30
- For any ambiguities or gaps in the specification:
31
- - Make your best-guess decision based on the spec's intent, codebase patterns, and domain conventions
32
- - Document each assumption clearly in the Context file
28
+ **If the work fits in a single milestone:** Proceed directly to investigation.
33
29
 
34
- ### Step 4: Assess Scope
30
+ **Anti-reduction rule:** If the spec describes a big vision, plan the big vision. Do not reduce scope. Phase complex/risky work into later milestones — do not cut it. The spec's ambition is the target, and your job is to sequence it intelligently, not shrink it.
35
31
 
36
- Based on reflection + investigation:
37
- - Is this a single milestone or multiple milestones?
38
- - If multi-milestone: plan the full sequence with dependencies
32
+ ## Mandatory Investigation
39
33
 
40
- ### Step 5: Write Artifacts
34
+ Do a mandatory investigation pass before making any decisions. This is not optional.
41
35
 
42
- **Milestone ID**: {{milestoneId}}
36
+ 1. **Scout the codebase** — `ls`, `find`, `rg`, or `scout` for broad unfamiliar areas. Understand what already exists, what patterns are established, what constraints current code imposes.
37
+ 2. **Check library docs** — `resolve_library` / `get_library_docs` for any tech mentioned in the spec. Get current facts about capabilities, constraints, API shapes, version-specific behavior.
38
+ 3. **Web search** — `search-the-web` if the domain is unfamiliar, if you need current best practices, or if the spec references external services/APIs you need facts about. Use `fetch_page` for full content when snippets aren't enough.
43
39
 
44
- Use these templates exactly:
40
+ **Web search budget:** Budget carefully across investigation + focused research:
41
+ - Prefer `resolve_library` / `get_library_docs` over `web_search` for library documentation.
42
+ - Prefer `search_and_read` for one-shot topic research.
43
+ - Target 2-3 web searches in this investigation pass. Save remaining budget for focused research.
44
+ - Do NOT repeat the same or similar queries.
45
45
 
46
- {{inlinedTemplates}}
46
+ The goal: your decisions should reflect what's actually true in the codebase and ecosystem, not what you assume.
47
+
48
+ ## Autonomous Decision-Making
49
+
50
+ For every area where the spec is ambiguous, vague, or silent:
51
+
52
+ - Apply the depth checklist (below) to identify what needs resolution
53
+ - Make your best-judgment call based on: the spec's intent, codebase patterns, domain conventions, and investigation findings
54
+ - **Document every assumption** in the Context file under an "Assumptions" section
55
+ - For each assumption, note: what the spec said (or didn't say), what you decided, and why
56
+
57
+ ### Depth Checklist
58
+
59
+ Ensure ALL of these are resolved before writing artifacts — from the spec + investigation, not by asking:
60
+
61
+ - [ ] **What is being built** — concrete enough that you could explain it to a stranger
62
+ - [ ] **Why it needs to exist** — the problem it solves or the desire it fulfills
63
+ - [ ] **Who it's for** — even if just the spec author
64
+ - [ ] **What "done" looks like** — observable outcomes, not abstract goals
65
+ - [ ] **The biggest technical unknowns / risks** — what could fail, what hasn't been proven
66
+ - [ ] **What external systems/services this touches** — APIs, databases, third-party services, hardware
67
+
68
+ If the spec leaves any of these unresolved, make your best-judgment call and document it.
69
+
70
+ ## Depth Verification
71
+
72
+ Print a structured depth summary in chat covering:
73
+ - What you understood the spec to describe
74
+ - Key technical findings from investigation
75
+ - Assumptions you made and why
76
+ - Areas where you're least confident
77
+
78
+ This is your audit trail. Print it — do not skip it.
79
+
80
+ ## Focused Research
81
+
82
+ Do a focused research pass before roadmap creation.
83
+
84
+ Research is advisory, not auto-binding. Use the spec + investigation to identify:
85
+ - table stakes the product space usually expects
86
+ - domain-standard behaviors that may be implied but not stated
87
+ - likely omissions that would make the product feel incomplete
88
+ - plausible anti-features or scope traps
89
+ - differentiators worth preserving
90
+
91
+ For multi-milestone visions, research should cover the full landscape, not just the first milestone. Research findings may affect milestone sequencing, not just slice ordering within M001.
92
+
93
+ **Key difference from interactive flow:** Where the interactive flow would present research-surfaced candidate requirements for the user to confirm/defer/reject, you instead apply your best judgment. If a research finding clearly aligns with the spec's intent, include it. If it's tangential or would expand scope beyond what the spec describes, defer it or mark it out of scope. Document the reasoning.
94
+
95
+ ## Capability Contract
96
+
97
+ Before writing a roadmap, produce `.gsd/REQUIREMENTS.md`.
98
+
99
+ Use it as the project's explicit capability contract.
100
+
101
+ Requirements must be organized into:
102
+ - Active
103
+ - Validated
104
+ - Deferred
105
+ - Out of Scope
106
+ - Traceability
107
+
108
+ Each requirement should include:
109
+ - stable ID (`R###`)
110
+ - title
111
+ - class
112
+ - status
113
+ - description
114
+ - why it matters
115
+ - source (`spec`, `inferred`, `research`, or `execution`)
116
+ - primary owning slice
117
+ - supporting slices
118
+ - validation status
119
+ - notes
120
+
121
+ Rules:
122
+ - Keep requirements capability-oriented, not a giant feature inventory
123
+ - Every Active requirement must either be mapped to a roadmap owner, explicitly deferred, blocked with reason, or moved out of scope
124
+ - Product-facing work should capture launchability, primary user loop, continuity, and failure visibility when relevant
125
+ - Later milestones may have provisional ownership, but the first planned milestone should map requirements to concrete slices wherever possible
126
+
127
+ For multi-milestone projects, requirements should span the full vision. Requirements owned by later milestones get provisional ownership. The full requirement set captures the spec's complete vision — milestones are the sequencing strategy, not the scope boundary.
128
+
129
+ **Print the requirements in chat before writing the roadmap.** Print a markdown table with columns: ID, Title, Status, Owner, Source. Group by status (Active, Deferred, Out of Scope).
130
+
131
+ ## Scope Assessment
132
+
133
+ Confirm the size estimate from your reflection still holds. Investigation and research often reveal hidden complexity or simplify things. If the scope grew or shrank significantly, adjust the milestone and slice counts accordingly.
134
+
135
+ ## Output Phase
136
+
137
+ ### Roadmap Preview
138
+
139
+ Before writing any files, **print the planned roadmap in chat**. Print a markdown table with columns: Slice, Title, Risk, Depends, Demo. One row per slice. Below the table, print the milestone definition of done as a bullet list.
140
+
141
+ This is the user's audit trail in the TUI scrollback — do not skip it.
142
+
143
+ ### Naming Convention
47
144
 
48
- **For single milestone**, write in this order:
145
+ Directories use bare IDs. Files use ID-SUFFIX format. Titles live inside file content, not in names.
146
+ - Milestone dir: `.gsd/milestones/{{milestoneId}}/`
147
+ - Milestone files: `{{milestoneId}}-CONTEXT.md`, `{{milestoneId}}-ROADMAP.md`
148
+ - Slice dirs: `S01/`, `S02/`, etc.
149
+
150
+ ### Single Milestone
151
+
152
+ In a single pass:
49
153
  1. `mkdir -p .gsd/milestones/{{milestoneId}}/slices`
50
- 2. Write `.gsd/PROJECT.md` (using Project template)
51
- 3. Write `.gsd/REQUIREMENTS.md` (using Requirements template)
52
- 4. Write `{{contextPath}}` (using Context template) — preserve the specification's exact terminology, emphasis, and specific framing. Do not paraphrase domain-specific language into generics. Document assumptions under an "Assumptions" section.
53
- 5. Write `{{roadmapPath}}` (using Roadmap template) — decompose into demoable vertical slices with checkboxes, risk, depends, demo sentences, proof strategy, verification classes, milestone definition of done, requirement coverage, and a boundary map. If the milestone crosses multiple runtime boundaries, include an explicit final integration slice.
54
- 6. Seed `.gsd/DECISIONS.md` (using Decisions template)
154
+ 2. Write or update `.gsd/PROJECT.md` use the **Project** output template below. Describe what the project is, its current state, and list the milestone sequence.
155
+ 3. Write or update `.gsd/REQUIREMENTS.md` use the **Requirements** output template below. Confirm requirement states, ownership, and traceability before roadmap creation.
156
+
157
+ **Depth-Preservation Guidance for context.md:**
158
+ Preserve the specification's exact terminology, emphasis, and specific framing. Do not paraphrase domain-specific language into generics. If the spec said "craft feel," write "craft feel" — not "high-quality user experience." The context file is downstream agents' only window into this conversation — flattening specifics into generics loses the signal that shaped every decision.
159
+
160
+ 4. Write `{{contextPath}}` — use the **Context** output template below. Preserve key risks, unknowns, existing codebase constraints, integration points, and relevant requirements surfaced during research. Include an "Assumptions" section documenting every judgment call.
161
+ 5. Call `gsd_plan_milestone` to create the roadmap. Decompose into demoable vertical slices with risk, depends, demo sentences, proof strategy, verification classes, milestone definition of done, requirement coverage, and a boundary map. If the milestone crosses multiple runtime boundaries, include an explicit final integration slice that proves the assembled system works end-to-end in a real environment. Use the **Roadmap** output template below to structure the tool call parameters.
162
+ 6. For each architectural or pattern decision, call `gsd_decision_save` — the tool auto-assigns IDs and regenerates `.gsd/DECISIONS.md` automatically.
55
163
  7. {{commitInstruction}}
56
- 9. Say exactly: "Milestone {{milestoneId}} ready."
57
164
 
58
- **For multi-milestone**, write in this order:
165
+ After writing the files, say exactly: "Milestone {{milestoneId}} ready." — nothing else. Auto-mode will start automatically.
166
+
167
+ ### Multi-Milestone
168
+
169
+ #### Phase 1: Shared artifacts
170
+
59
171
  1. For each milestone, call `gsd_milestone_generate_id` to get its ID — never invent milestone IDs manually. Then `mkdir -p .gsd/milestones/<ID>/slices` for each.
60
- 2. Write `.gsd/PROJECT.md` — full vision across ALL milestones (using Project template)
61
- 3. Write `.gsd/REQUIREMENTS.md` — full capability contract (using Requirements template)
62
- 4. Seed `.gsd/DECISIONS.md` (using Decisions template)
63
- 5. Write PRIMARY `{{contextPath}}` — full context with all assumptions documented
64
- 6. Write PRIMARY `{{roadmapPath}}` — detailed slices for the first milestone only
65
- 7. For each remaining milestone, write full CONTEXT.md with `depends_on` frontmatter:
66
- ```yaml
67
- ---
68
- depends_on: [M001, M002]
69
- ---
70
-
71
- # M003: Title
72
- ```
73
- Each context file should be rich enough that a future agent — with no memory of this conversation — can understand the intent, constraints, dependencies, what the milestone unlocks, and what "done" looks like.
74
- 8. {{multiMilestoneCommitInstruction}}
75
- 10. Say exactly: "Milestone {{milestoneId}} ready."
172
+ 2. Write `.gsd/PROJECT.md` — use the **Project** output template below.
173
+ 3. Write `.gsd/REQUIREMENTS.md` — use the **Requirements** output template below. Capture Active, Deferred, Out of Scope, and any already Validated requirements. Later milestones may have provisional ownership where slice plans do not exist yet.
174
+ 4. For any architectural or pattern decisions, call `gsd_decision_save` — the tool auto-assigns IDs and regenerates `.gsd/DECISIONS.md` automatically.
175
+
176
+ #### Phase 2: Primary milestone
177
+
178
+ 5. Write a full `CONTEXT.md` for the primary milestone (the first in sequence). Include an "Assumptions" section.
179
+ 6. Call `gsd_plan_milestone` for **only the primary milestone** — detail-planning later milestones now is waste because the codebase will change. Include requirement coverage and a milestone definition of done.
180
+
181
+ #### MANDATORY: depends_on Frontmatter in CONTEXT.md
182
+
183
+ Every CONTEXT.md for a milestone that depends on other milestones MUST have YAML frontmatter with `depends_on`. The auto-mode state machine reads this field to determine execution order — without it, milestones may execute out of order or in parallel when they shouldn't.
184
+
185
+ ```yaml
186
+ ---
187
+ depends_on: [M001, M002]
188
+ ---
189
+
190
+ # M003: Title
191
+ ```
192
+
193
+ If a milestone has no dependencies, omit the frontmatter. Do NOT rely on QUEUE.md or PROJECT.md for dependency tracking — the state machine only reads CONTEXT.md frontmatter.
194
+
195
+ #### Phase 3: Remaining milestones
196
+
197
+ For each remaining milestone, in dependency order, autonomously decide the best readiness mode:
198
+
199
+ - **Write full context** — if the spec provides enough detail for this milestone and investigation confirms feasibility. Write a full `CONTEXT.md` with technical assumptions verified against the actual codebase.
200
+ - **Write draft for later** — if the spec has seed material but the milestone needs its own investigation/research in a future session. Write a `CONTEXT-DRAFT.md` capturing seed material, key ideas, provisional scope, and open questions. **Downstream:** Auto-mode pauses at this milestone and prompts the user to discuss.
201
+ - **Just queue it** — if the milestone is identified but the spec provides no actionable detail. No context file written. **Downstream:** Auto-mode pauses and starts a full discussion from scratch.
202
+
203
+ **Default to writing full context** when the spec is detailed enough. Default to draft when the spec mentions the milestone but is vague. Default to queue when the milestone is implied by the vision but not described.
204
+
205
+ **Technical Assumption Verification is still MANDATORY** for full-context milestones:
206
+ 1. Read the actual code for every file or module you reference. Confirm APIs exist, check what functions actually do.
207
+ 2. Check for stale assumptions — verify referenced modules still work as described.
208
+ 3. Print findings in chat before writing each milestone's CONTEXT.md.
209
+
210
+ Each context file (full or draft) should be rich enough that a future agent encountering it fresh — with no memory of this conversation — can understand the intent, constraints, dependencies, what this milestone unlocks, and what "done" looks like.
211
+
212
+ #### Milestone Gate Tracking (MANDATORY for multi-milestone)
213
+
214
+ After deciding each milestone's readiness, immediately write or update `.gsd/DISCUSSION-MANIFEST.json`:
215
+
216
+ ```json
217
+ {
218
+ "primary": "M001",
219
+ "milestones": {
220
+ "M001": { "gate": "discussed", "context": "full" },
221
+ "M002": { "gate": "discussed", "context": "full" },
222
+ "M003": { "gate": "queued", "context": "none" }
223
+ },
224
+ "total": 3,
225
+ "gates_completed": 3
226
+ }
227
+ ```
228
+
229
+ Write this file AFTER each gate decision, not just at the end. Update `gates_completed` incrementally. The system reads this file and BLOCKS auto-start if `gates_completed < total`.
230
+
231
+ For single-milestone projects, do NOT write this file.
232
+
233
+ #### Phase 4: Finalize
234
+
235
+ 7. {{multiMilestoneCommitInstruction}}
236
+
237
+ After writing the files, say exactly: "Milestone {{milestoneId}} ready." — nothing else. Auto-mode will start automatically.
76
238
 
77
239
  ## Critical Rules
78
240
 
79
- - **DO NOT ask the user any questions** — this is headless mode
241
+ - **DO NOT ask the user any questions** — this is headless mode. Make judgment calls and document them.
80
242
  - **Preserve the specification's terminology** — don't paraphrase domain-specific language
81
- - **Document assumptions** — when you make a judgment call, note it in CONTEXT.md under "Assumptions"
82
- - **Investigate before writing** — always scout the codebase first
83
- - **Use depends_on frontmatter** for multi-milestone sequences (the state machine reads this field to determine execution order)
84
- - **Anti-reduction rule** — if the spec describes a big vision, plan the big vision. Do not ask "what's the minimum viable version?" or reduce scope. Phase complex/risky work into later milestones — do not cut it.
85
- - **Naming convention** — always use `gsd_milestone_generate_id` to get milestone IDs. Directories use bare IDs (e.g. `M001/` or `M001-r5jzab/`), files use ID-SUFFIX format (e.g. `M001-CONTEXT.md` or `M001-r5jzab-CONTEXT.md`). Never invent milestone IDs manually.
243
+ - **Document assumptions** — every judgment call gets noted in CONTEXT.md under "Assumptions" with reasoning
244
+ - **Investigate thoroughly** — scout codebase, check library docs, web search. Same rigor as interactive mode.
245
+ - **Do focused research** identify table stakes, domain standards, omissions, scope traps. Same rigor as interactive mode.
246
+ - **Use proper tools** — `gsd_plan_milestone` for roadmaps, `gsd_decision_save` for decisions, `gsd_milestone_generate_id` for IDs
247
+ - **Print artifacts in chat** — requirements table, roadmap preview, depth summary. The TUI scrollback is the user's audit trail.
248
+ - **Use depends_on frontmatter** for multi-milestone sequences
249
+ - **Anti-reduction rule** — if the spec describes a big vision, plan the big vision. Phase complexity — don't cut it.
250
+ - **Naming convention** — always use `gsd_milestone_generate_id` for IDs. Directories use bare IDs, files use ID-SUFFIX format.
86
251
  - **End with "Milestone {{milestoneId}} ready."** — this triggers auto-start detection
252
+
253
+ {{inlinedTemplates}}
@@ -29,7 +29,7 @@ You are the UAT runner. Execute every check defined in `{{uatPath}}` as deeply a
29
29
  - `runtime-executable` — execute the specified command or script. Capture stdout/stderr as evidence. Record pass/fail based on exit code and output.
30
30
  - `live-runtime` — exercise the real runtime path. Start or connect to the app/service if needed, use browser/runtime/network checks, and verify observable behavior.
31
31
  - `mixed` — run all automatable artifact-driven and live-runtime checks. Separate any remaining human-only checks explicitly.
32
- - `human-experience` — automate setup, preconditions, screenshots, logs, and objective checks, but do **not** invent subjective PASS results. Mark taste-based, experiential, or purely human-judgment checks as `NEEDS-HUMAN` and use an overall verdict of `PARTIAL` unless every required check was objective and passed.
32
+ - `human-experience` — automate setup, preconditions, screenshots, logs, and objective checks, but do **not** invent subjective PASS results. Mark taste-based, experiential, or purely human-judgment checks as `NEEDS-HUMAN`. Use an overall verdict of `PASS` when all automatable checks succeed (even if human-only checks remain as `NEEDS-HUMAN`). Use `PARTIAL` only when automatable checks themselves were inconclusive.
33
33
 
34
34
  ### Evidence tools
35
35
 
@@ -51,9 +51,9 @@ For each check, record:
51
51
  - `PASS`, `FAIL`, or `NEEDS-HUMAN`
52
52
 
53
53
  After running all checks, compute the **overall verdict**:
54
- - `PASS` — all required checks passed and no human-only checks remain
55
- - `FAIL` — one or more checks failed
56
- - `PARTIAL` — some checks passed, but one or more checks were skipped, inconclusive, or still require human judgment
54
+ - `PASS` — all automatable checks passed. Any remaining checks that honestly require human judgment are marked `NEEDS-HUMAN` with clear instructions for the human reviewer. (This is the correct verdict for mixed/human-experience/live-runtime modes when all automatable checks succeed.)
55
+ - `FAIL` — one or more automatable checks failed
56
+ - `PARTIAL` — one or more automatable checks were skipped or returned inconclusive results (not the same as `NEEDS-HUMAN` — use PARTIAL only when the agent itself could not determine pass/fail for a check it was supposed to automate)
57
57
 
58
58
  Call `gsd_summary_save` with `milestone_id: {{milestoneId}}`, `slice_id: {{sliceId}}`, `artifact_type: "ASSESSMENT"`, and the full UAT result markdown as `content` — the tool computes the file path and persists to both DB and disk. The content should follow this format:
59
59
 
@@ -183,8 +183,8 @@ test("single milestone worktree is merged to main when all complete (#962)", (t)
183
183
  "milestone branch should be deleted",
184
184
  );
185
185
 
186
- // Verify squash commit on main
187
- const log = run("git log --oneline -3", tempDir);
186
+ // Verify squash commit on main (milestone ID is in trailer, not subject)
187
+ const log = run("git log -3", tempDir);
188
188
  assert.ok(
189
189
  log.includes("M001"),
190
190
  "squash commit on main should reference M001",
@@ -76,7 +76,7 @@ test("#2151 bug 1: auto-stash unblocks merge when unrelated files are dirty", ()
76
76
 
77
77
  // Should succeed — the dirty README.md is auto-stashed before merge.
78
78
  const result = mergeMilestoneToMain(repo, "M200", roadmap);
79
- assert.ok(result.commitMessage.includes("feat(M200)"), "merge succeeds with dirty unrelated file");
79
+ assert.ok(result.commitMessage.includes("feat:") && result.commitMessage.includes("GSD-Milestone: M200"), "merge succeeds with dirty unrelated file");
80
80
  assert.ok(existsSync(join(repo, "stash-test.ts")), "milestone code merged to main");
81
81
 
82
82
  // Verify the dirty file was restored (stash popped).
@@ -160,15 +160,17 @@ describe("auto-worktree-milestone-merge", () => {
160
160
 
161
161
  const result = mergeMilestoneToMain(repo, "M020", roadmap);
162
162
 
163
- assert.match(result.commitMessage, /^feat\(M020\):/, "subject has conventional commit prefix");
163
+ assert.match(result.commitMessage, /^feat:/, "subject has conventional commit prefix without milestone ID");
164
164
  assert.ok(result.commitMessage.includes("Backend foundation"), "subject includes milestone title");
165
165
  assert.ok(result.commitMessage.includes("- S01: Core API"), "body lists S01");
166
166
  assert.ok(result.commitMessage.includes("- S02: Error handling"), "body lists S02");
167
167
  assert.ok(result.commitMessage.includes("- S03: Logging infra"), "body lists S03");
168
+ assert.ok(result.commitMessage.includes("GSD-Milestone: M020"), "body has GSD-Milestone trailer");
168
169
  assert.ok(result.commitMessage.includes("Branch: milestone/M020"), "body has branch metadata");
169
170
 
170
171
  const gitMsg = run("git log -1 --format=%B main", repo).trim();
171
- assert.match(gitMsg, /^feat\(M020\):/, "git commit message starts with feat(M020):");
172
+ assert.match(gitMsg, /^feat:/, "git commit message starts with feat:");
173
+ assert.ok(gitMsg.includes("GSD-Milestone: M020"), "git commit has GSD-Milestone trailer");
172
174
  assert.ok(gitMsg.includes("- S01: Core API"), "git commit body has S01");
173
175
  });
174
176
 
@@ -213,11 +215,11 @@ describe("auto-worktree-milestone-merge", () => {
213
215
  const result = mergeMilestoneToMain(repo, "M040", roadmap);
214
216
 
215
217
  const mainLog = run("git log --oneline main", repo);
216
- assert.ok(mainLog.includes("feat(M040)"), "milestone commit on main");
218
+ assert.ok(mainLog.includes("feat:"), "milestone commit on main");
217
219
 
218
220
  run("git push origin main", repo);
219
221
  const remoteLog = run("git log --oneline main", bareDir);
220
- assert.ok(remoteLog.includes("feat(M040)"), "milestone commit reachable on remote after manual push");
222
+ assert.ok(remoteLog.includes("feat:"), "milestone commit reachable on remote after manual push");
221
223
 
222
224
  assert.strictEqual(typeof result.pushed, "boolean", "pushed flag remains boolean");
223
225
  });
@@ -248,7 +250,7 @@ describe("auto-worktree-milestone-merge", () => {
248
250
  let threw = false;
249
251
  try {
250
252
  const result = mergeMilestoneToMain(repo, "M050", roadmap);
251
- assert.ok(result.commitMessage.includes("feat(M050)"), "merge commit created despite .gsd conflict");
253
+ assert.ok(result.commitMessage.includes("feat:") && result.commitMessage.includes("GSD-Milestone: M050"), "merge commit created despite .gsd conflict");
252
254
  } catch (err) {
253
255
  threw = true;
254
256
  }
@@ -274,7 +276,7 @@ describe("auto-worktree-milestone-merge", () => {
274
276
  let threw = false;
275
277
  try {
276
278
  const result = mergeMilestoneToMain(repo, "M060", roadmap);
277
- assert.ok(result.commitMessage.includes("feat(M060)"), "merge commit created");
279
+ assert.ok(result.commitMessage.includes("feat:") && result.commitMessage.includes("GSD-Milestone: M060"), "merge commit created");
278
280
  } catch (err) {
279
281
  threw = true;
280
282
  }
@@ -312,7 +314,7 @@ describe("auto-worktree-milestone-merge", () => {
312
314
  let errMsg = "";
313
315
  try {
314
316
  const result = mergeMilestoneToMain(dir, "M070", roadmap);
315
- assert.ok(result.commitMessage.includes("feat(M070)"), "merge commit created on master");
317
+ assert.ok(result.commitMessage.includes("feat:") && result.commitMessage.includes("GSD-Milestone: M070"), "merge commit created on master");
316
318
  } catch (err) {
317
319
  threw = true;
318
320
  errMsg = err instanceof Error ? err.message : String(err);
@@ -392,7 +394,7 @@ describe("auto-worktree-milestone-merge", () => {
392
394
  let threw = false;
393
395
  try {
394
396
  const result = mergeMilestoneToMain(repo, "M090", roadmap);
395
- assert.ok(result.commitMessage.includes("feat(M090)"), "#1738 merge succeeds after cleaning synced dirs");
397
+ assert.ok(result.commitMessage.includes("feat:") && result.commitMessage.includes("GSD-Milestone: M090"), "#1738 merge succeeds after cleaning synced dirs");
396
398
  } catch (err: unknown) {
397
399
  threw = true;
398
400
  }
@@ -419,7 +421,7 @@ describe("auto-worktree-milestone-merge", () => {
419
421
  let threw = false;
420
422
  try {
421
423
  const result = mergeMilestoneToMain(repo, "M100", roadmap);
422
- assert.ok(result.commitMessage.includes("feat(M100)"), "#2151: merge succeeds after stashing dirty files");
424
+ assert.ok(result.commitMessage.includes("feat:") && result.commitMessage.includes("GSD-Milestone: M100"), "#2151: merge succeeds after stashing dirty files");
423
425
  } catch {
424
426
  threw = true;
425
427
  }
@@ -519,7 +521,7 @@ describe("auto-worktree-milestone-merge", () => {
519
521
  let errMsg = "";
520
522
  try {
521
523
  const result = mergeMilestoneToMain(repo, "M140", roadmap);
522
- assert.ok(result.commitMessage.includes("feat(M140)"), "merge commit created");
524
+ assert.ok(result.commitMessage.includes("feat:") && result.commitMessage.includes("GSD-Milestone: M140"), "merge commit created");
523
525
  } catch (err) {
524
526
  threw = true;
525
527
  errMsg = err instanceof Error ? err.message : String(err);
@@ -589,7 +591,7 @@ describe("auto-worktree-milestone-merge", () => {
589
591
  assert.ok(existsSync(squashMsgPath), "SQUASH_MSG planted before merge");
590
592
 
591
593
  const result = mergeMilestoneToMain(repo, "M160", roadmap);
592
- assert.ok(result.commitMessage.includes("feat(M160)"), "merge commit created");
594
+ assert.ok(result.commitMessage.includes("feat:") && result.commitMessage.includes("GSD-Milestone: M160"), "merge commit created");
593
595
 
594
596
  assert.ok(!existsSync(squashMsgPath), "#1853: SQUASH_MSG must not persist after successful squash-merge");
595
597
  });
@@ -609,7 +611,7 @@ describe("auto-worktree-milestone-merge", () => {
609
611
  ]);
610
612
 
611
613
  const result = mergeMilestoneToMain(repo, "M170", roadmap);
612
- assert.ok(result.commitMessage.includes("feat(M170)"), "merge commit created");
614
+ assert.ok(result.commitMessage.includes("feat:") && result.commitMessage.includes("GSD-Milestone: M170"), "merge commit created");
613
615
 
614
616
  assert.ok(
615
617
  existsSync(join(repo, "uncommitted-agent-code.ts")),
@@ -252,7 +252,7 @@ describe('feature-branch-lifecycle-integration', async () => {
252
252
  // Exactly one new commit on feature branch (the squash merge)
253
253
  const featureLog = run(`git log --oneline ${featureBranch}`, repo);
254
254
  assert.ok(
255
- featureLog.includes(`feat(${milestoneId})`),
255
+ featureLog.includes("feat:"),
256
256
  "feature branch has milestone merge commit",
257
257
  );
258
258