@unbrained/pm-cli 2026.6.30 → 2026.7.2

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 (628) hide show
  1. package/AGENTS.md +2 -0
  2. package/CHANGELOG.md +26 -0
  3. package/dist/cli/bootstrap-args.js +89 -79
  4. package/dist/cli/bootstrap-args.js.map +1 -1
  5. package/dist/cli/commander-usage.d.ts +2 -0
  6. package/dist/cli/commander-usage.js +58 -47
  7. package/dist/cli/commander-usage.js.map +1 -1
  8. package/dist/cli/commands/aggregate.js +102 -79
  9. package/dist/cli/commands/aggregate.js.map +1 -1
  10. package/dist/cli/commands/calendar.js +339 -303
  11. package/dist/cli/commands/calendar.js.map +1 -1
  12. package/dist/cli/commands/close-many.js +89 -68
  13. package/dist/cli/commands/close-many.js.map +1 -1
  14. package/dist/cli/commands/close.js +157 -129
  15. package/dist/cli/commands/close.js.map +1 -1
  16. package/dist/cli/commands/comments-audit.js +50 -42
  17. package/dist/cli/commands/comments-audit.js.map +1 -1
  18. package/dist/cli/commands/config.d.ts +2 -0
  19. package/dist/cli/commands/config.js +443 -879
  20. package/dist/cli/commands/config.js.map +1 -1
  21. package/dist/cli/commands/context.js +365 -287
  22. package/dist/cli/commands/context.js.map +1 -1
  23. package/dist/cli/commands/contracts.js +352 -238
  24. package/dist/cli/commands/contracts.js.map +1 -1
  25. package/dist/cli/commands/create.js +483 -434
  26. package/dist/cli/commands/create.js.map +1 -1
  27. package/dist/cli/commands/dedupe-audit.js +46 -39
  28. package/dist/cli/commands/dedupe-audit.js.map +1 -1
  29. package/dist/cli/commands/dedupe-merge.js +88 -69
  30. package/dist/cli/commands/dedupe-merge.js.map +1 -1
  31. package/dist/cli/commands/extension/bundled-catalog.js +59 -46
  32. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  33. package/dist/cli/commands/extension/doctor.js +129 -78
  34. package/dist/cli/commands/extension/doctor.js.map +1 -1
  35. package/dist/cli/commands/extension/managed-state.js +101 -57
  36. package/dist/cli/commands/extension/managed-state.js.map +1 -1
  37. package/dist/cli/commands/extension/scaffold.d.ts +7 -0
  38. package/dist/cli/commands/extension/scaffold.js +214 -186
  39. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  40. package/dist/cli/commands/extension.d.ts +6 -1
  41. package/dist/cli/commands/extension.js +1034 -902
  42. package/dist/cli/commands/extension.js.map +1 -1
  43. package/dist/cli/commands/get.js +114 -81
  44. package/dist/cli/commands/get.js.map +1 -1
  45. package/dist/cli/commands/health.d.ts +17 -0
  46. package/dist/cli/commands/health.js +446 -307
  47. package/dist/cli/commands/health.js.map +1 -1
  48. package/dist/cli/commands/history-compact.js +209 -140
  49. package/dist/cli/commands/history-compact.js.map +1 -1
  50. package/dist/cli/commands/history-redact.js +162 -119
  51. package/dist/cli/commands/history-redact.js.map +1 -1
  52. package/dist/cli/commands/history-repair.js +120 -85
  53. package/dist/cli/commands/history-repair.js.map +1 -1
  54. package/dist/cli/commands/init.d.ts +8 -2
  55. package/dist/cli/commands/init.js +263 -162
  56. package/dist/cli/commands/init.js.map +1 -1
  57. package/dist/cli/commands/list-filter-shared.js +55 -48
  58. package/dist/cli/commands/list-filter-shared.js.map +1 -1
  59. package/dist/cli/commands/list.js +152 -102
  60. package/dist/cli/commands/list.js.map +1 -1
  61. package/dist/cli/commands/next.js +49 -32
  62. package/dist/cli/commands/next.js.map +1 -1
  63. package/dist/cli/commands/plan.js +373 -298
  64. package/dist/cli/commands/plan.js.map +1 -1
  65. package/dist/cli/commands/recurrence-parsers.js +43 -25
  66. package/dist/cli/commands/recurrence-parsers.js.map +1 -1
  67. package/dist/cli/commands/reindex.d.ts +21 -5
  68. package/dist/cli/commands/reindex.js +345 -205
  69. package/dist/cli/commands/reindex.js.map +1 -1
  70. package/dist/cli/commands/restore.d.ts +8 -7
  71. package/dist/cli/commands/restore.js +105 -69
  72. package/dist/cli/commands/restore.js.map +1 -1
  73. package/dist/cli/commands/schema.js +33 -30
  74. package/dist/cli/commands/schema.js.map +1 -1
  75. package/dist/cli/commands/search.d.ts +10 -2
  76. package/dist/cli/commands/search.js +595 -536
  77. package/dist/cli/commands/search.js.map +1 -1
  78. package/dist/cli/commands/telemetry.js +98 -87
  79. package/dist/cli/commands/telemetry.js.map +1 -1
  80. package/dist/cli/commands/test-all.js +237 -168
  81. package/dist/cli/commands/test-all.js.map +1 -1
  82. package/dist/cli/commands/test.d.ts +6 -5
  83. package/dist/cli/commands/test.js +530 -464
  84. package/dist/cli/commands/test.js.map +1 -1
  85. package/dist/cli/commands/update-many.js +57 -42
  86. package/dist/cli/commands/update-many.js.map +1 -1
  87. package/dist/cli/commands/update.d.ts +1 -1
  88. package/dist/cli/commands/update.js +764 -747
  89. package/dist/cli/commands/update.js.map +1 -1
  90. package/dist/cli/commands/validate.d.ts +18 -1
  91. package/dist/cli/commands/validate.js +466 -343
  92. package/dist/cli/commands/validate.js.map +1 -1
  93. package/dist/cli/error-guidance.js +399 -357
  94. package/dist/cli/error-guidance.js.map +1 -1
  95. package/dist/cli/extension-command-options.js +48 -21
  96. package/dist/cli/extension-command-options.js.map +1 -1
  97. package/dist/cli/main.d.ts +47 -0
  98. package/dist/cli/main.js +428 -341
  99. package/dist/cli/main.js.map +1 -1
  100. package/dist/cli/migration-gates.js +22 -45
  101. package/dist/cli/migration-gates.js.map +1 -1
  102. package/dist/cli/register-list-query.js +94 -105
  103. package/dist/cli/register-list-query.js.map +1 -1
  104. package/dist/cli/register-mutation.js +400 -416
  105. package/dist/cli/register-mutation.js.map +1 -1
  106. package/dist/cli/register-operations.js +86 -66
  107. package/dist/cli/register-operations.js.map +1 -1
  108. package/dist/cli/register-setup.js +120 -101
  109. package/dist/cli/register-setup.js.map +1 -1
  110. package/dist/cli/registration-helpers.js +117 -122
  111. package/dist/cli/registration-helpers.js.map +1 -1
  112. package/dist/cli-bundle/chunks/{activity-MVSEND6D.js → activity-CUC4JY3U.js} +9 -9
  113. package/dist/cli-bundle/chunks/activity-WEIEMM73.js +16 -0
  114. package/dist/cli-bundle/chunks/{aggregate-MOC4TR2G.js → aggregate-DKUTRY6R.js} +109 -85
  115. package/dist/cli-bundle/chunks/aggregate-DKUTRY6R.js.map +1 -0
  116. package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js → aggregate-SW5PNGCS.js} +108 -84
  117. package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js.map → aggregate-SW5PNGCS.js.map} +2 -2
  118. package/dist/cli-bundle/chunks/{append-KDHT4GHI.js → append-H32VOR2Y.js} +6 -6
  119. package/dist/cli-bundle/chunks/{append-LEDBAM3K.js → append-UBM632FK.js} +6 -6
  120. package/dist/cli-bundle/chunks/{chunk-Z55WX4IQ.js → chunk-2227673O.js} +158 -114
  121. package/dist/cli-bundle/chunks/chunk-2227673O.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js → chunk-2ASNV4DH.js} +4 -4
  123. package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js → chunk-2CHRYUXL.js} +2 -2
  124. package/dist/cli-bundle/chunks/{chunk-QE5UFCCO.js → chunk-2KWL5NPW.js} +42 -27
  125. package/dist/cli-bundle/chunks/chunk-2KWL5NPW.js.map +1 -0
  126. package/dist/cli-bundle/chunks/{chunk-ZEATCVAC.js → chunk-36UGKF4O.js} +21 -29
  127. package/dist/cli-bundle/chunks/chunk-36UGKF4O.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-JZG5ADVE.js → chunk-3AZUFQK6.js} +1103 -963
  129. package/dist/cli-bundle/chunks/chunk-3AZUFQK6.js.map +1 -0
  130. package/dist/cli-bundle/chunks/{chunk-DRPF274X.js → chunk-3LCUASYG.js} +2 -2
  131. package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js → chunk-3Q2HBMTI.js} +2 -2
  132. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +87 -0
  133. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +7 -0
  134. package/dist/cli-bundle/chunks/{chunk-GF7EAR22.js → chunk-4NUOWFBT.js} +109 -72
  135. package/dist/cli-bundle/chunks/chunk-4NUOWFBT.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js → chunk-55XRYWEG.js} +6 -6
  137. package/dist/cli-bundle/chunks/{chunk-5IRVSKPS.js → chunk-5GVTFFTC.js} +150 -224
  138. package/dist/cli-bundle/chunks/chunk-5GVTFFTC.js.map +1 -0
  139. package/dist/cli-bundle/chunks/{chunk-CHRNYKNI.js → chunk-5PGBHRY3.js} +41 -26
  140. package/dist/cli-bundle/chunks/chunk-5PGBHRY3.js.map +7 -0
  141. package/dist/cli-bundle/chunks/{chunk-53ARXF2O.js → chunk-66Z3X7ZG.js} +261 -161
  142. package/dist/cli-bundle/chunks/chunk-66Z3X7ZG.js.map +7 -0
  143. package/dist/cli-bundle/chunks/{chunk-A3UNLXNJ.js → chunk-6ITZLD4T.js} +738 -688
  144. package/dist/cli-bundle/chunks/chunk-6ITZLD4T.js.map +7 -0
  145. package/dist/cli-bundle/chunks/{chunk-JTRKME24.js → chunk-6YCYF2AI.js} +262 -162
  146. package/dist/cli-bundle/chunks/chunk-6YCYF2AI.js.map +1 -0
  147. package/dist/cli-bundle/chunks/{chunk-RM6MHL6A.js → chunk-6ZMBJRDJ.js} +580 -467
  148. package/dist/cli-bundle/chunks/chunk-6ZMBJRDJ.js.map +7 -0
  149. package/dist/cli-bundle/chunks/{chunk-RPRW26NG.js → chunk-7MYWF4ZX.js} +110 -73
  150. package/dist/cli-bundle/chunks/chunk-7MYWF4ZX.js.map +1 -0
  151. package/dist/cli-bundle/chunks/{chunk-SNUK7H5J.js → chunk-7NSPKJUS.js} +716 -606
  152. package/dist/cli-bundle/chunks/chunk-7NSPKJUS.js.map +7 -0
  153. package/dist/cli-bundle/chunks/{chunk-KYDYQMNW.js → chunk-7TH5NMVB.js} +95 -53
  154. package/dist/cli-bundle/chunks/chunk-7TH5NMVB.js.map +7 -0
  155. package/dist/cli-bundle/chunks/{chunk-VD3LKZFX.js → chunk-7W4H4K26.js} +739 -689
  156. package/dist/cli-bundle/chunks/chunk-7W4H4K26.js.map +1 -0
  157. package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js → chunk-A6VOGKBA.js} +6 -6
  158. package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js → chunk-AIAIXG7I.js} +2 -2
  159. package/dist/cli-bundle/chunks/{chunk-NIBP3I7A.js → chunk-AJEBCRIY.js} +128 -126
  160. package/dist/cli-bundle/chunks/chunk-AJEBCRIY.js.map +1 -0
  161. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js → chunk-B4O5S7I3.js} +79 -57
  162. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js.map → chunk-B4O5S7I3.js.map} +2 -2
  163. package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js → chunk-BTX5MIQF.js} +2 -2
  164. package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js +809 -0
  165. package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js.map +7 -0
  166. package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js → chunk-CYBDUHNO.js} +3 -3
  167. package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js → chunk-CZPVDLD2.js} +4 -4
  168. package/dist/cli-bundle/chunks/{chunk-FDEVKXC4.js → chunk-EMPGXBUF.js} +22 -30
  169. package/dist/cli-bundle/chunks/chunk-EMPGXBUF.js.map +1 -0
  170. package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js → chunk-EUKTMRN3.js} +2 -2
  171. package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js → chunk-FFOQHGNH.js} +6 -6
  172. package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js → chunk-GFMSLORL.js} +6 -6
  173. package/dist/cli-bundle/chunks/{chunk-IZQOJR2B.js → chunk-GRRG3MCT.js} +198 -189
  174. package/dist/cli-bundle/chunks/chunk-GRRG3MCT.js.map +7 -0
  175. package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js → chunk-H4GRLYJS.js} +3 -3
  176. package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js → chunk-HQTPRV4D.js} +6 -6
  177. package/dist/cli-bundle/chunks/{chunk-CY5IJMUM.js → chunk-I66WE2HE.js} +712 -602
  178. package/dist/cli-bundle/chunks/chunk-I66WE2HE.js.map +1 -0
  179. package/dist/cli-bundle/chunks/{chunk-ZFIEEDTJ.js → chunk-IEEJQCZ4.js} +509 -363
  180. package/dist/cli-bundle/chunks/chunk-IEEJQCZ4.js.map +7 -0
  181. package/dist/cli-bundle/chunks/{chunk-DU66JUGT.js → chunk-IG5JYZGU.js} +488 -420
  182. package/dist/cli-bundle/chunks/chunk-IG5JYZGU.js.map +7 -0
  183. package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js → chunk-JMK5GCK2.js} +2 -2
  184. package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js → chunk-JXAUVO6X.js} +258 -169
  185. package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js.map → chunk-JXAUVO6X.js.map} +2 -2
  186. package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js → chunk-K2VYLVX4.js} +2 -2
  187. package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js → chunk-KCO2EAN5.js} +3 -3
  188. package/dist/cli-bundle/chunks/{chunk-T7ZMQI4J.js → chunk-KIYCOJ63.js} +198 -189
  189. package/dist/cli-bundle/chunks/chunk-KIYCOJ63.js.map +1 -0
  190. package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js → chunk-KLXF7NCC.js} +2 -2
  191. package/dist/cli-bundle/chunks/{chunk-V3KLX7U7.js → chunk-KN3URLKS.js} +510 -364
  192. package/dist/cli-bundle/chunks/chunk-KN3URLKS.js.map +1 -0
  193. package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js → chunk-LRKMWUUV.js} +2 -2
  194. package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js → chunk-LTRAF2D7.js} +3 -3
  195. package/dist/cli-bundle/chunks/{chunk-5T6WPLRO.js → chunk-MNBPX5JS.js} +394 -354
  196. package/dist/cli-bundle/chunks/chunk-MNBPX5JS.js.map +7 -0
  197. package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js → chunk-MRD4T5LF.js} +2 -2
  198. package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js → chunk-N2JSWVWG.js} +4 -4
  199. package/dist/cli-bundle/chunks/{chunk-7WDETKGP.js → chunk-N3QCJS4M.js} +1105 -965
  200. package/dist/cli-bundle/chunks/chunk-N3QCJS4M.js.map +7 -0
  201. package/dist/cli-bundle/chunks/{chunk-KGQ3W65B.js → chunk-NRZS637N.js} +258 -169
  202. package/dist/cli-bundle/chunks/chunk-NRZS637N.js.map +1 -0
  203. package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js +799 -0
  204. package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js.map +1 -0
  205. package/dist/cli-bundle/chunks/{chunk-ZIE6WXJ2.js → chunk-Q6K2OACU.js} +153 -90
  206. package/dist/cli-bundle/chunks/chunk-Q6K2OACU.js.map +1 -0
  207. package/dist/cli-bundle/chunks/{chunk-K46GQ265.js → chunk-Q6NXOHS6.js} +489 -421
  208. package/dist/cli-bundle/chunks/chunk-Q6NXOHS6.js.map +1 -0
  209. package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js → chunk-QH3FSKRJ.js} +2 -2
  210. package/dist/cli-bundle/chunks/{chunk-UB3V5WUI.js → chunk-RM37OPYK.js} +394 -354
  211. package/dist/cli-bundle/chunks/chunk-RM37OPYK.js.map +1 -0
  212. package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js → chunk-S62UANU7.js} +3 -3
  213. package/dist/cli-bundle/chunks/{chunk-NO6Y6FB2.js → chunk-SPM2XLWI.js} +37 -28
  214. package/dist/cli-bundle/chunks/chunk-SPM2XLWI.js.map +7 -0
  215. package/dist/cli-bundle/chunks/{chunk-DORJSBGJ.js → chunk-SYNKD3ZG.js} +127 -125
  216. package/dist/cli-bundle/chunks/chunk-SYNKD3ZG.js.map +7 -0
  217. package/dist/cli-bundle/chunks/{chunk-6YRAMXRS.js → chunk-SYVUU7EK.js} +581 -468
  218. package/dist/cli-bundle/chunks/chunk-SYVUU7EK.js.map +1 -0
  219. package/dist/cli-bundle/chunks/{chunk-D5LYZVGB.js → chunk-TPOFWBMY.js} +95 -53
  220. package/dist/cli-bundle/chunks/chunk-TPOFWBMY.js.map +1 -0
  221. package/dist/cli-bundle/chunks/{chunk-IHXXUIXS.js → chunk-TTHCEV5Q.js} +92 -77
  222. package/dist/cli-bundle/chunks/chunk-TTHCEV5Q.js.map +1 -0
  223. package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js → chunk-U2BEEM2X.js} +3 -3
  224. package/dist/cli-bundle/chunks/{chunk-Z5BM2FKQ.js → chunk-UGLU6Q2I.js} +91 -76
  225. package/dist/cli-bundle/chunks/chunk-UGLU6Q2I.js.map +7 -0
  226. package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js → chunk-UT73HUPC.js} +3 -3
  227. package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js → chunk-UTSH5GWX.js} +4 -4
  228. package/dist/cli-bundle/chunks/{chunk-AWN4PPH5.js → chunk-UWKEJMZU.js} +157 -113
  229. package/dist/cli-bundle/chunks/chunk-UWKEJMZU.js.map +7 -0
  230. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +84 -0
  231. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +1 -0
  232. package/dist/cli-bundle/chunks/{chunk-KTMMTOIP.js → chunk-W47SML5B.js} +152 -89
  233. package/dist/cli-bundle/chunks/chunk-W47SML5B.js.map +7 -0
  234. package/dist/cli-bundle/chunks/{chunk-UFKNF23C.js → chunk-WJAMWAHZ.js} +157 -118
  235. package/dist/cli-bundle/chunks/chunk-WJAMWAHZ.js.map +7 -0
  236. package/dist/cli-bundle/chunks/{chunk-HIBK6H4S.js → chunk-XCHUVHKU.js} +685 -544
  237. package/dist/cli-bundle/chunks/chunk-XCHUVHKU.js.map +1 -0
  238. package/dist/cli-bundle/chunks/{chunk-DJDXAU74.js → chunk-XEWQKDYZ.js} +685 -544
  239. package/dist/cli-bundle/chunks/chunk-XEWQKDYZ.js.map +7 -0
  240. package/dist/cli-bundle/chunks/{chunk-BOWQWXLI.js → chunk-XTHQWXVC.js} +158 -119
  241. package/dist/cli-bundle/chunks/chunk-XTHQWXVC.js.map +1 -0
  242. package/dist/cli-bundle/chunks/{chunk-6T5ZIWBS.js → chunk-XWGEMNBR.js} +150 -224
  243. package/dist/cli-bundle/chunks/chunk-XWGEMNBR.js.map +7 -0
  244. package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js → chunk-Y4NRKBFW.js} +3 -3
  245. package/dist/cli-bundle/chunks/{chunk-WTRUDJ3R.js → chunk-YLZZ6T54.js} +38 -29
  246. package/dist/cli-bundle/chunks/chunk-YLZZ6T54.js.map +1 -0
  247. package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js → chunk-YPKFV2JR.js} +6 -6
  248. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js → chunk-Z4DGFQDH.js} +80 -58
  249. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js.map → chunk-Z4DGFQDH.js.map} +1 -1
  250. package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js → chunk-ZNHEYCDD.js} +2 -2
  251. package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js → chunk-ZNT7KEWE.js} +2 -2
  252. package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js → claim-SENTPZBN.js} +8 -8
  253. package/dist/cli-bundle/chunks/{claim-6NINZYB3.js → claim-Z7MEQCBT.js} +8 -8
  254. package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js → close-424MX4CU.js} +7 -7
  255. package/dist/cli-bundle/chunks/close-YCWQQPDS.js +14 -0
  256. package/dist/cli-bundle/chunks/{close-many-CXJBOWWY.js → close-many-2IV4J2TR.js} +103 -82
  257. package/dist/cli-bundle/chunks/close-many-2IV4J2TR.js.map +1 -0
  258. package/dist/cli-bundle/chunks/{close-many-BFMP6HHK.js → close-many-SWY34BII.js} +102 -81
  259. package/dist/cli-bundle/chunks/close-many-SWY34BII.js.map +7 -0
  260. package/dist/cli-bundle/chunks/{comments-ETHABIY6.js → comments-4FGNTSNV.js} +8 -8
  261. package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js → comments-7YS5MY5X.js} +8 -8
  262. package/dist/cli-bundle/chunks/config-BZJKK7FZ.js +1062 -0
  263. package/dist/cli-bundle/chunks/config-BZJKK7FZ.js.map +1 -0
  264. package/dist/cli-bundle/chunks/config-G74GISC4.js +1072 -0
  265. package/dist/cli-bundle/chunks/config-G74GISC4.js.map +7 -0
  266. package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js → context-LHVKJSPJ.js} +12 -12
  267. package/dist/cli-bundle/chunks/{context-XDI4DKKT.js → context-ZQY54JNS.js} +12 -12
  268. package/dist/cli-bundle/chunks/{contracts-SMOAN5NF.js → contracts-CP2EZJC7.js} +320 -199
  269. package/dist/cli-bundle/chunks/contracts-CP2EZJC7.js.map +7 -0
  270. package/dist/cli-bundle/chunks/{contracts-KP4QAGVW.js → contracts-FIZLMP7O.js} +321 -200
  271. package/dist/cli-bundle/chunks/contracts-FIZLMP7O.js.map +1 -0
  272. package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js → copy-GYNQQPW2.js} +5 -5
  273. package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js → copy-TLW7JTQT.js} +5 -5
  274. package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js → create-VSKYSOCD.js} +12 -12
  275. package/dist/cli-bundle/chunks/create-XTMAPS7I.js +28 -0
  276. package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js → delete-4W5JYCEG.js} +5 -5
  277. package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js → delete-ANTOTI2I.js} +5 -5
  278. package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js → deps-HPPE6MJN.js} +5 -5
  279. package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js → deps-ZQZN54EZ.js} +5 -5
  280. package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js → docs-RPOVFMP3.js} +7 -7
  281. package/dist/cli-bundle/chunks/{docs-2TIFR62T.js → docs-XJNYBJGE.js} +7 -7
  282. package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js → eval-DM6JBZTS.js} +10 -10
  283. package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js → eval-RFBI5FGS.js} +10 -10
  284. package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js → extension-B3YY4WY5.js} +11 -10
  285. package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js → extension-TTSEFQTS.js} +11 -10
  286. package/dist/cli-bundle/chunks/{files-DF3HO6XK.js → files-5D65CHGE.js} +7 -7
  287. package/dist/cli-bundle/chunks/{files-T5ODMETM.js → files-GPIG77EN.js} +7 -7
  288. package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js → focus-C3PEJV2C.js} +6 -6
  289. package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js → focus-ZHN7WIGX.js} +6 -6
  290. package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js → gc-D4JQ6OWN.js} +3 -3
  291. package/dist/cli-bundle/chunks/{gc-FULIVYR4.js → gc-VZIXDL32.js} +3 -3
  292. package/dist/cli-bundle/chunks/{get-VYPIICPC.js → get-GIBRUUOP.js} +121 -81
  293. package/dist/cli-bundle/chunks/get-GIBRUUOP.js.map +1 -0
  294. package/dist/cli-bundle/chunks/{get-AWK324RS.js → get-IOVAN6RU.js} +120 -80
  295. package/dist/cli-bundle/chunks/get-IOVAN6RU.js.map +7 -0
  296. package/dist/cli-bundle/chunks/{health-Q66C43GN.js → health-L2U3AFKV.js} +437 -264
  297. package/dist/cli-bundle/chunks/health-L2U3AFKV.js.map +1 -0
  298. package/dist/cli-bundle/chunks/{health-FBCVZGSX.js → health-MM7AWXYF.js} +436 -263
  299. package/dist/cli-bundle/chunks/health-MM7AWXYF.js.map +7 -0
  300. package/dist/cli-bundle/chunks/history-DD7L7BNL.js +18 -0
  301. package/dist/cli-bundle/chunks/{history-X4OSES6K.js → history-IL7XCEX2.js} +8 -8
  302. package/dist/cli-bundle/chunks/{history-compact-2GHT32UX.js → history-compact-HALOTOU7.js} +214 -135
  303. package/dist/cli-bundle/chunks/history-compact-HALOTOU7.js.map +1 -0
  304. package/dist/cli-bundle/chunks/{history-compact-WLCQEKXS.js → history-compact-MV25P7DM.js} +213 -134
  305. package/dist/cli-bundle/chunks/history-compact-MV25P7DM.js.map +7 -0
  306. package/dist/cli-bundle/chunks/history-redact-IX4YEWMY.js +19 -0
  307. package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js → history-redact-VYCWQFK7.js} +9 -9
  308. package/dist/cli-bundle/chunks/{history-repair-FY75IC26.js → history-repair-44MODPQF.js} +124 -84
  309. package/dist/cli-bundle/chunks/history-repair-44MODPQF.js.map +1 -0
  310. package/dist/cli-bundle/chunks/{history-repair-GABSDSVD.js → history-repair-CPNAOCNF.js} +123 -83
  311. package/dist/cli-bundle/chunks/history-repair-CPNAOCNF.js.map +7 -0
  312. package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js → init-F27NHENZ.js} +12 -11
  313. package/dist/cli-bundle/chunks/init-HHVQQP6C.js +22 -0
  314. package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js → learnings-HJVDQIGY.js} +8 -8
  315. package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js → learnings-XSFSUUWK.js} +8 -8
  316. package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js → list-HPMEKCAA.js} +8 -8
  317. package/dist/cli-bundle/chunks/{list-ROT7JF62.js → list-VMPWTURB.js} +8 -8
  318. package/dist/cli-bundle/chunks/{next-66BJB4N2.js → next-ETXF2ZCN.js} +59 -37
  319. package/dist/cli-bundle/chunks/next-ETXF2ZCN.js.map +7 -0
  320. package/dist/cli-bundle/chunks/{next-N5MWJTBY.js → next-QM6YJIIS.js} +60 -38
  321. package/dist/cli-bundle/chunks/next-QM6YJIIS.js.map +1 -0
  322. package/dist/cli-bundle/chunks/{notes-FW6YFLND.js → notes-GDZIKGR6.js} +8 -8
  323. package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js → notes-WDDBPC4D.js} +8 -8
  324. package/dist/cli-bundle/chunks/{plan-ZHKZ7JVF.js → plan-BGDR73Z6.js} +373 -279
  325. package/dist/cli-bundle/chunks/plan-BGDR73Z6.js.map +1 -0
  326. package/dist/cli-bundle/chunks/{plan-DQ7G4EDC.js → plan-C5IMM335.js} +372 -278
  327. package/dist/cli-bundle/chunks/plan-C5IMM335.js.map +7 -0
  328. package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js → profile-CCOKZ2IQ.js} +9 -9
  329. package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js → profile-HUCENIEQ.js} +9 -9
  330. package/dist/cli-bundle/chunks/{register-list-query-Y2VRHPCL.js → register-list-query-ROSNIL52.js} +80 -83
  331. package/dist/cli-bundle/chunks/register-list-query-ROSNIL52.js.map +1 -0
  332. package/dist/cli-bundle/chunks/{register-list-query-KY6Z6WV7.js → register-list-query-XN4ZRHSV.js} +79 -82
  333. package/dist/cli-bundle/chunks/register-list-query-XN4ZRHSV.js.map +7 -0
  334. package/dist/cli-bundle/chunks/{register-mutation-PCARIGZS.js → register-mutation-CFSB2MS3.js} +406 -385
  335. package/dist/cli-bundle/chunks/register-mutation-CFSB2MS3.js.map +1 -0
  336. package/dist/cli-bundle/chunks/{register-mutation-N6AYSKPM.js → register-mutation-KRLAHEL2.js} +405 -384
  337. package/dist/cli-bundle/chunks/register-mutation-KRLAHEL2.js.map +7 -0
  338. package/dist/cli-bundle/chunks/{register-operations-L6CYTOIH.js → register-operations-4PASGJDB.js} +112 -93
  339. package/dist/cli-bundle/chunks/register-operations-4PASGJDB.js.map +7 -0
  340. package/dist/cli-bundle/chunks/{register-operations-YAT6FUUB.js → register-operations-MBN4KGUM.js} +113 -94
  341. package/dist/cli-bundle/chunks/register-operations-MBN4KGUM.js.map +1 -0
  342. package/dist/cli-bundle/chunks/{register-setup-N7UGXYJC.js → register-setup-VIAWYFP5.js} +129 -104
  343. package/dist/cli-bundle/chunks/register-setup-VIAWYFP5.js.map +1 -0
  344. package/dist/cli-bundle/chunks/{register-setup-MPANILQF.js → register-setup-ZCGKHDKL.js} +128 -103
  345. package/dist/cli-bundle/chunks/register-setup-ZCGKHDKL.js.map +7 -0
  346. package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js → restore-4CBWUMCX.js} +9 -9
  347. package/dist/cli-bundle/chunks/restore-5UEAGG3W.js +17 -0
  348. package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js → scheduling-shortcuts-6VFKNKCM.js} +12 -12
  349. package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js → scheduling-shortcuts-ERHCVTEM.js} +12 -12
  350. package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js → schema-TDGK6N3I.js} +7 -7
  351. package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js → schema-UE5KKAUX.js} +7 -7
  352. package/dist/cli-bundle/chunks/{search-KP6H7COV.js → search-FP7MEU4S.js} +10 -10
  353. package/dist/cli-bundle/chunks/{search-CX5UMV4H.js → search-K4CFLQ5S.js} +10 -10
  354. package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js → stats-NJJCALEZ.js} +6 -6
  355. package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js → stats-XT6QRKQY.js} +6 -6
  356. package/dist/cli-bundle/chunks/{telemetry-DIFPXCAT.js → telemetry-5SQ5UDXC.js} +84 -70
  357. package/dist/cli-bundle/chunks/telemetry-5SQ5UDXC.js.map +7 -0
  358. package/dist/cli-bundle/chunks/{telemetry-WTYFUPRL.js → telemetry-HVXFZA2U.js} +85 -71
  359. package/dist/cli-bundle/chunks/telemetry-HVXFZA2U.js.map +1 -0
  360. package/dist/cli-bundle/chunks/{test-QNDXZQCW.js → test-UFSJ5YIO.js} +15 -14
  361. package/dist/cli-bundle/chunks/{test-HU2BS7EY.js → test-YCDAUBWF.js} +15 -14
  362. package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js +427 -0
  363. package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js.map +1 -0
  364. package/dist/cli-bundle/chunks/test-all-PM7UYN42.js +430 -0
  365. package/dist/cli-bundle/chunks/test-all-PM7UYN42.js.map +7 -0
  366. package/dist/cli-bundle/chunks/{test-runs-CA6K32RD.js → test-runs-FK5E75AA.js} +185 -147
  367. package/dist/cli-bundle/chunks/test-runs-FK5E75AA.js.map +1 -0
  368. package/dist/cli-bundle/chunks/{test-runs-LANLLPVO.js → test-runs-H4TGWGRN.js} +184 -146
  369. package/dist/cli-bundle/chunks/test-runs-H4TGWGRN.js.map +7 -0
  370. package/dist/cli-bundle/chunks/update-MTCFES6X.js +24 -0
  371. package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js → update-Y5WQVT5O.js} +15 -15
  372. package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js → update-many-6YAYYRLE.js} +83 -68
  373. package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js.map → update-many-6YAYYRLE.js.map} +2 -2
  374. package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js → update-many-JTKKSA7Y.js} +84 -69
  375. package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js.map → update-many-JTKKSA7Y.js.map} +1 -1
  376. package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js → upgrade-DTAHZ236.js} +11 -10
  377. package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js.map → upgrade-DTAHZ236.js.map} +1 -1
  378. package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js → upgrade-JUDU7YL4.js} +13 -12
  379. package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js.map → upgrade-JUDU7YL4.js.map} +1 -1
  380. package/dist/cli-bundle/chunks/{validate-2G566PKQ.js → validate-732RWS5W.js} +440 -319
  381. package/dist/cli-bundle/chunks/validate-732RWS5W.js.map +7 -0
  382. package/dist/cli-bundle/chunks/{validate-BDPVXHHH.js → validate-W7H5TEDC.js} +441 -320
  383. package/dist/cli-bundle/chunks/validate-W7H5TEDC.js.map +1 -0
  384. package/dist/cli-bundle/main.js +986 -1500
  385. package/dist/cli-bundle/main.js.map +4 -4
  386. package/dist/core/config/nested-settings.js +89 -67
  387. package/dist/core/config/nested-settings.js.map +1 -1
  388. package/dist/core/extensions/activation-summary-markdown.js +23 -12
  389. package/dist/core/extensions/activation-summary-markdown.js.map +1 -1
  390. package/dist/core/extensions/extension-policy.d.ts +18 -3
  391. package/dist/core/extensions/extension-policy.js +116 -106
  392. package/dist/core/extensions/extension-policy.js.map +1 -1
  393. package/dist/core/extensions/loader.js +310 -232
  394. package/dist/core/extensions/loader.js.map +1 -1
  395. package/dist/core/governance/metadata-coverage.js +20 -28
  396. package/dist/core/governance/metadata-coverage.js.map +1 -1
  397. package/dist/core/history/drift-scan.js +93 -81
  398. package/dist/core/history/drift-scan.js.map +1 -1
  399. package/dist/core/item/item-format.js +523 -410
  400. package/dist/core/item/item-format.js.map +1 -1
  401. package/dist/core/item/item-type-definition.js +14 -14
  402. package/dist/core/item/item-type-definition.js.map +1 -1
  403. package/dist/core/item/type-registry.js +87 -82
  404. package/dist/core/item/type-registry.js.map +1 -1
  405. package/dist/core/output/mutation-projection.js +42 -26
  406. package/dist/core/output/mutation-projection.js.map +1 -1
  407. package/dist/core/schema/runtime-schema.js +34 -28
  408. package/dist/core/schema/runtime-schema.js.map +1 -1
  409. package/dist/core/search/semantic-defaults.js +64 -37
  410. package/dist/core/search/semantic-defaults.js.map +1 -1
  411. package/dist/core/search/vector-stores.js +32 -17
  412. package/dist/core/search/vector-stores.js.map +1 -1
  413. package/dist/core/sentry/helpers.js +31 -28
  414. package/dist/core/sentry/helpers.js.map +1 -1
  415. package/dist/core/sentry/instrument.js +54 -43
  416. package/dist/core/sentry/instrument.js.map +1 -1
  417. package/dist/core/store/front-matter-cache.js +239 -153
  418. package/dist/core/store/front-matter-cache.js.map +1 -1
  419. package/dist/core/store/item-store.js +33 -26
  420. package/dist/core/store/item-store.js.map +1 -1
  421. package/dist/core/store/settings.js +247 -203
  422. package/dist/core/store/settings.js.map +1 -1
  423. package/dist/core/test/background-runs.js +189 -160
  424. package/dist/core/test/background-runs.js.map +1 -1
  425. package/dist/mcp/server.js +387 -367
  426. package/dist/mcp/server.js.map +1 -1
  427. package/dist/sdk/cli-contracts/flag-contracts.js +111 -180
  428. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  429. package/dist/sdk/cli-contracts/tool-schema.js +76 -45
  430. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  431. package/dist/sdk/compose.d.ts +4 -1
  432. package/dist/sdk/compose.js +181 -115
  433. package/dist/sdk/compose.js.map +1 -1
  434. package/docs/RELEASING.md +2 -3
  435. package/package.json +2 -2
  436. package/packages/pm-beads/extensions/beads/runtime.ts +240 -167
  437. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +65 -58
  438. package/packages/pm-todos/extensions/todos/runtime.ts +65 -42
  439. package/dist/cli-bundle/chunks/activity-EJBMXUBH.js +0 -16
  440. package/dist/cli-bundle/chunks/aggregate-MOC4TR2G.js.map +0 -1
  441. package/dist/cli-bundle/chunks/chunk-53ARXF2O.js.map +0 -7
  442. package/dist/cli-bundle/chunks/chunk-5IRVSKPS.js.map +0 -1
  443. package/dist/cli-bundle/chunks/chunk-5T6WPLRO.js.map +0 -7
  444. package/dist/cli-bundle/chunks/chunk-6T5ZIWBS.js.map +0 -7
  445. package/dist/cli-bundle/chunks/chunk-6YRAMXRS.js.map +0 -1
  446. package/dist/cli-bundle/chunks/chunk-7WDETKGP.js.map +0 -7
  447. package/dist/cli-bundle/chunks/chunk-A3UNLXNJ.js.map +0 -7
  448. package/dist/cli-bundle/chunks/chunk-AWN4PPH5.js.map +0 -7
  449. package/dist/cli-bundle/chunks/chunk-BOWQWXLI.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js +0 -115
  451. package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js.map +0 -1
  452. package/dist/cli-bundle/chunks/chunk-CHRNYKNI.js.map +0 -7
  453. package/dist/cli-bundle/chunks/chunk-CY5IJMUM.js.map +0 -1
  454. package/dist/cli-bundle/chunks/chunk-D5LYZVGB.js.map +0 -1
  455. package/dist/cli-bundle/chunks/chunk-DJDXAU74.js.map +0 -7
  456. package/dist/cli-bundle/chunks/chunk-DORJSBGJ.js.map +0 -7
  457. package/dist/cli-bundle/chunks/chunk-DU66JUGT.js.map +0 -7
  458. package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js +0 -118
  459. package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js.map +0 -7
  460. package/dist/cli-bundle/chunks/chunk-FDEVKXC4.js.map +0 -1
  461. package/dist/cli-bundle/chunks/chunk-GF7EAR22.js.map +0 -7
  462. package/dist/cli-bundle/chunks/chunk-HIBK6H4S.js.map +0 -1
  463. package/dist/cli-bundle/chunks/chunk-IHXXUIXS.js.map +0 -1
  464. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js +0 -35
  465. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js.map +0 -7
  466. package/dist/cli-bundle/chunks/chunk-IZQOJR2B.js.map +0 -7
  467. package/dist/cli-bundle/chunks/chunk-JTRKME24.js.map +0 -1
  468. package/dist/cli-bundle/chunks/chunk-JZG5ADVE.js.map +0 -1
  469. package/dist/cli-bundle/chunks/chunk-K46GQ265.js.map +0 -1
  470. package/dist/cli-bundle/chunks/chunk-KGQ3W65B.js.map +0 -1
  471. package/dist/cli-bundle/chunks/chunk-KTMMTOIP.js.map +0 -7
  472. package/dist/cli-bundle/chunks/chunk-KYDYQMNW.js.map +0 -7
  473. package/dist/cli-bundle/chunks/chunk-NIBP3I7A.js.map +0 -1
  474. package/dist/cli-bundle/chunks/chunk-NO6Y6FB2.js.map +0 -7
  475. package/dist/cli-bundle/chunks/chunk-QE5UFCCO.js.map +0 -1
  476. package/dist/cli-bundle/chunks/chunk-RM6MHL6A.js.map +0 -7
  477. package/dist/cli-bundle/chunks/chunk-RPRW26NG.js.map +0 -1
  478. package/dist/cli-bundle/chunks/chunk-SNUK7H5J.js.map +0 -7
  479. package/dist/cli-bundle/chunks/chunk-T7ZMQI4J.js.map +0 -1
  480. package/dist/cli-bundle/chunks/chunk-UB3V5WUI.js.map +0 -1
  481. package/dist/cli-bundle/chunks/chunk-UFKNF23C.js.map +0 -7
  482. package/dist/cli-bundle/chunks/chunk-V3KLX7U7.js.map +0 -1
  483. package/dist/cli-bundle/chunks/chunk-VD3LKZFX.js.map +0 -1
  484. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js +0 -32
  485. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js.map +0 -1
  486. package/dist/cli-bundle/chunks/chunk-WTRUDJ3R.js.map +0 -1
  487. package/dist/cli-bundle/chunks/chunk-Z55WX4IQ.js.map +0 -1
  488. package/dist/cli-bundle/chunks/chunk-Z5BM2FKQ.js.map +0 -7
  489. package/dist/cli-bundle/chunks/chunk-ZEATCVAC.js.map +0 -7
  490. package/dist/cli-bundle/chunks/chunk-ZFIEEDTJ.js.map +0 -7
  491. package/dist/cli-bundle/chunks/chunk-ZIE6WXJ2.js.map +0 -1
  492. package/dist/cli-bundle/chunks/close-37KEHLYM.js +0 -14
  493. package/dist/cli-bundle/chunks/close-many-BFMP6HHK.js.map +0 -7
  494. package/dist/cli-bundle/chunks/close-many-CXJBOWWY.js.map +0 -1
  495. package/dist/cli-bundle/chunks/config-FIXJZEQK.js +0 -1541
  496. package/dist/cli-bundle/chunks/config-FIXJZEQK.js.map +0 -7
  497. package/dist/cli-bundle/chunks/config-X3ZVCUUG.js +0 -1531
  498. package/dist/cli-bundle/chunks/config-X3ZVCUUG.js.map +0 -1
  499. package/dist/cli-bundle/chunks/contracts-KP4QAGVW.js.map +0 -1
  500. package/dist/cli-bundle/chunks/contracts-SMOAN5NF.js.map +0 -7
  501. package/dist/cli-bundle/chunks/create-DFMNBKBS.js +0 -28
  502. package/dist/cli-bundle/chunks/get-AWK324RS.js.map +0 -7
  503. package/dist/cli-bundle/chunks/get-VYPIICPC.js.map +0 -1
  504. package/dist/cli-bundle/chunks/health-FBCVZGSX.js.map +0 -7
  505. package/dist/cli-bundle/chunks/health-Q66C43GN.js.map +0 -1
  506. package/dist/cli-bundle/chunks/history-5XUSLAJA.js +0 -18
  507. package/dist/cli-bundle/chunks/history-compact-2GHT32UX.js.map +0 -1
  508. package/dist/cli-bundle/chunks/history-compact-WLCQEKXS.js.map +0 -7
  509. package/dist/cli-bundle/chunks/history-redact-BVHWDXPR.js +0 -19
  510. package/dist/cli-bundle/chunks/history-repair-FY75IC26.js.map +0 -1
  511. package/dist/cli-bundle/chunks/history-repair-GABSDSVD.js.map +0 -7
  512. package/dist/cli-bundle/chunks/init-TRYJELH4.js +0 -21
  513. package/dist/cli-bundle/chunks/next-66BJB4N2.js.map +0 -7
  514. package/dist/cli-bundle/chunks/next-N5MWJTBY.js.map +0 -1
  515. package/dist/cli-bundle/chunks/plan-DQ7G4EDC.js.map +0 -7
  516. package/dist/cli-bundle/chunks/plan-ZHKZ7JVF.js.map +0 -1
  517. package/dist/cli-bundle/chunks/register-list-query-KY6Z6WV7.js.map +0 -7
  518. package/dist/cli-bundle/chunks/register-list-query-Y2VRHPCL.js.map +0 -1
  519. package/dist/cli-bundle/chunks/register-mutation-N6AYSKPM.js.map +0 -7
  520. package/dist/cli-bundle/chunks/register-mutation-PCARIGZS.js.map +0 -1
  521. package/dist/cli-bundle/chunks/register-operations-L6CYTOIH.js.map +0 -7
  522. package/dist/cli-bundle/chunks/register-operations-YAT6FUUB.js.map +0 -1
  523. package/dist/cli-bundle/chunks/register-setup-MPANILQF.js.map +0 -7
  524. package/dist/cli-bundle/chunks/register-setup-N7UGXYJC.js.map +0 -1
  525. package/dist/cli-bundle/chunks/restore-IRAKSWIW.js +0 -17
  526. package/dist/cli-bundle/chunks/telemetry-DIFPXCAT.js.map +0 -7
  527. package/dist/cli-bundle/chunks/telemetry-WTYFUPRL.js.map +0 -1
  528. package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js +0 -360
  529. package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js.map +0 -7
  530. package/dist/cli-bundle/chunks/test-all-XLPI4USF.js +0 -357
  531. package/dist/cli-bundle/chunks/test-all-XLPI4USF.js.map +0 -1
  532. package/dist/cli-bundle/chunks/test-runs-CA6K32RD.js.map +0 -1
  533. package/dist/cli-bundle/chunks/test-runs-LANLLPVO.js.map +0 -7
  534. package/dist/cli-bundle/chunks/update-UXDLTEOZ.js +0 -24
  535. package/dist/cli-bundle/chunks/validate-2G566PKQ.js.map +0 -7
  536. package/dist/cli-bundle/chunks/validate-BDPVXHHH.js.map +0 -1
  537. /package/dist/cli-bundle/chunks/{activity-MVSEND6D.js.map → activity-CUC4JY3U.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{activity-EJBMXUBH.js.map → activity-WEIEMM73.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{append-KDHT4GHI.js.map → append-H32VOR2Y.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{append-LEDBAM3K.js.map → append-UBM632FK.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js.map → chunk-2ASNV4DH.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js.map → chunk-2CHRYUXL.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-DRPF274X.js.map → chunk-3LCUASYG.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js.map → chunk-3Q2HBMTI.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js.map → chunk-55XRYWEG.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js.map → chunk-A6VOGKBA.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js.map → chunk-AIAIXG7I.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js.map → chunk-BTX5MIQF.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js.map → chunk-CYBDUHNO.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js.map → chunk-CZPVDLD2.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js.map → chunk-EUKTMRN3.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js.map → chunk-FFOQHGNH.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js.map → chunk-GFMSLORL.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js.map → chunk-H4GRLYJS.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js.map → chunk-HQTPRV4D.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js.map → chunk-JMK5GCK2.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js.map → chunk-K2VYLVX4.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js.map → chunk-KCO2EAN5.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js.map → chunk-KLXF7NCC.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js.map → chunk-LRKMWUUV.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js.map → chunk-LTRAF2D7.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js.map → chunk-MRD4T5LF.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js.map → chunk-N2JSWVWG.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js.map → chunk-QH3FSKRJ.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js.map → chunk-S62UANU7.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js.map → chunk-U2BEEM2X.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js.map → chunk-UT73HUPC.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js.map → chunk-UTSH5GWX.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js.map → chunk-Y4NRKBFW.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js.map → chunk-YPKFV2JR.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js.map → chunk-ZNHEYCDD.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js.map → chunk-ZNT7KEWE.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js.map → claim-SENTPZBN.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{claim-6NINZYB3.js.map → claim-Z7MEQCBT.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js.map → close-424MX4CU.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{close-37KEHLYM.js.map → close-YCWQQPDS.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{comments-ETHABIY6.js.map → comments-4FGNTSNV.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js.map → comments-7YS5MY5X.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js.map → context-LHVKJSPJ.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{context-XDI4DKKT.js.map → context-ZQY54JNS.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js.map → copy-GYNQQPW2.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js.map → copy-TLW7JTQT.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js.map → create-VSKYSOCD.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{create-DFMNBKBS.js.map → create-XTMAPS7I.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js.map → delete-4W5JYCEG.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js.map → delete-ANTOTI2I.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js.map → deps-HPPE6MJN.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js.map → deps-ZQZN54EZ.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js.map → docs-RPOVFMP3.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{docs-2TIFR62T.js.map → docs-XJNYBJGE.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js.map → eval-DM6JBZTS.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js.map → eval-RFBI5FGS.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js.map → extension-B3YY4WY5.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js.map → extension-TTSEFQTS.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{files-DF3HO6XK.js.map → files-5D65CHGE.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{files-T5ODMETM.js.map → files-GPIG77EN.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js.map → focus-C3PEJV2C.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js.map → focus-ZHN7WIGX.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js.map → gc-D4JQ6OWN.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{gc-FULIVYR4.js.map → gc-VZIXDL32.js.map} +0 -0
  601. /package/dist/cli-bundle/chunks/{history-5XUSLAJA.js.map → history-DD7L7BNL.js.map} +0 -0
  602. /package/dist/cli-bundle/chunks/{history-X4OSES6K.js.map → history-IL7XCEX2.js.map} +0 -0
  603. /package/dist/cli-bundle/chunks/{history-redact-BVHWDXPR.js.map → history-redact-IX4YEWMY.js.map} +0 -0
  604. /package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js.map → history-redact-VYCWQFK7.js.map} +0 -0
  605. /package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js.map → init-F27NHENZ.js.map} +0 -0
  606. /package/dist/cli-bundle/chunks/{init-TRYJELH4.js.map → init-HHVQQP6C.js.map} +0 -0
  607. /package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js.map → learnings-HJVDQIGY.js.map} +0 -0
  608. /package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js.map → learnings-XSFSUUWK.js.map} +0 -0
  609. /package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js.map → list-HPMEKCAA.js.map} +0 -0
  610. /package/dist/cli-bundle/chunks/{list-ROT7JF62.js.map → list-VMPWTURB.js.map} +0 -0
  611. /package/dist/cli-bundle/chunks/{notes-FW6YFLND.js.map → notes-GDZIKGR6.js.map} +0 -0
  612. /package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js.map → notes-WDDBPC4D.js.map} +0 -0
  613. /package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js.map → profile-CCOKZ2IQ.js.map} +0 -0
  614. /package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js.map → profile-HUCENIEQ.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js.map → restore-4CBWUMCX.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{restore-IRAKSWIW.js.map → restore-5UEAGG3W.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js.map → scheduling-shortcuts-6VFKNKCM.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js.map → scheduling-shortcuts-ERHCVTEM.js.map} +0 -0
  619. /package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js.map → schema-TDGK6N3I.js.map} +0 -0
  620. /package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js.map → schema-UE5KKAUX.js.map} +0 -0
  621. /package/dist/cli-bundle/chunks/{search-KP6H7COV.js.map → search-FP7MEU4S.js.map} +0 -0
  622. /package/dist/cli-bundle/chunks/{search-CX5UMV4H.js.map → search-K4CFLQ5S.js.map} +0 -0
  623. /package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js.map → stats-NJJCALEZ.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js.map → stats-XT6QRKQY.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{test-QNDXZQCW.js.map → test-UFSJ5YIO.js.map} +0 -0
  626. /package/dist/cli-bundle/chunks/{test-HU2BS7EY.js.map → test-YCDAUBWF.js.map} +0 -0
  627. /package/dist/cli-bundle/chunks/{update-UXDLTEOZ.js.map → update-MTCFES6X.js.map} +0 -0
  628. /package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js.map → update-Y5WQVT5O.js.map} +0 -0
@@ -4,7 +4,7 @@
4
4
  * Implements the pm config command surface and its agent-facing runtime behavior.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0be07fdd-a74d-5d01-a1b7-bd26e021bf20")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a420e612-3d4b-5ebd-864e-a1a4bec5e45d")}catch(e){}}();
