@lumenflow/core 4.24.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (430) hide show
  1. package/dist/arg-parser.d.ts.map +1 -1
  2. package/dist/arg-parser.js +16 -0
  3. package/dist/arg-parser.js.map +1 -1
  4. package/dist/atomic-merge.d.ts.map +1 -1
  5. package/dist/atomic-merge.js +25 -18
  6. package/dist/atomic-merge.js.map +1 -1
  7. package/dist/client-ids.d.ts +1 -15
  8. package/dist/client-ids.d.ts.map +1 -1
  9. package/dist/client-ids.js +4 -13
  10. package/dist/client-ids.js.map +1 -1
  11. package/dist/code-path-validator.d.ts.map +1 -1
  12. package/dist/code-path-validator.js +6 -3
  13. package/dist/code-path-validator.js.map +1 -1
  14. package/dist/config-contract.d.ts +1 -30
  15. package/dist/config-contract.d.ts.map +1 -1
  16. package/dist/config-contract.js +4 -60
  17. package/dist/config-contract.js.map +1 -1
  18. package/dist/constants/backlog-patterns.d.ts +1 -20
  19. package/dist/constants/backlog-patterns.d.ts.map +1 -1
  20. package/dist/constants/backlog-patterns.js +2 -23
  21. package/dist/constants/backlog-patterns.js.map +1 -1
  22. package/dist/constants/duration-constants.d.ts +1 -28
  23. package/dist/constants/duration-constants.d.ts.map +1 -1
  24. package/dist/constants/duration-constants.js +4 -28
  25. package/dist/constants/duration-constants.js.map +1 -1
  26. package/dist/constants/gate-constants.d.ts +1 -23
  27. package/dist/constants/gate-constants.d.ts.map +1 -1
  28. package/dist/constants/gate-constants.js +4 -23
  29. package/dist/constants/gate-constants.js.map +1 -1
  30. package/dist/constants/lock-constants.d.ts +1 -28
  31. package/dist/constants/lock-constants.d.ts.map +1 -1
  32. package/dist/constants/lock-constants.js +2 -28
  33. package/dist/constants/lock-constants.js.map +1 -1
  34. package/dist/core/tool.schemas.d.ts +11 -11
  35. package/dist/core/worktree-guard.js +2 -2
  36. package/dist/core/worktree-guard.js.map +1 -1
  37. package/dist/cycle-detector.d.ts +4 -48
  38. package/dist/cycle-detector.d.ts.map +1 -1
  39. package/dist/cycle-detector.js +4 -78
  40. package/dist/cycle-detector.js.map +1 -1
  41. package/dist/date-utils.d.ts +1 -65
  42. package/dist/date-utils.d.ts.map +1 -1
  43. package/dist/date-utils.js +4 -140
  44. package/dist/date-utils.js.map +1 -1
  45. package/dist/delegation-monitor.d.ts +2 -0
  46. package/dist/delegation-monitor.d.ts.map +1 -1
  47. package/dist/delegation-monitor.js +29 -2
  48. package/dist/delegation-monitor.js.map +1 -1
  49. package/dist/delegation-recovery.d.ts +36 -17
  50. package/dist/delegation-recovery.d.ts.map +1 -1
  51. package/dist/delegation-recovery.js +285 -82
  52. package/dist/delegation-recovery.js.map +1 -1
  53. package/dist/delegation-registry-schema.d.ts +257 -31
  54. package/dist/delegation-registry-schema.d.ts.map +1 -1
  55. package/dist/delegation-registry-schema.js +43 -34
  56. package/dist/delegation-registry-schema.js.map +1 -1
  57. package/dist/delegation-registry-store.d.ts +4 -128
  58. package/dist/delegation-registry-store.d.ts.map +1 -1
  59. package/dist/delegation-registry-store.js +39 -178
  60. package/dist/delegation-registry-store.js.map +1 -1
  61. package/dist/delegation-tree.d.ts +12 -20
  62. package/dist/delegation-tree.d.ts.map +1 -1
  63. package/dist/delegation-tree.js +40 -29
  64. package/dist/delegation-tree.js.map +1 -1
  65. package/dist/delivery-review-contract.d.ts +1 -1
  66. package/dist/delivery-review-contract.d.ts.map +1 -1
  67. package/dist/docs-layout-presets.d.ts +1 -30
  68. package/dist/docs-layout-presets.d.ts.map +1 -1
  69. package/dist/docs-layout-presets.js +4 -38
  70. package/dist/docs-layout-presets.js.map +1 -1
  71. package/dist/domain/context.schemas.d.ts +3 -3
  72. package/dist/domain/orchestration.constants.d.ts +1 -110
  73. package/dist/domain/orchestration.constants.d.ts.map +1 -1
  74. package/dist/domain/orchestration.constants.js +2 -127
  75. package/dist/domain/orchestration.constants.js.map +1 -1
  76. package/dist/domain/orchestration.schemas.d.ts +1 -306
  77. package/dist/domain/orchestration.schemas.d.ts.map +1 -1
  78. package/dist/domain/orchestration.schemas.js +2 -211
  79. package/dist/domain/orchestration.schemas.js.map +1 -1
  80. package/dist/domain/orchestration.types.d.ts +1 -133
  81. package/dist/domain/orchestration.types.d.ts.map +1 -1
  82. package/dist/domain/orchestration.types.js +2 -2
  83. package/dist/domain/orchestration.types.js.map +1 -1
  84. package/dist/domain/recovery.schemas.d.ts +3 -3
  85. package/dist/domain/validation.schemas.d.ts +4 -4
  86. package/dist/error-handler.d.ts +4 -173
  87. package/dist/error-handler.d.ts.map +1 -1
  88. package/dist/error-handler.js +4 -244
  89. package/dist/error-handler.js.map +1 -1
  90. package/dist/file-classifiers.d.ts.map +1 -1
  91. package/dist/file-classifiers.js +26 -0
  92. package/dist/file-classifiers.js.map +1 -1
  93. package/dist/git-adapter.d.ts +4 -448
  94. package/dist/git-adapter.d.ts.map +1 -1
  95. package/dist/git-adapter.js +4 -772
  96. package/dist/git-adapter.js.map +1 -1
  97. package/dist/git-context-extractor.d.ts +4 -98
  98. package/dist/git-context-extractor.d.ts.map +1 -1
  99. package/dist/git-context-extractor.js +4 -563
  100. package/dist/git-context-extractor.js.map +1 -1
  101. package/dist/git-staged-validator.d.ts +4 -29
  102. package/dist/git-staged-validator.d.ts.map +1 -1
  103. package/dist/git-staged-validator.js +4 -46
  104. package/dist/git-staged-validator.js.map +1 -1
  105. package/dist/incremental-lint.d.ts.map +1 -1
  106. package/dist/incremental-lint.js +3 -2
  107. package/dist/incremental-lint.js.map +1 -1
  108. package/dist/incremental-test.d.ts +1 -32
  109. package/dist/incremental-test.d.ts.map +1 -1
  110. package/dist/incremental-test.js +4 -61
  111. package/dist/incremental-test.js.map +1 -1
  112. package/dist/index.d.ts +3 -2
  113. package/dist/index.d.ts.map +1 -1
  114. package/dist/index.js +10 -2
  115. package/dist/index.js.map +1 -1
  116. package/dist/integration-target.d.ts +30 -0
  117. package/dist/integration-target.d.ts.map +1 -0
  118. package/dist/integration-target.js +51 -0
  119. package/dist/integration-target.js.map +1 -0
  120. package/dist/lane-checker.d.ts.map +1 -1
  121. package/dist/lane-checker.js +8 -0
  122. package/dist/lane-checker.js.map +1 -1
  123. package/dist/lumenflow-config-schema.d.ts +73 -29
  124. package/dist/lumenflow-config-schema.d.ts.map +1 -1
  125. package/dist/lumenflow-config-schema.js +1 -1
  126. package/dist/lumenflow-config-schema.js.map +1 -1
  127. package/dist/lumenflow-config.d.ts +10 -34
  128. package/dist/lumenflow-config.d.ts.map +1 -1
  129. package/dist/lumenflow-config.js +32 -142
  130. package/dist/lumenflow-config.js.map +1 -1
  131. package/dist/manual-test-validator.d.ts +1 -96
  132. package/dist/manual-test-validator.d.ts.map +1 -1
  133. package/dist/manual-test-validator.js +4 -245
  134. package/dist/manual-test-validator.js.map +1 -1
  135. package/dist/micro-worktree-shared.d.ts.map +1 -1
  136. package/dist/micro-worktree-shared.js +10 -9
  137. package/dist/micro-worktree-shared.js.map +1 -1
  138. package/dist/micro-worktree.d.ts.map +1 -1
  139. package/dist/micro-worktree.js +26 -23
  140. package/dist/micro-worktree.js.map +1 -1
  141. package/dist/normalize-config-keys.d.ts +1 -10
  142. package/dist/normalize-config-keys.d.ts.map +1 -1
  143. package/dist/normalize-config-keys.js +7 -73
  144. package/dist/normalize-config-keys.js.map +1 -1
  145. package/dist/object-guards.d.ts +1 -10
  146. package/dist/object-guards.d.ts.map +1 -1
  147. package/dist/object-guards.js +7 -20
  148. package/dist/object-guards.js.map +1 -1
  149. package/dist/ports/config.ports.d.ts +1 -82
  150. package/dist/ports/config.ports.d.ts.map +1 -1
  151. package/dist/ports/config.ports.js +2 -1
  152. package/dist/ports/config.ports.js.map +1 -1
  153. package/dist/ports/dashboard-renderer.port.d.ts +1 -112
  154. package/dist/ports/dashboard-renderer.port.d.ts.map +1 -1
  155. package/dist/ports/dashboard-renderer.port.js +2 -1
  156. package/dist/ports/dashboard-renderer.port.js.map +1 -1
  157. package/dist/ports/git-validator.ports.d.ts +5 -110
  158. package/dist/ports/git-validator.ports.d.ts.map +1 -1
  159. package/dist/ports/git-validator.ports.js +8 -1
  160. package/dist/ports/git-validator.ports.js.map +1 -1
  161. package/dist/ports/sync-validator.ports.d.ts +1 -51
  162. package/dist/ports/sync-validator.ports.d.ts.map +1 -1
  163. package/dist/ports/sync-validator.ports.js +2 -1
  164. package/dist/ports/sync-validator.ports.js.map +1 -1
  165. package/dist/ports/wu-helpers.ports.d.ts +1 -156
  166. package/dist/ports/wu-helpers.ports.d.ts.map +1 -1
  167. package/dist/ports/wu-helpers.ports.js +2 -1
  168. package/dist/ports/wu-helpers.ports.js.map +1 -1
  169. package/dist/ports/wu-state.ports.d.ts +1 -208
  170. package/dist/ports/wu-state.ports.d.ts.map +1 -1
  171. package/dist/ports/wu-state.ports.js +2 -1
  172. package/dist/ports/wu-state.ports.js.map +1 -1
  173. package/dist/rebase-artifact-cleanup.d.ts.map +1 -1
  174. package/dist/rebase-artifact-cleanup.js +6 -3
  175. package/dist/rebase-artifact-cleanup.js.map +1 -1
  176. package/dist/sandbox-allowlist.d.ts +1 -15
  177. package/dist/sandbox-allowlist.d.ts.map +1 -1
  178. package/dist/sandbox-allowlist.js +4 -74
  179. package/dist/sandbox-allowlist.js.map +1 -1
  180. package/dist/sandbox-backend-linux.d.ts +1 -5
  181. package/dist/sandbox-backend-linux.d.ts.map +1 -1
  182. package/dist/sandbox-backend-linux.js +4 -64
  183. package/dist/sandbox-backend-linux.js.map +1 -1
  184. package/dist/sandbox-backend-macos.d.ts +1 -5
  185. package/dist/sandbox-backend-macos.d.ts.map +1 -1
  186. package/dist/sandbox-backend-macos.js +4 -109
  187. package/dist/sandbox-backend-macos.js.map +1 -1
  188. package/dist/sandbox-backend-windows.d.ts +1 -5
  189. package/dist/sandbox-backend-windows.d.ts.map +1 -1
  190. package/dist/sandbox-backend-windows.js +4 -27
  191. package/dist/sandbox-backend-windows.js.map +1 -1
  192. package/dist/sandbox-profile.d.ts +1 -57
  193. package/dist/sandbox-profile.d.ts.map +1 -1
  194. package/dist/sandbox-profile.js +4 -65
  195. package/dist/sandbox-profile.js.map +1 -1
  196. package/dist/schemas/agents-config.d.ts +47 -0
  197. package/dist/schemas/agents-config.d.ts.map +1 -1
  198. package/dist/schemas/agents-config.js +59 -0
  199. package/dist/schemas/agents-config.js.map +1 -1
  200. package/dist/schemas/command-schemas.d.ts +4 -4
  201. package/dist/schemas/flow-arg-validators.d.ts +2 -2
  202. package/dist/schemas/flow-schemas.d.ts +4 -4
  203. package/dist/schemas/gates-section-config.d.ts +32 -13
  204. package/dist/schemas/gates-section-config.d.ts.map +1 -1
  205. package/dist/schemas/gates-section-config.js +16 -1
  206. package/dist/schemas/gates-section-config.js.map +1 -1
  207. package/dist/schemas/initiative-arg-validators.d.ts +2 -2
  208. package/dist/schemas/initiative-schemas.d.ts +12 -12
  209. package/dist/schemas/lanes-config.d.ts +5 -5
  210. package/dist/schemas/memory-arg-validators.d.ts +6 -0
  211. package/dist/schemas/memory-arg-validators.d.ts.map +1 -1
  212. package/dist/schemas/memory-config.d.ts +4 -4
  213. package/dist/schemas/memory-schemas.d.ts +12 -0
  214. package/dist/schemas/memory-schemas.d.ts.map +1 -1
  215. package/dist/schemas/memory-schemas.js +12 -0
  216. package/dist/schemas/memory-schemas.js.map +1 -1
  217. package/dist/schemas/operational-config.d.ts +4 -4
  218. package/dist/schemas/setup-arg-validators.d.ts +3 -3
  219. package/dist/schemas/setup-schemas.d.ts +8 -8
  220. package/dist/schemas/wu-config.d.ts +3 -3
  221. package/dist/schemas/wu-lifecycle-arg-validators.d.ts +2 -2
  222. package/dist/schemas/wu-lifecycle-schemas.d.ts +4 -4
  223. package/dist/section-headings.d.ts +1 -34
  224. package/dist/section-headings.d.ts.map +1 -1
  225. package/dist/section-headings.js +2 -51
  226. package/dist/section-headings.js.map +1 -1
  227. package/dist/spawn-constraints-generator.js +3 -3
  228. package/dist/spawn-constraints-generator.js.map +1 -1
  229. package/dist/spawn-guidance-generators.d.ts +1 -1
  230. package/dist/spawn-guidance-generators.d.ts.map +1 -1
  231. package/dist/spawn-policy-resolver.d.ts +1 -1
  232. package/dist/spawn-policy-resolver.d.ts.map +1 -1
  233. package/dist/spawn-task-builder.d.ts +17 -1
  234. package/dist/spawn-task-builder.d.ts.map +1 -1
  235. package/dist/spawn-task-builder.js +63 -1
  236. package/dist/spawn-task-builder.js.map +1 -1
  237. package/dist/spawn-template-assembler.d.ts +1 -1
  238. package/dist/spawn-template-assembler.d.ts.map +1 -1
  239. package/dist/state-machine.d.ts +1 -9
  240. package/dist/state-machine.d.ts.map +1 -1
  241. package/dist/state-machine.js +2 -86
  242. package/dist/state-machine.js.map +1 -1
  243. package/dist/sync-validator.d.ts.map +1 -1
  244. package/dist/sync-validator.js +15 -12
  245. package/dist/sync-validator.js.map +1 -1
  246. package/dist/telemetry.d.ts.map +1 -1
  247. package/dist/telemetry.js +3 -2
  248. package/dist/telemetry.js.map +1 -1
  249. package/dist/work-classifier.d.ts +1 -102
  250. package/dist/work-classifier.d.ts.map +1 -1
  251. package/dist/work-classifier.js +2 -424
  252. package/dist/work-classifier.js.map +1 -1
  253. package/dist/worktree-symlink.d.ts +2 -2
  254. package/dist/worktree-symlink.d.ts.map +1 -1
  255. package/dist/worktree-symlink.js +37 -12
  256. package/dist/worktree-symlink.js.map +1 -1
  257. package/dist/wu-cli-constants.d.ts +1 -433
  258. package/dist/wu-cli-constants.d.ts.map +1 -1
  259. package/dist/wu-cli-constants.js +4 -436
  260. package/dist/wu-cli-constants.js.map +1 -1
  261. package/dist/wu-consistency-file-repairs.d.ts.map +1 -1
  262. package/dist/wu-consistency-file-repairs.js +5 -3
  263. package/dist/wu-consistency-file-repairs.js.map +1 -1
  264. package/dist/wu-context-constants.d.ts +22 -0
  265. package/dist/wu-context-constants.d.ts.map +1 -1
  266. package/dist/wu-context-constants.js +22 -0
  267. package/dist/wu-context-constants.js.map +1 -1
  268. package/dist/wu-doc-types.d.ts +1 -47
  269. package/dist/wu-doc-types.d.ts.map +1 -1
  270. package/dist/wu-domain-constants.d.ts +1 -295
  271. package/dist/wu-domain-constants.d.ts.map +1 -1
  272. package/dist/wu-domain-constants.js +4 -397
  273. package/dist/wu-domain-constants.js.map +1 -1
  274. package/dist/wu-done-branch-only.d.ts +1 -1
  275. package/dist/wu-done-branch-only.d.ts.map +1 -1
  276. package/dist/wu-done-branch-only.js +22 -13
  277. package/dist/wu-done-branch-only.js.map +1 -1
  278. package/dist/wu-done-branch-utils.d.ts.map +1 -1
  279. package/dist/wu-done-branch-utils.js +5 -3
  280. package/dist/wu-done-branch-utils.js.map +1 -1
  281. package/dist/wu-done-cleanup.d.ts.map +1 -1
  282. package/dist/wu-done-cleanup.js +66 -22
  283. package/dist/wu-done-cleanup.js.map +1 -1
  284. package/dist/wu-done-concurrent-merge.d.ts.map +1 -1
  285. package/dist/wu-done-concurrent-merge.js +9 -6
  286. package/dist/wu-done-concurrent-merge.js.map +1 -1
  287. package/dist/wu-done-errors.d.ts +3 -3
  288. package/dist/wu-done-errors.d.ts.map +1 -1
  289. package/dist/wu-done-inputs.d.ts.map +1 -1
  290. package/dist/wu-done-inputs.js +3 -0
  291. package/dist/wu-done-inputs.js.map +1 -1
  292. package/dist/wu-done-merge-phase.d.ts.map +1 -1
  293. package/dist/wu-done-merge-phase.js +4 -2
  294. package/dist/wu-done-merge-phase.js.map +1 -1
  295. package/dist/wu-done-merge.d.ts.map +1 -1
  296. package/dist/wu-done-merge.js +16 -8
  297. package/dist/wu-done-merge.js.map +1 -1
  298. package/dist/wu-done-merged-worktree.d.ts.map +1 -1
  299. package/dist/wu-done-merged-worktree.js +7 -8
  300. package/dist/wu-done-merged-worktree.js.map +1 -1
  301. package/dist/wu-done-messages.d.ts.map +1 -1
  302. package/dist/wu-done-messages.js +12 -5
  303. package/dist/wu-done-messages.js.map +1 -1
  304. package/dist/wu-done-metadata.d.ts.map +1 -1
  305. package/dist/wu-done-metadata.js +3 -8
  306. package/dist/wu-done-metadata.js.map +1 -1
  307. package/dist/wu-done-preflight-checks.d.ts.map +1 -1
  308. package/dist/wu-done-preflight-checks.js +21 -15
  309. package/dist/wu-done-preflight-checks.js.map +1 -1
  310. package/dist/wu-done-rebase.d.ts.map +1 -1
  311. package/dist/wu-done-rebase.js +10 -8
  312. package/dist/wu-done-rebase.js.map +1 -1
  313. package/dist/wu-done-retry-helpers.d.ts.map +1 -1
  314. package/dist/wu-done-retry-helpers.js +13 -11
  315. package/dist/wu-done-retry-helpers.js.map +1 -1
  316. package/dist/wu-done-validation.d.ts.map +1 -1
  317. package/dist/wu-done-validation.js +4 -2
  318. package/dist/wu-done-validation.js.map +1 -1
  319. package/dist/wu-done-worktree-services.d.ts.map +1 -1
  320. package/dist/wu-done-worktree-services.js +4 -2
  321. package/dist/wu-done-worktree-services.js.map +1 -1
  322. package/dist/wu-done-worktree.d.ts.map +1 -1
  323. package/dist/wu-done-worktree.js +4 -2
  324. package/dist/wu-done-worktree.js.map +1 -1
  325. package/dist/wu-git-constants.d.ts +1 -175
  326. package/dist/wu-git-constants.d.ts.map +1 -1
  327. package/dist/wu-git-constants.js +4 -175
  328. package/dist/wu-git-constants.js.map +1 -1
  329. package/dist/wu-helpers.d.ts +24 -0
  330. package/dist/wu-helpers.d.ts.map +1 -1
  331. package/dist/wu-helpers.js +37 -4
  332. package/dist/wu-helpers.js.map +1 -1
  333. package/dist/wu-id-format.d.ts +1 -137
  334. package/dist/wu-id-format.d.ts.map +1 -1
  335. package/dist/wu-id-format.js +2 -249
  336. package/dist/wu-id-format.js.map +1 -1
  337. package/dist/wu-id-generator.d.ts.map +1 -1
  338. package/dist/wu-id-generator.js +8 -5
  339. package/dist/wu-id-generator.js.map +1 -1
  340. package/dist/wu-paths-constants.d.ts +1 -253
  341. package/dist/wu-paths-constants.d.ts.map +1 -1
  342. package/dist/wu-paths-constants.js +4 -273
  343. package/dist/wu-paths-constants.js.map +1 -1
  344. package/dist/wu-paths.d.ts +1 -274
  345. package/dist/wu-paths.d.ts.map +1 -1
  346. package/dist/wu-paths.js +4 -236
  347. package/dist/wu-paths.js.map +1 -1
  348. package/dist/wu-rules-resolvers.d.ts.map +1 -1
  349. package/dist/wu-rules-resolvers.js +11 -6
  350. package/dist/wu-rules-resolvers.js.map +1 -1
  351. package/dist/wu-schema.d.ts +1 -830
  352. package/dist/wu-schema.d.ts.map +1 -1
  353. package/dist/wu-schema.js +4 -929
  354. package/dist/wu-schema.js.map +1 -1
  355. package/dist/wu-spawn-helpers.d.ts.map +1 -1
  356. package/dist/wu-spawn-helpers.js +5 -2
  357. package/dist/wu-spawn-helpers.js.map +1 -1
  358. package/dist/wu-spawn.d.ts +2 -2
  359. package/dist/wu-spawn.d.ts.map +1 -1
  360. package/dist/wu-spawn.js +2 -2
  361. package/dist/wu-spawn.js.map +1 -1
  362. package/dist/wu-state-schema.d.ts +1 -291
  363. package/dist/wu-state-schema.d.ts.map +1 -1
  364. package/dist/wu-state-schema.js +4 -212
  365. package/dist/wu-state-schema.js.map +1 -1
  366. package/dist/wu-status-transition.d.ts +3 -1
  367. package/dist/wu-status-transition.d.ts.map +1 -1
  368. package/dist/wu-status-transition.js +9 -24
  369. package/dist/wu-status-transition.js.map +1 -1
  370. package/dist/wu-statuses.d.ts +1 -208
  371. package/dist/wu-statuses.d.ts.map +1 -1
  372. package/dist/wu-statuses.js +4 -242
  373. package/dist/wu-statuses.js.map +1 -1
  374. package/dist/wu-transaction-collectors.d.ts +1 -0
  375. package/dist/wu-transaction-collectors.d.ts.map +1 -1
  376. package/dist/wu-transaction-collectors.js +13 -8
  377. package/dist/wu-transaction-collectors.js.map +1 -1
  378. package/dist/wu-type-helpers.d.ts +1 -27
  379. package/dist/wu-type-helpers.d.ts.map +1 -1
  380. package/dist/wu-type-helpers.js +4 -46
  381. package/dist/wu-type-helpers.js.map +1 -1
  382. package/dist/wu-ui-constants.d.ts +1 -235
  383. package/dist/wu-ui-constants.d.ts.map +1 -1
  384. package/dist/wu-ui-constants.js +5 -235
  385. package/dist/wu-ui-constants.js.map +1 -1
  386. package/dist/wu-validation-constants.d.ts +1 -60
  387. package/dist/wu-validation-constants.d.ts.map +1 -1
  388. package/dist/wu-validation-constants.js +4 -66
  389. package/dist/wu-validation-constants.js.map +1 -1
  390. package/dist/wu-yaml.d.ts +1 -112
  391. package/dist/wu-yaml.d.ts.map +1 -1
  392. package/dist/wu-yaml.js +4 -304
  393. package/dist/wu-yaml.js.map +1 -1
  394. package/package.json +12 -9
  395. package/dist/coverage-gate.d.ts +0 -128
  396. package/dist/coverage-gate.d.ts.map +0 -1
  397. package/dist/coverage-gate.js +0 -211
  398. package/dist/coverage-gate.js.map +0 -1
  399. package/dist/gates-agent-mode.d.ts +0 -108
  400. package/dist/gates-agent-mode.d.ts.map +0 -1
  401. package/dist/gates-agent-mode.js +0 -138
  402. package/dist/gates-agent-mode.js.map +0 -1
  403. package/dist/gates-config-internal.d.ts +0 -54
  404. package/dist/gates-config-internal.d.ts.map +0 -1
  405. package/dist/gates-config-internal.js +0 -107
  406. package/dist/gates-config-internal.js.map +0 -1
  407. package/dist/gates-config.d.ts +0 -68
  408. package/dist/gates-config.d.ts.map +0 -1
  409. package/dist/gates-config.js +0 -193
  410. package/dist/gates-config.js.map +0 -1
  411. package/dist/gates-coverage.d.ts +0 -42
  412. package/dist/gates-coverage.d.ts.map +0 -1
  413. package/dist/gates-coverage.js +0 -162
  414. package/dist/gates-coverage.js.map +0 -1
  415. package/dist/gates-presets.d.ts +0 -52
  416. package/dist/gates-presets.d.ts.map +0 -1
  417. package/dist/gates-presets.js +0 -117
  418. package/dist/gates-presets.js.map +0 -1
  419. package/dist/gates-schemas.d.ts +0 -143
  420. package/dist/gates-schemas.d.ts.map +0 -1
  421. package/dist/gates-schemas.js +0 -67
  422. package/dist/gates-schemas.js.map +0 -1
  423. package/dist/package-manager-resolver.d.ts +0 -80
  424. package/dist/package-manager-resolver.d.ts.map +0 -1
  425. package/dist/package-manager-resolver.js +0 -245
  426. package/dist/package-manager-resolver.js.map +0 -1
  427. package/dist/resolve-policy.d.ts +0 -293
  428. package/dist/resolve-policy.d.ts.map +0 -1
  429. package/dist/resolve-policy.js +0 -303
  430. package/dist/resolve-policy.js.map +0 -1
