@codeyam/codeyam-cli 0.1.0-staging.1669d45 → 0.1.0-staging.2a88920

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 (437) 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 +5 -5
  4. package/analyzer-template/packages/ai/index.ts +15 -2
  5. package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +87 -51
  6. package/analyzer-template/packages/ai/src/lib/astScopes/arrayDerivationDetector.ts +199 -0
  7. package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +98 -9
  8. package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +139 -23
  9. package/analyzer-template/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.ts +6 -126
  10. package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +555 -28
  11. package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +88 -7
  12. package/analyzer-template/packages/ai/src/lib/completionCall.ts +198 -34
  13. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +772 -243
  14. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.ts +205 -0
  15. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +10 -2
  16. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.ts +16 -3
  17. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.ts +6 -4
  18. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +43 -1
  19. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +122 -15
  20. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.ts +160 -0
  21. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.ts +40 -30
  22. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +319 -88
  23. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.ts +129 -0
  24. package/analyzer-template/packages/ai/src/lib/dataStructureChunking.ts +156 -0
  25. package/analyzer-template/packages/ai/src/lib/e2eDataTracking.ts +334 -0
  26. package/analyzer-template/packages/ai/src/lib/extractCriticalDataKeys.ts +120 -0
  27. package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +642 -7
  28. package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +35 -6
  29. package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +383 -6
  30. package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.ts +1 -1
  31. package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +1299 -51
  32. package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.ts +239 -0
  33. package/analyzer-template/packages/ai/src/lib/mergeStatements.ts +90 -96
  34. package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +10 -7
  35. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChunkPrompt.ts +82 -0
  36. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateCriticalKeysPrompt.ts +103 -0
  37. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +23 -6
  38. package/analyzer-template/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.ts +391 -0
  39. package/analyzer-template/packages/ai/src/lib/resolvePathToControllable.ts +179 -45
  40. package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +26 -4
  41. package/analyzer-template/packages/ai/src/lib/worker/analyzeScopeWorker.ts +114 -2
  42. package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +65 -59
  43. package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +113 -26
  44. package/analyzer-template/packages/analyze/src/lib/analysisContext.ts +44 -4
  45. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.ts +19 -0
  46. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.ts +19 -0
  47. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllExports.ts +11 -0
  48. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.ts +8 -0
  49. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.ts +49 -1
  50. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.ts +2 -1
  51. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +30 -19
  52. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +14 -4
  53. package/analyzer-template/packages/analyze/src/lib/files/analyze/dependencyResolver.ts +6 -0
  54. package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +4 -2
  55. package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +33 -10
  56. package/analyzer-template/packages/analyze/src/lib/files/analyzeRemixRoute.ts +4 -5
  57. package/analyzer-template/packages/analyze/src/lib/files/getImportedExports.ts +14 -12
  58. package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +189 -76
  59. package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +29 -0
  60. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +77 -9
  61. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +118 -10
  62. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +276 -17
  63. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.ts +56 -11
  64. package/analyzer-template/packages/analyze/src/lib/files/scenarios/propagateArrayItemSchemas.ts +474 -0
  65. package/analyzer-template/packages/analyze/src/lib/files/setImportedExports.ts +2 -1
  66. package/analyzer-template/packages/analyze/src/lib/utils/getFileByPath.ts +19 -0
  67. package/analyzer-template/packages/aws/package.json +2 -2
  68. package/analyzer-template/packages/database/src/lib/kysely/db.ts +8 -1
  69. package/analyzer-template/packages/database/src/lib/kysely/tables/commitsTable.ts +6 -0
  70. package/analyzer-template/packages/database/src/lib/loadAnalyses.ts +58 -1
  71. package/analyzer-template/packages/database/src/lib/loadAnalysis.ts +13 -0
  72. package/analyzer-template/packages/database/src/lib/loadBranch.ts +16 -1
  73. package/analyzer-template/packages/database/src/lib/loadCommit.ts +11 -0
  74. package/analyzer-template/packages/database/src/lib/loadCommits.ts +28 -0
  75. package/analyzer-template/packages/database/src/lib/loadEntities.ts +26 -3
  76. package/analyzer-template/packages/database/src/lib/loadEntityBranches.ts +12 -0
  77. package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +7 -14
  78. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts.map +1 -1
  79. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +8 -1
  80. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js.map +1 -1
  81. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/analysesTable.d.ts.map +1 -1
  82. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.d.ts +1 -0
  83. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.d.ts.map +1 -1
  84. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.js +3 -0
  85. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.js.map +1 -1
  86. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.d.ts +2 -0
  87. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.d.ts.map +1 -1
  88. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.js +45 -2
  89. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.js.map +1 -1
  90. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.d.ts.map +1 -1
  91. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js +8 -0
  92. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js.map +1 -1
  93. package/analyzer-template/packages/github/dist/database/src/lib/loadBranch.js +11 -1
  94. package/analyzer-template/packages/github/dist/database/src/lib/loadBranch.js.map +1 -1
  95. package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.d.ts.map +1 -1
  96. package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.js +7 -0
  97. package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.js.map +1 -1
  98. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts +3 -1
  99. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts.map +1 -1
  100. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js +22 -1
  101. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js.map +1 -1
  102. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts +3 -1
  103. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts.map +1 -1
  104. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js +23 -4
  105. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js.map +1 -1
  106. package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.d.ts.map +1 -1
  107. package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.js +9 -0
  108. package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.js.map +1 -1
  109. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts +2 -2
  110. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
  111. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +5 -4
  112. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
  113. package/analyzer-template/packages/github/dist/types/index.d.ts +1 -1
  114. package/analyzer-template/packages/github/dist/types/index.d.ts.map +1 -1
  115. package/analyzer-template/packages/github/dist/types/index.js.map +1 -1
  116. package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts +25 -1
  117. package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts.map +1 -1
  118. package/analyzer-template/packages/github/dist/types/src/types/Commit.d.ts +2 -0
  119. package/analyzer-template/packages/github/dist/types/src/types/Commit.d.ts.map +1 -1
  120. package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts +56 -6
  121. package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
  122. package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
  123. package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts.map +1 -1
  124. package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.d.ts +9 -1
  125. package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.d.ts.map +1 -1
  126. package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.js +29 -3
  127. package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.js.map +1 -1
  128. package/analyzer-template/packages/github/package.json +1 -1
  129. package/analyzer-template/packages/types/index.ts +1 -0
  130. package/analyzer-template/packages/types/src/types/Analysis.ts +25 -0
  131. package/analyzer-template/packages/types/src/types/Commit.ts +2 -0
  132. package/analyzer-template/packages/types/src/types/ScenariosDataStructure.ts +70 -6
  133. package/analyzer-template/packages/types/src/types/ScopeAnalysis.ts +6 -1
  134. package/analyzer-template/packages/utils/dist/types/index.d.ts +1 -1
  135. package/analyzer-template/packages/utils/dist/types/index.d.ts.map +1 -1
  136. package/analyzer-template/packages/utils/dist/types/index.js.map +1 -1
  137. package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts +25 -1
  138. package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts.map +1 -1
  139. package/analyzer-template/packages/utils/dist/types/src/types/Commit.d.ts +2 -0
  140. package/analyzer-template/packages/utils/dist/types/src/types/Commit.d.ts.map +1 -1
  141. package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts +56 -6
  142. package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
  143. package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
  144. package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts.map +1 -1
  145. package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.d.ts +9 -1
  146. package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.d.ts.map +1 -1
  147. package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.js +29 -3
  148. package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.js.map +1 -1
  149. package/analyzer-template/packages/utils/src/lib/safeFileName.ts +48 -3
  150. package/analyzer-template/playwright/capture.ts +20 -8
  151. package/analyzer-template/playwright/captureStatic.ts +1 -1
  152. package/analyzer-template/project/analyzeBaselineCommit.ts +5 -0
  153. package/analyzer-template/project/analyzeRegularCommit.ts +5 -0
  154. package/analyzer-template/project/captureLibraryFunctionDirect.ts +29 -26
  155. package/analyzer-template/project/constructMockCode.ts +367 -37
  156. package/analyzer-template/project/createEntitiesAndSortFiles.ts +83 -0
  157. package/analyzer-template/project/loadReadyToBeCaptured.ts +65 -41
  158. package/analyzer-template/project/orchestrateCapture/AwsCaptureTaskRunner.ts +12 -4
  159. package/analyzer-template/project/orchestrateCapture/SequentialCaptureTaskRunner.ts +18 -7
  160. package/analyzer-template/project/orchestrateCapture/taskRunner.ts +4 -2
  161. package/analyzer-template/project/orchestrateCapture.ts +71 -6
  162. package/analyzer-template/project/reconcileMockDataKeys.ts +152 -9
  163. package/analyzer-template/project/runAnalysis.ts +4 -0
  164. package/analyzer-template/project/start.ts +35 -11
  165. package/analyzer-template/project/writeMockDataTsx.ts +127 -4
  166. package/analyzer-template/project/writeScenarioComponents.ts +101 -8
  167. package/analyzer-template/scripts/comboWorkerLoop.cjs +98 -50
  168. package/background/src/lib/virtualized/project/analyzeBaselineCommit.js +5 -0
  169. package/background/src/lib/virtualized/project/analyzeBaselineCommit.js.map +1 -1
  170. package/background/src/lib/virtualized/project/analyzeRegularCommit.js +5 -0
  171. package/background/src/lib/virtualized/project/analyzeRegularCommit.js.map +1 -1
  172. package/background/src/lib/virtualized/project/captureLibraryFunctionDirect.js +3 -3
  173. package/background/src/lib/virtualized/project/captureLibraryFunctionDirect.js.map +1 -1
  174. package/background/src/lib/virtualized/project/constructMockCode.js +300 -7
  175. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  176. package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js +73 -1
  177. package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js.map +1 -1
  178. package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js +19 -8
  179. package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js.map +1 -1
  180. package/background/src/lib/virtualized/project/orchestrateCapture/AwsCaptureTaskRunner.js +2 -2
  181. package/background/src/lib/virtualized/project/orchestrateCapture/AwsCaptureTaskRunner.js.map +1 -1
  182. package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js +7 -5
  183. package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js.map +1 -1
  184. package/background/src/lib/virtualized/project/orchestrateCapture.js +58 -6
  185. package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
  186. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +126 -9
  187. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
  188. package/background/src/lib/virtualized/project/runAnalysis.js +3 -0
  189. package/background/src/lib/virtualized/project/runAnalysis.js.map +1 -1
  190. package/background/src/lib/virtualized/project/start.js +32 -11
  191. package/background/src/lib/virtualized/project/start.js.map +1 -1
  192. package/background/src/lib/virtualized/project/writeMockDataTsx.js +101 -4
  193. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  194. package/background/src/lib/virtualized/project/writeScenarioComponents.js +57 -8
  195. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  196. package/codeyam-cli/src/cli.js +2 -0
  197. package/codeyam-cli/src/cli.js.map +1 -1
  198. package/codeyam-cli/src/commands/debug.js +7 -5
  199. package/codeyam-cli/src/commands/debug.js.map +1 -1
  200. package/codeyam-cli/src/commands/memory.js +273 -0
  201. package/codeyam-cli/src/commands/memory.js.map +1 -0
  202. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +4 -0
  203. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
  204. package/codeyam-cli/src/utils/analysisRunner.js +21 -2
  205. package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
  206. package/codeyam-cli/src/utils/install-skills.js +42 -6
  207. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  208. package/codeyam-cli/src/utils/queue/job.js +1 -0
  209. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  210. package/codeyam-cli/src/utils/queue/manager.js +6 -0
  211. package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
  212. package/codeyam-cli/src/utils/rules/index.js +5 -0
  213. package/codeyam-cli/src/utils/rules/index.js.map +1 -0
  214. package/codeyam-cli/src/utils/rules/parser.js +106 -0
  215. package/codeyam-cli/src/utils/rules/parser.js.map +1 -0
  216. package/codeyam-cli/src/utils/rules/pathMatcher.js +18 -0
  217. package/codeyam-cli/src/utils/rules/pathMatcher.js.map +1 -0
  218. package/codeyam-cli/src/utils/rules/staleness.js +132 -0
  219. package/codeyam-cli/src/utils/rules/staleness.js.map +1 -0
  220. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +2 -0
  221. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
  222. package/codeyam-cli/src/webserver/app/lib/database.js +7 -3
  223. package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
  224. package/codeyam-cli/src/webserver/bootstrap.js +40 -0
  225. package/codeyam-cli/src/webserver/bootstrap.js.map +1 -1
  226. package/codeyam-cli/src/webserver/build/client/assets/EntityItem-DsN1wKrm.js +11 -0
  227. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-COi5OvsN.js → EntityTypeBadge-DLqD3qNt.js} +1 -1
  228. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-BwdQv49w.js → EntityTypeIcon-Ba2JVPzP.js} +1 -1
  229. package/codeyam-cli/src/webserver/build/client/assets/{InlineSpinner-CEleMv_j.js → InlineSpinner-C8lyxW9k.js} +1 -1
  230. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-D68KarMg.js → InteractivePreview-aht4aafF.js} +2 -2
  231. package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-L75Wvqgw.js → LibraryFunctionPreview-CVtiBnY5.js} +1 -1
  232. package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-C53WM8qn.js → LoadingDots-B0GLXMsr.js} +1 -1
  233. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-CrNkmy4i.js → LogViewer-xgeCVgSM.js} +1 -1
  234. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-OApQuNyq.js +16 -0
  235. package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-CQifa1n-.js → SafeScreenshot-DuDvi0jm.js} +1 -1
  236. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-CyaBFX7l.js → ScenarioViewer-DzccYyI8.js} +3 -13
  237. package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-D36O1rzU.js → TruncatedFilePath-DyFZkK0l.js} +1 -1
  238. package/codeyam-cli/src/webserver/build/client/assets/_index-BwqWJOgH.js +11 -0
  239. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-BwavGCpm.js +32 -0
  240. package/codeyam-cli/src/webserver/build/client/assets/api.health-l0sNRNKZ.js +1 -0
  241. package/codeyam-cli/src/webserver/build/client/assets/api.memory-profile-l0sNRNKZ.js +1 -0
  242. package/codeyam-cli/src/webserver/build/client/assets/api.restart-server-l0sNRNKZ.js +1 -0
  243. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-DgTPh8H-.js → chevron-down-Cx24_aWc.js} +1 -1
  244. package/codeyam-cli/src/webserver/build/client/assets/{chunk-EPOLDU6W-DdQKK6on.js → chunk-EPOLDU6W-CXRTFQ3F.js} +1 -1
  245. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-Dmr2bb1R.js → circle-check-BOARzkeR.js} +1 -1
  246. package/codeyam-cli/src/webserver/build/client/assets/copy-Bb-80kDT.js +6 -0
  247. package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-Do4ZLUYa.js → createLucideIcon-BdhJEx6B.js} +1 -1
  248. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BBnGWYga.js +1 -0
  249. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-CbdFyxZh.js → entity._sha._-BJUiQqZF.js} +12 -12
  250. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-B4iCfs5M.js → entity._sha.scenarios._scenarioId.fullscreen-DavjRmOY.js} +1 -1
  251. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-wDWZZO1W.js → entity._sha_.create-scenario-D1T4TGjf.js} +1 -1
  252. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-BMbl7MeQ.js → entity._sha_.edit._scenarioId-CTBG2mmz.js} +1 -1
  253. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-5wRKRIH9.js → entry.client-CS2cb_eZ.js} +1 -1
  254. package/codeyam-cli/src/webserver/build/client/assets/file-code-Dhef1kWN.js +6 -0
  255. package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-DD3SDH7t.js → fileTableUtils-DMJ7zii9.js} +1 -1
  256. package/codeyam-cli/src/webserver/build/client/assets/files-CJ6lTdTA.js +1 -0
  257. package/codeyam-cli/src/webserver/build/client/assets/{git-zXjT7J0G.js → git-CPTZZ-JZ.js} +8 -8
  258. package/codeyam-cli/src/webserver/build/client/assets/globals-D3yhhV8x.css +1 -0
  259. package/codeyam-cli/src/webserver/build/client/assets/{index-DLbXwndH.js → index-B1h680n5.js} +1 -1
  260. package/codeyam-cli/src/webserver/build/client/assets/{index-gPZ-lad1.js → index-lzqtyFU8.js} +1 -1
  261. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-BsPXJ81F.js → loader-circle-B7B9V-bu.js} +1 -1
  262. package/codeyam-cli/src/webserver/build/client/assets/manifest-a78b90a2.js +1 -0
  263. package/codeyam-cli/src/webserver/build/client/assets/memory--GCbFsBE.js +92 -0
  264. package/codeyam-cli/src/webserver/build/client/assets/root-eVAaavTS.js +62 -0
  265. package/codeyam-cli/src/webserver/build/client/assets/{search-P2FKIUql.js → search-CxXUmBSd.js} +1 -1
  266. package/codeyam-cli/src/webserver/build/client/assets/{settings-B2eDuBj8.js → settings-CS5f3WzT.js} +1 -1
  267. package/codeyam-cli/src/webserver/build/client/assets/{simulations-L18M6-kN.js → simulations-DwFIBT09.js} +1 -1
  268. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-BDz7kbVA.js → triangle-alert-B6LgvRJg.js} +1 -1
  269. package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-29dDmbH8.js → useCustomSizes-C1v1PQzo.js} +1 -1
  270. package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-BUm0UVJm.js → useLastLogLine-aSv48UbS.js} +1 -1
  271. package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-CkIOKTrZ.js → useReportContext-DYxHZQuP.js} +1 -1
  272. package/codeyam-cli/src/webserver/build/client/assets/{useToast-KKw5kTn-.js → useToast-mBRpZPiu.js} +1 -1
  273. package/codeyam-cli/src/webserver/build/server/assets/index-BM6TDT1Y.js +1 -0
  274. package/codeyam-cli/src/webserver/build/server/assets/server-build-dYC34MHw.js +257 -0
  275. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  276. package/codeyam-cli/src/webserver/build-info.json +5 -5
  277. package/codeyam-cli/templates/codeyam-memory-hook.sh +200 -0
  278. package/codeyam-cli/templates/codeyam:debug.md +47 -3
  279. package/codeyam-cli/templates/codeyam:diagnose.md +203 -25
  280. package/codeyam-cli/templates/codeyam:memory.md +341 -0
  281. package/codeyam-cli/templates/codeyam:new-rule.md +13 -0
  282. package/codeyam-cli/templates/rule-reflection-hook.py +160 -0
  283. package/codeyam-cli/templates/rules-instructions.md +93 -0
  284. package/package.json +8 -5
  285. package/packages/ai/index.js +7 -3
  286. package/packages/ai/index.js.map +1 -1
  287. package/packages/ai/src/lib/analyzeScope.js +70 -29
  288. package/packages/ai/src/lib/analyzeScope.js.map +1 -1
  289. package/packages/ai/src/lib/astScopes/arrayDerivationDetector.js +150 -0
  290. package/packages/ai/src/lib/astScopes/arrayDerivationDetector.js.map +1 -0
  291. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +78 -8
  292. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
  293. package/packages/ai/src/lib/astScopes/methodSemantics.js +109 -23
  294. package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
  295. package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js +1 -102
  296. package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js.map +1 -1
  297. package/packages/ai/src/lib/astScopes/processExpression.js +440 -27
  298. package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
  299. package/packages/ai/src/lib/completionCall.js +161 -30
  300. package/packages/ai/src/lib/completionCall.js.map +1 -1
  301. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +589 -166
  302. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  303. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js +179 -0
  304. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js.map +1 -1
  305. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +7 -1
  306. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
  307. package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js +13 -3
  308. package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js.map +1 -1
  309. package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js +6 -4
  310. package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js.map +1 -1
  311. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +41 -1
  312. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
  313. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +104 -11
  314. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
  315. package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js +159 -0
  316. package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js.map +1 -0
  317. package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js +37 -20
  318. package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js.map +1 -1
  319. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +265 -79
  320. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
  321. package/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.js +107 -0
  322. package/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.js.map +1 -0
  323. package/packages/ai/src/lib/dataStructureChunking.js +111 -0
  324. package/packages/ai/src/lib/dataStructureChunking.js.map +1 -0
  325. package/packages/ai/src/lib/e2eDataTracking.js +241 -0
  326. package/packages/ai/src/lib/e2eDataTracking.js.map +1 -0
  327. package/packages/ai/src/lib/extractCriticalDataKeys.js +96 -0
  328. package/packages/ai/src/lib/extractCriticalDataKeys.js.map +1 -0
  329. package/packages/ai/src/lib/generateEntityScenarioData.js +525 -8
  330. package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
  331. package/packages/ai/src/lib/generateEntityScenarios.js +26 -2
  332. package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
  333. package/packages/ai/src/lib/generateExecutionFlows.js +281 -4
  334. package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
  335. package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +946 -42
  336. package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -1
  337. package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js +194 -0
  338. package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js.map +1 -0
  339. package/packages/ai/src/lib/mergeStatements.js +70 -51
  340. package/packages/ai/src/lib/mergeStatements.js.map +1 -1
  341. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +10 -4
  342. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
  343. package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js +54 -0
  344. package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js.map +1 -0
  345. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +15 -7
  346. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
  347. package/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.js +335 -0
  348. package/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.js.map +1 -0
  349. package/packages/ai/src/lib/resolvePathToControllable.js +155 -41
  350. package/packages/ai/src/lib/resolvePathToControllable.js.map +1 -1
  351. package/packages/ai/src/lib/worker/SerializableDataStructure.js +7 -0
  352. package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
  353. package/packages/ai/src/lib/worker/analyzeScopeWorker.js +94 -1
  354. package/packages/ai/src/lib/worker/analyzeScopeWorker.js.map +1 -1
  355. package/packages/analyze/src/lib/FileAnalyzer.js +60 -36
  356. package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
  357. package/packages/analyze/src/lib/ProjectAnalyzer.js +96 -26
  358. package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
  359. package/packages/analyze/src/lib/analysisContext.js +30 -5
  360. package/packages/analyze/src/lib/analysisContext.js.map +1 -1
  361. package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js +14 -0
  362. package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js.map +1 -1
  363. package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js +14 -0
  364. package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js.map +1 -1
  365. package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js +6 -0
  366. package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js.map +1 -1
  367. package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js +6 -0
  368. package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js.map +1 -1
  369. package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js +39 -1
  370. package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js.map +1 -1
  371. package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js +2 -1
  372. package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js.map +1 -1
  373. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +21 -9
  374. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
  375. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +14 -4
  376. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
  377. package/packages/analyze/src/lib/files/analyze/dependencyResolver.js +5 -0
  378. package/packages/analyze/src/lib/files/analyze/dependencyResolver.js.map +1 -1
  379. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js +2 -1
  380. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
  381. package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js +31 -10
  382. package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js.map +1 -1
  383. package/packages/analyze/src/lib/files/analyzeRemixRoute.js +3 -2
  384. package/packages/analyze/src/lib/files/analyzeRemixRoute.js.map +1 -1
  385. package/packages/analyze/src/lib/files/getImportedExports.js +11 -7
  386. package/packages/analyze/src/lib/files/getImportedExports.js.map +1 -1
  387. package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +160 -68
  388. package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -1
  389. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +25 -8
  390. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
  391. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +71 -9
  392. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  393. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +57 -9
  394. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
  395. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +233 -9
  396. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
  397. package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js +46 -9
  398. package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js.map +1 -1
  399. package/packages/analyze/src/lib/files/setImportedExports.js +2 -1
  400. package/packages/analyze/src/lib/files/setImportedExports.js.map +1 -1
  401. package/packages/analyze/src/lib/utils/getFileByPath.js +12 -0
  402. package/packages/analyze/src/lib/utils/getFileByPath.js.map +1 -0
  403. package/packages/database/src/lib/kysely/db.js +8 -1
  404. package/packages/database/src/lib/kysely/db.js.map +1 -1
  405. package/packages/database/src/lib/kysely/tables/commitsTable.js +3 -0
  406. package/packages/database/src/lib/kysely/tables/commitsTable.js.map +1 -1
  407. package/packages/database/src/lib/loadAnalyses.js +45 -2
  408. package/packages/database/src/lib/loadAnalyses.js.map +1 -1
  409. package/packages/database/src/lib/loadAnalysis.js +8 -0
  410. package/packages/database/src/lib/loadAnalysis.js.map +1 -1
  411. package/packages/database/src/lib/loadBranch.js +11 -1
  412. package/packages/database/src/lib/loadBranch.js.map +1 -1
  413. package/packages/database/src/lib/loadCommit.js +7 -0
  414. package/packages/database/src/lib/loadCommit.js.map +1 -1
  415. package/packages/database/src/lib/loadCommits.js +22 -1
  416. package/packages/database/src/lib/loadCommits.js.map +1 -1
  417. package/packages/database/src/lib/loadEntities.js +23 -4
  418. package/packages/database/src/lib/loadEntities.js.map +1 -1
  419. package/packages/database/src/lib/loadEntityBranches.js +9 -0
  420. package/packages/database/src/lib/loadEntityBranches.js.map +1 -1
  421. package/packages/database/src/lib/updateCommitMetadata.js +5 -4
  422. package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
  423. package/packages/types/index.js.map +1 -1
  424. package/packages/utils/src/lib/safeFileName.js +29 -3
  425. package/packages/utils/src/lib/safeFileName.js.map +1 -1
  426. package/scripts/finalize-analyzer.cjs +3 -3
  427. package/codeyam-cli/src/webserver/build/client/assets/EntityItem-vauWK972.js +0 -1
  428. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-DzJRkCkr.js +0 -11
  429. package/codeyam-cli/src/webserver/build/client/assets/_index-Be83mo_j.js +0 -11
  430. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-BN6wu6Y-.js +0 -37
  431. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-Bn6aCAy_.js +0 -1
  432. package/codeyam-cli/src/webserver/build/client/assets/files-DKyMFI90.js +0 -1
  433. package/codeyam-cli/src/webserver/build/client/assets/globals-DTTQ3gY7.css +0 -1
  434. package/codeyam-cli/src/webserver/build/client/assets/manifest-22590fcf.js +0 -1
  435. package/codeyam-cli/src/webserver/build/client/assets/root-BsAarjAM.js +0 -57
  436. package/codeyam-cli/src/webserver/build/server/assets/index-BND5I5fv.js +0 -1
  437. package/codeyam-cli/src/webserver/build/server/assets/server-build-CFXnd7MG.js +0 -228
