@unbrained/pm-cli 2026.7.20 → 2026.7.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (421) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +11 -0
  3. package/dist/cli/commander-usage.d.ts +1 -1
  4. package/dist/cli/commander-usage.js +5 -5
  5. package/dist/cli/commander-usage.js.map +1 -1
  6. package/dist/cli/commands/completion.js +13 -5
  7. package/dist/cli/commands/completion.js.map +1 -1
  8. package/dist/cli/commands/contracts.js +4 -3
  9. package/dist/cli/commands/contracts.js.map +1 -1
  10. package/dist/cli/error-guidance.d.ts +2 -0
  11. package/dist/cli/error-guidance.js +7 -2
  12. package/dist/cli/error-guidance.js.map +1 -1
  13. package/dist/cli/main.d.ts +1 -5
  14. package/dist/cli/main.js +12 -50
  15. package/dist/cli/main.js.map +1 -1
  16. package/dist/cli/register-list-query.js +13 -3
  17. package/dist/cli/register-list-query.js.map +1 -1
  18. package/dist/cli/register-mutation.js +45 -3
  19. package/dist/cli/register-mutation.js.map +1 -1
  20. package/dist/cli/register-structured-mutation.d.ts +14 -0
  21. package/dist/cli/register-structured-mutation.js +62 -0
  22. package/dist/cli/register-structured-mutation.js.map +1 -0
  23. package/dist/cli/registration-helpers.js +5 -3
  24. package/dist/cli/registration-helpers.js.map +1 -1
  25. package/dist/cli-bundle/bundle-manifest.json +280 -296
  26. package/dist/cli-bundle/chunks/{append-E6V54WOQ.js → append-7OVFYR3C.js} +3 -3
  27. package/dist/cli-bundle/chunks/{append-NNJ3EFIT.js → append-DFETHAZL.js} +3 -3
  28. package/dist/cli-bundle/chunks/{chunk-C3KD7U3T.js → chunk-2L6ZP22J.js} +241 -10
  29. package/dist/cli-bundle/chunks/chunk-2L6ZP22J.js.map +7 -0
  30. package/dist/cli-bundle/chunks/{chunk-KZEANWJS.js → chunk-4PUUNQDV.js} +98 -30
  31. package/dist/cli-bundle/chunks/chunk-4PUUNQDV.js.map +7 -0
  32. package/dist/cli-bundle/chunks/{chunk-RDV4ZFYS.js → chunk-4QOB7L7I.js} +7 -9
  33. package/dist/cli-bundle/chunks/{chunk-RDV4ZFYS.js.map → chunk-4QOB7L7I.js.map} +1 -1
  34. package/dist/cli-bundle/chunks/{chunk-3LPFHE3P.js → chunk-4QSQ6XDK.js} +62 -20
  35. package/dist/cli-bundle/chunks/chunk-4QSQ6XDK.js.map +1 -0
  36. package/dist/cli-bundle/chunks/{chunk-QJKL5PHS.js → chunk-7656MAUL.js} +2 -2
  37. package/dist/cli-bundle/chunks/{chunk-3AO5VSDR.js → chunk-7RW4JCU2.js} +328 -6
  38. package/dist/cli-bundle/chunks/chunk-7RW4JCU2.js.map +7 -0
  39. package/dist/cli-bundle/chunks/{chunk-X6K5XTTN.js → chunk-7W2UAXXT.js} +5 -5
  40. package/dist/cli-bundle/chunks/{chunk-SSKOQNMS.js → chunk-ABWCF646.js} +9 -11
  41. package/dist/cli-bundle/chunks/{chunk-SSKOQNMS.js.map → chunk-ABWCF646.js.map} +1 -1
  42. package/dist/cli-bundle/chunks/{chunk-WVA4DVNV.js → chunk-ADBTSVGK.js} +71 -33
  43. package/dist/cli-bundle/chunks/chunk-ADBTSVGK.js.map +7 -0
  44. package/dist/cli-bundle/chunks/{chunk-J4FBIFU6.js → chunk-AELMUANP.js} +12 -6
  45. package/dist/cli-bundle/chunks/chunk-AELMUANP.js.map +1 -0
  46. package/dist/cli-bundle/chunks/{chunk-4F6BWJ4J.js → chunk-AMJPSANK.js} +57 -36
  47. package/dist/cli-bundle/chunks/chunk-AMJPSANK.js.map +7 -0
  48. package/dist/cli-bundle/chunks/{chunk-6VIJ7UA5.js → chunk-AS4SAZ5R.js} +850 -819
  49. package/dist/cli-bundle/chunks/chunk-AS4SAZ5R.js.map +7 -0
  50. package/dist/cli-bundle/chunks/{chunk-SG74J6MV.js → chunk-ATBCUC7Y.js} +574 -5
  51. package/dist/cli-bundle/chunks/chunk-ATBCUC7Y.js.map +1 -0
  52. package/dist/cli-bundle/chunks/{chunk-5OK4UGFV.js → chunk-BXNDKOR2.js} +3 -3
  53. package/dist/cli-bundle/chunks/{chunk-KSPWRNVP.js → chunk-CPX275C6.js} +2 -2
  54. package/dist/cli-bundle/chunks/{chunk-JH2ZSLO3.js → chunk-DZRV2OPA.js} +2 -2
  55. package/dist/cli-bundle/chunks/{chunk-L7BH7IWU.js → chunk-E5XMKOSB.js} +2 -2
  56. package/dist/cli-bundle/chunks/{chunk-CQTQKUUV.js → chunk-EWJWSNRU.js} +3 -3
  57. package/dist/cli-bundle/chunks/{chunk-DAQ45GCS.js → chunk-F2LBF7XJ.js} +22 -15
  58. package/dist/cli-bundle/chunks/chunk-F2LBF7XJ.js.map +7 -0
  59. package/dist/cli-bundle/chunks/{chunk-6XMUURSS.js → chunk-FJIFFBJX.js} +64 -33
  60. package/dist/cli-bundle/chunks/chunk-FJIFFBJX.js.map +1 -0
  61. package/dist/cli-bundle/chunks/{chunk-E7ICD63T.js → chunk-FO6OSVEN.js} +4 -6
  62. package/dist/cli-bundle/chunks/{chunk-E7ICD63T.js.map → chunk-FO6OSVEN.js.map} +1 -1
  63. package/dist/cli-bundle/chunks/{chunk-3MCTMJXI.js → chunk-FPBMLYPI.js} +2 -2
  64. package/dist/cli-bundle/chunks/{chunk-UZDQXNUB.js → chunk-FSE2IKJQ.js} +46 -5
  65. package/dist/cli-bundle/chunks/chunk-FSE2IKJQ.js.map +1 -0
  66. package/dist/cli-bundle/chunks/{chunk-IX677TRO.js → chunk-GKX4NJ7U.js} +8 -10
  67. package/dist/cli-bundle/chunks/{chunk-IX677TRO.js.map → chunk-GKX4NJ7U.js.map} +1 -1
  68. package/dist/cli-bundle/chunks/{chunk-DVDBQA3B.js → chunk-GTK4DTEW.js} +5 -5
  69. package/dist/cli-bundle/chunks/chunk-H7EAER5L.js +974 -0
  70. package/dist/cli-bundle/chunks/chunk-H7EAER5L.js.map +1 -0
  71. package/dist/cli-bundle/chunks/{chunk-5UX66S6U.js → chunk-ICDAQ4TD.js} +316 -8
  72. package/dist/cli-bundle/chunks/chunk-ICDAQ4TD.js.map +1 -0
  73. package/dist/cli-bundle/chunks/{chunk-YQQNAKW3.js → chunk-JFD5LPMI.js} +6 -8
  74. package/dist/cli-bundle/chunks/{chunk-YQQNAKW3.js.map → chunk-JFD5LPMI.js.map} +1 -1
  75. package/dist/cli-bundle/chunks/{chunk-QANSTTC7.js → chunk-JXCW2TI2.js} +6 -8
  76. package/dist/cli-bundle/chunks/{chunk-QANSTTC7.js.map → chunk-JXCW2TI2.js.map} +1 -1
  77. package/dist/cli-bundle/chunks/{chunk-GSJSM5BJ.js → chunk-K36WV5J6.js} +76 -13
  78. package/dist/cli-bundle/chunks/chunk-K36WV5J6.js.map +1 -0
  79. package/dist/cli-bundle/chunks/{chunk-GVI6FAFG.js → chunk-K55VMLSS.js} +7 -5
  80. package/dist/cli-bundle/chunks/chunk-K55VMLSS.js.map +7 -0
  81. package/dist/cli-bundle/chunks/{chunk-GIQSU6S2.js → chunk-KBLZ3AA5.js} +2 -2
  82. package/dist/cli-bundle/chunks/{chunk-XJF7CDNH.js → chunk-KH44WBAT.js} +2 -2
  83. package/dist/cli-bundle/chunks/{chunk-GV2262OF.js → chunk-LAV26CQG.js} +2 -2
  84. package/dist/cli-bundle/chunks/{chunk-VDO2JMD4.js → chunk-LVC72YRD.js} +2 -2
  85. package/dist/cli-bundle/chunks/{chunk-3VY6MIEO.js → chunk-LZYP423P.js} +35 -6
  86. package/dist/cli-bundle/chunks/chunk-LZYP423P.js.map +7 -0
  87. package/dist/cli-bundle/chunks/{chunk-ZYPFOO3L.js → chunk-MATHDCGG.js} +3 -3
  88. package/dist/cli-bundle/chunks/{chunk-OV7MSW3I.js → chunk-MWQ2HC2A.js} +99 -31
  89. package/dist/cli-bundle/chunks/chunk-MWQ2HC2A.js.map +1 -0
  90. package/dist/cli-bundle/chunks/{chunk-NHT3F4WZ.js → chunk-NUF7ROFH.js} +840 -816
  91. package/dist/cli-bundle/chunks/chunk-NUF7ROFH.js.map +1 -0
  92. package/dist/cli-bundle/chunks/{chunk-AOEOYL3S.js → chunk-O4BCOJTZ.js} +3 -3
  93. package/dist/cli-bundle/chunks/{chunk-RJO3YAFM.js → chunk-OCUBRA6D.js} +2 -2
  94. package/dist/cli-bundle/chunks/{chunk-5IZJWSDB.js → chunk-OG5DVFMA.js} +22 -15
  95. package/dist/cli-bundle/chunks/chunk-OG5DVFMA.js.map +1 -0
  96. package/dist/cli-bundle/chunks/{chunk-I577UHC7.js → chunk-OR42SO64.js} +2 -2
  97. package/dist/cli-bundle/chunks/{chunk-ZOJ3LR7O.js → chunk-OY7DMU5P.js} +2 -2
  98. package/dist/cli-bundle/chunks/{chunk-HEWM6CEN.js → chunk-P7MTHPJQ.js} +50 -9
  99. package/dist/cli-bundle/chunks/chunk-P7MTHPJQ.js.map +7 -0
  100. package/dist/cli-bundle/chunks/{chunk-2BO4CA46.js → chunk-PFNHX655.js} +236 -12
  101. package/dist/cli-bundle/chunks/{chunk-2BO4CA46.js.map → chunk-PFNHX655.js.map} +1 -1
  102. package/dist/cli-bundle/chunks/{chunk-ZV2NTVMJ.js → chunk-PONKZPCJ.js} +2 -2
  103. package/dist/cli-bundle/chunks/{chunk-THAOZG4U.js → chunk-PQSEQD6E.js} +8 -6
  104. package/dist/cli-bundle/chunks/chunk-PQSEQD6E.js.map +1 -0
  105. package/dist/cli-bundle/chunks/chunk-PWDEHT3L.js +991 -0
  106. package/dist/cli-bundle/chunks/chunk-PWDEHT3L.js.map +7 -0
  107. package/dist/cli-bundle/chunks/{chunk-UX6SSO2I.js → chunk-PZC2FUOQ.js} +2 -2
  108. package/dist/cli-bundle/chunks/{chunk-WUVEBQW6.js → chunk-QG4GFLQ6.js} +3 -5
  109. package/dist/cli-bundle/chunks/{chunk-WUVEBQW6.js.map → chunk-QG4GFLQ6.js.map} +1 -1
  110. package/dist/cli-bundle/chunks/{chunk-VQIHNHMJ.js → chunk-QIH77CAG.js} +2 -2
  111. package/dist/cli-bundle/chunks/{chunk-R3EWPG4A.js → chunk-QJIKE24M.js} +2 -2
  112. package/dist/cli-bundle/chunks/{chunk-QLZ643FM.js → chunk-QOOTOD3W.js} +10 -12
  113. package/dist/cli-bundle/chunks/{chunk-QLZ643FM.js.map → chunk-QOOTOD3W.js.map} +1 -1
  114. package/dist/cli-bundle/chunks/{chunk-MYSS5H2A.js → chunk-R3P6FZJW.js} +5 -7
  115. package/dist/cli-bundle/chunks/{chunk-MYSS5H2A.js.map → chunk-R3P6FZJW.js.map} +1 -1
  116. package/dist/cli-bundle/chunks/{chunk-G3COA6GS.js → chunk-RNPZYNHS.js} +56 -35
  117. package/dist/cli-bundle/chunks/chunk-RNPZYNHS.js.map +1 -0
  118. package/dist/cli-bundle/chunks/{chunk-T44FMVRL.js → chunk-RPESLSO5.js} +62 -20
  119. package/dist/cli-bundle/chunks/chunk-RPESLSO5.js.map +7 -0
  120. package/dist/cli-bundle/chunks/{chunk-INSTSQNZ.js → chunk-SY4SFZSD.js} +595 -3
  121. package/dist/cli-bundle/chunks/chunk-SY4SFZSD.js.map +7 -0
  122. package/dist/cli-bundle/chunks/{chunk-HB3P4M52.js → chunk-TRSHFPRZ.js} +2 -2
  123. package/dist/cli-bundle/chunks/{chunk-HRW7GF6T.js → chunk-UCBDQI5E.js} +2 -2
  124. package/dist/cli-bundle/chunks/{chunk-4U4Z6AHI.js → chunk-V22ZPOKN.js} +2 -2
  125. package/dist/cli-bundle/chunks/{chunk-JM6YAXTR.js → chunk-VHXHVTUU.js} +2 -2
  126. package/dist/cli-bundle/chunks/{chunk-LPEYZRUR.js → chunk-VJQG4BIM.js} +35 -6
  127. package/dist/cli-bundle/chunks/chunk-VJQG4BIM.js.map +1 -0
  128. package/dist/cli-bundle/chunks/{chunk-D6NXDNP3.js → chunk-VLRGDBLY.js} +2 -2
  129. package/dist/cli-bundle/chunks/{chunk-JAPE62Y5.js → chunk-VNTCM3VW.js} +3 -3
  130. package/dist/cli-bundle/chunks/{chunk-FDHPAVVB.js → chunk-VXOOB6YX.js} +2 -2
  131. package/dist/cli-bundle/chunks/{chunk-GFQP7HAZ.js → chunk-VZIZB6QH.js} +3 -5
  132. package/dist/cli-bundle/chunks/{chunk-GFQP7HAZ.js.map → chunk-VZIZB6QH.js.map} +1 -1
  133. package/dist/cli-bundle/chunks/{chunk-HQ3SB4CN.js → chunk-X3W65QK3.js} +2 -2
  134. package/dist/cli-bundle/chunks/{chunk-RZJLNXFG.js → chunk-XJTABV3X.js} +3 -3
  135. package/dist/cli-bundle/chunks/{chunk-GVT754PX.js → chunk-YCIUJJOD.js} +11 -5
  136. package/dist/cli-bundle/chunks/chunk-YCIUJJOD.js.map +7 -0
  137. package/dist/cli-bundle/chunks/{chunk-IJNK6WW2.js → chunk-Z75ONV25.js} +75 -12
  138. package/dist/cli-bundle/chunks/chunk-Z75ONV25.js.map +7 -0
  139. package/dist/cli-bundle/chunks/{chunk-4L23AGQ7.js → chunk-Z7VWXXJM.js} +5 -7
  140. package/dist/cli-bundle/chunks/{chunk-4L23AGQ7.js.map → chunk-Z7VWXXJM.js.map} +1 -1
  141. package/dist/cli-bundle/chunks/{chunk-YBT7O4KT.js → chunk-ZTVA4KLN.js} +4 -6
  142. package/dist/cli-bundle/chunks/{chunk-YBT7O4KT.js.map → chunk-ZTVA4KLN.js.map} +1 -1
  143. package/dist/cli-bundle/chunks/{chunk-TYHJDFYW.js → chunk-ZVZGXPQ5.js} +2 -2
  144. package/dist/cli-bundle/chunks/{close-many-SDA426VT.js → close-many-5RZXVN4J.js} +5 -6
  145. package/dist/cli-bundle/chunks/{close-many-UTZANOCQ.js → close-many-RZVTUGBG.js} +5 -6
  146. package/dist/cli-bundle/chunks/{comments-LZN6FXXC.js → comments-TPU7QRBL.js} +4 -4
  147. package/dist/cli-bundle/chunks/{comments-VBQ345ND.js → comments-Z4KV6FU3.js} +4 -4
  148. package/dist/cli-bundle/chunks/{create-GG4RBCGC.js → create-EIFBIVNQ.js} +6 -6
  149. package/dist/cli-bundle/chunks/{create-JBC5KUW6.js → create-RGSPN5GD.js} +6 -6
  150. package/dist/cli-bundle/chunks/{deps-FI4O6NQS.js → deps-UH5EQQUY.js} +3 -3
  151. package/dist/cli-bundle/chunks/{deps-DELOO4TL.js → deps-YG7UF3VR.js} +3 -3
  152. package/dist/cli-bundle/chunks/{docs-6Z2MP526.js → docs-G32TK6XS.js} +4 -4
  153. package/dist/cli-bundle/chunks/{docs-2UYBP5D6.js → docs-JWWNRC27.js} +4 -4
  154. package/dist/cli-bundle/chunks/{files-HKEAN5MA.js → files-3H32UQ4K.js} +4 -4
  155. package/dist/cli-bundle/chunks/{files-HEUGSJZL.js → files-4ALMCSKB.js} +4 -4
  156. package/dist/cli-bundle/chunks/{history-compact-7NDVP3PT.js → history-compact-77BT2LUB.js} +3 -4
  157. package/dist/cli-bundle/chunks/{history-compact-65YVN5DB.js → history-compact-VCKGTX64.js} +3 -4
  158. package/dist/cli-bundle/chunks/{history-redact-7YBL4XSG.js → history-redact-LJPZPNFA.js} +2 -3
  159. package/dist/cli-bundle/chunks/{history-redact-IZGNJBU4.js → history-redact-PWTTJ3XS.js} +2 -3
  160. package/dist/cli-bundle/chunks/{history-repair-7M4PYQUH.js → history-repair-I7CBNCV3.js} +5 -6
  161. package/dist/cli-bundle/chunks/{history-repair-GNGETJLI.js → history-repair-YTDZRK5E.js} +5 -6
  162. package/dist/cli-bundle/chunks/{learnings-3YXDRWFT.js → learnings-CYNOICKR.js} +4 -4
  163. package/dist/cli-bundle/chunks/{learnings-ALC6IMNL.js → learnings-KTYW3AL7.js} +4 -4
  164. package/dist/cli-bundle/chunks/{notes-7JMLQ447.js → notes-FGO63FXL.js} +4 -4
  165. package/dist/cli-bundle/chunks/{notes-JFCLTC5C.js → notes-ZERD3KB2.js} +4 -4
  166. package/dist/cli-bundle/chunks/{plan-T3XB3WTK.js → plan-OFJUBIM5.js} +7 -7
  167. package/dist/cli-bundle/chunks/{plan-KOIPWVOZ.js → plan-SGCDDTYR.js} +7 -7
  168. package/dist/cli-bundle/chunks/{profile-OILJHKUW.js → profile-3THJPIQY.js} +4 -5
  169. package/dist/cli-bundle/chunks/{profile-RJXA7PGS.js → profile-XEZAMMBW.js} +4 -5
  170. package/dist/cli-bundle/chunks/{register-list-query-CFVG75P3.js → register-list-query-BR435Q2H.js} +19 -16
  171. package/dist/cli-bundle/chunks/register-list-query-BR435Q2H.js.map +1 -0
  172. package/dist/cli-bundle/chunks/{register-list-query-E7UVY4TN.js → register-list-query-RWTWLOBE.js} +18 -15
  173. package/dist/cli-bundle/chunks/register-list-query-RWTWLOBE.js.map +7 -0
  174. package/dist/cli-bundle/chunks/{register-mutation-IQ55E25C.js → register-mutation-HLWC2WNP.js} +167 -31
  175. package/dist/cli-bundle/chunks/register-mutation-HLWC2WNP.js.map +1 -0
  176. package/dist/cli-bundle/chunks/{register-mutation-4VJTXBZW.js → register-mutation-ZJX5AZM5.js} +173 -30
  177. package/dist/cli-bundle/chunks/register-mutation-ZJX5AZM5.js.map +7 -0
  178. package/dist/cli-bundle/chunks/{register-operations-AR7RMX4W.js → register-operations-744YBJMV.js} +23 -25
  179. package/dist/cli-bundle/chunks/{register-operations-AR7RMX4W.js.map → register-operations-744YBJMV.js.map} +1 -1
  180. package/dist/cli-bundle/chunks/{register-operations-NOLZGORC.js → register-operations-UEBJH6AN.js} +21 -23
  181. package/dist/cli-bundle/chunks/{register-operations-NOLZGORC.js.map → register-operations-UEBJH6AN.js.map} +1 -1
  182. package/dist/cli-bundle/chunks/{register-setup-EYZ7VTPZ.js → register-setup-5DA4UZXI.js} +7 -8
  183. package/dist/cli-bundle/chunks/{register-setup-EYZ7VTPZ.js.map → register-setup-5DA4UZXI.js.map} +1 -1
  184. package/dist/cli-bundle/chunks/{register-setup-BB77VUEE.js → register-setup-6H25M3BH.js} +9 -10
  185. package/dist/cli-bundle/chunks/{register-setup-BB77VUEE.js.map → register-setup-6H25M3BH.js.map} +1 -1
  186. package/dist/cli-bundle/chunks/{restore-ZH65GZFB.js → restore-6TDVSATY.js} +4 -5
  187. package/dist/cli-bundle/chunks/{restore-L6IAGOD7.js → restore-RSL7C7LO.js} +4 -5
  188. package/dist/cli-bundle/chunks/{schema-4ERWM5QJ.js → schema-HFXFSGPG.js} +2 -3
  189. package/dist/cli-bundle/chunks/{schema-55DL3Q52.js → schema-TPVTIJPO.js} +2 -3
  190. package/dist/cli-bundle/chunks/{update-FW6FKDOP.js → update-LJZCL5SI.js} +7 -7
  191. package/dist/cli-bundle/chunks/{update-TJHSPRPT.js → update-SIA7LH5Y.js} +7 -7
  192. package/dist/cli-bundle/chunks/{update-many-PWXX5WHO.js → update-many-BDBZVGQL.js} +11 -12
  193. package/dist/cli-bundle/chunks/{update-many-NNALYQCN.js → update-many-MOY3A5B3.js} +11 -12
  194. package/dist/cli-bundle/main.js +60 -85
  195. package/dist/cli-bundle/main.js.map +2 -2
  196. package/dist/cli-bundle/sdk-runtime.js +37 -37
  197. package/dist/cli-bundle/sdk.js +126 -291
  198. package/dist/cli-bundle/sdk.js.map +4 -4
  199. package/dist/core/item/parse.d.ts +1 -1
  200. package/dist/core/item/parse.js +13 -7
  201. package/dist/core/item/parse.js.map +1 -1
  202. package/dist/core/output/mutation-projection.d.ts +2 -0
  203. package/dist/core/output/mutation-projection.js +33 -2
  204. package/dist/core/output/mutation-projection.js.map +1 -1
  205. package/dist/core/output/output.d.ts +4 -0
  206. package/dist/core/output/output.js +18 -13
  207. package/dist/core/output/output.js.map +1 -1
  208. package/dist/core/shared/command-types.d.ts +4 -0
  209. package/dist/core/shared/command-types.js +2 -2
  210. package/dist/core/shared/command-types.js.map +1 -1
  211. package/dist/mcp/server.js +39 -4
  212. package/dist/mcp/server.js.map +1 -1
  213. package/dist/mcp/tool-definitions.js +45 -4
  214. package/dist/mcp/tool-definitions.js.map +1 -1
  215. package/dist/sdk/cli-bootstrap.d.ts +2 -0
  216. package/dist/sdk/cli-bootstrap.js +20 -27
  217. package/dist/sdk/cli-bootstrap.js.map +1 -1
  218. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  219. package/dist/sdk/cli-contracts/enum-contracts.js +7 -2
  220. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  221. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  222. package/dist/sdk/cli-contracts/flag-contracts.js +21 -2
  223. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  224. package/dist/sdk/cli-contracts/tool-option-contracts.js +10 -2
  225. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  226. package/dist/sdk/cli-contracts/tool-parameter-tables.js +16 -3
  227. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  228. package/dist/sdk/cli-contracts/tool-schema.js +6 -2
  229. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  230. package/dist/sdk/cli-contracts.d.ts +1 -1
  231. package/dist/sdk/cli-contracts.js +3 -3
  232. package/dist/sdk/cli-contracts.js.map +1 -1
  233. package/dist/sdk/cli-program.js +4 -2
  234. package/dist/sdk/cli-program.js.map +1 -1
  235. package/dist/sdk/dependencies.d.ts +3 -2
  236. package/dist/sdk/dependencies.js +13 -12
  237. package/dist/sdk/dependencies.js.map +1 -1
  238. package/dist/sdk/error-runtime.d.ts +10 -0
  239. package/dist/sdk/error-runtime.js +59 -0
  240. package/dist/sdk/error-runtime.js.map +1 -0
  241. package/dist/sdk/graph/analytics.d.ts +9 -0
  242. package/dist/sdk/graph/analytics.js +24 -13
  243. package/dist/sdk/graph/analytics.js.map +1 -1
  244. package/dist/sdk/graph/assembly.d.ts +39 -0
  245. package/dist/sdk/graph/assembly.js +92 -12
  246. package/dist/sdk/graph/assembly.js.map +1 -1
  247. package/dist/sdk/graph/cache.d.ts +4 -1
  248. package/dist/sdk/graph/cache.js +17 -4
  249. package/dist/sdk/graph/cache.js.map +1 -1
  250. package/dist/sdk/graph/centrality.d.ts +82 -0
  251. package/dist/sdk/graph/centrality.js +259 -0
  252. package/dist/sdk/graph/centrality.js.map +1 -0
  253. package/dist/sdk/graph/durable-cache.d.ts +71 -0
  254. package/dist/sdk/graph/durable-cache.js +205 -0
  255. package/dist/sdk/graph/durable-cache.js.map +1 -0
  256. package/dist/sdk/graph/governance.d.ts +69 -1
  257. package/dist/sdk/graph/governance.js +143 -35
  258. package/dist/sdk/graph/governance.js.map +1 -1
  259. package/dist/sdk/graph/index.d.ts +7 -4
  260. package/dist/sdk/graph/index.js +8 -5
  261. package/dist/sdk/graph/index.js.map +1 -1
  262. package/dist/sdk/graph/mutation-advisory.d.ts +35 -4
  263. package/dist/sdk/graph/mutation-advisory.js +124 -35
  264. package/dist/sdk/graph/mutation-advisory.js.map +1 -1
  265. package/dist/sdk/graph/remediation.js +12 -2
  266. package/dist/sdk/graph/remediation.js.map +1 -1
  267. package/dist/sdk/graph/run.d.ts +133 -2
  268. package/dist/sdk/graph/run.js +217 -8
  269. package/dist/sdk/graph/run.js.map +1 -1
  270. package/dist/sdk/graph/scheduling.d.ts +59 -0
  271. package/dist/sdk/graph/scheduling.js +125 -0
  272. package/dist/sdk/graph/scheduling.js.map +1 -0
  273. package/dist/sdk/graph/traversal.d.ts +11 -0
  274. package/dist/sdk/graph/traversal.js +16 -2
  275. package/dist/sdk/graph/traversal.js.map +1 -1
  276. package/dist/sdk/index.d.ts +4 -0
  277. package/dist/sdk/index.js +6 -2
  278. package/dist/sdk/index.js.map +1 -1
  279. package/dist/sdk/runtime-input.js +7 -2
  280. package/dist/sdk/runtime-input.js.map +1 -1
  281. package/dist/sdk/runtime-primitives.d.ts +10 -0
  282. package/dist/sdk/runtime-primitives.js +14 -0
  283. package/dist/sdk/runtime-primitives.js.map +1 -0
  284. package/dist/sdk/runtime.d.ts +15 -0
  285. package/dist/sdk/runtime.js +16 -3
  286. package/dist/sdk/runtime.js.map +1 -1
  287. package/dist/sdk/structured-mutations.d.ts +21 -0
  288. package/dist/sdk/structured-mutations.js +375 -0
  289. package/dist/sdk/structured-mutations.js.map +1 -0
  290. package/docs/COMMANDS.md +85 -5
  291. package/docs/RELATIONSHIP_GRAPH.md +48 -7
  292. package/docs/SDK.md +78 -3
  293. package/marketplace.json +2 -2
  294. package/package.json +1 -1
  295. package/packages/pm-beads/package.json +1 -1
  296. package/packages/pm-calendar/package.json +1 -1
  297. package/packages/pm-command-kit/package.json +1 -1
  298. package/packages/pm-governance-audit/package.json +1 -1
  299. package/packages/pm-guide-shell/package.json +1 -1
  300. package/packages/pm-kanban/package.json +1 -1
  301. package/packages/pm-lifecycle-hooks/package.json +1 -1
  302. package/packages/pm-linked-test-adapters/package.json +1 -1
  303. package/packages/pm-search-advanced/package.json +1 -1
  304. package/packages/pm-templates/package.json +1 -1
  305. package/packages/pm-todos/package.json +1 -1
  306. package/packages/pm-vcs/package.json +1 -1
  307. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  308. package/plugins/pm-claude/README.md +5 -3
  309. package/plugins/pm-claude/commands/pm-init.md +1 -1
  310. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  311. package/dist/cli-bundle/chunks/chunk-3AO5VSDR.js.map +0 -7
  312. package/dist/cli-bundle/chunks/chunk-3LPFHE3P.js.map +0 -1
  313. package/dist/cli-bundle/chunks/chunk-3VY6MIEO.js.map +0 -7
  314. package/dist/cli-bundle/chunks/chunk-4F6BWJ4J.js.map +0 -7
  315. package/dist/cli-bundle/chunks/chunk-5IZJWSDB.js.map +0 -1
  316. package/dist/cli-bundle/chunks/chunk-5UX66S6U.js.map +0 -1
  317. package/dist/cli-bundle/chunks/chunk-6C2ZZX5Z.js +0 -286
  318. package/dist/cli-bundle/chunks/chunk-6C2ZZX5Z.js.map +0 -1
  319. package/dist/cli-bundle/chunks/chunk-6VIJ7UA5.js.map +0 -7
  320. package/dist/cli-bundle/chunks/chunk-6XMUURSS.js.map +0 -1
  321. package/dist/cli-bundle/chunks/chunk-C3KD7U3T.js.map +0 -7
  322. package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js +0 -334
  323. package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js.map +0 -1
  324. package/dist/cli-bundle/chunks/chunk-DAQ45GCS.js.map +0 -7
  325. package/dist/cli-bundle/chunks/chunk-E6LEMURX.js +0 -249
  326. package/dist/cli-bundle/chunks/chunk-E6LEMURX.js.map +0 -7
  327. package/dist/cli-bundle/chunks/chunk-G3COA6GS.js.map +0 -1
  328. package/dist/cli-bundle/chunks/chunk-GSJSM5BJ.js.map +0 -1
  329. package/dist/cli-bundle/chunks/chunk-GVI6FAFG.js.map +0 -7
  330. package/dist/cli-bundle/chunks/chunk-GVT754PX.js.map +0 -7
  331. package/dist/cli-bundle/chunks/chunk-HEWM6CEN.js.map +0 -7
  332. package/dist/cli-bundle/chunks/chunk-IJNK6WW2.js.map +0 -7
  333. package/dist/cli-bundle/chunks/chunk-INSTSQNZ.js.map +0 -7
  334. package/dist/cli-bundle/chunks/chunk-J4FBIFU6.js.map +0 -1
  335. package/dist/cli-bundle/chunks/chunk-KZEANWJS.js.map +0 -7
  336. package/dist/cli-bundle/chunks/chunk-LPEYZRUR.js.map +0 -1
  337. package/dist/cli-bundle/chunks/chunk-NHT3F4WZ.js.map +0 -1
  338. package/dist/cli-bundle/chunks/chunk-OV7MSW3I.js.map +0 -1
  339. package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js +0 -246
  340. package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js.map +0 -1
  341. package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js +0 -344
  342. package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js.map +0 -7
  343. package/dist/cli-bundle/chunks/chunk-SG74J6MV.js.map +0 -1
  344. package/dist/cli-bundle/chunks/chunk-T44FMVRL.js.map +0 -7
  345. package/dist/cli-bundle/chunks/chunk-THAOZG4U.js.map +0 -1
  346. package/dist/cli-bundle/chunks/chunk-UQLXSG72.js +0 -289
  347. package/dist/cli-bundle/chunks/chunk-UQLXSG72.js.map +0 -7
  348. package/dist/cli-bundle/chunks/chunk-UZDQXNUB.js.map +0 -1
  349. package/dist/cli-bundle/chunks/chunk-WVA4DVNV.js.map +0 -7
  350. package/dist/cli-bundle/chunks/register-list-query-CFVG75P3.js.map +0 -1
  351. package/dist/cli-bundle/chunks/register-list-query-E7UVY4TN.js.map +0 -7
  352. package/dist/cli-bundle/chunks/register-mutation-4VJTXBZW.js.map +0 -7
  353. package/dist/cli-bundle/chunks/register-mutation-IQ55E25C.js.map +0 -1
  354. /package/dist/cli-bundle/chunks/{append-E6V54WOQ.js.map → append-7OVFYR3C.js.map} +0 -0
  355. /package/dist/cli-bundle/chunks/{append-NNJ3EFIT.js.map → append-DFETHAZL.js.map} +0 -0
  356. /package/dist/cli-bundle/chunks/{chunk-QJKL5PHS.js.map → chunk-7656MAUL.js.map} +0 -0
  357. /package/dist/cli-bundle/chunks/{chunk-X6K5XTTN.js.map → chunk-7W2UAXXT.js.map} +0 -0
  358. /package/dist/cli-bundle/chunks/{chunk-5OK4UGFV.js.map → chunk-BXNDKOR2.js.map} +0 -0
  359. /package/dist/cli-bundle/chunks/{chunk-KSPWRNVP.js.map → chunk-CPX275C6.js.map} +0 -0
  360. /package/dist/cli-bundle/chunks/{chunk-JH2ZSLO3.js.map → chunk-DZRV2OPA.js.map} +0 -0
  361. /package/dist/cli-bundle/chunks/{chunk-L7BH7IWU.js.map → chunk-E5XMKOSB.js.map} +0 -0
  362. /package/dist/cli-bundle/chunks/{chunk-CQTQKUUV.js.map → chunk-EWJWSNRU.js.map} +0 -0
  363. /package/dist/cli-bundle/chunks/{chunk-3MCTMJXI.js.map → chunk-FPBMLYPI.js.map} +0 -0
  364. /package/dist/cli-bundle/chunks/{chunk-DVDBQA3B.js.map → chunk-GTK4DTEW.js.map} +0 -0
  365. /package/dist/cli-bundle/chunks/{chunk-GIQSU6S2.js.map → chunk-KBLZ3AA5.js.map} +0 -0
  366. /package/dist/cli-bundle/chunks/{chunk-XJF7CDNH.js.map → chunk-KH44WBAT.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{chunk-GV2262OF.js.map → chunk-LAV26CQG.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{chunk-VDO2JMD4.js.map → chunk-LVC72YRD.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{chunk-ZYPFOO3L.js.map → chunk-MATHDCGG.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{chunk-AOEOYL3S.js.map → chunk-O4BCOJTZ.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{chunk-RJO3YAFM.js.map → chunk-OCUBRA6D.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{chunk-I577UHC7.js.map → chunk-OR42SO64.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{chunk-ZOJ3LR7O.js.map → chunk-OY7DMU5P.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{chunk-ZV2NTVMJ.js.map → chunk-PONKZPCJ.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{chunk-UX6SSO2I.js.map → chunk-PZC2FUOQ.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{chunk-VQIHNHMJ.js.map → chunk-QIH77CAG.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{chunk-R3EWPG4A.js.map → chunk-QJIKE24M.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{chunk-HB3P4M52.js.map → chunk-TRSHFPRZ.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{chunk-HRW7GF6T.js.map → chunk-UCBDQI5E.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{chunk-4U4Z6AHI.js.map → chunk-V22ZPOKN.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{chunk-JM6YAXTR.js.map → chunk-VHXHVTUU.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{chunk-D6NXDNP3.js.map → chunk-VLRGDBLY.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{chunk-JAPE62Y5.js.map → chunk-VNTCM3VW.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{chunk-FDHPAVVB.js.map → chunk-VXOOB6YX.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{chunk-HQ3SB4CN.js.map → chunk-X3W65QK3.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{chunk-RZJLNXFG.js.map → chunk-XJTABV3X.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{chunk-TYHJDFYW.js.map → chunk-ZVZGXPQ5.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{close-many-SDA426VT.js.map → close-many-5RZXVN4J.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{close-many-UTZANOCQ.js.map → close-many-RZVTUGBG.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{comments-LZN6FXXC.js.map → comments-TPU7QRBL.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{comments-VBQ345ND.js.map → comments-Z4KV6FU3.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{create-GG4RBCGC.js.map → create-EIFBIVNQ.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{create-JBC5KUW6.js.map → create-RGSPN5GD.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{deps-FI4O6NQS.js.map → deps-UH5EQQUY.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{deps-DELOO4TL.js.map → deps-YG7UF3VR.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{docs-6Z2MP526.js.map → docs-G32TK6XS.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{docs-2UYBP5D6.js.map → docs-JWWNRC27.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{files-HKEAN5MA.js.map → files-3H32UQ4K.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{files-HEUGSJZL.js.map → files-4ALMCSKB.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{history-compact-7NDVP3PT.js.map → history-compact-77BT2LUB.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{history-compact-65YVN5DB.js.map → history-compact-VCKGTX64.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{history-redact-7YBL4XSG.js.map → history-redact-LJPZPNFA.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{history-redact-IZGNJBU4.js.map → history-redact-PWTTJ3XS.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{history-repair-7M4PYQUH.js.map → history-repair-I7CBNCV3.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{history-repair-GNGETJLI.js.map → history-repair-YTDZRK5E.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{learnings-3YXDRWFT.js.map → learnings-CYNOICKR.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{learnings-ALC6IMNL.js.map → learnings-KTYW3AL7.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{notes-7JMLQ447.js.map → notes-FGO63FXL.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{notes-JFCLTC5C.js.map → notes-ZERD3KB2.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{plan-T3XB3WTK.js.map → plan-OFJUBIM5.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{plan-KOIPWVOZ.js.map → plan-SGCDDTYR.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{profile-OILJHKUW.js.map → profile-3THJPIQY.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{profile-RJXA7PGS.js.map → profile-XEZAMMBW.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{restore-ZH65GZFB.js.map → restore-6TDVSATY.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{restore-L6IAGOD7.js.map → restore-RSL7C7LO.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{schema-4ERWM5QJ.js.map → schema-HFXFSGPG.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{schema-55DL3Q52.js.map → schema-TPVTIJPO.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{update-FW6FKDOP.js.map → update-LJZCL5SI.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{update-TJHSPRPT.js.map → update-SIA7LH5Y.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{update-many-PWXX5WHO.js.map → update-many-BDBZVGQL.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{update-many-NNALYQCN.js.map → update-many-MOY3A5B3.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","sources":["sdk/graph/run.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/graph/run\n *\n * Workspace-facing `pm graph` runner: one thin orchestrator that loads the\n * tracker once, resolves the fingerprint-keyed workspace assembly through the\n * shared graph cache, and dispatches bounded traversal, path, impact,\n * analytics, governance-audit, and remediation-planning queries through the\n * public graph toolkit. Every projection is counts-first, deterministic, and\n * carries explicit cost, truncation, and cache metadata so agents can budget\n * follow-up reads without re-scanning the workspace; identical repeated\n * queries in long-lived hosts are answered from the memoized snapshot.\n */\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { isTerminalStatus } from \"../../core/item/status.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { listAllItemMetadataLight } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport {\n parseDirection,\n parseKinds,\n parseMaxDepth,\n parsePositiveInteger,\n} from \"../dependencies.js\";\nimport {\n analyzeGraphImpact,\n analyzeKnowledgeGraph,\n analyzeRelationshipExecution,\n} from \"../relationship-analytics.js\";\nimport type { RelationshipQueryMeta } from \"../relationships.js\";\nimport {\n computeRelationshipDominators,\n detectRelationshipCommunities,\n findRedundantRelationshipEdges,\n} from \"./analytics.js\";\nimport {\n assembleWorkspaceRelationshipGraph,\n type WorkspaceRelationshipAssembly,\n} from \"./assembly.js\";\nimport {\n computeWorkspaceGraphFingerprint,\n workspaceGraphCache,\n type GraphCacheMetadata,\n} from \"./cache.js\";\nimport {\n auditWorkspaceRelationshipGraph,\n type RelationshipAuditReport,\n} from \"./governance.js\";\nimport {\n planRelationshipRemediation,\n type RelationshipRemediationStep,\n} from \"./remediation.js\";\nimport {\n enumerateRelationshipPaths,\n hierarchyAncestors,\n hierarchyDescendants,\n orderingPredecessors,\n orderingSuccessors,\n} from \"./traversal.js\";\n\nimport {\n GRAPH_SUBCOMMAND_VALUES,\n type GraphSubcommand,\n} from \"../cli-contracts/enum-contracts.js\";\n\nexport { GRAPH_SUBCOMMAND_VALUES, type GraphSubcommand };\n\n/** Graph subcommands that require a root item id. */\nconst ROOTED_SUBCOMMANDS = new Set<GraphSubcommand>([\n \"ancestors\",\n \"descendants\",\n \"predecessors\",\n \"successors\",\n \"paths\",\n \"impact\",\n \"dominators\",\n]);\n\n/** Default bounded sample rows returned by analyze/audit projections. */\nconst DEFAULT_SAMPLE_LIMIT = 10;\n\n/** Documents the graph command options payload exchanged by command, SDK, and package integrations. */\nexport interface GraphCommandOptions {\n /** Restricts traversal to registered relationship kinds (repeatable or comma-separated). */\n kind?: string | string[];\n /** Maximum traversal depth as a non-negative integer. */\n maxDepth?: string | number;\n /** Maximum returned rows per bounded collection. */\n limit?: string | number;\n /** Resume a traversal after this previously returned node id. */\n after?: string;\n /** Edge orientation for paths and impact queries (outgoing, incoming, or both). */\n direction?: string;\n /** Maximum enumerated paths for the paths subcommand. */\n maxPaths?: string | number;\n /** Maximum evidence sample entries per audit finding. */\n sample?: string | number;\n /** Item ids treated as explicitly valid isolates by the audit. */\n exemptIsolate?: string | string[];\n /** Return counts-first envelopes without row collections. */\n summary?: boolean;\n}\n\n/** Cost metadata attached to every graph query projection. */\nexport interface GraphQueryCost {\n /** Nodes expanded while answering the query. */\n visited_nodes: number;\n /** Edges inspected while answering the query. */\n inspected_edges: number;\n}\n\n/** Result envelope for the transitive traversal subcommands. */\nexport interface GraphTraversalResult {\n /** Executed graph subcommand. */\n subcommand: \"ancestors\" | \"descendants\" | \"predecessors\" | \"successors\";\n /** Canonical root item id. */\n root: string;\n /** Total emitted node ids before summary suppression. */\n count: number;\n /** Whether configured bounds omitted reachable work. */\n truncated: boolean;\n /** Cursor resuming emission after the last returned node. */\n next_cursor?: string;\n /** Query cost metadata. */\n cost: GraphQueryCost;\n /** Emitted node ids in deterministic breadth-first order; absent with summary. */\n ids?: string[];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** One enumerated path projected with relationship kinds instead of raw edges. */\nexport interface GraphPathRow {\n /** Ordered node ids from source to target inclusive. */\n nodes: string[];\n /** Relationship kind of each traversed edge, in path order. */\n kinds: string[];\n /** Number of edges in the path. */\n length: number;\n}\n\n/** Result envelope for the paths subcommand. */\nexport interface GraphPathsResult {\n /** Executed graph subcommand. */\n subcommand: \"paths\";\n /** Canonical source item id. */\n root: string;\n /** Canonical target item id. */\n target: string;\n /** Traversal orientation used for the enumeration. */\n direction: string;\n /** Total enumerated paths before summary suppression. */\n count: number;\n /** Whether depth, path-count, or safety bounds stopped the search early. */\n truncated: boolean;\n /** Query cost metadata. */\n cost: GraphQueryCost;\n /** Enumerated paths, shortest first; absent with summary. */\n paths?: GraphPathRow[];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** One affected item row in an impact projection. */\nexport interface GraphImpactRow {\n /** Affected item id. */\n id: string;\n /** Shortest relationship distance from the root. */\n distance: number;\n /** Exact node path explaining why the item is affected. */\n path: string[];\n}\n\n/** Result envelope for the impact subcommand. */\nexport interface GraphImpactResult {\n /** Executed graph subcommand. */\n subcommand: \"impact\";\n /** Canonical impact-origin item id. */\n root: string;\n /** Traversal orientation used for the blast-radius walk. */\n direction: string;\n /** Total affected items before summary suppression. */\n count: number;\n /** Whether configured bounds omitted reachable work. */\n truncated: boolean;\n /** Query cost metadata. */\n cost: GraphQueryCost;\n /** Affected item rows ordered by discovery; absent with summary. */\n affected?: GraphImpactRow[];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** Bounded execution-graph projection inside an analyze result. */\nexport interface GraphExecutionSummary {\n /** Whether the order-bearing graph is acyclic. */\n acyclic: boolean;\n /** Nodes participating in the topological order. */\n ordered_node_count: number;\n /** Number of parallelizable topological layers. */\n layer_count: number;\n /** Total items with no open prerequisites. */\n frontier_count: number;\n /** Bounded prerequisite-free sample; absent with summary. */\n frontier?: string[];\n /** Edge count of the longest execution path. */\n critical_path_length: number;\n /** Longest deterministic execution path; absent with summary. */\n critical_path?: string[];\n /** Total genuine ordering cycles. */\n cycle_count: number;\n /** Bounded ordering-cycle sample; absent with summary. */\n cycles?: string[][];\n}\n\n/** Bounded knowledge-graph projection inside an analyze result. */\nexport interface GraphKnowledgeSummary {\n /** Total weakly connected components. */\n component_count: number;\n /** Node count of the largest component. */\n largest_component_size: number;\n /** Total nodes without any relationship edges. */\n orphan_count: number;\n /** Bounded orphan sample; absent with summary. */\n orphans?: string[];\n /** Bounded maximum-degree hubs; absent with summary. */\n hubs?: { id: string; degree: number }[];\n}\n\n/** Result envelope for the analyze subcommand. */\nexport interface GraphAnalyzeResult {\n /** Executed graph subcommand. */\n subcommand: \"analyze\";\n /** Total indexed graph nodes. */\n node_count: number;\n /** Total deduplicated graph edges. */\n edge_count: number;\n /** Bound applied to every sample collection. */\n sample_limit: number;\n /** Execution-order analytics over registered ordering kinds. */\n execution: GraphExecutionSummary;\n /** Structural analytics over every stored edge. */\n knowledge: GraphKnowledgeSummary;\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** Result envelope for the audit subcommand. */\nexport interface GraphAuditResult {\n /** Executed graph subcommand. */\n subcommand: \"audit\";\n /** Total audit findings. */\n finding_count: number;\n /** Finding counts keyed by severity. */\n findings_by_severity: Record<string, number>;\n /** Finding-row counts keyed by finding code. Before 2026.7.19 this field incorrectly accumulated affected subjects; consumers of that unit must migrate to affected_subjects_by_code. */\n findings_by_code: Record<string, number>;\n /** Affected-subject counts keyed by severity. */\n affected_subjects_by_severity: Record<string, number>;\n /** Affected-subject counts keyed by finding code. */\n affected_subjects_by_code: Record<string, number>;\n /** Structural coverage metrics computed during the audit. */\n profile: RelationshipAuditReport[\"profile\"];\n /** Ordered findings with bounded evidence samples; absent with summary. */\n findings?: RelationshipAuditReport[\"findings\"];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** One bounded community row projected by the communities subcommand. */\nexport interface GraphCommunityRow {\n /** Lexicographically smallest member id, naming the community. */\n representative: string;\n /** Total member count before sampling. */\n size: number;\n /** Bounded sorted member sample. */\n members: string[];\n}\n\n/** Result envelope for the communities subcommand. */\nexport interface GraphCommunitiesResult {\n /** Executed graph subcommand. */\n subcommand: \"communities\";\n /** Total detected communities meeting the size floor. */\n community_count: number;\n /** Member count of the largest community. */\n largest_community_size: number;\n /** Label-propagation sweeps executed. */\n iterations: number;\n /** Whether labels stabilized before the iteration bound. */\n converged: boolean;\n /** Whether the iteration bound stopped propagation early or the sample bound omitted rows. */\n truncated: boolean;\n /** Query cost metadata. */\n cost: GraphQueryCost;\n /** Bounded community rows, largest first; absent with summary. */\n communities?: GraphCommunityRow[];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** One redundant stored edge projected with its witness path. */\nexport interface GraphRedundancyRow {\n /** Stored edge source id. */\n source: string;\n /** Stored edge target id. */\n target: string;\n /** Stored relationship kind. */\n kind: string;\n /** Semantic-orientation node path proving the edge is implied. */\n witness: string[];\n}\n\n/** Result envelope for the redundancy subcommand. */\nexport interface GraphRedundancyResult {\n /** Executed graph subcommand. */\n subcommand: \"redundancy\";\n /** Total redundant edges found within configured bounds. */\n redundant_count: number;\n /** Whether the row limit omitted further redundant edges. */\n truncated: boolean;\n /** Query cost metadata. */\n cost: GraphQueryCost;\n /** Redundant edge rows in deterministic scan order; absent with summary. */\n redundant?: GraphRedundancyRow[];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** One structural bottleneck row projected by the dominators subcommand. */\nexport interface GraphDominatorRow {\n /** Bottleneck node id. */\n id: string;\n /** Immediate dominator appearing on every root-to-node path. */\n idom: string;\n /** Reachable nodes strictly gated by this node. */\n dominated_count: number;\n}\n\n/** Result envelope for the dominators subcommand. */\nexport interface GraphDominatorsResult {\n /** Executed graph subcommand. */\n subcommand: \"dominators\";\n /** Canonical analyzed root id. */\n root: string;\n /** Traversal orientation used for reachability. */\n direction: string;\n /** Reachable node count including the root. */\n reachable_count: number;\n /** Total nodes gating at least one other reachable node. */\n bottleneck_count: number;\n /** Whether the depth bound cut reachability or the row limit omitted bottleneck rows. */\n truncated: boolean;\n /** Query cost metadata. */\n cost: GraphQueryCost;\n /** Bounded bottleneck rows, most-gating first; absent with summary. */\n bottlenecks?: GraphDominatorRow[];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** Result envelope for the dry-run remediation planning subcommand. */\nexport interface GraphPlanResult {\n /** Executed graph subcommand. */\n subcommand: \"plan\";\n /** Total derived remediation proposals before row bounding. */\n step_count: number;\n /** Proposal counts keyed by operation family. */\n steps_by_op: Record<string, number>;\n /** Proposal counts keyed by policy code. */\n steps_by_code: Record<string, number>;\n /** Total governance-audit findings the plan was derived from. */\n finding_count: number;\n /** Whether sample, scan, or row bounds omitted derivable proposals. */\n truncated: boolean;\n /** Query cost metadata. */\n cost: GraphQueryCost;\n /** Bounded proposal rows in audit severity order; absent with summary. */\n steps?: RelationshipRemediationStep[];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** Union of every graph subcommand result envelope. */\nexport type GraphResult =\n | GraphTraversalResult\n | GraphPathsResult\n | GraphImpactResult\n | GraphAnalyzeResult\n | GraphAuditResult\n | GraphCommunitiesResult\n | GraphRedundancyResult\n | GraphDominatorsResult\n | GraphPlanResult;\n\n/** Fully parsed graph invocation shared by the subcommand executors. */\ninterface GraphInvocation {\n /** Assembled workspace relationship graph and node details. */\n assembly: WorkspaceRelationshipAssembly;\n /** Canonical registered kind filters, when provided. */\n kinds?: string[];\n /** Parsed non-negative depth bound. */\n maxDepth?: number;\n /** Parsed positive row bound. */\n limit?: number;\n /** Traversal resume cursor. */\n after?: string;\n /** Validated traversal orientation. */\n direction: \"outgoing\" | \"incoming\" | \"both\";\n /** Parsed positive path-count bound. */\n maxPaths?: number;\n /** Parsed positive audit sample bound. */\n sample?: number;\n /** Normalized audit isolate exemptions. */\n exemptIsolates: string[];\n /** Whether row collections are suppressed. */\n summary: boolean;\n}\n\n/** Normalize repeatable or comma-separated id options into a flat list. */\nfunction normalizeIdList(raw: string | string[] | undefined): string[] {\n if (raw === undefined) return [];\n return (Array.isArray(raw) ? raw : [raw])\n .flatMap((value) => value.split(\",\"))\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n}\n\n/** Validate the graph subcommand and its positional-id requirements. */\nexport function parseGraphSubcommand(\n raw: string,\n id: string | undefined,\n target: string | undefined,\n): GraphSubcommand {\n const candidate = raw.trim().toLowerCase();\n if (!(GRAPH_SUBCOMMAND_VALUES as readonly string[]).includes(candidate)) {\n throw new PmCliError(\n `Invalid graph subcommand \"${raw}\". Use one of: ${GRAPH_SUBCOMMAND_VALUES.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n const subcommand = candidate as GraphSubcommand;\n if (ROOTED_SUBCOMMANDS.has(subcommand) && !id?.trim()) {\n throw new PmCliError(\n `graph ${subcommand} requires an item id.`,\n EXIT_CODE.USAGE,\n );\n }\n if (subcommand === \"paths\" && !target?.trim()) {\n throw new PmCliError(\n \"graph paths requires a source and a target item id.\",\n EXIT_CODE.USAGE,\n );\n }\n return subcommand;\n}\n\n/**\n * Re-throw graph-kernel semantic option misuse (non-family kind, unknown\n * cursor, non-transitive redundancy kind) as a usage error carrying the\n * original explanation instead of an opaque crash.\n */\nfunction rethrowGraphUsage(error: unknown): never {\n if (error instanceof TypeError)\n throw new PmCliError(error.message, EXIT_CODE.USAGE);\n throw error;\n}\n\n/** Convert traversal metadata into the shared cost/truncation projection. */\nfunction projectQueryMeta(meta: RelationshipQueryMeta): {\n truncated: boolean;\n cost: GraphQueryCost;\n} {\n return {\n truncated: meta.truncated,\n cost: {\n visited_nodes: meta.visitedNodes,\n inspected_edges: meta.inspectedEdges,\n },\n };\n}\n\n/** Resolve one item id case-insensitively against the assembled graph. */\nfunction canonicalizeGraphId(\n assembly: WorkspaceRelationshipAssembly,\n raw: string,\n): string {\n const wanted = raw.trim().toLowerCase();\n for (const detail of assembly.details) {\n if (\n detail.id.trim().toLowerCase() === wanted &&\n !assembly.missingIdSet.has(detail.id.toLowerCase())\n ) {\n return detail.id;\n }\n }\n throw new PmCliError(`Item ${raw} not found`, EXIT_CODE.NOT_FOUND);\n}\n\n/** Execute one transitive traversal subcommand over the assembled graph. */\nfunction runGraphTraversal(\n subcommand: \"ancestors\" | \"descendants\" | \"predecessors\" | \"successors\",\n root: string,\n invocation: GraphInvocation,\n): GraphTraversalResult {\n const walk = {\n ancestors: hierarchyAncestors,\n descendants: hierarchyDescendants,\n predecessors: orderingPredecessors,\n successors: orderingSuccessors,\n }[subcommand];\n let result;\n try {\n result = walk(invocation.assembly.graph, root, {\n ...(invocation.kinds === undefined ? {} : { kinds: invocation.kinds }),\n ...(invocation.maxDepth === undefined\n ? {}\n : { maxDepth: invocation.maxDepth }),\n ...(invocation.limit === undefined ? {} : { limit: invocation.limit }),\n ...(invocation.after === undefined ? {} : { after: invocation.after }),\n });\n } catch (error) {\n rethrowGraphUsage(error);\n }\n const meta = projectQueryMeta(result.meta);\n return {\n subcommand,\n root,\n count: result.value.length,\n ...meta,\n ...(result.meta.nextCursor === undefined\n ? {}\n : { next_cursor: result.meta.nextCursor }),\n ...(invocation.summary ? {} : { ids: result.value }),\n };\n}\n\n/** Execute the bounded simple-path enumeration subcommand. */\nfunction runGraphPaths(\n root: string,\n target: string,\n invocation: GraphInvocation,\n): GraphPathsResult {\n const result = enumerateRelationshipPaths(\n invocation.assembly.graph,\n root,\n target,\n {\n direction: invocation.direction,\n ...(invocation.kinds === undefined ? {} : { kinds: invocation.kinds }),\n ...(invocation.maxDepth === undefined\n ? {}\n : { maxDepth: invocation.maxDepth }),\n ...(invocation.maxPaths === undefined\n ? {}\n : { maxPaths: invocation.maxPaths }),\n },\n );\n return {\n subcommand: \"paths\",\n root,\n target,\n direction: invocation.direction,\n count: result.value.length,\n ...projectQueryMeta(result.meta),\n ...(invocation.summary\n ? {}\n : {\n paths: result.value.map((path) => ({\n nodes: path.nodes,\n kinds: path.edges.map((edge) => edge.kind),\n length: path.length,\n })),\n }),\n };\n}\n\n/** Execute the bounded blast-radius impact subcommand. */\nfunction runGraphImpact(\n root: string,\n invocation: GraphInvocation,\n): GraphImpactResult {\n const analysis = analyzeGraphImpact(invocation.assembly.graph, root, {\n direction: invocation.direction,\n ...(invocation.kinds === undefined ? {} : { kinds: invocation.kinds }),\n ...(invocation.maxDepth === undefined\n ? {}\n : { maxDepth: invocation.maxDepth }),\n ...(invocation.limit === undefined ? {} : { limit: invocation.limit }),\n });\n return {\n subcommand: \"impact\",\n root,\n direction: invocation.direction,\n count: analysis.affected.length,\n truncated: analysis.truncated,\n cost: {\n visited_nodes: analysis.cost.visitedNodes,\n inspected_edges: analysis.cost.inspectedEdges,\n },\n ...(invocation.summary ? {} : { affected: analysis.affected }),\n };\n}\n\n/** Execute the workspace-wide execution and knowledge analytics subcommand. */\nfunction runGraphAnalyze(invocation: GraphInvocation): GraphAnalyzeResult {\n const graph = invocation.assembly.graph;\n const sampleLimit = invocation.limit ?? DEFAULT_SAMPLE_LIMIT;\n const execution = analyzeRelationshipExecution(graph, {\n registry: graph.registry(),\n });\n const knowledge = analyzeKnowledgeGraph(graph);\n return {\n subcommand: \"analyze\",\n node_count: graph.nodes().length,\n edge_count: graph.edges().length,\n sample_limit: sampleLimit,\n execution: {\n acyclic: execution.acyclic,\n ordered_node_count: execution.order.length,\n layer_count: execution.layers.length,\n frontier_count: execution.frontier.length,\n critical_path_length: execution.criticalPathLength,\n cycle_count: execution.cycles.length,\n ...(invocation.summary\n ? {}\n : {\n frontier: execution.frontier.slice(0, sampleLimit),\n critical_path: execution.criticalPath.slice(0, sampleLimit),\n cycles: execution.cycles.slice(0, sampleLimit),\n }),\n },\n knowledge: {\n component_count: knowledge.components.length,\n largest_component_size: knowledge.components[0]?.length ?? 0,\n orphan_count: knowledge.orphans.length,\n ...(invocation.summary\n ? {}\n : {\n orphans: knowledge.orphans.slice(0, sampleLimit),\n hubs: knowledge.hubs.slice(0, sampleLimit),\n }),\n },\n };\n}\n\n/** Execute the governance-audit subcommand over the assembled graph. */\nfunction runGraphAudit(\n invocation: GraphInvocation,\n isTerminal: (status: string) => boolean,\n): GraphAuditResult {\n const report = auditWorkspaceRelationshipGraph(invocation.assembly, {\n isTerminal,\n ...(invocation.sample === undefined\n ? {}\n : { maxSampleSize: invocation.sample }),\n ...(invocation.exemptIsolates.length === 0\n ? {}\n : { exemptIsolates: invocation.exemptIsolates }),\n });\n const bySeverity: Record<string, number> = {};\n const byCode: Record<string, number> = {};\n const affectedBySeverity: Record<string, number> = {};\n const affectedByCode: Record<string, number> = {};\n for (const finding of report.findings) {\n bySeverity[finding.severity] = (bySeverity[finding.severity] ?? 0) + 1;\n byCode[finding.code] = (byCode[finding.code] ?? 0) + 1;\n affectedBySeverity[finding.severity] =\n (affectedBySeverity[finding.severity] ?? 0) + finding.count;\n affectedByCode[finding.code] =\n (affectedByCode[finding.code] ?? 0) + finding.count;\n }\n return {\n subcommand: \"audit\",\n finding_count: report.findings.length,\n findings_by_severity: bySeverity,\n findings_by_code: byCode,\n affected_subjects_by_severity: affectedBySeverity,\n affected_subjects_by_code: affectedByCode,\n profile: report.profile,\n ...(invocation.summary ? {} : { findings: report.findings }),\n };\n}\n\n/** Execute the deterministic community-detection subcommand. */\nfunction runGraphCommunities(\n invocation: GraphInvocation,\n): GraphCommunitiesResult {\n const sampleLimit = invocation.limit ?? DEFAULT_SAMPLE_LIMIT;\n const result = detectRelationshipCommunities(invocation.assembly.graph, {\n ...(invocation.kinds === undefined ? {} : { kinds: invocation.kinds }),\n });\n const analysis = result.value;\n return {\n subcommand: \"communities\",\n community_count: analysis.communities.length,\n largest_community_size: analysis.communities[0]?.size ?? 0,\n iterations: analysis.iterations,\n converged: analysis.converged,\n truncated: !analysis.converged || analysis.communities.length > sampleLimit,\n cost: {\n visited_nodes: result.meta.visitedNodes,\n inspected_edges: result.meta.inspectedEdges,\n },\n ...(invocation.summary\n ? {}\n : {\n communities: analysis.communities\n .slice(0, sampleLimit)\n .map((community) => ({\n representative: community.representative,\n size: community.size,\n members: community.members.slice(0, sampleLimit),\n })),\n }),\n };\n}\n\n/** Execute the transitive-redundancy scan subcommand. */\nfunction runGraphRedundancy(\n invocation: GraphInvocation,\n): GraphRedundancyResult {\n let result;\n try {\n result = findRedundantRelationshipEdges(invocation.assembly.graph, {\n ...(invocation.kinds === undefined ? {} : { kinds: invocation.kinds }),\n ...(invocation.maxDepth === undefined\n ? {}\n : { maxDepth: invocation.maxDepth }),\n ...(invocation.limit === undefined ? {} : { limit: invocation.limit }),\n });\n } catch (error) {\n rethrowGraphUsage(error);\n }\n return {\n subcommand: \"redundancy\",\n redundant_count: result.value.length,\n ...projectQueryMeta(result.meta),\n ...(invocation.summary\n ? {}\n : {\n redundant: result.value.map((row) => ({\n source: row.edge.source,\n target: row.edge.target,\n kind: row.edge.kind,\n witness: row.witness,\n })),\n }),\n };\n}\n\n/** Execute the dominator/bottleneck analysis subcommand. */\nfunction runGraphDominators(\n root: string,\n invocation: GraphInvocation,\n): GraphDominatorsResult {\n const limit = invocation.limit ?? DEFAULT_SAMPLE_LIMIT;\n const result = computeRelationshipDominators(\n invocation.assembly.graph,\n root,\n {\n direction: invocation.direction,\n ...(invocation.kinds === undefined ? {} : { kinds: invocation.kinds }),\n ...(invocation.maxDepth === undefined\n ? {}\n : { maxDepth: invocation.maxDepth }),\n },\n );\n const bottlenecks = result.value.rows.filter((row) => row.dominatedCount > 0);\n return {\n subcommand: \"dominators\",\n root,\n direction: invocation.direction,\n reachable_count: result.value.reachableCount,\n bottleneck_count: bottlenecks.length,\n truncated: result.meta.truncated || bottlenecks.length > limit,\n cost: {\n visited_nodes: result.meta.visitedNodes,\n inspected_edges: result.meta.inspectedEdges,\n },\n ...(invocation.summary\n ? {}\n : {\n bottlenecks: bottlenecks.slice(0, limit).map((row) => ({\n id: row.id,\n idom: row.idom,\n dominated_count: row.dominatedCount,\n })),\n }),\n };\n}\n\n/** Execute the dry-run remediation planning subcommand. */\nfunction runGraphPlan(\n invocation: GraphInvocation,\n isTerminal: (status: string) => boolean,\n): GraphPlanResult {\n const limit = invocation.limit ?? DEFAULT_SAMPLE_LIMIT;\n const plan = planRelationshipRemediation(invocation.assembly, {\n isTerminal,\n redundancyLimit: limit,\n ...(invocation.sample === undefined\n ? {}\n : { maxSampleSize: invocation.sample }),\n ...(invocation.exemptIsolates.length === 0\n ? {}\n : { exemptIsolates: invocation.exemptIsolates }),\n });\n const byOp: Record<string, number> = {};\n const byCode: Record<string, number> = {};\n for (const step of plan.steps) {\n byOp[step.op] = (byOp[step.op] ?? 0) + 1;\n byCode[step.code] = (byCode[step.code] ?? 0) + 1;\n }\n return {\n subcommand: \"plan\",\n step_count: plan.steps.length,\n steps_by_op: byOp,\n steps_by_code: byCode,\n finding_count: plan.report.findings.length,\n truncated: plan.truncated || plan.steps.length > limit,\n cost: {\n visited_nodes: plan.cost.visitedNodes,\n inspected_edges: plan.cost.inspectedEdges,\n },\n ...(invocation.summary ? {} : { steps: plan.steps.slice(0, limit) }),\n };\n}\n\n/** Build the deterministic memoization key covering every query-shaping input. */\nfunction buildGraphQueryKey(\n subcommand: GraphSubcommand,\n root: string | undefined,\n pathsTarget: string | undefined,\n invocation: GraphInvocation,\n): string {\n return JSON.stringify({\n subcommand,\n root: root ?? null,\n target: pathsTarget ?? null,\n kinds: invocation.kinds ?? null,\n maxDepth: invocation.maxDepth ?? null,\n limit: invocation.limit ?? null,\n after: invocation.after ?? null,\n direction: invocation.direction,\n maxPaths: invocation.maxPaths ?? null,\n sample: invocation.sample ?? null,\n // The audit consumes exemptions as a case-insensitive set, so the key\n // must not distinguish logically identical spellings or orderings.\n exemptIsolates: [\n ...new Set(invocation.exemptIsolates.map((id) => id.toLowerCase())),\n ].sort(),\n summary: invocation.summary,\n });\n}\n\n/** Dispatch one parsed graph subcommand to its executor. */\nfunction executeGraphSubcommand(\n subcommand: GraphSubcommand,\n root: string | undefined,\n pathsTarget: string | undefined,\n invocation: GraphInvocation,\n isTerminal: (status: string) => boolean,\n): GraphResult {\n if (subcommand === \"analyze\") return runGraphAnalyze(invocation);\n if (subcommand === \"audit\") return runGraphAudit(invocation, isTerminal);\n if (subcommand === \"plan\") return runGraphPlan(invocation, isTerminal);\n if (subcommand === \"communities\") return runGraphCommunities(invocation);\n if (subcommand === \"redundancy\") return runGraphRedundancy(invocation);\n if (subcommand === \"dominators\") return runGraphDominators(root!, invocation);\n if (subcommand === \"paths\")\n return runGraphPaths(root!, pathsTarget!, invocation);\n if (subcommand === \"impact\") return runGraphImpact(root!, invocation);\n return runGraphTraversal(subcommand, root!, invocation);\n}\n\n/** Implements run graph for the public runtime surface of this module. */\nexport async function runGraph(\n subcommandRaw: string,\n id: string | undefined,\n target: string | undefined,\n options: GraphCommandOptions,\n global: GlobalOptions,\n): Promise<GraphResult> {\n const subcommand = parseGraphSubcommand(subcommandRaw, id, target);\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n const items = await listAllItemMetadataLight(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n undefined,\n settings.schema,\n );\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const isTerminal = (status: string): boolean =>\n isTerminalStatus(status, statusRegistry);\n const kinds = parseKinds(options.kind);\n const lookup = workspaceGraphCache().lookup(\n pmRoot,\n computeWorkspaceGraphFingerprint(items, isTerminal),\n () => assembleWorkspaceRelationshipGraph(items, isTerminal),\n );\n const invocation: GraphInvocation = {\n assembly: lookup.assembly,\n ...(kinds === undefined ? {} : { kinds }),\n maxDepth: parseMaxDepth(options.maxDepth),\n limit: parsePositiveInteger(options.limit, \"limit\"),\n after: options.after?.trim() || undefined,\n direction: parseDirection(options.direction),\n maxPaths: parsePositiveInteger(options.maxPaths, \"max-paths\"),\n sample: parsePositiveInteger(options.sample, \"sample\"),\n exemptIsolates: normalizeIdList(options.exemptIsolate),\n summary: options.summary === true,\n };\n const root = ROOTED_SUBCOMMANDS.has(subcommand)\n ? canonicalizeGraphId(invocation.assembly, id!)\n : undefined;\n const pathsTarget =\n subcommand === \"paths\"\n ? canonicalizeGraphId(invocation.assembly, target!)\n : undefined;\n const memo = lookup.memoize(\n buildGraphQueryKey(subcommand, root, pathsTarget, invocation),\n () =>\n executeGraphSubcommand(\n subcommand,\n root,\n pathsTarget,\n invocation,\n isTerminal,\n ),\n );\n return {\n ...memo.value,\n cache: {\n fingerprint: lookup.fingerprint.slice(0, 12),\n assembly: lookup.assemblyReused ? \"hit\" : \"miss\",\n result: memo.reused ? \"hit\" : \"miss\",\n },\n };\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;;;AACH,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAA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,WAAW,GACf,UAAU,KAAK,OAAO;QACpB,CAAC,CAAC,mBAAmB,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAO,CAAC;QACnD,CAAC,CAAC,SAAS,CAAC;IAChB,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CACzB,kBAAkB,CAAC,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,CAAC,EAC7D,GAAG,EAAE,CACH,sBAAsB,CACpB,UAAU,EACV,IAAI,EACJ,WAAW,EACX,UAAU,EACV,UAAU,CACX,CACJ,CAAC;IACF,OAAO;QACL,GAAG,IAAI,CAAC,KAAK;QACb,KAAK,EAAE;YACL,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;YAC5C,QAAQ,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;YAChD,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;SACrC;KACF,CAAC;AACJ,CAAC","debugId":"f43d15d0-c4a0-533a-b125-4333554e4ea0"}
1
+ {"version":3,"file":"run.js","sources":["sdk/graph/run.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/graph/run\n *\n * Workspace-facing `pm graph` runner: one thin orchestrator that loads the\n * tracker once, resolves the fingerprint-keyed workspace assembly through the\n * shared graph cache, and dispatches bounded traversal, path, impact,\n * analytics, governance-audit, and remediation-planning queries through the\n * public graph toolkit. Every projection is counts-first, deterministic, and\n * carries explicit cost, truncation, and cache metadata so agents can budget\n * follow-up reads without re-scanning the workspace; identical repeated\n * queries in long-lived hosts are answered from the memoized snapshot.\n */\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { isTerminalStatus } from \"../../core/item/status.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { listAllItemMetadataLight } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport {\n parseDirection,\n parseKinds,\n parseMaxDepth,\n parsePositiveInteger,\n} from \"../dependencies.js\";\nimport {\n analyzeGraphImpact,\n analyzeKnowledgeGraph,\n analyzeRelationshipExecution,\n} from \"../relationship-analytics.js\";\nimport type { RelationshipQueryMeta } from \"../relationships.js\";\nimport {\n computeRelationshipDominators,\n detectRelationshipCommunities,\n findRedundantRelationshipEdges,\n} from \"./analytics.js\";\nimport {\n computeRelationshipCentrality,\n findRelationshipCutStructure,\n} from \"./centrality.js\";\nimport { analyzeRelationshipSchedule } from \"./scheduling.js\";\nimport {\n assembleWorkspaceRelationshipGraph,\n resolveWorkspaceRelationshipKindRegistry,\n type WorkspaceRelationshipAssembly,\n} from \"./assembly.js\";\nimport {\n computeWorkspaceGraphFingerprint,\n workspaceGraphCache,\n type GraphCacheMetadata,\n} from \"./cache.js\";\nimport {\n clearDurableGraphCache,\n durableGraphCacheStatus,\n loadGraphAuditBaseline,\n openDurableGraphCache,\n persistDurableGraphResult,\n saveGraphAuditBaseline,\n shouldPersistDurableGraphCache,\n GRAPH_DURABLE_CACHE_MIN_ITEMS,\n type DurableGraphCacheView,\n} from \"./durable-cache.js\";\nimport {\n auditWorkspaceRelationshipGraph,\n diffRelationshipAuditSnapshots,\n type RelationshipAuditDelta,\n type RelationshipAuditReport,\n type RelationshipAuditSnapshot,\n} from \"./governance.js\";\nimport {\n planRelationshipRemediation,\n type RelationshipRemediationStep,\n} from \"./remediation.js\";\nimport {\n enumerateRelationshipPaths,\n hierarchyAncestors,\n hierarchyDescendants,\n orderingPredecessors,\n orderingSuccessors,\n} from \"./traversal.js\";\n\nimport {\n GRAPH_SUBCOMMAND_VALUES,\n type GraphSubcommand,\n} from \"../cli-contracts/enum-contracts.js\";\n\nexport { GRAPH_SUBCOMMAND_VALUES, type GraphSubcommand };\n\n/** Graph subcommands that require a root item id. */\nconst ROOTED_SUBCOMMANDS = new Set<GraphSubcommand>([\n \"ancestors\",\n \"descendants\",\n \"predecessors\",\n \"successors\",\n \"paths\",\n \"impact\",\n \"dominators\",\n]);\n\n/** Default bounded sample rows returned by analyze/audit projections. */\nconst DEFAULT_SAMPLE_LIMIT = 10;\n\n/** Documents the graph command options payload exchanged by command, SDK, and package integrations. */\nexport interface GraphCommandOptions {\n /** Restricts traversal to registered relationship kinds (repeatable or comma-separated). */\n kind?: string | string[];\n /** Maximum traversal depth as a non-negative integer. */\n maxDepth?: string | number;\n /** Maximum returned rows per bounded collection. */\n limit?: string | number;\n /** Resume a traversal after this previously returned node id. */\n after?: string;\n /** Edge orientation for paths and impact queries (outgoing, incoming, or both). */\n direction?: string;\n /** Maximum enumerated paths for the paths subcommand. */\n maxPaths?: string | number;\n /** Maximum evidence sample entries per audit finding. */\n sample?: string | number;\n /** Item ids treated as explicitly valid isolates by the audit. */\n exemptIsolate?: string | string[];\n /** Item types whose active nodes are policy-valid isolates for the audit (repeatable or comma-separated). */\n exemptIsolateType?: string | string[];\n /** Persist the audit census as the change-since-baseline comparison point (audit only). */\n saveBaseline?: boolean;\n /** Rebuild and warm the durable graph index (index only). */\n rebuild?: boolean;\n /** Delete the durable graph index (index only). */\n clear?: boolean;\n /** Return counts-first envelopes without row collections. */\n summary?: boolean;\n}\n\n/** Cost metadata attached to every graph query projection. */\nexport interface GraphQueryCost {\n /** Nodes expanded while answering the query. */\n visited_nodes: number;\n /** Edges inspected while answering the query. */\n inspected_edges: number;\n}\n\n/** Result envelope for the transitive traversal subcommands. */\nexport interface GraphTraversalResult {\n /** Executed graph subcommand. */\n subcommand: \"ancestors\" | \"descendants\" | \"predecessors\" | \"successors\";\n /** Canonical root item id. */\n root: string;\n /** Total emitted node ids before summary suppression. */\n count: number;\n /** Whether configured bounds omitted reachable work. */\n truncated: boolean;\n /** Cursor resuming emission after the last returned node. */\n next_cursor?: string;\n /** Query cost metadata. */\n cost: GraphQueryCost;\n /** Emitted node ids in deterministic breadth-first order; absent with summary. */\n ids?: string[];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** One enumerated path projected with relationship kinds instead of raw edges. */\nexport interface GraphPathRow {\n /** Ordered node ids from source to target inclusive. */\n nodes: string[];\n /** Relationship kind of each traversed edge, in path order. */\n kinds: string[];\n /** Number of edges in the path. */\n length: number;\n}\n\n/** Result envelope for the paths subcommand. */\nexport interface GraphPathsResult {\n /** Executed graph subcommand. */\n subcommand: \"paths\";\n /** Canonical source item id. */\n root: string;\n /** Canonical target item id. */\n target: string;\n /** Traversal orientation used for the enumeration. */\n direction: string;\n /** Total enumerated paths before summary suppression. */\n count: number;\n /** Whether depth, path-count, or safety bounds stopped the search early. */\n truncated: boolean;\n /** Query cost metadata. */\n cost: GraphQueryCost;\n /** Enumerated paths, shortest first; absent with summary. */\n paths?: GraphPathRow[];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** One affected item row in an impact projection. */\nexport interface GraphImpactRow {\n /** Affected item id. */\n id: string;\n /** Shortest relationship distance from the root. */\n distance: number;\n /** Exact node path explaining why the item is affected. */\n path: string[];\n}\n\n/** Result envelope for the impact subcommand. */\nexport interface GraphImpactResult {\n /** Executed graph subcommand. */\n subcommand: \"impact\";\n /** Canonical impact-origin item id. */\n root: string;\n /** Traversal orientation used for the blast-radius walk. */\n direction: string;\n /** Total affected items before summary suppression. */\n count: number;\n /** Whether configured bounds omitted reachable work. */\n truncated: boolean;\n /** Query cost metadata. */\n cost: GraphQueryCost;\n /** Affected item rows ordered by discovery; absent with summary. */\n affected?: GraphImpactRow[];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** Bounded execution-graph projection inside an analyze result. */\nexport interface GraphExecutionSummary {\n /** Whether the order-bearing graph is acyclic. */\n acyclic: boolean;\n /** Nodes participating in the topological order. */\n ordered_node_count: number;\n /** Number of parallelizable topological layers. */\n layer_count: number;\n /** Total items with no open prerequisites. */\n frontier_count: number;\n /** Bounded prerequisite-free sample; absent with summary. */\n frontier?: string[];\n /** Edge count of the longest execution path. */\n critical_path_length: number;\n /** Longest deterministic execution path; absent with summary. */\n critical_path?: string[];\n /** Total genuine ordering cycles. */\n cycle_count: number;\n /** Bounded ordering-cycle sample; absent with summary. */\n cycles?: string[][];\n}\n\n/** Bounded knowledge-graph projection inside an analyze result. */\nexport interface GraphKnowledgeSummary {\n /** Total weakly connected components. */\n component_count: number;\n /** Node count of the largest component. */\n largest_component_size: number;\n /** Total nodes without any relationship edges. */\n orphan_count: number;\n /** Bounded orphan sample; absent with summary. */\n orphans?: string[];\n /** Bounded maximum-degree hubs; absent with summary. */\n hubs?: { id: string; degree: number }[];\n}\n\n/** Result envelope for the analyze subcommand. */\nexport interface GraphAnalyzeResult {\n /** Executed graph subcommand. */\n subcommand: \"analyze\";\n /** Total indexed graph nodes. */\n node_count: number;\n /** Total deduplicated graph edges. */\n edge_count: number;\n /** Bound applied to every sample collection. */\n sample_limit: number;\n /** Execution-order analytics over registered ordering kinds. */\n execution: GraphExecutionSummary;\n /** Structural analytics over every stored edge. */\n knowledge: GraphKnowledgeSummary;\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** Result envelope for the audit subcommand. */\nexport interface GraphAuditResult {\n /** Executed graph subcommand. */\n subcommand: \"audit\";\n /** Total audit findings. */\n finding_count: number;\n /** Finding counts keyed by severity. */\n findings_by_severity: Record<string, number>;\n /** Finding-row counts keyed by finding code. Before 2026.7.19 this field incorrectly accumulated affected subjects; consumers of that unit must migrate to affected_subjects_by_code. */\n findings_by_code: Record<string, number>;\n /** Affected-subject counts keyed by severity. */\n affected_subjects_by_severity: Record<string, number>;\n /** Affected-subject counts keyed by finding code. */\n affected_subjects_by_code: Record<string, number>;\n /** Structural coverage metrics computed during the audit. */\n profile: RelationshipAuditReport[\"profile\"];\n /** Ordered findings with bounded evidence samples; absent with summary. */\n findings?: RelationshipAuditReport[\"findings\"];\n /** Signed change since the persisted census baseline; absent when no baseline exists. */\n baseline?: RelationshipAuditDelta;\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** Result envelope for the durable-index maintenance subcommand. */\nexport interface GraphIndexResult {\n /** Executed graph subcommand. */\n subcommand: \"index\";\n /** Maintenance action performed by this invocation. */\n action: \"status\" | \"rebuilt\" | \"cleared\";\n /** Durable index disposition against the current workspace snapshot. */\n state: \"fresh\" | \"stale\" | \"absent\";\n /** Persisted deterministic query results in the envelope. */\n entry_count: number;\n /** Items in the current workspace snapshot. */\n item_count: number;\n /** Item threshold above which implicit persistence activates. */\n min_items_threshold: number;\n /** Whether queries on this workspace will persist results right now. */\n persist_enabled: boolean;\n /** Truncated fingerprint of the current workspace snapshot. */\n current_fingerprint: string;\n /** ISO timestamp of the last persisted write, absent without an envelope. */\n saved_at?: string;\n /** Envelope size in bytes, absent without an envelope. */\n bytes?: number;\n /** Cache observability; maintenance invocations never populate it. */\n cache?: GraphCacheMetadata;\n}\n\n/** One bounded community row projected by the communities subcommand. */\nexport interface GraphCommunityRow {\n /** Lexicographically smallest member id, naming the community. */\n representative: string;\n /** Total member count before sampling. */\n size: number;\n /** Bounded sorted member sample. */\n members: string[];\n}\n\n/** Result envelope for the communities subcommand. */\nexport interface GraphCommunitiesResult {\n /** Executed graph subcommand. */\n subcommand: \"communities\";\n /** Total detected communities meeting the size floor. */\n community_count: number;\n /** Member count of the largest community. */\n largest_community_size: number;\n /** Label-propagation sweeps executed. */\n iterations: number;\n /** Whether labels stabilized before the iteration bound. */\n converged: boolean;\n /** Whether the iteration bound stopped propagation early or the sample bound omitted rows. */\n truncated: boolean;\n /** Query cost metadata. */\n cost: GraphQueryCost;\n /** Bounded community rows, largest first; absent with summary. */\n communities?: GraphCommunityRow[];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** One redundant stored edge projected with its witness path. */\nexport interface GraphRedundancyRow {\n /** Stored edge source id. */\n source: string;\n /** Stored edge target id. */\n target: string;\n /** Stored relationship kind. */\n kind: string;\n /** Semantic-orientation node path proving the edge is implied. */\n witness: string[];\n}\n\n/** Result envelope for the redundancy subcommand. */\nexport interface GraphRedundancyResult {\n /** Executed graph subcommand. */\n subcommand: \"redundancy\";\n /** Total redundant edges found within configured bounds. */\n redundant_count: number;\n /** Whether the row limit omitted further redundant edges. */\n truncated: boolean;\n /** Query cost metadata. */\n cost: GraphQueryCost;\n /** Redundant edge rows in deterministic scan order; absent with summary. */\n redundant?: GraphRedundancyRow[];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** One structural bottleneck row projected by the dominators subcommand. */\nexport interface GraphDominatorRow {\n /** Bottleneck node id. */\n id: string;\n /** Immediate dominator appearing on every root-to-node path. */\n idom: string;\n /** Reachable nodes strictly gated by this node. */\n dominated_count: number;\n}\n\n/** Result envelope for the dominators subcommand. */\nexport interface GraphDominatorsResult {\n /** Executed graph subcommand. */\n subcommand: \"dominators\";\n /** Canonical analyzed root id. */\n root: string;\n /** Traversal orientation used for reachability. */\n direction: string;\n /** Reachable node count including the root. */\n reachable_count: number;\n /** Total nodes gating at least one other reachable node. */\n bottleneck_count: number;\n /** Whether the depth bound cut reachability or the row limit omitted bottleneck rows. */\n truncated: boolean;\n /** Query cost metadata. */\n cost: GraphQueryCost;\n /** Bounded bottleneck rows, most-gating first; absent with summary. */\n bottlenecks?: GraphDominatorRow[];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** One scheduled task row projected by the slack subcommand. */\nexport interface GraphScheduleRow {\n /** Scheduled task id. */\n id: string;\n /** Earliest start (longest prerequisite distance). */\n earliest_start: number;\n /** Latest start preserving the makespan. */\n latest_start: number;\n /** Total float: latest start minus earliest start. */\n slack: number;\n /** Whether the task lies on a critical path. */\n critical: boolean;\n}\n\n/** Result envelope for the critical-path slack subcommand. */\nexport interface GraphSlackResult {\n /** Executed graph subcommand. */\n subcommand: \"slack\";\n /** Whether the order-bearing graph is acyclic. */\n acyclic: boolean;\n /** Total makespan in unit task durations. */\n makespan: number;\n /** Tasks participating in the order-bearing DAG. */\n scheduled_count: number;\n /** Tasks with zero slack. */\n critical_count: number;\n /** Edge count of the longest execution path. */\n critical_path_length: number;\n /** Genuine ordering cycles excluded from scheduling. */\n cycle_count: number;\n /** Whether the row limit omitted scheduled tasks. */\n truncated: boolean;\n /** Longest deterministic execution path; absent with summary. */\n critical_path?: string[];\n /** Bounded scheduled rows, lowest slack first; absent with summary. */\n rows?: GraphScheduleRow[];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** One node ranked by structural centrality with directed fan-in/fan-out. */\nexport interface GraphCentralityRow {\n /** Node id. */\n id: string;\n /** Undirected unique-neighbor degree. */\n degree: number;\n /** Distinct ordering predecessors that gate this node (dependency fan-in). */\n in_degree: number;\n /** Distinct ordering successors this node gates (dependency fan-out). */\n out_degree: number;\n /** Shortest-path betweenness centrality. */\n betweenness: number;\n /** Wasserman–Faust closeness centrality. */\n closeness: number;\n}\n\n/** Result envelope for the centrality subcommand. */\nexport interface GraphCentralityResult {\n /** Executed graph subcommand. */\n subcommand: \"centrality\";\n /** Total indexed graph nodes. */\n node_count: number;\n /** Simple undirected edge count over selected kinds. */\n edge_count: number;\n /** Whether the row limit omitted ranked nodes. */\n truncated: boolean;\n /** Query cost metadata. */\n cost: GraphQueryCost;\n /** Bounded ranked node rows, highest betweenness first; absent with summary. */\n rows?: GraphCentralityRow[];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** One bridge edge projected by the articulation subcommand. */\nexport interface GraphBridgeRow {\n /** Lexicographically smaller endpoint. */\n source: string;\n /** Lexicographically larger endpoint. */\n target: string;\n}\n\n/** Result envelope for the articulation subcommand. */\nexport interface GraphArticulationResult {\n /** Executed graph subcommand. */\n subcommand: \"articulation\";\n /** Total articulation points (cut vertices). */\n articulation_count: number;\n /** Total bridge edges (cut edges). */\n bridge_count: number;\n /** Whether the row limit omitted articulation points or bridges. */\n truncated: boolean;\n /** Query cost metadata. */\n cost: GraphQueryCost;\n /** Bounded sorted articulation-point ids; absent with summary. */\n articulation_points?: string[];\n /** Bounded sorted bridge edges; absent with summary. */\n bridges?: GraphBridgeRow[];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** Result envelope for the dry-run remediation planning subcommand. */\nexport interface GraphPlanResult {\n /** Executed graph subcommand. */\n subcommand: \"plan\";\n /** Total derived remediation proposals before row bounding. */\n step_count: number;\n /** Proposal counts keyed by operation family. */\n steps_by_op: Record<string, number>;\n /** Proposal counts keyed by policy code. */\n steps_by_code: Record<string, number>;\n /** Total governance-audit findings the plan was derived from. */\n finding_count: number;\n /** Whether sample, scan, or row bounds omitted derivable proposals. */\n truncated: boolean;\n /** Query cost metadata. */\n cost: GraphQueryCost;\n /** Bounded proposal rows in audit severity order; absent with summary. */\n steps?: RelationshipRemediationStep[];\n /** Cache observability for this invocation. */\n cache?: GraphCacheMetadata;\n}\n\n/** Union of every graph subcommand result envelope. */\nexport type GraphResult =\n | GraphTraversalResult\n | GraphPathsResult\n | GraphImpactResult\n | GraphAnalyzeResult\n | GraphAuditResult\n | GraphCommunitiesResult\n | GraphRedundancyResult\n | GraphDominatorsResult\n | GraphSlackResult\n | GraphCentralityResult\n | GraphArticulationResult\n | GraphPlanResult\n | GraphIndexResult;\n\n/** Fully parsed graph invocation shared by the subcommand executors. */\ninterface GraphInvocation {\n /** Assembled workspace relationship graph and node details. */\n assembly: WorkspaceRelationshipAssembly;\n /** Canonical registered kind filters, when provided. */\n kinds?: string[];\n /** Parsed non-negative depth bound. */\n maxDepth?: number;\n /** Parsed positive row bound. */\n limit?: number;\n /** Traversal resume cursor. */\n after?: string;\n /** Validated traversal orientation. */\n direction: \"outgoing\" | \"incoming\" | \"both\";\n /** Parsed positive path-count bound. */\n maxPaths?: number;\n /** Parsed positive audit sample bound. */\n sample?: number;\n /** Normalized audit isolate exemptions. */\n exemptIsolates: string[];\n /** Normalized audit isolate-exempt item types. */\n exemptIsolateTypes: string[];\n /** Whether the audit census is persisted as the comparison baseline. */\n saveBaseline: boolean;\n /** Whether row collections are suppressed. */\n summary: boolean;\n}\n\n/** Normalize repeatable or comma-separated id options into a flat list. */\nfunction normalizeIdList(raw: string | string[] | undefined): string[] {\n if (raw === undefined) return [];\n return (Array.isArray(raw) ? raw : [raw])\n .flatMap((value) => value.split(\",\"))\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n}\n\n/** Validate the graph subcommand and its positional-id requirements. */\nexport function parseGraphSubcommand(\n raw: string,\n id: string | undefined,\n target: string | undefined,\n): GraphSubcommand {\n const candidate = raw.trim().toLowerCase();\n if (!(GRAPH_SUBCOMMAND_VALUES as readonly string[]).includes(candidate)) {\n throw new PmCliError(\n `Invalid graph subcommand \"${raw}\". Use one of: ${GRAPH_SUBCOMMAND_VALUES.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n const subcommand = candidate as GraphSubcommand;\n if (ROOTED_SUBCOMMANDS.has(subcommand) && !id?.trim()) {\n throw new PmCliError(\n `graph ${subcommand} requires an item id.`,\n EXIT_CODE.USAGE,\n );\n }\n if (subcommand === \"paths\" && !target?.trim()) {\n throw new PmCliError(\n \"graph paths requires a source and a target item id.\",\n EXIT_CODE.USAGE,\n );\n }\n return subcommand;\n}\n\n/**\n * Re-throw graph-kernel semantic option misuse (non-family kind, unknown\n * cursor, non-transitive redundancy kind) as a usage error carrying the\n * original explanation instead of an opaque crash.\n */\nfunction rethrowGraphUsage(error: unknown): never {\n if (error instanceof TypeError)\n throw new PmCliError(error.message, EXIT_CODE.USAGE);\n throw error;\n}\n\n/** Convert traversal metadata into the shared cost/truncation projection. */\nfunction projectQueryMeta(meta: RelationshipQueryMeta): {\n truncated: boolean;\n cost: GraphQueryCost;\n} {\n return {\n truncated: meta.truncated,\n cost: {\n visited_nodes: meta.visitedNodes,\n inspected_edges: meta.inspectedEdges,\n },\n };\n}\n\n/** Resolve one item id case-insensitively against the assembled graph. */\nfunction canonicalizeGraphId(\n assembly: WorkspaceRelationshipAssembly,\n raw: string,\n): string {\n const wanted = raw.trim().toLowerCase();\n for (const detail of assembly.details) {\n if (\n detail.id.trim().toLowerCase() === wanted &&\n !assembly.missingIdSet.has(detail.id.toLowerCase())\n ) {\n return detail.id;\n }\n }\n throw new PmCliError(`Item ${raw} not found`, EXIT_CODE.NOT_FOUND);\n}\n\n/** Execute one transitive traversal subcommand over the assembled graph. */\nfunction runGraphTraversal(\n subcommand: \"ancestors\" | \"descendants\" | \"predecessors\" | \"successors\",\n root: string,\n invocation: GraphInvocation,\n): GraphTraversalResult {\n const walk = {\n ancestors: hierarchyAncestors,\n descendants: hierarchyDescendants,\n predecessors: orderingPredecessors,\n successors: orderingSuccessors,\n }[subcommand];\n let result;\n try {\n result = walk(invocation.assembly.graph, root, {\n ...(invocation.kinds === undefined ? {} : { kinds: invocation.kinds }),\n ...(invocation.maxDepth === undefined\n ? {}\n : { maxDepth: invocation.maxDepth }),\n ...(invocation.limit === undefined ? {} : { limit: invocation.limit }),\n ...(invocation.after === undefined ? {} : { after: invocation.after }),\n });\n } catch (error) {\n rethrowGraphUsage(error);\n }\n const meta = projectQueryMeta(result.meta);\n return {\n subcommand,\n root,\n count: result.value.length,\n ...meta,\n ...(result.meta.nextCursor === undefined\n ? {}\n : { next_cursor: result.meta.nextCursor }),\n ...(invocation.summary ? {} : { ids: result.value }),\n };\n}\n\n/** Execute the bounded simple-path enumeration subcommand. */\nfunction runGraphPaths(\n root: string,\n target: string,\n invocation: GraphInvocation,\n): GraphPathsResult {\n const result = enumerateRelationshipPaths(\n invocation.assembly.graph,\n root,\n target,\n {\n direction: invocation.direction,\n ...(invocation.kinds === undefined ? {} : { kinds: invocation.kinds }),\n ...(invocation.maxDepth === undefined\n ? {}\n : { maxDepth: invocation.maxDepth }),\n ...(invocation.maxPaths === undefined\n ? {}\n : { maxPaths: invocation.maxPaths }),\n },\n );\n return {\n subcommand: \"paths\",\n root,\n target,\n direction: invocation.direction,\n count: result.value.length,\n ...projectQueryMeta(result.meta),\n ...(invocation.summary\n ? {}\n : {\n paths: result.value.map((path) => ({\n nodes: path.nodes,\n kinds: path.edges.map((edge) => edge.kind),\n length: path.length,\n })),\n }),\n };\n}\n\n/** Execute the bounded blast-radius impact subcommand. */\nfunction runGraphImpact(\n root: string,\n invocation: GraphInvocation,\n): GraphImpactResult {\n const analysis = analyzeGraphImpact(invocation.assembly.graph, root, {\n direction: invocation.direction,\n ...(invocation.kinds === undefined ? {} : { kinds: invocation.kinds }),\n ...(invocation.maxDepth === undefined\n ? {}\n : { maxDepth: invocation.maxDepth }),\n ...(invocation.limit === undefined ? {} : { limit: invocation.limit }),\n });\n return {\n subcommand: \"impact\",\n root,\n direction: invocation.direction,\n count: analysis.affected.length,\n truncated: analysis.truncated,\n cost: {\n visited_nodes: analysis.cost.visitedNodes,\n inspected_edges: analysis.cost.inspectedEdges,\n },\n ...(invocation.summary ? {} : { affected: analysis.affected }),\n };\n}\n\n/** Execute the workspace-wide execution and knowledge analytics subcommand. */\nfunction runGraphAnalyze(invocation: GraphInvocation): GraphAnalyzeResult {\n const graph = invocation.assembly.graph;\n const sampleLimit = invocation.limit ?? DEFAULT_SAMPLE_LIMIT;\n const execution = analyzeRelationshipExecution(graph, {\n registry: graph.registry(),\n });\n const knowledge = analyzeKnowledgeGraph(graph);\n return {\n subcommand: \"analyze\",\n node_count: graph.nodes().length,\n edge_count: graph.edges().length,\n sample_limit: sampleLimit,\n execution: {\n acyclic: execution.acyclic,\n ordered_node_count: execution.order.length,\n layer_count: execution.layers.length,\n frontier_count: execution.frontier.length,\n critical_path_length: execution.criticalPathLength,\n cycle_count: execution.cycles.length,\n ...(invocation.summary\n ? {}\n : {\n frontier: execution.frontier.slice(0, sampleLimit),\n critical_path: execution.criticalPath.slice(0, sampleLimit),\n cycles: execution.cycles.slice(0, sampleLimit),\n }),\n },\n knowledge: {\n component_count: knowledge.components.length,\n largest_component_size: knowledge.components[0]?.length ?? 0,\n orphan_count: knowledge.orphans.length,\n ...(invocation.summary\n ? {}\n : {\n orphans: knowledge.orphans.slice(0, sampleLimit),\n hubs: knowledge.hubs.slice(0, sampleLimit),\n }),\n },\n };\n}\n\n/** Execute the governance-audit subcommand over the assembled graph. */\nfunction runGraphAudit(\n invocation: GraphInvocation,\n isTerminal: (status: string) => boolean,\n): GraphAuditResult {\n const report = auditWorkspaceRelationshipGraph(invocation.assembly, {\n isTerminal,\n ...(invocation.sample === undefined\n ? {}\n : { maxSampleSize: invocation.sample }),\n ...(invocation.exemptIsolates.length === 0\n ? {}\n : { exemptIsolates: invocation.exemptIsolates }),\n ...(invocation.exemptIsolateTypes.length === 0\n ? {}\n : { isolateExemptTypes: invocation.exemptIsolateTypes }),\n });\n const bySeverity: Record<string, number> = {};\n const byCode: Record<string, number> = {};\n const affectedBySeverity: Record<string, number> = {};\n const affectedByCode: Record<string, number> = {};\n for (const finding of report.findings) {\n bySeverity[finding.severity] = (bySeverity[finding.severity] ?? 0) + 1;\n byCode[finding.code] = (byCode[finding.code] ?? 0) + 1;\n affectedBySeverity[finding.severity] =\n (affectedBySeverity[finding.severity] ?? 0) + finding.count;\n affectedByCode[finding.code] =\n (affectedByCode[finding.code] ?? 0) + finding.count;\n }\n return {\n subcommand: \"audit\",\n finding_count: report.findings.length,\n findings_by_severity: bySeverity,\n findings_by_code: byCode,\n affected_subjects_by_severity: affectedBySeverity,\n affected_subjects_by_code: affectedByCode,\n profile: report.profile,\n ...(invocation.summary ? {} : { findings: report.findings }),\n };\n}\n\n/** Execute the deterministic community-detection subcommand. */\nfunction runGraphCommunities(\n invocation: GraphInvocation,\n): GraphCommunitiesResult {\n const sampleLimit = invocation.limit ?? DEFAULT_SAMPLE_LIMIT;\n const result = detectRelationshipCommunities(invocation.assembly.graph, {\n ...(invocation.kinds === undefined ? {} : { kinds: invocation.kinds }),\n });\n const analysis = result.value;\n return {\n subcommand: \"communities\",\n community_count: analysis.communities.length,\n largest_community_size: analysis.communities[0]?.size ?? 0,\n iterations: analysis.iterations,\n converged: analysis.converged,\n truncated: !analysis.converged || analysis.communities.length > sampleLimit,\n cost: {\n visited_nodes: result.meta.visitedNodes,\n inspected_edges: result.meta.inspectedEdges,\n },\n ...(invocation.summary\n ? {}\n : {\n communities: analysis.communities\n .slice(0, sampleLimit)\n .map((community) => ({\n representative: community.representative,\n size: community.size,\n members: community.members.slice(0, sampleLimit),\n })),\n }),\n };\n}\n\n/** Execute the transitive-redundancy scan subcommand. */\nfunction runGraphRedundancy(\n invocation: GraphInvocation,\n): GraphRedundancyResult {\n let result;\n try {\n result = findRedundantRelationshipEdges(invocation.assembly.graph, {\n ...(invocation.kinds === undefined ? {} : { kinds: invocation.kinds }),\n ...(invocation.maxDepth === undefined\n ? {}\n : { maxDepth: invocation.maxDepth }),\n ...(invocation.limit === undefined ? {} : { limit: invocation.limit }),\n });\n } catch (error) {\n rethrowGraphUsage(error);\n }\n return {\n subcommand: \"redundancy\",\n redundant_count: result.value.length,\n ...projectQueryMeta(result.meta),\n ...(invocation.summary\n ? {}\n : {\n redundant: result.value.map((row) => ({\n source: row.edge.source,\n target: row.edge.target,\n kind: row.edge.kind,\n witness: row.witness,\n })),\n }),\n };\n}\n\n/** Execute the dominator/bottleneck analysis subcommand. */\nfunction runGraphDominators(\n root: string,\n invocation: GraphInvocation,\n): GraphDominatorsResult {\n const limit = invocation.limit ?? DEFAULT_SAMPLE_LIMIT;\n const result = computeRelationshipDominators(\n invocation.assembly.graph,\n root,\n {\n direction: invocation.direction,\n ...(invocation.kinds === undefined ? {} : { kinds: invocation.kinds }),\n ...(invocation.maxDepth === undefined\n ? {}\n : { maxDepth: invocation.maxDepth }),\n },\n );\n const bottlenecks = result.value.rows.filter((row) => row.dominatedCount > 0);\n return {\n subcommand: \"dominators\",\n root,\n direction: invocation.direction,\n reachable_count: result.value.reachableCount,\n bottleneck_count: bottlenecks.length,\n truncated: result.meta.truncated || bottlenecks.length > limit,\n cost: {\n visited_nodes: result.meta.visitedNodes,\n inspected_edges: result.meta.inspectedEdges,\n },\n ...(invocation.summary\n ? {}\n : {\n bottlenecks: bottlenecks.slice(0, limit).map((row) => ({\n id: row.id,\n idom: row.idom,\n dominated_count: row.dominatedCount,\n })),\n }),\n };\n}\n\n/** Execute the critical-path slack (float) analysis subcommand. */\nfunction runGraphSlack(invocation: GraphInvocation): GraphSlackResult {\n const limit = invocation.limit ?? DEFAULT_SAMPLE_LIMIT;\n // Scheduling spans every ordering kind; --kind is rejected upstream by\n // assertGraphFlagScope, so no kind filter reaches the analysis here.\n const analysis = analyzeRelationshipSchedule(invocation.assembly.graph);\n const criticalCount = analysis.rows.filter((row) => row.critical).length;\n return {\n subcommand: \"slack\",\n acyclic: analysis.acyclic,\n makespan: analysis.makespan,\n scheduled_count: analysis.scheduledCount,\n critical_count: criticalCount,\n critical_path_length: analysis.criticalPathLength,\n cycle_count: analysis.cycles.length,\n truncated: analysis.rows.length > limit,\n ...(invocation.summary\n ? {}\n : {\n critical_path: analysis.criticalPath,\n rows: analysis.rows.slice(0, limit).map((row) => ({\n id: row.id,\n earliest_start: row.earliestStart,\n latest_start: row.latestStart,\n slack: row.slack,\n critical: row.critical,\n })),\n }),\n };\n}\n\n/** Execute the structural-centrality ranking subcommand. */\nfunction runGraphCentrality(\n invocation: GraphInvocation,\n): GraphCentralityResult {\n const limit = invocation.limit ?? DEFAULT_SAMPLE_LIMIT;\n const result = computeRelationshipCentrality(invocation.assembly.graph, {\n ...(invocation.kinds === undefined ? {} : { kinds: invocation.kinds }),\n });\n const analysis = result.value;\n return {\n subcommand: \"centrality\",\n node_count: analysis.nodeCount,\n edge_count: analysis.edgeCount,\n truncated: analysis.rows.length > limit,\n cost: {\n visited_nodes: result.meta.visitedNodes,\n inspected_edges: result.meta.inspectedEdges,\n },\n ...(invocation.summary\n ? {}\n : {\n rows: analysis.rows.slice(0, limit).map((row) => ({\n id: row.id,\n degree: row.degree,\n in_degree: row.inDegree,\n out_degree: row.outDegree,\n betweenness: row.betweenness,\n closeness: row.closeness,\n })),\n }),\n };\n}\n\n/** Execute the articulation-point and bridge (cut-structure) subcommand. */\nfunction runGraphArticulation(\n invocation: GraphInvocation,\n): GraphArticulationResult {\n const limit = invocation.limit ?? DEFAULT_SAMPLE_LIMIT;\n const result = findRelationshipCutStructure(invocation.assembly.graph, {\n ...(invocation.kinds === undefined ? {} : { kinds: invocation.kinds }),\n });\n const { articulationPoints, bridges } = result.value;\n return {\n subcommand: \"articulation\",\n articulation_count: articulationPoints.length,\n bridge_count: bridges.length,\n truncated: articulationPoints.length > limit || bridges.length > limit,\n cost: {\n visited_nodes: result.meta.visitedNodes,\n inspected_edges: result.meta.inspectedEdges,\n },\n ...(invocation.summary\n ? {}\n : {\n articulation_points: articulationPoints.slice(0, limit),\n bridges: bridges.slice(0, limit),\n }),\n };\n}\n\n/** Execute the dry-run remediation planning subcommand. */\nfunction runGraphPlan(\n invocation: GraphInvocation,\n isTerminal: (status: string) => boolean,\n): GraphPlanResult {\n const limit = invocation.limit ?? DEFAULT_SAMPLE_LIMIT;\n const plan = planRelationshipRemediation(invocation.assembly, {\n isTerminal,\n redundancyLimit: limit,\n ...(invocation.sample === undefined\n ? {}\n : { maxSampleSize: invocation.sample }),\n ...(invocation.exemptIsolates.length === 0\n ? {}\n : { exemptIsolates: invocation.exemptIsolates }),\n ...(invocation.exemptIsolateTypes.length === 0\n ? {}\n : { isolateExemptTypes: invocation.exemptIsolateTypes }),\n });\n const byOp: Record<string, number> = {};\n const byCode: Record<string, number> = {};\n for (const step of plan.steps) {\n byOp[step.op] = (byOp[step.op] ?? 0) + 1;\n byCode[step.code] = (byCode[step.code] ?? 0) + 1;\n }\n return {\n subcommand: \"plan\",\n step_count: plan.steps.length,\n steps_by_op: byOp,\n steps_by_code: byCode,\n finding_count: plan.report.findings.length,\n truncated: plan.truncated || plan.steps.length > limit,\n cost: {\n visited_nodes: plan.cost.visitedNodes,\n inspected_edges: plan.cost.inspectedEdges,\n },\n ...(invocation.summary ? {} : { steps: plan.steps.slice(0, limit) }),\n };\n}\n\n/** Build the deterministic memoization key covering every query-shaping input. */\nfunction buildGraphQueryKey(\n subcommand: GraphSubcommand,\n root: string | undefined,\n pathsTarget: string | undefined,\n invocation: GraphInvocation,\n): string {\n return JSON.stringify({\n subcommand,\n root: root ?? null,\n target: pathsTarget ?? null,\n kinds: invocation.kinds ?? null,\n maxDepth: invocation.maxDepth ?? null,\n limit: invocation.limit ?? null,\n after: invocation.after ?? null,\n direction: invocation.direction,\n maxPaths: invocation.maxPaths ?? null,\n sample: invocation.sample ?? null,\n // The audit consumes exemptions as a case-insensitive set, so the key\n // must not distinguish logically identical spellings or orderings.\n exemptIsolates: [\n ...new Set(invocation.exemptIsolates.map((id) => id.toLowerCase())),\n ].sort(),\n exemptIsolateTypes: [\n ...new Set(\n invocation.exemptIsolateTypes.map((type) => type.toLowerCase()),\n ),\n ].sort(),\n summary: invocation.summary,\n });\n}\n\n/** Dispatch one parsed graph subcommand to its executor. */\nfunction executeGraphSubcommand(\n subcommand: Exclude<GraphSubcommand, \"index\">,\n root: string | undefined,\n pathsTarget: string | undefined,\n invocation: GraphInvocation,\n isTerminal: (status: string) => boolean,\n): GraphResult {\n if (subcommand === \"analyze\") return runGraphAnalyze(invocation);\n if (subcommand === \"audit\") return runGraphAudit(invocation, isTerminal);\n if (subcommand === \"plan\") return runGraphPlan(invocation, isTerminal);\n if (subcommand === \"communities\") return runGraphCommunities(invocation);\n if (subcommand === \"redundancy\") return runGraphRedundancy(invocation);\n if (subcommand === \"dominators\") return runGraphDominators(root!, invocation);\n if (subcommand === \"slack\") return runGraphSlack(invocation);\n if (subcommand === \"centrality\") return runGraphCentrality(invocation);\n if (subcommand === \"articulation\") return runGraphArticulation(invocation);\n if (subcommand === \"paths\")\n return runGraphPaths(root!, pathsTarget!, invocation);\n if (subcommand === \"impact\") return runGraphImpact(root!, invocation);\n return runGraphTraversal(subcommand, root!, invocation);\n}\n\n/** Reject maintenance or baseline flags outside their owning subcommand. */\nfunction assertGraphFlagScope(\n subcommand: GraphSubcommand,\n options: GraphCommandOptions,\n): void {\n if (\n subcommand !== \"index\" &&\n (options.rebuild === true || options.clear === true)\n )\n throw new PmCliError(\n \"--rebuild and --clear apply only to graph index.\",\n EXIT_CODE.USAGE,\n );\n if (subcommand !== \"audit\" && options.saveBaseline === true)\n throw new PmCliError(\n \"--save-baseline applies only to graph audit.\",\n EXIT_CODE.USAGE,\n );\n // Slack schedules the whole ordering DAG (reusing the exact execution\n // analysis, which has no kind filter), so reject --kind instead of silently\n // ignoring it and letting the cache key diverge on an inert option.\n if (subcommand === \"slack\" && options.kind !== undefined)\n throw new PmCliError(\n \"graph slack analyzes every ordering kind; --kind is not supported.\",\n EXIT_CODE.USAGE,\n );\n if (options.rebuild === true && options.clear === true)\n throw new PmCliError(\n \"graph index accepts either --rebuild or --clear, not both.\",\n EXIT_CODE.USAGE,\n );\n}\n\n/**\n * Execute the durable-index maintenance subcommand: report status, delete the\n * envelope, or rebuild it and warm the counts-first analyze and audit census\n * queries so follow-up summary invocations answer from the persisted index.\n * A rebuild is also the explicit opt-in that enables persistence on\n * workspaces below the implicit item threshold.\n */\nasync function runGraphIndex(\n pmRoot: string,\n fingerprint: string,\n invocation: GraphInvocation,\n itemCount: number,\n isTerminal: (status: string) => boolean,\n options: GraphCommandOptions,\n): Promise<GraphIndexResult> {\n let action: GraphIndexResult[\"action\"] = \"status\";\n if (options.clear === true) {\n await clearDurableGraphCache(pmRoot);\n action = \"cleared\";\n }\n if (options.rebuild === true) {\n await clearDurableGraphCache(pmRoot);\n const view = await openDurableGraphCache(pmRoot, fingerprint);\n const warmInvocation: GraphInvocation = {\n assembly: invocation.assembly,\n direction: \"both\",\n exemptIsolates: [],\n exemptIsolateTypes: [],\n saveBaseline: false,\n summary: true,\n };\n for (const warm of [\"analyze\", \"audit\"] as const) {\n await persistDurableGraphResult(\n pmRoot,\n fingerprint,\n view,\n buildGraphQueryKey(warm, undefined, undefined, warmInvocation),\n executeGraphSubcommand(\n warm,\n undefined,\n undefined,\n warmInvocation,\n isTerminal,\n ),\n );\n }\n action = \"rebuilt\";\n }\n const status = await durableGraphCacheStatus(pmRoot, fingerprint);\n return {\n subcommand: \"index\",\n action,\n state: status.exists ? (status.fresh ? \"fresh\" : \"stale\") : \"absent\",\n entry_count: status.entry_count,\n item_count: itemCount,\n min_items_threshold: GRAPH_DURABLE_CACHE_MIN_ITEMS,\n persist_enabled: shouldPersistDurableGraphCache(itemCount, status.exists),\n current_fingerprint: fingerprint.slice(0, 12),\n ...(status.saved_at === undefined ? {} : { saved_at: status.saved_at }),\n ...(status.bytes === undefined ? {} : { bytes: status.bytes }),\n };\n}\n\n/**\n * Attach the change-since-baseline census delta to one audit envelope and\n * persist the current census when the caller requested a new baseline. The\n * delta always compares against the baseline as it existed before this\n * invocation, so `--save-baseline` reports drift once and then resets it.\n */\nasync function applyAuditBaseline(\n pmRoot: string,\n fingerprint: string,\n audit: GraphAuditResult,\n saveBaseline: boolean,\n): Promise<GraphAuditResult> {\n const current: RelationshipAuditSnapshot = {\n saved_at: new Date().toISOString(),\n fingerprint,\n affected_subjects_by_code: audit.affected_subjects_by_code,\n profile: audit.profile,\n };\n const stored = await loadGraphAuditBaseline(pmRoot);\n if (saveBaseline) await saveGraphAuditBaseline(pmRoot, current);\n return stored === undefined\n ? audit\n : { ...audit, baseline: diffRelationshipAuditSnapshots(stored, current) };\n}\n\n/** Persist a rebuildable query result without allowing storage failure to reject the query. */\nasync function persistDurableGraphResultBestEffort(\n pmRoot: string,\n fingerprint: string,\n view: DurableGraphCacheView,\n queryKey: string,\n result: GraphResult,\n): Promise<void> {\n try {\n await persistDurableGraphResult(\n pmRoot,\n fingerprint,\n view,\n queryKey,\n result,\n );\n } catch {\n // The in-memory result remains authoritative; the next invocation can rebuild the cache.\n }\n}\n\n/** Implements run graph for the public runtime surface of this module. */\nexport async function runGraph(\n subcommandRaw: string,\n id: string | undefined,\n target: string | undefined,\n options: GraphCommandOptions,\n global: GlobalOptions,\n): Promise<GraphResult> {\n const subcommand = parseGraphSubcommand(subcommandRaw, id, target);\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n const items = await listAllItemMetadataLight(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n undefined,\n settings.schema,\n );\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const isTerminal = (status: string): boolean =>\n isTerminalStatus(status, statusRegistry);\n assertGraphFlagScope(subcommand, options);\n const relationshipRegistry = resolveWorkspaceRelationshipKindRegistry();\n const kinds = parseKinds(options.kind, relationshipRegistry);\n const lookup = workspaceGraphCache().lookup(\n pmRoot,\n computeWorkspaceGraphFingerprint(items, isTerminal, relationshipRegistry),\n () =>\n assembleWorkspaceRelationshipGraph(\n items,\n isTerminal,\n relationshipRegistry,\n ),\n );\n const invocation: GraphInvocation = {\n assembly: lookup.assembly,\n ...(kinds === undefined ? {} : { kinds }),\n maxDepth: parseMaxDepth(options.maxDepth),\n limit: parsePositiveInteger(options.limit, \"limit\"),\n after: options.after?.trim() || undefined,\n direction: parseDirection(options.direction),\n maxPaths: parsePositiveInteger(options.maxPaths, \"max-paths\"),\n sample: parsePositiveInteger(options.sample, \"sample\"),\n exemptIsolates: normalizeIdList(options.exemptIsolate),\n exemptIsolateTypes: normalizeIdList(options.exemptIsolateType),\n saveBaseline: options.saveBaseline === true,\n summary: options.summary === true,\n };\n if (subcommand === \"index\") {\n return runGraphIndex(\n pmRoot,\n lookup.fingerprint,\n invocation,\n items.length,\n isTerminal,\n options,\n );\n }\n const root = ROOTED_SUBCOMMANDS.has(subcommand)\n ? canonicalizeGraphId(invocation.assembly, id!)\n : undefined;\n const pathsTarget =\n subcommand === \"paths\"\n ? canonicalizeGraphId(invocation.assembly, target!)\n : undefined;\n const queryKey = buildGraphQueryKey(\n subcommand,\n root,\n pathsTarget,\n invocation,\n );\n const durableView = await openDurableGraphCache(pmRoot, lookup.fingerprint);\n const durableValue = durableView.results[queryKey];\n const memo = lookup.memoize(queryKey, () =>\n durableValue !== undefined\n ? (structuredClone(durableValue) as GraphResult)\n : executeGraphSubcommand(\n subcommand,\n root,\n pathsTarget,\n invocation,\n isTerminal,\n ),\n );\n const persistEnabled = shouldPersistDurableGraphCache(\n items.length,\n durableView.exists,\n );\n if (!memo.reused && durableValue === undefined && persistEnabled) {\n await persistDurableGraphResultBestEffort(\n pmRoot,\n lookup.fingerprint,\n durableView,\n queryKey,\n memo.value,\n );\n }\n const value =\n memo.value.subcommand === \"audit\"\n ? await applyAuditBaseline(\n pmRoot,\n lookup.fingerprint,\n memo.value,\n invocation.saveBaseline,\n )\n : memo.value;\n return {\n ...value,\n cache: {\n fingerprint: lookup.fingerprint.slice(0, 12),\n assembly: lookup.assemblyReused ? \"hit\" : \"miss\",\n result: memo.reused ? \"hit\" : \"miss\",\n durable:\n durableValue !== undefined ? \"hit\" : persistEnabled ? \"miss\" : \"off\",\n },\n };\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;;;AACH,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,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CAAiB;QAChD,CAAC,CAAC,sBAAsB,CACpB,UAAU,EACV,IAAI,EACJ,WAAW,EACX,UAAU,EACV,UAAU,CACX,CACN,CAAC;IACF,MAAM,cAAc,GAAG,8BAA8B,CACnD,KAAK,CAAC,MAAM,EACZ,WAAW,CAAC,MAAM,CACnB,CAAC;IACF,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,YAAY,KAAK,SAAS,IAAI,cAAc,EAAE,CAAC;QACjE,MAAM,mCAAmC,CACvC,MAAM,EACN,MAAM,CAAC,WAAW,EAClB,WAAW,EACX,QAAQ,EACR,IAAI,CAAC,KAAK,CACX,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,GACT,IAAI,CAAC,KAAK,CAAC,UAAU,KAAK,OAAO;QAC/B,CAAC,CAAC,MAAM,kBAAkB,CACtB,MAAM,EACN,MAAM,CAAC,WAAW,EAClB,IAAI,CAAC,KAAK,EACV,UAAU,CAAC,YAAY,CACxB;QACH,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;IACjB,OAAO;QACL,GAAG,KAAK;QACR,KAAK,EAAE;YACL,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;YAC5C,QAAQ,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;YAChD,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;YACpC,OAAO,EACL,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK;SACvE;KACF,CAAC;AACJ,CAAC","debugId":"7f767038-30c6-555b-b9ac-adaf98b154e2"}
@@ -0,0 +1,59 @@
1
+ import { RelationshipGraph } from "../relationships.js";
2
+ /** One scheduled task row with its earliest/latest window and total float. */
3
+ export interface RelationshipScheduleRow {
4
+ /** Scheduled task id. */
5
+ id: string;
6
+ /** Longest prerequisite distance from any source (earliest start). */
7
+ earliestStart: number;
8
+ /** Earliest start plus the unit task duration. */
9
+ earliestFinish: number;
10
+ /** Latest start that still preserves the makespan. */
11
+ latestStart: number;
12
+ /** Latest finish that still preserves the makespan. */
13
+ latestFinish: number;
14
+ /** Total float: latest start minus earliest start. */
15
+ slack: number;
16
+ /** Whether the task has zero slack and lies on a critical path. */
17
+ critical: boolean;
18
+ }
19
+ /** Bounded schedule-analysis controls. */
20
+ export interface GraphScheduleOptions {
21
+ /** Abort signal checked once at entry, before the forward pass. */
22
+ signal?: AbortSignal;
23
+ }
24
+ /** Deterministic critical-path schedule of the order-bearing subgraph. */
25
+ export interface RelationshipScheduleAnalysis {
26
+ /** Whether the result is exact rather than sampled or approximate. */
27
+ exact: true;
28
+ /** Whether the order-bearing graph is acyclic. */
29
+ acyclic: boolean;
30
+ /** Total makespan in unit task durations; zero when nothing is scheduled. */
31
+ makespan: number;
32
+ /** Number of tasks participating in the order-bearing DAG. */
33
+ scheduledCount: number;
34
+ /** Longest deterministic execution path — a canonical zero-slack chain. */
35
+ criticalPath: string[];
36
+ /** Edge count of the critical path. */
37
+ criticalPathLength: number;
38
+ /** Genuine ordering cycles, excluded from scheduling. */
39
+ cycles: string[][];
40
+ /** Scheduled rows sorted by ascending slack, then earliest start, then id. */
41
+ rows: RelationshipScheduleRow[];
42
+ /** Semantic provenance for the analysis. */
43
+ provenance: {
44
+ algorithm: "critical-path-method";
45
+ edgeFamily: "ordering";
46
+ weighting: "unit";
47
+ };
48
+ }
49
+ /**
50
+ * Compute the deterministic critical-path schedule of the order-bearing
51
+ * subgraph. Earliest-start distances and the critical path come from the exact
52
+ * execution analysis; the backward pass then assigns each task the latest start
53
+ * that preserves the makespan and reports total float as `slack`. Zero-slack
54
+ * tasks are `critical`. Only tasks with a well-defined earliest start are
55
+ * scheduled: tasks with no order-bearing edge, tasks on a genuine ordering
56
+ * cycle, and tasks transitively gated by a cycle (excluded from Kahn's partial
57
+ * order) are all omitted from `rows`; genuine cycles are reported in `cycles`.
58
+ */
59
+ export declare function analyzeRelationshipSchedule(graph: RelationshipGraph, options?: GraphScheduleOptions): RelationshipScheduleAnalysis;
@@ -0,0 +1,125 @@
1
+ /**
2
+ * @module sdk/graph/scheduling
3
+ *
4
+ * Critical Path Method (CPM) scheduling over the order-bearing relationship
5
+ * DAG. The forward pass — topological order, earliest-start distances, the
6
+ * longest deterministic path, and genuine-cycle isolation — is reused from the
7
+ * exact execution analysis; this module adds the backward pass that derives
8
+ * each task's latest start, latest finish, and total float (slack), then
9
+ * classifies zero-slack tasks as critical. Durations are unit-weighted so the
10
+ * schedule is deterministic and metadata-independent: slack counts how many
11
+ * whole prerequisite hops a task can drift without extending the makespan.
12
+ * Only tasks with a well-defined earliest start are scheduled: nodes with no
13
+ * order-bearing edge, genuine ordering cycles, and any task transitively gated
14
+ * by a cycle (whose earliest start is undefined) are all omitted from `rows`.
15
+ * Genuine ordering cycles are additionally reported in `cycles`.
16
+ */
17
+
18
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b92fecb2-bbc5-5837-906c-bf5d32b2a4d6")}catch(e){}}();
19
+ import { analyzeRelationshipExecution, } from "../relationship-analytics.js";
20
+ import { orientOrderingEdge } from "./traversal.js";
21
+ /**
22
+ * Collect the execution-oriented forward adjacency and the set of tasks that
23
+ * carry any order-bearing edge. Each ordering edge is oriented through the
24
+ * registry's declared precedence so inverse spellings agree, and self-loops
25
+ * (which the execution cycle analysis reports) never enter the adjacency.
26
+ */
27
+ function collectOrderingParticipation(graph) {
28
+ const registry = graph.registry();
29
+ const forward = new Map();
30
+ const participants = new Set();
31
+ for (const edge of graph.edges()) {
32
+ const definition = registry.require(edge.kind);
33
+ if (!definition.ordering)
34
+ continue;
35
+ const { predecessor, successor } = orientOrderingEdge(edge, definition);
36
+ participants.add(predecessor);
37
+ participants.add(successor);
38
+ if (predecessor === successor)
39
+ continue;
40
+ const targets = forward.get(predecessor);
41
+ if (targets === undefined)
42
+ forward.set(predecessor, new Set([successor]));
43
+ else
44
+ targets.add(successor);
45
+ }
46
+ return { forward, participants };
47
+ }
48
+ /** Resolve a task's latest finish from its acyclic successors, or the makespan when it has none. */
49
+ function latestFinishFor(successors, acyclic, latestStart, makespan) {
50
+ if (successors === undefined)
51
+ return makespan;
52
+ let bound = makespan;
53
+ for (const successor of successors) {
54
+ if (!acyclic.has(successor))
55
+ continue;
56
+ bound = Math.min(bound, latestStart.get(successor));
57
+ }
58
+ return bound;
59
+ }
60
+ /** Build one scheduled row from the forward earliest-start depth and backward latest-start. */
61
+ function scheduleRow(id, earliestStart, latestStart) {
62
+ const slack = latestStart - earliestStart;
63
+ return {
64
+ id,
65
+ earliestStart,
66
+ earliestFinish: earliestStart + 1,
67
+ latestStart,
68
+ latestFinish: latestStart + 1,
69
+ slack,
70
+ critical: slack === 0,
71
+ };
72
+ }
73
+ /** Run the backward CPM pass over the acyclic participants in reverse topological order. */
74
+ function computeScheduleRows(topoParticipants, participation, depth, acyclic, makespan) {
75
+ const latestStart = new Map();
76
+ for (let index = topoParticipants.length - 1; index >= 0; index -= 1) {
77
+ const id = topoParticipants[index];
78
+ const finish = latestFinishFor(participation.forward.get(id), acyclic, latestStart, makespan);
79
+ latestStart.set(id, finish - 1);
80
+ }
81
+ return topoParticipants
82
+ .map((id) => scheduleRow(id, depth[id], latestStart.get(id)))
83
+ .sort((left, right) => left.slack - right.slack ||
84
+ left.earliestStart - right.earliestStart ||
85
+ left.id.localeCompare(right.id));
86
+ }
87
+ /**
88
+ * Compute the deterministic critical-path schedule of the order-bearing
89
+ * subgraph. Earliest-start distances and the critical path come from the exact
90
+ * execution analysis; the backward pass then assigns each task the latest start
91
+ * that preserves the makespan and reports total float as `slack`. Zero-slack
92
+ * tasks are `critical`. Only tasks with a well-defined earliest start are
93
+ * scheduled: tasks with no order-bearing edge, tasks on a genuine ordering
94
+ * cycle, and tasks transitively gated by a cycle (excluded from Kahn's partial
95
+ * order) are all omitted from `rows`; genuine cycles are reported in `cycles`.
96
+ */
97
+ export function analyzeRelationshipSchedule(graph, options = {}) {
98
+ options.signal?.throwIfAborted();
99
+ const execution = analyzeRelationshipExecution(graph, { registry: graph.registry() });
100
+ const participation = collectOrderingParticipation(graph);
101
+ const acyclic = new Set(execution.order);
102
+ const topoParticipants = execution.order.filter((id) => participation.participants.has(id));
103
+ const makespan = topoParticipants.reduce((peak, id) => Math.max(peak, execution.depth[id] + 1), 0);
104
+ const rows = computeScheduleRows(topoParticipants, participation, execution.depth, acyclic, makespan);
105
+ const scheduled = rows.length > 0;
106
+ return {
107
+ exact: true,
108
+ acyclic: execution.acyclic,
109
+ makespan,
110
+ scheduledCount: rows.length,
111
+ // A single-node execution "path" over a workspace with no order-bearing
112
+ // edge is not a real critical path, so report it only when work is scheduled.
113
+ criticalPath: scheduled ? execution.criticalPath : [],
114
+ criticalPathLength: scheduled ? execution.criticalPathLength : 0,
115
+ cycles: execution.cycles,
116
+ rows,
117
+ provenance: {
118
+ algorithm: "critical-path-method",
119
+ edgeFamily: "ordering",
120
+ weighting: "unit",
121
+ },
122
+ };
123
+ }
124
+ //# sourceMappingURL=scheduling.js.map
125
+ //# debugId=b92fecb2-bbc5-5837-906c-bf5d32b2a4d6
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scheduling.js","sources":["sdk/graph/scheduling.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/graph/scheduling\n *\n * Critical Path Method (CPM) scheduling over the order-bearing relationship\n * DAG. The forward pass — topological order, earliest-start distances, the\n * longest deterministic path, and genuine-cycle isolation — is reused from the\n * exact execution analysis; this module adds the backward pass that derives\n * each task's latest start, latest finish, and total float (slack), then\n * classifies zero-slack tasks as critical. Durations are unit-weighted so the\n * schedule is deterministic and metadata-independent: slack counts how many\n * whole prerequisite hops a task can drift without extending the makespan.\n * Only tasks with a well-defined earliest start are scheduled: nodes with no\n * order-bearing edge, genuine ordering cycles, and any task transitively gated\n * by a cycle (whose earliest start is undefined) are all omitted from `rows`.\n * Genuine ordering cycles are additionally reported in `cycles`.\n */\nimport {\n analyzeRelationshipExecution,\n type RelationshipExecutionAnalysis,\n} from \"../relationship-analytics.js\";\nimport { RelationshipGraph } from \"../relationships.js\";\nimport { orientOrderingEdge } from \"./traversal.js\";\n\n/** One scheduled task row with its earliest/latest window and total float. */\nexport interface RelationshipScheduleRow {\n /** Scheduled task id. */\n id: string;\n /** Longest prerequisite distance from any source (earliest start). */\n earliestStart: number;\n /** Earliest start plus the unit task duration. */\n earliestFinish: number;\n /** Latest start that still preserves the makespan. */\n latestStart: number;\n /** Latest finish that still preserves the makespan. */\n latestFinish: number;\n /** Total float: latest start minus earliest start. */\n slack: number;\n /** Whether the task has zero slack and lies on a critical path. */\n critical: boolean;\n}\n\n/** Bounded schedule-analysis controls. */\nexport interface GraphScheduleOptions {\n /** Abort signal checked once at entry, before the forward pass. */\n signal?: AbortSignal;\n}\n\n/** Deterministic critical-path schedule of the order-bearing subgraph. */\nexport interface RelationshipScheduleAnalysis {\n /** Whether the result is exact rather than sampled or approximate. */\n exact: true;\n /** Whether the order-bearing graph is acyclic. */\n acyclic: boolean;\n /** Total makespan in unit task durations; zero when nothing is scheduled. */\n makespan: number;\n /** Number of tasks participating in the order-bearing DAG. */\n scheduledCount: number;\n /** Longest deterministic execution path — a canonical zero-slack chain. */\n criticalPath: string[];\n /** Edge count of the critical path. */\n criticalPathLength: number;\n /** Genuine ordering cycles, excluded from scheduling. */\n cycles: string[][];\n /** Scheduled rows sorted by ascending slack, then earliest start, then id. */\n rows: RelationshipScheduleRow[];\n /** Semantic provenance for the analysis. */\n provenance: {\n algorithm: \"critical-path-method\";\n edgeFamily: \"ordering\";\n weighting: \"unit\";\n };\n}\n\n/** Forward order-bearing adjacency restricted to tasks that carry an ordering edge. */\ninterface OrderingParticipation {\n /** Predecessor-to-successor adjacency in execution orientation. */\n forward: Map<string, Set<string>>;\n /** Ids that appear as an endpoint of at least one ordering edge. */\n participants: Set<string>;\n}\n\n/**\n * Collect the execution-oriented forward adjacency and the set of tasks that\n * carry any order-bearing edge. Each ordering edge is oriented through the\n * registry's declared precedence so inverse spellings agree, and self-loops\n * (which the execution cycle analysis reports) never enter the adjacency.\n */\nfunction collectOrderingParticipation(\n graph: RelationshipGraph,\n): OrderingParticipation {\n const registry = graph.registry();\n const forward = new Map<string, Set<string>>();\n const participants = new Set<string>();\n for (const edge of graph.edges()) {\n const definition = registry.require(edge.kind);\n if (!definition.ordering) continue;\n const { predecessor, successor } = orientOrderingEdge(edge, definition);\n participants.add(predecessor);\n participants.add(successor);\n if (predecessor === successor) continue;\n const targets = forward.get(predecessor);\n if (targets === undefined) forward.set(predecessor, new Set([successor]));\n else targets.add(successor);\n }\n return { forward, participants };\n}\n\n/** Resolve a task's latest finish from its acyclic successors, or the makespan when it has none. */\nfunction latestFinishFor(\n successors: Set<string> | undefined,\n acyclic: Set<string>,\n latestStart: Map<string, number>,\n makespan: number,\n): number {\n if (successors === undefined) return makespan;\n let bound = makespan;\n for (const successor of successors) {\n if (!acyclic.has(successor)) continue;\n bound = Math.min(bound, latestStart.get(successor)!);\n }\n return bound;\n}\n\n/** Build one scheduled row from the forward earliest-start depth and backward latest-start. */\nfunction scheduleRow(\n id: string,\n earliestStart: number,\n latestStart: number,\n): RelationshipScheduleRow {\n const slack = latestStart - earliestStart;\n return {\n id,\n earliestStart,\n earliestFinish: earliestStart + 1,\n latestStart,\n latestFinish: latestStart + 1,\n slack,\n critical: slack === 0,\n };\n}\n\n/** Run the backward CPM pass over the acyclic participants in reverse topological order. */\nfunction computeScheduleRows(\n topoParticipants: readonly string[],\n participation: OrderingParticipation,\n depth: Record<string, number>,\n acyclic: Set<string>,\n makespan: number,\n): RelationshipScheduleRow[] {\n const latestStart = new Map<string, number>();\n for (let index = topoParticipants.length - 1; index >= 0; index -= 1) {\n const id = topoParticipants[index]!;\n const finish = latestFinishFor(\n participation.forward.get(id),\n acyclic,\n latestStart,\n makespan,\n );\n latestStart.set(id, finish - 1);\n }\n return topoParticipants\n .map((id) => scheduleRow(id, depth[id]!, latestStart.get(id)!))\n .sort(\n (left, right) =>\n left.slack - right.slack ||\n left.earliestStart - right.earliestStart ||\n left.id.localeCompare(right.id),\n );\n}\n\n/**\n * Compute the deterministic critical-path schedule of the order-bearing\n * subgraph. Earliest-start distances and the critical path come from the exact\n * execution analysis; the backward pass then assigns each task the latest start\n * that preserves the makespan and reports total float as `slack`. Zero-slack\n * tasks are `critical`. Only tasks with a well-defined earliest start are\n * scheduled: tasks with no order-bearing edge, tasks on a genuine ordering\n * cycle, and tasks transitively gated by a cycle (excluded from Kahn's partial\n * order) are all omitted from `rows`; genuine cycles are reported in `cycles`.\n */\nexport function analyzeRelationshipSchedule(\n graph: RelationshipGraph,\n options: GraphScheduleOptions = {},\n): RelationshipScheduleAnalysis {\n options.signal?.throwIfAborted();\n const execution: RelationshipExecutionAnalysis = analyzeRelationshipExecution(\n graph,\n { registry: graph.registry() },\n );\n const participation = collectOrderingParticipation(graph);\n const acyclic = new Set(execution.order);\n const topoParticipants = execution.order.filter((id) =>\n participation.participants.has(id),\n );\n const makespan = topoParticipants.reduce(\n (peak, id) => Math.max(peak, execution.depth[id]! + 1),\n 0,\n );\n const rows = computeScheduleRows(\n topoParticipants,\n participation,\n execution.depth,\n acyclic,\n makespan,\n );\n const scheduled = rows.length > 0;\n return {\n exact: true,\n acyclic: execution.acyclic,\n makespan,\n scheduledCount: rows.length,\n // A single-node execution \"path\" over a workspace with no order-bearing\n // edge is not a real critical path, so report it only when work is scheduled.\n criticalPath: scheduled ? execution.criticalPath : [],\n criticalPathLength: scheduled ? execution.criticalPathLength : 0,\n cycles: execution.cycles,\n rows,\n provenance: {\n algorithm: \"critical-path-method\",\n edgeFamily: \"ordering\",\n weighting: \"unit\",\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,CAAC,MAAM,GAAG,CAAC,CAAC;IAClC,OAAO;QACL,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,SAAS,CAAC,OAAO;QAC1B,QAAQ;QACR,cAAc,EAAE,IAAI,CAAC,MAAM;QAC3B,wEAAwE;QACxE,8EAA8E;QAC9E,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE;QACrD,kBAAkB,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;QAChE,MAAM,EAAE,SAAS,CAAC,MAAM;QACxB,IAAI;QACJ,UAAU,EAAE;YACV,SAAS,EAAE,sBAAsB;YACjC,UAAU,EAAE,UAAU;YACtB,SAAS,EAAE,MAAM;SAClB;KACF,CAAC;AACJ,CAAC","debugId":"b92fecb2-bbc5-5837-906c-bf5d32b2a4d6"}
@@ -43,6 +43,17 @@ export interface GraphPathOptions extends RelationshipQueryOptions {
43
43
  export declare function hierarchyParentEndpoint(edge: RelationshipEdge, definition: RelationshipKindDefinition): string;
44
44
  /** Endpoint of an ordering edge that must finish first. */
45
45
  export declare function orderingPredecessorEndpoint(edge: RelationshipEdge, definition: RelationshipKindDefinition): string;
46
+ /**
47
+ * Orient one ordering edge into its execution direction — the predecessor that
48
+ * must finish first and the successor it gates — honoring the kind's declared
49
+ * precedence so inverse spellings (`blocked_by`/`blocks`) agree. This is the
50
+ * single ordering-orientation primitive shared by scheduling and degree
51
+ * analytics.
52
+ */
53
+ export declare function orientOrderingEdge(edge: RelationshipEdge, definition: RelationshipKindDefinition): {
54
+ predecessor: string;
55
+ successor: string;
56
+ };
46
57
  /**
47
58
  * Return the bounded transitive hierarchy ancestors of one node in
48
59
  * breadth-first discovery order, honoring each hierarchy kind's declared
@@ -1,6 +1,6 @@
1
1
  /** Default number of paths returned by bounded path enumeration. */
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ed9f0831-6011-5ee2-abd6-72375eac0a3a")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8b7a0e24-8ead-5b79-a83b-6d2bb32f807f")}catch(e){}}();
4
4
  const DEFAULT_MAX_PATHS = 5;
5
5
  /** Default expansion-safety bound for bounded path enumeration. */
6
6
  const DEFAULT_MAX_VISITED_PATHS = 10_000;
@@ -28,6 +28,20 @@ export function orderingPredecessorEndpoint(edge, definition) {
28
28
  ? edge.target
29
29
  : edge.source;
30
30
  }
31
+ /**
32
+ * Orient one ordering edge into its execution direction — the predecessor that
33
+ * must finish first and the successor it gates — honoring the kind's declared
34
+ * precedence so inverse spellings (`blocked_by`/`blocks`) agree. This is the
35
+ * single ordering-orientation primitive shared by scheduling and degree
36
+ * analytics.
37
+ */
38
+ export function orientOrderingEdge(edge, definition) {
39
+ const predecessor = orderingPredecessorEndpoint(edge, definition);
40
+ return {
41
+ predecessor,
42
+ successor: predecessor === edge.source ? edge.target : edge.source,
43
+ };
44
+ }
31
45
  /** Validate optional kind filters against one semantic edge family. */
32
46
  function resolveFamilyKinds(graph, kinds, family) {
33
47
  if (kinds === undefined)
@@ -259,4 +273,4 @@ export function enumerateRelationshipPaths(graph, source, target, options = {})
259
273
  return enumerateNonZeroRelationshipPaths(graph, source, target, options, maxPaths, maxVisitedPaths, maxDepth, direction);
260
274
  }
261
275
  //# sourceMappingURL=traversal.js.map
262
- //# debugId=ed9f0831-6011-5ee2-abd6-72375eac0a3a
276
+ //# debugId=8b7a0e24-8ead-5b79-a83b-6d2bb32f807f