@codeyam/codeyam-cli 0.1.0-staging.d0ad4ae → 0.1.0-staging.d4f25c3

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 (1262) hide show
  1. package/analyzer-template/.build-info.json +8 -8
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +27 -27
  4. package/analyzer-template/packages/ai/index.ts +21 -5
  5. package/analyzer-template/packages/ai/package.json +3 -3
  6. package/analyzer-template/packages/ai/src/lib/__mocks__/completionCall.ts +122 -0
  7. package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +226 -24
  8. package/analyzer-template/packages/ai/src/lib/astScopes/arrayDerivationDetector.ts +199 -0
  9. package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +217 -13
  10. package/analyzer-template/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.ts +644 -0
  11. package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +181 -23
  12. package/analyzer-template/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.ts +10 -17
  13. package/analyzer-template/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.ts +18 -0
  14. package/analyzer-template/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.ts +15 -0
  15. package/analyzer-template/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.ts +181 -1
  16. package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +1215 -29
  17. package/analyzer-template/packages/ai/src/lib/astScopes/sharedPatterns.ts +28 -0
  18. package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +265 -6
  19. package/analyzer-template/packages/ai/src/lib/completionCall.ts +247 -66
  20. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +2020 -334
  21. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +5 -1
  22. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.ts +205 -0
  23. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +10 -2
  24. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.ts +16 -3
  25. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.ts +6 -4
  26. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +54 -3
  27. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +129 -20
  28. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.ts +70 -0
  29. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.ts +62 -0
  30. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +140 -14
  31. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.ts +179 -0
  32. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.ts +40 -30
  33. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +393 -90
  34. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.ts +129 -0
  35. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.ts +35 -0
  36. package/analyzer-template/packages/ai/src/lib/dataStructureChunking.ts +183 -0
  37. package/analyzer-template/packages/ai/src/lib/e2eDataTracking.ts +334 -0
  38. package/analyzer-template/packages/ai/src/lib/extractCriticalDataKeys.ts +120 -0
  39. package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarioData.ts +4 -3
  40. package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarios.ts +86 -149
  41. package/analyzer-template/packages/ai/src/lib/generateEntityDataStructure.ts +59 -3
  42. package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +1458 -65
  43. package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +200 -196
  44. package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +677 -0
  45. package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.ts +528 -0
  46. package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +2484 -0
  47. package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.ts +239 -0
  48. package/analyzer-template/packages/ai/src/lib/guessScenarioDataFromDescription.ts +5 -5
  49. package/analyzer-template/packages/ai/src/lib/isolateScopes.ts +328 -7
  50. package/analyzer-template/packages/ai/src/lib/mergeJsonTypeDefinitions.ts +5 -0
  51. package/analyzer-template/packages/ai/src/lib/mergeStatements.ts +111 -87
  52. package/analyzer-template/packages/ai/src/lib/promptGenerators/collapseNullableObjects.ts +118 -0
  53. package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +10 -7
  54. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.ts +1 -1
  55. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.ts +28 -170
  56. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChunkPrompt.ts +82 -0
  57. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateCriticalKeysPrompt.ts +103 -0
  58. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +110 -6
  59. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.ts +14 -89
  60. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.ts +58 -0
  61. package/analyzer-template/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.ts +11 -11
  62. package/analyzer-template/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.ts +391 -0
  63. package/analyzer-template/packages/ai/src/lib/resolvePathToControllable.ts +824 -0
  64. package/analyzer-template/packages/ai/src/lib/splitOutsideParentheses.ts +5 -1
  65. package/analyzer-template/packages/ai/src/lib/validateExecutionFlowPaths.ts +531 -0
  66. package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +122 -3
  67. package/analyzer-template/packages/ai/src/lib/worker/analyzeScopeWorker.ts +114 -2
  68. package/analyzer-template/packages/analyze/index.ts +2 -0
  69. package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +65 -59
  70. package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +132 -33
  71. package/analyzer-template/packages/analyze/src/lib/analysisContext.ts +44 -4
  72. package/analyzer-template/packages/analyze/src/lib/asts/index.ts +7 -2
  73. package/analyzer-template/packages/analyze/src/lib/asts/nodes/getNodeType.ts +1 -0
  74. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.ts +19 -0
  75. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.ts +19 -0
  76. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllExports.ts +11 -0
  77. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.ts +8 -0
  78. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.ts +49 -1
  79. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.ts +2 -1
  80. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +447 -255
  81. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +39 -4
  82. package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +12 -0
  83. package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +4 -2
  84. package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +33 -10
  85. package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +14 -14
  86. package/analyzer-template/packages/analyze/src/lib/files/analyzeEntity.ts +4 -4
  87. package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +11 -12
  88. package/analyzer-template/packages/analyze/src/lib/files/analyzeRemixRoute.ts +4 -5
  89. package/analyzer-template/packages/analyze/src/lib/files/enums/steps.ts +1 -1
  90. package/analyzer-template/packages/analyze/src/lib/files/getImportedExports.ts +14 -12
  91. package/analyzer-template/packages/analyze/src/lib/files/scenarios/TransformationTracer.ts +1352 -0
  92. package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +193 -76
  93. package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +203 -41
  94. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.ts +28 -188
  95. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +355 -23
  96. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +166 -0
  97. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +1 -0
  98. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarios.ts +2 -3
  99. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +845 -72
  100. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.ts +56 -11
  101. package/analyzer-template/packages/analyze/src/lib/files/scenarios/propagateArrayItemSchemas.ts +474 -0
  102. package/analyzer-template/packages/analyze/src/lib/files/setImportedExports.ts +2 -1
  103. package/analyzer-template/packages/analyze/src/lib/index.ts +1 -0
  104. package/analyzer-template/packages/analyze/src/lib/utils/getFileByPath.ts +19 -0
  105. package/analyzer-template/packages/aws/package.json +10 -10
  106. package/analyzer-template/packages/database/index.ts +1 -0
  107. package/analyzer-template/packages/database/package.json +4 -4
  108. package/analyzer-template/packages/database/src/lib/analysisBranchToDb.ts +1 -1
  109. package/analyzer-template/packages/database/src/lib/analysisToDb.ts +1 -1
  110. package/analyzer-template/packages/database/src/lib/branchToDb.ts +1 -1
  111. package/analyzer-template/packages/database/src/lib/commitBranchToDb.ts +1 -1
  112. package/analyzer-template/packages/database/src/lib/commitToDb.ts +1 -1
  113. package/analyzer-template/packages/database/src/lib/fileToDb.ts +1 -1
  114. package/analyzer-template/packages/database/src/lib/kysely/db.ts +22 -1
  115. package/analyzer-template/packages/database/src/lib/kysely/tables/commitsTable.ts +6 -0
  116. package/analyzer-template/packages/database/src/lib/kysely/tables/debugReportsTable.ts +17 -1
  117. package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +164 -0
  118. package/analyzer-template/packages/database/src/lib/kysely/tables/labsRequestsTable.ts +52 -0
  119. package/analyzer-template/packages/database/src/lib/loadAnalyses.ts +58 -1
  120. package/analyzer-template/packages/database/src/lib/loadAnalysis.ts +13 -0
  121. package/analyzer-template/packages/database/src/lib/loadBranch.ts +16 -1
  122. package/analyzer-template/packages/database/src/lib/loadCommit.ts +11 -0
  123. package/analyzer-template/packages/database/src/lib/loadCommits.ts +58 -19
  124. package/analyzer-template/packages/database/src/lib/loadEntities.ts +26 -9
  125. package/analyzer-template/packages/database/src/lib/loadEntityBranches.ts +12 -0
  126. package/analyzer-template/packages/database/src/lib/loadReadyToBeCapturedAnalyses.ts +5 -6
  127. package/analyzer-template/packages/database/src/lib/projectToDb.ts +1 -1
  128. package/analyzer-template/packages/database/src/lib/saveFiles.ts +1 -1
  129. package/analyzer-template/packages/database/src/lib/scenarioToDb.ts +1 -1
  130. package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +96 -152
  131. package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatus.ts +58 -42
  132. package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.ts +81 -65
  133. package/analyzer-template/packages/database/src/lib/userScenarioToDb.ts +1 -1
  134. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +29 -1
  135. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.ts +33 -5
  136. package/analyzer-template/packages/github/dist/database/index.d.ts +1 -0
  137. package/analyzer-template/packages/github/dist/database/index.d.ts.map +1 -1
  138. package/analyzer-template/packages/github/dist/database/index.js +1 -0
  139. package/analyzer-template/packages/github/dist/database/index.js.map +1 -1
  140. package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js +1 -1
  141. package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js.map +1 -1
  142. package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js +1 -1
  143. package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js.map +1 -1
  144. package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js +1 -1
  145. package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js.map +1 -1
  146. package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js +1 -1
  147. package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js.map +1 -1
  148. package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js +1 -1
  149. package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js.map +1 -1
  150. package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js +1 -1
  151. package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js.map +1 -1
  152. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +4 -0
  153. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts.map +1 -1
  154. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +16 -1
  155. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js.map +1 -1
  156. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/analysesTable.d.ts +1 -18
  157. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/analysesTable.d.ts.map +1 -1
  158. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.d.ts +1 -0
  159. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.d.ts.map +1 -1
  160. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.js +3 -0
  161. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.js.map +1 -1
  162. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts +17 -1
  163. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts.map +1 -1
  164. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.js.map +1 -1
  165. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +29 -0
  166. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -0
  167. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +149 -0
  168. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
  169. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.d.ts +23 -0
  170. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.d.ts.map +1 -0
  171. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.js +35 -0
  172. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.js.map +1 -0
  173. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +6 -6
  174. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
  175. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.d.ts +2 -0
  176. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.d.ts.map +1 -1
  177. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.js +45 -2
  178. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.js.map +1 -1
  179. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.d.ts.map +1 -1
  180. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js +8 -0
  181. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js.map +1 -1
  182. package/analyzer-template/packages/github/dist/database/src/lib/loadBranch.js +11 -1
  183. package/analyzer-template/packages/github/dist/database/src/lib/loadBranch.js.map +1 -1
  184. package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.d.ts.map +1 -1
  185. package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.js +7 -0
  186. package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.js.map +1 -1
  187. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts +3 -1
  188. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts.map +1 -1
  189. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js +45 -14
  190. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js.map +1 -1
  191. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts +3 -1
  192. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts.map +1 -1
  193. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js +23 -10
  194. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js.map +1 -1
  195. package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.d.ts.map +1 -1
  196. package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.js +9 -0
  197. package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.js.map +1 -1
  198. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.d.ts.map +1 -1
  199. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js +5 -5
  200. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  201. package/analyzer-template/packages/github/dist/database/src/lib/projectToDb.js +1 -1
  202. package/analyzer-template/packages/github/dist/database/src/lib/projectToDb.js.map +1 -1
  203. package/analyzer-template/packages/github/dist/database/src/lib/saveFiles.js +1 -1
  204. package/analyzer-template/packages/github/dist/database/src/lib/saveFiles.js.map +1 -1
  205. package/analyzer-template/packages/github/dist/database/src/lib/scenarioToDb.js +1 -1
  206. package/analyzer-template/packages/github/dist/database/src/lib/scenarioToDb.js.map +1 -1
  207. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts +2 -2
  208. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
  209. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +76 -89
  210. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
  211. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.d.ts.map +1 -1
  212. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js +41 -30
  213. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
  214. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.d.ts.map +1 -1
  215. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
  216. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
  217. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -1
  218. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
  219. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
  220. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.d.ts.map +1 -1
  221. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
  222. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  223. package/analyzer-template/packages/github/dist/types/index.d.ts +3 -4
  224. package/analyzer-template/packages/github/dist/types/index.d.ts.map +1 -1
  225. package/analyzer-template/packages/github/dist/types/index.js +0 -1
  226. package/analyzer-template/packages/github/dist/types/index.js.map +1 -1
  227. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts +2 -0
  228. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
  229. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js +2 -0
  230. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js.map +1 -1
  231. package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts +71 -27
  232. package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts.map +1 -1
  233. package/analyzer-template/packages/github/dist/types/src/types/Commit.d.ts +2 -0
  234. package/analyzer-template/packages/github/dist/types/src/types/Commit.d.ts.map +1 -1
  235. package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts +8 -0
  236. package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
  237. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts +13 -54
  238. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
  239. package/analyzer-template/packages/github/dist/types/src/types/Scenario.js +1 -21
  240. package/analyzer-template/packages/github/dist/types/src/types/Scenario.js.map +1 -1
  241. package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts +153 -5
  242. package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
  243. package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
  244. package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts.map +1 -1
  245. package/analyzer-template/packages/github/dist/types/src/types/StatementInfo.d.ts +2 -0
  246. package/analyzer-template/packages/github/dist/types/src/types/StatementInfo.d.ts.map +1 -1
  247. package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.d.ts +9 -1
  248. package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.d.ts.map +1 -1
  249. package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.js +29 -3
  250. package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.js.map +1 -1
  251. package/analyzer-template/packages/github/package.json +2 -2
  252. package/analyzer-template/packages/types/index.ts +3 -6
  253. package/analyzer-template/packages/types/src/enums/ProjectFramework.ts +2 -0
  254. package/analyzer-template/packages/types/src/types/Analysis.ts +87 -27
  255. package/analyzer-template/packages/types/src/types/Commit.ts +2 -0
  256. package/analyzer-template/packages/types/src/types/ProjectMetadata.ts +8 -0
  257. package/analyzer-template/packages/types/src/types/Scenario.ts +13 -77
  258. package/analyzer-template/packages/types/src/types/ScenariosDataStructure.ts +181 -5
  259. package/analyzer-template/packages/types/src/types/ScopeAnalysis.ts +6 -1
  260. package/analyzer-template/packages/types/src/types/StatementInfo.ts +2 -0
  261. package/analyzer-template/packages/ui-components/package.json +1 -1
  262. package/analyzer-template/packages/utils/dist/types/index.d.ts +3 -4
  263. package/analyzer-template/packages/utils/dist/types/index.d.ts.map +1 -1
  264. package/analyzer-template/packages/utils/dist/types/index.js +0 -1
  265. package/analyzer-template/packages/utils/dist/types/index.js.map +1 -1
  266. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts +2 -0
  267. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
  268. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js +2 -0
  269. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js.map +1 -1
  270. package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts +71 -27
  271. package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts.map +1 -1
  272. package/analyzer-template/packages/utils/dist/types/src/types/Commit.d.ts +2 -0
  273. package/analyzer-template/packages/utils/dist/types/src/types/Commit.d.ts.map +1 -1
  274. package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts +8 -0
  275. package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
  276. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts +13 -54
  277. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
  278. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.js +1 -21
  279. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.js.map +1 -1
  280. package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts +153 -5
  281. package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
  282. package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
  283. package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts.map +1 -1
  284. package/analyzer-template/packages/utils/dist/types/src/types/StatementInfo.d.ts +2 -0
  285. package/analyzer-template/packages/utils/dist/types/src/types/StatementInfo.d.ts.map +1 -1
  286. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
  287. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +98 -3
  288. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  289. package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.d.ts +9 -1
  290. package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.d.ts.map +1 -1
  291. package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.js +29 -3
  292. package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.js.map +1 -1
  293. package/analyzer-template/packages/utils/src/lib/fs/rsyncCopy.ts +121 -3
  294. package/analyzer-template/packages/utils/src/lib/safeFileName.ts +48 -3
  295. package/analyzer-template/playwright/capture.ts +20 -8
  296. package/analyzer-template/playwright/captureFromUrl.ts +89 -82
  297. package/analyzer-template/playwright/captureStatic.ts +1 -1
  298. package/analyzer-template/playwright/getCodeYamInfo.ts +12 -7
  299. package/analyzer-template/project/analyzeBaselineCommit.ts +9 -0
  300. package/analyzer-template/project/analyzeBranchCommit.ts +4 -0
  301. package/analyzer-template/project/analyzeFileEntities.ts +4 -0
  302. package/analyzer-template/project/analyzeRegularCommit.ts +9 -0
  303. package/analyzer-template/project/captureLibraryFunctionDirect.ts +29 -26
  304. package/analyzer-template/project/constructMockCode.ts +593 -91
  305. package/analyzer-template/project/controller/startController.ts +16 -1
  306. package/analyzer-template/project/createEntitiesAndSortFiles.ts +83 -0
  307. package/analyzer-template/project/executeLibraryFunctionDirect.ts +7 -3
  308. package/analyzer-template/project/loadReadyToBeCaptured.ts +65 -41
  309. package/analyzer-template/project/mocks/analyzeFileMock.ts +8 -7
  310. package/analyzer-template/project/orchestrateCapture/AwsCaptureTaskRunner.ts +12 -4
  311. package/analyzer-template/project/orchestrateCapture/SequentialCaptureTaskRunner.ts +18 -7
  312. package/analyzer-template/project/orchestrateCapture/taskRunner.ts +4 -2
  313. package/analyzer-template/project/orchestrateCapture.ts +75 -7
  314. package/analyzer-template/project/reconcileMockDataKeys.ts +220 -1
  315. package/analyzer-template/project/runAnalysis.ts +6 -0
  316. package/analyzer-template/project/start.ts +49 -12
  317. package/analyzer-template/project/startScenarioCapture.ts +9 -0
  318. package/analyzer-template/project/writeClientLogRoute.ts +125 -0
  319. package/analyzer-template/project/writeMockDataTsx.ts +312 -10
  320. package/analyzer-template/project/writeScenarioComponents.ts +314 -43
  321. package/analyzer-template/project/writeSimpleRoot.ts +21 -11
  322. package/analyzer-template/scripts/comboWorkerLoop.cjs +98 -50
  323. package/analyzer-template/tsconfig.json +14 -1
  324. package/background/src/lib/local/createLocalAnalyzer.js +1 -1
  325. package/background/src/lib/local/createLocalAnalyzer.js.map +1 -1
  326. package/background/src/lib/virtualized/project/analyzeBaselineCommit.js +7 -1
  327. package/background/src/lib/virtualized/project/analyzeBaselineCommit.js.map +1 -1
  328. package/background/src/lib/virtualized/project/analyzeBranchCommit.js +2 -1
  329. package/background/src/lib/virtualized/project/analyzeBranchCommit.js.map +1 -1
  330. package/background/src/lib/virtualized/project/analyzeFileEntities.js +2 -1
  331. package/background/src/lib/virtualized/project/analyzeFileEntities.js.map +1 -1
  332. package/background/src/lib/virtualized/project/analyzeRegularCommit.js +7 -1
  333. package/background/src/lib/virtualized/project/analyzeRegularCommit.js.map +1 -1
  334. package/background/src/lib/virtualized/project/captureLibraryFunctionDirect.js +3 -3
  335. package/background/src/lib/virtualized/project/captureLibraryFunctionDirect.js.map +1 -1
  336. package/background/src/lib/virtualized/project/constructMockCode.js +493 -52
  337. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  338. package/background/src/lib/virtualized/project/controller/startController.js +11 -1
  339. package/background/src/lib/virtualized/project/controller/startController.js.map +1 -1
  340. package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js +73 -1
  341. package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js.map +1 -1
  342. package/background/src/lib/virtualized/project/executeLibraryFunctionDirect.js +6 -3
  343. package/background/src/lib/virtualized/project/executeLibraryFunctionDirect.js.map +1 -1
  344. package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js +19 -8
  345. package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js.map +1 -1
  346. package/background/src/lib/virtualized/project/mocks/analyzeFileMock.js +7 -7
  347. package/background/src/lib/virtualized/project/mocks/analyzeFileMock.js.map +1 -1
  348. package/background/src/lib/virtualized/project/orchestrateCapture/AwsCaptureTaskRunner.js +2 -2
  349. package/background/src/lib/virtualized/project/orchestrateCapture/AwsCaptureTaskRunner.js.map +1 -1
  350. package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js +7 -5
  351. package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js.map +1 -1
  352. package/background/src/lib/virtualized/project/orchestrateCapture.js +62 -7
  353. package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
  354. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +184 -1
  355. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
  356. package/background/src/lib/virtualized/project/runAnalysis.js +5 -0
  357. package/background/src/lib/virtualized/project/runAnalysis.js.map +1 -1
  358. package/background/src/lib/virtualized/project/start.js +44 -12
  359. package/background/src/lib/virtualized/project/start.js.map +1 -1
  360. package/background/src/lib/virtualized/project/startScenarioCapture.js +5 -0
  361. package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
  362. package/background/src/lib/virtualized/project/writeClientLogRoute.js +110 -0
  363. package/background/src/lib/virtualized/project/writeClientLogRoute.js.map +1 -0
  364. package/background/src/lib/virtualized/project/writeMockDataTsx.js +263 -6
  365. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  366. package/background/src/lib/virtualized/project/writeScenarioComponents.js +237 -41
  367. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  368. package/background/src/lib/virtualized/project/writeSimpleRoot.js +21 -11
  369. package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
  370. package/codeyam-cli/scripts/apply-setup.js +386 -9
  371. package/codeyam-cli/scripts/apply-setup.js.map +1 -1
  372. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js +196 -0
  373. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js.map +1 -0
  374. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js +114 -0
  375. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js.map +1 -0
  376. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js +149 -0
  377. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js.map +1 -0
  378. package/codeyam-cli/src/cli.js +44 -24
  379. package/codeyam-cli/src/cli.js.map +1 -1
  380. package/codeyam-cli/src/codeyam-cli.js +18 -2
  381. package/codeyam-cli/src/codeyam-cli.js.map +1 -1
  382. package/codeyam-cli/src/commands/__tests__/editor.isolateArgs.test.js +51 -0
  383. package/codeyam-cli/src/commands/__tests__/editor.isolateArgs.test.js.map +1 -0
  384. package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js +56 -0
  385. package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js.map +1 -0
  386. package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js +101 -47
  387. package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js.map +1 -1
  388. package/codeyam-cli/src/commands/analyze.js +21 -9
  389. package/codeyam-cli/src/commands/analyze.js.map +1 -1
  390. package/codeyam-cli/src/commands/baseline.js +10 -11
  391. package/codeyam-cli/src/commands/baseline.js.map +1 -1
  392. package/codeyam-cli/src/commands/debug.js +37 -23
  393. package/codeyam-cli/src/commands/debug.js.map +1 -1
  394. package/codeyam-cli/src/commands/default.js +43 -35
  395. package/codeyam-cli/src/commands/default.js.map +1 -1
  396. package/codeyam-cli/src/commands/editor.js +4630 -0
  397. package/codeyam-cli/src/commands/editor.js.map +1 -0
  398. package/codeyam-cli/src/commands/editorIsolateArgs.js +25 -0
  399. package/codeyam-cli/src/commands/editorIsolateArgs.js.map +1 -0
  400. package/codeyam-cli/src/commands/init.js +148 -292
  401. package/codeyam-cli/src/commands/init.js.map +1 -1
  402. package/codeyam-cli/src/commands/memory.js +278 -0
  403. package/codeyam-cli/src/commands/memory.js.map +1 -0
  404. package/codeyam-cli/src/commands/recapture.js +31 -18
  405. package/codeyam-cli/src/commands/recapture.js.map +1 -1
  406. package/codeyam-cli/src/commands/report.js +46 -1
  407. package/codeyam-cli/src/commands/report.js.map +1 -1
  408. package/codeyam-cli/src/commands/setup-sandbox.js +2 -0
  409. package/codeyam-cli/src/commands/setup-sandbox.js.map +1 -1
  410. package/codeyam-cli/src/commands/setup-simulations.js +284 -0
  411. package/codeyam-cli/src/commands/setup-simulations.js.map +1 -0
  412. package/codeyam-cli/src/commands/start.js +8 -12
  413. package/codeyam-cli/src/commands/start.js.map +1 -1
  414. package/codeyam-cli/src/commands/telemetry.js +37 -0
  415. package/codeyam-cli/src/commands/telemetry.js.map +1 -0
  416. package/codeyam-cli/src/commands/test-startup.js +2 -0
  417. package/codeyam-cli/src/commands/test-startup.js.map +1 -1
  418. package/codeyam-cli/src/commands/verify.js +14 -2
  419. package/codeyam-cli/src/commands/verify.js.map +1 -1
  420. package/codeyam-cli/src/data/techStacks.js +77 -0
  421. package/codeyam-cli/src/data/techStacks.js.map +1 -0
  422. package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js +173 -0
  423. package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js.map +1 -0
  424. package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js +46 -0
  425. package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js.map +1 -0
  426. package/codeyam-cli/src/utils/__tests__/devServerState.test.js +134 -0
  427. package/codeyam-cli/src/utils/__tests__/devServerState.test.js.map +1 -0
  428. package/codeyam-cli/src/utils/__tests__/editorApi.test.js +137 -0
  429. package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -0
  430. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +2379 -0
  431. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -0
  432. package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js +76 -0
  433. package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js.map +1 -0
  434. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js +93 -0
  435. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js.map +1 -0
  436. package/codeyam-cli/src/utils/__tests__/editorDeleteScenario.test.js +100 -0
  437. package/codeyam-cli/src/utils/__tests__/editorDeleteScenario.test.js.map +1 -0
  438. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +304 -0
  439. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -0
  440. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js +194 -0
  441. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js.map +1 -0
  442. package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js +315 -0
  443. package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js.map +1 -0
  444. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js +294 -0
  445. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js.map +1 -0
  446. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +542 -0
  447. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -0
  448. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js +594 -0
  449. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js.map +1 -0
  450. package/codeyam-cli/src/utils/__tests__/editorMigration.test.js +435 -0
  451. package/codeyam-cli/src/utils/__tests__/editorMigration.test.js.map +1 -0
  452. package/codeyam-cli/src/utils/__tests__/editorMockState.test.js +270 -0
  453. package/codeyam-cli/src/utils/__tests__/editorMockState.test.js.map +1 -0
  454. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js +217 -0
  455. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -0
  456. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +353 -0
  457. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -0
  458. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js +153 -0
  459. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js.map +1 -0
  460. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js +139 -0
  461. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js.map +1 -0
  462. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +221 -0
  463. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -0
  464. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +1559 -0
  465. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -0
  466. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +280 -0
  467. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -0
  468. package/codeyam-cli/src/utils/__tests__/editorSeedAdapterPrismaValidation.test.js +143 -0
  469. package/codeyam-cli/src/utils/__tests__/editorSeedAdapterPrismaValidation.test.js.map +1 -0
  470. package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js +66 -0
  471. package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js.map +1 -0
  472. package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js +53 -0
  473. package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js.map +1 -0
  474. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +1857 -0
  475. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -0
  476. package/codeyam-cli/src/utils/__tests__/git.editor.test.js +134 -0
  477. package/codeyam-cli/src/utils/__tests__/git.editor.test.js.map +1 -0
  478. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js +107 -0
  479. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js.map +1 -0
  480. package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js +185 -0
  481. package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js.map +1 -0
  482. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js +129 -0
  483. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js.map +1 -0
  484. package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js +9 -0
  485. package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js.map +1 -1
  486. package/codeyam-cli/src/utils/__tests__/project.test.js +65 -0
  487. package/codeyam-cli/src/utils/__tests__/project.test.js.map +1 -0
  488. package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js +118 -0
  489. package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js.map +1 -0
  490. package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js +284 -0
  491. package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js.map +1 -0
  492. package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js +121 -0
  493. package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js.map +1 -0
  494. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +672 -0
  495. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -0
  496. package/codeyam-cli/src/utils/__tests__/serverVersionStaleness.test.js +81 -0
  497. package/codeyam-cli/src/utils/__tests__/serverVersionStaleness.test.js.map +1 -0
  498. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +175 -82
  499. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
  500. package/codeyam-cli/src/utils/__tests__/telemetry.test.js +159 -0
  501. package/codeyam-cli/src/utils/__tests__/telemetry.test.js.map +1 -0
  502. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js +51 -0
  503. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js.map +1 -0
  504. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js +142 -0
  505. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js.map +1 -0
  506. package/codeyam-cli/src/utils/analysisRunner.js +32 -16
  507. package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
  508. package/codeyam-cli/src/utils/analyzer.js +16 -0
  509. package/codeyam-cli/src/utils/analyzer.js.map +1 -1
  510. package/codeyam-cli/src/utils/analyzerFinalization.js +100 -0
  511. package/codeyam-cli/src/utils/analyzerFinalization.js.map +1 -0
  512. package/codeyam-cli/src/utils/backgroundServer.js +203 -30
  513. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  514. package/codeyam-cli/src/utils/buildFlags.js +4 -0
  515. package/codeyam-cli/src/utils/buildFlags.js.map +1 -0
  516. package/codeyam-cli/src/utils/database.js +37 -2
  517. package/codeyam-cli/src/utils/database.js.map +1 -1
  518. package/codeyam-cli/src/utils/devModeEvents.js +40 -0
  519. package/codeyam-cli/src/utils/devModeEvents.js.map +1 -0
  520. package/codeyam-cli/src/utils/devServerState.js +71 -0
  521. package/codeyam-cli/src/utils/devServerState.js.map +1 -0
  522. package/codeyam-cli/src/utils/editorApi.js +79 -0
  523. package/codeyam-cli/src/utils/editorApi.js.map +1 -0
  524. package/codeyam-cli/src/utils/editorAudit.js +480 -0
  525. package/codeyam-cli/src/utils/editorAudit.js.map +1 -0
  526. package/codeyam-cli/src/utils/editorBroadcastViewport.js +26 -0
  527. package/codeyam-cli/src/utils/editorBroadcastViewport.js.map +1 -0
  528. package/codeyam-cli/src/utils/editorCapture.js +102 -0
  529. package/codeyam-cli/src/utils/editorCapture.js.map +1 -0
  530. package/codeyam-cli/src/utils/editorDeleteScenario.js +67 -0
  531. package/codeyam-cli/src/utils/editorDeleteScenario.js.map +1 -0
  532. package/codeyam-cli/src/utils/editorDevServer.js +197 -0
  533. package/codeyam-cli/src/utils/editorDevServer.js.map +1 -0
  534. package/codeyam-cli/src/utils/editorEntityChangeStatus.js +50 -0
  535. package/codeyam-cli/src/utils/editorEntityChangeStatus.js.map +1 -0
  536. package/codeyam-cli/src/utils/editorEntityHelpers.js +144 -0
  537. package/codeyam-cli/src/utils/editorEntityHelpers.js.map +1 -0
  538. package/codeyam-cli/src/utils/editorImageVerifier.js +155 -0
  539. package/codeyam-cli/src/utils/editorImageVerifier.js.map +1 -0
  540. package/codeyam-cli/src/utils/editorJournal.js +225 -0
  541. package/codeyam-cli/src/utils/editorJournal.js.map +1 -0
  542. package/codeyam-cli/src/utils/editorLoaderHelpers.js +152 -0
  543. package/codeyam-cli/src/utils/editorLoaderHelpers.js.map +1 -0
  544. package/codeyam-cli/src/utils/editorMigration.js +224 -0
  545. package/codeyam-cli/src/utils/editorMigration.js.map +1 -0
  546. package/codeyam-cli/src/utils/editorMockState.js +248 -0
  547. package/codeyam-cli/src/utils/editorMockState.js.map +1 -0
  548. package/codeyam-cli/src/utils/editorPreloadHelpers.js +135 -0
  549. package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -0
  550. package/codeyam-cli/src/utils/editorPreview.js +137 -0
  551. package/codeyam-cli/src/utils/editorPreview.js.map +1 -0
  552. package/codeyam-cli/src/utils/editorScenarioSwitch.js +112 -0
  553. package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -0
  554. package/codeyam-cli/src/utils/editorScenarios.js +557 -0
  555. package/codeyam-cli/src/utils/editorScenarios.js.map +1 -0
  556. package/codeyam-cli/src/utils/editorSeedAdapter.js +422 -0
  557. package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -0
  558. package/codeyam-cli/src/utils/editorShouldRevalidate.js +21 -0
  559. package/codeyam-cli/src/utils/editorShouldRevalidate.js.map +1 -0
  560. package/codeyam-cli/src/utils/entityChangeStatus.js +366 -0
  561. package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -0
  562. package/codeyam-cli/src/utils/entityChangeStatus.server.js +196 -0
  563. package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -0
  564. package/codeyam-cli/src/utils/fileMetadata.js +5 -0
  565. package/codeyam-cli/src/utils/fileMetadata.js.map +1 -1
  566. package/codeyam-cli/src/utils/fileWatcher.js +63 -9
  567. package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
  568. package/codeyam-cli/src/utils/generateReport.js +4 -3
  569. package/codeyam-cli/src/utils/generateReport.js.map +1 -1
  570. package/codeyam-cli/src/utils/git.js +103 -0
  571. package/codeyam-cli/src/utils/git.js.map +1 -1
  572. package/codeyam-cli/src/utils/install-skills.js +134 -39
  573. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  574. package/codeyam-cli/src/utils/interactiveSyncWatcher.js +126 -0
  575. package/codeyam-cli/src/utils/interactiveSyncWatcher.js.map +1 -0
  576. package/codeyam-cli/src/utils/labsAutoCheck.js +19 -0
  577. package/codeyam-cli/src/utils/labsAutoCheck.js.map +1 -0
  578. package/codeyam-cli/src/utils/npmVersionCheck.js +76 -0
  579. package/codeyam-cli/src/utils/npmVersionCheck.js.map +1 -0
  580. package/codeyam-cli/src/utils/parseRegisterArg.js +31 -0
  581. package/codeyam-cli/src/utils/parseRegisterArg.js.map +1 -0
  582. package/codeyam-cli/src/utils/pathIgnoring.js +19 -7
  583. package/codeyam-cli/src/utils/pathIgnoring.js.map +1 -1
  584. package/codeyam-cli/src/utils/progress.js +8 -1
  585. package/codeyam-cli/src/utils/progress.js.map +1 -1
  586. package/codeyam-cli/src/utils/project.js +15 -5
  587. package/codeyam-cli/src/utils/project.js.map +1 -1
  588. package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js +11 -11
  589. package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js.map +1 -1
  590. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js +22 -0
  591. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js.map +1 -1
  592. package/codeyam-cli/src/utils/queue/heartbeat.js +13 -5
  593. package/codeyam-cli/src/utils/queue/heartbeat.js.map +1 -1
  594. package/codeyam-cli/src/utils/queue/job.js +75 -1
  595. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  596. package/codeyam-cli/src/utils/queue/manager.js +7 -0
  597. package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
  598. package/codeyam-cli/src/utils/requireSimulations.js +10 -0
  599. package/codeyam-cli/src/utils/requireSimulations.js.map +1 -0
  600. package/codeyam-cli/src/utils/routePatternMatching.js +129 -0
  601. package/codeyam-cli/src/utils/routePatternMatching.js.map +1 -0
  602. package/codeyam-cli/src/utils/ruleReflection/__tests__/confusionDetector.test.js +82 -0
  603. package/codeyam-cli/src/utils/ruleReflection/__tests__/confusionDetector.test.js.map +1 -0
  604. package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js +229 -0
  605. package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js.map +1 -0
  606. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js +67 -0
  607. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js.map +1 -0
  608. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/captureFixture.js +105 -0
  609. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/captureFixture.js.map +1 -0
  610. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/loadCapturedFixture.js +34 -0
  611. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/loadCapturedFixture.js.map +1 -0
  612. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/runClaude.js +162 -0
  613. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/runClaude.js.map +1 -0
  614. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js +74 -0
  615. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js.map +1 -0
  616. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js +376 -0
  617. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js.map +1 -0
  618. package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js +113 -0
  619. package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js.map +1 -0
  620. package/codeyam-cli/src/utils/ruleReflection/__tests__/transcriptParser.test.js +127 -0
  621. package/codeyam-cli/src/utils/ruleReflection/__tests__/transcriptParser.test.js.map +1 -0
  622. package/codeyam-cli/src/utils/ruleReflection/confusionDetector.js +50 -0
  623. package/codeyam-cli/src/utils/ruleReflection/confusionDetector.js.map +1 -0
  624. package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js +116 -0
  625. package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js.map +1 -0
  626. package/codeyam-cli/src/utils/ruleReflection/index.js +5 -0
  627. package/codeyam-cli/src/utils/ruleReflection/index.js.map +1 -0
  628. package/codeyam-cli/src/utils/ruleReflection/promptBuilder.js +44 -0
  629. package/codeyam-cli/src/utils/ruleReflection/promptBuilder.js.map +1 -0
  630. package/codeyam-cli/src/utils/ruleReflection/transcriptParser.js +85 -0
  631. package/codeyam-cli/src/utils/ruleReflection/transcriptParser.js.map +1 -0
  632. package/codeyam-cli/src/utils/ruleReflection/types.js +5 -0
  633. package/codeyam-cli/src/utils/ruleReflection/types.js.map +1 -0
  634. package/codeyam-cli/src/utils/rules/__tests__/parser.test.js +83 -0
  635. package/codeyam-cli/src/utils/rules/__tests__/parser.test.js.map +1 -0
  636. package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js +118 -0
  637. package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js.map +1 -0
  638. package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js +72 -0
  639. package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js.map +1 -0
  640. package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js +293 -0
  641. package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js.map +1 -0
  642. package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js +76 -0
  643. package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js.map +1 -0
  644. package/codeyam-cli/src/utils/rules/index.js +7 -0
  645. package/codeyam-cli/src/utils/rules/index.js.map +1 -0
  646. package/codeyam-cli/src/utils/rules/parser.js +93 -0
  647. package/codeyam-cli/src/utils/rules/parser.js.map +1 -0
  648. package/codeyam-cli/src/utils/rules/pathMatcher.js +49 -0
  649. package/codeyam-cli/src/utils/rules/pathMatcher.js.map +1 -0
  650. package/codeyam-cli/src/utils/rules/rulePlacement.js +65 -0
  651. package/codeyam-cli/src/utils/rules/rulePlacement.js.map +1 -0
  652. package/codeyam-cli/src/utils/rules/ruleState.js +150 -0
  653. package/codeyam-cli/src/utils/rules/ruleState.js.map +1 -0
  654. package/codeyam-cli/src/utils/rules/sourceFiles.js +43 -0
  655. package/codeyam-cli/src/utils/rules/sourceFiles.js.map +1 -0
  656. package/codeyam-cli/src/utils/rules/staleness.js +137 -0
  657. package/codeyam-cli/src/utils/rules/staleness.js.map +1 -0
  658. package/codeyam-cli/src/utils/scenarioCoverage.js +77 -0
  659. package/codeyam-cli/src/utils/scenarioCoverage.js.map +1 -0
  660. package/codeyam-cli/src/utils/scenarioMarkers.js +134 -0
  661. package/codeyam-cli/src/utils/scenarioMarkers.js.map +1 -0
  662. package/codeyam-cli/src/utils/scenariosManifest.js +285 -0
  663. package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -0
  664. package/codeyam-cli/src/utils/serverState.js +94 -12
  665. package/codeyam-cli/src/utils/serverState.js.map +1 -1
  666. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +96 -45
  667. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
  668. package/codeyam-cli/src/utils/simulationGateMiddleware.js +166 -0
  669. package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -0
  670. package/codeyam-cli/src/utils/slugUtils.js +25 -0
  671. package/codeyam-cli/src/utils/slugUtils.js.map +1 -0
  672. package/codeyam-cli/src/utils/syncMocksMiddleware.js +7 -26
  673. package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
  674. package/codeyam-cli/src/utils/telemetry.js +106 -0
  675. package/codeyam-cli/src/utils/telemetry.js.map +1 -0
  676. package/codeyam-cli/src/utils/telemetryMiddleware.js +22 -0
  677. package/codeyam-cli/src/utils/telemetryMiddleware.js.map +1 -0
  678. package/codeyam-cli/src/utils/testRunner.js +158 -0
  679. package/codeyam-cli/src/utils/testRunner.js.map +1 -0
  680. package/codeyam-cli/src/utils/transcriptPruning.js +67 -0
  681. package/codeyam-cli/src/utils/transcriptPruning.js.map +1 -0
  682. package/codeyam-cli/src/utils/versionInfo.js +67 -15
  683. package/codeyam-cli/src/utils/versionInfo.js.map +1 -1
  684. package/codeyam-cli/src/utils/webappDetection.js +35 -2
  685. package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
  686. package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js +35 -0
  687. package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js.map +1 -0
  688. package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js +80 -0
  689. package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js.map +1 -0
  690. package/codeyam-cli/src/webserver/__tests__/dependency-smoke.test.js +66 -0
  691. package/codeyam-cli/src/webserver/__tests__/dependency-smoke.test.js.map +1 -0
  692. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js +628 -0
  693. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -0
  694. package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js +217 -0
  695. package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js.map +1 -0
  696. package/codeyam-cli/src/webserver/app/lib/clientErrors.js +71 -0
  697. package/codeyam-cli/src/webserver/app/lib/clientErrors.js.map +1 -0
  698. package/codeyam-cli/src/webserver/app/lib/database.js +63 -33
  699. package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
  700. package/codeyam-cli/src/webserver/app/lib/dbNotifier.js.map +1 -1
  701. package/codeyam-cli/src/webserver/app/lib/git.js +397 -0
  702. package/codeyam-cli/src/webserver/app/lib/git.js.map +1 -0
  703. package/codeyam-cli/src/webserver/app/types/editor.js +8 -0
  704. package/codeyam-cli/src/webserver/app/types/editor.js.map +1 -0
  705. package/codeyam-cli/src/webserver/backgroundServer.js +186 -37
  706. package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
  707. package/codeyam-cli/src/webserver/bootstrap.js +51 -0
  708. package/codeyam-cli/src/webserver/bootstrap.js.map +1 -1
  709. package/codeyam-cli/src/webserver/build/client/assets/CopyButton-CLe80MMu.js +1 -0
  710. package/codeyam-cli/src/webserver/build/client/assets/EntityItem-Crt_KN_U.js +11 -0
  711. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-CQgyEGV-.js +1 -0
  712. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-CD7lGABo.js +41 -0
  713. package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-CgTNOhnu.js +1 -0
  714. package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-CKeQT5Ty.js +25 -0
  715. package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-D3s1MFkb.js +3 -0
  716. package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-B0GLXMsr.js → LoadingDots-By5zI316.js} +1 -1
  717. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-xgeCVgSM.js → LogViewer-CM5zg40N.js} +3 -3
  718. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-C2PLkej3.js +11 -0
  719. package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-DanvyBPb.js +1 -0
  720. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-DUMfcNVK.js +10 -0
  721. package/codeyam-cli/src/webserver/build/client/assets/Spinner-D0LgAaSa.js +34 -0
  722. package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-CK7-NaPZ.js +1 -0
  723. package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-BA_Ry-rs.js +1 -0
  724. package/codeyam-cli/src/webserver/build/client/assets/_index-BAWd-Xjf.js +11 -0
  725. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-BOARiB-g.js +27 -0
  726. package/codeyam-cli/src/webserver/build/client/assets/addon-canvas-DpzMmAy5.js +1 -0
  727. package/codeyam-cli/src/webserver/build/client/assets/addon-fit-YJmn1quW.js +12 -0
  728. package/codeyam-cli/src/webserver/build/client/assets/addon-web-links-CHx25PAe.js +1 -0
  729. package/codeyam-cli/src/webserver/build/client/assets/addon-webgl-DI8QOUvO.js +58 -0
  730. package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-Bg3e7q4S.js +22 -0
  731. package/codeyam-cli/src/webserver/build/client/assets/api.editor-capture-scenario-l0sNRNKZ.js +1 -0
  732. package/codeyam-cli/src/webserver/build/client/assets/api.editor-client-errors-l0sNRNKZ.js +1 -0
  733. package/codeyam-cli/src/webserver/build/client/assets/api.editor-commit-l0sNRNKZ.js +1 -0
  734. package/codeyam-cli/src/webserver/build/client/assets/api.editor-dev-server-l0sNRNKZ.js +1 -0
  735. package/codeyam-cli/src/webserver/build/client/assets/api.editor-entity-status-l0sNRNKZ.js +1 -0
  736. package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-diff-l0sNRNKZ.js +1 -0
  737. package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-l0sNRNKZ.js +1 -0
  738. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-entry-l0sNRNKZ.js +1 -0
  739. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-image._-l0sNRNKZ.js +1 -0
  740. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-l0sNRNKZ.js +1 -0
  741. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-screenshot-l0sNRNKZ.js +1 -0
  742. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-update-l0sNRNKZ.js +1 -0
  743. package/codeyam-cli/src/webserver/build/client/assets/api.editor-load-commit-l0sNRNKZ.js +1 -0
  744. package/codeyam-cli/src/webserver/build/client/assets/api.editor-project-info-l0sNRNKZ.js +1 -0
  745. package/codeyam-cli/src/webserver/build/client/assets/api.editor-refresh-l0sNRNKZ.js +1 -0
  746. package/codeyam-cli/src/webserver/build/client/assets/api.editor-register-scenario-l0sNRNKZ.js +1 -0
  747. package/codeyam-cli/src/webserver/build/client/assets/api.editor-rename-scenario-l0sNRNKZ.js +1 -0
  748. package/codeyam-cli/src/webserver/build/client/assets/api.editor-save-seed-state-l0sNRNKZ.js +1 -0
  749. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-coverage-l0sNRNKZ.js +1 -0
  750. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-data-l0sNRNKZ.js +1 -0
  751. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-image._-l0sNRNKZ.js +1 -0
  752. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-prompt-l0sNRNKZ.js +1 -0
  753. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenarios-l0sNRNKZ.js +1 -0
  754. package/codeyam-cli/src/webserver/build/client/assets/api.editor-session-l0sNRNKZ.js +1 -0
  755. package/codeyam-cli/src/webserver/build/client/assets/api.editor-switch-scenario-l0sNRNKZ.js +1 -0
  756. package/codeyam-cli/src/webserver/build/client/assets/api.editor-test-results-l0sNRNKZ.js +1 -0
  757. package/codeyam-cli/src/webserver/build/client/assets/api.health-l0sNRNKZ.js +1 -0
  758. package/codeyam-cli/src/webserver/build/client/assets/api.labs-unlock-l0sNRNKZ.js +1 -0
  759. package/codeyam-cli/src/webserver/build/client/assets/api.memory-profile-l0sNRNKZ.js +1 -0
  760. package/codeyam-cli/src/webserver/build/client/assets/api.restart-server-l0sNRNKZ.js +1 -0
  761. package/codeyam-cli/src/webserver/build/client/assets/api.rule-path-l0sNRNKZ.js +1 -0
  762. package/codeyam-cli/src/webserver/build/client/assets/api.save-fixture-l0sNRNKZ.js +1 -0
  763. package/codeyam-cli/src/webserver/build/client/assets/book-open-CL-lMgHh.js +6 -0
  764. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-Cx24_aWc.js → chevron-down-GmAjGS9-.js} +2 -2
  765. package/codeyam-cli/src/webserver/build/client/assets/chunk-JZWAC4HX-BAdwhyCx.js +43 -0
  766. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-BOARzkeR.js → circle-check-DFcQkN5j.js} +2 -2
  767. package/codeyam-cli/src/webserver/build/client/assets/copy-C6iF61Xs.js +11 -0
  768. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-4ImjHTVC.js +41 -0
  769. package/codeyam-cli/src/webserver/build/client/assets/{cy-logo-cli-C1gnJVOL.svg → cy-logo-cli-CCKUIm0S.svg} +2 -2
  770. package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-DcX-ZS3p.js +1 -0
  771. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-C8y4mmyv.js +1 -0
  772. package/codeyam-cli/src/webserver/build/client/assets/editor._tab-Gbk_i5Js.js +1 -0
  773. package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-DN5ouXAl.js +58 -0
  774. package/codeyam-cli/src/webserver/build/client/assets/editorPreview-oepecPae.js +41 -0
  775. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-D0-YwkBh.js → entity._sha._-Blfy9UlN.js} +13 -13
  776. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-KTQuL0aj.js +6 -0
  777. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-C6eeL24i.js +6 -0
  778. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-DQM8E7L4.js +6 -0
  779. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-C1H_a_Y3.js → entity._sha_.edit._scenarioId-CAoXLsQr.js} +2 -2
  780. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-CS2cb_eZ.js → entry.client-SuW9syRS.js} +6 -6
  781. package/codeyam-cli/src/webserver/build/client/assets/executionFlowCoverage-BWhdfn70.js +1 -0
  782. package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-Daa96Fr1.js +1 -0
  783. package/codeyam-cli/src/webserver/build/client/assets/files-D-xGrg29.js +1 -0
  784. package/codeyam-cli/src/webserver/build/client/assets/git-Bq_fbXP5.js +1 -0
  785. package/codeyam-cli/src/webserver/build/client/assets/globals-fAqOD9ex.css +1 -0
  786. package/codeyam-cli/src/webserver/build/client/assets/{index-lzqtyFU8.js → index-Bp1l4hSv.js} +1 -1
  787. package/codeyam-cli/src/webserver/build/client/assets/{index-B1h680n5.js → index-CWV9XZiG.js} +1 -1
  788. package/codeyam-cli/src/webserver/build/client/assets/index-DE3jI_dv.js +15 -0
  789. package/codeyam-cli/src/webserver/build/client/assets/jsx-runtime-D_zvdyIk.js +9 -0
  790. package/codeyam-cli/src/webserver/build/client/assets/labs-B_IX45ih.js +1 -0
  791. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-B7B9V-bu.js → loader-circle-De-7qQ2u.js} +2 -2
  792. package/codeyam-cli/src/webserver/build/client/assets/manifest-389033be.js +1 -0
  793. package/codeyam-cli/src/webserver/build/client/assets/memory-Cx2xEx7s.js +101 -0
  794. package/codeyam-cli/src/webserver/build/client/assets/pause-CFxEKL1u.js +11 -0
  795. package/codeyam-cli/src/webserver/build/client/assets/root-DB3O9_9j.js +67 -0
  796. package/codeyam-cli/src/webserver/build/client/assets/{search-CxXUmBSd.js → search-BdBb5aqc.js} +2 -2
  797. package/codeyam-cli/src/webserver/build/client/assets/settings-DdE-Untf.js +1 -0
  798. package/codeyam-cli/src/webserver/build/client/assets/simulations-DSCdE99u.js +1 -0
  799. package/codeyam-cli/src/webserver/build/client/assets/terminal-CrplD4b1.js +11 -0
  800. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-B6LgvRJg.js → triangle-alert-DqJ0j69l.js} +2 -2
  801. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-DhXHbEjP.js +1 -0
  802. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-BNd5hYuW.js +2 -0
  803. package/codeyam-cli/src/webserver/build/client/assets/useReportContext-Cy5Qg_UR.js +1 -0
  804. package/codeyam-cli/src/webserver/build/client/assets/useToast-5HR2j9ZE.js +1 -0
  805. package/codeyam-cli/src/webserver/build/client/assets/xterm-BqvuqXEL.js +27 -0
  806. package/codeyam-cli/src/webserver/build/client/sound-test.html +98 -0
  807. package/codeyam-cli/src/webserver/build/server/assets/analysisRunner-D_1MSYeW.js +13 -0
  808. package/codeyam-cli/src/webserver/build/server/assets/index-ckWaCf_v.js +1 -0
  809. package/codeyam-cli/src/webserver/build/server/assets/init-ld124R4Z.js +10 -0
  810. package/codeyam-cli/src/webserver/build/server/assets/progress-CHTtrxFG.js +1 -0
  811. package/codeyam-cli/src/webserver/build/server/assets/server-build-DzzNZGv_.js +551 -0
  812. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  813. package/codeyam-cli/src/webserver/build-info.json +5 -5
  814. package/codeyam-cli/src/webserver/devServer.js +39 -5
  815. package/codeyam-cli/src/webserver/devServer.js.map +1 -1
  816. package/codeyam-cli/src/webserver/editorProxy.js +976 -0
  817. package/codeyam-cli/src/webserver/editorProxy.js.map +1 -0
  818. package/codeyam-cli/src/webserver/idleDetector.js +106 -0
  819. package/codeyam-cli/src/webserver/idleDetector.js.map +1 -0
  820. package/codeyam-cli/src/webserver/mockStateEvents.js +28 -0
  821. package/codeyam-cli/src/webserver/mockStateEvents.js.map +1 -0
  822. package/codeyam-cli/src/webserver/public/sound-test.html +98 -0
  823. package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +414 -0
  824. package/codeyam-cli/src/webserver/scripts/journalCapture.ts +266 -0
  825. package/codeyam-cli/src/webserver/server.js +376 -26
  826. package/codeyam-cli/src/webserver/server.js.map +1 -1
  827. package/codeyam-cli/src/webserver/terminalServer.js +831 -0
  828. package/codeyam-cli/src/webserver/terminalServer.js.map +1 -0
  829. package/codeyam-cli/templates/chrome-extension-react/EXTENSION_SETUP.md +75 -0
  830. package/codeyam-cli/templates/chrome-extension-react/README.md +46 -0
  831. package/codeyam-cli/templates/chrome-extension-react/gitignore +15 -0
  832. package/codeyam-cli/templates/chrome-extension-react/index.html +12 -0
  833. package/codeyam-cli/templates/chrome-extension-react/package.json +27 -0
  834. package/codeyam-cli/templates/chrome-extension-react/popup.html +12 -0
  835. package/codeyam-cli/templates/chrome-extension-react/public/manifest.json +15 -0
  836. package/codeyam-cli/templates/chrome-extension-react/src/background/service-worker.ts +7 -0
  837. package/codeyam-cli/templates/chrome-extension-react/src/globals.css +6 -0
  838. package/codeyam-cli/templates/chrome-extension-react/src/lib/storage.ts +37 -0
  839. package/codeyam-cli/templates/chrome-extension-react/src/popup/App.tsx +12 -0
  840. package/codeyam-cli/templates/chrome-extension-react/src/popup/main.tsx +10 -0
  841. package/codeyam-cli/templates/chrome-extension-react/tsconfig.json +24 -0
  842. package/codeyam-cli/templates/chrome-extension-react/vite.config.ts +41 -0
  843. package/codeyam-cli/templates/codeyam-editor-claude.md +147 -0
  844. package/codeyam-cli/templates/codeyam-editor-reference.md +214 -0
  845. package/codeyam-cli/templates/codeyam-memory-hook.sh +199 -0
  846. package/codeyam-cli/templates/commands/codeyam-diagnose.md +481 -0
  847. package/codeyam-cli/templates/editor-step-hook.py +321 -0
  848. package/codeyam-cli/templates/expo-react-native/MOBILE_SETUP.md +89 -0
  849. package/codeyam-cli/templates/expo-react-native/README.md +41 -0
  850. package/codeyam-cli/templates/expo-react-native/app/(tabs)/_layout.tsx +33 -0
  851. package/codeyam-cli/templates/expo-react-native/app/(tabs)/index.tsx +12 -0
  852. package/codeyam-cli/templates/expo-react-native/app/(tabs)/settings.tsx +12 -0
  853. package/codeyam-cli/templates/expo-react-native/app/_layout.tsx +12 -0
  854. package/codeyam-cli/templates/expo-react-native/app.json +18 -0
  855. package/codeyam-cli/templates/expo-react-native/babel.config.js +9 -0
  856. package/codeyam-cli/templates/expo-react-native/gitignore +12 -0
  857. package/codeyam-cli/templates/expo-react-native/global.css +3 -0
  858. package/codeyam-cli/templates/expo-react-native/lib/storage.ts +32 -0
  859. package/codeyam-cli/templates/expo-react-native/metro.config.js +6 -0
  860. package/codeyam-cli/templates/expo-react-native/nativewind-env.d.ts +1 -0
  861. package/codeyam-cli/templates/expo-react-native/package.json +38 -0
  862. package/codeyam-cli/templates/expo-react-native/tailwind.config.js +10 -0
  863. package/codeyam-cli/templates/expo-react-native/tsconfig.json +10 -0
  864. package/codeyam-cli/templates/hooks/staleness-check.sh +43 -0
  865. package/codeyam-cli/templates/isolation-route/next-app.tsx.template +80 -0
  866. package/codeyam-cli/templates/isolation-route/next-pages.tsx.template +79 -0
  867. package/codeyam-cli/templates/isolation-route/vite-react.tsx.template +78 -0
  868. package/codeyam-cli/templates/msw/browser-setup.ts.template +47 -0
  869. package/codeyam-cli/templates/msw/handler-router.ts.template +47 -0
  870. package/codeyam-cli/templates/msw/server-setup.ts.template +52 -0
  871. package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_PATTERNS.md +308 -0
  872. package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_UPGRADE.md +304 -0
  873. package/codeyam-cli/templates/nextjs-prisma-sqlite/DATABASE.md +126 -0
  874. package/codeyam-cli/templates/nextjs-prisma-sqlite/FEATURE_PATTERNS.md +37 -0
  875. package/codeyam-cli/templates/nextjs-prisma-sqlite/README.md +53 -0
  876. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/api/todos/route.ts +17 -0
  877. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/codeyam-isolate/layout.tsx +12 -0
  878. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/globals.css +26 -0
  879. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/layout.tsx +34 -0
  880. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/lib/prisma.ts +24 -0
  881. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/page.tsx +10 -0
  882. package/codeyam-cli/templates/nextjs-prisma-sqlite/env +4 -0
  883. package/codeyam-cli/templates/nextjs-prisma-sqlite/eslint.config.mjs +11 -0
  884. package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +64 -0
  885. package/codeyam-cli/templates/nextjs-prisma-sqlite/next.config.ts +14 -0
  886. package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +39 -0
  887. package/codeyam-cli/templates/nextjs-prisma-sqlite/postcss.config.mjs +7 -0
  888. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/schema.prisma +27 -0
  889. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/seed.ts +40 -0
  890. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma.config.ts +12 -0
  891. package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +127 -0
  892. package/codeyam-cli/templates/nextjs-prisma-sqlite/tsconfig.json +34 -0
  893. package/codeyam-cli/templates/nextjs-prisma-sqlite/vitest.config.ts +13 -0
  894. package/codeyam-cli/templates/nextjs-prisma-supabase/README.md +52 -0
  895. package/codeyam-cli/templates/nextjs-prisma-supabase/SUPABASE_SETUP.md +104 -0
  896. package/codeyam-cli/templates/nextjs-prisma-supabase/app/api/todos/route.ts +17 -0
  897. package/codeyam-cli/templates/nextjs-prisma-supabase/app/globals.css +26 -0
  898. package/codeyam-cli/templates/nextjs-prisma-supabase/app/layout.tsx +34 -0
  899. package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/prisma.ts +20 -0
  900. package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/supabase.ts +12 -0
  901. package/codeyam-cli/templates/nextjs-prisma-supabase/app/page.tsx +10 -0
  902. package/codeyam-cli/templates/nextjs-prisma-supabase/env +9 -0
  903. package/codeyam-cli/templates/nextjs-prisma-supabase/eslint.config.mjs +11 -0
  904. package/codeyam-cli/templates/nextjs-prisma-supabase/gitignore +40 -0
  905. package/codeyam-cli/templates/nextjs-prisma-supabase/next.config.ts +11 -0
  906. package/codeyam-cli/templates/nextjs-prisma-supabase/package.json +37 -0
  907. package/codeyam-cli/templates/nextjs-prisma-supabase/postcss.config.mjs +7 -0
  908. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/schema.prisma +27 -0
  909. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/seed.ts +39 -0
  910. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma.config.ts +12 -0
  911. package/codeyam-cli/templates/nextjs-prisma-supabase/tsconfig.json +34 -0
  912. package/codeyam-cli/templates/prompts/conversation-guidance.txt +44 -0
  913. package/codeyam-cli/templates/prompts/conversation-prompt.txt +28 -0
  914. package/codeyam-cli/templates/prompts/interruption-prompt.txt +31 -0
  915. package/codeyam-cli/templates/prompts/stale-rules-prompt.txt +24 -0
  916. package/codeyam-cli/templates/rule-notification-hook.py +83 -0
  917. package/codeyam-cli/templates/rule-reflection-hook.py +647 -0
  918. package/codeyam-cli/templates/rules-instructions.md +78 -0
  919. package/codeyam-cli/templates/seed-adapters/supabase.ts +282 -0
  920. package/codeyam-cli/templates/{codeyam-debug-skill.md → skills/codeyam-debug/SKILL.md} +48 -4
  921. package/codeyam-cli/templates/skills/codeyam-dev-mode/SKILL.md +237 -0
  922. package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +211 -0
  923. package/codeyam-cli/templates/skills/codeyam-memory/SKILL.md +611 -0
  924. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/deprecated-prompt.md +100 -0
  925. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.mjs +139 -0
  926. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs +52 -0
  927. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/misleading-api-prompt.md +117 -0
  928. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/read-json-field.mjs +61 -0
  929. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/ripgrep-fallback.mjs +155 -0
  930. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/analyze-prompt.md +46 -0
  931. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.mjs +13 -0
  932. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter-session.mjs +95 -0
  933. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.mjs +160 -0
  934. package/codeyam-cli/templates/skills/codeyam-new-rule/SKILL.md +11 -0
  935. package/codeyam-cli/templates/{codeyam-setup-skill.md → skills/codeyam-setup/SKILL.md} +13 -1
  936. package/codeyam-cli/templates/{codeyam-sim-skill.md → skills/codeyam-sim/SKILL.md} +1 -1
  937. package/codeyam-cli/templates/{codeyam-test-skill.md → skills/codeyam-test/SKILL.md} +1 -1
  938. package/codeyam-cli/templates/{codeyam-verify-skill.md → skills/codeyam-verify/SKILL.md} +1 -1
  939. package/package.json +33 -22
  940. package/packages/ai/index.js +8 -6
  941. package/packages/ai/index.js.map +1 -1
  942. package/packages/ai/src/lib/analyzeScope.js +179 -13
  943. package/packages/ai/src/lib/analyzeScope.js.map +1 -1
  944. package/packages/ai/src/lib/astScopes/arrayDerivationDetector.js +150 -0
  945. package/packages/ai/src/lib/astScopes/arrayDerivationDetector.js.map +1 -0
  946. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +160 -13
  947. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
  948. package/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.js +435 -0
  949. package/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.js.map +1 -0
  950. package/packages/ai/src/lib/astScopes/methodSemantics.js +138 -23
  951. package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
  952. package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js +10 -14
  953. package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js.map +1 -1
  954. package/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.js +8 -0
  955. package/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.js.map +1 -1
  956. package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js +7 -0
  957. package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js.map +1 -1
  958. package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js +138 -1
  959. package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js.map +1 -1
  960. package/packages/ai/src/lib/astScopes/processExpression.js +931 -29
  961. package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
  962. package/packages/ai/src/lib/astScopes/sharedPatterns.js +25 -0
  963. package/packages/ai/src/lib/astScopes/sharedPatterns.js.map +1 -1
  964. package/packages/ai/src/lib/completionCall.js +188 -38
  965. package/packages/ai/src/lib/completionCall.js.map +1 -1
  966. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +1600 -189
  967. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  968. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js +5 -1
  969. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js.map +1 -1
  970. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js +179 -0
  971. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js.map +1 -1
  972. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +7 -1
  973. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
  974. package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js +13 -3
  975. package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js.map +1 -1
  976. package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js +6 -4
  977. package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js.map +1 -1
  978. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +52 -3
  979. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
  980. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +111 -14
  981. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
  982. package/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.js +63 -0
  983. package/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.js.map +1 -0
  984. package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js +54 -0
  985. package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js.map +1 -0
  986. package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js +122 -12
  987. package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js.map +1 -1
  988. package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js +173 -0
  989. package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js.map +1 -0
  990. package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js +37 -20
  991. package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js.map +1 -1
  992. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +333 -81
  993. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
  994. package/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.js +107 -0
  995. package/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.js.map +1 -0
  996. package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js +34 -0
  997. package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js.map +1 -0
  998. package/packages/ai/src/lib/dataStructureChunking.js +130 -0
  999. package/packages/ai/src/lib/dataStructureChunking.js.map +1 -0
  1000. package/packages/ai/src/lib/e2eDataTracking.js +241 -0
  1001. package/packages/ai/src/lib/e2eDataTracking.js.map +1 -0
  1002. package/packages/ai/src/lib/extractCriticalDataKeys.js +96 -0
  1003. package/packages/ai/src/lib/extractCriticalDataKeys.js.map +1 -0
  1004. package/packages/ai/src/lib/generateChangesEntityScenarioData.js +4 -3
  1005. package/packages/ai/src/lib/generateChangesEntityScenarioData.js.map +1 -1
  1006. package/packages/ai/src/lib/generateChangesEntityScenarios.js +78 -120
  1007. package/packages/ai/src/lib/generateChangesEntityScenarios.js.map +1 -1
  1008. package/packages/ai/src/lib/generateEntityDataStructure.js +47 -2
  1009. package/packages/ai/src/lib/generateEntityDataStructure.js.map +1 -1
  1010. package/packages/ai/src/lib/generateEntityScenarioData.js +1153 -60
  1011. package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
  1012. package/packages/ai/src/lib/generateEntityScenarios.js +177 -163
  1013. package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
  1014. package/packages/ai/src/lib/generateExecutionFlows.js +484 -0
  1015. package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -0
  1016. package/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.js +380 -0
  1017. package/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.js.map +1 -0
  1018. package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +1807 -0
  1019. package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -0
  1020. package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js +194 -0
  1021. package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js.map +1 -0
  1022. package/packages/ai/src/lib/guessScenarioDataFromDescription.js +2 -2
  1023. package/packages/ai/src/lib/guessScenarioDataFromDescription.js.map +1 -1
  1024. package/packages/ai/src/lib/isolateScopes.js +270 -7
  1025. package/packages/ai/src/lib/isolateScopes.js.map +1 -1
  1026. package/packages/ai/src/lib/mergeJsonTypeDefinitions.js +5 -0
  1027. package/packages/ai/src/lib/mergeJsonTypeDefinitions.js.map +1 -1
  1028. package/packages/ai/src/lib/mergeStatements.js +88 -46
  1029. package/packages/ai/src/lib/mergeStatements.js.map +1 -1
  1030. package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js +97 -0
  1031. package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js.map +1 -0
  1032. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +10 -4
  1033. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
  1034. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js +1 -1
  1035. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js.map +1 -1
  1036. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js +21 -119
  1037. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js.map +1 -1
  1038. package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js +54 -0
  1039. package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js.map +1 -0
  1040. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +83 -6
  1041. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
  1042. package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js +10 -70
  1043. package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js.map +1 -1
  1044. package/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.js +45 -0
  1045. package/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.js.map +1 -0
  1046. package/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.js +9 -9
  1047. package/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.js.map +1 -1
  1048. package/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.js +335 -0
  1049. package/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.js.map +1 -0
  1050. package/packages/ai/src/lib/resolvePathToControllable.js +677 -0
  1051. package/packages/ai/src/lib/resolvePathToControllable.js.map +1 -0
  1052. package/packages/ai/src/lib/splitOutsideParentheses.js +3 -1
  1053. package/packages/ai/src/lib/splitOutsideParentheses.js.map +1 -1
  1054. package/packages/ai/src/lib/worker/SerializableDataStructure.js +29 -0
  1055. package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
  1056. package/packages/ai/src/lib/worker/analyzeScopeWorker.js +94 -1
  1057. package/packages/ai/src/lib/worker/analyzeScopeWorker.js.map +1 -1
  1058. package/packages/analyze/index.js +1 -0
  1059. package/packages/analyze/index.js.map +1 -1
  1060. package/packages/analyze/src/lib/FileAnalyzer.js +60 -36
  1061. package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
  1062. package/packages/analyze/src/lib/ProjectAnalyzer.js +109 -30
  1063. package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
  1064. package/packages/analyze/src/lib/analysisContext.js +30 -5
  1065. package/packages/analyze/src/lib/analysisContext.js.map +1 -1
  1066. package/packages/analyze/src/lib/asts/index.js +4 -2
  1067. package/packages/analyze/src/lib/asts/index.js.map +1 -1
  1068. package/packages/analyze/src/lib/asts/nodes/getNodeType.js +1 -0
  1069. package/packages/analyze/src/lib/asts/nodes/getNodeType.js.map +1 -1
  1070. package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js +14 -0
  1071. package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js.map +1 -1
  1072. package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js +14 -0
  1073. package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js.map +1 -1
  1074. package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js +6 -0
  1075. package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js.map +1 -1
  1076. package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js +6 -0
  1077. package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js.map +1 -1
  1078. package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js +39 -1
  1079. package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js.map +1 -1
  1080. package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js +2 -1
  1081. package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js.map +1 -1
  1082. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +189 -41
  1083. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
  1084. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +28 -4
  1085. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
  1086. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +9 -0
  1087. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
  1088. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js +2 -1
  1089. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
  1090. package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js +31 -10
  1091. package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js.map +1 -1
  1092. package/packages/analyze/src/lib/files/analyzeChange.js +10 -10
  1093. package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
  1094. package/packages/analyze/src/lib/files/analyzeEntity.js +4 -4
  1095. package/packages/analyze/src/lib/files/analyzeEntity.js.map +1 -1
  1096. package/packages/analyze/src/lib/files/analyzeInitial.js +9 -10
  1097. package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
  1098. package/packages/analyze/src/lib/files/analyzeRemixRoute.js +3 -2
  1099. package/packages/analyze/src/lib/files/analyzeRemixRoute.js.map +1 -1
  1100. package/packages/analyze/src/lib/files/enums/steps.js +1 -1
  1101. package/packages/analyze/src/lib/files/enums/steps.js.map +1 -1
  1102. package/packages/analyze/src/lib/files/getImportedExports.js +11 -7
  1103. package/packages/analyze/src/lib/files/getImportedExports.js.map +1 -1
  1104. package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js +907 -0
  1105. package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js.map +1 -0
  1106. package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +164 -68
  1107. package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -1
  1108. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +178 -31
  1109. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
  1110. package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js +29 -129
  1111. package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js.map +1 -1
  1112. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +252 -21
  1113. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  1114. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +104 -0
  1115. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -0
  1116. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +1 -0
  1117. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js.map +1 -1
  1118. package/packages/analyze/src/lib/files/scenarios/generateScenarios.js +2 -3
  1119. package/packages/analyze/src/lib/files/scenarios/generateScenarios.js.map +1 -1
  1120. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +686 -55
  1121. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
  1122. package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js +46 -9
  1123. package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js.map +1 -1
  1124. package/packages/analyze/src/lib/files/setImportedExports.js +2 -1
  1125. package/packages/analyze/src/lib/files/setImportedExports.js.map +1 -1
  1126. package/packages/analyze/src/lib/index.js +1 -0
  1127. package/packages/analyze/src/lib/index.js.map +1 -1
  1128. package/packages/analyze/src/lib/utils/getFileByPath.js +12 -0
  1129. package/packages/analyze/src/lib/utils/getFileByPath.js.map +1 -0
  1130. package/packages/database/index.js +1 -0
  1131. package/packages/database/index.js.map +1 -1
  1132. package/packages/database/src/lib/analysisBranchToDb.js +1 -1
  1133. package/packages/database/src/lib/analysisBranchToDb.js.map +1 -1
  1134. package/packages/database/src/lib/analysisToDb.js +1 -1
  1135. package/packages/database/src/lib/analysisToDb.js.map +1 -1
  1136. package/packages/database/src/lib/branchToDb.js +1 -1
  1137. package/packages/database/src/lib/branchToDb.js.map +1 -1
  1138. package/packages/database/src/lib/commitBranchToDb.js +1 -1
  1139. package/packages/database/src/lib/commitBranchToDb.js.map +1 -1
  1140. package/packages/database/src/lib/commitToDb.js +1 -1
  1141. package/packages/database/src/lib/commitToDb.js.map +1 -1
  1142. package/packages/database/src/lib/fileToDb.js +1 -1
  1143. package/packages/database/src/lib/fileToDb.js.map +1 -1
  1144. package/packages/database/src/lib/kysely/db.js +16 -1
  1145. package/packages/database/src/lib/kysely/db.js.map +1 -1
  1146. package/packages/database/src/lib/kysely/tables/commitsTable.js +3 -0
  1147. package/packages/database/src/lib/kysely/tables/commitsTable.js.map +1 -1
  1148. package/packages/database/src/lib/kysely/tables/debugReportsTable.js.map +1 -1
  1149. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +149 -0
  1150. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
  1151. package/packages/database/src/lib/kysely/tables/labsRequestsTable.js +35 -0
  1152. package/packages/database/src/lib/kysely/tables/labsRequestsTable.js.map +1 -0
  1153. package/packages/database/src/lib/loadAnalyses.js +45 -2
  1154. package/packages/database/src/lib/loadAnalyses.js.map +1 -1
  1155. package/packages/database/src/lib/loadAnalysis.js +8 -0
  1156. package/packages/database/src/lib/loadAnalysis.js.map +1 -1
  1157. package/packages/database/src/lib/loadBranch.js +11 -1
  1158. package/packages/database/src/lib/loadBranch.js.map +1 -1
  1159. package/packages/database/src/lib/loadCommit.js +7 -0
  1160. package/packages/database/src/lib/loadCommit.js.map +1 -1
  1161. package/packages/database/src/lib/loadCommits.js +45 -14
  1162. package/packages/database/src/lib/loadCommits.js.map +1 -1
  1163. package/packages/database/src/lib/loadEntities.js +23 -10
  1164. package/packages/database/src/lib/loadEntities.js.map +1 -1
  1165. package/packages/database/src/lib/loadEntityBranches.js +9 -0
  1166. package/packages/database/src/lib/loadEntityBranches.js.map +1 -1
  1167. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js +5 -5
  1168. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  1169. package/packages/database/src/lib/projectToDb.js +1 -1
  1170. package/packages/database/src/lib/projectToDb.js.map +1 -1
  1171. package/packages/database/src/lib/saveFiles.js +1 -1
  1172. package/packages/database/src/lib/saveFiles.js.map +1 -1
  1173. package/packages/database/src/lib/scenarioToDb.js +1 -1
  1174. package/packages/database/src/lib/scenarioToDb.js.map +1 -1
  1175. package/packages/database/src/lib/updateCommitMetadata.js +76 -89
  1176. package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
  1177. package/packages/database/src/lib/updateFreshAnalysisStatus.js +41 -30
  1178. package/packages/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
  1179. package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
  1180. package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
  1181. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
  1182. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
  1183. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
  1184. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  1185. package/packages/types/index.js +0 -1
  1186. package/packages/types/index.js.map +1 -1
  1187. package/packages/types/src/enums/ProjectFramework.js +2 -0
  1188. package/packages/types/src/enums/ProjectFramework.js.map +1 -1
  1189. package/packages/types/src/types/Scenario.js +1 -21
  1190. package/packages/types/src/types/Scenario.js.map +1 -1
  1191. package/packages/utils/src/lib/fs/rsyncCopy.js +98 -3
  1192. package/packages/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  1193. package/packages/utils/src/lib/safeFileName.js +29 -3
  1194. package/packages/utils/src/lib/safeFileName.js.map +1 -1
  1195. package/scripts/npm-post-install.cjs +34 -0
  1196. package/analyzer-template/packages/ai/src/lib/findMatchingAttribute.ts +0 -109
  1197. package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +0 -584
  1198. package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +0 -341
  1199. package/analyzer-template/packages/ai/src/lib/generateEntityKeyAttributes.ts +0 -495
  1200. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.ts +0 -67
  1201. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.ts +0 -120
  1202. package/codeyam-cli/src/commands/detect-universal-mocks.js +0 -118
  1203. package/codeyam-cli/src/commands/detect-universal-mocks.js.map +0 -1
  1204. package/codeyam-cli/src/commands/list.js +0 -31
  1205. package/codeyam-cli/src/commands/list.js.map +0 -1
  1206. package/codeyam-cli/src/commands/webapp-info.js +0 -146
  1207. package/codeyam-cli/src/commands/webapp-info.js.map +0 -1
  1208. package/codeyam-cli/src/utils/universal-mocks.js +0 -152
  1209. package/codeyam-cli/src/utils/universal-mocks.js.map +0 -1
  1210. package/codeyam-cli/src/webserver/build/client/assets/EntityItem-Cmysw5OP.js +0 -1
  1211. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-DLqD3qNt.js +0 -1
  1212. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-CAneekK2.js +0 -41
  1213. package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-Cu16OUmx.js +0 -25
  1214. package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-CVtiBnY5.js +0 -3
  1215. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-DcAUIpD_.js +0 -11
  1216. package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-DuDvi0jm.js +0 -1
  1217. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-BMKg0SAF.js +0 -15
  1218. package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-DyFZkK0l.js +0 -1
  1219. package/codeyam-cli/src/webserver/build/client/assets/_index-DSmTpjmK.js +0 -11
  1220. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-BF_aK4y6.js +0 -32
  1221. package/codeyam-cli/src/webserver/build/client/assets/chunk-EPOLDU6W-CXRTFQ3F.js +0 -51
  1222. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-BdhJEx6B.js +0 -21
  1223. package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-CKnwPCDr.js +0 -1
  1224. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-RJCf3Tvw.js +0 -1
  1225. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-EylcgScH.js +0 -1
  1226. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-DMe7kvgo.js +0 -1
  1227. package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-DMJ7zii9.js +0 -1
  1228. package/codeyam-cli/src/webserver/build/client/assets/files-BW7Cyeyi.js +0 -1
  1229. package/codeyam-cli/src/webserver/build/client/assets/git-CZu4fif0.js +0 -15
  1230. package/codeyam-cli/src/webserver/build/client/assets/globals-wHVy_II5.css +0 -1
  1231. package/codeyam-cli/src/webserver/build/client/assets/keyAttributeCoverage-CTlFMihX.js +0 -1
  1232. package/codeyam-cli/src/webserver/build/client/assets/manifest-2d191949.js +0 -1
  1233. package/codeyam-cli/src/webserver/build/client/assets/root-FHgpM6gc.js +0 -56
  1234. package/codeyam-cli/src/webserver/build/client/assets/settings-6D8k8Jp5.js +0 -1
  1235. package/codeyam-cli/src/webserver/build/client/assets/simulations-CDJZnWhN.js +0 -1
  1236. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-Dv18q8LD.js +0 -1
  1237. package/codeyam-cli/src/webserver/build/client/assets/useInteractiveMode-0ToGk4K3.js +0 -1
  1238. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-aSv48UbS.js +0 -2
  1239. package/codeyam-cli/src/webserver/build/client/assets/useReportContext-1BX144Eg.js +0 -1
  1240. package/codeyam-cli/src/webserver/build/client/assets/useToast-mBRpZPiu.js +0 -1
  1241. package/codeyam-cli/src/webserver/build/server/assets/index-pU0o5t1o.js +0 -1
  1242. package/codeyam-cli/src/webserver/build/server/assets/server-build-YzfkRwdn.js +0 -178
  1243. package/codeyam-cli/templates/codeyam-stop-hook.sh +0 -284
  1244. package/codeyam-cli/templates/debug-codeyam.md +0 -625
  1245. package/packages/ai/src/lib/findMatchingAttribute.js +0 -81
  1246. package/packages/ai/src/lib/findMatchingAttribute.js.map +0 -1
  1247. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +0 -425
  1248. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +0 -1
  1249. package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +0 -267
  1250. package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js.map +0 -1
  1251. package/packages/ai/src/lib/generateEntityKeyAttributes.js +0 -408
  1252. package/packages/ai/src/lib/generateEntityKeyAttributes.js.map +0 -1
  1253. package/packages/ai/src/lib/isFrontend.js +0 -5
  1254. package/packages/ai/src/lib/isFrontend.js.map +0 -1
  1255. package/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.js +0 -40
  1256. package/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.js.map +0 -1
  1257. package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js +0 -77
  1258. package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js.map +0 -1
  1259. package/scripts/finalize-analyzer.cjs +0 -81
  1260. /package/codeyam-cli/src/webserver/build/client/assets/{api.link-scenario-value-l0sNRNKZ.js → api.agent-transcripts-l0sNRNKZ.js} +0 -0
  1261. /package/codeyam-cli/src/webserver/build/client/assets/{api.update-key-attributes-l0sNRNKZ.js → api.dev-mode-events-l0sNRNKZ.js} +0 -0
  1262. /package/codeyam-cli/src/webserver/build/client/assets/{api.update-valid-values-l0sNRNKZ.js → api.editor-audit-l0sNRNKZ.js} +0 -0