@@ -1 +1 @@
1
- import{Y as F,M as G,N as H,W as I,O as J,R as K,T as L,V as Z,U as _,X as $,Q as rr}from"./assets/server-build-CFXnd7MG.js";import"react/jsx-runtime";import"node:stream";import"@react-router/node";import"react-router";import"isbot";import"react-dom/server";import"react";import"lucide-react";import"fetch-retry";import"better-sqlite3";import"pg";import"fs";import"path";import"kysely";import"kysely/helpers/sqlite";import"kysely/helpers/postgres";import"typescript";import"fs/promises";import"os";import"prompts";import"chalk";import"crypto";import"child_process";import"util";import"dotenv";import"events";import"uuid";import"url";import"openai";import"p-queue";import"p-retry";import"@aws-sdk/client-dynamodb";import"lru-cache";import"pluralize";import"piscina";import"json5";import"@aws-sdk/util-dynamodb";import"react-syntax-highlighter";import"react-syntax-highlighter/dist/cjs/styles/prism/index.js";import"node:crypto";import"v8";import"react-diff-viewer-continued";export{F as assets,G as assetsBuildDirectory,H as basename,I as entry,J as future,K as isSpaMode,L as prerender,Z as publicPath,_ as routeDiscovery,$ as routes,rr as ssr};
1
+ import{Y as H,Z as I,M as J,N as K,W as L,O as _,R as $,T as rr,V as tr,U as or,X as ir,Q as pr}from"./assets/server-build-dYC34MHw.js";import"react/jsx-runtime";import"node:stream";import"@react-router/node";import"react-router";import"isbot";import"react-dom/server";import"react";import"lucide-react";import"fetch-retry";import"better-sqlite3";import"pg";import"fs";import"path";import"kysely";import"kysely/helpers/sqlite";import"kysely/helpers/postgres";import"typescript";import"fs/promises";import"os";import"prompts";import"chalk";import"crypto";import"child_process";import"url";import"util";import"dotenv";import"events";import"uuid";import"openai";import"p-queue";import"p-retry";import"@aws-sdk/client-dynamodb";import"lru-cache";import"pluralize";import"piscina";import"json5";import"@aws-sdk/util-dynamodb";import"v8";import"react-syntax-highlighter";import"react-syntax-highlighter/dist/cjs/styles/prism/index.js";import"node:crypto";import"minimatch";import"react-markdown";import"remark-gfm";import"react-diff-viewer-continued";export{H as allowedActionOrigins,I as assets,J as assetsBuildDirectory,K as basename,L as entry,_ as future,$ as isSpaMode,rr as prerender,tr as publicPath,or as routeDiscovery,ir as routes,pr as ssr};
@@ -1,7 +1,7 @@
1
1
  {
2
- "buildTimestamp": "2026-01-21T15:31:57.854Z",
3
- "buildTime": 1769009517854,
4
- "buildNumber": 487,
5
- "semanticVersion": "0.1.487",
6
- "version": "0.1.487 (2026-01-21T15:31)"
2
+ "buildTimestamp": "2026-02-03T16:02:39.433Z",
3
+ "buildTime": 1770134559433,
4
+ "buildNumber": 579,
5
+ "semanticVersion": "0.1.579",
6
+ "version": "0.1.579 (2026-02-03T16:02)"
7
7
  }
