@skyramp/mcp 0.3.2-rc.pom-3 → 0.3.2

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 (289) hide show
  1. package/build/commands/commandLibrary.d.ts +1 -0
  2. package/build/commands/commandLibrary.js +19 -13
  3. package/build/commands/localDevTestChangesCommand.d.ts +15 -0
  4. package/build/commands/localDevTestChangesCommand.js +201 -0
  5. package/build/index.js +80 -6
  6. package/build/prompts/code-reuse.js +3 -0
  7. package/build/prompts/enhance-assertions/sharedAssertionRules.d.ts +1 -0
  8. package/build/prompts/enhance-assertions/sharedAssertionRules.js +17 -0
  9. package/build/prompts/initialize-workspace/initializeWorkspacePrompt.js +11 -9
  10. package/build/prompts/local-dev/local-dev-plan.d.ts +35 -0
  11. package/build/prompts/local-dev/local-dev-plan.js +429 -0
  12. package/build/prompts/local-dev/local-dev-prompts.d.ts +4 -0
  13. package/build/prompts/local-dev/local-dev-prompts.js +190 -0
  14. package/build/prompts/pom-aware-code-reuse.js +12 -0
  15. package/build/prompts/prompt-utils.d.ts +8 -0
  16. package/build/prompts/prompt-utils.js +33 -0
  17. package/build/prompts/sut-setup/modes/adaptWorkflowPrompt.js +37 -14
  18. package/build/prompts/sut-setup/shared.js +16 -12
  19. package/build/prompts/test-recommendation/analysisOutputPrompt.js +21 -29
  20. package/build/prompts/test-recommendation/scopeAssessment.d.ts +24 -7
  21. package/build/prompts/test-recommendation/scopeAssessment.js +111 -12
  22. package/build/prompts/test-recommendation/test-recommendation-prompt.js +41 -4
  23. package/build/prompts/testbot/testbot-prompts.d.ts +0 -5
  24. package/build/prompts/testbot/testbot-prompts.js +32 -52
  25. package/build/recommendation/planRanker.d.ts +15 -2
  26. package/build/recommendation/planRanker.js +76 -5
  27. package/build/resources/testbotResource.js +2 -1
  28. package/build/services/AnalyticsService.d.ts +1 -1
  29. package/build/services/TestExecutionService.d.ts +2 -1
  30. package/build/services/TestExecutionService.js +8 -3
  31. package/build/services/TestGenerationService.d.ts +2 -2
  32. package/build/services/TestGenerationService.js +39 -21
  33. package/build/services/containerEnv.js +3 -1
  34. package/build/tool-phases.js +6 -0
  35. package/build/tools/code-refactor/codeReuseTool.js +43 -4
  36. package/build/tools/code-refactor/enhanceAssertionsTool.js +68 -18
  37. package/build/tools/code-refactor/reuse-outcome.d.ts +109 -0
  38. package/build/tools/code-refactor/reuse-outcome.js +158 -0
  39. package/build/tools/code-refactor/reuse-state.d.ts +45 -0
  40. package/build/tools/code-refactor/reuse-state.js +140 -0
  41. package/build/tools/enrichTestWithMocksTool.d.ts +28 -0
  42. package/build/tools/enrichTestWithMocksTool.js +726 -0
  43. package/build/tools/executeSkyrampTestTool.d.ts +11 -0
  44. package/build/tools/executeSkyrampTestTool.js +62 -21
  45. package/build/tools/generate-tests/batchMockGenerationTool.d.ts +106 -0
  46. package/build/tools/generate-tests/batchMockGenerationTool.js +545 -0
  47. package/build/tools/generate-tests/generateBatchScenarioRestTool.js +25 -23
  48. package/build/tools/generate-tests/generateContractRestTool.js +2 -2
  49. package/build/tools/generate-tests/generateE2ERestTool.d.ts +1 -1
  50. package/build/tools/generate-tests/generateE2ERestTool.js +1 -1
  51. package/build/tools/generate-tests/generateLoadRestTool.d.ts +1 -1
  52. package/build/tools/generate-tests/generateLoadRestTool.js +1 -1
  53. package/build/tools/generate-tests/generateMockRestTool.d.ts +179 -6
  54. package/build/tools/generate-tests/generateMockRestTool.js +391 -22
  55. package/build/tools/generate-tests/loadTestSchema.d.ts +1 -1
  56. package/build/tools/generate-tests/planGuard.js +2 -22
  57. package/build/tools/generateEnrichedIntegrationTestTool.d.ts +25 -0
  58. package/build/tools/generateEnrichedIntegrationTestTool.js +235 -0
  59. package/build/tools/localDevWorkerComposeTool.d.ts +24 -0
  60. package/build/tools/localDevWorkerComposeTool.js +264 -0
  61. package/build/tools/one-click/oneClickTool.d.ts +13 -0
  62. package/build/tools/one-click/oneClickTool.js +195 -24
  63. package/build/tools/preflightMockCheckTool.d.ts +2 -0
  64. package/build/tools/preflightMockCheckTool.js +96 -0
  65. package/build/tools/queryProxyMocksTool.d.ts +70 -0
  66. package/build/tools/queryProxyMocksTool.js +522 -0
  67. package/build/tools/runExistingTestsTool.d.ts +31 -0
  68. package/build/tools/runExistingTestsTool.js +214 -13
  69. package/build/tools/submitReportTool.js +38 -3
  70. package/build/tools/test-management/analyzeChangesTool.d.ts +2 -1
  71. package/build/tools/test-management/analyzeChangesTool.js +63 -40
  72. package/build/tools/test-management/registerTestPlanTool.js +55 -7
  73. package/build/tools/trace/startTraceCollectionTool.js +3 -3
  74. package/build/types/FrontendIntegration.d.ts +3 -0
  75. package/build/types/FrontendIntegration.js +3 -0
  76. package/build/types/OneClickCommands.d.ts +1 -1
  77. package/build/types/Recommendation.d.ts +20 -0
  78. package/build/types/Recommendation.js +32 -6
  79. package/build/types/RepositoryAnalysis.d.ts +131 -14
  80. package/build/types/RepositoryAnalysis.js +16 -2
  81. package/build/types/ReuseOutcome.d.ts +63 -0
  82. package/build/types/ReuseOutcome.js +33 -0
  83. package/build/types/TestExecution.d.ts +1 -0
  84. package/build/types/TestTypes.d.ts +25 -7
  85. package/build/types/TestTypes.js +22 -6
  86. package/build/types/TestbotReport.d.ts +7 -0
  87. package/build/types/index.d.ts +2 -0
  88. package/build/types/index.js +1 -0
  89. package/build/utils/AnalysisStateManager.d.ts +26 -0
  90. package/build/utils/AnalysisStateManager.js +31 -1
  91. package/build/utils/analyze-openapi.js +18 -1
  92. package/build/utils/branchDiff.d.ts +17 -1
  93. package/build/utils/branchDiff.js +99 -14
  94. package/build/utils/featureFlags.d.ts +31 -0
  95. package/build/utils/featureFlags.js +37 -0
  96. package/build/utils/frontendIntegration.js +8 -1
  97. package/build/utils/grpcMockValidation.d.ts +1 -0
  98. package/build/utils/grpcMockValidation.js +49 -0
  99. package/build/utils/httpMethodValidation.d.ts +4 -0
  100. package/build/utils/httpMethodValidation.js +15 -0
  101. package/build/utils/logger.js +1 -1
  102. package/build/utils/mockCompatibility.d.ts +49 -0
  103. package/build/utils/mockCompatibility.js +82 -0
  104. package/build/utils/pom-scope/pom-files.js +7 -0
  105. package/build/utils/pom-verify/bindings.js +11 -1
  106. package/build/utils/pom-verify/re-exports.d.ts +10 -0
  107. package/build/utils/pom-verify/re-exports.js +61 -0
  108. package/build/utils/pom-verify/resolve.d.ts +4 -1
  109. package/build/utils/pom-verify/resolve.js +7 -4
  110. package/build/utils/pom-verify/verify.d.ts +5 -0
  111. package/build/utils/pom-verify/verify.js +25 -3
  112. package/build/utils/progress.js +10 -5
  113. package/build/utils/proxy-terminal.js +3 -3
  114. package/build/utils/routeParsers.d.ts +3 -9
  115. package/build/utils/routeParsers.js +79 -4
  116. package/build/utils/utils.js +2 -2
  117. package/build/utils/versions.d.ts +4 -3
  118. package/build/utils/versions.js +3 -1
  119. package/build/utils/workspaceAuth.d.ts +46 -0
  120. package/build/utils/workspaceAuth.js +156 -1
  121. package/build/workspace/testSuites.d.ts +2 -1
  122. package/build/workspace/testSuites.js +1 -1
  123. package/build/workspace/workspace.d.ts +108 -32
  124. package/build/workspace/workspace.js +32 -4
  125. package/package.json +5 -2
  126. package/build/adapters/jestAdapter.test.d.ts +0 -1
  127. package/build/adapters/jestAdapter.test.js +0 -93
  128. package/build/adapters/mochaAdapter.test.d.ts +0 -1
  129. package/build/adapters/mochaAdapter.test.js +0 -63
  130. package/build/adapters/playwrightAdapter.test.d.ts +0 -1
  131. package/build/adapters/playwrightAdapter.test.js +0 -169
  132. package/build/adapters/pytestAdapter.test.d.ts +0 -1
  133. package/build/adapters/pytestAdapter.test.js +0 -90
  134. package/build/prompts/code-reuse.test.d.ts +0 -1
  135. package/build/prompts/code-reuse.test.js +0 -62
  136. package/build/prompts/pom-aware-code-reuse.test.d.ts +0 -1
  137. package/build/prompts/pom-aware-code-reuse.test.js +0 -11
  138. package/build/prompts/test-maintenance/drift-analysis-prompt.test.d.ts +0 -1
  139. package/build/prompts/test-maintenance/drift-analysis-prompt.test.js +0 -51
  140. package/build/prompts/test-recommendation/analysisOutputPrompt.test.d.ts +0 -1
  141. package/build/prompts/test-recommendation/analysisOutputPrompt.test.js +0 -264
  142. package/build/prompts/test-recommendation/mergeEnrichedScenarios.test.d.ts +0 -1
  143. package/build/prompts/test-recommendation/mergeEnrichedScenarios.test.js +0 -126
  144. package/build/prompts/test-recommendation/promptPlan.test.d.ts +0 -1
  145. package/build/prompts/test-recommendation/promptPlan.test.js +0 -336
  146. package/build/prompts/test-recommendation/scopeAssessment.test.d.ts +0 -1
  147. package/build/prompts/test-recommendation/scopeAssessment.test.js +0 -371
  148. package/build/prompts/test-recommendation/test-recommendation-prompt.test.d.ts +0 -1
  149. package/build/prompts/test-recommendation/test-recommendation-prompt.test.js +0 -1925
  150. package/build/prompts/testbot/testbot-prompts.test.d.ts +0 -1
  151. package/build/prompts/testbot/testbot-prompts.test.js +0 -451
  152. package/build/recommendation/budgeters/diversityBalancedBudgeter.test.d.ts +0 -1
  153. package/build/recommendation/budgeters/diversityBalancedBudgeter.test.js +0 -138
  154. package/build/recommendation/budgeters/fixedNBudgeter.test.d.ts +0 -1
  155. package/build/recommendation/budgeters/fixedNBudgeter.test.js +0 -66
  156. package/build/recommendation/discriminators.test.d.ts +0 -1
  157. package/build/recommendation/discriminators.test.js +0 -324
  158. package/build/recommendation/diversity.test.d.ts +0 -1
  159. package/build/recommendation/diversity.test.js +0 -77
  160. package/build/recommendation/planRanker.test.d.ts +0 -1
  161. package/build/recommendation/planRanker.test.js +0 -110
  162. package/build/resources/testbotResource.test.d.ts +0 -1
  163. package/build/resources/testbotResource.test.js +0 -44
  164. package/build/services/AnalyticsService.test.d.ts +0 -1
  165. package/build/services/AnalyticsService.test.js +0 -86
  166. package/build/services/ScenarioGenerationService.integration.test.d.ts +0 -1
  167. package/build/services/ScenarioGenerationService.integration.test.js +0 -162
  168. package/build/services/ScenarioGenerationService.test.d.ts +0 -1
  169. package/build/services/ScenarioGenerationService.test.js +0 -414
  170. package/build/services/TestDiscoveryService.test.d.ts +0 -1
  171. package/build/services/TestDiscoveryService.test.js +0 -983
  172. package/build/services/TestExecutionService.test.d.ts +0 -1
  173. package/build/services/TestExecutionService.test.js +0 -1032
  174. package/build/services/TestGenerationService.test.d.ts +0 -1
  175. package/build/services/TestGenerationService.test.js +0 -578
  176. package/build/tool-phase-coverage.test.d.ts +0 -1
  177. package/build/tool-phase-coverage.test.js +0 -49
  178. package/build/tools/code-refactor/codeReuseTool.test.d.ts +0 -1
  179. package/build/tools/code-refactor/codeReuseTool.test.js +0 -572
  180. package/build/tools/generate-tests/generateBatchScenarioRestTool.test.d.ts +0 -1
  181. package/build/tools/generate-tests/generateBatchScenarioRestTool.test.js +0 -433
  182. package/build/tools/generate-tests/generateContractRestTool.test.d.ts +0 -1
  183. package/build/tools/generate-tests/generateContractRestTool.test.js +0 -142
  184. package/build/tools/generate-tests/generateIntegrationRestTool.test.d.ts +0 -1
  185. package/build/tools/generate-tests/generateIntegrationRestTool.test.js +0 -159
  186. package/build/tools/generate-tests/generateLoadRestTool.test.d.ts +0 -1
  187. package/build/tools/generate-tests/generateLoadRestTool.test.js +0 -169
  188. package/build/tools/generate-tests/generateUIRestTool.test.d.ts +0 -1
  189. package/build/tools/generate-tests/generateUIRestTool.test.js +0 -32
  190. package/build/tools/generate-tests/planGuard.test.d.ts +0 -1
  191. package/build/tools/generate-tests/planGuard.test.js +0 -185
  192. package/build/tools/generate-tests/scenarioLint.test.d.ts +0 -1
  193. package/build/tools/generate-tests/scenarioLint.test.js +0 -100
  194. package/build/tools/runExistingTestsTool.test.d.ts +0 -1
  195. package/build/tools/runExistingTestsTool.test.js +0 -379
  196. package/build/tools/submitReportTool.test.d.ts +0 -1
  197. package/build/tools/submitReportTool.test.js +0 -1428
  198. package/build/tools/test-management/actionsTool.test.d.ts +0 -1
  199. package/build/tools/test-management/actionsTool.test.js +0 -436
  200. package/build/tools/test-management/analyzeChangesTool.test.d.ts +0 -1
  201. package/build/tools/test-management/analyzeChangesTool.test.js +0 -522
  202. package/build/tools/test-management/analyzeTestHealthTool.test.d.ts +0 -1
  203. package/build/tools/test-management/analyzeTestHealthTool.test.js +0 -385
  204. package/build/tools/test-management/registerTestPlanTool.test.d.ts +0 -1
  205. package/build/tools/test-management/registerTestPlanTool.test.js +0 -296
  206. package/build/tools/trace/resolveSaveStoragePath.test.d.ts +0 -1
  207. package/build/tools/trace/resolveSaveStoragePath.test.js +0 -17
  208. package/build/tools/trace/resolveSessionPaths.test.d.ts +0 -1
  209. package/build/tools/trace/resolveSessionPaths.test.js +0 -104
  210. package/build/tools/trace/sessionState.test.d.ts +0 -1
  211. package/build/tools/trace/sessionState.test.js +0 -17
  212. package/build/tools/workspace/initializeWorkspaceTool.test.d.ts +0 -1
  213. package/build/tools/workspace/initializeWorkspaceTool.test.js +0 -139
  214. package/build/tools/workspace/serviceUpsert.test.d.ts +0 -1
  215. package/build/tools/workspace/serviceUpsert.test.js +0 -50
  216. package/build/utils/AnalysisStateManager.test.d.ts +0 -1
  217. package/build/utils/AnalysisStateManager.test.js +0 -134
  218. package/build/utils/dartRouteExtractor.test.d.ts +0 -1
  219. package/build/utils/dartRouteExtractor.test.js +0 -307
  220. package/build/utils/docker.test.d.ts +0 -1
  221. package/build/utils/docker.test.js +0 -114
  222. package/build/utils/featureFlags.test.d.ts +0 -1
  223. package/build/utils/featureFlags.test.js +0 -81
  224. package/build/utils/fileWalk.test.d.ts +0 -1
  225. package/build/utils/fileWalk.test.js +0 -252
  226. package/build/utils/frontendIntegration.test.d.ts +0 -1
  227. package/build/utils/frontendIntegration.test.js +0 -229
  228. package/build/utils/frontendSelectors.test.d.ts +0 -1
  229. package/build/utils/frontendSelectors.test.js +0 -118
  230. package/build/utils/gitStaging.test.d.ts +0 -1
  231. package/build/utils/gitStaging.test.js +0 -111
  232. package/build/utils/httpDefaults.test.d.ts +0 -1
  233. package/build/utils/httpDefaults.test.js +0 -21
  234. package/build/utils/importerHop.test.d.ts +0 -1
  235. package/build/utils/importerHop.test.js +0 -469
  236. package/build/utils/pathAffinityClassification.test.d.ts +0 -1
  237. package/build/utils/pathAffinityClassification.test.js +0 -208
  238. package/build/utils/planMatchKeys.test.d.ts +0 -1
  239. package/build/utils/planMatchKeys.test.js +0 -123
  240. package/build/utils/pom-scope/index.test.d.ts +0 -1
  241. package/build/utils/pom-scope/index.test.js +0 -278
  242. package/build/utils/pom-scope/pom-files.test.d.ts +0 -1
  243. package/build/utils/pom-scope/pom-files.test.js +0 -29
  244. package/build/utils/pom-scope/scoring.test.d.ts +0 -1
  245. package/build/utils/pom-scope/scoring.test.js +0 -39
  246. package/build/utils/pom-scope/selector-extractor.test.d.ts +0 -1
  247. package/build/utils/pom-scope/selector-extractor.test.js +0 -67
  248. package/build/utils/pom-verify/bindings.test.d.ts +0 -1
  249. package/build/utils/pom-verify/bindings.test.js +0 -164
  250. package/build/utils/pom-verify/calls.test.d.ts +0 -1
  251. package/build/utils/pom-verify/calls.test.js +0 -61
  252. package/build/utils/pom-verify/resolve.test.d.ts +0 -1
  253. package/build/utils/pom-verify/resolve.test.js +0 -114
  254. package/build/utils/pom-verify/verify.test.d.ts +0 -1
  255. package/build/utils/pom-verify/verify.test.js +0 -374
  256. package/build/utils/pr-comment-parser.test.d.ts +0 -1
  257. package/build/utils/pr-comment-parser.test.js +0 -428
  258. package/build/utils/progress.test.d.ts +0 -1
  259. package/build/utils/progress.test.js +0 -37
  260. package/build/utils/projectMetadata.test.d.ts +0 -1
  261. package/build/utils/projectMetadata.test.js +0 -172
  262. package/build/utils/pythonMountPrefixes.test.d.ts +0 -1
  263. package/build/utils/pythonMountPrefixes.test.js +0 -113
  264. package/build/utils/repoScanner.test.d.ts +0 -1
  265. package/build/utils/repoScanner.test.js +0 -190
  266. package/build/utils/reportVerification.test.d.ts +0 -1
  267. package/build/utils/reportVerification.test.js +0 -185
  268. package/build/utils/routeParsers.test.d.ts +0 -1
  269. package/build/utils/routeParsers.test.js +0 -1011
  270. package/build/utils/scenarioDrafting.test.d.ts +0 -1
  271. package/build/utils/scenarioDrafting.test.js +0 -876
  272. package/build/utils/sourceRouteExtractor.test.d.ts +0 -1
  273. package/build/utils/sourceRouteExtractor.test.js +0 -738
  274. package/build/utils/telemetry.test.d.ts +0 -1
  275. package/build/utils/telemetry.test.js +0 -70
  276. package/build/utils/trace-parser.test.d.ts +0 -6
  277. package/build/utils/trace-parser.test.js +0 -140
  278. package/build/utils/uiPageEnumerator.test.d.ts +0 -1
  279. package/build/utils/uiPageEnumerator.test.js +0 -824
  280. package/build/utils/utils.test.d.ts +0 -1
  281. package/build/utils/utils.test.js +0 -103
  282. package/build/utils/walkerCharacterization.test.d.ts +0 -1
  283. package/build/utils/walkerCharacterization.test.js +0 -233
  284. package/build/utils/workspaceAuth.test.d.ts +0 -1
  285. package/build/utils/workspaceAuth.test.js +0 -260
  286. package/build/workspace/testSuites.test.d.ts +0 -1
  287. package/build/workspace/testSuites.test.js +0 -23
  288. package/build/workspace/workspace.test.d.ts +0 -1
  289. package/build/workspace/workspace.test.js +0 -264
