@codeyam/codeyam-cli 0.1.0-staging.2a88920 → 0.1.0-staging.4684848

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 (364) hide show
  1. package/analyzer-template/.build-info.json +7 -7
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +4 -4
  4. package/analyzer-template/packages/ai/index.ts +1 -0
  5. package/analyzer-template/packages/ai/package.json +2 -2
  6. package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +23 -1
  7. package/analyzer-template/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.ts +10 -17
  8. package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +101 -0
  9. package/analyzer-template/packages/ai/src/lib/astScopes/sharedPatterns.ts +28 -0
  10. package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +6 -0
  11. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +330 -9
  12. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +5 -1
  13. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +11 -2
  14. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +2 -2
  15. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.ts +70 -0
  16. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +140 -14
  17. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.ts +20 -1
  18. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +84 -19
  19. package/analyzer-template/packages/ai/src/lib/dataStructureChunking.ts +33 -15
  20. package/analyzer-template/packages/ai/src/lib/generateEntityDataStructure.ts +58 -3
  21. package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +299 -5
  22. package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +38 -2
  23. package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +359 -142
  24. package/analyzer-template/packages/ai/src/lib/isolateScopes.ts +51 -3
  25. package/analyzer-template/packages/ai/src/lib/mergeJsonTypeDefinitions.ts +5 -0
  26. package/analyzer-template/packages/ai/src/lib/promptGenerators/collapseNullableObjects.ts +118 -0
  27. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +24 -4
  28. package/analyzer-template/packages/analyze/index.ts +2 -0
  29. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +69 -3
  30. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +5 -0
  31. package/analyzer-template/packages/analyze/src/lib/files/scenarios/TransformationTracer.ts +1315 -0
  32. package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +4 -0
  33. package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +59 -26
  34. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +194 -15
  35. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +372 -57
  36. package/analyzer-template/packages/analyze/src/lib/index.ts +1 -0
  37. package/analyzer-template/packages/database/package.json +1 -1
  38. package/analyzer-template/packages/database/src/lib/analysisBranchToDb.ts +1 -1
  39. package/analyzer-template/packages/database/src/lib/analysisToDb.ts +1 -1
  40. package/analyzer-template/packages/database/src/lib/branchToDb.ts +1 -1
  41. package/analyzer-template/packages/database/src/lib/commitBranchToDb.ts +1 -1
  42. package/analyzer-template/packages/database/src/lib/commitToDb.ts +1 -1
  43. package/analyzer-template/packages/database/src/lib/fileToDb.ts +1 -1
  44. package/analyzer-template/packages/database/src/lib/kysely/db.ts +6 -0
  45. package/analyzer-template/packages/database/src/lib/kysely/tables/debugReportsTable.ts +1 -1
  46. package/analyzer-template/packages/database/src/lib/kysely/tables/labsRequestsTable.ts +52 -0
  47. package/analyzer-template/packages/database/src/lib/projectToDb.ts +1 -1
  48. package/analyzer-template/packages/database/src/lib/saveFiles.ts +1 -1
  49. package/analyzer-template/packages/database/src/lib/scenarioToDb.ts +1 -1
  50. package/analyzer-template/packages/database/src/lib/userScenarioToDb.ts +1 -1
  51. package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js +1 -1
  52. package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js.map +1 -1
  53. package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js +1 -1
  54. package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js.map +1 -1
  55. package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js +1 -1
  56. package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js.map +1 -1
  57. package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js +1 -1
  58. package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js.map +1 -1
  59. package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js +1 -1
  60. package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js.map +1 -1
  61. package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js +1 -1
  62. package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js.map +1 -1
  63. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +2 -0
  64. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts.map +1 -1
  65. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +3 -0
  66. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js.map +1 -1
  67. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts +1 -1
  68. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.d.ts +23 -0
  69. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.d.ts.map +1 -0
  70. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.js +35 -0
  71. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.js.map +1 -0
  72. package/analyzer-template/packages/github/dist/database/src/lib/projectToDb.js +1 -1
  73. package/analyzer-template/packages/github/dist/database/src/lib/projectToDb.js.map +1 -1
  74. package/analyzer-template/packages/github/dist/database/src/lib/saveFiles.js +1 -1
  75. package/analyzer-template/packages/github/dist/database/src/lib/saveFiles.js.map +1 -1
  76. package/analyzer-template/packages/github/dist/database/src/lib/scenarioToDb.js +1 -1
  77. package/analyzer-template/packages/github/dist/database/src/lib/scenarioToDb.js.map +1 -1
  78. package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts +7 -0
  79. package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
  80. package/analyzer-template/packages/types/src/types/ProjectMetadata.ts +7 -0
  81. package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts +7 -0
  82. package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
  83. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
  84. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +93 -2
  85. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  86. package/analyzer-template/packages/utils/src/lib/fs/rsyncCopy.ts +108 -2
  87. package/analyzer-template/project/constructMockCode.ts +36 -1
  88. package/analyzer-template/project/writeMockDataTsx.ts +174 -12
  89. package/analyzer-template/project/writeScenarioComponents.ts +60 -12
  90. package/analyzer-template/project/writeSimpleRoot.ts +21 -11
  91. package/background/src/lib/local/createLocalAnalyzer.js +1 -1
  92. package/background/src/lib/local/createLocalAnalyzer.js.map +1 -1
  93. package/background/src/lib/virtualized/project/constructMockCode.js +30 -1
  94. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  95. package/background/src/lib/virtualized/project/writeMockDataTsx.js +156 -8
  96. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  97. package/background/src/lib/virtualized/project/writeScenarioComponents.js +60 -15
  98. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  99. package/background/src/lib/virtualized/project/writeSimpleRoot.js +21 -11
  100. package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
  101. package/codeyam-cli/scripts/apply-setup.js +180 -0
  102. package/codeyam-cli/scripts/apply-setup.js.map +1 -1
  103. package/codeyam-cli/src/cli.js +2 -0
  104. package/codeyam-cli/src/cli.js.map +1 -1
  105. package/codeyam-cli/src/codeyam-cli.js +18 -2
  106. package/codeyam-cli/src/codeyam-cli.js.map +1 -1
  107. package/codeyam-cli/src/commands/analyze.js +4 -2
  108. package/codeyam-cli/src/commands/analyze.js.map +1 -1
  109. package/codeyam-cli/src/commands/baseline.js +2 -0
  110. package/codeyam-cli/src/commands/baseline.js.map +1 -1
  111. package/codeyam-cli/src/commands/debug.js +2 -0
  112. package/codeyam-cli/src/commands/debug.js.map +1 -1
  113. package/codeyam-cli/src/commands/default.js +31 -20
  114. package/codeyam-cli/src/commands/default.js.map +1 -1
  115. package/codeyam-cli/src/commands/detect-universal-mocks.js +2 -0
  116. package/codeyam-cli/src/commands/detect-universal-mocks.js.map +1 -1
  117. package/codeyam-cli/src/commands/init.js +49 -257
  118. package/codeyam-cli/src/commands/init.js.map +1 -1
  119. package/codeyam-cli/src/commands/memory.js +17 -26
  120. package/codeyam-cli/src/commands/memory.js.map +1 -1
  121. package/codeyam-cli/src/commands/recapture.js +2 -0
  122. package/codeyam-cli/src/commands/recapture.js.map +1 -1
  123. package/codeyam-cli/src/commands/setup-sandbox.js +2 -0
  124. package/codeyam-cli/src/commands/setup-sandbox.js.map +1 -1
  125. package/codeyam-cli/src/commands/setup-simulations.js +284 -0
  126. package/codeyam-cli/src/commands/setup-simulations.js.map +1 -0
  127. package/codeyam-cli/src/commands/test-startup.js +2 -0
  128. package/codeyam-cli/src/commands/test-startup.js.map +1 -1
  129. package/codeyam-cli/src/commands/verify.js +14 -2
  130. package/codeyam-cli/src/commands/verify.js.map +1 -1
  131. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +128 -86
  132. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
  133. package/codeyam-cli/src/utils/analyzer.js +7 -0
  134. package/codeyam-cli/src/utils/analyzer.js.map +1 -1
  135. package/codeyam-cli/src/utils/backgroundServer.js +9 -0
  136. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  137. package/codeyam-cli/src/utils/generateReport.js +2 -2
  138. package/codeyam-cli/src/utils/install-skills.js +57 -54
  139. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  140. package/codeyam-cli/src/utils/labsAutoCheck.js +19 -0
  141. package/codeyam-cli/src/utils/labsAutoCheck.js.map +1 -0
  142. package/codeyam-cli/src/utils/progress.js +7 -0
  143. package/codeyam-cli/src/utils/progress.js.map +1 -1
  144. package/codeyam-cli/src/utils/queue/job.js +4 -0
  145. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  146. package/codeyam-cli/src/utils/requireSimulations.js +10 -0
  147. package/codeyam-cli/src/utils/requireSimulations.js.map +1 -0
  148. package/codeyam-cli/src/utils/ruleReflection/__tests__/confusionDetector.test.js +82 -0
  149. package/codeyam-cli/src/utils/ruleReflection/__tests__/confusionDetector.test.js.map +1 -0
  150. package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js +230 -0
  151. package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js.map +1 -0
  152. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js +67 -0
  153. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js.map +1 -0
  154. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/captureFixture.js +105 -0
  155. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/captureFixture.js.map +1 -0
  156. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/loadCapturedFixture.js +34 -0
  157. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/loadCapturedFixture.js.map +1 -0
  158. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/runClaude.js +162 -0
  159. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/runClaude.js.map +1 -0
  160. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js +75 -0
  161. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js.map +1 -0
  162. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js +378 -0
  163. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js.map +1 -0
  164. package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js +115 -0
  165. package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js.map +1 -0
  166. package/codeyam-cli/src/utils/ruleReflection/__tests__/transcriptParser.test.js +127 -0
  167. package/codeyam-cli/src/utils/ruleReflection/__tests__/transcriptParser.test.js.map +1 -0
  168. package/codeyam-cli/src/utils/ruleReflection/confusionDetector.js +50 -0
  169. package/codeyam-cli/src/utils/ruleReflection/confusionDetector.js.map +1 -0
  170. package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js +116 -0
  171. package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js.map +1 -0
  172. package/codeyam-cli/src/utils/ruleReflection/index.js +5 -0
  173. package/codeyam-cli/src/utils/ruleReflection/index.js.map +1 -0
  174. package/codeyam-cli/src/utils/ruleReflection/promptBuilder.js +44 -0
  175. package/codeyam-cli/src/utils/ruleReflection/promptBuilder.js.map +1 -0
  176. package/codeyam-cli/src/utils/ruleReflection/transcriptParser.js +85 -0
  177. package/codeyam-cli/src/utils/ruleReflection/transcriptParser.js.map +1 -0
  178. package/codeyam-cli/src/utils/ruleReflection/types.js +5 -0
  179. package/codeyam-cli/src/utils/ruleReflection/types.js.map +1 -0
  180. package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js +293 -0
  181. package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js.map +1 -0
  182. package/codeyam-cli/src/utils/rules/index.js +1 -0
  183. package/codeyam-cli/src/utils/rules/index.js.map +1 -1
  184. package/codeyam-cli/src/utils/rules/parser.js +2 -25
  185. package/codeyam-cli/src/utils/rules/parser.js.map +1 -1
  186. package/codeyam-cli/src/utils/rules/ruleState.js +150 -0
  187. package/codeyam-cli/src/utils/rules/ruleState.js.map +1 -0
  188. package/codeyam-cli/src/utils/rules/staleness.js +16 -11
  189. package/codeyam-cli/src/utils/rules/staleness.js.map +1 -1
  190. package/codeyam-cli/src/utils/serverState.js +37 -10
  191. package/codeyam-cli/src/utils/serverState.js.map +1 -1
  192. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +21 -44
  193. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
  194. package/codeyam-cli/src/webserver/app/lib/database.js +15 -3
  195. package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
  196. package/codeyam-cli/src/webserver/backgroundServer.js +24 -0
  197. package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
  198. package/codeyam-cli/src/webserver/build/client/assets/CopyButton-CQ-wF3Tv.js +1 -0
  199. package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-DsN1wKrm.js → EntityItem-HdckCi0m.js} +1 -1
  200. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-DLqD3qNt.js → EntityTypeBadge-Dh5RJMOE.js} +1 -1
  201. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-Ba2JVPzP.js → EntityTypeIcon-BnjjBHJu.js} +1 -1
  202. package/codeyam-cli/src/webserver/build/client/assets/{InlineSpinner-C8lyxW9k.js → InlineSpinner-CUSfu6W5.js} +1 -1
  203. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-aht4aafF.js → InteractivePreview-Coll1aD6.js} +2 -2
  204. package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-CVtiBnY5.js → LibraryFunctionPreview-lYMY8h-y.js} +1 -1
  205. package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-B0GLXMsr.js → LoadingDots-ay8XeA59.js} +1 -1
  206. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-xgeCVgSM.js → LogViewer-Dpul1_ik.js} +1 -1
  207. package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-OApQuNyq.js → ReportIssueModal-CRBCfV2W.js} +3 -8
  208. package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-DuDvi0jm.js → SafeScreenshot-DRTFDNFt.js} +1 -1
  209. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-DzccYyI8.js → ScenarioViewer-d6PSFxhS.js} +2 -2
  210. package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-DyFZkK0l.js → TruncatedFilePath-DDEOQ6Iw.js} +1 -1
  211. package/codeyam-cli/src/webserver/build/client/assets/{_index-BwqWJOgH.js → _index-CkziGg5F.js} +1 -1
  212. package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BwavGCpm.js → activity.(_tab)-B2v1pm9w.js} +6 -11
  213. package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-BXIaK8Md.js +11 -0
  214. package/codeyam-cli/src/webserver/build/client/assets/api.agent-transcripts-l0sNRNKZ.js +1 -0
  215. package/codeyam-cli/src/webserver/build/client/assets/api.labs-unlock-l0sNRNKZ.js +1 -0
  216. package/codeyam-cli/src/webserver/build/client/assets/api.save-fixture-l0sNRNKZ.js +1 -0
  217. package/codeyam-cli/src/webserver/build/client/assets/book-open-qbapxy6o.js +6 -0
  218. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-Cx24_aWc.js → chevron-down-C-mKrwr1.js} +1 -1
  219. package/codeyam-cli/src/webserver/build/client/assets/{chunk-EPOLDU6W-CXRTFQ3F.js → chunk-JZWAC4HX-BAvUl1nT.js} +12 -12
  220. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-BOARzkeR.js → circle-check-DlrT-SzI.js} +1 -1
  221. package/codeyam-cli/src/webserver/build/client/assets/copy-clIxnCqQ.js +11 -0
  222. package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-BdhJEx6B.js → createLucideIcon-B931Etud.js} +1 -1
  223. package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-BBnGWYga.js → dev.empty-BoPM6KnE.js} +1 -1
  224. package/codeyam-cli/src/webserver/build/client/assets/entity._sha._-oVRMh9Hl.js +16 -0
  225. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-DavjRmOY.js → entity._sha.scenarios._scenarioId.fullscreen-BjyzwQ7H.js} +1 -1
  226. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-D1T4TGjf.js → entity._sha_.create-scenario-DxuyDmZA.js} +1 -1
  227. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-CTBG2mmz.js → entity._sha_.edit._scenarioId-DESSZGQp.js} +1 -1
  228. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-CS2cb_eZ.js → entry.client-D5Yb90Ad.js} +1 -1
  229. package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-DMJ7zii9.js → fileTableUtils-DuObVYgh.js} +1 -1
  230. package/codeyam-cli/src/webserver/build/client/assets/{files-CJ6lTdTA.js → files-CDfz4Y-i.js} +1 -1
  231. package/codeyam-cli/src/webserver/build/client/assets/{git-CPTZZ-JZ.js → git-D6jOlDQw.js} +1 -1
  232. package/codeyam-cli/src/webserver/build/client/assets/globals-CKT08Djd.css +1 -0
  233. package/codeyam-cli/src/webserver/build/client/assets/{index-B1h680n5.js → index-DvOt1KIt.js} +1 -1
  234. package/codeyam-cli/src/webserver/build/client/assets/{index-lzqtyFU8.js → index-WfQFdoWK.js} +1 -1
  235. package/codeyam-cli/src/webserver/build/client/assets/labs-BbGyC1RY.js +1 -0
  236. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-B7B9V-bu.js → loader-circle-Bb7Y9k5O.js} +1 -1
  237. package/codeyam-cli/src/webserver/build/client/assets/manifest-fd06e67a.js +1 -0
  238. package/codeyam-cli/src/webserver/build/client/assets/memory-BXebUPaL.js +78 -0
  239. package/codeyam-cli/src/webserver/build/client/assets/pause-DaAHX2on.js +11 -0
  240. package/codeyam-cli/src/webserver/build/client/assets/root-CvNE9MaT.js +62 -0
  241. package/codeyam-cli/src/webserver/build/client/assets/{search-CxXUmBSd.js → search-DIqAPIrO.js} +1 -1
  242. package/codeyam-cli/src/webserver/build/client/assets/settings-DCIzBZM9.js +1 -0
  243. package/codeyam-cli/src/webserver/build/client/assets/{simulations-DwFIBT09.js → simulations-C6n_fNQY.js} +1 -1
  244. package/codeyam-cli/src/webserver/build/client/assets/terminal-CmPsszJy.js +11 -0
  245. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-B6LgvRJg.js → triangle-alert-Beg-oV50.js} +1 -1
  246. package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-C1v1PQzo.js → useCustomSizes-D7TLbP3M.js} +1 -1
  247. package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-aSv48UbS.js → useLastLogLine-Ce5rnai3.js} +1 -1
  248. package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-DYxHZQuP.js → useReportContext-B4D3wj27.js} +1 -1
  249. package/codeyam-cli/src/webserver/build/client/assets/{useToast-mBRpZPiu.js → useToast-BDt_-DnY.js} +1 -1
  250. package/codeyam-cli/src/webserver/build/server/assets/{index-BM6TDT1Y.js → index-DDr9Cp9M.js} +1 -1
  251. package/codeyam-cli/src/webserver/build/server/assets/server-build-DjwiujaU.js +257 -0
  252. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  253. package/codeyam-cli/src/webserver/build-info.json +5 -5
  254. package/codeyam-cli/templates/{codeyam:debug.md → codeyam-debug.md} +1 -1
  255. package/codeyam-cli/templates/codeyam-diagnose.md +481 -0
  256. package/codeyam-cli/templates/codeyam-memory-hook.sh +19 -20
  257. package/codeyam-cli/templates/codeyam-memory.md +392 -0
  258. package/codeyam-cli/templates/{codeyam:new-rule.md → codeyam-new-rule.md} +2 -2
  259. package/codeyam-cli/templates/{codeyam:setup.md → codeyam-setup.md} +13 -1
  260. package/codeyam-cli/templates/{codeyam:sim.md → codeyam-sim.md} +1 -1
  261. package/codeyam-cli/templates/{codeyam:test.md → codeyam-test.md} +1 -1
  262. package/codeyam-cli/templates/{codeyam:verify.md → codeyam-verify.md} +1 -1
  263. package/codeyam-cli/templates/rule-notification-hook.py +56 -0
  264. package/codeyam-cli/templates/rule-reflection-hook.py +554 -87
  265. package/codeyam-cli/templates/rules-instructions.md +63 -24
  266. package/package.json +10 -10
  267. package/packages/ai/index.js +1 -1
  268. package/packages/ai/index.js.map +1 -1
  269. package/packages/ai/src/lib/analyzeScope.js +21 -1
  270. package/packages/ai/src/lib/analyzeScope.js.map +1 -1
  271. package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js +10 -14
  272. package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js.map +1 -1
  273. package/packages/ai/src/lib/astScopes/processExpression.js +78 -1
  274. package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
  275. package/packages/ai/src/lib/astScopes/sharedPatterns.js +25 -0
  276. package/packages/ai/src/lib/astScopes/sharedPatterns.js.map +1 -1
  277. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +262 -8
  278. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  279. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js +5 -1
  280. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js.map +1 -1
  281. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +11 -2
  282. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
  283. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +2 -2
  284. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
  285. package/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.js +63 -0
  286. package/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.js.map +1 -0
  287. package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js +122 -12
  288. package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js.map +1 -1
  289. package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js +15 -1
  290. package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js.map +1 -1
  291. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +78 -17
  292. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
  293. package/packages/ai/src/lib/dataStructureChunking.js +26 -11
  294. package/packages/ai/src/lib/dataStructureChunking.js.map +1 -1
  295. package/packages/ai/src/lib/generateEntityDataStructure.js +46 -2
  296. package/packages/ai/src/lib/generateEntityDataStructure.js.map +1 -1
  297. package/packages/ai/src/lib/generateEntityScenarioData.js +212 -3
  298. package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
  299. package/packages/ai/src/lib/generateExecutionFlows.js +16 -2
  300. package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
  301. package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +242 -81
  302. package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -1
  303. package/packages/ai/src/lib/isolateScopes.js +39 -3
  304. package/packages/ai/src/lib/isolateScopes.js.map +1 -1
  305. package/packages/ai/src/lib/mergeJsonTypeDefinitions.js +5 -0
  306. package/packages/ai/src/lib/mergeJsonTypeDefinitions.js.map +1 -1
  307. package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js +97 -0
  308. package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js.map +1 -0
  309. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +17 -2
  310. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
  311. package/packages/analyze/index.js +1 -0
  312. package/packages/analyze/index.js.map +1 -1
  313. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +52 -2
  314. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
  315. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +3 -0
  316. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
  317. package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js +880 -0
  318. package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js.map +1 -0
  319. package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +5 -1
  320. package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -1
  321. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +51 -14
  322. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
  323. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +116 -13
  324. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  325. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +310 -45
  326. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
  327. package/packages/analyze/src/lib/index.js +1 -0
  328. package/packages/analyze/src/lib/index.js.map +1 -1
  329. package/packages/database/src/lib/analysisBranchToDb.js +1 -1
  330. package/packages/database/src/lib/analysisBranchToDb.js.map +1 -1
  331. package/packages/database/src/lib/analysisToDb.js +1 -1
  332. package/packages/database/src/lib/analysisToDb.js.map +1 -1
  333. package/packages/database/src/lib/branchToDb.js +1 -1
  334. package/packages/database/src/lib/branchToDb.js.map +1 -1
  335. package/packages/database/src/lib/commitBranchToDb.js +1 -1
  336. package/packages/database/src/lib/commitBranchToDb.js.map +1 -1
  337. package/packages/database/src/lib/commitToDb.js +1 -1
  338. package/packages/database/src/lib/commitToDb.js.map +1 -1
  339. package/packages/database/src/lib/fileToDb.js +1 -1
  340. package/packages/database/src/lib/fileToDb.js.map +1 -1
  341. package/packages/database/src/lib/kysely/db.js +3 -0
  342. package/packages/database/src/lib/kysely/db.js.map +1 -1
  343. package/packages/database/src/lib/kysely/tables/labsRequestsTable.js +35 -0
  344. package/packages/database/src/lib/kysely/tables/labsRequestsTable.js.map +1 -0
  345. package/packages/database/src/lib/projectToDb.js +1 -1
  346. package/packages/database/src/lib/projectToDb.js.map +1 -1
  347. package/packages/database/src/lib/saveFiles.js +1 -1
  348. package/packages/database/src/lib/saveFiles.js.map +1 -1
  349. package/packages/database/src/lib/scenarioToDb.js +1 -1
  350. package/packages/database/src/lib/scenarioToDb.js.map +1 -1
  351. package/packages/utils/src/lib/fs/rsyncCopy.js +93 -2
  352. package/packages/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  353. package/scripts/finalize-analyzer.cjs +8 -76
  354. package/codeyam-cli/src/webserver/build/client/assets/copy-Bb-80kDT.js +0 -6
  355. package/codeyam-cli/src/webserver/build/client/assets/entity._sha._-BJUiQqZF.js +0 -23
  356. package/codeyam-cli/src/webserver/build/client/assets/file-code-Dhef1kWN.js +0 -6
  357. package/codeyam-cli/src/webserver/build/client/assets/globals-D3yhhV8x.css +0 -1
  358. package/codeyam-cli/src/webserver/build/client/assets/manifest-a78b90a2.js +0 -1
  359. package/codeyam-cli/src/webserver/build/client/assets/memory--GCbFsBE.js +0 -92
  360. package/codeyam-cli/src/webserver/build/client/assets/root-eVAaavTS.js +0 -62
  361. package/codeyam-cli/src/webserver/build/client/assets/settings-CS5f3WzT.js +0 -1
  362. package/codeyam-cli/src/webserver/build/server/assets/server-build-dYC34MHw.js +0 -257
  363. package/codeyam-cli/templates/codeyam:diagnose.md +0 -803
  364. package/codeyam-cli/templates/codeyam:memory.md +0 -341
