@opengsd/gsd-pi 1.2.0-dev.d6c5343c → 1.2.0-dev.ddc97c10

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 (225) hide show
  1. package/dist/mcp-server.js +2 -1
  2. package/dist/resources/.managed-resources-content-hash +1 -1
  3. package/dist/resources/extensions/gsd/auto/orchestrator.js +28 -10
  4. package/dist/resources/extensions/gsd/auto/phases.js +47 -4
  5. package/dist/resources/extensions/gsd/auto/session.js +3 -0
  6. package/dist/resources/extensions/gsd/auto-direct-dispatch.js +3 -2
  7. package/dist/resources/extensions/gsd/auto-dispatch.js +11 -2
  8. package/dist/resources/extensions/gsd/auto-model-selection.js +11 -7
  9. package/dist/resources/extensions/gsd/auto-post-unit.js +18 -6
  10. package/dist/resources/extensions/gsd/auto-unit-closeout.js +45 -21
  11. package/dist/resources/extensions/gsd/auto-verification.js +14 -2
  12. package/dist/resources/extensions/gsd/auto.js +37 -1
  13. package/dist/resources/extensions/gsd/blocked-models.js +28 -0
  14. package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +26 -6
  15. package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +2 -2
  16. package/dist/resources/extensions/gsd/closeout-wizard.js +92 -0
  17. package/dist/resources/extensions/gsd/commands/context.js +16 -2
  18. package/dist/resources/extensions/gsd/commands-handlers.js +46 -3
  19. package/dist/resources/extensions/gsd/consent-question.js +16 -0
  20. package/dist/resources/extensions/gsd/crash-recovery.js +8 -3
  21. package/dist/resources/extensions/gsd/doctor-engine-checks.js +3 -3
  22. package/dist/resources/extensions/gsd/doctor-git-checks.js +2 -18
  23. package/dist/resources/extensions/gsd/gsd-command-home.js +22 -12
  24. package/dist/resources/extensions/gsd/gsd-db.js +2 -1
  25. package/dist/resources/extensions/gsd/guided-flow.js +6 -3
  26. package/dist/resources/extensions/gsd/milestone-closeout.js +73 -2
  27. package/dist/resources/extensions/gsd/milestone-planning-persistence.js +2 -2
  28. package/dist/resources/extensions/gsd/projection-flush.js +7 -0
  29. package/dist/resources/extensions/gsd/prompts/complete-slice.md +1 -1
  30. package/dist/resources/extensions/gsd/prompts/execute-task.md +1 -1
  31. package/dist/resources/extensions/gsd/prompts/plan-milestone.md +1 -1
  32. package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
  33. package/dist/resources/extensions/gsd/prompts/quick-task.md +1 -1
  34. package/dist/resources/extensions/gsd/prompts/reassess-roadmap.md +1 -1
  35. package/dist/resources/extensions/gsd/prompts/refine-slice.md +1 -1
  36. package/dist/resources/extensions/gsd/prompts/replan-slice.md +1 -1
  37. package/dist/resources/extensions/gsd/prompts/research-milestone.md +1 -1
  38. package/dist/resources/extensions/gsd/prompts/research-slice.md +1 -1
  39. package/dist/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
  40. package/dist/resources/extensions/gsd/prompts/run-uat.md +1 -1
  41. package/dist/resources/extensions/gsd/prompts/triage-captures.md +1 -1
  42. package/dist/resources/extensions/gsd/prompts/validate-milestone.md +1 -1
  43. package/dist/resources/extensions/gsd/roadmap-slices.js +25 -3
  44. package/dist/resources/extensions/gsd/session-lock.js +1 -1
  45. package/dist/resources/extensions/gsd/tool-contract.js +14 -3
  46. package/dist/resources/extensions/gsd/tools/complete-milestone.js +3 -2
  47. package/dist/resources/extensions/gsd/tools/complete-slice.js +2 -2
  48. package/dist/resources/extensions/gsd/tools/complete-task.js +3 -2
  49. package/dist/resources/extensions/gsd/tools/plan-slice.js +2 -2
  50. package/dist/resources/extensions/gsd/tools/plan-task.js +2 -2
  51. package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +2 -2
  52. package/dist/resources/extensions/gsd/tools/reopen-milestone.js +2 -2
  53. package/dist/resources/extensions/gsd/tools/reopen-slice.js +2 -2
  54. package/dist/resources/extensions/gsd/tools/reopen-task.js +2 -2
  55. package/dist/resources/extensions/gsd/tools/replan-slice.js +2 -2
  56. package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +67 -2
  57. package/dist/resources/extensions/gsd/verification-verdict.js +2 -1
  58. package/dist/resources/extensions/shared/gsd-browser-cli.js +21 -2
  59. package/dist/resources/shared/gsd-browser-path-sync.js +214 -0
  60. package/dist/resources/shared/package-manager-detection.js +1 -1
  61. package/dist/tsconfig.extensions.tsbuildinfo +1 -1
  62. package/dist/update-check.d.ts +2 -0
  63. package/dist/update-check.js +24 -1
  64. package/dist/update-cmd.js +20 -3
  65. package/dist/web/standalone/.next/BUILD_ID +1 -1
  66. package/dist/web/standalone/.next/app-path-routes-manifest.json +12 -12
  67. package/dist/web/standalone/.next/build-manifest.json +2 -2
  68. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  69. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  70. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  71. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  72. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  73. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  74. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  75. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  76. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  77. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  78. package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
  79. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  80. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  81. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  82. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  83. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  84. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  85. package/dist/web/standalone/.next/server/app/index.html +1 -1
  86. package/dist/web/standalone/.next/server/app/index.rsc +1 -1
  87. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  88. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
  89. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  90. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
  91. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  92. package/dist/web/standalone/.next/server/app-paths-manifest.json +12 -12
  93. package/dist/web/standalone/.next/server/chunks/8357.js +2 -2
  94. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  95. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  96. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  97. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  98. package/dist/web/standalone/node_modules/node-pty/build/Makefile +1 -1
  99. package/package.json +1 -1
  100. package/packages/cloud-mcp-gateway/package.json +2 -2
  101. package/packages/contracts/package.json +1 -1
  102. package/packages/daemon/package.json +4 -4
  103. package/packages/gsd-agent-core/package.json +5 -5
  104. package/packages/gsd-agent-modes/package.json +7 -7
  105. package/packages/mcp-server/dist/cli.js +10 -5
  106. package/packages/mcp-server/dist/cli.js.map +1 -1
  107. package/packages/mcp-server/dist/moonshot-tool-schema.d.ts +29 -0
  108. package/packages/mcp-server/dist/moonshot-tool-schema.d.ts.map +1 -0
  109. package/packages/mcp-server/dist/moonshot-tool-schema.js +50 -0
  110. package/packages/mcp-server/dist/moonshot-tool-schema.js.map +1 -0
  111. package/packages/mcp-server/dist/server.d.ts.map +1 -1
  112. package/packages/mcp-server/dist/server.js +4 -0
  113. package/packages/mcp-server/dist/server.js.map +1 -1
  114. package/packages/mcp-server/dist/workflow-tools.d.ts +18 -18
  115. package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
  116. package/packages/mcp-server/dist/workflow-tools.js +99 -38
  117. package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
  118. package/packages/mcp-server/package.json +5 -4
  119. package/packages/native/package.json +1 -1
  120. package/packages/pi-agent-core/package.json +1 -1
  121. package/packages/pi-ai/dist/index.d.ts +2 -0
  122. package/packages/pi-ai/dist/index.d.ts.map +1 -1
  123. package/packages/pi-ai/dist/index.js +2 -0
  124. package/packages/pi-ai/dist/index.js.map +1 -1
  125. package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  126. package/packages/pi-ai/dist/providers/anthropic.js +12 -7
  127. package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
  128. package/packages/pi-ai/dist/providers/google-shared.d.ts +5 -0
  129. package/packages/pi-ai/dist/providers/google-shared.d.ts.map +1 -1
  130. package/packages/pi-ai/dist/providers/google-shared.js +12 -3
  131. package/packages/pi-ai/dist/providers/google-shared.js.map +1 -1
  132. package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
  133. package/packages/pi-ai/dist/providers/openai-completions.js +7 -3
  134. package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
  135. package/packages/pi-ai/dist/utils/moonshot-tool-schema.d.ts +9 -0
  136. package/packages/pi-ai/dist/utils/moonshot-tool-schema.d.ts.map +1 -0
  137. package/packages/pi-ai/dist/utils/moonshot-tool-schema.js +34 -0
  138. package/packages/pi-ai/dist/utils/moonshot-tool-schema.js.map +1 -0
  139. package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
  140. package/packages/pi-ai/dist/utils/oauth/github-copilot.js +6 -2
  141. package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
  142. package/packages/pi-ai/package.json +1 -1
  143. package/packages/pi-coding-agent/package.json +7 -7
  144. package/packages/pi-tui/package.json +2 -2
  145. package/packages/rpc-client/package.json +2 -2
  146. package/pkg/package.json +1 -1
  147. package/src/resources/extensions/browser-tools/tests/gsd-browser-launch-config.test.mjs +11 -0
  148. package/src/resources/extensions/gsd/auto/orchestrator.ts +28 -10
  149. package/src/resources/extensions/gsd/auto/phases.ts +63 -24
  150. package/src/resources/extensions/gsd/auto/session.ts +3 -0
  151. package/src/resources/extensions/gsd/auto-direct-dispatch.ts +10 -16
  152. package/src/resources/extensions/gsd/auto-dispatch.ts +11 -10
  153. package/src/resources/extensions/gsd/auto-model-selection.ts +16 -7
  154. package/src/resources/extensions/gsd/auto-post-unit.ts +21 -6
  155. package/src/resources/extensions/gsd/auto-unit-closeout.ts +83 -28
  156. package/src/resources/extensions/gsd/auto-verification.ts +18 -2
  157. package/src/resources/extensions/gsd/auto.ts +44 -1
  158. package/src/resources/extensions/gsd/blocked-models.ts +49 -0
  159. package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +34 -5
  160. package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +2 -2
  161. package/src/resources/extensions/gsd/closeout-wizard.ts +102 -0
  162. package/src/resources/extensions/gsd/commands/context.ts +16 -2
  163. package/src/resources/extensions/gsd/commands-handlers.ts +46 -3
  164. package/src/resources/extensions/gsd/consent-question.ts +15 -0
  165. package/src/resources/extensions/gsd/crash-recovery.ts +10 -2
  166. package/src/resources/extensions/gsd/doctor-engine-checks.ts +3 -3
  167. package/src/resources/extensions/gsd/doctor-git-checks.ts +2 -19
  168. package/src/resources/extensions/gsd/gsd-command-home.ts +13 -3
  169. package/src/resources/extensions/gsd/gsd-db.ts +4 -3
  170. package/src/resources/extensions/gsd/guided-flow.ts +21 -26
  171. package/src/resources/extensions/gsd/milestone-closeout.ts +97 -2
  172. package/src/resources/extensions/gsd/milestone-planning-persistence.ts +2 -2
  173. package/src/resources/extensions/gsd/projection-flush.ts +20 -0
  174. package/src/resources/extensions/gsd/prompts/complete-slice.md +1 -1
  175. package/src/resources/extensions/gsd/prompts/execute-task.md +1 -1
  176. package/src/resources/extensions/gsd/prompts/plan-milestone.md +1 -1
  177. package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
  178. package/src/resources/extensions/gsd/prompts/quick-task.md +1 -1
  179. package/src/resources/extensions/gsd/prompts/reassess-roadmap.md +1 -1
  180. package/src/resources/extensions/gsd/prompts/refine-slice.md +1 -1
  181. package/src/resources/extensions/gsd/prompts/replan-slice.md +1 -1
  182. package/src/resources/extensions/gsd/prompts/research-milestone.md +1 -1
  183. package/src/resources/extensions/gsd/prompts/research-slice.md +1 -1
  184. package/src/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
  185. package/src/resources/extensions/gsd/prompts/run-uat.md +1 -1
  186. package/src/resources/extensions/gsd/prompts/triage-captures.md +1 -1
  187. package/src/resources/extensions/gsd/prompts/validate-milestone.md +1 -1
  188. package/src/resources/extensions/gsd/roadmap-slices.ts +28 -3
  189. package/src/resources/extensions/gsd/session-lock.ts +1 -1
  190. package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +69 -0
  191. package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +97 -0
  192. package/src/resources/extensions/gsd/tests/auto-remote-session-lock-cleanup.test.ts +65 -3
  193. package/src/resources/extensions/gsd/tests/blocked-models.test.ts +19 -0
  194. package/src/resources/extensions/gsd/tests/consent-question.test.ts +15 -0
  195. package/src/resources/extensions/gsd/tests/doctor-git-checks-terminal.test.ts +73 -0
  196. package/src/resources/extensions/gsd/tests/gsd-command-home.test.ts +120 -0
  197. package/src/resources/extensions/gsd/tests/guided-dispatch-root.test.ts +2 -6
  198. package/src/resources/extensions/gsd/tests/milestone-closeout.test.ts +95 -4
  199. package/src/resources/extensions/gsd/tests/parsers-legacy-importers.test.ts +0 -1
  200. package/src/resources/extensions/gsd/tests/phases-terminal-complete-idempotent.test.ts +242 -0
  201. package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +63 -2
  202. package/src/resources/extensions/gsd/tests/roadmap-slices.test.ts +68 -0
  203. package/src/resources/extensions/gsd/tests/runtime-invariant-modules.test.ts +19 -1
  204. package/src/resources/extensions/gsd/tests/tool-unavailable-retry.test.ts +33 -0
  205. package/src/resources/extensions/gsd/tests/transport-gate-double-complete.test.ts +139 -0
  206. package/src/resources/extensions/gsd/tests/verification-verdict.test.ts +2 -0
  207. package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +273 -38
  208. package/src/resources/extensions/gsd/tool-contract.ts +38 -3
  209. package/src/resources/extensions/gsd/tools/complete-milestone.ts +3 -2
  210. package/src/resources/extensions/gsd/tools/complete-slice.ts +2 -2
  211. package/src/resources/extensions/gsd/tools/complete-task.ts +3 -2
  212. package/src/resources/extensions/gsd/tools/plan-slice.ts +2 -2
  213. package/src/resources/extensions/gsd/tools/plan-task.ts +2 -2
  214. package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +2 -2
  215. package/src/resources/extensions/gsd/tools/reopen-milestone.ts +2 -2
  216. package/src/resources/extensions/gsd/tools/reopen-slice.ts +2 -2
  217. package/src/resources/extensions/gsd/tools/reopen-task.ts +2 -2
  218. package/src/resources/extensions/gsd/tools/replan-slice.ts +2 -2
  219. package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +81 -2
  220. package/src/resources/extensions/gsd/verification-verdict.ts +4 -2
  221. package/src/resources/extensions/shared/gsd-browser-cli.ts +23 -2
  222. package/src/resources/shared/gsd-browser-path-sync.ts +273 -0
  223. package/src/resources/shared/package-manager-detection.ts +1 -1
  224. /package/dist/web/standalone/.next/static/{jmTLg6xZmAuq_LIqKOxrH → McokybTayhff1xEVc-d3T}/_buildManifest.js +0 -0
  225. /package/dist/web/standalone/.next/static/{jmTLg6xZmAuq_LIqKOxrH → McokybTayhff1xEVc-d3T}/_ssgManifest.js +0 -0
