@cleocode/core 2026.4.5 → 2026.4.7

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 (782) hide show
  1. package/dist/discovery.d.ts +69 -0
  2. package/dist/discovery.d.ts.map +1 -0
  3. package/dist/index.d.ts +3 -2
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +1643 -2349
  6. package/dist/index.js.map +4 -4
  7. package/dist/init.d.ts +51 -0
  8. package/dist/init.d.ts.map +1 -1
  9. package/dist/internal.d.ts +9 -1
  10. package/dist/internal.d.ts.map +1 -1
  11. package/dist/lifecycle/default-chain.d.ts +8 -2
  12. package/dist/lifecycle/default-chain.d.ts.map +1 -1
  13. package/dist/lifecycle/index.d.ts +1 -0
  14. package/dist/lifecycle/index.d.ts.map +1 -1
  15. package/dist/lifecycle/stage-guidance.d.ts +140 -0
  16. package/dist/lifecycle/stage-guidance.d.ts.map +1 -0
  17. package/dist/orchestration/protocol-validators.d.ts +122 -3
  18. package/dist/orchestration/protocol-validators.d.ts.map +1 -1
  19. package/dist/paths.d.ts +91 -0
  20. package/dist/paths.d.ts.map +1 -1
  21. package/dist/scaffold.d.ts +31 -1
  22. package/dist/scaffold.d.ts.map +1 -1
  23. package/dist/skills/dispatch.d.ts +1 -1
  24. package/dist/skills/skill-paths.d.ts +9 -6
  25. package/dist/skills/skill-paths.d.ts.map +1 -1
  26. package/dist/validation/protocols/_shared.d.ts +40 -0
  27. package/dist/validation/protocols/_shared.d.ts.map +1 -0
  28. package/dist/validation/protocols/architecture-decision.d.ts +23 -0
  29. package/dist/validation/protocols/architecture-decision.d.ts.map +1 -0
  30. package/dist/validation/protocols/artifact-publish.d.ts +22 -0
  31. package/dist/validation/protocols/artifact-publish.d.ts.map +1 -0
  32. package/dist/validation/protocols/consensus.d.ts +11 -17
  33. package/dist/validation/protocols/consensus.d.ts.map +1 -1
  34. package/dist/validation/protocols/contribution.d.ts +12 -17
  35. package/dist/validation/protocols/contribution.d.ts.map +1 -1
  36. package/dist/validation/protocols/decomposition.d.ts +18 -21
  37. package/dist/validation/protocols/decomposition.d.ts.map +1 -1
  38. package/dist/validation/protocols/implementation.d.ts +9 -17
  39. package/dist/validation/protocols/implementation.d.ts.map +1 -1
  40. package/dist/validation/protocols/provenance.d.ts +23 -0
  41. package/dist/validation/protocols/provenance.d.ts.map +1 -0
  42. package/dist/validation/protocols/release.d.ts +25 -0
  43. package/dist/validation/protocols/release.d.ts.map +1 -0
  44. package/dist/validation/protocols/research.d.ts +9 -17
  45. package/dist/validation/protocols/research.d.ts.map +1 -1
  46. package/dist/validation/protocols/specification.d.ts +7 -17
  47. package/dist/validation/protocols/specification.d.ts.map +1 -1
  48. package/dist/validation/protocols/testing.d.ts +22 -0
  49. package/dist/validation/protocols/testing.d.ts.map +1 -0
  50. package/dist/validation/protocols/validation.d.ts +22 -0
  51. package/dist/validation/protocols/validation.d.ts.map +1 -0
  52. package/package.json +7 -7
  53. package/src/discovery.ts +235 -0
  54. package/src/index.ts +16 -0
  55. package/src/init.ts +196 -0
  56. package/src/internal.ts +31 -1
  57. package/src/lifecycle/default-chain.ts +11 -2
  58. package/src/lifecycle/index.ts +10 -0
  59. package/src/lifecycle/stage-guidance.ts +282 -0
  60. package/src/orchestration/__tests__/protocol-validators.test.ts +259 -7
  61. package/src/orchestration/protocol-validators.ts +419 -4
  62. package/src/paths.ts +110 -0
  63. package/src/scaffold.ts +240 -4
  64. package/src/skills/dispatch.ts +6 -6
  65. package/src/skills/skill-paths.ts +27 -23
  66. package/src/validation/protocols/_shared.ts +88 -0
  67. package/src/validation/protocols/architecture-decision.ts +52 -0
  68. package/src/validation/protocols/artifact-publish.ts +49 -0
  69. package/src/validation/protocols/consensus.ts +44 -74
  70. package/src/validation/protocols/contribution.ts +28 -65
  71. package/src/validation/protocols/decomposition.ts +37 -64
  72. package/src/validation/protocols/implementation.ts +25 -65
  73. package/src/validation/protocols/protocols-markdown/architecture-decision.md +303 -0
  74. package/src/validation/protocols/protocols-markdown/artifact-publish.md +600 -0
  75. package/src/validation/protocols/protocols-markdown/consensus.md +322 -0
  76. package/src/validation/protocols/protocols-markdown/contribution.md +388 -0
  77. package/src/validation/protocols/protocols-markdown/decomposition.md +421 -0
  78. package/src/validation/protocols/protocols-markdown/implementation.md +357 -0
  79. package/src/validation/protocols/protocols-markdown/provenance.md +613 -0
  80. package/src/validation/protocols/protocols-markdown/release.md +783 -0
  81. package/src/validation/protocols/protocols-markdown/research.md +261 -0
  82. package/src/validation/protocols/protocols-markdown/specification.md +300 -0
  83. package/src/validation/protocols/protocols-markdown/testing.md +287 -0
  84. package/src/validation/protocols/protocols-markdown/validation.md +242 -0
  85. package/src/validation/protocols/provenance.ts +50 -0
  86. package/src/validation/protocols/release.ts +44 -0
  87. package/src/validation/protocols/research.ts +25 -87
  88. package/src/validation/protocols/specification.ts +27 -89
  89. package/src/validation/protocols/testing.ts +46 -0
  90. package/src/validation/protocols/validation.ts +46 -0
  91. package/dist/cant/approval.d.ts +0 -110
  92. package/dist/cant/approval.d.ts.map +0 -1
  93. package/dist/cant/context-builder.d.ts +0 -79
  94. package/dist/cant/context-builder.d.ts.map +0 -1
  95. package/dist/cant/discretion.d.ts +0 -95
  96. package/dist/cant/discretion.d.ts.map +0 -1
  97. package/dist/cant/index.d.ts +0 -25
  98. package/dist/cant/index.d.ts.map +0 -1
  99. package/dist/cant/parallel-runner.d.ts +0 -38
  100. package/dist/cant/parallel-runner.d.ts.map +0 -1
  101. package/dist/cant/types.d.ts +0 -127
  102. package/dist/cant/types.d.ts.map +0 -1
  103. package/dist/cant/workflow-executor.d.ts +0 -105
  104. package/dist/cant/workflow-executor.d.ts.map +0 -1
  105. package/dist/validation/protocols/release-protocol.d.ts +0 -27
  106. package/dist/validation/protocols/release-protocol.d.ts.map +0 -1
  107. package/dist/validation/protocols/testing-protocol.d.ts +0 -27
  108. package/dist/validation/protocols/testing-protocol.d.ts.map +0 -1
  109. package/dist/validation/protocols/validation-protocol.d.ts +0 -27
  110. package/dist/validation/protocols/validation-protocol.d.ts.map +0 -1
  111. package/schemas/agent-configs.schema.json +0 -120
  112. package/schemas/agent-registry.schema.json +0 -132
  113. package/schemas/archive.schema.json +0 -450
  114. package/schemas/brain-decision.schema.json +0 -69
  115. package/schemas/brain-learning.schema.json +0 -57
  116. package/schemas/brain-pattern.schema.json +0 -72
  117. package/schemas/critical-path.schema.json +0 -246
  118. package/schemas/deps-cache.schema.json +0 -97
  119. package/schemas/doctor-output.schema.json +0 -283
  120. package/schemas/error.schema.json +0 -161
  121. package/schemas/global-config.schema.json +0 -219
  122. package/schemas/grade.schema.json +0 -49
  123. package/schemas/log.schema.json +0 -250
  124. package/schemas/metrics.schema.json +0 -328
  125. package/schemas/migrations.schema.json +0 -150
  126. package/schemas/nexus-registry.schema.json +0 -90
  127. package/schemas/operation-constitution.schema.json +0 -438
  128. package/schemas/output.schema.json +0 -164
  129. package/schemas/projects-registry.schema.json +0 -107
  130. package/schemas/protocol-frontmatter.schema.json +0 -72
  131. package/schemas/rcasd-consensus-report.schema.json +0 -10
  132. package/schemas/rcasd-evidence.schema.json +0 -42
  133. package/schemas/rcasd-gate-result.schema.json +0 -46
  134. package/schemas/rcasd-hitl-resolution.schema.json +0 -10
  135. package/schemas/rcasd-index.schema.json +0 -10
  136. package/schemas/rcasd-manifest.schema.json +0 -10
  137. package/schemas/rcasd-research-output.schema.json +0 -10
  138. package/schemas/rcasd-spec-frontmatter.schema.json +0 -10
  139. package/schemas/rcasd-stage-transition.schema.json +0 -38
  140. package/schemas/releases.schema.json +0 -267
  141. package/schemas/skills-manifest.schema.json +0 -91
  142. package/schemas/spec-index.schema.json +0 -196
  143. package/schemas/system-flow-atlas.schema.json +0 -125
  144. package/src/__tests__/audit-prune.test.d.ts.map +0 -1
  145. package/src/__tests__/audit-prune.test.js +0 -162
  146. package/src/__tests__/audit-prune.test.js.map +0 -1
  147. package/src/__tests__/caamp-skill-install.test.d.ts.map +0 -1
  148. package/src/__tests__/caamp-skill-install.test.js +0 -147
  149. package/src/__tests__/caamp-skill-install.test.js.map +0 -1
  150. package/src/__tests__/cli-parity.test.d.ts.map +0 -1
  151. package/src/__tests__/cli-parity.test.js +0 -209
  152. package/src/__tests__/cli-parity.test.js.map +0 -1
  153. package/src/__tests__/config.test.d.ts.map +0 -1
  154. package/src/__tests__/config.test.js +0 -144
  155. package/src/__tests__/config.test.js.map +0 -1
  156. package/src/__tests__/core-parity.test.d.ts.map +0 -1
  157. package/src/__tests__/core-parity.test.js +0 -645
  158. package/src/__tests__/core-parity.test.js.map +0 -1
  159. package/src/__tests__/error-catalog.test.d.ts.map +0 -1
  160. package/src/__tests__/error-catalog.test.js +0 -127
  161. package/src/__tests__/error-catalog.test.js.map +0 -1
  162. package/src/__tests__/golden-parity.test.d.ts.map +0 -1
  163. package/src/__tests__/golden-parity.test.js +0 -212
  164. package/src/__tests__/golden-parity.test.js.map +0 -1
  165. package/src/__tests__/hooks.test.d.ts.map +0 -1
  166. package/src/__tests__/hooks.test.js +0 -201
  167. package/src/__tests__/hooks.test.js.map +0 -1
  168. package/src/__tests__/human-output.test.d.ts.map +0 -1
  169. package/src/__tests__/human-output.test.js +0 -158
  170. package/src/__tests__/human-output.test.js.map +0 -1
  171. package/src/__tests__/index-api-compat.test.d.ts.map +0 -1
  172. package/src/__tests__/index-api-compat.test.js +0 -16
  173. package/src/__tests__/index-api-compat.test.js.map +0 -1
  174. package/src/__tests__/init-e2e.test.d.ts.map +0 -1
  175. package/src/__tests__/init-e2e.test.js +0 -221
  176. package/src/__tests__/init-e2e.test.js.map +0 -1
  177. package/src/__tests__/injection-chain.test.d.ts.map +0 -1
  178. package/src/__tests__/injection-chain.test.js +0 -234
  179. package/src/__tests__/injection-chain.test.js.map +0 -1
  180. package/src/__tests__/injection-mvi-tiers.test.d.ts.map +0 -1
  181. package/src/__tests__/injection-mvi-tiers.test.js +0 -152
  182. package/src/__tests__/injection-mvi-tiers.test.js.map +0 -1
  183. package/src/__tests__/injection-shared.test.d.ts.map +0 -1
  184. package/src/__tests__/injection-shared.test.js +0 -194
  185. package/src/__tests__/injection-shared.test.js.map +0 -1
  186. package/src/__tests__/lafs-conformance.test.d.ts.map +0 -1
  187. package/src/__tests__/lafs-conformance.test.js +0 -786
  188. package/src/__tests__/lafs-conformance.test.js.map +0 -1
  189. package/src/__tests__/logger.test.d.ts.map +0 -1
  190. package/src/__tests__/logger.test.js +0 -75
  191. package/src/__tests__/logger.test.js.map +0 -1
  192. package/src/__tests__/paths.test.d.ts.map +0 -1
  193. package/src/__tests__/paths.test.js +0 -327
  194. package/src/__tests__/paths.test.js.map +0 -1
  195. package/src/__tests__/project-info.test.d.ts.map +0 -1
  196. package/src/__tests__/project-info.test.js +0 -156
  197. package/src/__tests__/project-info.test.js.map +0 -1
  198. package/src/__tests__/rcsd-pipeline-e2e.test.d.ts.map +0 -1
  199. package/src/__tests__/rcsd-pipeline-e2e.test.js +0 -263
  200. package/src/__tests__/rcsd-pipeline-e2e.test.js.map +0 -1
  201. package/src/__tests__/remote.test.d.ts.map +0 -1
  202. package/src/__tests__/remote.test.js +0 -149
  203. package/src/__tests__/remote.test.js.map +0 -1
  204. package/src/__tests__/scaffold.test.d.ts.map +0 -1
  205. package/src/__tests__/scaffold.test.js +0 -474
  206. package/src/__tests__/scaffold.test.js.map +0 -1
  207. package/src/__tests__/schema-management.test.d.ts.map +0 -1
  208. package/src/__tests__/schema-management.test.js +0 -287
  209. package/src/__tests__/schema-management.test.js.map +0 -1
  210. package/src/__tests__/schema.test.d.ts.map +0 -1
  211. package/src/__tests__/schema.test.js +0 -51
  212. package/src/__tests__/schema.test.js.map +0 -1
  213. package/src/__tests__/sharing.test.d.ts.map +0 -1
  214. package/src/__tests__/sharing.test.js +0 -160
  215. package/src/__tests__/sharing.test.js.map +0 -1
  216. package/src/__tests__/snapshot.test.d.ts.map +0 -1
  217. package/src/__tests__/snapshot.test.js +0 -72
  218. package/src/__tests__/snapshot.test.js.map +0 -1
  219. package/src/__tests__/upgrade.test.d.ts.map +0 -1
  220. package/src/__tests__/upgrade.test.js +0 -321
  221. package/src/__tests__/upgrade.test.js.map +0 -1
  222. package/src/adapters/__tests__/discovery.test.d.ts.map +0 -1
  223. package/src/adapters/__tests__/discovery.test.js +0 -56
  224. package/src/adapters/__tests__/discovery.test.js.map +0 -1
  225. package/src/adapters/__tests__/manager.test.d.ts.map +0 -1
  226. package/src/adapters/__tests__/manager.test.js +0 -260
  227. package/src/adapters/__tests__/manager.test.js.map +0 -1
  228. package/src/agents/__tests__/agent-registry.test.d.ts.map +0 -1
  229. package/src/agents/__tests__/agent-registry.test.js +0 -262
  230. package/src/agents/__tests__/agent-registry.test.js.map +0 -1
  231. package/src/agents/__tests__/capacity.test.d.ts.map +0 -1
  232. package/src/agents/__tests__/capacity.test.js +0 -173
  233. package/src/agents/__tests__/capacity.test.js.map +0 -1
  234. package/src/agents/__tests__/execution-learning.test.d.ts.map +0 -1
  235. package/src/agents/__tests__/execution-learning.test.js +0 -533
  236. package/src/agents/__tests__/execution-learning.test.js.map +0 -1
  237. package/src/agents/__tests__/health-monitor.test.d.ts.map +0 -1
  238. package/src/agents/__tests__/health-monitor.test.js +0 -259
  239. package/src/agents/__tests__/health-monitor.test.js.map +0 -1
  240. package/src/agents/__tests__/registry.test.d.ts.map +0 -1
  241. package/src/agents/__tests__/registry.test.js +0 -373
  242. package/src/agents/__tests__/registry.test.js.map +0 -1
  243. package/src/agents/__tests__/retry.test.d.ts.map +0 -1
  244. package/src/agents/__tests__/retry.test.js +0 -225
  245. package/src/agents/__tests__/retry.test.js.map +0 -1
  246. package/src/cant/__tests__/cant-agent-parse.test.d.ts.map +0 -1
  247. package/src/cant/__tests__/cant-agent-parse.test.js +0 -77
  248. package/src/cant/__tests__/cant-agent-parse.test.js.map +0 -1
  249. package/src/cant/__tests__/cant-agent-parse.test.ts +0 -94
  250. package/src/cant/approval.ts +0 -218
  251. package/src/cant/context-builder.ts +0 -135
  252. package/src/cant/discretion.ts +0 -149
  253. package/src/cant/index.ts +0 -58
  254. package/src/cant/parallel-runner.ts +0 -205
  255. package/src/cant/types.ts +0 -158
  256. package/src/cant/workflow-executor.ts +0 -618
  257. package/src/compliance/__tests__/sync.test.d.ts.map +0 -1
  258. package/src/compliance/__tests__/sync.test.js +0 -119
  259. package/src/compliance/__tests__/sync.test.js.map +0 -1
  260. package/src/conduit/__tests__/dual-api-e2e.test.d.ts.map +0 -1
  261. package/src/conduit/__tests__/dual-api-e2e.test.js +0 -178
  262. package/src/conduit/__tests__/dual-api-e2e.test.js.map +0 -1
  263. package/src/conduit/__tests__/dual-api-e2e.test.ts +0 -212
  264. package/src/conduit/__tests__/local-credential-flow.test.d.ts.map +0 -1
  265. package/src/conduit/__tests__/local-credential-flow.test.js +0 -185
  266. package/src/conduit/__tests__/local-credential-flow.test.js.map +0 -1
  267. package/src/conduit/__tests__/local-transport.test.d.ts.map +0 -1
  268. package/src/conduit/__tests__/local-transport.test.js +0 -404
  269. package/src/conduit/__tests__/local-transport.test.js.map +0 -1
  270. package/src/conduit/__tests__/sse-transport.test.d.ts.map +0 -1
  271. package/src/conduit/__tests__/sse-transport.test.js +0 -291
  272. package/src/conduit/__tests__/sse-transport.test.js.map +0 -1
  273. package/src/hooks/__tests__/provider-hooks.test.d.ts.map +0 -1
  274. package/src/hooks/__tests__/provider-hooks.test.js +0 -33
  275. package/src/hooks/__tests__/provider-hooks.test.js.map +0 -1
  276. package/src/hooks/__tests__/registry.test.d.ts.map +0 -1
  277. package/src/hooks/__tests__/registry.test.js +0 -37
  278. package/src/hooks/__tests__/registry.test.js.map +0 -1
  279. package/src/hooks/handlers/__tests__/error-hooks.test.d.ts.map +0 -1
  280. package/src/hooks/handlers/__tests__/error-hooks.test.js +0 -90
  281. package/src/hooks/handlers/__tests__/error-hooks.test.js.map +0 -1
  282. package/src/hooks/handlers/__tests__/file-hooks.test.d.ts.map +0 -1
  283. package/src/hooks/handlers/__tests__/file-hooks.test.js +0 -128
  284. package/src/hooks/handlers/__tests__/file-hooks.test.js.map +0 -1
  285. package/src/hooks/handlers/__tests__/hook-automation-e2e.test.d.ts.map +0 -1
  286. package/src/hooks/handlers/__tests__/hook-automation-e2e.test.js +0 -501
  287. package/src/hooks/handlers/__tests__/hook-automation-e2e.test.js.map +0 -1
  288. package/src/hooks/handlers/__tests__/session-hooks.test.d.ts.map +0 -1
  289. package/src/hooks/handlers/__tests__/session-hooks.test.js +0 -54
  290. package/src/hooks/handlers/__tests__/session-hooks.test.js.map +0 -1
  291. package/src/hooks/handlers/__tests__/task-hooks.test.d.ts.map +0 -1
  292. package/src/hooks/handlers/__tests__/task-hooks.test.js +0 -77
  293. package/src/hooks/handlers/__tests__/task-hooks.test.js.map +0 -1
  294. package/src/intelligence/__tests__/adaptive-validation.test.d.ts.map +0 -1
  295. package/src/intelligence/__tests__/adaptive-validation.test.js +0 -517
  296. package/src/intelligence/__tests__/adaptive-validation.test.js.map +0 -1
  297. package/src/intelligence/__tests__/impact.test.d.ts.map +0 -1
  298. package/src/intelligence/__tests__/impact.test.js +0 -515
  299. package/src/intelligence/__tests__/impact.test.js.map +0 -1
  300. package/src/intelligence/__tests__/patterns.test.d.ts.map +0 -1
  301. package/src/intelligence/__tests__/patterns.test.js +0 -370
  302. package/src/intelligence/__tests__/patterns.test.js.map +0 -1
  303. package/src/intelligence/__tests__/prediction.test.d.ts.map +0 -1
  304. package/src/intelligence/__tests__/prediction.test.js +0 -314
  305. package/src/intelligence/__tests__/prediction.test.js.map +0 -1
  306. package/src/lib/__tests__/retry.test.d.ts.map +0 -1
  307. package/src/lib/__tests__/retry.test.js +0 -225
  308. package/src/lib/__tests__/retry.test.js.map +0 -1
  309. package/src/lifecycle/__tests__/chain-store.test.d.ts.map +0 -1
  310. package/src/lifecycle/__tests__/chain-store.test.js +0 -243
  311. package/src/lifecycle/__tests__/chain-store.test.js.map +0 -1
  312. package/src/lifecycle/__tests__/consolidate-rcasd.test.d.ts.map +0 -1
  313. package/src/lifecycle/__tests__/consolidate-rcasd.test.js +0 -210
  314. package/src/lifecycle/__tests__/consolidate-rcasd.test.js.map +0 -1
  315. package/src/lifecycle/__tests__/default-chain.test.d.ts.map +0 -1
  316. package/src/lifecycle/__tests__/default-chain.test.js +0 -74
  317. package/src/lifecycle/__tests__/default-chain.test.js.map +0 -1
  318. package/src/lifecycle/__tests__/frontmatter.test.d.ts.map +0 -1
  319. package/src/lifecycle/__tests__/frontmatter.test.js +0 -229
  320. package/src/lifecycle/__tests__/frontmatter.test.js.map +0 -1
  321. package/src/lifecycle/__tests__/lifecycle.test.d.ts.map +0 -1
  322. package/src/lifecycle/__tests__/lifecycle.test.js +0 -126
  323. package/src/lifecycle/__tests__/lifecycle.test.js.map +0 -1
  324. package/src/lifecycle/__tests__/pipeline.integration.test.d.ts.map +0 -1
  325. package/src/lifecycle/__tests__/pipeline.integration.test.js +0 -977
  326. package/src/lifecycle/__tests__/pipeline.integration.test.js.map +0 -1
  327. package/src/lifecycle/__tests__/rcasd-paths.test.d.ts.map +0 -1
  328. package/src/lifecycle/__tests__/rcasd-paths.test.js +0 -206
  329. package/src/lifecycle/__tests__/rcasd-paths.test.js.map +0 -1
  330. package/src/lifecycle/__tests__/resume-schema-contract.test.d.ts.map +0 -1
  331. package/src/lifecycle/__tests__/resume-schema-contract.test.js +0 -246
  332. package/src/lifecycle/__tests__/resume-schema-contract.test.js.map +0 -1
  333. package/src/lifecycle/__tests__/stage-record-provenance.integration.test.d.ts.map +0 -1
  334. package/src/lifecycle/__tests__/stage-record-provenance.integration.test.js +0 -95
  335. package/src/lifecycle/__tests__/stage-record-provenance.integration.test.js.map +0 -1
  336. package/src/lifecycle/__tests__/tessera-engine.test.d.ts.map +0 -1
  337. package/src/lifecycle/__tests__/tessera-engine.test.js +0 -392
  338. package/src/lifecycle/__tests__/tessera-engine.test.js.map +0 -1
  339. package/src/memory/__tests__/auto-extract.test.d.ts.map +0 -1
  340. package/src/memory/__tests__/auto-extract.test.js +0 -197
  341. package/src/memory/__tests__/auto-extract.test.js.map +0 -1
  342. package/src/memory/__tests__/brain-automation.test.d.ts.map +0 -1
  343. package/src/memory/__tests__/brain-automation.test.js +0 -730
  344. package/src/memory/__tests__/brain-automation.test.js.map +0 -1
  345. package/src/memory/__tests__/brain-embedding.test.d.ts.map +0 -1
  346. package/src/memory/__tests__/brain-embedding.test.js +0 -92
  347. package/src/memory/__tests__/brain-embedding.test.js.map +0 -1
  348. package/src/memory/__tests__/brain-links.test.d.ts.map +0 -1
  349. package/src/memory/__tests__/brain-links.test.js +0 -221
  350. package/src/memory/__tests__/brain-links.test.js.map +0 -1
  351. package/src/memory/__tests__/brain-migration.test.d.ts.map +0 -1
  352. package/src/memory/__tests__/brain-migration.test.js +0 -180
  353. package/src/memory/__tests__/brain-migration.test.js.map +0 -1
  354. package/src/memory/__tests__/brain-retrieval.test.d.ts.map +0 -1
  355. package/src/memory/__tests__/brain-retrieval.test.js +0 -701
  356. package/src/memory/__tests__/brain-retrieval.test.js.map +0 -1
  357. package/src/memory/__tests__/brain-search.test.d.ts.map +0 -1
  358. package/src/memory/__tests__/brain-search.test.js +0 -180
  359. package/src/memory/__tests__/brain-search.test.js.map +0 -1
  360. package/src/memory/__tests__/claude-mem-migration.test.d.ts.map +0 -1
  361. package/src/memory/__tests__/claude-mem-migration.test.js +0 -424
  362. package/src/memory/__tests__/claude-mem-migration.test.js.map +0 -1
  363. package/src/memory/__tests__/decisions.test.d.ts.map +0 -1
  364. package/src/memory/__tests__/decisions.test.js +0 -253
  365. package/src/memory/__tests__/decisions.test.js.map +0 -1
  366. package/src/memory/__tests__/engine-compat.test.d.ts.map +0 -1
  367. package/src/memory/__tests__/engine-compat.test.js +0 -331
  368. package/src/memory/__tests__/engine-compat.test.js.map +0 -1
  369. package/src/memory/__tests__/memory-bridge.test.d.ts.map +0 -1
  370. package/src/memory/__tests__/memory-bridge.test.js +0 -231
  371. package/src/memory/__tests__/memory-bridge.test.js.map +0 -1
  372. package/src/memory/__tests__/pipeline-manifest-sqlite.test.d.ts.map +0 -1
  373. package/src/memory/__tests__/pipeline-manifest-sqlite.test.js +0 -516
  374. package/src/memory/__tests__/pipeline-manifest-sqlite.test.js.map +0 -1
  375. package/src/memory/__tests__/session-memory.test.d.ts.map +0 -1
  376. package/src/memory/__tests__/session-memory.test.js +0 -387
  377. package/src/memory/__tests__/session-memory.test.js.map +0 -1
  378. package/src/metrics/__tests__/model-provider-registry.test.d.ts.map +0 -1
  379. package/src/metrics/__tests__/model-provider-registry.test.js +0 -45
  380. package/src/metrics/__tests__/model-provider-registry.test.js.map +0 -1
  381. package/src/metrics/__tests__/provider-detection.test.d.ts.map +0 -1
  382. package/src/metrics/__tests__/provider-detection.test.js +0 -111
  383. package/src/metrics/__tests__/provider-detection.test.js.map +0 -1
  384. package/src/migration/__tests__/checksum.test.d.ts.map +0 -1
  385. package/src/migration/__tests__/checksum.test.js +0 -216
  386. package/src/migration/__tests__/checksum.test.js.map +0 -1
  387. package/src/migration/__tests__/logger.test.d.ts.map +0 -1
  388. package/src/migration/__tests__/logger.test.js +0 -256
  389. package/src/migration/__tests__/logger.test.js.map +0 -1
  390. package/src/migration/__tests__/migration-failure.integration.test.d.ts.map +0 -1
  391. package/src/migration/__tests__/migration-failure.integration.test.js +0 -515
  392. package/src/migration/__tests__/migration-failure.integration.test.js.map +0 -1
  393. package/src/migration/__tests__/migration.test.d.ts.map +0 -1
  394. package/src/migration/__tests__/migration.test.js +0 -82
  395. package/src/migration/__tests__/migration.test.js.map +0 -1
  396. package/src/migration/__tests__/state.test.d.ts.map +0 -1
  397. package/src/migration/__tests__/state.test.js +0 -330
  398. package/src/migration/__tests__/state.test.js.map +0 -1
  399. package/src/migration/__tests__/validate.test.d.ts.map +0 -1
  400. package/src/migration/__tests__/validate.test.js +0 -258
  401. package/src/migration/__tests__/validate.test.js.map +0 -1
  402. package/src/nexus/__tests__/deps.test.d.ts.map +0 -1
  403. package/src/nexus/__tests__/deps.test.js +0 -283
  404. package/src/nexus/__tests__/deps.test.js.map +0 -1
  405. package/src/nexus/__tests__/nexus-e2e.test.d.ts.map +0 -1
  406. package/src/nexus/__tests__/nexus-e2e.test.js +0 -1220
  407. package/src/nexus/__tests__/nexus-e2e.test.js.map +0 -1
  408. package/src/nexus/__tests__/permissions.test.d.ts.map +0 -1
  409. package/src/nexus/__tests__/permissions.test.js +0 -119
  410. package/src/nexus/__tests__/permissions.test.js.map +0 -1
  411. package/src/nexus/__tests__/query.test.d.ts.map +0 -1
  412. package/src/nexus/__tests__/query.test.js +0 -168
  413. package/src/nexus/__tests__/query.test.js.map +0 -1
  414. package/src/nexus/__tests__/reconcile.test.d.ts.map +0 -1
  415. package/src/nexus/__tests__/reconcile.test.js +0 -135
  416. package/src/nexus/__tests__/reconcile.test.js.map +0 -1
  417. package/src/nexus/__tests__/registry.test.d.ts.map +0 -1
  418. package/src/nexus/__tests__/registry.test.js +0 -229
  419. package/src/nexus/__tests__/registry.test.js.map +0 -1
  420. package/src/nexus/__tests__/transfer.test.d.ts.map +0 -1
  421. package/src/nexus/__tests__/transfer.test.js +0 -372
  422. package/src/nexus/__tests__/transfer.test.js.map +0 -1
  423. package/src/observability/__tests__/index.test.d.ts.map +0 -1
  424. package/src/observability/__tests__/index.test.js +0 -288
  425. package/src/observability/__tests__/index.test.js.map +0 -1
  426. package/src/observability/__tests__/log-filter.test.d.ts.map +0 -1
  427. package/src/observability/__tests__/log-filter.test.js +0 -151
  428. package/src/observability/__tests__/log-filter.test.js.map +0 -1
  429. package/src/observability/__tests__/log-parser.test.d.ts.map +0 -1
  430. package/src/observability/__tests__/log-parser.test.js +0 -170
  431. package/src/observability/__tests__/log-parser.test.js.map +0 -1
  432. package/src/observability/__tests__/log-reader.test.d.ts.map +0 -1
  433. package/src/observability/__tests__/log-reader.test.js +0 -150
  434. package/src/observability/__tests__/log-reader.test.js.map +0 -1
  435. package/src/orchestration/__tests__/autonomous-spec.test.d.ts.map +0 -1
  436. package/src/orchestration/__tests__/autonomous-spec.test.js +0 -419
  437. package/src/orchestration/__tests__/autonomous-spec.test.js.map +0 -1
  438. package/src/orchestration/__tests__/orchestration.test.d.ts.map +0 -1
  439. package/src/orchestration/__tests__/orchestration.test.js +0 -205
  440. package/src/orchestration/__tests__/orchestration.test.js.map +0 -1
  441. package/src/orchestration/__tests__/protocol-validators.test.d.ts.map +0 -1
  442. package/src/orchestration/__tests__/protocol-validators.test.js +0 -382
  443. package/src/orchestration/__tests__/protocol-validators.test.js.map +0 -1
  444. package/src/phases/__tests__/deps.test.d.ts.map +0 -1
  445. package/src/phases/__tests__/deps.test.js +0 -210
  446. package/src/phases/__tests__/deps.test.js.map +0 -1
  447. package/src/phases/__tests__/phases.test.d.ts.map +0 -1
  448. package/src/phases/__tests__/phases.test.js +0 -215
  449. package/src/phases/__tests__/phases.test.js.map +0 -1
  450. package/src/release/__tests__/artifacts.test.d.ts.map +0 -1
  451. package/src/release/__tests__/artifacts.test.js +0 -65
  452. package/src/release/__tests__/artifacts.test.js.map +0 -1
  453. package/src/release/__tests__/cancel-release.test.d.ts.map +0 -1
  454. package/src/release/__tests__/cancel-release.test.js +0 -154
  455. package/src/release/__tests__/cancel-release.test.js.map +0 -1
  456. package/src/release/__tests__/changelog-writer.test.d.ts.map +0 -1
  457. package/src/release/__tests__/changelog-writer.test.js +0 -132
  458. package/src/release/__tests__/changelog-writer.test.js.map +0 -1
  459. package/src/release/__tests__/push-policy.test.d.ts.map +0 -1
  460. package/src/release/__tests__/push-policy.test.js +0 -142
  461. package/src/release/__tests__/push-policy.test.js.map +0 -1
  462. package/src/release/__tests__/release.test.d.ts.map +0 -1
  463. package/src/release/__tests__/release.test.js +0 -25
  464. package/src/release/__tests__/release.test.js.map +0 -1
  465. package/src/sequence/__tests__/allocate.test.d.ts.map +0 -1
  466. package/src/sequence/__tests__/allocate.test.js +0 -113
  467. package/src/sequence/__tests__/allocate.test.js.map +0 -1
  468. package/src/sessions/__tests__/briefing-blocked.test.d.ts.map +0 -1
  469. package/src/sessions/__tests__/briefing-blocked.test.js +0 -117
  470. package/src/sessions/__tests__/briefing-blocked.test.js.map +0 -1
  471. package/src/sessions/__tests__/briefing.test.d.ts.map +0 -1
  472. package/src/sessions/__tests__/briefing.test.js +0 -336
  473. package/src/sessions/__tests__/briefing.test.js.map +0 -1
  474. package/src/sessions/__tests__/handoff-integration.test.d.ts.map +0 -1
  475. package/src/sessions/__tests__/handoff-integration.test.js +0 -264
  476. package/src/sessions/__tests__/handoff-integration.test.js.map +0 -1
  477. package/src/sessions/__tests__/handoff.test.d.ts.map +0 -1
  478. package/src/sessions/__tests__/handoff.test.js +0 -435
  479. package/src/sessions/__tests__/handoff.test.js.map +0 -1
  480. package/src/sessions/__tests__/index.test.d.ts.map +0 -1
  481. package/src/sessions/__tests__/index.test.js +0 -82
  482. package/src/sessions/__tests__/index.test.js.map +0 -1
  483. package/src/sessions/__tests__/session-cleanup.test.d.ts.map +0 -1
  484. package/src/sessions/__tests__/session-cleanup.test.js +0 -201
  485. package/src/sessions/__tests__/session-cleanup.test.js.map +0 -1
  486. package/src/sessions/__tests__/session-edge-cases.test.d.ts.map +0 -1
  487. package/src/sessions/__tests__/session-edge-cases.test.js +0 -251
  488. package/src/sessions/__tests__/session-edge-cases.test.js.map +0 -1
  489. package/src/sessions/__tests__/session-find.test.d.ts.map +0 -1
  490. package/src/sessions/__tests__/session-find.test.js +0 -210
  491. package/src/sessions/__tests__/session-find.test.js.map +0 -1
  492. package/src/sessions/__tests__/session-grade.integration.test.d.ts.map +0 -1
  493. package/src/sessions/__tests__/session-grade.integration.test.js +0 -287
  494. package/src/sessions/__tests__/session-grade.integration.test.js.map +0 -1
  495. package/src/sessions/__tests__/session-grade.test.d.ts.map +0 -1
  496. package/src/sessions/__tests__/session-grade.test.js +0 -630
  497. package/src/sessions/__tests__/session-grade.test.js.map +0 -1
  498. package/src/sessions/__tests__/session-memory-bridge.test.d.ts.map +0 -1
  499. package/src/sessions/__tests__/session-memory-bridge.test.js +0 -52
  500. package/src/sessions/__tests__/session-memory-bridge.test.js.map +0 -1
  501. package/src/sessions/__tests__/sessions.test.d.ts.map +0 -1
  502. package/src/sessions/__tests__/sessions.test.js +0 -113
  503. package/src/sessions/__tests__/sessions.test.js.map +0 -1
  504. package/src/skills/__tests__/discovery.test.d.ts.map +0 -1
  505. package/src/skills/__tests__/discovery.test.js +0 -171
  506. package/src/skills/__tests__/discovery.test.js.map +0 -1
  507. package/src/skills/__tests__/dispatch.test.d.ts.map +0 -1
  508. package/src/skills/__tests__/dispatch.test.js +0 -99
  509. package/src/skills/__tests__/dispatch.test.js.map +0 -1
  510. package/src/skills/__tests__/dynamic-skill-generator.test.d.ts.map +0 -1
  511. package/src/skills/__tests__/dynamic-skill-generator.test.js +0 -77
  512. package/src/skills/__tests__/dynamic-skill-generator.test.js.map +0 -1
  513. package/src/skills/__tests__/manifests.test.d.ts.map +0 -1
  514. package/src/skills/__tests__/manifests.test.js +0 -121
  515. package/src/skills/__tests__/manifests.test.js.map +0 -1
  516. package/src/skills/__tests__/precedence.test.d.ts.map +0 -1
  517. package/src/skills/__tests__/precedence.test.js +0 -325
  518. package/src/skills/__tests__/precedence.test.js.map +0 -1
  519. package/src/skills/__tests__/routing-table.test.d.ts.map +0 -1
  520. package/src/skills/__tests__/routing-table.test.js +0 -91
  521. package/src/skills/__tests__/routing-table.test.js.map +0 -1
  522. package/src/skills/__tests__/skill-paths.test.d.ts.map +0 -1
  523. package/src/skills/__tests__/skill-paths.test.js +0 -71
  524. package/src/skills/__tests__/skill-paths.test.js.map +0 -1
  525. package/src/skills/__tests__/test-utility.test.d.ts.map +0 -1
  526. package/src/skills/__tests__/test-utility.test.js +0 -59
  527. package/src/skills/__tests__/test-utility.test.js.map +0 -1
  528. package/src/skills/__tests__/token.test.d.ts.map +0 -1
  529. package/src/skills/__tests__/token.test.js +0 -135
  530. package/src/skills/__tests__/token.test.js.map +0 -1
  531. package/src/skills/__tests__/validation.test.d.ts.map +0 -1
  532. package/src/skills/__tests__/validation.test.js +0 -108
  533. package/src/skills/__tests__/validation.test.js.map +0 -1
  534. package/src/skills/__tests__/version.test.d.ts.map +0 -1
  535. package/src/skills/__tests__/version.test.js +0 -71
  536. package/src/skills/__tests__/version.test.js.map +0 -1
  537. package/src/skills/injection/__tests__/subagent.test.d.ts.map +0 -1
  538. package/src/skills/injection/__tests__/subagent.test.js +0 -122
  539. package/src/skills/injection/__tests__/subagent.test.js.map +0 -1
  540. package/src/skills/orchestrator/__tests__/spawn-tier.test.d.ts.map +0 -1
  541. package/src/skills/orchestrator/__tests__/spawn-tier.test.js +0 -228
  542. package/src/skills/orchestrator/__tests__/spawn-tier.test.js.map +0 -1
  543. package/src/spawn/__tests__/adapter-registry.test.d.ts.map +0 -1
  544. package/src/spawn/__tests__/adapter-registry.test.js +0 -76
  545. package/src/spawn/__tests__/adapter-registry.test.js.map +0 -1
  546. package/src/stats/__tests__/stats.test.d.ts.map +0 -1
  547. package/src/stats/__tests__/stats.test.js +0 -374
  548. package/src/stats/__tests__/stats.test.js.map +0 -1
  549. package/src/sticky/__tests__/purge.test.d.ts.map +0 -1
  550. package/src/sticky/__tests__/purge.test.js +0 -64
  551. package/src/sticky/__tests__/purge.test.js.map +0 -1
  552. package/src/store/__tests__/atomic.test.d.ts.map +0 -1
  553. package/src/store/__tests__/atomic.test.js +0 -81
  554. package/src/store/__tests__/atomic.test.js.map +0 -1
  555. package/src/store/__tests__/backup.test.d.ts.map +0 -1
  556. package/src/store/__tests__/backup.test.js +0 -131
  557. package/src/store/__tests__/backup.test.js.map +0 -1
  558. package/src/store/__tests__/brain-accessor-pageindex.test.d.ts.map +0 -1
  559. package/src/store/__tests__/brain-accessor-pageindex.test.js +0 -179
  560. package/src/store/__tests__/brain-accessor-pageindex.test.js.map +0 -1
  561. package/src/store/__tests__/brain-accessor.test.d.ts.map +0 -1
  562. package/src/store/__tests__/brain-accessor.test.js +0 -398
  563. package/src/store/__tests__/brain-accessor.test.js.map +0 -1
  564. package/src/store/__tests__/brain-pageindex.test.d.ts.map +0 -1
  565. package/src/store/__tests__/brain-pageindex.test.js +0 -137
  566. package/src/store/__tests__/brain-pageindex.test.js.map +0 -1
  567. package/src/store/__tests__/brain-schema.test.d.ts.map +0 -1
  568. package/src/store/__tests__/brain-schema.test.js +0 -137
  569. package/src/store/__tests__/brain-schema.test.js.map +0 -1
  570. package/src/store/__tests__/brain-vec.test.d.ts.map +0 -1
  571. package/src/store/__tests__/brain-vec.test.js +0 -100
  572. package/src/store/__tests__/brain-vec.test.js.map +0 -1
  573. package/src/store/__tests__/collision-detection.test.d.ts.map +0 -1
  574. package/src/store/__tests__/collision-detection.test.js +0 -165
  575. package/src/store/__tests__/collision-detection.test.js.map +0 -1
  576. package/src/store/__tests__/data-safety-central.test.d.ts.map +0 -1
  577. package/src/store/__tests__/data-safety-central.test.js +0 -408
  578. package/src/store/__tests__/data-safety-central.test.js.map +0 -1
  579. package/src/store/__tests__/db-helpers.test.d.ts.map +0 -1
  580. package/src/store/__tests__/db-helpers.test.js +0 -101
  581. package/src/store/__tests__/db-helpers.test.js.map +0 -1
  582. package/src/store/__tests__/e2e-safety-integration.test.d.ts.map +0 -1
  583. package/src/store/__tests__/e2e-safety-integration.test.js +0 -402
  584. package/src/store/__tests__/e2e-safety-integration.test.js.map +0 -1
  585. package/src/store/__tests__/git-checkpoint.test.d.ts.map +0 -1
  586. package/src/store/__tests__/git-checkpoint.test.js +0 -133
  587. package/src/store/__tests__/git-checkpoint.test.js.map +0 -1
  588. package/src/store/__tests__/idempotent-migration.test.d.ts.map +0 -1
  589. package/src/store/__tests__/idempotent-migration.test.js +0 -172
  590. package/src/store/__tests__/idempotent-migration.test.js.map +0 -1
  591. package/src/store/__tests__/import-logging.test.d.ts.map +0 -1
  592. package/src/store/__tests__/import-logging.test.js +0 -92
  593. package/src/store/__tests__/import-logging.test.js.map +0 -1
  594. package/src/store/__tests__/import-sort.test.d.ts.map +0 -1
  595. package/src/store/__tests__/import-sort.test.js +0 -109
  596. package/src/store/__tests__/import-sort.test.js.map +0 -1
  597. package/src/store/__tests__/json.test.d.ts.map +0 -1
  598. package/src/store/__tests__/json.test.js +0 -98
  599. package/src/store/__tests__/json.test.js.map +0 -1
  600. package/src/store/__tests__/lifecycle-schema-parity.test.d.ts.map +0 -1
  601. package/src/store/__tests__/lifecycle-schema-parity.test.js +0 -90
  602. package/src/store/__tests__/lifecycle-schema-parity.test.js.map +0 -1
  603. package/src/store/__tests__/migration-integration.test.d.ts.map +0 -1
  604. package/src/store/__tests__/migration-integration.test.js +0 -238
  605. package/src/store/__tests__/migration-integration.test.js.map +0 -1
  606. package/src/store/__tests__/migration-retry.test.d.ts.map +0 -1
  607. package/src/store/__tests__/migration-retry.test.js +0 -178
  608. package/src/store/__tests__/migration-retry.test.js.map +0 -1
  609. package/src/store/__tests__/migration-safety.test.d.ts.map +0 -1
  610. package/src/store/__tests__/migration-safety.test.js +0 -756
  611. package/src/store/__tests__/migration-safety.test.js.map +0 -1
  612. package/src/store/__tests__/migration-sqlite.test.d.ts.map +0 -1
  613. package/src/store/__tests__/migration-sqlite.test.js +0 -544
  614. package/src/store/__tests__/migration-sqlite.test.js.map +0 -1
  615. package/src/store/__tests__/performance-safety.test.d.ts.map +0 -1
  616. package/src/store/__tests__/performance-safety.test.js +0 -157
  617. package/src/store/__tests__/performance-safety.test.js.map +0 -1
  618. package/src/store/__tests__/project-detect.test.d.ts.map +0 -1
  619. package/src/store/__tests__/project-detect.test.js +0 -609
  620. package/src/store/__tests__/project-detect.test.js.map +0 -1
  621. package/src/store/__tests__/project-registry.test.d.ts.map +0 -1
  622. package/src/store/__tests__/project-registry.test.js +0 -28
  623. package/src/store/__tests__/project-registry.test.js.map +0 -1
  624. package/src/store/__tests__/provider.test.d.ts.map +0 -1
  625. package/src/store/__tests__/provider.test.js +0 -15
  626. package/src/store/__tests__/provider.test.js.map +0 -1
  627. package/src/store/__tests__/relations.test.d.ts.map +0 -1
  628. package/src/store/__tests__/relations.test.js +0 -318
  629. package/src/store/__tests__/relations.test.js.map +0 -1
  630. package/src/store/__tests__/safety-accessor.test.d.ts.map +0 -1
  631. package/src/store/__tests__/safety-accessor.test.js +0 -219
  632. package/src/store/__tests__/safety-accessor.test.js.map +0 -1
  633. package/src/store/__tests__/sequence-validation.test.d.ts.map +0 -1
  634. package/src/store/__tests__/sequence-validation.test.js +0 -94
  635. package/src/store/__tests__/sequence-validation.test.js.map +0 -1
  636. package/src/store/__tests__/session-store.test.d.ts.map +0 -1
  637. package/src/store/__tests__/session-store.test.js +0 -463
  638. package/src/store/__tests__/session-store.test.js.map +0 -1
  639. package/src/store/__tests__/sqlite-backup.test.d.ts.map +0 -1
  640. package/src/store/__tests__/sqlite-backup.test.js +0 -72
  641. package/src/store/__tests__/sqlite-backup.test.js.map +0 -1
  642. package/src/store/__tests__/sqlite.test.d.ts.map +0 -1
  643. package/src/store/__tests__/sqlite.test.js +0 -256
  644. package/src/store/__tests__/sqlite.test.js.map +0 -1
  645. package/src/store/__tests__/task-store.test.d.ts.map +0 -1
  646. package/src/store/__tests__/task-store.test.js +0 -514
  647. package/src/store/__tests__/task-store.test.js.map +0 -1
  648. package/src/store/__tests__/test-db-helper.d.ts.map +0 -1
  649. package/src/store/__tests__/test-db-helper.js +0 -110
  650. package/src/store/__tests__/test-db-helper.js.map +0 -1
  651. package/src/store/__tests__/write-verification.test.d.ts.map +0 -1
  652. package/src/store/__tests__/write-verification.test.js +0 -185
  653. package/src/store/__tests__/write-verification.test.js.map +0 -1
  654. package/src/system/__tests__/cleanup.test.d.ts.map +0 -1
  655. package/src/system/__tests__/cleanup.test.js +0 -87
  656. package/src/system/__tests__/cleanup.test.js.map +0 -1
  657. package/src/system/__tests__/health.test.d.ts.map +0 -1
  658. package/src/system/__tests__/health.test.js +0 -55
  659. package/src/system/__tests__/health.test.js.map +0 -1
  660. package/src/task-work/__tests__/start-deps.test.d.ts.map +0 -1
  661. package/src/task-work/__tests__/start-deps.test.js +0 -152
  662. package/src/task-work/__tests__/start-deps.test.js.map +0 -1
  663. package/src/tasks/__tests__/add.test.d.ts.map +0 -1
  664. package/src/tasks/__tests__/add.test.js +0 -226
  665. package/src/tasks/__tests__/add.test.js.map +0 -1
  666. package/src/tasks/__tests__/archive.test.d.ts.map +0 -1
  667. package/src/tasks/__tests__/archive.test.js +0 -196
  668. package/src/tasks/__tests__/archive.test.js.map +0 -1
  669. package/src/tasks/__tests__/assignee.test.d.ts.map +0 -1
  670. package/src/tasks/__tests__/assignee.test.js +0 -125
  671. package/src/tasks/__tests__/assignee.test.js.map +0 -1
  672. package/src/tasks/__tests__/atomicity.test.d.ts.map +0 -1
  673. package/src/tasks/__tests__/atomicity.test.js +0 -192
  674. package/src/tasks/__tests__/atomicity.test.js.map +0 -1
  675. package/src/tasks/__tests__/cancel-ops.test.d.ts.map +0 -1
  676. package/src/tasks/__tests__/cancel-ops.test.js +0 -115
  677. package/src/tasks/__tests__/cancel-ops.test.js.map +0 -1
  678. package/src/tasks/__tests__/complete-unblocks.test.d.ts.map +0 -1
  679. package/src/tasks/__tests__/complete-unblocks.test.js +0 -151
  680. package/src/tasks/__tests__/complete-unblocks.test.js.map +0 -1
  681. package/src/tasks/__tests__/complete.test.d.ts.map +0 -1
  682. package/src/tasks/__tests__/complete.test.js +0 -230
  683. package/src/tasks/__tests__/complete.test.js.map +0 -1
  684. package/src/tasks/__tests__/delete.test.d.ts.map +0 -1
  685. package/src/tasks/__tests__/delete.test.js +0 -183
  686. package/src/tasks/__tests__/delete.test.js.map +0 -1
  687. package/src/tasks/__tests__/dependency-check.test.d.ts.map +0 -1
  688. package/src/tasks/__tests__/dependency-check.test.js +0 -293
  689. package/src/tasks/__tests__/dependency-check.test.js.map +0 -1
  690. package/src/tasks/__tests__/deps-ready.test.d.ts.map +0 -1
  691. package/src/tasks/__tests__/deps-ready.test.js +0 -68
  692. package/src/tasks/__tests__/deps-ready.test.js.map +0 -1
  693. package/src/tasks/__tests__/epic-enforcement.test.d.ts.map +0 -1
  694. package/src/tasks/__tests__/epic-enforcement.test.js +0 -669
  695. package/src/tasks/__tests__/epic-enforcement.test.js.map +0 -1
  696. package/src/tasks/__tests__/find.test.d.ts.map +0 -1
  697. package/src/tasks/__tests__/find.test.js +0 -163
  698. package/src/tasks/__tests__/find.test.js.map +0 -1
  699. package/src/tasks/__tests__/graph-ops.test.d.ts.map +0 -1
  700. package/src/tasks/__tests__/graph-ops.test.js +0 -174
  701. package/src/tasks/__tests__/graph-ops.test.js.map +0 -1
  702. package/src/tasks/__tests__/hierarchy-policy.test.d.ts.map +0 -1
  703. package/src/tasks/__tests__/hierarchy-policy.test.js +0 -399
  704. package/src/tasks/__tests__/hierarchy-policy.test.js.map +0 -1
  705. package/src/tasks/__tests__/hierarchy.test.d.ts.map +0 -1
  706. package/src/tasks/__tests__/hierarchy.test.js +0 -302
  707. package/src/tasks/__tests__/hierarchy.test.js.map +0 -1
  708. package/src/tasks/__tests__/id-generator.test.d.ts.map +0 -1
  709. package/src/tasks/__tests__/id-generator.test.js +0 -59
  710. package/src/tasks/__tests__/id-generator.test.js.map +0 -1
  711. package/src/tasks/__tests__/labels.test.d.ts.map +0 -1
  712. package/src/tasks/__tests__/labels.test.js +0 -173
  713. package/src/tasks/__tests__/labels.test.js.map +0 -1
  714. package/src/tasks/__tests__/list.test.d.ts.map +0 -1
  715. package/src/tasks/__tests__/list.test.js +0 -272
  716. package/src/tasks/__tests__/list.test.js.map +0 -1
  717. package/src/tasks/__tests__/minimal-test.test.d.ts.map +0 -1
  718. package/src/tasks/__tests__/minimal-test.test.js +0 -25
  719. package/src/tasks/__tests__/minimal-test.test.js.map +0 -1
  720. package/src/tasks/__tests__/phase-tracking.test.d.ts.map +0 -1
  721. package/src/tasks/__tests__/phase-tracking.test.js +0 -209
  722. package/src/tasks/__tests__/phase-tracking.test.js.map +0 -1
  723. package/src/tasks/__tests__/pipeline-stage.test.d.ts.map +0 -1
  724. package/src/tasks/__tests__/pipeline-stage.test.js +0 -277
  725. package/src/tasks/__tests__/pipeline-stage.test.js.map +0 -1
  726. package/src/tasks/__tests__/plan-priority.test.d.ts.map +0 -1
  727. package/src/tasks/__tests__/plan-priority.test.js +0 -133
  728. package/src/tasks/__tests__/plan-priority.test.js.map +0 -1
  729. package/src/tasks/__tests__/priority-normalization.test.d.ts.map +0 -1
  730. package/src/tasks/__tests__/priority-normalization.test.js +0 -117
  731. package/src/tasks/__tests__/priority-normalization.test.js.map +0 -1
  732. package/src/tasks/__tests__/relates.test.d.ts.map +0 -1
  733. package/src/tasks/__tests__/relates.test.js +0 -84
  734. package/src/tasks/__tests__/relates.test.js.map +0 -1
  735. package/src/tasks/__tests__/show-deps.test.d.ts.map +0 -1
  736. package/src/tasks/__tests__/show-deps.test.js +0 -182
  737. package/src/tasks/__tests__/show-deps.test.js.map +0 -1
  738. package/src/tasks/__tests__/show.test.d.ts.map +0 -1
  739. package/src/tasks/__tests__/show.test.js +0 -126
  740. package/src/tasks/__tests__/show.test.js.map +0 -1
  741. package/src/tasks/__tests__/staleness.test.d.ts.map +0 -1
  742. package/src/tasks/__tests__/staleness.test.js +0 -154
  743. package/src/tasks/__tests__/staleness.test.js.map +0 -1
  744. package/src/tasks/__tests__/task-ops-depends.test.d.ts.map +0 -1
  745. package/src/tasks/__tests__/task-ops-depends.test.js +0 -118
  746. package/src/tasks/__tests__/task-ops-depends.test.js.map +0 -1
  747. package/src/tasks/__tests__/update.test.d.ts.map +0 -1
  748. package/src/tasks/__tests__/update.test.js +0 -320
  749. package/src/tasks/__tests__/update.test.js.map +0 -1
  750. package/src/validation/__tests__/chain-validation.test.d.ts.map +0 -1
  751. package/src/validation/__tests__/chain-validation.test.js +0 -204
  752. package/src/validation/__tests__/chain-validation.test.js.map +0 -1
  753. package/src/validation/__tests__/compliance.test.d.ts.map +0 -1
  754. package/src/validation/__tests__/compliance.test.js +0 -83
  755. package/src/validation/__tests__/compliance.test.js.map +0 -1
  756. package/src/validation/__tests__/docs-sync.test.d.ts.map +0 -1
  757. package/src/validation/__tests__/docs-sync.test.js +0 -243
  758. package/src/validation/__tests__/docs-sync.test.js.map +0 -1
  759. package/src/validation/__tests__/doctor-gitignore.test.d.ts.map +0 -1
  760. package/src/validation/__tests__/doctor-gitignore.test.js +0 -154
  761. package/src/validation/__tests__/doctor-gitignore.test.js.map +0 -1
  762. package/src/validation/__tests__/doctor-injection.test.d.ts.map +0 -1
  763. package/src/validation/__tests__/doctor-injection.test.js +0 -230
  764. package/src/validation/__tests__/doctor-injection.test.js.map +0 -1
  765. package/src/validation/__tests__/doctor.test.d.ts.map +0 -1
  766. package/src/validation/__tests__/doctor.test.js +0 -202
  767. package/src/validation/__tests__/doctor.test.js.map +0 -1
  768. package/src/validation/__tests__/engine.test.d.ts.map +0 -1
  769. package/src/validation/__tests__/engine.test.js +0 -346
  770. package/src/validation/__tests__/engine.test.js.map +0 -1
  771. package/src/validation/__tests__/manifest.test.d.ts.map +0 -1
  772. package/src/validation/__tests__/manifest.test.js +0 -244
  773. package/src/validation/__tests__/manifest.test.js.map +0 -1
  774. package/src/validation/__tests__/protocol-common.test.d.ts.map +0 -1
  775. package/src/validation/__tests__/protocol-common.test.js +0 -112
  776. package/src/validation/__tests__/protocol-common.test.js.map +0 -1
  777. package/src/validation/__tests__/verification.test.d.ts.map +0 -1
  778. package/src/validation/__tests__/verification.test.js +0 -277
  779. package/src/validation/__tests__/verification.test.js.map +0 -1
  780. package/src/validation/protocols/release-protocol.ts +0 -80
  781. package/src/validation/protocols/testing-protocol.ts +0 -93
  782. package/src/validation/protocols/validation-protocol.ts +0 -93