@@ -0,0 +1,200 @@
1
+ #!/bin/bash
2
+ # CodeYam Memory - Pre-commit Hook (BLOCKING)
3
+ # Ensures rules are reviewed when associated code changes
4
+ #
5
+ # This hook checks that rules with matching `paths` patterns have been reviewed
6
+ # (indicated by an updated `timestamp` field) when associated code files are modified.
7
+
8
+ set -e
9
+
10
+ RULES_DIR=".claude/rules"
11
+
12
+ # Skip if no rules directory
13
+ if [ ! -d "$RULES_DIR" ]; then
14
+ exit 0
15
+ fi
16
+
17
+ # Get staged code files (added, copied, modified, renamed)
18
+ STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACMR 2>/dev/null | grep -E '\.(ts|tsx|js|jsx)$' || true)
19
+
20
+ if [ -z "$STAGED_FILES" ]; then
21
+ exit 0
22
+ fi
23
+
24
+ # Function to convert ISO 8601 timestamp to epoch seconds
25
+ # Handles both macOS and Linux date commands
26
+ timestamp_to_epoch() {
27
+ local ts="$1"
28
+ # Remove trailing Z if present
29
+ ts="${ts%Z}"
30
+
31
+ if date --version >/dev/null 2>&1; then
32
+ # GNU date (Linux)
33
+ date -d "$ts" +%s 2>/dev/null || echo "0"
34
+ else
35
+ # BSD date (macOS)
36
+ # Handle ISO 8601 format: 2026-01-27T10:30:00
37
+ date -j -f "%Y-%m-%dT%H:%M:%S" "$ts" +%s 2>/dev/null || echo "0"
38
+ fi
39
+ }
40
+
41
+ # Function to get file modification time as epoch
42
+ get_file_mtime() {
43
+ local file="$1"
44
+ if [ ! -f "$file" ]; then
45
+ echo "0"
46
+ return
47
+ fi
48
+
49
+ if stat --version >/dev/null 2>&1; then
50
+ # GNU stat (Linux)
51
+ stat -c %Y "$file" 2>/dev/null || echo "0"
52
+ else
53
+ # BSD stat (macOS)
54
+ stat -f %m "$file" 2>/dev/null || echo "0"
55
+ fi
56
+ }
57
+
58
+ # Function to check if a file matches a glob pattern
59
+ # This is a simplified matcher - complex globs may not work perfectly
60
+ matches_pattern() {
61
+ local file="$1"
62
+ local pattern="$2"
63
+
64
+ # Handle ** patterns by converting to simpler form
65
+ # This is a simplification - proper glob matching would need a more robust solution
66
+ local regex_pattern="$pattern"
67
+
68
+ # Escape regex special chars except * and ?
69
+ regex_pattern=$(echo "$regex_pattern" | sed 's/\./\\./g; s/\[/\\[/g; s/\]/\\]/g')
70
+
71
+ # Convert glob patterns to regex
72
+ # ** matches any path segment(s)
73
+ regex_pattern=$(echo "$regex_pattern" | sed 's/\*\*/DOUBLESTAR/g')
74
+ # * matches anything except /
75
+ regex_pattern=$(echo "$regex_pattern" | sed 's/\*/[^/]*/g')
76
+ # ** matches any path
77
+ regex_pattern=$(echo "$regex_pattern" | sed 's/DOUBLESTAR/.*/g')
78
+ # ? matches single char
79
+ regex_pattern=$(echo "$regex_pattern" | sed 's/?/./g')
80
+
81
+ # Anchor the pattern
82
+ regex_pattern="^${regex_pattern}$"
83
+
84
+ echo "$file" | grep -qE "$regex_pattern" 2>/dev/null
85
+ }
86
+
87
+ # Parse timestamp from YAML frontmatter
88
+ get_rule_timestamp() {
89
+ local rule_file="$1"
90
+ # Extract content between first two --- lines, then find timestamp
91
+ sed -n '1,/^---$/!{/^---$/q;p}' "$rule_file" 2>/dev/null | \
92
+ grep -E '^timestamp:' | \
93
+ sed 's/timestamp:[[:space:]]*//' | \
94
+ tr -d "'" | tr -d '"' | \
95
+ head -1
96
+ }
97
+
98
+ # Parse paths from YAML frontmatter
99
+ get_rule_paths() {
100
+ local rule_file="$1"
101
+ # Extract the paths array from YAML frontmatter
102
+ # This handles both inline array and multi-line array formats
103
+ sed -n '1,/^---$/!{/^---$/q;p}' "$rule_file" 2>/dev/null | \
104
+ sed -n '/^paths:/,/^[a-z]/p' | \
105
+ grep -E "^[[:space:]]*-" | \
106
+ sed "s/^[[:space:]]*-[[:space:]]*//" | \
107
+ tr -d "'" | tr -d '"'
108
+ }
109
+
110
+ OUTDATED_RULES=""
111
+ CHECKED_RULES=""
112
+
113
+ # Find all rule files and check them
114
+ while IFS= read -r rule_file; do
115
+ # Skip if already checked this rule
116
+ if echo "$CHECKED_RULES" | grep -qF "$rule_file"; then
117
+ continue
118
+ fi
119
+ CHECKED_RULES="$CHECKED_RULES $rule_file"
120
+
121
+ rule_timestamp=$(get_rule_timestamp "$rule_file")
122
+
123
+ # Skip rules without timestamp
124
+ if [ -z "$rule_timestamp" ]; then
125
+ continue
126
+ fi
127
+
128
+ rule_epoch=$(timestamp_to_epoch "$rule_timestamp")
129
+
130
+ if [ "$rule_epoch" = "0" ]; then
131
+ continue
132
+ fi
133
+
134
+ # Get paths for this rule
135
+ rule_paths=$(get_rule_paths "$rule_file")
136
+
137
+ if [ -z "$rule_paths" ]; then
138
+ continue
139
+ fi
140
+
141
+ # Check each staged file against this rule's paths
142
+ rule_is_outdated=false
143
+ matched_file=""
144
+
145
+ while IFS= read -r staged_file; do
146
+ if [ -z "$staged_file" ]; then
147
+ continue
148
+ fi
149
+
150
+ while IFS= read -r pattern; do
151
+ if [ -z "$pattern" ]; then
152
+ continue
153
+ fi
154
+
155
+ if matches_pattern "$staged_file" "$pattern"; then
156
+ # Get file modification time
157
+ file_epoch=$(get_file_mtime "$staged_file")
158
+
159
+ # If file is newer than rule timestamp, flag it
160
+ if [ "$file_epoch" -gt "$rule_epoch" ]; then
161
+ rule_is_outdated=true
162
+ matched_file="$staged_file"
163
+ break 2
164
+ fi
165
+ fi
166
+ done <<< "$rule_paths"
167
+ done <<< "$STAGED_FILES"
168
+
169
+ if [ "$rule_is_outdated" = true ]; then
170
+ OUTDATED_RULES="$OUTDATED_RULES
171
+ - $rule_file
172
+ (matched: $matched_file)"
173
+ fi
174
+
175
+ done < <(find "$RULES_DIR" -name "*.md" -type f 2>/dev/null)
176
+
177
+ if [ -n "$OUTDATED_RULES" ]; then
178
+ echo ""
179
+ echo "================================================================"
180
+ echo " Claude Rules (Codeyam Memory): Outdated Documentation Detected"
181
+ echo "================================================================"
182
+ echo ""
183
+ echo " The following rules have timestamps older than the code"
184
+ echo " files they cover:"
185
+ echo "$OUTDATED_RULES"
186
+ echo ""
187
+ echo " To proceed:"
188
+ echo " 1. Review each rule to ensure it's still accurate"
189
+ echo " 2. Update the 'timestamp' field in the YAML frontmatter"
190
+ echo " 3. Stage the updated rule file(s)"
191
+ echo " 4. Commit again"
192
+ echo ""
193
+ echo " Or ask Claude to \"run \`codeyam memory status\` and follow the instructions.\""
194
+ echo ""
195
+ echo "================================================================"
196
+ echo ""
197
+ exit 1 # BLOCK the commit
198
+ fi
199
+
200
+ exit 0
@@ -37,6 +37,49 @@ The `codeyam init` command has already auto-approved:
37
37
 