@@ -758,6 +758,71 @@ const projectDirParam = z
758
758
  .optional()
759
759
  .describe("Optional. Omit this field — the server defaults to its current working directory, which is already the correct project or worktree root.");
760
760
  const unknownRecord = z.record(z.string(), z.unknown());
761
+ /** Split "id — detail" / "id - detail" pairs used by legacy string payloads. */
762
+ function splitPair(value) {
763
+ const match = value.match(/^(.+?)\s*(?:—|-)\s+(.+)$/);
764
+ return match ? [match[1].trim(), match[2].trim()] : [value.trim(), ""];
765
+ }
766
+ /** Accept string or string[] at runtime; emit array-only JSON Schema (no anyOf). */
767
+ const optionalStringOrStringArray = () => z.preprocess((value) => (value == null ? value : Array.isArray(value) ? value : [value]), z.array(z.string()).optional());
768
+ function optionalStructuredStringArray(itemSchema, coerceString) {
769
+ return z.preprocess((value) => {
770
+ if (value == null)
771
+ return value;
772
+ if (!Array.isArray(value))
773
+ return value;
774
+ return value.map((item) => (typeof item === "string" ? coerceString(item) : item));
775
+ }, z.array(itemSchema).optional());
776
+ }
777
+ const requirementAdvancedItemSchema = z.preprocess((value) => {
778
+ if (typeof value !== "string")
779
+ return value;
780
+ const [id, how] = splitPair(value);
781
+ return { id, how };
782
+ }, z.object({ id: z.string(), how: z.string() }));
783
+ const requirementValidatedItemSchema = z.preprocess((value) => {
784
+ if (typeof value !== "string")
785
+ return value;
786
+ const [id, proof] = splitPair(value);
787
+ return { id, proof };
788
+ }, z.object({ id: z.string(), proof: z.string() }));
789
+ const requirementInvalidatedItemSchema = z.preprocess((value) => {
790
+ if (typeof value !== "string")
791
+ return value;
792
+ const [id, what] = splitPair(value);
793
+ return { id, what };
794
+ }, z.object({ id: z.string(), what: z.string() }));
795
+ const filesModifiedItemSchema = z.preprocess((value) => {
796
+ if (typeof value !== "string")
797
+ return value;
798
+ const [path, description] = splitPair(value);
799
+ return { path, description };
800
+ }, z.object({ path: z.string(), description: z.string() }));
801
+ const requiresItemSchema = z.preprocess((value) => {
802
+ if (typeof value !== "string")
803
+ return value;
804
+ const [slice, provides] = splitPair(value);
805
+ return { slice, provides };
806
+ }, z.object({ slice: z.string(), provides: z.string() }));
807
+ // Accept either a string (legacy command-only form) or the structured object.
808
+ // Mirrors `normalizeVerificationEvidence` in the executor: strings are coerced
809
+ // into the canonical object shape before Zod validates, so the emitted JSON
810
+ // Schema stays a single object type (no anyOf/oneOf) for Moonshot/Kimi.
811
+ const verificationEvidenceItemSchema = z.preprocess((value) => {
812
+ if (typeof value !== "string")
813
+ return value;
814
+ return {
815
+ command: value,
816
+ exitCode: -1,
817
+ verdict: "unknown (coerced from string)",
818
+ durationMs: 0,
819
+ };
820
+ }, z.object({
821
+ command: z.string(),
822
+ exitCode: z.number(),
823
+ verdict: z.string(),
824
+ durationMs: z.number(),
825
+ }));
761
826
  const nonEmptyString = (field) => z.string().trim().min(1, `${field} must be a non-empty string`);