8
8
  import { pathExists } from "../../core/fs/fs-utils.js";
9
9
  import { resolveConfigPositionalValue } from "../../core/config/positional-value.js";
10
10
  import { NESTED_SETTING_DESCRIPTORS, parseNestedSettingValue, readNestedSettingValue, resolveNestedSettingDescriptor, writeNestedSettingValue, } from "../../core/config/nested-settings.js";
@@ -124,6 +124,7 @@ const CONFIG_KEY_ALIASES = {
124
124
  // hint so agents see ~21 keys instead of all ~45 kebab+snake variants; snake_case
125
125
  // forms stay fully accepted as input via CONFIG_KEY_VALUES/normalizeKey.
126
126
  const CANONICAL_CONFIG_KEYS = Object.keys(CONFIG_KEY_ALIASES).map((candidate) => CONFIG_KEY_ALIASES[candidate][0]);
127
+ const CONFIG_KEY_BY_ALIAS = Object.fromEntries(Object.keys(CONFIG_KEY_ALIASES).flatMap((key) => CONFIG_KEY_ALIASES[key].map((alias) => [alias, key])));
127
128
  const CONFIG_KEY_SUMMARIES = {
128
129
  definition_of_done: "Definition of Done criteria list.",
129
130
  item_format: "Default item file format.",
@@ -156,8 +157,38 @@ const LIFECYCLE_PATTERN_CONFIG_KEYS = [
156
157
  "lifecycle_closure_like_resolution_patterns",
157
158
  "lifecycle_closure_like_actual_result_patterns",
158
159
  ];
160
+ const CRITERIA_CONFIG_KEYS = new Set([
161
+ "metadata_required_fields",
162
+ ...LIFECYCLE_PATTERN_CONFIG_KEYS,
163
+ ]);
164
+ const TRACKING_CONFIG_KEYS = new Set([
165
+ "test_result_tracking",
166
+ "telemetry_tracking",
167
+ ]);
168
+ const GOVERNANCE_BOOLEAN_CONFIG_KEYS = new Set([
169
+ "governance_require_close_reason",
170
+ "governance_force_required_for_stale_lock",
171
+ ]);
172
+ const GOVERNANCE_POLICY_CONFIG_KEYS = new Set([
173
+ "governance_ownership_enforcement",
174
+ "governance_create_mode_default",
175
+ "governance_close_validation_default",
176
+ ]);
177
+ const GOVERNANCE_VALIDATION_CONFIG_KEYS = new Set([
178
+ "governance_parent_reference_policy",
179
+ "governance_metadata_validation_profile",
180
+ "governance_workflow_enforcement",
181
+ ]);
182
+ const GOVERNANCE_PRESET_OR_TYPE_CONFIG_KEYS = new Set([
183
+ "governance_preset",
184
+ "governance_create_default_type",
185
+ ]);
186
+ const isCriteriaValueConfigKey = (key) => CRITERIA_CONFIG_KEYS.has(key);
187
+ const isGovernancePolicyConfigKey = (key) => GOVERNANCE_POLICY_CONFIG_KEYS.has(key);
188
+ const isGovernanceValidationConfigKey = (key) => GOVERNANCE_VALIDATION_CONFIG_KEYS.has(key);
189
+ const isGovernancePresetOrTypeConfigKey = (key) => GOVERNANCE_PRESET_OR_TYPE_CONFIG_KEYS.has(key);
159
190
  function isCriteriaConfigKey(key) {
160
- return key === "definition_of_done" || key === "metadata_required_fields" || LIFECYCLE_PATTERN_CONFIG_KEYS.includes(key);
191
+ return key === "definition_of_done" || isCriteriaValueConfigKey(key);
161
192
  }
162
193
  function normalizeScope(value) {
163
194
  if (CONFIG_SCOPE_VALUES.includes(value)) {
@@ -172,83 +203,9 @@ function normalizeAction(value) {
172
203
  throw new PmCliError(`Invalid config action "${value}". Allowed: get, set, list, export`, EXIT_CODE.USAGE);
173
204
  }
174
205
  function normalizeKey(value) {
175
- if (CONFIG_KEY_VALUES.includes(value)) {
176
- if (value === "item-format" || value === "item_format") {
177
- return "item_format";
178
- }
179
- if (value === "history-missing-stream-policy" || value === "history_missing_stream_policy") {
180
- return "history_missing_stream_policy";
181
- }
182
- if (value === "sprint-release-format-policy" || value === "sprint_release_format_policy") {
183
- return "sprint_release_format_policy";
184
- }
185
- if (value === "parent-reference-policy" || value === "parent_reference_policy") {
186
- return "parent_reference_policy";
187
- }
188
- if (value === "metadata-validation-profile" || value === "metadata_validation_profile") {
189
- return "metadata_validation_profile";
190
- }
191
- if (value === "metadata-required-fields" || value === "metadata_required_fields") {
192
- return "metadata_required_fields";
193
- }
194
- if (value === "lifecycle-stale-blocker-reason-patterns" ||
195
- value === "lifecycle_stale_blocker_reason_patterns") {
196
- return "lifecycle_stale_blocker_reason_patterns";
197
- }
198
- if (value === "lifecycle-closure-like-blocked-reason-patterns" ||
199
- value === "lifecycle_closure_like_blocked_reason_patterns") {
200
- return "lifecycle_closure_like_blocked_reason_patterns";
201
- }
202
- if (value === "lifecycle-closure-like-resolution-patterns" ||
203
- value === "lifecycle_closure_like_resolution_patterns") {
204
- return "lifecycle_closure_like_resolution_patterns";
205
- }
206
- if (value === "lifecycle-closure-like-actual-result-patterns" ||
207
- value === "lifecycle_closure_like_actual_result_patterns") {
208
- return "lifecycle_closure_like_actual_result_patterns";
209
- }
210
- if (value === "governance-preset" || value === "governance_preset") {
211
- return "governance_preset";
212
- }
213
- if (value === "governance-ownership-enforcement" || value === "governance_ownership_enforcement") {
214
- return "governance_ownership_enforcement";
215
- }
216
- if (value === "governance-create-mode-default" || value === "governance_create_mode_default") {
217
- return "governance_create_mode_default";
218
- }
219
- if (value === "governance-close-validation-default" || value === "governance_close_validation_default") {
220
- return "governance_close_validation_default";
221
- }
222
- if (value === "governance-require-close-reason" || value === "governance_require_close_reason") {
223
- return "governance_require_close_reason";
224
- }
225
- if (value === "governance-create-default-type" || value === "governance_create_default_type") {
226
- return "governance_create_default_type";
227
- }
228
- if (value === "governance-workflow-enforcement" || value === "governance_workflow_enforcement") {
229
- return "governance_workflow_enforcement";
230
- }
231
- if (value === "governance-parent-reference-policy" || value === "governance_parent_reference_policy") {
232
- return "governance_parent_reference_policy";
233
- }
234
- if (value === "governance-metadata-validation-profile" ||
235
- value === "governance_metadata_validation_profile") {
236
- return "governance_metadata_validation_profile";
237
- }
238
- if (value === "governance-force-required-for-stale-lock" ||
239
- value === "governance_force_required_for_stale_lock") {
240
- return "governance_force_required_for_stale_lock";
241
- }
242
- if (value === "test-result-tracking" || value === "test_result_tracking") {
243
- return "test_result_tracking";
244
- }
245
- if (value === "telemetry-tracking" || value === "telemetry_tracking") {
246
- return "telemetry_tracking";
247
- }
248
- if (value === "context") {
249
- return "context";
250
- }
251
- return "definition_of_done";
206
+ const key = CONFIG_KEY_BY_ALIAS[value];
207
+ if (key) {
208
+ return key;
252
209
  }
253
210
  const nestedKeys = NESTED_SETTING_DESCRIPTORS.map((descriptor) => descriptor.key).join(", ");
254
211
  throw new PmCliError(`Invalid config key "${value}". Supported: ${CANONICAL_CONFIG_KEYS.join(", ")} (underscore variants also accepted). Nested leaf settings: ${nestedKeys}.`, EXIT_CODE.USAGE);
@@ -479,82 +436,47 @@ function assertConfigKeyDefined(key) {
479
436
  throw new PmCliError("Config action requires <key>", EXIT_CODE.USAGE);
480
437
  }
481
438
  }
439
+ const CONFIG_VALUE_READERS = {
440
+ definition_of_done: (settings) => [...settings.workflow.definition_of_done],
441
+ item_format: (settings) => settings.item_format,
442
+ history_missing_stream_policy: (settings) => settings.history.missing_stream,
443
+ sprint_release_format_policy: (settings) => settings.validation.sprint_release_format,
444
+ parent_reference_policy: (settings) => settings.validation.parent_reference,
445
+ metadata_validation_profile: (settings) => settings.validation.metadata_profile,
446
+ metadata_required_fields: (settings) => [...settings.validation.metadata_required_fields],
447
+ lifecycle_stale_blocker_reason_patterns: (settings) => [
448
+ ...settings.validation.lifecycle_stale_blocker_reason_patterns,
449
+ ],
450
+ lifecycle_closure_like_blocked_reason_patterns: (settings) => [
451
+ ...settings.validation.lifecycle_closure_like_blocked_reason_patterns,
452
+ ],
453
+ lifecycle_closure_like_resolution_patterns: (settings) => [
454
+ ...settings.validation.lifecycle_closure_like_resolution_patterns,
455
+ ],
456
+ lifecycle_closure_like_actual_result_patterns: (settings) => [
457
+ ...settings.validation.lifecycle_closure_like_actual_result_patterns,
458
+ ],
459
+ governance_preset: (settings) => settings.governance.preset,
460
+ governance_ownership_enforcement: (settings) => settings.governance.ownership_enforcement,
461
+ governance_create_mode_default: (settings) => settings.governance.create_mode_default,
462
+ governance_close_validation_default: (settings) => settings.governance.close_validation_default,
463
+ governance_require_close_reason: (settings) => settings.governance.require_close_reason ? "enabled" : "disabled",
464
+ governance_create_default_type: (settings) => settings.governance.create_default_type ?? "",
465
+ governance_workflow_enforcement: (settings) => settings.governance.workflow_enforcement ?? "off",
466
+ governance_parent_reference_policy: (settings) => settings.governance.parent_reference,
467
+ governance_metadata_validation_profile: (settings) => settings.governance.metadata_profile,
468
+ governance_force_required_for_stale_lock: (settings) => settings.governance.force_required_for_stale_lock ? "enabled" : "disabled",
469
+ test_result_tracking: (settings) => settings.testing.record_results_to_items ? "enabled" : "disabled",
470
+ telemetry_tracking: (settings) => settings.telemetry.enabled ? "enabled" : "disabled",
471
+ context: (settings) => ({
472
+ default_depth: settings.context.default_depth,
473
+ activity_limit: settings.context.activity_limit,
474
+ stale_threshold_days: settings.context.stale_threshold_days,
475
+ sections: { ...settings.context.sections },
476
+ }),
477
+ };
482
478
  function readConfigValue(settings, key) {
483
- if (key === "item_format") {
484
- return settings.item_format;
485
- }
486
- if (key === "history_missing_stream_policy") {
487
- return settings.history.missing_stream;
488
- }
489
- if (key === "sprint_release_format_policy") {
490
- return settings.validation.sprint_release_format;
491
- }
492
- if (key === "parent_reference_policy") {
493
- return settings.validation.parent_reference;
494
- }
495
- if (key === "metadata_validation_profile") {
496
- return settings.validation.metadata_profile;
497
- }
498
- if (key === "metadata_required_fields") {
499
- return [...settings.validation.metadata_required_fields];
500
- }
501
- if (key === "lifecycle_stale_blocker_reason_patterns") {
502
- return [...settings.validation.lifecycle_stale_blocker_reason_patterns];
503
- }
504
- if (key === "lifecycle_closure_like_blocked_reason_patterns") {
505
- return [...settings.validation.lifecycle_closure_like_blocked_reason_patterns];
506
- }
507
- if (key === "lifecycle_closure_like_resolution_patterns") {
508
- return [...settings.validation.lifecycle_closure_like_resolution_patterns];
509
- }
510
- if (key === "lifecycle_closure_like_actual_result_patterns") {
511
- return [...settings.validation.lifecycle_closure_like_actual_result_patterns];
512
- }
513
- if (key === "governance_preset") {
514
- return settings.governance.preset;
515
- }
516
- if (key === "governance_ownership_enforcement") {
517
- return settings.governance.ownership_enforcement;
518
- }
519
- if (key === "governance_create_mode_default") {
520
- return settings.governance.create_mode_default;
521
- }
522
- if (key === "governance_close_validation_default") {
523
- return settings.governance.close_validation_default;
524
- }
525
- if (key === "governance_require_close_reason") {
526
- return settings.governance.require_close_reason ? "enabled" : "disabled";
527
- }
528
- if (key === "governance_create_default_type") {
529
- return settings.governance.create_default_type ?? "";
530
- }
531
- if (key === "governance_workflow_enforcement") {
532
- return settings.governance.workflow_enforcement ?? "off";
533
- }
534
- if (key === "governance_parent_reference_policy") {
535
- return settings.governance.parent_reference;
536
- }
537
- if (key === "governance_metadata_validation_profile") {
538
- return settings.governance.metadata_profile;
539
- }
540
- if (key === "governance_force_required_for_stale_lock") {
541
- return settings.governance.force_required_for_stale_lock ? "enabled" : "disabled";
542
- }
543
- if (key === "test_result_tracking") {
544
- return settings.testing.record_results_to_items ? "enabled" : "disabled";
545
- }
546
- if (key === "telemetry_tracking") {
547
- return settings.telemetry.enabled ? "enabled" : "disabled";
548
- }
549
- if (key === "context") {
550
- return {
551
- default_depth: settings.context.default_depth,
552
- activity_limit: settings.context.activity_limit,
553
- stale_threshold_days: settings.context.stale_threshold_days,
554
- sections: { ...settings.context.sections },
555
- };
556
- }
557
- return [...settings.workflow.definition_of_done];
479
+ return CONFIG_VALUE_READERS[key](settings);
558
480
  }
559
481
  function withWarnings(result, warnings) {
560
482
  if (warnings.length === 0) {
@@ -653,6 +575,12 @@ async function applyContextConfig(settings, options, target, scope, warnings) {
653
575
  changed,
654
576
  }, warnings);
655
577
  }
578
+ function applyNestedSettingPositionalValue(keyValue, valueValue, options) {
579
+ if (options.value !== undefined && options.value !== valueValue) {
580
+ throw new PmCliError(`Config set ${keyValue} received both positional value "${valueValue}" and --value "${options.value}". Pass only one.`, EXIT_CODE.USAGE);
581
+ }
582
+ return { ...options, value: valueValue };
583
+ }
656
584
  /**
657
585
  * Route an intuitive `pm config set <key> <value>` positional value onto the typed
658
586
  * flag it belongs to (--format/--policy/--criterion), applying enabled/disabled
@@ -671,12 +599,7 @@ function applyPositionalValue(action, keyValue, normalizedKey, nestedSetting, va
671
599
  throw new PmCliError('Config action "set" requires <key> before a positional <value>.', EXIT_CODE.USAGE);
672
600
  }
673
601
  if (nestedSetting) {
674
- if (options.value !== undefined && valueValue !== undefined && options.value !== valueValue) {
675
- throw new PmCliError(`Config set ${keyValue} received both positional value "${valueValue}" and --value "${options.value}". Pass only one.`, EXIT_CODE.USAGE);
676
- }
677
- // valueValue is guaranteed defined here (the valueValue === undefined early return
678
- // above preserves a pre-existing --value), so this never overwrites --value.
679
- return { ...options, value: valueValue };
602
+ return applyNestedSettingPositionalValue(keyValue, valueValue, options);
680
603
  }
681
604
  assertConfigKeyDefined(normalizedKey);
682
605
  const routed = resolveConfigPositionalValue(normalizedKey, valueValue);
@@ -706,770 +629,411 @@ function applyPositionalValue(action, keyValue, normalizedKey, nestedSetting, va
706
629
  }
707
630
  return { ...options, policy: routed.value };
708
631
  }
709
- /**
710
- * Implements run config for the public runtime surface of this module.
711
- */
712
- export async function runConfig(scopeValue, actionValue, keyValue, options, global, valueValue) {
713
- const scope = normalizeScope(scopeValue);
714
- const action = normalizeAction(actionValue);
715
- // Nested leaf settings (search/provider/vector-store) are detected before
716
- // normalizeKey so they bypass the ConfigKey union without breaking the
717
- // existing key-not-found error path for actually-unknown keys.
718
- const nestedSetting = (action === "get" || action === "set") ? resolveNestedSettingDescriptor(keyValue) : undefined;
719
- const key = nestedSetting ? undefined : normalizeKeyForAction(action, keyValue);
720
- options = applyPositionalValue(action, keyValue, key, nestedSetting, valueValue, options);
721
- const target = await resolveSettingsTarget(scope, global);
722
- const { settings, metadata, warnings: settingsReadWarnings } = await readSettingsWithMetadata(target.pmRoot);
723
- const warnings = normalizeWarnings(settingsReadWarnings);
724
- if (nestedSetting) {
725
- if (action === "get") {
726
- const currentValue = readNestedSettingValue(settings, nestedSetting);
727
- return withWarnings({
728
- scope,
729
- key: nestedSetting.key,
730
- nested_setting: {
731
- key: nestedSetting.key,
732
- path: nestedSetting.path,
733
- kind: nestedSetting.kind,
734
- value: currentValue,
735
- },
736
- settings_path: target.settingsPath,
737
- changed: false,
738
- }, warnings);
739
- }
740
- // action === "set"
741
- const rawValue = options.value;
742
- if (typeof rawValue !== "string") {
743
- throw new PmCliError(`Config set ${nestedSetting.key} requires a value. Pass it positionally (\`pm config ${scope} set ${nestedSetting.key} <value>\`) or via --value.`, EXIT_CODE.USAGE);
744
- }
745
- const parsed = parseNestedSettingValue(nestedSetting, rawValue);
746
- if (!parsed.ok) {
747
- throw new PmCliError(parsed.error.message, EXIT_CODE.USAGE);
748
- }
749
- const changed = writeNestedSettingValue(settings, nestedSetting, parsed.parsed.value);
750
- if (changed) {
751
- await writeSettings(target.pmRoot, settings, `config:set:${nestedSetting.path}`);
752
- }
632
+ function buildConfigListResult(context) {
633
+ const keys = Object.keys(CONFIG_KEY_ALIASES).map((candidate) => ({
634
+ key: candidate,
635
+ aliases: CONFIG_KEY_ALIASES[candidate],
636
+ value_kind: candidate === "context"
637
+ ? "object"
638
+ : isCriteriaConfigKey(candidate) ? "string_array" : "enum",
639
+ set_flags: candidate === "context"
640
+ ? ["--default-depth", "--activity-limit", "--stale-threshold-days", "--section-<name>"]
641
+ : isCriteriaConfigKey(candidate) ? ["--criterion", "--clear-criteria"] : candidate === "item_format" ? ["--format"] : ["--policy"],
642
+ summary: CONFIG_KEY_SUMMARIES[candidate],
643
+ value: readConfigValue(context.settings, candidate),
644
+ }));
645
+ const nestedSettings = NESTED_SETTING_DESCRIPTORS.map((descriptor) => ({
646
+ key: descriptor.key,
647
+ path: descriptor.path,
648
+ kind: descriptor.kind,
649
+ value: readNestedSettingValue(context.settings, descriptor),
650
+ }));
651
+ return withWarnings({
652
+ scope: context.scope,
653
+ keys,
654
+ nested_settings: nestedSettings,
655
+ count: keys.length,
656
+ settings_path: context.target.settingsPath,
657
+ changed: false,
658
+ }, context.warnings);
659
+ }
660
+ function buildConfigExportResult(context) {
661
+ const values = Object.fromEntries(Object.keys(CONFIG_KEY_ALIASES).map((key) => [key, readConfigValue(context.settings, key)]));
662
+ return withWarnings({
663
+ scope: context.scope,
664
+ values,
665
+ settings_path: context.target.settingsPath,
666
+ changed: false,
667
+ }, context.warnings);
668
+ }
669
+ function buildConfigGetResult(context, key) {
670
+ const value = readConfigValue(context.settings, key);
671
+ const base = {
672
+ scope: context.scope,
673
+ key,
674
+ settings_path: context.target.settingsPath,
675
+ changed: false,
676
+ };
677
+ if (key === "item_format") {
753
678
  return withWarnings({
754
- scope,
679
+ ...base,
680
+ format: context.settings.item_format,
681
+ has_explicit_item_format: context.metadata.has_explicit_item_format,
682
+ }, context.warnings);
683
+ }
684
+ if (key === "context") {
685
+ return withWarnings({ ...base, context_settings: value }, context.warnings);
686
+ }
687
+ if (Array.isArray(value)) {
688
+ return withWarnings({ ...base, criteria: value }, context.warnings);
689
+ }
690
+ return withWarnings({ ...base, policy: value }, context.warnings);
691
+ }
692
+ async function buildNestedSettingResult(context, action, nestedSetting, options) {
693
+ if (action === "get") {
694
+ const currentValue = readNestedSettingValue(context.settings, nestedSetting);
695
+ return withWarnings({
696
+ scope: context.scope,
755
697
  key: nestedSetting.key,
756
698
  nested_setting: {
757
699
  key: nestedSetting.key,
758
700
  path: nestedSetting.path,
759
701
  kind: nestedSetting.kind,
760
- value: parsed.parsed.value,
702
+ value: currentValue,
761
703
  },
762
- settings_path: target.settingsPath,
763
- changed,
764
- }, warnings);
765
- }
766
- if (action === "list") {
767
- const keys = Object.keys(CONFIG_KEY_ALIASES).map((candidate) => ({
768
- key: candidate,
769
- aliases: CONFIG_KEY_ALIASES[candidate],
770
- value_kind: candidate === "context"
771
- ? "object"
772
- : isCriteriaConfigKey(candidate) ? "string_array" : "enum",
773
- set_flags: candidate === "context"
774
- ? ["--default-depth", "--activity-limit", "--stale-threshold-days", "--section-<name>"]
775
- : isCriteriaConfigKey(candidate) ? ["--criterion", "--clear-criteria"] : candidate === "item_format" ? ["--format"] : ["--policy"],
776
- summary: CONFIG_KEY_SUMMARIES[candidate],
777
- value: readConfigValue(settings, candidate),
778
- }));
779
- const nestedSettings = NESTED_SETTING_DESCRIPTORS.map((descriptor) => ({
780
- key: descriptor.key,
781
- path: descriptor.path,
782
- kind: descriptor.kind,
783
- value: readNestedSettingValue(settings, descriptor),
784
- }));
785
- return withWarnings({
786
- scope,
787
- keys,
788
- nested_settings: nestedSettings,
789
- count: keys.length,
790
- settings_path: target.settingsPath,
704
+ settings_path: context.target.settingsPath,
791
705
  changed: false,
792
- }, warnings);
706
+ }, context.warnings);
793
707
  }
794
- if (action === "export") {
795
- const values = {
796
- definition_of_done: readConfigValue(settings, "definition_of_done"),
797
- item_format: readConfigValue(settings, "item_format"),
798
- history_missing_stream_policy: readConfigValue(settings, "history_missing_stream_policy"),
799
- sprint_release_format_policy: readConfigValue(settings, "sprint_release_format_policy"),
800
- parent_reference_policy: readConfigValue(settings, "parent_reference_policy"),
801
- metadata_validation_profile: readConfigValue(settings, "metadata_validation_profile"),
802
- metadata_required_fields: readConfigValue(settings, "metadata_required_fields"),
803
- lifecycle_stale_blocker_reason_patterns: readConfigValue(settings, "lifecycle_stale_blocker_reason_patterns"),
804
- lifecycle_closure_like_blocked_reason_patterns: readConfigValue(settings, "lifecycle_closure_like_blocked_reason_patterns"),
805
- lifecycle_closure_like_resolution_patterns: readConfigValue(settings, "lifecycle_closure_like_resolution_patterns"),
806
- lifecycle_closure_like_actual_result_patterns: readConfigValue(settings, "lifecycle_closure_like_actual_result_patterns"),
807
- governance_preset: readConfigValue(settings, "governance_preset"),
808
- governance_ownership_enforcement: readConfigValue(settings, "governance_ownership_enforcement"),
809
- governance_create_mode_default: readConfigValue(settings, "governance_create_mode_default"),
810
- governance_close_validation_default: readConfigValue(settings, "governance_close_validation_default"),
811
- governance_require_close_reason: readConfigValue(settings, "governance_require_close_reason"),
812
- governance_create_default_type: readConfigValue(settings, "governance_create_default_type"),
813
- governance_workflow_enforcement: readConfigValue(settings, "governance_workflow_enforcement"),
814
- governance_parent_reference_policy: readConfigValue(settings, "governance_parent_reference_policy"),
815
- governance_metadata_validation_profile: readConfigValue(settings, "governance_metadata_validation_profile"),
816
- governance_force_required_for_stale_lock: readConfigValue(settings, "governance_force_required_for_stale_lock"),
817
- test_result_tracking: readConfigValue(settings, "test_result_tracking"),
818
- telemetry_tracking: readConfigValue(settings, "telemetry_tracking"),
819
- context: readConfigValue(settings, "context"),
820
- };
821
- return withWarnings({
822
- scope,
823
- values,
824
- settings_path: target.settingsPath,
825
- changed: false,
826
- }, warnings);
708
+ const rawValue = options.value;
709
+ if (typeof rawValue !== "string") {
710
+ throw new PmCliError(`Config set ${nestedSetting.key} requires a value. Pass it positionally (\`pm config ${context.scope} set ${nestedSetting.key} <value>\`) or via --value.`, EXIT_CODE.USAGE);
827
711
  }
828
- // For get/set (non-nested) `normalizeKeyForAction` already guaranteed a key above,
829
- // so `key` is defined here. list/export return before reaching these branches.
830
- if (action === "get") {
831
- assertConfigKeyDefined(key);
832
- if (key === "item_format") {
833
- return withWarnings({
834
- scope,
835
- key,
836
- format: settings.item_format,
837
- has_explicit_item_format: metadata.has_explicit_item_format,
838
- settings_path: target.settingsPath,
839
- changed: false,
840
- }, warnings);
841
- }
842
- if (key === "history_missing_stream_policy") {
843
- return withWarnings({
844
- scope,
845
- key,
846
- policy: settings.history.missing_stream,
847
- settings_path: target.settingsPath,
848
- changed: false,
849
- }, warnings);
850
- }
851
- if (key === "sprint_release_format_policy") {
852
- return withWarnings({
853
- scope,
854
- key,
855
- policy: settings.validation.sprint_release_format,
856
- settings_path: target.settingsPath,
857
- changed: false,
858
- }, warnings);
859
- }
860
- if (key === "parent_reference_policy") {
861
- return withWarnings({
862
- scope,
863
- key,
864
- policy: settings.validation.parent_reference,
865
- settings_path: target.settingsPath,
866
- changed: false,
867
- }, warnings);
868
- }
869
- if (key === "metadata_validation_profile") {
870
- return withWarnings({
871
- scope,
872
- key,
873
- policy: settings.validation.metadata_profile,
874
- settings_path: target.settingsPath,
875
- changed: false,
876
- }, warnings);
877
- }
878
- if (key === "metadata_required_fields") {
879
- return withWarnings({
880
- scope,
881
- key,
882
- criteria: [...settings.validation.metadata_required_fields],
883
- settings_path: target.settingsPath,
884
- changed: false,
885
- }, warnings);
886
- }
887
- if (key === "lifecycle_stale_blocker_reason_patterns") {
888
- return withWarnings({
889
- scope,
890
- key,
891
- criteria: [...settings.validation.lifecycle_stale_blocker_reason_patterns],
892
- settings_path: target.settingsPath,
893
- changed: false,
894
- }, warnings);
895
- }
896
- if (key === "lifecycle_closure_like_blocked_reason_patterns") {
897
- return withWarnings({
898
- scope,
899
- key,
900
- criteria: [...settings.validation.lifecycle_closure_like_blocked_reason_patterns],
901
- settings_path: target.settingsPath,
902
- changed: false,
903
- }, warnings);
904
- }
905
- if (key === "lifecycle_closure_like_resolution_patterns") {
906
- return withWarnings({
907
- scope,
908
- key,
909
- criteria: [...settings.validation.lifecycle_closure_like_resolution_patterns],
910
- settings_path: target.settingsPath,
911
- changed: false,
912
- }, warnings);
913
- }
914
- if (key === "lifecycle_closure_like_actual_result_patterns") {
915
- return withWarnings({
916
- scope,
917
- key,
918
- criteria: [...settings.validation.lifecycle_closure_like_actual_result_patterns],
919
- settings_path: target.settingsPath,
920
- changed: false,
921
- }, warnings);
922
- }
923
- if (key === "governance_preset") {
924
- return withWarnings({
925
- scope,
926
- key,
927
- policy: settings.governance.preset,
928
- settings_path: target.settingsPath,
929
- changed: false,
930
- }, warnings);
931
- }
932
- if (key === "governance_ownership_enforcement") {
933
- return withWarnings({
934
- scope,
935
- key,
936
- policy: settings.governance.ownership_enforcement,
937
- settings_path: target.settingsPath,
938
- changed: false,
939
- }, warnings);
940
- }
941
- if (key === "governance_create_mode_default") {
942
- return withWarnings({
943
- scope,
944
- key,
945
- policy: settings.governance.create_mode_default,
946
- settings_path: target.settingsPath,
947
- changed: false,
948
- }, warnings);
949
- }
950
- if (key === "governance_close_validation_default") {
951
- return withWarnings({
952
- scope,
953
- key,
954
- policy: settings.governance.close_validation_default,
955
- settings_path: target.settingsPath,
956
- changed: false,
957
- }, warnings);
958
- }
959
- if (key === "governance_require_close_reason") {
960
- return withWarnings({
961
- scope,
962
- key,
963
- policy: settings.governance.require_close_reason ? "enabled" : "disabled",
964
- settings_path: target.settingsPath,
965
- changed: false,
966
- }, warnings);
967
- }
968
- if (key === "governance_create_default_type") {
969
- return withWarnings({
970
- scope,
971
- key,
972
- policy: settings.governance.create_default_type ?? "",
973
- settings_path: target.settingsPath,
974
- changed: false,
975
- }, warnings);
976
- }
977
- if (key === "governance_workflow_enforcement") {
978
- return withWarnings({
979
- scope,
980
- key,
981
- policy: settings.governance.workflow_enforcement ?? "off",
982
- settings_path: target.settingsPath,
983
- changed: false,
984
- }, warnings);
985
- }
986
- if (key === "governance_parent_reference_policy") {
987
- return withWarnings({
988
- scope,
989
- key,
990
- policy: settings.governance.parent_reference,
991
- settings_path: target.settingsPath,
992
- changed: false,
993
- }, warnings);
994
- }
995
- if (key === "governance_metadata_validation_profile") {
996
- return withWarnings({
997
- scope,
998
- key,
999
- policy: settings.governance.metadata_profile,
1000
- settings_path: target.settingsPath,
1001
- changed: false,
1002
- }, warnings);
1003
- }
1004
- if (key === "governance_force_required_for_stale_lock") {
1005
- return withWarnings({
1006
- scope,
1007
- key,
1008
- policy: settings.governance.force_required_for_stale_lock ? "enabled" : "disabled",
1009
- settings_path: target.settingsPath,
1010
- changed: false,
1011
- }, warnings);
1012
- }
1013
- if (key === "test_result_tracking") {
1014
- return withWarnings({
1015
- scope,
1016
- key,
1017
- policy: settings.testing.record_results_to_items ? "enabled" : "disabled",
1018
- settings_path: target.settingsPath,
1019
- changed: false,
1020
- }, warnings);
1021
- }
1022
- if (key === "telemetry_tracking") {
1023
- return withWarnings({
1024
- scope,
1025
- key,
1026
- policy: settings.telemetry.enabled ? "enabled" : "disabled",
1027
- settings_path: target.settingsPath,
1028
- changed: false,
1029
- }, warnings);
1030
- }
1031
- if (key === "context") {
1032
- return withWarnings({
1033
- scope,
1034
- key,
1035
- context_settings: {
1036
- default_depth: settings.context.default_depth,
1037
- activity_limit: settings.context.activity_limit,
1038
- stale_threshold_days: settings.context.stale_threshold_days,
1039
- sections: { ...settings.context.sections },
1040
- },
1041
- settings_path: target.settingsPath,
1042
- changed: false,
1043
- }, warnings);
1044
- }
1045
- return withWarnings({
1046
- scope,
1047
- key,
1048
- criteria: [...settings.workflow.definition_of_done],
1049
- settings_path: target.settingsPath,
1050
- changed: false,
1051
- }, warnings);
712
+ const parsed = parseNestedSettingValue(nestedSetting, rawValue);
713
+ if (!parsed.ok) {
714
+ throw new PmCliError(parsed.error.message, EXIT_CODE.USAGE);
1052
715
  }
1053
- assertConfigKeyDefined(key);
1054
- if (options.clearCriteria === true && !isCriteriaConfigKey(key)) {
1055
- throw new PmCliError("--clear-criteria is only supported with config set criteria-list keys", EXIT_CODE.USAGE);
716
+ const changed = writeNestedSettingValue(context.settings, nestedSetting, parsed.parsed.value);
717
+ if (changed) {
718
+ await writeSettings(context.target.pmRoot, context.settings, `config:set:${nestedSetting.path}`);
1056
719
  }
1057
- if (key === "item_format") {
1058
- const nextFormat = normalizeItemFormat(options.format);
1059
- const changed = settings.item_format !== nextFormat || !metadata.has_explicit_item_format;
1060
- let migration = undefined;
1061
- if (changed) {
1062
- const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
1063
- const migrated = await migrateItemFilesToFormat(target.pmRoot, nextFormat, "config:set:item_format:migrate", typeRegistry.type_to_folder, settings.schema);
1064
- migration = {
1065
- target_format: migrated.target_format,
1066
- scanned: migrated.scanned,
1067
- migrated: migrated.migrated,
1068
- removed: migrated.removed,
1069
- warnings: migrated.warnings,
1070
- };
1071
- settings.item_format = nextFormat;
1072
- await writeSettings(target.pmRoot, settings, "config:set:item_format");
1073
- }
1074
- return withWarnings({
1075
- scope,
1076
- key,
1077
- format: settings.item_format,
1078
- has_explicit_item_format: true,
1079
- migration,
1080
- settings_path: target.settingsPath,
1081
- changed,
1082
- }, warnings);
720
+ return withWarnings({
721
+ scope: context.scope,
722
+ key: nestedSetting.key,
723
+ nested_setting: {
724
+ key: nestedSetting.key,
725
+ path: nestedSetting.path,
726
+ kind: nestedSetting.kind,
727
+ value: parsed.parsed.value,
728
+ },
729
+ settings_path: context.target.settingsPath,
730
+ changed,
731
+ }, context.warnings);
732
+ }
733
+ async function writeConfigSettingsIfChanged(context, changed, reason) {
734
+ if (changed) {
735
+ await writeSettings(context.target.pmRoot, context.settings, reason);
1083
736
  }
737
+ }
738
+ function hasGovernanceValidationMirrorChange(governanceValue, validationValue, nextPolicy) {
739
+ return governanceValue !== nextPolicy || validationValue !== nextPolicy;
740
+ }
741
+ function buildPolicyResult(context, key, policy, changed) {
742
+ return withWarnings({
743
+ scope: context.scope,
744
+ key,
745
+ policy,
746
+ settings_path: context.target.settingsPath,
747
+ changed,
748
+ }, context.warnings);
749
+ }
750
+ function buildCriteriaResult(context, key, criteria, changed) {
751
+ return withWarnings({
752
+ scope: context.scope,
753
+ key,
754
+ criteria,
755
+ settings_path: context.target.settingsPath,
756
+ changed,
757
+ }, context.warnings);
758
+ }
759
+ async function setItemFormatConfig(context, options) {
760
+ const nextFormat = normalizeItemFormat(options.format);
761
+ const changed = context.settings.item_format !== nextFormat || !context.metadata.has_explicit_item_format;
762
+ let migration = undefined;
763
+ if (changed) {
764
+ const typeRegistry = resolveItemTypeRegistry(context.settings, getActiveExtensionRegistrations());
765
+ const migrated = await migrateItemFilesToFormat(context.target.pmRoot, nextFormat, "config:set:item_format:migrate", typeRegistry.type_to_folder, context.settings.schema);
766
+ migration = {
767
+ target_format: migrated.target_format,
768
+ scanned: migrated.scanned,
769
+ migrated: migrated.migrated,
770
+ removed: migrated.removed,
771
+ warnings: migrated.warnings,
772
+ };
773
+ context.settings.item_format = nextFormat;
774
+ await writeSettings(context.target.pmRoot, context.settings, "config:set:item_format");
775
+ }
776
+ return withWarnings({
777
+ scope: context.scope,
778
+ key: "item_format",
779
+ format: context.settings.item_format,
780
+ has_explicit_item_format: true,
781
+ migration,
782
+ settings_path: context.target.settingsPath,
783
+ changed,
784
+ }, context.warnings);
785
+ }
786
+ async function setValidationConfig(context, key, options) {
1084
787
  if (key === "history_missing_stream_policy") {
1085
788
  const nextPolicy = normalizeHistoryMissingStreamPolicy(options.policy);
1086
- const changed = settings.history.missing_stream !== nextPolicy;
1087
- settings.history.missing_stream = nextPolicy;
1088
- if (changed) {
1089
- await writeSettings(target.pmRoot, settings, "config:set:history_missing_stream_policy");
1090
- }
1091
- return withWarnings({
1092
- scope,
1093
- key,
1094
- policy: settings.history.missing_stream,
1095
- settings_path: target.settingsPath,
1096
- changed,
1097
- }, warnings);
789
+ const changed = context.settings.history.missing_stream !== nextPolicy;
790
+ context.settings.history.missing_stream = nextPolicy;
791
+ await writeConfigSettingsIfChanged(context, changed, "config:set:history_missing_stream_policy");
792
+ return buildPolicyResult(context, key, context.settings.history.missing_stream, changed);
1098
793
  }
1099
794
  if (key === "sprint_release_format_policy") {
1100
795
  const nextPolicy = normalizeSprintReleaseFormatPolicy(options.policy);
1101
- const changed = settings.validation.sprint_release_format !== nextPolicy;
1102
- settings.validation.sprint_release_format = nextPolicy;
1103
- if (changed) {
1104
- await writeSettings(target.pmRoot, settings, "config:set:sprint_release_format_policy");
1105
- }
1106
- return withWarnings({
1107
- scope,
1108
- key,
1109
- policy: settings.validation.sprint_release_format,
1110
- settings_path: target.settingsPath,
1111
- changed,
1112
- }, warnings);
796
+ const changed = context.settings.validation.sprint_release_format !== nextPolicy;
797
+ context.settings.validation.sprint_release_format = nextPolicy;
798
+ await writeConfigSettingsIfChanged(context, changed, "config:set:sprint_release_format_policy");
799
+ return buildPolicyResult(context, key, context.settings.validation.sprint_release_format, changed);
1113
800
  }
1114
801
  if (key === "parent_reference_policy") {
1115
802
  const nextPolicy = normalizeParentReferencePolicy(options.policy);
1116
- const changed = settings.validation.parent_reference !== nextPolicy ||
1117
- settings.governance.preset !== "custom" ||
1118
- settings.governance.parent_reference !== nextPolicy;
1119
- settings.validation.parent_reference = nextPolicy;
1120
- settings.governance.preset = "custom";
1121
- settings.governance.parent_reference = nextPolicy;
1122
- if (changed) {
1123
- await writeSettings(target.pmRoot, settings, "config:set:parent_reference_policy");
1124
- }
1125
- return withWarnings({
1126
- scope,
1127
- key,
1128
- policy: settings.validation.parent_reference,
1129
- settings_path: target.settingsPath,
1130
- changed,
1131
- }, warnings);
1132
- }
1133
- if (key === "metadata_validation_profile") {
1134
- const nextPolicy = normalizeValidateMetadataProfile(options.policy);
1135
- const changed = settings.validation.metadata_profile !== nextPolicy ||
1136
- settings.governance.preset !== "custom" ||
1137
- settings.governance.metadata_profile !== nextPolicy;
1138
- settings.validation.metadata_profile = nextPolicy;
1139
- settings.governance.preset = "custom";
1140
- settings.governance.metadata_profile = nextPolicy;
1141
- if (changed) {
1142
- await writeSettings(target.pmRoot, settings, "config:set:metadata_validation_profile");
1143
- }
1144
- return withWarnings({
1145
- scope,
1146
- key,
1147
- policy: settings.validation.metadata_profile,
1148
- settings_path: target.settingsPath,
1149
- changed,
1150
- }, warnings);
1151
- }
803
+ const changed = context.settings.validation.parent_reference !== nextPolicy ||
804
+ context.settings.governance.preset !== "custom" ||
805
+ context.settings.governance.parent_reference !== nextPolicy;
806
+ context.settings.validation.parent_reference = nextPolicy;
807
+ context.settings.governance.preset = "custom";
808
+ context.settings.governance.parent_reference = nextPolicy;
809
+ await writeConfigSettingsIfChanged(context, changed, "config:set:parent_reference_policy");
810
+ return buildPolicyResult(context, key, context.settings.validation.parent_reference, changed);
811
+ }
812
+ const nextPolicy = normalizeValidateMetadataProfile(options.policy);
813
+ const changed = context.settings.validation.metadata_profile !== nextPolicy ||
814
+ context.settings.governance.preset !== "custom" ||
815
+ context.settings.governance.metadata_profile !== nextPolicy;
816
+ context.settings.validation.metadata_profile = nextPolicy;
817
+ context.settings.governance.preset = "custom";
818
+ context.settings.governance.metadata_profile = nextPolicy;
819
+ await writeConfigSettingsIfChanged(context, changed, "config:set:metadata_validation_profile");
820
+ return buildPolicyResult(context, key, context.settings.validation.metadata_profile, changed);
821
+ }
822
+ async function setCriteriaConfig(context, key, options) {
1152
823
  if (key === "metadata_required_fields") {
1153
824
  const nextCriteria = normalizeMetadataRequiredFields(options.criterion, options.clearCriteria);
1154
- const changed = nextCriteria.length !== settings.validation.metadata_required_fields.length ||
1155
- nextCriteria.some((value, index) => value !== settings.validation.metadata_required_fields[index]);
1156
- settings.validation.metadata_required_fields = nextCriteria;
1157
- if (changed) {
1158
- await writeSettings(target.pmRoot, settings, "config:set:metadata_required_fields");
1159
- }
1160
- return withWarnings({
1161
- scope,
1162
- key,
1163
- criteria: [...settings.validation.metadata_required_fields],
1164
- settings_path: target.settingsPath,
1165
- changed,
1166
- }, warnings);
1167
- }
1168
- if (key === "lifecycle_stale_blocker_reason_patterns") {
1169
- const nextCriteria = normalizeLifecyclePatternCriteria(key, options.criterion, options.clearCriteria);
1170
- const changed = nextCriteria.length !== settings.validation.lifecycle_stale_blocker_reason_patterns.length ||
1171
- nextCriteria.some((value, index) => value !== settings.validation.lifecycle_stale_blocker_reason_patterns[index]);
1172
- settings.validation.lifecycle_stale_blocker_reason_patterns = nextCriteria;
1173
- if (changed) {
1174
- await writeSettings(target.pmRoot, settings, "config:set:lifecycle_stale_blocker_reason_patterns");
1175
- }
1176
- return withWarnings({
1177
- scope,
1178
- key,
1179
- criteria: [...settings.validation.lifecycle_stale_blocker_reason_patterns],
1180
- settings_path: target.settingsPath,
1181
- changed,
1182
- }, warnings);
1183
- }
1184
- if (key === "lifecycle_closure_like_blocked_reason_patterns") {
1185
- const nextCriteria = normalizeLifecyclePatternCriteria(key, options.criterion, options.clearCriteria);
1186
- const changed = nextCriteria.length !== settings.validation.lifecycle_closure_like_blocked_reason_patterns.length ||
1187
- nextCriteria.some((value, index) => value !== settings.validation.lifecycle_closure_like_blocked_reason_patterns[index]);
1188
- settings.validation.lifecycle_closure_like_blocked_reason_patterns = nextCriteria;
1189
- if (changed) {
1190
- await writeSettings(target.pmRoot, settings, "config:set:lifecycle_closure_like_blocked_reason_patterns");
1191
- }
1192
- return withWarnings({
1193
- scope,
1194
- key,
1195
- criteria: [...settings.validation.lifecycle_closure_like_blocked_reason_patterns],
1196
- settings_path: target.settingsPath,
1197
- changed,
1198
- }, warnings);
1199
- }
1200
- if (key === "lifecycle_closure_like_resolution_patterns") {
1201
- const nextCriteria = normalizeLifecyclePatternCriteria(key, options.criterion, options.clearCriteria);
1202
- const changed = nextCriteria.length !== settings.validation.lifecycle_closure_like_resolution_patterns.length ||
1203
- nextCriteria.some((value, index) => value !== settings.validation.lifecycle_closure_like_resolution_patterns[index]);
1204
- settings.validation.lifecycle_closure_like_resolution_patterns = nextCriteria;
1205
- if (changed) {
1206
- await writeSettings(target.pmRoot, settings, "config:set:lifecycle_closure_like_resolution_patterns");
1207
- }
1208
- return withWarnings({
1209
- scope,
1210
- key,
1211
- criteria: [...settings.validation.lifecycle_closure_like_resolution_patterns],
1212
- settings_path: target.settingsPath,
1213
- changed,
1214
- }, warnings);
1215
- }
1216
- if (key === "lifecycle_closure_like_actual_result_patterns") {
1217
- const nextCriteria = normalizeLifecyclePatternCriteria(key, options.criterion, options.clearCriteria);
1218
- const changed = nextCriteria.length !== settings.validation.lifecycle_closure_like_actual_result_patterns.length ||
1219
- nextCriteria.some((value, index) => value !== settings.validation.lifecycle_closure_like_actual_result_patterns[index]);
1220
- settings.validation.lifecycle_closure_like_actual_result_patterns = nextCriteria;
1221
- if (changed) {
1222
- await writeSettings(target.pmRoot, settings, "config:set:lifecycle_closure_like_actual_result_patterns");
1223
- }
1224
- return withWarnings({
1225
- scope,
1226
- key,
1227
- criteria: [...settings.validation.lifecycle_closure_like_actual_result_patterns],
1228
- settings_path: target.settingsPath,
1229
- changed,
1230
- }, warnings);
1231
- }
825
+ const changed = nextCriteria.length !== context.settings.validation.metadata_required_fields.length ||
826
+ nextCriteria.some((value, index) => value !== context.settings.validation.metadata_required_fields[index]);
827
+ context.settings.validation.metadata_required_fields = nextCriteria;
828
+ await writeConfigSettingsIfChanged(context, changed, "config:set:metadata_required_fields");
829
+ return buildCriteriaResult(context, key, [...context.settings.validation.metadata_required_fields], changed);
830
+ }
831
+ const lifecycleTargets = {
832
+ lifecycle_stale_blocker_reason_patterns: context.settings.validation.lifecycle_stale_blocker_reason_patterns,
833
+ lifecycle_closure_like_blocked_reason_patterns: context.settings.validation.lifecycle_closure_like_blocked_reason_patterns,
834
+ lifecycle_closure_like_resolution_patterns: context.settings.validation.lifecycle_closure_like_resolution_patterns,
835
+ lifecycle_closure_like_actual_result_patterns: context.settings.validation.lifecycle_closure_like_actual_result_patterns,
836
+ };
837
+ const currentCriteria = lifecycleTargets[key];
838
+ const nextCriteria = normalizeLifecyclePatternCriteria(key, options.criterion, options.clearCriteria);
839
+ const changed = nextCriteria.length !== currentCriteria.length ||
840
+ nextCriteria.some((value, index) => value !== currentCriteria[index]);
841
+ currentCriteria.splice(0, currentCriteria.length, ...nextCriteria);
842
+ await writeConfigSettingsIfChanged(context, changed, `config:set:${key}`);
843
+ return buildCriteriaResult(context, key, [...currentCriteria], changed);
844
+ }
845
+ async function setGovernancePresetOrTypeConfig(context, key, options) {
1232
846
  if (key === "governance_preset") {
1233
847
  const nextPolicy = normalizeGovernancePreset(options.policy);
1234
- const changed = settings.governance.preset !== nextPolicy;
1235
- settings.governance.preset = nextPolicy;
1236
- if (changed) {
1237
- await writeSettings(target.pmRoot, settings, "config:set:governance_preset");
1238
- }
1239
- return withWarnings({
1240
- scope,
1241
- key,
1242
- policy: settings.governance.preset,
1243
- settings_path: target.settingsPath,
1244
- changed,
1245
- }, warnings);
1246
- }
848
+ const changed = context.settings.governance.preset !== nextPolicy;
849
+ context.settings.governance.preset = nextPolicy;
850
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_preset");
851
+ return buildPolicyResult(context, key, context.settings.governance.preset, changed);
852
+ }
853
+ const policyProvided = typeof options.policy === "string";
854
+ const rawType = policyProvided ? options.policy.trim() : "";
855
+ if (policyProvided && rawType.length === 0) {
856
+ const changed = context.settings.governance.create_default_type !== undefined;
857
+ delete context.settings.governance.create_default_type;
858
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_create_default_type");
859
+ return buildPolicyResult(context, key, context.settings.governance.create_default_type ?? "", changed);
860
+ }
861
+ if (rawType.length === 0) {
862
+ throw new PmCliError('Config set governance-create-default-type requires an item type value (or an empty value "" to clear it)', EXIT_CODE.USAGE);
863
+ }
864
+ const typeRegistry = resolveItemTypeRegistry(context.settings, getActiveExtensionRegistrations());
865
+ const resolvedType = resolveTypeName(rawType, typeRegistry);
866
+ if (!resolvedType) {
867
+ throw new PmCliError(buildInvalidTypeError(rawType, typeRegistry.types, resolveItemTypesFilePath(context.target.pmRoot, context.settings.schema)), EXIT_CODE.USAGE);
868
+ }
869
+ const changed = context.settings.governance.create_default_type !== resolvedType;
870
+ context.settings.governance.create_default_type = resolvedType;
871
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_create_default_type");
872
+ return buildPolicyResult(context, key, context.settings.governance.create_default_type, changed);
873
+ }
874
+ async function setGovernancePolicyConfig(context, key, options) {
1247
875
  if (key === "governance_ownership_enforcement") {
1248
876
  const nextPolicy = normalizeGovernanceOwnershipEnforcement(options.policy);
1249
- const changed = settings.governance.preset !== "custom" || settings.governance.ownership_enforcement !== nextPolicy;
1250
- settings.governance.preset = "custom";
1251
- settings.governance.ownership_enforcement = nextPolicy;
1252
- if (changed) {
1253
- await writeSettings(target.pmRoot, settings, "config:set:governance_ownership_enforcement");
1254
- }
1255
- return withWarnings({
1256
- scope,
1257
- key,
1258
- policy: settings.governance.ownership_enforcement,
1259
- settings_path: target.settingsPath,
1260
- changed,
1261
- }, warnings);
877
+ const changed = context.settings.governance.preset !== "custom" ||
878
+ context.settings.governance.ownership_enforcement !== nextPolicy;
879
+ context.settings.governance.preset = "custom";
880
+ context.settings.governance.ownership_enforcement = nextPolicy;
881
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_ownership_enforcement");
882
+ return buildPolicyResult(context, key, context.settings.governance.ownership_enforcement, changed);
1262
883
  }
1263
884
  if (key === "governance_create_mode_default") {
1264
885
  const nextPolicy = normalizeGovernanceCreateModeDefault(options.policy);
1265
- const changed = settings.governance.preset !== "custom" || settings.governance.create_mode_default !== nextPolicy;
1266
- settings.governance.preset = "custom";
1267
- settings.governance.create_mode_default = nextPolicy;
1268
- if (changed) {
1269
- await writeSettings(target.pmRoot, settings, "config:set:governance_create_mode_default");
1270
- }
1271
- return withWarnings({
1272
- scope,
1273
- key,
1274
- policy: settings.governance.create_mode_default,
1275
- settings_path: target.settingsPath,
1276
- changed,
1277
- }, warnings);
1278
- }
1279
- if (key === "governance_close_validation_default") {
1280
- const nextPolicy = normalizeGovernanceCloseValidationDefault(options.policy);
1281
- const changed = settings.governance.preset !== "custom" || settings.governance.close_validation_default !== nextPolicy;
1282
- settings.governance.preset = "custom";
1283
- settings.governance.close_validation_default = nextPolicy;
1284
- if (changed) {
1285
- await writeSettings(target.pmRoot, settings, "config:set:governance_close_validation_default");
1286
- }
1287
- return withWarnings({
1288
- scope,
1289
- key,
1290
- policy: settings.governance.close_validation_default,
1291
- settings_path: target.settingsPath,
1292
- changed,
1293
- }, warnings);
1294
- }
1295
- if (key === "governance_require_close_reason") {
1296
- const nextPolicy = normalizeGovernanceRequireCloseReasonPolicy(options.policy);
1297
- const nextEnabled = nextPolicy === "enabled";
1298
- const changed = settings.governance.require_close_reason !== nextEnabled;
1299
- settings.governance.require_close_reason = nextEnabled;
1300
- if (changed) {
1301
- await writeSettings(target.pmRoot, settings, "config:set:governance_require_close_reason");
1302
- }
1303
- return withWarnings({
1304
- scope,
1305
- key,
1306
- policy: settings.governance.require_close_reason ? "enabled" : "disabled",
1307
- settings_path: target.settingsPath,
1308
- changed,
1309
- }, warnings);
1310
- }
1311
- if (key === "governance_create_default_type") {
1312
- const policyProvided = typeof options.policy === "string";
1313
- const rawType = policyProvided ? options.policy.trim() : "";
1314
- // An explicit empty value clears the setting back to "unset" (matching how
1315
- // get/export expose unset as ""). Without this clear path there is no CLI
1316
- // route back from a set value to the governance default.
1317
- if (policyProvided && rawType.length === 0) {
1318
- const changed = settings.governance.create_default_type !== undefined;
1319
- delete settings.governance.create_default_type;
1320
- if (changed) {
1321
- await writeSettings(target.pmRoot, settings, "config:set:governance_create_default_type");
1322
- }
1323
- return withWarnings({
1324
- scope,
1325
- key,
1326
- policy: settings.governance.create_default_type ?? "",
1327
- settings_path: target.settingsPath,
1328
- changed,
1329
- }, warnings);
1330
- }
1331
- if (rawType.length === 0) {
1332
- throw new PmCliError('Config set governance-create-default-type requires an item type value (or an empty value "" to clear it)', EXIT_CODE.USAGE);
1333
- }
1334
- // create_default_type is preset-orthogonal: it tunes `pm create` and is
1335
- // carried through writes regardless of preset, so we do NOT force preset=custom.
1336
- const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
1337
- const resolvedType = resolveTypeName(rawType, typeRegistry);
1338
- if (!resolvedType) {
1339
- throw new PmCliError(buildInvalidTypeError(rawType, typeRegistry.types, resolveItemTypesFilePath(target.pmRoot, settings.schema)), EXIT_CODE.USAGE);
1340
- }
1341
- const changed = settings.governance.create_default_type !== resolvedType;
1342
- settings.governance.create_default_type = resolvedType;
1343
- if (changed) {
1344
- await writeSettings(target.pmRoot, settings, "config:set:governance_create_default_type");
1345
- }
1346
- return withWarnings({
1347
- scope,
1348
- key,
1349
- policy: settings.governance.create_default_type,
1350
- settings_path: target.settingsPath,
1351
- changed,
1352
- }, warnings);
1353
- }
1354
- if (key === "governance_workflow_enforcement") {
1355
- const nextPolicy = normalizeGovernanceWorkflowEnforcement(options.policy);
1356
- // workflow_enforcement is preset-orthogonal (see create_default_type above).
1357
- const changed = (settings.governance.workflow_enforcement ?? "off") !== nextPolicy;
1358
- settings.governance.workflow_enforcement = nextPolicy;
1359
- if (changed) {
1360
- await writeSettings(target.pmRoot, settings, "config:set:governance_workflow_enforcement");
1361
- }
1362
- return withWarnings({
1363
- scope,
1364
- key,
1365
- policy: settings.governance.workflow_enforcement,
1366
- settings_path: target.settingsPath,
1367
- changed,
1368
- }, warnings);
1369
- }
886
+ const changed = context.settings.governance.preset !== "custom" ||
887
+ context.settings.governance.create_mode_default !== nextPolicy;
888
+ context.settings.governance.preset = "custom";
889
+ context.settings.governance.create_mode_default = nextPolicy;
890
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_create_mode_default");
891
+ return buildPolicyResult(context, key, context.settings.governance.create_mode_default, changed);
892
+ }
893
+ const nextPolicy = normalizeGovernanceCloseValidationDefault(options.policy);
894
+ const changed = context.settings.governance.preset !== "custom" ||
895
+ context.settings.governance.close_validation_default !== nextPolicy;
896
+ context.settings.governance.preset = "custom";
897
+ context.settings.governance.close_validation_default = nextPolicy;
898
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_close_validation_default");
899
+ return buildPolicyResult(context, key, context.settings.governance.close_validation_default, changed);
900
+ }
901
+ async function setGovernanceValidationConfig(context, key, options) {
1370
902
  if (key === "governance_parent_reference_policy") {
1371
903
  const nextPolicy = normalizeParentReferencePolicy(options.policy);
1372
- const changed = settings.governance.preset !== "custom" || settings.governance.parent_reference !== nextPolicy;
1373
- settings.governance.preset = "custom";
1374
- settings.governance.parent_reference = nextPolicy;
1375
- settings.validation.parent_reference = nextPolicy;
1376
- if (changed) {
1377
- await writeSettings(target.pmRoot, settings, "config:set:governance_parent_reference_policy");
1378
- }
1379
- return withWarnings({
1380
- scope,
1381
- key,
1382
- policy: settings.governance.parent_reference,
1383
- settings_path: target.settingsPath,
1384
- changed,
1385
- }, warnings);
904
+ const changed = context.settings.governance.preset !== "custom" ||
905
+ hasGovernanceValidationMirrorChange(context.settings.governance.parent_reference, context.settings.validation.parent_reference, nextPolicy);
906
+ context.settings.governance.preset = "custom";
907
+ context.settings.governance.parent_reference = nextPolicy;
908
+ context.settings.validation.parent_reference = nextPolicy;
909
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_parent_reference_policy");
910
+ return buildPolicyResult(context, key, context.settings.governance.parent_reference, changed);
1386
911
  }
1387
912
  if (key === "governance_metadata_validation_profile") {
1388
913
  const nextPolicy = normalizeValidateMetadataProfile(options.policy);
1389
- const changed = settings.governance.preset !== "custom" || settings.governance.metadata_profile !== nextPolicy;
1390
- settings.governance.preset = "custom";
1391
- settings.governance.metadata_profile = nextPolicy;
1392
- settings.validation.metadata_profile = nextPolicy;
1393
- if (changed) {
1394
- await writeSettings(target.pmRoot, settings, "config:set:governance_metadata_validation_profile");
1395
- }
1396
- return withWarnings({
1397
- scope,
1398
- key,
1399
- policy: settings.governance.metadata_profile,
1400
- settings_path: target.settingsPath,
1401
- changed,
1402
- }, warnings);
1403
- }
1404
- if (key === "governance_force_required_for_stale_lock") {
1405
- const nextPolicy = normalizeGovernanceForceRequiredForStaleLockPolicy(options.policy);
914
+ const changed = context.settings.governance.preset !== "custom" ||
915
+ hasGovernanceValidationMirrorChange(context.settings.governance.metadata_profile, context.settings.validation.metadata_profile, nextPolicy);
916
+ context.settings.governance.preset = "custom";
917
+ context.settings.governance.metadata_profile = nextPolicy;
918
+ context.settings.validation.metadata_profile = nextPolicy;
919
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_metadata_validation_profile");
920
+ return buildPolicyResult(context, key, context.settings.governance.metadata_profile, changed);
921
+ }
922
+ const nextPolicy = normalizeGovernanceWorkflowEnforcement(options.policy);
923
+ const changed = (context.settings.governance.workflow_enforcement ?? "off") !== nextPolicy;
924
+ context.settings.governance.workflow_enforcement = nextPolicy;
925
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_workflow_enforcement");
926
+ return buildPolicyResult(context, key, context.settings.governance.workflow_enforcement, changed);
927
+ }
928
+ async function setGovernanceBooleanConfig(context, key, options) {
929
+ if (key === "governance_require_close_reason") {
930
+ const nextPolicy = normalizeGovernanceRequireCloseReasonPolicy(options.policy);
1406
931
  const nextEnabled = nextPolicy === "enabled";
1407
- const changed = settings.governance.preset !== "custom" || settings.governance.force_required_for_stale_lock !== nextEnabled;
1408
- settings.governance.preset = "custom";
1409
- settings.governance.force_required_for_stale_lock = nextEnabled;
1410
- if (changed) {
1411
- await writeSettings(target.pmRoot, settings, "config:set:governance_force_required_for_stale_lock");
1412
- }
1413
- return withWarnings({
1414
- scope,
1415
- key,
1416
- policy: settings.governance.force_required_for_stale_lock ? "enabled" : "disabled",
1417
- settings_path: target.settingsPath,
1418
- changed,
1419
- }, warnings);
1420
- }
932
+ const changed = context.settings.governance.require_close_reason !== nextEnabled;
933
+ context.settings.governance.require_close_reason = nextEnabled;
934
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_require_close_reason");
935
+ return buildPolicyResult(context, key, context.settings.governance.require_close_reason ? "enabled" : "disabled", changed);
936
+ }
937
+ const nextPolicy = normalizeGovernanceForceRequiredForStaleLockPolicy(options.policy);
938
+ const nextEnabled = nextPolicy === "enabled";
939
+ const changed = context.settings.governance.preset !== "custom" ||
940
+ context.settings.governance.force_required_for_stale_lock !== nextEnabled;
941
+ context.settings.governance.preset = "custom";
942
+ context.settings.governance.force_required_for_stale_lock = nextEnabled;
943
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_force_required_for_stale_lock");
944
+ return buildPolicyResult(context, key, context.settings.governance.force_required_for_stale_lock ? "enabled" : "disabled", changed);
945
+ }
946
+ async function setTrackingConfig(context, key, options) {
1421
947
  if (key === "test_result_tracking") {
1422
948
  const nextPolicy = normalizeTestResultTrackingPolicy(options.policy);
1423
949
  const nextEnabled = nextPolicy === "enabled";
1424
- const changed = settings.testing.record_results_to_items !== nextEnabled;
1425
- settings.testing.record_results_to_items = nextEnabled;
1426
- if (changed) {
1427
- await writeSettings(target.pmRoot, settings, "config:set:test_result_tracking");
1428
- }
1429
- return withWarnings({
1430
- scope,
1431
- key,
1432
- policy: settings.testing.record_results_to_items ? "enabled" : "disabled",
1433
- settings_path: target.settingsPath,
1434
- changed,
1435
- }, warnings);
1436
- }
1437
- if (key === "telemetry_tracking") {
1438
- const nextPolicy = normalizeTelemetryTrackingPolicy(options.policy);
1439
- const nextEnabled = nextPolicy === "enabled";
1440
- const changed = settings.telemetry.enabled !== nextEnabled || !settings.telemetry.first_run_prompt_completed;
1441
- settings.telemetry.enabled = nextEnabled;
1442
- settings.telemetry.first_run_prompt_completed = true;
1443
- if (changed) {
1444
- await writeSettings(target.pmRoot, settings, "config:set:telemetry_tracking");
1445
- }
1446
- return withWarnings({
1447
- scope,
1448
- key,
1449
- policy: settings.telemetry.enabled ? "enabled" : "disabled",
1450
- settings_path: target.settingsPath,
1451
- changed,
1452
- }, warnings);
950
+ const changed = context.settings.testing.record_results_to_items !== nextEnabled;
951
+ context.settings.testing.record_results_to_items = nextEnabled;
952
+ await writeConfigSettingsIfChanged(context, changed, "config:set:test_result_tracking");
953
+ return buildPolicyResult(context, key, context.settings.testing.record_results_to_items ? "enabled" : "disabled", changed);
954
+ }
955
+ const nextPolicy = normalizeTelemetryTrackingPolicy(options.policy);
956
+ const nextEnabled = nextPolicy === "enabled";
957
+ const changed = context.settings.telemetry.enabled !== nextEnabled ||
958
+ !context.settings.telemetry.first_run_prompt_completed;
959
+ context.settings.telemetry.enabled = nextEnabled;
960
+ context.settings.telemetry.first_run_prompt_completed = true;
961
+ await writeConfigSettingsIfChanged(context, changed, "config:set:telemetry_tracking");
962
+ return buildPolicyResult(context, key, context.settings.telemetry.enabled ? "enabled" : "disabled", changed);
963
+ }
964
+ async function setDefinitionOfDoneConfig(context, key, options) {
965
+ const nextCriteria = normalizeCriteria(options.criterion, options.clearCriteria);
966
+ const changed = nextCriteria.length !== context.settings.workflow.definition_of_done.length ||
967
+ nextCriteria.some((value, index) => value !== context.settings.workflow.definition_of_done[index]);
968
+ context.settings.workflow.definition_of_done = nextCriteria;
969
+ await writeConfigSettingsIfChanged(context, changed, "config:set:definition_of_done");
970
+ return buildCriteriaResult(context, key, [...context.settings.workflow.definition_of_done], changed);
971
+ }
972
+ async function setConfigValue(context, key, options) {
973
+ if (options.clearCriteria === true && !isCriteriaConfigKey(key)) {
974
+ throw new PmCliError("--clear-criteria is only supported with config set criteria-list keys", EXIT_CODE.USAGE);
975
+ }
976
+ if (key === "item_format") {
977
+ return setItemFormatConfig(context, options);
1453
978
  }
1454
979
  if (key === "context") {
1455
- return applyContextConfig(settings, options, target, scope, warnings);
980
+ return applyContextConfig(context.settings, options, context.target, context.scope, context.warnings);
1456
981
  }
1457
- const nextCriteria = normalizeCriteria(options.criterion, options.clearCriteria);
1458
- const changed = nextCriteria.length !== settings.workflow.definition_of_done.length ||
1459
- nextCriteria.some((value, index) => value !== settings.workflow.definition_of_done[index]);
1460
- settings.workflow.definition_of_done = nextCriteria;
1461
- if (changed) {
1462
- await writeSettings(target.pmRoot, settings, "config:set:definition_of_done");
982
+ if (key === "definition_of_done") {
983
+ return setDefinitionOfDoneConfig(context, key, options);
1463
984
  }
1464
- return withWarnings({
985
+ if (isCriteriaValueConfigKey(key)) {
986
+ return setCriteriaConfig(context, key, options);
987
+ }
988
+ if (TRACKING_CONFIG_KEYS.has(key)) {
989
+ return setTrackingConfig(context, key, options);
990
+ }
991
+ if (GOVERNANCE_BOOLEAN_CONFIG_KEYS.has(key)) {
992
+ return setGovernanceBooleanConfig(context, key, options);
993
+ }
994
+ if (isGovernancePolicyConfigKey(key)) {
995
+ return setGovernancePolicyConfig(context, key, options);
996
+ }
997
+ if (isGovernanceValidationConfigKey(key)) {
998
+ return setGovernanceValidationConfig(context, key, options);
999
+ }
1000
+ if (isGovernancePresetOrTypeConfigKey(key)) {
1001
+ return setGovernancePresetOrTypeConfig(context, key, options);
1002
+ }
1003
+ return setValidationConfig(context, key, options);
1004
+ }
1005
+ /**
1006
+ * Implements run config for the public runtime surface of this module.
1007
+ */
1008
+ export async function runConfig(scopeValue, actionValue, keyValue, options, global, valueValue) {
1009
+ const scope = normalizeScope(scopeValue);
1010
+ const action = normalizeAction(actionValue);
1011
+ const nestedSetting = (action === "get" || action === "set") ? resolveNestedSettingDescriptor(keyValue) : undefined;
1012
+ const key = nestedSetting ? undefined : normalizeKeyForAction(action, keyValue);
1013
+ const routedOptions = applyPositionalValue(action, keyValue, key, nestedSetting, valueValue, options);
1014
+ const target = await resolveSettingsTarget(scope, global);
1015
+ const { settings, metadata, warnings: settingsReadWarnings } = await readSettingsWithMetadata(target.pmRoot);
1016
+ const context = {
1465
1017
  scope,
1466
- key,
1467
- criteria: [...settings.workflow.definition_of_done],
1468
- settings_path: target.settingsPath,
1469
- changed,
1470
- }, warnings);
1018
+ target,
1019
+ settings,
1020
+ metadata,
1021
+ warnings: normalizeWarnings(settingsReadWarnings),
1022
+ };
1023
+ if (nestedSetting) {
1024
+ return buildNestedSettingResult(context, action, nestedSetting, routedOptions);
1025
+ }
1026
+ if (action === "list") {
1027
+ return buildConfigListResult(context);
1028
+ }
1029
+ if (action === "export") {
1030
+ return buildConfigExportResult(context);
1031
+ }
1032
+ assertConfigKeyDefined(key);
1033
+ return action === "get" ? buildConfigGetResult(context, key) : setConfigValue(context, key, routedOptions);
1471
1034
  }
1472
1035
  export const _testOnlyConfigCommand = {
1036
+ hasGovernanceValidationMirrorChange,
1473
1037
  applyPositionalValue,
1474
1038
  normalizeAction,
1475
1039
  normalizeCriteria,
@@ -1492,4 +1056,4 @@ export const _testOnlyConfigCommand = {
1492
1056
  normalizeWarnings,
1493
1057
  };
1494
1058
  //# sourceMappingURL=config.js.map
1495
- //# debugId=0be07fdd-a74d-5d01-a1b7-bd26e021bf20
1059
+ //# debugId=a420e612-3d4b-5ebd-864e-a1a4bec5e45d