@@ -1,10 +1,10 @@
1
1
  {
2
- "buildTimestamp": "2026-02-03T16:02:42.155Z",
3
- "buildTime": 1770134562155,
4
- "gitCommit": "2a889201e1cd93b82aab6744032951d45114bbb4",
2
+ "buildTimestamp": "2026-02-13T12:46:15.997Z",
3
+ "buildTime": 1770986775997,
4
+ "gitCommit": "4684848f0720e8d6673ec5479d17c6a1d40ce733",
5
5
  "nodeVersion": "v20.20.0",
6
- "contentHash": "7fe877ecfbb0322305ef8daccd364fe4275c2fb3c60d2436353f83025a750441",
7
- "buildNumber": 559,
8
- "semanticVersion": "0.1.559",
9
- "version": "0.1.559 (2026-02-03T16:02+7fe877e)"
6
+ "contentHash": "4e94e73e9be6ff27f80a8345110fe1d31d9863861a8966e4b17887ad7c6eff67",
7
+ "buildNumber": 619,
8
+ "semanticVersion": "0.1.619",
9
+ "version": "0.1.619 (2026-02-13T12:46+4e94e73)"
10
10
  }
@@ -1,7 +1,7 @@
1
1
 
2
- [2/3/2026, 4:02:42 PM] > codeyam-combo@1.0.0 mergeDependencies
3
- [2/3/2026, 4:02:42 PM] > node ./scripts/mergePackageJsonFiles.cjs
2
+ [2/13/2026, 12:46:15 PM] > codeyam-combo@1.0.0 mergeDependencies
3
+ [2/13/2026, 12:46:15 PM] > node ./scripts/mergePackageJsonFiles.cjs
4
4
 