@@ -0,0 +1,1857 @@
1
+ import { buildReverseDependencyGraph, classifyDirectChanges, computeEntityChangeStatus, buildChangedFilesMap, pageNameFromUrl, scenarioEntityName, buildEntityInfosFromScenarios, buildEntityInfosFromGlossary, filterGroupsByChangeStatus, filterGlossaryByChangeStatus, filterScenarioScreenshotsByChangeStatus, } from "../entityChangeStatus.js";
2
+ import { scanPageFilePaths, detectFirstFeature, readFeatureStartedAt, readEditorStep, readEditorSessionId, } from "../entityChangeStatus.server.js";
3
+ import * as fsModule from 'fs';
4
+ import * as pathModule from 'path';
5
+ import * as os from 'os';
6
+ // ── Helpers ──────────────────────────────────────────────────────────────
7
+ /** Shorthand to build an EntityInfo with importedBy metadata */
8
+ function entity(name, filePath, importedBy) {
9
+ if (!importedBy)
10
+ return { name, filePath };
11
+ // Convert simplified { filePath: [importerName, ...] } to DB format
12
+ const dbFormat = {};
13
+ for (const [fp, importers] of Object.entries(importedBy)) {
14
+ dbFormat[fp] = {};
15
+ for (const imp of importers) {
16
+ dbFormat[fp][imp] = { shas: ['test-sha'] };
17
+ }
18
+ }
19
+ return { name, filePath, importedBy: dbFormat };
20
+ }
21
+ /** Helper: get sorted impactedBy names from a result */
22
+ function impactNames(result, entityName) {
23
+ return (result[entityName]?.impactedBy || []).map((d) => d.name).sort();
24
+ }
25
+ // ── Tests ────────────────────────────────────────────────────────────────
26
+ describe('entityChangeStatus', () => {
27
+ // ── buildChangedFilesMap ───────────────────────────────────────────────
28
+ describe('buildChangedFilesMap', () => {
29
+ it('should map "added" files to "new"', () => {
30
+ const files = [
31
+ { path: 'components/New.tsx', status: 'added' },
32
+ ];
33
+ const result = buildChangedFilesMap(files, false);
34
+ expect(result.get('components/New.tsx')).toBe('new');
35
+ });
36
+ it('should map "untracked" files to "new"', () => {
37
+ const files = [
38
+ { path: 'components/Untracked.tsx', status: 'untracked' },
39
+ ];
40
+ const result = buildChangedFilesMap(files, false);
41
+ expect(result.get('components/Untracked.tsx')).toBe('new');
42
+ });
43
+ it('should map "modified" files to "edited"', () => {
44
+ const files = [
45
+ { path: 'components/Modified.tsx', status: 'modified' },
46
+ ];
47
+ const result = buildChangedFilesMap(files, false);
48
+ expect(result.get('components/Modified.tsx')).toBe('edited');
49
+ });
50
+ it('should ignore "deleted" files', () => {
51
+ const files = [
52
+ { path: 'components/Deleted.tsx', status: 'deleted' },
53
+ ];
54
+ const result = buildChangedFilesMap(files, false);
55
+ expect(result.size).toBe(0);
56
+ });
57
+ it('should ignore "renamed" files', () => {
58
+ const files = [
59
+ { path: 'components/Renamed.tsx', status: 'renamed' },
60
+ ];
61
+ const result = buildChangedFilesMap(files, false);
62
+ expect(result.size).toBe(0);
63
+ });
64
+ it('should treat ALL non-deleted files as "new" when isFirstFeature is true', () => {
65
+ const files = [
66
+ { path: 'components/Modified.tsx', status: 'modified' },
67
+ { path: 'components/Added.tsx', status: 'added' },
68
+ { path: 'components/Untracked.tsx', status: 'untracked' },
69
+ { path: 'components/Renamed.tsx', status: 'renamed' },
70
+ { path: 'components/Deleted.tsx', status: 'deleted' },
71
+ ];
72
+ const result = buildChangedFilesMap(files, true);
73
+ // Everything except deleted should be 'new'
74
+ expect(result.get('components/Modified.tsx')).toBe('new');
75
+ expect(result.get('components/Added.tsx')).toBe('new');
76
+ expect(result.get('components/Untracked.tsx')).toBe('new');
77
+ expect(result.get('components/Renamed.tsx')).toBe('new');
78
+ expect(result.has('components/Deleted.tsx')).toBe(false);
79
+ });
80
+ it('should return empty map for empty input', () => {
81
+ expect(buildChangedFilesMap([], false).size).toBe(0);
82
+ expect(buildChangedFilesMap([], true).size).toBe(0);
83
+ });
84
+ it('should handle mix of statuses correctly', () => {
85
+ const files = [
86
+ { path: 'a.tsx', status: 'added' },
87
+ { path: 'b.tsx', status: 'modified' },
88
+ { path: 'c.tsx', status: 'untracked' },
89
+ { path: 'd.tsx', status: 'deleted' },
90
+ ];
91
+ const result = buildChangedFilesMap(files, false);
92
+ expect(result.get('a.tsx')).toBe('new');
93
+ expect(result.get('b.tsx')).toBe('edited');
94
+ expect(result.get('c.tsx')).toBe('new');
95
+ expect(result.has('d.tsx')).toBe(false);
96
+ expect(result.size).toBe(3);
97
+ });
98
+ });
99
+ // ── pageNameFromUrl ───────────────────────────────────────────────────
100
+ describe('pageNameFromUrl', () => {
101
+ it('should return "Home" for null', () => {
102
+ expect(pageNameFromUrl(null)).toBe('Home');
103
+ });
104
+ it('should return "Home" for undefined', () => {
105
+ expect(pageNameFromUrl(undefined)).toBe('Home');
106
+ });
107
+ it('should return "Home" for root path "/"', () => {
108
+ expect(pageNameFromUrl('/')).toBe('Home');
109
+ });
110
+ it('should capitalize first segment for simple paths', () => {
111
+ expect(pageNameFromUrl('/about')).toBe('About');
112
+ expect(pageNameFromUrl('/drinks')).toBe('Drinks');
113
+ expect(pageNameFromUrl('/settings')).toBe('Settings');
114
+ });
115
+ it('should use only the first segment for nested paths', () => {
116
+ expect(pageNameFromUrl('/drinks/123')).toBe('Drinks');
117
+ expect(pageNameFromUrl('/blog/posts/latest')).toBe('Blog');
118
+ });
119
+ it('should strip query parameters', () => {
120
+ expect(pageNameFromUrl('/settings?tab=profile')).toBe('Settings');
121
+ expect(pageNameFromUrl('/drinks?sort=name&filter=ipa')).toBe('Drinks');
122
+ });
123
+ it('should handle paths without leading slash', () => {
124
+ expect(pageNameFromUrl('about')).toBe('About');
125
+ });
126
+ it('should handle empty string as Home', () => {
127
+ // Empty string: after stripping '/', split gives [''], charAt(0) is ''
128
+ // This is an edge case — empty string is falsy so returns Home
129
+ expect(pageNameFromUrl('')).toBe('Home');
130
+ });
131
+ it('should return Home for root path with query string', () => {
132
+ expect(pageNameFromUrl('/?demo=empty')).toBe('Home');
133
+ expect(pageNameFromUrl('/?state=seeded')).toBe('Home');
134
+ expect(pageNameFromUrl('/?tab=overview&sort=date')).toBe('Home');
135
+ });
136
+ it('should handle dynamic route segments', () => {
137
+ expect(pageNameFromUrl('/drinks/[id]')).toBe('Drinks');
138
+ expect(pageNameFromUrl('/users/[userId]/posts')).toBe('Users');
139
+ });
140
+ it('should strip file extensions from URL segments', () => {
141
+ expect(pageNameFromUrl('/library.html')).toBe('Library');
142
+ expect(pageNameFromUrl('/about.htm')).toBe('About');
143
+ expect(pageNameFromUrl('/library.html?article=a1')).toBe('Library');
144
+ });
145
+ });
146
+ // ── buildEntityInfosFromScenarios ─────────────────────────────────────
147
+ describe('buildEntityInfosFromScenarios', () => {
148
+ it('should extract component entity from scenario with componentName/componentPath', () => {
149
+ const scenarios = [
150
+ {
151
+ componentName: 'DrinkCard',
152
+ componentPath: 'components/DrinkCard.tsx',
153
+ },
154
+ ];
155
+ const result = buildEntityInfosFromScenarios(scenarios, {}, []);
156
+ expect(result).toEqual([
157
+ { name: 'DrinkCard', filePath: 'components/DrinkCard.tsx' },
158
+ ]);
159
+ });
160
+ it('should extract page entity from scenario with URL', () => {
161
+ const scenarios = [
162
+ { componentName: null, componentPath: null, url: '/' },
163
+ ];
164
+ const pageFilePaths = { Home: 'app/page.tsx' };
165
+ const result = buildEntityInfosFromScenarios(scenarios, pageFilePaths, []);
166
+ expect(result).toEqual([{ name: 'Home', filePath: 'app/page.tsx' }]);
167
+ });
168
+ it('should derive page name from URL using pageNameFromUrl', () => {
169
+ const scenarios = [
170
+ { componentName: null, componentPath: null, url: '/drinks/123' },
171
+ ];
172
+ const pageFilePaths = { Drinks: 'app/drinks/page.tsx' };
173
+ const result = buildEntityInfosFromScenarios(scenarios, pageFilePaths, []);
174
+ expect(result).toEqual([
175
+ { name: 'Drinks', filePath: 'app/drinks/page.tsx' },
176
+ ]);
177
+ });
178
+ it('should skip page scenarios when page file path is not found', () => {
179
+ const scenarios = [
180
+ { componentName: null, componentPath: null, url: '/nonexistent' },
181
+ ];
182
+ const result = buildEntityInfosFromScenarios(scenarios, {}, []);
183
+ expect(result).toEqual([]);
184
+ });
185
+ it('should deduplicate by entity name (first occurrence wins)', () => {
186
+ const scenarios = [
187
+ {
188
+ componentName: 'DrinkCard',
189
+ componentPath: 'components/DrinkCard.tsx',
190
+ },
191
+ {
192
+ componentName: 'DrinkCard',
193
+ componentPath: 'components/DrinkCard.tsx',
194
+ },
195
+ {
196
+ componentName: 'DrinkCard',
197
+ componentPath: 'components/DrinkCard2.tsx',
198
+ },
199
+ ];
200
+ const result = buildEntityInfosFromScenarios(scenarios, {}, []);
201
+ expect(result).toHaveLength(1);
202
+ expect(result[0].filePath).toBe('components/DrinkCard.tsx');
203
+ });
204
+ it('should enrich entities with importedBy metadata from entity DB', () => {
205
+ const scenarios = [
206
+ {
207
+ componentName: 'DrinkCard',
208
+ componentPath: 'components/DrinkCard.tsx',
209
+ },
210
+ ];
211
+ const entitiesWithMetadata = [
212
+ {
213
+ name: 'DrinkCard',
214
+ metadata: {
215
+ importedBy: {
216
+ 'components/DrinkCard.tsx': {
217
+ DrinkList: { shas: ['abc'] },
218
+ },
219
+ },
220
+ },
221
+ },
222
+ ];
223
+ const result = buildEntityInfosFromScenarios(scenarios, {}, entitiesWithMetadata);
224
+ expect(result[0].importedBy).toEqual({
225
+ 'components/DrinkCard.tsx': {
226
+ DrinkList: { shas: ['abc'] },
227
+ },
228
+ });
229
+ });
230
+ it('should handle entities without matching metadata (no importedBy)', () => {
231
+ const scenarios = [
232
+ {
233
+ componentName: 'DrinkCard',
234
+ componentPath: 'components/DrinkCard.tsx',
235
+ },
236
+ ];
237
+ const entitiesWithMetadata = [
238
+ { name: 'UnrelatedEntity', metadata: null },
239
+ ];
240
+ const result = buildEntityInfosFromScenarios(scenarios, {}, entitiesWithMetadata);
241
+ expect(result[0].importedBy).toBeUndefined();
242
+ });
243
+ it('should handle mixed component and page scenarios', () => {
244
+ const scenarios = [
245
+ {
246
+ componentName: 'DrinkCard',
247
+ componentPath: 'components/DrinkCard.tsx',
248
+ },
249
+ { componentName: null, componentPath: null, url: '/' },
250
+ { componentName: 'Header', componentPath: 'components/Header.tsx' },
251
+ { componentName: null, componentPath: null, url: '/drinks' },
252
+ ];
253
+ const pageFilePaths = {
254
+ Home: 'app/page.tsx',
255
+ Drinks: 'app/drinks/page.tsx',
256
+ };
257
+ const result = buildEntityInfosFromScenarios(scenarios, pageFilePaths, []);
258
+ expect(result.map((e) => e.name)).toEqual([
259
+ 'DrinkCard',
260
+ 'Home',
261
+ 'Header',
262
+ 'Drinks',
263
+ ]);
264
+ });
265
+ it('should skip scenarios with componentName but no componentPath', () => {
266
+ const scenarios = [
267
+ { componentName: 'DrinkCard', componentPath: null },
268
+ ];
269
+ const result = buildEntityInfosFromScenarios(scenarios, {}, []);
270
+ expect(result).toEqual([]);
271
+ });
272
+ it('should handle empty inputs', () => {
273
+ expect(buildEntityInfosFromScenarios([], {}, [])).toEqual([]);
274
+ });
275
+ it('should handle scenarios where url is undefined (not a page scenario)', () => {
276
+ // A scenario with no componentName and no url — should be skipped
277
+ const scenarios = [
278
+ { componentName: null, componentPath: null },
279
+ ];
280
+ const result = buildEntityInfosFromScenarios(scenarios, {}, []);
281
+ expect(result).toEqual([]);
282
+ });
283
+ it('should handle entity metadata with null metadata field', () => {
284
+ const scenarios = [
285
+ { componentName: 'Card', componentPath: 'components/Card.tsx' },
286
+ ];
287
+ const metadata = [
288
+ { name: 'Card', metadata: null },
289
+ ];
290
+ const result = buildEntityInfosFromScenarios(scenarios, {}, metadata);
291
+ expect(result[0].importedBy).toBeUndefined();
292
+ });
293
+ });
294
+ // ── buildReverseDependencyGraph ──────────────────────────────────────
295
+ describe('buildReverseDependencyGraph', () => {
296
+ it('should return empty map for empty entities', () => {
297
+ expect(buildReverseDependencyGraph([]).size).toBe(0);
298
+ });
299
+ it('should build reverse graph from a single importer', () => {
300
+ const result = buildReverseDependencyGraph([
301
+ entity('DrinkCard', 'components/DrinkCard.tsx', {
302
+ 'components/DrinkCard.tsx': ['DrinkList'],
303
+ }),
304
+ ]);
305
+ expect(result.get('DrinkCard')).toEqual(new Set(['DrinkList']));
306
+ });
307
+ it('should collect multiple importers across file paths', () => {
308
+ const result = buildReverseDependencyGraph([
309
+ entity('Button', 'components/Button.tsx', {
310
+ 'components/Button.tsx': ['LoginForm'],
311
+ 'lib/ui/Button.tsx': ['SignupForm'],
312
+ }),
313
+ ]);
314
+ expect(result.get('Button')).toEqual(new Set(['LoginForm', 'SignupForm']));
315
+ });
316
+ it('should deduplicate importers appearing under multiple file paths', () => {
317
+ const result = buildReverseDependencyGraph([
318
+ entity('Icon', 'components/Icon.tsx', {
319
+ 'components/Icon.tsx': ['Header'],
320
+ 'lib/Icon.tsx': ['Header'],
321
+ }),
322
+ ]);
323
+ expect(result.get('Icon')).toEqual(new Set(['Header']));
324
+ });
325
+ it('should skip entities with no importedBy metadata', () => {
326
+ const result = buildReverseDependencyGraph([
327
+ entity('Orphan', 'components/Orphan.tsx'),
328
+ entity('Used', 'components/Used.tsx', {
329
+ 'components/Used.tsx': ['Parent'],
330
+ }),
331
+ ]);
332
+ expect(result.has('Orphan')).toBe(false);
333
+ expect(result.get('Used')).toEqual(new Set(['Parent']));
334
+ });
335
+ it('should handle empty importedBy object gracefully', () => {
336
+ const entities = [
337
+ { name: 'Empty', filePath: 'components/Empty.tsx', importedBy: {} },
338
+ ];
339
+ const result = buildReverseDependencyGraph(entities);
340
+ expect(result.has('Empty')).toBe(false);
341
+ });
342
+ it('should handle multiple importers under a single file path', () => {
343
+ const result = buildReverseDependencyGraph([
344
+ entity('utils', 'lib/utils.ts', {
345
+ 'lib/utils.ts': ['DrinkCard', 'DrinkList', 'Header'],
346
+ }),
347
+ ]);
348
+ expect(result.get('utils')).toEqual(new Set(['DrinkCard', 'DrinkList', 'Header']));
349
+ });
350
+ });
351
+ // ── classifyDirectChanges ────────────────────────────────────────────
352
+ describe('classifyDirectChanges', () => {
353
+ it('should classify entities whose file paths match changed files', () => {
354
+ const changedFiles = new Map([
355
+ ['components/DrinkCard.tsx', 'edited'],
356
+ ['app/page.tsx', 'new'],
357
+ ]);
358
+ const entities = [
359
+ entity('DrinkCard', 'components/DrinkCard.tsx'),
360
+ entity('Home', 'app/page.tsx'),
361
+ entity('Header', 'components/Header.tsx'),
362
+ ];
363
+ const result = classifyDirectChanges(changedFiles, entities);
364
+ expect(result.get('DrinkCard')).toBe('edited');
365
+ expect(result.get('Home')).toBe('new');
366
+ expect(result.has('Header')).toBe(false);
367
+ });
368
+ it('should return empty map when no files match', () => {
369
+ const changedFiles = new Map([
370
+ ['unrelated/file.ts', 'edited'],
371
+ ]);
372
+ const result = classifyDirectChanges(changedFiles, [
373
+ entity('DrinkCard', 'components/DrinkCard.tsx'),
374
+ ]);
375
+ expect(result.size).toBe(0);
376
+ });
377
+ it('should return empty map for empty inputs', () => {
378
+ expect(classifyDirectChanges(new Map(), [])).toEqual(new Map());
379
+ });
380
+ it('should match file paths exactly (no normalization)', () => {
381
+ const changedFiles = new Map([
382
+ ['components/DrinkCard.tsx', 'edited'],
383
+ ]);
384
+ // Slightly different path should NOT match
385
+ const result = classifyDirectChanges(changedFiles, [
386
+ entity('DrinkCard', './components/DrinkCard.tsx'),
387
+ ]);
388
+ expect(result.size).toBe(0);
389
+ });
390
+ });
391
+ // ── computeEntityChangeStatus ────────────────────────────────────────
392
+ describe('computeEntityChangeStatus', () => {
393
+ // ── Basic classification ───────────────────────────────────────────
394
+ it('should mark entity as "new" when its file is added', () => {
395
+ const result = computeEntityChangeStatus(new Map([['components/DrinkCard.tsx', 'new']]), [entity('DrinkCard', 'components/DrinkCard.tsx')]);
396
+ expect(result['DrinkCard']).toEqual({ status: 'new' });
397
+ });
398
+ it('should mark entity as "edited" when its file is modified', () => {
399
+ const result = computeEntityChangeStatus(new Map([['components/DrinkCard.tsx', 'edited']]), [entity('DrinkCard', 'components/DrinkCard.tsx')]);
400
+ expect(result['DrinkCard']).toEqual({ status: 'edited' });
401
+ });
402
+ it('should omit unchanged entities with no impacted deps', () => {
403
+ const result = computeEntityChangeStatus(new Map([['components/DrinkCard.tsx', 'edited']]), [
404
+ entity('DrinkCard', 'components/DrinkCard.tsx'),
405
+ entity('Header', 'components/Header.tsx'),
406
+ ]);
407
+ expect(result['DrinkCard']).toBeDefined();
408
+ expect(result['Header']).toBeUndefined();
409
+ });
410
+ it('should return empty map for empty inputs', () => {
411
+ expect(computeEntityChangeStatus(new Map(), [])).toEqual({});
412
+ });
413
+ it('should return empty map when changedFiles has entries but no entity matches', () => {
414
+ const result = computeEntityChangeStatus(new Map([['unrelated/file.ts', 'edited']]), [entity('DrinkCard', 'components/DrinkCard.tsx')]);
415
+ expect(result).toEqual({});
416
+ });
417
+ // ── Single-level impact ────────────────────────────────────────────
418
+ it('should mark single-level impact: A imports B, B edited → A impacted by B', () => {
419
+ const result = computeEntityChangeStatus(new Map([['components/DrinkCard.tsx', 'edited']]), [
420
+ entity('DrinkCard', 'components/DrinkCard.tsx', {
421
+ 'components/DrinkCard.tsx': ['DrinkList'],
422
+ }),
423
+ entity('DrinkList', 'components/DrinkList.tsx'),
424
+ ]);
425
+ expect(result['DrinkCard']).toEqual({ status: 'edited' });
426
+ expect(result['DrinkList']).toEqual({
427
+ status: 'impacted',
428
+ impactedBy: [
429
+ {
430
+ name: 'DrinkCard',
431
+ filePath: 'components/DrinkCard.tsx',
432
+ changeType: 'edited',
433
+ },
434
+ ],
435
+ });
436
+ });
437
+ it('should preserve changeType correctly: "new" root cause shows as "new" in impactedBy', () => {
438
+ const result = computeEntityChangeStatus(new Map([['components/DrinkCard.tsx', 'new']]), [
439
+ entity('DrinkCard', 'components/DrinkCard.tsx', {
440
+ 'components/DrinkCard.tsx': ['DrinkList'],
441
+ }),
442
+ entity('DrinkList', 'components/DrinkList.tsx'),
443
+ ]);
444
+ expect(result['DrinkList']?.impactedBy?.[0]?.changeType).toBe('new');
445
+ });
446
+ // ── Multi-level transitive ─────────────────────────────────────────
447
+ it('should trace multi-level transitive: Icon→DrinkCard→DrinkList, Icon edited → all impacted by Icon', () => {
448
+ const result = computeEntityChangeStatus(new Map([['components/Icon.tsx', 'edited']]), [
449
+ entity('Icon', 'components/Icon.tsx', {
450
+ 'components/Icon.tsx': ['DrinkCard'],
451
+ }),
452
+ entity('DrinkCard', 'components/DrinkCard.tsx', {
453
+ 'components/DrinkCard.tsx': ['DrinkList'],
454
+ }),
455
+ entity('DrinkList', 'components/DrinkList.tsx'),
456
+ ]);
457
+ expect(result['Icon']).toEqual({ status: 'edited' });
458
+ // Both should trace back to Icon as root cause (not intermediate DrinkCard)
459
+ expect(result['DrinkCard']?.impactedBy).toEqual([
460
+ { name: 'Icon', filePath: 'components/Icon.tsx', changeType: 'edited' },
461
+ ]);
462
+ expect(result['DrinkList']?.impactedBy).toEqual([
463
+ { name: 'Icon', filePath: 'components/Icon.tsx', changeType: 'edited' },
464
+ ]);
465
+ });
466
+ // ── Multiple root causes ───────────────────────────────────────────
467
+ it('should track multiple root causes: DrinkCard imports Icon and utils (both changed)', () => {
468
+ const result = computeEntityChangeStatus(new Map([
469
+ ['components/Icon.tsx', 'edited'],
470
+ ['lib/utils.ts', 'new'],
471
+ ]), [
472
+ entity('Icon', 'components/Icon.tsx', {
473
+ 'components/Icon.tsx': ['DrinkCard'],
474
+ }),
475
+ entity('utils', 'lib/utils.ts', {
476
+ 'lib/utils.ts': ['DrinkCard'],
477
+ }),
478
+ entity('DrinkCard', 'components/DrinkCard.tsx'),
479
+ ]);
480
+ expect(result['DrinkCard']?.status).toBe('impacted');
481
+ expect(impactNames(result, 'DrinkCard')).toEqual(['Icon', 'utils']);
482
+ // Verify changeTypes are preserved
483
+ const iconDep = result['DrinkCard']?.impactedBy?.find((d) => d.name === 'Icon');
484
+ const utilsDep = result['DrinkCard']?.impactedBy?.find((d) => d.name === 'utils');
485
+ expect(iconDep?.changeType).toBe('edited');
486
+ expect(utilsDep?.changeType).toBe('new');
487
+ });
488
+ // ── Diamond dependency (BFS root cause propagation) ────────────────
489
+ it('should propagate ALL root causes through diamond: D1→A→C→E, D2→B→C→E', () => {
490
+ // This tests that when two paths converge at C and C has downstream
491
+ // importers (E), ALL root causes propagate through — not just the
492
+ // ones from whichever path was processed first.
493
+ //
494
+ // D1(edited) ──importedBy──→ A ──importedBy──→ C ──importedBy──→ E
495
+ // D2(new) ──importedBy──→ B ──importedBy──→ C
496
+ //
497
+ const result = computeEntityChangeStatus(new Map([
498
+ ['components/D1.tsx', 'edited'],
499
+ ['components/D2.tsx', 'new'],
500
+ ]), [
501
+ entity('D1', 'components/D1.tsx', {
502
+ 'components/D1.tsx': ['A'],
503
+ }),
504
+ entity('D2', 'components/D2.tsx', {
505
+ 'components/D2.tsx': ['B'],
506
+ }),
507
+ entity('A', 'components/A.tsx', {
508
+ 'components/A.tsx': ['C'],
509
+ }),
510
+ entity('B', 'components/B.tsx', {
511
+ 'components/B.tsx': ['C'],
512
+ }),
513
+ entity('C', 'components/C.tsx', {
514
+ 'components/C.tsx': ['E'],
515
+ }),
516
+ entity('E', 'components/E.tsx'),
517
+ ]);
518
+ // C should have both root causes
519
+ expect(result['C']?.status).toBe('impacted');
520
+ expect(impactNames(result, 'C')).toEqual(['D1', 'D2']);
521
+ // E (downstream of C) must also have both root causes
522
+ expect(result['E']?.status).toBe('impacted');
523
+ expect(impactNames(result, 'E')).toEqual(['D1', 'D2']);
524
+ });
525
+ it('should propagate root causes through diamond with unequal path lengths', () => {
526
+ // D1 reaches C directly (depth 1), D2 reaches C via B (depth 2).
527
+ // C has downstream E. E must get both root causes.
528
+ //
529
+ // D1(edited) ──importedBy──→ C ──importedBy──→ E
530
+ // D2(new) ──importedBy──→ B ──importedBy──→ C
531
+ //
532
+ const result = computeEntityChangeStatus(new Map([
533
+ ['components/D1.tsx', 'edited'],
534
+ ['components/D2.tsx', 'new'],
535
+ ]), [
536
+ entity('D1', 'components/D1.tsx', {
537
+ 'components/D1.tsx': ['C'],
538
+ }),
539
+ entity('D2', 'components/D2.tsx', {
540
+ 'components/D2.tsx': ['B'],
541
+ }),
542
+ entity('B', 'components/B.tsx', {
543
+ 'components/B.tsx': ['C'],
544
+ }),
545
+ entity('C', 'components/C.tsx', {
546
+ 'components/C.tsx': ['E'],
547
+ }),
548
+ entity('E', 'components/E.tsx'),
549
+ ]);
550
+ expect(impactNames(result, 'C')).toEqual(['D1', 'D2']);
551
+ expect(impactNames(result, 'E')).toEqual(['D1', 'D2']);
552
+ });
553
+ // ── Cycles ─────────────────────────────────────────────────────────
554
+ it('should handle simple cycle without infinite loop: A↔B, A edited', () => {
555
+ const result = computeEntityChangeStatus(new Map([['components/A.tsx', 'edited']]), [
556
+ entity('A', 'components/A.tsx', {
557
+ 'components/A.tsx': ['B'],
558
+ }),
559
+ entity('B', 'components/B.tsx', {
560
+ 'components/B.tsx': ['A'],
561
+ }),
562
+ ]);
563
+ expect(result['A']).toEqual({ status: 'edited' });
564
+ expect(result['B']).toEqual({
565
+ status: 'impacted',
566
+ impactedBy: [
567
+ { name: 'A', filePath: 'components/A.tsx', changeType: 'edited' },
568
+ ],
569
+ });
570
+ });
571
+ it('should handle three-node cycle: A→B→C→A, A edited', () => {
572
+ const result = computeEntityChangeStatus(new Map([['components/A.tsx', 'edited']]), [
573
+ entity('A', 'components/A.tsx', {
574
+ 'components/A.tsx': ['B'],
575
+ }),
576
+ entity('B', 'components/B.tsx', {
577
+ 'components/B.tsx': ['C'],
578
+ }),
579
+ entity('C', 'components/C.tsx', {
580
+ 'components/C.tsx': ['A'],
581
+ }),
582
+ ]);
583
+ expect(result['A']).toEqual({ status: 'edited' });
584
+ expect(result['B']?.status).toBe('impacted');
585
+ expect(result['C']?.status).toBe('impacted');
586
+ expect(impactNames(result, 'B')).toEqual(['A']);
587
+ expect(impactNames(result, 'C')).toEqual(['A']);
588
+ });
589
+ it('should handle cycle with multiple seeds: A→B→C→A, A and C both edited', () => {
590
+ const result = computeEntityChangeStatus(new Map([
591
+ ['components/A.tsx', 'edited'],
592
+ ['components/C.tsx', 'new'],
593
+ ]), [
594
+ entity('A', 'components/A.tsx', {
595
+ 'components/A.tsx': ['B'],
596
+ }),
597
+ entity('B', 'components/B.tsx', {
598
+ 'components/B.tsx': ['C'],
599
+ }),
600
+ entity('C', 'components/C.tsx', {
601
+ 'components/C.tsx': ['A'],
602
+ }),
603
+ ]);
604
+ // A and C directly changed
605
+ expect(result['A']).toEqual({ status: 'edited' });
606
+ expect(result['C']).toEqual({ status: 'new' });
607
+ // B is impacted by both (A importedBy B via A→B, C importedBy B via C→...→B)
608
+ expect(result['B']?.status).toBe('impacted');
609
+ expect(impactNames(result, 'B')).toEqual(['A', 'C']);
610
+ });
611
+ it('should handle self-import cycle gracefully', () => {
612
+ // Entity lists itself as its own importer
613
+ const result = computeEntityChangeStatus(new Map([['components/A.tsx', 'edited']]), [
614
+ entity('A', 'components/A.tsx', {
615
+ 'components/A.tsx': ['A'],
616
+ }),
617
+ ]);
618
+ // A is directly changed — self-loop should not create an impacted entry
619
+ expect(result['A']).toEqual({ status: 'edited' });
620
+ });
621
+ // ── Direct change priority ─────────────────────────────────────────
622
+ it('should NOT mark directly-changed entities as impacted even if they import other changed entities', () => {
623
+ const result = computeEntityChangeStatus(new Map([
624
+ ['components/A.tsx', 'edited'],
625
+ ['components/B.tsx', 'new'],
626
+ ]), [
627
+ entity('A', 'components/A.tsx', {
628
+ 'components/A.tsx': ['B'],
629
+ }),
630
+ entity('B', 'components/B.tsx'),
631
+ ]);
632
+ expect(result['A']).toEqual({ status: 'edited' });
633
+ expect(result['B']).toEqual({ status: 'new' });
634
+ });
635
+ it('should not produce impacted entries when ALL entities are directly changed', () => {
636
+ const result = computeEntityChangeStatus(new Map([
637
+ ['components/A.tsx', 'edited'],
638
+ ['components/B.tsx', 'new'],
639
+ ['components/C.tsx', 'edited'],
640
+ ]), [
641
+ entity('A', 'components/A.tsx', {
642
+ 'components/A.tsx': ['B'],
643
+ }),
644
+ entity('B', 'components/B.tsx', {
645
+ 'components/B.tsx': ['C'],
646
+ }),
647
+ entity('C', 'components/C.tsx'),
648
+ ]);
649
+ expect(Object.values(result).every((s) => s.status !== 'impacted')).toBe(true);
650
+ expect(result['A']?.status).toBe('edited');
651
+ expect(result['B']?.status).toBe('new');
652
+ expect(result['C']?.status).toBe('edited');
653
+ });
654
+ // ── Missing metadata / graceful degradation ────────────────────────
655
+ it('should handle missing importedBy metadata gracefully (no impact propagation)', () => {
656
+ const result = computeEntityChangeStatus(new Map([['components/DrinkCard.tsx', 'edited']]), [
657
+ entity('DrinkCard', 'components/DrinkCard.tsx'),
658
+ entity('DrinkList', 'components/DrinkList.tsx'),
659
+ ]);
660
+ expect(result['DrinkCard']).toEqual({ status: 'edited' });
661
+ expect(result['DrinkList']).toBeUndefined();
662
+ });
663
+ it('should skip phantom importers (importedBy references entity not in entities list)', () => {
664
+ // DrinkCard's importedBy references "PhantomPage" which is not in entities
665
+ const result = computeEntityChangeStatus(new Map([['components/DrinkCard.tsx', 'edited']]), [
666
+ entity('DrinkCard', 'components/DrinkCard.tsx', {
667
+ 'components/DrinkCard.tsx': ['PhantomPage', 'DrinkList'],
668
+ }),
669
+ entity('DrinkList', 'components/DrinkList.tsx'),
670
+ ]);
671
+ // PhantomPage should not appear in results (not in entities list)
672
+ expect(result['PhantomPage']).toBeUndefined();
673
+ // DrinkList should still be impacted
674
+ expect(result['DrinkList']?.status).toBe('impacted');
675
+ });
676
+ // ── maxDepth ───────────────────────────────────────────────────────
677
+ it('should enforce maxDepth and stop propagation beyond limit', () => {
678
+ // Chain: D → C → B → A
679
+ const result = computeEntityChangeStatus(new Map([['components/D.tsx', 'edited']]), [
680
+ entity('D', 'components/D.tsx', { 'components/D.tsx': ['C'] }),
681
+ entity('C', 'components/C.tsx', { 'components/C.tsx': ['B'] }),
682
+ entity('B', 'components/B.tsx', { 'components/B.tsx': ['A'] }),
683
+ entity('A', 'components/A.tsx'),
684
+ ], 2);
685
+ expect(result['D']).toEqual({ status: 'edited' });
686
+ expect(result['C']?.status).toBe('impacted');
687
+ expect(result['B']?.status).toBe('impacted');
688
+ // A at depth 3 is cut off
689
+ expect(result['A']).toBeUndefined();
690
+ });
691
+ it('should use default maxDepth of 20 when not specified', () => {
692
+ // Build a chain of depth 15 — should all be reached with default maxDepth
693
+ const entities = [];
694
+ for (let i = 0; i < 16; i++) {
695
+ const name = `E${i}`;
696
+ const filePath = `components/${name}.tsx`;
697
+ if (i < 15) {
698
+ entities.push(entity(name, filePath, { [filePath]: [`E${i + 1}`] }));
699
+ }
700
+ else {
701
+ entities.push(entity(name, filePath));
702
+ }
703
+ }
704
+ const result = computeEntityChangeStatus(new Map([['components/E0.tsx', 'edited']]), entities);
705
+ // E15 at depth 15 should still be reached (within default maxDepth of 20)
706
+ expect(result['E15']?.status).toBe('impacted');
707
+ });
708
+ // ── Fan-out ────────────────────────────────────────────────────────
709
+ it('should handle large fan-out: one changed entity imported by many', () => {
710
+ const importers = Array.from({ length: 10 }, (_, i) => `Comp${i}`);
711
+ const entities = [
712
+ entity('SharedUtil', 'lib/shared.ts', {
713
+ 'lib/shared.ts': importers,
714
+ }),
715
+ ...importers.map((name) => entity(name, `components/${name}.tsx`)),
716
+ ];
717
+ const result = computeEntityChangeStatus(new Map([['lib/shared.ts', 'edited']]), entities);
718
+ expect(result['SharedUtil']).toEqual({ status: 'edited' });
719
+ for (const name of importers) {
720
+ expect(result[name]?.status).toBe('impacted');
721
+ expect(result[name]?.impactedBy).toEqual([
722
+ {
723
+ name: 'SharedUtil',
724
+ filePath: 'lib/shared.ts',
725
+ changeType: 'edited',
726
+ },
727
+ ]);
728
+ }
729
+ });
730
+ // ── Deterministic output ───────────────────────────────────────────
731
+ it('should sort impactedBy array by name for deterministic output', () => {
732
+ const result = computeEntityChangeStatus(new Map([
733
+ ['components/Zebra.tsx', 'edited'],
734
+ ['components/Apple.tsx', 'new'],
735
+ ['components/Mango.tsx', 'edited'],
736
+ ]), [
737
+ entity('Zebra', 'components/Zebra.tsx', {
738
+ 'components/Zebra.tsx': ['Target'],
739
+ }),
740
+ entity('Apple', 'components/Apple.tsx', {
741
+ 'components/Apple.tsx': ['Target'],
742
+ }),
743
+ entity('Mango', 'components/Mango.tsx', {
744
+ 'components/Mango.tsx': ['Target'],
745
+ }),
746
+ entity('Target', 'components/Target.tsx'),
747
+ ]);
748
+ expect(impactNames(result, 'Target')).toEqual([
749
+ 'Apple',
750
+ 'Mango',
751
+ 'Zebra',
752
+ ]);
753
+ });
754
+ // ── Realistic integration-style scenarios ──────────────────────────
755
+ it('should compute correct status for a realistic Next.js app scenario', () => {
756
+ // Simulates a real editor session:
757
+ // - User edited DrinkCard component and added a new formatPrice utility
758
+ // - DrinkCard is imported by DrinkList component and Home page
759
+ // - formatPrice is imported by DrinkCard
760
+ // - Header is unchanged and imports nothing changed
761
+ //
762
+ // Expected:
763
+ // - DrinkCard: edited (directly changed)
764
+ // - formatPrice: new (directly changed)
765
+ // - DrinkList: impacted by [DrinkCard, formatPrice] (DrinkCard is edited,
766
+ // and formatPrice flows through DrinkCard)
767
+ // - Home: impacted by [DrinkCard, formatPrice] (same reasoning)
768
+ // - Header: not in results (unchanged, no changed deps)
769
+ const result = computeEntityChangeStatus(new Map([
770
+ ['components/DrinkCard.tsx', 'edited'],
771
+ ['lib/formatPrice.ts', 'new'],
772
+ ]), [
773
+ entity('formatPrice', 'lib/formatPrice.ts', {
774
+ 'lib/formatPrice.ts': ['DrinkCard'],
775
+ }),
776
+ entity('DrinkCard', 'components/DrinkCard.tsx', {
777
+ 'components/DrinkCard.tsx': ['DrinkList', 'Home'],
778
+ }),
779
+ entity('DrinkList', 'components/DrinkList.tsx'),
780
+ entity('Home', 'app/page.tsx'),
781
+ entity('Header', 'components/Header.tsx'),
782
+ ]);
783
+ expect(result['formatPrice']).toEqual({ status: 'new' });
784
+ expect(result['DrinkCard']).toEqual({ status: 'edited' });
785
+ expect(result['Header']).toBeUndefined();
786
+ // DrinkList and Home are impacted by DrinkCard (directly, its an importer)
787
+ // AND by formatPrice (transitively via DrinkCard)
788
+ expect(result['DrinkList']?.status).toBe('impacted');
789
+ expect(impactNames(result, 'DrinkList')).toEqual([
790
+ 'DrinkCard',
791
+ 'formatPrice',
792
+ ]);
793
+ expect(result['Home']?.status).toBe('impacted');
794
+ expect(impactNames(result, 'Home')).toEqual(['DrinkCard', 'formatPrice']);
795
+ });
796
+ it('should handle a realistic scenario where component is both directly changed AND an intermediate', () => {
797
+ // DrinkCard is edited AND it imports formatPrice (also changed).
798
+ // DrinkCard should be marked 'edited' (direct), not 'impacted'.
799
+ // DrinkList imports DrinkCard → impacted by both DrinkCard and formatPrice.
800
+ const result = computeEntityChangeStatus(new Map([
801
+ ['components/DrinkCard.tsx', 'edited'],
802
+ ['lib/formatPrice.ts', 'new'],
803
+ ]), [
804
+ entity('formatPrice', 'lib/formatPrice.ts', {
805
+ 'lib/formatPrice.ts': ['DrinkCard'],
806
+ }),
807
+ entity('DrinkCard', 'components/DrinkCard.tsx', {
808
+ 'components/DrinkCard.tsx': ['DrinkList'],
809
+ }),
810
+ entity('DrinkList', 'components/DrinkList.tsx'),
811
+ ]);
812
+ // DrinkCard is directly changed — status should be 'edited', no impactedBy
813
+ expect(result['DrinkCard']).toEqual({ status: 'edited' });
814
+ // DrinkList is impacted by BOTH root causes
815
+ expect(result['DrinkList']?.status).toBe('impacted');
816
+ expect(impactNames(result, 'DrinkList')).toEqual([
817
+ 'DrinkCard',
818
+ 'formatPrice',
819
+ ]);
820
+ });
821
+ // ── End-to-end pipeline test ───────────────────────────────────────
822
+ it('should produce correct results through the full pipeline: git files → scenarios → entity infos → status', () => {
823
+ // This tests the complete data flow that both route handlers execute:
824
+ // 1. buildChangedFilesMap from git status
825
+ // 2. buildEntityInfosFromScenarios from scenario data + metadata
826
+ // 3. computeEntityChangeStatus from the above
827
+ // Step 1: Git status
828
+ const gitFiles = [
829
+ { path: 'components/DrinkCard.tsx', status: 'modified' },
830
+ { path: 'lib/formatPrice.ts', status: 'added' },
831
+ { path: 'components/Header.tsx', status: 'deleted' },
832
+ ];
833
+ const changedFiles = buildChangedFilesMap(gitFiles, false);
834
+ expect(changedFiles.get('components/DrinkCard.tsx')).toBe('edited');
835
+ expect(changedFiles.get('lib/formatPrice.ts')).toBe('new');
836
+ expect(changedFiles.has('components/Header.tsx')).toBe(false);
837
+ // Step 2: Build entity infos from scenarios
838
+ const scenarios = [
839
+ {
840
+ componentName: 'DrinkCard',
841
+ componentPath: 'components/DrinkCard.tsx',
842
+ },
843
+ { componentName: null, componentPath: null, url: '/' },
844
+ {
845
+ componentName: 'DrinkList',
846
+ componentPath: 'components/DrinkList.tsx',
847
+ },
848
+ ];
849
+ const pageFilePaths = { Home: 'app/page.tsx' };
850
+ const metadata = [
851
+ {
852
+ name: 'DrinkCard',
853
+ metadata: {
854
+ importedBy: {
855
+ 'components/DrinkCard.tsx': {
856
+ DrinkList: { shas: ['sha1'] },
857
+ Home: { shas: ['sha2'] },
858
+ },
859
+ },
860
+ },
861
+ },
862
+ { name: 'DrinkList', metadata: null },
863
+ ];
864
+ const entityInfos = buildEntityInfosFromScenarios(scenarios, pageFilePaths, metadata);
865
+ expect(entityInfos).toHaveLength(3);
866
+ expect(entityInfos.find((e) => e.name === 'DrinkCard')?.importedBy).toBeDefined();
867
+ // Step 3: Compute status
868
+ const result = computeEntityChangeStatus(changedFiles, entityInfos);
869
+ expect(result['DrinkCard']).toEqual({ status: 'edited' });
870
+ expect(result['DrinkList']?.status).toBe('impacted');
871
+ expect(result['Home']?.status).toBe('impacted');
872
+ expect(impactNames(result, 'DrinkList')).toEqual(['DrinkCard']);
873
+ expect(impactNames(result, 'Home')).toEqual(['DrinkCard']);
874
+ });
875
+ it('should produce correct results for first-feature pipeline (all files new)', () => {
876
+ const gitFiles = [
877
+ { path: 'components/DrinkCard.tsx', status: 'modified' },
878
+ { path: 'app/page.tsx', status: 'modified' },
879
+ { path: 'components/Header.tsx', status: 'untracked' },
880
+ ];
881
+ // isFirstFeature = true → all become 'new'
882
+ const changedFiles = buildChangedFilesMap(gitFiles, true);
883
+ expect(changedFiles.get('components/DrinkCard.tsx')).toBe('new');
884
+ expect(changedFiles.get('app/page.tsx')).toBe('new');
885
+ expect(changedFiles.get('components/Header.tsx')).toBe('new');
886
+ const scenarios = [
887
+ {
888
+ componentName: 'DrinkCard',
889
+ componentPath: 'components/DrinkCard.tsx',
890
+ },
891
+ { componentName: null, componentPath: null, url: '/' },
892
+ { componentName: 'Header', componentPath: 'components/Header.tsx' },
893
+ ];
894
+ const entityInfos = buildEntityInfosFromScenarios(scenarios, { Home: 'app/page.tsx' }, []);
895
+ const result = computeEntityChangeStatus(changedFiles, entityInfos);
896
+ // All should be 'new' — none impacted
897
+ expect(result['DrinkCard']).toEqual({ status: 'new' });
898
+ expect(result['Home']).toEqual({ status: 'new' });
899
+ expect(result['Header']).toEqual({ status: 'new' });
900
+ expect(Object.values(result).some((s) => s.status === 'impacted')).toBe(false);
901
+ });
902
+ // ── Pass-through propagation ─────────────────────────────────────
903
+ it('should propagate root causes THROUGH a directly-changed intermediate entity', () => {
904
+ // D is edited, A is also edited, A importedBy B.
905
+ // D importedBy A (so D flows through A).
906
+ // B should be impacted by BOTH D (transitive through A) and A (direct importer).
907
+ //
908
+ // D(edited) ──importedBy──→ A(edited) ──importedBy──→ B
909
+ //
910
+ const result = computeEntityChangeStatus(new Map([
911
+ ['components/D.tsx', 'edited'],
912
+ ['components/A.tsx', 'edited'],
913
+ ]), [
914
+ entity('D', 'components/D.tsx', {
915
+ 'components/D.tsx': ['A'],
916
+ }),
917
+ entity('A', 'components/A.tsx', {
918
+ 'components/A.tsx': ['B'],
919
+ }),
920
+ entity('B', 'components/B.tsx'),
921
+ ]);
922
+ expect(result['D']).toEqual({ status: 'edited' });
923
+ expect(result['A']).toEqual({ status: 'edited' });
924
+ // B must see BOTH root causes — D propagated through A
925
+ expect(result['B']?.status).toBe('impacted');
926
+ expect(impactNames(result, 'B')).toEqual(['A', 'D']);
927
+ });
928
+ it('should propagate through a chain of directly-changed entities: D→C→B→A all changed except A', () => {
929
+ // D, C, B all directly changed. A imports B.
930
+ // A should see D, C, B as root causes.
931
+ const result = computeEntityChangeStatus(new Map([
932
+ ['components/D.tsx', 'edited'],
933
+ ['components/C.tsx', 'new'],
934
+ ['components/B.tsx', 'edited'],
935
+ ]), [
936
+ entity('D', 'components/D.tsx', { 'components/D.tsx': ['C'] }),
937
+ entity('C', 'components/C.tsx', { 'components/C.tsx': ['B'] }),
938
+ entity('B', 'components/B.tsx', { 'components/B.tsx': ['A'] }),
939
+ entity('A', 'components/A.tsx'),
940
+ ]);
941
+ expect(result['A']?.status).toBe('impacted');
942
+ expect(impactNames(result, 'A')).toEqual(['B', 'C', 'D']);
943
+ });
944
+ // ── Wide diamond ─────────────────────────────────────────────────
945
+ it('should handle wide diamond: 3+ paths converging then fanning out', () => {
946
+ // D1, D2, D3 all edited, all importedBy Merge, Merge importedBy [Out1, Out2]
947
+ //
948
+ // D1 ─┐
949
+ // D2 ─┼──importedBy──→ Merge ──importedBy──→ Out1
950
+ // D3 ─┘ └──importedBy──→ Out2
951
+ //
952
+ const result = computeEntityChangeStatus(new Map([
953
+ ['components/D1.tsx', 'edited'],
954
+ ['components/D2.tsx', 'new'],
955
+ ['components/D3.tsx', 'edited'],
956
+ ]), [
957
+ entity('D1', 'components/D1.tsx', { 'components/D1.tsx': ['Merge'] }),
958
+ entity('D2', 'components/D2.tsx', { 'components/D2.tsx': ['Merge'] }),
959
+ entity('D3', 'components/D3.tsx', { 'components/D3.tsx': ['Merge'] }),
960
+ entity('Merge', 'components/Merge.tsx', {
961
+ 'components/Merge.tsx': ['Out1', 'Out2'],
962
+ }),
963
+ entity('Out1', 'components/Out1.tsx'),
964
+ entity('Out2', 'components/Out2.tsx'),
965
+ ]);
966
+ // Merge gets all 3 root causes
967
+ expect(impactNames(result, 'Merge')).toEqual(['D1', 'D2', 'D3']);
968
+ // Out1 and Out2 also get all 3 root causes (propagated through Merge)
969
+ expect(impactNames(result, 'Out1')).toEqual(['D1', 'D2', 'D3']);
970
+ expect(impactNames(result, 'Out2')).toEqual(['D1', 'D2', 'D3']);
971
+ });
972
+ // ── changedFiles with non-entity entries ─────────────────────────
973
+ it('should ignore changedFiles entries that do not match any entity file path', () => {
974
+ // Git shows many changed files, but only some are entities
975
+ const result = computeEntityChangeStatus(new Map([
976
+ ['components/DrinkCard.tsx', 'edited'],
977
+ ['package.json', 'edited'],
978
+ ['README.md', 'new'],
979
+ ['.env', 'edited'],
980
+ ['tsconfig.json', 'edited'],
981
+ ]), [
982
+ entity('DrinkCard', 'components/DrinkCard.tsx', {
983
+ 'components/DrinkCard.tsx': ['DrinkList'],
984
+ }),
985
+ entity('DrinkList', 'components/DrinkList.tsx'),
986
+ ]);
987
+ expect(result['DrinkCard']).toEqual({ status: 'edited' });
988
+ expect(result['DrinkList']?.status).toBe('impacted');
989
+ // Only entities should appear in results
990
+ expect(Object.keys(result)).toEqual(['DrinkCard', 'DrinkList']);
991
+ });
992
+ });
993
+ // ── buildEntityInfosFromScenarios — additional edge cases ────────
994
+ describe('buildEntityInfosFromScenarios (edge cases)', () => {
995
+ it('should deduplicate page scenarios with different URLs resolving to same name', () => {
996
+ // /drinks and /drinks/123 both resolve to "Drinks"
997
+ const scenarios = [
998
+ { componentName: null, componentPath: null, url: '/drinks' },
999
+ { componentName: null, componentPath: null, url: '/drinks/123' },
1000
+ {
1001
+ componentName: null,
1002
+ componentPath: null,
1003
+ url: '/drinks/456?tab=reviews',
1004
+ },
1005
+ ];
1006
+ const pageFilePaths = { Drinks: 'app/drinks/page.tsx' };
1007
+ const result = buildEntityInfosFromScenarios(scenarios, pageFilePaths, []);
1008
+ // Should deduplicate to a single "Drinks" entity
1009
+ expect(result).toHaveLength(1);
1010
+ expect(result[0]).toEqual({
1011
+ name: 'Drinks',
1012
+ filePath: 'app/drinks/page.tsx',
1013
+ });
1014
+ });
1015
+ it('should handle component and page scenario with same conceptual name (component wins)', () => {
1016
+ // A component named "Home" AND a page URL "/" both produce name "Home"
1017
+ // Component scenario comes first — it should win
1018
+ const scenarios = [
1019
+ { componentName: 'Home', componentPath: 'components/Home.tsx' },
1020
+ { componentName: null, componentPath: null, url: '/' },
1021
+ ];
1022
+ const pageFilePaths = { Home: 'app/page.tsx' };
1023
+ const result = buildEntityInfosFromScenarios(scenarios, pageFilePaths, []);
1024
+ expect(result).toHaveLength(1);
1025
+ // Component path should win (first occurrence)
1026
+ expect(result[0].filePath).toBe('components/Home.tsx');
1027
+ });
1028
+ it('should handle multiple scenarios for the same component (only first is included)', () => {
1029
+ const scenarios = [
1030
+ {
1031
+ componentName: 'DrinkCard',
1032
+ componentPath: 'components/DrinkCard.tsx',
1033
+ },
1034
+ {
1035
+ componentName: 'DrinkCard',
1036
+ componentPath: 'components/DrinkCard.tsx',
1037
+ },
1038
+ {
1039
+ componentName: 'DrinkCard',
1040
+ componentPath: 'components/DrinkCard.tsx',
1041
+ },
1042
+ ];
1043
+ const metadata = [
1044
+ {
1045
+ name: 'DrinkCard',
1046
+ metadata: {
1047
+ importedBy: {
1048
+ 'components/DrinkCard.tsx': { DrinkList: { shas: ['abc'] } },
1049
+ },
1050
+ },
1051
+ },
1052
+ ];
1053
+ const result = buildEntityInfosFromScenarios(scenarios, {}, metadata);
1054
+ expect(result).toHaveLength(1);
1055
+ expect(result[0].importedBy).toBeDefined();
1056
+ });
1057
+ it('should use displayName for non-app/ pageFilePath instead of collapsing to Home', () => {
1058
+ // Margo bug: Chrome extension has two entry points:
1059
+ // "/" → src/popup/App.tsx (Home)
1060
+ // "/library.html" → src/library/FullPageLibrary.tsx (Library)
1061
+ // Without displayName, buildRoutePattern('src/library/FullPageLibrary.tsx')
1062
+ // returns '/' since it doesn't start with 'app/', collapsing both to "Home".
1063
+ const scenarios = [
1064
+ {
1065
+ componentName: null,
1066
+ componentPath: null,
1067
+ url: '/',
1068
+ pageFilePath: 'src/popup/App.tsx',
1069
+ displayName: 'Home',
1070
+ },
1071
+ {
1072
+ componentName: null,
1073
+ componentPath: null,
1074
+ url: '/library.html',
1075
+ pageFilePath: 'src/library/FullPageLibrary.tsx',
1076
+ displayName: 'Library',
1077
+ },
1078
+ ];
1079
+ const result = buildEntityInfosFromScenarios(scenarios, {}, []);
1080
+ expect(result).toHaveLength(2);
1081
+ expect(result.map((e) => e.name).sort()).toEqual(['Home', 'Library']);
1082
+ expect(result.find((e) => e.name === 'Home')?.filePath).toBe('src/popup/App.tsx');
1083
+ expect(result.find((e) => e.name === 'Library')?.filePath).toBe('src/library/FullPageLibrary.tsx');
1084
+ });
1085
+ });
1086
+ // ── Full pipeline regression tests ───────────────────────────────
1087
+ describe('full pipeline regression tests', () => {
1088
+ it('regression: entity with changed file AND imported by other unchanged entities should propagate', () => {
1089
+ // This catches the old regex-based bug: previously, "impacted" was marked
1090
+ // for every entity not directly changed, even if no dependency was actually changed.
1091
+ // With the new system, only entities that transitively import a changed entity get impacted.
1092
+ const gitFiles = [
1093
+ { path: 'lib/formatPrice.ts', status: 'added' },
1094
+ ];
1095
+ const changedFiles = buildChangedFilesMap(gitFiles, false);
1096
+ const scenarios = [
1097
+ {
1098
+ componentName: 'DrinkCard',
1099
+ componentPath: 'components/DrinkCard.tsx',
1100
+ },
1101
+ { componentName: 'Header', componentPath: 'components/Header.tsx' },
1102
+ { componentName: null, componentPath: null, url: '/' },
1103
+ ];
1104
+ const pageFilePaths = { Home: 'app/page.tsx' };
1105
+ const metadata = [
1106
+ {
1107
+ name: 'formatPrice',
1108
+ metadata: {
1109
+ importedBy: {
1110
+ 'lib/formatPrice.ts': { DrinkCard: { shas: ['sha1'] } },
1111
+ },
1112
+ },
1113
+ },
1114
+ {
1115
+ name: 'DrinkCard',
1116
+ metadata: {
1117
+ importedBy: {
1118
+ 'components/DrinkCard.tsx': { Home: { shas: ['sha2'] } },
1119
+ },
1120
+ },
1121
+ },
1122
+ ];
1123
+ // formatPrice is not a scenario entity — only DrinkCard, Header, Home are.
1124
+ // But formatPrice IS in the metadata as importedBy DrinkCard.
1125
+ // We need to include formatPrice in entityInfos for the graph to work.
1126
+ // However, buildEntityInfosFromScenarios only builds from scenarios,
1127
+ // so formatPrice won't be in the entities list → DrinkCard won't be impacted.
1128
+ //
1129
+ // This test documents the current behavior: only entities from scenarios
1130
+ // participate in the change status graph. Changed files that aren't entities
1131
+ // don't propagate impact (they'd need to be in the entities list).
1132
+ const entityInfos = buildEntityInfosFromScenarios(scenarios, pageFilePaths, metadata);
1133
+ const result = computeEntityChangeStatus(changedFiles, entityInfos);
1134
+ // formatPrice is not in scenarios, so not in entityInfos
1135
+ expect(entityInfos.find((e) => e.name === 'formatPrice')).toBeUndefined();
1136
+ // No entity files match changed files → empty result
1137
+ // DrinkCard and Home are NOT impacted because formatPrice is not in entities
1138
+ expect(result['DrinkCard']).toBeUndefined();
1139
+ expect(result['Header']).toBeUndefined();
1140
+ expect(result['Home']).toBeUndefined();
1141
+ });
1142
+ it('pipeline: changed utility file that IS an entity propagates impact correctly', () => {
1143
+ // When the changed utility IS registered as a scenario entity,
1144
+ // the full chain works end-to-end.
1145
+ const gitFiles = [
1146
+ { path: 'lib/formatPrice.ts', status: 'added' },
1147
+ ];
1148
+ const changedFiles = buildChangedFilesMap(gitFiles, false);
1149
+ const scenarios = [
1150
+ { componentName: 'formatPrice', componentPath: 'lib/formatPrice.ts' },
1151
+ {
1152
+ componentName: 'DrinkCard',
1153
+ componentPath: 'components/DrinkCard.tsx',
1154
+ },
1155
+ { componentName: null, componentPath: null, url: '/' },
1156
+ ];
1157
+ const pageFilePaths = { Home: 'app/page.tsx' };
1158
+ const metadata = [
1159
+ {
1160
+ name: 'formatPrice',
1161
+ metadata: {
1162
+ importedBy: {
1163
+ 'lib/formatPrice.ts': { DrinkCard: { shas: ['sha1'] } },
1164
+ },
1165
+ },
1166
+ },
1167
+ {
1168
+ name: 'DrinkCard',
1169
+ metadata: {
1170
+ importedBy: {
1171
+ 'components/DrinkCard.tsx': { Home: { shas: ['sha2'] } },
1172
+ },
1173
+ },
1174
+ },
1175
+ ];
1176
+ const entityInfos = buildEntityInfosFromScenarios(scenarios, pageFilePaths, metadata);
1177
+ const result = computeEntityChangeStatus(changedFiles, entityInfos);
1178
+ expect(result['formatPrice']).toEqual({ status: 'new' });
1179
+ expect(result['DrinkCard']?.status).toBe('impacted');
1180
+ expect(impactNames(result, 'DrinkCard')).toEqual(['formatPrice']);
1181
+ expect(result['Home']?.status).toBe('impacted');
1182
+ expect(impactNames(result, 'Home')).toEqual(['formatPrice']);
1183
+ });
1184
+ it('pipeline: renamed file status is correctly ignored', () => {
1185
+ const gitFiles = [
1186
+ { path: 'components/OldName.tsx', status: 'renamed' },
1187
+ { path: 'components/DrinkCard.tsx', status: 'modified' },
1188
+ ];
1189
+ const changedFiles = buildChangedFilesMap(gitFiles, false);
1190
+ // Renamed file should not appear
1191
+ expect(changedFiles.has('components/OldName.tsx')).toBe(false);
1192
+ expect(changedFiles.get('components/DrinkCard.tsx')).toBe('edited');
1193
+ });
1194
+ it('pipeline: first feature mode with import graph still marks everything new', () => {
1195
+ // Even with importedBy metadata, first-feature mode should mark
1196
+ // all entities as 'new' with no 'impacted' entries.
1197
+ const gitFiles = [
1198
+ { path: 'components/DrinkCard.tsx', status: 'modified' },
1199
+ { path: 'app/page.tsx', status: 'modified' },
1200
+ ];
1201
+ const changedFiles = buildChangedFilesMap(gitFiles, true); // first feature!
1202
+ const scenarios = [
1203
+ {
1204
+ componentName: 'DrinkCard',
1205
+ componentPath: 'components/DrinkCard.tsx',
1206
+ },
1207
+ { componentName: null, componentPath: null, url: '/' },
1208
+ ];
1209
+ const metadata = [
1210
+ {
1211
+ name: 'DrinkCard',
1212
+ metadata: {
1213
+ importedBy: {
1214
+ 'components/DrinkCard.tsx': { Home: { shas: ['sha1'] } },
1215
+ },
1216
+ },
1217
+ },
1218
+ ];
1219
+ const entityInfos = buildEntityInfosFromScenarios(scenarios, { Home: 'app/page.tsx' }, metadata);
1220
+ const result = computeEntityChangeStatus(changedFiles, entityInfos);
1221
+ // Both are directly changed (new) → no impact propagation
1222
+ expect(result['DrinkCard']).toEqual({ status: 'new' });
1223
+ expect(result['Home']).toEqual({ status: 'new' });
1224
+ });
1225
+ });
1226
+ // ── filterGroupsByChangeStatus ──────────────────────────────────────────
1227
+ describe('filterGroupsByChangeStatus', () => {
1228
+ const groups = [
1229
+ ['Home', ['s1', 's2']],
1230
+ ['About', ['s3']],
1231
+ ['Header', ['s4']],
1232
+ ];
1233
+ it('should return all groups when entityChangeStatus is undefined', () => {
1234
+ expect(filterGroupsByChangeStatus(groups, undefined)).toEqual(groups);
1235
+ });
1236
+ it('should return all groups when entityChangeStatus is empty', () => {
1237
+ expect(filterGroupsByChangeStatus(groups, {})).toEqual(groups);
1238
+ });
1239
+ it('should filter to only groups with a change status', () => {
1240
+ const status = {
1241
+ Home: { status: 'new' },
1242
+ Header: { status: 'edited' },
1243
+ };
1244
+ const result = filterGroupsByChangeStatus(groups, status);
1245
+ expect(result).toEqual([
1246
+ ['Home', ['s1', 's2']],
1247
+ ['Header', ['s4']],
1248
+ ]);
1249
+ });
1250
+ it('should return empty array when no groups match', () => {
1251
+ const status = {
1252
+ Footer: { status: 'new' },
1253
+ };
1254
+ const result = filterGroupsByChangeStatus(groups, status);
1255
+ expect(result).toEqual([]);
1256
+ });
1257
+ });
1258
+ // ── buildEntityInfosFromGlossary ────────────────────────────────────
1259
+ describe('buildEntityInfosFromGlossary', () => {
1260
+ it('should convert glossary entries to EntityInfo with name and filePath', () => {
1261
+ const glossary = [
1262
+ { name: 'pad', filePath: 'app/lib/calendar.ts' },
1263
+ { name: 'formatDate', filePath: 'app/lib/calendar.ts' },
1264
+ ];
1265
+ const result = buildEntityInfosFromGlossary(glossary);
1266
+ expect(result).toEqual([
1267
+ { name: 'pad', filePath: 'app/lib/calendar.ts' },
1268
+ { name: 'formatDate', filePath: 'app/lib/calendar.ts' },
1269
+ ]);
1270
+ });
1271
+ it('should deduplicate by name (first occurrence wins)', () => {
1272
+ const glossary = [
1273
+ { name: 'pad', filePath: 'app/lib/calendar.ts' },
1274
+ { name: 'pad', filePath: 'app/lib/other.ts' },
1275
+ ];
1276
+ const result = buildEntityInfosFromGlossary(glossary);
1277
+ expect(result).toHaveLength(1);
1278
+ expect(result[0].filePath).toBe('app/lib/calendar.ts');
1279
+ });
1280
+ it('should skip entries already present in existingNames set', () => {
1281
+ const glossary = [
1282
+ { name: 'Home', filePath: 'app/lib/calendar.ts' },
1283
+ { name: 'pad', filePath: 'app/lib/calendar.ts' },
1284
+ ];
1285
+ const existing = new Set(['Home']);
1286
+ const result = buildEntityInfosFromGlossary(glossary, existing);
1287
+ expect(result).toHaveLength(1);
1288
+ expect(result[0].name).toBe('pad');
1289
+ });
1290
+ it('should return empty array for empty input', () => {
1291
+ expect(buildEntityInfosFromGlossary([])).toEqual([]);
1292
+ });
1293
+ });
1294
+ // ── filterGlossaryByChangeStatus ──────────────────────────────────────
1295
+ describe('filterGlossaryByChangeStatus', () => {
1296
+ const functions = [
1297
+ {
1298
+ name: 'pad',
1299
+ filePath: 'lib/calendar.ts',
1300
+ description: '',
1301
+ testFile: 'test.ts',
1302
+ },
1303
+ {
1304
+ name: 'formatDate',
1305
+ filePath: 'lib/calendar.ts',
1306
+ description: '',
1307
+ testFile: 'test.ts',
1308
+ },
1309
+ {
1310
+ name: 'getDays',
1311
+ filePath: 'lib/calendar.ts',
1312
+ description: '',
1313
+ testFile: 'test.ts',
1314
+ },
1315
+ ];
1316
+ it('should return all functions when entityChangeStatus is undefined', () => {
1317
+ expect(filterGlossaryByChangeStatus(functions, undefined)).toEqual(functions);
1318
+ });
1319
+ it('should return all functions when entityChangeStatus is empty', () => {
1320
+ expect(filterGlossaryByChangeStatus(functions, {})).toEqual(functions);
1321
+ });
1322
+ it('should filter to only functions with a change status', () => {
1323
+ const status = {
1324
+ pad: { status: 'new' },
1325
+ getDays: { status: 'edited' },
1326
+ };
1327
+ const result = filterGlossaryByChangeStatus(functions, status);
1328
+ expect(result).toHaveLength(2);
1329
+ expect(result.map((f) => f.name)).toEqual(['pad', 'getDays']);
1330
+ });
1331
+ it('should return empty array when no functions match', () => {
1332
+ const status = {
1333
+ SomeOtherThing: { status: 'new' },
1334
+ };
1335
+ const result = filterGlossaryByChangeStatus(functions, status);
1336
+ expect(result).toEqual([]);
1337
+ });
1338
+ });
1339
+ // ── scenarioEntityName ──────────────────────────────────────────────
1340
+ describe('scenarioEntityName', () => {
1341
+ it('should return componentName when set', () => {
1342
+ expect(scenarioEntityName({
1343
+ componentName: 'ReviewCard',
1344
+ url: '/isolated-components/ReviewCard?s=Default',
1345
+ })).toBe('ReviewCard');
1346
+ });
1347
+ it('should return page name from URL when componentName is null', () => {
1348
+ expect(scenarioEntityName({ componentName: null, url: '/drinks/1' })).toBe('Drinks');
1349
+ });
1350
+ it('should return Home for root URL when componentName is null', () => {
1351
+ expect(scenarioEntityName({ componentName: null, url: '/' })).toBe('Home');
1352
+ });
1353
+ it('should return Home when both componentName and url are null', () => {
1354
+ expect(scenarioEntityName({ componentName: null, url: null })).toBe('Home');
1355
+ });
1356
+ it('should return page name when componentName is undefined', () => {
1357
+ expect(scenarioEntityName({ url: '/settings' })).toBe('Settings');
1358
+ });
1359
+ it('should return Home when no fields provided', () => {
1360
+ expect(scenarioEntityName({})).toBe('Home');
1361
+ });
1362
+ });
1363
+ // ── filterScenarioScreenshotsByChangeStatus ───────────────────────────
1364
+ describe('filterScenarioScreenshotsByChangeStatus', () => {
1365
+ it('should return all screenshots when entityChangeStatus is undefined', () => {
1366
+ const screenshots = [
1367
+ { name: 'Busy Month', path: 'busy.png', componentName: null, url: '/' },
1368
+ {
1369
+ name: 'EventPill - Default',
1370
+ path: 'pill.png',
1371
+ componentName: 'EventPill',
1372
+ url: '/isolated-components/EventPill',
1373
+ },
1374
+ ];
1375
+ expect(filterScenarioScreenshotsByChangeStatus(screenshots, undefined)).toEqual(screenshots);
1376
+ });
1377
+ it('should return all screenshots when entityChangeStatus is empty', () => {
1378
+ const screenshots = [
1379
+ { name: 'Busy Month', path: 'busy.png', componentName: null, url: '/' },
1380
+ ];
1381
+ expect(filterScenarioScreenshotsByChangeStatus(screenshots, {})).toEqual(screenshots);
1382
+ });
1383
+ it('should include component scenarios whose entity has a change status', () => {
1384
+ const screenshots = [
1385
+ {
1386
+ name: 'EventPill - Default',
1387
+ path: 'pill.png',
1388
+ componentName: 'EventPill',
1389
+ url: '/isolated-components/EventPill',
1390
+ },
1391
+ {
1392
+ name: 'ErrorState - Server Error',
1393
+ path: 'error.png',
1394
+ componentName: 'ErrorState',
1395
+ url: '/isolated-components/ErrorState',
1396
+ },
1397
+ {
1398
+ name: 'CalendarGrid - Default',
1399
+ path: 'grid.png',
1400
+ componentName: 'CalendarGrid',
1401
+ url: '/isolated-components/CalendarGrid',
1402
+ },
1403
+ ];
1404
+ const status = {
1405
+ ErrorState: { status: 'new' },
1406
+ EventPill: { status: 'edited' },
1407
+ };
1408
+ const result = filterScenarioScreenshotsByChangeStatus(screenshots, status);
1409
+ expect(result.map((s) => s.name)).toEqual([
1410
+ 'EventPill - Default',
1411
+ 'ErrorState - Server Error',
1412
+ ]);
1413
+ });
1414
+ it('should include page scenarios whose page entity has a change status', () => {
1415
+ const screenshots = [
1416
+ { name: 'Busy Month', path: 'busy.png', componentName: null, url: '/' },
1417
+ {
1418
+ name: 'Empty Calendar',
1419
+ path: 'empty.png',
1420
+ componentName: null,
1421
+ url: '/',
1422
+ },
1423
+ ];
1424
+ const status = {
1425
+ Home: { status: 'edited' },
1426
+ };
1427
+ const result = filterScenarioScreenshotsByChangeStatus(screenshots, status);
1428
+ expect(result).toEqual(screenshots);
1429
+ });
1430
+ it('should exclude page scenarios when their page entity has no status', () => {
1431
+ const screenshots = [
1432
+ { name: 'Busy Month', path: 'busy.png', componentName: null, url: '/' },
1433
+ {
1434
+ name: 'EventPill - Default',
1435
+ path: 'pill.png',
1436
+ componentName: 'EventPill',
1437
+ url: '/isolated-components/EventPill',
1438
+ },
1439
+ ];
1440
+ const status = {
1441
+ SomeComponent: { status: 'new' },
1442
+ };
1443
+ const result = filterScenarioScreenshotsByChangeStatus(screenshots, status);
1444
+ // Home page has no status, so "Busy Month" is excluded
1445
+ // SomeComponent doesn't match EventPill either
1446
+ expect(result).toEqual([]);
1447
+ });
1448
+ it('should include both page and component scenarios when both entities have status', () => {
1449
+ const screenshots = [
1450
+ { name: 'Busy Month', path: 'busy.png', componentName: null, url: '/' },
1451
+ {
1452
+ name: 'Empty Calendar',
1453
+ path: 'empty.png',
1454
+ componentName: null,
1455
+ url: '/',
1456
+ },
1457
+ {
1458
+ name: 'EventPill - Default',
1459
+ path: 'pill.png',
1460
+ componentName: 'EventPill',
1461
+ url: '/isolated-components/EventPill',
1462
+ },
1463
+ ];
1464
+ const status = {
1465
+ Home: { status: 'edited' },
1466
+ EventPill: { status: 'new' },
1467
+ };
1468
+ const result = filterScenarioScreenshotsByChangeStatus(screenshots, status);
1469
+ expect(result.map((s) => s.name)).toEqual([
1470
+ 'Busy Month',
1471
+ 'Empty Calendar',
1472
+ 'EventPill - Default',
1473
+ ]);
1474
+ });
1475
+ it('should handle page scenarios with dashes in names using URL, not name parsing', () => {
1476
+ // The original bug: "Drink Detail - Earl Grey" was parsed as component "Drink Detail"
1477
+ const screenshots = [
1478
+ {
1479
+ name: 'Drink Detail - Earl Grey',
1480
+ path: 'earl.png',
1481
+ componentName: null,
1482
+ url: '/drinks/1',
1483
+ },
1484
+ {
1485
+ name: 'Drink Detail - No Reviews',
1486
+ path: 'no-reviews.png',
1487
+ componentName: null,
1488
+ url: '/drinks/1',
1489
+ },
1490
+ {
1491
+ name: 'ReviewCard - Default',
1492
+ path: 'review.png',
1493
+ componentName: 'ReviewCard',
1494
+ url: '/isolated-components/ReviewCard',
1495
+ },
1496
+ {
1497
+ name: 'Full Catalog',
1498
+ path: 'catalog.png',
1499
+ componentName: null,
1500
+ url: '/',
1501
+ },
1502
+ ];
1503
+ const status = {
1504
+ Drinks: { status: 'new' },
1505
+ ReviewCard: { status: 'new' },
1506
+ Home: { status: 'edited' },
1507
+ };
1508
+ const result = filterScenarioScreenshotsByChangeStatus(screenshots, status);
1509
+ expect(result.map((s) => s.name)).toEqual([
1510
+ 'Drink Detail - Earl Grey',
1511
+ 'Drink Detail - No Reviews',
1512
+ 'ReviewCard - Default',
1513
+ 'Full Catalog',
1514
+ ]);
1515
+ });
1516
+ it('should exclude page scenarios for unchanged pages even with dashes in names', () => {
1517
+ const screenshots = [
1518
+ {
1519
+ name: 'Drink Detail - Earl Grey',
1520
+ path: 'earl.png',
1521
+ componentName: null,
1522
+ url: '/drinks/1',
1523
+ },
1524
+ {
1525
+ name: 'ReviewCard - Default',
1526
+ path: 'review.png',
1527
+ componentName: 'ReviewCard',
1528
+ url: '/isolated-components/ReviewCard',
1529
+ },
1530
+ ];
1531
+ const status = {
1532
+ ReviewCard: { status: 'edited' },
1533
+ };
1534
+ const result = filterScenarioScreenshotsByChangeStatus(screenshots, status);
1535
+ // Drinks page has no status, so "Drink Detail" page scenarios are excluded
1536
+ expect(result.map((s) => s.name)).toEqual(['ReviewCard - Default']);
1537
+ });
1538
+ it('should use componentName for matching, not the name prefix', () => {
1539
+ const screenshots = [
1540
+ {
1541
+ name: 'Card Loading State - Spinner',
1542
+ path: 'spinner.png',
1543
+ componentName: 'LoadingCard',
1544
+ url: '/isolated-components/LoadingCard',
1545
+ },
1546
+ ];
1547
+ const status = {
1548
+ LoadingCard: { status: 'new' },
1549
+ };
1550
+ const result = filterScenarioScreenshotsByChangeStatus(screenshots, status);
1551
+ expect(result.map((s) => s.name)).toEqual([
1552
+ 'Card Loading State - Spinner',
1553
+ ]);
1554
+ });
1555
+ it('should exclude component scenario when its entity has no status', () => {
1556
+ const screenshots = [
1557
+ {
1558
+ name: 'Card Loading State - Spinner',
1559
+ path: 'spinner.png',
1560
+ componentName: 'LoadingCard',
1561
+ url: '/isolated-components/LoadingCard',
1562
+ },
1563
+ ];
1564
+ const status = {
1565
+ SomeOtherComponent: { status: 'new' },
1566
+ };
1567
+ const result = filterScenarioScreenshotsByChangeStatus(screenshots, status);
1568
+ expect(result).toEqual([]);
1569
+ });
1570
+ it('should filter per-page independently (not all-or-nothing for pages)', () => {
1571
+ // Only Drinks page changed, not Home — scenarios for each page should be filtered independently
1572
+ const screenshots = [
1573
+ {
1574
+ name: 'Full Catalog',
1575
+ path: 'catalog.png',
1576
+ componentName: null,
1577
+ url: '/',
1578
+ },
1579
+ {
1580
+ name: 'Drink Detail - Earl Grey',
1581
+ path: 'earl.png',
1582
+ componentName: null,
1583
+ url: '/drinks/1',
1584
+ },
1585
+ ];
1586
+ const status = {
1587
+ Drinks: { status: 'new' },
1588
+ };
1589
+ const result = filterScenarioScreenshotsByChangeStatus(screenshots, status);
1590
+ // Home page has no status, so "Full Catalog" is excluded
1591
+ // Drinks page has status, so "Drink Detail" is included
1592
+ expect(result.map((s) => s.name)).toEqual(['Drink Detail - Earl Grey']);
1593
+ });
1594
+ it('should fall back to name-based parsing when componentName is not present (backward compat)', () => {
1595
+ const screenshots = [
1596
+ { name: 'EventPill - Default', path: 'pill.png' },
1597
+ { name: 'Full Calendar', path: 'cal.png' },
1598
+ ];
1599
+ const status = {
1600
+ EventPill: { status: 'new' },
1601
+ Home: { status: 'edited' },
1602
+ };
1603
+ const result = filterScenarioScreenshotsByChangeStatus(screenshots, status);
1604
+ expect(result.map((s) => s.name)).toEqual([
1605
+ 'EventPill - Default',
1606
+ 'Full Calendar',
1607
+ ]);
1608
+ });
1609
+ });
1610
+ // ── scanPageFilePaths ───────────────────────────────────────────────────
1611
+ describe('scanPageFilePaths', () => {
1612
+ let tempDir;
1613
+ beforeEach(() => {
1614
+ tempDir = fsModule.mkdtempSync(pathModule.join(os.tmpdir(), 'scanpages-test-'));
1615
+ });
1616
+ afterEach(() => {
1617
+ fsModule.rmSync(tempDir, { recursive: true, force: true });
1618
+ });
1619
+ it('should find page.tsx files in nested app/ structure', () => {
1620
+ const appDir = pathModule.join(tempDir, 'app');
1621
+ fsModule.mkdirSync(appDir, { recursive: true });
1622
+ fsModule.writeFileSync(pathModule.join(appDir, 'page.tsx'), '');
1623
+ fsModule.mkdirSync(pathModule.join(appDir, 'drinks'), {
1624
+ recursive: true,
1625
+ });
1626
+ fsModule.writeFileSync(pathModule.join(appDir, 'drinks', 'page.tsx'), '');
1627
+ fsModule.mkdirSync(pathModule.join(appDir, 'settings', 'profile'), {
1628
+ recursive: true,
1629
+ });
1630
+ fsModule.writeFileSync(pathModule.join(appDir, 'settings', 'profile', 'page.tsx'), '');
1631
+ const result = scanPageFilePaths(tempDir);
1632
+ expect(result.map).toEqual({
1633
+ Home: 'app/page.tsx',
1634
+ Drinks: 'app/drinks/page.tsx',
1635
+ Settings: 'app/settings/profile/page.tsx',
1636
+ });
1637
+ });
1638
+ it('should find page.js files', () => {
1639
+ const appDir = pathModule.join(tempDir, 'app');
1640
+ fsModule.mkdirSync(appDir, { recursive: true });
1641
+ fsModule.writeFileSync(pathModule.join(appDir, 'page.js'), '');
1642
+ const result = scanPageFilePaths(tempDir);
1643
+ expect(result.map).toEqual({ Home: 'app/page.js' });
1644
+ });
1645
+ it('should skip isolated-components directories', () => {
1646
+ const appDir = pathModule.join(tempDir, 'app');
1647
+ fsModule.mkdirSync(pathModule.join(appDir, 'isolated-components', 'test'), {
1648
+ recursive: true,
1649
+ });
1650
+ fsModule.writeFileSync(pathModule.join(appDir, 'isolated-components', 'test', 'page.tsx'), '');
1651
+ const result = scanPageFilePaths(tempDir);
1652
+ expect(result.map).toEqual({});
1653
+ });
1654
+ it('should return empty map when app/ does not exist', () => {
1655
+ const result = scanPageFilePaths(tempDir);
1656
+ expect(result.map).toEqual({});
1657
+ });
1658
+ // ── Expo Router support ──────────────────────────────────────────────
1659
+ it('should find index.tsx as Home page (Expo Router)', () => {
1660
+ const appDir = pathModule.join(tempDir, 'app');
1661
+ fsModule.mkdirSync(appDir, { recursive: true });
1662
+ fsModule.writeFileSync(pathModule.join(appDir, 'index.tsx'), '');
1663
+ const result = scanPageFilePaths(tempDir);
1664
+ expect(result.map).toEqual({ Home: 'app/index.tsx' });
1665
+ });
1666
+ it('should find named route files as pages (Expo Router)', () => {
1667
+ const appDir = pathModule.join(tempDir, 'app');
1668
+ fsModule.mkdirSync(appDir, { recursive: true });
1669
+ fsModule.writeFileSync(pathModule.join(appDir, 'index.tsx'), '');
1670
+ fsModule.writeFileSync(pathModule.join(appDir, 'add-tea.tsx'), '');
1671
+ fsModule.mkdirSync(pathModule.join(appDir, 'tea'), { recursive: true });
1672
+ fsModule.writeFileSync(pathModule.join(appDir, 'tea', '[id].tsx'), '');
1673
+ const result = scanPageFilePaths(tempDir);
1674
+ expect(result.map).toEqual({
1675
+ Home: 'app/index.tsx',
1676
+ 'Add-tea': 'app/add-tea.tsx',
1677
+ Tea: 'app/tea/[id].tsx',
1678
+ });
1679
+ });
1680
+ it('should skip _layout.tsx files (Expo Router)', () => {
1681
+ const appDir = pathModule.join(tempDir, 'app');
1682
+ fsModule.mkdirSync(appDir, { recursive: true });
1683
+ fsModule.writeFileSync(pathModule.join(appDir, '_layout.tsx'), '');
1684
+ fsModule.writeFileSync(pathModule.join(appDir, 'index.tsx'), '');
1685
+ const result = scanPageFilePaths(tempDir);
1686
+ expect(result.map).toEqual({ Home: 'app/index.tsx' });
1687
+ });
1688
+ it('should handle route groups like (tabs) transparently (Expo Router)', () => {
1689
+ const appDir = pathModule.join(tempDir, 'app');
1690
+ const tabsDir = pathModule.join(appDir, '(tabs)');
1691
+ fsModule.mkdirSync(tabsDir, { recursive: true });
1692
+ fsModule.writeFileSync(pathModule.join(tabsDir, '_layout.tsx'), '');
1693
+ fsModule.writeFileSync(pathModule.join(tabsDir, 'index.tsx'), '');
1694
+ fsModule.writeFileSync(pathModule.join(tabsDir, 'settings.tsx'), '');
1695
+ const result = scanPageFilePaths(tempDir);
1696
+ expect(result.map).toEqual({
1697
+ Home: 'app/(tabs)/index.tsx',
1698
+ Settings: 'app/(tabs)/settings.tsx',
1699
+ });
1700
+ });
1701
+ it('should prefer page.tsx over index.tsx when both exist (Next.js priority)', () => {
1702
+ const appDir = pathModule.join(tempDir, 'app');
1703
+ fsModule.mkdirSync(appDir, { recursive: true });
1704
+ fsModule.writeFileSync(pathModule.join(appDir, 'page.tsx'), '');
1705
+ fsModule.writeFileSync(pathModule.join(appDir, 'index.tsx'), '');
1706
+ const result = scanPageFilePaths(tempDir);
1707
+ expect(result.map).toEqual({ Home: 'app/page.tsx' });
1708
+ });
1709
+ it('should include all page files in allFiles when multiple routes share a page name', () => {
1710
+ const appDir = pathModule.join(tempDir, 'app');
1711
+ fsModule.mkdirSync(appDir, { recursive: true });
1712
+ fsModule.writeFileSync(pathModule.join(appDir, 'page.tsx'), '');
1713
+ fsModule.mkdirSync(pathModule.join(appDir, 'feedback', '[id]', 'edit'), {
1714
+ recursive: true,
1715
+ });
1716
+ fsModule.mkdirSync(pathModule.join(appDir, 'feedback', 'new'), {
1717
+ recursive: true,
1718
+ });
1719
+ fsModule.writeFileSync(pathModule.join(appDir, 'feedback', '[id]', 'page.tsx'), '');
1720
+ fsModule.writeFileSync(pathModule.join(appDir, 'feedback', '[id]', 'edit', 'page.tsx'), '');
1721
+ fsModule.writeFileSync(pathModule.join(appDir, 'feedback', 'new', 'page.tsx'), '');
1722
+ const result = scanPageFilePaths(tempDir);
1723
+ // Map picks one canonical file per page name
1724
+ expect(result.map['Home']).toBe('app/page.tsx');
1725
+ expect(result.map['Feedback']).toBeDefined();
1726
+ // allFiles includes ALL page files, even those that collided on page name
1727
+ expect(result.allFiles.sort()).toEqual([
1728
+ 'app/feedback/[id]/edit/page.tsx',
1729
+ 'app/feedback/[id]/page.tsx',
1730
+ 'app/feedback/new/page.tsx',
1731
+ 'app/page.tsx',
1732
+ ]);
1733
+ });
1734
+ });
1735
+ // ── detectFirstFeature ─────────────────────────────────────────────────
1736
+ describe('detectFirstFeature', () => {
1737
+ it('should return true when git has 0 or 1 commits', () => {
1738
+ const tempDir = fsModule.mkdtempSync(pathModule.join(os.tmpdir(), 'firstfeat-test-'));
1739
+ try {
1740
+ // Init a git repo with no commits
1741
+ require('child_process').execSync('git init', {
1742
+ cwd: tempDir,
1743
+ stdio: 'ignore',
1744
+ });
1745
+ expect(detectFirstFeature(tempDir)).toBe(true);
1746
+ }
1747
+ finally {
1748
+ fsModule.rmSync(tempDir, { recursive: true, force: true });
1749
+ }
1750
+ });
1751
+ it('should return false when git has multiple commits', () => {
1752
+ const tempDir = fsModule.mkdtempSync(pathModule.join(os.tmpdir(), 'firstfeat-test-'));
1753
+ try {
1754
+ require('child_process').execSync('git init && git config user.email "test@test.com" && git config user.name "test" && git commit --allow-empty -m "first" && git commit --allow-empty -m "second"', { cwd: tempDir, stdio: 'ignore' });
1755
+ expect(detectFirstFeature(tempDir)).toBe(false);
1756
+ }
1757
+ finally {
1758
+ fsModule.rmSync(tempDir, { recursive: true, force: true });
1759
+ }
1760
+ });
1761
+ it('should return true when not a git repo', () => {
1762
+ const tempDir = fsModule.mkdtempSync(pathModule.join(os.tmpdir(), 'firstfeat-test-'));
1763
+ try {
1764
+ expect(detectFirstFeature(tempDir)).toBe(true);
1765
+ }
1766
+ finally {
1767
+ fsModule.rmSync(tempDir, { recursive: true, force: true });
1768
+ }
1769
+ });
1770
+ });
1771
+ // ── readFeatureStartedAt ───────────────────────────────────────────────
1772
+ describe('readFeatureStartedAt', () => {
1773
+ let tempDir;
1774
+ beforeEach(() => {
1775
+ tempDir = fsModule.mkdtempSync(pathModule.join(os.tmpdir(), 'featurets-test-'));
1776
+ fsModule.mkdirSync(pathModule.join(tempDir, '.codeyam'), {
1777
+ recursive: true,
1778
+ });
1779
+ });
1780
+ afterEach(() => {
1781
+ fsModule.rmSync(tempDir, { recursive: true, force: true });
1782
+ });
1783
+ it('should return featureStartedAt from editor-step.json', () => {
1784
+ fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'editor-step.json'), JSON.stringify({ featureStartedAt: '2026-03-01T10:00:00.000Z' }));
1785
+ expect(readFeatureStartedAt(tempDir)).toBe('2026-03-01T10:00:00.000Z');
1786
+ });
1787
+ it('should return null when file does not exist', () => {
1788
+ expect(readFeatureStartedAt(tempDir)).toBeNull();
1789
+ });
1790
+ it('should return null when featureStartedAt is not set', () => {
1791
+ fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'editor-step.json'), JSON.stringify({ step: 5 }));
1792
+ expect(readFeatureStartedAt(tempDir)).toBeNull();
1793
+ });
1794
+ it('should return null for invalid JSON', () => {
1795
+ fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'editor-step.json'), 'not json');
1796
+ expect(readFeatureStartedAt(tempDir)).toBeNull();
1797
+ });
1798
+ });
1799
+ // ── readEditorStep ──────────────────────────────────────────────────────
1800
+ describe('readEditorStep', () => {
1801
+ let tempDir;
1802
+ beforeEach(() => {
1803
+ tempDir = fsModule.mkdtempSync(pathModule.join(os.tmpdir(), 'editorstep-test-'));
1804
+ fsModule.mkdirSync(pathModule.join(tempDir, '.codeyam'), {
1805
+ recursive: true,
1806
+ });
1807
+ });
1808
+ afterEach(() => {
1809
+ fsModule.rmSync(tempDir, { recursive: true, force: true });
1810
+ });
1811
+ it('should return step and label from editor-step.json', () => {
1812
+ fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'editor-step.json'), JSON.stringify({ step: 3, label: 'Confirm', feature: 'Add login' }));
1813
+ expect(readEditorStep(tempDir)).toEqual({ step: 3, label: 'Confirm' });
1814
+ });
1815
+ it('should return null when file does not exist', () => {
1816
+ expect(readEditorStep(tempDir)).toBeNull();
1817
+ });
1818
+ it('should return null when step field is missing', () => {
1819
+ fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'editor-step.json'), JSON.stringify({ feature: 'Add login' }));
1820
+ expect(readEditorStep(tempDir)).toBeNull();
1821
+ });
1822
+ it('should return null for invalid JSON', () => {
1823
+ fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'editor-step.json'), 'not json');
1824
+ expect(readEditorStep(tempDir)).toBeNull();
1825
+ });
1826
+ });
1827
+ // ── readEditorSessionId ─────────────────────────────────────────────────
1828
+ describe('readEditorSessionId', () => {
1829
+ let tempDir;
1830
+ beforeEach(() => {
1831
+ tempDir = fsModule.mkdtempSync(pathModule.join(os.tmpdir(), 'sessionid-test-'));
1832
+ fsModule.mkdirSync(pathModule.join(tempDir, '.codeyam'), {
1833
+ recursive: true,
1834
+ });
1835
+ });
1836
+ afterEach(() => {
1837
+ fsModule.rmSync(tempDir, { recursive: true, force: true });
1838
+ });
1839
+ it('should return session ID from claude-session-id.txt', () => {
1840
+ const uuid = '550e8400-e29b-41d4-a716-446655440000';
1841
+ fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'claude-session-id.txt'), uuid);
1842
+ expect(readEditorSessionId(tempDir)).toBe(uuid);
1843
+ });
1844
+ it('should trim whitespace from session ID', () => {
1845
+ fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'claude-session-id.txt'), ' abc-123 \n');
1846
+ expect(readEditorSessionId(tempDir)).toBe('abc-123');
1847
+ });
1848
+ it('should return null when file does not exist', () => {
1849
+ expect(readEditorSessionId(tempDir)).toBeNull();
1850
+ });
1851
+ it('should return null when file is empty', () => {
1852
+ fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'claude-session-id.txt'), '');
1853
+ expect(readEditorSessionId(tempDir)).toBeNull();
1854
+ });
1855
+ });
1856
+ });
1857
+ //# sourceMappingURL=entityChangeStatus.test.js.map