@@ -1,211 +0,0 @@
1
- #!/usr/bin/env node
2
- // Copyright (c) 2026 Hellmai Ltd
3
- // SPDX-License-Identifier: AGPL-3.0-only
4
- /**
5
- * Coverage Gate for Quality Gates
6
- *
7
- * WU-1433: Adds coverage checking to gates with configurable mode (warn/block).
8
- * Enforces ≥90% coverage on hex core files (application layer).
9
- *
10
- * Mode flag allows gradual rollout:
11
- * - warn: Log failures but don't block (default)
12
- * - block: Fail the gate if thresholds not met
13
- *
14
- * @see {@link packages/@lumenflow/cli/src/gates.ts} - Integration point
15
- * @see {@link vitest.config.ts} - Coverage thresholds
16
- */
17
- /* eslint-disable security/detect-non-literal-fs-filename, security/detect-object-injection */
18
- import { readFileSync, existsSync } from 'node:fs';
19
- import { EMOJI, STRING_LITERALS } from './wu-constants.js';
20
- import { DEFAULT_MIN_COVERAGE } from './constants/gate-constants.js';
21
- /**
22
- * Coverage gate modes
23
- * @constant
24
- */
25
- export const COVERAGE_GATE_MODES = Object.freeze({
26
- /** Log warnings but don't fail the gate */
27
- WARN: 'warn',
28
- /** Fail the gate if thresholds not met */
29
- BLOCK: 'block',
30
- });
31
- /**
32
- * Glob patterns for hex core files that require ≥90% coverage.
33
- * These are the critical application layer files.
34
- *
35
- * WU-1068: Changed from @exampleapp to @lumenflow for framework reusability.
36
- * Project-specific patterns should be configured in workspace.yaml.
37
- *
38
- * @constant {string[]}
39
- */
40
- export const HEX_CORE_PATTERNS = Object.freeze([
41
- 'packages/@lumenflow/core/',
42
- 'packages/@lumenflow/cli/',
43
- ]);
44
- /**
45
- * Default coverage threshold for hex core files (percentage)
46
- * WU-1262: Kept for backwards compatibility.
47
- * WU-2044: Now delegates to DEFAULT_MIN_COVERAGE from gate-constants.ts (DRY).
48
- * The actual threshold is determined by resolveCoverageConfig() based on methodology.
49
- * @constant {number}
50
- */
51
- export const COVERAGE_THRESHOLD = DEFAULT_MIN_COVERAGE;
52
- /**
53
- * Default path to coverage summary JSON
54
- * @constant {string}
55
- */
56
- export const DEFAULT_COVERAGE_PATH = 'coverage/coverage-summary.json';
57
- /**
58
- * Check if a file path is in the hex core layer.
59
- *
60
- * WU-2448: Coverage reporters may emit absolute paths (e.g., <repo-root>/packages/...)
61
- * or file:// URLs; use substring matching so hex-core checks still apply.
62
- *
63
- * @param {string|null|undefined} filePath - File path to check
64
- * @returns {boolean} True if file is in hex core layer
65
- */
66
- export function isHexCoreFile(filePath) {
67
- if (!filePath || typeof filePath !== 'string') {
68
- return false;
69
- }
70
- // Normalize backslashes to forward slashes for cross-platform compatibility
71
- const normalizedPath = filePath.replace(/\\/g, '/');
72
- return HEX_CORE_PATTERNS.some((pattern) => normalizedPath.includes(pattern));
73
- }
74
- /**
75
- * Parse coverage JSON file.
76
- *
77
- * @param {string} coveragePath - Path to coverage-summary.json
78
- * @returns {object|null} Parsed coverage data or null if invalid
79
- */
80
- export function parseCoverageJson(coveragePath) {
81
- if (!existsSync(coveragePath)) {
82
- return null;
83
- }
84
- try {
85
- const content = readFileSync(coveragePath, { encoding: 'utf-8' });
86
- const data = JSON.parse(content);
87
- // Transform to consistent format
88
- const files = {};
89
- for (const [key, value] of Object.entries(data)) {
90
- if (key === 'total')
91
- continue;
92
- files[key] = value;
93
- }
94
- return {
95
- total: data.total,
96
- files,
97
- };
98
- }
99
- catch {
100
- return null;
101
- }
102
- }
103
- /**
104
- * Check if coverage meets thresholds for hex core files.
105
- *
106
- * @param {object|null} coverageData - Parsed coverage data
107
- * @param {number} [threshold] - Coverage threshold to use (defaults to COVERAGE_THRESHOLD)
108
- * @returns {{ pass: boolean, failures: Array<{ file: string, actual: number, threshold: number, metric: string }> }}
109
- */
110
- export function checkCoverageThresholds(coverageData, threshold) {
111
- if (!coverageData || !coverageData.files) {
112
- return { pass: true, failures: [] };
113
- }
114
- // WU-1262: Use provided threshold or fall back to constant
115
- const effectiveThreshold = threshold ?? COVERAGE_THRESHOLD;
116
- const failures = [];
117
- for (const [file, metricsValue] of Object.entries(coverageData.files)) {
118
- if (!isHexCoreFile(file)) {
119
- continue;
120
- }
121
- // Check lines coverage (primary metric)
122
- const metrics = metricsValue;
123
- const linesCoverage = metrics.lines?.pct ?? 0;
124
- if (linesCoverage < effectiveThreshold) {
125
- failures.push({
126
- file,
127
- actual: linesCoverage,
128
- threshold: effectiveThreshold,
129
- metric: 'lines',
130
- });
131
- }
132
- }
133
- return {
134
- pass: failures.length === 0,
135
- failures,
136
- };
137
- }
138
- /**
139
- * Format coverage data for display.
140
- *
141
- * @param {object|null} coverageData - Parsed coverage data
142
- * @returns {string} Formatted output string
143
- */
144
- export function formatCoverageDelta(coverageData) {
145
- if (!coverageData) {
146
- return '';
147
- }
148
- const lines = [];
149
- const totalPct = coverageData.total?.lines?.pct ?? 0;
150
- lines.push(`${STRING_LITERALS.NEWLINE}Coverage Summary: ${totalPct.toFixed(1)}% lines${STRING_LITERALS.NEWLINE}`);
151
- // Show hex core files
152
- const hexCoreFiles = Object.entries(coverageData.files || {}).filter(([file]) => isHexCoreFile(file));
153
- if (hexCoreFiles.length > 0) {
154
- lines.push('Hex Core Files:');
155
- for (const [file, metricsValue] of hexCoreFiles) {
156
- const metrics = metricsValue;
157
- const pct = metrics.lines?.pct ?? 0;
158
- const status = pct >= COVERAGE_THRESHOLD ? EMOJI.SUCCESS : EMOJI.FAILURE;
159
- const shortFile = file.replace('packages/@lumenflow/', '');
160
- lines.push(` ${status} ${shortFile}: ${pct.toFixed(1)}%`);
161
- }
162
- }
163
- return lines.join(STRING_LITERALS.NEWLINE);
164
- }
165
- /**
166
- * Run coverage gate.
167
- *
168
- * @param {CoverageGateOptions} options - Gate options
169
- * @returns {Promise<{ ok: boolean, mode: string, duration: number, message: string }>}
170
- */
171
- export async function runCoverageGate(options = {}) {
172
- const start = Date.now();
173
- const mode = options.mode || COVERAGE_GATE_MODES.WARN;
174
- const coveragePath = options.coveragePath || DEFAULT_COVERAGE_PATH;
175
- const logger = options.logger && typeof options.logger.log === 'function' ? options.logger : console;
176
- // WU-1262: Use provided threshold or default constant
177
- const threshold = options.threshold ?? COVERAGE_THRESHOLD;
178
- // Parse coverage data
179
- const coverageData = parseCoverageJson(coveragePath);
180
- if (!coverageData) {
181
- const duration = Date.now() - start;
182
- logger.log(`\n${EMOJI.WARNING} Coverage gate: No coverage data found at ${coveragePath}`);
183
- logger.log(' Run tests with coverage first: pnpm test:coverage\n');
184
- return { ok: true, mode, duration, message: 'No coverage data' };
185
- }
186
- // Check thresholds (WU-1262: pass resolved threshold)
187
- const { pass, failures } = checkCoverageThresholds(coverageData, threshold);
188
- // Format and display
189
- const output = formatCoverageDelta(coverageData);
190
- logger.log(output);
191
- const duration = Date.now() - start;
192
- if (!pass) {
193
- logger.log(`\n${EMOJI.FAILURE} Coverage below ${threshold}% for hex core files:`);
194
- for (const failure of failures) {
195
- const shortFile = failure.file.replace('packages/@lumenflow/', '');
196
- logger.log(` - ${shortFile}: ${failure.actual.toFixed(1)}% (requires ${failure.threshold}%)`);
197
- }
198
- if (mode === COVERAGE_GATE_MODES.BLOCK) {
199
- logger.log(`\n${EMOJI.FAILURE} Coverage gate FAILED (mode: block)\n`);
200
- return { ok: false, mode, duration, message: 'Coverage threshold not met' };
201
- }
202
- else {
203
- logger.log(`\n${EMOJI.WARNING} Coverage gate WARNING (mode: warn)\n`);
204
- logger.log(' Note: This will become blocking in future. Fix coverage now.\n');
205
- return { ok: true, mode, duration, message: 'Coverage warning' };
206
- }
207
- }
208
- logger.log(`\n${EMOJI.SUCCESS} Coverage gate passed\n`);
209
- return { ok: true, mode, duration, message: 'Coverage OK' };
210
- }
211
- //# sourceMappingURL=coverage-gate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coverage-gate.js","sourceRoot":"","sources":["../src/coverage-gate.ts"],"names":[],"mappings":";AACA,iCAAiC;AACjC,yCAAyC;AACzC;;;;;;;;;;;;GAYG;AAEH,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K,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;IACxD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;AAC9D,CAAC"}
@@ -1,108 +0,0 @@
1
- /// <reference path="./types.d.ts" />
2
- /**
3
- * Options for agent mode detection
4
- */
5
- interface GatesAgentModeOptions {
6
- /** Command line arguments */
7
- argv?: string[];
8
- /** Environment variables */
9
- env?: Record<string, string | undefined>;
10
- /** stdout stream */
11
- stdout?: {
12
- isTTY?: boolean;
13
- };
14
- }
15
- /**
16
- * Options for log path functions
17
- */
18
- interface GatesLogOptions {
19
- /** Working directory */
20
- cwd: string;
21
- /** Environment variables */
22
- env?: Record<string, string | undefined>;
23
- }
24
- /**
25
- * Options for building gate log path
26
- */
27
- interface BuildGatesLogPathOptions extends GatesLogOptions {
28
- /** WU ID */
29
- wuId?: string;
30
- /** Lane name */
31
- lane?: string;
32
- /** Current timestamp */
33
- now?: Date;
34
- }
35
- /**
36
- * Options for updating symlink
37
- */
38
- interface UpdateGatesLatestSymlinkOptions extends GatesLogOptions {
39
- /** Path to the actual gate log file */
40
- logPath: string;
41
- }
42
- /**
43
- * Determine whether gates should run in low-noise "agent mode".
44
- *
45
- * Agent mode is intended for Claude Code sessions, where tool output is injected into the
46
- * conversation context and can trigger "prompt too long".
47
- *
48
- * Detection strategy (WU-1827):
49
- * 1. --verbose flag always forces full output (returns false)
50
- * 2. CLAUDE_PROJECT_DIR env var is a strong hint (returns true if set)
51
- * 3. TTY check: non-TTY + non-CI = likely agent mode (returns true)
52
- * 4. Interactive TTY = human user (returns false)
53
- *
54
- * @param {GatesAgentModeOptions} options
55
- * @returns {boolean} True if gates should run in agent mode
56
- */
57
- export declare function shouldUseGatesAgentMode({ argv, env, stdout }?: GatesAgentModeOptions): boolean;
58
- export declare function getGatesLogDir({ cwd, env }: GatesLogOptions): string;
59
- export declare function buildGatesLogPath({ cwd, env, wuId, lane, now, }: BuildGatesLogPathOptions): string;
60
- /**
61
- * Get the path to the gates-latest.log symlink (WU-2064)
62
- *
63
- * @param {Object} options
64
- * @param {string} options.cwd - Working directory
65
- * @param {Object} [options.env] - Environment variables
66
- * @returns {string} Path to the symlink
67
- */
68
- export declare function getGatesLatestSymlinkPath({ cwd, env }: GatesLogOptions): string;
69
- /**
70
- * Create or update the gates-latest.log symlink to point to the most recent gate run (WU-2064)
71
- *
72
- * This provides a stable path for agents to access the most recent gate log
73
- * without needing to know the timestamp-based filename.
74
- *
75
- * @param {Object} options
76
- * @param {string} options.logPath - Path to the actual gate log file
77
- * @param {string} options.cwd - Working directory
78
- * @param {Object} [options.env] - Environment variables
79
- * @returns {boolean} True if symlink was created/updated successfully
80
- */
81
- export declare function updateGatesLatestSymlink({ logPath, cwd, env }: UpdateGatesLatestSymlinkOptions): boolean;
82
- export declare const WU_DONE_PRE_COMMIT_GATE_DECISION_REASONS: {
83
- readonly SKIP_GATES_FLAG: "skip-gates-flag";
84
- readonly REUSE_STEP_ZERO: "reuse-step-zero";
85
- readonly REUSE_CHECKPOINT: "reuse-checkpoint";
86
- readonly RUN_REQUIRED: "run-required";
87
- };
88
- export type WuDonePreCommitGateDecisionReason = (typeof WU_DONE_PRE_COMMIT_GATE_DECISION_REASONS)[keyof typeof WU_DONE_PRE_COMMIT_GATE_DECISION_REASONS];
89
- export interface WuDonePreCommitGateDecisionInput {
90
- skipGates: boolean;
91
- fullGatesRanInCurrentRun: boolean;
92
- skippedByCheckpoint: boolean;
93
- checkpointId?: string | null;
94
- }
95
- export interface WuDonePreCommitGateDecision {
96
- runPreCommitFullSuite: boolean;
97
- reason: WuDonePreCommitGateDecisionReason;
98
- message: string;
99
- }
100
- /**
101
- * Decide whether wu:done pre-flight hook validation should rerun full gates.
102
- *
103
- * WU-1659: Avoid duplicate full-suite execution when Step 0 already ran gates
104
- * (or reused a valid checkpoint), while keeping operator-visible reasoning.
105
- */
106
- export declare function resolveWuDonePreCommitGateDecision(input: WuDonePreCommitGateDecisionInput): WuDonePreCommitGateDecision;
107
- export {};
108
- //# sourceMappingURL=gates-agent-mode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gates-agent-mode.d.ts","sourceRoot":"","sources":["../src/gates-agent-mode.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,UAAU,qBAAqB;IAC7B,6BAA6B;IAC7B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,4BAA4B;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,oBAAoB;IACpB,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAC9B;AAED;;GAEG;AACH,UAAU,eAAe;IACvB,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,4BAA4B;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAC1C;AAED;;GAEG;AACH,UAAU,wBAAyB,SAAQ,eAAe;IACxD,YAAY;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ;AAED;;GAEG;AACH,UAAU,+BAAgC,SAAQ,eAAe;IAC/D,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,GAAE,qBAA0B,WA4BxF;AAED,wBAAgB,cAAc,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,eAAe,UAG3D;AAED,wBAAgB,iBAAiB,CAAC,EAChC,GAAG,EACH,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,GAAgB,GACjB,EAAE,wBAAwB,UAM1B;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,eAAe,UAGtE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,+BAA+B,WAmB9F;AAED,eAAO,MAAM,wCAAwC;;;;;CAK3C,CAAC;AAEX,MAAM,MAAM,iCAAiC,GAC3C,CAAC,OAAO,wCAAwC,CAAC,CAAC,MAAM,OAAO,wCAAwC,CAAC,CAAC;AAE3G,MAAM,WAAW,gCAAgC;IAC/C,SAAS,EAAE,OAAO,CAAC;IACnB,wBAAwB,EAAE,OAAO,CAAC;IAClC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,2BAA2B;IAC1C,qBAAqB,EAAE,OAAO,CAAC;IAC/B,MAAM,EAAE,iCAAiC,CAAC;IAC1C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,gCAAgC,GACtC,2BAA2B,CAiC7B"}
@@ -1,138 +0,0 @@
1
- // Copyright (c) 2026 Hellmai Ltd
2
- // SPDX-License-Identifier: AGPL-3.0-only
3
- import path from 'node:path';
4
- import { existsSync, unlinkSync, symlinkSync } from 'node:fs';
5
- /**
6
- * Determine whether gates should run in low-noise "agent mode".
7
- *
8
- * Agent mode is intended for Claude Code sessions, where tool output is injected into the
9
- * conversation context and can trigger "prompt too long".
10
- *
11
- * Detection strategy (WU-1827):
12
- * 1. --verbose flag always forces full output (returns false)
13
- * 2. CLAUDE_PROJECT_DIR env var is a strong hint (returns true if set)
14
- * 3. TTY check: non-TTY + non-CI = likely agent mode (returns true)
15
- * 4. Interactive TTY = human user (returns false)
16
- *
17
- * @param {GatesAgentModeOptions} options
18
- * @returns {boolean} True if gates should run in agent mode
19
- */
20
- export function shouldUseGatesAgentMode({ argv, env, stdout } = {}) {
21
- // --verbose flag always forces full output
22
- const isVerbose = Array.isArray(argv) && argv.includes('--verbose');
23
- if (isVerbose) {
24
- return false;
25
- }
26
- // CLAUDE_PROJECT_DIR is a strong hint that we're in Claude Code
27
- const hasClaudeProjectDir = Boolean(env?.CLAUDE_PROJECT_DIR);
28
- if (hasClaudeProjectDir) {
29
- return true;
30
- }
31
- // CI environments should get full output for debugging
32
- const isCI = Boolean(env?.CI);
33
- if (isCI) {
34
- return false;
35
- }
36
- // Use provided stdout or fall back to process.stdout
37
- const stdoutStream = stdout ?? process.stdout;
38
- // TTY check: non-TTY = likely agent mode (Claude Code Bash tool doesn't have TTY)
39
- // If stdout is undefined or isTTY is falsy, assume agent mode (safer default)
40
- const isTTY = stdoutStream?.isTTY ?? false;
41
- // Non-TTY + non-CI = likely agent mode
42
- return !isTTY;
43
- }
44
- export function getGatesLogDir({ cwd, env }) {
45
- const configured = env?.LUMENFLOW_LOG_DIR;
46
- return path.resolve(cwd, configured || '.logs');
47
- }
48
- export function buildGatesLogPath({ cwd, env, wuId, lane, now = new Date(), }) {
49
- const logDir = getGatesLogDir({ cwd, env });
50
- const safeLane = (lane || 'unknown').toLowerCase().replace(/[^a-z0-9]+/g, '-');
51
- const safeWu = (wuId || 'unknown').toLowerCase().replace(/[^a-z0-9]+/g, '-');
52
- const stamp = now.toISOString().replace(/[:.]/g, '-');
53
- return path.join(logDir, `gates-${safeLane}-${safeWu}-${stamp}.log`);
54
- }
55
- /**
56
- * Get the path to the gates-latest.log symlink (WU-2064)
57
- *
58
- * @param {Object} options
59
- * @param {string} options.cwd - Working directory
60
- * @param {Object} [options.env] - Environment variables
61
- * @returns {string} Path to the symlink
62
- */
63
- export function getGatesLatestSymlinkPath({ cwd, env }) {
64
- const logDir = getGatesLogDir({ cwd, env });
65
- return path.join(logDir, 'gates-latest.log');
66
- }
67
- /**
68
- * Create or update the gates-latest.log symlink to point to the most recent gate run (WU-2064)
69
- *
70
- * This provides a stable path for agents to access the most recent gate log
71
- * without needing to know the timestamp-based filename.
72
- *
73
- * @param {Object} options
74
- * @param {string} options.logPath - Path to the actual gate log file
75
- * @param {string} options.cwd - Working directory
76
- * @param {Object} [options.env] - Environment variables
77
- * @returns {boolean} True if symlink was created/updated successfully
78
- */
79
- export function updateGatesLatestSymlink({ logPath, cwd, env }) {
80
- const symlinkPath = getGatesLatestSymlinkPath({ cwd, env });
81
- try {
82
- // Remove existing symlink if present
83
- if (existsSync(symlinkPath)) {
84
- unlinkSync(symlinkPath);
85
- }
86
- // Create relative symlink (so it works regardless of absolute path)
87
- const logDir = path.dirname(symlinkPath);
88
- const relativePath = path.relative(logDir, logPath);
89
- symlinkSync(relativePath, symlinkPath);
90
- return true;
91
- }
92
- catch {
93
- // Symlink creation is best-effort, don't fail gates
94
- return false;
95
- }
96
- }
97
- export const WU_DONE_PRE_COMMIT_GATE_DECISION_REASONS = {
98
- SKIP_GATES_FLAG: 'skip-gates-flag',
99
- REUSE_STEP_ZERO: 'reuse-step-zero',
100
- REUSE_CHECKPOINT: 'reuse-checkpoint',
101
- RUN_REQUIRED: 'run-required',
102
- };
103
- /**
104
- * Decide whether wu:done pre-flight hook validation should rerun full gates.
105
- *
106
- * WU-1659: Avoid duplicate full-suite execution when Step 0 already ran gates
107
- * (or reused a valid checkpoint), while keeping operator-visible reasoning.
108
- */
109
- export function resolveWuDonePreCommitGateDecision(input) {
110
- if (input.skipGates) {
111
- return {
112
- runPreCommitFullSuite: false,
113
- reason: WU_DONE_PRE_COMMIT_GATE_DECISION_REASONS.SKIP_GATES_FLAG,
114
- message: 'Pre-flight hook validation skipped because --skip-gates is active.',
115
- };
116
- }
117
- if (input.fullGatesRanInCurrentRun) {
118
- return {
119
- runPreCommitFullSuite: false,
120
- reason: WU_DONE_PRE_COMMIT_GATE_DECISION_REASONS.REUSE_STEP_ZERO,
121
- message: 'Pre-flight hook validation reuses Step 0 gate results; duplicate full-suite run skipped.',
122
- };
123
- }
124
- if (input.skippedByCheckpoint) {
125
- const checkpointSuffix = input.checkpointId ? ` (${input.checkpointId})` : '';
126
- return {
127
- runPreCommitFullSuite: false,
128
- reason: WU_DONE_PRE_COMMIT_GATE_DECISION_REASONS.REUSE_CHECKPOINT,
129
- message: `Pre-flight hook validation reuses checkpoint gate attestation${checkpointSuffix}; duplicate full-suite run skipped.`,
130
- };
131
- }
132
- return {
133
- runPreCommitFullSuite: true,
134
- reason: WU_DONE_PRE_COMMIT_GATE_DECISION_REASONS.RUN_REQUIRED,
135
- message: 'No gate attestation found for this wu:done run; executing pre-flight hook gate suite.',
136
- };
137
- }
138
- //# sourceMappingURL=gates-agent-mode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gates-agent-mode.js","sourceRoot":"","sources":["../src/gates-agent-mode.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,yCAAyC;AAEzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AA4C9D;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,uBAAuB,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAA4B,EAAE;IACvF,2CAA2C;IAC3C,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IACpE,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gEAAgE;IAChE,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;IAC7D,IAAI,mBAAmB,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,uDAAuD;IACvD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC9B,IAAI,IAAI,EAAE,CAAC;QACT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,wCAAwC,CAAC,eAAe;YAChE,OAAO,EACL,0FAA0F;SAC7F,CAAC;IACJ,CAAC;IAED,IAAI,KAAK,CAAC,mBAAmB,EAAE,CAAC;QAC9B,MAAM,gBAAgB,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9E,OAAO;YACL,qBAAqB,EAAE,KAAK;YAC5B,MAAM,EAAE,wCAAwC,CAAC,gBAAgB;YACjE,OAAO,EAAE,gEAAgE,gBAAgB,qCAAqC;SAC/H,CAAC;IACJ,CAAC;IAED,OAAO;QACL,qBAAqB,EAAE,IAAI;QAC3B,MAAM,EAAE,wCAAwC,CAAC,YAAY;QAC7D,OAAO,EACL,uFAAuF;KAC1F,CAAC;AACJ,CAAC"}
@@ -1,54 +0,0 @@
1
- /// <reference path="./types.d.ts" />
2
- export declare const GATES_RUNTIME_DEFAULTS: {
3
- readonly COMMAND_TIMEOUT_MS: 120000;
4
- readonly MAX_ESLINT_WARNINGS: 100;
5
- readonly DEFAULT_MIN_COVERAGE: number;
6
- readonly DEFAULT_ENABLE_COVERAGE: true;
7
- readonly DEFAULT_PACKAGE_MANAGER: "pnpm";
8
- readonly DEFAULT_TEST_RUNNER: "vitest";
9
- };
10
- export declare const SOFTWARE_DELIVERY_FIELDS: {
11
- readonly GATES: "gates";
12
- readonly METHODOLOGY: "methodology";
13
- readonly PACKAGE_MANAGER: "package_manager";
14
- readonly PACKAGE_MANAGER_CAMEL: "packageManager";
15
- readonly TEST_RUNNER: "test_runner";
16
- readonly TEST_RUNNER_CAMEL: "testRunner";
17
- readonly BUILD_COMMAND: "build_command";
18
- readonly BUILD_COMMAND_CAMEL: "buildCommand";
19
- };
20
- export declare const GATES_FIELDS: {
21
- readonly EXECUTION: "execution";
22
- readonly LANE_HEALTH: "lane_health";
23
- readonly LANE_HEALTH_CAMEL: "laneHealth";
24
- readonly TDD_DIFF_EVIDENCE: "tdd_diff_evidence";
25
- readonly MIN_COVERAGE: "minCoverage";
26
- readonly MIN_COVERAGE_SNAKE: "min_coverage";
27
- readonly ENABLE_COVERAGE: "enableCoverage";
28
- readonly ENABLE_COVERAGE_SNAKE: "enable_coverage";
29
- readonly COMMANDS: "commands";
30
- };
31
- export declare const GATES_COMMAND_FIELDS: {
32
- readonly TEST_FULL: "test_full";
33
- readonly TEST_DOCS_ONLY: "test_docs_only";
34
- readonly TEST_INCREMENTAL: "test_incremental";
35
- readonly LINT: "lint";
36
- readonly TYPECHECK: "typecheck";
37
- readonly FORMAT: "format";
38
- readonly MIGRATION_VERIFY: "migration_verify";
39
- };
40
- /**
41
- * Load the software_delivery section from workspace.yaml
42
- *
43
- * @param projectRoot - Project root directory
44
- * @returns Parsed software_delivery record, or null
45
- */
46
- export declare function loadSoftwareDeliveryConfig(projectRoot: string): Record<string, unknown> | null;
47
- /**
48
- * Load the gates sub-section from workspace.yaml software_delivery
49
- *
50
- * @param projectRoot - Project root directory
51
- * @returns Parsed gates record, or null
52
- */
53
- export declare function getGatesSection(projectRoot: string): Record<string, unknown> | null;
54
- //# sourceMappingURL=gates-config-internal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gates-config-internal.d.ts","sourceRoot":"","sources":["../src/gates-config-internal.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,sBAAsB;;;;;;;CAOzB,CAAC;AAQX,eAAO,MAAM,wBAAwB;;;;;;;;;CAS3B,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;;;;;;CAUf,CAAC;AAEX,eAAO,MAAM,oBAAoB;;;;;;;;CAQvB,CAAC;AAMX;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAiB9F;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAMnF"}
@@ -1,107 +0,0 @@
1
- // Copyright (c) 2026 Hellmai Ltd
2
- // SPDX-License-Identifier: AGPL-3.0-only
3
- /**
4
- * Gates Configuration Internals
5
- *
6
- * WU-2037: Shared infrastructure for gates modules
7
- *
8
- * Contains runtime defaults, field-name constants, and config-loading helpers
9
- * used by gates-config.ts, gates-coverage.ts, and package-manager-resolver.ts.
10
- *
11
- * This module exists to break circular imports between the facade (gates-config.ts)
12
- * and its extracted sub-modules.
13
- *
14
- * @module gates-config-internal
15
- */
16
- import * as fs from 'node:fs';
17
- import * as path from 'node:path';
18
- import * as yaml from 'yaml';
19
- import { WORKSPACE_CONFIG_FILE_NAME, WORKSPACE_V2_KEYS } from './config-contract.js';
20
- import { asRecord } from './object-guards.js';
21
- import { getDefaultPolicy } from './resolve-policy.js';
22
- // ---------------------------------------------------------------------------
23
- // Runtime defaults
24
- // ---------------------------------------------------------------------------
25
- const DEFAULT_POLICY = getDefaultPolicy();
26
- export const GATES_RUNTIME_DEFAULTS = {
27
- COMMAND_TIMEOUT_MS: 120000,
28
- MAX_ESLINT_WARNINGS: 100,
29
- DEFAULT_MIN_COVERAGE: DEFAULT_POLICY.coverage_threshold,
30
- DEFAULT_ENABLE_COVERAGE: true,
31
- DEFAULT_PACKAGE_MANAGER: 'pnpm',
32
- DEFAULT_TEST_RUNNER: 'vitest',
33
- };
34
- // ---------------------------------------------------------------------------
35
- // Field-name constants (avoid magic strings across modules)
36
- // ---------------------------------------------------------------------------
37
- const SOFTWARE_DELIVERY_KEY = WORKSPACE_V2_KEYS.SOFTWARE_DELIVERY;
38
- export const SOFTWARE_DELIVERY_FIELDS = {
39
- GATES: 'gates',
40
- METHODOLOGY: 'methodology',
41
- PACKAGE_MANAGER: 'package_manager',
42
- PACKAGE_MANAGER_CAMEL: 'packageManager',
43
- TEST_RUNNER: 'test_runner',
44
- TEST_RUNNER_CAMEL: 'testRunner',
45
- BUILD_COMMAND: 'build_command',
46
- BUILD_COMMAND_CAMEL: 'buildCommand',
47
- };
48
- export const GATES_FIELDS = {
49
- EXECUTION: 'execution',
50
- LANE_HEALTH: 'lane_health',
51
- LANE_HEALTH_CAMEL: 'laneHealth',
52
- TDD_DIFF_EVIDENCE: 'tdd_diff_evidence',
53
- MIN_COVERAGE: 'minCoverage',
54
- MIN_COVERAGE_SNAKE: 'min_coverage',
55
- ENABLE_COVERAGE: 'enableCoverage',
56
- ENABLE_COVERAGE_SNAKE: 'enable_coverage',
57
- COMMANDS: 'commands',
58
- };
59
- export const GATES_COMMAND_FIELDS = {
60
- TEST_FULL: 'test_full',
61
- TEST_DOCS_ONLY: 'test_docs_only',
62
- TEST_INCREMENTAL: 'test_incremental',
63
- LINT: 'lint',
64
- TYPECHECK: 'typecheck',
65
- FORMAT: 'format',
66
- MIGRATION_VERIFY: 'migration_verify',
67
- };
68
- // ---------------------------------------------------------------------------
69
- // Config loading helpers
70
- // ---------------------------------------------------------------------------
71
- /**
72
- * Load the software_delivery section from workspace.yaml
73
- *
74
- * @param projectRoot - Project root directory
75
- * @returns Parsed software_delivery record, or null
76
- */
77
- export function loadSoftwareDeliveryConfig(projectRoot) {
78
- const configPath = path.join(projectRoot, WORKSPACE_CONFIG_FILE_NAME);
79
- if (!fs.existsSync(configPath)) {
80
- return null;
81
- }
82
- try {
83
- const content = fs.readFileSync(configPath, 'utf8');
84
- const data = asRecord(yaml.parse(content));
85
- if (!data) {
86
- return null;
87
- }
88
- return asRecord(data[SOFTWARE_DELIVERY_KEY]);
89
- }
90
- catch {
91
- return null;
92
- }
93
- }
94
- /**
95
- * Load the gates sub-section from workspace.yaml software_delivery
96
- *
97
- * @param projectRoot - Project root directory
98
- * @returns Parsed gates record, or null
99
- */
100
- export function getGatesSection(projectRoot) {
101
- const softwareDelivery = loadSoftwareDeliveryConfig(projectRoot);
102
- if (!softwareDelivery) {
103
- return null;
104
- }
105
- return asRecord(softwareDelivery[SOFTWARE_DELIVERY_FIELDS.GATES]);
106
- }
107
- //# sourceMappingURL=gates-config-internal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gates-config-internal.js","sourceRoot":"","sources":["../src/gates-config-internal.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,yCAAyC;AAEzC;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,MAAM,cAAc,GAAG,gBAAgB,EAAE,CAAC;AAE1C,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,kBAAkB,EAAE,MAAM;IAC1B,mBAAmB,EAAE,GAAG;IACxB,oBAAoB,EAAE,cAAc,CAAC,kBAAkB;IACvD,uBAAuB,EAAE,IAAI;IAC7B,uBAAuB,EAAE,MAAM;IAC/B,mBAAmB,EAAE,QAAQ;CACrB,CAAC;AAEX,8EAA8E;AAC9E,4DAA4D;AAC5D,8EAA8E;AAE9E,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,iBAAiB,CAAC;AAElE,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,eAAe,EAAE,iBAAiB;IAClC,qBAAqB,EAAE,gBAAgB;IACvC,WAAW,EAAE,aAAa;IAC1B,iBAAiB,EAAE,YAAY;IAC/B,aAAa,EAAE,eAAe;IAC9B,mBAAmB,EAAE,cAAc;CAC3B,CAAC;AAEX,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS,EAAE,WAAW;IACtB,WAAW,EA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