@@ -8,7 +8,7 @@ import { toolError } from "../../utils/utils.js";
8
8
  import { buildApprovedPlanItem } from "../../utils/planMatchKeys.js";
9
9
  import { SCENARIO_CATEGORIES, CATEGORY_PRIORITY, Novelty, PriorityTier } from "../../types/TestRecommendation.js";
10
10
  import { HttpMethod, TestType } from "../../types/TestTypes.js";
11
- import { CandidateSource, computeCandidateId, DiscriminatorKind } from "../../types/Recommendation.js";
11
+ import { CandidateSource, computeCandidateId, scenarioMergeKey, DiscriminatorKind } from "../../types/Recommendation.js";
12
12
  import { selectPlan } from "../../recommendation/planRanker.js";
13
13
  import { validateDiscriminator } from "../../recommendation/discriminators.js";
14
14
  import { isAttackSurfaceSecurityBoundary } from "../../prompts/test-recommendation/recommendationShared.js";
@@ -220,6 +220,39 @@ function renderPlanItem(item, rank) {
220
220
  const discriminatorNote = item.verifiedDiscriminator ? `, verified discriminator: ${item.verifiedDiscriminator}` : "";
221
221
  return `${rank}. [${item.testType}] "${item.scenarioName}" (${item.category}${discriminatorNote}) — ${describeGenerationCall(item)}`;
222
222
  }