38
38
  You can freely work with logs and update configuration without asking for permission.
39
39
 
40
+ ## Important: File Locations
41
+
42
+ Understanding where files live is critical for debugging:
43
+
44
+ | What | Location | Notes |
45
+ | ------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- |
46
+ | **Database** | `.codeyam/db.sqlite3` | In the **original project directory** (where you ran `codeyam init`). Contains entities, analyses, scenarios. |
47
+ | **Config** | `.codeyam/config.json` | In the **original project directory**. Universal mocks go here. |
48
+ | **LLM Calls** | `.codeyam/llm-calls/` | In the **original project directory**. JSON files recording LLM inputs/outputs for each analysis. |
49
+ | **Logs** | `/tmp/codeyam/local-dev/{projectSlug}/codeyam/log.txt` | In the temp folder. Analysis and capture logs. |
50
+ | **Generated files** | `/tmp/codeyam/local-dev/{projectSlug}/project/` | A **copy** of your project with mock injections. |
51
+ | **Analyzer** | `/tmp/codeyam/local-dev/{projectSlug}/codeyam/` | The analysis engine runtime. |
52
+
53
+ **Common mistake:** Looking for the database in `/tmp/codeyam/local-dev/{projectSlug}/project/.codeyam/db.sqlite3` - this is a **copy** and may be empty or stale. Always query the database in the **original project directory**.
54
+
55
+ ### Debugging with LLM Calls
56
+
57
+ The `.codeyam/llm-calls/` directory contains JSON files recording every LLM interaction during analysis. Examining these is often key to understanding why analysis produced unexpected results:
58
+
59
+ ```bash
60
+ # List recent LLM calls
61
+ ls -lt .codeyam/llm-calls/ | head -10
62
+
63
+ # View a specific call (shows both the prompt sent and response received)
64
+ cat .codeyam/llm-calls/{filename}.json | jq .
65
+ ```
66
+
67
+ **What to look for:**
68
+
69
+ - **Input context**: Was the right code/context sent to the LLM?
70
+ - **Response parsing**: Did the LLM return valid JSON? Were fields missing or malformed?
71
+ - **Scenario generation**: For scenario issues, check if the LLM generated the expected data structures
72
+
73
+ **Example database query:**
74
+
75
+ ```bash
76
+ # CORRECT - query the original project database
77
+ sqlite3 /path/to/your/project/.codeyam/db.sqlite3 "SELECT id, entityName FROM analyses LIMIT 5"
78
+
79
+ # WRONG - the temp copy doesn't have the real data
80
+ sqlite3 /tmp/codeyam/local-dev/{projectSlug}/project/.codeyam/db.sqlite3 "..."
81
+ ```
82
+
40
83
  ## Debugging Workflow
