@unbrained/pm-cli 2026.6.20 → 2026.6.21

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 (408) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cli/commands/extension/scaffold.js +49 -3
  3. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  4. package/dist/cli/commands/extension.js +9 -2
  5. package/dist/cli/commands/extension.js.map +1 -1
  6. package/dist/cli/commands/health.js +15 -3
  7. package/dist/cli/commands/health.js.map +1 -1
  8. package/dist/cli/commands/validate.d.ts +1 -1
  9. package/dist/cli/commands/validate.js +44 -2
  10. package/dist/cli/commands/validate.js.map +1 -1
  11. package/dist/cli-bundle/chunks/activity-CIHV64UC.js +18 -0
  12. package/dist/cli-bundle/chunks/{activity-KEEITOTB.js → activity-KW3IRP44.js} +11 -11
  13. package/dist/cli-bundle/chunks/{aggregate-GB2LJNTZ.js → aggregate-3ZKQG5SW.js} +10 -10
  14. package/dist/cli-bundle/chunks/{aggregate-5BTHOHW2.js → aggregate-FIGQEIL3.js} +10 -10
  15. package/dist/cli-bundle/chunks/{append-BBM4MNVD.js → append-EWJYJ7CH.js} +8 -8
  16. package/dist/cli-bundle/chunks/{append-BFV5UYWS.js → append-QEOLX3XB.js} +8 -8
  17. package/dist/cli-bundle/chunks/{chunk-RICT5QYR.js → chunk-2EIMPCE4.js} +3 -3
  18. package/dist/cli-bundle/chunks/{chunk-ZYG4TR32.js → chunk-2GCDRRIF.js} +12 -12
  19. package/dist/cli-bundle/chunks/{chunk-DYOJJTCG.js → chunk-2PKHRP6G.js} +10 -10
  20. package/dist/cli-bundle/chunks/{chunk-LTUB7ARL.js → chunk-32R4PIC6.js} +52 -7
  21. package/dist/cli-bundle/chunks/chunk-32R4PIC6.js.map +1 -0
  22. package/dist/cli-bundle/chunks/{chunk-HWHZ7EY7.js → chunk-37QXHBIB.js} +3 -3
  23. package/dist/cli-bundle/chunks/{chunk-ACULWT7G.js → chunk-3EWSGA7N.js} +12 -12
  24. package/dist/cli-bundle/chunks/{chunk-II4BRHKM.js → chunk-3MDHREEV.js} +3 -3
  25. package/dist/cli-bundle/chunks/{chunk-AZ75OVK4.js → chunk-434HM6Z5.js} +4 -3
  26. package/dist/cli-bundle/chunks/chunk-434HM6Z5.js.map +1 -0
  27. package/dist/cli-bundle/chunks/{chunk-E4E7UQBT.js → chunk-52OCIDPG.js} +5 -5
  28. package/dist/cli-bundle/chunks/{chunk-FA5O2DEG.js → chunk-5FIEHKEX.js} +5 -5
  29. package/dist/cli-bundle/chunks/{chunk-2QJLN4KM.js → chunk-5IDI42VV.js} +7 -7
  30. package/dist/cli-bundle/chunks/{chunk-H3ZTSYPA.js → chunk-5PCI3UBT.js} +52 -7
  31. package/dist/cli-bundle/chunks/chunk-5PCI3UBT.js.map +7 -0
  32. package/dist/cli-bundle/chunks/{chunk-2LUNPA3U.js → chunk-5QICDWMV.js} +2 -2
  33. package/dist/cli-bundle/chunks/{chunk-EOFROIC5.js → chunk-6CJWZAN7.js} +7 -7
  34. package/dist/cli-bundle/chunks/{chunk-3KVCMB2M.js → chunk-6H4LF7AO.js} +2 -2
  35. package/dist/cli-bundle/chunks/{chunk-6DZO5NN7.js → chunk-6M4RJS4M.js} +3 -3
  36. package/dist/cli-bundle/chunks/{chunk-WFOITX4A.js → chunk-6ZXM2XNF.js} +8 -8
  37. package/dist/cli-bundle/chunks/{chunk-AW4PYYNF.js → chunk-76Z3YSHV.js} +2 -2
  38. package/dist/cli-bundle/chunks/{chunk-ZHCSGIUX.js → chunk-7D3SAQXM.js} +2 -2
  39. package/dist/cli-bundle/chunks/{chunk-MFCFHL27.js → chunk-A4Z7ZOL5.js} +2 -2
  40. package/dist/cli-bundle/chunks/{chunk-F4EYOSNC.js → chunk-AIS5PGI3.js} +2 -2
  41. package/dist/cli-bundle/chunks/{chunk-BYNJWB5F.js → chunk-AZMOLBN3.js} +7 -7
  42. package/dist/cli-bundle/chunks/{chunk-VE3BUO3R.js → chunk-B473GZWW.js} +3 -3
  43. package/dist/cli-bundle/chunks/{chunk-W2ZESOQE.js → chunk-C3AZ5ZML.js} +13 -13
  44. package/dist/cli-bundle/chunks/{chunk-CNPWCUDR.js → chunk-C4N5I7ZW.js} +3 -3
  45. package/dist/cli-bundle/chunks/{chunk-DKWIPIJY.js → chunk-CF55WVVS.js} +2 -2
  46. package/dist/cli-bundle/chunks/{chunk-YBQF4CAW.js → chunk-CZPXY7UW.js} +3 -3
  47. package/dist/cli-bundle/chunks/{chunk-6KARQMC6.js → chunk-CZUB4XWO.js} +2 -2
  48. package/dist/cli-bundle/chunks/{chunk-K2LBDYDC.js → chunk-D7FYS6PG.js} +2 -2
  49. package/dist/cli-bundle/chunks/{chunk-X3CD2VUI.js → chunk-EBH56IXK.js} +8 -8
  50. package/dist/cli-bundle/chunks/{chunk-5XK2RYJR.js → chunk-F5NZWFSW.js} +7 -7
  51. package/dist/cli-bundle/chunks/{chunk-BZWIDTDE.js → chunk-F7K5GWP3.js} +9 -9
  52. package/dist/cli-bundle/chunks/{chunk-4KFL5OYK.js → chunk-FKBDKV7Y.js} +3 -3
  53. package/dist/cli-bundle/chunks/{chunk-XNQ3YH6N.js → chunk-FRUFKWNK.js} +2 -2
  54. package/dist/cli-bundle/chunks/{chunk-ICEWMJYH.js → chunk-FWPDUYEY.js} +7 -7
  55. package/dist/cli-bundle/chunks/{chunk-2ZY5SLNR.js → chunk-GMHPNNYG.js} +10 -10
  56. package/dist/cli-bundle/chunks/{chunk-U3WTMYBX.js → chunk-GOZUHWFD.js} +2 -2
  57. package/dist/cli-bundle/chunks/{chunk-ATRXPXAL.js → chunk-H7NJZWG2.js} +13 -13
  58. package/dist/cli-bundle/chunks/{chunk-VONJSFUW.js → chunk-HC4AWIKT.js} +2 -2
  59. package/dist/cli-bundle/chunks/{chunk-PF5GLFPU.js → chunk-HCU6WUSY.js} +9 -9
  60. package/dist/cli-bundle/chunks/{chunk-NKTUBA2C.js → chunk-HIP7WVTL.js} +4 -4
  61. package/dist/cli-bundle/chunks/{chunk-QWAJPGEI.js → chunk-HMOADQVT.js} +4 -3
  62. package/dist/cli-bundle/chunks/chunk-HMOADQVT.js.map +7 -0
  63. package/dist/cli-bundle/chunks/{chunk-RADIHKJ3.js → chunk-J4MYYSOL.js} +5 -5
  64. package/dist/cli-bundle/chunks/{chunk-IWKD7B33.js → chunk-JINYH2DB.js} +23 -2
  65. package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +7 -0
  66. package/dist/cli-bundle/chunks/{chunk-FSOJCFDS.js → chunk-LEU5GHRC.js} +55 -5
  67. package/dist/cli-bundle/chunks/chunk-LEU5GHRC.js.map +1 -0
  68. package/dist/cli-bundle/chunks/{chunk-OVSFW4KD.js → chunk-LUWW7L4B.js} +3 -3
  69. package/dist/cli-bundle/chunks/{chunk-6KSFULO6.js → chunk-M5XALUSL.js} +2 -2
  70. package/dist/cli-bundle/chunks/{chunk-BBSUVIIT.js → chunk-N5ZJACJ6.js} +8 -8
  71. package/dist/cli-bundle/chunks/{chunk-ETJKPURB.js → chunk-NB3PYLQ6.js} +5 -5
  72. package/dist/cli-bundle/chunks/{chunk-7MMXBIRZ.js → chunk-NIGXMNNI.js} +2 -2
  73. package/dist/cli-bundle/chunks/{chunk-XKJDCJEH.js → chunk-NIUEXCFS.js} +6 -6
  74. package/dist/cli-bundle/chunks/{chunk-RNKUCHUQ.js → chunk-NJHMAJ6N.js} +8 -8
  75. package/dist/cli-bundle/chunks/{chunk-AOCYDQLT.js → chunk-NJN7LL7U.js} +5 -5
  76. package/dist/cli-bundle/chunks/{chunk-MTQK5ZSB.js → chunk-NSBZ2CKF.js} +2 -2
  77. package/dist/cli-bundle/chunks/{chunk-26OQTCGH.js → chunk-NXS7ZKAK.js} +4 -4
  78. package/dist/cli-bundle/chunks/{chunk-6LTSLEHD.js → chunk-O47BPOPC.js} +2 -2
  79. package/dist/cli-bundle/chunks/{chunk-6Y7IQ6XN.js → chunk-OFYMIDF2.js} +9 -9
  80. package/dist/cli-bundle/chunks/{chunk-4YMX7XFI.js → chunk-OTHIWLMB.js} +5 -5
  81. package/dist/cli-bundle/chunks/{chunk-QUTJOHGK.js → chunk-PFSRUHDH.js} +9 -9
  82. package/dist/cli-bundle/chunks/{chunk-FXKPUMIR.js → chunk-PP2U4NMT.js} +5 -5
  83. package/dist/cli-bundle/chunks/{chunk-XXGAWTH5.js → chunk-PUH4D67U.js} +2 -2
  84. package/dist/cli-bundle/chunks/{chunk-NCGQ27PK.js → chunk-Q2J2HJUN.js} +2 -2
  85. package/dist/cli-bundle/chunks/{chunk-5MWA46UN.js → chunk-QGG32QHW.js} +61 -4
  86. package/dist/cli-bundle/chunks/chunk-QGG32QHW.js.map +7 -0
  87. package/dist/cli-bundle/chunks/{chunk-J7VSEFWB.js → chunk-QQHISQBJ.js} +3 -3
  88. package/dist/cli-bundle/chunks/{chunk-KCJZREBI.js → chunk-QZTWBFXJ.js} +2 -2
  89. package/dist/cli-bundle/chunks/{chunk-OLEP5TJH.js → chunk-R2EMWY7Q.js} +24 -3
  90. package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +1 -0
  91. package/dist/cli-bundle/chunks/{chunk-NMQNXH4U.js → chunk-RLK7P77C.js} +5 -5
  92. package/dist/cli-bundle/chunks/{chunk-FBBPCSJM.js → chunk-RVHYI7SL.js} +8 -8
  93. package/dist/cli-bundle/chunks/{chunk-3WAKNI2W.js → chunk-SBGXDO7A.js} +3 -3
  94. package/dist/cli-bundle/chunks/{chunk-6FSPWUBI.js → chunk-SRYYRVPB.js} +2 -2
  95. package/dist/cli-bundle/chunks/{chunk-SL233DQD.js → chunk-SX75ADBK.js} +6 -6
  96. package/dist/cli-bundle/chunks/{chunk-YT4Z2OVB.js → chunk-TKBHZPKD.js} +3 -3
  97. package/dist/cli-bundle/chunks/{chunk-EKMHDL6Z.js → chunk-UEMNL33O.js} +8 -8
  98. package/dist/cli-bundle/chunks/{chunk-4S4INK3B.js → chunk-UPE3CDD7.js} +7 -7
  99. package/dist/cli-bundle/chunks/{chunk-4PW4C3ZB.js → chunk-UV6IYE5U.js} +2 -2
  100. package/dist/cli-bundle/chunks/{chunk-GF44HVZL.js → chunk-WQ7NIVDK.js} +4 -4
  101. package/dist/cli-bundle/chunks/{chunk-B3LROPTV.js → chunk-YCJX76PW.js} +2 -2
  102. package/dist/cli-bundle/chunks/{chunk-WMQBNVZL.js → chunk-Z6T4PQI2.js} +4 -4
  103. package/dist/cli-bundle/chunks/{claim-G57ZJLZ4.js → claim-RC56YUWG.js} +10 -10
  104. package/dist/cli-bundle/chunks/{claim-TRSDQO6L.js → claim-THOJ6CMV.js} +10 -10
  105. package/dist/cli-bundle/chunks/close-DNMHGOCX.js +15 -0
  106. package/dist/cli-bundle/chunks/{close-4QMUQMON.js → close-SG5MNCVQ.js} +8 -8
  107. package/dist/cli-bundle/chunks/{close-many-A7U62CRI.js → close-many-3L3AQZBU.js} +15 -15
  108. package/dist/cli-bundle/chunks/{close-many-3UWKJRQK.js → close-many-DKQLBGLV.js} +15 -15
  109. package/dist/cli-bundle/chunks/{comments-4EM7XR74.js → comments-M7ZOZNBX.js} +10 -10
  110. package/dist/cli-bundle/chunks/{comments-URWDZP2I.js → comments-SKWMDWCW.js} +10 -10
  111. package/dist/cli-bundle/chunks/{config-GRJYZ2O3.js → config-7CK62S7T.js} +8 -8
  112. package/dist/cli-bundle/chunks/{config-PSZ5GWAK.js → config-OZCUABPB.js} +8 -8
  113. package/dist/cli-bundle/chunks/{context-A46YAV2F.js → context-OEC366TO.js} +13 -13
  114. package/dist/cli-bundle/chunks/{context-BCR34RKM.js → context-PUG2A7RC.js} +13 -13
  115. package/dist/cli-bundle/chunks/{contracts-JOPCQNDP.js → contracts-3THOLA7L.js} +4 -4
  116. package/dist/cli-bundle/chunks/{contracts-HPT25X4D.js → contracts-N65FXEOL.js} +4 -4
  117. package/dist/cli-bundle/chunks/{copy-X7V6AEDB.js → copy-6QLHILAC.js} +7 -7
  118. package/dist/cli-bundle/chunks/{copy-KBTIUW7L.js → copy-JPX7VZCH.js} +7 -7
  119. package/dist/cli-bundle/chunks/create-NNP6TSFO.js +30 -0
  120. package/dist/cli-bundle/chunks/{create-ZPZKJDFQ.js → create-Y54ZVVZH.js} +14 -14
  121. package/dist/cli-bundle/chunks/{delete-FGKVPUQZ.js → delete-63PCMQAJ.js} +7 -7
  122. package/dist/cli-bundle/chunks/{delete-2ZI6CJZM.js → delete-GDSMGAGJ.js} +7 -7
  123. package/dist/cli-bundle/chunks/{deps-IUJOBF2H.js → deps-T4ZF5G54.js} +7 -7
  124. package/dist/cli-bundle/chunks/{deps-SJCEFU3C.js → deps-XYQ73XRH.js} +7 -7
  125. package/dist/cli-bundle/chunks/{docs-UWJ75CKR.js → docs-C75YIXHC.js} +9 -9
  126. package/dist/cli-bundle/chunks/{docs-2LXF5SVC.js → docs-EHNPDWUL.js} +9 -9
  127. package/dist/cli-bundle/chunks/{eval-FRIDCTM2.js → eval-3WKDTRMH.js} +12 -12
  128. package/dist/cli-bundle/chunks/{eval-ZTT3F3SL.js → eval-GTENKE24.js} +12 -12
  129. package/dist/cli-bundle/chunks/{extension-VRYTNNSV.js → extension-46NWACO3.js} +5 -5
  130. package/dist/cli-bundle/chunks/{extension-XFQG3BXL.js → extension-D5FDZ2CO.js} +5 -5
  131. package/dist/cli-bundle/chunks/{files-B2RUCA32.js → files-DSZBOSSN.js} +9 -9
  132. package/dist/cli-bundle/chunks/{files-AJOGTTAN.js → files-X3H7CCBQ.js} +9 -9
  133. package/dist/cli-bundle/chunks/{focus-7N36RIMT.js → focus-5STQXDPU.js} +8 -8
  134. package/dist/cli-bundle/chunks/{focus-CFE33IYC.js → focus-MDVPOWB5.js} +8 -8
  135. package/dist/cli-bundle/chunks/{gc-OYJK4YBY.js → gc-ZC7JHBG7.js} +3 -3
  136. package/dist/cli-bundle/chunks/{gc-SBF2FGHK.js → gc-ZMST3WQP.js} +3 -3
  137. package/dist/cli-bundle/chunks/{get-577VLZZ7.js → get-J2IPJRZW.js} +11 -11
  138. package/dist/cli-bundle/chunks/{get-LLFWSPXW.js → get-NT7L2HUZ.js} +11 -11
  139. package/dist/cli-bundle/chunks/{health-C2PUT6JZ.js → health-IVMA3XQC.js} +33 -20
  140. package/dist/cli-bundle/chunks/health-IVMA3XQC.js.map +1 -0
  141. package/dist/cli-bundle/chunks/{health-PBJS7W2T.js → health-WOYBR3KU.js} +32 -19
  142. package/dist/cli-bundle/chunks/health-WOYBR3KU.js.map +7 -0
  143. package/dist/cli-bundle/chunks/{history-4FJK6Y3O.js → history-RLH2QCRO.js} +10 -10
  144. package/dist/cli-bundle/chunks/history-WX3MGFS2.js +20 -0
  145. package/dist/cli-bundle/chunks/{history-compact-HXF3OT7G.js → history-compact-UXDIFC33.js} +12 -12
  146. package/dist/cli-bundle/chunks/{history-compact-AXR6R6GU.js → history-compact-ZBEBGJM7.js} +12 -12
  147. package/dist/cli-bundle/chunks/{history-redact-UMPD4G3K.js → history-redact-P7I7AWMB.js} +11 -11
  148. package/dist/cli-bundle/chunks/history-redact-YQGU3XRA.js +21 -0
  149. package/dist/cli-bundle/chunks/{history-repair-WHOK2ICG.js → history-repair-52KINVIK.js} +12 -12
  150. package/dist/cli-bundle/chunks/{history-repair-X57HE5EA.js → history-repair-RM5ITLU5.js} +12 -12
  151. package/dist/cli-bundle/chunks/{init-N7MIIYCU.js → init-2BNZOO6F.js} +10 -10
  152. package/dist/cli-bundle/chunks/init-SC2P6CHP.js +20 -0
  153. package/dist/cli-bundle/chunks/{learnings-GZRBIEAN.js → learnings-W6F3FIPL.js} +10 -10
  154. package/dist/cli-bundle/chunks/{learnings-FPG7WAVW.js → learnings-YGYVHWJK.js} +10 -10
  155. package/dist/cli-bundle/chunks/{list-MZBCSKLU.js → list-K6FPV4J4.js} +10 -10
  156. package/dist/cli-bundle/chunks/{list-ZDQ2OBSO.js → list-KPAYU5KZ.js} +10 -10
  157. package/dist/cli-bundle/chunks/{notes-WQAP67EC.js → notes-PU74EPKV.js} +10 -10
  158. package/dist/cli-bundle/chunks/{notes-LW53PFLH.js → notes-YTD6ZILW.js} +10 -10
  159. package/dist/cli-bundle/chunks/{plan-AVJ4VJQO.js → plan-FNXHXRCI.js} +14 -14
  160. package/dist/cli-bundle/chunks/{plan-VZKICKIJ.js → plan-GEQYUCBW.js} +14 -14
  161. package/dist/cli-bundle/chunks/{register-list-query-CM4SVAQA.js → register-list-query-PHWYHENI.js} +19 -19
  162. package/dist/cli-bundle/chunks/{register-list-query-7BD6ZHU5.js → register-list-query-QI45RMKN.js} +19 -19
  163. package/dist/cli-bundle/chunks/{register-mutation-PLFHAS4N.js → register-mutation-X3BUOQEL.js} +33 -33
  164. package/dist/cli-bundle/chunks/{register-mutation-ANZIWHUF.js → register-mutation-YINRTS7L.js} +33 -33
  165. package/dist/cli-bundle/chunks/{register-operations-KQPQIFF2.js → register-operations-E5JEASRK.js} +32 -32
  166. package/dist/cli-bundle/chunks/{register-operations-VLGCAWIW.js → register-operations-MIDTRW7S.js} +32 -32
  167. package/dist/cli-bundle/chunks/{register-setup-TMEF6V7O.js → register-setup-DYBFLEZX.js} +15 -15
  168. package/dist/cli-bundle/chunks/{register-setup-KPTZ36D4.js → register-setup-EG2U6CEU.js} +15 -15
  169. package/dist/cli-bundle/chunks/restore-5KHR2YYQ.js +19 -0
  170. package/dist/cli-bundle/chunks/{restore-64JKQV7G.js → restore-XQYSWBV7.js} +11 -11
  171. package/dist/cli-bundle/chunks/{scheduling-shortcuts-X6D6VSZR.js → scheduling-shortcuts-HJMTEXKE.js} +14 -14
  172. package/dist/cli-bundle/chunks/{scheduling-shortcuts-4ION7QAX.js → scheduling-shortcuts-NNT5ASZR.js} +14 -14
  173. package/dist/cli-bundle/chunks/{schema-OA4RSVMI.js → schema-263RI4WW.js} +9 -9
  174. package/dist/cli-bundle/chunks/{schema-TA3NF3RG.js → schema-TZXW6XWD.js} +9 -9
  175. package/dist/cli-bundle/chunks/{search-INCM5I4J.js → search-LECJYSXE.js} +12 -12
  176. package/dist/cli-bundle/chunks/{search-UAIHEQZL.js → search-SFRJOVDG.js} +12 -12
  177. package/dist/cli-bundle/chunks/{stats-WQWTIA5Y.js → stats-N7ER2PNK.js} +8 -8
  178. package/dist/cli-bundle/chunks/{stats-RHEMG4CE.js → stats-VPBGSRQH.js} +8 -8
  179. package/dist/cli-bundle/chunks/{telemetry-G6UKGKJU.js → telemetry-L6K3BUIQ.js} +4 -4
  180. package/dist/cli-bundle/chunks/{telemetry-XA5D2QEO.js → telemetry-PP3FUNBU.js} +4 -4
  181. package/dist/cli-bundle/chunks/{test-ZMQF23P3.js → test-3EGNS3T5.js} +15 -15
  182. package/dist/cli-bundle/chunks/{test-XF7BYLMZ.js → test-RQCTSWUK.js} +15 -15
  183. package/dist/cli-bundle/chunks/{test-all-WUBBJCPU.js → test-all-NJ5V2QFS.js} +15 -15
  184. package/dist/cli-bundle/chunks/{test-all-ZNQBMUOI.js → test-all-ZHFAWNC3.js} +15 -15
  185. package/dist/cli-bundle/chunks/{test-runs-RFA42EEX.js → test-runs-AJHR6IQF.js} +5 -5
  186. package/dist/cli-bundle/chunks/{test-runs-N7LI7HLH.js → test-runs-GN3C6GOI.js} +5 -5
  187. package/dist/cli-bundle/chunks/update-6YXOGHRT.js +24 -0
  188. package/dist/cli-bundle/chunks/update-V33YUBRP.js +28 -0
  189. package/dist/cli-bundle/chunks/{update-many-NMRUQZL2.js → update-many-N2AN6ZDH.js} +23 -23
  190. package/dist/cli-bundle/chunks/{update-many-6XFR7TFG.js → update-many-RYQ64CFW.js} +23 -23
  191. package/dist/cli-bundle/chunks/{upgrade-EJTME2YQ.js → upgrade-TJXFLZIX.js} +5 -5
  192. package/dist/cli-bundle/chunks/{upgrade-QMCSONWR.js → upgrade-VPCIYAVW.js} +5 -5
  193. package/dist/cli-bundle/chunks/{validate-3SUCHXXX.js → validate-JMNWEUYF.js} +62 -24
  194. package/dist/cli-bundle/chunks/validate-JMNWEUYF.js.map +1 -0
  195. package/dist/cli-bundle/chunks/{validate-KIIJY5RC.js → validate-PHKIYGSY.js} +61 -23
  196. package/dist/cli-bundle/chunks/validate-PHKIYGSY.js.map +7 -0
  197. package/dist/cli-bundle/main.js +17 -17
  198. package/dist/core/diagnostics/remediation.js +23 -2
  199. package/dist/core/diagnostics/remediation.js.map +1 -1
  200. package/dist/core/item/item-format-version.d.ts +87 -0
  201. package/dist/core/item/item-format-version.js +85 -0
  202. package/dist/core/item/item-format-version.js.map +1 -0
  203. package/dist/core/item/item-format.js +8 -2
  204. package/dist/core/item/item-format.js.map +1 -1
  205. package/dist/core/shared/constants.js +3 -2
  206. package/dist/core/shared/constants.js.map +1 -1
  207. package/dist/sdk/index.d.ts +2 -2
  208. package/dist/sdk/index.js +3 -3
  209. package/dist/sdk/index.js.map +1 -1
  210. package/dist/sdk/runtime.d.ts +1 -0
  211. package/dist/sdk/runtime.js +3 -2
  212. package/dist/sdk/runtime.js.map +1 -1
  213. package/dist/sdk/testing.d.ts +48 -1
  214. package/dist/sdk/testing.js +98 -2
  215. package/dist/sdk/testing.js.map +1 -1
  216. package/dist/types.d.ts +7 -0
  217. package/dist/types.js +2 -2
  218. package/dist/types.js.map +1 -1
  219. package/docs/ARCHITECTURE.md +2 -0
  220. package/docs/COMMANDS.md +2 -0
  221. package/docs/SDK.md +71 -0
  222. package/package.json +1 -1
  223. package/packages/pm-command-kit/README.md +4 -0
  224. package/packages/pm-todos/extensions/todos/runtime.js +191 -8
  225. package/packages/pm-todos/extensions/todos/runtime.ts +207 -7
  226. package/dist/cli-bundle/chunks/activity-7G7NNNZQ.js +0 -18
  227. package/dist/cli-bundle/chunks/chunk-5MWA46UN.js.map +0 -7
  228. package/dist/cli-bundle/chunks/chunk-AZ75OVK4.js.map +0 -1
  229. package/dist/cli-bundle/chunks/chunk-FSOJCFDS.js.map +0 -1
  230. package/dist/cli-bundle/chunks/chunk-H3ZTSYPA.js.map +0 -7
  231. package/dist/cli-bundle/chunks/chunk-IWKD7B33.js.map +0 -7
  232. package/dist/cli-bundle/chunks/chunk-LTUB7ARL.js.map +0 -1
  233. package/dist/cli-bundle/chunks/chunk-OLEP5TJH.js.map +0 -1
  234. package/dist/cli-bundle/chunks/chunk-QWAJPGEI.js.map +0 -7
  235. package/dist/cli-bundle/chunks/close-NNZZTZ5V.js +0 -15
  236. package/dist/cli-bundle/chunks/create-4KOAQ6ME.js +0 -30
  237. package/dist/cli-bundle/chunks/health-C2PUT6JZ.js.map +0 -1
  238. package/dist/cli-bundle/chunks/health-PBJS7W2T.js.map +0 -7
  239. package/dist/cli-bundle/chunks/history-ZXNWG6H4.js +0 -20
  240. package/dist/cli-bundle/chunks/history-redact-GV633Z4H.js +0 -21
  241. package/dist/cli-bundle/chunks/init-KQWZSNBX.js +0 -20
  242. package/dist/cli-bundle/chunks/restore-GKM26SAW.js +0 -19
  243. package/dist/cli-bundle/chunks/update-CPNOG73P.js +0 -24
  244. package/dist/cli-bundle/chunks/update-T5AYT6ZN.js +0 -28
  245. package/dist/cli-bundle/chunks/validate-3SUCHXXX.js.map +0 -1
  246. package/dist/cli-bundle/chunks/validate-KIIJY5RC.js.map +0 -7
  247. /package/dist/cli-bundle/chunks/{activity-7G7NNNZQ.js.map → activity-CIHV64UC.js.map} +0 -0
  248. /package/dist/cli-bundle/chunks/{activity-KEEITOTB.js.map → activity-KW3IRP44.js.map} +0 -0
  249. /package/dist/cli-bundle/chunks/{aggregate-GB2LJNTZ.js.map → aggregate-3ZKQG5SW.js.map} +0 -0
  250. /package/dist/cli-bundle/chunks/{aggregate-5BTHOHW2.js.map → aggregate-FIGQEIL3.js.map} +0 -0
  251. /package/dist/cli-bundle/chunks/{append-BBM4MNVD.js.map → append-EWJYJ7CH.js.map} +0 -0
  252. /package/dist/cli-bundle/chunks/{append-BFV5UYWS.js.map → append-QEOLX3XB.js.map} +0 -0
  253. /package/dist/cli-bundle/chunks/{chunk-RICT5QYR.js.map → chunk-2EIMPCE4.js.map} +0 -0
  254. /package/dist/cli-bundle/chunks/{chunk-ZYG4TR32.js.map → chunk-2GCDRRIF.js.map} +0 -0
  255. /package/dist/cli-bundle/chunks/{chunk-DYOJJTCG.js.map → chunk-2PKHRP6G.js.map} +0 -0
  256. /package/dist/cli-bundle/chunks/{chunk-HWHZ7EY7.js.map → chunk-37QXHBIB.js.map} +0 -0
  257. /package/dist/cli-bundle/chunks/{chunk-ACULWT7G.js.map → chunk-3EWSGA7N.js.map} +0 -0
  258. /package/dist/cli-bundle/chunks/{chunk-II4BRHKM.js.map → chunk-3MDHREEV.js.map} +0 -0
  259. /package/dist/cli-bundle/chunks/{chunk-E4E7UQBT.js.map → chunk-52OCIDPG.js.map} +0 -0
  260. /package/dist/cli-bundle/chunks/{chunk-FA5O2DEG.js.map → chunk-5FIEHKEX.js.map} +0 -0
  261. /package/dist/cli-bundle/chunks/{chunk-2QJLN4KM.js.map → chunk-5IDI42VV.js.map} +0 -0
  262. /package/dist/cli-bundle/chunks/{chunk-2LUNPA3U.js.map → chunk-5QICDWMV.js.map} +0 -0
  263. /package/dist/cli-bundle/chunks/{chunk-EOFROIC5.js.map → chunk-6CJWZAN7.js.map} +0 -0
  264. /package/dist/cli-bundle/chunks/{chunk-3KVCMB2M.js.map → chunk-6H4LF7AO.js.map} +0 -0
  265. /package/dist/cli-bundle/chunks/{chunk-6DZO5NN7.js.map → chunk-6M4RJS4M.js.map} +0 -0
  266. /package/dist/cli-bundle/chunks/{chunk-WFOITX4A.js.map → chunk-6ZXM2XNF.js.map} +0 -0
  267. /package/dist/cli-bundle/chunks/{chunk-AW4PYYNF.js.map → chunk-76Z3YSHV.js.map} +0 -0
  268. /package/dist/cli-bundle/chunks/{chunk-ZHCSGIUX.js.map → chunk-7D3SAQXM.js.map} +0 -0
  269. /package/dist/cli-bundle/chunks/{chunk-MFCFHL27.js.map → chunk-A4Z7ZOL5.js.map} +0 -0
  270. /package/dist/cli-bundle/chunks/{chunk-F4EYOSNC.js.map → chunk-AIS5PGI3.js.map} +0 -0
  271. /package/dist/cli-bundle/chunks/{chunk-BYNJWB5F.js.map → chunk-AZMOLBN3.js.map} +0 -0
  272. /package/dist/cli-bundle/chunks/{chunk-VE3BUO3R.js.map → chunk-B473GZWW.js.map} +0 -0
  273. /package/dist/cli-bundle/chunks/{chunk-W2ZESOQE.js.map → chunk-C3AZ5ZML.js.map} +0 -0
  274. /package/dist/cli-bundle/chunks/{chunk-CNPWCUDR.js.map → chunk-C4N5I7ZW.js.map} +0 -0
  275. /package/dist/cli-bundle/chunks/{chunk-DKWIPIJY.js.map → chunk-CF55WVVS.js.map} +0 -0
  276. /package/dist/cli-bundle/chunks/{chunk-YBQF4CAW.js.map → chunk-CZPXY7UW.js.map} +0 -0
  277. /package/dist/cli-bundle/chunks/{chunk-6KARQMC6.js.map → chunk-CZUB4XWO.js.map} +0 -0
  278. /package/dist/cli-bundle/chunks/{chunk-K2LBDYDC.js.map → chunk-D7FYS6PG.js.map} +0 -0
  279. /package/dist/cli-bundle/chunks/{chunk-X3CD2VUI.js.map → chunk-EBH56IXK.js.map} +0 -0
  280. /package/dist/cli-bundle/chunks/{chunk-5XK2RYJR.js.map → chunk-F5NZWFSW.js.map} +0 -0
  281. /package/dist/cli-bundle/chunks/{chunk-BZWIDTDE.js.map → chunk-F7K5GWP3.js.map} +0 -0
  282. /package/dist/cli-bundle/chunks/{chunk-4KFL5OYK.js.map → chunk-FKBDKV7Y.js.map} +0 -0
  283. /package/dist/cli-bundle/chunks/{chunk-XNQ3YH6N.js.map → chunk-FRUFKWNK.js.map} +0 -0
  284. /package/dist/cli-bundle/chunks/{chunk-ICEWMJYH.js.map → chunk-FWPDUYEY.js.map} +0 -0
  285. /package/dist/cli-bundle/chunks/{chunk-2ZY5SLNR.js.map → chunk-GMHPNNYG.js.map} +0 -0
  286. /package/dist/cli-bundle/chunks/{chunk-U3WTMYBX.js.map → chunk-GOZUHWFD.js.map} +0 -0
  287. /package/dist/cli-bundle/chunks/{chunk-ATRXPXAL.js.map → chunk-H7NJZWG2.js.map} +0 -0
  288. /package/dist/cli-bundle/chunks/{chunk-VONJSFUW.js.map → chunk-HC4AWIKT.js.map} +0 -0
  289. /package/dist/cli-bundle/chunks/{chunk-PF5GLFPU.js.map → chunk-HCU6WUSY.js.map} +0 -0
  290. /package/dist/cli-bundle/chunks/{chunk-NKTUBA2C.js.map → chunk-HIP7WVTL.js.map} +0 -0
  291. /package/dist/cli-bundle/chunks/{chunk-RADIHKJ3.js.map → chunk-J4MYYSOL.js.map} +0 -0
  292. /package/dist/cli-bundle/chunks/{chunk-OVSFW4KD.js.map → chunk-LUWW7L4B.js.map} +0 -0
  293. /package/dist/cli-bundle/chunks/{chunk-6KSFULO6.js.map → chunk-M5XALUSL.js.map} +0 -0
  294. /package/dist/cli-bundle/chunks/{chunk-BBSUVIIT.js.map → chunk-N5ZJACJ6.js.map} +0 -0
  295. /package/dist/cli-bundle/chunks/{chunk-ETJKPURB.js.map → chunk-NB3PYLQ6.js.map} +0 -0
  296. /package/dist/cli-bundle/chunks/{chunk-7MMXBIRZ.js.map → chunk-NIGXMNNI.js.map} +0 -0
  297. /package/dist/cli-bundle/chunks/{chunk-XKJDCJEH.js.map → chunk-NIUEXCFS.js.map} +0 -0
  298. /package/dist/cli-bundle/chunks/{chunk-RNKUCHUQ.js.map → chunk-NJHMAJ6N.js.map} +0 -0
  299. /package/dist/cli-bundle/chunks/{chunk-AOCYDQLT.js.map → chunk-NJN7LL7U.js.map} +0 -0
  300. /package/dist/cli-bundle/chunks/{chunk-MTQK5ZSB.js.map → chunk-NSBZ2CKF.js.map} +0 -0
  301. /package/dist/cli-bundle/chunks/{chunk-26OQTCGH.js.map → chunk-NXS7ZKAK.js.map} +0 -0
  302. /package/dist/cli-bundle/chunks/{chunk-6LTSLEHD.js.map → chunk-O47BPOPC.js.map} +0 -0
  303. /package/dist/cli-bundle/chunks/{chunk-6Y7IQ6XN.js.map → chunk-OFYMIDF2.js.map} +0 -0
  304. /package/dist/cli-bundle/chunks/{chunk-4YMX7XFI.js.map → chunk-OTHIWLMB.js.map} +0 -0
  305. /package/dist/cli-bundle/chunks/{chunk-QUTJOHGK.js.map → chunk-PFSRUHDH.js.map} +0 -0
  306. /package/dist/cli-bundle/chunks/{chunk-FXKPUMIR.js.map → chunk-PP2U4NMT.js.map} +0 -0
  307. /package/dist/cli-bundle/chunks/{chunk-XXGAWTH5.js.map → chunk-PUH4D67U.js.map} +0 -0
  308. /package/dist/cli-bundle/chunks/{chunk-NCGQ27PK.js.map → chunk-Q2J2HJUN.js.map} +0 -0
  309. /package/dist/cli-bundle/chunks/{chunk-J7VSEFWB.js.map → chunk-QQHISQBJ.js.map} +0 -0
  310. /package/dist/cli-bundle/chunks/{chunk-KCJZREBI.js.map → chunk-QZTWBFXJ.js.map} +0 -0
  311. /package/dist/cli-bundle/chunks/{chunk-NMQNXH4U.js.map → chunk-RLK7P77C.js.map} +0 -0
  312. /package/dist/cli-bundle/chunks/{chunk-FBBPCSJM.js.map → chunk-RVHYI7SL.js.map} +0 -0
  313. /package/dist/cli-bundle/chunks/{chunk-3WAKNI2W.js.map → chunk-SBGXDO7A.js.map} +0 -0
  314. /package/dist/cli-bundle/chunks/{chunk-6FSPWUBI.js.map → chunk-SRYYRVPB.js.map} +0 -0
  315. /package/dist/cli-bundle/chunks/{chunk-SL233DQD.js.map → chunk-SX75ADBK.js.map} +0 -0
  316. /package/dist/cli-bundle/chunks/{chunk-YT4Z2OVB.js.map → chunk-TKBHZPKD.js.map} +0 -0
  317. /package/dist/cli-bundle/chunks/{chunk-EKMHDL6Z.js.map → chunk-UEMNL33O.js.map} +0 -0
  318. /package/dist/cli-bundle/chunks/{chunk-4S4INK3B.js.map → chunk-UPE3CDD7.js.map} +0 -0
  319. /package/dist/cli-bundle/chunks/{chunk-4PW4C3ZB.js.map → chunk-UV6IYE5U.js.map} +0 -0
  320. /package/dist/cli-bundle/chunks/{chunk-GF44HVZL.js.map → chunk-WQ7NIVDK.js.map} +0 -0
  321. /package/dist/cli-bundle/chunks/{chunk-B3LROPTV.js.map → chunk-YCJX76PW.js.map} +0 -0
  322. /package/dist/cli-bundle/chunks/{chunk-WMQBNVZL.js.map → chunk-Z6T4PQI2.js.map} +0 -0
  323. /package/dist/cli-bundle/chunks/{claim-G57ZJLZ4.js.map → claim-RC56YUWG.js.map} +0 -0
  324. /package/dist/cli-bundle/chunks/{claim-TRSDQO6L.js.map → claim-THOJ6CMV.js.map} +0 -0
  325. /package/dist/cli-bundle/chunks/{close-NNZZTZ5V.js.map → close-DNMHGOCX.js.map} +0 -0
  326. /package/dist/cli-bundle/chunks/{close-4QMUQMON.js.map → close-SG5MNCVQ.js.map} +0 -0
  327. /package/dist/cli-bundle/chunks/{close-many-A7U62CRI.js.map → close-many-3L3AQZBU.js.map} +0 -0
  328. /package/dist/cli-bundle/chunks/{close-many-3UWKJRQK.js.map → close-many-DKQLBGLV.js.map} +0 -0
  329. /package/dist/cli-bundle/chunks/{comments-4EM7XR74.js.map → comments-M7ZOZNBX.js.map} +0 -0
  330. /package/dist/cli-bundle/chunks/{comments-URWDZP2I.js.map → comments-SKWMDWCW.js.map} +0 -0
  331. /package/dist/cli-bundle/chunks/{config-GRJYZ2O3.js.map → config-7CK62S7T.js.map} +0 -0
  332. /package/dist/cli-bundle/chunks/{config-PSZ5GWAK.js.map → config-OZCUABPB.js.map} +0 -0
  333. /package/dist/cli-bundle/chunks/{context-A46YAV2F.js.map → context-OEC366TO.js.map} +0 -0
  334. /package/dist/cli-bundle/chunks/{context-BCR34RKM.js.map → context-PUG2A7RC.js.map} +0 -0
  335. /package/dist/cli-bundle/chunks/{contracts-JOPCQNDP.js.map → contracts-3THOLA7L.js.map} +0 -0
  336. /package/dist/cli-bundle/chunks/{contracts-HPT25X4D.js.map → contracts-N65FXEOL.js.map} +0 -0
  337. /package/dist/cli-bundle/chunks/{copy-X7V6AEDB.js.map → copy-6QLHILAC.js.map} +0 -0
  338. /package/dist/cli-bundle/chunks/{copy-KBTIUW7L.js.map → copy-JPX7VZCH.js.map} +0 -0
  339. /package/dist/cli-bundle/chunks/{create-4KOAQ6ME.js.map → create-NNP6TSFO.js.map} +0 -0
  340. /package/dist/cli-bundle/chunks/{create-ZPZKJDFQ.js.map → create-Y54ZVVZH.js.map} +0 -0
  341. /package/dist/cli-bundle/chunks/{delete-FGKVPUQZ.js.map → delete-63PCMQAJ.js.map} +0 -0
  342. /package/dist/cli-bundle/chunks/{delete-2ZI6CJZM.js.map → delete-GDSMGAGJ.js.map} +0 -0
  343. /package/dist/cli-bundle/chunks/{deps-IUJOBF2H.js.map → deps-T4ZF5G54.js.map} +0 -0
  344. /package/dist/cli-bundle/chunks/{deps-SJCEFU3C.js.map → deps-XYQ73XRH.js.map} +0 -0
  345. /package/dist/cli-bundle/chunks/{docs-UWJ75CKR.js.map → docs-C75YIXHC.js.map} +0 -0
  346. /package/dist/cli-bundle/chunks/{docs-2LXF5SVC.js.map → docs-EHNPDWUL.js.map} +0 -0
  347. /package/dist/cli-bundle/chunks/{eval-FRIDCTM2.js.map → eval-3WKDTRMH.js.map} +0 -0
  348. /package/dist/cli-bundle/chunks/{eval-ZTT3F3SL.js.map → eval-GTENKE24.js.map} +0 -0
  349. /package/dist/cli-bundle/chunks/{extension-VRYTNNSV.js.map → extension-46NWACO3.js.map} +0 -0
  350. /package/dist/cli-bundle/chunks/{extension-XFQG3BXL.js.map → extension-D5FDZ2CO.js.map} +0 -0
  351. /package/dist/cli-bundle/chunks/{files-B2RUCA32.js.map → files-DSZBOSSN.js.map} +0 -0
  352. /package/dist/cli-bundle/chunks/{files-AJOGTTAN.js.map → files-X3H7CCBQ.js.map} +0 -0
  353. /package/dist/cli-bundle/chunks/{focus-7N36RIMT.js.map → focus-5STQXDPU.js.map} +0 -0
  354. /package/dist/cli-bundle/chunks/{focus-CFE33IYC.js.map → focus-MDVPOWB5.js.map} +0 -0
  355. /package/dist/cli-bundle/chunks/{gc-OYJK4YBY.js.map → gc-ZC7JHBG7.js.map} +0 -0
  356. /package/dist/cli-bundle/chunks/{gc-SBF2FGHK.js.map → gc-ZMST3WQP.js.map} +0 -0
  357. /package/dist/cli-bundle/chunks/{get-577VLZZ7.js.map → get-J2IPJRZW.js.map} +0 -0
  358. /package/dist/cli-bundle/chunks/{get-LLFWSPXW.js.map → get-NT7L2HUZ.js.map} +0 -0
  359. /package/dist/cli-bundle/chunks/{history-4FJK6Y3O.js.map → history-RLH2QCRO.js.map} +0 -0
  360. /package/dist/cli-bundle/chunks/{history-ZXNWG6H4.js.map → history-WX3MGFS2.js.map} +0 -0
  361. /package/dist/cli-bundle/chunks/{history-compact-HXF3OT7G.js.map → history-compact-UXDIFC33.js.map} +0 -0
  362. /package/dist/cli-bundle/chunks/{history-compact-AXR6R6GU.js.map → history-compact-ZBEBGJM7.js.map} +0 -0
  363. /package/dist/cli-bundle/chunks/{history-redact-UMPD4G3K.js.map → history-redact-P7I7AWMB.js.map} +0 -0
  364. /package/dist/cli-bundle/chunks/{history-redact-GV633Z4H.js.map → history-redact-YQGU3XRA.js.map} +0 -0
  365. /package/dist/cli-bundle/chunks/{history-repair-WHOK2ICG.js.map → history-repair-52KINVIK.js.map} +0 -0
  366. /package/dist/cli-bundle/chunks/{history-repair-X57HE5EA.js.map → history-repair-RM5ITLU5.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{init-N7MIIYCU.js.map → init-2BNZOO6F.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{init-KQWZSNBX.js.map → init-SC2P6CHP.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{learnings-GZRBIEAN.js.map → learnings-W6F3FIPL.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{learnings-FPG7WAVW.js.map → learnings-YGYVHWJK.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{list-MZBCSKLU.js.map → list-K6FPV4J4.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{list-ZDQ2OBSO.js.map → list-KPAYU5KZ.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{notes-WQAP67EC.js.map → notes-PU74EPKV.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{notes-LW53PFLH.js.map → notes-YTD6ZILW.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{plan-AVJ4VJQO.js.map → plan-FNXHXRCI.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{plan-VZKICKIJ.js.map → plan-GEQYUCBW.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{register-list-query-CM4SVAQA.js.map → register-list-query-PHWYHENI.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{register-list-query-7BD6ZHU5.js.map → register-list-query-QI45RMKN.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{register-mutation-PLFHAS4N.js.map → register-mutation-X3BUOQEL.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{register-mutation-ANZIWHUF.js.map → register-mutation-YINRTS7L.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{register-operations-KQPQIFF2.js.map → register-operations-E5JEASRK.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{register-operations-VLGCAWIW.js.map → register-operations-MIDTRW7S.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{register-setup-TMEF6V7O.js.map → register-setup-DYBFLEZX.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{register-setup-KPTZ36D4.js.map → register-setup-EG2U6CEU.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{restore-GKM26SAW.js.map → restore-5KHR2YYQ.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{restore-64JKQV7G.js.map → restore-XQYSWBV7.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-X6D6VSZR.js.map → scheduling-shortcuts-HJMTEXKE.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-4ION7QAX.js.map → scheduling-shortcuts-NNT5ASZR.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{schema-OA4RSVMI.js.map → schema-263RI4WW.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{schema-TA3NF3RG.js.map → schema-TZXW6XWD.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{search-INCM5I4J.js.map → search-LECJYSXE.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{search-UAIHEQZL.js.map → search-SFRJOVDG.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{stats-WQWTIA5Y.js.map → stats-N7ER2PNK.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{stats-RHEMG4CE.js.map → stats-VPBGSRQH.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{telemetry-G6UKGKJU.js.map → telemetry-L6K3BUIQ.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{telemetry-XA5D2QEO.js.map → telemetry-PP3FUNBU.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{test-ZMQF23P3.js.map → test-3EGNS3T5.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{test-XF7BYLMZ.js.map → test-RQCTSWUK.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{test-all-WUBBJCPU.js.map → test-all-NJ5V2QFS.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{test-all-ZNQBMUOI.js.map → test-all-ZHFAWNC3.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{test-runs-RFA42EEX.js.map → test-runs-AJHR6IQF.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{test-runs-N7LI7HLH.js.map → test-runs-GN3C6GOI.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{update-CPNOG73P.js.map → update-6YXOGHRT.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{update-T5AYT6ZN.js.map → update-V33YUBRP.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{update-many-NMRUQZL2.js.map → update-many-N2AN6ZDH.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{update-many-6XFR7TFG.js.map → update-many-RYQ64CFW.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{upgrade-EJTME2YQ.js.map → upgrade-TJXFLZIX.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{upgrade-QMCSONWR.js.map → upgrade-VPCIYAVW.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"remediation.js","sources":["core/diagnostics/remediation.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Shared machine-executable remediation registry.\n *\n * `pm health` and `pm validate` both emit stable, colon-delimited warning tokens\n * (for example `history_drift_missing_stream:pm-abcd` or\n * `validate_resolution_missing_fields:3`). Agents that gate on these commands\n * previously had to hardcode the mapping from a warning code to the `pm` command\n * that fixes it. This module is the single source of truth for that mapping so\n * `pm health --json` (per-check `remediation_map`) and `pm validate --fix-hints`\n * (per-check `fix_hints`) can both surface executable remediation without any\n * duplicated, drift-prone lookup tables.\n *\n * Semantics of {@link RemediationEntry.command}: the suggested next `pm` command\n * an operator/agent should run to resolve findings with that code. Per-item\n * findings use an `<id>` placeholder (callers that have the concrete id may\n * substitute it); findings whose only fix is a manual file edit point at the\n * most useful diagnostic/repair command and describe the manual step in\n * {@link RemediationEntry.summary}.\n */\n\n/** Maps a stable diagnostic warning code to the command and summary that resolve it. */\nexport interface RemediationEntry {\n /**\n * Stable warning-code prefix this entry resolves. A warning matches when it\n * equals this code or begins with `<code>:`. Registry codes are mutually\n * exclusive under that colon-boundary rule (no code is a `:`-delimited prefix\n * of another — e.g. `settings:id_prefix_empty` is distinct from a bare\n * `settings`, which is intentionally not registered), so `resolveRemediation`\n * uses first-match with no ordering dependency.\n */\n readonly code: string;\n /** Executable `pm` command (or imperative) that resolves the finding. May contain an `<id>` placeholder. */\n readonly command: string;\n /** One-line description of what the command does / which manual step it covers. */\n readonly summary: string;\n}\n\n/**\n * Registry of every non-extension `pm health` / `pm validate` warning code and\n * its remediation. Extension findings keep their richer, contextual\n * `details.triage.remediation` produced by the extension health triage and are\n * intentionally excluded here (see pm-0hnu: \"all non-extension checks\").\n */\nexport const REMEDIATION_REGISTRY: readonly RemediationEntry[] = Object.freeze([\n // --- pm health: directories ---\n {\n code: \"missing_directory\",\n command: \"pm init\",\n summary: \"Recreate missing tracker directories (pm init is idempotent and restores the scaffold).\",\n },\n // --- pm health: settings (read/parse) ---\n {\n code: \"settings_read_invalid_json\",\n command: \"pm config list --json\",\n summary:\n \"settings.json is not valid JSON and pm fell back to defaults; fix the syntax error in the reported path, then re-run.\",\n },\n {\n code: \"settings_read_invalid_schema\",\n command: \"pm config list --json\",\n summary:\n \"settings.json failed schema validation and pm fell back to defaults; correct the reported key in the file, then re-run.\",\n },\n {\n code: \"settings_read_merge_failed\",\n command: \"pm config list --json\",\n summary: \"Global/project settings could not be merged; reconcile the conflicting keys in the reported settings files.\",\n },\n // --- pm health: settings_values ---\n {\n code: \"settings:id_prefix_empty\",\n command: \"pm config list --json\",\n summary: 'id_prefix is empty; set a non-empty \"id_prefix\" in settings.json so generated item ids are well-formed.',\n },\n {\n code: \"settings:locks_ttl_non_positive\",\n command: \"pm config list --json\",\n summary: 'locks.ttl_seconds must be positive; set a positive \"locks.ttl_seconds\" in settings.json.',\n },\n // --- pm health: telemetry (advisory) ---\n {\n code: \"telemetry_state_invalid_json\",\n command: \"pm health --check-telemetry\",\n summary: \"Local telemetry state file is corrupt; pm recreates it on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_invalid_rows\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry queue has unparseable rows; they are skipped on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_pending\",\n command: \"pm health --check-telemetry\",\n summary: \"Telemetry events are queued; they flush automatically on the next reachable command. Advisory only.\",\n },\n {\n code: \"telemetry_queue_high_retries\",\n command: \"pm telemetry flush\",\n summary:\n \"Some queued telemetry events are near retry exhaustion; flush now and verify endpoint reachability before entries are dropped.\",\n },\n {\n code: \"telemetry_endpoint_probe_failed\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry endpoint is unreachable; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_endpoint_probe_http_status\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry endpoint returned a non-success status; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_schema_version_behind\",\n command: \"pm health --check-telemetry\",\n summary: \"Client schema is behind server; upgrade pm-cli to emit the latest event shape.\",\n },\n {\n code: \"telemetry_otel_export_failing\",\n command: \"pm health --check-telemetry\",\n summary:\n \"OTLP trace spans are queued but the traces endpoint export is failing; spans retry automatically on the next reachable command, or set PM_TELEMETRY_OTEL_DISABLED=1 to skip OTLP export. Advisory only.\",\n },\n // --- pm health: integrity ---\n {\n code: \"integrity_item_unreadable\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file could not be read; restore or repair the file at the reported path.\",\n },\n {\n code: \"integrity_item_parse_failed\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file failed to parse; fix the malformed front matter at the reported path.\",\n },\n {\n code: \"integrity_item_conflict_marker\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file contains Git conflict markers; resolve the <<<<<<< / >>>>>>> markers at the reported line.\",\n },\n {\n code: \"integrity_history_unreadable\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream could not be read; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_invalid_json\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream contains invalid JSON; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_conflict_marker\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream contains Git conflict markers; resolve the markers, then re-anchor the chain.\",\n },\n // --- pm health: history_drift ---\n // `pm health` rewrites these commands to `pm history-repair --all` in the\n // per-check remediation_map when more than one stream is drifted.\n {\n code: \"history_drift_missing_stream\",\n command: \"pm history-repair <id>\",\n summary: \"The item has no history stream; re-anchor the chain to rebuild it (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_unreadable_stream\",\n command: \"pm history-repair <id>\",\n summary: \"The item's history stream is unreadable; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_hash_mismatch\",\n command: \"pm history-repair <id>\",\n summary: \"The item's content hash no longer matches its history; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_chain_mismatch\",\n command: \"pm history-repair <id>\",\n summary: \"The item's history chain is broken; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n // --- pm health: storage (history compaction policy) ---\n {\n code: \"history_stream_over_compact_threshold\",\n command: \"pm history-compact <id>\",\n summary: \"The history stream exceeds the configured compaction threshold; compact it (pm history-compact --all-streams sweeps every over-threshold stream in one pass).\",\n },\n // --- pm health: locks ---\n {\n code: \"locks_stale_count\",\n command: \"pm gc --scope locks\",\n summary:\n \"Stale item-claim locks (embedded ttl elapsed) can block mutations; sweep them — gc retains active and unparseable locks.\",\n },\n {\n code: \"locks_unreadable\",\n command: \"pm gc --scope locks --dry-run\",\n summary:\n \"Some lock files could not be read; preview the sweep and inspect the unreadable files manually — gc never deletes what it cannot read.\",\n },\n // --- pm health: extensions ---\n // Most extension findings keep their richer, contextual\n // `details.triage.remediation` and are intentionally absent here. The\n // partial-coverage code is the exception: it is not a per-extension triage\n // result but a system-wide adoption gap (unmanaged installs the update-health\n // scan had to skip), so it has a single deterministic fix and belongs in the\n // shared registry like any other health finding (pm-bdvm).\n {\n code: \"extension_update_health_partial_coverage\",\n command: \"pm extension --adopt-all --project\",\n summary:\n \"Update-health coverage is partial because unmanaged extensions were skipped; adopt the existing installs into managed metadata so the update scan covers them (use --global for global-scope extensions, or pm package --adopt-all when working with packages).\",\n },\n // --- pm health: vectorization ---\n {\n code: \"vectorization_stale_items_remaining\",\n command: \"pm health --refresh-vectors\",\n summary: \"Some items have stale embeddings; refresh vectors so semantic search results stay current.\",\n },\n {\n code: \"vectorization_embedding_identity_changed\",\n command: \"pm reindex --mode semantic\",\n summary: \"Embedding provider/model changed since the last index; run a semantic reindex to rebuild vectors.\",\n },\n // --- pm validate: metadata ---\n // Note: validate_metadata_missing_author has no entry on purpose. `pm update\n // --author` sets the mutation/audit author (history), not the item's\n // `metadata.author` front-matter field, and there is no CLI flag that writes\n // that field — so emitting a command here would record an audit entry without\n // clearing the finding. A missing item author must be restored at the source.\n {\n code: \"validate_metadata_missing_acceptance_criteria\",\n command: 'pm update <id> --acceptance-criteria \"<criteria>\"',\n summary: \"Backfill the missing acceptance criteria on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_estimate\",\n command: 'pm update <id> --estimate \"<estimate>\"',\n summary: \"Backfill the missing estimate on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_close_reason\",\n command: 'pm update <id> --close-reason \"<reason>\"',\n summary: \"Backfill the missing close reason on the reported closed item(s).\",\n },\n {\n code: \"validate_metadata_missing_reviewer\",\n command: 'pm update <id> --reviewer \"<name>\"',\n summary: \"Backfill the missing reviewer on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_risk\",\n command: 'pm update <id> --risk \"<level>\"',\n summary: \"Backfill the missing risk on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_confidence\",\n command: 'pm update <id> --confidence \"<level>\"',\n summary: \"Backfill the missing confidence on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_sprint\",\n command: 'pm update <id> --sprint \"<sprint>\"',\n summary: \"Backfill the missing sprint on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_release\",\n command: 'pm update <id> --release \"<release>\"',\n summary: \"Backfill the missing release on the reported item(s).\",\n },\n {\n code: \"validate_metadata_custom_profile_missing_required_fields\",\n command: 'pm config set metadata-required-fields --criterion \"<field>\"',\n summary:\n \"Config-driven finding: the custom metadata profile has no required fields configured and falls back to core, so configure the fields rather than mutating items.\",\n },\n {\n code: \"validate_metadata_duplicate_issue_codes\",\n command: 'pm update <id> --title \"<distinct title>\"',\n summary:\n \"Two or more items share one logical issue code (GH-235); give each a distinct title so the derived code is unique, or close the redundant item with pm close <id> --duplicate-of <canonical-id> (closed-as-duplicate items are excluded from the check).\",\n },\n // --- pm validate: resolution ---\n {\n code: \"validate_resolution_missing_fields\",\n command: 'pm update <id> --resolution \"<how resolved>\"',\n summary: \"Backfill resolution / expected_result / actual_result on the reported closed item(s).\",\n },\n // --- pm validate: lifecycle ---\n {\n code: \"validate_lifecycle_active_closure_like_metadata\",\n command: \"pm update <id> --unset <closure-like-field>\",\n summary:\n \"Clear the closure-like field the validator flags on this active item — the detail row names it (resolution / actual-result / blocked-reason) — or close the item if it is actually done.\",\n },\n {\n code: \"validate_lifecycle_active_terminal_parent\",\n command: \"pm update <id> --parent <active-parent-id>\",\n summary: \"Reopen the terminal parent or move the active child under a non-terminal parent.\",\n },\n {\n code: \"validate_lifecycle_stale_blockers\",\n command: \"pm update <id> --unset blocked-by --unset blocked-reason\",\n summary:\n \"Resolve the stale blocker the validator flags: clear blocked-by/blocked-reason when they linger on a non-blocked item or report a resolved blocker; if instead a blocked item is missing blocker context, add the context or move it out of a blocked status.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles_error\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary: \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary: \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n {\n code: \"validate_hierarchy_parent_cycle_error\",\n command: \"pm update <id> --parent <other-id>\",\n summary:\n \"Break the parent-hierarchy cycle by reparenting one item in the reported cycle to a non-cyclic parent (or clear it with pm update <id> --unset parent).\",\n },\n {\n code: \"validate_hierarchy_parent_cycle\",\n command: \"pm update <id> --parent <other-id>\",\n summary:\n \"Break the parent-hierarchy cycle by reparenting one item in the reported cycle to a non-cyclic parent (or clear it with pm update <id> --unset parent).\",\n },\n // --- pm validate: files ---\n {\n code: \"validate_files_missing_linked_paths\",\n command: \"pm <files|docs> <id> --remove <path>\",\n summary:\n \"The check spans both item.files and item.docs under one code: restore the missing linked artifact, or unlink it with pm files (linked file) or pm docs (linked doc).\",\n },\n {\n code: \"validate_files_orphaned_paths\",\n command: \"pm <files|docs> <id> --add <path>\",\n summary:\n \"Link the orphaned artifact with pm files (file) or pm docs (doc), or remove it from the workspace.\",\n },\n {\n code: \"validate_files_tracked_all_strict_forces_pm_internals\",\n command: \"pm validate --check-files --include-pm-internals\",\n summary: \"tracked-all-strict scan flagged pm internals; re-run with --include-pm-internals or a softer --scan-mode.\",\n },\n // --- pm validate: history_drift ---\n {\n code: \"validate_history_drift_missing_streams\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items missing a history stream.\",\n },\n {\n code: \"validate_history_drift_unreadable_streams\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items with an unreadable history stream.\",\n },\n {\n code: \"validate_history_drift_hash_mismatches\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items whose content hash drifted.\",\n },\n {\n code: \"validate_history_drift_chain_mismatches\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items with a broken history chain.\",\n },\n // --- pm validate: command_references ---\n {\n code: \"validate_command_references_stale_pm_ids\",\n command: 'pm update <id> --replace-tests --test \"command=<corrected-command>\" [--test ...]',\n summary:\n \"Correct the stale pm-ID inside the item's linked test command (the check scans tests[].command, not the body). --replace-tests overwrites the entire tests list, so re-include the item's other linked tests in the same call.\",\n },\n]);\n\n/**\n * Resolve the remediation entry for a warning token, or `undefined` when no\n * entry is registered. A warning matches an entry when it equals the entry code\n * or begins with `<code>:` (the colon boundary keeps sibling codes such as\n * `validate_lifecycle_dependency_cycles` and\n * `validate_lifecycle_dependency_cycles_error` disjoint).\n *\n * First match is intentional and correct: registry codes are mutually exclusive\n * under the colon-boundary rule, so at most one entry can ever match a warning\n * and order is irrelevant. That invariant is enforced by a test (see\n * remediation-registry.spec.ts \"keeps every registry code mutually exclusive\"),\n * which is why this stays a simple linear scan rather than a longest-prefix\n * search — a longest-prefix tie-break is unreachable with disjoint codes.\n *\n * Accepts unknown input defensively (this is an exported helper SDK consumers\n * may call from untyped JS): a non-string `warning` resolves to `undefined`.\n */\nexport function resolveRemediation(warning: string): RemediationEntry | undefined {\n if (typeof warning !== \"string\") {\n return undefined;\n }\n const normalized = warning.trim();\n for (const entry of REMEDIATION_REGISTRY) {\n if (normalized === entry.code || normalized.startsWith(`${entry.code}:`)) {\n return entry;\n }\n }\n return undefined;\n}\n\n/**\n * Build a compact `remediation_map` (code -> command) for a set of warning\n * tokens. First match wins per code; unknown codes are skipped. Used by\n * `pm health --json` per-check details and as the source of deduped executable\n * commands for `pm validate --fix-hints`.\n */\nexport function buildRemediationMap(warnings: Iterable<string>): Record<string, string> {\n const map: Record<string, string> = {};\n for (const warning of warnings) {\n const entry = resolveRemediation(warning);\n if (entry !== undefined && !Object.prototype.hasOwnProperty.call(map, entry.code)) {\n map[entry.code] = entry.command;\n }\n }\n return map;\n}\n\n/**\n * Build a deduped, ordered list of executable remediation commands for a set of\n * warning tokens (one command per distinct matched code). Used by\n * `pm validate --fix-hints` for checks that do not already emit per-row\n * remediation commands.\n */\nexport function buildRemediationCommands(warnings: Iterable<string>): string[] {\n return Object.values(buildRemediationMap(warnings));\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAmBH;;;;;GAKG;;;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAgC,MAAM,CAAC,MAAM,CAAC;IAC7E,iCAAiC;IACjC;QACE,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,yFAAyF;KACnG;IACD,2CAA2C;IAC3C;QACE,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EACL,uHAAuH;KAC1H;IACD;QACE,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EACL,yHAAyH;KAC5H;IACD;QACE,IAAI,EAA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0B;IACjE,OAAO,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC","debugId":"18ec090a-cfc4-5acf-90b6-7e6fade40d8d"}
1
+ {"version":3,"file":"remediation.js","sources":["core/diagnostics/remediation.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Shared machine-executable remediation registry.\n *\n * `pm health` and `pm validate` both emit stable, colon-delimited warning tokens\n * (for example `history_drift_missing_stream:pm-abcd` or\n * `validate_resolution_missing_fields:3`). Agents that gate on these commands\n * previously had to hardcode the mapping from a warning code to the `pm` command\n * that fixes it. This module is the single source of truth for that mapping so\n * `pm health --json` (per-check `remediation_map`) and `pm validate --fix-hints`\n * (per-check `fix_hints`) can both surface executable remediation without any\n * duplicated, drift-prone lookup tables.\n *\n * Semantics of {@link RemediationEntry.command}: the suggested next `pm` command\n * an operator/agent should run to resolve findings with that code. Per-item\n * findings use an `<id>` placeholder (callers that have the concrete id may\n * substitute it); findings whose only fix is a manual file edit point at the\n * most useful diagnostic/repair command and describe the manual step in\n * {@link RemediationEntry.summary}.\n */\n\n/** Maps a stable diagnostic warning code to the command and summary that resolve it. */\nexport interface RemediationEntry {\n /**\n * Stable warning-code prefix this entry resolves. A warning matches when it\n * equals this code or begins with `<code>:`. Registry codes are mutually\n * exclusive under that colon-boundary rule (no code is a `:`-delimited prefix\n * of another — e.g. `settings:id_prefix_empty` is distinct from a bare\n * `settings`, which is intentionally not registered), so `resolveRemediation`\n * uses first-match with no ordering dependency.\n */\n readonly code: string;\n /** Executable `pm` command (or imperative) that resolves the finding. May contain an `<id>` placeholder. */\n readonly command: string;\n /** One-line description of what the command does / which manual step it covers. */\n readonly summary: string;\n}\n\n/**\n * Registry of every non-extension `pm health` / `pm validate` warning code and\n * its remediation. Extension findings keep their richer, contextual\n * `details.triage.remediation` produced by the extension health triage and are\n * intentionally excluded here (see pm-0hnu: \"all non-extension checks\").\n */\nexport const REMEDIATION_REGISTRY: readonly RemediationEntry[] = Object.freeze([\n // --- pm health: directories ---\n {\n code: \"missing_directory\",\n command: \"pm init\",\n summary: \"Recreate missing tracker directories (pm init is idempotent and restores the scaffold).\",\n },\n // --- pm health: settings (read/parse) ---\n {\n code: \"settings_read_invalid_json\",\n command: \"pm config list --json\",\n summary:\n \"settings.json is not valid JSON and pm fell back to defaults; fix the syntax error in the reported path, then re-run.\",\n },\n {\n code: \"settings_read_invalid_schema\",\n command: \"pm config list --json\",\n summary:\n \"settings.json failed schema validation and pm fell back to defaults; correct the reported key in the file, then re-run.\",\n },\n {\n code: \"settings_read_merge_failed\",\n command: \"pm config list --json\",\n summary: \"Global/project settings could not be merged; reconcile the conflicting keys in the reported settings files.\",\n },\n // --- pm health: settings_values ---\n {\n code: \"settings:id_prefix_empty\",\n command: \"pm config list --json\",\n summary: 'id_prefix is empty; set a non-empty \"id_prefix\" in settings.json so generated item ids are well-formed.',\n },\n {\n code: \"settings:locks_ttl_non_positive\",\n command: \"pm config list --json\",\n summary: 'locks.ttl_seconds must be positive; set a positive \"locks.ttl_seconds\" in settings.json.',\n },\n // --- pm health: telemetry (advisory) ---\n {\n code: \"telemetry_state_invalid_json\",\n command: \"pm health --check-telemetry\",\n summary: \"Local telemetry state file is corrupt; pm recreates it on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_invalid_rows\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry queue has unparseable rows; they are skipped on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_pending\",\n command: \"pm health --check-telemetry\",\n summary: \"Telemetry events are queued; they flush automatically on the next reachable command. Advisory only.\",\n },\n {\n code: \"telemetry_queue_high_retries\",\n command: \"pm telemetry flush\",\n summary:\n \"Some queued telemetry events are near retry exhaustion; flush now and verify endpoint reachability before entries are dropped.\",\n },\n {\n code: \"telemetry_endpoint_probe_failed\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry endpoint is unreachable; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_endpoint_probe_http_status\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry endpoint returned a non-success status; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_schema_version_behind\",\n command: \"pm health --check-telemetry\",\n summary: \"Client schema is behind server; upgrade pm-cli to emit the latest event shape.\",\n },\n {\n code: \"telemetry_otel_export_failing\",\n command: \"pm health --check-telemetry\",\n summary:\n \"OTLP trace spans are queued but the traces endpoint export is failing; spans retry automatically on the next reachable command, or set PM_TELEMETRY_OTEL_DISABLED=1 to skip OTLP export. Advisory only.\",\n },\n // --- pm health: integrity ---\n {\n code: \"integrity_item_unreadable\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file could not be read; restore or repair the file at the reported path.\",\n },\n {\n code: \"integrity_item_parse_failed\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file failed to parse; fix the malformed front matter at the reported path.\",\n },\n {\n code: \"integrity_item_conflict_marker\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file contains Git conflict markers; resolve the <<<<<<< / >>>>>>> markers at the reported line.\",\n },\n {\n code: \"integrity_history_unreadable\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream could not be read; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_invalid_json\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream contains invalid JSON; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_conflict_marker\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream contains Git conflict markers; resolve the markers, then re-anchor the chain.\",\n },\n // --- pm health (integrity) + pm validate (format_version): item format version ---\n {\n code: \"integrity_item_outdated_format_version\",\n command: \"pm validate --verbose-diagnostics\",\n summary: \"An item predates the current storage format version; a pm storage migration rewrites it. Use --verbose-diagnostics to list the affected items.\",\n },\n {\n code: \"integrity_item_ahead_format_version\",\n command: \"npm install -g @unbrained/pm-cli@latest\",\n summary: \"An item was written by a newer pm format version than this runtime supports; upgrade pm to read and validate it safely.\",\n },\n // --- pm health: history_drift ---\n // `pm health` rewrites these commands to `pm history-repair --all` in the\n // per-check remediation_map when more than one stream is drifted.\n {\n code: \"history_drift_missing_stream\",\n command: \"pm history-repair <id>\",\n summary: \"The item has no history stream; re-anchor the chain to rebuild it (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_unreadable_stream\",\n command: \"pm history-repair <id>\",\n summary: \"The item's history stream is unreadable; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_hash_mismatch\",\n command: \"pm history-repair <id>\",\n summary: \"The item's content hash no longer matches its history; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_chain_mismatch\",\n command: \"pm history-repair <id>\",\n summary: \"The item's history chain is broken; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n // --- pm health: storage (history compaction policy) ---\n {\n code: \"history_stream_over_compact_threshold\",\n command: \"pm history-compact <id>\",\n summary: \"The history stream exceeds the configured compaction threshold; compact it (pm history-compact --all-streams sweeps every over-threshold stream in one pass).\",\n },\n // --- pm health: locks ---\n {\n code: \"locks_stale_count\",\n command: \"pm gc --scope locks\",\n summary:\n \"Stale item-claim locks (embedded ttl elapsed) can block mutations; sweep them — gc retains active and unparseable locks.\",\n },\n {\n code: \"locks_unreadable\",\n command: \"pm gc --scope locks --dry-run\",\n summary:\n \"Some lock files could not be read; preview the sweep and inspect the unreadable files manually — gc never deletes what it cannot read.\",\n },\n // --- pm health: extensions ---\n // Most extension findings keep their richer, contextual\n // `details.triage.remediation` and are intentionally absent here. The\n // partial-coverage code is the exception: it is not a per-extension triage\n // result but a system-wide adoption gap (unmanaged installs the update-health\n // scan had to skip), so it has a single deterministic fix and belongs in the\n // shared registry like any other health finding (pm-bdvm).\n {\n code: \"extension_update_health_partial_coverage\",\n command: \"pm extension --adopt-all --project\",\n summary:\n \"Update-health coverage is partial because unmanaged extensions were skipped; adopt the existing installs into managed metadata so the update scan covers them (use --global for global-scope extensions, or pm package --adopt-all when working with packages).\",\n },\n // --- pm health: vectorization ---\n {\n code: \"vectorization_stale_items_remaining\",\n command: \"pm health --refresh-vectors\",\n summary: \"Some items have stale embeddings; refresh vectors so semantic search results stay current.\",\n },\n {\n code: \"vectorization_embedding_identity_changed\",\n command: \"pm reindex --mode semantic\",\n summary: \"Embedding provider/model changed since the last index; run a semantic reindex to rebuild vectors.\",\n },\n // --- pm validate: metadata ---\n // Note: validate_metadata_missing_author has no entry on purpose. `pm update\n // --author` sets the mutation/audit author (history), not the item's\n // `metadata.author` front-matter field, and there is no CLI flag that writes\n // that field — so emitting a command here would record an audit entry without\n // clearing the finding. A missing item author must be restored at the source.\n {\n code: \"validate_metadata_missing_acceptance_criteria\",\n command: 'pm update <id> --acceptance-criteria \"<criteria>\"',\n summary: \"Backfill the missing acceptance criteria on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_estimate\",\n command: 'pm update <id> --estimate \"<estimate>\"',\n summary: \"Backfill the missing estimate on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_close_reason\",\n command: 'pm update <id> --close-reason \"<reason>\"',\n summary: \"Backfill the missing close reason on the reported closed item(s).\",\n },\n {\n code: \"validate_metadata_missing_reviewer\",\n command: 'pm update <id> --reviewer \"<name>\"',\n summary: \"Backfill the missing reviewer on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_risk\",\n command: 'pm update <id> --risk \"<level>\"',\n summary: \"Backfill the missing risk on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_confidence\",\n command: 'pm update <id> --confidence \"<level>\"',\n summary: \"Backfill the missing confidence on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_sprint\",\n command: 'pm update <id> --sprint \"<sprint>\"',\n summary: \"Backfill the missing sprint on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_release\",\n command: 'pm update <id> --release \"<release>\"',\n summary: \"Backfill the missing release on the reported item(s).\",\n },\n {\n code: \"validate_metadata_custom_profile_missing_required_fields\",\n command: 'pm config set metadata-required-fields --criterion \"<field>\"',\n summary:\n \"Config-driven finding: the custom metadata profile has no required fields configured and falls back to core, so configure the fields rather than mutating items.\",\n },\n {\n code: \"validate_metadata_duplicate_issue_codes\",\n command: 'pm update <id> --title \"<distinct title>\"',\n summary:\n \"Two or more items share one logical issue code (GH-235); give each a distinct title so the derived code is unique, or close the redundant item with pm close <id> --duplicate-of <canonical-id> (closed-as-duplicate items are excluded from the check).\",\n },\n // --- pm validate: resolution ---\n {\n code: \"validate_resolution_missing_fields\",\n command: 'pm update <id> --resolution \"<how resolved>\"',\n summary: \"Backfill resolution / expected_result / actual_result on the reported closed item(s).\",\n },\n // --- pm validate: lifecycle ---\n {\n code: \"validate_lifecycle_active_closure_like_metadata\",\n command: \"pm update <id> --unset <closure-like-field>\",\n summary:\n \"Clear the closure-like field the validator flags on this active item — the detail row names it (resolution / actual-result / blocked-reason) — or close the item if it is actually done.\",\n },\n {\n code: \"validate_lifecycle_active_terminal_parent\",\n command: \"pm update <id> --parent <active-parent-id>\",\n summary: \"Reopen the terminal parent or move the active child under a non-terminal parent.\",\n },\n {\n code: \"validate_lifecycle_stale_blockers\",\n command: \"pm update <id> --unset blocked-by --unset blocked-reason\",\n summary:\n \"Resolve the stale blocker the validator flags: clear blocked-by/blocked-reason when they linger on a non-blocked item or report a resolved blocker; if instead a blocked item is missing blocker context, add the context or move it out of a blocked status.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles_error\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary: \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary: \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n {\n code: \"validate_hierarchy_parent_cycle_error\",\n command: \"pm update <id> --parent <other-id>\",\n summary:\n \"Break the parent-hierarchy cycle by reparenting one item in the reported cycle to a non-cyclic parent (or clear it with pm update <id> --unset parent).\",\n },\n {\n code: \"validate_hierarchy_parent_cycle\",\n command: \"pm update <id> --parent <other-id>\",\n summary:\n \"Break the parent-hierarchy cycle by reparenting one item in the reported cycle to a non-cyclic parent (or clear it with pm update <id> --unset parent).\",\n },\n // --- pm validate: files ---\n {\n code: \"validate_files_missing_linked_paths\",\n command: \"pm <files|docs> <id> --remove <path>\",\n summary:\n \"The check spans both item.files and item.docs under one code: restore the missing linked artifact, or unlink it with pm files (linked file) or pm docs (linked doc).\",\n },\n {\n code: \"validate_files_orphaned_paths\",\n command: \"pm <files|docs> <id> --add <path>\",\n summary:\n \"Link the orphaned artifact with pm files (file) or pm docs (doc), or remove it from the workspace.\",\n },\n {\n code: \"validate_files_tracked_all_strict_forces_pm_internals\",\n command: \"pm validate --check-files --include-pm-internals\",\n summary: \"tracked-all-strict scan flagged pm internals; re-run with --include-pm-internals or a softer --scan-mode.\",\n },\n // --- pm validate: history_drift ---\n {\n code: \"validate_history_drift_missing_streams\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items missing a history stream.\",\n },\n {\n code: \"validate_history_drift_unreadable_streams\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items with an unreadable history stream.\",\n },\n {\n code: \"validate_history_drift_hash_mismatches\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items whose content hash drifted.\",\n },\n {\n code: \"validate_history_drift_chain_mismatches\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items with a broken history chain.\",\n },\n // --- pm validate: command_references ---\n {\n code: \"validate_command_references_stale_pm_ids\",\n command: 'pm update <id> --replace-tests --test \"command=<corrected-command>\" [--test ...]',\n summary:\n \"Correct the stale pm-ID inside the item's linked test command (the check scans tests[].command, not the body). --replace-tests overwrites the entire tests list, so re-include the item's other linked tests in the same call.\",\n },\n {\n code: \"validate_format_version_outdated_items\",\n command: \"pm validate --verbose-diagnostics\",\n summary: \"One or more items predate the current storage format version; a pm storage migration rewrites them. Use --verbose-diagnostics to list the affected items.\",\n },\n {\n code: \"validate_format_version_ahead_items\",\n command: \"npm install -g @unbrained/pm-cli@latest\",\n summary: \"One or more items were written by a newer pm format version than this runtime supports; upgrade pm to read and validate them safely.\",\n },\n]);\n\n/**\n * Resolve the remediation entry for a warning token, or `undefined` when no\n * entry is registered. A warning matches an entry when it equals the entry code\n * or begins with `<code>:` (the colon boundary keeps sibling codes such as\n * `validate_lifecycle_dependency_cycles` and\n * `validate_lifecycle_dependency_cycles_error` disjoint).\n *\n * First match is intentional and correct: registry codes are mutually exclusive\n * under the colon-boundary rule, so at most one entry can ever match a warning\n * and order is irrelevant. That invariant is enforced by a test (see\n * remediation-registry.spec.ts \"keeps every registry code mutually exclusive\"),\n * which is why this stays a simple linear scan rather than a longest-prefix\n * search — a longest-prefix tie-break is unreachable with disjoint codes.\n *\n * Accepts unknown input defensively (this is an exported helper SDK consumers\n * may call from untyped JS): a non-string `warning` resolves to `undefined`.\n */\nexport function resolveRemediation(warning: string): RemediationEntry | undefined {\n if (typeof warning !== \"string\") {\n return undefined;\n }\n const normalized = warning.trim();\n for (const entry of REMEDIATION_REGISTRY) {\n if (normalized === entry.code || normalized.startsWith(`${entry.code}:`)) {\n return entry;\n }\n }\n return undefined;\n}\n\n/**\n * Build a compact `remediation_map` (code -> command) for a set of warning\n * tokens. First match wins per code; unknown codes are skipped. Used by\n * `pm health --json` per-check details and as the source of deduped executable\n * commands for `pm validate --fix-hints`.\n */\nexport function buildRemediationMap(warnings: Iterable<string>): Record<string, string> {\n const map: Record<string, string> = {};\n for (const warning of warnings) {\n const entry = resolveRemediation(warning);\n if (entry !== undefined && !Object.prototype.hasOwnProperty.call(map, entry.code)) {\n map[entry.code] = entry.command;\n }\n }\n return map;\n}\n\n/**\n * Build a deduped, ordered list of executable remediation commands for a set of\n * warning tokens (one command per distinct matched code). Used by\n * `pm validate --fix-hints` for checks that do not already emit per-row\n * remediation commands.\n */\nexport function buildRemediationCommands(warnings: Iterable<string>): string[] {\n return Object.values(buildRemediationMap(warnings));\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAmBH;;;;;GAKG;;;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAgC,MAAM,CAAC,MAAM,CAAC;IAC7E,iCAAiC;IACjC;QACE,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,yFAAyF;KACnG;IACD,2CAA2C;IAC3C;QACE,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EACL,uHAAuH;KAC1H;IACD;QACE,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EACL,yHAAyH;KAC5H;IACD;QACE,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EAAE,6GAA6G;KACvH;IACD,qCAAqC;IACrC;QACE,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EAAE,yGAAyG;KACnH;IACD;QACE,IAAI,EAAE,iCAAiC;QACvC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EAAE,0FAA0F;KACpG;IACD,0CAA0C;IAC1C;QACE,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,6BAA6B;QACtC,OAAO,EAAE,0FAA0F;KACpG;IACD;QACE,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,6BAA6B;QACtC,OAAO,EAAE,8FAA8F;KACxG;IACD;QACE,IAAI,EAAE,yBAAyB;QAC/B,OAAO,EAAE,6BAA6B;QACtC,OAAO,EAAE,qGAAqG;KAC/G;IACD;QACE,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,oBAAoB;QAC7B,OAAO,EACL,gIAAgI;KACnI;IACD;QACE,IAAI,EAAE,iCAAiC;QACvC,OAAO,EAAE,6BAA6B;QACtC,OAAO,EAAE,6FAA6F;KACvG;IACD;QACE,IA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AQ,EAAE,CAAC;QAChC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAClC,KAAK,MAAM,KAAK,IAAI,oBAAoB,EAAE,CAAC;QACzC,IAAI,UAAU,KAAK,KAAK,CAAC,IAAI,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YACzE,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAA0B;IAC5D,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAClF,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAA0B;IACjE,OAAO,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC","debugId":"6700669e-bb33-5b85-a194-73e559d13abd"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * @module core/item/item-format-version
3
+ *
4
+ * Tracks the on-disk item front-matter format version so a future breaking
5
+ * storage change can tell already-current items apart from items that a staged
6
+ * migration must rewrite, without re-parsing and structurally guessing every
7
+ * file. The version is an explicit, monotonically increasing integer stamped in
8
+ * front-matter as `pm_format_version`.
9
+ *
10
+ * Token economy is a first-class constraint here: the baseline version (1) is
11
+ * the implicit default and is never serialized, so today's corpus gains zero
12
+ * bytes and zero churn. The field only materializes once an item reaches
13
+ * version 2 or higher. Absence of the field is therefore always interpreted as
14
+ * the baseline version, both now and after future bumps. The classification
15
+ * helpers below power the advisory `pm health` integrity surface and the
16
+ * `pm validate` format-version check.
17
+ */
18
+ import type { ItemMetadata } from "../../types/index.js";
19
+ /**
20
+ * The original (and implicit) item front-matter format version. Items missing a
21
+ * `pm_format_version` field are always treated as this version, so the baseline
22
+ * is never written to disk and adds no per-item token cost.
23
+ */
24
+ export declare const BASELINE_ITEM_FORMAT_VERSION = 1;
25
+ /**
26
+ * The format version this runtime writes and considers current. When a breaking
27
+ * front-matter change ships, bump this constant and add a migration that
28
+ * rewrites items whose {@link effectiveItemFormatVersion} is lower; items at or
29
+ * above it need no migration. It stays equal to
30
+ * {@link BASELINE_ITEM_FORMAT_VERSION} until the first such change.
31
+ */
32
+ export declare const CURRENT_ITEM_FORMAT_VERSION = 1;
33
+ /**
34
+ * Resolve the format version an item is effectively stored at. A present,
35
+ * positive-integer `pm_format_version` is taken verbatim (including versions
36
+ * ahead of this runtime, so they can be flagged rather than silently clamped);
37
+ * an absent, malformed, or sub-baseline value resolves to
38
+ * {@link BASELINE_ITEM_FORMAT_VERSION}.
39
+ */
40
+ export declare function effectiveItemFormatVersion(metadata: Pick<ItemMetadata, "pm_format_version">): number;
41
+ /**
42
+ * Reduce an item's `pm_format_version` to its persisted form: the baseline
43
+ * version (and any malformed or sub-baseline value) is dropped so it is never
44
+ * serialized, while versions at or above {@link BASELINE_ITEM_FORMAT_VERSION}
45
+ * plus one are preserved verbatim. This keeps the field absent for the entire
46
+ * current corpus and only writes it once an item genuinely advances past the
47
+ * implicit baseline.
48
+ */
49
+ export declare function normalizeItemFormatVersion(value: unknown): number | undefined;
50
+ /**
51
+ * Relationship between an item's stored format version and the runtime's
52
+ * current version: `outdated` (below current, a migration would rewrite it),
53
+ * `ahead` (above current, written by a newer pm than this one), or `current`.
54
+ */
55
+ export type ItemFormatVersionStatus = "current" | "outdated" | "ahead";
56
+ /**
57
+ * Classify a single stored format version against the runtime's current
58
+ * version. Defaults to {@link CURRENT_ITEM_FORMAT_VERSION}; the `current`
59
+ * parameter exists so callers (and tests) can evaluate against a hypothetical
60
+ * future version without mutating the module constant.
61
+ */
62
+ export declare function classifyItemFormatVersion(version: number, current?: number): ItemFormatVersionStatus;
63
+ /**
64
+ * One item's reference (id or relative path) paired with the format version it
65
+ * is stored at, used as input to {@link scanItemFormatVersions}.
66
+ */
67
+ export interface ItemFormatVersionScanEntry {
68
+ ref: string;
69
+ version: number;
70
+ }
71
+ /**
72
+ * Sorted references partitioned by how their stored format version compares to
73
+ * the runtime's current version. References at the current version are omitted
74
+ * from both lists.
75
+ */
76
+ export interface ItemFormatVersionScanResult {
77
+ outdated: string[];
78
+ ahead: string[];
79
+ }
80
+ /**
81
+ * Partition a set of items by format version into `outdated` (need migration)
82
+ * and `ahead` (written by a newer pm) reference lists, each sorted for stable
83
+ * diagnostics. Pushing all comparison branches into this pure, exhaustively
84
+ * tested helper lets `pm health` and `pm validate` emit findings by iterating
85
+ * the result lists, with no version-comparison branching of their own.
86
+ */
87
+ export declare function scanItemFormatVersions(entries: readonly ItemFormatVersionScanEntry[], current?: number): ItemFormatVersionScanResult;
@@ -0,0 +1,85 @@
1
+ /**
2
+ * The original (and implicit) item front-matter format version. Items missing a
3
+ * `pm_format_version` field are always treated as this version, so the baseline
4
+ * is never written to disk and adds no per-item token cost.
5
+ */
6
+
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f0e67d63-2f7b-5f4a-b441-7a499c82e0a8")}catch(e){}}();
8
+ export const BASELINE_ITEM_FORMAT_VERSION = 1;
9
+ /**
10
+ * The format version this runtime writes and considers current. When a breaking
11
+ * front-matter change ships, bump this constant and add a migration that
12
+ * rewrites items whose {@link effectiveItemFormatVersion} is lower; items at or
13
+ * above it need no migration. It stays equal to
14
+ * {@link BASELINE_ITEM_FORMAT_VERSION} until the first such change.
15
+ */
16
+ export const CURRENT_ITEM_FORMAT_VERSION = 1;
17
+ /**
18
+ * Resolve the format version an item is effectively stored at. A present,
19
+ * positive-integer `pm_format_version` is taken verbatim (including versions
20
+ * ahead of this runtime, so they can be flagged rather than silently clamped);
21
+ * an absent, malformed, or sub-baseline value resolves to
22
+ * {@link BASELINE_ITEM_FORMAT_VERSION}.
23
+ */
24
+ export function effectiveItemFormatVersion(metadata) {
25
+ const raw = metadata.pm_format_version;
26
+ if (typeof raw === "number" && Number.isInteger(raw) && raw >= BASELINE_ITEM_FORMAT_VERSION) {
27
+ return raw;
28
+ }
29
+ return BASELINE_ITEM_FORMAT_VERSION;
30
+ }
31
+ /**
32
+ * Reduce an item's `pm_format_version` to its persisted form: the baseline
33
+ * version (and any malformed or sub-baseline value) is dropped so it is never
34
+ * serialized, while versions at or above {@link BASELINE_ITEM_FORMAT_VERSION}
35
+ * plus one are preserved verbatim. This keeps the field absent for the entire
36
+ * current corpus and only writes it once an item genuinely advances past the
37
+ * implicit baseline.
38
+ */
39
+ export function normalizeItemFormatVersion(value) {
40
+ if (typeof value !== "number" || !Number.isInteger(value) || value <= BASELINE_ITEM_FORMAT_VERSION) {
41
+ return undefined;
42
+ }
43
+ return value;
44
+ }
45
+ /**
46
+ * Classify a single stored format version against the runtime's current
47
+ * version. Defaults to {@link CURRENT_ITEM_FORMAT_VERSION}; the `current`
48
+ * parameter exists so callers (and tests) can evaluate against a hypothetical
49
+ * future version without mutating the module constant.
50
+ */
51
+ export function classifyItemFormatVersion(version, current = CURRENT_ITEM_FORMAT_VERSION) {
52
+ if (version < current) {
53
+ return "outdated";
54
+ }
55
+ if (version > current) {
56
+ return "ahead";
57
+ }
58
+ return "current";
59
+ }
60
+ /**
61
+ * Partition a set of items by format version into `outdated` (need migration)
62
+ * and `ahead` (written by a newer pm) reference lists, each sorted for stable
63
+ * diagnostics. Pushing all comparison branches into this pure, exhaustively
64
+ * tested helper lets `pm health` and `pm validate` emit findings by iterating
65
+ * the result lists, with no version-comparison branching of their own.
66
+ */
67
+ export function scanItemFormatVersions(entries, current = CURRENT_ITEM_FORMAT_VERSION) {
68
+ const outdated = [];
69
+ const ahead = [];
70
+ for (const entry of entries) {
71
+ const status = classifyItemFormatVersion(entry.version, current);
72
+ if (status === "outdated") {
73
+ outdated.push(entry.ref);
74
+ }
75
+ else if (status === "ahead") {
76
+ ahead.push(entry.ref);
77
+ }
78
+ }
79
+ return {
80
+ outdated: outdated.sort((left, right) => left.localeCompare(right)),
81
+ ahead: ahead.sort((left, right) => left.localeCompare(right)),
82
+ };
83
+ }
84
+ //# sourceMappingURL=item-format-version.js.map
85
+ //# debugId=f0e67d63-2f7b-5f4a-b441-7a499c82e0a8
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item-format-version.js","sources":["core/item/item-format-version.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/item/item-format-version\n *\n * Tracks the on-disk item front-matter format version so a future breaking\n * storage change can tell already-current items apart from items that a staged\n * migration must rewrite, without re-parsing and structurally guessing every\n * file. The version is an explicit, monotonically increasing integer stamped in\n * front-matter as `pm_format_version`.\n *\n * Token economy is a first-class constraint here: the baseline version (1) is\n * the implicit default and is never serialized, so today's corpus gains zero\n * bytes and zero churn. The field only materializes once an item reaches\n * version 2 or higher. Absence of the field is therefore always interpreted as\n * the baseline version, both now and after future bumps. The classification\n * helpers below power the advisory `pm health` integrity surface and the\n * `pm validate` format-version check.\n */\nimport type { ItemMetadata } from \"../../types/index.js\";\n\n/**\n * The original (and implicit) item front-matter format version. Items missing a\n * `pm_format_version` field are always treated as this version, so the baseline\n * is never written to disk and adds no per-item token cost.\n */\nexport const BASELINE_ITEM_FORMAT_VERSION = 1;\n\n/**\n * The format version this runtime writes and considers current. When a breaking\n * front-matter change ships, bump this constant and add a migration that\n * rewrites items whose {@link effectiveItemFormatVersion} is lower; items at or\n * above it need no migration. It stays equal to\n * {@link BASELINE_ITEM_FORMAT_VERSION} until the first such change.\n */\nexport const CURRENT_ITEM_FORMAT_VERSION = 1;\n\n/**\n * Resolve the format version an item is effectively stored at. A present,\n * positive-integer `pm_format_version` is taken verbatim (including versions\n * ahead of this runtime, so they can be flagged rather than silently clamped);\n * an absent, malformed, or sub-baseline value resolves to\n * {@link BASELINE_ITEM_FORMAT_VERSION}.\n */\nexport function effectiveItemFormatVersion(metadata: Pick<ItemMetadata, \"pm_format_version\">): number {\n const raw = metadata.pm_format_version;\n if (typeof raw === \"number\" && Number.isInteger(raw) && raw >= BASELINE_ITEM_FORMAT_VERSION) {\n return raw;\n }\n return BASELINE_ITEM_FORMAT_VERSION;\n}\n\n/**\n * Reduce an item's `pm_format_version` to its persisted form: the baseline\n * version (and any malformed or sub-baseline value) is dropped so it is never\n * serialized, while versions at or above {@link BASELINE_ITEM_FORMAT_VERSION}\n * plus one are preserved verbatim. This keeps the field absent for the entire\n * current corpus and only writes it once an item genuinely advances past the\n * implicit baseline.\n */\nexport function normalizeItemFormatVersion(value: unknown): number | undefined {\n if (typeof value !== \"number\" || !Number.isInteger(value) || value <= BASELINE_ITEM_FORMAT_VERSION) {\n return undefined;\n }\n return value;\n}\n\n/**\n * Relationship between an item's stored format version and the runtime's\n * current version: `outdated` (below current, a migration would rewrite it),\n * `ahead` (above current, written by a newer pm than this one), or `current`.\n */\nexport type ItemFormatVersionStatus = \"current\" | \"outdated\" | \"ahead\";\n\n/**\n * Classify a single stored format version against the runtime's current\n * version. Defaults to {@link CURRENT_ITEM_FORMAT_VERSION}; the `current`\n * parameter exists so callers (and tests) can evaluate against a hypothetical\n * future version without mutating the module constant.\n */\nexport function classifyItemFormatVersion(\n version: number,\n current: number = CURRENT_ITEM_FORMAT_VERSION,\n): ItemFormatVersionStatus {\n if (version < current) {\n return \"outdated\";\n }\n if (version > current) {\n return \"ahead\";\n }\n return \"current\";\n}\n\n/**\n * One item's reference (id or relative path) paired with the format version it\n * is stored at, used as input to {@link scanItemFormatVersions}.\n */\nexport interface ItemFormatVersionScanEntry {\n ref: string;\n version: number;\n}\n\n/**\n * Sorted references partitioned by how their stored format version compares to\n * the runtime's current version. References at the current version are omitted\n * from both lists.\n */\nexport interface ItemFormatVersionScanResult {\n outdated: string[];\n ahead: string[];\n}\n\n/**\n * Partition a set of items by format version into `outdated` (need migration)\n * and `ahead` (written by a newer pm) reference lists, each sorted for stable\n * diagnostics. Pushing all comparison branches into this pure, exhaustively\n * tested helper lets `pm health` and `pm validate` emit findings by iterating\n * the result lists, with no version-comparison branching of their own.\n */\nexport function scanItemFormatVersions(\n entries: readonly ItemFormatVersionScanEntry[],\n current: number = CURRENT_ITEM_FORMAT_VERSION,\n): ItemFormatVersionScanResult {\n const outdated: string[] = [];\n const ahead: string[] = [];\n for (const entry of entries) {\n const status = classifyItemFormatVersion(entry.version, current);\n if (status === \"outdated\") {\n outdated.push(entry.ref);\n } else if (status === \"ahead\") {\n ahead.push(entry.ref);\n }\n }\n return {\n outdated: outdated.sort((left, right) => left.localeCompare(right)),\n ahead: ahead.sort((left, right) => left.localeCompare(right)),\n };\n}\n"],"names":[],"mappings":"AAmBA;;;;GAIG;;;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CAAC,QAAiD;IAC1F,MAAM,GAAG,GAAG,QAAQ,CAAC,iBAAiB,CAAC;IACvC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,4BAA4B,EAAE,CAAC;QAC5F,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,4BAA4B,CAAC;AACtC,CAAC;AAED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I,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;KAC9D,CAAC;AACJ,CAAC","debugId":"f0e67d63-2f7b-5f4a-b441-7a499c82e0a8"}
@@ -4,11 +4,12 @@
4
4
  * Defines item parsing, formatting, and lifecycle helpers for Item Format.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c295802c-f55f-56e8-afdc-257cdef6a4cb")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="777ea2a9-5aa6-5a90-abb5-a0b6052645f2")}catch(e){}}();
8
8
  import { encode as encodeToon } from "@toon-format/toon";
9
9
  import { CONFIDENCE_TEXT_VALUES, ISSUE_SEVERITY_VALUES, RECURRENCE_FREQUENCY_VALUES, RECURRENCE_WEEKDAY_VALUES, STATUS_VALUES, weekdayOrderIndex, } from "../../types/index.js";
10
10
  import { coerceRuntimeFieldValue } from "../schema/runtime-field-values.js";
11
11
  import { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, } from "../schema/runtime-schema.js";
12
+ import { BASELINE_ITEM_FORMAT_VERSION, normalizeItemFormatVersion } from "./item-format-version.js";
12
13
  import { normalizeStatusInput } from "./status.js";
13
14
  import { decodeToonItemContent } from "./toon-decode.js";
14
15
  import { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from "../shared/constants.js";
@@ -129,6 +130,10 @@ function assertValidFrontMatter(frontMatter, runtimeContext) {
129
130
  }
130
131
  const itemType = record.type;
131
132
  assertFrontMatterCondition(typeof itemType === "string" && itemType.trim().length > 0, "type must be a non-empty string");
133
+ const formatVersion = record.pm_format_version;
134
+ if (formatVersion !== undefined) {
135
+ assertFrontMatterCondition(typeof formatVersion === "number" && Number.isInteger(formatVersion) && formatVersion >= BASELINE_ITEM_FORMAT_VERSION, `pm_format_version must be an integer >= ${BASELINE_ITEM_FORMAT_VERSION}`);
136
+ }
132
137
  const status = record.status;
133
138
  assertFrontMatterCondition(typeof status === "string" && status.trim().length > 0, "status must be a non-empty string");
134
139
  const statusRegistry = runtimeContext?.statusRegistry;
@@ -849,6 +854,7 @@ export function normalizeFrontMatter(frontMatter, options = {}) {
849
854
  title: frontMatter.title,
850
855
  description: frontMatter.description,
851
856
  type: frontMatter.type,
857
+ pm_format_version: normalizeItemFormatVersion(frontMatter.pm_format_version),
852
858
  source_type: frontMatter.source_type?.trim() || undefined,
853
859
  type_options: normalizeTypeOptions(frontMatter.type_options),
854
860
  status: normalizedStatus,
@@ -1149,4 +1155,4 @@ export const _testOnlyItemFormat = {
1149
1155
  sortTests,
1150
1156
  };
1151
1157
  //# sourceMappingURL=item-format.js.map
1152
- //# debugId=c295802c-f55f-56e8-afdc-257cdef6a4cb
1158
+ //# debugId=777ea2a9-5aa6-5a90-abb5-a0b6052645f2