223
+ /**
224
+ * Whether this run generates UI/E2E tests is a deterministic property of the
225
+ * approved plan, so it is decided here rather than left to the agent to resolve
226
+ * from prompt prose. The prompt owns HOW to record a UI trace and the runtime
227
+ * conditions the server cannot know (app unreachable, unintegrated component);
228
+ * this directive owns WHETHER and HOW MANY.
229
+ */
230
+ function renderGenerationDirective(plan) {
231
+ const uiCount = plan.generate.filter((item) => item.testType === TestType.UI || item.testType === TestType.E2E).length;
232
+ const nonUICount = plan.generate.length - uiCount;
233
+ const tests = (n) => `${n} test${n === 1 ? "" : "s"}`;
234
+ if (plan.generate.length === 0) {
235
+ return [
236
+ "### Generation directive: GENERATE NOTHING",
237
+ "Create zero new tests of any type this run and proceed to the report. An empty `newTestsCreated` is the CORRECT " +
238
+ "result for this PR — there is no new observable surface to cover. Do not record a browser trace and do not invent " +
239
+ "a spec to have something to report; report your maintenance work and the ADDITIONAL candidates as recommendations instead.",
240
+ ];
241
+ }
242
+ if (uiCount === 0) {
243
+ return [
244
+ "### Generation directive: NO UI/E2E GENERATION",
245
+ `This plan allocates no UI/E2E generation. Generate the ${tests(nonUICount)} listed above and create zero UI tests ` +
246
+ "— do not record a browser trace and do not add a UI spec to fill `newTestsCreated`.",
247
+ ];
248
+ }
249
+ return [
250
+ `### Generation directive: UI/E2E GENERATION REQUIRED (${uiCount})`,
251
+ `This plan allocates ${tests(uiCount)} of type UI/E2E. You MUST attempt to record and generate each one — do not ` +
252
+ "downgrade them to recommendations while the app is reachable." +
253
+ (nonUICount > 0 ? ` Generate the ${tests(nonUICount)} of other types as well.` : ""),
254
+ ];
255
+ }
223
256
  function renderPlanText(plan) {
224
257
  const lines = [];
225
258
  lines.push(`## Approved Test Plan (${plan.planId})`);
@@ -249,6 +282,8 @@ function renderPlanText(plan) {
249
282
  lines.push(`- ${demotion.candidateId}: ${demotion.reason}`);
250
283
  }
251
284
  }
