specweave 0.32.0 → 0.32.3

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 (347) hide show
  1. package/CLAUDE.md +215 -2
  2. package/README.md +22 -0
  3. package/bin/specweave.js +52 -1
  4. package/dist/plugins/specweave-ado/lib/ado-duplicate-detector.d.ts +100 -0
  5. package/dist/plugins/specweave-ado/lib/ado-duplicate-detector.d.ts.map +1 -0
  6. package/dist/plugins/specweave-ado/lib/ado-duplicate-detector.js +291 -0
  7. package/dist/plugins/specweave-ado/lib/ado-duplicate-detector.js.map +1 -0
  8. package/dist/plugins/specweave-jira/lib/jira-duplicate-detector.d.ts +103 -0
  9. package/dist/plugins/specweave-jira/lib/jira-duplicate-detector.d.ts.map +1 -0
  10. package/dist/plugins/specweave-jira/lib/jira-duplicate-detector.js +310 -0
  11. package/dist/plugins/specweave-jira/lib/jira-duplicate-detector.js.map +1 -0
  12. package/dist/plugins/specweave-jira/lib/jira-permission-gate.d.ts +126 -0
  13. package/dist/plugins/specweave-jira/lib/jira-permission-gate.d.ts.map +1 -0
  14. package/dist/plugins/specweave-jira/lib/jira-permission-gate.js +207 -0
  15. package/dist/plugins/specweave-jira/lib/jira-permission-gate.js.map +1 -0
  16. package/dist/src/adapters/codex/README.md +1 -1
  17. package/dist/src/adapters/codex/adapter.js +1 -1
  18. package/dist/src/cli/commands/archive.d.ts +2 -0
  19. package/dist/src/cli/commands/archive.d.ts.map +1 -1
  20. package/dist/src/cli/commands/archive.js +33 -0
  21. package/dist/src/cli/commands/archive.js.map +1 -1
  22. package/dist/src/cli/commands/cache.d.ts +17 -0
  23. package/dist/src/cli/commands/cache.d.ts.map +1 -0
  24. package/dist/src/cli/commands/cache.js +126 -0
  25. package/dist/src/cli/commands/cache.js.map +1 -0
  26. package/dist/src/cli/commands/context.d.ts +92 -0
  27. package/dist/src/cli/commands/context.d.ts.map +1 -0
  28. package/dist/src/cli/commands/context.js +205 -0
  29. package/dist/src/cli/commands/context.js.map +1 -0
  30. package/dist/src/cli/commands/init.d.ts.map +1 -1
  31. package/dist/src/cli/commands/init.js +112 -70
  32. package/dist/src/cli/commands/init.js.map +1 -1
  33. package/dist/src/cli/commands/plan/increment-detector.js +2 -2
  34. package/dist/src/cli/commands/plan/increment-detector.js.map +1 -1
  35. package/dist/src/cli/commands/sync-spec-commits.js +1 -1
  36. package/dist/src/cli/commands/sync-spec-commits.js.map +1 -1
  37. package/dist/src/cli/commands/sync-specs.js +2 -2
  38. package/dist/src/cli/commands/sync-specs.js.map +1 -1
  39. package/dist/src/cli/helpers/github/increment-profile-selector.js +1 -1
  40. package/dist/src/cli/helpers/github/increment-profile-selector.js.map +1 -1
  41. package/dist/src/cli/helpers/init/external-import.d.ts +3 -0
  42. package/dist/src/cli/helpers/init/external-import.d.ts.map +1 -1
  43. package/dist/src/cli/helpers/init/external-import.js +17 -4
  44. package/dist/src/cli/helpers/init/external-import.js.map +1 -1
  45. package/dist/src/cli/helpers/init/index.d.ts +1 -0
  46. package/dist/src/cli/helpers/init/index.d.ts.map +1 -1
  47. package/dist/src/cli/helpers/init/index.js +2 -0
  48. package/dist/src/cli/helpers/init/index.js.map +1 -1
  49. package/dist/src/cli/helpers/init/jira-ado-auto-detect.d.ts +70 -0
  50. package/dist/src/cli/helpers/init/jira-ado-auto-detect.d.ts.map +1 -1
  51. package/dist/src/cli/helpers/init/jira-ado-auto-detect.js +214 -4
  52. package/dist/src/cli/helpers/init/jira-ado-auto-detect.js.map +1 -1
  53. package/dist/src/cli/helpers/init/living-docs-preflight.d.ts +4 -0
  54. package/dist/src/cli/helpers/init/living-docs-preflight.d.ts.map +1 -1
  55. package/dist/src/cli/helpers/init/living-docs-preflight.js +34 -3
  56. package/dist/src/cli/helpers/init/living-docs-preflight.js.map +1 -1
  57. package/dist/src/cli/helpers/init/testing-config.d.ts +3 -0
  58. package/dist/src/cli/helpers/init/testing-config.d.ts.map +1 -1
  59. package/dist/src/cli/helpers/init/testing-config.js +9 -2
  60. package/dist/src/cli/helpers/init/testing-config.js.map +1 -1
  61. package/dist/src/cli/helpers/init/translation-config.d.ts +3 -0
  62. package/dist/src/cli/helpers/init/translation-config.d.ts.map +1 -1
  63. package/dist/src/cli/helpers/init/translation-config.js +21 -4
  64. package/dist/src/cli/helpers/init/translation-config.js.map +1 -1
  65. package/dist/src/cli/helpers/init/wizard-navigation.d.ts +45 -0
  66. package/dist/src/cli/helpers/init/wizard-navigation.d.ts.map +1 -0
  67. package/dist/src/cli/helpers/init/wizard-navigation.js +97 -0
  68. package/dist/src/cli/helpers/init/wizard-navigation.js.map +1 -0
  69. package/dist/src/cli/workers/living-docs-worker.js +66 -1
  70. package/dist/src/cli/workers/living-docs-worker.js.map +1 -1
  71. package/dist/src/config/types.d.ts +203 -1208
  72. package/dist/src/config/types.d.ts.map +1 -1
  73. package/dist/src/core/discrepancy/increment-generator.d.ts.map +1 -1
  74. package/dist/src/core/discrepancy/increment-generator.js +5 -2
  75. package/dist/src/core/discrepancy/increment-generator.js.map +1 -1
  76. package/dist/src/core/increment/duplicate-detector.js +2 -2
  77. package/dist/src/core/increment/duplicate-detector.js.map +1 -1
  78. package/dist/src/core/increment/increment-archiver.d.ts +49 -4
  79. package/dist/src/core/increment/increment-archiver.d.ts.map +1 -1
  80. package/dist/src/core/increment/increment-archiver.js +123 -22
  81. package/dist/src/core/increment/increment-archiver.js.map +1 -1
  82. package/dist/src/core/increment/increment-status.js +2 -2
  83. package/dist/src/core/increment/increment-status.js.map +1 -1
  84. package/dist/src/core/increment/increment-utils.d.ts +150 -0
  85. package/dist/src/core/increment/increment-utils.d.ts.map +1 -1
  86. package/dist/src/core/increment/increment-utils.js +216 -4
  87. package/dist/src/core/increment/increment-utils.js.map +1 -1
  88. package/dist/src/core/increment/metadata-validator.js +1 -1
  89. package/dist/src/core/increment/metadata-validator.js.map +1 -1
  90. package/dist/src/core/living-docs/feature-archiver.d.ts +4 -0
  91. package/dist/src/core/living-docs/feature-archiver.d.ts.map +1 -1
  92. package/dist/src/core/living-docs/feature-archiver.js +32 -10
  93. package/dist/src/core/living-docs/feature-archiver.js.map +1 -1
  94. package/dist/src/core/living-docs/feature-id-manager.d.ts.map +1 -1
  95. package/dist/src/core/living-docs/feature-id-manager.js +8 -4
  96. package/dist/src/core/living-docs/feature-id-manager.js.map +1 -1
  97. package/dist/src/core/living-docs/governance/ecosystem-detector.d.ts +38 -0
  98. package/dist/src/core/living-docs/governance/ecosystem-detector.d.ts.map +1 -0
  99. package/dist/src/core/living-docs/governance/ecosystem-detector.js +325 -0
  100. package/dist/src/core/living-docs/governance/ecosystem-detector.js.map +1 -0
  101. package/dist/src/core/living-docs/governance/frontend-standards-parser.d.ts +74 -0
  102. package/dist/src/core/living-docs/governance/frontend-standards-parser.d.ts.map +1 -0
  103. package/dist/src/core/living-docs/governance/frontend-standards-parser.js +366 -0
  104. package/dist/src/core/living-docs/governance/frontend-standards-parser.js.map +1 -0
  105. package/dist/src/core/living-docs/governance/go-standards-parser.d.ts +64 -0
  106. package/dist/src/core/living-docs/governance/go-standards-parser.d.ts.map +1 -0
  107. package/dist/src/core/living-docs/governance/go-standards-parser.js +229 -0
  108. package/dist/src/core/living-docs/governance/go-standards-parser.js.map +1 -0
  109. package/dist/src/core/living-docs/governance/index.d.ts +50 -0
  110. package/dist/src/core/living-docs/governance/index.d.ts.map +1 -0
  111. package/dist/src/core/living-docs/governance/index.js +56 -0
  112. package/dist/src/core/living-docs/governance/index.js.map +1 -0
  113. package/dist/src/core/living-docs/governance/java-standards-parser.d.ts +89 -0
  114. package/dist/src/core/living-docs/governance/java-standards-parser.d.ts.map +1 -0
  115. package/dist/src/core/living-docs/governance/java-standards-parser.js +356 -0
  116. package/dist/src/core/living-docs/governance/java-standards-parser.js.map +1 -0
  117. package/dist/src/core/living-docs/governance/python-standards-parser.d.ts +83 -0
  118. package/dist/src/core/living-docs/governance/python-standards-parser.d.ts.map +1 -0
  119. package/dist/src/core/living-docs/governance/python-standards-parser.js +347 -0
  120. package/dist/src/core/living-docs/governance/python-standards-parser.js.map +1 -0
  121. package/dist/src/core/living-docs/governance/standards-generator.d.ts +38 -0
  122. package/dist/src/core/living-docs/governance/standards-generator.d.ts.map +1 -0
  123. package/dist/src/core/living-docs/governance/standards-generator.js +476 -0
  124. package/dist/src/core/living-docs/governance/standards-generator.js.map +1 -0
  125. package/dist/src/core/living-docs/hierarchy-mapper.js +3 -3
  126. package/dist/src/core/living-docs/hierarchy-mapper.js.map +1 -1
  127. package/dist/src/core/living-docs/intelligent-analyzer/architecture-generator.d.ts +18 -0
  128. package/dist/src/core/living-docs/intelligent-analyzer/architecture-generator.d.ts.map +1 -0
  129. package/dist/src/core/living-docs/intelligent-analyzer/architecture-generator.js +299 -0
  130. package/dist/src/core/living-docs/intelligent-analyzer/architecture-generator.js.map +1 -0
  131. package/dist/src/core/living-docs/intelligent-analyzer/deep-repo-analyzer.d.ts +15 -0
  132. package/dist/src/core/living-docs/intelligent-analyzer/deep-repo-analyzer.d.ts.map +1 -0
  133. package/dist/src/core/living-docs/intelligent-analyzer/deep-repo-analyzer.js +138 -0
  134. package/dist/src/core/living-docs/intelligent-analyzer/deep-repo-analyzer.js.map +1 -0
  135. package/dist/src/core/living-docs/intelligent-analyzer/file-sampler.d.ts +24 -0
  136. package/dist/src/core/living-docs/intelligent-analyzer/file-sampler.d.ts.map +1 -0
  137. package/dist/src/core/living-docs/intelligent-analyzer/file-sampler.js +198 -0
  138. package/dist/src/core/living-docs/intelligent-analyzer/file-sampler.js.map +1 -0
  139. package/dist/src/core/living-docs/intelligent-analyzer/inconsistency-detector.d.ts +17 -0
  140. package/dist/src/core/living-docs/intelligent-analyzer/inconsistency-detector.d.ts.map +1 -0
  141. package/dist/src/core/living-docs/intelligent-analyzer/inconsistency-detector.js +241 -0
  142. package/dist/src/core/living-docs/intelligent-analyzer/inconsistency-detector.js.map +1 -0
  143. package/dist/src/core/living-docs/intelligent-analyzer/index.d.ts +28 -0
  144. package/dist/src/core/living-docs/intelligent-analyzer/index.d.ts.map +1 -0
  145. package/dist/src/core/living-docs/intelligent-analyzer/index.js +197 -0
  146. package/dist/src/core/living-docs/intelligent-analyzer/index.js.map +1 -0
  147. package/dist/src/core/living-docs/intelligent-analyzer/organization-synthesizer.d.ts +22 -0
  148. package/dist/src/core/living-docs/intelligent-analyzer/organization-synthesizer.d.ts.map +1 -0
  149. package/dist/src/core/living-docs/intelligent-analyzer/organization-synthesizer.js +482 -0
  150. package/dist/src/core/living-docs/intelligent-analyzer/organization-synthesizer.js.map +1 -0
  151. package/dist/src/core/living-docs/intelligent-analyzer/strategy-generator.d.ts +42 -0
  152. package/dist/src/core/living-docs/intelligent-analyzer/strategy-generator.d.ts.map +1 -0
  153. package/dist/src/core/living-docs/intelligent-analyzer/strategy-generator.js +343 -0
  154. package/dist/src/core/living-docs/intelligent-analyzer/strategy-generator.js.map +1 -0
  155. package/dist/src/core/living-docs/intelligent-analyzer/types.d.ts +190 -0
  156. package/dist/src/core/living-docs/intelligent-analyzer/types.d.ts.map +1 -0
  157. package/dist/src/core/living-docs/intelligent-analyzer/types.js +7 -0
  158. package/dist/src/core/living-docs/intelligent-analyzer/types.js.map +1 -0
  159. package/dist/src/core/living-docs/living-docs-sync.d.ts +11 -3
  160. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  161. package/dist/src/core/living-docs/living-docs-sync.js +53 -10
  162. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  163. package/dist/src/core/living-docs/module-analyzer.d.ts +22 -0
  164. package/dist/src/core/living-docs/module-analyzer.d.ts.map +1 -1
  165. package/dist/src/core/living-docs/module-analyzer.js +123 -19
  166. package/dist/src/core/living-docs/module-analyzer.js.map +1 -1
  167. package/dist/src/core/llm/provider-factory.js +2 -2
  168. package/dist/src/core/llm/provider-factory.js.map +1 -1
  169. package/dist/src/core/llm/providers/anthropic-provider.js +1 -1
  170. package/dist/src/core/llm/providers/bedrock-provider.d.ts.map +1 -1
  171. package/dist/src/core/llm/providers/bedrock-provider.js +8 -4
  172. package/dist/src/core/llm/providers/bedrock-provider.js.map +1 -1
  173. package/dist/src/core/sync/spec-increment-mapper.js +3 -3
  174. package/dist/src/core/sync/spec-increment-mapper.js.map +1 -1
  175. package/dist/src/importers/item-converter.d.ts +25 -0
  176. package/dist/src/importers/item-converter.d.ts.map +1 -1
  177. package/dist/src/importers/item-converter.js +135 -5
  178. package/dist/src/importers/item-converter.js.map +1 -1
  179. package/dist/src/importers/jira-importer.d.ts +14 -0
  180. package/dist/src/importers/jira-importer.d.ts.map +1 -1
  181. package/dist/src/importers/jira-importer.js +75 -0
  182. package/dist/src/importers/jira-importer.js.map +1 -1
  183. package/dist/src/init/architecture/types.d.ts +33 -140
  184. package/dist/src/init/architecture/types.d.ts.map +1 -1
  185. package/dist/src/init/compliance/types.d.ts +30 -27
  186. package/dist/src/init/compliance/types.d.ts.map +1 -1
  187. package/dist/src/init/repo/types.d.ts +11 -34
  188. package/dist/src/init/repo/types.d.ts.map +1 -1
  189. package/dist/src/init/research/src/config/types.d.ts +15 -82
  190. package/dist/src/init/research/src/config/types.d.ts.map +1 -1
  191. package/dist/src/init/research/types.d.ts +38 -93
  192. package/dist/src/init/research/types.d.ts.map +1 -1
  193. package/dist/src/init/team/types.d.ts +4 -42
  194. package/dist/src/init/team/types.d.ts.map +1 -1
  195. package/dist/src/integrations/jira/jira-token-provider.d.ts +93 -0
  196. package/dist/src/integrations/jira/jira-token-provider.d.ts.map +1 -0
  197. package/dist/src/integrations/jira/jira-token-provider.js +160 -0
  198. package/dist/src/integrations/jira/jira-token-provider.js.map +1 -0
  199. package/dist/src/sync/ado-reconciler.d.ts +92 -0
  200. package/dist/src/sync/ado-reconciler.d.ts.map +1 -0
  201. package/dist/src/sync/ado-reconciler.js +335 -0
  202. package/dist/src/sync/ado-reconciler.js.map +1 -0
  203. package/dist/src/sync/jira-reconciler.d.ts +106 -0
  204. package/dist/src/sync/jira-reconciler.d.ts.map +1 -0
  205. package/dist/src/sync/jira-reconciler.js +405 -0
  206. package/dist/src/sync/jira-reconciler.js.map +1 -0
  207. package/dist/src/types/dashboard-cache.d.ts +181 -0
  208. package/dist/src/types/dashboard-cache.d.ts.map +1 -0
  209. package/dist/src/types/dashboard-cache.js +65 -0
  210. package/dist/src/types/dashboard-cache.js.map +1 -0
  211. package/dist/src/types/model-selection.d.ts +6 -4
  212. package/dist/src/types/model-selection.d.ts.map +1 -1
  213. package/dist/src/types/model-selection.js +3 -1
  214. package/dist/src/types/model-selection.js.map +1 -1
  215. package/dist/src/utils/docs-validator.d.ts +131 -0
  216. package/dist/src/utils/docs-validator.d.ts.map +1 -0
  217. package/dist/src/utils/docs-validator.js +529 -0
  218. package/dist/src/utils/docs-validator.js.map +1 -0
  219. package/dist/src/utils/external-tool-drift-detector.d.ts +1 -1
  220. package/dist/src/utils/external-tool-drift-detector.d.ts.map +1 -1
  221. package/dist/src/utils/external-tool-drift-detector.js +5 -4
  222. package/dist/src/utils/external-tool-drift-detector.js.map +1 -1
  223. package/dist/src/utils/feature-id-collision.js +1 -1
  224. package/dist/src/utils/feature-id-collision.js.map +1 -1
  225. package/dist/src/utils/feature-id-derivation.d.ts +8 -3
  226. package/dist/src/utils/feature-id-derivation.d.ts.map +1 -1
  227. package/dist/src/utils/feature-id-derivation.js +14 -6
  228. package/dist/src/utils/feature-id-derivation.js.map +1 -1
  229. package/dist/src/utils/html-to-mdx.d.ts +1 -0
  230. package/dist/src/utils/html-to-mdx.d.ts.map +1 -1
  231. package/dist/src/utils/html-to-mdx.js +43 -5
  232. package/dist/src/utils/html-to-mdx.js.map +1 -1
  233. package/dist/src/utils/model-selection.d.ts +3 -4
  234. package/dist/src/utils/model-selection.d.ts.map +1 -1
  235. package/dist/src/utils/model-selection.js +3 -4
  236. package/dist/src/utils/model-selection.js.map +1 -1
  237. package/package.json +1 -1
  238. package/plugins/specweave/agents/code-standards-detective/AGENT.md +48 -0
  239. package/plugins/specweave/agents/pm/AGENT.md +10 -7
  240. package/plugins/specweave/commands/specweave-archive-features.md +5 -7
  241. package/plugins/specweave/commands/specweave-archive.md +2 -1
  242. package/plugins/specweave/commands/specweave-costs.md +4 -4
  243. package/plugins/specweave/commands/specweave-do.md +44 -10
  244. package/plugins/specweave/commands/specweave-done.md +109 -0
  245. package/plugins/specweave/commands/specweave-import-external.md +45 -18
  246. package/plugins/specweave/commands/specweave-increment.md +331 -33
  247. package/plugins/specweave/commands/specweave-jobs.md +2 -2
  248. package/plugins/specweave/commands/specweave-progress.md +4 -4
  249. package/plugins/specweave/commands/specweave-restore-feature.md +5 -4
  250. package/plugins/specweave/commands/specweave-sync-docs.md +1 -1
  251. package/plugins/specweave/commands/specweave-sync-specs.md +216 -322
  252. package/plugins/specweave/commands/specweave-validate-features.md +13 -8
  253. package/plugins/specweave/commands/specweave-validate.md +27 -1
  254. package/plugins/specweave/hooks/docs-changed.sh.backup +79 -0
  255. package/plugins/specweave/hooks/hooks.json +43 -4
  256. package/plugins/specweave/hooks/human-input-required.sh.backup +75 -0
  257. package/plugins/specweave/hooks/lib/common-setup.sh +375 -0
  258. package/plugins/specweave/hooks/lib/crash-prevention.sh +336 -0
  259. package/plugins/specweave/hooks/post-first-increment.sh.backup +61 -0
  260. package/plugins/specweave/hooks/post-increment-change.sh.backup +98 -0
  261. package/plugins/specweave/hooks/post-increment-completion.sh.backup +231 -0
  262. package/plugins/specweave/hooks/post-increment-planning.sh.backup +1048 -0
  263. package/plugins/specweave/hooks/post-increment-status-change.sh.backup +147 -0
  264. package/plugins/specweave/hooks/post-spec-update.sh.backup +158 -0
  265. package/plugins/specweave/hooks/post-task-completion.sh +4 -23
  266. package/plugins/specweave/hooks/post-user-story-complete.sh.backup +179 -0
  267. package/plugins/specweave/hooks/pre-command-deduplication.sh +1 -6
  268. package/plugins/specweave/hooks/pre-command-deduplication.sh.backup +83 -0
  269. package/plugins/specweave/hooks/pre-implementation.sh.backup +67 -0
  270. package/plugins/specweave/hooks/pre-task-completion.sh +8 -37
  271. package/plugins/specweave/hooks/pre-task-completion.sh.backup +194 -0
  272. package/plugins/specweave/hooks/pre-tool-use.sh +2 -11
  273. package/plugins/specweave/hooks/pre-tool-use.sh.backup +133 -0
  274. package/plugins/specweave/hooks/spec-project-validator.sh +80 -25
  275. package/plugins/specweave/hooks/universal/dispatcher.mjs +135 -42
  276. package/plugins/specweave/hooks/universal/fail-fast-wrapper.sh +183 -0
  277. package/plugins/specweave/hooks/user-prompt-submit.sh +140 -38
  278. package/plugins/specweave/hooks/user-prompt-submit.sh.backup +386 -0
  279. package/plugins/specweave/hooks/v2/dispatchers/post-tool-use.sh +12 -0
  280. package/plugins/specweave/hooks/v2/dispatchers/session-start.sh +89 -0
  281. package/plugins/specweave/hooks/v2/guards/bash-file-guard.sh +211 -0
  282. package/plugins/specweave/hooks/v2/guards/bash-file-guard.test.sh +163 -0
  283. package/plugins/specweave/hooks/v2/guards/completion-guard.sh +26 -28
  284. package/plugins/specweave/hooks/v2/guards/features-folder-guard.sh +50 -0
  285. package/plugins/specweave/hooks/v2/guards/increment-duplicate-guard.sh +135 -0
  286. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js +2 -2
  287. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js.map +1 -1
  288. package/plugins/specweave/scripts/README.md +166 -0
  289. package/plugins/specweave/scripts/cleanup-state.sh +142 -0
  290. package/plugins/specweave/scripts/force-kill.sh +142 -0
  291. package/plugins/specweave/scripts/jobs.js +171 -0
  292. package/plugins/specweave/scripts/progress.js +170 -0
  293. package/plugins/specweave/scripts/read-costs.sh +132 -0
  294. package/plugins/specweave/scripts/read-jobs.sh +324 -0
  295. package/plugins/specweave/scripts/read-progress.sh +185 -0
  296. package/plugins/specweave/scripts/read-status.sh +146 -0
  297. package/plugins/specweave/scripts/read-workflow.sh +173 -0
  298. package/plugins/specweave/scripts/rebuild-dashboard-cache.sh +327 -0
  299. package/plugins/specweave/scripts/session-watchdog.sh +192 -0
  300. package/plugins/specweave/scripts/status.js +154 -0
  301. package/plugins/specweave/scripts/update-dashboard-cache.sh +281 -0
  302. package/plugins/specweave/skills/code-standards-analyzer/SKILL.md +58 -6
  303. package/plugins/specweave/skills/increment-planner/SKILL.md +388 -48
  304. package/plugins/specweave/skills/increment-planner/templates/spec-multi-project.md +17 -7
  305. package/plugins/specweave/skills/increment-planner/templates/spec-single-project.md +6 -1
  306. package/plugins/specweave/skills/increment-planner/templates/tasks-multi-project.md +1 -1
  307. package/plugins/specweave/skills/increment-planner/templates/tasks-single-project.md +1 -1
  308. package/plugins/specweave/skills/instant-status/SKILL.md +70 -0
  309. package/plugins/specweave-ado/commands/cleanup-duplicates.md +212 -0
  310. package/plugins/specweave-ado/commands/reconcile.md +120 -0
  311. package/plugins/specweave-ado/hooks/post-living-docs-update.sh.backup +353 -0
  312. package/plugins/specweave-ado/hooks/post-task-completion.sh.backup +172 -0
  313. package/plugins/specweave-ado/lib/ado-duplicate-detector.js +279 -0
  314. package/plugins/specweave-ado/lib/ado-duplicate-detector.ts +407 -0
  315. package/plugins/specweave-ado/lib/enhanced-ado-sync.js +170 -0
  316. package/plugins/specweave-docs/commands/build.md +32 -4
  317. package/plugins/specweave-docs/commands/preview.md +43 -1
  318. package/plugins/specweave-docs/commands/validate.md +250 -0
  319. package/plugins/specweave-github/agents/github-manager/AGENT.md +2 -2
  320. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +1262 -0
  321. package/plugins/specweave-github/hooks/post-task-completion.sh.backup +258 -0
  322. package/plugins/specweave-github/lib/enhanced-github-sync.js +220 -0
  323. package/plugins/specweave-infrastructure/skills/hetzner-provisioner/README.md +1 -1
  324. package/plugins/specweave-jira/agents/jira-manager/AGENT.md +1 -1
  325. package/plugins/specweave-jira/agents/jira-multi-project-mapper/AGENT.md +530 -0
  326. package/plugins/specweave-jira/agents/jira-sync-judge/AGENT.md +438 -0
  327. package/plugins/specweave-jira/commands/cleanup-duplicates.md +219 -0
  328. package/plugins/specweave-jira/commands/close.md +297 -0
  329. package/plugins/specweave-jira/commands/create.md +198 -0
  330. package/plugins/specweave-jira/commands/reconcile.md +123 -0
  331. package/plugins/specweave-jira/commands/status.md +215 -0
  332. package/plugins/specweave-jira/hooks/post-task-completion.sh.backup +172 -0
  333. package/plugins/specweave-jira/lib/enhanced-jira-sync.js +134 -0
  334. package/plugins/specweave-jira/lib/jira-duplicate-detector.js +296 -0
  335. package/plugins/specweave-jira/lib/jira-duplicate-detector.ts +434 -0
  336. package/plugins/specweave-jira/lib/jira-permission-gate.js +160 -0
  337. package/plugins/specweave-jira/lib/jira-permission-gate.ts +276 -0
  338. package/plugins/specweave-jira/lib/jira-profile-resolver.js +222 -0
  339. package/plugins/specweave-jira/lib/jira-profile-resolver.ts +427 -0
  340. package/plugins/specweave-jira/reference/jira-specweave-mapping.md +16 -11
  341. package/plugins/specweave-release/commands/specweave-release-npm.md +140 -14
  342. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +1254 -0
  343. package/plugins/specweave-release/hooks/post-task-completion.sh.backup +110 -0
  344. package/plugins/specweave/hooks/post-edit-spec.sh +0 -265
  345. package/plugins/specweave/hooks/post-write-spec.sh +0 -267
  346. package/plugins/specweave/hooks/pre-edit-spec.sh +0 -151
  347. package/plugins/specweave/hooks/pre-write-spec.sh +0 -151