762
827
  // Optional non-empty string: accepts omitted/undefined but rejects "" or
763
828
  // whitespace. Mirrors executor guards of the form
@@ -1003,34 +1068,34 @@ const sliceCompleteParams = {
1003
1068
  deviations: z.string().optional(),
1004
1069
  knownLimitations: z.string().optional(),
1005
1070
  followUps: z.string().optional(),
1006
- keyFiles: z.union([z.array(z.string()), z.string()]).optional(),
1007
- keyDecisions: z.union([z.array(z.string()), z.string()]).optional(),
1008
- patternsEstablished: z.union([z.array(z.string()), z.string()]).optional(),
1009
- observabilitySurfaces: z.union([z.array(z.string()), z.string()]).optional(),
1010
- provides: z.union([z.array(z.string()), z.string()]).optional(),
1011
- requirementsSurfaced: z.union([z.array(z.string()), z.string()]).optional(),
1012
- drillDownPaths: z.union([z.array(z.string()), z.string()]).optional(),
1013
- affects: z.union([z.array(z.string()), z.string()]).optional(),
1014
- requirementsAdvanced: z.array(z.union([
1015
- z.object({ id: z.string(), how: z.string() }),
1016
- z.string(),
1017
- ])).optional(),
1018
- requirementsValidated: z.array(z.union([
1019
- z.object({ id: z.string(), proof: z.string() }),
1020
- z.string(),
1021
- ])).optional(),
1022
- requirementsInvalidated: z.array(z.union([
1023
- z.object({ id: z.string(), what: z.string() }),
1024
- z.string(),
1025
- ])).optional(),
1026
- filesModified: z.array(z.union([
1027
- z.object({ path: z.string(), description: z.string() }),
1028
- z.string(),
1029
- ])).optional(),
1030
- requires: z.array(z.union([
1031
- z.object({ slice: z.string(), provides: z.string() }),
1032
- z.string(),
1033
- ])).optional(),
1071
+ keyFiles: optionalStringOrStringArray(),
1072
+ keyDecisions: optionalStringOrStringArray(),
1073
+ patternsEstablished: optionalStringOrStringArray(),
1074
+ observabilitySurfaces: optionalStringOrStringArray(),
1075
+ provides: optionalStringOrStringArray(),
1076
+ requirementsSurfaced: optionalStringOrStringArray(),
1077
+ drillDownPaths: optionalStringOrStringArray(),
1078
+ affects: optionalStringOrStringArray(),
1079
+ requirementsAdvanced: optionalStructuredStringArray(requirementAdvancedItemSchema, (value) => {
1080
+ const [id, how] = splitPair(value);
1081
+ return { id, how };
1082
+ }),
1083
+ requirementsValidated: optionalStructuredStringArray(requirementValidatedItemSchema, (value) => {
1084
+ const [id, proof] = splitPair(value);
1085
+ return { id, proof };
1086
+ }),
1087
+ requirementsInvalidated: optionalStructuredStringArray(requirementInvalidatedItemSchema, (value) => {
1088
+ const [id, what] = splitPair(value);
1089
+ return { id, what };
1090
+ }),
1091
+ filesModified: optionalStructuredStringArray(filesModifiedItemSchema, (value) => {
1092
+ const [path, description] = splitPair(value);
1093
+ return { path, description };
1094
+ }),
1095
+ requires: optionalStructuredStringArray(requiresItemSchema, (value) => {
1096
+ const [slice, provides] = splitPair(value);
1097
+ return { slice, provides };
1098
+ }),
1034
1099
  };
