edsger 0.50.0 → 0.52.0

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 (470) hide show
  1. package/.claude/settings.local.json +23 -3
  2. package/.env.local +12 -0
  3. package/README.md +25 -25
  4. package/dist/api/chat.d.ts +7 -7
  5. package/dist/api/chat.js +13 -13
  6. package/dist/api/cross-product.d.ts +10 -10
  7. package/dist/api/cross-product.js +30 -30
  8. package/dist/api/github.d.ts +5 -5
  9. package/dist/api/github.js +10 -10
  10. package/dist/api/intelligence.d.ts +3 -3
  11. package/dist/api/issues/approval-checker.d.ts +20 -0
  12. package/dist/api/{features → issues}/approval-checker.js +16 -16
  13. package/dist/api/issues/get-issue.d.ts +5 -0
  14. package/dist/api/issues/get-issue.js +21 -0
  15. package/dist/api/issues/index.d.ts +8 -0
  16. package/dist/api/issues/index.js +10 -0
  17. package/dist/api/issues/issue-utils.d.ts +23 -0
  18. package/dist/api/issues/issue-utils.js +80 -0
  19. package/dist/api/issues/status-updater.d.ts +41 -0
  20. package/dist/api/{features → issues}/status-updater.js +23 -23
  21. package/dist/api/{features → issues}/test-cases.d.ts +7 -7
  22. package/dist/api/{features → issues}/test-cases.js +12 -12
  23. package/dist/api/issues/update-issue.d.ts +20 -0
  24. package/dist/api/{features/update-feature.js → issues/update-issue.js} +22 -22
  25. package/dist/api/{features → issues}/user-stories.d.ts +5 -5
  26. package/dist/api/{features → issues}/user-stories.js +8 -8
  27. package/dist/api/products.d.ts +1 -1
  28. package/dist/api/tasks.d.ts +1 -1
  29. package/dist/api/test-reports.d.ts +2 -2
  30. package/dist/api/test-reports.js +4 -4
  31. package/dist/auth/login.js +1 -1
  32. package/dist/commands/agent-workflow/chat-worker.d.ts +7 -7
  33. package/dist/commands/agent-workflow/chat-worker.js +50 -50
  34. package/dist/commands/agent-workflow/index.d.ts +2 -2
  35. package/dist/commands/agent-workflow/index.js +3 -3
  36. package/dist/commands/agent-workflow/{feature-worker.d.ts → issue-worker.d.ts} +4 -4
  37. package/dist/commands/agent-workflow/{feature-worker.js → issue-worker.js} +12 -12
  38. package/dist/commands/agent-workflow/processor.d.ts +9 -9
  39. package/dist/commands/agent-workflow/processor.js +90 -90
  40. package/dist/commands/build/index.js +2 -2
  41. package/dist/commands/find-bugs/index.d.ts +11 -0
  42. package/dist/commands/find-bugs/index.js +39 -0
  43. package/dist/commands/find-features/index.d.ts +14 -0
  44. package/dist/commands/find-features/index.js +42 -0
  45. package/dist/commands/find-smells/index.d.ts +21 -0
  46. package/dist/commands/find-smells/index.js +65 -0
  47. package/dist/commands/init/prompts.js +1 -1
  48. package/dist/commands/init/templates.d.ts +1 -1
  49. package/dist/commands/init/templates.js +4 -4
  50. package/dist/commands/workflow/config/phase-configs.js +17 -17
  51. package/dist/commands/workflow/core/index.d.ts +1 -1
  52. package/dist/commands/workflow/core/index.js +2 -2
  53. package/dist/commands/workflow/core/issue-filter.d.ts +16 -0
  54. package/dist/commands/workflow/core/issue-filter.js +47 -0
  55. package/dist/commands/workflow/core/state-manager.d.ts +10 -10
  56. package/dist/commands/workflow/core/state-manager.js +10 -10
  57. package/dist/commands/workflow/core/workflow-logger.d.ts +9 -9
  58. package/dist/commands/workflow/core/workflow-logger.js +21 -21
  59. package/dist/commands/workflow/executors/phase-executor.d.ts +2 -2
  60. package/dist/commands/workflow/executors/phase-executor.js +32 -32
  61. package/dist/commands/workflow/issue-coordinator.d.ts +18 -0
  62. package/dist/commands/workflow/{feature-coordinator.js → issue-coordinator.js} +29 -29
  63. package/dist/commands/workflow/phase-orchestrator.d.ts +2 -2
  64. package/dist/commands/workflow/phase-orchestrator.js +82 -82
  65. package/dist/commands/workflow/processor.d.ts +7 -7
  66. package/dist/commands/workflow/processor.js +44 -44
  67. package/dist/config/{feature-status.d.ts → issue-status.d.ts} +14 -14
  68. package/dist/config/{feature-status.js → issue-status.js} +14 -14
  69. package/dist/errors/index.d.ts +6 -6
  70. package/dist/errors/index.js +11 -11
  71. package/dist/index.js +90 -1
  72. package/dist/phases/app-store-generation/context.js +6 -6
  73. package/dist/phases/app-store-generation/index.js +2 -2
  74. package/dist/phases/app-store-generation/prompts.js +2 -2
  75. package/dist/phases/autonomous/index.d.ts +3 -3
  76. package/dist/phases/autonomous/index.js +37 -37
  77. package/dist/phases/autonomous/prompts.d.ts +2 -2
  78. package/dist/phases/autonomous/prompts.js +4 -4
  79. package/dist/phases/branch-planning/context.d.ts +3 -3
  80. package/dist/phases/branch-planning/context.js +12 -12
  81. package/dist/phases/branch-planning/index.d.ts +3 -3
  82. package/dist/phases/branch-planning/index.js +32 -32
  83. package/dist/phases/branch-planning/outcome.d.ts +5 -5
  84. package/dist/phases/branch-planning/outcome.js +12 -12
  85. package/dist/phases/branch-planning/prompts.d.ts +3 -3
  86. package/dist/phases/branch-planning/prompts.js +13 -13
  87. package/dist/phases/bug-fixing/analyzer.d.ts +2 -2
  88. package/dist/phases/bug-fixing/analyzer.js +13 -13
  89. package/dist/phases/bug-fixing/context-fetcher.d.ts +3 -3
  90. package/dist/phases/bug-fixing/context-fetcher.js +18 -18
  91. package/dist/phases/bug-fixing/mcp-server.js +17 -18
  92. package/dist/phases/chat-processor/context.d.ts +5 -5
  93. package/dist/phases/chat-processor/context.js +17 -17
  94. package/dist/phases/chat-processor/index.d.ts +4 -4
  95. package/dist/phases/chat-processor/index.js +17 -17
  96. package/dist/phases/chat-processor/product-context.d.ts +3 -3
  97. package/dist/phases/chat-processor/product-context.js +16 -16
  98. package/dist/phases/chat-processor/product-prompts.d.ts +1 -1
  99. package/dist/phases/chat-processor/product-prompts.js +10 -10
  100. package/dist/phases/chat-processor/product-tools.d.ts +2 -2
  101. package/dist/phases/chat-processor/product-tools.js +33 -33
  102. package/dist/phases/chat-processor/prompts.d.ts +3 -3
  103. package/dist/phases/chat-processor/prompts.js +22 -22
  104. package/dist/phases/chat-processor/tools.js +46 -46
  105. package/dist/phases/code-implementation/branch-pr-creator.d.ts +3 -3
  106. package/dist/phases/code-implementation/branch-pr-creator.js +5 -5
  107. package/dist/phases/code-implementation/context.d.ts +3 -3
  108. package/dist/phases/code-implementation/context.js +18 -18
  109. package/dist/phases/code-implementation/index.d.ts +4 -4
  110. package/dist/phases/code-implementation/index.js +88 -88
  111. package/dist/phases/code-implementation/outcome.d.ts +3 -3
  112. package/dist/phases/code-implementation/outcome.js +6 -6
  113. package/dist/phases/code-implementation/prompts.d.ts +1 -1
  114. package/dist/phases/code-implementation/prompts.js +6 -6
  115. package/dist/phases/code-implementation-verification/agent.d.ts +3 -3
  116. package/dist/phases/code-implementation-verification/agent.js +5 -5
  117. package/dist/phases/code-implementation-verification/index.d.ts +3 -3
  118. package/dist/phases/code-implementation-verification/index.js +11 -11
  119. package/dist/phases/code-implementation-verification/prompts.d.ts +3 -3
  120. package/dist/phases/code-implementation-verification/prompts.js +7 -7
  121. package/dist/phases/code-refine/context.d.ts +8 -8
  122. package/dist/phases/code-refine/context.js +29 -29
  123. package/dist/phases/code-refine/index.d.ts +2 -2
  124. package/dist/phases/code-refine/index.js +20 -20
  125. package/dist/phases/code-refine/prompts.d.ts +1 -1
  126. package/dist/phases/code-refine/prompts.js +3 -3
  127. package/dist/phases/code-refine/refine-iteration.d.ts +1 -1
  128. package/dist/phases/code-refine/refine-iteration.js +4 -4
  129. package/dist/phases/code-refine/retry-handler.js +2 -2
  130. package/dist/phases/code-refine-verification/index.js +10 -10
  131. package/dist/phases/code-refine-verification/types.d.ts +2 -2
  132. package/dist/phases/code-review/context.d.ts +8 -8
  133. package/dist/phases/code-review/context.js +25 -25
  134. package/dist/phases/code-review/diff-utils.d.ts +1 -1
  135. package/dist/phases/code-review/diff-utils.js +1 -1
  136. package/dist/phases/code-review/index.d.ts +2 -2
  137. package/dist/phases/code-review/index.js +26 -26
  138. package/dist/phases/code-testing/analyzer.d.ts +2 -2
  139. package/dist/phases/code-testing/analyzer.js +18 -18
  140. package/dist/phases/code-testing/context-fetcher.d.ts +3 -3
  141. package/dist/phases/code-testing/context-fetcher.js +16 -16
  142. package/dist/phases/code-testing/prompts.d.ts +1 -1
  143. package/dist/phases/code-testing/prompts.js +5 -5
  144. package/dist/phases/find-bugs/index.d.ts +30 -0
  145. package/dist/phases/find-bugs/index.js +216 -0
  146. package/dist/phases/find-bugs/prompts.d.ts +22 -0
  147. package/dist/phases/find-bugs/prompts.js +101 -0
  148. package/dist/phases/find-bugs/state.d.ts +19 -0
  149. package/dist/phases/find-bugs/state.js +13 -0
  150. package/dist/phases/find-bugs/types.d.ts +21 -0
  151. package/dist/phases/find-bugs/types.js +16 -0
  152. package/dist/phases/find-features/index.d.ts +40 -0
  153. package/dist/phases/find-features/index.js +279 -0
  154. package/dist/phases/find-features/prompts.d.ts +43 -0
  155. package/dist/phases/find-features/prompts.js +138 -0
  156. package/dist/phases/find-features/state.d.ts +25 -0
  157. package/dist/phases/find-features/state.js +22 -0
  158. package/dist/phases/find-features/types.d.ts +27 -0
  159. package/dist/phases/find-features/types.js +16 -0
  160. package/dist/phases/find-shared/git.d.ts +24 -0
  161. package/dist/phases/find-shared/git.js +60 -0
  162. package/dist/phases/find-shared/mcp.d.ts +33 -0
  163. package/dist/phases/find-shared/mcp.js +69 -0
  164. package/dist/phases/find-shared/scan-state.d.ts +33 -0
  165. package/dist/phases/find-shared/scan-state.js +112 -0
  166. package/dist/phases/find-smells/index.d.ts +47 -0
  167. package/dist/phases/find-smells/index.js +278 -0
  168. package/dist/phases/find-smells/prompts.d.ts +30 -0
  169. package/dist/phases/find-smells/prompts.js +129 -0
  170. package/dist/phases/find-smells/state.d.ts +21 -0
  171. package/dist/phases/find-smells/state.js +17 -0
  172. package/dist/phases/find-smells/types.d.ts +51 -0
  173. package/dist/phases/find-smells/types.js +64 -0
  174. package/dist/phases/functional-testing/analyzer.d.ts +2 -2
  175. package/dist/phases/functional-testing/analyzer.js +40 -40
  176. package/dist/phases/functional-testing/context-fetcher.d.ts +3 -3
  177. package/dist/phases/functional-testing/context-fetcher.js +16 -16
  178. package/dist/phases/functional-testing/http-fallback.d.ts +2 -2
  179. package/dist/phases/functional-testing/http-fallback.js +9 -9
  180. package/dist/phases/functional-testing/mcp-server.js +23 -24
  181. package/dist/phases/functional-testing/prompts.d.ts +1 -1
  182. package/dist/phases/functional-testing/prompts.js +4 -4
  183. package/dist/phases/functional-testing/test-report-creator.d.ts +2 -2
  184. package/dist/phases/functional-testing/test-report-creator.js +10 -10
  185. package/dist/phases/functional-testing/test-retry-handler.js +3 -3
  186. package/dist/phases/growth-analysis/context.js +6 -6
  187. package/dist/phases/growth-analysis/index.js +2 -2
  188. package/dist/phases/growth-analysis/prompts.js +2 -2
  189. package/dist/phases/intelligence-analysis/context.js +7 -7
  190. package/dist/phases/intelligence-analysis/index.js +3 -3
  191. package/dist/phases/{feature-analysis → issue-analysis}/agent.js +1 -1
  192. package/dist/phases/issue-analysis/context.d.ts +24 -0
  193. package/dist/phases/{feature-analysis → issue-analysis}/context.js +30 -30
  194. package/dist/phases/issue-analysis/index.d.ts +8 -0
  195. package/dist/phases/{feature-analysis → issue-analysis}/index.js +29 -29
  196. package/dist/phases/issue-analysis/outcome.d.ts +40 -0
  197. package/dist/phases/{feature-analysis → issue-analysis}/outcome.js +17 -17
  198. package/dist/phases/{feature-analysis → issue-analysis}/prompts.d.ts +3 -3
  199. package/dist/phases/{feature-analysis → issue-analysis}/prompts.js +12 -12
  200. package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/agent.d.ts +2 -2
  201. package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/agent.js +1 -1
  202. package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/index.d.ts +5 -5
  203. package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/index.js +9 -9
  204. package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/prompts.d.ts +2 -2
  205. package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/prompts.js +7 -7
  206. package/dist/phases/output-contracts.js +37 -37
  207. package/dist/phases/pr-execution/context.d.ts +3 -3
  208. package/dist/phases/pr-execution/context.js +14 -14
  209. package/dist/phases/pr-execution/index.d.ts +2 -2
  210. package/dist/phases/pr-execution/index.js +22 -22
  211. package/dist/phases/pr-execution/outcome.d.ts +4 -4
  212. package/dist/phases/pr-execution/outcome.js +6 -6
  213. package/dist/phases/pr-execution/prompts.d.ts +4 -4
  214. package/dist/phases/pr-execution/prompts.js +6 -6
  215. package/dist/phases/pr-resolve/checklist-learner.js +2 -2
  216. package/dist/phases/pr-review/index.d.ts +1 -1
  217. package/dist/phases/pr-review/index.js +1 -1
  218. package/dist/phases/pr-review/prompts.d.ts +1 -1
  219. package/dist/phases/pr-review/prompts.js +1 -1
  220. package/dist/phases/pr-shared/context.d.ts +3 -3
  221. package/dist/phases/pr-shared/context.js +3 -3
  222. package/dist/phases/pr-splitting/context.d.ts +3 -3
  223. package/dist/phases/pr-splitting/context.js +16 -16
  224. package/dist/phases/pr-splitting/index.d.ts +4 -4
  225. package/dist/phases/pr-splitting/index.js +29 -29
  226. package/dist/phases/pr-splitting/outcome.d.ts +3 -3
  227. package/dist/phases/pr-splitting/outcome.js +7 -7
  228. package/dist/phases/pr-splitting/prompts.d.ts +3 -3
  229. package/dist/phases/pr-splitting/prompts.js +11 -11
  230. package/dist/phases/pull-request/creator.d.ts +4 -4
  231. package/dist/phases/pull-request/creator.js +25 -25
  232. package/dist/phases/pull-request/handler.d.ts +3 -3
  233. package/dist/phases/pull-request/handler.js +16 -16
  234. package/dist/phases/release-sync/index.js +2 -2
  235. package/dist/phases/run-sheet/agent.js +1 -2
  236. package/dist/phases/run-sheet/index.js +3 -3
  237. package/dist/phases/smoke-test/index.js +2 -2
  238. package/dist/phases/technical-design/context.d.ts +3 -3
  239. package/dist/phases/technical-design/context.js +11 -11
  240. package/dist/phases/technical-design/index.d.ts +2 -2
  241. package/dist/phases/technical-design/index.js +27 -27
  242. package/dist/phases/technical-design/outcome.d.ts +4 -4
  243. package/dist/phases/technical-design/outcome.js +6 -6
  244. package/dist/phases/technical-design/prompts.d.ts +2 -2
  245. package/dist/phases/technical-design/prompts.js +10 -10
  246. package/dist/phases/technical-design-verification/agent.d.ts +3 -3
  247. package/dist/phases/technical-design-verification/agent.js +4 -4
  248. package/dist/phases/technical-design-verification/index.d.ts +4 -4
  249. package/dist/phases/technical-design-verification/index.js +12 -12
  250. package/dist/phases/technical-design-verification/prompts.d.ts +3 -3
  251. package/dist/phases/technical-design-verification/prompts.js +6 -6
  252. package/dist/phases/test-cases-analysis/context.d.ts +5 -5
  253. package/dist/phases/test-cases-analysis/context.js +18 -18
  254. package/dist/phases/test-cases-analysis/formatters.js +7 -7
  255. package/dist/phases/test-cases-analysis/index.d.ts +1 -1
  256. package/dist/phases/test-cases-analysis/index.js +21 -21
  257. package/dist/phases/test-cases-analysis/outcome.d.ts +7 -7
  258. package/dist/phases/test-cases-analysis/outcome.js +13 -13
  259. package/dist/phases/test-cases-analysis/prompts.d.ts +3 -3
  260. package/dist/phases/test-cases-analysis/prompts.js +6 -6
  261. package/dist/phases/user-stories-analysis/context.d.ts +5 -5
  262. package/dist/phases/user-stories-analysis/context.js +18 -18
  263. package/dist/phases/user-stories-analysis/formatters.js +7 -7
  264. package/dist/phases/user-stories-analysis/index.d.ts +1 -1
  265. package/dist/phases/user-stories-analysis/index.js +21 -21
  266. package/dist/phases/user-stories-analysis/outcome.d.ts +7 -7
  267. package/dist/phases/user-stories-analysis/outcome.js +13 -13
  268. package/dist/phases/user-stories-analysis/prompts.d.ts +3 -3
  269. package/dist/phases/user-stories-analysis/prompts.js +10 -10
  270. package/dist/services/audit-logs.d.ts +10 -10
  271. package/dist/services/audit-logs.js +12 -12
  272. package/dist/services/branches.d.ts +6 -6
  273. package/dist/services/branches.js +16 -16
  274. package/dist/services/checklist.d.ts +3 -3
  275. package/dist/services/checklist.js +11 -11
  276. package/dist/services/coaching/coaching-agent.js +2 -2
  277. package/dist/services/coaching/coaching-loop.d.ts +1 -1
  278. package/dist/services/coaching/coaching-loop.js +2 -2
  279. package/dist/services/coaching/phase-coaching.d.ts +2 -2
  280. package/dist/services/coaching/phase-coaching.js +3 -3
  281. package/dist/services/coaching/self-rating.js +1 -1
  282. package/dist/services/feedbacks.d.ts +4 -4
  283. package/dist/services/feedbacks.js +8 -8
  284. package/dist/services/phase-hooks/bindings-fetcher.d.ts +4 -4
  285. package/dist/services/phase-hooks/bindings-fetcher.js +8 -8
  286. package/dist/services/phase-hooks/hook-executor.js +1 -1
  287. package/dist/services/phase-hooks/hook-logging.d.ts +2 -2
  288. package/dist/services/phase-hooks/hook-logging.js +4 -4
  289. package/dist/services/phase-hooks/hook-runner.d.ts +1 -1
  290. package/dist/services/phase-hooks/hook-runner.js +4 -4
  291. package/dist/services/phase-hooks/types.d.ts +3 -3
  292. package/dist/services/phase-ratings.d.ts +7 -7
  293. package/dist/services/phase-ratings.js +8 -8
  294. package/dist/services/pull-requests.d.ts +4 -4
  295. package/dist/services/pull-requests.js +11 -11
  296. package/dist/services/skill-resolver.d.ts +1 -1
  297. package/dist/services/skill-resolver.js +1 -1
  298. package/dist/skills/phase/app-store-generation/SKILL.md +9 -9
  299. package/dist/skills/phase/autonomous/SKILL.md +2 -2
  300. package/dist/skills/phase/branch-planning/SKILL.md +12 -12
  301. package/dist/skills/phase/bug-fixing/SKILL.md +1 -1
  302. package/dist/skills/phase/code-implementation/SKILL.md +6 -6
  303. package/dist/skills/phase/code-implementation-verification/SKILL.md +3 -3
  304. package/dist/skills/phase/code-testing/SKILL.md +5 -5
  305. package/dist/skills/phase/functional-testing/SKILL.md +3 -3
  306. package/dist/skills/phase/growth-analysis/SKILL.md +8 -8
  307. package/dist/skills/phase/incremental-sync/SKILL.md +6 -6
  308. package/dist/skills/phase/intelligence-analysis/SKILL.md +7 -7
  309. package/dist/skills/phase/{feature-analysis → issue-analysis}/SKILL.md +8 -8
  310. package/dist/skills/phase/pr-execution/SKILL.md +7 -7
  311. package/dist/skills/phase/pr-splitting/SKILL.md +14 -14
  312. package/dist/skills/phase/smoke-test/SKILL.md +1 -1
  313. package/dist/skills/phase/technical-design/SKILL.md +5 -5
  314. package/dist/skills/phase/test-cases-analysis/SKILL.md +4 -4
  315. package/dist/skills/phase/user-stories-analysis/SKILL.md +13 -13
  316. package/dist/system/session-manager.d.ts +3 -3
  317. package/dist/system/session-manager.js +3 -3
  318. package/dist/system/sleep-notification.js +2 -2
  319. package/dist/system/sleep-prevention.js +1 -1
  320. package/dist/types/index.d.ts +21 -21
  321. package/dist/types/{features.d.ts → issues.d.ts} +3 -3
  322. package/dist/types/pipeline.d.ts +4 -4
  323. package/dist/updater/auto-updater.d.ts +2 -2
  324. package/dist/updater/auto-updater.js +3 -3
  325. package/dist/utils/conflict-resolver.d.ts +1 -1
  326. package/dist/utils/conflict-resolver.js +5 -5
  327. package/dist/utils/formatters.d.ts +4 -4
  328. package/dist/utils/formatters.js +29 -29
  329. package/dist/utils/git-branch-manager-async.d.ts +6 -6
  330. package/dist/utils/git-branch-manager-async.js +41 -41
  331. package/dist/utils/git-branch-manager.d.ts +11 -11
  332. package/dist/utils/git-branch-manager.js +42 -42
  333. package/dist/utils/image-downloader.d.ts +4 -4
  334. package/dist/utils/image-downloader.js +17 -17
  335. package/dist/utils/pipeline-logger.d.ts +1 -1
  336. package/dist/utils/pipeline-logger.js +5 -5
  337. package/dist/workspace/workspace-manager.d.ts +17 -17
  338. package/dist/workspace/workspace-manager.js +21 -21
  339. package/package.json +1 -1
  340. package/vitest.config.ts +4 -0
  341. package/dist/api/__tests__/app-store.test.d.ts +0 -7
  342. package/dist/api/__tests__/app-store.test.js +0 -60
  343. package/dist/api/__tests__/intelligence.test.d.ts +0 -11
  344. package/dist/api/__tests__/intelligence.test.js +0 -315
  345. package/dist/api/features/__tests__/feature-utils.test.d.ts +0 -4
  346. package/dist/api/features/__tests__/feature-utils.test.js +0 -370
  347. package/dist/api/features/__tests__/status-updater.test.d.ts +0 -4
  348. package/dist/api/features/__tests__/status-updater.test.js +0 -88
  349. package/dist/api/features/approval-checker.d.ts +0 -20
  350. package/dist/api/features/feature-utils.d.ts +0 -23
  351. package/dist/api/features/feature-utils.js +0 -80
  352. package/dist/api/features/get-feature.d.ts +0 -5
  353. package/dist/api/features/get-feature.js +0 -21
  354. package/dist/api/features/index.d.ts +0 -8
  355. package/dist/api/features/index.js +0 -10
  356. package/dist/api/features/status-updater.d.ts +0 -41
  357. package/dist/api/features/update-feature.d.ts +0 -20
  358. package/dist/commands/build/__tests__/build.test.d.ts +0 -5
  359. package/dist/commands/build/__tests__/build.test.js +0 -206
  360. package/dist/commands/build/__tests__/detect-project.test.d.ts +0 -6
  361. package/dist/commands/build/__tests__/detect-project.test.js +0 -160
  362. package/dist/commands/build/__tests__/run-build.test.d.ts +0 -6
  363. package/dist/commands/build/__tests__/run-build.test.js +0 -433
  364. package/dist/commands/intelligence/__tests__/command.test.d.ts +0 -4
  365. package/dist/commands/intelligence/__tests__/command.test.js +0 -48
  366. package/dist/commands/workflow/core/__tests__/feature-filter.test.d.ts +0 -5
  367. package/dist/commands/workflow/core/__tests__/feature-filter.test.js +0 -316
  368. package/dist/commands/workflow/core/__tests__/pipeline-evaluator.test.d.ts +0 -4
  369. package/dist/commands/workflow/core/__tests__/pipeline-evaluator.test.js +0 -397
  370. package/dist/commands/workflow/core/__tests__/state-manager.test.d.ts +0 -4
  371. package/dist/commands/workflow/core/__tests__/state-manager.test.js +0 -384
  372. package/dist/commands/workflow/core/feature-filter.d.ts +0 -16
  373. package/dist/commands/workflow/core/feature-filter.js +0 -47
  374. package/dist/commands/workflow/feature-coordinator.d.ts +0 -18
  375. package/dist/config/__tests__/config.test.d.ts +0 -4
  376. package/dist/config/__tests__/config.test.js +0 -286
  377. package/dist/config/__tests__/feature-status.test.d.ts +0 -4
  378. package/dist/config/__tests__/feature-status.test.js +0 -111
  379. package/dist/errors/__tests__/index.test.d.ts +0 -4
  380. package/dist/errors/__tests__/index.test.js +0 -349
  381. package/dist/phases/app-store-generation/__tests__/agent.test.d.ts +0 -5
  382. package/dist/phases/app-store-generation/__tests__/agent.test.js +0 -142
  383. package/dist/phases/app-store-generation/__tests__/context.test.d.ts +0 -4
  384. package/dist/phases/app-store-generation/__tests__/context.test.js +0 -284
  385. package/dist/phases/app-store-generation/__tests__/prompts.test.d.ts +0 -4
  386. package/dist/phases/app-store-generation/__tests__/prompts.test.js +0 -122
  387. package/dist/phases/app-store-generation/__tests__/screenshot-composer.test.d.ts +0 -5
  388. package/dist/phases/app-store-generation/__tests__/screenshot-composer.test.js +0 -826
  389. package/dist/phases/code-review/__tests__/diff-utils.test.js +0 -101
  390. package/dist/phases/feature-analysis/context.d.ts +0 -24
  391. package/dist/phases/feature-analysis/index.d.ts +0 -8
  392. package/dist/phases/feature-analysis/outcome.d.ts +0 -40
  393. package/dist/phases/intelligence-analysis/__tests__/context.test.d.ts +0 -4
  394. package/dist/phases/intelligence-analysis/__tests__/context.test.js +0 -192
  395. package/dist/phases/intelligence-analysis/__tests__/matching.test.d.ts +0 -13
  396. package/dist/phases/intelligence-analysis/__tests__/matching.test.js +0 -154
  397. package/dist/phases/intelligence-analysis/__tests__/orchestration.test.d.ts +0 -5
  398. package/dist/phases/intelligence-analysis/__tests__/orchestration.test.js +0 -378
  399. package/dist/phases/intelligence-analysis/__tests__/prompts.test.d.ts +0 -4
  400. package/dist/phases/intelligence-analysis/__tests__/prompts.test.js +0 -33
  401. package/dist/phases/pr-execution/__tests__/file-assigner.test.d.ts +0 -1
  402. package/dist/phases/pr-execution/__tests__/file-assigner.test.js +0 -303
  403. package/dist/phases/pr-resolve/__tests__/checklist-learner.test.d.ts +0 -1
  404. package/dist/phases/pr-resolve/__tests__/checklist-learner.test.js +0 -157
  405. package/dist/phases/pr-resolve/__tests__/prompts.test.d.ts +0 -1
  406. package/dist/phases/pr-resolve/__tests__/prompts.test.js +0 -116
  407. package/dist/phases/pr-resolve/__tests__/resolve-mapping.test.d.ts +0 -1
  408. package/dist/phases/pr-resolve/__tests__/resolve-mapping.test.js +0 -138
  409. package/dist/phases/pr-resolve/__tests__/types.test.d.ts +0 -1
  410. package/dist/phases/pr-resolve/__tests__/types.test.js +0 -43
  411. package/dist/phases/pr-resolve/__tests__/workspace.test.d.ts +0 -1
  412. package/dist/phases/pr-resolve/__tests__/workspace.test.js +0 -111
  413. package/dist/phases/pr-review/__tests__/prompts.test.d.ts +0 -1
  414. package/dist/phases/pr-review/__tests__/prompts.test.js +0 -49
  415. package/dist/phases/pr-review/__tests__/review-comments.test.d.ts +0 -1
  416. package/dist/phases/pr-review/__tests__/review-comments.test.js +0 -110
  417. package/dist/phases/pr-shared/__tests__/agent-utils.test.d.ts +0 -1
  418. package/dist/phases/pr-shared/__tests__/agent-utils.test.js +0 -91
  419. package/dist/phases/pr-shared/__tests__/context.test.d.ts +0 -1
  420. package/dist/phases/pr-shared/__tests__/context.test.js +0 -94
  421. package/dist/phases/pr-splitting/__tests__/import-dep-validator.test.d.ts +0 -1
  422. package/dist/phases/pr-splitting/__tests__/import-dep-validator.test.js +0 -331
  423. package/dist/phases/run-sheet/render.d.ts +0 -60
  424. package/dist/phases/run-sheet/render.js +0 -297
  425. package/dist/phases/smoke-test/__tests__/agent.test.d.ts +0 -4
  426. package/dist/phases/smoke-test/__tests__/agent.test.js +0 -84
  427. package/dist/phases/smoke-test/__tests__/github.test.d.ts +0 -9
  428. package/dist/phases/smoke-test/__tests__/github.test.js +0 -120
  429. package/dist/phases/smoke-test/__tests__/snapshot.test.d.ts +0 -8
  430. package/dist/phases/smoke-test/__tests__/snapshot.test.js +0 -93
  431. package/dist/phases/smoke-test/github.d.ts +0 -54
  432. package/dist/phases/smoke-test/github.js +0 -101
  433. package/dist/phases/smoke-test/snapshot.d.ts +0 -27
  434. package/dist/phases/smoke-test/snapshot.js +0 -157
  435. package/dist/services/coaching/__tests__/coaching-agent.test.d.ts +0 -1
  436. package/dist/services/coaching/__tests__/coaching-agent.test.js +0 -74
  437. package/dist/services/coaching/__tests__/coaching-loop.test.d.ts +0 -1
  438. package/dist/services/coaching/__tests__/coaching-loop.test.js +0 -59
  439. package/dist/services/coaching/__tests__/self-rating.test.d.ts +0 -1
  440. package/dist/services/coaching/__tests__/self-rating.test.js +0 -188
  441. package/dist/services/lifecycle-agent/__tests__/phase-criteria.test.d.ts +0 -4
  442. package/dist/services/lifecycle-agent/__tests__/phase-criteria.test.js +0 -133
  443. package/dist/services/lifecycle-agent/__tests__/transition-rules.test.d.ts +0 -4
  444. package/dist/services/lifecycle-agent/__tests__/transition-rules.test.js +0 -336
  445. package/dist/services/lifecycle-agent/index.d.ts +0 -24
  446. package/dist/services/lifecycle-agent/index.js +0 -25
  447. package/dist/services/lifecycle-agent/phase-criteria.d.ts +0 -57
  448. package/dist/services/lifecycle-agent/phase-criteria.js +0 -335
  449. package/dist/services/lifecycle-agent/transition-rules.d.ts +0 -60
  450. package/dist/services/lifecycle-agent/transition-rules.js +0 -184
  451. package/dist/services/lifecycle-agent/types.d.ts +0 -190
  452. package/dist/services/lifecycle-agent/types.js +0 -12
  453. package/dist/services/phase-hooks/__tests__/bindings-fetcher.test.d.ts +0 -1
  454. package/dist/services/phase-hooks/__tests__/bindings-fetcher.test.js +0 -122
  455. package/dist/services/phase-hooks/__tests__/hook-executor.test.d.ts +0 -1
  456. package/dist/services/phase-hooks/__tests__/hook-executor.test.js +0 -321
  457. package/dist/services/phase-hooks/__tests__/hook-runner.test.d.ts +0 -1
  458. package/dist/services/phase-hooks/__tests__/hook-runner.test.js +0 -261
  459. package/dist/services/phase-hooks/__tests__/plugin-loader.test.d.ts +0 -1
  460. package/dist/services/phase-hooks/__tests__/plugin-loader.test.js +0 -158
  461. package/dist/services/video/__tests__/video-pipeline.test.d.ts +0 -6
  462. package/dist/services/video/__tests__/video-pipeline.test.js +0 -249
  463. package/dist/types/features.js +0 -1
  464. package/dist/workspace/__tests__/workspace-manager.test.d.ts +0 -7
  465. package/dist/workspace/__tests__/workspace-manager.test.js +0 -52
  466. /package/dist/api/{features → issues}/batch-operations.d.ts +0 -0
  467. /package/dist/api/{features → issues}/batch-operations.js +0 -0
  468. /package/dist/phases/{feature-analysis → issue-analysis}/agent.d.ts +0 -0
  469. /package/dist/skills/phase/{feature-analysis-verification → issue-analysis-verification}/SKILL.md +0 -0
  470. /package/dist/{phases/code-review/__tests__/diff-utils.test.d.ts → types/issues.js} +0 -0