@@ -0,0 +1,405 @@
1
+ /**
2
+ * JIRA Reconciler (NEW in v0.33.0)
3
+ *
4
+ * Reconciles JIRA issue states with increment metadata.json statuses.
5
+ * Fixes drift between local SpecWeave state and JIRA:
6
+ * - Closes issues for completed increments that are still open
7
+ * - Reopens issues for in-progress increments that are closed
8
+ *
9
+ * Mirrors the GitHub reconciler pattern for consistency.
10
+ *
11
+ * Triggered by:
12
+ * - /specweave-jira:reconcile command (manual)
13
+ * - SessionStart hook (automatic, if configured)
14
+ * - post-increment-status-change.sh (on resume/abandon)
15
+ */
16
+ import { promises as fs, existsSync } from 'fs';
17
+ import path from 'path';
18
+ import { consoleLogger } from '../utils/logger.js';
19
+ /**
20
+ * JIRA Status Mapping
21
+ */
22
+ const JIRA_STATUSES = {
23
+ CLOSED: ['Done', 'Closed', 'Resolved', "Won't Do"],
24
+ OPEN: ['To Do', 'In Progress', 'In Review', 'Open', 'Reopened'],
25
+ };
26
+ export class JiraReconciler {
27
+ constructor(options) {
28
+ this.domain = '';
29
+ this.auth = '';
30
+ this.projectRoot = options.projectRoot;
31
+ this.dryRun = options.dryRun ?? false;
32
+ this.logger = options.logger ?? consoleLogger;
33
+ }
34
+ /**
35
+ * Main reconciliation entry point
36
+ */
37
+ async reconcile() {
38
+ const result = {
39
+ scanned: 0,
40
+ mismatches: 0,
41
+ closed: 0,
42
+ reopened: 0,
43
+ errors: [],
44
+ details: [],
45
+ };
46
+ try {
47
+ // 1. Check if JIRA sync is enabled
48
+ const config = await this.loadConfig();
49
+ const canUpdate = config.sync?.settings?.canUpdateExternalItems ?? false;
50
+ const canUpdateStatus = config.sync?.settings?.canUpdateStatus ?? false;
51
+ const jiraEnabled = config.sync?.jira?.enabled ?? false;
52
+ if (!canUpdate || !jiraEnabled) {
53
+ this.logger.log('ℹ️ JIRA sync is disabled - skipping reconciliation');
54
+ this.logger.log(' Enable with: canUpdateExternalItems=true AND sync.jira.enabled=true');
55
+ return result;
56
+ }
57
+ if (!canUpdateStatus) {
58
+ this.logger.log('ℹ️ JIRA status updates are disabled - skipping reconciliation');
59
+ this.logger.log(' Enable with: canUpdateStatus=true');
60
+ return result;
61
+ }
62
+ // 2. Verify JIRA credentials
63
+ if (!this.initCredentials()) {
64
+ result.errors.push('JIRA credentials not configured');
65
+ this.logger.error('❌ JIRA credentials not found. Set JIRA_API_TOKEN and JIRA_EMAIL environment variables.');
66
+ return result;
67
+ }
68
+ // 3. Scan all non-archived increments
69
+ const increments = await this.scanIncrements();
70
+ result.scanned = increments.length;
71
+ this.logger.log(`\n📊 Scanning ${increments.length} increment(s) for JIRA state drift...\n`);
72
+ // 4. Check and fix each increment
73
+ for (const inc of increments) {
74
+ await this.reconcileIncrement(inc, result);
75
+ }
76
+ // 5. Report summary
77
+ this.logger.log('\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
78
+ this.logger.log('📊 JIRA RECONCILIATION SUMMARY');
79
+ this.logger.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
80
+ this.logger.log(` Increments scanned: ${result.scanned}`);
81
+ this.logger.log(` Mismatches found: ${result.mismatches}`);
82
+ this.logger.log(` Issues closed: ${result.closed}`);
83
+ this.logger.log(` Issues reopened: ${result.reopened}`);
84
+ this.logger.log(` Errors: ${result.errors.length}`);
85
+ if (this.dryRun) {
86
+ this.logger.log('\n ⚠️ DRY RUN - No changes were made');
87
+ }
88
+ this.logger.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n');
89
+ return result;
90
+ }
91
+ catch (error) {
92
+ result.errors.push(`Reconciliation error: ${error.message}`);
93
+ this.logger.error('❌ Reconciliation failed:', error.message);
94
+ return result;
95
+ }
96
+ }
97
+ /**
98
+ * Reconcile a single increment
99
+ */
100
+ async reconcileIncrement(inc, result) {
101
+ const status = inc.metadataStatus;
102
+ // Determine expected JIRA state
103
+ const shouldBeClosed = status === 'completed' || status === 'abandoned';
104
+ const shouldBeOpen = status === 'in-progress' || status === 'active' || status === 'planning';
105
+ // Check main issue
106
+ if (inc.issue) {
107
+ await this.reconcileIssue(inc.incrementId, inc.issue.key, shouldBeClosed, shouldBeOpen, status, result);
108
+ }
109
+ // Check User Story issues
110
+ for (const us of inc.userStoryIssues) {
111
+ await this.reconcileIssue(`${inc.incrementId}/${us.userStoryId}`, us.issueKey, shouldBeClosed, shouldBeOpen, status, result);
112
+ }
113
+ }
114
+ /**
115
+ * Reconcile a single issue
116
+ */
117
+ async reconcileIssue(context, issueKey, shouldBeClosed, shouldBeOpen, metadataStatus, result) {
118
+ try {
119
+ // Get current JIRA state
120
+ const issue = await this.getIssue(issueKey);
121
+ const currentStatus = issue?.fields?.status?.name ?? 'Unknown';
122
+ const isCurrentlyClosed = JIRA_STATUSES.CLOSED.includes(currentStatus);
123
+ // Check for mismatch
124
+ if (shouldBeClosed && !isCurrentlyClosed) {
125
+ // Should be closed but is open
126
+ result.mismatches++;
127
+ this.logger.log(` ❌ Issue ${issueKey} (${context}): ${currentStatus} but should be CLOSED (status=${metadataStatus})`);
128
+ if (!this.dryRun) {
129
+ const comment = `h2. 🔄 Auto-Reconciled by SpecWeave
130
+
131
+ This issue was closed by SpecWeave reconciliation.
132
+
133
+ *Reason*: Increment status is \`${metadataStatus}\` but JIRA issue was still open.
134
+
135
+ ----
136
+ 🤖 Auto-reconciled by SpecWeave`;
137
+ await this.transitionIssue(issueKey, 'Done', comment);
138
+ result.closed++;
139
+ this.logger.log(` ✅ Closed issue ${issueKey}`);
140
+ }
141
+ else {
142
+ this.logger.log(` [DRY RUN] Would close issue ${issueKey}`);
143
+ }
144
+ result.details.push({
145
+ incrementId: context,
146
+ action: this.dryRun ? 'skip' : 'close',
147
+ issueKey,
148
+ reason: `Status=${metadataStatus}, JIRA=${currentStatus}`,
149
+ });
150
+ }
151
+ else if (shouldBeOpen && isCurrentlyClosed) {
152
+ // Should be open but is closed
153
+ result.mismatches++;
154
+ this.logger.log(` ❌ Issue ${issueKey} (${context}): CLOSED but should be OPEN (status=${metadataStatus})`);
155
+ if (!this.dryRun) {
156
+ const comment = `h2. 🔄 Auto-Reconciled by SpecWeave
157
+
158
+ This issue was reopened by SpecWeave reconciliation.
159
+
160
+ *Reason*: Increment status is \`${metadataStatus}\` but JIRA issue was closed.
161
+ This typically happens when an increment was resumed after being paused/completed.
162
+
163
+ ----
164
+ 🤖 Auto-reconciled by SpecWeave`;
165
+ await this.transitionIssue(issueKey, 'To Do', comment);
166
+ result.reopened++;
167
+ this.logger.log(` ✅ Reopened issue ${issueKey}`);
168
+ }
169
+ else {
170
+ this.logger.log(` [DRY RUN] Would reopen issue ${issueKey}`);
171
+ }
172
+ result.details.push({
173
+ incrementId: context,
174
+ action: this.dryRun ? 'skip' : 'reopen',
175
+ issueKey,
176
+ reason: `Status=${metadataStatus}, JIRA=${currentStatus}`,
177
+ });
178
+ }
179
+ else {
180
+ // State matches
181
+ this.logger.log(` ✅ Issue ${issueKey} (${context}): State matches (${currentStatus})`);
182
+ result.details.push({
183
+ incrementId: context,
184
+ action: 'skip',
185
+ issueKey,
186
+ reason: 'State matches',
187
+ });
188
+ }
189
+ }
190
+ catch (error) {
191
+ result.errors.push(`Issue ${issueKey}: ${error.message}`);
192
+ result.details.push({
193
+ incrementId: context,
194
+ action: 'error',
195
+ issueKey,
196
+ reason: error.message,
197
+ });
198
+ }
199
+ }
200
+ /**
201
+ * Scan increments directory for non-archived increments
202
+ */
203
+ async scanIncrements() {
204
+ const incrementsPath = path.join(this.projectRoot, '.specweave', 'increments');
205
+ const results = [];
206
+ if (!existsSync(incrementsPath)) {
207
+ return results;
208
+ }
209
+ const entries = await fs.readdir(incrementsPath, { withFileTypes: true });
210
+ for (const entry of entries) {
211
+ if (!entry.isDirectory())
212
+ continue;
213
+ if (entry.name === '_archive' || entry.name.startsWith('.'))
214
+ continue;
215
+ const incrementPath = path.join(incrementsPath, entry.name);
216
+ const metadataPath = path.join(incrementPath, 'metadata.json');
217
+ if (!existsSync(metadataPath))
218
+ continue;
219
+ try {
220
+ const metadataContent = await fs.readFile(metadataPath, 'utf-8');
221
+ const metadata = JSON.parse(metadataContent);
222
+ // Check for JIRA issue link (support both new and legacy naming)
223
+ const jiraSync = metadata.external_sync?.jira || metadata.external_ids?.jira;
224
+ if (!jiraSync?.issueKey && !jiraSync?.epic)
225
+ continue;
226
+ const state = {
227
+ incrementId: entry.name,
228
+ incrementPath,
229
+ metadataStatus: metadata.status || 'unknown',
230
+ featureId: metadata.featureId,
231
+ issue: {
232
+ key: jiraSync.issueKey || jiraSync.epic,
233
+ url: jiraSync.issueUrl,
234
+ },
235
+ userStoryIssues: [],
236
+ };
237
+ // Extract user story issues if present
238
+ if (jiraSync.stories && Array.isArray(jiraSync.stories)) {
239
+ for (const story of jiraSync.stories) {
240
+ if (story.issueKey || story.key) {
241
+ state.userStoryIssues.push({
242
+ userStoryId: story.id || story.userStoryId,
243
+ issueKey: story.issueKey || story.key,
244
+ });
245
+ }
246
+ }
247
+ }
248
+ results.push(state);
249
+ }
250
+ catch {
251
+ // Skip invalid metadata
252
+ }
253
+ }
254
+ return results;
255
+ }
256
+ /**
257
+ * Load config.json
258
+ */
259
+ async loadConfig() {
260
+ const configPath = path.join(this.projectRoot, '.specweave', 'config.json');
261
+ try {
262
+ const content = await fs.readFile(configPath, 'utf-8');
263
+ return JSON.parse(content);
264
+ }
265
+ catch {
266
+ return {};
267
+ }
268
+ }
269
+ /**
270
+ * Initialize JIRA credentials
271
+ */
272
+ initCredentials() {
273
+ const token = process.env.JIRA_API_TOKEN;
274
+ const email = process.env.JIRA_EMAIL;
275
+ this.domain = process.env.JIRA_DOMAIN || '';
276
+ if (!token || !email || !this.domain) {
277
+ return false;
278
+ }
279
+ this.auth = Buffer.from(`${email}:${token}`).toString('base64');
280
+ return true;
281
+ }
282
+ /**
283
+ * Get issue from JIRA API
284
+ */
285
+ async getIssue(issueKey) {
286
+ const url = `https://${this.domain}/rest/api/3/issue/${issueKey}`;
287
+ const response = await fetch(url, {
288
+ headers: {
289
+ Authorization: `Basic ${this.auth}`,
290
+ Accept: 'application/json',
291
+ },
292
+ });
293
+ if (!response.ok) {
294
+ throw new Error(`Failed to get issue: ${response.status}`);
295
+ }
296
+ return response.json();
297
+ }
298
+ /**
299
+ * Get available transitions for an issue
300
+ */
301
+ async getTransitions(issueKey) {
302
+ const url = `https://${this.domain}/rest/api/3/issue/${issueKey}/transitions`;
303
+ const response = await fetch(url, {
304
+ headers: {
305
+ Authorization: `Basic ${this.auth}`,
306
+ Accept: 'application/json',
307
+ },
308
+ });
309
+ if (!response.ok) {
310
+ throw new Error(`Failed to get transitions: ${response.status}`);
311
+ }
312
+ const data = await response.json();
313
+ return data.transitions || [];
314
+ }
315
+ /**
316
+ * Transition issue to new status and add comment
317
+ */
318
+ async transitionIssue(issueKey, targetStatus, comment) {
319
+ // First, add comment
320
+ await this.addComment(issueKey, comment);
321
+ // Get available transitions
322
+ const transitions = await this.getTransitions(issueKey);
323
+ // Find transition matching target status
324
+ const transition = transitions.find((t) => t.name.toLowerCase() === targetStatus.toLowerCase() ||
325
+ t.to?.name?.toLowerCase() === targetStatus.toLowerCase());
326
+ if (!transition) {
327
+ // Try common alternatives
328
+ const alternatives = targetStatus === 'Done'
329
+ ? ['Closed', 'Resolved', 'Complete']
330
+ : ['Open', 'Reopened', 'In Progress'];
331
+ const altTransition = transitions.find((t) => alternatives.some(alt => t.name.toLowerCase() === alt.toLowerCase() ||
332
+ t.to?.name?.toLowerCase() === alt.toLowerCase()));
333
+ if (!altTransition) {
334
+ throw new Error(`No transition found to "${targetStatus}". Available: ${transitions.map((t) => t.name).join(', ')}`);
335
+ }
336
+ await this.doTransition(issueKey, altTransition.id);
337
+ }
338
+ else {
339
+ await this.doTransition(issueKey, transition.id);
340
+ }
341
+ }
342
+ /**
343
+ * Execute transition
344
+ */
345
+ async doTransition(issueKey, transitionId) {
346
+ const url = `https://${this.domain}/rest/api/3/issue/${issueKey}/transitions`;
347
+ const response = await fetch(url, {
348
+ method: 'POST',
349
+ headers: {
350
+ Authorization: `Basic ${this.auth}`,
351
+ 'Content-Type': 'application/json',
352
+ },
353
+ body: JSON.stringify({
354
+ transition: { id: transitionId },
355
+ }),
356
+ });
357
+ if (!response.ok) {
358
+ const error = await response.text();
359
+ throw new Error(`Failed to transition issue: ${response.status} - ${error}`);
360
+ }
361
+ }
362
+ /**
363
+ * Add comment to issue
364
+ */
365
+ async addComment(issueKey, comment) {
366
+ const url = `https://${this.domain}/rest/api/3/issue/${issueKey}/comment`;
367
+ const response = await fetch(url, {
368
+ method: 'POST',
369
+ headers: {
370
+ Authorization: `Basic ${this.auth}`,
371
+ 'Content-Type': 'application/json',
372
+ },
373
+ body: JSON.stringify({
374
+ body: {
375
+ type: 'doc',
376
+ version: 1,
377
+ content: [
378
+ {
379
+ type: 'paragraph',
380
+ content: [
381
+ {
382
+ type: 'text',
383
+ text: comment,
384
+ },
385
+ ],
386
+ },
387
+ ],
388
+ },
389
+ }),
390
+ });
391
+ if (!response.ok) {
392
+ // Non-fatal, just log warning
393
+ this.logger.log(` ⚠️ Failed to add comment to ${issueKey}`);
394
+ }
395
+ }
396
+ }
397
+ /**
398
+ * Convenience function for quick reconciliation
399
+ */
400
+ export async function reconcileJira(projectRoot = process.cwd(), dryRun = false) {
401
+ const reconciler = new JiraReconciler({ projectRoot, dryRun });
402
+ return reconciler.reconcile();
403
+ }
404
+ export default JiraReconciler;
405
+ //# sourceMappingURL=jira-reconciler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jira-reconciler.js","sourceRoot":"","sources":["../../../src/sync/jira-reconciler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAU,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAqC3D;;GAEG;AACH,MAAM,aAAa,GAAG;IACpB,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,CAAC;IAClD,IAAI,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC;CAChE,CAAC;AAEF,MAAM,OAAO,cAAc;IAOzB,YAAY,OAA6B;QAHjC,WAAM,GAAW,EAAE,CAAC;QACpB,SAAI,GAAW,EAAE,CAAC;QAGxB,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,KAAK,CAAC;QACt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ED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,181 @@
1
+ /**
2
+ * Type definitions for Dashboard Cache system
3
+ *
4
+ * Pre-computed state cache for O(1) status command reads.
5
+ * Updated incrementally on file changes, not rebuilt on every query.
6
+ *
7
+ * @see spec.md 0117-instant-dashboard-cache
8
+ */
9
+ /**
10
+ * Current cache schema version
11
+ * Increment when making breaking schema changes
12
+ */
13
+ export declare const DASHBOARD_CACHE_VERSION = 1;
14
+ /**
15
+ * Cache file location
16
+ */
17
+ export declare const DASHBOARD_CACHE_PATH = ".specweave/state/dashboard.json";
18
+ /**
19
+ * Task completion stats for an increment
20
+ */
21
+ export interface TaskStats {
22
+ total: number;
23
+ completed: number;
24
+ }
25
+ /**
26
+ * Acceptance criteria stats for an increment
27
+ */
28
+ export interface ACStats {
29
+ total: number;
30
+ completed: number;
31
+ }
32
+ /**
33
+ * Increment status values
34
+ */
35
+ export type IncrementStatus = 'backlog' | 'planned' | 'active' | 'paused' | 'ready_for_review' | 'completed' | 'abandoned';
36
+ /**
37
+ * Increment type values
38
+ */
39
+ export type IncrementType = 'feature' | 'hotfix' | 'bug' | 'refactor' | 'experiment' | 'change-request';
40
+ /**
41
+ * Priority values
42
+ */
43
+ export type Priority = 'P0' | 'P1' | 'P2' | 'P3';
44
+ /**
45
+ * Cached data for a single increment
46
+ */
47
+ export interface CachedIncrement {
48
+ /** Increment status */
49
+ status: IncrementStatus;
50
+ /** Increment type */
51
+ type: IncrementType;
52
+ /** Priority level */
53
+ priority: Priority;
54
+ /** Task completion stats */
55
+ tasks: TaskStats;
56
+ /** Acceptance criteria completion stats */
57
+ acs: ACStats;
58
+ /** Creation timestamp */
59
+ createdAt: string;
60
+ /** Last activity timestamp */
61
+ lastActivity: string;
62
+ /** User story IDs in this increment */
63
+ userStories: string[];
64
+ /** Increment title (for display) */
65
+ title?: string;
66
+ /** Project ID */
67
+ project?: string;
68
+ }
69
+ /**
70
+ * Summary counts by status
71
+ */
72
+ export interface StatusSummary {
73
+ total: number;
74
+ active: number;
75
+ paused: number;
76
+ backlog: number;
77
+ planned: number;
78
+ ready_for_review: number;
79
+ completed: number;
80
+ abandoned: number;
81
+ archived: number;
82
+ }
83
+ /**
84
+ * Counts by type
85
+ */
86
+ export interface TypeCounts {
87
+ feature: number;
88
+ hotfix: number;
89
+ bug: number;
90
+ refactor: number;
91
+ experiment: number;
92
+ 'change-request': number;
93
+ }
94
+ /**
95
+ * Counts by priority
96
+ */
97
+ export interface PriorityCounts {
98
+ P0: number;
99
+ P1: number;
100
+ P2: number;
101
+ P3: number;
102
+ }
103
+ /**
104
+ * Summary statistics across all increments
105
+ */
106
+ export interface DashboardSummary extends StatusSummary {
107
+ byType: TypeCounts;
108
+ byPriority: PriorityCounts;
109
+ }
110
+ /**
111
+ * Background job info
112
+ */
113
+ export interface CachedJob {
114
+ id: string;
115
+ type: string;
116
+ status: 'running' | 'paused' | 'completed' | 'failed';
117
+ progress?: number;
118
+ message?: string;
119
+ startedAt: string;
120
+ updatedAt: string;
121
+ }
122
+ /**
123
+ * Jobs section of cache
124
+ */
125
+ export interface JobsCache {
126
+ running: CachedJob[];
127
+ paused: CachedJob[];
128
+ failed: CachedJob[];
129
+ completedCount: number;
130
+ }
131
+ /**
132
+ * Cost tracking section of cache
133
+ */
134
+ export interface CostsCache {
135
+ totalTokens: number;
136
+ totalCost: number;
137
+ totalSavings: number;
138
+ byIncrement: Record<string, {
139
+ tokens: number;
140
+ cost: number;
141
+ savings: number;
142
+ }>;
143
+ }
144
+ /**
145
+ * Source file mtimes for stale detection
146
+ */
147
+ export interface SourceMtimes {
148
+ [incrementId: string]: {
149
+ metadata?: number;
150
+ tasks?: number;
151
+ spec?: number;
152
+ };
153
+ }
154
+ /**
155
+ * Complete dashboard cache structure
156
+ */
157
+ export interface DashboardCache {
158
+ /** Schema version for migrations */
159
+ version: number;
160
+ /** Last update timestamp */
161
+ updatedAt: string;
162
+ /** Per-increment cached data */
163
+ increments: Record<string, CachedIncrement>;
164
+ /** Aggregated summary statistics */
165
+ summary: DashboardSummary;
166
+ /** Background jobs state */
167
+ jobs: JobsCache;
168
+ /** Cost tracking data */
169
+ costs: CostsCache;
170
+ /** Source file mtimes for stale detection */
171
+ mtimes?: SourceMtimes;
172
+ }
173
+ /**
174
+ * Change types for incremental updates
175
+ */
176
+ export type CacheChangeType = 'metadata' | 'tasks' | 'spec' | 'jobs';
177
+ /**
178
+ * Create an empty dashboard cache
179
+ */
180
+ export declare function createEmptyCache(): DashboardCache;
181
+ //# sourceMappingURL=dashboard-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-cache.d.ts","sourceRoot":"","sources":["../../../src/types/dashboard-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,oBAAoB,oCAAoC,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,QAAQ,GACR,KAAK,GACL,UAAU,GACV,YAAY,GACZ,gBAAgB,CAAC;AAErB;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,qBAAqB;IACrB,IAAI,EAAE,aAAa,CAAC;IACpB,q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KAAK,EAAE,UAAU,CAAC;IAClB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAErE;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,cAAc,CA2CjD"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Type definitions for Dashboard Cache system
3
+ *
4
+ * Pre-computed state cache for O(1) status command reads.
5
+ * Updated incrementally on file changes, not rebuilt on every query.
6
+ *
7
+ * @see spec.md 0117-instant-dashboard-cache
8
+ */
9
+ /**
10
+ * Current cache schema version
11
+ * Increment when making breaking schema changes
12
+ */
13
+ export const DASHBOARD_CACHE_VERSION = 1;
14
+ /**
15
+ * Cache file location
16
+ */
17
+ export const DASHBOARD_CACHE_PATH = '.specweave/state/dashboard.json';
18
+ /**
19
+ * Create an empty dashboard cache
20
+ */
21
+ export function createEmptyCache() {
22
+ return {
23
+ version: DASHBOARD_CACHE_VERSION,
24
+ updatedAt: new Date().toISOString(),
25
+ increments: {},
26
+ summary: {
27
+ total: 0,
28
+ active: 0,
29
+ paused: 0,
30
+ backlog: 0,
31
+ planned: 0,
32
+ ready_for_review: 0,
33
+ completed: 0,
34
+ abandoned: 0,
35
+ archived: 0,
36
+ byType: {
37
+ feature: 0,
38
+ hotfix: 0,
39
+ bug: 0,
40
+ refactor: 0,
41
+ experiment: 0,
42
+ 'change-request': 0,
43
+ },
44
+ byPriority: {
45
+ P0: 0,
46
+ P1: 0,
47
+ P2: 0,
48
+ P3: 0,
49
+ },
50
+ },
51
+ jobs: {
52
+ running: [],
53
+ paused: [],
54
+ failed: [],
55
+ completedCount: 0,
56
+ },
57
+ costs: {
58
+ totalTokens: 0,
59
+ totalCost: 0,
60
+ totalSavings: 0,
61
+ byIncrement: {},
62
+ },
63
+ };
64
+ }
65
+ //# sourceMappingURL=dashboard-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-cache.js","sourceRoot":"","sources":["../../../src/types/dashboard-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,iCAAiC,CAAC;AA8LtE;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,OAAO,EAAE,uBAAuB;QAChC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,UAAU,EAAE,EAAE;QACd,OAAO,EAAE;YACP,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,MAAM,EAAE,CAAC;YACT,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;YACV,gBAAgB,EAAE,CAAC;YACnB,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,CAAC;YACZ,QAAQ,EAAE,CAAC;YACX,MAAM,EAAE;gBACN,OAAO,EAAE,CAAC;gBACV,MAAM,EAAE,CAAC;gBACT,GAAG,EAAE,CAAC;gBACN,QAAQ,EAAE,CAAC;gBACX,UAAU,EAAE,CAAC;gBACb,gBAAgB,EAAE,CAAC;aACpB;YACD,UAAU,EAAE;gBACV,EAAE,EAAE,CAAC;gBACL,EAAE,EAAE,CAAC;gBACL,EAAE,EAAE,CAAC;gBACL,EAAE,EAAE,CAAC;aACN;SACF;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,EAAE;YACV,cAAc,EAAE,CAAC;SAClB;QACD,KAAK,EAAE;YACL,WAAW,EAAE,CAAC;YACd,SAAS,EAAE,CAAC;YACZ,YAAY,EAAE,CAAC;YACf,WAAW,EAAE,EAAE;SAChB;KACF,CAAC;AACJ,CAAC"}