1035
1100
  const sliceCompleteSchema = z.object(sliceCompleteParams);
1036
1101
  export const _sliceCompleteSchemaForTest = sliceCompleteSchema;
@@ -1144,15 +1209,7 @@ const taskCompleteParams = {
1144
1209
  recommendationRationale: z.string().describe("Why the recommendation — 1-2 sentences."),
1145
1210
  continueWithDefault: z.boolean().describe("When true, the recommendation is recorded as the default, but auto-mode still pauses until the user resolves via /gsd escalate resolve."),
1146
1211
  }).optional().describe("ADR-011 Phase 2: optional escalation payload. Only honored when phases.mid_execution_escalation is true."),
1147
- verificationEvidence: z.array(z.union([
1148
- z.object({
1149
- command: z.string(),
1150
- exitCode: z.number(),
1151
- verdict: z.string(),
1152
- durationMs: z.number(),
1153
- }),
1154
- z.string(),
1155
- ])).optional().describe("Verification evidence entries"),
1212
+ verificationEvidence: z.array(verificationEvidenceItemSchema).optional().describe("Verification evidence entries"),
1156
1213
  };
1157
1214
  const taskCompleteSchema = z.object(taskCompleteParams);
1158
1215
  const taskReopenParams = {
@@ -1277,7 +1334,11 @@ const uatResultSaveParams = {
1277
1334
  checks: z.array(uatCheckSchema).min(1).describe("Structured check results"),
1278
1335
  presentation: uatPresentationSchema.describe("Tool-presentation evidence"),
1279
1336
  notes: z.string().optional().describe("Overall verdict rationale"),
1280
- attempt: z.union([z.number().int().min(1), z.literal("auto")]).optional().describe("Attempt number or auto"),
1337
+ // Accept number (e.g. 1) or string (e.g. "1", "auto") and coerce to string
1338
+ // before validation, so the emitted JSON Schema stays a single primitive type
1339
+ // (no anyOf/oneOf) for Moonshot/Kimi. The executor still treats "auto" and
1340
+ // numeric strings as previously.
1341
+ attempt: z.preprocess((value) => (typeof value === "number" ? String(value) : value), z.string().optional()).describe("Attempt number or auto"),
1281
1342
  previousAttemptId: z.string().optional(),
1282
1343
  };
1283
1344
  const uatResultSaveSchema = z.object(uatResultSaveParams);