specweave 0.22.13 → 0.23.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 (312) hide show
  1. package/.claude-plugin/README.md +2 -2
  2. package/CLAUDE.md +447 -52
  3. package/README.md +33 -10
  4. package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.d.ts +1 -1
  5. package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.js +1 -1
  6. package/dist/plugins/specweave-github/lib/enhanced-github-sync.js +1 -1
  7. package/dist/plugins/specweave-github/lib/enhanced-github-sync.js.map +1 -1
  8. package/dist/plugins/specweave-github/lib/github-spec-content-sync.d.ts.map +1 -1
  9. package/dist/plugins/specweave-github/lib/github-spec-content-sync.js +4 -1
  10. package/dist/plugins/specweave-github/lib/github-spec-content-sync.js.map +1 -1
  11. package/dist/plugins/specweave-github/lib/github-spec-sync.d.ts +1 -1
  12. package/dist/plugins/specweave-github/lib/github-spec-sync.js +1 -1
  13. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.d.ts +9 -0
  14. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.d.ts.map +1 -1
  15. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js +10 -1
  16. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js.map +1 -1
  17. package/dist/plugins/specweave-github/lib/progress-comment-builder.js +2 -2
  18. package/dist/plugins/specweave-github/lib/progress-comment-builder.js.map +1 -1
  19. package/dist/plugins/specweave-github/lib/types.d.ts +1 -1
  20. package/dist/src/cli/commands/import-external.d.ts +22 -0
  21. package/dist/src/cli/commands/import-external.d.ts.map +1 -0
  22. package/dist/src/cli/commands/import-external.js +282 -0
  23. package/dist/src/cli/commands/import-external.js.map +1 -0
  24. package/dist/src/cli/commands/init.d.ts.map +1 -1
  25. package/dist/src/cli/commands/init.js +359 -1
  26. package/dist/src/cli/commands/init.js.map +1 -1
  27. package/dist/src/cli/helpers/github-repo-selector.d.ts +59 -0
  28. package/dist/src/cli/helpers/github-repo-selector.d.ts.map +1 -0
  29. package/dist/src/cli/helpers/github-repo-selector.js +265 -0
  30. package/dist/src/cli/helpers/github-repo-selector.js.map +1 -0
  31. package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
  32. package/dist/src/cli/helpers/issue-tracker/index.js +41 -24
  33. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
  34. package/dist/src/config/import-config.d.ts +69 -0
  35. package/dist/src/config/import-config.d.ts.map +1 -0
  36. package/dist/src/config/import-config.js +136 -0
  37. package/dist/src/config/import-config.js.map +1 -0
  38. package/dist/src/config/types.d.ts +26 -26
  39. package/dist/src/core/increment/ac-status-manager.d.ts.map +1 -1
  40. package/dist/src/core/increment/ac-status-manager.js +4 -2
  41. package/dist/src/core/increment/ac-status-manager.js.map +1 -1
  42. package/dist/src/core/increment/completion-validator.d.ts +30 -1
  43. package/dist/src/core/increment/completion-validator.d.ts.map +1 -1
  44. package/dist/src/core/increment/completion-validator.js +151 -3
  45. package/dist/src/core/increment/completion-validator.js.map +1 -1
  46. package/dist/src/core/increment/increment-archiver.d.ts +25 -0
  47. package/dist/src/core/increment/increment-archiver.d.ts.map +1 -1
  48. package/dist/src/core/increment/increment-archiver.js +130 -3
  49. package/dist/src/core/increment/increment-archiver.js.map +1 -1
  50. package/dist/src/core/living-docs/feature-archiver.d.ts +37 -0
  51. package/dist/src/core/living-docs/feature-archiver.d.ts.map +1 -1
  52. package/dist/src/core/living-docs/feature-archiver.js +262 -18
  53. package/dist/src/core/living-docs/feature-archiver.js.map +1 -1
  54. package/dist/src/core/living-docs/feature-id-manager.d.ts +17 -0
  55. package/dist/src/core/living-docs/feature-id-manager.d.ts.map +1 -1
  56. package/dist/src/core/living-docs/feature-id-manager.js +25 -0
  57. package/dist/src/core/living-docs/feature-id-manager.js.map +1 -1
  58. package/dist/src/core/living-docs/living-docs-sync.d.ts +16 -0
  59. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  60. package/dist/src/core/living-docs/living-docs-sync.js +56 -1
  61. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  62. package/dist/src/core/living-docs/task-project-specific-generator.d.ts +2 -2
  63. package/dist/src/core/living-docs/task-project-specific-generator.js +2 -2
  64. package/dist/src/core/repo-structure/prompt-consolidator.d.ts +2 -2
  65. package/dist/src/core/repo-structure/prompt-consolidator.d.ts.map +1 -1
  66. package/dist/src/core/repo-structure/prompt-consolidator.js +3 -15
  67. package/dist/src/core/repo-structure/prompt-consolidator.js.map +1 -1
  68. package/dist/src/core/repo-structure/repo-structure-manager.d.ts +1 -1
  69. package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
  70. package/dist/src/core/repo-structure/repo-structure-manager.js +3 -6
  71. package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
  72. package/dist/src/core/spec-content-sync.d.ts +4 -1
  73. package/dist/src/core/spec-content-sync.d.ts.map +1 -1
  74. package/dist/src/core/spec-content-sync.js +139 -4
  75. package/dist/src/core/spec-content-sync.js.map +1 -1
  76. package/dist/src/core/spec-task-mapper.d.ts.map +1 -1
  77. package/dist/src/core/spec-task-mapper.js +9 -8
  78. package/dist/src/core/spec-task-mapper.js.map +1 -1
  79. package/dist/src/core/status-line-validator.d.ts +63 -0
  80. package/dist/src/core/status-line-validator.d.ts.map +1 -0
  81. package/dist/src/core/status-line-validator.js +253 -0
  82. package/dist/src/core/status-line-validator.js.map +1 -0
  83. package/dist/src/core/sync/bidirectional-engine.d.ts +10 -1
  84. package/dist/src/core/sync/bidirectional-engine.d.ts.map +1 -1
  85. package/dist/src/core/sync/bidirectional-engine.js +10 -1
  86. package/dist/src/core/sync/bidirectional-engine.js.map +1 -1
  87. package/dist/src/core/sync/profile-manager.d.ts.map +1 -1
  88. package/dist/src/core/sync/profile-manager.js +3 -0
  89. package/dist/src/core/sync/profile-manager.js.map +1 -1
  90. package/dist/src/core/sync/project-context.d.ts.map +1 -1
  91. package/dist/src/core/sync/project-context.js +3 -0
  92. package/dist/src/core/sync/project-context.js.map +1 -1
  93. package/dist/src/core/sync/status-sync-engine.d.ts +1 -1
  94. package/dist/src/core/sync/status-sync-engine.js +1 -1
  95. package/dist/src/core/sync/sync-event-logger.d.ts +15 -1
  96. package/dist/src/core/sync/sync-event-logger.d.ts.map +1 -1
  97. package/dist/src/core/sync/sync-event-logger.js +39 -1
  98. package/dist/src/core/sync/sync-event-logger.js.map +1 -1
  99. package/dist/src/core/types/origin-metadata.d.ts +153 -0
  100. package/dist/src/core/types/origin-metadata.d.ts.map +1 -0
  101. package/dist/src/core/types/origin-metadata.js +166 -0
  102. package/dist/src/core/types/origin-metadata.js.map +1 -0
  103. package/dist/src/core/types/sync-config-validator.d.ts +57 -0
  104. package/dist/src/core/types/sync-config-validator.d.ts.map +1 -0
  105. package/dist/src/core/types/sync-config-validator.js +116 -0
  106. package/dist/src/core/types/sync-config-validator.js.map +1 -0
  107. package/dist/src/core/types/sync-profile.d.ts +8 -2
  108. package/dist/src/core/types/sync-profile.d.ts.map +1 -1
  109. package/dist/src/core/types/sync-profile.js.map +1 -1
  110. package/dist/src/core/types/sync-settings.d.ts +73 -0
  111. package/dist/src/core/types/sync-settings.d.ts.map +1 -0
  112. package/dist/src/core/types/sync-settings.js +90 -0
  113. package/dist/src/core/types/sync-settings.js.map +1 -0
  114. package/dist/src/core/utils/permission-checker.d.ts +100 -0
  115. package/dist/src/core/utils/permission-checker.d.ts.map +1 -0
  116. package/dist/src/core/utils/permission-checker.js +166 -0
  117. package/dist/src/core/utils/permission-checker.js.map +1 -0
  118. package/dist/src/generators/spec/spec-parser.js +3 -3
  119. package/dist/src/generators/spec/spec-parser.js.map +1 -1
  120. package/dist/src/generators/spec/task-parser.js +4 -4
  121. package/dist/src/generators/spec/task-parser.js.map +1 -1
  122. package/dist/src/id-generators/task-id-generator.d.ts +96 -0
  123. package/dist/src/id-generators/task-id-generator.d.ts.map +1 -0
  124. package/dist/src/id-generators/task-id-generator.js +143 -0
  125. package/dist/src/id-generators/task-id-generator.js.map +1 -0
  126. package/dist/src/id-generators/us-id-generator.d.ts +96 -0
  127. package/dist/src/id-generators/us-id-generator.d.ts.map +1 -0
  128. package/dist/src/id-generators/us-id-generator.js +143 -0
  129. package/dist/src/id-generators/us-id-generator.js.map +1 -0
  130. package/dist/src/importers/ado-importer.d.ts +43 -0
  131. package/dist/src/importers/ado-importer.d.ts.map +1 -0
  132. package/dist/src/importers/ado-importer.js +234 -0
  133. package/dist/src/importers/ado-importer.js.map +1 -0
  134. package/dist/src/importers/duplicate-detector.d.ts +107 -0
  135. package/dist/src/importers/duplicate-detector.d.ts.map +1 -0
  136. package/dist/src/importers/duplicate-detector.js +189 -0
  137. package/dist/src/importers/duplicate-detector.js.map +1 -0
  138. package/dist/src/importers/external-importer.d.ts +96 -0
  139. package/dist/src/importers/external-importer.d.ts.map +1 -0
  140. package/dist/src/importers/external-importer.js +13 -0
  141. package/dist/src/importers/external-importer.js.map +1 -0
  142. package/dist/src/importers/github-importer.d.ts +37 -0
  143. package/dist/src/importers/github-importer.d.ts.map +1 -0
  144. package/dist/src/importers/github-importer.js +161 -0
  145. package/dist/src/importers/github-importer.js.map +1 -0
  146. package/dist/src/importers/import-coordinator.d.ts +105 -0
  147. package/dist/src/importers/import-coordinator.d.ts.map +1 -0
  148. package/dist/src/importers/import-coordinator.js +224 -0
  149. package/dist/src/importers/import-coordinator.js.map +1 -0
  150. package/dist/src/importers/item-converter.d.ts +96 -0
  151. package/dist/src/importers/item-converter.d.ts.map +1 -0
  152. package/dist/src/importers/item-converter.js +246 -0
  153. package/dist/src/importers/item-converter.js.map +1 -0
  154. package/dist/src/importers/jira-importer.d.ts +42 -0
  155. package/dist/src/importers/jira-importer.d.ts.map +1 -0
  156. package/dist/src/importers/jira-importer.js +221 -0
  157. package/dist/src/importers/jira-importer.js.map +1 -0
  158. package/dist/src/importers/rate-limiter.d.ts +128 -0
  159. package/dist/src/importers/rate-limiter.d.ts.map +1 -0
  160. package/dist/src/importers/rate-limiter.js +200 -0
  161. package/dist/src/importers/rate-limiter.js.map +1 -0
  162. package/dist/src/init/compliance/types.d.ts +2 -2
  163. package/dist/src/init/repo/types.d.ts +2 -2
  164. package/dist/src/integrations/ado/ado-client.d.ts +6 -0
  165. package/dist/src/integrations/ado/ado-client.d.ts.map +1 -1
  166. package/dist/src/integrations/ado/ado-client.js +23 -0
  167. package/dist/src/integrations/ado/ado-client.js.map +1 -1
  168. package/dist/src/integrations/jira/jira-client.d.ts +6 -0
  169. package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
  170. package/dist/src/integrations/jira/jira-client.js +38 -0
  171. package/dist/src/integrations/jira/jira-client.js.map +1 -1
  172. package/dist/src/integrations/jira/jira-mapper.d.ts +1 -1
  173. package/dist/src/integrations/jira/jira-mapper.js +1 -1
  174. package/dist/src/living-docs/fs-id-allocator.d.ts +149 -0
  175. package/dist/src/living-docs/fs-id-allocator.d.ts.map +1 -0
  176. package/dist/src/living-docs/fs-id-allocator.js +325 -0
  177. package/dist/src/living-docs/fs-id-allocator.js.map +1 -0
  178. package/dist/src/living-docs/id-registry.d.ts +124 -0
  179. package/dist/src/living-docs/id-registry.d.ts.map +1 -0
  180. package/dist/src/living-docs/id-registry.js +230 -0
  181. package/dist/src/living-docs/id-registry.js.map +1 -0
  182. package/dist/src/progress/us-progress-tracker.d.ts +68 -0
  183. package/dist/src/progress/us-progress-tracker.d.ts.map +1 -0
  184. package/dist/src/progress/us-progress-tracker.js +120 -0
  185. package/dist/src/progress/us-progress-tracker.js.map +1 -0
  186. package/dist/src/sync/external-item-sync-service.d.ts +150 -0
  187. package/dist/src/sync/external-item-sync-service.d.ts.map +1 -0
  188. package/dist/src/sync/external-item-sync-service.js +241 -0
  189. package/dist/src/sync/external-item-sync-service.js.map +1 -0
  190. package/dist/src/sync/format-preservation-sync.d.ts +90 -0
  191. package/dist/src/sync/format-preservation-sync.d.ts.map +1 -0
  192. package/dist/src/sync/format-preservation-sync.js +173 -0
  193. package/dist/src/sync/format-preservation-sync.js.map +1 -0
  194. package/dist/src/sync/index.d.ts +8 -0
  195. package/dist/src/sync/index.d.ts.map +1 -0
  196. package/dist/src/sync/index.js +6 -0
  197. package/dist/src/sync/index.js.map +1 -0
  198. package/dist/src/sync/sync-coordinator.d.ts +49 -0
  199. package/dist/src/sync/sync-coordinator.d.ts.map +1 -0
  200. package/dist/src/sync/sync-coordinator.js +248 -0
  201. package/dist/src/sync/sync-coordinator.js.map +1 -0
  202. package/dist/src/sync/sync-metadata.d.ts +75 -0
  203. package/dist/src/sync/sync-metadata.d.ts.map +1 -0
  204. package/dist/src/sync/sync-metadata.js +100 -0
  205. package/dist/src/sync/sync-metadata.js.map +1 -0
  206. package/dist/src/types/living-docs-us-file.d.ts +63 -0
  207. package/dist/src/types/living-docs-us-file.d.ts.map +1 -0
  208. package/dist/src/types/living-docs-us-file.js +27 -0
  209. package/dist/src/types/living-docs-us-file.js.map +1 -0
  210. package/dist/src/validators/format-preservation-validator.d.ts +127 -0
  211. package/dist/src/validators/format-preservation-validator.d.ts.map +1 -0
  212. package/dist/src/validators/format-preservation-validator.js +187 -0
  213. package/dist/src/validators/format-preservation-validator.js.map +1 -0
  214. package/package.json +3 -2
  215. package/plugins/specweave/.claude-plugin/plugin.json +36 -2
  216. package/plugins/specweave/agents/architect/AGENT.md +11 -2
  217. package/plugins/specweave/agents/test-aware-planner/AGENT.md +81 -25
  218. package/plugins/specweave/commands/specweave-archive-features.md +11 -1
  219. package/plugins/specweave/commands/specweave-import-external.md +407 -0
  220. package/plugins/specweave/commands/specweave-progress.md +45 -97
  221. package/plugins/specweave/hooks/post-edit-spec.sh +41 -0
  222. package/plugins/specweave/hooks/post-increment-completion.sh +168 -26
  223. package/plugins/specweave/hooks/post-increment-planning.sh +148 -4
  224. package/plugins/specweave/hooks/post-spec-update.sh +0 -0
  225. package/plugins/specweave/hooks/post-task-completion.sh +75 -5
  226. package/plugins/specweave/hooks/post-write-spec.sh +37 -0
  227. package/plugins/specweave/lib/hooks/auto-transition.js +1 -1
  228. package/plugins/specweave/lib/hooks/auto-transition.ts +1 -1
  229. package/plugins/specweave/lib/hooks/invoke-translator-skill.js +1 -1
  230. package/plugins/specweave/lib/hooks/invoke-translator-skill.ts +1 -1
  231. package/plugins/specweave/lib/hooks/sync-cache.js +294 -0
  232. package/plugins/specweave/lib/hooks/sync-living-docs.js +67 -2
  233. package/plugins/specweave/lib/hooks/sync-us-tasks.js +200 -14
  234. package/plugins/specweave/lib/hooks/translate-file.js +1 -1
  235. package/plugins/specweave/lib/hooks/translate-file.ts +1 -1
  236. package/plugins/specweave/lib/hooks/update-ac-status.js +1 -1
  237. package/plugins/specweave/lib/hooks/update-ac-status.ts +1 -1
  238. package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.d.ts +115 -0
  239. package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js +345 -0
  240. package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js.map +1 -0
  241. package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.d.ts +106 -0
  242. package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js +220 -0
  243. package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js.map +1 -0
  244. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.d.ts +60 -0
  245. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js +192 -0
  246. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js.map +1 -0
  247. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.d.ts +52 -0
  248. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js +276 -0
  249. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js.map +1 -0
  250. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.d.ts +163 -0
  251. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +541 -0
  252. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -0
  253. package/plugins/specweave/lib/vendor/core/types/increment-metadata.d.ts +157 -0
  254. package/plugins/specweave/lib/vendor/core/types/increment-metadata.js +191 -0
  255. package/plugins/specweave/lib/vendor/core/types/increment-metadata.js.map +1 -0
  256. package/plugins/specweave/lib/vendor/generators/spec/task-parser.d.ts +95 -0
  257. package/plugins/specweave/lib/vendor/generators/spec/task-parser.js +301 -0
  258. package/plugins/specweave/lib/vendor/generators/spec/task-parser.js.map +1 -0
  259. package/plugins/specweave/lib/vendor/utils/logger.d.ts +48 -0
  260. package/plugins/specweave/lib/vendor/utils/logger.js +53 -0
  261. package/plugins/specweave/lib/vendor/utils/logger.js.map +1 -0
  262. package/plugins/specweave/lib/vendor/utils/translation.d.ts +187 -0
  263. package/plugins/specweave/lib/vendor/utils/translation.js +414 -0
  264. package/plugins/specweave/lib/vendor/utils/translation.js.map +1 -0
  265. package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
  266. package/plugins/specweave-ado/lib/ado-multi-project-sync.js +0 -1
  267. package/plugins/specweave-ado/lib/conflict-resolver.ts +1 -1
  268. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +1 -1
  269. package/plugins/specweave-backend/.claude-plugin/plugin.json +1 -1
  270. package/plugins/specweave-confluent/.claude-plugin/plugin.json +1 -1
  271. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +1 -1
  272. package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
  273. package/plugins/specweave-docs/.claude-plugin/plugin.json +1 -1
  274. package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
  275. package/plugins/specweave-figma/.claude-plugin/plugin.json +1 -1
  276. package/plugins/specweave-frontend/.claude-plugin/plugin.json +1 -1
  277. package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
  278. package/plugins/specweave-github/commands/specweave-github-update-user-story.md +1 -1
  279. package/plugins/specweave-github/hooks/post-task-completion.sh +37 -22
  280. package/plugins/specweave-github/lib/ThreeLayerSyncManager.ts +1 -1
  281. package/plugins/specweave-github/lib/enhanced-github-sync.js +1 -1
  282. package/plugins/specweave-github/lib/enhanced-github-sync.ts +1 -1
  283. package/plugins/specweave-github/lib/github-spec-content-sync.js +2 -1
  284. package/plugins/specweave-github/lib/github-spec-content-sync.ts +4 -1
  285. package/plugins/specweave-github/lib/github-spec-sync.js +1 -1
  286. package/plugins/specweave-github/lib/github-spec-sync.ts +1 -1
  287. package/plugins/specweave-github/lib/github-sync-bidirectional.js +1 -1
  288. package/plugins/specweave-github/lib/github-sync-bidirectional.ts +10 -1
  289. package/plugins/specweave-github/lib/progress-comment-builder.js +1 -1
  290. package/plugins/specweave-github/lib/progress-comment-builder.ts +2 -2
  291. package/plugins/specweave-github/lib/types.ts +1 -1
  292. package/plugins/specweave-github/skills/github-issue-standard/SKILL.md +1 -1
  293. package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
  294. package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
  295. package/plugins/specweave-jira/lib/enhanced-jira-sync.js +3 -3
  296. package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
  297. package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
  298. package/plugins/specweave-kubernetes/.claude-plugin/plugin.json +1 -1
  299. package/plugins/specweave-ml/.claude-plugin/plugin.json +1 -1
  300. package/plugins/specweave-mobile/.claude-plugin/plugin.json +1 -1
  301. package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
  302. package/plugins/specweave-payments/.claude-plugin/plugin.json +1 -1
  303. package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
  304. package/plugins/specweave-testing/.claude-plugin/plugin.json +1 -1
  305. package/plugins/specweave-tooling/.claude-plugin/plugin.json +1 -1
  306. package/plugins/specweave-ui/.claude-plugin/plugin.json +1 -1
  307. package/src/templates/.env.example +5 -0
  308. package/src/templates/config-permissions-guide.md +413 -0
  309. package/src/templates/config.json.template +68 -0
  310. package/src/templates/tasks.md.template +180 -201
  311. package/plugins/specweave-ado/lib/enhanced-ado-sync.js +0 -170
  312. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +0 -5442
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Represents the completion status of an Acceptance Criteria
3
+ */
4
+ export interface ACCompletionStatus {
5
+ acId: string;
6
+ totalTasks: number;
7
+ completedTasks: number;
8
+ percentage: number;
9
+ isComplete: boolean;
10
+ tasks: string[];
11
+ }
12
+ /**
13
+ * Represents an Acceptance Criteria definition in spec.md
14
+ */
15
+ export interface ACDefinition {
16
+ acId: string;
17
+ description: string;
18
+ checked: boolean;
19
+ lineNumber: number;
20
+ fullLine: string;
21
+ }
22
+ /**
23
+ * Result of syncing AC status
24
+ */
25
+ export interface ACSyncResult {
26
+ synced: boolean;
27
+ updated: string[];
28
+ conflicts: string[];
29
+ warnings: string[];
30
+ changes: string[];
31
+ }
32
+ /**
33
+ * Validation result for AC-task mapping
34
+ */
35
+ export interface ValidationResult {
36
+ valid: boolean;
37
+ orphanedACs: string[];
38
+ invalidReferences: string[];
39
+ errors: string[];
40
+ }
41
+ /**
42
+ * AC sync event for metadata logging
43
+ */
44
+ export interface ACSyncEvent {
45
+ timestamp: string;
46
+ updated: string[];
47
+ conflicts: string[];
48
+ warnings: string[];
49
+ changesCount: number;
50
+ }
51
+ /**
52
+ * AC completion summary
53
+ */
54
+ export interface ACCompletionSummary {
55
+ totalACs: number;
56
+ completeACs: number;
57
+ incompleteACs: number;
58
+ percentage: number;
59
+ acStatuses: Map<string, ACCompletionStatus>;
60
+ }
61
+ /**
62
+ * ACStatusManager: Automatically sync spec.md AC checkboxes with tasks.md completion status
63
+ */
64
+ export declare class ACStatusManager {
65
+ private rootPath;
66
+ constructor(rootPath: string);
67
+ /**
68
+ * Parse tasks.md and extract AC completion status
69
+ *
70
+ * @param tasksContent - Content of tasks.md file
71
+ * @returns Map of AC-ID to ACCompletionStatus
72
+ */
73
+ parseTasksForACStatus(tasksContent: string): Map<string, ACCompletionStatus>;
74
+ /**
75
+ * Helper method to add a task to the AC map
76
+ */
77
+ private addTaskToACMap;
78
+ /**
79
+ * Parse spec.md and extract AC checkboxes
80
+ *
81
+ * @param specContent - Content of spec.md file
82
+ * @returns Map of AC-ID to ACDefinition
83
+ */
84
+ parseSpecForACs(specContent: string): Map<string, ACDefinition>;
85
+ /**
86
+ * Sync AC status from tasks.md to spec.md
87
+ *
88
+ * @param incrementId - Increment ID (e.g., "0039")
89
+ * @returns Result of sync operation
90
+ */
91
+ syncACStatus(incrementId: string): Promise<ACSyncResult>;
92
+ /**
93
+ * Log AC sync event to metadata.json
94
+ * Keeps last 20 events for audit trail
95
+ *
96
+ * @param incrementId - Increment ID
97
+ * @param result - Sync result to log
98
+ */
99
+ private logSyncEvent;
100
+ /**
101
+ * Validate AC-task mapping
102
+ *
103
+ * @param incrementId - Increment ID
104
+ * @returns Validation result
105
+ */
106
+ validateACMapping(incrementId: string): ValidationResult;
107
+ /**
108
+ * Get AC completion summary
109
+ *
110
+ * @param incrementId - Increment ID
111
+ * @returns Summary of AC completion status
112
+ */
113
+ getACCompletionSummary(incrementId: string): ACCompletionSummary;
114
+ }
115
+ //# sourceMappingURL=ac-status-manager.d.ts.map
@@ -0,0 +1,345 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+ /**
4
+ * ACStatusManager: Automatically sync spec.md AC checkboxes with tasks.md completion status
5
+ */
6
+ export class ACStatusManager {
7
+ constructor(rootPath) {
8
+ this.rootPath = rootPath;
9
+ }
10
+ /**
11
+ * Parse tasks.md and extract AC completion status
12
+ *
13
+ * @param tasksContent - Content of tasks.md file
14
+ * @returns Map of AC-ID to ACCompletionStatus
15
+ */
16
+ parseTasksForACStatus(tasksContent) {
17
+ const acMap = new Map();
18
+ // Regex to match task headers: ### T-###: Task name
19
+ const taskHeaderRegex = /###\s+(T-\d+):/g;
20
+ // Split content by task headers
21
+ const lines = tasksContent.split('\n');
22
+ let currentTaskId = null;
23
+ let currentTaskACs = [];
24
+ let hasCheckedBoxes = false;
25
+ let hasUncheckedBoxes = false;
26
+ for (let i = 0; i < lines.length; i++) {
27
+ const line = lines[i];
28
+ // Check if this is a task header
29
+ const taskMatch = line.match(/###\s+(T-\d+):/);
30
+ if (taskMatch) {
31
+ // Process previous task if exists
32
+ if (currentTaskId && currentTaskACs.length > 0) {
33
+ // Task is complete if it has at least one [x] and no [ ]
34
+ const currentTaskComplete = hasCheckedBoxes && !hasUncheckedBoxes;
35
+ this.addTaskToACMap(acMap, currentTaskId, currentTaskACs, currentTaskComplete);
36
+ }
37
+ // Start new task
38
+ currentTaskId = taskMatch[1];
39
+ currentTaskACs = [];
40
+ hasCheckedBoxes = false;
41
+ hasUncheckedBoxes = false;
42
+ continue;
43
+ }
44
+ // Check if this line contains AC tags (supports both old and new formats)
45
+ // Old format: **AC**: AC-US1-01
46
+ // New format: **Satisfies ACs**: AC-US1-01, AC-US1-02
47
+ const acMatch = line.match(/\*\*(?:AC|Satisfies ACs)\*\*:\s*(.+)/);
48
+ if (acMatch && currentTaskId) {
49
+ // Extract AC-IDs (can be comma or space separated)
50
+ const acText = acMatch[1].trim();
51
+ const acIds = acText
52
+ .split(/[,\s]+/)
53
+ .map(id => id.trim())
54
+ .filter(id => id.startsWith('AC-'));
55
+ currentTaskACs.push(...acIds);
56
+ continue;
57
+ }
58
+ // Check task completion status
59
+ if (currentTaskId && line.includes('- [')) {
60
+ if (line.includes('- [ ]')) {
61
+ hasUncheckedBoxes = true;
62
+ }
63
+ else if (line.includes('- [x]')) {
64
+ hasCheckedBoxes = true;
65
+ }
66
+ }
67
+ }
68
+ // Process last task
69
+ if (currentTaskId && currentTaskACs.length > 0) {
70
+ const currentTaskComplete = hasCheckedBoxes && !hasUncheckedBoxes;
71
+ this.addTaskToACMap(acMap, currentTaskId, currentTaskACs, currentTaskComplete);
72
+ }
73
+ return acMap;
74
+ }
75
+ /**
76
+ * Helper method to add a task to the AC map
77
+ */
78
+ addTaskToACMap(acMap, taskId, acIds, isComplete) {
79
+ for (const acId of acIds) {
80
+ if (!acMap.has(acId)) {
81
+ acMap.set(acId, {
82
+ acId,
83
+ totalTasks: 0,
84
+ completedTasks: 0,
85
+ percentage: 0,
86
+ isComplete: false,
87
+ tasks: []
88
+ });
89
+ }
90
+ const status = acMap.get(acId);
91
+ status.totalTasks++;
92
+ if (isComplete) {
93
+ status.completedTasks++;
94
+ }
95
+ status.tasks.push(taskId);
96
+ // Calculate percentage
97
+ status.percentage = status.totalTasks > 0
98
+ ? Math.round((status.completedTasks / status.totalTasks) * 100 * 100) / 100
99
+ : 0;
100
+ // Update isComplete flag
101
+ status.isComplete = status.percentage === 100;
102
+ }
103
+ }
104
+ /**
105
+ * Parse spec.md and extract AC checkboxes
106
+ *
107
+ * @param specContent - Content of spec.md file
108
+ * @returns Map of AC-ID to ACDefinition
109
+ */
110
+ parseSpecForACs(specContent) {
111
+ const acMap = new Map();
112
+ const lines = specContent.split('\n');
113
+ for (let i = 0; i < lines.length; i++) {
114
+ const line = lines[i];
115
+ // Match AC checkbox pattern: - [ ] AC-ID: Description
116
+ // or: - [x] AC-ID: Description
117
+ // Also handles bold format: - [ ] **AC-ID**: Description
118
+ const acMatch = line.match(/^-\s+\[([ x])\]\s+\*{0,2}(AC-[A-Z0-9-]+)\*{0,2}:\s*(.+)/);
119
+ if (acMatch) {
120
+ const checked = acMatch[1] === 'x';
121
+ const acId = acMatch[2];
122
+ const description = acMatch[3].trim();
123
+ acMap.set(acId, {
124
+ acId,
125
+ description,
126
+ checked,
127
+ lineNumber: i + 1, // 1-indexed
128
+ fullLine: line
129
+ });
130
+ }
131
+ }
132
+ return acMap;
133
+ }
134
+ /**
135
+ * Sync AC status from tasks.md to spec.md
136
+ *
137
+ * @param incrementId - Increment ID (e.g., "0039")
138
+ * @returns Result of sync operation
139
+ */
140
+ async syncACStatus(incrementId) {
141
+ const result = {
142
+ synced: false,
143
+ updated: [],
144
+ conflicts: [],
145
+ warnings: [],
146
+ changes: []
147
+ };
148
+ // Paths
149
+ const incrementPath = path.join(this.rootPath, '.specweave', 'increments', incrementId);
150
+ const specPath = path.join(incrementPath, 'spec.md');
151
+ const tasksPath = path.join(incrementPath, 'tasks.md');
152
+ // Check files exist
153
+ if (!fs.existsSync(specPath)) {
154
+ result.warnings.push('spec.md does not exist');
155
+ return result;
156
+ }
157
+ if (!fs.existsSync(tasksPath)) {
158
+ result.warnings.push('tasks.md does not exist');
159
+ return result;
160
+ }
161
+ // Read files
162
+ const specContent = fs.readFileSync(specPath, 'utf-8');
163
+ const tasksContent = fs.readFileSync(tasksPath, 'utf-8');
164
+ // Parse both files
165
+ const taskACStatuses = this.parseTasksForACStatus(tasksContent);
166
+ const specACs = this.parseSpecForACs(specContent);
167
+ // Sync logic
168
+ const specLines = specContent.split('\n');
169
+ let updated = false;
170
+ for (const [acId, taskStatus] of taskACStatuses.entries()) {
171
+ const specAC = specACs.get(acId);
172
+ if (!specAC) {
173
+ result.warnings.push(`${acId} referenced in tasks.md but not found in spec.md`);
174
+ continue;
175
+ }
176
+ // Check if status should change
177
+ const shouldBeChecked = taskStatus.isComplete;
178
+ const currentlyChecked = specAC.checked;
179
+ if (shouldBeChecked && !currentlyChecked) {
180
+ // Update from [ ] to [x]
181
+ const oldLine = specLines[specAC.lineNumber - 1];
182
+ const newLine = oldLine.replace('- [ ]', '- [x]');
183
+ specLines[specAC.lineNumber - 1] = newLine;
184
+ result.updated.push(acId);
185
+ result.changes.push(`${acId}: [ ] → [x] (${taskStatus.completedTasks}/${taskStatus.totalTasks} tasks complete)`);
186
+ updated = true;
187
+ }
188
+ else if (!shouldBeChecked && currentlyChecked) {
189
+ // Conflict: AC is [x] but tasks incomplete
190
+ result.conflicts.push(`${acId}: [x] but only ${taskStatus.completedTasks}/${taskStatus.totalTasks} tasks complete (${taskStatus.percentage}%)`);
191
+ }
192
+ }
193
+ // Check for ACs with no tasks
194
+ for (const [acId, specAC] of specACs.entries()) {
195
+ if (!taskACStatuses.has(acId)) {
196
+ if (specAC.checked) {
197
+ result.warnings.push(`${acId}: [x] but no tasks found (manual verification?)`);
198
+ }
199
+ else {
200
+ result.warnings.push(`${acId}: has no tasks mapped`);
201
+ }
202
+ }
203
+ }
204
+ // Write updated spec.md
205
+ if (updated) {
206
+ const newSpecContent = specLines.join('\n');
207
+ fs.writeFileSync(specPath, newSpecContent, 'utf-8');
208
+ result.synced = true;
209
+ }
210
+ // Log sync event to metadata.json
211
+ if (result.synced || result.conflicts.length > 0 || result.warnings.length > 0) {
212
+ this.logSyncEvent(incrementId, result);
213
+ }
214
+ return result;
215
+ }
216
+ /**
217
+ * Log AC sync event to metadata.json
218
+ * Keeps last 20 events for audit trail
219
+ *
220
+ * @param incrementId - Increment ID
221
+ * @param result - Sync result to log
222
+ */
223
+ logSyncEvent(incrementId, result) {
224
+ const metadataPath = path.join(this.rootPath, '.specweave', 'increments', incrementId, 'metadata.json');
225
+ try {
226
+ // Read existing metadata
227
+ let metadata = {};
228
+ if (fs.existsSync(metadataPath)) {
229
+ const metadataContent = fs.readFileSync(metadataPath, 'utf-8');
230
+ metadata = JSON.parse(metadataContent);
231
+ }
232
+ // Initialize acSyncEvents array if doesn't exist
233
+ if (!metadata.acSyncEvents) {
234
+ metadata.acSyncEvents = [];
235
+ }
236
+ // Create new event
237
+ const event = {
238
+ timestamp: new Date().toISOString(),
239
+ updated: result.updated,
240
+ conflicts: result.conflicts,
241
+ warnings: result.warnings,
242
+ changesCount: result.updated.length
243
+ };
244
+ // Add event to beginning (newest first)
245
+ metadata.acSyncEvents.unshift(event);
246
+ // Keep only last 20 events (rolling history)
247
+ if (metadata.acSyncEvents.length > 20) {
248
+ metadata.acSyncEvents = metadata.acSyncEvents.slice(0, 20);
249
+ }
250
+ // Update lastActivity timestamp
251
+ metadata.lastActivity = new Date().toISOString();
252
+ // Write updated metadata
253
+ fs.writeFileSync(metadataPath, JSON.stringify(metadata, null, 2), 'utf-8');
254
+ }
255
+ catch (error) {
256
+ // Non-blocking: Log error but don't fail sync
257
+ console.error('Warning: Failed to log AC sync event to metadata.json', error);
258
+ }
259
+ }
260
+ /**
261
+ * Validate AC-task mapping
262
+ *
263
+ * @param incrementId - Increment ID
264
+ * @returns Validation result
265
+ */
266
+ validateACMapping(incrementId) {
267
+ const result = {
268
+ valid: true,
269
+ orphanedACs: [],
270
+ invalidReferences: [],
271
+ errors: []
272
+ };
273
+ const incrementPath = path.join(this.rootPath, '.specweave', 'increments', incrementId);
274
+ const specPath = path.join(incrementPath, 'spec.md');
275
+ const tasksPath = path.join(incrementPath, 'tasks.md');
276
+ // Check files exist
277
+ if (!fs.existsSync(specPath)) {
278
+ result.errors.push('spec.md does not exist');
279
+ result.valid = false;
280
+ return result;
281
+ }
282
+ if (!fs.existsSync(tasksPath)) {
283
+ result.errors.push('tasks.md does not exist');
284
+ result.valid = false;
285
+ return result;
286
+ }
287
+ // Read and parse
288
+ const specContent = fs.readFileSync(specPath, 'utf-8');
289
+ const tasksContent = fs.readFileSync(tasksPath, 'utf-8');
290
+ const taskACStatuses = this.parseTasksForACStatus(tasksContent);
291
+ const specACs = this.parseSpecForACs(specContent);
292
+ // Find orphaned ACs (in spec but no tasks)
293
+ for (const acId of specACs.keys()) {
294
+ if (!taskACStatuses.has(acId)) {
295
+ result.orphanedACs.push(acId);
296
+ result.valid = false;
297
+ }
298
+ }
299
+ // Find invalid references (in tasks but not in spec)
300
+ for (const acId of taskACStatuses.keys()) {
301
+ if (!specACs.has(acId)) {
302
+ result.invalidReferences.push(acId);
303
+ result.valid = false;
304
+ }
305
+ }
306
+ return result;
307
+ }
308
+ /**
309
+ * Get AC completion summary
310
+ *
311
+ * @param incrementId - Increment ID
312
+ * @returns Summary of AC completion status
313
+ */
314
+ getACCompletionSummary(incrementId) {
315
+ const incrementPath = path.join(this.rootPath, '.specweave', 'increments', incrementId);
316
+ const tasksPath = path.join(incrementPath, 'tasks.md');
317
+ const summary = {
318
+ totalACs: 0,
319
+ completeACs: 0,
320
+ incompleteACs: 0,
321
+ percentage: 0,
322
+ acStatuses: new Map()
323
+ };
324
+ if (!fs.existsSync(tasksPath)) {
325
+ return summary;
326
+ }
327
+ const tasksContent = fs.readFileSync(tasksPath, 'utf-8');
328
+ const acStatuses = this.parseTasksForACStatus(tasksContent);
329
+ summary.acStatuses = acStatuses;
330
+ summary.totalACs = acStatuses.size;
331
+ for (const status of acStatuses.values()) {
332
+ if (status.isComplete) {
333
+ summary.completeACs++;
334
+ }
335
+ else {
336
+ summary.incompleteACs++;
337
+ }
338
+ }
339
+ summary.percentage = summary.totalACs > 0
340
+ ? Math.round((summary.completeACs / summary.totalACs) * 100)
341
+ : 0;
342
+ return summary;
343
+ }
344
+ }
345
+ //# sourceMappingURL=ac-status-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ac-status-manager.js","sourceRoot":"","sources":["../../../../src/core/increment/ac-status-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAoE7B;;GAEG;AACH,MAAM,OAAO,eAAe;IAG1B,YAAY,QAAgB;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;;;;OAKG;IACH,qBAAqB,CAAC,YAAoB;QACxC,MAAM,KAAK,GAAG,IAAI,GAAG,EAA8B,CAAC;QAEpD,oDAAoD;QACpD,MAAM,eAAe,GAAG,iBAAiB,CAAC;QAE1C,gCAAgC;QAChC,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,aAAa,GAAkB,IAAI,CAAC;QACxC,IAAI,cAAc,GAAa,EAAE,CAAC;QAClC,IAAI,eAAe,GAAG,KAAK,CAAC;QAC5B,IAAI,iBAAiB,GAAG,KAAK,CAAC;QAE9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YAEtB,iCAAiC;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C,UAAU,EAAE,CAAC;gBACtB,OAAO,CAAC,WAAW,EAAE,CAAC;YACxB,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,aAAa,EAAE,CAAC;YAC1B,CAAC;QACH,CAAC;QAED,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,QAAQ,GAAG,CAAC;YACvC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;YAC5D,CAAC,CAAC,CAAC,CAAC;QAEN,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Active Increment Manager
3
+ *
4
+ * Manages the `.specweave/state/active-increment.json` file which tracks
5
+ * the currently active increment for status line display.
6
+ *
7
+ * **Critical**: This file MUST be updated whenever increment status changes:
8
+ * - When new increment is created → Set as active
9
+ * - When increment is completed → Clear or set to next active
10
+ * - When increment is paused → Set to next active (or clear if none)
11
+ * - When increment is resumed → Set as active
12
+ *
13
+ * Part of increment 0021: Fix Active Increment Tracking
14
+ */
15
+ /**
16
+ * Active increment state stored in .specweave/state/active-increment.json
17
+ *
18
+ * **UPGRADED**: Now supports MULTIPLE active increments (up to 2)
19
+ * - One regular feature increment
20
+ * - One hotfix/bug increment (optional)
21
+ */
22
+ export interface ActiveIncrementState {
23
+ ids: string[];
24
+ id?: string | null;
25
+ lastUpdated: string;
26
+ }
27
+ /**
28
+ * Active Increment Manager
29
+ *
30
+ * Central authority for managing which increment is currently active.
31
+ */
32
+ export declare class ActiveIncrementManager {
33
+ private rootDir;
34
+ private stateFile;
35
+ constructor(rootDir?: string);
36
+ /**
37
+ * Get all currently active increment IDs
38
+ * Returns empty array if no increments are active
39
+ *
40
+ * **NEW**: Returns array of ALL active increments (max 2)
41
+ */
42
+ getActive(): string[];
43
+ /**
44
+ * Get the primary active increment (first in list)
45
+ * Returns null if no increments are active
46
+ *
47
+ * This maintains backwards compatibility with code expecting a single ID
48
+ */
49
+ getPrimary(): string | null;
50
+ /**
51
+ * Add an increment to the active list
52
+ * Validates that the increment exists and is actually active
53
+ *
54
+ * **NEW**: Adds to list instead of replacing (max 2)
55
+ * @param skipValidation - Skip validation (used during lazy initialization to prevent circular dependency)
56
+ */
57
+ addActive(incrementId: string, skipValidation?: boolean): void;
58
+ /**
59
+ * Remove an increment from the active list
60
+ */
61
+ removeActive(incrementId: string): void;
62
+ /**
63
+ * Set the active increment (legacy method for backwards compatibility)
64
+ * Now delegates to addActive()
65
+ * @param skipValidation - Skip validation (used during lazy initialization to prevent circular dependency)
66
+ */
67
+ setActive(incrementId: string, skipValidation?: boolean): void;
68
+ /**
69
+ * Clear all active increments
70
+ */
71
+ clearActive(): void;
72
+ /**
73
+ * Smart update: Rebuild active list from metadata
74
+ *
75
+ * This is called when:
76
+ * - An increment is completed
77
+ * - An increment is paused
78
+ * - An increment is abandoned
79
+ *
80
+ * Logic:
81
+ * 1. Scan all increments for status=active
82
+ * 2. Update cache to match reality
83
+ * 3. Max 2 increments (sorted by lastActivity)
84
+ */
85
+ smartUpdate(): void;
86
+ /**
87
+ * Validate that all active increment pointers are correct
88
+ * Does NOT fix stale pointers - caller should call smartUpdate() if needed
89
+ *
90
+ * Returns true if all valid, false if any invalid
91
+ */
92
+ validate(): boolean;
93
+ /**
94
+ * Write state file atomically (temp file → rename)
95
+ */
96
+ private writeState;
97
+ /**
98
+ * Get state file path (for testing)
99
+ */
100
+ getStateFilePath(): string;
101
+ /**
102
+ * Check if state file exists (for testing)
103
+ */
104
+ exists(): boolean;
105
+ }
106
+ //# sourceMappingURL=active-increment-manager.d.ts.map