@unbrained/pm-cli 2026.7.21 → 2026.7.22

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 (506) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +25 -0
  3. package/dist/cli/bundle-integrity.js +3 -3
  4. package/dist/cli/bundle-integrity.js.map +1 -1
  5. package/dist/cli/commands/contracts.d.ts +5 -0
  6. package/dist/cli/commands/contracts.js +8 -6
  7. package/dist/cli/commands/contracts.js.map +1 -1
  8. package/dist/cli/commands/copy.js +36 -20
  9. package/dist/cli/commands/copy.js.map +1 -1
  10. package/dist/cli/commands/create.js +48 -24
  11. package/dist/cli/commands/create.js.map +1 -1
  12. package/dist/cli/commands/merge.d.ts +1 -1
  13. package/dist/cli/commands/merge.js +3 -3
  14. package/dist/cli/commands/merge.js.map +1 -1
  15. package/dist/cli/commands/restore.js +40 -22
  16. package/dist/cli/commands/restore.js.map +1 -1
  17. package/dist/cli/commands/update.js +12 -9
  18. package/dist/cli/commands/update.js.map +1 -1
  19. package/dist/cli/extension-command-help.js +3 -4
  20. package/dist/cli/extension-command-help.js.map +1 -1
  21. package/dist/cli/main.d.ts +3 -2
  22. package/dist/cli/main.js +6 -6
  23. package/dist/cli/main.js.map +1 -1
  24. package/dist/cli/register-list-query.js +33 -21
  25. package/dist/cli/register-list-query.js.map +1 -1
  26. package/dist/cli/register-mutation.js +63 -37
  27. package/dist/cli/register-mutation.js.map +1 -1
  28. package/dist/cli/registration-helpers.d.ts +2 -0
  29. package/dist/cli/registration-helpers.js +3 -2
  30. package/dist/cli/registration-helpers.js.map +1 -1
  31. package/dist/cli-bundle/bundle-manifest.json +349 -341
  32. package/dist/cli-bundle/chunks/{append-7OVFYR3C.js → append-CYMA7RJT.js} +5 -5
  33. package/dist/cli-bundle/chunks/append-H53CAPMP.js +11 -0
  34. package/dist/cli-bundle/chunks/{chunk-PFNHX655.js → chunk-2P7OK4WG.js} +3 -3
  35. package/dist/cli-bundle/chunks/{chunk-EJDGV4GR.js → chunk-3EBGHNNQ.js} +3 -3
  36. package/dist/cli-bundle/chunks/{chunk-DZRV2OPA.js → chunk-3EDFN3VV.js} +2 -2
  37. package/dist/cli-bundle/chunks/{chunk-ZOY5K4D3.js → chunk-3PWJWLLQ.js} +2 -2
  38. package/dist/cli-bundle/chunks/{chunk-VXOOB6YX.js → chunk-3SJAR3CY.js} +4 -4
  39. package/dist/cli-bundle/chunks/{chunk-GTLCVJOE.js → chunk-3WVKMF2A.js} +3 -3
  40. package/dist/cli-bundle/chunks/{chunk-LAV26CQG.js → chunk-42SYYKA4.js} +4 -4
  41. package/dist/cli-bundle/chunks/{chunk-NLR32VFS.js → chunk-4IXLNV7W.js} +2 -2
  42. package/dist/cli-bundle/chunks/{chunk-BKIAH72N.js → chunk-4LTPHDKA.js} +39 -23
  43. package/dist/cli-bundle/chunks/chunk-4LTPHDKA.js.map +1 -0
  44. package/dist/cli-bundle/chunks/{chunk-ABWCF646.js → chunk-4YTQVO3V.js} +5 -5
  45. package/dist/cli-bundle/chunks/{chunk-E5XMKOSB.js → chunk-5EBRMHI6.js} +4 -4
  46. package/dist/cli-bundle/chunks/{chunk-IY6VZ3IW.js → chunk-5FAG2JUC.js} +320 -62
  47. package/dist/cli-bundle/chunks/chunk-5FAG2JUC.js.map +7 -0
  48. package/dist/cli-bundle/chunks/{chunk-GKX4NJ7U.js → chunk-5K5LHZZX.js} +6 -6
  49. package/dist/cli-bundle/chunks/{chunk-T6PPNM7V.js → chunk-5K7BOAB6.js} +4 -4
  50. package/dist/cli-bundle/chunks/{chunk-4QOB7L7I.js → chunk-5MUZ54G2.js} +5 -5
  51. package/dist/cli-bundle/chunks/{chunk-SF3DT5HJ.js → chunk-5QME4KX2.js} +3 -3
  52. package/dist/cli-bundle/chunks/{chunk-RMF7LMBS.js → chunk-6PDGFY3P.js} +27 -17
  53. package/dist/cli-bundle/chunks/{chunk-RMF7LMBS.js.map → chunk-6PDGFY3P.js.map} +2 -2
  54. package/dist/cli-bundle/chunks/{chunk-TRSHFPRZ.js → chunk-6PM6CPPP.js} +5 -5
  55. package/dist/cli-bundle/chunks/{chunk-O4BCOJTZ.js → chunk-7AHRY3ZB.js} +21 -16
  56. package/dist/cli-bundle/chunks/chunk-7AHRY3ZB.js.map +7 -0
  57. package/dist/cli-bundle/chunks/{chunk-OR42SO64.js → chunk-7B36A3VT.js} +4 -4
  58. package/dist/cli-bundle/chunks/{chunk-QWRVBJ4D.js → chunk-7OR2YKKD.js} +2 -2
  59. package/dist/cli-bundle/chunks/{chunk-FPBMLYPI.js → chunk-7QUV54XX.js} +4 -4
  60. package/dist/cli-bundle/chunks/{chunk-WWNL6WMH.js → chunk-7WXW6JHG.js} +2 -2
  61. package/dist/cli-bundle/chunks/{chunk-BXNDKOR2.js → chunk-A2VL5SVG.js} +4 -4
  62. package/dist/cli-bundle/chunks/chunk-AXGDUXJW.js +5 -0
  63. package/dist/cli-bundle/chunks/{chunk-IAQE32BI.js → chunk-B2AVNGG3.js} +4 -4
  64. package/dist/cli-bundle/chunks/{chunk-K36WV5J6.js → chunk-B7O44UBR.js} +71 -8
  65. package/dist/cli-bundle/chunks/chunk-B7O44UBR.js.map +1 -0
  66. package/dist/cli-bundle/chunks/{chunk-HCEBZNC3.js → chunk-BRMPF2RM.js} +4 -4
  67. package/dist/cli-bundle/chunks/{chunk-Z7VWXXJM.js → chunk-BTNKMF2A.js} +4 -4
  68. package/dist/cli-bundle/chunks/{chunk-KH44WBAT.js → chunk-CD4643VW.js} +4 -4
  69. package/dist/cli-bundle/chunks/{chunk-OWXOPDHD.js → chunk-CJEEC5O4.js} +4 -4
  70. package/dist/cli-bundle/chunks/{chunk-PZC2FUOQ.js → chunk-CTPKCZCF.js} +2 -2
  71. package/dist/cli-bundle/chunks/{chunk-7W2UAXXT.js → chunk-D4OBQVL3.js} +10 -10
  72. package/dist/cli-bundle/chunks/{chunk-EWJWSNRU.js → chunk-DM4TYC2A.js} +4 -4
  73. package/dist/cli-bundle/chunks/{chunk-VJQG4BIM.js → chunk-DSFTAQ7T.js} +3 -3
  74. package/dist/cli-bundle/chunks/{chunk-AELMUANP.js → chunk-DVB6SQU7.js} +2 -2
  75. package/dist/cli-bundle/chunks/{chunk-KBLZ3AA5.js → chunk-E3ZWOFSO.js} +4 -4
  76. package/dist/cli-bundle/chunks/chunk-EP25DV6P.js +9 -0
  77. package/dist/cli-bundle/chunks/{chunk-GTK4DTEW.js → chunk-F4VCB4WY.js} +10 -10
  78. package/dist/cli-bundle/chunks/{chunk-V22ZPOKN.js → chunk-F4XAQUQA.js} +6 -6
  79. package/dist/cli-bundle/chunks/{chunk-QOOTOD3W.js → chunk-FGR6IBAF.js} +6 -6
  80. package/dist/cli-bundle/chunks/{chunk-JSLT7WVE.js → chunk-FKBMT2Q6.js} +2 -2
  81. package/dist/cli-bundle/chunks/{chunk-QIH77CAG.js → chunk-G5RLSSIX.js} +2 -2
  82. package/dist/cli-bundle/chunks/{chunk-P7MTHPJQ.js → chunk-GEKRVH3G.js} +2 -2
  83. package/dist/cli-bundle/chunks/{chunk-2L6ZP22J.js → chunk-GSP6IZFU.js} +3 -3
  84. package/dist/cli-bundle/chunks/{chunk-ATBCUC7Y.js → chunk-H3MDK2VU.js} +48 -30
  85. package/dist/cli-bundle/chunks/chunk-H3MDK2VU.js.map +1 -0
  86. package/dist/cli-bundle/chunks/{chunk-ZVZGXPQ5.js → chunk-HYZZM3Q2.js} +2 -2
  87. package/dist/cli-bundle/chunks/{chunk-XJTABV3X.js → chunk-IBWG3OSH.js} +22 -17
  88. package/dist/cli-bundle/chunks/chunk-IBWG3OSH.js.map +1 -0
  89. package/dist/cli-bundle/chunks/{chunk-4XGJLADW.js → chunk-IHY5SX7O.js} +3 -3
  90. package/dist/cli-bundle/chunks/{chunk-UCBDQI5E.js → chunk-IMU7JLUI.js} +7 -7
  91. package/dist/cli-bundle/chunks/{chunk-Z75ONV25.js → chunk-IPAQAJWB.js} +77 -7
  92. package/dist/cli-bundle/chunks/chunk-IPAQAJWB.js.map +7 -0
  93. package/dist/cli-bundle/chunks/{chunk-7RW4JCU2.js → chunk-IQCD6OO3.js} +25 -13
  94. package/dist/cli-bundle/chunks/chunk-IQCD6OO3.js.map +7 -0
  95. package/dist/cli-bundle/chunks/{chunk-YQWCZ5AC.js → chunk-J3ZKFEDM.js} +38 -22
  96. package/dist/cli-bundle/chunks/chunk-J3ZKFEDM.js.map +7 -0
  97. package/dist/cli-bundle/chunks/{chunk-PEQGTJ5Q.js → chunk-JCLXCGIL.js} +3 -3
  98. package/dist/cli-bundle/chunks/{chunk-GROYI4RB.js → chunk-JLTHOYR7.js} +3 -3
  99. package/dist/cli-bundle/chunks/{chunk-JHJSFOAM.js → chunk-JMPVHM44.js} +4 -4
  100. package/dist/cli-bundle/chunks/{chunk-MATHDCGG.js → chunk-JWYG36RV.js} +8 -8
  101. package/dist/cli-bundle/chunks/{chunk-ZTVA4KLN.js → chunk-KEGVMZNA.js} +28 -16
  102. package/dist/cli-bundle/chunks/chunk-KEGVMZNA.js.map +7 -0
  103. package/dist/cli-bundle/chunks/{chunk-VLRGDBLY.js → chunk-KEHOPUHH.js} +4 -4
  104. package/dist/cli-bundle/chunks/{chunk-K55VMLSS.js → chunk-KJ4ZF35M.js} +63 -13
  105. package/dist/cli-bundle/chunks/chunk-KJ4ZF35M.js.map +7 -0
  106. package/dist/cli-bundle/chunks/{chunk-CPX275C6.js → chunk-KPCZL2YK.js} +6 -6
  107. package/dist/cli-bundle/chunks/{chunk-POG76WWZ.js → chunk-L7DZV6EZ.js} +319 -61
  108. package/dist/cli-bundle/chunks/chunk-L7DZV6EZ.js.map +1 -0
  109. package/dist/cli-bundle/chunks/{chunk-FO6OSVEN.js → chunk-LANV45W2.js} +8 -8
  110. package/dist/cli-bundle/chunks/{chunk-LVC72YRD.js → chunk-LC5ZUXWE.js} +7 -7
  111. package/dist/cli-bundle/chunks/{chunk-SY4SFZSD.js → chunk-LE522OXA.js} +55 -30
  112. package/dist/cli-bundle/chunks/chunk-LE522OXA.js.map +7 -0
  113. package/dist/cli-bundle/chunks/{chunk-TVYYO5A7.js → chunk-MBHYQYCS.js} +2 -2
  114. package/dist/cli-bundle/chunks/{chunk-FJIFFBJX.js → chunk-MROP2RNT.js} +66 -74
  115. package/dist/cli-bundle/chunks/chunk-MROP2RNT.js.map +1 -0
  116. package/dist/cli-bundle/chunks/{chunk-7656MAUL.js → chunk-MUAJHL2R.js} +2 -2
  117. package/dist/cli-bundle/chunks/{chunk-R3P6FZJW.js → chunk-N6QCY2AX.js} +43 -25
  118. package/dist/cli-bundle/chunks/chunk-N6QCY2AX.js.map +1 -0
  119. package/dist/cli-bundle/chunks/{chunk-7WCE6Y64.js → chunk-NUQCSV4P.js} +2 -2
  120. package/dist/cli-bundle/chunks/{chunk-SZVB53Y3.js → chunk-O3GFE2PX.js} +3 -3
  121. package/dist/cli-bundle/chunks/{chunk-OY7DMU5P.js → chunk-O43LEUSD.js} +2 -2
  122. package/dist/cli-bundle/chunks/{chunk-AMJPSANK.js → chunk-O7RH6BWP.js} +103 -44
  123. package/dist/cli-bundle/chunks/chunk-O7RH6BWP.js.map +7 -0
  124. package/dist/cli-bundle/chunks/{chunk-NUF7ROFH.js → chunk-OODR5KYF.js} +26 -27
  125. package/dist/cli-bundle/chunks/chunk-OODR5KYF.js.map +1 -0
  126. package/dist/cli-bundle/chunks/{chunk-LZYP423P.js → chunk-OZ25YD4Q.js} +3 -3
  127. package/dist/cli-bundle/chunks/{chunk-VZIZB6QH.js → chunk-PKYKQCTJ.js} +4 -4
  128. package/dist/cli-bundle/chunks/{chunk-UZLJOEAC.js → chunk-PMRED6QZ.js} +3 -3
  129. package/dist/cli-bundle/chunks/{chunk-ADBTSVGK.js → chunk-PPATPPI6.js} +65 -73
  130. package/dist/cli-bundle/chunks/chunk-PPATPPI6.js.map +7 -0
  131. package/dist/cli-bundle/chunks/{chunk-K4CI6Y45.js → chunk-PWGJCP2V.js} +2 -2
  132. package/dist/cli-bundle/chunks/{chunk-UVN66B3M.js → chunk-Q3Z2Y5WJ.js} +2 -2
  133. package/dist/cli-bundle/chunks/{chunk-RNPZYNHS.js → chunk-Q6YZ3VCI.js} +104 -45
  134. package/dist/cli-bundle/chunks/chunk-Q6YZ3VCI.js.map +1 -0
  135. package/dist/cli-bundle/chunks/{chunk-7DOJC3HS.js → chunk-QE5EUHKN.js} +28 -18
  136. package/dist/cli-bundle/chunks/chunk-QE5EUHKN.js.map +1 -0
  137. package/dist/cli-bundle/chunks/{chunk-AS4SAZ5R.js → chunk-QKMMWESK.js} +25 -26
  138. package/dist/cli-bundle/chunks/chunk-QKMMWESK.js.map +7 -0
  139. package/dist/cli-bundle/chunks/{chunk-R7QV7ICM.js → chunk-QSXN2FAN.js} +4 -4
  140. package/dist/cli-bundle/chunks/{chunk-5NTE36LD.js → chunk-RBECHH5K.js} +4 -4
  141. package/dist/cli-bundle/chunks/{chunk-JXCW2TI2.js → chunk-RPNC7M63.js} +8 -8
  142. package/dist/cli-bundle/chunks/{chunk-ICDAQ4TD.js → chunk-S2QQNTA6.js} +26 -14
  143. package/dist/cli-bundle/chunks/chunk-S2QQNTA6.js.map +1 -0
  144. package/dist/cli-bundle/chunks/{chunk-JFD5LPMI.js → chunk-SP3BAXFF.js} +29 -17
  145. package/dist/cli-bundle/chunks/chunk-SP3BAXFF.js.map +1 -0
  146. package/dist/cli-bundle/chunks/{chunk-F2LBF7XJ.js → chunk-SUSFH6F7.js} +5 -5
  147. package/dist/cli-bundle/chunks/{chunk-VHXHVTUU.js → chunk-TDOPC7UY.js} +2 -2
  148. package/dist/cli-bundle/chunks/{chunk-HYW67VJ5.js → chunk-TLF52ZDP.js} +30 -25
  149. package/dist/cli-bundle/chunks/chunk-TLF52ZDP.js.map +1 -0
  150. package/dist/cli-bundle/chunks/{chunk-FSE2IKJQ.js → chunk-TWHG646K.js} +2 -2
  151. package/dist/cli-bundle/chunks/{chunk-OCUBRA6D.js → chunk-U7U7WGEC.js} +4 -4
  152. package/dist/cli-bundle/chunks/{chunk-PONKZPCJ.js → chunk-UFRVIIJ2.js} +4 -4
  153. package/dist/cli-bundle/chunks/{chunk-VNTCM3VW.js → chunk-VKX2VZZH.js} +8 -8
  154. package/dist/cli-bundle/chunks/{chunk-7AVEY74G.js → chunk-VTOCZ343.js} +29 -24
  155. package/dist/cli-bundle/chunks/chunk-VTOCZ343.js.map +7 -0
  156. package/dist/cli-bundle/chunks/{chunk-6JUTHVQS.js → chunk-W2JDNTN3.js} +2 -2
  157. package/dist/cli-bundle/chunks/{chunk-PQSEQD6E.js → chunk-W35PHE44.js} +62 -12
  158. package/dist/cli-bundle/chunks/chunk-W35PHE44.js.map +1 -0
  159. package/dist/cli-bundle/chunks/{chunk-4QSQ6XDK.js → chunk-WT4KXBUD.js} +68 -31
  160. package/dist/cli-bundle/chunks/chunk-WT4KXBUD.js.map +1 -0
  161. package/dist/cli-bundle/chunks/{chunk-RPESLSO5.js → chunk-XC5RVKHH.js} +69 -32
  162. package/dist/cli-bundle/chunks/chunk-XC5RVKHH.js.map +7 -0
  163. package/dist/cli-bundle/chunks/{chunk-QG4GFLQ6.js → chunk-XD6UF2NB.js} +42 -24
  164. package/dist/cli-bundle/chunks/chunk-XD6UF2NB.js.map +7 -0
  165. package/dist/cli-bundle/chunks/{chunk-AF2CCM5U.js → chunk-XKRVX4B3.js} +4 -4
  166. package/dist/cli-bundle/chunks/{chunk-JGUKMMRS.js → chunk-XN4NQZJK.js} +3 -3
  167. package/dist/cli-bundle/chunks/{chunk-3P7UJQOX.js → chunk-YKFMLQNK.js} +2 -2
  168. package/dist/cli-bundle/chunks/{chunk-YCIUJJOD.js → chunk-YKWKMGL7.js} +2 -2
  169. package/dist/cli-bundle/chunks/{chunk-TOBGV45Y.js → chunk-YUKIFPWK.js} +2 -2
  170. package/dist/cli-bundle/chunks/{chunk-72LQ4TKV.js → chunk-YYEZEP3E.js} +3 -3
  171. package/dist/cli-bundle/chunks/{chunk-X3W65QK3.js → chunk-ZEY3XSZQ.js} +5 -5
  172. package/dist/cli-bundle/chunks/{chunk-MWQ2HC2A.js → chunk-ZKOQHLJP.js} +59 -34
  173. package/dist/cli-bundle/chunks/chunk-ZKOQHLJP.js.map +1 -0
  174. package/dist/cli-bundle/chunks/{chunk-QJIKE24M.js → chunk-ZQ3UMKWE.js} +2 -2
  175. package/dist/cli-bundle/chunks/{chunk-4PUUNQDV.js → chunk-ZVVEWHWK.js} +58 -33
  176. package/dist/cli-bundle/chunks/chunk-ZVVEWHWK.js.map +7 -0
  177. package/dist/cli-bundle/chunks/{chunk-OG5DVFMA.js → chunk-ZXE6SNKO.js} +5 -5
  178. package/dist/cli-bundle/chunks/close-GAUIGOQC.js +12 -0
  179. package/dist/cli-bundle/chunks/{close-QEMOYZN3.js → close-SJIEKNY4.js} +5 -5
  180. package/dist/cli-bundle/chunks/{close-many-RZVTUGBG.js → close-many-B6AIC5OQ.js} +15 -14
  181. package/dist/cli-bundle/chunks/close-many-QCINT6I2.js +24 -0
  182. package/dist/cli-bundle/chunks/comments-4SK5EUEJ.js +13 -0
  183. package/dist/cli-bundle/chunks/{comments-TPU7QRBL.js → comments-DM5KV2RS.js} +7 -7
  184. package/dist/cli-bundle/chunks/copy-4KCCLTYQ.js +10 -0
  185. package/dist/cli-bundle/chunks/{copy-DKTSSCK7.js → copy-HEP5SZHB.js} +5 -4
  186. package/dist/cli-bundle/chunks/create-BDKQFPRE.js +30 -0
  187. package/dist/cli-bundle/chunks/{create-EIFBIVNQ.js → create-VCGBCYL2.js} +11 -10
  188. package/dist/cli-bundle/chunks/delete-JWDXPR3H.js +10 -0
  189. package/dist/cli-bundle/chunks/{delete-LCS3VPDH.js → delete-ZSPBTVJD.js} +4 -4
  190. package/dist/cli-bundle/chunks/{deps-YG7UF3VR.js → deps-BZTWWOIE.js} +6 -6
  191. package/dist/cli-bundle/chunks/{deps-UH5EQQUY.js → deps-OVAJOQIE.js} +6 -6
  192. package/dist/cli-bundle/chunks/{docs-G32TK6XS.js → docs-3GFMSWLL.js} +6 -6
  193. package/dist/cli-bundle/chunks/docs-SY2NPT6Y.js +14 -0
  194. package/dist/cli-bundle/chunks/{files-4ALMCSKB.js → files-2SEL4QIU.js} +6 -6
  195. package/dist/cli-bundle/chunks/{files-3H32UQ4K.js → files-FYMMJGNN.js} +6 -6
  196. package/dist/cli-bundle/chunks/focus-4A27YJ2Z.js +10 -0
  197. package/dist/cli-bundle/chunks/{focus-7SOUT5PZ.js → focus-TEUJKTAT.js} +5 -5
  198. package/dist/cli-bundle/chunks/history-compact-7QOKL2NB.js +16 -0
  199. package/dist/cli-bundle/chunks/{history-compact-77BT2LUB.js → history-compact-U7A37VR6.js} +6 -6
  200. package/dist/cli-bundle/chunks/{history-redact-LJPZPNFA.js → history-redact-TNKUO4ZE.js} +4 -4
  201. package/dist/cli-bundle/chunks/{history-redact-PWTTJ3XS.js → history-redact-ZWRUWQY3.js} +4 -4
  202. package/dist/cli-bundle/chunks/{history-repair-I7CBNCV3.js → history-repair-6IU5VWHN.js} +7 -7
  203. package/dist/cli-bundle/chunks/history-repair-GWCGJUM2.js +17 -0
  204. package/dist/cli-bundle/chunks/learnings-DDFAUUX3.js +13 -0
  205. package/dist/cli-bundle/chunks/{learnings-KTYW3AL7.js → learnings-GOEZXMKL.js} +7 -7
  206. package/dist/cli-bundle/chunks/{notes-ZERD3KB2.js → notes-BZWODAEK.js} +7 -7
  207. package/dist/cli-bundle/chunks/notes-OBJ6FL36.js +13 -0
  208. package/dist/cli-bundle/chunks/{plan-OFJUBIM5.js → plan-V57VQTAG.js} +12 -11
  209. package/dist/cli-bundle/chunks/plan-ZMOBD6FX.js +27 -0
  210. package/dist/cli-bundle/chunks/{profile-3THJPIQY.js → profile-BG3N4ETA.js} +9 -9
  211. package/dist/cli-bundle/chunks/{profile-XEZAMMBW.js → profile-XLM45FKV.js} +9 -9
  212. package/dist/cli-bundle/chunks/{register-list-query-BR435Q2H.js → register-list-query-EYYNTGMF.js} +48 -38
  213. package/dist/cli-bundle/chunks/register-list-query-EYYNTGMF.js.map +1 -0
  214. package/dist/cli-bundle/chunks/{register-list-query-RWTWLOBE.js → register-list-query-WGXJPXXY.js} +47 -37
  215. package/dist/cli-bundle/chunks/register-list-query-WGXJPXXY.js.map +7 -0
  216. package/dist/cli-bundle/chunks/{register-mutation-HLWC2WNP.js → register-mutation-3YSDDVOL.js} +131 -105
  217. package/dist/cli-bundle/chunks/register-mutation-3YSDDVOL.js.map +1 -0
  218. package/dist/cli-bundle/chunks/{register-mutation-ZJX5AZM5.js → register-mutation-VDGUMMUY.js} +131 -105
  219. package/dist/cli-bundle/chunks/register-mutation-VDGUMMUY.js.map +7 -0
  220. package/dist/cli-bundle/chunks/{register-operations-744YBJMV.js → register-operations-H4URGAHX.js} +36 -35
  221. package/dist/cli-bundle/chunks/{register-operations-744YBJMV.js.map → register-operations-H4URGAHX.js.map} +1 -1
  222. package/dist/cli-bundle/chunks/{register-operations-UEBJH6AN.js → register-operations-HSO7X77D.js} +34 -33
  223. package/dist/cli-bundle/chunks/{register-operations-UEBJH6AN.js.map → register-operations-HSO7X77D.js.map} +1 -1
  224. package/dist/cli-bundle/chunks/{register-setup-5DA4UZXI.js → register-setup-HZ2KKXK4.js} +13 -13
  225. package/dist/cli-bundle/chunks/{register-setup-6H25M3BH.js → register-setup-WCBKJ3H3.js} +13 -13
  226. package/dist/cli-bundle/chunks/{restore-6TDVSATY.js → restore-3NGRFDPX.js} +7 -6
  227. package/dist/cli-bundle/chunks/restore-LNVNUWHE.js +15 -0
  228. package/dist/cli-bundle/chunks/{schema-TPVTIJPO.js → schema-LMFZ742C.js} +6 -6
  229. package/dist/cli-bundle/chunks/{schema-HFXFSGPG.js → schema-O34O33UW.js} +6 -6
  230. package/dist/cli-bundle/chunks/update-BN6VZSYX.js +24 -0
  231. package/dist/cli-bundle/chunks/{update-LJZCL5SI.js → update-FDLPLKOB.js} +14 -13
  232. package/dist/cli-bundle/chunks/update-many-WCKOPN3K.js +35 -0
  233. package/dist/cli-bundle/chunks/update-many-WCKOPN3K.js.map +7 -0
  234. package/dist/cli-bundle/chunks/update-many-X6DVGOMM.js +39 -0
  235. package/dist/cli-bundle/chunks/update-many-X6DVGOMM.js.map +1 -0
  236. package/dist/cli-bundle/main.js +65 -64
  237. package/dist/cli-bundle/main.js.map +2 -2
  238. package/dist/cli-bundle/sdk-runtime.js +53 -52
  239. package/dist/cli-bundle/sdk-testing.js +6 -6
  240. package/dist/cli-bundle/sdk.js +362 -56
  241. package/dist/cli-bundle/sdk.js.map +4 -4
  242. package/dist/cli.js +10 -4
  243. package/dist/cli.js.map +1 -1
  244. package/dist/core/diagnostics/remediation.js +7 -2
  245. package/dist/core/diagnostics/remediation.js.map +1 -1
  246. package/dist/core/search/background-refresh.d.ts +3 -1
  247. package/dist/core/search/background-refresh.js +34 -6
  248. package/dist/core/search/background-refresh.js.map +1 -1
  249. package/dist/core/search/cache.js +28 -5
  250. package/dist/core/search/cache.js.map +1 -1
  251. package/dist/core/shared/constants.d.ts +2 -0
  252. package/dist/core/shared/constants.js +29 -24
  253. package/dist/core/shared/constants.js.map +1 -1
  254. package/dist/core/store/item-metadata-cache.d.ts +32 -1
  255. package/dist/core/store/item-metadata-cache.js +289 -21
  256. package/dist/core/store/item-metadata-cache.js.map +1 -1
  257. package/dist/core/store/item-store.js +71 -34
  258. package/dist/core/store/item-store.js.map +1 -1
  259. package/dist/core/store/settings.js +9 -3
  260. package/dist/core/store/settings.js.map +1 -1
  261. package/dist/sdk/cli-bootstrap.js +68 -76
  262. package/dist/sdk/cli-bootstrap.js.map +1 -1
  263. package/dist/sdk/compile-cache.d.ts +16 -0
  264. package/dist/sdk/compile-cache.js +73 -0
  265. package/dist/sdk/compile-cache.js.map +1 -0
  266. package/dist/sdk/context-relevance.d.ts +16 -1
  267. package/dist/sdk/context-relevance.js +20 -8
  268. package/dist/sdk/context-relevance.js.map +1 -1
  269. package/dist/sdk/context-signal-store.d.ts +77 -0
  270. package/dist/sdk/context-signal-store.js +201 -0
  271. package/dist/sdk/context-signal-store.js.map +1 -0
  272. package/dist/sdk/dependency-provenance.d.ts +12 -0
  273. package/dist/sdk/dependency-provenance.js +38 -0
  274. package/dist/sdk/dependency-provenance.js.map +1 -0
  275. package/dist/sdk/governance/storage-integrity.d.ts +1 -1
  276. package/dist/sdk/governance/storage-integrity.js +47 -6
  277. package/dist/sdk/governance/storage-integrity.js.map +1 -1
  278. package/dist/sdk/graph/assembly.d.ts +2 -0
  279. package/dist/sdk/graph/assembly.js +51 -4
  280. package/dist/sdk/graph/assembly.js.map +1 -1
  281. package/dist/sdk/graph/run.js +12 -13
  282. package/dist/sdk/graph/run.js.map +1 -1
  283. package/dist/sdk/index.d.ts +5 -0
  284. package/dist/sdk/index.js +7 -2
  285. package/dist/sdk/index.js.map +1 -1
  286. package/dist/sdk/item-metadata-index.d.ts +11 -0
  287. package/dist/sdk/item-metadata-index.js +15 -0
  288. package/dist/sdk/item-metadata-index.js.map +1 -0
  289. package/dist/sdk/merge/index.d.ts +1 -0
  290. package/dist/sdk/merge/index.js +3 -2
  291. package/dist/sdk/merge/index.js.map +1 -1
  292. package/dist/sdk/merge/install.js +25 -9
  293. package/dist/sdk/merge/install.js.map +1 -1
  294. package/dist/sdk/merge/reconcile.d.ts +46 -0
  295. package/dist/sdk/merge/reconcile.js +46 -0
  296. package/dist/sdk/merge/reconcile.js.map +1 -0
  297. package/dist/sdk/query/list.d.ts +5 -4
  298. package/dist/sdk/query/list.js +22 -14
  299. package/dist/sdk/query/list.js.map +1 -1
  300. package/dist/sdk/relationship-history.d.ts +30 -0
  301. package/dist/sdk/relationship-history.js +75 -7
  302. package/dist/sdk/relationship-history.js.map +1 -1
  303. package/dist/sdk/relationship-migration.d.ts +42 -0
  304. package/dist/sdk/relationship-migration.js +78 -0
  305. package/dist/sdk/relationship-migration.js.map +1 -0
  306. package/dist/sdk/structured-mutations.js +4 -25
  307. package/dist/sdk/structured-mutations.js.map +1 -1
  308. package/docs/COMMANDS.md +26 -3
  309. package/docs/CONFIGURATION.md +1 -1
  310. package/docs/MERGE_SAFETY.md +14 -5
  311. package/docs/PERFORMANCE.md +28 -0
  312. package/docs/RELATIONSHIP_GRAPH.md +47 -1
  313. package/docs/SDK.md +78 -5
  314. package/marketplace.json +2 -2
  315. package/package.json +2 -2
  316. package/packages/pm-beads/package.json +1 -1
  317. package/packages/pm-calendar/package.json +1 -1
  318. package/packages/pm-command-kit/package.json +1 -1
  319. package/packages/pm-governance-audit/package.json +1 -1
  320. package/packages/pm-guide-shell/package.json +1 -1
  321. package/packages/pm-kanban/package.json +1 -1
  322. package/packages/pm-lifecycle-hooks/package.json +1 -1
  323. package/packages/pm-linked-test-adapters/package.json +1 -1
  324. package/packages/pm-search-advanced/package.json +1 -1
  325. package/packages/pm-templates/package.json +1 -1
  326. package/packages/pm-todos/package.json +1 -1
  327. package/packages/pm-vcs/package.json +1 -1
  328. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  329. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  330. package/dist/cli-bundle/chunks/append-DFETHAZL.js +0 -11
  331. package/dist/cli-bundle/chunks/chunk-4PUUNQDV.js.map +0 -7
  332. package/dist/cli-bundle/chunks/chunk-4QSQ6XDK.js.map +0 -1
  333. package/dist/cli-bundle/chunks/chunk-7AVEY74G.js.map +0 -7
  334. package/dist/cli-bundle/chunks/chunk-7DOJC3HS.js.map +0 -1
  335. package/dist/cli-bundle/chunks/chunk-7RW4JCU2.js.map +0 -7
  336. package/dist/cli-bundle/chunks/chunk-ADBTSVGK.js.map +0 -7
  337. package/dist/cli-bundle/chunks/chunk-AMJPSANK.js.map +0 -7
  338. package/dist/cli-bundle/chunks/chunk-AS4SAZ5R.js.map +0 -7
  339. package/dist/cli-bundle/chunks/chunk-ATBCUC7Y.js.map +0 -1
  340. package/dist/cli-bundle/chunks/chunk-BKIAH72N.js.map +0 -1
  341. package/dist/cli-bundle/chunks/chunk-FJIFFBJX.js.map +0 -1
  342. package/dist/cli-bundle/chunks/chunk-HYW67VJ5.js.map +0 -1
  343. package/dist/cli-bundle/chunks/chunk-ICDAQ4TD.js.map +0 -1
  344. package/dist/cli-bundle/chunks/chunk-IY6VZ3IW.js.map +0 -7
  345. package/dist/cli-bundle/chunks/chunk-JFD5LPMI.js.map +0 -1
  346. package/dist/cli-bundle/chunks/chunk-K36WV5J6.js.map +0 -1
  347. package/dist/cli-bundle/chunks/chunk-K55VMLSS.js.map +0 -7
  348. package/dist/cli-bundle/chunks/chunk-MWQ2HC2A.js.map +0 -1
  349. package/dist/cli-bundle/chunks/chunk-NUF7ROFH.js.map +0 -1
  350. package/dist/cli-bundle/chunks/chunk-O4BCOJTZ.js.map +0 -7
  351. package/dist/cli-bundle/chunks/chunk-POG76WWZ.js.map +0 -1
  352. package/dist/cli-bundle/chunks/chunk-PQSEQD6E.js.map +0 -1
  353. package/dist/cli-bundle/chunks/chunk-QG4GFLQ6.js.map +0 -7
  354. package/dist/cli-bundle/chunks/chunk-R3P6FZJW.js.map +0 -1
  355. package/dist/cli-bundle/chunks/chunk-RNPZYNHS.js.map +0 -1
  356. package/dist/cli-bundle/chunks/chunk-RPESLSO5.js.map +0 -7
  357. package/dist/cli-bundle/chunks/chunk-SY4SFZSD.js.map +0 -7
  358. package/dist/cli-bundle/chunks/chunk-XJTABV3X.js.map +0 -1
  359. package/dist/cli-bundle/chunks/chunk-YQWCZ5AC.js.map +0 -7
  360. package/dist/cli-bundle/chunks/chunk-Z75ONV25.js.map +0 -7
  361. package/dist/cli-bundle/chunks/chunk-ZTVA4KLN.js.map +0 -7
  362. package/dist/cli-bundle/chunks/close-O5QVZ6ET.js +0 -12
  363. package/dist/cli-bundle/chunks/close-many-5RZXVN4J.js +0 -23
  364. package/dist/cli-bundle/chunks/comments-Z4KV6FU3.js +0 -13
  365. package/dist/cli-bundle/chunks/copy-M7DDI6LS.js +0 -9
  366. package/dist/cli-bundle/chunks/create-RGSPN5GD.js +0 -29
  367. package/dist/cli-bundle/chunks/delete-MD7YXQLH.js +0 -10
  368. package/dist/cli-bundle/chunks/docs-JWWNRC27.js +0 -14
  369. package/dist/cli-bundle/chunks/focus-DRQ6FQH6.js +0 -10
  370. package/dist/cli-bundle/chunks/history-compact-VCKGTX64.js +0 -16
  371. package/dist/cli-bundle/chunks/history-repair-YTDZRK5E.js +0 -17
  372. package/dist/cli-bundle/chunks/learnings-CYNOICKR.js +0 -13
  373. package/dist/cli-bundle/chunks/notes-FGO63FXL.js +0 -13
  374. package/dist/cli-bundle/chunks/plan-SGCDDTYR.js +0 -26
  375. package/dist/cli-bundle/chunks/register-list-query-BR435Q2H.js.map +0 -1
  376. package/dist/cli-bundle/chunks/register-list-query-RWTWLOBE.js.map +0 -7
  377. package/dist/cli-bundle/chunks/register-mutation-HLWC2WNP.js.map +0 -1
  378. package/dist/cli-bundle/chunks/register-mutation-ZJX5AZM5.js.map +0 -7
  379. package/dist/cli-bundle/chunks/restore-RSL7C7LO.js +0 -14
  380. package/dist/cli-bundle/chunks/update-SIA7LH5Y.js +0 -23
  381. package/dist/cli-bundle/chunks/update-many-BDBZVGQL.js +0 -38
  382. package/dist/cli-bundle/chunks/update-many-MOY3A5B3.js +0 -34
  383. /package/dist/cli-bundle/chunks/{append-7OVFYR3C.js.map → append-CYMA7RJT.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{append-DFETHAZL.js.map → append-H53CAPMP.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{chunk-PFNHX655.js.map → chunk-2P7OK4WG.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{chunk-EJDGV4GR.js.map → chunk-3EBGHNNQ.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{chunk-DZRV2OPA.js.map → chunk-3EDFN3VV.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{chunk-ZOY5K4D3.js.map → chunk-3PWJWLLQ.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{chunk-VXOOB6YX.js.map → chunk-3SJAR3CY.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{chunk-GTLCVJOE.js.map → chunk-3WVKMF2A.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{chunk-LAV26CQG.js.map → chunk-42SYYKA4.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{chunk-NLR32VFS.js.map → chunk-4IXLNV7W.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{chunk-ABWCF646.js.map → chunk-4YTQVO3V.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{chunk-E5XMKOSB.js.map → chunk-5EBRMHI6.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{chunk-GKX4NJ7U.js.map → chunk-5K5LHZZX.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{chunk-T6PPNM7V.js.map → chunk-5K7BOAB6.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{chunk-4QOB7L7I.js.map → chunk-5MUZ54G2.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{chunk-SF3DT5HJ.js.map → chunk-5QME4KX2.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{chunk-TRSHFPRZ.js.map → chunk-6PM6CPPP.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{chunk-OR42SO64.js.map → chunk-7B36A3VT.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{chunk-QWRVBJ4D.js.map → chunk-7OR2YKKD.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{chunk-FPBMLYPI.js.map → chunk-7QUV54XX.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{chunk-WWNL6WMH.js.map → chunk-7WXW6JHG.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{chunk-BXNDKOR2.js.map → chunk-A2VL5SVG.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{close-QEMOYZN3.js.map → chunk-AXGDUXJW.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{chunk-IAQE32BI.js.map → chunk-B2AVNGG3.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{chunk-HCEBZNC3.js.map → chunk-BRMPF2RM.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{chunk-Z7VWXXJM.js.map → chunk-BTNKMF2A.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{chunk-KH44WBAT.js.map → chunk-CD4643VW.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{chunk-OWXOPDHD.js.map → chunk-CJEEC5O4.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{chunk-PZC2FUOQ.js.map → chunk-CTPKCZCF.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{chunk-7W2UAXXT.js.map → chunk-D4OBQVL3.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{chunk-EWJWSNRU.js.map → chunk-DM4TYC2A.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{chunk-VJQG4BIM.js.map → chunk-DSFTAQ7T.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{chunk-AELMUANP.js.map → chunk-DVB6SQU7.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{chunk-KBLZ3AA5.js.map → chunk-E3ZWOFSO.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{close-O5QVZ6ET.js.map → chunk-EP25DV6P.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{chunk-GTK4DTEW.js.map → chunk-F4VCB4WY.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{chunk-V22ZPOKN.js.map → chunk-F4XAQUQA.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{chunk-QOOTOD3W.js.map → chunk-FGR6IBAF.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{chunk-JSLT7WVE.js.map → chunk-FKBMT2Q6.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{chunk-QIH77CAG.js.map → chunk-G5RLSSIX.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{chunk-P7MTHPJQ.js.map → chunk-GEKRVH3G.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{chunk-2L6ZP22J.js.map → chunk-GSP6IZFU.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{chunk-ZVZGXPQ5.js.map → chunk-HYZZM3Q2.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{chunk-4XGJLADW.js.map → chunk-IHY5SX7O.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{chunk-UCBDQI5E.js.map → chunk-IMU7JLUI.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{chunk-PEQGTJ5Q.js.map → chunk-JCLXCGIL.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{chunk-GROYI4RB.js.map → chunk-JLTHOYR7.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{chunk-JHJSFOAM.js.map → chunk-JMPVHM44.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{chunk-MATHDCGG.js.map → chunk-JWYG36RV.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{chunk-VLRGDBLY.js.map → chunk-KEHOPUHH.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{chunk-CPX275C6.js.map → chunk-KPCZL2YK.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{chunk-FO6OSVEN.js.map → chunk-LANV45W2.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{chunk-LVC72YRD.js.map → chunk-LC5ZUXWE.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{chunk-TVYYO5A7.js.map → chunk-MBHYQYCS.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{chunk-7656MAUL.js.map → chunk-MUAJHL2R.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{chunk-7WCE6Y64.js.map → chunk-NUQCSV4P.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{chunk-SZVB53Y3.js.map → chunk-O3GFE2PX.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{chunk-OY7DMU5P.js.map → chunk-O43LEUSD.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{chunk-LZYP423P.js.map → chunk-OZ25YD4Q.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{chunk-VZIZB6QH.js.map → chunk-PKYKQCTJ.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{chunk-UZLJOEAC.js.map → chunk-PMRED6QZ.js.map} +0 -0
  444. /package/dist/cli-bundle/chunks/{chunk-K4CI6Y45.js.map → chunk-PWGJCP2V.js.map} +0 -0
  445. /package/dist/cli-bundle/chunks/{chunk-UVN66B3M.js.map → chunk-Q3Z2Y5WJ.js.map} +0 -0
  446. /package/dist/cli-bundle/chunks/{chunk-R7QV7ICM.js.map → chunk-QSXN2FAN.js.map} +0 -0
  447. /package/dist/cli-bundle/chunks/{chunk-5NTE36LD.js.map → chunk-RBECHH5K.js.map} +0 -0
  448. /package/dist/cli-bundle/chunks/{chunk-JXCW2TI2.js.map → chunk-RPNC7M63.js.map} +0 -0
  449. /package/dist/cli-bundle/chunks/{chunk-F2LBF7XJ.js.map → chunk-SUSFH6F7.js.map} +0 -0
  450. /package/dist/cli-bundle/chunks/{chunk-VHXHVTUU.js.map → chunk-TDOPC7UY.js.map} +0 -0
  451. /package/dist/cli-bundle/chunks/{chunk-FSE2IKJQ.js.map → chunk-TWHG646K.js.map} +0 -0
  452. /package/dist/cli-bundle/chunks/{chunk-OCUBRA6D.js.map → chunk-U7U7WGEC.js.map} +0 -0
  453. /package/dist/cli-bundle/chunks/{chunk-PONKZPCJ.js.map → chunk-UFRVIIJ2.js.map} +0 -0
  454. /package/dist/cli-bundle/chunks/{chunk-VNTCM3VW.js.map → chunk-VKX2VZZH.js.map} +0 -0
  455. /package/dist/cli-bundle/chunks/{chunk-6JUTHVQS.js.map → chunk-W2JDNTN3.js.map} +0 -0
  456. /package/dist/cli-bundle/chunks/{chunk-AF2CCM5U.js.map → chunk-XKRVX4B3.js.map} +0 -0
  457. /package/dist/cli-bundle/chunks/{chunk-JGUKMMRS.js.map → chunk-XN4NQZJK.js.map} +0 -0
  458. /package/dist/cli-bundle/chunks/{chunk-3P7UJQOX.js.map → chunk-YKFMLQNK.js.map} +0 -0
  459. /package/dist/cli-bundle/chunks/{chunk-YCIUJJOD.js.map → chunk-YKWKMGL7.js.map} +0 -0
  460. /package/dist/cli-bundle/chunks/{chunk-TOBGV45Y.js.map → chunk-YUKIFPWK.js.map} +0 -0
  461. /package/dist/cli-bundle/chunks/{chunk-72LQ4TKV.js.map → chunk-YYEZEP3E.js.map} +0 -0
  462. /package/dist/cli-bundle/chunks/{chunk-X3W65QK3.js.map → chunk-ZEY3XSZQ.js.map} +0 -0
  463. /package/dist/cli-bundle/chunks/{chunk-QJIKE24M.js.map → chunk-ZQ3UMKWE.js.map} +0 -0
  464. /package/dist/cli-bundle/chunks/{chunk-OG5DVFMA.js.map → chunk-ZXE6SNKO.js.map} +0 -0
  465. /package/dist/cli-bundle/chunks/{close-many-5RZXVN4J.js.map → close-GAUIGOQC.js.map} +0 -0
  466. /package/dist/cli-bundle/chunks/{close-many-RZVTUGBG.js.map → close-SJIEKNY4.js.map} +0 -0
  467. /package/dist/cli-bundle/chunks/{comments-TPU7QRBL.js.map → close-many-B6AIC5OQ.js.map} +0 -0
  468. /package/dist/cli-bundle/chunks/{comments-Z4KV6FU3.js.map → close-many-QCINT6I2.js.map} +0 -0
  469. /package/dist/cli-bundle/chunks/{copy-M7DDI6LS.js.map → comments-4SK5EUEJ.js.map} +0 -0
  470. /package/dist/cli-bundle/chunks/{copy-DKTSSCK7.js.map → comments-DM5KV2RS.js.map} +0 -0
  471. /package/dist/cli-bundle/chunks/{create-RGSPN5GD.js.map → copy-4KCCLTYQ.js.map} +0 -0
  472. /package/dist/cli-bundle/chunks/{create-EIFBIVNQ.js.map → copy-HEP5SZHB.js.map} +0 -0
  473. /package/dist/cli-bundle/chunks/{delete-MD7YXQLH.js.map → create-BDKQFPRE.js.map} +0 -0
  474. /package/dist/cli-bundle/chunks/{delete-LCS3VPDH.js.map → create-VCGBCYL2.js.map} +0 -0
  475. /package/dist/cli-bundle/chunks/{deps-YG7UF3VR.js.map → delete-JWDXPR3H.js.map} +0 -0
  476. /package/dist/cli-bundle/chunks/{deps-UH5EQQUY.js.map → delete-ZSPBTVJD.js.map} +0 -0
  477. /package/dist/cli-bundle/chunks/{docs-JWWNRC27.js.map → deps-BZTWWOIE.js.map} +0 -0
  478. /package/dist/cli-bundle/chunks/{docs-G32TK6XS.js.map → deps-OVAJOQIE.js.map} +0 -0
  479. /package/dist/cli-bundle/chunks/{files-3H32UQ4K.js.map → docs-3GFMSWLL.js.map} +0 -0
  480. /package/dist/cli-bundle/chunks/{files-4ALMCSKB.js.map → docs-SY2NPT6Y.js.map} +0 -0
  481. /package/dist/cli-bundle/chunks/{focus-DRQ6FQH6.js.map → files-2SEL4QIU.js.map} +0 -0
  482. /package/dist/cli-bundle/chunks/{focus-7SOUT5PZ.js.map → files-FYMMJGNN.js.map} +0 -0
  483. /package/dist/cli-bundle/chunks/{history-compact-VCKGTX64.js.map → focus-4A27YJ2Z.js.map} +0 -0
  484. /package/dist/cli-bundle/chunks/{history-compact-77BT2LUB.js.map → focus-TEUJKTAT.js.map} +0 -0
  485. /package/dist/cli-bundle/chunks/{history-redact-PWTTJ3XS.js.map → history-compact-7QOKL2NB.js.map} +0 -0
  486. /package/dist/cli-bundle/chunks/{history-redact-LJPZPNFA.js.map → history-compact-U7A37VR6.js.map} +0 -0
  487. /package/dist/cli-bundle/chunks/{history-repair-I7CBNCV3.js.map → history-redact-TNKUO4ZE.js.map} +0 -0
  488. /package/dist/cli-bundle/chunks/{history-repair-YTDZRK5E.js.map → history-redact-ZWRUWQY3.js.map} +0 -0
  489. /package/dist/cli-bundle/chunks/{learnings-KTYW3AL7.js.map → history-repair-6IU5VWHN.js.map} +0 -0
  490. /package/dist/cli-bundle/chunks/{learnings-CYNOICKR.js.map → history-repair-GWCGJUM2.js.map} +0 -0
  491. /package/dist/cli-bundle/chunks/{notes-FGO63FXL.js.map → learnings-DDFAUUX3.js.map} +0 -0
  492. /package/dist/cli-bundle/chunks/{notes-ZERD3KB2.js.map → learnings-GOEZXMKL.js.map} +0 -0
  493. /package/dist/cli-bundle/chunks/{plan-OFJUBIM5.js.map → notes-BZWODAEK.js.map} +0 -0
  494. /package/dist/cli-bundle/chunks/{plan-SGCDDTYR.js.map → notes-OBJ6FL36.js.map} +0 -0
  495. /package/dist/cli-bundle/chunks/{profile-3THJPIQY.js.map → plan-V57VQTAG.js.map} +0 -0
  496. /package/dist/cli-bundle/chunks/{profile-XEZAMMBW.js.map → plan-ZMOBD6FX.js.map} +0 -0
  497. /package/dist/cli-bundle/chunks/{restore-6TDVSATY.js.map → profile-BG3N4ETA.js.map} +0 -0
  498. /package/dist/cli-bundle/chunks/{restore-RSL7C7LO.js.map → profile-XLM45FKV.js.map} +0 -0
  499. /package/dist/cli-bundle/chunks/{register-setup-5DA4UZXI.js.map → register-setup-HZ2KKXK4.js.map} +0 -0
  500. /package/dist/cli-bundle/chunks/{register-setup-6H25M3BH.js.map → register-setup-WCBKJ3H3.js.map} +0 -0
  501. /package/dist/cli-bundle/chunks/{schema-TPVTIJPO.js.map → restore-3NGRFDPX.js.map} +0 -0
  502. /package/dist/cli-bundle/chunks/{schema-HFXFSGPG.js.map → restore-LNVNUWHE.js.map} +0 -0
  503. /package/dist/cli-bundle/chunks/{update-LJZCL5SI.js.map → schema-LMFZ742C.js.map} +0 -0
  504. /package/dist/cli-bundle/chunks/{update-SIA7LH5Y.js.map → schema-O34O33UW.js.map} +0 -0
  505. /package/dist/cli-bundle/chunks/{update-many-MOY3A5B3.js.map → update-BN6VZSYX.js.map} +0 -0
  506. /package/dist/cli-bundle/chunks/{update-many-BDBZVGQL.js.map → update-FDLPLKOB.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"structured-mutations.js","sources":["sdk/structured-mutations.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/structured-mutations\n *\n * Parses agent-authored JSON mutation payloads into the public atomic item\n * transaction contract and normalizes full item documents for CLI round trips.\n */\nimport { EXIT_CODE } from \"../core/shared/constants.js\";\nimport { PmCliError } from \"../core/shared/errors.js\";\nimport { levenshteinDistanceWithinLimit } from \"../core/shared/levenshtein.js\";\nimport { CLOSE_FLAG_CONTRACTS } from \"./cli-contracts/flag-contracts.js\";\nimport {\n CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,\n UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,\n} from \"./cli-contracts/commander-mutation-options.js\";\nimport type { PmClientFullMutationOptions } from \"./runtime.js\";\nimport type { BulkItemMutation } from \"./item-transaction.js\";\n\nconst MUTATION_ROW_KEYS = [\"op\", \"id\", \"reason\", \"options\"] as const;\nconst ITEM_ENVELOPE_KEYS = [\n \"item\",\n \"linked\",\n \"schedule\",\n \"claim_state\",\n \"children\",\n] as const;\nconst READ_ONLY_ITEM_KEYS = new Set([\n \"created_at\",\n \"updated_at\",\n \"closed_at\",\n \"version\",\n \"format_version\",\n \"path\",\n \"author\",\n]);\nconst UPDATE_READ_ONLY_ITEM_KEYS = new Set([...READ_ONLY_ITEM_KEYS, \"id\"]);\nconst ITEM_FIELD_KEYS = new Set([\n \"id\",\n \"title\",\n \"description\",\n \"type\",\n \"status\",\n \"priority\",\n \"tags\",\n \"body\",\n \"deadline\",\n \"estimated_minutes\",\n \"acceptance_criteria\",\n \"definition_of_ready\",\n \"order\",\n \"rank\",\n \"goal\",\n \"objective\",\n \"value\",\n \"impact\",\n \"outcome\",\n \"why_now\",\n \"assignee\",\n \"parent\",\n \"reviewer\",\n \"risk\",\n \"confidence\",\n \"sprint\",\n \"release\",\n \"blocked_by\",\n \"blocked_reason\",\n \"unblock_note\",\n \"reporter\",\n \"severity\",\n \"environment\",\n \"repro_steps\",\n \"resolution\",\n \"expected_result\",\n \"actual_result\",\n \"affected_version\",\n \"fixed_version\",\n \"component\",\n \"regression\",\n \"customer_impact\",\n \"close_reason\",\n \"dependencies\",\n \"comments\",\n \"notes\",\n \"learnings\",\n \"files\",\n \"tests\",\n \"docs\",\n \"reminders\",\n \"events\",\n \"type_options\",\n]);\nconst MUTATION_OPTION_KEYS: Readonly<\n Record<BulkItemMutation[\"op\"], readonly string[]>\n> = {\n create: CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS.map(\n (contract) => contract.target,\n ),\n update: UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS.map(\n (contract) => contract.target,\n ),\n close: CLOSE_FLAG_CONTRACTS.map((contract) =>\n contract.flag\n .slice(2)\n .replaceAll(/-([a-z])/gu, (_match, letter: string) =>\n letter.toUpperCase(),\n ),\n ).filter((key) => key !== \"reason\"),\n};\n\n/** Validated transaction controls shared by atomic CLI and MCP adapters. */\nexport interface AtomicMutationControls {\n /** Compensation policy applied to created items when a later step fails. */\n createCompensation?: \"close\" | \"delete\";\n /** Workspace transaction lock lifetime in seconds. */\n lockTtlSeconds?: number;\n /** Maximum time to wait for the workspace transaction lock. */\n lockWaitMs?: number;\n}\n\n/** Validate and normalize atomic transaction controls at every transport boundary. */\nexport function parseAtomicMutationControls(\n value: Record<string, unknown>,\n): AtomicMutationControls {\n const controls: AtomicMutationControls = {};\n const compensation = value.createCompensation;\n if (compensation !== undefined) {\n if (compensation !== \"close\" && compensation !== \"delete\") {\n throw new PmCliError(\n \"createCompensation must be close or delete.\",\n EXIT_CODE.USAGE,\n );\n }\n controls.createCompensation = compensation;\n }\n for (const key of [\"lockTtlSeconds\", \"lockWaitMs\"] as const) {\n const raw = value[key];\n if (raw === undefined) continue;\n const parsed =\n typeof raw === \"number\" ||\n (typeof raw === \"string\" && raw.trim().length > 0)\n ? Number(raw)\n : Number.NaN;\n if (!Number.isSafeInteger(parsed) || parsed <= 0) {\n throw new PmCliError(\n `${key} must be a positive safe integer.`,\n EXIT_CODE.USAGE,\n );\n }\n controls[key] = parsed;\n }\n return controls;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n\nfunction nearestKey(\n key: string,\n candidates: readonly string[],\n): string | undefined {\n const limit = Math.max(1, Math.min(3, Math.floor(key.length / 4) + 1));\n let best: { key: string; distance: number } | undefined;\n for (const candidate of candidates) {\n const distance = levenshteinDistanceWithinLimit(key, candidate, limit);\n if (distance !== null && (best === undefined || distance < best.distance)) {\n best = { key: candidate, distance };\n }\n }\n return best?.key;\n}\n\nfunction unknownKeyError(\n scope: string,\n key: string,\n candidates: readonly string[],\n): PmCliError {\n const suggestion = nearestKey(key, candidates);\n return new PmCliError(\n suggestion === undefined\n ? `${scope} does not recognize key \"${key}\". Allowed keys: ${candidates.join(\", \")}.`\n : `${scope} does not recognize key \"${key}\". Did you mean \"${suggestion}\"?`,\n EXIT_CODE.USAGE,\n {\n code: \"stdin_json_unknown_key\",\n required: `Use documented ${scope} keys only.`,\n why: \"Strict structured input prevents silent typos from creating incomplete or unintended mutations.\",\n nextSteps: [\n suggestion === undefined\n ? `Remove or correct \"${key}\".`\n : `Replace \"${key}\" with \"${suggestion}\".`,\n ],\n },\n );\n}\n\nfunction parseJsonValue(input: string, label: string): unknown {\n try {\n return JSON.parse(input) as unknown;\n } catch (error: unknown) {\n const detail = error instanceof Error ? error.message : String(error);\n throw new PmCliError(\n `${label} must be valid JSON: ${detail}`,\n EXIT_CODE.USAGE,\n {\n code: \"stdin_json_invalid\",\n required: `Pipe one valid JSON ${label.toLowerCase()} into stdin.`,\n why: \"Structured mutation input must parse deterministically before any tracker write begins.\",\n },\n );\n }\n}\n\nfunction validateMutationObject(\n value: unknown,\n index: number,\n): Record<string, unknown> {\n if (!isPlainObject(value)) {\n throw new PmCliError(\n `Mutation ${index + 1} must be an object.`,\n EXIT_CODE.USAGE,\n );\n }\n for (const key of Object.keys(value)) {\n if (\n !MUTATION_ROW_KEYS.includes(key as (typeof MUTATION_ROW_KEYS)[number])\n ) {\n throw unknownKeyError(`mutation ${index + 1}`, key, MUTATION_ROW_KEYS);\n }\n }\n return value;\n}\n\nfunction validateMutationOptions(\n options: unknown,\n op: BulkItemMutation[\"op\"],\n index: number,\n): Record<string, unknown> | undefined {\n if (options === undefined) return undefined;\n if (!isPlainObject(options)) {\n throw new PmCliError(\n `Mutation ${index + 1} options must be an object.`,\n EXIT_CODE.USAGE,\n );\n }\n for (const key of Object.keys(options)) {\n if (!MUTATION_OPTION_KEYS[op].includes(key)) {\n throw unknownKeyError(\n `mutation ${index + 1} ${op} options`,\n key,\n MUTATION_OPTION_KEYS[op],\n );\n }\n }\n return options;\n}\n\nfunction validateMutationRow(value: unknown, index: number): BulkItemMutation {\n const mutation = validateMutationObject(value, index);\n const { op, id, reason } = mutation;\n if (op !== \"create\" && op !== \"update\" && op !== \"close\") {\n throw new PmCliError(\n `Mutation ${index + 1} op must be create, update, or close.`,\n EXIT_CODE.USAGE,\n );\n }\n const options = validateMutationOptions(mutation.options, op, index);\n if (typeof id !== \"string\" || id.trim().length === 0) {\n throw new PmCliError(\n `Mutation ${index + 1} requires a non-empty id.`,\n EXIT_CODE.USAGE,\n );\n }\n const normalizedId = id.trim();\n if (op === \"close\") {\n if (typeof reason !== \"string\" || reason.trim().length === 0) {\n throw new PmCliError(\n `Mutation ${index + 1} close requires a non-empty reason.`,\n EXIT_CODE.USAGE,\n );\n }\n return {\n op,\n id: normalizedId,\n reason: reason.trim(),\n ...(options === undefined\n ? {}\n : { options: options as PmClientFullMutationOptions }),\n };\n }\n if (!isPlainObject(options)) {\n throw new PmCliError(\n `Mutation ${index + 1} ${op} requires an options object.`,\n EXIT_CODE.USAGE,\n );\n }\n return {\n op,\n id: normalizedId,\n options: options as PmClientFullMutationOptions,\n };\n}\n\n/** Parse a JSON array, or an object containing `mutations`, into an atomic mutation batch. */\nexport function parseItemMutationBatch(input: string): BulkItemMutation[] {\n const parsed = parseJsonValue(input, \"Mutation batch\");\n const rows = Array.isArray(parsed)\n ? parsed\n : isPlainObject(parsed) && Array.isArray(parsed.mutations)\n ? parsed.mutations\n : undefined;\n if (rows === undefined || rows.length === 0) {\n throw new PmCliError(\n \"Mutation batch must be a non-empty JSON array or an object with a non-empty mutations array.\",\n EXIT_CODE.USAGE,\n );\n }\n return rows.map((row, index) => validateMutationRow(row, index));\n}\n\nfunction serializePairs(\n value: Record<string, unknown>,\n keys: readonly string[],\n): string {\n return keys\n .filter((key) => value[key] !== undefined && value[key] !== null)\n .map((key) => {\n const rendered = String(value[key]);\n return `${key}=${/[\",\\n\\r\\\\]/u.test(rendered) ? JSON.stringify(rendered) : rendered}`;\n })\n .join(\",\");\n}\n\nfunction serializeObjectArray(\n value: unknown,\n keys: readonly string[],\n label: string,\n): string[] | undefined {\n if (value === undefined) return undefined;\n if (!Array.isArray(value) || !value.every(isPlainObject)) {\n throw new PmCliError(\n `${label} must be an array of objects.`,\n EXIT_CODE.USAGE,\n );\n }\n return value.map((entry) => serializePairs(entry, keys));\n}\n\nfunction scalarItemOption(key: string, value: unknown): unknown {\n if (\n key === \"tags\" &&\n Array.isArray(value) &&\n value.every((entry) => typeof entry === \"string\")\n ) {\n return JSON.stringify(value);\n }\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n return String(value);\n }\n return value;\n}\n\nfunction appendFacetOptions(\n target: Record<string, unknown>,\n source: Record<string, unknown>,\n skipPersistedAnnotations = false,\n): void {\n const mappings: ReadonlyArray<readonly [string, string, readonly string[]]> =\n [\n [\"dependencies\", \"dep\", [\"id\", \"kind\", \"created_at\", \"author\"]],\n [\"comments\", \"comment\", [\"text\", \"created_at\", \"author\"]],\n [\"notes\", \"note\", [\"text\", \"created_at\", \"author\"]],\n [\"learnings\", \"learning\", [\"text\", \"created_at\", \"author\"]],\n [\"files\", \"file\", [\"path\", \"scope\", \"note\"]],\n [\"tests\", \"test\", [\"command\", \"scope\", \"timeout_seconds\"]],\n [\"docs\", \"doc\", [\"path\", \"scope\", \"note\"]],\n [\"reminders\", \"reminder\", [\"at\", \"text\", \"created_at\"]],\n [\"events\", \"event\", [\"start_at\", \"end_at\", \"title\", \"location\"]],\n [\"type_options\", \"typeOption\", [\"key\", \"value\"]],\n ];\n for (const [sourceKey, targetKey, keys] of mappings) {\n const sourceValue = source[sourceKey];\n const serialized = serializeObjectArray(\n skipPersistedAnnotations &&\n [\"comments\", \"notes\", \"learnings\"].includes(sourceKey) &&\n Array.isArray(sourceValue)\n ? sourceValue.filter(\n (entry) =>\n !isPlainObject(entry) || entry.created_at === undefined,\n )\n : sourceValue,\n keys,\n sourceKey,\n );\n if (serialized !== undefined && serialized.length > 0)\n target[targetKey] = serialized;\n }\n}\n\nfunction validateItemDocumentKeys(\n parsed: Record<string, unknown>,\n envelope: boolean,\n): void {\n for (const key of Object.keys(parsed)) {\n if (envelope) {\n if (\n !ITEM_ENVELOPE_KEYS.includes(key as (typeof ITEM_ENVELOPE_KEYS)[number])\n )\n throw unknownKeyError(\"item envelope\", key, ITEM_ENVELOPE_KEYS);\n continue;\n }\n if (\n !ITEM_FIELD_KEYS.has(key) &&\n nearestKey(key, [...ITEM_FIELD_KEYS]) === undefined &&\n nearestKey(key, ITEM_ENVELOPE_KEYS) === \"item\"\n )\n throw unknownKeyError(\"item envelope\", key, ITEM_ENVELOPE_KEYS);\n }\n}\n\nfunction resolveItemDocument(parsed: Record<string, unknown>): {\n item: Record<string, unknown>;\n linked?: Record<string, unknown>;\n} {\n const envelope = Object.hasOwn(parsed, \"item\");\n validateItemDocumentKeys(parsed, envelope);\n const item = envelope ? parsed.item : parsed;\n if (!isPlainObject(item)) {\n throw new PmCliError(\n \"Item document item must be an object.\",\n EXIT_CODE.USAGE,\n );\n }\n return {\n item,\n ...(envelope && isPlainObject(parsed.linked)\n ? { linked: parsed.linked }\n : {}),\n };\n}\n\nfunction appendItemDocumentEntry(\n documentOptions: Record<string, unknown>,\n key: string,\n value: unknown,\n mode: \"create\" | \"update\",\n): void {\n const readOnlyKeys =\n mode === \"update\" ? UPDATE_READ_ONLY_ITEM_KEYS : READ_ONLY_ITEM_KEYS;\n if (readOnlyKeys.has(key)) return;\n if (!ITEM_FIELD_KEYS.has(key)) {\n const suggestion = nearestKey(key, [...ITEM_FIELD_KEYS]);\n if (suggestion !== undefined)\n throw unknownKeyError(\"item document\", key, [...ITEM_FIELD_KEYS]);\n const fields = Array.isArray(documentOptions.field)\n ? (documentOptions.field as string[])\n : [];\n fields.push(\n serializePairs(\n {\n key,\n value: typeof value === \"string\" ? value : JSON.stringify(value),\n },\n [\"key\", \"value\"],\n ),\n );\n documentOptions.field = fields;\n return;\n }\n if (\n [\n \"dependencies\",\n \"comments\",\n \"notes\",\n \"learnings\",\n \"files\",\n \"tests\",\n \"docs\",\n \"reminders\",\n \"events\",\n \"type_options\",\n ].includes(key)\n )\n return;\n documentOptions[\n key.replaceAll(/_([a-z])/gu, (_match, letter: string) =>\n letter.toUpperCase(),\n )\n ] = scalarItemOption(key, value);\n}\n\n/**\n * Convert a direct item JSON document or `pm get --json` envelope into the\n * create/update option shape. Explicit CLI flags override document values.\n */\nexport function itemDocumentToMutationOptions(\n input: string,\n mode: \"create\" | \"update\",\n explicitOptions: Record<string, unknown> = {},\n): Record<string, unknown> {\n const parsed = parseJsonValue(input, \"Item document\");\n if (!isPlainObject(parsed)) {\n throw new PmCliError(\n \"Item document must be a JSON object.\",\n EXIT_CODE.USAGE,\n );\n }\n const { item, linked } = resolveItemDocument(parsed);\n const documentOptions: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(item)) {\n appendItemDocumentEntry(documentOptions, key, value, mode);\n }\n appendFacetOptions(documentOptions, item, mode === \"update\");\n if (linked !== undefined) appendFacetOptions(documentOptions, linked);\n return {\n ...documentOptions,\n ...Object.fromEntries(\n Object.entries(explicitOptions).filter(\n ([, value]) => value !== undefined,\n ),\n ),\n stdinJson: undefined,\n };\n}\n\n/** Validate an already-decoded MCP mutation array through the same strict parser as CLI stdin. */\nexport function validateItemMutationRows(value: unknown): Bulk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eAAe,EAAE,MAAM,CAAC,CAAC;IACtE,OAAO;QACL,GAAG,eAAe;QAClB,GAAG,MAAM,CAAC,WAAW,CACnB,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,MAAM,CACpC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CACnC,CACF;QACD,SAAS,EAAE,SAAS;KACrB,CAAC;AACJ,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,wBAAwB,CAAC,KAAc;IACrD,OAAO,sBAAsB,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AACvD,CAAC","debugId":"916a227a-1ec9-5af6-9b71-e871af2d7f0c"}
1
+ {"version":3,"file":"structured-mutations.js","sources":["sdk/structured-mutations.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/structured-mutations\n *\n * Parses agent-authored JSON mutation payloads into the public atomic item\n * transaction contract and normalizes full item documents for CLI round trips.\n */\nimport {\n EXIT_CODE,\n ITEM_PROJECT_CONTEXT_KEYS,\n} from \"../core/shared/constants.js\";\nimport { PmCliError } from \"../core/shared/errors.js\";\nimport { levenshteinDistanceWithinLimit } from \"../core/shared/levenshtein.js\";\nimport { CLOSE_FLAG_CONTRACTS } from \"./cli-contracts/flag-contracts.js\";\nimport {\n CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,\n UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,\n} from \"./cli-contracts/commander-mutation-options.js\";\nimport type { PmClientFullMutationOptions } from \"./runtime.js\";\nimport type { BulkItemMutation } from \"./item-transaction.js\";\n\nconst MUTATION_ROW_KEYS = [\"op\", \"id\", \"reason\", \"options\"] as const;\nconst ITEM_ENVELOPE_KEYS = [\n \"item\",\n \"linked\",\n \"schedule\",\n \"claim_state\",\n \"children\",\n] as const;\nconst READ_ONLY_ITEM_KEYS = new Set([\n \"created_at\",\n \"updated_at\",\n \"closed_at\",\n \"version\",\n \"format_version\",\n \"path\",\n \"author\",\n]);\nconst UPDATE_READ_ONLY_ITEM_KEYS = new Set([...READ_ONLY_ITEM_KEYS, \"id\"]);\nconst ITEM_FIELD_KEYS = new Set([\n \"id\",\n \"title\",\n \"description\",\n \"type\",\n \"status\",\n \"priority\",\n \"tags\",\n \"body\",\n \"deadline\",\n \"estimated_minutes\",\n \"acceptance_criteria\",\n \"definition_of_ready\",\n \"order\",\n \"rank\",\n \"assignee\",\n ...ITEM_PROJECT_CONTEXT_KEYS,\n \"affected_version\",\n \"fixed_version\",\n \"component\",\n \"regression\",\n \"customer_impact\",\n \"close_reason\",\n \"dependencies\",\n \"comments\",\n \"notes\",\n \"learnings\",\n \"files\",\n \"tests\",\n \"docs\",\n \"reminders\",\n \"events\",\n \"type_options\",\n]);\nconst MUTATION_OPTION_KEYS: Readonly<\n Record<BulkItemMutation[\"op\"], readonly string[]>\n> = {\n create: CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS.map(\n (contract) => contract.target,\n ),\n update: UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS.map(\n (contract) => contract.target,\n ),\n close: CLOSE_FLAG_CONTRACTS.map((contract) =>\n contract.flag\n .slice(2)\n .replaceAll(/-([a-z])/gu, (_match, letter: string) =>\n letter.toUpperCase(),\n ),\n ).filter((key) => key !== \"reason\"),\n};\n\n/** Validated transaction controls shared by atomic CLI and MCP adapters. */\nexport interface AtomicMutationControls {\n /** Compensation policy applied to created items when a later step fails. */\n createCompensation?: \"close\" | \"delete\";\n /** Workspace transaction lock lifetime in seconds. */\n lockTtlSeconds?: number;\n /** Maximum time to wait for the workspace transaction lock. */\n lockWaitMs?: number;\n}\n\n/** Validate and normalize atomic transaction controls at every transport boundary. */\nexport function parseAtomicMutationControls(\n value: Record<string, unknown>,\n): AtomicMutationControls {\n const controls: AtomicMutationControls = {};\n const compensation = value.createCompensation;\n if (compensation !== undefined) {\n if (compensation !== \"close\" && compensation !== \"delete\") {\n throw new PmCliError(\n \"createCompensation must be close or delete.\",\n EXIT_CODE.USAGE,\n );\n }\n controls.createCompensation = compensation;\n }\n for (const key of [\"lockTtlSeconds\", \"lockWaitMs\"] as const) {\n const raw = value[key];\n if (raw === undefined) continue;\n const parsed =\n typeof raw === \"number\" ||\n (typeof raw === \"string\" && raw.trim().length > 0)\n ? Number(raw)\n : Number.NaN;\n if (!Number.isSafeInteger(parsed) || parsed <= 0) {\n throw new PmCliError(\n `${key} must be a positive safe integer.`,\n EXIT_CODE.USAGE,\n );\n }\n controls[key] = parsed;\n }\n return controls;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n\nfunction nearestKey(\n key: string,\n candidates: readonly string[],\n): string | undefined {\n const limit = Math.max(1, Math.min(3, Math.floor(key.length / 4) + 1));\n let best: { key: string; distance: number } | undefined;\n for (const candidate of candidates) {\n const distance = levenshteinDistanceWithinLimit(key, candidate, limit);\n if (distance !== null && (best === undefined || distance < best.distance)) {\n best = { key: candidate, distance };\n }\n }\n return best?.key;\n}\n\nfunction unknownKeyError(\n scope: string,\n key: string,\n candidates: readonly string[],\n): PmCliError {\n const suggestion = nearestKey(key, candidates);\n return new PmCliError(\n suggestion === undefined\n ? `${scope} does not recognize key \"${key}\". Allowed keys: ${candidates.join(\", \")}.`\n : `${scope} does not recognize key \"${key}\". Did you mean \"${suggestion}\"?`,\n EXIT_CODE.USAGE,\n {\n code: \"stdin_json_unknown_key\",\n required: `Use documented ${scope} keys only.`,\n why: \"Strict structured input prevents silent typos from creating incomplete or unintended mutations.\",\n nextSteps: [\n suggestion === undefined\n ? `Remove or correct \"${key}\".`\n : `Replace \"${key}\" with \"${suggestion}\".`,\n ],\n },\n );\n}\n\nfunction parseJsonValue(input: string, label: string): unknown {\n try {\n return JSON.parse(input) as unknown;\n } catch (error: unknown) {\n const detail = error instanceof Error ? error.message : String(error);\n throw new PmCliError(\n `${label} must be valid JSON: ${detail}`,\n EXIT_CODE.USAGE,\n {\n code: \"stdin_json_invalid\",\n required: `Pipe one valid JSON ${label.toLowerCase()} into stdin.`,\n why: \"Structured mutation input must parse deterministically before any tracker write begins.\",\n },\n );\n }\n}\n\nfunction validateMutationObject(\n value: unknown,\n index: number,\n): Record<string, unknown> {\n if (!isPlainObject(value)) {\n throw new PmCliError(\n `Mutation ${index + 1} must be an object.`,\n EXIT_CODE.USAGE,\n );\n }\n for (const key of Object.keys(value)) {\n if (\n !MUTATION_ROW_KEYS.includes(key as (typeof MUTATION_ROW_KEYS)[number])\n ) {\n throw unknownKeyError(`mutation ${index + 1}`, key, MUTATION_ROW_KEYS);\n }\n }\n return value;\n}\n\nfunction validateMutationOptions(\n options: unknown,\n op: BulkItemMutation[\"op\"],\n index: number,\n): Record<string, unknown> | undefined {\n if (options === undefined) return undefined;\n if (!isPlainObject(options)) {\n throw new PmCliError(\n `Mutation ${index + 1} options must be an object.`,\n EXIT_CODE.USAGE,\n );\n }\n for (const key of Object.keys(options)) {\n if (!MUTATION_OPTION_KEYS[op].includes(key)) {\n throw unknownKeyError(\n `mutation ${index + 1} ${op} options`,\n key,\n MUTATION_OPTION_KEYS[op],\n );\n }\n }\n return options;\n}\n\nfunction validateMutationRow(value: unknown, index: number): BulkItemMutation {\n const mutation = validateMutationObject(value, index);\n const { op, id, reason } = mutation;\n if (op !== \"create\" && op !== \"update\" && op !== \"close\") {\n throw new PmCliError(\n `Mutation ${index + 1} op must be create, update, or close.`,\n EXIT_CODE.USAGE,\n );\n }\n const options = validateMutationOptions(mutation.options, op, index);\n if (typeof id !== \"string\" || id.trim().length === 0) {\n throw new PmCliError(\n `Mutation ${index + 1} requires a non-empty id.`,\n EXIT_CODE.USAGE,\n );\n }\n const normalizedId = id.trim();\n if (op === \"close\") {\n if (typeof reason !== \"string\" || reason.trim().length === 0) {\n throw new PmCliError(\n `Mutation ${index + 1} close requires a non-empty reason.`,\n EXIT_CODE.USAGE,\n );\n }\n return {\n op,\n id: normalizedId,\n reason: reason.trim(),\n ...(options === undefined\n ? {}\n : { options: options as PmClientFullMutationOptions }),\n };\n }\n if (!isPlainObject(options)) {\n throw new PmCliError(\n `Mutation ${index + 1} ${op} requires an options object.`,\n EXIT_CODE.USAGE,\n );\n }\n return {\n op,\n id: normalizedId,\n options: options as PmClientFullMutationOptions,\n };\n}\n\n/** Parse a JSON array, or an object containing `mutations`, into an atomic mutation batch. */\nexport function parseItemMutationBatch(input: string): BulkItemMutation[] {\n const parsed = parseJsonValue(input, \"Mutation batch\");\n const rows = Array.isArray(parsed)\n ? parsed\n : isPlainObject(parsed) && Array.isArray(parsed.mutations)\n ? parsed.mutations\n : undefined;\n if (rows === undefined || rows.length === 0) {\n throw new PmCliError(\n \"Mutation batch must be a non-empty JSON array or an object with a non-empty mutations array.\",\n EXIT_CODE.USAGE,\n );\n }\n return rows.map((row, index) => validateMutationRow(row, index));\n}\n\nfunction serializePairs(\n value: Record<string, unknown>,\n keys: readonly string[],\n): string {\n return keys\n .filter((key) => value[key] !== undefined && value[key] !== null)\n .map((key) => {\n const rendered = String(value[key]);\n return `${key}=${/[\",\\n\\r\\\\]/u.test(rendered) ? JSON.stringify(rendered) : rendered}`;\n })\n .join(\",\");\n}\n\nfunction serializeObjectArray(\n value: unknown,\n keys: readonly string[],\n label: string,\n): string[] | undefined {\n if (value === undefined) return undefined;\n if (!Array.isArray(value) || !value.every(isPlainObject)) {\n throw new PmCliError(\n `${label} must be an array of objects.`,\n EXIT_CODE.USAGE,\n );\n }\n return value.map((entry) => serializePairs(entry, keys));\n}\n\nfunction scalarItemOption(key: string, value: unknown): unknown {\n if (\n key === \"tags\" &&\n Array.isArray(value) &&\n value.every((entry) => typeof entry === \"string\")\n ) {\n return JSON.stringify(value);\n }\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n return String(value);\n }\n return value;\n}\n\nfunction appendFacetOptions(\n target: Record<string, unknown>,\n source: Record<string, unknown>,\n skipPersistedAnnotations = false,\n): void {\n const mappings: ReadonlyArray<readonly [string, string, readonly string[]]> =\n [\n [\"dependencies\", \"dep\", [\"id\", \"kind\", \"created_at\", \"author\"]],\n [\"comments\", \"comment\", [\"text\", \"created_at\", \"author\"]],\n [\"notes\", \"note\", [\"text\", \"created_at\", \"author\"]],\n [\"learnings\", \"learning\", [\"text\", \"created_at\", \"author\"]],\n [\"files\", \"file\", [\"path\", \"scope\", \"note\"]],\n [\"tests\", \"test\", [\"command\", \"scope\", \"timeout_seconds\"]],\n [\"docs\", \"doc\", [\"path\", \"scope\", \"note\"]],\n [\"reminders\", \"reminder\", [\"at\", \"text\", \"created_at\"]],\n [\"events\", \"event\", [\"start_at\", \"end_at\", \"title\", \"location\"]],\n [\"type_options\", \"typeOption\", [\"key\", \"value\"]],\n ];\n for (const [sourceKey, targetKey, keys] of mappings) {\n const sourceValue = source[sourceKey];\n const serialized = serializeObjectArray(\n skipPersistedAnnotations &&\n [\"comments\", \"notes\", \"learnings\"].includes(sourceKey) &&\n Array.isArray(sourceValue)\n ? sourceValue.filter(\n (entry) => !isPlainObject(entry) || entry.created_at === undefined,\n )\n : sourceValue,\n keys,\n sourceKey,\n );\n if (serialized !== undefined && serialized.length > 0)\n target[targetKey] = serialized;\n }\n}\n\nfunction validateItemDocumentKeys(\n parsed: Record<string, unknown>,\n envelope: boolean,\n): void {\n for (const key of Object.keys(parsed)) {\n if (envelope) {\n if (\n !ITEM_ENVELOPE_KEYS.includes(key as (typeof ITEM_ENVELOPE_KEYS)[number])\n )\n throw unknownKeyError(\"item envelope\", key, ITEM_ENVELOPE_KEYS);\n continue;\n }\n if (\n !ITEM_FIELD_KEYS.has(key) &&\n nearestKey(key, [...ITEM_FIELD_KEYS]) === undefined &&\n nearestKey(key, ITEM_ENVELOPE_KEYS) === \"item\"\n )\n throw unknownKeyError(\"item envelope\", key, ITEM_ENVELOPE_KEYS);\n }\n}\n\nfunction resolveItemDocument(parsed: Record<string, unknown>): {\n item: Record<string, unknown>;\n linked?: Record<string, unknown>;\n} {\n const envelope = Object.hasOwn(parsed, \"item\");\n validateItemDocumentKeys(parsed, envelope);\n const item = envelope ? parsed.item : parsed;\n if (!isPlainObject(item)) {\n throw new PmCliError(\n \"Item document item must be an object.\",\n EXIT_CODE.USAGE,\n );\n }\n return {\n item,\n ...(envelope && isPlainObject(parsed.linked)\n ? { linked: parsed.linked }\n : {}),\n };\n}\n\nfunction appendItemDocumentEntry(\n documentOptions: Record<string, unknown>,\n key: string,\n value: unknown,\n mode: \"create\" | \"update\",\n): void {\n const readOnlyKeys =\n mode === \"update\" ? UPDATE_READ_ONLY_ITEM_KEYS : READ_ONLY_ITEM_KEYS;\n if (readOnlyKeys.has(key)) return;\n if (!ITEM_FIELD_KEYS.has(key)) {\n const suggestion = nearestKey(key, [...ITEM_FIELD_KEYS]);\n if (suggestion !== undefined)\n throw unknownKeyError(\"item document\", key, [...ITEM_FIELD_KEYS]);\n const fields = Array.isArray(documentOptions.field)\n ? (documentOptions.field as string[])\n : [];\n fields.push(\n serializePairs(\n {\n key,\n value: typeof value === \"string\" ? value : JSON.stringify(value),\n },\n [\"key\", \"value\"],\n ),\n );\n documentOptions.field = fields;\n return;\n }\n if (\n [\n \"dependencies\",\n \"comments\",\n \"notes\",\n \"learnings\",\n \"files\",\n \"tests\",\n \"docs\",\n \"reminders\",\n \"events\",\n \"type_options\",\n ].includes(key)\n )\n return;\n documentOptions[\n key.replaceAll(/_([a-z])/gu, (_match, letter: string) =>\n letter.toUpperCase(),\n )\n ] = scalarItemOption(key, value);\n}\n\n/**\n * Convert a direct item JSON document or `pm get --json` envelope into the\n * create/update option shape. Explicit CLI flags override document values.\n */\nexport function itemDocumentToMutationOptions(\n input: string,\n mode: \"create\" | \"update\",\n explicitOptions: Record<string, unknown> = {},\n): Record<string, unknown> {\n const parsed = parseJsonValue(input, \"Item document\");\n if (!isPlainObject(parsed)) {\n throw new PmCliError(\n \"Item document must be a JSON object.\",\n EXIT_CODE.USAGE,\n );\n }\n const { item, linked } = resolveItemDocument(parsed);\n const documentOptions: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(item)) {\n appendItemDocumentEntry(documentOptions, key, value, mode);\n }\n appendFacetOptions(documentOptions, item, mode === \"update\");\n if (linked !== undefined) appendFacetOptions(documentOptions, linked);\n return {\n ...documentOptions,\n ...Object.fromEntries(\n Object.entries(explicitOptions).filter(\n ([, value]) => value !== undefined,\n ),\n ),\n stdinJson: undefined,\n };\n}\n\n/** Validate an already-decoded MCP mutation array through the same strict parser as CLI stdin. */\nexport function validateItemMutationRows(value: unknown): BulkItemMutation[] {\n return parseItemMutationBatch(JSON.stringify(value));\n}\n"],"names":[],"mappings":"AAAA;;;;;GAKG;;;AACH,OAAO,EACL,SAAS,EACT,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EACL,8CAA8C,EAC9C,8CAA8C,GAC/C,MAAM,+CAA+C,CAAC;AAIvD,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAU,CAAC;AACrE,MAAM,kBAAkB,GAAG;IACzB,MAAM;IACN,QAAQ;IACR,UAAU;IACV,aAAa;IACb,UAAU;CACF,CAAC;AACX,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IAClC,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,SAAS;IACT,gBAAgB;IAChB,MAAM;IACN,QAAQ;CACT,CAAC,CAAC;AACH,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,mBAAmB,EAAE,IAAI,CAAC,CAAC,CAAC;AAC3E,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC9B,IAAI;IACJ,OAAO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IAAI,CAAC,CAAC;IAC7D,CAAC;IACD,kBAAkB,CAAC,eAAe,EAAE,IAAI,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC;IAC7D,IAAI,MAAM,KAAK,SAAS;QAAE,kBAAkB,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IACtE,OAAO;QACL,GAAG,eAAe;QAClB,GAAG,MAAM,CAAC,WAAW,CACnB,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,MAAM,CACpC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CACnC,CACF;QACD,SAAS,EAAE,SAAS;KACrB,CAAC;AACJ,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,wBAAwB,CAAC,KAAc;IACrD,OAAO,sBAAsB,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AACvD,CAAC","debugId":"d482b64e-460e-515c-9dcd-43c6210167d2"}
package/docs/COMMANDS.md CHANGED
@@ -242,13 +242,21 @@ pm eval --fail-under 0.6 --json # CI gate: exit non-zero when aggregate nDC
242
242
 
243
243
  ### Full results, totals, and bodies
244
244
 
245
- `pm list*` returns every matched row when neither `--limit` nor `--offset` is set. When a `--limit`/`--offset` _does_ drop rows, the result adds a top-level `total` (the pre-pagination match count) so an agent knows how many remain. Pass `--no-truncate` (alias `--all`) to force the entire matched set and override any `--limit` in one call — the canonical "give me everything" flag for large-corpus audits:
245
+ `pm list*` returns every matched row when neither `--limit` nor `--offset` is set. Every JSON/TOON result has the same pagination envelope: `total` is the pre-pagination match count, `has_more` and `truncated` are booleans, and `next_cursor` is either the continuation token or `null`. The `filters` object omits unset values instead of emitting null placeholders, keeping long-running agent context stable and lean. Pass `--no-truncate` (alias `--all`) to force the entire matched set and override any `--limit` in one call — the canonical "give me everything" flag for large-corpus audits:
246
246
 
247
247
  ```bash
248
248
  pm list-all --no-truncate --brief # every matched row, ignoring any --limit
249
- pm list-open --limit 20 --json # result.total reports the full count when truncated
249
+ pm list-open --limit 20 --json # stable total/has_more/truncated/next_cursor envelope
250
250
  ```
251
251
 
252
+ Compatibility note: older responses emitted `total` only when pagination
253
+ omitted rows, omitted `next_cursor` on a completed page, and emitted unset
254
+ verbose filter keys as `null`. Integrations should now read `total` as the
255
+ unconditional pre-pagination match count, branch on `has_more` or
256
+ `next_cursor != null`, and test filter-key presence rather than using
257
+ `"total" in result`, `next_cursor !== undefined`, or
258
+ `filters.<key> === null` guards.
259
+
252
260
  JSON output is compact by default (id/status/type/title) for token efficiency. To pull item bodies in bulk in a single call — instead of one `pm get` per item — add `--include-body`, which expands each row to the full field set plus `body`:
253
261
 
254
262
  ```bash
@@ -628,7 +636,7 @@ pm deps <id> --format context --direction both --kind blocked_by,parent --token-
628
636
 
629
637
  Linked files and docs keep reviews reproducible. `deps` is read-only and projects item relationships. `--format context` returns one bounded, explainable relationship packet: a counts-first summary, per-node `role`/`via`/`reasons`, root evidence pointers, enumerated `missing_references` with active-versus-legacy classification, `meta.completeness`, and cursor continuation; `--direction`, repeatable or comma-separated `--kind`, `--max-depth`, `--node-limit`, `--edge-limit`, `--token-budget`, and `--cursor` control the traversal (see [Relationship Graph](RELATIONSHIP_GRAPH.md)). `--edge-limit` caps both returned graph edges and enumerated `missing_references`; `missing_reference_count` retains the total when rows are omitted. The standalone `--note <text>` flag annotates every link added by `--add`/`--add-glob` in the same invocation (a per-entry embedded `note=` wins); `--note` without an add is a usage error.
630
638
 
631
- Structured key/value forms reject unrecognized keys with an `Allowed keys: …` error (matching `test --add`), so a typoed key (`lable=` instead of `label=`) fails fast instead of being silently dropped: `--add`/`--file`/`--doc` accept `path,scope,note`; `--add-glob` accepts `pattern,glob,path,scope,note`; `--remove` accepts `path`; `--migrate` accepts `from,to`; `--dep` accepts `id,kind,type,author,created_at` (plus `source_kind` on update); `--reminder` accepts `at,date,text,title`; `--event` accepts `start,date,end,duration,title,description,location,timezone,all_day` and the `recur_*` recurrence keys. Bare values (`--add src/cli/main.ts`) skip key validation.
639
+ Structured key/value forms reject unrecognized keys with an `Allowed keys: …` error (matching `test --add`), so a typoed key (`lable=` instead of `label=`) fails fast instead of being silently dropped: `--add`/`--file`/`--doc` accept `path,scope,note`; `--add-glob` accepts `pattern,glob,path,scope,note`; `--remove` accepts `path`; `--migrate` accepts `from,to`; create/update `--dep` accepts `id,kind,type,author,created_at,source_kind`; `--reminder` accepts `at,date,text,title`; `--event` accepts `start,date,end,duration,title,description,location,timezone,all_day` and the `recur_*` recurrence keys. Set `source_kind=global` for a dependency owned by another workspace: pm preserves its id verbatim, materializes it as an external graph endpoint, and excludes it from dangling-local-reference findings. Dependencies without that explicit provenance retain normal local `id_prefix` normalization. Bare values (`--add src/cli/main.ts`) skip key validation.
632
640
 
633
641
  ## Graph Queries
634
642
 
@@ -814,6 +822,21 @@ When more than one history stream is drifted, the `history_drift` remediation co
814
822
 
815
823
  ## History and Recovery
816
824
 
825
+ After a branch merge that touched tracker history, preview and apply the
826
+ one-command reconciliation gate:
827
+
828
+ ```bash
829
+ pm merge reconcile --dry-run --json
830
+ pm merge reconcile --message "Reconcile branch histories" --json
831
+ ```
832
+
833
+ The command scans every history stream, delegates repairs to the audited
834
+ `history-repair --all` engine, then runs the history-drift and storage-integrity
835
+ validation checks. Dry-run leaves drift intact and reports it in `validation`;
836
+ apply exits nonzero if any stream fails or either invariant stays red. No Git
837
+ hook is installed automatically—teams may call this command from an explicit
838
+ post-merge hook after opting into that policy.
839
+
817
840
  ```bash
818
841
  pm history <id> --limit 20
819
842
  pm history <id> --diff
@@ -50,7 +50,7 @@ Precedence:
50
50
  4. global settings
51
51
  5. built-in defaults
52
52
 
53
- When `settings.json` cannot be loaded, `pm` falls back to built-in defaults and prints a one-time `settings_read_invalid_json` or `settings_read_invalid_schema` warning to stderr (stdout output is unchanged); run `pm health` for remediation.
53
+ When `settings.json` cannot be loaded, `pm` falls back to built-in defaults and prints a one-time `settings_read_fs_error`, `settings_read_invalid_json`, or `settings_read_invalid_schema` warning to stderr (stdout output is unchanged); run `pm health` for remediation.
54
54
 
55
55
  ## Common Settings
56
56
 
@@ -1,6 +1,6 @@
1
1
  # Multi-Branch Tracker Merge Safety
2
2
 
3
- Tracked by [pm-wc1r](../.agents/pm/features/pm-wc1r.toon), with the integrity and concurrency fixes [pm-9q2t](../.agents/pm/issues/pm-9q2t.toon), [pm-cxyv](../.agents/pm/issues/pm-cxyv.toon), [pm-gpo7](../.agents/pm/issues/pm-gpo7.toon), [pm-m3nl](../.agents/pm/issues/pm-m3nl.toon), [pm-wwfd](../.agents/pm/issues/pm-wwfd.toon), and [pm-xdn6](../.agents/pm/issues/pm-xdn6.toon). Fence-coverage completeness and drift detection are tracked by [pm-i4fx](../.agents/pm/issues/pm-i4fx.toon); cross-branch id collision safety by [pm-pibw](../.agents/pm/issues/pm-pibw.toon); this repository's own adoption by [pm-iwsj](../.agents/pm/chores/pm-iwsj.toon).
3
+ Tracked by [pm-wc1r](../.agents/pm/features/pm-wc1r.toon), with the integrity and concurrency fixes [pm-9q2t](../.agents/pm/issues/pm-9q2t.toon), [pm-cxyv](../.agents/pm/issues/pm-cxyv.toon), [pm-gpo7](../.agents/pm/issues/pm-gpo7.toon), [pm-m3nl](../.agents/pm/issues/pm-m3nl.toon), [pm-wwfd](../.agents/pm/issues/pm-wwfd.toon), and [pm-xdn6](../.agents/pm/issues/pm-xdn6.toon). Fence-coverage completeness and drift detection are tracked by [pm-i4fx](../.agents/pm/issues/pm-i4fx.toon); cross-branch id collision safety by [pm-pibw](../.agents/pm/issues/pm-pibw.toon); post-merge reconciliation by [pm-mfkv92](../.agents/pm/issues/pm-mfkv92.toon); this repository's own adoption by [pm-iwsj](../.agents/pm/chores/pm-iwsj.toon).
4
4
 
5
5
  pm stores project context as reviewable repository files. Concurrent agents can therefore use ordinary branches and worktrees, but tracker artifacts need semantic merge behavior: raw line merging cannot preserve TOON collection counts, JSON object structure, or append-only history hash chains.
6
6
 
@@ -16,6 +16,8 @@ git commit -m "chore(pm): install tracker merge drivers"
16
16
 
17
17
  `pm merge install` writes an idempotent, fenced `.gitattributes` block and repository-local `git config` entries. The attributes are committed; the driver commands are clone-local, so every collaborator and fresh CI clone that performs merges must run the install command.
18
18
 
19
+ The installer publishes the shared `.gitattributes` fence only after the clone-local driver commands are configured. If the repository Git config is read-only or another Git process holds its lock, the command returns the stable `merge_git_config_unwritable` error with recovery guidance and leaves an absent fence absent. Use `pm merge install --dry-run --json` to inspect the contract in intentionally read-only workspaces.
20
+
19
21
  ### Fence coverage contract
20
22
 
21
23
  The fenced block is generated by one shared coverage contract (`buildMergeAttributePatterns`) covering every mergeable artifact class: per-type item folders (`*.toon`/`*.md`), all tracker `**/*.jsonl` paths under the relationship-event driver with the more-specific `history/*.jsonl` rule overriding history streams, `settings.json`, and `schema/*.json`. The broad JSONL rule is required because `RelationshipEventStore` supports package-owned custom relative paths anywhere below the tracker root. Two mechanisms keep the committed fence from drifting out of that contract:
@@ -40,7 +42,7 @@ pm merge install --dry-run --json
40
42
 
41
43
  When both sides change the same scalar or JSON leaf differently, the driver writes a parseable preferred-side result but exits nonzero. Git keeps the path conflicted so a human or coordinating agent must review the losing value and explicitly `git add` the resolution. Use `--prefer theirs` only when that is the intended resolution policy.
42
44
 
43
- The underlying public SDK exports are `mergeItemDocuments`, `mergeHistoryStreams`, `mergeRelationshipEventStreams`, `mergeJsonDocuments`, `runMergeDriver`, `runMergeInstall`, `refreshMergeAttributeFenceIfInstalled`, `buildMergeAttributePatterns`, and `auditMergeAttributeFence` from `@unbrained/pm-cli/sdk`. Hosts can embed the same semantics without shelling out.
45
+ The underlying public SDK exports are `mergeItemDocuments`, `mergeHistoryStreams`, `mergeRelationshipEventStreams`, `mergeJsonDocuments`, `runMergeDriver`, `runMergeInstall`, `runMergeReconcile`, `refreshMergeAttributeFenceIfInstalled`, `buildMergeAttributePatterns`, and `auditMergeAttributeFence` from `@unbrained/pm-cli/sdk`. Hosts can embed the same semantics without shelling out.
44
46
 
45
47
  ## Cross-branch id collision safety
46
48
 
@@ -54,10 +56,17 @@ Item ids are `<prefix>` plus random base36 characters, and uniqueness is only pr
54
56
  After every branch merge that touches `.agents/pm`, run:
55
57
 
56
58
  ```bash
57
- pm validate --check-history-drift --strict-exit
58
- pm history <item-id> --verify --strict-exit
59
+ pm merge reconcile --dry-run --json
60
+ pm merge reconcile --message "Reconcile merged tracker histories" --json
59
61
  ```
60
62
 
63
+ The preview reports every drifted stream without mutation. The apply pass uses
64
+ the audited bulk history-repair engine and immediately validates history drift
65
+ plus storage integrity; it exits nonzero when a stream cannot be repaired or an
66
+ invariant remains red. Clean workspaces are a successful no-op. Default Git
67
+ hooks remain unchanged: repositories that want automatic enforcement must opt
68
+ in by invoking this command from their own post-merge hook.
69
+
61
70
  The default validation surface includes `storage_integrity`. It fails on unreadable item documents, history conflict markers, malformed history tails, live items whose latest history operation is `delete` (a delete/modify resurrection candidate), and unparseable settings/schema files. This prevents the ordinary tolerant read path from turning corruption into a green gate.
62
71
 
63
72
  A history union can be structurally valid while replayed history and the chosen item document describe different effective state. In that case inspect both authors' events before reconciliation, then run the audited repair:
@@ -66,7 +75,7 @@ A history union can be structurally valid while replayed history and the chosen
66
75
  pm history <item-id> --verify --strict-exit
67
76
  pm history-repair <item-id> --dry-run
68
77
  pm history-repair <item-id>
69
- pm validate --check-history-drift --strict-exit
78
+ pm merge reconcile --dry-run --json
70
79
  ```
71
80
 
72
81
  `history-repair` records the reconciliation patch and surfaces discarded event authors/operations when the on-disk document would otherwise revert effective merged history. Re-apply any intended losing mutation as a normal `pm update` so it remains explicit and auditable.
@@ -38,6 +38,34 @@ pnpm benchmark:scale --items ci --iterations 3 --transport both --check
38
38
 
39
39
  The JSON report records fixture generation time plus one excluded warmup observation and measured p50/p95/min/max latency, peak RSS on Linux, output bytes, and estimated tokens for `list`, `get`, `next`, `context`, `search`, `create`, and `claim`. The warmup exposes initial index-build cost while regression percentiles measure the continuously warm derived-index contract across real cold CLI processes and in-process SDK calls. Run the committed local regression check with `pnpm benchmark:scale:check`. GitHub-hosted runners do not execute the scale suite, which keeps expensive performance work off Actions and avoids consuming hosted-runner capacity.
40
40
 
41
+ The metadata read cache is rebuildable derived state. Workspaces with at least
42
+ 500 indexed items use its directory-validated fast path to avoid per-item
43
+ stats; validation and recovery can force a canonical source scan. Every
44
+ metadata, body, and collection tier carries one `source_cursor`. A small
45
+ manifest exposes the base cursor and item count without parsing the full index.
46
+ A supported create, update, move, or delete acquires the cross-process
47
+ derived-index writer lock before the authoritative item commit and atomically
48
+ publishes one collapsed delta containing every compatible tier projection,
49
+ directory signatures, and the next cursor before releasing the lock. Mutation
50
+ cost therefore follows changed items rather than total workspace size. A torn,
51
+ corrupt, or base-mismatched delta is rejected and rebuilt from source.
52
+
53
+ SDK hosts that commit authoritative item documents outside the stock mutation
54
+ commands use `acquireItemMetadataDerivedIndexLock` and
55
+ `refreshItemMetadataDerivedIndex` from `@unbrained/pm-cli/sdk` around the same
56
+ commit boundary. Repeated writes collapse by item path in the delta instead of
57
+ growing an event log; a later source scan compacts the projection into fresh
58
+ base tiers. Projection failure removes the rebuildable tiers, delta, and
59
+ manifest and returns a warning; it never rolls back or outranks the
60
+ authoritative item/history write. Small workspaces without an active index
61
+ receive a no-op release function and retain direct external-edit detection.
62
+
63
+ Context-signal snapshots follow the same rule: they are versioned and
64
+ cursor-stamped, never authoritative, and rebuild from the metadata index or
65
+ source-scan fallback when missing, stale, or corrupt. SDK hosts can persist
66
+ that layer with `ContextSignalStore` while retaining explicit `fresh`/`rebuilt`
67
+ and `derived_index`/`scan_fallback` diagnostics.
68
+
41
69
  To refresh a baseline after an intentional, measured improvement:
42
70
 
43
71
  ```bash
@@ -28,8 +28,14 @@ Hierarchy kinds likewise declare which endpoint is the structural parent. `sourc
28
28
 
29
29
  `RelationshipEventStore` is the built-in durable filesystem adapter. It stores validated JSONL at `.agents/pm/relationships/events.jsonl` by default, replays every row through the same registry and cardinality checks on open, and serializes cross-process appends with the tracker lock. Async `currentVersion()`, `snapshot()`, and `page()` reads take the same lock before refreshing, so long-lived readers observe completed appends without torn JSONL tails. Store paths must stay lexically inside a non-symlinked tracker root and cannot traverse symlinked components. Database, replicated-log, and event-bus adapters can persist the same public events and rebuild the same snapshots.
30
30
 
31
+ `appendBatch(inputs)` is the migration/import path. It refreshes under the writer lock, validates every event against one evolving in-memory view, and publishes the complete JSONL replacement with one atomic rename. A validation or write failure leaves the prior stream byte-for-byte unchanged. The ordinary `append(input)` remains the low-latency single-event path and retains its append-only write. `existingEventPolicy: "skip_identical"` makes deterministic migrations resumable across processes: an existing event id is skipped only when its relationship id, action, canonical edge, author, timestamp, and reason are identical; a same-id/different-content collision fails closed.
32
+
31
33
  ```ts
32
- import { RelationshipEventLog, RelationshipEventStore } from "@unbrained/pm-cli/sdk";
34
+ import {
35
+ RelationshipEventLog,
36
+ RelationshipEventStore,
37
+ planRelationshipEventBackfill,
38
+ } from "@unbrained/pm-cli/sdk";
33
39
 
34
40
  const history = new RelationshipEventLog(["design", "build", "ship"]);
35
41
  history.append({
@@ -57,6 +63,30 @@ await durable.append({
57
63
  author: "release-agent",
58
64
  timestamp: new Date().toISOString(),
59
65
  });
66
+
67
+ const legacyItems = [
68
+ { id: "design", title: "Design", status: "closed" as const },
69
+ {
70
+ id: "build",
71
+ title: "Build",
72
+ status: "open" as const,
73
+ parent: "design",
74
+ dependencies: [{ id: "design", kind: "blocked_by" }],
75
+ },
76
+ ];
77
+ const migration = planRelationshipEventBackfill(legacyItems, {
78
+ migrationId: "legacy-items-v1",
79
+ author: "migration-agent",
80
+ timestamp: "2026-07-21T20:45:00.000Z",
81
+ });
82
+ const migrationStore = await RelationshipEventStore.open({
83
+ pmRoot: ".agents/pm",
84
+ nodes: migration.nodes,
85
+ relativePath: "relationships/legacy-items-v1.jsonl",
86
+ });
87
+ await migrationStore.appendBatch(migration.events, {
88
+ existingEventPolicy: "skip_identical",
89
+ });
60
90
  ```
61
91
 
62
92
  ## Explainable analytics
@@ -232,6 +262,18 @@ every entry rebuilds from item storage on fingerprint mismatch, and
232
262
  envelopes report the `cache.durable` disposition. Ids resolve
233
263
  case-insensitively; `--summary` returns envelopes without row collections.
234
264
 
265
+ The graph fingerprint consumes the item-metadata-derived index, whose metadata,
266
+ body, and collection tiers plus collapsed mutation delta publish one effective
267
+ source cursor. Supported item mutations serialize authoritative writes with a
268
+ bounded derived-index projection, so a long-lived SDK host or later CLI process
269
+ observes the committed relationship fields without paying for a full source
270
+ scan or rewriting the whole index. Cursor disagreement, an invalid projection
271
+ path, or any refresh failure invalidates the rebuildable base/delta state; the
272
+ next graph read source-scans and reconstructs both indexes. Package-owned
273
+ storage adapters can preserve this contract with the public
274
+ `acquireItemMetadataDerivedIndexLock` and
275
+ `refreshItemMetadataDerivedIndex` SDK primitives.
276
+
235
277
  Mutation advisories reuse the same cycle semantics incrementally:
236
278
  `collectNewOrderingCycleWarnings` builds a lightweight ordering digraph
237
279
  directly from the before/after item snapshots (no full workspace assembly)
@@ -243,6 +285,10 @@ longer paying two whole-graph SCC analyses per dependency-bearing mutation.
243
285
 
244
286
  Aliases normalize at registry boundaries; stored values are not silently rewritten. Imports must carry or select a compatible registry version. Federation merges definitions before edges and rejects identifier or alias collisions. Rollback removes the custom definition and its derived index only after application-owned edges have been exported or superseded; immutable history is retained.
245
287
 
288
+ `planRelationshipEventBackfill(items, options)` is the side-effect-free bridge from legacy item `parent`, scalar `blocked_by`, and structured `dependencies` fields to the event platform. It uses the same workspace assembly and registry semantics as graph queries, so custom kinds, aliases, external targets, case normalization, duplicate-row governance, and explicit missing-target placeholders cannot drift between migration and reads. Input order does not affect the SHA-256 plan fingerprint, deterministic event ids, relationship ids, node universe, or event order. The plan reports total normalized edges, raw duplicate dependency groups, dangling internal references, and ids skipped through `existingEventIds` before any write occurs.
289
+
290
+ For a resumable migration, keep `migrationId`, `author`, and `timestamp` stable, inspect the plan evidence, open the store with `plan.nodes`, and publish with `appendBatch(..., { existingEventPolicy: "skip_identical" })`. Changing semantic input under the same migration id intentionally produces an event-id collision instead of silently rewriting history. A plan is not an authority transfer: legacy item/history files remain authoritative until the application explicitly switches its read adapter and records that cutover.
291
+
246
292
  Validation rejects missing endpoints, disallowed self-edges, cardinality violations at mutation boundaries, ordering-only cycles, and incompatible aliases or versions. Immutable graph snapshots deduplicate canonical edges deterministically, retaining the last supplied edge; mutation boundaries may reject duplicates before snapshot construction. Evidence freshness and application payload schemas are extension policy: the core preserves payloads but does not invent domain meaning.
247
293
 
248
294
  ## Consequences and non-goals
package/docs/SDK.md CHANGED
@@ -64,6 +64,7 @@ Source of truth:
64
64
  - [`src/sdk/graph/run.ts`](../src/sdk/graph/run.ts)
65
65
  - [`src/sdk/relationship-history.ts`](../src/sdk/relationship-history.ts)
66
66
  - [`src/sdk/relationship-context.ts`](../src/sdk/relationship-context.ts)
67
+ - [`src/sdk/context-signal-store.ts`](../src/sdk/context-signal-store.ts)
67
68
  - [`src/sdk/governance/validate.ts`](../src/sdk/governance/validate.ts)
68
69
  - [`src/sdk/governance/health.ts`](../src/sdk/governance/health.ts)
69
70
  - [`src/sdk/governance/gc.ts`](../src/sdk/governance/gc.ts)
@@ -161,8 +162,8 @@ Command/action contract exports:
161
162
  - `PmClient` / `runAction` (high-level in-process action execution for custom tools, bots, CI, and embedded runtimes)
162
163
  - Typed read primitives on `PmClient`: `get` (including `GetOptions.at` point-in-time reads), `list`, `search`, `context`, `next`, `aggregate`, and `stats`; direct `getItemAt` reconstructs a canonical historical document without mutation
163
164
  - Read primitive option/result contracts: `GetOptions` / `GetResult`, `ListOptions` / `ListResult`, `SearchOptions` / `SearchResult`, `ContextOptions` / `ContextResult`, `NextOptions` / `NextResult`, `AggregateOptions` / `AggregateResult`, `StatsCommandOptions` / `StatsResult`
164
- - Context relevance primitives: `buildItemContextRelevanceCandidates`, `defaultScoreContextCandidates`, `scoreContextCandidates`, `scoreContextCandidatesWithActiveExtensions`, `evaluateContextRanking`, `runContextEvaluationScenario`, `runContextEvaluationCorpus`, and `summarizeContextEvaluationReports`
165
- - Context relevance contracts: `ContextRelevanceCandidate`, `ContextRelevanceSignals`, `ContextRelevanceScorer`, `ContextRelevanceReport`, `ContextEvaluationReader`, `ContextEvaluationScenario`, `ContextEvaluationScenarioReport`, `ContextEvaluationThresholds`, and `ContextEvaluationCorpusReport`
165
+ - Context relevance primitives: `buildItemContextRelevanceCandidates`, `buildContextSignalSnapshot`, `ContextSignalStore`, `JsonFileContextSignalStoreAdapter`, `parseContextSignalSnapshot`, `defaultScoreContextCandidates`, `scoreContextCandidates`, `scoreContextCandidatesWithActiveExtensions`, `evaluateContextRanking`, `runContextEvaluationScenario`, `runContextEvaluationCorpus`, and `summarizeContextEvaluationReports`
166
+ - Context relevance contracts: `ContextRelevanceCandidate`, `ContextRelevanceSignals`, `ContextSignalSnapshot`, `ContextSignalStoreAdapter`, `ContextSignalStoreReadResult`, `ContextRelevanceScorer`, `ContextRelevanceReport`, `ContextEvaluationReader`, `ContextEvaluationScenario`, `ContextEvaluationScenarioReport`, `ContextEvaluationThresholds`, and `ContextEvaluationCorpusReport`
166
167
  - Context packing and feedback primitives: `packContextCandidates`, `recordContextUsageServing`, `recordContextUsageTouch`, `recordContextUsageTouches`, and `readContextUsageAffinity`
167
168
  - Typed annotation and relationship primitives on `PmClient`: `comments`, `notes`, `learnings`, `files`, `filesDiscover`, `docs`, `deps`, `graph`, and `append`
168
169
  - Workspace graph-query runner: `runGraph` (with `GraphCommandOptions`, `GraphResult`, and per-subcommand envelopes) resolves the workspace relationship graph through the shared fingerprint-keyed cache and dispatches bounded `ancestors`/`descendants`/`predecessors`/`successors`/`paths`/`impact`/`analyze`/`audit`/`communities`/`redundancy`/`dominators`/`slack`/`centrality`/`articulation`/`plan` queries with counts-first cost, truncation, and cache metadata; the `pm graph` CLI command and `pm_graph` MCP tool are thin adapters over it.
@@ -179,9 +180,11 @@ Command/action contract exports:
179
180
  - Linked-resource kernel primitives: `runFiles`, `runFilesDiscover`, `runDocs`, `runDeps`, `runLinkedArtifacts`, parsing/normalization/path-validation helpers, and their typed contracts. The CLI files/docs/deps modules are presentation-only re-exports of these SDK implementations.
180
181
  - Actionability primitives: `collectBlockedByIds`, `resolveItemBlockers`, `collectDependencyBlockedIds`, and `computeActionabilityReport` expose the same edge-aware blocked/ready definition used by `pm next`, `pm context`, and `pm list-blocked`. Embedded schedulers can therefore classify custom lifecycle schemas without importing CLI or core modules.
181
182
  - Dependency-governance primitives: `collectDanglingDependencyReferences`, `collectMissingDependencyTargetIds`, and `assembleWorkspaceRelationshipGraph` normalize hierarchy, scalar blockers, and structured dependencies into one graph while partitioning missing targets into actionable active holders, informational terminal-history holders, and the legacy `no-active-blocker` sentinel without mutating stored history.
182
- - Relationship graph primitives: `RelationshipKindRegistry`, `createRelationshipKindRegistry`, `RelationshipGraph`, `RelationshipEventLog`, `RelationshipEventStore`, `buildRelationshipContext`, `buildDepsRelationshipContext`, `hierarchyAncestors`, `hierarchyDescendants`, `orderingPredecessors`, `orderingSuccessors`, `enumerateRelationshipPaths`, `auditWorkspaceRelationshipGraph`, `isOrderingRelationshipKind`, and `dependencyToRelationship` provide application-defined edge semantics, durable replay, bounded semantic traversal, policy-aware governance, and explainable context queries. `RelationshipEventLog.stream/project` and their durable-store equivalents page immutable prefixes and fold them into deterministic application state with exact version, processed-count, and as-of metadata. See [Relationship graph semantics](RELATIONSHIP_GRAPH.md).
183
+ - Relationship graph primitives: `RelationshipKindRegistry`, `createRelationshipKindRegistry`, `RelationshipGraph`, `RelationshipEventLog`, `RelationshipEventStore`, `planRelationshipEventBackfill`, `buildRelationshipContext`, `buildDepsRelationshipContext`, `hierarchyAncestors`, `hierarchyDescendants`, `orderingPredecessors`, `orderingSuccessors`, `enumerateRelationshipPaths`, `auditWorkspaceRelationshipGraph`, `isOrderingRelationshipKind`, and `dependencyToRelationship` provide application-defined edge semantics, durable replay, deterministic legacy migration, bounded semantic traversal, policy-aware governance, and explainable context queries. `RelationshipEventLog.stream/project` and their durable-store equivalents page immutable prefixes and fold them into deterministic application state with exact version, processed-count, and as-of metadata. `RelationshipEventStore.appendBatch` validates a complete import under one cross-process lock and atomically publishes it; `skip_identical` resume mode rejects same-id semantic collisions. See [Relationship graph semantics](RELATIONSHIP_GRAPH.md).
183
184
  - Atomic application transactions: `commitWorkspaceTransaction` coordinates ordered, idempotent item and relationship mutations under one workspace writer lock and a durable replay journal. Interrupted work resumes from step inspection; ordinary failures append reverse-order compensations without rewriting immutable histories.
184
- - Multi-branch merge primitives: `mergeItemDocuments`, `mergeHistoryStreams`, `mergeRelationshipEventStreams`, `mergeJsonDocuments`, `runMergeDriver`, and `runMergeInstall` provide the same field-aware item, hash-chain-preserving history, sequence-renumbering relationship-event, and key-level configuration semantics as `pm merge`; `buildMergeAttributePatterns`, `refreshMergeAttributeFenceIfInstalled`, and `auditMergeAttributeFence` expose the fence coverage contract, the post-schema-mutation refresh, and the validate-side drift audit. See [Multi-Branch Merge Safety](MERGE_SAFETY.md).
185
+ - Multi-branch merge primitives: `mergeItemDocuments`, `mergeHistoryStreams`, `mergeRelationshipEventStreams`, `mergeJsonDocuments`, `runMergeDriver`, `runMergeInstall`, and `runMergeReconcile` provide the same field-aware item, hash-chain-preserving history, sequence-renumbering relationship-event, key-level configuration, and audited post-merge repair-and-verify semantics as `pm merge`; `buildMergeAttributePatterns`, `refreshMergeAttributeFenceIfInstalled`, and `auditMergeAttributeFence` expose the fence coverage contract, the post-schema-mutation refresh, and the validate-side drift audit. See [Multi-Branch Merge Safety](MERGE_SAFETY.md).
186
+ - Dependency provenance primitives: `EXTERNAL_DEPENDENCY_SOURCE_KIND`, `isExternalDependencySourceKind`, and `normalizeDependencySeedId` let custom importers preserve cross-workspace dependency ids explicitly while retaining local prefix normalization for ordinary seeds.
187
+ - Compile-cache lifecycle primitive: `pruneCompileCacheGenerations` bounds pm-owned Node bytecode caches to the current package generation; embedded hosts can apply the same upgrade cleanup without importing the executable entrypoint.
185
188
  - Typed mutation inputs (pm-x29o / GH-601): `PmCreateActionOptions`, `PmUpdateActionOptions`, and `PmCloseActionOptions` (`PmClientCloseActionOptions` on the client method) strip the permissive custom-field index signature from the executable command-option contracts, retaining their exact public keys and value types without a second hand-written shape; the free `create`/`update`/`close` functions and `PmClient` methods share those types. `PmUpdateManyActionOptions`, `PmCloseManyActionOptions`, and `OptionsFromContracts` cover flat action-contract composition. Field typos, object values, invalid scalar kinds, and MCP-only aliases on a `PmClient` command-option bag fail `tsc` under strict. Runtime-schema custom fields use the repeatable `field` option and `PmClient.run` remains the wide escape hatch. Projected list rows expose the typed `ListProjectedItemCore` fields (`row.id` is `string | undefined`, never `unknown`).
186
189
  - Typed customization primitives on `PmClient`: `init`, `config`, `schema`, `schemaList`, `schemaShow`, `schemaAddType`, `schemaRemoveType`, `schemaAddStatus`, `schemaRemoveStatus`, `schemaAddField`, `schemaRemoveField`, `schemaListFields`, `schemaShowField`, `schemaApplyPreset`, `schemaInferTypes`, `schemaShowStatus`, `profile`, `profileList`, `profileShow`, `profileApply`, and `profileLint`
187
190
  - Workspace-scaffold primitives: `ensurePmGitignore` and `getPmGitignoreBlock` let custom tools apply the same idempotent runtime/search cache policy as `pm init` without importing CLI internals.
@@ -1081,12 +1084,24 @@ the SDK search engine directly. Package authors can import these functions and
1081
1084
  their typed result contracts from `@unbrained/pm-cli/sdk` without importing CLI
1082
1085
  implementation modules.
1083
1086
 
1084
- List result rows are modeled by projection: `ListFullResult` contains complete
1087
+ List results always expose `total`, `has_more`, `truncated`, and a nullable
1088
+ `next_cursor`, whether or not the page was truncated; unset filter echoes are
1089
+ omitted. This stable, lean envelope lets agents plan continuation without
1090
+ branching on key presence. Result rows are modeled by projection:
1091
+ `ListFullResult` contains complete
1085
1092
  `ListedItem` records, tree ordering may enrich them with `ListTreeMetadata`, and
1086
1093
  compact or `fields` projections return `ListProjectedItem` dictionaries. Use
1087
1094
  `full: true` when an integration requires complete item metadata; the overload
1088
1095
  then returns `ListFullResult` without an assertion or cast.
1089
1096
 
1097
+ Migration note: before this contract, `total` was present only when pagination
1098
+ omitted rows, a completed page omitted `next_cursor`, and verbose results
1099
+ emitted unset filter keys with `null` values. Consumers must use `has_more` or
1100
+ `next_cursor != null` for continuation, read `total` as the unconditional
1101
+ pre-pagination match count, and use key presence for filter diagnostics;
1102
+ `"total" in result`, strict `next_cursor !== undefined`, and
1103
+ `filters.<key> === null` checks do not express the stable envelope semantics.
1104
+
1090
1105
  ### Execution and diagnostics
1091
1106
 
1092
1107
  Tracked by [pm-oslr](../.agents/pm/features/pm-oslr.toon) and the SDK boundary
@@ -1153,6 +1168,8 @@ compact rounded report metrics for stable machine output.
1153
1168
 
1154
1169
  Tracked by [pm-4k6b](../.agents/pm/features/pm-4k6b.toon),
1155
1170
  [pm-h3no](../.agents/pm/tasks/pm-h3no.toon),
1171
+ [pm-3hps](../.agents/pm/tasks/pm-3hps.toon),
1172
+ [pm-801d](../.agents/pm/features/pm-801d.toon),
1156
1173
  [pm-atfm](../.agents/pm/features/pm-atfm.toon), and
1157
1174
  [pm-qyc6](../.agents/pm/issues/pm-qyc6.toon).
1158
1175
 
@@ -1168,6 +1185,57 @@ throwing override degrades to the deterministic default and emits an
1168
1185
  `extension_context_relevance_invalid_result` warning instead of breaking the
1169
1186
  read path.
1170
1187
 
1188
+ For persistent derived signals, use `ContextSignalStore` with a caller-owned
1189
+ `ContextSignalStoreAdapter`, or use `JsonFileContextSignalStoreAdapter` for a
1190
+ same-directory atomic JSON snapshot. Each snapshot carries both a
1191
+ `format_version` and `signal_set_version`, the authoritative history or index
1192
+ `source_cursor`, the stable caller clock, and whether its items came from the
1193
+ `derived_index` or `scan_fallback` path. Item rows are deterministic and sorted;
1194
+ the snapshot never replaces item or history data.
1195
+
1196
+ `readOrRebuild(items, options)` reuses a snapshot only when the cursor and
1197
+ complete item-id set match. Missing, stale, version-incompatible, or corrupt
1198
+ state is rebuilt from the authoritative items and atomically replaced. The
1199
+ result reports `cache_status` and non-fatal `context_signal_store_stale`,
1200
+ `context_signal_store_invalid`, or `context_signal_store_write_failed`
1201
+ warnings. A write failure still serves the in-memory rebuilt candidates because
1202
+ the snapshot is derived, never authoritative. Optional maps for activity density,
1203
+ graph proximity, claim/focus, knowledge density, author affinity, usage
1204
+ affinity, and semantic similarity let an index or application-specific host
1205
+ supply richer signals without changing the canonical scorer contract.
1206
+
1207
+ ```ts
1208
+ import {
1209
+ ContextSignalStore,
1210
+ JsonFileContextSignalStoreAdapter,
1211
+ readSettings,
1212
+ resolvePmRoot,
1213
+ resolveRuntimeStatusRegistry,
1214
+ scoreContextCandidates,
1215
+ } from "@unbrained/pm-cli/sdk";
1216
+
1217
+ const pmRoot = resolvePmRoot(process.cwd());
1218
+ const statusRegistry = resolveRuntimeStatusRegistry(
1219
+ (await readSettings(pmRoot)).schema,
1220
+ );
1221
+ const store = new ContextSignalStore(
1222
+ new JsonFileContextSignalStoreAdapter(
1223
+ ".agents/pm/runtime/context-signals.json",
1224
+ ),
1225
+ );
1226
+ const signalRead = await store.readOrRebuild(itemsFromDerivedIndex, {
1227
+ statusRegistry,
1228
+ now: "2026-07-21T12:00:00.000Z",
1229
+ source: "derived_index",
1230
+ sourceCursor: historyCursor,
1231
+ activityDensity,
1232
+ graphProximity,
1233
+ semanticSimilarity,
1234
+ });
1235
+
1236
+ const report = await scoreContextCandidates(signalRead.candidates);
1237
+ ```
1238
+
1171
1239
  Use `--explain-ranking --json` on `pm context` or `pm next` to include the model,
1172
1240
  available signals, baseline rank, final rank, score, and per-signal
1173
1241
  contributions. Explanation data is opt-in so default agent output stays bounded.
@@ -2486,6 +2554,11 @@ By default the auto-created command only has a handler. Pass an optional third
2486
2554
  description, flags, intent, examples, failure hints, and positional arguments —
2487
2555
  surfaced in `--help` and runtime contracts exactly like `registerCommand`:
2488
2556
 
2557
+ When a package also registers a rich canonical nested command such as
2558
+ `csv export`, the compatible flattened adapter path (`csv-export export`)
2559
+ inherits that canonical description, arguments, and flags. Both help surfaces
2560
+ and option parsing therefore stay identical without duplicating metadata.
2561
+
2489
2562
  ```ts
2490
2563
  import { defineExtension } from "@unbrained/pm-cli/sdk";
2491
2564
 
package/marketplace.json CHANGED
@@ -6,14 +6,14 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Official marketplace for pm CLI — native git-based project management for Claude Code and AI coding agents.",
9
- "version": "2026.7.21"
9
+ "version": "2026.7.22"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "pm-claude",
14
14
  "source": "./plugins/pm-claude",
15
15
  "description": "Native pm CLI integration for Claude Code — 28 MCP tools, 5 workflow skills, 14 slash commands, 4 subagents, hybrid TUI task tracking, session context injection, and coordination subagents for git-based project management without leaving Claude Code.",
16
- "version": "2026.7.21",
16
+ "version": "2026.7.22",
17
17
  "author": {
18
18
  "name": "unbrained",
19
19
  "url": "https://github.com/unbraind/pm-cli"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-cli",
3
- "version": "2026.7.21",
3
+ "version": "2026.7.22",
4
4
  "description": "Git-native project management CLI for humans and agents.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.10.0",
@@ -80,7 +80,7 @@
80
80
  "lint:complexity:baseline": "eslint . --suppress-rule complexity --suppress-rule sonarjs/cognitive-complexity",
81
81
  "lint:duplicates": "jscpd --config .jscpd.json",
82
82
  "lint:codefactor": "pnpm quality:static",
83
- "quality:static": "pnpm build && pnpm exec tsx scripts/release/static-quality-gate.mts --max-eslint-suppressions 154 --max-coverage-ignore-pragmas 477 --min-docstring-coverage 100 --min-exported-docstring-coverage 100 --min-member-docstring-coverage 100 && node scripts/release/audit-package-boundary.mjs && node scripts/release/token-budget-gate.mjs",
83
+ "quality:static": "pnpm build && pnpm exec tsx scripts/release/static-quality-gate.mts --max-eslint-suppressions 150 --max-coverage-ignore-pragmas 477 --min-docstring-coverage 100 --min-exported-docstring-coverage 100 --min-member-docstring-coverage 100 && node scripts/release/audit-package-boundary.mjs && node scripts/release/token-budget-gate.mjs",
84
84
  "quality:token-budget": "node scripts/release/token-budget-gate.mjs",
85
85
  "quality:context-eval": "node scripts/release/context-eval-gate.mjs",
86
86
  "quality:docs-skills": "node scripts/release/docs-skills-gate.mjs",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-beads",
3
- "version": "2026.7.21",
3
+ "version": "2026.7.22",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party pm package for importing Beads JSONL records.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-calendar",
3
- "version": "2026.7.21",
3
+ "version": "2026.7.22",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party pm package for calendar and agenda views.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-command-kit",
3
- "version": "2026.7.21",
3
+ "version": "2026.7.22",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party pm exemplar package for the commands capability: registerCommand, registerFlags, and registerParser.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-governance-audit",
3
- "version": "2026.7.21",
3
+ "version": "2026.7.22",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party pm package for governance audit and normalization workflows.",