5
5
 
6
- [2/3/2026, 4:02:42 PM] Merged dependencies into root package.json
6
+ [2/13/2026, 12:46:15 PM] Merged dependencies into root package.json
7
7
 
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@aws-sdk/client-cloudwatch-logs": "^3.980.0",
11
- "@aws-sdk/client-cloudfront": "^3.966.0",
11
+ "@aws-sdk/client-cloudfront": "^3.985.0",
12
12
  "@aws-sdk/client-codebuild": "^3.948.0",
13
13
  "@aws-sdk/client-dynamodb": "^3.956.0",
14
14
  "@aws-sdk/client-ec2": "^3.899.0",
@@ -30,7 +30,7 @@
30
30
  "jest": "^30.2.0",
31
31
  "jsdom": "^27.4.0",
32
32
  "jsonc-parser": "^3.2.1",
33
- "lru-cache": "^11.2.4",
33
+ "lru-cache": "^11.2.5",
34
34
  "openai": "^6.16.0",
35
35
  "p-queue": "^8.1.0",
36
36
  "p-retry": "^7.1.1",
@@ -44,11 +44,11 @@
44
44
  "pluralize": "^8.0.0",
45
45
  "yargs": "^18.0.0",
46
46
  "json5": "^2.2.3",
47
- "@anthropic-ai/sdk": "^0.71.0",
47
+ "@anthropic-ai/sdk": "^0.74.0",
48
48
  "@aws-sdk/s3-request-presigner": "^3.940.0",