@@ -1,977 +0,0 @@
1
- /**
2
- * RCASD-IVTR+C Pipeline Integration Test
3
- *
4
- * End-to-end test exercising the full RCASD-IVTR+C lifecycle through all 9 stages.
5
- * This is the final validation test for epic T4798.
6
- *
7
- * Test Coverage:
8
- * 1. Full pipeline flow through all 9 stages
9
- * 2. Gate enforcement (blocking and allowing transitions)
10
- * 3. Evidence recording across stages
11
- * 4. Cross-session resume capability
12
- * 5. Pipeline completion verification
13
- *
14
- * @task T4806
15
- * @epic T4798
16
- * @audit T4799 - Validates unified pipeline implementation
17
- */
18
- import { mkdir, mkdtemp, rm } from 'node:fs/promises';
19
- import { tmpdir } from 'node:os';
20
- import { join } from 'node:path';
21
- import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
22
- // Legacy lifecycle (for cross-session resume testing)
23
- import { failGate, getLifecycleHistory, getLifecycleStatus, passGate, recordStageProgress, } from '../index.js';
24
- // Pipeline (stub implementations - validates expected behavior)
25
- import { advanceStage, cancelPipeline, completePipeline, getCurrentStage, getPipeline, initializePipeline, } from '../pipeline.js';
26
- // Stage definitions
27
- import { checkTransition as checkTransitionRaw, getPrerequisites as getPrerequisitesRaw, PIPELINE_STAGES, STAGE_DEFINITIONS as STAGE_DEFINITIONS_RAW, STAGE_ORDER as STAGE_ORDER_RAW, } from '../stages.js';
28
- // State machine (fully implemented)
29
- import { checkPrerequisites as checkPrerequisitesRaw, createInitialContext, executeTransition as executeTransitionRaw, getCurrentStageState, getValidNextStages, isBlocked, isTerminalState, setStageStatus as setStageStatusRaw, skipStage as skipStageRaw, validateTransition as validateTransitionRaw, } from '../state-machine.js';
30
- let testDir;
31
- let cleoDir;
32
- async function ensureTaskExists(taskId) {
33
- const { getDb, getNativeDb } = await import('../../store/sqlite.js');
34
- await getDb();
35
- getNativeDb()
36
- .prepare(`INSERT OR IGNORE INTO tasks (id, title, status, priority, created_at) VALUES (?, ?, 'pending', 'medium', datetime('now'))`)
37
- .run(taskId, `Task ${taskId}`);
38
- }
39
- const LEGACY_TO_CANONICAL = {
40
- adr: 'architecture_decision',
41
- spec: 'specification',
42
- decompose: 'decomposition',
43
- implement: 'implementation',
44
- verify: 'validation',
45
- test: 'testing',
46
- };
47
- const CANONICAL_TO_LEGACY = {
48
- architecture_decision: 'adr',
49
- specification: 'spec',
50
- decomposition: 'decompose',
51
- implementation: 'implement',
52
- validation: 'verify',
53
- testing: 'test',
54
- };
55
- function toCanonical(stage) {
56
- return (LEGACY_TO_CANONICAL[stage] ?? stage);
57
- }
58
- function toLegacy(stage) {
59
- return CANONICAL_TO_LEGACY[stage] ?? stage;
60
- }
61
- function addLegacyAliases(context) {
62
- const stages = context.stages;
63
- for (const [legacy, canonical] of Object.entries(LEGACY_TO_CANONICAL)) {
64
- stages[legacy] = stages[canonical];
65
- }
66
- return {
67
- ...context,
68
- stages: stages,
69
- };
70
- }
71
- function executeTransition(transition, context) {
72
- return executeTransitionRaw({
73
- ...transition,
74
- from: toCanonical(transition.from),
75
- to: toCanonical(transition.to),
76
- }, context).then((result) => ({
77
- ...result,
78
- context: addLegacyAliases(result.context),
79
- }));
80
- }
81
- function validateTransition(transition, context) {
82
- return validateTransitionRaw({
83
- ...transition,
84
- from: toCanonical(transition.from),
85
- to: toCanonical(transition.to),
86
- }, context);
87
- }
88
- function checkPrerequisites(stage, stages) {
89
- return checkPrerequisitesRaw(toCanonical(stage), stages);
90
- }
91
- function setStageStatus(stage, status, context) {
92
- const canonical = toCanonical(stage);
93
- const next = setStageStatusRaw(canonical, status, context);
94
- context.stages[canonical] = next;
95
- context.stages[stage] = next;
96
- return next;
97
- }
98
- function skipStage(stage, reason, context) {
99
- return skipStageRaw(toCanonical(stage), reason, context);
100
- }
101
- const STAGE_ORDER = new Proxy(STAGE_ORDER_RAW, {
102
- get(target, prop) {
103
- return target[toCanonical(prop)];
104
- },
105
- });
106
- const STAGE_DEFINITIONS = new Proxy(STAGE_DEFINITIONS_RAW, {
107
- get(target, prop) {
108
- return target[toCanonical(prop)];
109
- },
110
- });
111
- function getPrerequisites(stage) {
112
- return getPrerequisitesRaw(toCanonical(stage));
113
- }
114
- function checkTransition(from, to, force) {
115
- return checkTransitionRaw(toCanonical(from), toCanonical(to), force);
116
- }
117
- describe('RCASD-IVTR+C Pipeline Integration', () => {
118
- beforeEach(async () => {
119
- testDir = await mkdtemp(join(tmpdir(), 'cleo-pipeline-test-'));
120
- cleoDir = join(testDir, '.cleo');
121
- await mkdir(cleoDir, { recursive: true });
122
- await mkdir(join(cleoDir, 'rcasd'), { recursive: true });
123
- await mkdir(join(cleoDir, 'backups', 'operational'), { recursive: true });
124
- process.env['CLEO_DIR'] = cleoDir;
125
- process.env['LIFECYCLE_ENFORCEMENT_MODE'] = 'off';
126
- });
127
- afterEach(async () => {
128
- // Close ALL SQLite connections before cleanup — Windows locks open files
129
- try {
130
- const { closeAllDatabases } = await import('../../store/sqlite.js');
131
- await closeAllDatabases();
132
- }
133
- catch {
134
- /* module may not be loaded */
135
- }
136
- delete process.env['CLEO_DIR'];
137
- delete process.env['LIFECYCLE_ENFORCEMENT_MODE'];
138
- await rm(testDir, { recursive: true, force: true });
139
- vi.restoreAllMocks();
140
- });
141
- // =============================================================================
142
- // FULL PIPELINE FLOW TEST
143
- // =============================================================================
144
- describe('full pipeline flow through all 9 stages', () => {
145
- it('should complete all 9 stages with state machine transitions', async () => {
146
- const pipelineId = 'T4806';
147
- let context = createInitialContext(pipelineId, 'test-agent');
148
- // Stage 1: Research
149
- expect(context.currentStage).toBe('research');
150
- expect(context.stages['research'].status).toBe('in_progress');
151
- // Mark research as completed before transitioning
152
- context.stages['research'] = setStageStatus('research', 'completed', context);
153
- // Complete research and transition to consensus
154
- const researchTransition = {
155
- from: 'research',
156
- to: 'consensus',
157
- initiatedBy: 'test-agent',
158
- };
159
- let result = await executeTransition(researchTransition, context);
160
- expect(result.success).toBe(true);
161
- context = result.context;
162
- expect(context.currentStage).toBe('consensus');
163
- expect(context.stages['research'].status).toBe('completed');
164
- // Stage 2: Consensus - mark as completed and transition to architecture_decision
165
- context.stages['consensus'] = setStageStatus('consensus', 'completed', context);
166
- const consensusTransition = {
167
- from: 'consensus',
168
- to: 'architecture_decision',
169
- initiatedBy: 'test-agent',
170
- };
171
- result = await executeTransition(consensusTransition, context);
172
- expect(result.success).toBe(true);
173
- context = result.context;
174
- expect(context.currentStage).toBe('architecture_decision');
175
- // Stage 3: ADR - mark as completed and transition to specification
176
- context.stages['architecture_decision'] = setStageStatus('architecture_decision', 'completed', context);
177
- const adrTransition = {
178
- from: 'architecture_decision',
179
- to: 'specification',
180
- initiatedBy: 'test-agent',
181
- };
182
- result = await executeTransition(adrTransition, context);
183
- expect(result.success).toBe(true);
184
- context = result.context;
185
- expect(context.currentStage).toBe('specification');
186
- // Stage 4: Spec - mark as completed and transition to decomposition
187
- context.stages['specification'] = setStageStatus('specification', 'completed', context);
188
- const specTransition = {
189
- from: 'specification',
190
- to: 'decomposition',
191
- initiatedBy: 'test-agent',
192
- };
193
- result = await executeTransition(specTransition, context);
194
- expect(result.success).toBe(true);
195
- context = result.context;
196
- expect(context.currentStage).toBe('decomposition');
197
- // Stage 5: Decompose - mark as completed and transition to implementation
198
- context.stages['decomposition'] = setStageStatus('decomposition', 'completed', context);
199
- const decomposeTransition = {
200
- from: 'decomposition',
201
- to: 'implementation',
202
- initiatedBy: 'test-agent',
203
- };
204
- result = await executeTransition(decomposeTransition, context);
205
- expect(result.success).toBe(true);
206
- context = result.context;
207
- expect(context.currentStage).toBe('implementation');
208
- // Stage 6: Implement - mark as completed and transition to validation
209
- context.stages['implementation'] = setStageStatus('implementation', 'completed', context);
210
- const implementTransition = {
211
- from: 'implementation',
212
- to: 'validation',
213
- initiatedBy: 'test-agent',
214
- };
215
- result = await executeTransition(implementTransition, context);
216
- expect(result.success).toBe(true);
217
- context = result.context;
218
- expect(context.currentStage).toBe('validation');
219
- // Stage 7: Verify - mark as completed and transition to testing
220
- context.stages['validation'] = setStageStatus('validation', 'completed', context);
221
- const verifyTransition = {
222
- from: 'validation',
223
- to: 'testing',
224
- initiatedBy: 'test-agent',
225
- };
226
- result = await executeTransition(verifyTransition, context);
227
- expect(result.success).toBe(true);
228
- context = result.context;
229
- expect(context.currentStage).toBe('testing');
230
- // Stage 8: Test - mark as completed and transition to release
231
- context.stages['testing'] = setStageStatus('testing', 'completed', context);
232
- const testTransition = {
233
- from: 'testing',
234
- to: 'release',
235
- initiatedBy: 'test-agent',
236
- };
237
- result = await executeTransition(testTransition, context);
238
- expect(result.success).toBe(true);
239
- context = result.context;
240
- expect(context.currentStage).toBe('release');
241
- // Stage 9: Release - complete it
242
- const releaseState = setStageStatus('release', 'completed', context);
243
- context.stages['release'] = releaseState;
244
- // Verify all stages completed
245
- expect(context.stages['research'].status).toBe('completed');
246
- expect(context.stages['consensus'].status).toBe('completed');
247
- expect(context.stages['architecture_decision'].status).toBe('completed');
248
- expect(context.stages['specification'].status).toBe('completed');
249
- expect(context.stages['decomposition'].status).toBe('completed');
250
- expect(context.stages['implementation'].status).toBe('completed');
251
- expect(context.stages['validation'].status).toBe('completed');
252
- expect(context.stages['testing'].status).toBe('completed');
253
- expect(context.stages['release'].status).toBe('completed');
254
- // Verify terminal state
255
- expect(isTerminalState(context)).toBe(true);
256
- expect(context.transitionCount).toBe(8);
257
- });
258
- it('should track stage order correctly', () => {
259
- expect(STAGE_ORDER['research']).toBe(1);
260
- expect(STAGE_ORDER['consensus']).toBe(2);
261
- expect(STAGE_ORDER['adr']).toBe(3);
262
- expect(STAGE_ORDER['spec']).toBe(4);
263
- expect(STAGE_ORDER['decompose']).toBe(5);
264
- expect(STAGE_ORDER['implement']).toBe(6);
265
- expect(STAGE_ORDER['verify']).toBe(7);
266
- expect(STAGE_ORDER['test']).toBe(8);
267
- expect(STAGE_ORDER['release']).toBe(9);
268
- });
269
- it('should have correct stage definitions for all 9 stages', () => {
270
- expect(STAGE_DEFINITIONS['research'].order).toBe(1);
271
- expect(STAGE_DEFINITIONS['consensus'].order).toBe(2);
272
- expect(STAGE_DEFINITIONS['adr'].order).toBe(3);
273
- expect(STAGE_DEFINITIONS['spec'].order).toBe(4);
274
- expect(STAGE_DEFINITIONS['decompose'].order).toBe(5);
275
- expect(STAGE_DEFINITIONS['implement'].order).toBe(6);
276
- expect(STAGE_DEFINITIONS['verify'].order).toBe(7);
277
- expect(STAGE_DEFINITIONS['test'].order).toBe(8);
278
- expect(STAGE_DEFINITIONS['release'].order).toBe(9);
279
- });
280
- });
281
- // =============================================================================
282
- // GATE ENFORCEMENT TESTS
283
- // =============================================================================
284
- describe('gate enforcement blocks invalid transitions', () => {
285
- it('should block transition when prerequisites are not met', async () => {
286
- const pipelineId = 'T4806';
287
- const context = createInitialContext(pipelineId, 'test-agent');
288
- // Try to skip ahead to implementation without completing decomposition
289
- const invalidTransition = {
290
- from: 'research',
291
- to: 'implementation',
292
- initiatedBy: 'test-agent',
293
- };
294
- const validation = await validateTransition(invalidTransition, context);
295
- expect(validation.valid).toBe(false);
296
- expect(validation.errors.length).toBeGreaterThan(0);
297
- expect(validation.prerequisitesMet).toBe(false);
298
- });
299
- it('should block backward transitions without force flag', async () => {
300
- const pipelineId = 'T4806';
301
- let context = createInitialContext(pipelineId, 'test-agent');
302
- // Mark research as completed before transitioning
303
- context.stages['research'] = setStageStatus('research', 'completed', context);
304
- // Move to consensus
305
- const transition = {
306
- from: 'research',
307
- to: 'consensus',
308
- initiatedBy: 'test-agent',
309
- };
310
- const result = await executeTransition(transition, context);
311
- expect(result.success).toBe(true);
312
- context = result.context;
313
- // Try to go back to research without force
314
- const backwardTransition = {
315
- from: 'consensus',
316
- to: 'research',
317
- initiatedBy: 'test-agent',
318
- };
319
- const validation = await validateTransition(backwardTransition, context);
320
- expect(validation.valid).toBe(false);
321
- expect(validation.requiresForce).toBe(true);
322
- });
323
- it('should require force to skip non-skippable stages', async () => {
324
- const check = checkTransition('research', 'spec', false);
325
- // spec requires force because it would skip consensus and adr
326
- expect(check.requiresForce).toBe(true);
327
- });
328
- it('should detect blocked state correctly', async () => {
329
- const pipelineId = 'T4806';
330
- const context = createInitialContext(pipelineId, 'test-agent');
331
- expect(isBlocked(context)).toBe(false);
332
- // Set research as blocked
333
- context.stages['research'].status = 'blocked';
334
- expect(isBlocked(context)).toBe(true);
335
- });
336
- it('should validate prerequisite requirements per stage', () => {
337
- // Research has no prerequisites
338
- expect(getPrerequisites('research')).toEqual([]);
339
- // Consensus requires research
340
- expect(getPrerequisites('consensus')).toContain('research');
341
- // Spec requires research, consensus, adr
342
- const specPrereqs = getPrerequisites('spec');
343
- expect(specPrereqs).toContain('research');
344
- expect(specPrereqs).toContain('consensus');
345
- expect(specPrereqs).toContain('architecture_decision');
346
- // Implement requires research, spec, decompose
347
- const implementPrereqs = getPrerequisites('implement');
348
- expect(implementPrereqs).toContain('research');
349
- expect(implementPrereqs).toContain('specification');
350
- expect(implementPrereqs).toContain('decomposition');
351
- });
352
- });
353
- describe('gate enforcement allows valid transitions', () => {
354
- it('should allow sequential progression with prerequisites met', async () => {
355
- const pipelineId = 'T4806';
356
- const context = createInitialContext(pipelineId, 'test-agent');
357
- // Mark research as completed
358
- context.stages['research'] = setStageStatus('research', 'completed', context);
359
- // Complete research
360
- const transition = {
361
- from: 'research',
362
- to: 'consensus',
363
- initiatedBy: 'test-agent',
364
- };
365
- const validation = await validateTransition(transition, context);
366
- expect(validation.valid).toBe(true);
367
- expect(validation.ruleAllowed).toBe(true);
368
- expect(validation.prerequisitesMet).toBe(true);
369
- });
370
- it('should allow skipping optional stages', async () => {
371
- const pipelineId = 'T4806';
372
- const context = createInitialContext(pipelineId, 'test-agent');
373
- // Mark consensus as skipped (it's skippable)
374
- context.stages['consensus'] = skipStage('consensus', 'Not needed', context);
375
- context.stages['consensus'].status = 'skipped';
376
- // Now try to transition to adr (prerequisite is research, which is in_progress)
377
- // First complete research
378
- context.stages['research'].status = 'completed';
379
- context.stages['research'].completedAt = new Date();
380
- const transition = {
381
- from: 'research',
382
- to: 'architecture_decision',
383
- initiatedBy: 'test-agent',
384
- };
385
- const validation = await validateTransition(transition, context);
386
- // architecture_decision requires research and consensus - consensus is skipped which is acceptable
387
- expect(validation.prerequisitesMet).toBe(true);
388
- });
389
- it('should allow backward transition with force flag', async () => {
390
- const pipelineId = 'T4806';
391
- let context = createInitialContext(pipelineId, 'test-agent');
392
- // Mark research as completed before transitioning
393
- context.stages['research'] = setStageStatus('research', 'completed', context);
394
- // Move forward
395
- const forwardTransition = {
396
- from: 'research',
397
- to: 'consensus',
398
- initiatedBy: 'test-agent',
399
- };
400
- let result = await executeTransition(forwardTransition, context);
401
- expect(result.success).toBe(true);
402
- context = result.context;
403
- // Mark consensus as completed before going back
404
- context.stages['consensus'] = setStageStatus('consensus', 'completed', context);
405
- // Go back with force
406
- const backwardTransition = {
407
- from: 'consensus',
408
- to: 'research',
409
- initiatedBy: 'test-agent',
410
- force: true,
411
- };
412
- result = await executeTransition(backwardTransition, context);
413
- expect(result.success).toBe(true);
414
- expect(result.context.currentStage).toBe('research');
415
- });
416
- it('should identify valid next stages', () => {
417
- const pipelineId = 'T4806';
418
- const context = createInitialContext(pipelineId, 'test-agent');
419
- const validNext = getValidNextStages(context, false);
420
- expect(validNext).toContain('consensus');
421
- });
422
- });
423
- // =============================================================================
424
- // EVIDENCE RECORDING TESTS
425
- // =============================================================================
426
- describe('evidence recording works across stages', () => {
427
- it('should record stage completion timestamps', async () => {
428
- const pipelineId = 'T4806';
429
- let context = createInitialContext(pipelineId, 'test-agent');
430
- const beforeTime = new Date();
431
- // Mark research as completed before transitioning
432
- context.stages['research'] = setStageStatus('research', 'completed', context);
433
- const transition = {
434
- from: 'research',
435
- to: 'consensus',
436
- initiatedBy: 'test-agent',
437
- };
438
- const result = await executeTransition(transition, context);
439
- context = result.context;
440
- const researchCompletedAt = context.stages['research'].completedAt;
441
- expect(researchCompletedAt).toBeDefined();
442
- expect(researchCompletedAt.getTime()).toBeGreaterThanOrEqual(beforeTime.getTime());
443
- });
444
- it('should record gate results with timestamp [T4801 SQLite-native]', async () => {
445
- // T4801: Now uses SQLite-native gate tracking
446
- const epicId = 'T4806';
447
- const gateResult = await passGate(epicId, 'research-prerequisites-met', 'test-agent', 'All prerequisites verified', testDir);
448
- expect(gateResult.epicId).toBe(epicId);
449
- expect(gateResult.gateName).toBe('research-prerequisites-met');
450
- expect(gateResult.timestamp).toBeDefined();
451
- });
452
- it('should record failed gate with reason [T4801 SQLite-native]', async () => {
453
- // T4801: Now uses SQLite-native gate tracking
454
- const epicId = 'T4806';
455
- const gateResult = await failGate(epicId, 'specification-incomplete', 'Missing acceptance criteria', testDir);
456
- expect(gateResult.epicId).toBe(epicId);
457
- expect(gateResult.gateName).toBe('specification-incomplete');
458
- expect(gateResult.reason).toBe('Missing acceptance criteria');
459
- });
460
- it('should maintain stage state metadata', () => {
461
- const pipelineId = 'T4806';
462
- const context = createInitialContext(pipelineId, 'test-agent');
463
- expect(context.stages['research'].assignedAgent).toBe('test-agent');
464
- expect(context.stages['research'].status).toBe('in_progress');
465
- expect(context.stages['research'].startedAt).toBeDefined();
466
- });
467
- it('should track transition count', async () => {
468
- const pipelineId = 'T4806';
469
- let context = createInitialContext(pipelineId, 'test-agent');
470
- expect(context.transitionCount).toBe(0);
471
- expect(context.version).toBe(1);
472
- // Mark research as completed before transitioning
473
- context.stages['research'] = setStageStatus('research', 'completed', context);
474
- const transition = {
475
- from: 'research',
476
- to: 'consensus',
477
- initiatedBy: 'test-agent',
478
- };
479
- const result = await executeTransition(transition, context);
480
- context = result.context;
481
- expect(context.transitionCount).toBe(1);
482
- });
483
- });
484
- // =============================================================================
485
- // CROSS-SESSION RESUME TESTS
486
- // =============================================================================
487
- describe('cross-session resume preserves context', () => {
488
- it('should restore pipeline state from SQLite [T4801]', async () => {
489
- // T4801: Now uses SQLite-native storage
490
- const epicId = 'T4806';
491
- // Simulate session A: progress through some stages
492
- await recordStageProgress(epicId, 'research', 'completed', 'Initial research done', testDir);
493
- await recordStageProgress(epicId, 'consensus', 'completed', 'Consensus reached', testDir);
494
- await recordStageProgress(epicId, 'architecture_decision', 'skipped', 'Simple change, no ADR needed', testDir);
495
- await recordStageProgress(epicId, 'specification', 'completed', 'Spec written', testDir);
496
- // Simulate session B: read state and continue
497
- const status = await getLifecycleStatus(epicId, testDir);
498
- expect(status.initialized).toBe(true);
499
- expect(status.currentStage).toBe('specification');
500
- // Continue in session B
501
- await recordStageProgress(epicId, 'decomposition', 'completed', 'Task breakdown complete', testDir);
502
- const updatedStatus = await getLifecycleStatus(epicId, testDir);
503
- expect(updatedStatus.currentStage).toBe('decomposition');
504
- });
505
- it('should preserve gate results across sessions [T4801]', async () => {
506
- // T4801: Now uses SQLite-native storage
507
- const epicId = 'T4806';
508
- // Session A: record gate passes
509
- await passGate(epicId, 'research-complete', 'agent-a', 'Research verified', testDir);
510
- await passGate(epicId, 'specification-reviewed', 'agent-a', 'Spec approved', testDir);
511
- // Session B: verify gates are still recorded
512
- const history = await getLifecycleHistory(epicId, testDir);
513
- const gateEvents = history.history.filter((h) => h.action.startsWith('gate.'));
514
- expect(gateEvents.length).toBe(2);
515
- });
516
- it('should maintain stage timestamps across sessions [T4801]', async () => {
517
- // T4801: Now uses SQLite-native storage
518
- const epicId = 'T4806';
519
- const beforeTime = new Date().toISOString();
520
- // Record progress
521
- await recordStageProgress(epicId, 'research', 'completed', undefined, testDir);
522
- // Verify timestamp is recorded
523
- const status = await getLifecycleStatus(epicId, testDir);
524
- const researchStage = status.stages.find((s) => s.stage === 'research');
525
- expect(researchStage?.completedAt).toBeDefined();
526
- expect(Date.parse(researchStage?.completedAt ?? '')).toBeGreaterThanOrEqual(Date.parse(beforeTime));
527
- });
528
- it('should track full history across sessions [T4801]', async () => {
529
- // T4801: Now uses SQLite-native storage
530
- const epicId = 'T4806';
531
- // Complete several stages
532
- await recordStageProgress(epicId, 'research', 'completed', undefined, testDir);
533
- await recordStageProgress(epicId, 'consensus', 'skipped', 'Single agent', testDir);
534
- await recordStageProgress(epicId, 'specification', 'completed', undefined, testDir);
535
- const history = await getLifecycleHistory(epicId, testDir);
536
- const completedActions = history.history.filter((h) => h.action === 'completed');
537
- expect(completedActions.length).toBe(2); // research and specification
538
- expect(history.history.some((h) => h.action === 'skipped')).toBe(true);
539
- });
540
- });
541
- // =============================================================================
542
- // PIPELINE COMPLETION TESTS
543
- // =============================================================================
544
- describe('pipeline completion marks all stages correctly', () => {
545
- it('should mark all stages as completed when pipeline completes', async () => {
546
- const pipelineId = 'T4806';
547
- let context = createInitialContext(pipelineId, 'test-agent');
548
- // Progress through all stages
549
- const stages = [
550
- 'research',
551
- 'consensus',
552
- 'architecture_decision',
553
- 'specification',
554
- 'decomposition',
555
- 'implementation',
556
- 'validation',
557
- 'testing',
558
- ];
559
- for (let i = 0; i < stages.length - 1; i++) {
560
- const from = stages[i];
561
- const to = stages[i + 1];
562
- // Mark source stage as in-progress then completed before transitioning
563
- context.stages[from] = setStageStatus(from, 'in_progress', context);
564
- context.stages[from] = setStageStatus(from, 'completed', context);
565
- const transition = {
566
- from,
567
- to,
568
- initiatedBy: 'test-agent',
569
- };
570
- const result = await executeTransition(transition, context);
571
- if (!result.success) {
572
- throw new Error(`Transition from ${from} to ${to} failed: ${result.errors?.join(', ')}`);
573
- }
574
- context = result.context;
575
- }
576
- // Mark testing stage as completed and transition to release
577
- const now = new Date();
578
- context.stages['testing'] = setStageStatus('testing', 'in_progress', context);
579
- context.stages['testing'] = setStageStatus('testing', 'completed', context);
580
- const finalTransition = {
581
- from: 'testing',
582
- to: 'release',
583
- initiatedBy: 'test-agent',
584
- };
585
- const finalResult = await executeTransition(finalTransition, context);
586
- if (!finalResult.success) {
587
- throw new Error(`Final transition from test to release failed: ${finalResult.errors?.join(', ')}`);
588
- }
589
- context = finalResult.context;
590
- // Stage 9: Release - complete it (bypass transition validation)
591
- context.stages['release'] = setStageStatus('release', 'completed', context);
592
- // Verify all stages completed
593
- expect(context.stages['research'].status).toBe('completed');
594
- expect(context.stages['consensus'].status).toBe('completed');
595
- expect(context.stages['architecture_decision'].status).toBe('completed');
596
- expect(context.stages['specification'].status).toBe('completed');
597
- expect(context.stages['decomposition'].status).toBe('completed');
598
- expect(context.stages['implementation'].status).toBe('completed');
599
- expect(context.stages['validation'].status).toBe('completed');
600
- expect(context.stages['testing'].status).toBe('completed');
601
- expect(context.stages['release'].status).toBe('completed');
602
- // Verify terminal state
603
- expect(isTerminalState(context)).toBe(true);
604
- expect(context.transitionCount).toBe(8);
605
- });
606
- it('should calculate terminal state correctly', async () => {
607
- const pipelineId = 'T4806';
608
- let context = createInitialContext(pipelineId, 'test-agent');
609
- expect(isTerminalState(context)).toBe(false);
610
- // Progress through all stages
611
- const stages = [
612
- 'research',
613
- 'consensus',
614
- 'architecture_decision',
615
- 'specification',
616
- 'decomposition',
617
- 'implementation',
618
- 'validation',
619
- 'testing',
620
- 'release',
621
- ];
622
- for (let i = 0; i < stages.length - 1; i++) {
623
- const from = stages[i];
624
- const to = stages[i + 1];
625
- // Mark from stage as in-progress then completed before transitioning
626
- context.stages[from] = setStageStatus(from, 'in_progress', context);
627
- context.stages[from] = setStageStatus(from, 'completed', context);
628
- const transition = {
629
- from,
630
- to,
631
- initiatedBy: 'test-agent',
632
- };
633
- const result = await executeTransition(transition, context);
634
- context = result.context;
635
- }
636
- // Complete release
637
- context.stages['release'] = setStageStatus('release', 'completed', context);
638
- expect(isTerminalState(context)).toBe(true);
639
- });
640
- it('should update transition count correctly', async () => {
641
- const pipelineId = 'T4806';
642
- let context = createInitialContext(pipelineId, 'test-agent');
643
- expect(context.transitionCount).toBe(0);
644
- expect(context.version).toBe(1);
645
- // Make 3 transitions
646
- const transitions = [
647
- ['research', 'consensus'],
648
- ['consensus', 'architecture_decision'],
649
- ['architecture_decision', 'specification'],
650
- ];
651
- for (const [from, to] of transitions) {
652
- // Mark from stage as in-progress then completed before transitioning
653
- context.stages[from] = setStageStatus(from, 'in_progress', context);
654
- context.stages[from] = setStageStatus(from, 'completed', context);
655
- const transition = {
656
- from,
657
- to,
658
- initiatedBy: 'test-agent',
659
- };
660
- const result = await executeTransition(transition, context);
661
- context = result.context;
662
- }
663
- expect(context.transitionCount).toBe(3);
664
- expect(context.version).toBe(4);
665
- });
666
- it('should provide correct final context state', async () => {
667
- const pipelineId = 'T4806';
668
- let context = createInitialContext(pipelineId, 'test-agent');
669
- // Progress through all stages
670
- const stages = [
671
- 'research',
672
- 'consensus',
673
- 'architecture_decision',
674
- 'specification',
675
- 'decomposition',
676
- 'implementation',
677
- 'validation',
678
- 'testing',
679
- 'release',
680
- ];
681
- for (let i = 0; i < stages.length - 1; i++) {
682
- const from = stages[i];
683
- const to = stages[i + 1];
684
- // Mark from stage as in-progress then completed before transitioning
685
- context.stages[from] = setStageStatus(from, 'in_progress', context);
686
- context.stages[from] = setStageStatus(from, 'completed', context);
687
- const transition = {
688
- from,
689
- to,
690
- initiatedBy: 'test-agent',
691
- };
692
- const result = await executeTransition(transition, context);
693
- context = result.context;
694
- }
695
- context.stages['release'] = setStageStatus('release', 'completed', context);
696
- // Verify final state
697
- expect(context.pipelineId).toBe(pipelineId);
698
- expect(context.currentStage).toBe('release');
699
- expect(context.transitionCount).toBe(8);
700
- expect(isTerminalState(context)).toBe(true);
701
- // Verify stage states
702
- const currentStageState = getCurrentStageState(context);
703
- expect(currentStageState.stage).toBe('release');
704
- expect(currentStageState.status).toBe('completed');
705
- });
706
- });
707
- // =============================================================================
708
- // PIPELINE STUB VALIDATION TESTS (T4800)
709
- // =============================================================================
710
- describe('pipeline stub implementations (T4800)', () => {
711
- it('initializePipeline should return valid pipeline structure', async () => {
712
- await ensureTaskExists('T4806');
713
- const pipeline = await initializePipeline('T4806', {
714
- startStage: 'research',
715
- assignedAgent: 'test-agent',
716
- });
717
- expect(pipeline.id).toBe('T4806');
718
- expect(pipeline.currentStage).toBe('research');
719
- expect(pipeline.status).toBe('active');
720
- expect(pipeline.isActive).toBe(true);
721
- expect(pipeline.version).toBe(1);
722
- expect(pipeline.transitionCount).toBe(0);
723
- });
724
- it('initializePipeline should accept custom start stage', async () => {
725
- await ensureTaskExists('T4806');
726
- const pipeline = await initializePipeline('T4806', {
727
- startStage: 'specification',
728
- });
729
- expect(pipeline.currentStage).toBe('specification');
730
- });
731
- it('getPipeline should return null for non-existent pipeline (stub)', async () => {
732
- const pipeline = await getPipeline('T99999');
733
- expect(pipeline).toBeNull();
734
- });
735
- it('advanceStage should validate required parameters', async () => {
736
- // Missing toStage
737
- await expect(advanceStage('T4806', { initiatedBy: 'test-agent' })).rejects.toThrow('target stage');
738
- // Missing initiatedBy
739
- await expect(advanceStage('T4806', { toStage: 'consensus' })).rejects.toThrow('initiatedBy');
740
- });
741
- it('getCurrentStage should throw when pipeline not found (stub)', async () => {
742
- // The stub getPipeline returns null, so getCurrentStage throws NOT_FOUND
743
- await expect(getCurrentStage('T4806')).rejects.toThrow('No pipeline found');
744
- });
745
- it('completePipeline should validate input (stub)', async () => {
746
- await expect(completePipeline('T4806', 'All stages completed')).rejects.toThrow('No pipeline found');
747
- });
748
- it('cancelPipeline should validate input (stub)', async () => {
749
- await expect(cancelPipeline('T4806', 'Cancelled for testing')).rejects.toThrow('No pipeline found');
750
- });
751
- });
752
- // =============================================================================
753
- // STAGE DEFINITION VALIDATION TESTS
754
- // =============================================================================
755
- describe('stage definition validation', () => {
756
- it('should have 9 pipeline stages', () => {
757
- expect(PIPELINE_STAGES.length).toBe(9);
758
- });
759
- it('should have correct stage categories', () => {
760
- expect(STAGE_DEFINITIONS['research'].category).toBe('planning');
761
- expect(STAGE_DEFINITIONS['consensus'].category).toBe('decision');
762
- expect(STAGE_DEFINITIONS['adr'].category).toBe('decision');
763
- expect(STAGE_DEFINITIONS['spec'].category).toBe('planning');
764
- expect(STAGE_DEFINITIONS['decompose'].category).toBe('planning');
765
- expect(STAGE_DEFINITIONS['implement'].category).toBe('execution');
766
- expect(STAGE_DEFINITIONS['verify'].category).toBe('validation');
767
- expect(STAGE_DEFINITIONS['test'].category).toBe('validation');
768
- expect(STAGE_DEFINITIONS['release'].category).toBe('delivery');
769
- });
770
- it('should have correct skippable flags', () => {
771
- expect(STAGE_DEFINITIONS['research'].skippable).toBe(false);
772
- expect(STAGE_DEFINITIONS['consensus'].skippable).toBe(true);
773
- expect(STAGE_DEFINITIONS['adr'].skippable).toBe(true);
774
- expect(STAGE_DEFINITIONS['spec'].skippable).toBe(false);
775
- expect(STAGE_DEFINITIONS['decompose'].skippable).toBe(false);
776
- expect(STAGE_DEFINITIONS['implement'].skippable).toBe(false);
777
- expect(STAGE_DEFINITIONS['verify'].skippable).toBe(false);
778
- expect(STAGE_DEFINITIONS['test'].skippable).toBe(false);
779
- expect(STAGE_DEFINITIONS['release'].skippable).toBe(true);
780
- });
781
- it('should have expected artifacts defined for each stage', () => {
782
- expect(STAGE_DEFINITIONS['research'].expectedArtifacts).toContain('research-report');
783
- expect(STAGE_DEFINITIONS['spec'].expectedArtifacts).toContain('spec-document');
784
- expect(STAGE_DEFINITIONS['implement'].expectedArtifacts).toContain('source-code');
785
- expect(STAGE_DEFINITIONS['test'].expectedArtifacts).toContain('test-results');
786
- expect(STAGE_DEFINITIONS['release'].expectedArtifacts).toContain('release-notes');
787
- });
788
- it('should have required gates defined for each stage', () => {
789
- expect(STAGE_DEFINITIONS['research'].requiredGates).toContain('prerequisites-met');
790
- expect(STAGE_DEFINITIONS['consensus'].requiredGates).toContain('research-complete');
791
- expect(STAGE_DEFINITIONS['implement'].requiredGates).toContain('code-complete');
792
- expect(STAGE_DEFINITIONS['test'].requiredGates).toContain('tests-pass');
793
- });
794
- });
795
- // =============================================================================
796
- // TRANSITION RULE VALIDATION TESTS
797
- // =============================================================================
798
- describe('transition rule validation', () => {
799
- it('should allow all forward sequential transitions', () => {
800
- const stages = [
801
- 'research',
802
- 'consensus',
803
- 'architecture_decision',
804
- 'specification',
805
- 'decomposition',
806
- 'implementation',
807
- 'validation',
808
- 'testing',
809
- 'release',
810
- ];
811
- for (let i = 0; i < stages.length - 1; i++) {
812
- const from = stages[i];
813
- const to = stages[i + 1];
814
- const check = checkTransition(from, to, false);
815
- expect(check.allowed).toBe(true);
816
- }
817
- });
818
- it('should block release to any stage', () => {
819
- const stages = [
820
- 'research',
821
- 'consensus',
822
- 'architecture_decision',
823
- 'specification',
824
- 'decomposition',
825
- 'implementation',
826
- 'validation',
827
- 'testing',
828
- ];
829
- for (const stage of stages) {
830
- const check = checkTransition('release', stage, false);
831
- expect(check.allowed).toBe(false);
832
- }
833
- });
834
- it('should allow skipping with force', () => {
835
- const check = checkTransition('research', 'spec', true);
836
- expect(check.allowed).toBe(true);
837
- });
838
- it('should require force for backward transitions', () => {
839
- const checkNoForce = checkTransition('implement', 'spec', false);
840
- expect(checkNoForce.allowed).toBe(false);
841
- expect(checkNoForce.requiresForce).toBe(true);
842
- const checkWithForce = checkTransition('implement', 'spec', true);
843
- expect(checkWithForce.allowed).toBe(true);
844
- });
845
- });
846
- // =============================================================================
847
- // INTEGRITY AND CONSISTENCY TESTS
848
- // =============================================================================
849
- describe('data integrity and consistency', () => {
850
- it('should maintain immutable state during transitions', async () => {
851
- const pipelineId = 'T4806';
852
- const originalContext = createInitialContext(pipelineId, 'test-agent');
853
- // Mark research as completed before transitioning
854
- originalContext.stages['research'] = setStageStatus('research', 'completed', originalContext);
855
- const transition = {
856
- from: 'research',
857
- to: 'consensus',
858
- initiatedBy: 'test-agent',
859
- };
860
- const result = await executeTransition(transition, originalContext);
861
- // Original context should be unchanged
862
- expect(originalContext.currentStage).toBe('research');
863
- expect(originalContext.stages['research'].status).toBe('completed');
864
- // New context should reflect the transition
865
- expect(result.context.currentStage).toBe('consensus');
866
- expect(result.context.stages['research'].status).toBe('completed');
867
- });
868
- it('should handle concurrent transition attempts gracefully', async () => {
869
- const pipelineId = 'T4806';
870
- const context = createInitialContext(pipelineId, 'test-agent');
871
- // Mark research as completed before transitioning
872
- context.stages['research'] = setStageStatus('research', 'completed', context);
873
- const transition = {
874
- from: 'research',
875
- to: 'consensus',
876
- initiatedBy: 'test-agent',
877
- };
878
- // Execute same transition twice
879
- const result1 = await executeTransition(transition, context);
880
- const result2 = await executeTransition(transition, context);
881
- // Both should succeed with fresh contexts
882
- expect(result1.success).toBe(true);
883
- expect(result2.success).toBe(true);
884
- // But they should be independent
885
- expect(result1.context).not.toBe(result2.context);
886
- });
887
- it('should validate all stage names are defined', () => {
888
- for (const stage of PIPELINE_STAGES) {
889
- expect(STAGE_DEFINITIONS[stage]).toBeDefined();
890
- expect(STAGE_DEFINITIONS[stage].stage).toBe(stage);
891
- }
892
- });
893
- it('should have consistent order between STAGE_ORDER and definitions', () => {
894
- for (const stage of PIPELINE_STAGES) {
895
- expect(STAGE_ORDER[stage]).toBe(STAGE_DEFINITIONS[stage].order);
896
- }
897
- });
898
- it('should have complete prerequisite mappings', () => {
899
- for (const stage of PIPELINE_STAGES) {
900
- const prereqs = getPrerequisites(stage);
901
- expect(Array.isArray(prereqs)).toBe(true);
902
- // All prerequisites should be valid stages
903
- for (const prereq of prereqs) {
904
- expect(PIPELINE_STAGES).toContain(prereq);
905
- }
906
- }
907
- });
908
- });
909
- });
910
- // =============================================================================
911
- // EPIC COMPLETION TEST
912
- // =============================================================================
913
- describe('T4798 Epic Completion Validation', () => {
914
- beforeEach(async () => {
915
- testDir = await mkdtemp(join(tmpdir(), 'cleo-epic-completion-'));
916
- cleoDir = join(testDir, '.cleo');
917
- await mkdir(cleoDir, { recursive: true });
918
- await mkdir(join(cleoDir, 'rcasd'), { recursive: true });
919
- process.env['CLEO_DIR'] = cleoDir;
920
- process.env['LIFECYCLE_ENFORCEMENT_MODE'] = 'off';
921
- });
922
- afterEach(async () => {
923
- try {
924
- const { closeAllDatabases } = await import('../../store/sqlite.js');
925
- await closeAllDatabases();
926
- }
927
- catch {
928
- /* ignore */
929
- }
930
- delete process.env['CLEO_DIR'];
931
- delete process.env['LIFECYCLE_ENFORCEMENT_MODE'];
932
- await rm(testDir, { recursive: true, force: true });
933
- });
934
- it('validates all T4798 dependencies are functional [T4801]', async () => {
935
- // T4801: All dependencies now use SQLite-native storage
936
- // T4800: Pipeline State Machine
937
- const pipelineId = 'T4806';
938
- const context = createInitialContext(pipelineId, 'test-agent');
939
- expect(context).toBeDefined();
940
- expect(context.currentStage).toBe('research');
941
- // T4801: SQLite Schema (verified via stage definitions)
942
- expect(PIPELINE_STAGES.length).toBe(9);
943
- expect(STAGE_DEFINITIONS['research'].order).toBe(1);
944
- // T4804: Gate/Evidence Recording (via passGate/failGate)
945
- const gateResult = await passGate('T4806', 'research-test-gate', 'agent', 'Test', testDir);
946
- expect(gateResult.timestamp).toBeDefined();
947
- // T4805: Cross-session resume (via recordStageProgress)
948
- await recordStageProgress('T4806', 'research', 'completed', undefined, testDir);
949
- const status = await getLifecycleStatus('T4806', testDir);
950
- expect(status.initialized).toBe(true);
951
- });
952
- it('confirms pipeline integration is complete', () => {
953
- // Verify all 9 stages are present
954
- const expectedStages = [
955
- 'research',
956
- 'consensus',
957
- 'architecture_decision',
958
- 'specification',
959
- 'decomposition',
960
- 'implementation',
961
- 'validation',
962
- 'testing',
963
- 'release',
964
- ];
965
- expect(PIPELINE_STAGES).toEqual(expectedStages);
966
- // Verify state machine is functional
967
- const context = createInitialContext('T4806', 'test-agent');
968
- expect(isTerminalState(context)).toBe(false);
969
- // Verify gate enforcement is configured
970
- expect(STAGE_DEFINITIONS['research'].requiredGates.length).toBeGreaterThan(0);
971
- expect(STAGE_DEFINITIONS['implement'].requiredGates.length).toBeGreaterThan(0);
972
- // Verify evidence recording is available
973
- expect(typeof passGate).toBe('function');
974
- expect(typeof failGate).toBe('function');
975
- });
976
- });
977
- //# sourceMappingURL=pipeline.integration.test.js.map