specweave 0.28.68 → 0.29.1

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 (318) hide show
  1. package/CLAUDE.md +3 -2
  2. package/README.md +19 -2
  3. package/dist/src/cli/commands/discrepancies.d.ts +89 -0
  4. package/dist/src/cli/commands/discrepancies.d.ts.map +1 -0
  5. package/dist/src/cli/commands/discrepancies.js +385 -0
  6. package/dist/src/cli/commands/discrepancies.js.map +1 -0
  7. package/dist/src/cli/commands/notifications.d.ts +70 -0
  8. package/dist/src/cli/commands/notifications.d.ts.map +1 -0
  9. package/dist/src/cli/commands/notifications.js +236 -0
  10. package/dist/src/cli/commands/notifications.js.map +1 -0
  11. package/dist/src/cli/commands/sync-logs.d.ts +54 -0
  12. package/dist/src/cli/commands/sync-logs.d.ts.map +1 -0
  13. package/dist/src/cli/commands/sync-logs.js +240 -0
  14. package/dist/src/cli/commands/sync-logs.js.map +1 -0
  15. package/dist/src/cli/commands/sync-monitor.d.ts +42 -0
  16. package/dist/src/cli/commands/sync-monitor.d.ts.map +1 -0
  17. package/dist/src/cli/commands/sync-monitor.js +191 -0
  18. package/dist/src/cli/commands/sync-monitor.js.map +1 -0
  19. package/dist/src/cli/helpers/init/brownfield-analysis.d.ts +45 -0
  20. package/dist/src/cli/helpers/init/brownfield-analysis.d.ts.map +1 -0
  21. package/dist/src/cli/helpers/init/brownfield-analysis.js +431 -0
  22. package/dist/src/cli/helpers/init/brownfield-analysis.js.map +1 -0
  23. package/dist/src/cli/helpers/init/index.d.ts +1 -0
  24. package/dist/src/cli/helpers/init/index.d.ts.map +1 -1
  25. package/dist/src/cli/helpers/init/index.js +2 -0
  26. package/dist/src/cli/helpers/init/index.js.map +1 -1
  27. package/dist/src/cli/workers/brownfield-worker.d.ts +66 -0
  28. package/dist/src/cli/workers/brownfield-worker.d.ts.map +1 -0
  29. package/dist/src/cli/workers/brownfield-worker.js +417 -0
  30. package/dist/src/cli/workers/brownfield-worker.js.map +1 -0
  31. package/dist/src/core/background/brownfield-launcher.d.ts +86 -0
  32. package/dist/src/core/background/brownfield-launcher.d.ts.map +1 -0
  33. package/dist/src/core/background/brownfield-launcher.js +295 -0
  34. package/dist/src/core/background/brownfield-launcher.js.map +1 -0
  35. package/dist/src/core/background/index.d.ts +2 -0
  36. package/dist/src/core/background/index.d.ts.map +1 -1
  37. package/dist/src/core/background/index.js +2 -0
  38. package/dist/src/core/background/index.js.map +1 -1
  39. package/dist/src/core/background/types.d.ts +23 -2
  40. package/dist/src/core/background/types.d.ts.map +1 -1
  41. package/dist/src/core/config/index.d.ts +1 -0
  42. package/dist/src/core/config/index.d.ts.map +1 -1
  43. package/dist/src/core/config/index.js +1 -0
  44. package/dist/src/core/config/index.js.map +1 -1
  45. package/dist/src/core/config/types.d.ts +6 -0
  46. package/dist/src/core/config/types.d.ts.map +1 -1
  47. package/dist/src/core/config/types.js.map +1 -1
  48. package/dist/src/core/dashboard/dashboard-data.d.ts +156 -0
  49. package/dist/src/core/dashboard/dashboard-data.d.ts.map +1 -0
  50. package/dist/src/core/dashboard/dashboard-data.js +191 -0
  51. package/dist/src/core/dashboard/dashboard-data.js.map +1 -0
  52. package/dist/src/core/dashboard/index.d.ts +9 -0
  53. package/dist/src/core/dashboard/index.d.ts.map +1 -0
  54. package/dist/src/core/dashboard/index.js +9 -0
  55. package/dist/src/core/dashboard/index.js.map +1 -0
  56. package/dist/src/core/discrepancy/analyzers/api-route-analyzer.d.ts +77 -0
  57. package/dist/src/core/discrepancy/analyzers/api-route-analyzer.d.ts.map +1 -0
  58. package/dist/src/core/discrepancy/analyzers/api-route-analyzer.js +286 -0
  59. package/dist/src/core/discrepancy/analyzers/api-route-analyzer.js.map +1 -0
  60. package/dist/src/core/discrepancy/analyzers/index.d.ts +8 -0
  61. package/dist/src/core/discrepancy/analyzers/index.d.ts.map +1 -0
  62. package/dist/src/core/discrepancy/analyzers/index.js +8 -0
  63. package/dist/src/core/discrepancy/analyzers/index.js.map +1 -0
  64. package/dist/src/core/discrepancy/analyzers/typescript-analyzer.d.ts +96 -0
  65. package/dist/src/core/discrepancy/analyzers/typescript-analyzer.d.ts.map +1 -0
  66. package/dist/src/core/discrepancy/analyzers/typescript-analyzer.js +247 -0
  67. package/dist/src/core/discrepancy/analyzers/typescript-analyzer.js.map +1 -0
  68. package/dist/src/core/discrepancy/brownfield-manager.d.ts +88 -0
  69. package/dist/src/core/discrepancy/brownfield-manager.d.ts.map +1 -0
  70. package/dist/src/core/discrepancy/brownfield-manager.js +520 -0
  71. package/dist/src/core/discrepancy/brownfield-manager.js.map +1 -0
  72. package/dist/src/core/discrepancy/brownfield-types.d.ts +174 -0
  73. package/dist/src/core/discrepancy/brownfield-types.d.ts.map +1 -0
  74. package/dist/src/core/discrepancy/brownfield-types.js +11 -0
  75. package/dist/src/core/discrepancy/brownfield-types.js.map +1 -0
  76. package/dist/src/core/discrepancy/detector.d.ts +92 -0
  77. package/dist/src/core/discrepancy/detector.d.ts.map +1 -0
  78. package/dist/src/core/discrepancy/detector.js +346 -0
  79. package/dist/src/core/discrepancy/detector.js.map +1 -0
  80. package/dist/src/core/discrepancy/increment-generator.d.ts +51 -0
  81. package/dist/src/core/discrepancy/increment-generator.d.ts.map +1 -0
  82. package/dist/src/core/discrepancy/increment-generator.js +234 -0
  83. package/dist/src/core/discrepancy/increment-generator.js.map +1 -0
  84. package/dist/src/core/discrepancy/index.d.ts +18 -0
  85. package/dist/src/core/discrepancy/index.d.ts.map +1 -0
  86. package/dist/src/core/discrepancy/index.js +24 -0
  87. package/dist/src/core/discrepancy/index.js.map +1 -0
  88. package/dist/src/core/discrepancy/severity-classifier.d.ts +81 -0
  89. package/dist/src/core/discrepancy/severity-classifier.d.ts.map +1 -0
  90. package/dist/src/core/discrepancy/severity-classifier.js +289 -0
  91. package/dist/src/core/discrepancy/severity-classifier.js.map +1 -0
  92. package/dist/src/core/discrepancy/spec-parser.d.ts +74 -0
  93. package/dist/src/core/discrepancy/spec-parser.d.ts.map +1 -0
  94. package/dist/src/core/discrepancy/spec-parser.js +213 -0
  95. package/dist/src/core/discrepancy/spec-parser.js.map +1 -0
  96. package/dist/src/core/discrepancy/update-recommender.d.ts +77 -0
  97. package/dist/src/core/discrepancy/update-recommender.d.ts.map +1 -0
  98. package/dist/src/core/discrepancy/update-recommender.js +323 -0
  99. package/dist/src/core/discrepancy/update-recommender.js.map +1 -0
  100. package/dist/src/core/living-docs/living-docs-sync.d.ts +13 -16
  101. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  102. package/dist/src/core/living-docs/living-docs-sync.js +31 -112
  103. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  104. package/dist/src/core/logs/index.d.ts +10 -0
  105. package/dist/src/core/logs/index.d.ts.map +1 -0
  106. package/dist/src/core/logs/index.js +10 -0
  107. package/dist/src/core/logs/index.js.map +1 -0
  108. package/dist/src/core/logs/log-aggregator.d.ts +130 -0
  109. package/dist/src/core/logs/log-aggregator.d.ts.map +1 -0
  110. package/dist/src/core/logs/log-aggregator.js +206 -0
  111. package/dist/src/core/logs/log-aggregator.js.map +1 -0
  112. package/dist/src/core/logs/log-exporter.d.ts +81 -0
  113. package/dist/src/core/logs/log-exporter.d.ts.map +1 -0
  114. package/dist/src/core/logs/log-exporter.js +141 -0
  115. package/dist/src/core/logs/log-exporter.js.map +1 -0
  116. package/dist/src/core/notifications/command-integration.d.ts +82 -0
  117. package/dist/src/core/notifications/command-integration.d.ts.map +1 -0
  118. package/dist/src/core/notifications/command-integration.js +80 -0
  119. package/dist/src/core/notifications/command-integration.js.map +1 -0
  120. package/dist/src/core/notifications/index.d.ts +12 -0
  121. package/dist/src/core/notifications/index.d.ts.map +1 -0
  122. package/dist/src/core/notifications/index.js +12 -0
  123. package/dist/src/core/notifications/index.js.map +1 -0
  124. package/dist/src/core/notifications/notification-display.d.ts +70 -0
  125. package/dist/src/core/notifications/notification-display.d.ts.map +1 -0
  126. package/dist/src/core/notifications/notification-display.js +177 -0
  127. package/dist/src/core/notifications/notification-display.js.map +1 -0
  128. package/dist/src/core/notifications/notification-manager.d.ts +126 -0
  129. package/dist/src/core/notifications/notification-manager.d.ts.map +1 -0
  130. package/dist/src/core/notifications/notification-manager.js +287 -0
  131. package/dist/src/core/notifications/notification-manager.js.map +1 -0
  132. package/dist/src/core/notifications/notification-types.d.ts +159 -0
  133. package/dist/src/core/notifications/notification-types.d.ts.map +1 -0
  134. package/dist/src/core/notifications/notification-types.js +93 -0
  135. package/dist/src/core/notifications/notification-types.js.map +1 -0
  136. package/dist/src/core/scheduler/index.d.ts +11 -0
  137. package/dist/src/core/scheduler/index.d.ts.map +1 -0
  138. package/dist/src/core/scheduler/index.js +11 -0
  139. package/dist/src/core/scheduler/index.js.map +1 -0
  140. package/dist/src/core/scheduler/job-scheduler.d.ts +179 -0
  141. package/dist/src/core/scheduler/job-scheduler.d.ts.map +1 -0
  142. package/dist/src/core/scheduler/job-scheduler.js +282 -0
  143. package/dist/src/core/scheduler/job-scheduler.js.map +1 -0
  144. package/dist/src/core/scheduler/schedule-persistence.d.ts +83 -0
  145. package/dist/src/core/scheduler/schedule-persistence.d.ts.map +1 -0
  146. package/dist/src/core/scheduler/schedule-persistence.js +180 -0
  147. package/dist/src/core/scheduler/schedule-persistence.js.map +1 -0
  148. package/dist/src/core/scheduler/scheduled-job.d.ts +188 -0
  149. package/dist/src/core/scheduler/scheduled-job.d.ts.map +1 -0
  150. package/dist/src/core/scheduler/scheduled-job.js +182 -0
  151. package/dist/src/core/scheduler/scheduled-job.js.map +1 -0
  152. package/dist/src/core/sync/permission-enforcer.d.ts +206 -0
  153. package/dist/src/core/sync/permission-enforcer.d.ts.map +1 -0
  154. package/dist/src/core/sync/permission-enforcer.js +268 -0
  155. package/dist/src/core/sync/permission-enforcer.js.map +1 -0
  156. package/dist/src/core/sync/sync-audit-logger.d.ts +217 -0
  157. package/dist/src/core/sync/sync-audit-logger.d.ts.map +1 -0
  158. package/dist/src/core/sync/sync-audit-logger.js +327 -0
  159. package/dist/src/core/sync/sync-audit-logger.js.map +1 -0
  160. package/dist/src/core/sync/sync-interceptor.d.ts +190 -0
  161. package/dist/src/core/sync/sync-interceptor.d.ts.map +1 -0
  162. package/dist/src/core/sync/sync-interceptor.js +224 -0
  163. package/dist/src/core/sync/sync-interceptor.js.map +1 -0
  164. package/dist/src/core/types/increment-metadata.d.ts +5 -2
  165. package/dist/src/core/types/increment-metadata.d.ts.map +1 -1
  166. package/dist/src/core/types/sync-config.d.ts +267 -0
  167. package/dist/src/core/types/sync-config.d.ts.map +1 -0
  168. package/dist/src/core/types/sync-config.js +304 -0
  169. package/dist/src/core/types/sync-config.js.map +1 -0
  170. package/dist/src/hooks/index.d.ts +11 -0
  171. package/dist/src/hooks/index.d.ts.map +1 -0
  172. package/dist/src/hooks/index.js +11 -0
  173. package/dist/src/hooks/index.js.map +1 -0
  174. package/dist/src/hooks/platform.d.ts +125 -0
  175. package/dist/src/hooks/platform.d.ts.map +1 -0
  176. package/dist/src/hooks/platform.js +325 -0
  177. package/dist/src/hooks/platform.js.map +1 -0
  178. package/dist/src/hooks/processor.d.ts +20 -0
  179. package/dist/src/hooks/processor.d.ts.map +1 -0
  180. package/dist/src/hooks/processor.js +317 -0
  181. package/dist/src/hooks/processor.js.map +1 -0
  182. package/dist/src/hooks/scheduler-startup.d.ts +19 -0
  183. package/dist/src/hooks/scheduler-startup.d.ts.map +1 -0
  184. package/dist/src/hooks/scheduler-startup.js +92 -0
  185. package/dist/src/hooks/scheduler-startup.js.map +1 -0
  186. package/dist/src/hooks/session-start.d.ts +16 -0
  187. package/dist/src/hooks/session-start.d.ts.map +1 -0
  188. package/dist/src/hooks/session-start.js +92 -0
  189. package/dist/src/hooks/session-start.js.map +1 -0
  190. package/dist/src/importers/duplicate-detector.d.ts +13 -2
  191. package/dist/src/importers/duplicate-detector.d.ts.map +1 -1
  192. package/dist/src/importers/duplicate-detector.js +21 -2
  193. package/dist/src/importers/duplicate-detector.js.map +1 -1
  194. package/dist/src/importers/item-converter.d.ts +41 -2
  195. package/dist/src/importers/item-converter.d.ts.map +1 -1
  196. package/dist/src/importers/item-converter.js +225 -38
  197. package/dist/src/importers/item-converter.js.map +1 -1
  198. package/dist/src/living-docs/fs-id-allocator.d.ts +7 -0
  199. package/dist/src/living-docs/fs-id-allocator.d.ts.map +1 -1
  200. package/dist/src/living-docs/fs-id-allocator.js +30 -4
  201. package/dist/src/living-docs/fs-id-allocator.js.map +1 -1
  202. package/dist/src/sync/ado-sync-wrapper.d.ts +137 -0
  203. package/dist/src/sync/ado-sync-wrapper.d.ts.map +1 -0
  204. package/dist/src/sync/ado-sync-wrapper.js +148 -0
  205. package/dist/src/sync/ado-sync-wrapper.js.map +1 -0
  206. package/dist/src/sync/github-sync-wrapper.d.ts +195 -0
  207. package/dist/src/sync/github-sync-wrapper.d.ts.map +1 -0
  208. package/dist/src/sync/github-sync-wrapper.js +220 -0
  209. package/dist/src/sync/github-sync-wrapper.js.map +1 -0
  210. package/dist/src/sync/jira-sync-wrapper.d.ts +155 -0
  211. package/dist/src/sync/jira-sync-wrapper.d.ts.map +1 -0
  212. package/dist/src/sync/jira-sync-wrapper.js +175 -0
  213. package/dist/src/sync/jira-sync-wrapper.js.map +1 -0
  214. package/dist/src/utils/feature-id-derivation.d.ts +58 -0
  215. package/dist/src/utils/feature-id-derivation.d.ts.map +1 -0
  216. package/dist/src/utils/feature-id-derivation.js +77 -0
  217. package/dist/src/utils/feature-id-derivation.js.map +1 -0
  218. package/package.json +3 -1
  219. package/plugins/specweave/commands/specweave-discrepancies.md +141 -0
  220. package/plugins/specweave/commands/specweave-discrepancy-to-increment.md +160 -0
  221. package/plugins/specweave/commands/specweave-jobs.md +45 -2
  222. package/plugins/specweave/commands/specweave-notifications.md +92 -0
  223. package/plugins/specweave/commands/specweave-sync-logs.md +131 -0
  224. package/plugins/specweave/commands/specweave-sync-monitor.md +57 -0
  225. package/plugins/specweave/hooks/hooks.json +3 -3
  226. package/plugins/specweave/hooks/lib/scheduler-startup.sh +72 -0
  227. package/plugins/specweave/hooks/universal/dispatcher.mjs +246 -0
  228. package/plugins/specweave/hooks/universal/session-start.cmd +16 -0
  229. package/plugins/specweave/hooks/universal/session-start.ps1 +16 -0
  230. package/plugins/specweave/hooks/v2/dispatchers/session-start.sh +14 -5
  231. package/plugins/specweave/lib/vendor/core/types/increment-metadata.d.ts +5 -2
  232. package/plugins/specweave/skills/discrepancy-viewer.md +154 -0
  233. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +46 -0
  234. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +69 -0
  235. package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts +0 -26
  236. package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts.map +0 -1
  237. package/dist/plugins/specweave-github/lib/enhanced-github-sync.js +0 -249
  238. package/dist/plugins/specweave-github/lib/enhanced-github-sync.js.map +0 -1
  239. package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts +0 -28
  240. package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts.map +0 -1
  241. package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js +0 -156
  242. package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js.map +0 -1
  243. package/dist/src/core/sync/bidirectional-engine.d.ts +0 -119
  244. package/dist/src/core/sync/bidirectional-engine.d.ts.map +0 -1
  245. package/dist/src/core/sync/bidirectional-engine.js +0 -359
  246. package/dist/src/core/sync/bidirectional-engine.js.map +0 -1
  247. package/dist/src/core/sync/conflict-resolver.d.ts +0 -66
  248. package/dist/src/core/sync/conflict-resolver.d.ts.map +0 -1
  249. package/dist/src/core/sync/conflict-resolver.js +0 -108
  250. package/dist/src/core/sync/conflict-resolver.js.map +0 -1
  251. package/dist/src/core/sync/enhanced-content-builder.d.ts +0 -55
  252. package/dist/src/core/sync/enhanced-content-builder.d.ts.map +0 -1
  253. package/dist/src/core/sync/enhanced-content-builder.js +0 -203
  254. package/dist/src/core/sync/enhanced-content-builder.js.map +0 -1
  255. package/dist/src/core/sync/folder-mapper.d.ts +0 -71
  256. package/dist/src/core/sync/folder-mapper.d.ts.map +0 -1
  257. package/dist/src/core/sync/folder-mapper.js +0 -203
  258. package/dist/src/core/sync/folder-mapper.js.map +0 -1
  259. package/dist/src/core/sync/label-detector.d.ts +0 -66
  260. package/dist/src/core/sync/label-detector.d.ts.map +0 -1
  261. package/dist/src/core/sync/label-detector.js +0 -224
  262. package/dist/src/core/sync/label-detector.js.map +0 -1
  263. package/dist/src/core/sync/performance-optimizer.d.ts +0 -153
  264. package/dist/src/core/sync/performance-optimizer.d.ts.map +0 -1
  265. package/dist/src/core/sync/performance-optimizer.js +0 -220
  266. package/dist/src/core/sync/performance-optimizer.js.map +0 -1
  267. package/dist/src/core/sync/profile-selector.d.ts +0 -52
  268. package/dist/src/core/sync/profile-selector.d.ts.map +0 -1
  269. package/dist/src/core/sync/profile-selector.js +0 -179
  270. package/dist/src/core/sync/profile-selector.js.map +0 -1
  271. package/dist/src/core/sync/profile-validator.d.ts +0 -52
  272. package/dist/src/core/sync/profile-validator.d.ts.map +0 -1
  273. package/dist/src/core/sync/profile-validator.js +0 -170
  274. package/dist/src/core/sync/profile-validator.js.map +0 -1
  275. package/dist/src/core/sync/rate-limiter.d.ts +0 -116
  276. package/dist/src/core/sync/rate-limiter.d.ts.map +0 -1
  277. package/dist/src/core/sync/rate-limiter.js +0 -308
  278. package/dist/src/core/sync/rate-limiter.js.map +0 -1
  279. package/dist/src/core/sync/retry-handler.d.ts +0 -98
  280. package/dist/src/core/sync/retry-handler.d.ts.map +0 -1
  281. package/dist/src/core/sync/retry-handler.js +0 -196
  282. package/dist/src/core/sync/retry-handler.js.map +0 -1
  283. package/dist/src/core/sync/retry-logic.d.ts +0 -64
  284. package/dist/src/core/sync/retry-logic.d.ts.map +0 -1
  285. package/dist/src/core/sync/retry-logic.js +0 -165
  286. package/dist/src/core/sync/retry-logic.js.map +0 -1
  287. package/dist/src/core/sync/status-cache.d.ts +0 -91
  288. package/dist/src/core/sync/status-cache.d.ts.map +0 -1
  289. package/dist/src/core/sync/status-cache.js +0 -140
  290. package/dist/src/core/sync/status-cache.js.map +0 -1
  291. package/dist/src/core/sync/status-mapper.d.ts +0 -69
  292. package/dist/src/core/sync/status-mapper.d.ts.map +0 -1
  293. package/dist/src/core/sync/status-mapper.js +0 -90
  294. package/dist/src/core/sync/status-mapper.js.map +0 -1
  295. package/dist/src/core/sync/status-sync-engine.d.ts +0 -162
  296. package/dist/src/core/sync/status-sync-engine.d.ts.map +0 -1
  297. package/dist/src/core/sync/status-sync-engine.js +0 -347
  298. package/dist/src/core/sync/status-sync-engine.js.map +0 -1
  299. package/dist/src/core/sync/sync-event-logger.d.ts +0 -113
  300. package/dist/src/core/sync/sync-event-logger.d.ts.map +0 -1
  301. package/dist/src/core/sync/sync-event-logger.js +0 -141
  302. package/dist/src/core/sync/sync-event-logger.js.map +0 -1
  303. package/dist/src/core/sync/time-range-selector.d.ts +0 -48
  304. package/dist/src/core/sync/time-range-selector.d.ts.map +0 -1
  305. package/dist/src/core/sync/time-range-selector.js +0 -224
  306. package/dist/src/core/sync/time-range-selector.js.map +0 -1
  307. package/dist/src/core/sync/types.d.ts +0 -52
  308. package/dist/src/core/sync/types.d.ts.map +0 -1
  309. package/dist/src/core/sync/types.js +0 -5
  310. package/dist/src/core/sync/types.js.map +0 -1
  311. package/dist/src/core/sync/workflow-detector.d.ts +0 -95
  312. package/dist/src/core/sync/workflow-detector.d.ts.map +0 -1
  313. package/dist/src/core/sync/workflow-detector.js +0 -175
  314. package/dist/src/core/sync/workflow-detector.js.map +0 -1
  315. package/plugins/specweave-github/lib/enhanced-github-sync.js +0 -220
  316. package/plugins/specweave-github/lib/enhanced-github-sync.ts +0 -322
  317. package/plugins/specweave-jira/lib/enhanced-jira-sync.js +0 -134
  318. package/plugins/specweave-jira/lib/enhanced-jira-sync.ts +0 -196