@@ -1,370 +0,0 @@
1
- /**
2
- * Unit tests for feature utility functions
3
- */
4
- import assert from 'node:assert';
5
- import { describe, it } from 'node:test';
6
- import { filterFeaturesByStatus, sortFeaturesByUpdatedAt, } from '../feature-utils.js';
7
- void describe('Feature Utils', () => {
8
- void describe('sortFeaturesByUpdatedAt', () => {
9
- void it('should sort features by updated_at in ascending order (oldest first)', () => {
10
- const features = [
11
- {
12
- id: '1',
13
- name: 'Feature 1',
14
- status: 'ready_for_ai',
15
- product_id: 'test-product',
16
- updated_at: '2024-01-15T10:00:00Z',
17
- },
18
- {
19
- id: '2',
20
- name: 'Feature 2',
21
- status: 'ready_for_ai',
22
- product_id: 'test-product',
23
- updated_at: '2024-01-10T10:00:00Z',
24
- },
25
- {
26
- id: '3',
27
- name: 'Feature 3',
28
- status: 'ready_for_ai',
29
- product_id: 'test-product',
30
- updated_at: '2024-01-20T10:00:00Z',
31
- },
32
- ];
33
- const sorted = sortFeaturesByUpdatedAt(features);
34
- // Should be sorted oldest first: Feature 2, Feature 1, Feature 3
35
- assert.strictEqual(sorted[0].id, '2', 'First should be Feature 2 (oldest)');
36
- assert.strictEqual(sorted[1].id, '1', 'Second should be Feature 1');
37
- assert.strictEqual(sorted[2].id, '3', 'Third should be Feature 3 (newest)');
38
- });
39
- void it('should handle features with missing updated_at dates', () => {
40
- const features = [
41
- {
42
- id: '1',
43
- name: 'Feature 1',
44
- status: 'ready_for_ai',
45
- product_id: 'test-product',
46
- updated_at: '2024-01-15T10:00:00Z',
47
- },
48
- {
49
- id: '2',
50
- name: 'Feature 2',
51
- status: 'ready_for_ai',
52
- product_id: 'test-product',
53
- // Missing updated_at
54
- },
55
- {
56
- id: '3',
57
- name: 'Feature 3',
58
- status: 'ready_for_ai',
59
- product_id: 'test-product',
60
- updated_at: '2024-01-10T10:00:00Z',
61
- },
62
- ];
63
- const sorted = sortFeaturesByUpdatedAt(features);
64
- // Feature without updated_at should be treated as epoch (1970-01-01)
65
- // and sorted first
66
- assert.strictEqual(sorted[0].id, '2', 'Feature without date should come first');
67
- assert.strictEqual(sorted[1].id, '3', 'Feature 3 should be second (older date)');
68
- assert.strictEqual(sorted[2].id, '1', 'Feature 1 should be third (newer date)');
69
- });
70
- void it('should handle empty array', () => {
71
- const features = [];
72
- const sorted = sortFeaturesByUpdatedAt(features);
73
- assert.strictEqual(sorted.length, 0, 'Empty array should remain empty');
74
- });
75
- void it('should handle single feature', () => {
76
- const features = [
77
- {
78
- id: '1',
79
- name: 'Feature 1',
80
- status: 'ready_for_ai',
81
- product_id: 'test-product',
82
- updated_at: '2024-01-15T10:00:00Z',
83
- },
84
- ];
85
- const sorted = sortFeaturesByUpdatedAt(features);
86
- assert.strictEqual(sorted.length, 1, 'Should return single feature');
87
- assert.strictEqual(sorted[0].id, '1', 'Should be the same feature');
88
- });
89
- void it('should create a new array and not mutate the original', () => {
90
- const features = [
91
- {
92
- id: '1',
93
- name: 'Feature 1',
94
- status: 'ready_for_ai',
95
- product_id: 'test-product',
96
- updated_at: '2024-01-15T10:00:00Z',
97
- },
98
- {
99
- id: '2',
100
- name: 'Feature 2',
101
- status: 'ready_for_ai',
102
- product_id: 'test-product',
103
- updated_at: '2024-01-10T10:00:00Z',
104
- },
105
- ];
106
- const originalOrder = features.map((f) => f.id);
107
- const sorted = sortFeaturesByUpdatedAt(features);
108
- const originalAfterSort = features.map((f) => f.id);
109
- // Original array should be unchanged
110
- assert.deepStrictEqual(originalAfterSort, originalOrder, 'Original array should not be mutated');
111
- // Sorted array should be different
112
- assert.notDeepStrictEqual(sorted.map((f) => f.id), originalOrder, 'Sorted array should have different order');
113
- });
114
- void it('should handle features with same updated_at timestamps consistently', () => {
115
- const sameTimestamp = '2024-01-15T10:00:00Z';
116
- const features = [
117
- {
118
- id: '1',
119
- name: 'Feature 1',
120
- status: 'ready_for_ai',
121
- product_id: 'test-product',
122
- updated_at: sameTimestamp,
123
- },
124
- {
125
- id: '2',
126
- name: 'Feature 2',
127
- status: 'ready_for_ai',
128
- product_id: 'test-product',
129
- updated_at: sameTimestamp,
130
- },
131
- {
132
- id: '3',
133
- name: 'Feature 3',
134
- status: 'ready_for_ai',
135
- product_id: 'test-product',
136
- updated_at: sameTimestamp,
137
- },
138
- ];
139
- const sorted = sortFeaturesByUpdatedAt(features);
140
- assert.strictEqual(sorted.length, 3, 'Should return all features');
141
- // Order should be stable (same as original for equal timestamps)
142
- // Note: JavaScript sort is stable in modern engines
143
- });
144
- void it('should handle various date formats correctly', () => {
145
- const features = [
146
- {
147
- id: '1',
148
- name: 'Feature 1',
149
- status: 'ready_for_ai',
150
- product_id: 'test-product',
151
- updated_at: '2024-01-15', // Date only
152
- },
153
- {
154
- id: '2',
155
- name: 'Feature 2',
156
- status: 'ready_for_ai',
157
- product_id: 'test-product',
158
- updated_at: '2024-01-10T10:00:00.000Z', // Full ISO format
159
- },
160
- {
161
- id: '3',
162
- name: 'Feature 3',
163
- status: 'ready_for_ai',
164
- product_id: 'test-product',
165
- updated_at: '2024-01-20T15:30:00Z', // ISO with time
166
- },
167
- ];
168
- const sorted = sortFeaturesByUpdatedAt(features);
169
- // Should handle different date formats and sort correctly
170
- assert.strictEqual(sorted[0].id, '2', 'Feature 2 should be first (oldest)');
171
- assert.strictEqual(sorted[1].id, '1', 'Feature 1 should be second');
172
- assert.strictEqual(sorted[2].id, '3', 'Feature 3 should be third (newest)');
173
- });
174
- });
175
- void describe('filterFeaturesByStatus', () => {
176
- void it('should filter features by exact status match', () => {
177
- const features = [
178
- {
179
- id: '1',
180
- name: 'Feature 1',
181
- status: 'ready_for_ai',
182
- product_id: 'test-product',
183
- },
184
- {
185
- id: '2',
186
- name: 'Feature 2',
187
- status: 'feature_analysis',
188
- product_id: 'test-product',
189
- },
190
- {
191
- id: '3',
192
- name: 'Feature 3',
193
- status: 'ready_for_ai',
194
- product_id: 'test-product',
195
- },
196
- ];
197
- const filtered = filterFeaturesByStatus(features, 'ready_for_ai');
198
- assert.strictEqual(filtered.length, 2, 'Should return 2 ready_for_ai features');
199
- assert.strictEqual(filtered[0].id, '1', 'Should include Feature 1');
200
- assert.strictEqual(filtered[1].id, '3', 'Should include Feature 3');
201
- });
202
- void it('should return empty array when no features match status', () => {
203
- const features = [
204
- {
205
- id: '1',
206
- name: 'Feature 1',
207
- status: 'feature_analysis',
208
- product_id: 'test-product',
209
- },
210
- {
211
- id: '2',
212
- name: 'Feature 2',
213
- status: 'code_implementation',
214
- product_id: 'test-product',
215
- },
216
- ];
217
- const filtered = filterFeaturesByStatus(features, 'ready_for_ai');
218
- assert.strictEqual(filtered.length, 0, 'Should return empty array');
219
- });
220
- void it('should handle empty input array', () => {
221
- const features = [];
222
- const filtered = filterFeaturesByStatus(features, 'ready_for_ai');
223
- assert.strictEqual(filtered.length, 0, 'Should return empty array');
224
- });
225
- });
226
- void describe('Integration Tests - Workflow Processing Order', () => {
227
- void it('should process features in oldest-first order for workflow execution', () => {
228
- // This test simulates the expected behavior for workflow processing
229
- const simulatedWorkflowFeatures = [
230
- {
231
- id: 'urgent-feature',
232
- name: 'Urgent Feature',
233
- status: 'ready_for_ai',
234
- product_id: 'test-product',
235
- updated_at: '2024-01-01T08:00:00Z', // Very old - should be processed first
236
- },
237
- {
238
- id: 'recent-feature',
239
- name: 'Recent Feature',
240
- status: 'ready_for_ai',
241
- product_id: 'test-product',
242
- updated_at: '2024-01-20T10:00:00Z', // Recent - should be processed last
243
- },
244
- {
245
- id: 'medium-feature',
246
- name: 'Medium Feature',
247
- status: 'ready_for_ai',
248
- product_id: 'test-product',
249
- updated_at: '2024-01-10T12:00:00Z', // Medium age - should be processed second
250
- },
251
- ];
252
- const processingOrder = sortFeaturesByUpdatedAt(simulatedWorkflowFeatures);
253
- // Verify processing order matches expected workflow behavior
254
- assert.strictEqual(processingOrder[0].id, 'urgent-feature', 'Oldest feature should be processed first in workflow');
255
- assert.strictEqual(processingOrder[1].id, 'medium-feature', 'Medium-age feature should be processed second in workflow');
256
- assert.strictEqual(processingOrder[2].id, 'recent-feature', 'Newest feature should be processed last in workflow');
257
- // Verify timestamps are in correct ascending order
258
- const timestamps = processingOrder.map((f) => new Date(f.updated_at || 0).getTime());
259
- for (let i = 1; i < timestamps.length; i++) {
260
- assert.ok(timestamps[i] >= timestamps[i - 1], `Feature ${i} should have timestamp >= feature ${i - 1}`);
261
- }
262
- });
263
- void it('should maintain consistent ordering across multiple calls', () => {
264
- const features = [
265
- {
266
- id: '1',
267
- name: 'Feature 1',
268
- status: 'ready_for_ai',
269
- product_id: 'test-product',
270
- updated_at: '2024-01-15T10:00:00Z',
271
- },
272
- {
273
- id: '2',
274
- name: 'Feature 2',
275
- status: 'ready_for_ai',
276
- product_id: 'test-product',
277
- updated_at: '2024-01-10T10:00:00Z',
278
- },
279
- {
280
- id: '3',
281
- name: 'Feature 3',
282
- status: 'ready_for_ai',
283
- product_id: 'test-product',
284
- updated_at: '2024-01-20T10:00:00Z',
285
- },
286
- ];
287
- // Sort multiple times to ensure consistency
288
- const sorted1 = sortFeaturesByUpdatedAt(features);
289
- const sorted2 = sortFeaturesByUpdatedAt(features);
290
- const sorted3 = sortFeaturesByUpdatedAt(features);
291
- // All should produce the same order
292
- assert.deepStrictEqual(sorted1.map((f) => f.id), sorted2.map((f) => f.id), 'First and second sort should produce same order');
293
- assert.deepStrictEqual(sorted2.map((f) => f.id), sorted3.map((f) => f.id), 'Second and third sort should produce same order');
294
- });
295
- void it('should verify oldest-first ordering is critical for fair workflow processing', () => {
296
- // Test that demonstrates why oldest-first ordering is important
297
- const featuresWithVariousAges = [
298
- {
299
- id: 'very-old-bug',
300
- name: 'Critical Bug Fix',
301
- status: 'ready_for_ai',
302
- product_id: 'test-product',
303
- updated_at: '2024-01-01T00:00:00Z', // Very old, should be highest priority
304
- },
305
- {
306
- id: 'new-enhancement',
307
- name: 'Nice to Have Feature',
308
- status: 'ready_for_ai',
309
- product_id: 'test-product',
310
- updated_at: '2024-01-25T00:00:00Z', // Recent, should be lowest priority
311
- },
312
- {
313
- id: 'medium-priority',
314
- name: 'Important Feature',
315
- status: 'ready_for_ai',
316
- product_id: 'test-product',
317
- updated_at: '2024-01-15T00:00:00Z', // Medium age, should be middle priority
318
- },
319
- ];
320
- const orderedFeatures = sortFeaturesByUpdatedAt(featuresWithVariousAges);
321
- // The oldest feature (potentially a bug that's been waiting) should be processed first
322
- assert.strictEqual(orderedFeatures[0].id, 'very-old-bug');
323
- assert.strictEqual(orderedFeatures[1].id, 'medium-priority');
324
- assert.strictEqual(orderedFeatures[2].id, 'new-enhancement');
325
- // Verify the business logic: older items get processed before newer ones
326
- // This ensures fairness and prevents newer features from always jumping ahead
327
- const ages = orderedFeatures.map((f) => new Date(f.updated_at ?? '').getTime());
328
- assert.ok(ages[0] <= ages[1] && ages[1] <= ages[2], 'Features should be processed in age order (oldest first)');
329
- });
330
- });
331
- void describe('getReadyForAIFeatures integration behavior', () => {
332
- void it('should use sortFeaturesByUpdatedAt to ensure oldest-first processing', () => {
333
- // This test verifies the integration between getReadyForAIFeatures and sortFeaturesByUpdatedAt
334
- // We can test this indirectly by testing the sorting function that getReadyForAIFeatures uses
335
- const mockApiResponse = [
336
- {
337
- id: 'feat-1',
338
- name: 'Feature Added Last Week',
339
- status: 'ready_for_ai',
340
- product_id: 'product-123',
341
- updated_at: '2024-01-18T10:00:00Z',
342
- },
343
- {
344
- id: 'feat-2',
345
- name: 'Feature Added Yesterday',
346
- status: 'ready_for_ai',
347
- product_id: 'product-123',
348
- updated_at: '2024-01-24T15:30:00Z',
349
- },
350
- {
351
- id: 'feat-3',
352
- name: 'Feature Added Last Month',
353
- status: 'ready_for_ai',
354
- product_id: 'product-123',
355
- updated_at: '2024-01-05T08:00:00Z',
356
- },
357
- ];
358
- // This simulates what getReadyForAIFeatures does internally
359
- const sortedForWorkflow = sortFeaturesByUpdatedAt(mockApiResponse);
360
- // Verify oldest-first ordering that getReadyForAIFeatures should provide
361
- assert.strictEqual(sortedForWorkflow[0].id, 'feat-3', 'Oldest feature should be first');
362
- assert.strictEqual(sortedForWorkflow[1].id, 'feat-1', 'Second oldest should be second');
363
- assert.strictEqual(sortedForWorkflow[2].id, 'feat-2', 'Newest feature should be last');
364
- // Verify the function returns the features in the correct order for workflow processing
365
- const expectedOrder = ['feat-3', 'feat-1', 'feat-2'];
366
- const actualOrder = sortedForWorkflow.map((f) => f.id);
367
- assert.deepStrictEqual(actualOrder, expectedOrder, 'Features should be ordered for fair workflow processing');
368
- });
369
- });
370
- });
@@ -1,4 +0,0 @@
1
- /**
2
- * Unit tests for status progression logic
3
- */
4
- export {};
@@ -1,88 +0,0 @@
1
- /**
2
- * Unit tests for status progression logic
3
- */
4
- import assert from 'node:assert';
5
- import { describe, it } from 'node:test';
6
- import { STATUS_PROGRESSION_ORDER } from '../../../config/feature-status.js';
7
- import { isForwardProgression } from '../status-updater.js';
8
- void describe('Status Progression Logic', () => {
9
- void describe('isForwardProgression', () => {
10
- void it('should allow forward progression', () => {
11
- assert.strictEqual(isForwardProgression('backlog', 'ready_for_ai'), true, 'Should allow progression from backlog to ready_for_ai');
12
- assert.strictEqual(isForwardProgression('feature_analysis', 'technical_design'), true, 'Should allow progression from feature_analysis to technical_design');
13
- assert.strictEqual(isForwardProgression('code_implementation', 'shipped'), true, 'Should allow progression from code_implementation to shipped');
14
- });
15
- void it('should allow staying at same status', () => {
16
- assert.strictEqual(isForwardProgression('backlog', 'backlog'), true, 'Should allow staying at backlog status');
17
- assert.strictEqual(isForwardProgression('feature_analysis', 'feature_analysis'), true, 'Should allow staying at feature_analysis status');
18
- assert.strictEqual(isForwardProgression('shipped', 'shipped'), true, 'Should allow staying at shipped status');
19
- });
20
- void it('should prevent backward progression', () => {
21
- assert.strictEqual(isForwardProgression('ready_for_ai', 'backlog'), false, 'Should prevent regression from ready_for_ai to backlog');
22
- assert.strictEqual(isForwardProgression('technical_design', 'feature_analysis'), false, 'Should prevent regression from technical_design to feature_analysis');
23
- assert.strictEqual(isForwardProgression('shipped', 'code_implementation'), false, 'Should prevent regression from shipped to code_implementation');
24
- });
25
- void it('should handle edge cases correctly', () => {
26
- // First status to last status
27
- assert.strictEqual(isForwardProgression('backlog', 'shipped'), true, 'Should allow progression from first to last status');
28
- // Last status to first status
29
- assert.strictEqual(isForwardProgression('shipped', 'backlog'), false, 'Should prevent regression from last to first status');
30
- });
31
- void it('should handle testing workflow correctly', () => {
32
- // Allow progression through testing states
33
- assert.strictEqual(isForwardProgression('functional_testing', 'testing_in_progress'), true, 'Should allow progression to testing_in_progress');
34
- assert.strictEqual(isForwardProgression('testing_in_progress', 'testing_passed'), true, 'Should allow progression to testing_passed');
35
- // Allow retry after failed testing
36
- assert.strictEqual(isForwardProgression('testing_in_progress', 'testing_failed'), true, 'Should allow marking tests as failed');
37
- // Prevent going back to testing_in_progress from passed
38
- assert.strictEqual(isForwardProgression('testing_passed', 'testing_in_progress'), false, 'Should prevent going back from testing_passed to testing_in_progress');
39
- });
40
- });
41
- void describe('STATUS_PROGRESSION_ORDER', () => {
42
- void it('should contain all expected statuses', () => {
43
- const expectedStatuses = [
44
- 'backlog',
45
- 'ready_for_ai',
46
- 'feature_analysis',
47
- 'feature_analysis_verification',
48
- 'technical_design',
49
- 'technical_design_verification',
50
- 'branch_planning',
51
- 'branch_planning_verification',
52
- 'code_implementation',
53
- 'code_implementation_verification',
54
- 'code_refine',
55
- 'code_refine_verification',
56
- 'bug_fixing',
57
- 'code_review',
58
- 'functional_testing',
59
- 'testing_in_progress',
60
- 'testing_passed',
61
- 'testing_failed',
62
- 'ready_for_review',
63
- 'shipped',
64
- ];
65
- assert.strictEqual(STATUS_PROGRESSION_ORDER.length, expectedStatuses.length, 'Should contain the correct number of statuses');
66
- for (const status of expectedStatuses) {
67
- assert.ok(STATUS_PROGRESSION_ORDER.includes(status), `Should include status: ${status}`);
68
- }
69
- });
70
- void it('should have correct ordering for key workflow phases', () => {
71
- const backlogIndex = STATUS_PROGRESSION_ORDER.indexOf('backlog');
72
- const readyForDevIndex = STATUS_PROGRESSION_ORDER.indexOf('ready_for_ai');
73
- const featureAnalysisIndex = STATUS_PROGRESSION_ORDER.indexOf('feature_analysis');
74
- const technicalDesignIndex = STATUS_PROGRESSION_ORDER.indexOf('technical_design');
75
- const codeImplementationIndex = STATUS_PROGRESSION_ORDER.indexOf('code_implementation');
76
- const shippedIndex = STATUS_PROGRESSION_ORDER.indexOf('shipped');
77
- assert.ok(backlogIndex < readyForDevIndex, 'backlog should come before ready_for_ai');
78
- assert.ok(readyForDevIndex < featureAnalysisIndex, 'ready_for_ai should come before feature_analysis');
79
- assert.ok(featureAnalysisIndex < technicalDesignIndex, 'feature_analysis should come before technical_design');
80
- assert.ok(technicalDesignIndex < codeImplementationIndex, 'technical_design should come before code_implementation');
81
- assert.ok(codeImplementationIndex < shippedIndex, 'code_implementation should come before shipped');
82
- });
83
- void it('should not have duplicate statuses', () => {
84
- const uniqueStatuses = new Set(STATUS_PROGRESSION_ORDER);
85
- assert.strictEqual(uniqueStatuses.size, STATUS_PROGRESSION_ORDER.length, 'Should not contain duplicate statuses');
86
- });
87
- });
88
- });
@@ -1,20 +0,0 @@
1
- /**
2
- * Approval workflow integration for feature phases
3
- * Checks if current feature status has been approved before executing next phase
4
- */
5
- interface ApprovalCheckResult {
6
- canProceed: boolean;
7
- requiresApproval: boolean;
8
- approvalId?: string;
9
- message?: string;
10
- }
11
- /**
12
- * Check if current feature status has been approved before executing next phase
13
- * This should be called BEFORE executing a phase, not after
14
- *
15
- * @param featureId - Feature ID
16
- * @param verbose - Verbose logging
17
- * @returns Promise<ApprovalCheckResult> - Whether the phase can proceed
18
- */
19
- export declare function checkApprovalBeforePhaseExecution(featureId: string, verbose?: boolean): Promise<ApprovalCheckResult>;
20
- export {};
@@ -1,23 +0,0 @@
1
- import { type FeatureInfo } from '../../types/features.js';
2
- /**
3
- * Claim the next available ready_for_ai feature for processing.
4
- * Uses database-level locking (FOR UPDATE SKIP LOCKED) to prevent
5
- * race conditions between multiple workers.
6
- *
7
- * @param productId - The product ID to claim a feature from
8
- * @param verbose - Whether to log verbose output
9
- * @returns The claimed feature or null if no features available
10
- */
11
- export declare function claimNextFeature(productId: string, verbose?: boolean): Promise<FeatureInfo | null>;
12
- /**
13
- * Filter features by status
14
- */
15
- export declare function filterFeaturesByStatus(features: FeatureInfo[], status: string): FeatureInfo[];
16
- /**
17
- * Sort features by updated_at (oldest first for processing)
18
- */
19
- export declare function sortFeaturesByUpdatedAt(features: FeatureInfo[]): FeatureInfo[];
20
- /**
21
- * Get features with ready_for_ai status for a product
22
- */
23
- export declare function getReadyForAIFeatures(productId: string, verbose?: boolean): Promise<FeatureInfo[]>;
@@ -1,80 +0,0 @@
1
- import { logError, logInfo } from '../../utils/logger.js';
2
- import { callMcpEndpoint } from '../mcp-client.js';
3
- /**
4
- * Claim the next available ready_for_ai feature for processing.
5
- * Uses database-level locking (FOR UPDATE SKIP LOCKED) to prevent
6
- * race conditions between multiple workers.
7
- *
8
- * @param productId - The product ID to claim a feature from
9
- * @param verbose - Whether to log verbose output
10
- * @returns The claimed feature or null if no features available
11
- */
12
- export async function claimNextFeature(productId, verbose) {
13
- if (verbose) {
14
- logInfo(`Attempting to claim next ready_for_ai feature for product: ${productId}`);
15
- }
16
- try {
17
- const result = (await callMcpEndpoint('features/claim', {
18
- product_id: productId,
19
- }));
20
- if (result.feature) {
21
- if (verbose) {
22
- logInfo(`✅ Claimed feature: ${result.feature.name} (${result.feature.id})`);
23
- }
24
- return result.feature;
25
- }
26
- if (verbose) {
27
- logInfo('No features available for processing');
28
- }
29
- return null;
30
- }
31
- catch (error) {
32
- const errorMessage = error instanceof Error ? error.message : String(error);
33
- logError(`Failed to claim feature: ${errorMessage}`);
34
- throw error;
35
- }
36
- }
37
- /**
38
- * Filter features by status
39
- */
40
- export function filterFeaturesByStatus(features, status) {
41
- return features.filter((feature) => feature.status === status);
42
- }
43
- /**
44
- * Sort features by updated_at (oldest first for processing)
45
- */
46
- export function sortFeaturesByUpdatedAt(features) {
47
- return [...features].sort((a, b) => {
48
- const dateA = new Date(a.updated_at || 0).getTime();
49
- const dateB = new Date(b.updated_at || 0).getTime();
50
- return dateA - dateB;
51
- });
52
- }
53
- /**
54
- * Get features with ready_for_ai status for a product
55
- */
56
- export async function getReadyForAIFeatures(productId, verbose) {
57
- if (verbose) {
58
- logInfo(`Fetching ready_for_ai features for product: ${productId}`);
59
- }
60
- try {
61
- const result = (await callMcpEndpoint('features/list', {
62
- product_id: productId,
63
- status: 'ready_for_ai',
64
- }));
65
- const features = result.features || [];
66
- const sortedFeatures = sortFeaturesByUpdatedAt(features);
67
- if (verbose) {
68
- logInfo(`✅ Found ${sortedFeatures.length} ready_for_ai features (oldest first)`);
69
- sortedFeatures.forEach((feature, index) => {
70
- logInfo(` ${index + 1}. ${feature.name} (updated: ${feature.updated_at})`);
71
- });
72
- }
73
- return sortedFeatures;
74
- }
75
- catch (error) {
76
- const errorMessage = error instanceof Error ? error.message : String(error);
77
- logError(`Failed to fetch ready_for_ai features: ${errorMessage}`);
78
- throw error;
79
- }
80
- }
@@ -1,5 +0,0 @@
1
- import { type FeatureInfo } from '../../types/features.js';
2
- /**
3
- * Get feature details by ID
4
- */
5
- export declare function getFeature(featureId: string, verbose?: boolean): Promise<FeatureInfo>;
@@ -1,21 +0,0 @@
1
- import { logInfo } from '../../utils/logger.js';
2
- import { callMcpEndpoint } from '../mcp-client.js';
3
- /**
4
- * Get feature details by ID
5
- */
6
- export async function getFeature(featureId, verbose) {
7
- if (verbose) {
8
- logInfo(`Fetching feature details for: ${featureId}`);
9
- }
10
- const result = (await callMcpEndpoint('features/get', {
11
- feature_id: featureId,
12
- }));
13
- if (!result.features || result.features.length === 0) {
14
- throw new Error(`Feature not found: ${featureId}`);
15
- }
16
- const feature = result.features[0];
17
- if (!feature || typeof feature !== 'object') {
18
- throw new Error(`Invalid feature data returned for: ${featureId}`);
19
- }
20
- return feature;
21
- }
@@ -1,8 +0,0 @@
1
- export * from './batch-operations.js';
2
- export * from './feature-utils.js';
3
- export * from './get-feature.js';
4
- export * from './status-updater.js';
5
- export * from './test-cases.js';
6
- export * from './update-feature.js';
7
- export * from './user-stories.js';
8
- export * from '../../types/features.js';
@@ -1,10 +0,0 @@
1
- // Re-export all feature-related functions
2
- export * from './batch-operations.js';
3
- export * from './feature-utils.js';
4
- export * from './get-feature.js';
5
- export * from './status-updater.js';
6
- export * from './test-cases.js';
7
- export * from './update-feature.js';
8
- export * from './user-stories.js';
9
- // Re-export types
10
- export * from '../../types/features.js';