285
+ lines.push("");
286
+ lines.push(...renderGenerationDirective(plan));
252
287
  return lines.join("\n");
253
288
  }
254
289
  // ── Tool registration ───────────────────────────────────────────────────────
@@ -285,14 +320,27 @@ export function registerRegisterTestPlanTool(server) {
285
320
  const allScenarios = stateData.repositoryAnalysis?.scenarios ?? [];
286
321
  const { candidates: agentCandidates, demotions } = buildAgentCandidates(params.candidates ?? [], diffText);
287
322
  const serverCandidates = recoverServerCandidates(stateData.approvedPlan, allScenarios);
288
- // Merge by candidateId; a pre-seeded server candidate wins over an agent
289
- // submission that happens to hash to the same id (identical scenario
290
- // content) — source: "server" is preserved per the unified-plan design.
323
+ // Merge by scenario-name identity, NOT the full content-hashed candidateId:
324
+ // the server (analyze_changes) and the agent frequently draft their own
325
+ // independent steps[] for "the same" scenario (identical scenarioName),
326
+ // which hash to different candidateIds — deduping on the full id let
327
+ // both survive as apparent duplicates (SKYR-4026). A pre-seeded server
328
+ // candidate wins over an agent submission for the same scenario name —
329
+ // source: "server" is preserved per the unified-plan design.
330
+ //
331
+ // Uses scenarioMergeKey (untruncated), not scenarioNameSlug — the
332
+ // latter's 48-char cap is fine for a short candidateId prefix combined
333
+ // with a content hash, but bare as a Map key it would silently collapse
334
+ // two distinct long scenario names sharing a common prefix. A missing
335
+ // scenarioName (schema requires one for agent candidates; only a
336
+ // malformed server-recovered scenario could lack one) falls back to
337
+ // the already-unique candidateId rather than a shared literal.
338
+ const mergeKey = (c) => scenarioMergeKey(c.scenario.scenarioName) || c.candidateId;
291
339
  const merged = new Map();
292
340
  for (const candidate of agentCandidates)
293
- merged.set(candidate.candidateId, candidate);
341
+ merged.set(mergeKey(candidate), candidate);
294
342
  for (const candidate of serverCandidates)
295
- merged.set(candidate.candidateId, candidate);
343
+ merged.set(mergeKey(candidate), candidate);
296
344
  const allCandidates = [...merged.values()];
297
345
  // An empty union would persist an authoritative plan with an empty
298
346
  // GENERATE list, which the generation gate then enforces — bricking
@@ -304,7 +352,7 @@ export function registerRegisterTestPlanTool(server) {
304
352
  return errorResult;
305
353
  }
306
354
  const budgetContext = resolveBudgetContext(stateData);
307
- const result = selectPlan(allCandidates, { ...budgetContext, demotions });
355
+ const result = selectPlan(allCandidates, { ...budgetContext, demotions, diffText });
308
356
  const approvedPlan = {
309
357
  planId: crypto.randomUUID(),
310
358
  createdAt: new Date().toISOString(),
@@ -5,7 +5,7 @@ import { SkyrampClient } from "@skyramp/skyramp";
5
5
  import openProxyTerminalTracked from "../../utils/proxy-terminal.js";
6
6
  import { getEntryPoint } from "../../utils/telemetry.js";
7
7
  import { logger } from "../../utils/logger.js";
8
- import { basePlaywrightSchema, baseSchema, SESSION_STORAGE_FILENAME, } from "../../types/TestTypes.js";
8
+ import { basePlaywrightSchema, baseSchema, RuntimeEnvironment, SESSION_STORAGE_FILENAME, } from "../../types/TestTypes.js";
9
9
  import { AnalyticsService } from "../../services/AnalyticsService.js";
10
10
  import { resolveSessionPaths } from "./resolveSessionPaths.js";
11
11
  import { setSavedSessionPath } from "./sessionState.js";
@@ -67,8 +67,8 @@ For detailed documentation visit: https://www.skyramp.dev/docs/load-test/advance
67
67
  playwrightSaveStoragePath: basePlaywrightSchema.shape.playwrightSaveStoragePath,
68
68
  playwrightViewportSize: basePlaywrightSchema.shape.playwrightViewportSize,
69
69
  runtime: z
70
- .string()
71
- .default("docker")
70
+ .literal(RuntimeEnvironment.DOCKER)
71
+ .default(RuntimeEnvironment.DOCKER)
72
72
  .describe("Runtime environment for trace collection. Currently only 'docker' is supported and is used as the default."),
73
73
  include: z
74
74
  .array(z.string())
@@ -9,6 +9,9 @@
9
9
  export declare enum IntegrationReason {
10
10
  /** Framework route/page/entrypoint file — reachable by convention, grep skipped. */
11
11
  RouteOrEntrypoint = "route-or-entrypoint",
12
+ /** i18n/locale content file — often loaded via a runtime-templated path rather
13
+ * than a static quoted import, so the grep-based check is skipped (SKYR-3977). */
14
+ I18nLocaleContent = "i18n-locale-content",
12
15
  /** At least one production file imports/references the component's module path. */
13
16
  Imported = "imported",
14
17
  /** No production importer found — the component has no DOM presence in the running app. */
@@ -10,6 +10,9 @@ export var IntegrationReason;
10
10
  (function (IntegrationReason) {
11
11
  /** Framework route/page/entrypoint file — reachable by convention, grep skipped. */
12
12
  IntegrationReason["RouteOrEntrypoint"] = "route-or-entrypoint";
13
+ /** i18n/locale content file — often loaded via a runtime-templated path rather
14
+ * than a static quoted import, so the grep-based check is skipped (SKYR-3977). */
15
+ IntegrationReason["I18nLocaleContent"] = "i18n-locale-content";
13
16
  /** At least one production file imports/references the component's module path. */
14
17
  IntegrationReason["Imported"] = "imported";
15
18
  /** No production importer found — the component has no DOM presence in the running app. */
@@ -4,7 +4,7 @@
4
4
  * and executed by the coding assistant following the workflow instructions.
5
5
  */
6
6
  /** Unique identifier for a one-click command */
7
- export type OneClickCommandId = "test_given_endpoint_comprehensively" | "full_repo_scan_recommend_generate_and_execute_top_n_tests";
7
+ export type OneClickCommandId = "test_given_endpoint_comprehensively" | "full_repo_scan_recommend_generate_and_execute_top_n_tests" | "local_dev_test_changes";
8
8
  /** Metadata for intent recognition by coding assistants */
9
9
  export interface CommandIntentMetadata {
10
10
  /** Context indicators describing when to use and when NOT to use this workflow */
@@ -74,6 +74,26 @@ export interface Budgeter {
74
74
  readonly name: string;
75
75
  select(ranked: Candidate[], ctx: BudgetContext): SelectionResult;
76
76
  }
77
+ /**
78
+ * Slug of a scenario name alone (no content hash) — stable across independent
79
+ * drafts of "the same" scenario even when their steps[] differ (e.g. the
80
+ * server's auto-drafted version vs. the agent's own re-drafted version of a
81
+ * scenario with an identical name). Used to dedupe by scenario identity where
82
+ * `computeCandidateId`'s content-sensitive hash would wrongly treat two drafts
83
+ * of the same named scenario as distinct (SKYR-4026).
84
+ */
85
+ export declare function scenarioNameSlug(scenarioName: string | undefined): string;
86
+ /**
87
+ * Merge-dedup identity key for a scenario name — like {@link scenarioNameSlug}
88
+ * but NOT truncated and with no shared fallback for a missing name. The 48-char
89
+ * truncation in `scenarioNameSlug` is fine for `computeCandidateId` (combined
90
+ * with a content hash for uniqueness), but used bare as a Map key it would
91
+ * silently collapse two distinct scenarios sharing a long common prefix, and
92
+ * collapse every candidate with no scenarioName onto the same key. Returns ""
93
+ * for a missing name so the caller can fall back to something already unique
94
+ * (e.g. candidateId) instead of a shared literal.
95
+ */
96
+ export declare function scenarioMergeKey(scenarioName: string | undefined): string;
77
97
  /**
78
98
  * Deterministic candidate id: a slug of the scenario name plus an 8-char content
79
99
  * hash. Pure and reproducible — the same scenario always yields the same id, so
@@ -17,6 +17,37 @@ export var CandidateSource;
17
17
  CandidateSource["AGENT"] = "agent";
18
18
  CandidateSource["SERVER"] = "server";
19
19
  })(CandidateSource || (CandidateSource = {}));
20
+ /**
21
+ * Slug of a scenario name alone (no content hash) — stable across independent
22
+ * drafts of "the same" scenario even when their steps[] differ (e.g. the
23
+ * server's auto-drafted version vs. the agent's own re-drafted version of a
24
+ * scenario with an identical name). Used to dedupe by scenario identity where
25
+ * `computeCandidateId`'s content-sensitive hash would wrongly treat two drafts
26
+ * of the same named scenario as distinct (SKYR-4026).
27
+ */
28
+ export function scenarioNameSlug(scenarioName) {
29
+ return ((scenarioName ?? "")
30
+ .toLowerCase()
31
+ .replace(/[^a-z0-9]+/g, "-")
32
+ .replace(/^-+|-+$/g, "")
33
+ .slice(0, 48) || "scenario");
34
+ }
35
+ /**
36
+ * Merge-dedup identity key for a scenario name — like {@link scenarioNameSlug}
37
+ * but NOT truncated and with no shared fallback for a missing name. The 48-char
38
+ * truncation in `scenarioNameSlug` is fine for `computeCandidateId` (combined
39
+ * with a content hash for uniqueness), but used bare as a Map key it would
40
+ * silently collapse two distinct scenarios sharing a long common prefix, and
41
+ * collapse every candidate with no scenarioName onto the same key. Returns ""
42
+ * for a missing name so the caller can fall back to something already unique
43
+ * (e.g. candidateId) instead of a shared literal.
44
+ */
45
+ export function scenarioMergeKey(scenarioName) {
46
+ return (scenarioName ?? "")
47
+ .toLowerCase()
48
+ .replace(/[^a-z0-9]+/g, "-")
49
+ .replace(/^-+|-+$/g, "");
50
+ }
20
51
  /**
21
52
  * Deterministic candidate id: a slug of the scenario name plus an 8-char content
22
53
  * hash. Pure and reproducible — the same scenario always yields the same id, so
@@ -26,12 +57,7 @@ export var CandidateSource;
26
57
  * cosmetic re-serialization does not change the id while a real edit does.
27
58
  */
28
59
  export function computeCandidateId(scenario) {
29
- const slugSource = scenario.scenarioName ?? "";
30
- const slug = slugSource
31
- .toLowerCase()
32
- .replace(/[^a-z0-9]+/g, "-")
33
- .replace(/^-+|-+$/g, "")
34
- .slice(0, 48) || "scenario";
60
+ const slug = scenarioNameSlug(scenario.scenarioName);
35
61
  const canonical = {
36
62
  scenarioName: scenario.scenarioName ?? "",
37
63
  category: scenario.category ?? "",
@@ -145,6 +145,22 @@ export interface BranchDiffContext {
145
145
  affectedServices: string[];
146
146
  summary?: string;
147
147
  }
148
+ export interface RouteDiscoveryInfo {
149
+ /** Files the LLM should inspect to infer endpoint methods and paths from source. */
150
+ candidateFiles: string[];
151
+ /** Static scanner output. Best-effort hints only, not an authoritative catalog. */
152
+ staticHints: Array<{
153
+ path: string;
154
+ methods: string[];
155
+ sourceFile: string;
156
+ }>;
157
+ /** OpenAPI paths from workspace config. Authoritative when specFetchSucceeded is true. */
158
+ openApiPaths: string[];
159
+ /** Router/module entry points that help the LLM reconstruct full mounted paths. */
160
+ routerMountContext: string[];
161
+ /** Full diff file path when available; read this to ground endpoint extraction in changed code. */
162
+ diffFilePath?: string;
163
+ }
148
164
  export interface RepositoryAnalysis {
149
165
  metadata: AnalysisMetadata;
150
166
  projectClassification: ProjectClassification;
@@ -155,6 +171,7 @@ export interface RepositoryAnalysis {
155
171
  authentication: AuthenticationInfo;
156
172
  infrastructure: InfrastructureInfo;
157
173
  existingTests: ExistingTestInfo;
174
+ routeDiscovery?: RouteDiscoveryInfo;
158
175
  branchDiffContext?: BranchDiffContext;
159
176
  }
160
177
  export interface AnalysisMetadata {
@@ -542,6 +559,7 @@ export declare const endpointMethodSchema: z.ZodObject<{
542
559
  }, "strip", z.ZodTypeAny, {
543
560
  method: string;
544
561
  description: string;
562
+ sourceFile: string;
545
563
  queryParams: {
546
564
  type: string;
547
565
  name: string;
@@ -550,7 +568,6 @@ export declare const endpointMethodSchema: z.ZodObject<{
550
568
  constraints?: string | undefined;
551
569
  }[];
552
570
  authRequired: boolean;
553
- sourceFile: string;
554
571
  interactions: {
555
572
  type: "error" | "success" | "edge-case";
556
573
  description: string;
@@ -581,6 +598,7 @@ export declare const endpointMethodSchema: z.ZodObject<{
581
598
  }, {
582
599
  method: string;
583
600
  description: string;
601
+ sourceFile: string;
584
602
  queryParams: {
585
603
  type: string;
586
604
  name: string;
@@ -589,7 +607,6 @@ export declare const endpointMethodSchema: z.ZodObject<{
589
607
  constraints?: string | undefined;
590
608
  }[];
591
609
  authRequired: boolean;
592
- sourceFile: string;
593
610
  interactions: {
594
611
  type: "error" | "success" | "edge-case";
595
612
  description: string;
@@ -784,6 +801,7 @@ export declare const enrichedEndpointSchema: z.ZodObject<{
784
801
  }, "strip", z.ZodTypeAny, {
785
802
  method: string;
786
803
  description: string;
804
+ sourceFile: string;
787
805
  queryParams: {
788
806
  type: string;
789
807
  name: string;
@@ -792,7 +810,6 @@ export declare const enrichedEndpointSchema: z.ZodObject<{
792
810
  constraints?: string | undefined;
793
811
  }[];
794
812
  authRequired: boolean;
795
- sourceFile: string;
796
813
  interactions: {
797
814
  type: "error" | "success" | "edge-case";
798
815
  description: string;
@@ -823,6 +840,7 @@ export declare const enrichedEndpointSchema: z.ZodObject<{
823
840
  }, {
824
841
  method: string;
825
842
  description: string;
843
+ sourceFile: string;
826
844
  queryParams: {
827
845
  type: string;
828
846
  name: string;
@@ -831,7 +849,6 @@ export declare const enrichedEndpointSchema: z.ZodObject<{
831
849
  constraints?: string | undefined;
832
850
  }[];
833
851
  authRequired: boolean;
834
- sourceFile: string;
835
852
  interactions: {
836
853
  type: "error" | "success" | "edge-case";
837
854
  description: string;
@@ -873,6 +890,7 @@ export declare const enrichedEndpointSchema: z.ZodObject<{
873
890
  methods: {
874
891
  method: string;
875
892
  description: string;
893
+ sourceFile: string;
876
894
  queryParams: {
877
895
  type: string;
878
896
  name: string;
@@ -881,7 +899,6 @@ export declare const enrichedEndpointSchema: z.ZodObject<{
881
899
  constraints?: string | undefined;
882
900
  }[];
883
901
  authRequired: boolean;
884
- sourceFile: string;
885
902
  interactions: {
886
903
  type: "error" | "success" | "edge-case";
887
904
  description: string;
@@ -923,6 +940,7 @@ export declare const enrichedEndpointSchema: z.ZodObject<{
923
940
  methods: {
924
941
  method: string;
925
942
  description: string;
943
+ sourceFile: string;
926
944
  queryParams: {
927
945
  type: string;
928
946
  name: string;
@@ -931,7 +949,6 @@ export declare const enrichedEndpointSchema: z.ZodObject<{
931
949
  constraints?: string | undefined;
932
950
  }[];
933
951
  authRequired: boolean;
934
- sourceFile: string;
935
952
  interactions: {
936
953
  type: "error" | "success" | "edge-case";
937
954
  description: string;
@@ -1423,6 +1440,45 @@ export declare const branchDiffContextSchema: z.ZodObject<{
1423
1440
  }[] | undefined;
1424
1441
  summary?: string | undefined;
1425
1442
  }>;
1443
+ export declare const routeDiscoveryInfoSchema: z.ZodObject<{
1444
+ candidateFiles: z.ZodArray<z.ZodString, "many">;
1445
+ staticHints: z.ZodArray<z.ZodObject<{
1446
+ path: z.ZodString;
1447
+ methods: z.ZodArray<z.ZodString, "many">;
1448
+ sourceFile: z.ZodString;
1449
+ }, "strip", z.ZodTypeAny, {
1450
+ path: string;
1451
+ sourceFile: string;
1452
+ methods: string[];
1453
+ }, {
1454
+ path: string;
1455
+ sourceFile: string;
1456
+ methods: string[];
1457
+ }>, "many">;
1458
+ openApiPaths: z.ZodArray<z.ZodString, "many">;
1459
+ routerMountContext: z.ZodArray<z.ZodString, "many">;
1460
+ diffFilePath: z.ZodOptional<z.ZodString>;
1461
+ }, "strip", z.ZodTypeAny, {
1462
+ candidateFiles: string[];
1463
+ staticHints: {
1464
+ path: string;
1465
+ sourceFile: string;
1466
+ methods: string[];
1467
+ }[];
1468
+ openApiPaths: string[];
1469
+ routerMountContext: string[];
1470
+ diffFilePath?: string | undefined;
1471
+ }, {
1472
+ candidateFiles: string[];
1473
+ staticHints: {
1474
+ path: string;
1475
+ sourceFile: string;
1476
+ methods: string[];
1477
+ }[];
1478
+ openApiPaths: string[];
1479
+ routerMountContext: string[];
1480
+ diffFilePath?: string | undefined;
1481
+ }>;
1426
1482
  export declare const analysisMetadataSchema: z.ZodObject<{
1427
1483
  repositoryName: z.ZodString;
1428
1484
  analysisDate: z.ZodString;
@@ -2057,6 +2113,7 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2057
2113
  }, "strip", z.ZodTypeAny, {
2058
2114
  method: string;
2059
2115
  description: string;
2116
+ sourceFile: string;
2060
2117
  queryParams: {
2061
2118
  type: string;
2062
2119
  name: string;
@@ -2065,7 +2122,6 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2065
2122
  constraints?: string | undefined;
2066
2123
  }[];
2067
2124
  authRequired: boolean;
2068
- sourceFile: string;
2069
2125
  interactions: {
2070
2126
  type: "error" | "success" | "edge-case";
2071
2127
  description: string;
@@ -2096,6 +2152,7 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2096
2152
  }, {
2097
2153
  method: string;
2098
2154
  description: string;
2155
+ sourceFile: string;
2099
2156
  queryParams: {
2100
2157
  type: string;
2101
2158
  name: string;
@@ -2104,7 +2161,6 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2104
2161
  constraints?: string | undefined;
2105
2162
  }[];
2106
2163
  authRequired: boolean;
2107
- sourceFile: string;
2108
2164
  interactions: {
2109
2165
  type: "error" | "success" | "edge-case";
2110
2166
  description: string;
@@ -2146,6 +2202,7 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2146
2202
  methods: {
2147
2203
  method: string;
2148
2204
  description: string;
2205
+ sourceFile: string;
2149
2206
  queryParams: {
2150
2207
  type: string;
2151
2208
  name: string;
@@ -2154,7 +2211,6 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2154
2211
  constraints?: string | undefined;
2155
2212
  }[];
2156
2213
  authRequired: boolean;
2157
- sourceFile: string;
2158
2214
  interactions: {
2159
2215
  type: "error" | "success" | "edge-case";
2160
2216
  description: string;
@@ -2196,6 +2252,7 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2196
2252
  methods: {
2197
2253
  method: string;
2198
2254
  description: string;
2255
+ sourceFile: string;
2199
2256
  queryParams: {
2200
2257
  type: string;
2201
2258
  name: string;
@@ -2204,7 +2261,6 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2204
2261
  constraints?: string | undefined;
2205
2262
  }[];
2206
2263
  authRequired: boolean;
2207
- sourceFile: string;
2208
2264
  interactions: {
2209
2265
  type: "error" | "success" | "edge-case";
2210
2266
  description: string;
@@ -2250,6 +2306,7 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2250
2306
  methods: {
2251
2307
  method: string;
2252
2308
  description: string;
2309
+ sourceFile: string;
2253
2310
  queryParams: {
2254
2311
  type: string;
2255
2312
  name: string;
@@ -2258,7 +2315,6 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2258
2315
  constraints?: string | undefined;
2259
2316
  }[];
2260
2317
  authRequired: boolean;
2261
- sourceFile: string;
2262
2318
  interactions: {
2263
2319
  type: "error" | "success" | "edge-case";
2264
2320
  description: string;
@@ -2304,6 +2360,7 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2304
2360
  methods: {
2305
2361
  method: string;
2306
2362
  description: string;
2363
+ sourceFile: string;
2307
2364
  queryParams: {
2308
2365
  type: string;
2309
2366
  name: string;
@@ -2312,7 +2369,6 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2312
2369
  constraints?: string | undefined;
2313
2370
  }[];
2314
2371
  authRequired: boolean;
2315
- sourceFile: string;
2316
2372
  interactions: {
2317
2373
  type: "error" | "success" | "edge-case";
2318
2374
  description: string;
@@ -2440,6 +2496,45 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2440
2496
  estimatedCoverage?: number | undefined;
2441
2497
  relevantExternalTestPaths?: string[] | undefined;
2442
2498
  }>;
2499
+ routeDiscovery: z.ZodOptional<z.ZodObject<{
2500
+ candidateFiles: z.ZodArray<z.ZodString, "many">;
2501
+ staticHints: z.ZodArray<z.ZodObject<{
2502
+ path: z.ZodString;
2503
+ methods: z.ZodArray<z.ZodString, "many">;
2504
+ sourceFile: z.ZodString;
2505
+ }, "strip", z.ZodTypeAny, {
2506
+ path: string;
2507
+ sourceFile: string;
2508
+ methods: string[];
2509
+ }, {
2510
+ path: string;
2511
+ sourceFile: string;
2512
+ methods: string[];
2513
+ }>, "many">;
2514
+ openApiPaths: z.ZodArray<z.ZodString, "many">;
2515
+ routerMountContext: z.ZodArray<z.ZodString, "many">;
2516
+ diffFilePath: z.ZodOptional<z.ZodString>;
2517
+ }, "strip", z.ZodTypeAny, {
2518
+ candidateFiles: string[];
2519
+ staticHints: {
2520
+ path: string;
2521
+ sourceFile: string;
2522
+ methods: string[];
2523
+ }[];
2524
+ openApiPaths: string[];
2525
+ routerMountContext: string[];
2526
+ diffFilePath?: string | undefined;
2527
+ }, {
2528
+ candidateFiles: string[];
2529
+ staticHints: {
2530
+ path: string;
2531
+ sourceFile: string;
2532
+ methods: string[];
2533
+ }[];
2534
+ openApiPaths: string[];
2535
+ routerMountContext: string[];
2536
+ diffFilePath?: string | undefined;
2537
+ }>>;
2443
2538
  branchDiffContext: z.ZodOptional<z.ZodObject<{
2444
2539
  currentBranch: z.ZodString;
2445
2540
  baseBranch: z.ZodString;
@@ -2700,6 +2795,7 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2700
2795
  methods: {
2701
2796
  method: string;
2702
2797
  description: string;
2798
+ sourceFile: string;
2703
2799
  queryParams: {
2704
2800
  type: string;
2705
2801
  name: string;
@@ -2708,7 +2804,6 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2708
2804
  constraints?: string | undefined;
2709
2805
  }[];
2710
2806
  authRequired: boolean;
2711
- sourceFile: string;
2712
2807
  interactions: {
2713
2808
  type: "error" | "success" | "edge-case";
2714
2809
  description: string;
@@ -2768,6 +2863,17 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2768
2863
  estimatedCoverage?: number | undefined;
2769
2864
  relevantExternalTestPaths?: string[] | undefined;
2770
2865
  };
2866
+ routeDiscovery?: {
2867
+ candidateFiles: string[];
2868
+ staticHints: {
2869
+ path: string;
2870
+ sourceFile: string;
2871
+ methods: string[];
2872
+ }[];
2873
+ openApiPaths: string[];
2874
+ routerMountContext: string[];
2875
+ diffFilePath?: string | undefined;
2876
+ } | undefined;
2771
2877
  branchDiffContext?: {
2772
2878
  currentBranch: string;
2773
2879
  baseBranch: string;
@@ -2902,6 +3008,7 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2902
3008
  methods: {
2903
3009
  method: string;
2904
3010
  description: string;
3011
+ sourceFile: string;
2905
3012
  queryParams: {
2906
3013
  type: string;
2907
3014
  name: string;
@@ -2910,7 +3017,6 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2910
3017
  constraints?: string | undefined;
2911
3018
  }[];
2912
3019
  authRequired: boolean;
2913
- sourceFile: string;
2914
3020
  interactions: {
2915
3021
  type: "error" | "success" | "edge-case";
2916
3022
  description: string;
@@ -2970,6 +3076,17 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2970
3076
  estimatedCoverage?: number | undefined;
2971
3077
  relevantExternalTestPaths?: string[] | undefined;
2972
3078
  };
3079
+ routeDiscovery?: {
3080
+ candidateFiles: string[];
3081
+ staticHints: {
3082
+ path: string;
3083
+ sourceFile: string;
3084
+ methods: string[];
3085
+ }[];
3086
+ openApiPaths: string[];
3087
+ routerMountContext: string[];
3088
+ diffFilePath?: string | undefined;
3089
+ } | undefined;
2973
3090
  branchDiffContext?: {
2974
3091
  currentBranch: string;
2975
3092
  baseBranch: string;
@@ -128,17 +128,30 @@ export const branchDiffContextSchema = z.object({
128
128
  changeType: z.enum(["added", "modified", "removed"]),
129
129
  })),
130
130
  })),
131
- removedEndpoints: z.array(z.object({
131
+ removedEndpoints: z
132
+ .array(z.object({
132
133
  path: z.string(),
133
134
  methods: z.array(z.object({
134
135
  method: z.string(),
135
136
  sourceFile: z.string(),
136
137
  changeType: z.literal("removed"),
137
138
  })),
138
- })).optional(),
139
+ }))
140
+ .optional(),
139
141
  affectedServices: z.array(z.string()),
140
142
  summary: z.string().optional(),
141
143
  });
144
+ export const routeDiscoveryInfoSchema = z.object({
145
+ candidateFiles: z.array(z.string()),
146
+ staticHints: z.array(z.object({
147
+ path: z.string(),
148
+ methods: z.array(z.string()),
149
+ sourceFile: z.string(),
150
+ })),
151
+ openApiPaths: z.array(z.string()),
152
+ routerMountContext: z.array(z.string()),
153
+ diffFilePath: z.string().optional(),
154
+ });
142
155
  export const analysisMetadataSchema = z.object({
143
156
  repositoryName: z.string(),
144
157
  analysisDate: z.string(),
@@ -239,5 +252,6 @@ export const repositoryAnalysisSchema = z.object({
239
252
  estimatedCoverage: z.number().optional(),
240
253
  relevantExternalTestPaths: z.array(z.string()).optional(),
241
254
  }),
255
+ routeDiscovery: routeDiscoveryInfoSchema.optional(),
242
256
  branchDiffContext: branchDiffContextSchema.optional(),
243
257
  });