41
84
 
42
85
  ### Step 1: Read the Error Log
@@ -44,8 +87,8 @@ You can freely work with logs and update configuration without asking for permis
44
87
  The simulation log contains all error details:
45
88
 
46
89
  ```bash
47
- # For local development
48
- tail -n 100 /tmp/codeyam/local-dev/{projectSlug}/log.txt
90
+ # For local development (note the /codeyam/ folder in the path)
91
+ tail -n 100 /tmp/codeyam/local-dev/{projectSlug}/codeyam/log.txt
49
92
  ```
50
93
 
51
94
  Look for:
@@ -92,7 +135,8 @@ Cannot destructure property 'entities' of 'useLoaderData()' as it is null
92
135
  This is a **SCENARIO MOCK ISSUE**, not a universal mock issue. Follow these steps:
93
136
 
94
137
  1. **Check the analysis metadata** for `scenariosDataStructure`:
95
- - Query the database or check analysis records
138
+ - Query the database **in the original project directory** (`.codeyam/db.sqlite3`)
139
+ - Example: `sqlite3 .codeyam/db.sqlite3 "SELECT json_extract(analysis, '$.scenariosDataStructure') FROM analyses WHERE entityName='MyEntity'"`
96
140
  - Look for the `dataForMocks` property
97
141
  - This shows what data the analysis engine expected to mock