@@ -0,0 +1,417 @@
1
+ /**
2
+ * Brownfield Analysis Worker
3
+ *
4
+ * Performs brownfield documentation analysis in phases:
5
+ * 1. Discovery - Find all code/doc files
6
+ * 2. Code Analysis - Extract signatures, APIs
7
+ * 3. Doc Matching - Match code to docs
8
+ * 4. Discrepancy Detection - Find documentation gaps
9
+ * 5. Reporting - Generate summary
10
+ *
11
+ * Supports pause/resume via checkpoints.
12
+ */
13
+ import * as fs from 'node:fs';
14
+ import * as path from 'node:path';
15
+ import { updateBrownfieldProgress, completeBrownfieldJob, failBrownfieldJob, } from '../../core/background/index.js';
16
+ import { BrownfieldDiscrepancyManager, } from '../../core/discrepancy/index.js';
17
+ import { consoleLogger } from '../../utils/logger.js';
18
+ /**
19
+ * Brownfield Analysis Worker
20
+ */
21
+ export class BrownfieldAnalysisWorker {
22
+ constructor(projectPath, jobId, config, options = {}) {
23
+ this.projectPath = projectPath;
24
+ this.jobId = jobId;
25
+ this.config = config;
26
+ this.logger = options.logger ?? consoleLogger;
27
+ this.discrepancyManager = new BrownfieldDiscrepancyManager(projectPath, {
28
+ logger: this.logger,
29
+ });
30
+ this.context = {
31
+ projectPath,
32
+ sourceDocsPath: config.sourceDocsPath,
33
+ depth: config.analysisDepth,
34
+ codeFiles: [],
35
+ docFiles: [],
36
+ modules: [],
37
+ docs: [],
38
+ };
39
+ }
40
+ /**
41
+ * Run the brownfield analysis
42
+ */
43
+ async run() {
44
+ const phases = [
45
+ 'discovery',
46
+ 'code-analysis',
47
+ 'doc-matching',
48
+ 'discrepancy-detect',
49
+ 'reporting',
50
+ ];
51
+ // Resume from checkpoint if exists
52
+ const startPhaseIndex = this.config.checkpoint
53
+ ? phases.indexOf(this.config.checkpoint.phase)
54
+ : 0;
55
+ let discrepancyCount = 0;
56
+ try {
57
+ for (let i = startPhaseIndex; i < phases.length; i++) {
58
+ const phase = phases[i];
59
+ this.logger.log(`Starting phase: ${phase}`);
60
+ updateBrownfieldProgress(this.projectPath, this.jobId, phase, 0, 100);
61
+ switch (phase) {
62
+ case 'discovery':
63
+ await this.runDiscoveryPhase();
64
+ break;
65
+ case 'code-analysis':
66
+ await this.runCodeAnalysisPhase();
67
+ break;
68
+ case 'doc-matching':
69
+ await this.runDocMatchingPhase();
70
+ break;
71
+ case 'discrepancy-detect':
72
+ discrepancyCount = await this.runDiscrepancyDetectionPhase();
73
+ break;
74
+ case 'reporting':
75
+ await this.runReportingPhase(discrepancyCount);
76
+ break;
77
+ }
78
+ updateBrownfieldProgress(this.projectPath, this.jobId, phase, 100, 100);
79
+ this.logger.log(`Completed phase: ${phase}`);
80
+ }
81
+ completeBrownfieldJob(this.projectPath, this.jobId, discrepancyCount);
82
+ return discrepancyCount;
83
+ }
84
+ catch (error) {
85
+ const errorMsg = error instanceof Error ? error.message : String(error);
86
+ this.logger.error('Brownfield analysis failed:', error);
87
+ failBrownfieldJob(this.projectPath, this.jobId, errorMsg);
88
+ throw error;
89
+ }
90
+ }
91
+ /**
92
+ * Phase 1: Discovery - Find all code and documentation files
93
+ */
94
+ async runDiscoveryPhase() {
95
+ this.logger.log('Discovering files...');
96
+ // Find code files
97
+ this.context.codeFiles = this.findFiles(this.projectPath, [
98
+ '.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs',
99
+ ], ['code']);
100
+ // Find documentation files
101
+ const docPaths = this.context.sourceDocsPath
102
+ ? [path.join(this.projectPath, this.context.sourceDocsPath)]
103
+ : [this.projectPath];
104
+ for (const docPath of docPaths) {
105
+ if (fs.existsSync(docPath)) {
106
+ this.context.docFiles.push(...this.findFiles(docPath, [
107
+ '.md', '.mdx', '.rst', '.txt',
108
+ ], ['doc']));
109
+ }
110
+ }
111
+ this.logger.log(`Found ${this.context.codeFiles.length} code files`);
112
+ this.logger.log(`Found ${this.context.docFiles.length} doc files`);
113
+ }
114
+ /**
115
+ * Phase 2: Code Analysis - Extract exports and signatures
116
+ */
117
+ async runCodeAnalysisPhase() {
118
+ this.logger.log('Analyzing code...');
119
+ // Group files by directory to form modules
120
+ const moduleMap = new Map();
121
+ for (const file of this.context.codeFiles) {
122
+ const dir = path.dirname(file.relativePath);
123
+ if (!moduleMap.has(dir)) {
124
+ moduleMap.set(dir, []);
125
+ }
126
+ moduleMap.get(dir).push(file);
127
+ }
128
+ // Analyze each module
129
+ for (const [modulePath, files] of moduleMap.entries()) {
130
+ const module = this.analyzeModule(modulePath, files);
131
+ if (module) {
132
+ this.context.modules.push(module);
133
+ }
134
+ }
135
+ this.logger.log(`Analyzed ${this.context.modules.length} modules`);
136
+ }
137
+ /**
138
+ * Phase 3: Doc Matching - Match docs to code modules
139
+ */
140
+ async runDocMatchingPhase() {
141
+ this.logger.log('Matching documentation...');
142
+ for (const docFile of this.context.docFiles) {
143
+ const docInfo = this.parseDocFile(docFile);
144
+ if (docInfo) {
145
+ this.context.docs.push(docInfo);
146
+ }
147
+ }
148
+ this.logger.log(`Parsed ${this.context.docs.length} doc files`);
149
+ }
150
+ /**
151
+ * Phase 4: Discrepancy Detection - Find documentation gaps
152
+ */
153
+ async runDiscrepancyDetectionPhase() {
154
+ this.logger.log('Detecting discrepancies...');
155
+ await this.discrepancyManager.ensureFolderStructure();
156
+ const discrepancies = [];
157
+ // Detect undocumented exports
158
+ for (const module of this.context.modules) {
159
+ const undocumented = module.exports.filter(e => !e.hasDocComment);
160
+ if (undocumented.length > 0) {
161
+ discrepancies.push({
162
+ type: 'missing-docs',
163
+ module: module.name,
164
+ codeLocation: `${module.path}`,
165
+ summary: `${undocumented.length} undocumented exports in ${module.name}`,
166
+ details: `The following exports lack documentation:\n${undocumented.map(e => `- ${e.name} (${e.type})`).join('\n')}`,
167
+ evidence: {
168
+ codeSnippet: undocumented.slice(0, 5).map(e => e.signature || e.name).join('\n'),
169
+ },
170
+ priority: this.calculatePriority(undocumented.length, module.exports.length),
171
+ confidence: 90,
172
+ autoDetected: true,
173
+ status: 'pending',
174
+ detectedAt: new Date().toISOString(),
175
+ detectedBy: 'brownfield-analyzer',
176
+ lastChecked: new Date().toISOString(),
177
+ });
178
+ }
179
+ }
180
+ // Detect modules without any docs
181
+ const modulesWithoutDocs = this.context.modules.filter(m => {
182
+ const moduleName = m.name.toLowerCase();
183
+ return !this.context.docs.some(d => d.relativePath.toLowerCase().includes(moduleName) ||
184
+ d.topics.some(t => t.toLowerCase().includes(moduleName)));
185
+ });
186
+ for (const module of modulesWithoutDocs) {
187
+ discrepancies.push({
188
+ type: 'missing-docs',
189
+ module: module.name,
190
+ codeLocation: module.path,
191
+ summary: `No documentation found for module: ${module.name}`,
192
+ details: `Module ${module.name} has ${module.exports.length} exports but no matching documentation file.`,
193
+ evidence: {},
194
+ priority: 'medium',
195
+ confidence: 75,
196
+ autoDetected: true,
197
+ status: 'pending',
198
+ detectedAt: new Date().toISOString(),
199
+ detectedBy: 'brownfield-analyzer',
200
+ lastChecked: new Date().toISOString(),
201
+ });
202
+ }
203
+ // Create discrepancies in batch
204
+ if (discrepancies.length > 0) {
205
+ await this.discrepancyManager.createBatch(discrepancies);
206
+ }
207
+ this.logger.log(`Detected ${discrepancies.length} discrepancies`);
208
+ return discrepancies.length;
209
+ }
210
+ /**
211
+ * Phase 5: Reporting - Generate summary
212
+ */
213
+ async runReportingPhase(discrepancyCount) {
214
+ this.logger.log('Generating report...');
215
+ const stats = await this.discrepancyManager.getStats();
216
+ const report = {
217
+ generatedAt: new Date().toISOString(),
218
+ analysisDepth: this.context.depth,
219
+ codebase: {
220
+ codeFiles: this.context.codeFiles.length,
221
+ docFiles: this.context.docFiles.length,
222
+ modules: this.context.modules.length,
223
+ },
224
+ discrepancies: {
225
+ total: discrepancyCount,
226
+ byType: stats.byType,
227
+ byPriority: stats.byPriority,
228
+ },
229
+ recommendations: this.generateRecommendations(stats),
230
+ };
231
+ // Save report
232
+ const reportPath = path.join(this.projectPath, '.specweave', 'discrepancies', 'latest-report.json');
233
+ fs.writeFileSync(reportPath, JSON.stringify(report, null, 2));
234
+ this.logger.log(`Report saved to ${reportPath}`);
235
+ }
236
+ // ─────────────────────────────────────────────────────────────
237
+ // Helper methods
238
+ // ─────────────────────────────────────────────────────────────
239
+ findFiles(dir, extensions, types, maxDepth = 10) {
240
+ const files = [];
241
+ this.walkDir(dir, extensions, files, '', maxDepth, types[0]);
242
+ return files;
243
+ }
244
+ walkDir(dir, extensions, files, relativePath, depth, type) {
245
+ if (depth <= 0)
246
+ return;
247
+ if (!fs.existsSync(dir))
248
+ return;
249
+ // Skip common non-code directories
250
+ const skipDirs = ['node_modules', '.git', '.specweave', 'dist', 'build', 'coverage'];
251
+ const dirName = path.basename(dir);
252
+ if (skipDirs.includes(dirName))
253
+ return;
254
+ try {
255
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
256
+ for (const entry of entries) {
257
+ const fullPath = path.join(dir, entry.name);
258
+ const relPath = path.join(relativePath, entry.name);
259
+ if (entry.isDirectory()) {
260
+ this.walkDir(fullPath, extensions, files, relPath, depth - 1, type);
261
+ }
262
+ else if (entry.isFile()) {
263
+ const ext = path.extname(entry.name).toLowerCase();
264
+ if (extensions.includes(ext)) {
265
+ const stats = fs.statSync(fullPath);
266
+ files.push({
267
+ path: fullPath,
268
+ relativePath: relPath,
269
+ type,
270
+ extension: ext,
271
+ size: stats.size,
272
+ lastModified: stats.mtime,
273
+ });
274
+ }
275
+ }
276
+ }
277
+ }
278
+ catch {
279
+ // Ignore permission errors
280
+ }
281
+ }
282
+ analyzeModule(modulePath, files) {
283
+ const exports = [];
284
+ let lastModified = new Date(0);
285
+ for (const file of files) {
286
+ if (file.lastModified > lastModified) {
287
+ lastModified = file.lastModified;
288
+ }
289
+ // Quick analysis: look for export statements
290
+ try {
291
+ const content = fs.readFileSync(file.path, 'utf-8');
292
+ const fileExports = this.extractExports(content, file);
293
+ exports.push(...fileExports);
294
+ }
295
+ catch {
296
+ // Skip files that can't be read
297
+ }
298
+ }
299
+ if (exports.length === 0 && this.context.depth === 'quick') {
300
+ return null;
301
+ }
302
+ return {
303
+ name: modulePath || 'root',
304
+ path: modulePath,
305
+ exports,
306
+ hasTests: files.some(f => f.relativePath.includes('.test.') || f.relativePath.includes('.spec.')),
307
+ lastModified,
308
+ };
309
+ }
310
+ extractExports(content, file) {
311
+ const exports = [];
312
+ const lines = content.split('\n');
313
+ // Simple regex patterns for exports
314
+ const exportPatterns = [
315
+ { regex: /export\s+(?:async\s+)?function\s+(\w+)/g, type: 'function' },
316
+ { regex: /export\s+class\s+(\w+)/g, type: 'class' },
317
+ { regex: /export\s+(?:type|interface)\s+(\w+)/g, type: 'type' },
318
+ { regex: /export\s+const\s+(\w+)/g, type: 'const' },
319
+ { regex: /export\s+\{\s*([^}]+)\s*\}/g, type: 'variable' },
320
+ ];
321
+ for (let i = 0; i < lines.length; i++) {
322
+ const line = lines[i];
323
+ for (const pattern of exportPatterns) {
324
+ const matches = line.matchAll(pattern.regex);
325
+ for (const match of matches) {
326
+ const name = match[1].trim();
327
+ // Check if previous line has doc comment
328
+ const hasDocComment = i > 0 && (lines[i - 1].trim().startsWith('*/') ||
329
+ lines[i - 1].trim().startsWith('* ') ||
330
+ lines[i - 1].trim().startsWith('//'));
331
+ if (pattern.type === 'variable') {
332
+ // Handle export { a, b, c }
333
+ const names = name.split(',').map(n => n.trim().split(' ')[0]);
334
+ for (const n of names) {
335
+ if (n && !n.includes('type')) {
336
+ exports.push({
337
+ name: n,
338
+ type: 'variable',
339
+ line: i + 1,
340
+ hasDocComment: false, // Can't easily detect for re-exports
341
+ });
342
+ }
343
+ }
344
+ }
345
+ else {
346
+ exports.push({
347
+ name,
348
+ type: pattern.type,
349
+ line: i + 1,
350
+ hasDocComment,
351
+ signature: line.trim().slice(0, 100),
352
+ });
353
+ }
354
+ }
355
+ }
356
+ }
357
+ return exports;
358
+ }
359
+ parseDocFile(file) {
360
+ try {
361
+ const content = fs.readFileSync(file.path, 'utf-8');
362
+ // Extract title (first heading)
363
+ const titleMatch = content.match(/^#\s+(.+)$/m);
364
+ const title = titleMatch?.[1];
365
+ // Extract topics (other headings)
366
+ const headingMatches = content.matchAll(/^#{2,}\s+(.+)$/gm);
367
+ const topics = Array.from(headingMatches).map(m => m[1]);
368
+ // Word count
369
+ const wordCount = content.split(/\s+/).length;
370
+ return {
371
+ path: file.path,
372
+ relativePath: file.relativePath,
373
+ title,
374
+ topics,
375
+ lastModified: file.lastModified,
376
+ wordCount,
377
+ };
378
+ }
379
+ catch {
380
+ return null;
381
+ }
382
+ }
383
+ calculatePriority(undocumentedCount, totalCount) {
384
+ const ratio = undocumentedCount / totalCount;
385
+ if (ratio > 0.8 && undocumentedCount > 5)
386
+ return 'critical';
387
+ if (ratio > 0.5 && undocumentedCount > 3)
388
+ return 'high';
389
+ if (ratio > 0.3)
390
+ return 'medium';
391
+ return 'low';
392
+ }
393
+ generateRecommendations(stats) {
394
+ const recommendations = [];
395
+ if (stats.byType['missing-docs'] > 10) {
396
+ recommendations.push('Consider creating a documentation sprint to address missing docs');
397
+ }
398
+ if (stats.byType['stale-docs'] > 5) {
399
+ recommendations.push('Review and update stale documentation');
400
+ }
401
+ if (stats.byPriority.critical > 0) {
402
+ recommendations.push('Address critical discrepancies first - they may impact onboarding');
403
+ }
404
+ if (stats.total > 50) {
405
+ recommendations.push('Consider using /specweave:discrepancy-to-increment to batch discrepancies');
406
+ }
407
+ return recommendations;
408
+ }
409
+ }
410
+ /**
411
+ * Run brownfield analysis for a job
412
+ */
413
+ export async function runBrownfieldAnalysis(projectPath, jobId, config, options = {}) {
414
+ const worker = new BrownfieldAnalysisWorker(projectPath, jobId, config, options);
415
+ return worker.run();
416
+ }
417
+ //# sourceMappingURL=brownfield-worker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brownfield-worker.js","sourceRoot":"","sources":["../../../../src/cli/workers/brownfield-worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAGL,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,gCAAgC,CAAC;AACxC,OAAO,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AED,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,WAAmB,EACnB,KAAa,EACb,MAA2B,EAC3B,UAA+B,EAAE;IAEjC,MAAM,MAAM,GAAG,IAAI,wBAAwB,CAAC,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACjF,OAAO,MAAM,CAAC,GAAG,EAAE,CAAC;AACtB,CAAC"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Brownfield Analysis Job Launcher
3
+ *
4
+ * Launches brownfield documentation analysis as a background job.
5
+ * Supports long-running analysis of large codebases (1000+ files).
6
+ */
7
+ import { BackgroundJob, BrownfieldPhase } from './types.js';
8
+ import { Logger } from '../../utils/logger.js';
9
+ /**
10
+ * Options for launching brownfield analysis
11
+ */
12
+ export interface BrownfieldLaunchOptions {
13
+ projectPath: string;
14
+ sourceDocsPath?: string;
15
+ analysisDepth: 'quick' | 'standard' | 'deep';
16
+ logger?: Logger;
17
+ }
18
+ /**
19
+ * Result of launching a brownfield job
20
+ */
21
+ export interface BrownfieldLaunchResult {
22
+ success: boolean;
23
+ jobId: string;
24
+ message: string;
25
+ }
26
+ /**
27
+ * Load job state from filesystem
28
+ */
29
+ export declare function loadJobState(projectPath: string, jobId: string): BackgroundJob | null;
30
+ /**
31
+ * List all brownfield jobs for a project
32
+ */
33
+ export declare function listBrownfieldJobs(projectPath: string): BackgroundJob[];
34
+ /**
35
+ * Get the most recent active brownfield job
36
+ */
37
+ export declare function getActiveBrownfieldJob(projectPath: string): BackgroundJob | null;
38
+ /**
39
+ * Update job progress
40
+ */
41
+ export declare function updateJobProgress(projectPath: string, jobId: string, phase: BrownfieldPhase, current: number, total: number, currentItem?: string): void;
42
+ /**
43
+ * Brownfield completion statistics
44
+ */
45
+ export interface BrownfieldCompletionStats {
46
+ discrepancyCount: number;
47
+ filesAnalyzed: number;
48
+ modulesDetected: number;
49
+ byType: Record<string, number>;
50
+ byPriority: Record<string, number>;
51
+ durationMs: number;
52
+ }
53
+ /**
54
+ * Mark job as completed with full statistics
55
+ */
56
+ export declare function completeJob(projectPath: string, jobId: string, discrepancyCount: number, stats?: BrownfieldCompletionStats): void;
57
+ /**
58
+ * Format completion notification for display
59
+ */
60
+ export declare function formatCompletionNotification(jobId: string, stats: BrownfieldCompletionStats): string;
61
+ /**
62
+ * Mark job as failed
63
+ */
64
+ export declare function failJob(projectPath: string, jobId: string, error: string): void;
65
+ /**
66
+ * Pause a running job
67
+ */
68
+ export declare function pauseJob(projectPath: string, jobId: string): boolean;
69
+ /**
70
+ * Launch brownfield analysis as a background job
71
+ *
72
+ * Note: In the current implementation, this creates the job state
73
+ * but the actual analysis is performed by the brownfield-worker
74
+ * which is invoked separately. For now, this sets up the job
75
+ * for future integration with a proper background process system.
76
+ */
77
+ export declare function launchBrownfieldAnalysisJob(options: BrownfieldLaunchOptions): Promise<BrownfieldLaunchResult>;
78
+ /**
79
+ * Resume a paused job
80
+ */
81
+ export declare function resumeJob(projectPath: string, jobId: string): boolean;
82
+ /**
83
+ * Delete a job and its state
84
+ */
85
+ export declare function deleteJob(projectPath: string, jobId: string): boolean;
86
+ //# sourceMappingURL=brownfield-launcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brownfield-launcher.d.ts","sourceRoot":"","sources":["../../../../src/core/background/brownfield-launcher.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EACL,aAAa,EAEb,eAAe,EAEhB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAiB,MAAM,uBAAuB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AAC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