@unbrained/pm-cli 2026.7.1 → 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 (563) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cli/commander-usage.d.ts +2 -0
  3. package/dist/cli/commander-usage.js +58 -47
  4. package/dist/cli/commander-usage.js.map +1 -1
  5. package/dist/cli/commands/aggregate.js +102 -79
  6. package/dist/cli/commands/aggregate.js.map +1 -1
  7. package/dist/cli/commands/calendar.js +278 -243
  8. package/dist/cli/commands/calendar.js.map +1 -1
  9. package/dist/cli/commands/close-many.js +89 -68
  10. package/dist/cli/commands/close-many.js.map +1 -1
  11. package/dist/cli/commands/close.js +157 -129
  12. package/dist/cli/commands/close.js.map +1 -1
  13. package/dist/cli/commands/comments-audit.js +50 -42
  14. package/dist/cli/commands/comments-audit.js.map +1 -1
  15. package/dist/cli/commands/config.d.ts +2 -0
  16. package/dist/cli/commands/config.js +443 -879
  17. package/dist/cli/commands/config.js.map +1 -1
  18. package/dist/cli/commands/context.js +365 -287
  19. package/dist/cli/commands/context.js.map +1 -1
  20. package/dist/cli/commands/contracts.js +352 -238
  21. package/dist/cli/commands/contracts.js.map +1 -1
  22. package/dist/cli/commands/dedupe-audit.js +46 -39
  23. package/dist/cli/commands/dedupe-audit.js.map +1 -1
  24. package/dist/cli/commands/dedupe-merge.js +88 -69
  25. package/dist/cli/commands/dedupe-merge.js.map +1 -1
  26. package/dist/cli/commands/get.js +114 -81
  27. package/dist/cli/commands/get.js.map +1 -1
  28. package/dist/cli/commands/health.d.ts +17 -0
  29. package/dist/cli/commands/health.js +446 -307
  30. package/dist/cli/commands/health.js.map +1 -1
  31. package/dist/cli/commands/history-compact.js +209 -140
  32. package/dist/cli/commands/history-compact.js.map +1 -1
  33. package/dist/cli/commands/history-redact.js +162 -119
  34. package/dist/cli/commands/history-redact.js.map +1 -1
  35. package/dist/cli/commands/history-repair.js +120 -85
  36. package/dist/cli/commands/history-repair.js.map +1 -1
  37. package/dist/cli/commands/init.d.ts +8 -2
  38. package/dist/cli/commands/init.js +263 -162
  39. package/dist/cli/commands/init.js.map +1 -1
  40. package/dist/cli/commands/list.js +152 -102
  41. package/dist/cli/commands/list.js.map +1 -1
  42. package/dist/cli/commands/next.js +49 -32
  43. package/dist/cli/commands/next.js.map +1 -1
  44. package/dist/cli/commands/plan.js +373 -298
  45. package/dist/cli/commands/plan.js.map +1 -1
  46. package/dist/cli/commands/recurrence-parsers.js +43 -25
  47. package/dist/cli/commands/recurrence-parsers.js.map +1 -1
  48. package/dist/cli/commands/reindex.d.ts +21 -5
  49. package/dist/cli/commands/reindex.js +345 -205
  50. package/dist/cli/commands/reindex.js.map +1 -1
  51. package/dist/cli/commands/restore.d.ts +8 -7
  52. package/dist/cli/commands/restore.js +105 -69
  53. package/dist/cli/commands/restore.js.map +1 -1
  54. package/dist/cli/commands/schema.js +33 -30
  55. package/dist/cli/commands/schema.js.map +1 -1
  56. package/dist/cli/commands/search.d.ts +10 -2
  57. package/dist/cli/commands/search.js +503 -470
  58. package/dist/cli/commands/search.js.map +1 -1
  59. package/dist/cli/commands/telemetry.js +98 -87
  60. package/dist/cli/commands/telemetry.js.map +1 -1
  61. package/dist/cli/commands/test-all.js +237 -168
  62. package/dist/cli/commands/test-all.js.map +1 -1
  63. package/dist/cli/commands/test.d.ts +6 -5
  64. package/dist/cli/commands/test.js +424 -344
  65. package/dist/cli/commands/test.js.map +1 -1
  66. package/dist/cli/commands/update-many.js +57 -42
  67. package/dist/cli/commands/update-many.js.map +1 -1
  68. package/dist/cli/commands/update.d.ts +1 -1
  69. package/dist/cli/commands/update.js +738 -671
  70. package/dist/cli/commands/update.js.map +1 -1
  71. package/dist/cli/commands/validate.d.ts +18 -1
  72. package/dist/cli/commands/validate.js +466 -343
  73. package/dist/cli/commands/validate.js.map +1 -1
  74. package/dist/cli/error-guidance.js +399 -357
  75. package/dist/cli/error-guidance.js.map +1 -1
  76. package/dist/cli/main.d.ts +47 -0
  77. package/dist/cli/main.js +428 -341
  78. package/dist/cli/main.js.map +1 -1
  79. package/dist/cli/migration-gates.js +22 -45
  80. package/dist/cli/migration-gates.js.map +1 -1
  81. package/dist/cli/register-list-query.js +94 -105
  82. package/dist/cli/register-list-query.js.map +1 -1
  83. package/dist/cli/register-mutation.js +400 -416
  84. package/dist/cli/register-mutation.js.map +1 -1
  85. package/dist/cli/register-operations.js +86 -66
  86. package/dist/cli/register-operations.js.map +1 -1
  87. package/dist/cli/register-setup.js +120 -101
  88. package/dist/cli/register-setup.js.map +1 -1
  89. package/dist/cli-bundle/chunks/{activity-DBLQVIP6.js → activity-CUC4JY3U.js} +9 -9
  90. package/dist/cli-bundle/chunks/activity-WEIEMM73.js +16 -0
  91. package/dist/cli-bundle/chunks/{aggregate-JTEF4BP7.js → aggregate-DKUTRY6R.js} +108 -84
  92. package/dist/cli-bundle/chunks/aggregate-DKUTRY6R.js.map +1 -0
  93. package/dist/cli-bundle/chunks/{aggregate-SDF7DUOD.js → aggregate-SW5PNGCS.js} +107 -83
  94. package/dist/cli-bundle/chunks/{aggregate-SDF7DUOD.js.map → aggregate-SW5PNGCS.js.map} +2 -2
  95. package/dist/cli-bundle/chunks/{append-QCFJSDFL.js → append-H32VOR2Y.js} +6 -6
  96. package/dist/cli-bundle/chunks/{append-LOVPGVPT.js → append-UBM632FK.js} +6 -6
  97. package/dist/cli-bundle/chunks/{chunk-RLDHZHQS.js → chunk-2227673O.js} +158 -114
  98. package/dist/cli-bundle/chunks/chunk-2227673O.js.map +1 -0
  99. package/dist/cli-bundle/chunks/{chunk-SLMUGTK3.js → chunk-2ASNV4DH.js} +4 -4
  100. package/dist/cli-bundle/chunks/{chunk-UZIWVBE6.js → chunk-2CHRYUXL.js} +2 -2
  101. package/dist/cli-bundle/chunks/{chunk-NWMZWYYB.js → chunk-2KWL5NPW.js} +42 -27
  102. package/dist/cli-bundle/chunks/chunk-2KWL5NPW.js.map +1 -0
  103. package/dist/cli-bundle/chunks/{chunk-NFDPYAIP.js → chunk-36UGKF4O.js} +21 -29
  104. package/dist/cli-bundle/chunks/chunk-36UGKF4O.js.map +7 -0
  105. package/dist/cli-bundle/chunks/{chunk-NU2UEROZ.js → chunk-3AZUFQK6.js} +6 -6
  106. package/dist/cli-bundle/chunks/{chunk-LB6TP6MC.js → chunk-3LCUASYG.js} +2 -2
  107. package/dist/cli-bundle/chunks/{chunk-HPPFYYOV.js → chunk-3Q2HBMTI.js} +2 -2
  108. package/dist/cli-bundle/chunks/{chunk-IPYBJWTE.js → chunk-4NUOWFBT.js} +109 -72
  109. package/dist/cli-bundle/chunks/chunk-4NUOWFBT.js.map +7 -0
  110. package/dist/cli-bundle/chunks/{chunk-W4ULYO7Z.js → chunk-55XRYWEG.js} +6 -6
  111. package/dist/cli-bundle/chunks/{chunk-HXTQJXWT.js → chunk-5GVTFFTC.js} +2 -2
  112. package/dist/cli-bundle/chunks/{chunk-BDTISOSD.js → chunk-5PGBHRY3.js} +41 -26
  113. package/dist/cli-bundle/chunks/chunk-5PGBHRY3.js.map +7 -0
  114. package/dist/cli-bundle/chunks/{chunk-YITK2PJ6.js → chunk-66Z3X7ZG.js} +261 -161
  115. package/dist/cli-bundle/chunks/chunk-66Z3X7ZG.js.map +7 -0
  116. package/dist/cli-bundle/chunks/{chunk-NUHHPVVS.js → chunk-6ITZLD4T.js} +712 -612
  117. package/dist/cli-bundle/chunks/chunk-6ITZLD4T.js.map +7 -0
  118. package/dist/cli-bundle/chunks/{chunk-V3NOKJF2.js → chunk-6YCYF2AI.js} +262 -162
  119. package/dist/cli-bundle/chunks/chunk-6YCYF2AI.js.map +1 -0
  120. package/dist/cli-bundle/chunks/{chunk-BZCEN4JA.js → chunk-6ZMBJRDJ.js} +492 -403
  121. package/dist/cli-bundle/chunks/chunk-6ZMBJRDJ.js.map +7 -0
  122. package/dist/cli-bundle/chunks/{chunk-CF7RL6FR.js → chunk-7MYWF4ZX.js} +110 -73
  123. package/dist/cli-bundle/chunks/chunk-7MYWF4ZX.js.map +1 -0
  124. package/dist/cli-bundle/chunks/{chunk-RVUALSJF.js → chunk-7NSPKJUS.js} +356 -285
  125. package/dist/cli-bundle/chunks/chunk-7NSPKJUS.js.map +7 -0
  126. package/dist/cli-bundle/chunks/{chunk-4DSGXSBL.js → chunk-7TH5NMVB.js} +95 -53
  127. package/dist/cli-bundle/chunks/chunk-7TH5NMVB.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-ZETXE4SE.js → chunk-7W4H4K26.js} +713 -613
  129. package/dist/cli-bundle/chunks/chunk-7W4H4K26.js.map +1 -0
  130. package/dist/cli-bundle/chunks/{chunk-64HNBBFQ.js → chunk-A6VOGKBA.js} +6 -6
  131. package/dist/cli-bundle/chunks/{chunk-WYDHYJPO.js → chunk-AIAIXG7I.js} +2 -2
  132. package/dist/cli-bundle/chunks/{chunk-CWFNTKQJ.js → chunk-AJEBCRIY.js} +5 -5
  133. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js → chunk-B4O5S7I3.js} +79 -57
  134. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js.map → chunk-B4O5S7I3.js.map} +2 -2
  135. package/dist/cli-bundle/chunks/{chunk-NOLPZMSV.js → chunk-BTX5MIQF.js} +2 -2
  136. package/dist/cli-bundle/chunks/{chunk-RH5ZBYFD.js → chunk-BVZZN2LH.js} +3 -3
  137. package/dist/cli-bundle/chunks/{chunk-27BXPBAY.js → chunk-CYBDUHNO.js} +3 -3
  138. package/dist/cli-bundle/chunks/{chunk-A7FPBAQS.js → chunk-CZPVDLD2.js} +4 -4
  139. package/dist/cli-bundle/chunks/{chunk-3VGN2UWE.js → chunk-EMPGXBUF.js} +22 -30
  140. package/dist/cli-bundle/chunks/chunk-EMPGXBUF.js.map +1 -0
  141. package/dist/cli-bundle/chunks/{chunk-JPECA746.js → chunk-EUKTMRN3.js} +2 -2
  142. package/dist/cli-bundle/chunks/{chunk-2466X6E4.js → chunk-FFOQHGNH.js} +6 -6
  143. package/dist/cli-bundle/chunks/{chunk-JLM7BHI7.js → chunk-GFMSLORL.js} +6 -6
  144. package/dist/cli-bundle/chunks/{chunk-SDR5J34Q.js → chunk-GRRG3MCT.js} +4 -4
  145. package/dist/cli-bundle/chunks/{chunk-GJ326ZKX.js → chunk-H4GRLYJS.js} +3 -3
  146. package/dist/cli-bundle/chunks/{chunk-OGXLACHC.js → chunk-HQTPRV4D.js} +6 -6
  147. package/dist/cli-bundle/chunks/{chunk-7R4QEMZZ.js → chunk-I66WE2HE.js} +354 -283
  148. package/dist/cli-bundle/chunks/chunk-I66WE2HE.js.map +1 -0
  149. package/dist/cli-bundle/chunks/{chunk-BHO33VBQ.js → chunk-IEEJQCZ4.js} +3 -3
  150. package/dist/cli-bundle/chunks/{chunk-JMP4E6D7.js → chunk-IG5JYZGU.js} +390 -312
  151. package/dist/cli-bundle/chunks/{chunk-JMP4E6D7.js.map → chunk-IG5JYZGU.js.map} +2 -2
  152. package/dist/cli-bundle/chunks/{chunk-4DUVCVLZ.js → chunk-JMK5GCK2.js} +2 -2
  153. package/dist/cli-bundle/chunks/{chunk-3K2M5OYU.js → chunk-JXAUVO6X.js} +258 -169
  154. package/dist/cli-bundle/chunks/{chunk-3K2M5OYU.js.map → chunk-JXAUVO6X.js.map} +2 -2
  155. package/dist/cli-bundle/chunks/{chunk-AXIDKKAT.js → chunk-K2VYLVX4.js} +2 -2
  156. package/dist/cli-bundle/chunks/{chunk-EJUDVUYZ.js → chunk-KCO2EAN5.js} +3 -3
  157. package/dist/cli-bundle/chunks/{chunk-6AQZPVHQ.js → chunk-KIYCOJ63.js} +4 -4
  158. package/dist/cli-bundle/chunks/{chunk-ZRP4VG5U.js → chunk-KLXF7NCC.js} +2 -2
  159. package/dist/cli-bundle/chunks/{chunk-QCWF6IYD.js → chunk-KN3URLKS.js} +3 -3
  160. package/dist/cli-bundle/chunks/{chunk-N74UMG5H.js → chunk-LRKMWUUV.js} +2 -2
  161. package/dist/cli-bundle/chunks/{chunk-AVEE5EHK.js → chunk-LTRAF2D7.js} +3 -3
  162. package/dist/cli-bundle/chunks/{chunk-VARHOHYV.js → chunk-MNBPX5JS.js} +55 -36
  163. package/dist/cli-bundle/chunks/chunk-MNBPX5JS.js.map +7 -0
  164. package/dist/cli-bundle/chunks/{chunk-IJYK2T43.js → chunk-MRD4T5LF.js} +2 -2
  165. package/dist/cli-bundle/chunks/{chunk-G7I7DEZA.js → chunk-N2JSWVWG.js} +4 -4
  166. package/dist/cli-bundle/chunks/{chunk-5QFDBI4F.js → chunk-N3QCJS4M.js} +6 -6
  167. package/dist/cli-bundle/chunks/{chunk-JSU5P7VS.js → chunk-NRZS637N.js} +258 -169
  168. package/dist/cli-bundle/chunks/chunk-NRZS637N.js.map +1 -0
  169. package/dist/cli-bundle/chunks/{chunk-4A3BJ675.js → chunk-OTUJZKGI.js} +3 -3
  170. package/dist/cli-bundle/chunks/{chunk-5CGRF3L5.js → chunk-Q6K2OACU.js} +153 -90
  171. package/dist/cli-bundle/chunks/chunk-Q6K2OACU.js.map +1 -0
  172. package/dist/cli-bundle/chunks/{chunk-3XZCOZ5J.js → chunk-Q6NXOHS6.js} +391 -313
  173. package/dist/cli-bundle/chunks/chunk-Q6NXOHS6.js.map +1 -0
  174. package/dist/cli-bundle/chunks/{chunk-HZZEHPRG.js → chunk-QH3FSKRJ.js} +2 -2
  175. package/dist/cli-bundle/chunks/{chunk-4XOIEKSD.js → chunk-RM37OPYK.js} +56 -37
  176. package/dist/cli-bundle/chunks/chunk-RM37OPYK.js.map +1 -0
  177. package/dist/cli-bundle/chunks/{chunk-NKZAN7BD.js → chunk-S62UANU7.js} +3 -3
  178. package/dist/cli-bundle/chunks/{chunk-RMMQ74TG.js → chunk-SPM2XLWI.js} +37 -28
  179. package/dist/cli-bundle/chunks/chunk-SPM2XLWI.js.map +7 -0
  180. package/dist/cli-bundle/chunks/{chunk-3J6JRJ3I.js → chunk-SYNKD3ZG.js} +5 -5
  181. package/dist/cli-bundle/chunks/{chunk-FFMQB7WR.js → chunk-SYVUU7EK.js} +493 -404
  182. package/dist/cli-bundle/chunks/chunk-SYVUU7EK.js.map +1 -0
  183. package/dist/cli-bundle/chunks/{chunk-UYUYDGIB.js → chunk-TPOFWBMY.js} +95 -53
  184. package/dist/cli-bundle/chunks/chunk-TPOFWBMY.js.map +1 -0
  185. package/dist/cli-bundle/chunks/{chunk-OTUHB4HS.js → chunk-TTHCEV5Q.js} +92 -77
  186. package/dist/cli-bundle/chunks/chunk-TTHCEV5Q.js.map +1 -0
  187. package/dist/cli-bundle/chunks/{chunk-L5OEFZQG.js → chunk-U2BEEM2X.js} +3 -3
  188. package/dist/cli-bundle/chunks/{chunk-KNPEF7QG.js → chunk-UGLU6Q2I.js} +91 -76
  189. package/dist/cli-bundle/chunks/chunk-UGLU6Q2I.js.map +7 -0
  190. package/dist/cli-bundle/chunks/{chunk-EVMTBV6V.js → chunk-UT73HUPC.js} +3 -3
  191. package/dist/cli-bundle/chunks/{chunk-VICZWYGZ.js → chunk-UTSH5GWX.js} +4 -4
  192. package/dist/cli-bundle/chunks/{chunk-IZBR4NRW.js → chunk-UWKEJMZU.js} +157 -113
  193. package/dist/cli-bundle/chunks/chunk-UWKEJMZU.js.map +7 -0
  194. package/dist/cli-bundle/chunks/{chunk-3S2KT7NG.js → chunk-W47SML5B.js} +152 -89
  195. package/dist/cli-bundle/chunks/chunk-W47SML5B.js.map +7 -0
  196. package/dist/cli-bundle/chunks/{chunk-RGEMWD6Q.js → chunk-WJAMWAHZ.js} +157 -118
  197. package/dist/cli-bundle/chunks/chunk-WJAMWAHZ.js.map +7 -0
  198. package/dist/cli-bundle/chunks/{chunk-JWXRETDF.js → chunk-XCHUVHKU.js} +626 -484
  199. package/dist/cli-bundle/chunks/chunk-XCHUVHKU.js.map +1 -0
  200. package/dist/cli-bundle/chunks/{chunk-55SNVXRQ.js → chunk-XEWQKDYZ.js} +626 -484
  201. package/dist/cli-bundle/chunks/chunk-XEWQKDYZ.js.map +7 -0
  202. package/dist/cli-bundle/chunks/{chunk-TP5Q5ZD3.js → chunk-XTHQWXVC.js} +158 -119
  203. package/dist/cli-bundle/chunks/chunk-XTHQWXVC.js.map +1 -0
  204. package/dist/cli-bundle/chunks/{chunk-MDPEOIGN.js → chunk-XWGEMNBR.js} +2 -2
  205. package/dist/cli-bundle/chunks/{chunk-HYTGA6GI.js → chunk-Y4NRKBFW.js} +3 -3
  206. package/dist/cli-bundle/chunks/{chunk-2D4HATP2.js → chunk-YLZZ6T54.js} +38 -29
  207. package/dist/cli-bundle/chunks/chunk-YLZZ6T54.js.map +1 -0
  208. package/dist/cli-bundle/chunks/{chunk-22WKIL3H.js → chunk-YPKFV2JR.js} +6 -6
  209. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js → chunk-Z4DGFQDH.js} +80 -58
  210. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js.map → chunk-Z4DGFQDH.js.map} +1 -1
  211. package/dist/cli-bundle/chunks/{chunk-DDPTYJIM.js → chunk-ZNHEYCDD.js} +2 -2
  212. package/dist/cli-bundle/chunks/{chunk-MAUKX7JC.js → chunk-ZNT7KEWE.js} +2 -2
  213. package/dist/cli-bundle/chunks/{claim-T3GCKV7C.js → claim-SENTPZBN.js} +8 -8
  214. package/dist/cli-bundle/chunks/{claim-EMQLYPRW.js → claim-Z7MEQCBT.js} +8 -8
  215. package/dist/cli-bundle/chunks/{close-TQYAAFJP.js → close-424MX4CU.js} +7 -7
  216. package/dist/cli-bundle/chunks/close-YCWQQPDS.js +14 -0
  217. package/dist/cli-bundle/chunks/{close-many-LDRVEQY2.js → close-many-2IV4J2TR.js} +102 -81
  218. package/dist/cli-bundle/chunks/close-many-2IV4J2TR.js.map +1 -0
  219. package/dist/cli-bundle/chunks/{close-many-BG5QQIDQ.js → close-many-SWY34BII.js} +101 -80
  220. package/dist/cli-bundle/chunks/close-many-SWY34BII.js.map +7 -0
  221. package/dist/cli-bundle/chunks/{comments-YUXJRZPQ.js → comments-4FGNTSNV.js} +8 -8
  222. package/dist/cli-bundle/chunks/{comments-QCKR2YY2.js → comments-7YS5MY5X.js} +8 -8
  223. package/dist/cli-bundle/chunks/config-BZJKK7FZ.js +1062 -0
  224. package/dist/cli-bundle/chunks/config-BZJKK7FZ.js.map +1 -0
  225. package/dist/cli-bundle/chunks/config-G74GISC4.js +1072 -0
  226. package/dist/cli-bundle/chunks/config-G74GISC4.js.map +7 -0
  227. package/dist/cli-bundle/chunks/{context-OCZ3FJ4Z.js → context-LHVKJSPJ.js} +12 -12
  228. package/dist/cli-bundle/chunks/{context-B6275WPX.js → context-ZQY54JNS.js} +12 -12
  229. package/dist/cli-bundle/chunks/{contracts-HN7ABKLP.js → contracts-CP2EZJC7.js} +320 -199
  230. package/dist/cli-bundle/chunks/contracts-CP2EZJC7.js.map +7 -0
  231. package/dist/cli-bundle/chunks/{contracts-W4FZVVD6.js → contracts-FIZLMP7O.js} +321 -200
  232. package/dist/cli-bundle/chunks/contracts-FIZLMP7O.js.map +1 -0
  233. package/dist/cli-bundle/chunks/{copy-DEM4DATS.js → copy-GYNQQPW2.js} +5 -5
  234. package/dist/cli-bundle/chunks/{copy-BTJOSKKT.js → copy-TLW7JTQT.js} +5 -5
  235. package/dist/cli-bundle/chunks/{create-RLRJMRTM.js → create-VSKYSOCD.js} +12 -12
  236. package/dist/cli-bundle/chunks/create-XTMAPS7I.js +28 -0
  237. package/dist/cli-bundle/chunks/{delete-LSVHAB4Y.js → delete-4W5JYCEG.js} +5 -5
  238. package/dist/cli-bundle/chunks/{delete-BHK7VB2Z.js → delete-ANTOTI2I.js} +5 -5
  239. package/dist/cli-bundle/chunks/{deps-XHYXWEPT.js → deps-HPPE6MJN.js} +5 -5
  240. package/dist/cli-bundle/chunks/{deps-4UDFJRUA.js → deps-ZQZN54EZ.js} +5 -5
  241. package/dist/cli-bundle/chunks/{docs-GYZNVS26.js → docs-RPOVFMP3.js} +7 -7
  242. package/dist/cli-bundle/chunks/{docs-26S44RXU.js → docs-XJNYBJGE.js} +7 -7
  243. package/dist/cli-bundle/chunks/{eval-PGRVIJQU.js → eval-DM6JBZTS.js} +10 -10
  244. package/dist/cli-bundle/chunks/{eval-UYF3ZPVO.js → eval-RFBI5FGS.js} +10 -10
  245. package/dist/cli-bundle/chunks/{extension-CPSLJQVE.js → extension-B3YY4WY5.js} +11 -11
  246. package/dist/cli-bundle/chunks/{extension-CXJ6RELI.js → extension-TTSEFQTS.js} +11 -11
  247. package/dist/cli-bundle/chunks/{files-NQHEXUZD.js → files-5D65CHGE.js} +7 -7
  248. package/dist/cli-bundle/chunks/{files-MBNICQFM.js → files-GPIG77EN.js} +7 -7
  249. package/dist/cli-bundle/chunks/{focus-XZW5423D.js → focus-C3PEJV2C.js} +6 -6
  250. package/dist/cli-bundle/chunks/{focus-DWYIG7GU.js → focus-ZHN7WIGX.js} +6 -6
  251. package/dist/cli-bundle/chunks/{gc-LPVMKJQJ.js → gc-D4JQ6OWN.js} +3 -3
  252. package/dist/cli-bundle/chunks/{gc-7GQYOS2G.js → gc-VZIXDL32.js} +3 -3
  253. package/dist/cli-bundle/chunks/{get-DSDEKJ3L.js → get-GIBRUUOP.js} +121 -81
  254. package/dist/cli-bundle/chunks/get-GIBRUUOP.js.map +1 -0
  255. package/dist/cli-bundle/chunks/{get-A7MAOHCU.js → get-IOVAN6RU.js} +120 -80
  256. package/dist/cli-bundle/chunks/get-IOVAN6RU.js.map +7 -0
  257. package/dist/cli-bundle/chunks/{health-3IPFLKXB.js → health-L2U3AFKV.js} +437 -265
  258. package/dist/cli-bundle/chunks/health-L2U3AFKV.js.map +1 -0
  259. package/dist/cli-bundle/chunks/{health-GZXGBZ36.js → health-MM7AWXYF.js} +436 -264
  260. package/dist/cli-bundle/chunks/health-MM7AWXYF.js.map +7 -0
  261. package/dist/cli-bundle/chunks/history-DD7L7BNL.js +18 -0
  262. package/dist/cli-bundle/chunks/{history-NERDJNUB.js → history-IL7XCEX2.js} +8 -8
  263. package/dist/cli-bundle/chunks/{history-compact-HR7BB4LR.js → history-compact-HALOTOU7.js} +214 -135
  264. package/dist/cli-bundle/chunks/history-compact-HALOTOU7.js.map +1 -0
  265. package/dist/cli-bundle/chunks/{history-compact-2WRZ2WK4.js → history-compact-MV25P7DM.js} +213 -134
  266. package/dist/cli-bundle/chunks/history-compact-MV25P7DM.js.map +7 -0
  267. package/dist/cli-bundle/chunks/history-redact-IX4YEWMY.js +19 -0
  268. package/dist/cli-bundle/chunks/{history-redact-O3NBCNWC.js → history-redact-VYCWQFK7.js} +9 -9
  269. package/dist/cli-bundle/chunks/{history-repair-XA3LC4GA.js → history-repair-44MODPQF.js} +124 -84
  270. package/dist/cli-bundle/chunks/history-repair-44MODPQF.js.map +1 -0
  271. package/dist/cli-bundle/chunks/{history-repair-LCMOS45X.js → history-repair-CPNAOCNF.js} +123 -83
  272. package/dist/cli-bundle/chunks/history-repair-CPNAOCNF.js.map +7 -0
  273. package/dist/cli-bundle/chunks/{init-64XDLQJB.js → init-F27NHENZ.js} +12 -12
  274. package/dist/cli-bundle/chunks/init-HHVQQP6C.js +22 -0
  275. package/dist/cli-bundle/chunks/{learnings-LPKCSJX7.js → learnings-HJVDQIGY.js} +8 -8
  276. package/dist/cli-bundle/chunks/{learnings-JR6MA5TI.js → learnings-XSFSUUWK.js} +8 -8
  277. package/dist/cli-bundle/chunks/{list-G5Y65VF6.js → list-HPMEKCAA.js} +8 -8
  278. package/dist/cli-bundle/chunks/{list-DNBJVO3E.js → list-VMPWTURB.js} +8 -8
  279. package/dist/cli-bundle/chunks/{next-BCERKDUR.js → next-ETXF2ZCN.js} +59 -37
  280. package/dist/cli-bundle/chunks/next-ETXF2ZCN.js.map +7 -0
  281. package/dist/cli-bundle/chunks/{next-FYTQF6HG.js → next-QM6YJIIS.js} +60 -38
  282. package/dist/cli-bundle/chunks/next-QM6YJIIS.js.map +1 -0
  283. package/dist/cli-bundle/chunks/{notes-2BMU3VVQ.js → notes-GDZIKGR6.js} +8 -8
  284. package/dist/cli-bundle/chunks/{notes-6KTGO2OJ.js → notes-WDDBPC4D.js} +8 -8
  285. package/dist/cli-bundle/chunks/{plan-RKZHQVXR.js → plan-BGDR73Z6.js} +373 -279
  286. package/dist/cli-bundle/chunks/plan-BGDR73Z6.js.map +1 -0
  287. package/dist/cli-bundle/chunks/{plan-4WXEQCTN.js → plan-C5IMM335.js} +372 -278
  288. package/dist/cli-bundle/chunks/plan-C5IMM335.js.map +7 -0
  289. package/dist/cli-bundle/chunks/{profile-QLER5ENE.js → profile-CCOKZ2IQ.js} +9 -9
  290. package/dist/cli-bundle/chunks/{profile-4OMM32CD.js → profile-HUCENIEQ.js} +9 -9
  291. package/dist/cli-bundle/chunks/{register-list-query-7LV46VAU.js → register-list-query-ROSNIL52.js} +80 -83
  292. package/dist/cli-bundle/chunks/register-list-query-ROSNIL52.js.map +1 -0
  293. package/dist/cli-bundle/chunks/{register-list-query-SNG5PGA4.js → register-list-query-XN4ZRHSV.js} +79 -82
  294. package/dist/cli-bundle/chunks/register-list-query-XN4ZRHSV.js.map +7 -0
  295. package/dist/cli-bundle/chunks/{register-mutation-ENNDUAZG.js → register-mutation-CFSB2MS3.js} +403 -382
  296. package/dist/cli-bundle/chunks/register-mutation-CFSB2MS3.js.map +1 -0
  297. package/dist/cli-bundle/chunks/{register-mutation-KK7PHYYU.js → register-mutation-KRLAHEL2.js} +402 -381
  298. package/dist/cli-bundle/chunks/register-mutation-KRLAHEL2.js.map +7 -0
  299. package/dist/cli-bundle/chunks/{register-operations-HZ6XERQG.js → register-operations-4PASGJDB.js} +112 -93
  300. package/dist/cli-bundle/chunks/register-operations-4PASGJDB.js.map +7 -0
  301. package/dist/cli-bundle/chunks/{register-operations-C6OWLDSH.js → register-operations-MBN4KGUM.js} +113 -94
  302. package/dist/cli-bundle/chunks/register-operations-MBN4KGUM.js.map +1 -0
  303. package/dist/cli-bundle/chunks/{register-setup-P67EMBDJ.js → register-setup-VIAWYFP5.js} +129 -104
  304. package/dist/cli-bundle/chunks/register-setup-VIAWYFP5.js.map +1 -0
  305. package/dist/cli-bundle/chunks/{register-setup-ZKJ53RS7.js → register-setup-ZCGKHDKL.js} +128 -103
  306. package/dist/cli-bundle/chunks/register-setup-ZCGKHDKL.js.map +7 -0
  307. package/dist/cli-bundle/chunks/{restore-4MHZFJ2E.js → restore-4CBWUMCX.js} +9 -9
  308. package/dist/cli-bundle/chunks/restore-5UEAGG3W.js +17 -0
  309. package/dist/cli-bundle/chunks/{scheduling-shortcuts-LB6DOLRL.js → scheduling-shortcuts-6VFKNKCM.js} +12 -12
  310. package/dist/cli-bundle/chunks/{scheduling-shortcuts-UTOYKLXQ.js → scheduling-shortcuts-ERHCVTEM.js} +12 -12
  311. package/dist/cli-bundle/chunks/{schema-73HR2OJW.js → schema-TDGK6N3I.js} +7 -7
  312. package/dist/cli-bundle/chunks/{schema-U6LJKSIR.js → schema-UE5KKAUX.js} +7 -7
  313. package/dist/cli-bundle/chunks/{search-KILGT37L.js → search-FP7MEU4S.js} +10 -10
  314. package/dist/cli-bundle/chunks/{search-AXPXKZER.js → search-K4CFLQ5S.js} +10 -10
  315. package/dist/cli-bundle/chunks/{stats-PSYVVTNZ.js → stats-NJJCALEZ.js} +6 -6
  316. package/dist/cli-bundle/chunks/{stats-W5KNVJWQ.js → stats-XT6QRKQY.js} +6 -6
  317. package/dist/cli-bundle/chunks/{telemetry-GAHHQTOS.js → telemetry-5SQ5UDXC.js} +84 -70
  318. package/dist/cli-bundle/chunks/telemetry-5SQ5UDXC.js.map +7 -0
  319. package/dist/cli-bundle/chunks/{telemetry-BZUF6H7G.js → telemetry-HVXFZA2U.js} +85 -71
  320. package/dist/cli-bundle/chunks/telemetry-HVXFZA2U.js.map +1 -0
  321. package/dist/cli-bundle/chunks/{test-ACD52Z3S.js → test-UFSJ5YIO.js} +15 -15
  322. package/dist/cli-bundle/chunks/{test-PWDIZ255.js → test-YCDAUBWF.js} +15 -15
  323. package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js +427 -0
  324. package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js.map +1 -0
  325. package/dist/cli-bundle/chunks/test-all-PM7UYN42.js +430 -0
  326. package/dist/cli-bundle/chunks/test-all-PM7UYN42.js.map +7 -0
  327. package/dist/cli-bundle/chunks/{test-runs-UXIXPDKU.js → test-runs-FK5E75AA.js} +185 -147
  328. package/dist/cli-bundle/chunks/test-runs-FK5E75AA.js.map +1 -0
  329. package/dist/cli-bundle/chunks/{test-runs-PLRAZEFW.js → test-runs-H4TGWGRN.js} +184 -146
  330. package/dist/cli-bundle/chunks/test-runs-H4TGWGRN.js.map +7 -0
  331. package/dist/cli-bundle/chunks/update-MTCFES6X.js +24 -0
  332. package/dist/cli-bundle/chunks/{update-KFX2SIAC.js → update-Y5WQVT5O.js} +15 -15
  333. package/dist/cli-bundle/chunks/{update-many-Z5GJS5LC.js → update-many-6YAYYRLE.js} +82 -67
  334. package/dist/cli-bundle/chunks/{update-many-Z5GJS5LC.js.map → update-many-6YAYYRLE.js.map} +2 -2
  335. package/dist/cli-bundle/chunks/{update-many-RNSBX2TA.js → update-many-JTKKSA7Y.js} +83 -68
  336. package/dist/cli-bundle/chunks/{update-many-RNSBX2TA.js.map → update-many-JTKKSA7Y.js.map} +1 -1
  337. package/dist/cli-bundle/chunks/{upgrade-HAK6JG2O.js → upgrade-DTAHZ236.js} +11 -11
  338. package/dist/cli-bundle/chunks/{upgrade-BRL6KCOJ.js → upgrade-JUDU7YL4.js} +11 -11
  339. package/dist/cli-bundle/chunks/{validate-MTUVL5VC.js → validate-732RWS5W.js} +440 -320
  340. package/dist/cli-bundle/chunks/validate-732RWS5W.js.map +7 -0
  341. package/dist/cli-bundle/chunks/{validate-X5W76YJL.js → validate-W7H5TEDC.js} +441 -321
  342. package/dist/cli-bundle/chunks/validate-W7H5TEDC.js.map +1 -0
  343. package/dist/cli-bundle/main.js +945 -812
  344. package/dist/cli-bundle/main.js.map +3 -3
  345. package/dist/core/config/nested-settings.js +89 -67
  346. package/dist/core/config/nested-settings.js.map +1 -1
  347. package/dist/core/governance/metadata-coverage.js +20 -28
  348. package/dist/core/governance/metadata-coverage.js.map +1 -1
  349. package/dist/core/history/drift-scan.js +93 -81
  350. package/dist/core/history/drift-scan.js.map +1 -1
  351. package/dist/core/item/item-type-definition.js +14 -14
  352. package/dist/core/item/item-type-definition.js.map +1 -1
  353. package/dist/core/item/type-registry.js +87 -82
  354. package/dist/core/item/type-registry.js.map +1 -1
  355. package/dist/core/output/mutation-projection.js +42 -26
  356. package/dist/core/output/mutation-projection.js.map +1 -1
  357. package/dist/core/schema/runtime-schema.js +34 -28
  358. package/dist/core/schema/runtime-schema.js.map +1 -1
  359. package/dist/core/search/semantic-defaults.js +64 -37
  360. package/dist/core/search/semantic-defaults.js.map +1 -1
  361. package/dist/core/search/vector-stores.js +32 -17
  362. package/dist/core/search/vector-stores.js.map +1 -1
  363. package/dist/core/sentry/helpers.js +31 -28
  364. package/dist/core/sentry/helpers.js.map +1 -1
  365. package/dist/core/sentry/instrument.js +54 -43
  366. package/dist/core/sentry/instrument.js.map +1 -1
  367. package/dist/core/store/front-matter-cache.js +239 -153
  368. package/dist/core/store/front-matter-cache.js.map +1 -1
  369. package/dist/core/store/item-store.js +33 -26
  370. package/dist/core/store/item-store.js.map +1 -1
  371. package/dist/core/store/settings.js +247 -203
  372. package/dist/core/store/settings.js.map +1 -1
  373. package/dist/core/test/background-runs.js +189 -160
  374. package/dist/core/test/background-runs.js.map +1 -1
  375. package/package.json +2 -2
  376. package/packages/pm-beads/extensions/beads/runtime.ts +240 -167
  377. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +65 -58
  378. package/packages/pm-todos/extensions/todos/runtime.ts +65 -42
  379. package/dist/cli-bundle/chunks/activity-AW6XVFH6.js +0 -16
  380. package/dist/cli-bundle/chunks/aggregate-JTEF4BP7.js.map +0 -1
  381. package/dist/cli-bundle/chunks/chunk-2D4HATP2.js.map +0 -1
  382. package/dist/cli-bundle/chunks/chunk-3S2KT7NG.js.map +0 -7
  383. package/dist/cli-bundle/chunks/chunk-3VGN2UWE.js.map +0 -1
  384. package/dist/cli-bundle/chunks/chunk-3XZCOZ5J.js.map +0 -1
  385. package/dist/cli-bundle/chunks/chunk-4DSGXSBL.js.map +0 -7
  386. package/dist/cli-bundle/chunks/chunk-4XOIEKSD.js.map +0 -1
  387. package/dist/cli-bundle/chunks/chunk-55SNVXRQ.js.map +0 -7
  388. package/dist/cli-bundle/chunks/chunk-5CGRF3L5.js.map +0 -1
  389. package/dist/cli-bundle/chunks/chunk-7R4QEMZZ.js.map +0 -1
  390. package/dist/cli-bundle/chunks/chunk-BDTISOSD.js.map +0 -7
  391. package/dist/cli-bundle/chunks/chunk-BZCEN4JA.js.map +0 -7
  392. package/dist/cli-bundle/chunks/chunk-CF7RL6FR.js.map +0 -1
  393. package/dist/cli-bundle/chunks/chunk-FFMQB7WR.js.map +0 -1
  394. package/dist/cli-bundle/chunks/chunk-IPYBJWTE.js.map +0 -7
  395. package/dist/cli-bundle/chunks/chunk-IZBR4NRW.js.map +0 -7
  396. package/dist/cli-bundle/chunks/chunk-JSU5P7VS.js.map +0 -1
  397. package/dist/cli-bundle/chunks/chunk-JWXRETDF.js.map +0 -1
  398. package/dist/cli-bundle/chunks/chunk-KNPEF7QG.js.map +0 -7
  399. package/dist/cli-bundle/chunks/chunk-NFDPYAIP.js.map +0 -7
  400. package/dist/cli-bundle/chunks/chunk-NUHHPVVS.js.map +0 -7
  401. package/dist/cli-bundle/chunks/chunk-NWMZWYYB.js.map +0 -1
  402. package/dist/cli-bundle/chunks/chunk-OTUHB4HS.js.map +0 -1
  403. package/dist/cli-bundle/chunks/chunk-RGEMWD6Q.js.map +0 -7
  404. package/dist/cli-bundle/chunks/chunk-RLDHZHQS.js.map +0 -1
  405. package/dist/cli-bundle/chunks/chunk-RMMQ74TG.js.map +0 -7
  406. package/dist/cli-bundle/chunks/chunk-RVUALSJF.js.map +0 -7
  407. package/dist/cli-bundle/chunks/chunk-TP5Q5ZD3.js.map +0 -1
  408. package/dist/cli-bundle/chunks/chunk-UYUYDGIB.js.map +0 -1
  409. package/dist/cli-bundle/chunks/chunk-V3NOKJF2.js.map +0 -1
  410. package/dist/cli-bundle/chunks/chunk-VARHOHYV.js.map +0 -7
  411. package/dist/cli-bundle/chunks/chunk-YITK2PJ6.js.map +0 -7
  412. package/dist/cli-bundle/chunks/chunk-ZETXE4SE.js.map +0 -1
  413. package/dist/cli-bundle/chunks/close-E6ZZGCJY.js +0 -14
  414. package/dist/cli-bundle/chunks/close-many-BG5QQIDQ.js.map +0 -7
  415. package/dist/cli-bundle/chunks/close-many-LDRVEQY2.js.map +0 -1
  416. package/dist/cli-bundle/chunks/config-DMSU64QO.js +0 -1541
  417. package/dist/cli-bundle/chunks/config-DMSU64QO.js.map +0 -7
  418. package/dist/cli-bundle/chunks/config-QH2DICD6.js +0 -1531
  419. package/dist/cli-bundle/chunks/config-QH2DICD6.js.map +0 -1
  420. package/dist/cli-bundle/chunks/contracts-HN7ABKLP.js.map +0 -7
  421. package/dist/cli-bundle/chunks/contracts-W4FZVVD6.js.map +0 -1
  422. package/dist/cli-bundle/chunks/create-OH3BDGBB.js +0 -28
  423. package/dist/cli-bundle/chunks/get-A7MAOHCU.js.map +0 -7
  424. package/dist/cli-bundle/chunks/get-DSDEKJ3L.js.map +0 -1
  425. package/dist/cli-bundle/chunks/health-3IPFLKXB.js.map +0 -1
  426. package/dist/cli-bundle/chunks/health-GZXGBZ36.js.map +0 -7
  427. package/dist/cli-bundle/chunks/history-WSZHY3PN.js +0 -18
  428. package/dist/cli-bundle/chunks/history-compact-2WRZ2WK4.js.map +0 -7
  429. package/dist/cli-bundle/chunks/history-compact-HR7BB4LR.js.map +0 -1
  430. package/dist/cli-bundle/chunks/history-redact-MP6CH7U5.js +0 -19
  431. package/dist/cli-bundle/chunks/history-repair-LCMOS45X.js.map +0 -7
  432. package/dist/cli-bundle/chunks/history-repair-XA3LC4GA.js.map +0 -1
  433. package/dist/cli-bundle/chunks/init-PAX32BJA.js +0 -22
  434. package/dist/cli-bundle/chunks/next-BCERKDUR.js.map +0 -7
  435. package/dist/cli-bundle/chunks/next-FYTQF6HG.js.map +0 -1
  436. package/dist/cli-bundle/chunks/plan-4WXEQCTN.js.map +0 -7
  437. package/dist/cli-bundle/chunks/plan-RKZHQVXR.js.map +0 -1
  438. package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js.map +0 -1
  439. package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js.map +0 -7
  440. package/dist/cli-bundle/chunks/register-mutation-ENNDUAZG.js.map +0 -1
  441. package/dist/cli-bundle/chunks/register-mutation-KK7PHYYU.js.map +0 -7
  442. package/dist/cli-bundle/chunks/register-operations-C6OWLDSH.js.map +0 -1
  443. package/dist/cli-bundle/chunks/register-operations-HZ6XERQG.js.map +0 -7
  444. package/dist/cli-bundle/chunks/register-setup-P67EMBDJ.js.map +0 -1
  445. package/dist/cli-bundle/chunks/register-setup-ZKJ53RS7.js.map +0 -7
  446. package/dist/cli-bundle/chunks/restore-YALDGTQR.js +0 -17
  447. package/dist/cli-bundle/chunks/telemetry-BZUF6H7G.js.map +0 -1
  448. package/dist/cli-bundle/chunks/telemetry-GAHHQTOS.js.map +0 -7
  449. package/dist/cli-bundle/chunks/test-all-L2MDDUCA.js +0 -358
  450. package/dist/cli-bundle/chunks/test-all-L2MDDUCA.js.map +0 -1
  451. package/dist/cli-bundle/chunks/test-all-RBZ6DLU2.js +0 -361
  452. package/dist/cli-bundle/chunks/test-all-RBZ6DLU2.js.map +0 -7
  453. package/dist/cli-bundle/chunks/test-runs-PLRAZEFW.js.map +0 -7
  454. package/dist/cli-bundle/chunks/test-runs-UXIXPDKU.js.map +0 -1
  455. package/dist/cli-bundle/chunks/update-AMRSOIWP.js +0 -24
  456. package/dist/cli-bundle/chunks/validate-MTUVL5VC.js.map +0 -7
  457. package/dist/cli-bundle/chunks/validate-X5W76YJL.js.map +0 -1
  458. /package/dist/cli-bundle/chunks/{activity-DBLQVIP6.js.map → activity-CUC4JY3U.js.map} +0 -0
  459. /package/dist/cli-bundle/chunks/{activity-AW6XVFH6.js.map → activity-WEIEMM73.js.map} +0 -0
  460. /package/dist/cli-bundle/chunks/{append-QCFJSDFL.js.map → append-H32VOR2Y.js.map} +0 -0
  461. /package/dist/cli-bundle/chunks/{append-LOVPGVPT.js.map → append-UBM632FK.js.map} +0 -0
  462. /package/dist/cli-bundle/chunks/{chunk-SLMUGTK3.js.map → chunk-2ASNV4DH.js.map} +0 -0
  463. /package/dist/cli-bundle/chunks/{chunk-UZIWVBE6.js.map → chunk-2CHRYUXL.js.map} +0 -0
  464. /package/dist/cli-bundle/chunks/{chunk-NU2UEROZ.js.map → chunk-3AZUFQK6.js.map} +0 -0
  465. /package/dist/cli-bundle/chunks/{chunk-LB6TP6MC.js.map → chunk-3LCUASYG.js.map} +0 -0
  466. /package/dist/cli-bundle/chunks/{chunk-HPPFYYOV.js.map → chunk-3Q2HBMTI.js.map} +0 -0
  467. /package/dist/cli-bundle/chunks/{chunk-W4ULYO7Z.js.map → chunk-55XRYWEG.js.map} +0 -0
  468. /package/dist/cli-bundle/chunks/{chunk-HXTQJXWT.js.map → chunk-5GVTFFTC.js.map} +0 -0
  469. /package/dist/cli-bundle/chunks/{chunk-64HNBBFQ.js.map → chunk-A6VOGKBA.js.map} +0 -0
  470. /package/dist/cli-bundle/chunks/{chunk-WYDHYJPO.js.map → chunk-AIAIXG7I.js.map} +0 -0
  471. /package/dist/cli-bundle/chunks/{chunk-CWFNTKQJ.js.map → chunk-AJEBCRIY.js.map} +0 -0
  472. /package/dist/cli-bundle/chunks/{chunk-NOLPZMSV.js.map → chunk-BTX5MIQF.js.map} +0 -0
  473. /package/dist/cli-bundle/chunks/{chunk-RH5ZBYFD.js.map → chunk-BVZZN2LH.js.map} +0 -0
  474. /package/dist/cli-bundle/chunks/{chunk-27BXPBAY.js.map → chunk-CYBDUHNO.js.map} +0 -0
  475. /package/dist/cli-bundle/chunks/{chunk-A7FPBAQS.js.map → chunk-CZPVDLD2.js.map} +0 -0
  476. /package/dist/cli-bundle/chunks/{chunk-JPECA746.js.map → chunk-EUKTMRN3.js.map} +0 -0
  477. /package/dist/cli-bundle/chunks/{chunk-2466X6E4.js.map → chunk-FFOQHGNH.js.map} +0 -0
  478. /package/dist/cli-bundle/chunks/{chunk-JLM7BHI7.js.map → chunk-GFMSLORL.js.map} +0 -0
  479. /package/dist/cli-bundle/chunks/{chunk-SDR5J34Q.js.map → chunk-GRRG3MCT.js.map} +0 -0
  480. /package/dist/cli-bundle/chunks/{chunk-GJ326ZKX.js.map → chunk-H4GRLYJS.js.map} +0 -0
  481. /package/dist/cli-bundle/chunks/{chunk-OGXLACHC.js.map → chunk-HQTPRV4D.js.map} +0 -0
  482. /package/dist/cli-bundle/chunks/{chunk-BHO33VBQ.js.map → chunk-IEEJQCZ4.js.map} +0 -0
  483. /package/dist/cli-bundle/chunks/{chunk-4DUVCVLZ.js.map → chunk-JMK5GCK2.js.map} +0 -0
  484. /package/dist/cli-bundle/chunks/{chunk-AXIDKKAT.js.map → chunk-K2VYLVX4.js.map} +0 -0
  485. /package/dist/cli-bundle/chunks/{chunk-EJUDVUYZ.js.map → chunk-KCO2EAN5.js.map} +0 -0
  486. /package/dist/cli-bundle/chunks/{chunk-6AQZPVHQ.js.map → chunk-KIYCOJ63.js.map} +0 -0
  487. /package/dist/cli-bundle/chunks/{chunk-ZRP4VG5U.js.map → chunk-KLXF7NCC.js.map} +0 -0
  488. /package/dist/cli-bundle/chunks/{chunk-QCWF6IYD.js.map → chunk-KN3URLKS.js.map} +0 -0
  489. /package/dist/cli-bundle/chunks/{chunk-N74UMG5H.js.map → chunk-LRKMWUUV.js.map} +0 -0
  490. /package/dist/cli-bundle/chunks/{chunk-AVEE5EHK.js.map → chunk-LTRAF2D7.js.map} +0 -0
  491. /package/dist/cli-bundle/chunks/{chunk-IJYK2T43.js.map → chunk-MRD4T5LF.js.map} +0 -0
  492. /package/dist/cli-bundle/chunks/{chunk-G7I7DEZA.js.map → chunk-N2JSWVWG.js.map} +0 -0
  493. /package/dist/cli-bundle/chunks/{chunk-5QFDBI4F.js.map → chunk-N3QCJS4M.js.map} +0 -0
  494. /package/dist/cli-bundle/chunks/{chunk-4A3BJ675.js.map → chunk-OTUJZKGI.js.map} +0 -0
  495. /package/dist/cli-bundle/chunks/{chunk-HZZEHPRG.js.map → chunk-QH3FSKRJ.js.map} +0 -0
  496. /package/dist/cli-bundle/chunks/{chunk-NKZAN7BD.js.map → chunk-S62UANU7.js.map} +0 -0
  497. /package/dist/cli-bundle/chunks/{chunk-3J6JRJ3I.js.map → chunk-SYNKD3ZG.js.map} +0 -0
  498. /package/dist/cli-bundle/chunks/{chunk-L5OEFZQG.js.map → chunk-U2BEEM2X.js.map} +0 -0
  499. /package/dist/cli-bundle/chunks/{chunk-EVMTBV6V.js.map → chunk-UT73HUPC.js.map} +0 -0
  500. /package/dist/cli-bundle/chunks/{chunk-VICZWYGZ.js.map → chunk-UTSH5GWX.js.map} +0 -0
  501. /package/dist/cli-bundle/chunks/{chunk-MDPEOIGN.js.map → chunk-XWGEMNBR.js.map} +0 -0
  502. /package/dist/cli-bundle/chunks/{chunk-HYTGA6GI.js.map → chunk-Y4NRKBFW.js.map} +0 -0
  503. /package/dist/cli-bundle/chunks/{chunk-22WKIL3H.js.map → chunk-YPKFV2JR.js.map} +0 -0
  504. /package/dist/cli-bundle/chunks/{chunk-DDPTYJIM.js.map → chunk-ZNHEYCDD.js.map} +0 -0
  505. /package/dist/cli-bundle/chunks/{chunk-MAUKX7JC.js.map → chunk-ZNT7KEWE.js.map} +0 -0
  506. /package/dist/cli-bundle/chunks/{claim-T3GCKV7C.js.map → claim-SENTPZBN.js.map} +0 -0
  507. /package/dist/cli-bundle/chunks/{claim-EMQLYPRW.js.map → claim-Z7MEQCBT.js.map} +0 -0
  508. /package/dist/cli-bundle/chunks/{close-TQYAAFJP.js.map → close-424MX4CU.js.map} +0 -0
  509. /package/dist/cli-bundle/chunks/{close-E6ZZGCJY.js.map → close-YCWQQPDS.js.map} +0 -0
  510. /package/dist/cli-bundle/chunks/{comments-YUXJRZPQ.js.map → comments-4FGNTSNV.js.map} +0 -0
  511. /package/dist/cli-bundle/chunks/{comments-QCKR2YY2.js.map → comments-7YS5MY5X.js.map} +0 -0
  512. /package/dist/cli-bundle/chunks/{context-OCZ3FJ4Z.js.map → context-LHVKJSPJ.js.map} +0 -0
  513. /package/dist/cli-bundle/chunks/{context-B6275WPX.js.map → context-ZQY54JNS.js.map} +0 -0
  514. /package/dist/cli-bundle/chunks/{copy-DEM4DATS.js.map → copy-GYNQQPW2.js.map} +0 -0
  515. /package/dist/cli-bundle/chunks/{copy-BTJOSKKT.js.map → copy-TLW7JTQT.js.map} +0 -0
  516. /package/dist/cli-bundle/chunks/{create-RLRJMRTM.js.map → create-VSKYSOCD.js.map} +0 -0
  517. /package/dist/cli-bundle/chunks/{create-OH3BDGBB.js.map → create-XTMAPS7I.js.map} +0 -0
  518. /package/dist/cli-bundle/chunks/{delete-LSVHAB4Y.js.map → delete-4W5JYCEG.js.map} +0 -0
  519. /package/dist/cli-bundle/chunks/{delete-BHK7VB2Z.js.map → delete-ANTOTI2I.js.map} +0 -0
  520. /package/dist/cli-bundle/chunks/{deps-XHYXWEPT.js.map → deps-HPPE6MJN.js.map} +0 -0
  521. /package/dist/cli-bundle/chunks/{deps-4UDFJRUA.js.map → deps-ZQZN54EZ.js.map} +0 -0
  522. /package/dist/cli-bundle/chunks/{docs-GYZNVS26.js.map → docs-RPOVFMP3.js.map} +0 -0
  523. /package/dist/cli-bundle/chunks/{docs-26S44RXU.js.map → docs-XJNYBJGE.js.map} +0 -0
  524. /package/dist/cli-bundle/chunks/{eval-PGRVIJQU.js.map → eval-DM6JBZTS.js.map} +0 -0
  525. /package/dist/cli-bundle/chunks/{eval-UYF3ZPVO.js.map → eval-RFBI5FGS.js.map} +0 -0
  526. /package/dist/cli-bundle/chunks/{extension-CPSLJQVE.js.map → extension-B3YY4WY5.js.map} +0 -0
  527. /package/dist/cli-bundle/chunks/{extension-CXJ6RELI.js.map → extension-TTSEFQTS.js.map} +0 -0
  528. /package/dist/cli-bundle/chunks/{files-NQHEXUZD.js.map → files-5D65CHGE.js.map} +0 -0
  529. /package/dist/cli-bundle/chunks/{files-MBNICQFM.js.map → files-GPIG77EN.js.map} +0 -0
  530. /package/dist/cli-bundle/chunks/{focus-XZW5423D.js.map → focus-C3PEJV2C.js.map} +0 -0
  531. /package/dist/cli-bundle/chunks/{focus-DWYIG7GU.js.map → focus-ZHN7WIGX.js.map} +0 -0
  532. /package/dist/cli-bundle/chunks/{gc-LPVMKJQJ.js.map → gc-D4JQ6OWN.js.map} +0 -0
  533. /package/dist/cli-bundle/chunks/{gc-7GQYOS2G.js.map → gc-VZIXDL32.js.map} +0 -0
  534. /package/dist/cli-bundle/chunks/{history-WSZHY3PN.js.map → history-DD7L7BNL.js.map} +0 -0
  535. /package/dist/cli-bundle/chunks/{history-NERDJNUB.js.map → history-IL7XCEX2.js.map} +0 -0
  536. /package/dist/cli-bundle/chunks/{history-redact-MP6CH7U5.js.map → history-redact-IX4YEWMY.js.map} +0 -0
  537. /package/dist/cli-bundle/chunks/{history-redact-O3NBCNWC.js.map → history-redact-VYCWQFK7.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{init-64XDLQJB.js.map → init-F27NHENZ.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{init-PAX32BJA.js.map → init-HHVQQP6C.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{learnings-LPKCSJX7.js.map → learnings-HJVDQIGY.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{learnings-JR6MA5TI.js.map → learnings-XSFSUUWK.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{list-G5Y65VF6.js.map → list-HPMEKCAA.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{list-DNBJVO3E.js.map → list-VMPWTURB.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{notes-2BMU3VVQ.js.map → notes-GDZIKGR6.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{notes-6KTGO2OJ.js.map → notes-WDDBPC4D.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{profile-QLER5ENE.js.map → profile-CCOKZ2IQ.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{profile-4OMM32CD.js.map → profile-HUCENIEQ.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{restore-4MHZFJ2E.js.map → restore-4CBWUMCX.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{restore-YALDGTQR.js.map → restore-5UEAGG3W.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-LB6DOLRL.js.map → scheduling-shortcuts-6VFKNKCM.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-UTOYKLXQ.js.map → scheduling-shortcuts-ERHCVTEM.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{schema-73HR2OJW.js.map → schema-TDGK6N3I.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{schema-U6LJKSIR.js.map → schema-UE5KKAUX.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{search-KILGT37L.js.map → search-FP7MEU4S.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{search-AXPXKZER.js.map → search-K4CFLQ5S.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{stats-PSYVVTNZ.js.map → stats-NJJCALEZ.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{stats-W5KNVJWQ.js.map → stats-XT6QRKQY.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{test-ACD52Z3S.js.map → test-UFSJ5YIO.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{test-PWDIZ255.js.map → test-YCDAUBWF.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{update-AMRSOIWP.js.map → update-MTCFES6X.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{update-KFX2SIAC.js.map → update-Y5WQVT5O.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{upgrade-HAK6JG2O.js.map → upgrade-DTAHZ236.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{upgrade-BRL6KCOJ.js.map → upgrade-JUDU7YL4.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