98
142
 
@@ -4,7 +4,7 @@ When a user asks to debug a scenario or analysis (e.g., `/codeyam:diagnose [ID]`
4
4
 
5
5
  ## Goal
6
6
 
7
- Determine whether a capture failure can be fixed locally (via database changes) or requires a CodeYam engine fix. Either way, produce a detailed debug report.
7
+ **Capture quality screenshots** by fixing all errors, then document what was wrong. Every issue can be fixed locally—the question is whether the fix is in the database (Categories 1-3) or in the tmp folder code (Category 4). Either way, you must capture screenshots before concluding.
8
8
 
9
9
  ## Definition of Done
10
10
 
@@ -14,6 +14,43 @@ Determine whether a capture failure can be fixed locally (via database changes)
14
14
  2. **SUCCESS (File Fix)**: Issue fixed via tmp folder edits, screenshots recaptured with `--capture-only`, ALL screenshot files verified AND visually inspected, changes documented for CodeYam team
15
15
  3. **UNFIXABLE**: Issue cannot be fixed locally (rare), documented in final report with full details
16
16
 
17
+ **CRITICAL: NEVER stop debugging before capturing quality screenshots.** Even if you identify the root cause as a "Category 4 engine bug", you MUST:
18
+
19
+ 1. Fix the issue manually in the tmp folder (this is always possible)
20
+ 2. Run `codeyam recapture --capture-only` to capture screenshots with your fixes in place
21
+ 3. Verify the screenshots show the component rendering correctly
22
+ 4. ONLY THEN document the engine bug for the CodeYam team
23
+
24
+ Stopping after identifying a bug category without capturing screenshots defeats the purpose of debugging.
25
+
26
+ ## Critical: Persistence and User Communication
27
+
28
+ **DO NOT give up prematurely.** Every issue can be fixed by editing files in the tmp folder. If you find yourself thinking:
29
+
30
+ - "This requires an engine-level fix"
31
+ - "This is blocked by a code generation bug"
32
+ - "The engine doesn't properly handle X"
33
+
34
+ **STOP.** These statements are incorrect. You have full access to edit any file in `/tmp/codeyam/local-dev/{slug}/project/`. The "engine" just wrote those files—they're plain TypeScript/JavaScript that you can edit directly.
35
+
36
+ ### Before Stopping or Concluding
37
+
38
+ 1. **Try at least 3 different approaches** to fix the issue
39
+ 2. **Never unilaterally decide to stop.** If you've been debugging and aren't making progress, ASK THE USER:
40
+ > "I've tried X, Y, and Z but haven't resolved the issue yet. Would you like me to continue investigating other approaches, or should I document what I've found so far?"
41
+ 3. **Only stop when the user agrees** or when you've successfully captured quality screenshots
42
+
43
+ ### The "Engine Bug" Misconception
44
+
45
+ When you identify a Category 4 issue (code generation bug), this does NOT mean you're blocked. It means:
46
+
47
+ - The bug is in how CodeYam generates code (useful info for the CodeYam team)
48
+ - You MUST still fix it manually by editing files in the tmp folder
49
+ - You MUST still capture quality screenshots
50
+ - You document what you fixed so the CodeYam team can improve the engine
51
+
52
+ **"Engine bug" is a diagnosis category, not an excuse to stop.**
53
+
17
54
  ---
18
55
 
19
56
  ## Debug Flow Summary
@@ -25,11 +62,12 @@ Determine whether a capture failure can be fixed locally (via database changes)
25
62
  │ Retrieve the analysis id to use in the debug command │
26
63
  │ │ │
27
64
  │ ▼ │
28
- │ Step 1: codeyam debug [ANALYSIS ID] (generates files to inspect)
29
- Step 2: Identify error type from logs/output
30
- │ Step 3: Diagnose root cause category (1-4)
31
- │ Step 4: Attempt fix (database edit or universal mock)
32
- │ Step 5: Verify locally (curl returns 200)
65
+ │ Step 1: Copy the logs to a temporary location (see below). |
66
+ | Step 2: codeyam debug [ANALYSIS ID] (generates files to inspect)
67
+ │ Step 3: Identify error type from logs/output
68
+ │ Step 4: Diagnose root cause category (1-4)
69
+ │ Step 5: Attempt fix (database edit or universal mock)
70
+ │ Step 6: Verify locally (curl returns 200) │
33
71
  │ │ │
34
72
  │ ┌─────────┴─────────┐ │
35
73
  │ ▼ ▼ │
@@ -43,12 +81,12 @@ Determine whether a capture failure can be fixed locally (via database changes)
43
81
  │ │ Verify without regenerating │
44
82
  │ │ │ │
45
83
  │ ▼ ▼ │
46
- │ Step 6: Recapture Step 6: Recapture --capture-only │
84
+ │ Step 7: Recapture Step 7: Recapture --capture-only │
47
85
  │ (normal) (preserves file fixes) │
48
86
  │ │ │ │
49
87
  │ └─────────┬─────────┘ │
50
88
  │ ▼ │
51
- │ Step 7: Verify screenshots (check for client-side errors) │
89
+ │ Step 8: Verify screenshots (check for client-side errors) │
52
90
  │ │ │
53
91
  │ ▼ │
54
92
  │ Verify ALL files exist on disk │
@@ -59,16 +97,128 @@ Determine whether a capture failure can be fixed locally (via database changes)
59
97
  └─────────────────────────────────────────────────────────────────────┘
60
98
  ```
61
99
 
100
+ **Logs:** Before debugging copy the original logs to a temorary location as the debugging will overwrite these logs and they are valuable for debugging issues.
101
+
102
+ Original Logs Locaion: `/tmp/codeyam/local-dev/{slug}/codeyam/logs.txt`
103
+ Temporary location: `/tmp/codeyam/local-dev/{slug}/debug/original-logs.txt`
104
+
105
+ **Notice:** Both paths lead to "Recapture" and "Verify screenshots". There is no path that ends after just identifying a bug category. You must always capture quality screenshots before completing.
106
+
107
+ ---
108
+
109
+ ## MANDATORY: Session Context (Do This First!)
110
+
111
+ Long debugging sessions cause context loss. To prevent forgetting critical information:
112
+
113
+ ### Step 1: Create Session Context File
114
+
115
+ At the **very start** of debugging, create `.codeyam/debug-session.md` in the **original project directory**:
116
+
117
+ ```markdown
118
+ # Debug Session Context
119
+
120
+ **IMPORTANT**: Keep a todo item "📍 Re-read debug session context" that is NEVER marked complete.
121
+ If the todo disappears, add it back immediately.
122
+
123
+ ## Key Locations
124
+
125
+ - **Original project**: [FULL PATH - run all codeyam commands here]
126
+ - **Tmp folder**: /tmp/codeyam/local-dev/[SLUG]/project (edit files here, do NOT run codeyam commands)
127
+ - **Database**: [ORIGINAL PROJECT]/.codeyam/db.sqlite3
128
+ - **Logs**: /tmp/codeyam/local-dev/[SLUG]/codeyam/log.txt
129
+
130
+ ## IDs
131
+
132
+ - **Analysis ID**: [ID]
133
+ - **Scenario ID**: [ID]
134
+ - **Entity**: [NAME] at [FILE PATH]
135
+
136
+ ## URLs (fill in after running codeyam debug)
137
+
138
+ - **Scenario URL**: http://localhost:[PORT]/static/codeyam-sample
139
+ - **Dev server port**: [PORT from codeyam debug output]
140
+
141
+ ## Commands Reference
142
+
143
+ All commands run from: [ORIGINAL PROJECT PATH]
144
+
145
+ - `codeyam debug [ANALYSIS_ID]` - regenerate files (overwrites tmp folder!)
146
+ - `codeyam recapture [ID]` - regenerate AND capture (overwrites tmp folder!)
147
+ - `codeyam recapture [ID] --capture-only` - capture WITHOUT regenerating (preserves your edits)
148
+ - `codeyam test-startup` - test startup (overwrites tmp folder!)
149
+ ```
150
+
151
+ ### Step 2: Create Persistent Todo
152
+
153
+ Use TodoWrite to create this todo list with the first item being a persistent reminder:
154
+
155
+ ```
156
+ 📍 Re-read .codeyam/debug-session.md before any codeyam command (NEVER complete this)
157
+ ```
158
+
159
+ **CRITICAL**: The first todo item must NEVER be marked as completed. It serves as a constant reminder to check your session context before running commands. If you accidentally complete it or it disappears, add it back immediately.
160
+
161
+ ### Step 3: Read Context Before Actions
162
+
163
+ **Before running ANY of these commands**, re-read `.codeyam/debug-session.md`:
164
+
165
+ - `codeyam debug`
166
+ - `codeyam recapture`
167
+ - `codeyam test-startup`
168
+ - Any database queries
169
+
170
+ This prevents running commands from the wrong directory or forgetting key IDs.
171
+
172
+ ---
173
+
174
+ ## Critical: Where to Run Commands
175
+
176
+ **All `codeyam` commands MUST be run from the ORIGINAL PROJECT DIRECTORY**, not from the tmp folder.
177
+
178
+ | Location | What's There | Run Commands Here? |
179
+ | ---------------------------------------------------------------------- | -------------------------------------------------------------- | ------------------------------------------------- |
180
+ | **Original project** (e.g., `/Users/.../clients-codeyam/boltwise/app`) | Database (`.codeyam/db.sqlite3`), config, universal mocks | **YES - run all codeyam commands here** |
181
+ | **Tmp folder** (`/tmp/codeyam/local-dev/{slug}/project/`) | Copy of project with mock injections, generated scenario files | **NO - only edit files here, don't run commands** |
182
+
183
+ **Common mistake:** Running `codeyam recapture` from the tmp folder. This will fail with "Not in a CodeYam project" because the database doesn't exist there.
184
+
185
+ ```bash
186
+ # WRONG - running from tmp folder
187
+ cd /tmp/codeyam/local-dev/boltwise-app/project
188
+ codeyam recapture abc123 # ❌ Fails: "Not in a CodeYam project"
189
+
190
+ # CORRECT - running from original project directory
191
+ cd /Users/jaredcosulich/workspace/codeyam/clients-codeyam/boltwise/app
192
+ codeyam recapture abc123 # ✅ Works
193
+ ```
194
+
195
+ **Workflow:**
196
+
197
+ 1. Edit files in `/tmp/codeyam/local-dev/{slug}/project/` to fix issues
198
+ 2. Test by curling the dev server running from the tmp folder
199
+ 3. **Switch back to the original project directory** to run `codeyam recapture`
200
+
62
201
  ---
63
202
 
64
203
  ## What You Can and Cannot Modify
65
204
 
66
205
  **NEVER modify the client's original source code in the workspace.** Only modify files in the tmp folder.
67
206
 
207
+ ### CRITICAL: Fix the Mocks, Never the Client Code
208
+
209
+ When debugging errors, the fix is ALWAYS in the mock data or mock code—never in the client's components or application code.
210
+
211
+ **If a component crashes due to unexpected data:**
212
+
213
+ - Fix the mock data to provide what the component expects
214
+ - Do NOT modify the component to handle the bad data
215
+
216
+ **The client's code is sacred.** Our job is to make the simulation environment correct, not to "improve" or "harden" the client's code. Even if a component could be more defensive, that's not our fix to make.
217
+
68
218
  **You CAN modify:**
69
219
 
70
- - Data in the local SQLite database (`.codeyam/db.sqlite3`)
71
- - Universal mocks in `.codeyam/universal-mocks`
220
+ - Data in the local SQLite database (`.codeyam/db.sqlite3`) - in the **original project directory**
221
+ - Universal mocks in `.codeyam/universal-mocks` - in the **original project directory**
72
222
  - **Files in `/tmp/codeyam/local-dev/{slug}/project/`** - These are temporary copies used for simulation
73
223
  - Generated mock files in `__codeyamMocks__/` directories
74
224
  - Layout/route files that wrap scenarios
@@ -157,12 +307,12 @@ This is the most important step. Determine WHERE in the pipeline the bug origina
157
307
 
158
308
  ### The 4 Error Categories
159
309
 
160
- | Category | What's Wrong | Where to Check | Fixable Locally? |
161
- | -------- | ---------------------------------------------------- | ------------------------- | ---------------------- |
162
- | **1** | Missing attribute in `isolatedDataStructure` | `entities.metadata` | Sometimes (re-analyze) |
163
- | **2** | Attribute not merged into `mergedDataStructure` | `analyses.metadata` | Sometimes (re-analyze) |
164
- | **3** | Data structure complete, but scenario data wrong | `scenarios.metadata` | Yes (edit mockData) |
165
- | **4** | Data complete, but mock code/mock data written wrong | Generated files in `/tmp` | **No (engine bug)** |
310
+ | Category | What's Wrong | Where to Check | Fixable Locally? |
311
+ | -------- | ---------------------------------------------------- | ------------------------- | ----------------------------- |
312
+ | **1** | Missing attribute in `isolatedDataStructure` | `entities.metadata` | Sometimes (re-analyze) |
313
+ | **2** | Attribute not merged into `mergedDataStructure` | `analyses.metadata` | Sometimes (re-analyze) |
314
+ | **3** | Data structure complete, but scenario data wrong | `scenarios.metadata` | Yes (edit mockData) |
315
+ | **4** | Data complete, but mock code/mock data written wrong | Generated files in `/tmp` | **Yes (edit files directly)** |
166
316
 
167
317
  ### Diagnostic Queries
168
318
 
@@ -201,7 +351,7 @@ sqlite3 .codeyam/db.sqlite3 \
201
351
  6. **Check generated mock code** - Is the mock code syntactically/semantically correct? If wrong → **Category 4 (engine bug)**
202
352
  7. **Check generated imports** - Are the imports correct? Are entities containing environment variables mocked out? If wrong → **Category 4 (engine bug)**
203
353
 
204
- ### Category 4 Indicators (Engine Bug)
354
+ ### Category 4 Indicators (Code Generation Issue)
205
355
 
206
356
  The issue is Category 4 if:
207
357
 
@@ -210,6 +360,16 @@ The issue is Category 4 if:
210
360
  - BUT the generated mock code has syntax errors, wrong structure, or doesn't match the data
211
361
  - Database edits don't fix the generated code (it regenerates wrong)
212
362
 
363
+ **Category 4 does NOT mean you are blocked.** You have full access to fix these issues:
364
+
365
+ 1. **Edit the files directly** in `/tmp/codeyam/local-dev/{slug}/project/`
366
+ 2. **Fix any syntax errors, wrong imports, missing mocks** - these are just TypeScript files
367
+ 3. **Restart the dev server** and verify the fix works
368
+ 4. **Capture quality screenshots** with `codeyam recapture --capture-only`
369
+ 5. **Document what you fixed** for the CodeYam team to improve the engine
370
+
371
+ The term "engine bug" means the CodeYam code generation has a bug—it does NOT mean you cannot fix the issue locally. You always can.
372
+
213
373
  ---
214
374
 
215
375
  ## Step 4: Attempt Fix
@@ -261,9 +421,15 @@ EOF
261
421
 
262
422
  ### For Category 4 (Code Generation Issues)
263
423
 
264
- **CAN be fixed locally by editing files in the tmp folder!** See Step 5a below.
424
+ **MUST be fixed locally by editing files in the tmp folder.** This is a REQUIRED step, not optional.
265
425
 
266
- After fixing, use `codeyam recapture --capture-only` to capture without regenerating the (now-fixed) files.
426
+ 1. Go to Step 5a and fix all code issues in the tmp folder
427
+ 2. Verify the scenario loads correctly (curl returns 200)
428
+ 3. Run `codeyam recapture --capture-only` to capture screenshots (this preserves your fixes)
429
+ 4. Verify the screenshots look correct
430
+ 5. THEN document the engine bug in your final report
431
+
432
+ **DO NOT stop after identifying a Category 4 issue.** The goal is to capture quality screenshots, then document what you fixed.
267
433
 
268
434
  ### Universal Mocks (for infrastructure dependencies)
269
435
 
@@ -322,7 +488,9 @@ After making **database changes** (Categories 1-3):
322
488
 
323
489
  ## Step 5a: Fix Code Issues in Tmp Folder (Category 4)
324
490
 
325
- If the error is in bad imports, generated code or mock files, you can fix them directly in the tmp folder:
491
+ If the error is in bad imports, generated code or mock files, you can fix them directly in the tmp folder.
492
+
493
+ **REMINDER: Only fix GENERATED files (mocks, layouts, routes)—never the client's application code.** If a client component crashes, the fix is in the mock data or mock code, not in the component itself.
326
494
 
327
495
  ### Locate the Problematic File
328
496
 
@@ -361,11 +529,19 @@ cd /tmp/codeyam/local-dev/{slug}/project
361
529
  npm run dev # or pnpm dev / yarn dev
362
530
  ```
363
531
 
364
- Then curl the scenario URL to verify the fix works:
532
+ Then verify the fix works. You can either:
365
533
 
366
- ```bash
367
- curl -s http://localhost:3112/static/codeyam-sample | head -50
368
- ```
534
+ 1. **Curl the URL** to check for errors:
535
+
536
+ ```bash
537
+ curl -s http://localhost:3112/static/codeyam-sample | head -50
538
+ ```
539
+
540
+ 2. **Ask the user to verify visually**: If the fix involves visual output or you're unsure if it worked, ask the user to visit the URL and confirm:
541
+
542
+ > "I've fixed the mock data. Can you visit http://localhost:3112/static/codeyam-sample and let me know if the component renders correctly now?"
543
+
544
+ This is especially useful for client-side rendering issues that curl won't catch.
369
545
 
370
546
  ---
371
547
 
@@ -574,8 +750,10 @@ If this is an engine bug, include:
574
750
 
575
751
  ### Verification
576
752
 
753
+ **All of these must be checked before the debug session is complete:**
754
+
577
755
  - [ ] Scenario loads without errors (curl returns 200)
578
- - [ ] Screenshots recaptured successfully
756
+ - [ ] Screenshots recaptured successfully (this is REQUIRED, not optional)
579
757
  - [ ] Used `--capture-only` flag (if file changes were made)
580
758
  - [ ] Screenshot files verified to exist on disk
581
759
  - [ ] Screenshots visually inspected - no client-side errors visible