@unbrained/pm-cli 2026.6.10 → 2026.6.12

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 (456) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +44 -0
  3. package/README.md +1 -1
  4. package/dist/cli/bootstrap-args.d.ts +11 -0
  5. package/dist/cli/bootstrap-args.js +88 -4
  6. package/dist/cli/bootstrap-args.js.map +1 -1
  7. package/dist/cli/commands/completion.js +20 -8
  8. package/dist/cli/commands/completion.js.map +1 -1
  9. package/dist/cli/commands/contracts.d.ts +2 -0
  10. package/dist/cli/commands/contracts.js +9 -2
  11. package/dist/cli/commands/contracts.js.map +1 -1
  12. package/dist/cli/commands/create.js +6 -3
  13. package/dist/cli/commands/create.js.map +1 -1
  14. package/dist/cli/commands/docs.d.ts +2 -0
  15. package/dist/cli/commands/docs.js +2 -2
  16. package/dist/cli/commands/docs.js.map +1 -1
  17. package/dist/cli/commands/files.d.ts +2 -0
  18. package/dist/cli/commands/files.js +2 -2
  19. package/dist/cli/commands/files.js.map +1 -1
  20. package/dist/cli/commands/health.d.ts +1 -1
  21. package/dist/cli/commands/health.js +77 -2
  22. package/dist/cli/commands/health.js.map +1 -1
  23. package/dist/cli/commands/history-repair.d.ts +36 -0
  24. package/dist/cli/commands/history-repair.js +68 -3
  25. package/dist/cli/commands/history-repair.js.map +1 -1
  26. package/dist/cli/commands/index.d.ts +1 -1
  27. package/dist/cli/commands/index.js +3 -3
  28. package/dist/cli/commands/index.js.map +1 -1
  29. package/dist/cli/commands/linked-artifacts.d.ts +18 -0
  30. package/dist/cli/commands/linked-artifacts.js +26 -3
  31. package/dist/cli/commands/linked-artifacts.js.map +1 -1
  32. package/dist/cli/commands/plan.d.ts +6 -0
  33. package/dist/cli/commands/plan.js +93 -32
  34. package/dist/cli/commands/plan.js.map +1 -1
  35. package/dist/cli/commands/validate.d.ts +20 -0
  36. package/dist/cli/commands/validate.js +292 -28
  37. package/dist/cli/commands/validate.js.map +1 -1
  38. package/dist/cli/error-guidance.d.ts +8 -0
  39. package/dist/cli/error-guidance.js +102 -2
  40. package/dist/cli/error-guidance.js.map +1 -1
  41. package/dist/cli/help-content.js +7 -3
  42. package/dist/cli/help-content.js.map +1 -1
  43. package/dist/cli/register-mutation.js +47 -16
  44. package/dist/cli/register-mutation.js.map +1 -1
  45. package/dist/cli/register-operations.js +10 -2
  46. package/dist/cli/register-operations.js.map +1 -1
  47. package/dist/cli/register-setup.js +16 -16
  48. package/dist/cli/register-setup.js.map +1 -1
  49. package/dist/cli-bundle/chunks/{activity-W6TS5F2L.js → activity-XADJOG6G.js} +11 -11
  50. package/dist/cli-bundle/chunks/activity-XZIUPGZH.js +16 -0
  51. package/dist/cli-bundle/chunks/{aggregate-UK2WJ4Z3.js → aggregate-6OTS3AOO.js} +10 -10
  52. package/dist/cli-bundle/chunks/{aggregate-NNJLKGEK.js → aggregate-OD36DJU5.js} +10 -10
  53. package/dist/cli-bundle/chunks/{append-DHGTLUZW.js → append-JYWO4P7W.js} +8 -8
  54. package/dist/cli-bundle/chunks/{append-7BS36Z2L.js → append-KG55G7S3.js} +8 -8
  55. package/dist/cli-bundle/chunks/{chunk-GF5XIBUH.js → chunk-35P4GT6E.js} +111 -10
  56. package/dist/cli-bundle/chunks/chunk-35P4GT6E.js.map +7 -0
  57. package/dist/cli-bundle/chunks/{chunk-A6XVYNQJ.js → chunk-37CYVF73.js} +5 -5
  58. package/dist/cli-bundle/chunks/{chunk-XRE4CTNP.js → chunk-3KLPFWZ4.js} +6 -6
  59. package/dist/cli-bundle/chunks/{chunk-WSWOQP3Z.js → chunk-4HFU4UO2.js} +3 -3
  60. package/dist/cli-bundle/chunks/{chunk-UNH3KSHG.js → chunk-4JCSYR6F.js} +3 -3
  61. package/dist/cli-bundle/chunks/{chunk-73PSHEMT.js → chunk-4YFAGDRH.js} +8 -8
  62. package/dist/cli-bundle/chunks/{chunk-7GYMMDDW.js → chunk-5SCT2JCT.js} +2 -2
  63. package/dist/cli-bundle/chunks/{chunk-Q6PSD5DZ.js → chunk-73ZPG2I3.js} +3 -3
  64. package/dist/cli-bundle/chunks/{chunk-XH6RA5A5.js → chunk-7AMK6DOW.js} +15 -15
  65. package/dist/cli-bundle/chunks/{chunk-XH6RA5A5.js.map → chunk-7AMK6DOW.js.map} +1 -1
  66. package/dist/cli-bundle/chunks/{chunk-CTW7QAHM.js → chunk-7IYFN5R7.js} +3 -3
  67. package/dist/cli-bundle/chunks/{chunk-OSGWBWLK.js → chunk-7UGSRQCL.js} +5 -5
  68. package/dist/cli-bundle/chunks/{chunk-WNMRICXH.js → chunk-A6LXQFO7.js} +4 -3
  69. package/dist/cli-bundle/chunks/chunk-A6LXQFO7.js.map +1 -0
  70. package/dist/cli-bundle/chunks/{chunk-UDWUDUJI.js → chunk-ATEES5SX.js} +2 -2
  71. package/dist/cli-bundle/chunks/{chunk-2MKBPWMK.js → chunk-AVGHVVF7.js} +3 -3
  72. package/dist/cli-bundle/chunks/{chunk-ZH7C7ZVX.js → chunk-AX4GEVQC.js} +14 -14
  73. package/dist/cli-bundle/chunks/{chunk-ZH7C7ZVX.js.map → chunk-AX4GEVQC.js.map} +2 -2
  74. package/dist/cli-bundle/chunks/chunk-C6SAP27O.js +187 -0
  75. package/dist/cli-bundle/chunks/chunk-C6SAP27O.js.map +1 -0
  76. package/dist/cli-bundle/chunks/{chunk-344GDQTH.js → chunk-CCX4RSYZ.js} +2 -2
  77. package/dist/cli-bundle/chunks/{chunk-6KQS23TX.js → chunk-CW6E4NAT.js} +8 -8
  78. package/dist/cli-bundle/chunks/{chunk-K45NAJV2.js → chunk-DY6C42S6.js} +9 -9
  79. package/dist/cli-bundle/chunks/chunk-EKS6O2IR.js +217 -0
  80. package/dist/cli-bundle/chunks/chunk-EKS6O2IR.js.map +1 -0
  81. package/dist/cli-bundle/chunks/{chunk-ANVZCNL5.js → chunk-ESANVZF4.js} +3 -3
  82. package/dist/cli-bundle/chunks/{chunk-6OSG3EMX.js → chunk-EWFY7SLA.js} +8 -8
  83. package/dist/cli-bundle/chunks/{chunk-DMDEC4QP.js → chunk-F75JSIOZ.js} +6 -6
  84. package/dist/cli-bundle/chunks/{chunk-TALBUVWF.js → chunk-FDH2X65L.js} +2 -2
  85. package/dist/cli-bundle/chunks/{chunk-OQGJSCZZ.js → chunk-FY4SPXSC.js} +3 -2
  86. package/dist/cli-bundle/chunks/chunk-FY4SPXSC.js.map +7 -0
  87. package/dist/cli-bundle/chunks/{chunk-TZLGCTA5.js → chunk-GKIZW7SM.js} +3 -3
  88. package/dist/cli-bundle/chunks/{chunk-UMWF6ZAS.js → chunk-GWZSYR6X.js} +2 -2
  89. package/dist/cli-bundle/chunks/{chunk-KHBRV5JU.js → chunk-HGLC63AU.js} +8 -8
  90. package/dist/cli-bundle/chunks/{chunk-CMEHZD6G.js → chunk-HHHJ2GI3.js} +8 -8
  91. package/dist/cli-bundle/chunks/{chunk-MF6KSSMF.js → chunk-HI7STVF2.js} +6 -6
  92. package/dist/cli-bundle/chunks/{chunk-IEQ3N7WP.js → chunk-I2IJY2NL.js} +2 -2
  93. package/dist/cli-bundle/chunks/{chunk-O64EYNHF.js → chunk-I53JBTJW.js} +6 -6
  94. package/dist/cli-bundle/chunks/{chunk-K7SXBA75.js → chunk-I7NYDZDV.js} +2 -2
  95. package/dist/cli-bundle/chunks/{chunk-WBU257Z4.js → chunk-IGVJRZ6H.js} +8 -8
  96. package/dist/cli-bundle/chunks/{chunk-7TW64BS5.js → chunk-IUKD4W6Z.js} +2 -2
  97. package/dist/cli-bundle/chunks/{chunk-DTRIVUTN.js → chunk-KBPQHXWG.js} +21 -8
  98. package/dist/cli-bundle/chunks/chunk-KBPQHXWG.js.map +1 -0
  99. package/dist/cli-bundle/chunks/{chunk-OVNSQHDG.js → chunk-KWAXVAXX.js} +4 -4
  100. package/dist/cli-bundle/chunks/{chunk-WWEFBBVF.js → chunk-L5EPZQIC.js} +12 -12
  101. package/dist/cli-bundle/chunks/chunk-NAWVUHXH.js +220 -0
  102. package/dist/cli-bundle/chunks/chunk-NAWVUHXH.js.map +7 -0
  103. package/dist/cli-bundle/chunks/{chunk-6ADVKPVV.js → chunk-OASDW5UI.js} +7 -7
  104. package/dist/cli-bundle/chunks/{chunk-EIS32UA4.js → chunk-OLKBSY4N.js} +2 -2
  105. package/dist/cli-bundle/chunks/{chunk-X3IPJU2O.js → chunk-P5BJOMBB.js} +9 -9
  106. package/dist/cli-bundle/chunks/{chunk-LYL32FT6.js → chunk-P5U5EOMA.js} +3 -3
  107. package/dist/cli-bundle/chunks/{chunk-EAQLLID6.js → chunk-PNYAAB4S.js} +21 -188
  108. package/dist/cli-bundle/chunks/chunk-PNYAAB4S.js.map +1 -0
  109. package/dist/cli-bundle/chunks/{chunk-TV6FZGVK.js → chunk-QJMGRZO2.js} +3 -3
  110. package/dist/cli-bundle/chunks/{chunk-KMMUDSSB.js → chunk-QKW5D45B.js} +5 -5
  111. package/dist/cli-bundle/chunks/{chunk-4H2NDEGJ.js → chunk-QNJSITCX.js} +7 -7
  112. package/dist/cli-bundle/chunks/chunk-R2OUQVBK.js +190 -0
  113. package/dist/cli-bundle/chunks/chunk-R2OUQVBK.js.map +7 -0
  114. package/dist/cli-bundle/chunks/{chunk-XSCGU4WT.js → chunk-R4VWYWRN.js} +19 -193
  115. package/dist/cli-bundle/chunks/chunk-R4VWYWRN.js.map +7 -0
  116. package/dist/cli-bundle/chunks/{chunk-VSS3CSTF.js → chunk-RXAP6JL5.js} +9 -9
  117. package/dist/cli-bundle/chunks/{chunk-3VTWCBXL.js → chunk-S26FESD4.js} +3 -3
  118. package/dist/cli-bundle/chunks/{chunk-DEYNERFX.js → chunk-S2ZLDYGS.js} +4 -4
  119. package/dist/cli-bundle/chunks/{chunk-QGIWURY3.js → chunk-SO55HRA5.js} +12 -12
  120. package/dist/cli-bundle/chunks/{chunk-F2PVV7IX.js → chunk-SXKNJPQ7.js} +3 -3
  121. package/dist/cli-bundle/chunks/{chunk-5OMABP7I.js → chunk-TK5VZFHY.js} +7 -7
  122. package/dist/cli-bundle/chunks/{chunk-UY26RIBR.js → chunk-TNAP7EJX.js} +2 -2
  123. package/dist/cli-bundle/chunks/{chunk-QJ2OIEOC.js → chunk-UIG4TW2H.js} +111 -10
  124. package/dist/cli-bundle/chunks/chunk-UIG4TW2H.js.map +1 -0
  125. package/dist/cli-bundle/chunks/{chunk-SNASEDXB.js → chunk-UUWGCWBU.js} +3 -3
  126. package/dist/cli-bundle/chunks/{chunk-6N46IM44.js → chunk-VAOUX6TK.js} +2 -2
  127. package/dist/cli-bundle/chunks/{chunk-X5YC5DZM.js → chunk-VFUZV5EB.js} +5 -5
  128. package/dist/cli-bundle/chunks/{chunk-I2FM2SMO.js → chunk-VPEAS7PS.js} +2 -2
  129. package/dist/cli-bundle/chunks/{chunk-7DUVDW7C.js → chunk-VSRZRLG3.js} +3 -3
  130. package/dist/cli-bundle/chunks/{chunk-GP6SHEAI.js → chunk-WPDMBIX6.js} +20 -7
  131. package/dist/cli-bundle/chunks/chunk-WPDMBIX6.js.map +7 -0
  132. package/dist/cli-bundle/chunks/{chunk-PYULT32I.js → chunk-WUNFKP7M.js} +2 -2
  133. package/dist/cli-bundle/chunks/{chunk-LUJQJR7G.js → chunk-XJDGS74Y.js} +5 -5
  134. package/dist/cli-bundle/chunks/{chunk-TXWMLDMG.js → chunk-XMBI6TNW.js} +4 -4
  135. package/dist/cli-bundle/chunks/{chunk-4CYHWHZU.js → chunk-XTKJSVWH.js} +2 -2
  136. package/dist/cli-bundle/chunks/{chunk-T6QLB34N.js → chunk-XUC4C4PT.js} +3 -3
  137. package/dist/cli-bundle/chunks/{chunk-KRZQGRVL.js → chunk-XWMF3POR.js} +5 -5
  138. package/dist/cli-bundle/chunks/{chunk-OROMGSBP.js → chunk-Y3YKK7CY.js} +2 -2
  139. package/dist/cli-bundle/chunks/{chunk-D6JZBUZ6.js → chunk-YW6Q3RYZ.js} +7 -7
  140. package/dist/cli-bundle/chunks/{chunk-GRHPU6EM.js → chunk-ZLMIWZUG.js} +2 -2
  141. package/dist/cli-bundle/chunks/{chunk-5HH6QRH5.js → chunk-ZMW77VWV.js} +9 -9
  142. package/dist/cli-bundle/chunks/{chunk-BE5G7HEL.js → chunk-ZYNJNPYD.js} +4 -4
  143. package/dist/cli-bundle/chunks/{claim-3TY5LE54.js → claim-2RDYMCTP.js} +10 -10
  144. package/dist/cli-bundle/chunks/{claim-LM4YY6QQ.js → claim-MJ7DZFC3.js} +10 -10
  145. package/dist/cli-bundle/chunks/close-4FMAPEMY.js +13 -0
  146. package/dist/cli-bundle/chunks/{close-CSD4LEMT.js → close-XLEKIQSW.js} +8 -8
  147. package/dist/cli-bundle/chunks/{close-many-B5SHDX6W.js → close-many-AOD4HSAZ.js} +15 -15
  148. package/dist/cli-bundle/chunks/{close-many-WRXB5KVY.js → close-many-XKAQY5CQ.js} +15 -15
  149. package/dist/cli-bundle/chunks/{comments-BDDEK3VW.js → comments-B4RWWDJT.js} +10 -10
  150. package/dist/cli-bundle/chunks/{comments-A5ALOYTG.js → comments-RN5TG4ZN.js} +10 -10
  151. package/dist/cli-bundle/chunks/{config-W2NHDNQT.js → config-3JXJ3XZ7.js} +8 -8
  152. package/dist/cli-bundle/chunks/{config-YUYBMJOW.js → config-FZ4UDC4B.js} +8 -8
  153. package/dist/cli-bundle/chunks/{context-LRJ74NSU.js → context-L36PIN35.js} +13 -13
  154. package/dist/cli-bundle/chunks/{context-R2QLOJCK.js → context-QBPO3BFM.js} +13 -13
  155. package/dist/cli-bundle/chunks/{contracts-HJHR4NCD.js → contracts-2G66IGIA.js} +309 -6
  156. package/dist/cli-bundle/chunks/contracts-2G66IGIA.js.map +1 -0
  157. package/dist/cli-bundle/chunks/{contracts-47X7RYUF.js → contracts-PJCHYSO5.js} +315 -5
  158. package/dist/cli-bundle/chunks/contracts-PJCHYSO5.js.map +7 -0
  159. package/dist/cli-bundle/chunks/{copy-P4UVYZ7M.js → copy-ALU5WMHA.js} +7 -7
  160. package/dist/cli-bundle/chunks/{copy-B7HFOWFB.js → copy-FWIVTLBO.js} +7 -7
  161. package/dist/cli-bundle/chunks/{create-5ERJF64D.js → create-5433DP3G.js} +13 -13
  162. package/dist/cli-bundle/chunks/create-VWLWS34Z.js +27 -0
  163. package/dist/cli-bundle/chunks/{delete-LX3LGBCH.js → delete-IYTIYAJS.js} +7 -7
  164. package/dist/cli-bundle/chunks/{delete-S3WVK6LP.js → delete-Y2SGJBGY.js} +7 -7
  165. package/dist/cli-bundle/chunks/{deps-YSM4LZQD.js → deps-6TSPOSGU.js} +7 -7
  166. package/dist/cli-bundle/chunks/{deps-GWSNH7OZ.js → deps-CZ4PTVXU.js} +7 -7
  167. package/dist/cli-bundle/chunks/{docs-TG6JMVMY.js → docs-I3BAF5WH.js} +11 -11
  168. package/dist/cli-bundle/chunks/docs-I3BAF5WH.js.map +1 -0
  169. package/dist/cli-bundle/chunks/{docs-7RYFBHQD.js → docs-MXLGZUIT.js} +10 -10
  170. package/dist/cli-bundle/chunks/docs-MXLGZUIT.js.map +7 -0
  171. package/dist/cli-bundle/chunks/{extension-R3LUKMX7.js → extension-Q34OEWO5.js} +5 -5
  172. package/dist/cli-bundle/chunks/{extension-VNMRKIHI.js → extension-WH2FOIOZ.js} +5 -5
  173. package/dist/cli-bundle/chunks/{files-KAKU57OT.js → files-FYP3MDPX.js} +10 -10
  174. package/dist/cli-bundle/chunks/files-FYP3MDPX.js.map +7 -0
  175. package/dist/cli-bundle/chunks/{files-QB3EYPMO.js → files-GUXUM2MB.js} +11 -11
  176. package/dist/cli-bundle/chunks/files-GUXUM2MB.js.map +1 -0
  177. package/dist/cli-bundle/chunks/{gc-KNUPLPSW.js → gc-FENB2ESG.js} +14 -176
  178. package/dist/cli-bundle/chunks/gc-FENB2ESG.js.map +1 -0
  179. package/dist/cli-bundle/chunks/{gc-B747VM4M.js → gc-KGQG66SA.js} +12 -181
  180. package/dist/cli-bundle/chunks/gc-KGQG66SA.js.map +7 -0
  181. package/dist/cli-bundle/chunks/{get-GMGLIQ5I.js → get-PCHS7RA6.js} +11 -11
  182. package/dist/cli-bundle/chunks/{get-SBL6NHYQ.js → get-QARTE6BL.js} +11 -11
  183. package/dist/cli-bundle/chunks/{health-WWZJ5KJS.js → health-7MTXAVR2.js} +82 -15
  184. package/dist/cli-bundle/chunks/health-7MTXAVR2.js.map +7 -0
  185. package/dist/cli-bundle/chunks/{health-IG43Z4KL.js → health-E4D7KGHD.js} +83 -16
  186. package/dist/cli-bundle/chunks/health-E4D7KGHD.js.map +1 -0
  187. package/dist/cli-bundle/chunks/{history-XCWRXBXC.js → history-7WUAEWHW.js} +10 -10
  188. package/dist/cli-bundle/chunks/history-L2FQFRTU.js +20 -0
  189. package/dist/cli-bundle/chunks/{history-compact-KICKUCR7.js → history-compact-3EJ3L2O7.js} +11 -11
  190. package/dist/cli-bundle/chunks/{history-compact-IDH7E7VN.js → history-compact-LW27IPFK.js} +11 -11
  191. package/dist/cli-bundle/chunks/{history-redact-JJWH3QWK.js → history-redact-G72A4EJ4.js} +11 -11
  192. package/dist/cli-bundle/chunks/history-redact-QWQCX5DZ.js +19 -0
  193. package/dist/cli-bundle/chunks/{history-repair-N5HXKJOI.js → history-repair-OSQOKJ3E.js} +71 -13
  194. package/dist/cli-bundle/chunks/history-repair-OSQOKJ3E.js.map +7 -0
  195. package/dist/cli-bundle/chunks/{history-repair-7HWBZKXN.js → history-repair-SBK7P34V.js} +72 -14
  196. package/dist/cli-bundle/chunks/history-repair-SBK7P34V.js.map +1 -0
  197. package/dist/cli-bundle/chunks/init-4BKRHGWW.js +17 -0
  198. package/dist/cli-bundle/chunks/{init-OQA3TWIS.js → init-S5WEGUJY.js} +9 -9
  199. package/dist/cli-bundle/chunks/{learnings-L7VQUSVI.js → learnings-HQXSSKZ5.js} +10 -10
  200. package/dist/cli-bundle/chunks/{learnings-Z4GAIZQ5.js → learnings-XK3P4ZDR.js} +10 -10
  201. package/dist/cli-bundle/chunks/{list-W5ROBC5U.js → list-6CL3XFT6.js} +10 -10
  202. package/dist/cli-bundle/chunks/list-BYNN4ZEO.js +19 -0
  203. package/dist/cli-bundle/chunks/{notes-JJDOEDFK.js → notes-5T6P7C5V.js} +10 -10
  204. package/dist/cli-bundle/chunks/{notes-SDCK7BEN.js → notes-U5FZCSBT.js} +10 -10
  205. package/dist/cli-bundle/chunks/{plan-H5HYHMBB.js → plan-2YTQYWGM.js} +63 -23
  206. package/dist/cli-bundle/chunks/plan-2YTQYWGM.js.map +1 -0
  207. package/dist/cli-bundle/chunks/{plan-W2B5RYR3.js → plan-7IVSICR6.js} +62 -22
  208. package/dist/cli-bundle/chunks/plan-7IVSICR6.js.map +7 -0
  209. package/dist/cli-bundle/chunks/{register-list-query-QGRFMDWA.js → register-list-query-4UPMHONX.js} +18 -18
  210. package/dist/cli-bundle/chunks/{register-list-query-V4S23735.js → register-list-query-7VOW2C3W.js} +18 -18
  211. package/dist/cli-bundle/chunks/{register-mutation-ZPZNJXSA.js → register-mutation-FARSGYRD.js} +64 -47
  212. package/dist/cli-bundle/chunks/{register-mutation-ZPZNJXSA.js.map → register-mutation-FARSGYRD.js.map} +2 -2
  213. package/dist/cli-bundle/chunks/{register-mutation-I57PLUHA.js → register-mutation-LJDNVREU.js} +65 -48
  214. package/dist/cli-bundle/chunks/{register-mutation-I57PLUHA.js.map → register-mutation-LJDNVREU.js.map} +1 -1
  215. package/dist/cli-bundle/chunks/{register-operations-KAMLXAF5.js → register-operations-FFTYAL42.js} +38 -34
  216. package/dist/cli-bundle/chunks/register-operations-FFTYAL42.js.map +1 -0
  217. package/dist/cli-bundle/chunks/{register-operations-YEN4YEZ2.js → register-operations-HCJKDUA6.js} +37 -33
  218. package/dist/cli-bundle/chunks/{register-operations-YEN4YEZ2.js.map → register-operations-HCJKDUA6.js.map} +2 -2
  219. package/dist/cli-bundle/chunks/{register-setup-BZ3TNE3G.js → register-setup-6AVIUOCC.js} +31 -31
  220. package/dist/cli-bundle/chunks/register-setup-6AVIUOCC.js.map +1 -0
  221. package/dist/cli-bundle/chunks/{register-setup-WLFL3OUF.js → register-setup-KVNLO5OJ.js} +30 -30
  222. package/dist/cli-bundle/chunks/register-setup-KVNLO5OJ.js.map +7 -0
  223. package/dist/cli-bundle/chunks/restore-CHIOQAQL.js +17 -0
  224. package/dist/cli-bundle/chunks/{restore-RGFSPG4K.js → restore-M6AFHMV4.js} +11 -11
  225. package/dist/cli-bundle/chunks/{schema-CCDU3RLC.js → schema-76HDZJCC.js} +8 -8
  226. package/dist/cli-bundle/chunks/{schema-KZASL323.js → schema-AINZ2IMM.js} +8 -8
  227. package/dist/cli-bundle/chunks/{search-7KSOLI2E.js → search-JMLFQEPJ.js} +10 -10
  228. package/dist/cli-bundle/chunks/{search-DTL7CO22.js → search-NL3TSCYB.js} +10 -10
  229. package/dist/cli-bundle/chunks/{stats-QNV7B2CE.js → stats-BKXCBIGT.js} +7 -7
  230. package/dist/cli-bundle/chunks/{stats-IOXQMGI6.js → stats-UBD56TGK.js} +7 -7
  231. package/dist/cli-bundle/chunks/{telemetry-NHR5RFXT.js → telemetry-N454RHG5.js} +4 -4
  232. package/dist/cli-bundle/chunks/{telemetry-IV5C6JOM.js → telemetry-ZJXK3H7X.js} +4 -4
  233. package/dist/cli-bundle/chunks/{test-PIL2CEEB.js → test-BQAKIXAT.js} +14 -14
  234. package/dist/cli-bundle/chunks/test-O74JFUH5.js +32 -0
  235. package/dist/cli-bundle/chunks/{test-all-MFN4MYCV.js → test-all-7LV3I6S5.js} +14 -14
  236. package/dist/cli-bundle/chunks/{test-all-GRLYHBNP.js → test-all-TDYCCBA4.js} +14 -14
  237. package/dist/cli-bundle/chunks/{test-runs-7WCSC3TY.js → test-runs-E64M6XS3.js} +5 -5
  238. package/dist/cli-bundle/chunks/{test-runs-7LRFWWCA.js → test-runs-LXZLULCI.js} +5 -5
  239. package/dist/cli-bundle/chunks/update-36JM7YZT.js +21 -0
  240. package/dist/cli-bundle/chunks/update-I246PCLO.js +25 -0
  241. package/dist/cli-bundle/chunks/{update-many-UYMTVF42.js → update-many-F4IKDWZB.js} +22 -22
  242. package/dist/cli-bundle/chunks/{update-many-LOTAYUTN.js → update-many-NTWZ5YT3.js} +22 -22
  243. package/dist/cli-bundle/chunks/{upgrade-ZZSC7CLV.js → upgrade-37F7JKES.js} +5 -5
  244. package/dist/cli-bundle/chunks/{upgrade-LT2MLLPS.js → upgrade-L32JA4TZ.js} +5 -5
  245. package/dist/cli-bundle/chunks/{validate-IQIQSKUX.js → validate-46KCRHL7.js} +462 -50
  246. package/dist/cli-bundle/chunks/validate-46KCRHL7.js.map +1 -0
  247. package/dist/cli-bundle/chunks/{validate-3XRORNMP.js → validate-CRFMPTYD.js} +482 -49
  248. package/dist/cli-bundle/chunks/validate-CRFMPTYD.js.map +7 -0
  249. package/dist/cli-bundle/main.js +180 -25
  250. package/dist/cli-bundle/main.js.map +2 -2
  251. package/dist/core/diagnostics/remediation.js +19 -6
  252. package/dist/core/diagnostics/remediation.js.map +1 -1
  253. package/dist/core/lock/lock-gc.d.ts +31 -0
  254. package/dist/core/lock/lock-gc.js +120 -62
  255. package/dist/core/lock/lock-gc.js.map +1 -1
  256. package/dist/core/output/query-summary.d.ts +31 -0
  257. package/dist/core/output/query-summary.js +62 -0
  258. package/dist/core/output/query-summary.js.map +1 -0
  259. package/dist/core/shared/constants.js +3 -2
  260. package/dist/core/shared/constants.js.map +1 -1
  261. package/dist/core/telemetry/consent.js +18 -3
  262. package/dist/core/telemetry/consent.js.map +1 -1
  263. package/dist/core/validate/fix-planning.d.ts +130 -0
  264. package/dist/core/validate/fix-planning.js +202 -0
  265. package/dist/core/validate/fix-planning.js.map +1 -0
  266. package/dist/core/validate/missing-by-type.d.ts +21 -0
  267. package/dist/core/validate/missing-by-type.js +39 -0
  268. package/dist/core/validate/missing-by-type.js.map +1 -0
  269. package/dist/core/validate/stale-file-classification.d.ts +41 -0
  270. package/dist/core/validate/stale-file-classification.js +73 -0
  271. package/dist/core/validate/stale-file-classification.js.map +1 -0
  272. package/dist/mcp/server.js +74 -266
  273. package/dist/mcp/server.js.map +1 -1
  274. package/dist/mcp/tool-definitions.d.ts +27 -0
  275. package/dist/mcp/tool-definitions.js +330 -0
  276. package/dist/mcp/tool-definitions.js.map +1 -0
  277. package/dist/sdk/cli-contracts/tool-parameter-tables.js +38 -2
  278. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  279. package/dist/sdk/cli-contracts.d.ts +6 -1
  280. package/dist/sdk/cli-contracts.js +74 -7
  281. package/dist/sdk/cli-contracts.js.map +1 -1
  282. package/docs/AGENT_GUIDE.md +7 -2
  283. package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
  284. package/docs/COMMANDS.md +25 -2
  285. package/marketplace.json +1 -1
  286. package/package.json +1 -1
  287. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  288. package/plugins/pm-claude/README.md +7 -3
  289. package/plugins/pm-claude/commands/pm-init.md +1 -1
  290. package/plugins/pm-codex/README.md +2 -2
  291. package/dist/cli-bundle/chunks/activity-5QLX6DHN.js +0 -16
  292. package/dist/cli-bundle/chunks/chunk-DTRIVUTN.js.map +0 -1
  293. package/dist/cli-bundle/chunks/chunk-EAQLLID6.js.map +0 -1
  294. package/dist/cli-bundle/chunks/chunk-GF5XIBUH.js.map +0 -7
  295. package/dist/cli-bundle/chunks/chunk-GP6SHEAI.js.map +0 -7
  296. package/dist/cli-bundle/chunks/chunk-OQGJSCZZ.js.map +0 -7
  297. package/dist/cli-bundle/chunks/chunk-QJ2OIEOC.js.map +0 -1
  298. package/dist/cli-bundle/chunks/chunk-WNMRICXH.js.map +0 -1
  299. package/dist/cli-bundle/chunks/chunk-XSCGU4WT.js.map +0 -7
  300. package/dist/cli-bundle/chunks/close-SIQCDOBR.js +0 -13
  301. package/dist/cli-bundle/chunks/contracts-47X7RYUF.js.map +0 -7
  302. package/dist/cli-bundle/chunks/contracts-HJHR4NCD.js.map +0 -1
  303. package/dist/cli-bundle/chunks/create-TXNRPS4K.js +0 -27
  304. package/dist/cli-bundle/chunks/docs-7RYFBHQD.js.map +0 -7
  305. package/dist/cli-bundle/chunks/docs-TG6JMVMY.js.map +0 -1
  306. package/dist/cli-bundle/chunks/files-KAKU57OT.js.map +0 -7
  307. package/dist/cli-bundle/chunks/files-QB3EYPMO.js.map +0 -1
  308. package/dist/cli-bundle/chunks/gc-B747VM4M.js.map +0 -7
  309. package/dist/cli-bundle/chunks/gc-KNUPLPSW.js.map +0 -1
  310. package/dist/cli-bundle/chunks/health-IG43Z4KL.js.map +0 -1
  311. package/dist/cli-bundle/chunks/health-WWZJ5KJS.js.map +0 -7
  312. package/dist/cli-bundle/chunks/history-6UKSZTRT.js +0 -20
  313. package/dist/cli-bundle/chunks/history-redact-HKYBTK6X.js +0 -19
  314. package/dist/cli-bundle/chunks/history-repair-7HWBZKXN.js.map +0 -1
  315. package/dist/cli-bundle/chunks/history-repair-N5HXKJOI.js.map +0 -7
  316. package/dist/cli-bundle/chunks/init-27JLDUO2.js +0 -17
  317. package/dist/cli-bundle/chunks/list-6U3CJVXS.js +0 -19
  318. package/dist/cli-bundle/chunks/plan-H5HYHMBB.js.map +0 -1
  319. package/dist/cli-bundle/chunks/plan-W2B5RYR3.js.map +0 -7
  320. package/dist/cli-bundle/chunks/register-operations-KAMLXAF5.js.map +0 -1
  321. package/dist/cli-bundle/chunks/register-setup-BZ3TNE3G.js.map +0 -1
  322. package/dist/cli-bundle/chunks/register-setup-WLFL3OUF.js.map +0 -7
  323. package/dist/cli-bundle/chunks/restore-GNI2W5CN.js +0 -17
  324. package/dist/cli-bundle/chunks/test-4Z37CXW4.js +0 -32
  325. package/dist/cli-bundle/chunks/update-I4G34LKJ.js +0 -21
  326. package/dist/cli-bundle/chunks/update-VI5DBZ3G.js +0 -25
  327. package/dist/cli-bundle/chunks/validate-3XRORNMP.js.map +0 -7
  328. package/dist/cli-bundle/chunks/validate-IQIQSKUX.js.map +0 -1
  329. /package/dist/cli-bundle/chunks/{activity-W6TS5F2L.js.map → activity-XADJOG6G.js.map} +0 -0
  330. /package/dist/cli-bundle/chunks/{activity-5QLX6DHN.js.map → activity-XZIUPGZH.js.map} +0 -0
  331. /package/dist/cli-bundle/chunks/{aggregate-UK2WJ4Z3.js.map → aggregate-6OTS3AOO.js.map} +0 -0
  332. /package/dist/cli-bundle/chunks/{aggregate-NNJLKGEK.js.map → aggregate-OD36DJU5.js.map} +0 -0
  333. /package/dist/cli-bundle/chunks/{append-DHGTLUZW.js.map → append-JYWO4P7W.js.map} +0 -0
  334. /package/dist/cli-bundle/chunks/{append-7BS36Z2L.js.map → append-KG55G7S3.js.map} +0 -0
  335. /package/dist/cli-bundle/chunks/{chunk-A6XVYNQJ.js.map → chunk-37CYVF73.js.map} +0 -0
  336. /package/dist/cli-bundle/chunks/{chunk-XRE4CTNP.js.map → chunk-3KLPFWZ4.js.map} +0 -0
  337. /package/dist/cli-bundle/chunks/{chunk-WSWOQP3Z.js.map → chunk-4HFU4UO2.js.map} +0 -0
  338. /package/dist/cli-bundle/chunks/{chunk-UNH3KSHG.js.map → chunk-4JCSYR6F.js.map} +0 -0
  339. /package/dist/cli-bundle/chunks/{chunk-73PSHEMT.js.map → chunk-4YFAGDRH.js.map} +0 -0
  340. /package/dist/cli-bundle/chunks/{chunk-7GYMMDDW.js.map → chunk-5SCT2JCT.js.map} +0 -0
  341. /package/dist/cli-bundle/chunks/{chunk-Q6PSD5DZ.js.map → chunk-73ZPG2I3.js.map} +0 -0
  342. /package/dist/cli-bundle/chunks/{chunk-CTW7QAHM.js.map → chunk-7IYFN5R7.js.map} +0 -0
  343. /package/dist/cli-bundle/chunks/{chunk-OSGWBWLK.js.map → chunk-7UGSRQCL.js.map} +0 -0
  344. /package/dist/cli-bundle/chunks/{chunk-UDWUDUJI.js.map → chunk-ATEES5SX.js.map} +0 -0
  345. /package/dist/cli-bundle/chunks/{chunk-2MKBPWMK.js.map → chunk-AVGHVVF7.js.map} +0 -0
  346. /package/dist/cli-bundle/chunks/{chunk-344GDQTH.js.map → chunk-CCX4RSYZ.js.map} +0 -0
  347. /package/dist/cli-bundle/chunks/{chunk-6KQS23TX.js.map → chunk-CW6E4NAT.js.map} +0 -0
  348. /package/dist/cli-bundle/chunks/{chunk-K45NAJV2.js.map → chunk-DY6C42S6.js.map} +0 -0
  349. /package/dist/cli-bundle/chunks/{chunk-ANVZCNL5.js.map → chunk-ESANVZF4.js.map} +0 -0
  350. /package/dist/cli-bundle/chunks/{chunk-6OSG3EMX.js.map → chunk-EWFY7SLA.js.map} +0 -0
  351. /package/dist/cli-bundle/chunks/{chunk-DMDEC4QP.js.map → chunk-F75JSIOZ.js.map} +0 -0
  352. /package/dist/cli-bundle/chunks/{chunk-TALBUVWF.js.map → chunk-FDH2X65L.js.map} +0 -0
  353. /package/dist/cli-bundle/chunks/{chunk-TZLGCTA5.js.map → chunk-GKIZW7SM.js.map} +0 -0
  354. /package/dist/cli-bundle/chunks/{chunk-UMWF6ZAS.js.map → chunk-GWZSYR6X.js.map} +0 -0
  355. /package/dist/cli-bundle/chunks/{chunk-KHBRV5JU.js.map → chunk-HGLC63AU.js.map} +0 -0
  356. /package/dist/cli-bundle/chunks/{chunk-CMEHZD6G.js.map → chunk-HHHJ2GI3.js.map} +0 -0
  357. /package/dist/cli-bundle/chunks/{chunk-MF6KSSMF.js.map → chunk-HI7STVF2.js.map} +0 -0
  358. /package/dist/cli-bundle/chunks/{chunk-IEQ3N7WP.js.map → chunk-I2IJY2NL.js.map} +0 -0
  359. /package/dist/cli-bundle/chunks/{chunk-O64EYNHF.js.map → chunk-I53JBTJW.js.map} +0 -0
  360. /package/dist/cli-bundle/chunks/{chunk-K7SXBA75.js.map → chunk-I7NYDZDV.js.map} +0 -0
  361. /package/dist/cli-bundle/chunks/{chunk-WBU257Z4.js.map → chunk-IGVJRZ6H.js.map} +0 -0
  362. /package/dist/cli-bundle/chunks/{chunk-7TW64BS5.js.map → chunk-IUKD4W6Z.js.map} +0 -0
  363. /package/dist/cli-bundle/chunks/{chunk-OVNSQHDG.js.map → chunk-KWAXVAXX.js.map} +0 -0
  364. /package/dist/cli-bundle/chunks/{chunk-WWEFBBVF.js.map → chunk-L5EPZQIC.js.map} +0 -0
  365. /package/dist/cli-bundle/chunks/{chunk-6ADVKPVV.js.map → chunk-OASDW5UI.js.map} +0 -0
  366. /package/dist/cli-bundle/chunks/{chunk-EIS32UA4.js.map → chunk-OLKBSY4N.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{chunk-X3IPJU2O.js.map → chunk-P5BJOMBB.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{chunk-LYL32FT6.js.map → chunk-P5U5EOMA.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{chunk-TV6FZGVK.js.map → chunk-QJMGRZO2.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{chunk-KMMUDSSB.js.map → chunk-QKW5D45B.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{chunk-4H2NDEGJ.js.map → chunk-QNJSITCX.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{chunk-VSS3CSTF.js.map → chunk-RXAP6JL5.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{chunk-3VTWCBXL.js.map → chunk-S26FESD4.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{chunk-DEYNERFX.js.map → chunk-S2ZLDYGS.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{chunk-QGIWURY3.js.map → chunk-SO55HRA5.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{chunk-F2PVV7IX.js.map → chunk-SXKNJPQ7.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{chunk-5OMABP7I.js.map → chunk-TK5VZFHY.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{chunk-UY26RIBR.js.map → chunk-TNAP7EJX.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{chunk-SNASEDXB.js.map → chunk-UUWGCWBU.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{chunk-6N46IM44.js.map → chunk-VAOUX6TK.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{chunk-X5YC5DZM.js.map → chunk-VFUZV5EB.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{chunk-I2FM2SMO.js.map → chunk-VPEAS7PS.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{chunk-7DUVDW7C.js.map → chunk-VSRZRLG3.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{chunk-PYULT32I.js.map → chunk-WUNFKP7M.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{chunk-LUJQJR7G.js.map → chunk-XJDGS74Y.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{chunk-TXWMLDMG.js.map → chunk-XMBI6TNW.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{chunk-4CYHWHZU.js.map → chunk-XTKJSVWH.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{chunk-T6QLB34N.js.map → chunk-XUC4C4PT.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{chunk-KRZQGRVL.js.map → chunk-XWMF3POR.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{chunk-OROMGSBP.js.map → chunk-Y3YKK7CY.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{chunk-D6JZBUZ6.js.map → chunk-YW6Q3RYZ.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{chunk-GRHPU6EM.js.map → chunk-ZLMIWZUG.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{chunk-5HH6QRH5.js.map → chunk-ZMW77VWV.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{chunk-BE5G7HEL.js.map → chunk-ZYNJNPYD.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{claim-3TY5LE54.js.map → claim-2RDYMCTP.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{claim-LM4YY6QQ.js.map → claim-MJ7DZFC3.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{close-SIQCDOBR.js.map → close-4FMAPEMY.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{close-CSD4LEMT.js.map → close-XLEKIQSW.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{close-many-B5SHDX6W.js.map → close-many-AOD4HSAZ.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{close-many-WRXB5KVY.js.map → close-many-XKAQY5CQ.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{comments-BDDEK3VW.js.map → comments-B4RWWDJT.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{comments-A5ALOYTG.js.map → comments-RN5TG4ZN.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{config-W2NHDNQT.js.map → config-3JXJ3XZ7.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{config-YUYBMJOW.js.map → config-FZ4UDC4B.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{context-LRJ74NSU.js.map → context-L36PIN35.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{context-R2QLOJCK.js.map → context-QBPO3BFM.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{copy-P4UVYZ7M.js.map → copy-ALU5WMHA.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{copy-B7HFOWFB.js.map → copy-FWIVTLBO.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{create-5ERJF64D.js.map → create-5433DP3G.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{create-TXNRPS4K.js.map → create-VWLWS34Z.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{delete-LX3LGBCH.js.map → delete-IYTIYAJS.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{delete-S3WVK6LP.js.map → delete-Y2SGJBGY.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{deps-YSM4LZQD.js.map → deps-6TSPOSGU.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{deps-GWSNH7OZ.js.map → deps-CZ4PTVXU.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{extension-R3LUKMX7.js.map → extension-Q34OEWO5.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{extension-VNMRKIHI.js.map → extension-WH2FOIOZ.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{get-GMGLIQ5I.js.map → get-PCHS7RA6.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{get-SBL6NHYQ.js.map → get-QARTE6BL.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{history-XCWRXBXC.js.map → history-7WUAEWHW.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{history-6UKSZTRT.js.map → history-L2FQFRTU.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{history-compact-KICKUCR7.js.map → history-compact-3EJ3L2O7.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{history-compact-IDH7E7VN.js.map → history-compact-LW27IPFK.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{history-redact-JJWH3QWK.js.map → history-redact-G72A4EJ4.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{history-redact-HKYBTK6X.js.map → history-redact-QWQCX5DZ.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{init-27JLDUO2.js.map → init-4BKRHGWW.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{init-OQA3TWIS.js.map → init-S5WEGUJY.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{learnings-L7VQUSVI.js.map → learnings-HQXSSKZ5.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{learnings-Z4GAIZQ5.js.map → learnings-XK3P4ZDR.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{list-W5ROBC5U.js.map → list-6CL3XFT6.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{list-6U3CJVXS.js.map → list-BYNN4ZEO.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{notes-JJDOEDFK.js.map → notes-5T6P7C5V.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{notes-SDCK7BEN.js.map → notes-U5FZCSBT.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{register-list-query-QGRFMDWA.js.map → register-list-query-4UPMHONX.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{register-list-query-V4S23735.js.map → register-list-query-7VOW2C3W.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{restore-GNI2W5CN.js.map → restore-CHIOQAQL.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{restore-RGFSPG4K.js.map → restore-M6AFHMV4.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{schema-CCDU3RLC.js.map → schema-76HDZJCC.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{schema-KZASL323.js.map → schema-AINZ2IMM.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{search-7KSOLI2E.js.map → search-JMLFQEPJ.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{search-DTL7CO22.js.map → search-NL3TSCYB.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{stats-QNV7B2CE.js.map → stats-BKXCBIGT.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{stats-IOXQMGI6.js.map → stats-UBD56TGK.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{telemetry-NHR5RFXT.js.map → telemetry-N454RHG5.js.map} +0 -0
  444. /package/dist/cli-bundle/chunks/{telemetry-IV5C6JOM.js.map → telemetry-ZJXK3H7X.js.map} +0 -0
  445. /package/dist/cli-bundle/chunks/{test-PIL2CEEB.js.map → test-BQAKIXAT.js.map} +0 -0
  446. /package/dist/cli-bundle/chunks/{test-4Z37CXW4.js.map → test-O74JFUH5.js.map} +0 -0
  447. /package/dist/cli-bundle/chunks/{test-all-MFN4MYCV.js.map → test-all-7LV3I6S5.js.map} +0 -0
  448. /package/dist/cli-bundle/chunks/{test-all-GRLYHBNP.js.map → test-all-TDYCCBA4.js.map} +0 -0
  449. /package/dist/cli-bundle/chunks/{test-runs-7WCSC3TY.js.map → test-runs-E64M6XS3.js.map} +0 -0
  450. /package/dist/cli-bundle/chunks/{test-runs-7LRFWWCA.js.map → test-runs-LXZLULCI.js.map} +0 -0
  451. /package/dist/cli-bundle/chunks/{update-I4G34LKJ.js.map → update-36JM7YZT.js.map} +0 -0
  452. /package/dist/cli-bundle/chunks/{update-VI5DBZ3G.js.map → update-I246PCLO.js.map} +0 -0
  453. /package/dist/cli-bundle/chunks/{update-many-UYMTVF42.js.map → update-many-F4IKDWZB.js.map} +0 -0
  454. /package/dist/cli-bundle/chunks/{update-many-LOTAYUTN.js.map → update-many-NTWZ5YT3.js.map} +0 -0
  455. /package/dist/cli-bundle/chunks/{upgrade-ZZSC7CLV.js.map → upgrade-37F7JKES.js.map} +0 -0
  456. /package/dist/cli-bundle/chunks/{upgrade-LT2MLLPS.js.map → upgrade-L32JA4TZ.js.map} +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../cli/commands/validate.ts", "../../../../../../../../core/validate/fix-planning.ts", "../../../../../../../../core/validate/missing-by-type.ts", "../../../../../../../../core/validate/stale-file-classification.ts"],
4
+ "sourcesContent": ["import fs from \"node:fs/promises\";\nimport { realpathSync } from \"node:fs\";\nimport type { Dirent } from \"node:fs\";\nimport { execFile } from \"node:child_process\";\nimport path from \"node:path\";\nimport { promisify } from \"node:util\";\nimport { buildRemediationCommands } from \"../../core/diagnostics/remediation.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { scanHistoryDrift } from \"../../core/history/drift-scan.js\";\nimport { normalizeStatusInput } from \"../../core/item/status.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry, type RuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport {\n DEFAULT_VALIDATE_CLOSURE_LIKE_METADATA_FIELD_PATTERNS,\n DEFAULT_VALIDATE_STALE_BLOCKER_REASON_PATTERNS,\n EXIT_CODE,\n PM_DIRNAME,\n} from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { toNonEmptyStringOrUndefined } from \"../../core/shared/primitives.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { listAllFrontMatterWithBody } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport {\n partitionFixesByGrant,\n planCloseReasonBackfillFixes,\n planResolutionBackfillFixes,\n planStaleLinkPruneFixes,\n planTerminalParentFixes,\n resolveGrantedFixScopes,\n toFixOutputRow,\n type CloseReasonBackfillRow,\n type ResolutionBackfillRow,\n type StaleLinkPruneRow,\n type TerminalParentFixRow,\n type ValidateFixRecord,\n} from \"../../core/validate/fix-planning.js\";\nimport { buildMissingByTypeCounts, type MissingFieldOccurrence } from \"../../core/validate/missing-by-type.js\";\nimport {\n classifyStaleLinkedPaths,\n summarizeStaleLinkedPathClassifications,\n} from \"../../core/validate/stale-file-classification.js\";\nimport type { ValidateMetadataProfile, ValidateMetadataRequiredField } from \"../../types/index.js\";\nimport { extractReferencedPmItemIdsFromCommand } from \"./test.js\";\n\ntype ValidateCheckName = \"metadata\" | \"resolution\" | \"lifecycle\" | \"files\" | \"command_references\" | \"history_drift\";\ntype ValidateStatus = \"ok\" | \"warn\" | \"error\";\ntype ValidateDependencyCycleSeverity = \"off\" | \"warn\" | \"error\";\ntype ValidateFileScanMode = \"default\" | \"tracked-all\" | \"tracked-all-strict\";\ntype ItemWithBody = Awaited<ReturnType<typeof listAllFrontMatterWithBody>>[number];\ntype FileCandidateSource = \"default-curated\" | \"tracked-git\" | \"tracked-all-fallback-default\";\n\nconst FILE_SCAN_DIRECTORIES = [\"src\", \"tests\", \"docs\"] as const;\nconst FILE_SCAN_ROOT_FILES = [\n \"README.md\",\n \"PRD.md\",\n \"CHANGELOG.md\",\n \"AGENTS.md\",\n \"CONTRIBUTING.md\",\n \"SECURITY.md\",\n \"CODE_OF_CONDUCT.md\",\n \"LICENSE\",\n] as const;\nconst DIRECTORY_IGNORE_SET = new Set([\"node_modules\", \".git\", \".cursor\", \".agents\", \"dist\", \"coverage\"]);\nconst RESOLUTION_FIELD_KEYS = [\"resolution\", \"expected_result\", \"actual_result\"] as const;\ntype ResolutionFieldKey = (typeof RESOLUTION_FIELD_KEYS)[number];\nconst VALIDATE_FILE_SCAN_MODES = [\"default\", \"tracked-all\", \"tracked-all-strict\"] as const;\nconst VALIDATE_METADATA_PROFILE_VALUES = [\"core\", \"strict\", \"custom\"] as const;\nconst VALIDATE_DEPENDENCY_CYCLE_SEVERITY_VALUES = [\"off\", \"warn\", \"error\"] as const;\nconst LIFECYCLE_PATTERN_FIELD_KEYS = [\"blocked_reason\", \"resolution\", \"actual_result\"] as const;\ntype LifecyclePatternFieldKey = (typeof LIFECYCLE_PATTERN_FIELD_KEYS)[number];\nconst CORE_METADATA_REQUIRED_FIELDS = [\"author\", \"acceptance_criteria\", \"estimated_minutes\", \"close_reason\"] as const;\nconst STRICT_METADATA_REQUIRED_FIELDS = [\n ...CORE_METADATA_REQUIRED_FIELDS,\n \"reviewer\",\n \"risk\",\n \"confidence\",\n \"sprint\",\n \"release\",\n] as const;\nconst SUPPORTED_METADATA_REQUIRED_FIELDS = [\n ...new Set([...STRICT_METADATA_REQUIRED_FIELDS]),\n] as ValidateMetadataRequiredField[];\nconst METADATA_REQUIRED_FIELD_ALIASES: Record<string, ValidateMetadataRequiredField> = {\n author: \"author\",\n acceptance_criteria: \"acceptance_criteria\",\n \"acceptance-criteria\": \"acceptance_criteria\",\n estimated_minutes: \"estimated_minutes\",\n \"estimated-minutes\": \"estimated_minutes\",\n estimate: \"estimated_minutes\",\n close_reason: \"close_reason\",\n \"close-reason\": \"close_reason\",\n reviewer: \"reviewer\",\n risk: \"risk\",\n confidence: \"confidence\",\n sprint: \"sprint\",\n release: \"release\",\n};\nconst METADATA_WARNING_TOKEN_BY_FIELD: Record<ValidateMetadataRequiredField, string> = {\n author: \"validate_metadata_missing_author\",\n acceptance_criteria: \"validate_metadata_missing_acceptance_criteria\",\n estimated_minutes: \"validate_metadata_missing_estimate\",\n close_reason: \"validate_metadata_missing_close_reason\",\n reviewer: \"validate_metadata_missing_reviewer\",\n risk: \"validate_metadata_missing_risk\",\n confidence: \"validate_metadata_missing_confidence\",\n sprint: \"validate_metadata_missing_sprint\",\n release: \"validate_metadata_missing_release\",\n};\nconst METADATA_COUNT_KEY_BY_FIELD: Record<ValidateMetadataRequiredField, string> = {\n author: \"missing_author\",\n acceptance_criteria: \"missing_acceptance_criteria\",\n estimated_minutes: \"missing_estimated_minutes\",\n close_reason: \"closed_missing_close_reason\",\n reviewer: \"missing_reviewer\",\n risk: \"missing_risk\",\n confidence: \"missing_confidence\",\n sprint: \"missing_sprint\",\n release: \"missing_release\",\n};\nconst METADATA_ITEM_IDS_KEY_BY_FIELD: Record<ValidateMetadataRequiredField, string> = {\n author: \"missing_author_item_ids\",\n acceptance_criteria: \"missing_acceptance_criteria_item_ids\",\n estimated_minutes: \"missing_estimated_minutes_item_ids\",\n close_reason: \"closed_missing_close_reason_item_ids\",\n reviewer: \"missing_reviewer_item_ids\",\n risk: \"missing_risk_item_ids\",\n confidence: \"missing_confidence_item_ids\",\n sprint: \"missing_sprint_item_ids\",\n release: \"missing_release_item_ids\",\n};\nconst METADATA_TRUNCATED_KEY_BY_FIELD: Record<ValidateMetadataRequiredField, string> = {\n author: \"missing_author_truncated\",\n acceptance_criteria: \"missing_acceptance_criteria_truncated\",\n estimated_minutes: \"missing_estimated_minutes_truncated\",\n close_reason: \"closed_missing_close_reason_truncated\",\n reviewer: \"missing_reviewer_truncated\",\n risk: \"missing_risk_truncated\",\n confidence: \"missing_confidence_truncated\",\n sprint: \"missing_sprint_truncated\",\n release: \"missing_release_truncated\",\n};\nconst GIT_LS_FILES_MAX_BUFFER = 32 * 1024 * 1024;\nconst FILE_LIST_SUMMARY_LIMIT = 40;\nconst DIAGNOSTIC_LIST_SUMMARY_LIMIT = 5;\nconst execFileAsync = promisify(execFile);\n\nexport interface ValidateCommandOptions {\n checkMetadata?: boolean;\n checkResolution?: boolean;\n checkLifecycle?: boolean;\n checkStaleBlockers?: boolean;\n dependencyCycleSeverity?: string;\n checkFiles?: boolean;\n includePmInternals?: boolean;\n verboseFileLists?: boolean;\n verboseDiagnostics?: boolean;\n checkHistoryDrift?: boolean;\n checkCommandReferences?: boolean;\n scanMode?: string;\n metadataProfile?: string;\n fixHints?: boolean;\n autoFix?: boolean;\n dryRun?: boolean;\n fixScope?: string[];\n pruneMissing?: boolean;\n}\n\nexport interface ValidateCheck {\n name: ValidateCheckName;\n status: ValidateStatus;\n details: Record<string, unknown>;\n}\n\nexport interface ValidateFixesSummary {\n mode: \"apply\" | \"dry_run\";\n auto_fix: boolean;\n prune_missing: boolean;\n granted_fix_scopes: string[];\n planned_count: number;\n applied_count: number;\n gated_count: number;\n failed_count: number;\n planned_fixes: Array<Record<string, unknown>>;\n applied_fixes: Array<Record<string, unknown>>;\n gated_fixes: Array<Record<string, unknown>>;\n failed_fixes: Array<Record<string, unknown>>;\n}\n\nexport interface ValidateResult {\n ok: boolean;\n has_warnings: boolean;\n checks: ValidateCheck[];\n warnings: string[];\n /** Present when --auto-fix or --prune-missing was requested; checks always reflect the PRE-fix state. */\n fixes?: ValidateFixesSummary;\n generated_at: string;\n}\n\nfunction normalizeRelativePath(value: string): string {\n return value.replaceAll(\"\\\\\", \"/\").replace(/^\\.\\/+/, \"\").replace(/^\\/+/, \"\");\n}\n\nfunction normalizeRelativeDirectoryPath(value: string): string {\n const normalized = normalizeRelativePath(value);\n return normalized.replace(/\\/+$/, \"\");\n}\n\n\n\nfunction toMeaningfulString(value: unknown): string | undefined {\n const normalized = toNonEmptyStringOrUndefined(value);\n if (!normalized) {\n return undefined;\n }\n const lowered = normalized.toLowerCase();\n if (lowered === \"none\" || lowered === \"null\" || lowered === \"n/a\" || lowered === \"na\") {\n return undefined;\n }\n return normalized;\n}\n\nfunction normalizeStatusForRegistry(status: string, statusRegistry: RuntimeStatusRegistry): string {\n return normalizeStatusInput(status, statusRegistry) ?? status;\n}\n\nfunction isTerminalStatus(status: string, statusRegistry: RuntimeStatusRegistry): boolean {\n return statusRegistry.terminal_statuses.has(normalizeStatusForRegistry(status, statusRegistry));\n}\n\ninterface ValidateMetadataPolicy {\n profile: ValidateMetadataProfile;\n profile_source: \"default\" | \"settings\" | \"option\";\n required_fields: ValidateMetadataRequiredField[];\n configured_custom_fields: ValidateMetadataRequiredField[];\n fallback_to_core: boolean;\n warnings: string[];\n}\n\ntype LifecyclePatternSource = \"default\" | \"settings\";\n\ninterface LifecyclePatternPolicy {\n stale_blocker_reason_patterns: string[];\n stale_blocker_reason_pattern_source: LifecyclePatternSource;\n closure_like_metadata_field_patterns: Record<LifecyclePatternFieldKey, string[]>;\n closure_like_metadata_field_pattern_sources: Record<LifecyclePatternFieldKey, LifecyclePatternSource>;\n}\n\ninterface LifecyclePatternSettingsSource {\n validation: {\n lifecycle_stale_blocker_reason_patterns: string[];\n lifecycle_closure_like_blocked_reason_patterns: string[];\n lifecycle_closure_like_resolution_patterns: string[];\n lifecycle_closure_like_actual_result_patterns: string[];\n };\n}\n\nfunction normalizeLifecyclePatternList(values: readonly string[] | undefined): string[] {\n return [...new Set((values ?? []).map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0))].sort(\n (left, right) => left.localeCompare(right),\n );\n}\n\nfunction areSortedStringListsEqual(left: readonly string[], right: readonly string[]): boolean {\n if (left.length !== right.length) {\n return false;\n }\n return left.every((value, index) => value === right[index]);\n}\n\nfunction resolveLifecyclePatternPolicy(settings: LifecyclePatternSettingsSource): LifecyclePatternPolicy {\n const defaultStalePatterns = normalizeLifecyclePatternList(DEFAULT_VALIDATE_STALE_BLOCKER_REASON_PATTERNS);\n const defaultClosureLikePatterns = {\n blocked_reason: normalizeLifecyclePatternList(DEFAULT_VALIDATE_CLOSURE_LIKE_METADATA_FIELD_PATTERNS.blocked_reason),\n resolution: normalizeLifecyclePatternList(DEFAULT_VALIDATE_CLOSURE_LIKE_METADATA_FIELD_PATTERNS.resolution),\n actual_result: normalizeLifecyclePatternList(DEFAULT_VALIDATE_CLOSURE_LIKE_METADATA_FIELD_PATTERNS.actual_result),\n } satisfies Record<LifecyclePatternFieldKey, string[]>;\n const staleBlockerReasonPatterns = normalizeLifecyclePatternList(\n settings.validation.lifecycle_stale_blocker_reason_patterns,\n );\n const closureLikePatterns = {\n blocked_reason: normalizeLifecyclePatternList(settings.validation.lifecycle_closure_like_blocked_reason_patterns),\n resolution: normalizeLifecyclePatternList(settings.validation.lifecycle_closure_like_resolution_patterns),\n actual_result: normalizeLifecyclePatternList(settings.validation.lifecycle_closure_like_actual_result_patterns),\n } satisfies Record<LifecyclePatternFieldKey, string[]>;\n return {\n stale_blocker_reason_patterns: staleBlockerReasonPatterns,\n stale_blocker_reason_pattern_source: areSortedStringListsEqual(staleBlockerReasonPatterns, defaultStalePatterns)\n ? \"default\"\n : \"settings\",\n closure_like_metadata_field_patterns: closureLikePatterns,\n closure_like_metadata_field_pattern_sources: {\n blocked_reason: areSortedStringListsEqual(closureLikePatterns.blocked_reason, defaultClosureLikePatterns.blocked_reason)\n ? \"default\"\n : \"settings\",\n resolution: areSortedStringListsEqual(closureLikePatterns.resolution, defaultClosureLikePatterns.resolution)\n ? \"default\"\n : \"settings\",\n actual_result: areSortedStringListsEqual(closureLikePatterns.actual_result, defaultClosureLikePatterns.actual_result)\n ? \"default\"\n : \"settings\",\n },\n };\n}\n\nfunction resolveValidateMetadataProfile(value: string | undefined): ValidateMetadataProfile {\n const normalized = value?.trim().toLowerCase();\n if (!normalized || normalized.length === 0) {\n return \"core\";\n }\n if ((VALIDATE_METADATA_PROFILE_VALUES as readonly string[]).includes(normalized)) {\n return normalized as ValidateMetadataProfile;\n }\n throw new PmCliError(\n `Unknown --metadata-profile value \"${value}\". Supported values: ${VALIDATE_METADATA_PROFILE_VALUES.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction resolveDependencyCycleSeverity(value: string | undefined): ValidateDependencyCycleSeverity {\n const normalized = value?.trim().toLowerCase();\n if (!normalized || normalized.length === 0) {\n return \"warn\";\n }\n if ((VALIDATE_DEPENDENCY_CYCLE_SEVERITY_VALUES as readonly string[]).includes(normalized)) {\n return normalized as ValidateDependencyCycleSeverity;\n }\n throw new PmCliError(\n `Unknown --dependency-cycle-severity value \"${value}\". Supported values: ${VALIDATE_DEPENDENCY_CYCLE_SEVERITY_VALUES.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction normalizeMetadataRequiredFieldsFromSettings(\n values: readonly ValidateMetadataRequiredField[] | undefined,\n): ValidateMetadataRequiredField[] {\n const normalized = [...new Set((values ?? []).map((value) => value.trim().toLowerCase().replaceAll(\"-\", \"_\")))];\n return normalized\n .map((value) => METADATA_REQUIRED_FIELD_ALIASES[value])\n .filter((value): value is ValidateMetadataRequiredField => value !== undefined)\n .sort((left, right) => left.localeCompare(right));\n}\n\nfunction resolveValidateMetadataPolicy(\n profile: ValidateMetadataProfile,\n profileSource: \"default\" | \"settings\" | \"option\",\n configuredCustomFields: readonly ValidateMetadataRequiredField[],\n): ValidateMetadataPolicy {\n const normalizedCustomFields = normalizeMetadataRequiredFieldsFromSettings(configuredCustomFields);\n if (profile === \"core\") {\n return {\n profile,\n profile_source: profileSource,\n required_fields: [...CORE_METADATA_REQUIRED_FIELDS],\n configured_custom_fields: normalizedCustomFields,\n fallback_to_core: false,\n warnings: [],\n };\n }\n if (profile === \"strict\") {\n return {\n profile,\n profile_source: profileSource,\n required_fields: [...STRICT_METADATA_REQUIRED_FIELDS],\n configured_custom_fields: normalizedCustomFields,\n fallback_to_core: false,\n warnings: [],\n };\n }\n if (normalizedCustomFields.length > 0) {\n return {\n profile,\n profile_source: profileSource,\n required_fields: normalizedCustomFields,\n configured_custom_fields: normalizedCustomFields,\n fallback_to_core: false,\n warnings: [],\n };\n }\n return {\n profile,\n profile_source: profileSource,\n required_fields: [...CORE_METADATA_REQUIRED_FIELDS],\n configured_custom_fields: normalizedCustomFields,\n fallback_to_core: true,\n warnings: [\"validate_metadata_custom_profile_missing_required_fields:0\"],\n };\n}\n\nfunction isMetadataFieldMissing(\n item: ItemWithBody,\n field: ValidateMetadataRequiredField,\n statusRegistry: RuntimeStatusRegistry,\n): boolean {\n if (field === \"author\") {\n return !toNonEmptyStringOrUndefined(item.author);\n }\n if (field === \"acceptance_criteria\") {\n return !toNonEmptyStringOrUndefined(item.acceptance_criteria);\n }\n if (field === \"estimated_minutes\") {\n return !Number.isFinite(item.estimated_minutes);\n }\n if (field === \"close_reason\") {\n return normalizeStatusForRegistry(item.status, statusRegistry) === statusRegistry.close_status && !toNonEmptyStringOrUndefined(item.close_reason);\n }\n if (field === \"reviewer\") {\n return !toNonEmptyStringOrUndefined(item.reviewer);\n }\n if (field === \"risk\") {\n return !toNonEmptyStringOrUndefined(item.risk);\n }\n if (field === \"confidence\") {\n if (typeof item.confidence === \"number\") {\n return !Number.isFinite(item.confidence);\n }\n return !toNonEmptyStringOrUndefined(item.confidence);\n }\n if (field === \"sprint\") {\n return !toNonEmptyStringOrUndefined(item.sprint);\n }\n return !toNonEmptyStringOrUndefined(item.release);\n}\n\nfunction resolveFileScanMode(scanMode: string | undefined): ValidateFileScanMode {\n if (scanMode === undefined) {\n return \"default\";\n }\n const normalized = scanMode.trim().toLowerCase();\n if (normalized.length === 0) {\n return \"default\";\n }\n if (normalized === \"default\") {\n return \"default\";\n }\n if (normalized === \"tracked-all\" || normalized === \"tracked_all\") {\n return \"tracked-all\";\n }\n if (normalized === \"tracked-all-strict\" || normalized === \"tracked_all_strict\") {\n return \"tracked-all-strict\";\n }\n throw new PmCliError(\n `Unknown --scan-mode value \"${scanMode}\". Supported values: ${VALIDATE_FILE_SCAN_MODES.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction resolveWorkspaceRoot(pmRoot: string): string {\n const resolvedPmRoot = path.resolve(pmRoot);\n const normalizedPmRoot = resolvedPmRoot.replaceAll(\"\\\\\", \"/\");\n if (normalizedPmRoot.endsWith(\"/.agents/pm\")) {\n return path.dirname(path.dirname(resolvedPmRoot));\n }\n const resolvedCwd = path.resolve(process.cwd());\n const canonicalPmRoot = realpathForWorkspaceRoot(resolvedPmRoot);\n const canonicalCwd = realpathForWorkspaceRoot(resolvedCwd);\n const relativeFromPmRoot = path.relative(canonicalPmRoot, canonicalCwd);\n const cwdInsidePmRoot =\n relativeFromPmRoot.length === 0 ||\n (!relativeFromPmRoot.startsWith(\"..\") && !path.isAbsolute(relativeFromPmRoot));\n if (cwdInsidePmRoot) {\n return resolvedPmRoot;\n }\n /* c8 ignore next 2 -- non-standard PM root layouts are integration-only edge cases. */\n return resolvedCwd;\n}\n\nfunction realpathForWorkspaceRoot(inputPath: string): string {\n try {\n return realpathSync.native(inputPath);\n } catch {\n return path.resolve(inputPath);\n }\n}\n\nasync function listFilesRecursive(basePath: string, relativePath: string, output: string[]): Promise<void> {\n const targetDirectory = relativePath.length > 0 ? path.join(basePath, relativePath) : basePath;\n let entries: Dirent[];\n try {\n entries = await fs.readdir(targetDirectory, { withFileTypes: true });\n } catch (error: unknown) {\n if (typeof error === \"object\" && error !== null && \"code\" in error && (error as { code?: string }).code === \"ENOENT\") {\n return;\n }\n throw error;\n }\n\n for (const entry of entries) {\n if (entry.name.startsWith(\".\")) {\n continue;\n }\n const childRelative = relativePath.length > 0 ? path.join(relativePath, entry.name) : entry.name;\n if (entry.isDirectory()) {\n if (DIRECTORY_IGNORE_SET.has(entry.name)) {\n continue;\n }\n await listFilesRecursive(basePath, childRelative, output);\n continue;\n }\n /* c8 ignore next 3 -- non-file dirent variants (symlink/socket) are filesystem-specific. */\n if (!entry.isFile()) {\n continue;\n }\n output.push(normalizeRelativePath(childRelative));\n }\n}\n\nasync function collectDefaultProjectFileCandidates(workspaceRoot: string): Promise<string[]> {\n const discovered: string[] = [];\n for (const directory of FILE_SCAN_DIRECTORIES) {\n await listFilesRecursive(workspaceRoot, directory, discovered);\n }\n for (const candidate of FILE_SCAN_ROOT_FILES) {\n const absolute = path.join(workspaceRoot, candidate);\n try {\n const stats = await fs.stat(absolute);\n /* c8 ignore start -- root-candidate presence depends on fixture workspace composition. */\n if (stats.isFile()) {\n discovered.push(normalizeRelativePath(candidate));\n }\n /* c8 ignore stop */\n } catch {\n // Ignore root-file candidates that are not present in this workspace.\n }\n }\n return [...new Set(discovered)].sort((left, right) => left.localeCompare(right));\n}\n\nasync function collectTrackedGitFileCandidates(workspaceRoot: string): Promise<string[] | null> {\n try {\n const { stdout } = await execFileAsync(\"git\", [\"ls-files\", \"-z\"], {\n cwd: workspaceRoot,\n encoding: \"utf8\",\n maxBuffer: GIT_LS_FILES_MAX_BUFFER,\n windowsHide: true,\n });\n const discovered = stdout\n .split(\"\\0\")\n .map((value) => normalizeRelativePath(value))\n .filter((value) => value.length > 0);\n return [...new Set(discovered)].sort((left, right) => left.localeCompare(right));\n } catch {\n /* c8 ignore start -- fallback path exercised only when git metadata is unavailable. */\n return null;\n /* c8 ignore stop */\n }\n}\n\ninterface FileCandidateCollection {\n requestedMode: ValidateFileScanMode;\n appliedMode: ValidateFileScanMode;\n source: FileCandidateSource;\n candidateFiles: string[];\n candidateTotal: number;\n candidateScanned: number;\n}\n\nfunction resolvePmInternalCandidatePrefixes(pmRoot: string, workspaceRoot: string): string[] {\n const prefixes = new Set<string>();\n const configuredDefault = normalizeRelativeDirectoryPath(PM_DIRNAME);\n if (configuredDefault.length > 0) {\n prefixes.add(configuredDefault);\n }\n const relativePmRoot = normalizeRelativeDirectoryPath(path.relative(workspaceRoot, pmRoot));\n if (relativePmRoot.length > 0 && !relativePmRoot.startsWith(\"..\")) {\n prefixes.add(relativePmRoot);\n }\n return [...prefixes].sort((left, right) => left.localeCompare(right));\n}\n\nfunction hasPathPrefix(candidate: string, prefixes: string[]): boolean {\n for (const prefix of prefixes) {\n if (candidate === prefix || candidate.startsWith(`${prefix}/`)) {\n return true;\n }\n }\n return false;\n}\n\nasync function collectProjectFileCandidates(\n workspaceRoot: string,\n scanMode: ValidateFileScanMode,\n): Promise<FileCandidateCollection> {\n if (scanMode === \"tracked-all\" || scanMode === \"tracked-all-strict\") {\n const trackedCandidates = await collectTrackedGitFileCandidates(workspaceRoot);\n if (trackedCandidates) {\n return {\n requestedMode: scanMode,\n appliedMode: scanMode,\n source: \"tracked-git\",\n candidateFiles: trackedCandidates,\n candidateTotal: trackedCandidates.length,\n candidateScanned: trackedCandidates.length,\n };\n }\n /* c8 ignore start -- deterministic fallback retained for non-git workspaces. */\n const fallbackCandidates = await collectDefaultProjectFileCandidates(workspaceRoot);\n return {\n requestedMode: scanMode,\n appliedMode: \"default\",\n source: \"tracked-all-fallback-default\",\n candidateFiles: fallbackCandidates,\n candidateTotal: fallbackCandidates.length,\n candidateScanned: fallbackCandidates.length,\n };\n /* c8 ignore stop */\n }\n\n const defaultCandidates = await collectDefaultProjectFileCandidates(workspaceRoot);\n return {\n requestedMode: scanMode,\n appliedMode: \"default\",\n source: \"default-curated\",\n candidateFiles: defaultCandidates,\n candidateTotal: defaultCandidates.length,\n candidateScanned: defaultCandidates.length,\n };\n}\n\nfunction summarizeList(values: string[], limit = DIAGNOSTIC_LIST_SUMMARY_LIMIT): { values: string[]; truncated: boolean } {\n /* c8 ignore start -- truncation behavior only surfaces with very large synthetic datasets. */\n if (values.length <= limit) {\n return { values, truncated: false };\n }\n return {\n values: values.slice(0, limit),\n truncated: true,\n };\n /* c8 ignore stop */\n}\n\nfunction summarizeFileList(\n values: string[],\n verboseFileLists: boolean,\n): {\n values: string[];\n truncated: boolean;\n total: number;\n} {\n if (verboseFileLists) {\n return {\n values,\n truncated: false,\n total: values.length,\n };\n }\n const summary = summarizeList(values, FILE_LIST_SUMMARY_LIMIT);\n return {\n values: summary.values,\n truncated: summary.truncated,\n total: values.length,\n };\n}\n\nconst RESOLUTION_REMEDIATION_FLAG_BY_FIELD: Record<ResolutionFieldKey, string> = {\n resolution: \"--resolution\",\n expected_result: \"--expected-result\",\n actual_result: \"--actual-result\",\n};\n\nconst RESOLUTION_REMEDIATION_PLACEHOLDER_BY_FIELD: Record<ResolutionFieldKey, string> = {\n resolution: \"Describe how this item was resolved\",\n expected_result: \"Describe the expected result\",\n actual_result: \"Describe the actual result\",\n};\n\nfunction buildResolutionRemediationCommand(row: { id: string; missing_fields: ResolutionFieldKey[] }): string {\n const fieldArguments = row.missing_fields\n .map((field) => `${RESOLUTION_REMEDIATION_FLAG_BY_FIELD[field]} \\\"${RESOLUTION_REMEDIATION_PLACEHOLDER_BY_FIELD[field]}\\\"`)\n .join(\" \");\n return `pm update ${row.id} ${fieldArguments} --message \\\"Backfill resolution metadata\\\"`;\n}\n\n/**\n * Attach a uniform, machine-executable `fix_hints` array to a validate check's\n * details when `--fix-hints` is requested. The resolution check's existing\n * per-row remediation commands (which already carry concrete item ids) are\n * aliased in so agents read one uniform field across every check; all other\n * checks derive one generic command per distinct warning code from the shared\n * remediation registry. Generic hints may contain `<id>`/`<field>`/`<path>`\n * placeholders the caller substitutes before running — they are templates, not\n * always directly executable as-is. Read-only: this only enriches the diagnostic\n * output, never mutates any item.\n */\nfunction attachValidateFixHints(check: ValidateCheck, checkWarnings: string[]): void {\n const existingResolutionHints = check.details?.missing_resolution_remediation_hints;\n const aliasedResolution = Array.isArray(existingResolutionHints) && existingResolutionHints.length > 0;\n const fixHints = aliasedResolution\n ? (existingResolutionHints as unknown[]).filter((hint): hint is string => typeof hint === \"string\")\n : buildRemediationCommands(checkWarnings);\n if (fixHints.length === 0) {\n return;\n }\n // The resolution check truncates its per-row hint list for low-token output;\n // carry that marker onto fix_hints so an agent knows the list is partial and\n // there are more items to repair beyond the ones shown.\n const truncated = aliasedResolution && check.details?.missing_resolution_remediation_hints_truncated === true;\n check.details = {\n ...check.details,\n fix_hints: fixHints,\n ...(truncated ? { fix_hints_truncated: true } : {}),\n };\n}\n\nfunction resolveRequestedChecks(options: ValidateCommandOptions): Set<ValidateCheckName> {\n const requested = new Set<ValidateCheckName>();\n if (options.checkMetadata) {\n requested.add(\"metadata\");\n }\n if (options.checkResolution) {\n requested.add(\"resolution\");\n }\n if (options.checkLifecycle || options.checkStaleBlockers) {\n requested.add(\"lifecycle\");\n }\n if (options.checkFiles) {\n requested.add(\"files\");\n }\n if (options.checkHistoryDrift) {\n requested.add(\"history_drift\");\n }\n if (options.checkCommandReferences) {\n requested.add(\"command_references\");\n }\n if (requested.size === 0) {\n // Remediation flags without explicit --check-* flags scope the run to the\n // checks that can produce fixes: --auto-fix plans metadata/resolution\n // backfills and gated lifecycle fixes; --prune-missing needs the files\n // scan. With neither, the historical run-everything default applies.\n if (options.autoFix) {\n requested.add(\"metadata\");\n requested.add(\"resolution\");\n requested.add(\"lifecycle\");\n }\n if (options.pruneMissing) {\n requested.add(\"files\");\n }\n if (requested.size === 0) {\n requested.add(\"metadata\");\n requested.add(\"resolution\");\n requested.add(\"lifecycle\");\n requested.add(\"files\");\n requested.add(\"command_references\");\n requested.add(\"history_drift\");\n }\n return requested;\n }\n // Explicit check flags are respected as-is, except --prune-missing always\n // needs the files scan it acts on.\n if (options.pruneMissing) {\n requested.add(\"files\");\n }\n return requested;\n}\n\nfunction buildMetadataCheck(\n items: ItemWithBody[],\n metadataPolicy: ValidateMetadataPolicy,\n statusRegistry: RuntimeStatusRegistry,\n verboseDiagnostics: boolean,\n): { check: ValidateCheck; warnings: string[]; closeReasonBackfillRows: CloseReasonBackfillRow[] } {\n const missingByField = Object.fromEntries(\n SUPPORTED_METADATA_REQUIRED_FIELDS.map((field) => [field, [] as string[]]),\n ) as Record<ValidateMetadataRequiredField, string[]>;\n const itemsById = new Map(items.map((item) => [item.id, item]));\n\n for (const item of items) {\n for (const field of SUPPORTED_METADATA_REQUIRED_FIELDS) {\n if (!isMetadataFieldMissing(item, field, statusRegistry)) {\n continue;\n }\n missingByField[field].push(item.id);\n }\n }\n\n const warningTokens = [...metadataPolicy.warnings];\n for (const field of metadataPolicy.required_fields) {\n const missingItems = missingByField[field];\n if (missingItems.length === 0) {\n continue;\n }\n warningTokens.push(`${METADATA_WARNING_TOKEN_BY_FIELD[field]}:${missingItems.length}`);\n }\n\n // Zero-suppress counts to reduce agent token cost (telemetry pm-tylj).\n // Only emit counts for the ACTIVE required fields of the resolved profile so a\n // looser profile (e.g. core) never reports missing reviewer/risk/sprint/etc.\n // Defensive guards (Gemini high #1, PR #78 follow-up): a future settings\n // shape could include an unsupported field in required_fields — fall back\n // to 0 instead of throwing TypeError, and skip writing when the count-key\n // mapping is undefined.\n const counts: Record<string, number> = {};\n for (const field of metadataPolicy.required_fields) {\n const value = missingByField[field]?.length ?? 0;\n const countKey = METADATA_COUNT_KEY_BY_FIELD[field];\n if (value > 0 && countKey) {\n counts[countKey] = value;\n }\n }\n // Per-item-type grouping of missing required-field counts (pm-pmyq /\n // GH-172): counts only — never row dumps — and only for the ACTIVE required\n // fields, so the grouping mirrors `counts` at type granularity (e.g.\n // `{ Task: { close_reason: 3 } }`). Zero-suppressed at both levels.\n const missingFieldOccurrences: MissingFieldOccurrence[] = [];\n for (const field of metadataPolicy.required_fields) {\n for (const itemId of missingByField[field] ?? []) {\n const itemType = itemsById.get(itemId)?.type;\n missingFieldOccurrences.push({ item_type: typeof itemType === \"string\" && itemType.length > 0 ? itemType : \"Unknown\", field });\n }\n }\n const missingByType = buildMissingByTypeCounts(missingFieldOccurrences);\n const details: Record<string, unknown> = {\n checked_items: items.length,\n metadata_profile: metadataPolicy.profile,\n metadata_profile_source: metadataPolicy.profile_source,\n metadata_profile_fallback_to_core: metadataPolicy.fallback_to_core,\n required_fields: [...metadataPolicy.required_fields],\n supported_required_fields: [...SUPPORTED_METADATA_REQUIRED_FIELDS],\n counts,\n missing_by_type: missingByType,\n };\n if (metadataPolicy.configured_custom_fields.length > 0) {\n details.configured_custom_required_fields = [...metadataPolicy.configured_custom_fields];\n }\n\n // Only emit per-field item_ids/truncated keys for the ACTIVE required fields of\n // the resolved profile (and only when there are missing items). This stops a\n // looser profile (e.g. core) from emitting the identical full ID array for\n // reviewer/risk/confidence/sprint/release that it does not even require\n // (pm-edge #2 — ~150 redundant lines per validate run on minimal/core).\n // Defensive guard (Gemini high #2, PR #78 follow-up): same optional-chain\n // safety as the counts loop above — never throw if a future settings shape\n // includes an unsupported field.\n for (const field of metadataPolicy.required_fields) {\n const missing = missingByField[field];\n if (!missing || missing.length === 0) {\n continue;\n }\n const idsKey = METADATA_ITEM_IDS_KEY_BY_FIELD[field];\n const truncatedKey = METADATA_TRUNCATED_KEY_BY_FIELD[field];\n if (!idsKey || !truncatedKey) {\n continue;\n }\n const summarized = summarizeList(missing, verboseDiagnostics ? missing.length : DIAGNOSTIC_LIST_SUMMARY_LIMIT);\n details[idsKey] = summarized.values;\n details[truncatedKey] = summarized.truncated;\n }\n\n // Auto-fix planning input (pm-c3sz): closed items flagged for a missing\n // close_reason whose resolution can serve as the derivable source value.\n // Only collected when close_reason is an active required field, so fixes\n // always trace back to an actual finding of this run.\n const closeReasonBackfillRows: CloseReasonBackfillRow[] = metadataPolicy.required_fields.includes(\"close_reason\")\n ? (missingByField.close_reason ?? []).map((itemId) => ({\n id: itemId,\n resolution: toNonEmptyStringOrUndefined(itemsById.get(itemId)?.resolution),\n }))\n : [];\n\n return {\n check: {\n name: \"metadata\",\n status: warningTokens.length === 0 ? \"ok\" : \"warn\",\n details,\n },\n warnings: warningTokens,\n closeReasonBackfillRows,\n };\n}\n\nfunction buildResolutionCheck(\n items: ItemWithBody[],\n statusRegistry: RuntimeStatusRegistry,\n verboseDiagnostics: boolean,\n): { check: ValidateCheck; warnings: string[]; resolutionBackfillRows: ResolutionBackfillRow[] } {\n const terminalDoneStatuses = new Set<string>(statusRegistry.terminal_done_statuses);\n terminalDoneStatuses.add(statusRegistry.close_status);\n const closedItems = items.filter((item) => terminalDoneStatuses.has(normalizeStatusForRegistry(item.status, statusRegistry)));\n const missingResolutionRows: Array<{ id: string; missing_fields: ResolutionFieldKey[] }> = [];\n const resolutionBackfillRows: ResolutionBackfillRow[] = [];\n\n for (const item of closedItems) {\n const missingFields = RESOLUTION_FIELD_KEYS.filter((field) => !toNonEmptyStringOrUndefined(item[field]));\n if (missingFields.length === 0) {\n continue;\n }\n missingResolutionRows.push({\n id: item.id,\n missing_fields: missingFields,\n });\n // Auto-fix planning input (pm-c3sz): the planner backfills only the\n // `resolution` field, deriving from the item's close_reason when present.\n resolutionBackfillRows.push({\n id: item.id,\n missing_fields: missingFields,\n close_reason: toNonEmptyStringOrUndefined(item.close_reason),\n });\n }\n\n const warnings =\n missingResolutionRows.length > 0 ? [`validate_resolution_missing_fields:${missingResolutionRows.length}`] : [];\n const diagnosticLimit = verboseDiagnostics ? Number.POSITIVE_INFINITY : DIAGNOSTIC_LIST_SUMMARY_LIMIT;\n const summarizedRows = summarizeList(\n missingResolutionRows.map((row) => `${row.id}:${row.missing_fields.join(\",\")}`),\n diagnosticLimit,\n );\n const remediationHints = missingResolutionRows.map((row) => buildResolutionRemediationCommand(row));\n const summarizedHints = summarizeList(remediationHints, diagnosticLimit);\n return {\n check: {\n name: \"resolution\",\n status: warnings.length === 0 ? \"ok\" : \"warn\",\n details: {\n checked_closed_items: closedItems.length,\n missing_resolution_items: missingResolutionRows.length,\n missing_resolution_rows: summarizedRows.values,\n missing_resolution_rows_truncated: summarizedRows.truncated,\n missing_resolution_remediation_hints: summarizedHints.values,\n missing_resolution_remediation_hints_truncated: summarizedHints.truncated,\n },\n },\n warnings,\n resolutionBackfillRows,\n };\n}\n\nfunction buildLifecycleDependencyGraph(activeItems: ItemWithBody[]): Map<string, string[]> {\n const activeItemIds = new Set(activeItems.map((item) => item.id));\n const graph = new Map<string, string[]>();\n const sortedItems = [...activeItems].sort((left, right) => left.id.localeCompare(right.id));\n for (const item of sortedItems) {\n const edges = new Set<string>();\n for (const dependency of item.dependencies ?? []) {\n const dependencyId = toMeaningfulString(dependency.id);\n if (!dependencyId || !activeItemIds.has(dependencyId)) {\n continue;\n }\n edges.add(dependencyId);\n }\n graph.set(item.id, [...edges].sort((left, right) => left.localeCompare(right)));\n }\n return graph;\n}\n\nfunction findLifecycleDependencyCycleComponents(graph: Map<string, string[]>): string[][] {\n let nextIndex = 0;\n const indexById = new Map<string, number>();\n const lowLinkById = new Map<string, number>();\n const stack: string[] = [];\n const inStack = new Set<string>();\n const components: string[][] = [];\n\n const visit = (id: string): void => {\n indexById.set(id, nextIndex);\n lowLinkById.set(id, nextIndex);\n nextIndex += 1;\n stack.push(id);\n inStack.add(id);\n\n for (const dependencyId of graph.get(id) ?? []) {\n if (!indexById.has(dependencyId)) {\n visit(dependencyId);\n lowLinkById.set(id, Math.min(lowLinkById.get(id)!, lowLinkById.get(dependencyId)!));\n } else if (inStack.has(dependencyId)) {\n lowLinkById.set(id, Math.min(lowLinkById.get(id)!, indexById.get(dependencyId)!));\n }\n }\n\n if (lowLinkById.get(id) !== indexById.get(id)) {\n return;\n }\n const component: string[] = [];\n while (stack.length > 0) {\n const member = stack.pop()!;\n inStack.delete(member);\n component.push(member);\n if (member === id) {\n break;\n }\n }\n component.sort((left, right) => left.localeCompare(right));\n components.push(component);\n };\n\n const sortedNodeIds = [...graph.keys()].sort((left, right) => left.localeCompare(right));\n for (const id of sortedNodeIds) {\n if (!indexById.has(id)) {\n visit(id);\n }\n }\n\n const cycleComponents = components.filter((component) => {\n if (component.length > 1) {\n return true;\n }\n const selfId = component[0];\n return (graph.get(selfId) ?? []).includes(selfId);\n });\n return cycleComponents.sort(\n (left, right) =>\n left[0].localeCompare(right[0]) ||\n left.length - right.length ||\n left.join(\",\").localeCompare(right.join(\",\")),\n );\n}\n\nfunction resolveLifecycleDependencyCycleSamplePath(component: string[], graph: Map<string, string[]>): string[] {\n const start = component[0];\n if (component.length === 1) {\n return [start, start];\n }\n const componentSet = new Set(component);\n const path: string[] = [start];\n const visited = new Set<string>([start]);\n\n const search = (current: string): boolean => {\n const neighbors = (graph.get(current) ?? []).filter((candidate) => componentSet.has(candidate));\n for (const next of neighbors) {\n if (next === start && path.length > 1) {\n path.push(start);\n return true;\n }\n if (visited.has(next)) {\n continue;\n }\n visited.add(next);\n path.push(next);\n if (search(next)) {\n return true;\n }\n path.pop();\n visited.delete(next);\n }\n return false;\n };\n\n if (search(start)) {\n return [...path];\n }\n return [...component, start];\n}\n\nfunction detectLifecycleDependencyCycles(activeItems: ItemWithBody[]): {\n cycle_count: number;\n cycle_item_ids: string[];\n cycle_sample_paths: string[];\n} {\n const graph = buildLifecycleDependencyGraph(activeItems);\n const cycleComponents = findLifecycleDependencyCycleComponents(graph);\n const cycleItemIds = [...new Set(cycleComponents.flat())].sort((left, right) => left.localeCompare(right));\n const cycleSamplePaths = cycleComponents.map((component) =>\n resolveLifecycleDependencyCycleSamplePath(component, graph).join(\"->\"),\n );\n return {\n cycle_count: cycleComponents.length,\n cycle_item_ids: cycleItemIds,\n cycle_sample_paths: cycleSamplePaths,\n };\n}\n\nfunction buildLifecycleCheck(\n items: ItemWithBody[],\n includeStaleBlockers: boolean,\n dependencyCycleSeverity: ValidateDependencyCycleSeverity,\n statusRegistry: RuntimeStatusRegistry,\n lifecyclePatternPolicy: LifecyclePatternPolicy,\n verboseDiagnostics: boolean,\n): { check: ValidateCheck; warnings: string[]; terminalParentFixRows: TerminalParentFixRow[] } {\n const itemsById = new Map(items.map((item) => [item.id, item]));\n const blockedStatuses =\n statusRegistry.blocked_statuses.size > 0 ? statusRegistry.blocked_statuses : new Set<string>([\"blocked\"]);\n const activeItems = items.filter((item) => !isTerminalStatus(item.status, statusRegistry));\n const closureLikeRows: Array<{ id: string; fields: string[] }> = [];\n const terminalParentRows: Array<{ id: string; parent_id: string; parent_status: string }> = [];\n const terminalParentFixRows: TerminalParentFixRow[] = [];\n const staleBlockerRows: Array<{ id: string; status: string; reasons: string[] }> = [];\n\n for (const item of activeItems) {\n const closureLikeFields = Object.entries(lifecyclePatternPolicy.closure_like_metadata_field_patterns)\n .filter(([field, patterns]) => {\n const value = toMeaningfulString(item[field as keyof ItemWithBody]);\n if (!value) {\n return false;\n }\n const normalized = value.toLowerCase();\n return patterns.some((pattern) => normalized.includes(pattern));\n })\n .map(([field]) => field)\n .sort((left, right) => left.localeCompare(right));\n\n if (closureLikeFields.length > 0) {\n closureLikeRows.push({\n id: item.id,\n fields: closureLikeFields,\n });\n }\n\n const parentId = toMeaningfulString(item.parent);\n if (parentId) {\n const parent = itemsById.get(parentId);\n if (parent && isTerminalStatus(parent.status, statusRegistry)) {\n terminalParentRows.push({\n id: item.id,\n parent_id: parent.id,\n parent_status: parent.status,\n });\n // Gated lifecycle auto-fix input (pm-8jss): when the terminal parent\n // has its own ACTIVE parent, the child can be reparented one level up;\n // otherwise the suggested fix clears the parent link.\n const grandparentId = toMeaningfulString(parent.parent);\n const grandparent = grandparentId ? itemsById.get(grandparentId) : undefined;\n terminalParentFixRows.push({\n id: item.id,\n parent_id: parent.id,\n grandparent_id: grandparent?.id,\n grandparent_active: grandparent !== undefined && !isTerminalStatus(grandparent.status, statusRegistry),\n });\n }\n }\n\n if (includeStaleBlockers) {\n const blockedBy = toMeaningfulString(item.blocked_by);\n const blockedReason = toMeaningfulString(item.blocked_reason);\n const blockedReasonNormalized = blockedReason?.toLowerCase();\n const reasons: string[] = [];\n const normalizedStatus = normalizeStatusForRegistry(item.status, statusRegistry);\n\n if (!blockedStatuses.has(normalizedStatus)) {\n if (blockedBy) {\n reasons.push(\"non_blocked_status_has_blocked_by\");\n }\n if (blockedReason) {\n reasons.push(\"non_blocked_status_has_blocked_reason\");\n }\n } else {\n if (!blockedBy && !blockedReason) {\n reasons.push(\"blocked_status_missing_blocker_context\");\n }\n if (blockedReasonNormalized?.includes(\"no active blocker\")) {\n reasons.push(\"blocked_status_reason_reports_no_active_blocker\");\n }\n if (\n blockedReasonNormalized &&\n lifecyclePatternPolicy.stale_blocker_reason_patterns.some((pattern) => blockedReasonNormalized.includes(pattern))\n ) {\n reasons.push(\"blocked_status_reason_matches_stale_pattern\");\n }\n }\n\n if (reasons.length > 0) {\n staleBlockerRows.push({\n id: item.id,\n status: item.status,\n reasons: [...new Set(reasons)].sort((left, right) => left.localeCompare(right)),\n });\n }\n }\n }\n\n closureLikeRows.sort((left, right) => left.id.localeCompare(right.id));\n terminalParentRows.sort(\n (left, right) => left.id.localeCompare(right.id) || left.parent_id.localeCompare(right.parent_id),\n );\n terminalParentFixRows.sort(\n (left, right) => left.id.localeCompare(right.id) || left.parent_id.localeCompare(right.parent_id),\n );\n staleBlockerRows.sort((left, right) => left.id.localeCompare(right.id));\n const dependencyCycleDiagnostics = detectLifecycleDependencyCycles(activeItems);\n\n const warnings: string[] = [];\n if (closureLikeRows.length > 0) {\n warnings.push(`validate_lifecycle_active_closure_like_metadata:${closureLikeRows.length}`);\n }\n if (terminalParentRows.length > 0) {\n warnings.push(`validate_lifecycle_active_terminal_parent:${terminalParentRows.length}`);\n }\n if (includeStaleBlockers && staleBlockerRows.length > 0) {\n warnings.push(`validate_lifecycle_stale_blockers:${staleBlockerRows.length}`);\n }\n if (dependencyCycleDiagnostics.cycle_count > 0 && dependencyCycleSeverity !== \"off\") {\n warnings.push(\n `${\n dependencyCycleSeverity === \"error\"\n ? \"validate_lifecycle_dependency_cycles_error\"\n : \"validate_lifecycle_dependency_cycles\"\n }:${dependencyCycleDiagnostics.cycle_count}`,\n );\n }\n\n const diagnosticLimit = verboseDiagnostics ? Number.POSITIVE_INFINITY : DIAGNOSTIC_LIST_SUMMARY_LIMIT;\n const summarizedClosureLikeRows = summarizeList(\n closureLikeRows.map((row) => `${row.id}:${row.fields.join(\",\")}`),\n diagnosticLimit,\n );\n const summarizedTerminalParentRows = summarizeList(\n terminalParentRows.map((row) => `${row.id}:${row.parent_id}:${row.parent_status}`),\n diagnosticLimit,\n );\n const summarizedStaleBlockerRows = summarizeList(\n staleBlockerRows.map((row) => `${row.id}:${row.status}:${row.reasons.join(\",\")}`),\n diagnosticLimit,\n );\n const summarizedDependencyCycleItemIds = summarizeList(dependencyCycleDiagnostics.cycle_item_ids, diagnosticLimit);\n const summarizedDependencyCycleSamplePaths = summarizeList(dependencyCycleDiagnostics.cycle_sample_paths, diagnosticLimit);\n\n return {\n check: {\n name: \"lifecycle\",\n status: dependencyCycleDiagnostics.cycle_count > 0 && dependencyCycleSeverity === \"error\"\n ? \"error\"\n : warnings.length === 0\n ? \"ok\"\n : \"warn\",\n details: {\n checked_active_items: activeItems.length,\n active_closure_like_metadata_items: closureLikeRows.length,\n active_closure_like_metadata_rows: summarizedClosureLikeRows.values,\n active_closure_like_metadata_rows_truncated: summarizedClosureLikeRows.truncated,\n active_terminal_parent_items: terminalParentRows.length,\n active_terminal_parent_rows: summarizedTerminalParentRows.values,\n active_terminal_parent_rows_truncated: summarizedTerminalParentRows.truncated,\n stale_blocker_checks_enabled: includeStaleBlockers,\n stale_blocker_items: staleBlockerRows.length,\n stale_blocker_rows: summarizedStaleBlockerRows.values,\n stale_blocker_rows_truncated: summarizedStaleBlockerRows.truncated,\n dependency_cycle_severity_policy: dependencyCycleSeverity,\n dependency_cycle_count: dependencyCycleDiagnostics.cycle_count,\n dependency_cycle_item_count: dependencyCycleDiagnostics.cycle_item_ids.length,\n dependency_cycle_item_ids: summarizedDependencyCycleItemIds.values,\n dependency_cycle_item_ids_truncated: summarizedDependencyCycleItemIds.truncated,\n dependency_cycle_sample_paths: summarizedDependencyCycleSamplePaths.values,\n dependency_cycle_sample_paths_truncated: summarizedDependencyCycleSamplePaths.truncated,\n stale_blocker_reason_patterns: [...lifecyclePatternPolicy.stale_blocker_reason_patterns],\n stale_blocker_reason_pattern_source: lifecyclePatternPolicy.stale_blocker_reason_pattern_source,\n closure_like_blocked_reason_patterns: [\n ...lifecyclePatternPolicy.closure_like_metadata_field_patterns.blocked_reason,\n ],\n closure_like_blocked_reason_pattern_source:\n lifecyclePatternPolicy.closure_like_metadata_field_pattern_sources.blocked_reason,\n closure_like_resolution_patterns: [...lifecyclePatternPolicy.closure_like_metadata_field_patterns.resolution],\n closure_like_resolution_pattern_source:\n lifecyclePatternPolicy.closure_like_metadata_field_pattern_sources.resolution,\n closure_like_actual_result_patterns: [...lifecyclePatternPolicy.closure_like_metadata_field_patterns.actual_result],\n closure_like_actual_result_pattern_source:\n lifecyclePatternPolicy.closure_like_metadata_field_pattern_sources.actual_result,\n },\n },\n warnings,\n terminalParentFixRows,\n };\n}\n\nasync function buildFilesCheck(\n items: ItemWithBody[],\n workspaceRoot: string,\n pmRoot: string,\n fileScanMode: ValidateFileScanMode,\n includePmInternals: boolean,\n verboseFileLists: boolean,\n): Promise<{ check: ValidateCheck; warnings: string[]; staleLinkPruneRows: StaleLinkPruneRow[] }> {\n const linkedProjectPaths = new Set<string>();\n const missingLinkedPaths: string[] = [];\n const staleLinkRows: Array<{ item_id: string; path: string; link_kind: \"files\" | \"docs\" }> = [];\n\n for (const item of items) {\n const linkedArtifactGroups = [\n { link_kind: \"files\" as const, artifacts: item.files ?? [] },\n { link_kind: \"docs\" as const, artifacts: item.docs ?? [] },\n ];\n for (const group of linkedArtifactGroups) {\n for (const artifact of group.artifacts) {\n if (artifact.scope !== \"project\") {\n continue;\n }\n const normalizedPath = normalizeRelativePath(artifact.path);\n if (normalizedPath.length === 0) {\n continue;\n }\n linkedProjectPaths.add(normalizedPath);\n const absolutePath = path.isAbsolute(artifact.path) ? artifact.path : path.resolve(workspaceRoot, artifact.path);\n let missing = false;\n try {\n const stats = await fs.stat(absolutePath);\n if (!stats.isFile()) {\n missing = true;\n }\n } catch {\n missing = true;\n }\n if (missing) {\n missingLinkedPaths.push(normalizedPath);\n staleLinkRows.push({ item_id: item.id, path: normalizedPath, link_kind: group.link_kind });\n }\n }\n }\n }\n\n const uniqueMissingLinkedPaths = [...new Set(missingLinkedPaths)].sort((left, right) => left.localeCompare(right));\n const fileCandidates = await collectProjectFileCandidates(workspaceRoot, fileScanMode);\n const strictTrackedAllMode = fileScanMode === \"tracked-all-strict\";\n const strictModeForcesPmInternals = strictTrackedAllMode && !includePmInternals;\n const includePmInternalsEffective = includePmInternals || strictTrackedAllMode;\n const pmInternalCandidatePrefixes = includePmInternalsEffective ? [] : resolvePmInternalCandidatePrefixes(pmRoot, workspaceRoot);\n const excludedPmInternalPaths =\n pmInternalCandidatePrefixes.length === 0\n ? []\n : fileCandidates.candidateFiles.filter((candidate) => hasPathPrefix(candidate, pmInternalCandidatePrefixes));\n const candidateFiles =\n pmInternalCandidatePrefixes.length === 0\n ? fileCandidates.candidateFiles\n : fileCandidates.candidateFiles.filter((candidate) => !hasPathPrefix(candidate, pmInternalCandidatePrefixes));\n const excludedPmInternalCount = excludedPmInternalPaths.length;\n const excludedByReason: Record<string, unknown> = {};\n if (excludedPmInternalCount > 0) {\n const summarizedPmInternalPaths = summarizeFileList(excludedPmInternalPaths, verboseFileLists);\n excludedByReason.pm_internals = {\n count: excludedPmInternalCount,\n paths: summarizedPmInternalPaths.values,\n paths_truncated: summarizedPmInternalPaths.truncated,\n paths_total: summarizedPmInternalPaths.total,\n };\n }\n const orphanedFiles = candidateFiles.filter((candidate) => !linkedProjectPaths.has(candidate));\n // Stale-path classification (pm-0v2m / GH-184): a missing linked path whose\n // basename still exists in the candidate scan is reported as `moved` (with\n // relink candidates); otherwise it is `deleted` and safe to prune.\n const classifiedStalePaths = classifyStaleLinkedPaths(uniqueMissingLinkedPaths, candidateFiles);\n const classificationByPath = new Map(classifiedStalePaths.map((entry) => [entry.path, entry.classification]));\n const movedStalePathCount = classifiedStalePaths.filter((entry) => entry.classification === \"moved\").length;\n const staleLinkPruneRows: StaleLinkPruneRow[] = staleLinkRows\n .map((row) => ({\n ...row,\n classification: classificationByPath.get(row.path) ?? (\"deleted\" as const),\n }))\n .sort(\n (left, right) =>\n left.item_id.localeCompare(right.item_id) ||\n left.path.localeCompare(right.path) ||\n left.link_kind.localeCompare(right.link_kind),\n );\n const warnings: string[] = [];\n if (strictModeForcesPmInternals) {\n warnings.push(\"validate_files_tracked_all_strict_forces_pm_internals\");\n }\n if (uniqueMissingLinkedPaths.length > 0) {\n warnings.push(`validate_files_missing_linked_paths:${uniqueMissingLinkedPaths.length}`);\n }\n if (orphanedFiles.length > 0) {\n warnings.push(`validate_files_orphaned_paths:${orphanedFiles.length}`);\n }\n const summarizedMissing = summarizeFileList(uniqueMissingLinkedPaths, verboseFileLists);\n const summarizedOrphaned = summarizeFileList(orphanedFiles, verboseFileLists);\n const summarizedClassifications = summarizeFileList(\n summarizeStaleLinkedPathClassifications(classifiedStalePaths),\n verboseFileLists,\n );\n\n return {\n check: {\n name: \"files\",\n status: warnings.length === 0 ? \"ok\" : \"warn\",\n details: {\n workspace_root: workspaceRoot,\n scan_mode_requested: fileCandidates.requestedMode,\n scan_mode_applied: fileCandidates.appliedMode,\n strict_tracked_all_mode: strictTrackedAllMode,\n strict_mode_forces_pm_internals: strictModeForcesPmInternals,\n strict_mode_forces_pm_internals_notice: strictModeForcesPmInternals\n ? \"tracked-all-strict force-enables PM internals; pass --include-pm-internals to make inclusion explicit.\"\n : null,\n file_list_detail_mode: verboseFileLists ? \"full\" : \"summary\",\n file_list_summary_limit: FILE_LIST_SUMMARY_LIMIT,\n candidate_scan_source: fileCandidates.source,\n include_pm_internals: includePmInternalsEffective,\n include_pm_internals_requested: includePmInternals,\n pm_internal_candidate_prefixes: pmInternalCandidatePrefixes,\n pm_internal_excluded_count: excludedPmInternalCount,\n excluded_total: excludedPmInternalCount,\n excluded_by_reason: excludedByReason,\n linked_project_paths: linkedProjectPaths.size,\n candidate_total_raw: fileCandidates.candidateTotal,\n candidate_scanned_raw: fileCandidates.candidateScanned,\n candidate_total: candidateFiles.length,\n candidate_scanned: candidateFiles.length,\n scanned_candidate_files: candidateFiles.length,\n missing_linked_paths_count: uniqueMissingLinkedPaths.length,\n missing_linked_paths_total: summarizedMissing.total,\n missing_linked_paths: summarizedMissing.values,\n missing_linked_paths_truncated: summarizedMissing.truncated,\n missing_linked_paths_moved_count: movedStalePathCount,\n missing_linked_paths_deleted_count: uniqueMissingLinkedPaths.length - movedStalePathCount,\n missing_linked_path_classifications: summarizedClassifications.values,\n missing_linked_path_classifications_truncated: summarizedClassifications.truncated,\n orphaned_paths_count: orphanedFiles.length,\n orphaned_paths_total: summarizedOrphaned.total,\n orphaned_paths: summarizedOrphaned.values,\n orphaned_paths_truncated: summarizedOrphaned.truncated,\n },\n },\n warnings,\n staleLinkPruneRows,\n };\n}\n\nasync function buildHistoryDriftCheck(\n pmRoot: string,\n items: ItemWithBody[],\n verboseDiagnostics: boolean,\n): Promise<{ check: ValidateCheck; warnings: string[] }> {\n const { missingStreams, unreadableStreams, hashMismatches, chainMismatches, driftedItems } = await scanHistoryDrift(\n pmRoot,\n items,\n );\n const warnings: string[] = [];\n if (missingStreams.length > 0) {\n warnings.push(`validate_history_drift_missing_streams:${missingStreams.length}`);\n }\n if (unreadableStreams.length > 0) {\n warnings.push(`validate_history_drift_unreadable_streams:${unreadableStreams.length}`);\n }\n if (hashMismatches.length > 0) {\n warnings.push(`validate_history_drift_hash_mismatches:${hashMismatches.length}`);\n }\n if (chainMismatches.length > 0) {\n warnings.push(`validate_history_drift_chain_mismatches:${chainMismatches.length}`);\n }\n const diagnosticLimit = verboseDiagnostics ? Number.POSITIVE_INFINITY : DIAGNOSTIC_LIST_SUMMARY_LIMIT;\n const summarizedDrifted = summarizeList(driftedItems, diagnosticLimit);\n return {\n check: {\n name: \"history_drift\",\n status: warnings.length === 0 ? \"ok\" : \"warn\",\n details: {\n checked_items: items.length,\n drifted_items_count: driftedItems.length,\n drifted_items: summarizedDrifted.values,\n drifted_items_truncated: summarizedDrifted.truncated,\n counts: {\n missing_streams: missingStreams.length,\n unreadable_streams: unreadableStreams.length,\n hash_mismatches: hashMismatches.length,\n chain_mismatches: chainMismatches.length,\n },\n },\n },\n warnings,\n };\n}\n\nfunction summarizeCommandReferenceRow(ownerId: string, referencedId: string, command: string): string {\n const normalizedCommand = command.trim().replaceAll(/\\s+/g, \" \");\n const commandPreview = normalizedCommand.length > 120 ? `${normalizedCommand.slice(0, 117)}...` : normalizedCommand;\n return `${ownerId}:${referencedId}:${commandPreview}`;\n}\n\nfunction buildCommandReferencesCheck(\n items: ItemWithBody[],\n idPrefix: string,\n verboseDiagnostics: boolean,\n): { check: ValidateCheck; warnings: string[] } {\n const knownIds = new Set(items.map((item) => item.id.toLowerCase()));\n let linkedCommandsScanned = 0;\n let referencedPmIdCount = 0;\n const referencedPmIds = new Set<string>();\n const staleReferenceRows: string[] = [];\n\n for (const item of items) {\n for (const linkedTest of item.tests ?? []) {\n if (typeof linkedTest.command !== \"string\" || linkedTest.command.trim().length === 0) {\n continue;\n }\n linkedCommandsScanned += 1;\n const referencedIds = extractReferencedPmItemIdsFromCommand(linkedTest.command, idPrefix);\n if (referencedIds.length === 0) {\n continue;\n }\n referencedPmIdCount += referencedIds.length;\n for (const referencedId of referencedIds) {\n referencedPmIds.add(referencedId);\n if (!knownIds.has(referencedId.toLowerCase())) {\n staleReferenceRows.push(summarizeCommandReferenceRow(item.id, referencedId, linkedTest.command));\n }\n }\n }\n }\n\n const uniqueStaleReferenceRows = [...new Set(staleReferenceRows)].sort((left, right) => left.localeCompare(right));\n const stalePmIds = [...new Set(uniqueStaleReferenceRows.map((row) => row.split(\":\")[1] ?? \"\"))]\n .filter((value) => value.length > 0)\n .sort((left, right) => left.localeCompare(right));\n const warnings =\n uniqueStaleReferenceRows.length > 0 ? [`validate_command_references_stale_pm_ids:${uniqueStaleReferenceRows.length}`] : [];\n const diagnosticLimit = verboseDiagnostics ? Number.POSITIVE_INFINITY : DIAGNOSTIC_LIST_SUMMARY_LIMIT;\n const summarizedRows = summarizeList(uniqueStaleReferenceRows, diagnosticLimit);\n const summarizedStalePmIds = summarizeList(stalePmIds, diagnosticLimit);\n const summarizedReferencedPmIds = summarizeList(\n [...referencedPmIds].sort((left, right) => left.localeCompare(right)),\n diagnosticLimit,\n );\n\n return {\n check: {\n name: \"command_references\",\n status: warnings.length === 0 ? \"ok\" : \"warn\",\n details: {\n checked_items: items.length,\n linked_commands_scanned: linkedCommandsScanned,\n referenced_pm_ids_count: referencedPmIdCount,\n unique_referenced_pm_ids_count: referencedPmIds.size,\n unique_referenced_pm_ids: summarizedReferencedPmIds.values,\n unique_referenced_pm_ids_truncated: summarizedReferencedPmIds.truncated,\n stale_pm_id_references_count: uniqueStaleReferenceRows.length,\n stale_pm_ids_count: stalePmIds.length,\n stale_pm_ids: summarizedStalePmIds.values,\n stale_pm_ids_truncated: summarizedStalePmIds.truncated,\n stale_pm_id_reference_rows: summarizedRows.values,\n stale_pm_id_reference_rows_truncated: summarizedRows.truncated,\n },\n },\n warnings,\n };\n}\n\nconst VALIDATE_AUTO_FIX_MESSAGE = \"pm validate auto-fix\";\n\n/**\n * Apply one planned fix through the SAME audited command paths an operator\n * would use by hand (`pm update` / `pm files --remove` / `pm docs --remove`),\n * so every applied fix carries normal history, locking, and hook behavior.\n * Command modules are imported lazily: plain validate runs stay read-only and\n * never pay the mutation-stack import cost.\n */\nasync function applyValidateFix(fix: ValidateFixRecord, global: GlobalOptions): Promise<void> {\n switch (fix.kind) {\n case \"set_resolution\":\n case \"set_close_reason\":\n case \"reparent\":\n case \"unset_parent\": {\n const { runUpdate } = await import(\"./update.js\");\n const updateOptions: Record<string, unknown> = { message: VALIDATE_AUTO_FIX_MESSAGE };\n if (fix.kind === \"set_resolution\") {\n updateOptions.resolution = fix.value;\n } else if (fix.kind === \"set_close_reason\") {\n updateOptions.closeReason = fix.value;\n } else if (fix.kind === \"reparent\") {\n updateOptions.parent = fix.parent_id;\n } else {\n updateOptions.unset = [\"parent\"];\n }\n await runUpdate(fix.item_id, updateOptions, global);\n return;\n }\n case \"prune_file_link\": {\n throw new Error(`Unsupported non-batched fix kind: ${fix.kind}`);\n }\n case \"prune_doc_link\": {\n throw new Error(`Unsupported non-batched fix kind: ${fix.kind}`);\n }\n }\n}\n\nfunction pruneBatchKey(fix: ValidateFixRecord): string | null {\n if (fix.kind !== \"prune_file_link\" && fix.kind !== \"prune_doc_link\") {\n return null;\n }\n return `${fix.kind}:${fix.item_id}`;\n}\n\nasync function applyValidateFixes(applicable: ValidateFixRecord[], global: GlobalOptions): Promise<{\n applied: ValidateFixRecord[];\n failed: Array<{ fix: ValidateFixRecord; error: unknown }>;\n}> {\n const applied: ValidateFixRecord[] = [];\n const failed: Array<{ fix: ValidateFixRecord; error: unknown }> = [];\n const pruneBatches = new Map<string, ValidateFixRecord[]>();\n\n for (const fix of applicable) {\n const batchKey = pruneBatchKey(fix);\n if (batchKey === null) {\n try {\n await applyValidateFix(fix, global);\n applied.push(fix);\n } catch (error) {\n failed.push({ fix, error });\n }\n continue;\n }\n const existing = pruneBatches.get(batchKey);\n if (existing) {\n existing.push(fix);\n } else {\n pruneBatches.set(batchKey, [fix]);\n }\n }\n\n for (const batch of pruneBatches.values()) {\n const first = batch[0];\n if (!first) {\n continue;\n }\n const remove = batch\n .map((fix) => fix.path)\n .filter((value): value is string => typeof value === \"string\" && value.length > 0);\n try {\n if (first.kind === \"prune_file_link\") {\n const { runFiles } = await import(\"./files.js\");\n await runFiles(first.item_id, { remove, message: VALIDATE_AUTO_FIX_MESSAGE }, global);\n } else {\n const { runDocs } = await import(\"./docs.js\");\n await runDocs(first.item_id, { remove, message: VALIDATE_AUTO_FIX_MESSAGE }, global);\n }\n applied.push(...batch);\n } catch (error) {\n failed.push(...batch.map((fix) => ({ fix, error })));\n }\n }\n\n return { applied, failed };\n}\n\nexport async function runValidate(options: ValidateCommandOptions, global: GlobalOptions): Promise<ValidateResult> {\n const fixesRequested = options.autoFix === true || options.pruneMissing === true;\n if (options.dryRun === true && !fixesRequested) {\n throw new PmCliError(\n \"--dry-run requires --auto-fix or --prune-missing (there is nothing to preview otherwise).\",\n EXIT_CODE.USAGE,\n );\n }\n if (options.fixScope !== undefined && options.fixScope.length > 0 && options.autoFix !== true) {\n throw new PmCliError(\"--fix-scope requires --auto-fix.\", EXIT_CODE.USAGE);\n }\n // Resolved up-front so unknown --fix-scope values fail fast before any scan.\n const grantedFixScopes = resolveGrantedFixScopes(options.fixScope);\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const itemReadWarnings: string[] = [];\n const items = await listAllFrontMatterWithBody(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n itemReadWarnings,\n settings.schema,\n );\n const requestedChecks = resolveRequestedChecks(options);\n const metadataProfileSource: \"default\" | \"settings\" | \"option\" =\n typeof options.metadataProfile === \"string\" ? \"option\" : \"settings\";\n const metadataProfile = resolveValidateMetadataProfile(\n typeof options.metadataProfile === \"string\" ? options.metadataProfile : settings.validation.metadata_profile,\n );\n const metadataPolicy = resolveValidateMetadataPolicy(\n metadataProfile,\n metadataProfileSource,\n settings.validation.metadata_required_fields,\n );\n const lifecyclePatternPolicy = resolveLifecyclePatternPolicy(settings);\n const dependencyCycleSeverity = resolveDependencyCycleSeverity(options.dependencyCycleSeverity);\n const fileScanMode = resolveFileScanMode(options.scanMode);\n const workspaceRoot = resolveWorkspaceRoot(pmRoot);\n const checks: ValidateCheck[] = [];\n const warnings = [...new Set(itemReadWarnings)];\n const fixHintsEnabled = options.fixHints === true;\n const record = (built: { check: ValidateCheck; warnings: string[] }): void => {\n if (fixHintsEnabled) {\n attachValidateFixHints(built.check, built.warnings);\n }\n checks.push(built.check);\n warnings.push(...built.warnings);\n };\n\n let closeReasonBackfillRows: CloseReasonBackfillRow[] = [];\n let resolutionBackfillRows: ResolutionBackfillRow[] = [];\n let terminalParentFixRows: TerminalParentFixRow[] = [];\n let staleLinkPruneRows: StaleLinkPruneRow[] = [];\n\n if (requestedChecks.has(\"metadata\")) {\n const built = buildMetadataCheck(items, metadataPolicy, statusRegistry, Boolean(options.verboseDiagnostics));\n closeReasonBackfillRows = built.closeReasonBackfillRows;\n record(built);\n }\n if (requestedChecks.has(\"resolution\")) {\n const built = buildResolutionCheck(items, statusRegistry, Boolean(options.verboseDiagnostics));\n resolutionBackfillRows = built.resolutionBackfillRows;\n record(built);\n }\n if (requestedChecks.has(\"lifecycle\")) {\n const built = buildLifecycleCheck(\n items,\n Boolean(options.checkStaleBlockers),\n dependencyCycleSeverity,\n statusRegistry,\n lifecyclePatternPolicy,\n Boolean(options.verboseDiagnostics),\n );\n terminalParentFixRows = built.terminalParentFixRows;\n record(built);\n }\n if (requestedChecks.has(\"files\")) {\n const built = await buildFilesCheck(\n items,\n workspaceRoot,\n pmRoot,\n fileScanMode,\n Boolean(options.includePmInternals),\n Boolean(options.verboseFileLists),\n );\n staleLinkPruneRows = built.staleLinkPruneRows;\n record(built);\n }\n if (requestedChecks.has(\"command_references\")) {\n record(buildCommandReferencesCheck(items, settings.id_prefix, Boolean(options.verboseDiagnostics)));\n }\n if (requestedChecks.has(\"history_drift\")) {\n record(await buildHistoryDriftCheck(pmRoot, items, Boolean(options.verboseDiagnostics)));\n }\n\n // Remediation phase (pm-c3sz / pm-8jss / pm-0v2m). Plans are derived from\n // the findings of THIS run; checks above always report the pre-fix state.\n // Safe field backfills apply by default under --auto-fix; gated lifecycle\n // fixes are planned but withheld unless --fix-scope lifecycle grants them;\n // --dry-run previews without mutating; failures never abort the run.\n let fixes: ValidateFixesSummary | undefined;\n if (fixesRequested) {\n const planned: ValidateFixRecord[] = [];\n if (options.autoFix === true) {\n planned.push(...planCloseReasonBackfillFixes(closeReasonBackfillRows));\n planned.push(...planResolutionBackfillFixes(resolutionBackfillRows));\n planned.push(...planTerminalParentFixes(terminalParentFixRows));\n }\n if (options.pruneMissing === true) {\n planned.push(...planStaleLinkPruneFixes(staleLinkPruneRows));\n }\n const { applicable, gated } = partitionFixesByGrant(planned, grantedFixScopes);\n const dryRun = options.dryRun === true;\n const appliedFixRows: Array<Record<string, unknown>> = [];\n const failedFixRows: Array<Record<string, unknown>> = [];\n if (!dryRun) {\n const applied = await applyValidateFixes(applicable, global);\n appliedFixRows.push(...applied.applied.map(toFixOutputRow));\n failedFixRows.push(\n ...applied.failed.map(({ fix, error }) => ({\n ...toFixOutputRow(fix),\n error: error instanceof Error ? error.message : String(error),\n })),\n );\n }\n fixes = {\n mode: dryRun ? \"dry_run\" : \"apply\",\n auto_fix: options.autoFix === true,\n prune_missing: options.pruneMissing === true,\n granted_fix_scopes: [...grantedFixScopes].sort((left, right) => left.localeCompare(right)),\n planned_count: planned.length,\n applied_count: appliedFixRows.length,\n gated_count: gated.length,\n failed_count: failedFixRows.length,\n planned_fixes: planned.map(toFixOutputRow),\n applied_fixes: appliedFixRows,\n gated_fixes: gated.map((fix) => ({\n ...toFixOutputRow(fix),\n gate_hint: `Withheld: re-run with --fix-scope ${fix.gate} to apply.`,\n })),\n failed_fixes: failedFixRows,\n };\n }\n\n const normalizedWarnings = [...new Set(warnings)].sort((left, right) => left.localeCompare(right));\n const hasErrors = checks.some((check) => check.status === \"error\");\n return {\n ok: !hasErrors,\n has_warnings: normalizedWarnings.length > 0,\n checks,\n warnings: normalizedWarnings,\n ...(fixes !== undefined ? { fixes } : {}),\n generated_at: nowIso(),\n };\n}\n", "/**\n * Fix planning for `pm validate --auto-fix` / `--prune-missing` (pm-c3sz,\n * pm-8jss, pm-0v2m).\n *\n * Pure module: planners turn check findings into declarative\n * {@link ValidateFixRecord}s; the validate command decides whether to apply\n * them (apply mode), preview them (`--dry-run`), or withhold gated fixes\n * (lifecycle structural changes require an explicit `--fix-scope lifecycle`).\n *\n * Safety invariants:\n * - Every planned fix is deterministic and non-destructive: it only sets a\n * derivable field value or removes a stale LINK (never a real file).\n * - No fix ever closes, deletes, or cancels an item.\n * - Lifecycle fixes (reparent / unset parent) are structural, so they are\n * planned with `gate: \"lifecycle\"` and only applied when that scope was\n * explicitly granted.\n */\n\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\n\nexport type ValidateFixCheck = \"metadata\" | \"resolution\" | \"lifecycle\" | \"files\";\n\nexport type ValidateFixKind =\n | \"set_resolution\"\n | \"set_close_reason\"\n | \"reparent\"\n | \"unset_parent\"\n | \"prune_file_link\"\n | \"prune_doc_link\";\n\nexport type ValidateFixScope = \"metadata\" | \"resolution\" | \"lifecycle\";\n\n/** Scopes auto-applied without an explicit `--fix-scope` (safe field backfills). */\nexport const DEFAULT_GRANTED_FIX_SCOPES: readonly ValidateFixScope[] = [\"metadata\", \"resolution\"];\n\n/** Scopes accepted by `--fix-scope` (lifecycle is the opt-in structural scope). */\nexport const SUPPORTED_FIX_SCOPES: readonly ValidateFixScope[] = [\"metadata\", \"resolution\", \"lifecycle\"];\n\nexport interface ValidateFixRecord {\n /** Item the fix targets. */\n item_id: string;\n /** Validate check the finding came from. */\n check: ValidateFixCheck;\n /** Front-matter field (or link list) the fix changes. */\n field: string;\n /** Declarative fix kind the applier dispatches on. */\n kind: ValidateFixKind;\n /** Equivalent standalone `pm` command for the fix. */\n command: string;\n /** New value for set-field fixes. */\n value?: string;\n /** Stale link path for prune fixes. */\n path?: string;\n /** Target parent id for reparent fixes. */\n parent_id?: string;\n /**\n * Fix scope the `--fix-scope` allowlist must grant for the fix to be\n * applied. Every `--auto-fix` record carries one (the granted default is\n * metadata+resolution; lifecycle must be named explicitly). Absent only on\n * `--prune-missing` records, which are governed by their own flag.\n */\n gate?: ValidateFixScope;\n}\n\n/** Default resolution backfilled onto closed items with no derivable source text. */\nexport const DEFAULT_RESOLUTION_BACKFILL_VALUE = \"completed\";\n\nfunction quoteForCommand(value: string): string {\n return `\"${value.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll('\"', '\\\\\"')}\"`;\n}\n\nfunction toMeaningfulValue(value: string | undefined): string | undefined {\n const trimmed = value?.trim();\n return trimmed !== undefined && trimmed.length > 0 ? trimmed : undefined;\n}\n\nexport interface ResolutionBackfillRow {\n id: string;\n /** Resolution-check missing field keys for this closed item. */\n missing_fields: readonly string[];\n /** The item's close_reason, when present (preferred derivation source). */\n close_reason?: string;\n}\n\n/**\n * Plan resolution backfills for closed items flagged by the resolution check.\n * Only the `resolution` field is mechanical enough to auto-fix: it derives\n * from the item's own `close_reason` when present and falls back to the\n * `\"completed\"` default. `expected_result` / `actual_result` stay hint-only —\n * no deterministic source text exists for them.\n */\nexport function planResolutionBackfillFixes(rows: readonly ResolutionBackfillRow[]): ValidateFixRecord[] {\n const fixes: ValidateFixRecord[] = [];\n for (const row of rows) {\n if (!row.missing_fields.includes(\"resolution\")) {\n continue;\n }\n const value = toMeaningfulValue(row.close_reason) ?? DEFAULT_RESOLUTION_BACKFILL_VALUE;\n fixes.push({\n item_id: row.id,\n check: \"resolution\",\n field: \"resolution\",\n kind: \"set_resolution\",\n value,\n command: `pm update ${row.id} --resolution ${quoteForCommand(value)}`,\n gate: \"resolution\",\n });\n }\n return fixes;\n}\n\nexport interface CloseReasonBackfillRow {\n id: string;\n /** The item's resolution, when present (the only derivation source). */\n resolution?: string;\n}\n\n/**\n * Plan close_reason backfills for closed items flagged by the metadata check.\n * Only derivable when the item already carries a resolution; items missing\n * both stay hint-only (any synthesized reason would be fabricated, not\n * derived).\n */\nexport function planCloseReasonBackfillFixes(rows: readonly CloseReasonBackfillRow[]): ValidateFixRecord[] {\n const fixes: ValidateFixRecord[] = [];\n for (const row of rows) {\n const value = toMeaningfulValue(row.resolution);\n if (value === undefined) {\n continue;\n }\n fixes.push({\n item_id: row.id,\n check: \"metadata\",\n field: \"close_reason\",\n kind: \"set_close_reason\",\n value,\n command: `pm update ${row.id} --close-reason ${quoteForCommand(value)}`,\n gate: \"metadata\",\n });\n }\n return fixes;\n}\n\nexport interface TerminalParentFixRow {\n id: string;\n parent_id: string;\n /** The terminal parent's own parent, when one exists. */\n grandparent_id?: string;\n /** True when the grandparent exists and is NOT terminal (safe reparent target). */\n grandparent_active?: boolean;\n}\n\n/**\n * Plan lifecycle fixes for active items whose parent is terminal (pm-8jss /\n * GH-168). When the terminal parent has an active grandparent, the child is\n * reparented one level up (it stays inside the same hierarchy); otherwise the\n * parent link is cleared so the item surfaces as unparented active work.\n * Either way the item itself is never closed or mutated beyond `parent` —\n * and every fix carries `gate: \"lifecycle\"` so it is only applied under an\n * explicit `--fix-scope lifecycle`.\n */\nexport function planTerminalParentFixes(rows: readonly TerminalParentFixRow[]): ValidateFixRecord[] {\n return rows.map((row) => {\n if (row.grandparent_id !== undefined && row.grandparent_active === true) {\n return {\n item_id: row.id,\n check: \"lifecycle\" as const,\n field: \"parent\",\n kind: \"reparent\" as const,\n parent_id: row.grandparent_id,\n command: `pm update ${row.id} --parent ${row.grandparent_id}`,\n gate: \"lifecycle\" as const,\n };\n }\n return {\n item_id: row.id,\n check: \"lifecycle\" as const,\n field: \"parent\",\n kind: \"unset_parent\" as const,\n command: `pm update ${row.id} --unset parent`,\n gate: \"lifecycle\" as const,\n };\n });\n}\n\nexport interface StaleLinkPruneRow {\n item_id: string;\n path: string;\n link_kind: \"files\" | \"docs\";\n classification: \"moved\" | \"deleted\";\n}\n\n/**\n * Plan link prunes for `--prune-missing` (pm-0v2m / GH-184). Only links whose\n * stale path classified as `deleted` are pruned; `moved` links keep their\n * relink candidates in the files-check details instead of being dropped, so\n * recoverable link information is never destroyed. Link removal only — real\n * files are never touched.\n */\nexport function planStaleLinkPruneFixes(rows: readonly StaleLinkPruneRow[]): ValidateFixRecord[] {\n const fixes: ValidateFixRecord[] = [];\n for (const row of rows) {\n if (row.classification !== \"deleted\") {\n continue;\n }\n const noun = row.link_kind === \"files\" ? \"files\" : \"docs\";\n fixes.push({\n item_id: row.item_id,\n check: \"files\",\n field: row.link_kind,\n kind: row.link_kind === \"files\" ? \"prune_file_link\" : \"prune_doc_link\",\n path: row.path,\n command: `pm ${noun} ${row.item_id} --remove ${quoteForCommand(row.path)}`,\n });\n }\n return fixes;\n}\n\n/**\n * Resolve the granted `--fix-scope` set (repeatable and/or comma-separated).\n * With no explicit scopes the safe field-backfill scopes (metadata,\n * resolution) are granted; lifecycle must always be named explicitly. Unknown\n * values fail fast with the supported list.\n */\nexport function resolveGrantedFixScopes(rawScopes: readonly string[] | undefined): Set<ValidateFixScope> {\n const tokens = (rawScopes ?? [])\n .flatMap((raw) => raw.split(\",\"))\n .map((raw) => raw.trim())\n .filter((raw) => raw.length > 0);\n if (tokens.length === 0) {\n if (rawScopes !== undefined && rawScopes.length > 0) {\n throw new PmCliError(\n `--fix-scope values must not be empty. Supported values: ${SUPPORTED_FIX_SCOPES.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n return new Set(DEFAULT_GRANTED_FIX_SCOPES);\n }\n const granted = new Set<ValidateFixScope>();\n for (const raw of tokens) {\n const normalized = raw.toLowerCase().replaceAll(\"-\", \"_\");\n if ((SUPPORTED_FIX_SCOPES as readonly string[]).includes(normalized)) {\n granted.add(normalized as ValidateFixScope);\n continue;\n }\n throw new PmCliError(\n `Unknown --fix-scope value \"${raw}\". Supported values: ${SUPPORTED_FIX_SCOPES.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n return granted;\n}\n\n/**\n * Split a fix plan into the records that may be applied under the granted\n * scopes and the gated records that were withheld. `--fix-scope` is an exact\n * allowlist: every `--auto-fix` record requires its gate scope in `granted`.\n * Ungated records (`--prune-missing` link prunes, governed by their own flag)\n * are always applicable.\n */\nexport function partitionFixesByGrant(\n fixes: readonly ValidateFixRecord[],\n granted: ReadonlySet<ValidateFixScope>,\n): { applicable: ValidateFixRecord[]; gated: ValidateFixRecord[] } {\n const applicable: ValidateFixRecord[] = [];\n const gated: ValidateFixRecord[] = [];\n for (const fix of fixes) {\n if (fix.gate !== undefined && !granted.has(fix.gate)) {\n gated.push(fix);\n } else {\n applicable.push(fix);\n }\n }\n return { applicable, gated };\n}\n\n/** Compact serialization of a fix for planned/applied output rows. */\nexport function toFixOutputRow(fix: ValidateFixRecord): Record<string, unknown> {\n return {\n item_id: fix.item_id,\n check: fix.check,\n field: fix.field,\n command: fix.command,\n ...(fix.gate !== undefined ? { gate: fix.gate } : {}),\n };\n}\n", "/**\n * Per-item-type grouping of missing-required-field counts for\n * `pm validate --check-metadata` (pm-pmyq / GH-172).\n *\n * Pure module: callers stream `(item_type, field)` pairs — one per missing\n * required field occurrence — and receive a compact, deterministically sorted\n * `missing_by_type` map of counts (never row dumps), e.g.\n * `{ Task: { close_reason: 3, reviewer: 1 } }`.\n */\n\nexport interface MissingFieldOccurrence {\n /** Item type name as stored in front matter (e.g. \"Task\"). */\n item_type: string;\n /** Required metadata field that is missing on the item. */\n field: string;\n}\n\n/**\n * Aggregate missing-field occurrences into `{ type: { field: count } }` with\n * both levels sorted lexicographically for stable, diff-friendly output.\n * Zero counts never appear (only observed occurrences are aggregated).\n */\nexport function buildMissingByTypeCounts(\n occurrences: Iterable<MissingFieldOccurrence>,\n): Record<string, Record<string, number>> {\n const countsByType = new Map<string, Map<string, number>>();\n for (const occurrence of occurrences) {\n let fieldCounts = countsByType.get(occurrence.item_type);\n if (!fieldCounts) {\n fieldCounts = new Map<string, number>();\n countsByType.set(occurrence.item_type, fieldCounts);\n }\n fieldCounts.set(occurrence.field, (fieldCounts.get(occurrence.field) ?? 0) + 1);\n }\n\n const result: Record<string, Record<string, number>> = {};\n for (const type of [...countsByType.keys()].sort((left, right) => left.localeCompare(right))) {\n const fieldCounts = countsByType.get(type)!;\n const fields: Record<string, number> = {};\n for (const field of [...fieldCounts.keys()].sort((left, right) => left.localeCompare(right))) {\n fields[field] = fieldCounts.get(field)!;\n }\n result[type] = fields;\n }\n return result;\n}\n", "/**\n * Classification of stale linked paths reported by `pm validate --check-files`.\n *\n * A linked file path that no longer exists is either:\n * - `moved`: a file with the same basename still exists elsewhere in the\n * scanned candidate set — the candidates are reported so an agent can relink\n * the item to the new location instead of dropping the link, or\n * - `deleted`: no candidate with that basename exists anywhere in the scan,\n * so the link points at content that is gone and pruning it is safe.\n *\n * Pure module (pm-0v2m / GH-184): no filesystem access — callers pass the\n * already-collected candidate file list from the files check scan.\n */\n\nexport type StaleLinkedPathClassification = \"moved\" | \"deleted\";\n\nexport interface ClassifiedStaleLinkedPath {\n /** Normalized workspace-relative stale linked path. */\n path: string;\n classification: StaleLinkedPathClassification;\n /**\n * Candidate new locations (same basename, different path), sorted and capped\n * at `candidateLimit`. Empty for `deleted`.\n */\n candidates: string[];\n /** True when more candidates existed than `candidateLimit` allowed. */\n candidates_truncated: boolean;\n}\n\nexport const DEFAULT_STALE_PATH_CANDIDATE_LIMIT = 3;\n\nfunction basenameOf(relativePath: string): string {\n const lastSlash = Math.max(relativePath.lastIndexOf(\"/\"), relativePath.lastIndexOf(\"\\\\\"));\n return lastSlash === -1 ? relativePath : relativePath.slice(lastSlash + 1);\n}\n\n/**\n * Classify each stale (missing) linked path as `moved` or `deleted` by\n * matching its basename against the candidate file list. Output preserves the\n * input order of `stalePaths` (callers pass an already-sorted unique list).\n * A candidate equal to the stale path itself never matches (the path is known\n * missing; an identical candidate would be self-referential noise).\n */\nexport function classifyStaleLinkedPaths(\n stalePaths: readonly string[],\n candidateFiles: readonly string[],\n candidateLimit: number = DEFAULT_STALE_PATH_CANDIDATE_LIMIT,\n): ClassifiedStaleLinkedPath[] {\n const limit = Number.isFinite(candidateLimit) && candidateLimit >= 1 ? Math.floor(candidateLimit) : DEFAULT_STALE_PATH_CANDIDATE_LIMIT;\n const candidatesByBasename = new Map<string, string[]>();\n for (const candidate of candidateFiles) {\n const basename = basenameOf(candidate);\n if (basename.length === 0) {\n continue;\n }\n const bucket = candidatesByBasename.get(basename);\n if (bucket) {\n bucket.push(candidate);\n } else {\n candidatesByBasename.set(basename, [candidate]);\n }\n }\n\n return stalePaths.map((stalePath) => {\n const matches = (candidatesByBasename.get(basenameOf(stalePath)) ?? [])\n .filter((candidate) => candidate !== stalePath)\n .sort((left, right) => left.localeCompare(right));\n if (matches.length === 0) {\n return {\n path: stalePath,\n classification: \"deleted\" as const,\n candidates: [],\n candidates_truncated: false,\n };\n }\n return {\n path: stalePath,\n classification: \"moved\" as const,\n candidates: matches.slice(0, limit),\n candidates_truncated: matches.length > limit,\n };\n });\n}\n\n/**\n * Render compact `<path>:moved:<top-candidate>` / `<path>:deleted` rows for\n * the files check details (token-efficient counterpart to the full\n * classification objects).\n */\nexport function summarizeStaleLinkedPathClassifications(classified: readonly ClassifiedStaleLinkedPath[]): string[] {\n return classified.map((entry) =>\n entry.classification === \"moved\" ? `${entry.path}:moved:${entry.candidates[0]}` : `${entry.path}:deleted`,\n );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AACf,SAAS,oBAAoB;AAE7B,SAAS,gBAAgB;AACzB,OAAO,UAAU;AACjB,SAAS,iBAAiB;;;;;;;;;;AC6BnB,IAAM,6BAA0D,CAAC,YAAY,YAAY;AAGzF,IAAM,uBAAoD,CAAC,YAAY,cAAc,WAAW;AA6BhG,IAAM,oCAAoC;AAEjD,SAAS,gBAAgB,OAAa;AACpC,SAAO,IAAI,MAAM,WAAW,MAAM,MAAM,EAAE,WAAW,KAAK,KAAK,CAAC;AAClE;AAEA,SAAS,kBAAkB,OAAyB;AAClD,QAAM,UAAU,OAAO,KAAI;AAC3B,SAAO,YAAY,UAAa,QAAQ,SAAS,IAAI,UAAU;AACjE;AAiBM,SAAU,4BAA4B,MAAsC;AAChF,QAAM,QAA6B,CAAA;AACnC,aAAW,OAAO,MAAM;AACtB,QAAI,CAAC,IAAI,eAAe,SAAS,YAAY,GAAG;AAC9C;IACF;AACA,UAAM,QAAQ,kBAAkB,IAAI,YAAY,KAAK;AACrD,UAAM,KAAK;MACT,SAAS,IAAI;MACb,OAAO;MACP,OAAO;MACP,MAAM;MACN;MACA,SAAS,aAAa,IAAI,EAAE,iBAAiB,gBAAgB,KAAK,CAAC;MACnE,MAAM;K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