49
49
  "better-sqlite3": "^12.4.1",
50
50
  "fetch-retry": "^6.0.0",
51
- "kysely": "^0.28.5",
51
+ "kysely": "^0.28.11",
52
52
  "pg": "^8.16.3",
53
53
  "@octokit/request": "^10.0.3",
54
54
  "lucide-react": "^0.556.0",
@@ -43,6 +43,7 @@ export { default as isolateScopes } from './src/lib/isolateScopes';
43
43
  export {
44
44
  default as analyzeScope,
45
45
  destroyWorkerPool,
46
+ skipWorkerPool,
46
47
  } from './src/lib/analyzeScope';
47
48
  export { default as logOrderedMap } from './src/lib/logOrderedMap';
48
49
  export {
@@ -9,12 +9,12 @@
9
9
  "author": "",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
- "@anthropic-ai/sdk": "^0.71.0",
12
+ "@anthropic-ai/sdk": "^0.74.0",
13
13
  "jsdom": "^27.4.0",
14
14
  "p-queue": "^8.1.0",
15
15
  "p-retry": "^7.1.1",
16
16
  "piscina": "^5.1.4",
17
- "lru-cache": "^11.2.4"
17
+ "lru-cache": "^11.2.5"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@types/jsdom": "^27.0.0"
@@ -50,6 +50,19 @@ let workerPool: Piscina<
50
50
  AnalyzeScopeWorkerOutput
51
51
  > | null = null;
52
52
  let workerPoolDestroyed = false;
53
+ let workerPoolSkipped = false;
54
+
55
+ /**
56
+ * Skip worker pool initialization for the current session.
57
+ *
58
+ * The worker thread creates its own ProjectAnalyzer (ts.Program), which takes
59
+ * 50-70s — far longer than the actual entity processing (<2s for typical batches).
60
+ * When the entity count is small, running analyzeScopeLocal on the main thread
61
+ * reuses the existing ProjectAnalyzer and avoids this overhead entirely.
62
+ */
63
+ export function skipWorkerPool() {
64
+ workerPoolSkipped = true;
65
+ }
53
66
 
54
67
  /**
55
68
  * Check if we're in Node.js main thread
@@ -108,6 +121,7 @@ function ensureWorkerPool() {
108
121
  'analyzeScope should not be called after data structure preparation completes.',
109
122
  );
110
123
  }
124
+ if (workerPoolSkipped) return;
111
125
  if (workerPool !== null) return;
112
126
 
113
127
  // Only initialize worker pool in Node.js environment
@@ -123,10 +137,17 @@ function ensureWorkerPool() {
123
137
  // Note: WORKER_PATH is null when __mocks__/analyzeScope.ts is active
124
138
  const { WORKER_PATH } = analyzeScopeWorkerPaths();
125
139
 
140
+ // Disable workers when tracing is enabled - we need access to ScopeDataStructure
141
+ // instance in the main thread to capture pre-serialization state
142
+ const tracingEnabled =
143
+ process.env.CODEYAM_TRACE_TRANSFORMS === '1' ||
144
+ process.env.CODEYAM_TRACE_TRANSFORMS === 'true';
145
+
126
146
  if (
127
147
  process.env.USE_WORKER_THREADS &&
128
148
  WORKER_PATH &&
129
- fs.existsSync(WORKER_PATH)
149
+ fs.existsSync(WORKER_PATH) &&
150
+ !tracingEnabled
130
151
  ) {
131
152
  console.log('CodeYam: Using worker threads for analyzeScope', {
132
153
  WORKER_PATH,
@@ -159,6 +180,7 @@ function ensureWorkerPool() {
159
180
  WORKER_PATH,
160
181
  workerExists: WORKER_PATH ? fs.existsSync(WORKER_PATH) : false,
161
182
  USE_WORKER_THREADS: process.env.USE_WORKER_THREADS,
183
+ tracingEnabled,
162
184
  });
163
185
  workerPool = null; // Explicitly set to indicate "no workers"
164
186
  }
@@ -22,11 +22,8 @@ export class ForInStatementHandler implements PatternHandler {
22
22
  // Process the expression being iterated over first (e.g., object)
23
23
  context.processExpression(node.expression);
24
24
 
25
- // Get the path of the object being iterated
26
- const expressionPath = context.getStructuralPath(node.expression);
27
-
28
- // If the initializer is a variable declaration with an identifier, establish equivalence
29
- // to indicate it's iterating over the keys of the expression
25
+ // If the initializer is a variable declaration with an identifier,
26
+ // type it as 'string' since for-in keys are always strings
30
27
  if (ts.isVariableDeclarationList(node.initializer)) {
31
28
  const declarations = node.initializer.declarations;
32
29
  if (
@@ -36,25 +33,21 @@ export class ForInStatementHandler implements PatternHandler {
36
33
  ) {
37
34
  const variableName = StructuredPath.fromBase(declarations[0].name.text);
38
35
 
39
- // Add type for the key variable (string for object keys)
36
+ // Type the key variable as 'string' for-in keys are always strings.
37
+ // Note: We intentionally do NOT equivalence the key variable to
38
+ // expressionPath[*key*]. The key variable is the KEY (a string),
39
+ // while [*key*] in the schema represents the VALUE at a dynamic key.
40
+ // Creating that equivalence would cause the 'string' type to propagate
41
+ // to the value path. The value access (e.g., obj[key]) is handled
42
+ // correctly by the element access handler in processExpression.
40
43
  context.addType(variableName, 'string');
41
-
42
- if (expressionPath) {
43
- // For for...in loops, the variable is equivalent to the keys of the object
44
- // We represent this with a *key* suffix to indicate it's a key, not a value
45
- context.addEquivalence(variableName, expressionPath.withKey('key'));
46
- }
47
44
  }
48
45
  } else if (ts.isIdentifier(node.initializer)) {
49
46
  // If the initializer is directly an identifier (rare but possible)
50
47
  const variableName = StructuredPath.fromBase(node.initializer.text);
51
48
 
52
- // Add type for the key variable
49
+ // See comment above — type as string but don't equivalence to value path
53
50
  context.addType(variableName, 'string');
54
-
55
- if (expressionPath) {
56
- context.addEquivalence(variableName, expressionPath.withKey('key'));
57
- }
58
51
  } else {
59
52
  context.processExpression(node.initializer);
60
53
  }
@@ -9,6 +9,7 @@ import { StructuredPath } from './paths';
9
9
  import { nodeToSource } from './nodeToSource';
10
10
  import { methodRegistry, ArrayPushSemantics } from './methodSemantics';
11
11
  import {
12
+ getComparisonOperatorString,
12
13
  isArithmeticOperator,
13
14
  isAssignmentOperator,
14
15
  isBitwiseCompoundOperator,
@@ -25,6 +26,74 @@ import {
25
26
  } from './conditionalEffectsExtractor';
26
27
  import { detectArrayDerivedPattern } from './arrayDerivationDetector';
27
28
 
29
+ /**
30
+ * Recursively extracts root variable names from an expression AST node.
31
+ * Used to identify which variables flow into JSX expression children,
32
+ * so we can link them to the return value schema.
33
+ *
34
+ * Examples:
35
+ * - `filteredTopPaths.map(...)` → ['filteredTopPaths']
36
+ * - `a && b` → ['a', 'b']
37
+ * - `condition ? x : y` → ['condition', 'x', 'y']
38
+ */
39
+ function extractRootVariableNames(node: ts.Expression): string[] {
40
+ const ignoredIdentifiers = new Set([
41
+ 'undefined',
42
+ 'null',
43
+ 'true',
44
+ 'false',
45
+ 'NaN',
46
+ 'Infinity',
47
+ ]);
48
+
49
+ if (ts.isIdentifier(node)) {
50
+ const name = node.text;
51
+ return ignoredIdentifiers.has(name) ? [] : [name];
52
+ }
53
+
54
+ if (ts.isPropertyAccessExpression(node)) {
55
+ return extractRootVariableNames(node.expression);
56
+ }
57
+
58
+ if (ts.isCallExpression(node)) {
59
+ return extractRootVariableNames(node.expression);
60
+ }
61
+
62
+ if (ts.isBinaryExpression(node)) {
63
+ return [
64
+ ...extractRootVariableNames(node.left),
65
+ ...extractRootVariableNames(node.right),
66
+ ];
67
+ }
68
+
69
+ if (ts.isPrefixUnaryExpression(node)) {
70
+ return extractRootVariableNames(node.operand);
71
+ }
72
+
73
+ if (ts.isConditionalExpression(node)) {
74
+ return [
75
+ ...extractRootVariableNames(node.condition),
76
+ ...extractRootVariableNames(node.whenTrue),
77
+ ...extractRootVariableNames(node.whenFalse),
78
+ ];
79
+ }
80
+
81
+ if (ts.isParenthesizedExpression(node)) {
82
+ return extractRootVariableNames(node.expression);
83
+ }
84
+
85
+ // Stop recursion at JSX elements and other terminal nodes
86
+ if (
87
+ ts.isJsxElement(node) ||
88
+ ts.isJsxFragment(node) ||
89
+ ts.isJsxSelfClosingElement(node)
90
+ ) {
91
+ return [];
92
+ }
93
+
94
+ return [];
95
+ }
96
+
28
97
  /**
29
98
  * Checks if a JSX element has props that reference variables from the parent scope.
30
99
  * This is used to detect unconditionally-rendered children that should have their
@@ -1294,6 +1363,11 @@ export function extractConditionalUsage(
1294
1363
  return literalValue;
1295
1364
  };
1296
1365
 
1366
+ // Get the comparison operator string for the compound condition
1367
+ const comparisonOperator = getComparisonOperatorString(
1368
+ unwrapped.operatorToken.kind,
1369
+ );
1370
+
1297
1371
  // Helper to add a condition
1298
1372
  const addCondition = (
1299
1373
  path: string,
@@ -1338,6 +1412,7 @@ export function extractConditionalUsage(
1338
1412
  comparedValues,
1339
1413
  isNegated,
1340
1414
  requiredValue,
1415
+ ...(comparisonOperator && { comparisonOperator }),
1341
1416
  ...(chainInfo.currentOrGroupId && {
1342
1417
  orGroupId: chainInfo.currentOrGroupId,
1343
1418
  }),
@@ -3334,6 +3409,19 @@ export function processExpression({
3334
3409
  for (const child of unwrappedNode.children) {
3335
3410
  // Process expressions in JSX children: <div>{expr}</div>
3336
3411
  if (ts.isJsxExpression(child) && child.expression) {
3412
+ // When processing return value JSX, link root variables to return value schema
3413
+ if (targetPath && targetPath.base !== '') {
3414
+ const varNames = [
3415
+ ...new Set(extractRootVariableNames(child.expression)),
3416
+ ];
3417
+ for (const varName of varNames) {
3418
+ context.addEquivalence(
3419
+ targetPath.withProperty(varName),
3420
+ StructuredPath.fromBase(varName),
3421
+ );
3422
+ }
3423
+ }
3424
+
3337
3425
  // Process the expression with StructuredPath.empty() as targetPath
3338
3426
  // to trigger type registration without imposing prefix
3339
3427
  processExpression({
@@ -3368,6 +3456,19 @@ export function processExpression({
3368
3456
  for (const child of unwrappedNode.children) {
3369
3457
  // Process expressions in JSX children: <>{expr}</>
3370
3458
  if (ts.isJsxExpression(child) && child.expression) {
3459
+ // When processing return value JSX, link root variables to return value schema
3460
+ if (targetPath && targetPath.base !== '') {
3461
+ const varNames = [
3462
+ ...new Set(extractRootVariableNames(child.expression)),
3463
+ ];
3464
+ for (const varName of varNames) {
3465
+ context.addEquivalence(
3466
+ targetPath.withProperty(varName),
3467
+ StructuredPath.fromBase(varName),
3468
+ );
3469
+ }
3470
+ }
3471
+
3371
3472
  // Process the expression to extract structure
3372
3473
  processExpression({
3373
3474
  node: child.expression,
@@ -71,6 +71,34 @@ export function isComparisonOperator(kind: ts.SyntaxKind): boolean {
71
71
  );
72
72
  }
73
73
 
74
+ /**
75
+ * Returns the string representation of a comparison operator token.
76
+ */
77
+ export function getComparisonOperatorString(
78
+ kind: ts.SyntaxKind,
79
+ ): string | undefined {
80
+ switch (kind) {
81
+ case ts.SyntaxKind.EqualsEqualsToken:
82
+ return '==';
83
+ case ts.SyntaxKind.EqualsEqualsEqualsToken:
84
+ return '===';
85
+ case ts.SyntaxKind.ExclamationEqualsToken:
86
+ return '!=';
87
+ case ts.SyntaxKind.ExclamationEqualsEqualsToken:
88
+ return '!==';
89
+ case ts.SyntaxKind.LessThanToken:
90
+ return '<';
91
+ case ts.SyntaxKind.LessThanEqualsToken:
92
+ return '<=';
93
+ case ts.SyntaxKind.GreaterThanToken:
94
+ return '>';
95
+ case ts.SyntaxKind.GreaterThanEqualsToken:
96
+ return '>=';
97
+ default:
98
+ return undefined;
99
+ }
100
+ }
101
+
74
102
  /**
75
103
  * Checks if an operator is an arithmetic operator
76
104
  */
@@ -433,6 +433,12 @@ export interface CompoundConditional {
433
433
  isNegated: boolean;
434
434
  /** Required value for this condition to be true */
435
435
  requiredValue?: string | boolean;
436
+ /**
437
+ * The comparison operator used (e.g., '>', '<', '>=', '<=', '===', '!==').
438
+ * Preserves the original operator so flow generation can distinguish
439
+ * `length > 0` from `length === 0`.
440
+ */
441
+ comparisonOperator?: string;
436
442
  /**
437
443
  * When conditions are part of an OR expression within an && chain,
438
444
  * they share the same orGroupId. Conditions with the same orGroupId