@unbrained/pm-cli 2026.8.7 → 2026.8.9

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 (288) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +54 -0
  3. package/dist/cli/main.js +4 -3
  4. package/dist/cli/register-annotations.d.ts +11 -0
  5. package/dist/cli/register-annotations.js +195 -0
  6. package/dist/cli/register-history-author.js +7 -30
  7. package/dist/cli/register-mutation.js +25 -206
  8. package/dist/cli/runtime-compatibility-boundary.d.ts +17 -0
  9. package/dist/cli/runtime-compatibility-boundary.js +43 -0
  10. package/dist/cli-bundle/bundle-manifest.json +158 -694
  11. package/dist/cli-bundle/chunks/chunk-2DTCZXSD.js +13 -0
  12. package/dist/cli-bundle/chunks/chunk-5JO6R4BS.js +3 -0
  13. package/dist/cli-bundle/chunks/chunk-5KN4DZYV.js +194 -0
  14. package/dist/cli-bundle/chunks/chunk-EF43KODO.js +2 -0
  15. package/dist/cli-bundle/chunks/chunk-GMX5YOI3.js +77 -0
  16. package/dist/cli-bundle/chunks/chunk-HUV2Z7IS.js +28 -0
  17. package/dist/cli-bundle/chunks/chunk-MHBVCUF2.js +2 -0
  18. package/dist/cli-bundle/chunks/chunk-PYO5GZU6.js +5 -0
  19. package/dist/cli-bundle/chunks/chunk-QWRRFYK3.js +2 -0
  20. package/dist/cli-bundle/chunks/chunk-RJC7TPF4.js +8 -0
  21. package/dist/cli-bundle/chunks/chunk-YC3UF2IO.js +2068 -0
  22. package/dist/cli-bundle/chunks/{register-list-query-FJZCJ67O.js → register-list-query-BUE7PTCU.js} +8 -8
  23. package/dist/cli-bundle/chunks/register-mutation-FC3XLVIK.js +20 -0
  24. package/dist/cli-bundle/chunks/register-operations-YH2WAOXU.js +2 -0
  25. package/dist/cli-bundle/chunks/register-setup-UQDTNTLJ.js +2 -0
  26. package/dist/cli-bundle/focused-chunks/chunk-2VVP5RAA.js +153 -0
  27. package/dist/cli-bundle/focused-chunks/{chunk-4VJQTS3P.js → chunk-3GSFUDAI.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/chunk-3WVHTUAW.js +5 -0
  29. package/dist/cli-bundle/focused-chunks/chunk-4H6MVCK3.js +16 -0
  30. package/dist/cli-bundle/focused-chunks/{chunk-73JUDYXT.js → chunk-54TZJ4BM.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/chunk-5NK5TJ5D.js +2 -0
  32. package/dist/cli-bundle/focused-chunks/{chunk-HNL6IFGS.js → chunk-6DO4YQWZ.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/chunk-73FIJONU.js +2 -0
  34. package/dist/cli-bundle/focused-chunks/{chunk-TIKDBG4D.js → chunk-C3GCHDSQ.js} +29 -27
  35. package/dist/cli-bundle/focused-chunks/chunk-JGRSQZJT.js +18 -0
  36. package/dist/cli-bundle/focused-chunks/{chunk-YZEZAPJK.js → chunk-KNEHLPBF.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/chunk-MRWVJ3ZG.js +2 -0
  38. package/dist/cli-bundle/focused-chunks/chunk-NL57J7BZ.js +4 -0
  39. package/dist/cli-bundle/focused-chunks/{chunk-NBJKQP4S.js → chunk-P6BBIQRG.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/{chunk-QHRTT7WT.js → chunk-PZAGVQNN.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/chunk-QDAO3XEK.js +14 -0
  42. package/dist/cli-bundle/focused-chunks/chunk-T4IGQCSY.js +2 -0
  43. package/dist/cli-bundle/focused-chunks/chunk-U46GQJNY.js +2 -0
  44. package/dist/cli-bundle/focused-chunks/{chunk-RPNYG5MO.js → chunk-VRXJSGIT.js} +6 -6
  45. package/dist/cli-bundle/focused-chunks/{chunk-R2LEMEV5.js → chunk-XC2ZW3CJ.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/chunk-ZG54B4XG.js +2 -0
  47. package/dist/cli-bundle/main.js +13 -13
  48. package/dist/cli-bundle/sdk-authoring.js +1 -1
  49. package/dist/cli-bundle/sdk-contracts.js +1 -1
  50. package/dist/cli-bundle/sdk-core.js +38 -38
  51. package/dist/cli-bundle/sdk-governance.js +1 -1
  52. package/dist/cli-bundle/sdk-graph.js +1 -1
  53. package/dist/cli-bundle/sdk-merge.js +1 -1
  54. package/dist/cli-bundle/sdk-query.js +1 -1
  55. package/dist/cli-bundle/sdk-runtime.js +1 -1
  56. package/dist/cli-bundle/sdk-testing.js +1 -1
  57. package/dist/cli-bundle/sdk.js +2 -1
  58. package/dist/cli.js +14 -4
  59. package/dist/core/diagnostics/remediation.js +12 -2
  60. package/dist/core/history/history.js +13 -4
  61. package/dist/core/item/actionability.d.ts +7 -1
  62. package/dist/core/item/actionability.js +71 -15
  63. package/dist/core/output/output.js +9 -2
  64. package/dist/core/sentry/helpers.d.ts +10 -0
  65. package/dist/core/sentry/helpers.js +59 -4
  66. package/dist/core/shared/author.d.ts +25 -0
  67. package/dist/core/shared/author.js +114 -9
  68. package/dist/core/shared/constants.d.ts +2 -0
  69. package/dist/core/shared/constants.js +4 -2
  70. package/dist/sdk/actionability.d.ts +1 -1
  71. package/dist/sdk/actionability.js +3 -3
  72. package/dist/sdk/annotations.d.ts +40 -0
  73. package/dist/sdk/annotations.js +61 -9
  74. package/dist/sdk/author-attribution.d.ts +12 -0
  75. package/dist/sdk/author-attribution.js +73 -11
  76. package/dist/sdk/cli-contracts/command-exit-contracts.d.ts +118 -0
  77. package/dist/sdk/cli-contracts/command-exit-contracts.js +152 -0
  78. package/dist/sdk/cli-contracts/completeness.js +5 -3
  79. package/dist/sdk/cli-contracts/flag-contracts.js +5 -2
  80. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +19 -0
  81. package/dist/sdk/cli-contracts/runtime-contracts.js +44 -2
  82. package/dist/sdk/cli-contracts/tool-parameter-tables.js +15 -2
  83. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  84. package/dist/sdk/cli-contracts/tool-schema.js +6 -3
  85. package/dist/sdk/comments.d.ts +7 -0
  86. package/dist/sdk/comments.js +2 -2
  87. package/dist/sdk/completion.js +9 -5
  88. package/dist/sdk/contracts.d.ts +1 -0
  89. package/dist/sdk/contracts.js +3 -2
  90. package/dist/sdk/core-governance.d.ts +1 -1
  91. package/dist/sdk/core-governance.js +3 -3
  92. package/dist/sdk/dependencies.d.ts +2 -0
  93. package/dist/sdk/dependencies.js +7 -6
  94. package/dist/sdk/environment/host-environment-errors.d.ts +27 -0
  95. package/dist/sdk/environment/host-environment-errors.js +124 -0
  96. package/dist/sdk/environment/project-runtime-compatibility.d.ts +65 -0
  97. package/dist/sdk/environment/project-runtime-compatibility.js +385 -0
  98. package/dist/sdk/environment/source-context.d.ts +23 -0
  99. package/dist/sdk/environment/source-context.js +29 -0
  100. package/dist/sdk/error-code-catalog.d.ts +6 -0
  101. package/dist/sdk/error-code-catalog.js +62 -8
  102. package/dist/sdk/extension/bundled-catalog.js +19 -6
  103. package/dist/sdk/generated-error-code-catalog.js +665 -3
  104. package/dist/sdk/governance/health.d.ts +11 -3
  105. package/dist/sdk/governance/health.js +32 -13
  106. package/dist/sdk/governance/provenance-health.d.ts +26 -0
  107. package/dist/sdk/governance/provenance-health.js +139 -0
  108. package/dist/sdk/governance/validate.js +13 -8
  109. package/dist/sdk/governance.d.ts +1 -0
  110. package/dist/sdk/governance.js +3 -2
  111. package/dist/sdk/graph/assembly.d.ts +4 -0
  112. package/dist/sdk/graph/assembly.js +22 -2
  113. package/dist/sdk/graph/run.d.ts +2 -0
  114. package/dist/sdk/graph/run.js +3 -2
  115. package/dist/sdk/index.d.ts +7 -3
  116. package/dist/sdk/index.js +9 -5
  117. package/dist/sdk/learnings.d.ts +15 -0
  118. package/dist/sdk/learnings.js +2 -2
  119. package/dist/sdk/lifecycle/close-many.d.ts +6 -1
  120. package/dist/sdk/lifecycle/close-many.js +43 -5
  121. package/dist/sdk/lifecycle/close.js +13 -8
  122. package/dist/sdk/lifecycle/create.js +6 -12
  123. package/dist/sdk/lifecycle/plan.js +6 -3
  124. package/dist/sdk/lifecycle/update-many.d.ts +2 -1
  125. package/dist/sdk/lifecycle/update-many.js +29 -5
  126. package/dist/sdk/lifecycle/update.js +6 -20
  127. package/dist/sdk/merge/driver.d.ts +2 -1
  128. package/dist/sdk/merge/driver.js +7 -4
  129. package/dist/sdk/merge/index.d.ts +1 -1
  130. package/dist/sdk/merge/index.js +3 -3
  131. package/dist/sdk/merge/install.d.ts +21 -0
  132. package/dist/sdk/merge/install.js +51 -21
  133. package/dist/sdk/merge/receipts.d.ts +14 -1
  134. package/dist/sdk/merge/receipts.js +36 -8
  135. package/dist/sdk/merge/reconcile.js +21 -4
  136. package/dist/sdk/merge/three-way.d.ts +6 -2
  137. package/dist/sdk/merge/three-way.js +24 -10
  138. package/dist/sdk/notes.d.ts +7 -0
  139. package/dist/sdk/notes.js +2 -2
  140. package/dist/sdk/query/get.d.ts +11 -0
  141. package/dist/sdk/query/get.js +37 -3
  142. package/dist/sdk/read-output-contracts.d.ts +1 -1
  143. package/dist/sdk/read-output-contracts.js +103 -5
  144. package/dist/sdk/relationship-kinds/contract.d.ts +48 -0
  145. package/dist/sdk/relationship-kinds/contract.js +22 -0
  146. package/dist/sdk/relationships.d.ts +6 -41
  147. package/dist/sdk/relationships.js +12 -126
  148. package/dist/sdk/runtime-primitives.d.ts +1 -1
  149. package/dist/sdk/runtime-primitives.js +3 -3
  150. package/dist/sdk/runtime.d.ts +1 -1
  151. package/dist/sdk/runtime.js +9 -25
  152. package/dist/sdk/similarity.d.ts +5 -0
  153. package/dist/sdk/similarity.js +40 -10
  154. package/dist/sdk/structured-mutations.js +5 -2
  155. package/dist/sdk/test/execution.js +4 -2
  156. package/dist/sdk/test/linked-command-detection.d.ts +2 -7
  157. package/dist/sdk/test/linked-command-detection.js +22 -9
  158. package/dist/sdk/test/parsers.js +5 -2
  159. package/dist/sdk/workspace-snapshot.d.ts +9 -0
  160. package/dist/sdk/workspace-snapshot.js +48 -16
  161. package/docs/AGENT_GUIDE.md +2 -1
  162. package/docs/AGENT_RUNTIME_PRIMITIVES.md +11 -4
  163. package/docs/COMMANDS.md +19 -1
  164. package/docs/DEPENDENCY_KIND_CONTRACT.md +29 -0
  165. package/docs/ITEM_READ_PROJECTIONS.md +26 -0
  166. package/docs/MERGE_SAFETY.md +10 -3
  167. package/docs/README.md +1 -0
  168. package/docs/RELATIONSHIP_GRAPH.md +1 -1
  169. package/docs/RELEASING.md +27 -2
  170. package/docs/SCRIPTING.md +27 -1
  171. package/docs/SDK_AGENT_SESSION_CONTEXT.md +35 -2
  172. package/docs/SDK_CONTEXT_INTEGRITY.md +81 -0
  173. package/docs/SDK_RUNTIME_BOUNDARIES.md +58 -0
  174. package/docs/SELF_DESCRIBING_CONTEXT_CONTRACTS.md +13 -0
  175. package/docs/SENTRY_CONTRACT_EPOCHS.md +20 -0
  176. package/docs/TESTING.md +17 -0
  177. package/docs/agent-task-token-baseline.json +2 -2
  178. package/marketplace.json +2 -2
  179. package/package.json +5 -3
  180. package/packages/pm-beads/package.json +1 -1
  181. package/packages/pm-calendar/package.json +1 -1
  182. package/packages/pm-command-kit/package.json +1 -1
  183. package/packages/pm-digital-twin/package.json +1 -1
  184. package/packages/pm-governance-audit/package.json +1 -1
  185. package/packages/pm-guide-shell/package.json +1 -1
  186. package/packages/pm-kanban/package.json +1 -1
  187. package/packages/pm-lifecycle-hooks/package.json +1 -1
  188. package/packages/pm-linked-test-adapters/package.json +1 -1
  189. package/packages/pm-search-advanced/package.json +1 -1
  190. package/packages/pm-templates/package.json +1 -1
  191. package/packages/pm-todos/package.json +1 -1
  192. package/packages/pm-vcs/package.json +1 -1
  193. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  194. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  195. package/sdk/public-surface.json +756 -57
  196. package/dist/cli-bundle/chunks/append-7BXBFDGD.js +0 -2
  197. package/dist/cli-bundle/chunks/chunk-2AXF3VSK.js +0 -2
  198. package/dist/cli-bundle/chunks/chunk-2XS43CCV.js +0 -2
  199. package/dist/cli-bundle/chunks/chunk-3A6KWB72.js +0 -8
  200. package/dist/cli-bundle/chunks/chunk-3ISTDB42.js +0 -8
  201. package/dist/cli-bundle/chunks/chunk-4MTI7XOV.js +0 -5
  202. package/dist/cli-bundle/chunks/chunk-6BX5UDCN.js +0 -3
  203. package/dist/cli-bundle/chunks/chunk-6QPO7KLR.js +0 -2
  204. package/dist/cli-bundle/chunks/chunk-7MXHZHSQ.js +0 -5
  205. package/dist/cli-bundle/chunks/chunk-7ZPMJW4U.js +0 -2
  206. package/dist/cli-bundle/chunks/chunk-A6KGKEWT.js +0 -2
  207. package/dist/cli-bundle/chunks/chunk-AGYNSNCI.js +0 -2
  208. package/dist/cli-bundle/chunks/chunk-B4H7FEFH.js +0 -5
  209. package/dist/cli-bundle/chunks/chunk-B4KLBBMN.js +0 -2
  210. package/dist/cli-bundle/chunks/chunk-BXCSXK4J.js +0 -2
  211. package/dist/cli-bundle/chunks/chunk-CALJHNBL.js +0 -23
  212. package/dist/cli-bundle/chunks/chunk-CFIGP5LY.js +0 -2
  213. package/dist/cli-bundle/chunks/chunk-CHOQ2VAW.js +0 -2
  214. package/dist/cli-bundle/chunks/chunk-CS6MRHG7.js +0 -2
  215. package/dist/cli-bundle/chunks/chunk-CUGNQQKH.js +0 -2
  216. package/dist/cli-bundle/chunks/chunk-D4FPS43D.js +0 -164
  217. package/dist/cli-bundle/chunks/chunk-E2ZSLTOP.js +0 -2
  218. package/dist/cli-bundle/chunks/chunk-FB7G2HY2.js +0 -2
  219. package/dist/cli-bundle/chunks/chunk-H5Y5YE6A.js +0 -2
  220. package/dist/cli-bundle/chunks/chunk-H5Y6UV6E.js +0 -2
  221. package/dist/cli-bundle/chunks/chunk-H7KGWPDF.js +0 -2
  222. package/dist/cli-bundle/chunks/chunk-HFSD77TQ.js +0 -2
  223. package/dist/cli-bundle/chunks/chunk-HX2GTA6L.js +0 -2
  224. package/dist/cli-bundle/chunks/chunk-J2IEKAVR.js +0 -2
  225. package/dist/cli-bundle/chunks/chunk-JC6FKIFM.js +0 -2
  226. package/dist/cli-bundle/chunks/chunk-K44PYFXH.js +0 -2
  227. package/dist/cli-bundle/chunks/chunk-K4KGEEBT.js +0 -2
  228. package/dist/cli-bundle/chunks/chunk-KFLK5TRH.js +0 -21
  229. package/dist/cli-bundle/chunks/chunk-KL6IEBV2.js +0 -2
  230. package/dist/cli-bundle/chunks/chunk-KWQZDZSS.js +0 -2
  231. package/dist/cli-bundle/chunks/chunk-KZ4X3DGU.js +0 -3
  232. package/dist/cli-bundle/chunks/chunk-LD77HJMQ.js +0 -13
  233. package/dist/cli-bundle/chunks/chunk-LEPJJ6QC.js +0 -2
  234. package/dist/cli-bundle/chunks/chunk-ME2JJ4LA.js +0 -3
  235. package/dist/cli-bundle/chunks/chunk-NE5VRDAI.js +0 -2
  236. package/dist/cli-bundle/chunks/chunk-NFLJ3FHD.js +0 -2
  237. package/dist/cli-bundle/chunks/chunk-NG6OXIBR.js +0 -19
  238. package/dist/cli-bundle/chunks/chunk-NYIGHWQY.js +0 -8
  239. package/dist/cli-bundle/chunks/chunk-NZ75GNSA.js +0 -2
  240. package/dist/cli-bundle/chunks/chunk-PCJWJNC2.js +0 -2
  241. package/dist/cli-bundle/chunks/chunk-PD3225AM.js +0 -2
  242. package/dist/cli-bundle/chunks/chunk-PDEGKG7P.js +0 -2
  243. package/dist/cli-bundle/chunks/chunk-PIE5HBNA.js +0 -2
  244. package/dist/cli-bundle/chunks/chunk-PW2H7YJR.js +0 -56
  245. package/dist/cli-bundle/chunks/chunk-RSIC5OPE.js +0 -2
  246. package/dist/cli-bundle/chunks/chunk-TPKN3S7S.js +0 -2
  247. package/dist/cli-bundle/chunks/chunk-TPXAXTCO.js +0 -2
  248. package/dist/cli-bundle/chunks/chunk-UFWUJO4V.js +0 -2
  249. package/dist/cli-bundle/chunks/chunk-UQLZQVFW.js +0 -55
  250. package/dist/cli-bundle/chunks/chunk-VT3Z5G7D.js +0 -2
  251. package/dist/cli-bundle/chunks/chunk-WOD3WWUN.js +0 -2
  252. package/dist/cli-bundle/chunks/chunk-WSJEIGJF.js +0 -3
  253. package/dist/cli-bundle/chunks/chunk-WYNUU7ZW.js +0 -2008
  254. package/dist/cli-bundle/chunks/chunk-YGPNCCXZ.js +0 -2
  255. package/dist/cli-bundle/chunks/close-CMY3BAUG.js +0 -2
  256. package/dist/cli-bundle/chunks/close-many-SA4XZCTK.js +0 -2
  257. package/dist/cli-bundle/chunks/comments-EZ556ZD3.js +0 -2
  258. package/dist/cli-bundle/chunks/copy-ZSGPA52X.js +0 -2
  259. package/dist/cli-bundle/chunks/create-I5DVV4YG.js +0 -2
  260. package/dist/cli-bundle/chunks/delete-RL3JACSW.js +0 -2
  261. package/dist/cli-bundle/chunks/deps-S7UBCECS.js +0 -2
  262. package/dist/cli-bundle/chunks/docs-ZZNVBBYO.js +0 -2
  263. package/dist/cli-bundle/chunks/files-27C337VT.js +0 -2
  264. package/dist/cli-bundle/chunks/focus-5Z2SG7LU.js +0 -2
  265. package/dist/cli-bundle/chunks/history-compact-HJQK67CZ.js +0 -2
  266. package/dist/cli-bundle/chunks/history-redact-PWC6PDWA.js +0 -2
  267. package/dist/cli-bundle/chunks/history-repair-N3CY4WBF.js +0 -2
  268. package/dist/cli-bundle/chunks/learnings-4FH23XDT.js +0 -2
  269. package/dist/cli-bundle/chunks/profile-5Y5XXH5N.js +0 -2
  270. package/dist/cli-bundle/chunks/register-mutation-YGYPW3BL.js +0 -20
  271. package/dist/cli-bundle/chunks/register-operations-WMDSUMQF.js +0 -2
  272. package/dist/cli-bundle/chunks/register-setup-DL7FFABC.js +0 -2
  273. package/dist/cli-bundle/chunks/restore-6KYBV5BY.js +0 -2
  274. package/dist/cli-bundle/chunks/schema-EQGKBYXJ.js +0 -2
  275. package/dist/cli-bundle/chunks/update-QVTYOD6I.js +0 -2
  276. package/dist/cli-bundle/chunks/update-many-DJSBU525.js +0 -2
  277. package/dist/cli-bundle/focused-chunks/chunk-2ECLECMK.js +0 -12
  278. package/dist/cli-bundle/focused-chunks/chunk-3K4XV2BF.js +0 -16
  279. package/dist/cli-bundle/focused-chunks/chunk-4EX25PXM.js +0 -8
  280. package/dist/cli-bundle/focused-chunks/chunk-CIXVQPB7.js +0 -5
  281. package/dist/cli-bundle/focused-chunks/chunk-DLTS3IHM.js +0 -2
  282. package/dist/cli-bundle/focused-chunks/chunk-DQ6FKGL3.js +0 -14
  283. package/dist/cli-bundle/focused-chunks/chunk-JLG2C4EQ.js +0 -2
  284. package/dist/cli-bundle/focused-chunks/chunk-MHMTKV5V.js +0 -2
  285. package/dist/cli-bundle/focused-chunks/chunk-MOTJFQ3F.js +0 -153
  286. package/dist/cli-bundle/focused-chunks/chunk-RW5IYD4J.js +0 -4
  287. package/dist/cli-bundle/focused-chunks/chunk-VZFU2R4M.js +0 -2
  288. package/dist/cli-bundle/focused-chunks/chunk-ZJIMJHDB.js +0 -2
package/dist/cli.js CHANGED
@@ -5,13 +5,14 @@
5
5
  * Bootstraps the executable pm CLI entrypoint and startup optimizations.
6
6
  */
7
7
 
8
- !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]="46833198-bc44-5ed4-b685-51434f93d8df")}catch(e){}}();
8
+ !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]="81ec2fa2-c616-5978-999d-b76d5f45bafe")}catch(e){}}();
9
9
  import fs from "node:fs";
10
10
  import * as nodeModule from "node:module";
11
11
  import os from "node:os";
12
12
  import path from "node:path";
13
13
  import { fileURLToPath } from "node:url";
14
- import { runCliWithBundleIntegrity, } from "./cli/bundle-integrity.js";
14
+ import { runCliWithBundleIntegrity } from "./cli/bundle-integrity.js";
15
+ import { runRuntimeCompatibleCli } from "./cli/runtime-compatibility-boundary.js";
15
16
  import { pruneCompileCacheGenerations, resolveCompileCacheGeneration, } from "./sdk/compile-cache.js";
16
17
  function enableNodeCompileCache() {
17
18
  const { enableCompileCache } = nodeModule;
@@ -90,7 +91,16 @@ export const _testOnly = {
90
91
  if (!printFastVersionIfRequested()) {
91
92
  enableNodeCompileCache();
92
93
  const cliEntrypointPath = fileURLToPath(import.meta.url);
93
- await runCliWithBundleIntegrity(process.argv.slice(2), cliEntrypointPath, () => import("./cli-bundle/main.js"), process.stderr.write.bind(process.stderr));
94
+ const executingVersion = readPackageVersionForPath(cliEntrypointPath);
95
+ const invocationArgv = process.argv.slice(2);
96
+ await runRuntimeCompatibleCli({
97
+ executingVersion,
98
+ projectRoot: process.cwd(),
99
+ argv: invocationArgv,
100
+ allowStale: process.env.PM_ALLOW_STALE_CLI === "1",
101
+ run: () => runCliWithBundleIntegrity(invocationArgv, cliEntrypointPath, () => import("./cli-bundle/main.js"), process.stderr.write.bind(process.stderr)),
102
+ writeError: process.stderr.write.bind(process.stderr),
103
+ });
94
104
  }
95
105
  //# sourceMappingURL=cli.js.map
96
- //# debugId=46833198-bc44-5ed4-b685-51434f93d8df
106
+ //# debugId=81ec2fa2-c616-5978-999d-b76d5f45bafe
@@ -19,7 +19,7 @@
19
19
  */
20
20
  /** Registry of every non-extension `pm health` / `pm validate` warning code and its remediation. Extension findings keep their richer, contextual `details.triage.remediation` produced by the extension health triage and are intentionally excluded here (see pm-0hnu: "all non-extension checks"). */
21
21
 
22
- !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]="6a350683-275b-5d4d-ae02-45798b115f89")}catch(e){}}();
22
+ !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]="8daf3070-facb-5775-a813-fb695ac9e3ce")}catch(e){}}();
23
23
  export const REMEDIATION_REGISTRY = Object.freeze([
24
24
  // --- pm health: directories ---
25
25
  {
@@ -188,6 +188,16 @@ export const REMEDIATION_REGISTRY = Object.freeze([
188
188
  command: "git rm --cached -r -- <tracked-runtime-directories>",
189
189
  summary: "Clone-local tracker runtime artifacts are committed. Run the exact tracked_runtime_cache.remediation_command from the integrity check, commit the index-only removals, and keep the managed .gitignore fence.",
190
190
  },
191
+ {
192
+ code: "merge_decisions_unreviewed",
193
+ command: "pm merge reconcile --dry-run",
194
+ summary: "Review the pending merge receipts, re-apply any intended discarded values, then run pm merge reconcile; lossy receipts require explicit --force acceptance.",
195
+ },
196
+ {
197
+ code: "validate_merge_decisions_unreviewed",
198
+ command: "pm merge reconcile --dry-run",
199
+ summary: "Review the pending merge receipts before reconciliation; history-repair alone does not settle them, and lossy receipts require explicit --force acceptance.",
200
+ },
191
201
  // --- pm health: history_drift ---
192
202
  // `pm health` rewrites these commands to `pm history-repair --all` in the
193
203
  // per-check remediation_map when more than one stream is drifted.
@@ -459,4 +469,4 @@ export function buildRemediationCommands(warnings) {
459
469
  return Object.values(buildRemediationMap(warnings));
460
470
  }
461
471
  //# sourceMappingURL=remediation.js.map
462
- //# debugId=6a350683-275b-5d4d-ae02-45798b115f89
472
+ //# debugId=8daf3070-facb-5775-a813-fb695ac9e3ce
@@ -4,7 +4,7 @@
4
4
  * Implements append-only history and replay behavior for History.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5228a53a-603c-5c9f-870b-8ea8e0c5d27a")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ce2dace3-7c86-5edf-8bda-083a0b3e7f2b")}catch(e){}}();
8
8
  import jsonPatch from "fast-json-patch";
9
9
  import { ITEM_METADATA_KEY_ORDER } from "../shared/constants.js";
10
10
  import { runActiveServiceOverride } from "../extensions/index.js";
@@ -13,7 +13,7 @@ import { canonicalDocument } from "../item/item-format.js";
13
13
  import { toItemRecord } from "../item/item-record.js";
14
14
  import { orderObject, sha256Hex, stableStringify, } from "../shared/serialization.js";
15
15
  import { nowIso } from "../shared/time.js";
16
- import { resolveHistoryAgentIdentity, resolveHistoryAuthorSource, } from "../shared/author.js";
16
+ import { diagnoseAgentIdentity, resolveHistoryAgentIdentity, resolveHistoryAuthorSource, } from "../shared/author.js";
17
17
  import { removeHistoryEventIndexForHistoryPath, updateHistoryEventIndexAfterAppend, } from "./event-index.js";
18
18
  import { invalidateHistoryDriftCacheForPath } from "./drift-cache.js";
19
19
  const EMPTY_LEGACY_HASH_DOCUMENT = {
@@ -128,6 +128,15 @@ export function createHistoryEntry(params) {
128
128
  const rawPatch = jsonPatch.compare(beforePatchCanonical, afterPatchCanonical);
129
129
  const patch = normalizeHistoryPatchOps(beforePatchCanonical, rawPatch);
130
130
  const agentIdentity = resolveHistoryAgentIdentity(params.author);
131
+ const provenanceOutcomes = agentIdentity.harness
132
+ ? Object.fromEntries(Object.entries(diagnoseAgentIdentity().provenance_outcomes).filter(([, outcome]) => outcome.status === "failed"))
133
+ : undefined;
134
+ const context = provenanceOutcomes === undefined || Object.keys(provenanceOutcomes).length === 0
135
+ ? params.context
136
+ : {
137
+ ...params.context,
138
+ agent_provenance_outcomes: provenanceOutcomes,
139
+ };
131
140
  return {
132
141
  ts: params.nowIso,
133
142
  author: params.author,
@@ -151,7 +160,7 @@ export function createHistoryEntry(params) {
151
160
  before_hash: sha256Hex(stableStringify(beforeHashCanonical)),
152
161
  after_hash: sha256Hex(stableStringify(afterHashCanonical)),
153
162
  message: params.message === undefined ? undefined : params.message,
154
- ...(params.context === undefined ? {} : { context: params.context }),
163
+ ...(context === undefined ? {} : { context }),
155
164
  };
156
165
  }
157
166
  function isRecord(value) {
@@ -233,4 +242,4 @@ export const _testOnly = {
233
242
  isDefinedPointerPath,
234
243
  };
235
244
  //# sourceMappingURL=history.js.map
236
- //# debugId=5228a53a-603c-5c9f-870b-8ea8e0c5d27a
245
+ //# debugId=ce2dace3-7c86-5edf-8bda-083a0b3e7f2b
@@ -1,7 +1,13 @@
1
1
  import type { RuntimeStatusRegistry } from "../schema/runtime-schema.js";
2
2
  import type { ItemMetadata, ItemStatus } from "../../types/index.js";
3
+ /** Built-in ordering kinds that must remain reachable by blocker resolution. */
4
+ export declare const ACTIONABILITY_ORDERING_KINDS: readonly string[];
3
5
  /** Collects the blocker item ids declared by an item: the legacy scalar `blocked_by` field plus every `blocked_by` dependency edge. Ids are trimmed, de-duplicated, and returned in stable lexicographic order. This is the single source of truth for "what must close before this item can proceed", shared by `pm next` readiness classification and the close-time auto-unblock sweep. */
4
6
  export declare function collectBlockedByIds(item: Pick<ItemMetadata, "blocked_by" | "dependencies">): string[];
7
+ /** Build every forward and reverse blocker set in one corpus pass. */
8
+ export declare function indexBlockedByIds(corpus: readonly ItemMetadata[]): Map<string, string[]>;
9
+ /** Collect blockers from both an item's forward declarations and corpus-level reverse `blocks` edges. */
10
+ export declare function collectBlockedByIdsFromCorpus(item: ItemMetadata, corpus: readonly ItemMetadata[]): string[];
5
11
  /** A blocker reference resolved against the corpus and annotated with its state. */
6
12
  export interface ResolvedBlocker {
7
13
  /** Stable identifier used to reference this record across commands and storage. */
@@ -13,7 +19,7 @@ export interface ResolvedBlocker {
13
19
  /** True when the blocker no longer gates work because the referenced item is terminal. */
14
20
  resolved: boolean;
15
21
  }
16
- /** Resolves an item's declared blockers against a corpus index, annotating each with the blocker's title/status and whether it still gates work. Unknown ids remain unresolved: silently treating a typo as satisfied would dispatch work whose prerequisite was never completed. Terminal referenced items alone are resolved. */
22
+ /** Resolves an item's blockers against a corpus index with reverse `blocks` support. */
17
23
  export declare function resolveItemBlockers(item: Pick<ItemMetadata, "blocked_by" | "dependencies">, itemsById: Map<string, ItemMetadata>, statusRegistry: RuntimeStatusRegistry): ResolvedBlocker[];
18
24
  /**
19
25
  * Collects the normalized (trimmed, lowercased) ids of every corpus item that is
@@ -10,10 +10,17 @@
10
10
  * `blocked_by` resolution a single source of truth.
11
11
  */
12
12
 
13
- !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]="bf429f76-9722-5e34-a5f0-6ced8d1ed667")}catch(e){}}();
13
+ !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]="de8a82e1-0b02-5d5a-9086-686529a1ccab")}catch(e){}}();
14
14
  import { isTerminalStatus, normalizeStatusForRegistry } from "./status.js";
15
15
  /** Dependency kind that marks "this item is blocked by the referenced item". */
16
16
  const BLOCKED_BY_DEPENDENCY_KIND = "blocked_by";
17
+ /** Reverse dependency kind that marks "this item blocks the referenced item". */
18
+ const BLOCKS_DEPENDENCY_KIND = "blocks";
19
+ /** Built-in ordering kinds that must remain reachable by blocker resolution. */
20
+ export const ACTIONABILITY_ORDERING_KINDS = Object.freeze([
21
+ BLOCKED_BY_DEPENDENCY_KIND,
22
+ BLOCKS_DEPENDENCY_KIND,
23
+ ]);
17
24
  /** Retired placeholder that explicitly means an item has no active blocker. */
18
25
  const NO_ACTIVE_BLOCKER_SENTINEL = "no-active-blocker";
19
26
  /**
@@ -28,23 +35,66 @@ function normalizeItemId(id) {
28
35
  /** Collects the blocker item ids declared by an item: the legacy scalar `blocked_by` field plus every `blocked_by` dependency edge. Ids are trimmed, de-duplicated, and returned in stable lexicographic order. This is the single source of truth for "what must close before this item can proceed", shared by `pm next` readiness classification and the close-time auto-unblock sweep. */
29
36
  export function collectBlockedByIds(item) {
30
37
  const ids = new Set();
31
- const scalar = typeof item.blocked_by === "string" ? item.blocked_by.trim() : "";
32
- if (scalar.length > 0 && scalar.toLowerCase() !== NO_ACTIVE_BLOCKER_SENTINEL) {
38
+ const scalar = typeof item.blocked_by === "string" ? normalizeItemId(item.blocked_by) : "";
39
+ if (scalar.length > 0 && scalar !== NO_ACTIVE_BLOCKER_SENTINEL) {
33
40
  ids.add(scalar);
34
41
  }
35
42
  for (const dependency of item.dependencies ?? []) {
43
+ const dependencyId = typeof dependency.id === "string" ? normalizeItemId(dependency.id) : "";
36
44
  if (dependency.kind === BLOCKED_BY_DEPENDENCY_KIND &&
37
- typeof dependency.id === "string" &&
38
- dependency.id.trim().length > 0 &&
39
- dependency.id.trim().toLowerCase() !== NO_ACTIVE_BLOCKER_SENTINEL) {
40
- ids.add(dependency.id.trim());
45
+ dependencyId.length > 0 &&
46
+ dependencyId !== NO_ACTIVE_BLOCKER_SENTINEL) {
47
+ ids.add(dependencyId);
41
48
  }
42
49
  }
43
50
  return [...ids].sort((left, right) => left.localeCompare(right));
44
51
  }
52
+ /** Build every forward and reverse blocker set in one corpus pass. */
53
+ export function indexBlockedByIds(corpus) {
54
+ const idsByItem = new Map();
55
+ for (const item of corpus) {
56
+ const itemId = normalizeItemId(item.id);
57
+ if (itemId.length === 0)
58
+ continue;
59
+ idsByItem.set(itemId, new Set(collectBlockedByIds(item)));
60
+ }
61
+ for (const candidate of corpus) {
62
+ const candidateId = normalizeItemId(candidate.id);
63
+ if (candidateId.length === 0)
64
+ continue;
65
+ for (const dependency of candidate.dependencies ?? []) {
66
+ const targetId = dependency.kind === BLOCKS_DEPENDENCY_KIND &&
67
+ typeof dependency.id === "string"
68
+ ? normalizeItemId(dependency.id)
69
+ : "";
70
+ if (targetId.length === 0 || targetId === NO_ACTIVE_BLOCKER_SENTINEL) {
71
+ continue;
72
+ }
73
+ const blockerIds = idsByItem.get(targetId) ?? new Set();
74
+ blockerIds.add(candidateId);
75
+ idsByItem.set(targetId, blockerIds);
76
+ }
77
+ }
78
+ return new Map([...idsByItem].map(([itemId, blockerIds]) => [
79
+ itemId,
80
+ [...blockerIds].sort((left, right) => left.localeCompare(right)),
81
+ ]));
82
+ }
83
+ /** Collect blockers from both an item's forward declarations and corpus-level reverse `blocks` edges. */
84
+ export function collectBlockedByIdsFromCorpus(item, corpus) {
85
+ const itemId = normalizeItemId(item.id);
86
+ return itemId.length > 0
87
+ ? (indexBlockedByIds(corpus).get(itemId) ?? collectBlockedByIds(item))
88
+ : collectBlockedByIds(item);
89
+ }
45
90
  /** Resolves an item's declared blockers against a corpus index, annotating each with the blocker's title/status and whether it still gates work. Unknown ids remain unresolved: silently treating a typo as satisfied would dispatch work whose prerequisite was never completed. Terminal referenced items alone are resolved. */
46
- export function resolveItemBlockers(item, itemsById, statusRegistry) {
47
- return collectBlockedByIds(item).map((id) => {
91
+ function resolveItemBlockersWithIndex(item, itemsById, statusRegistry, blockerIdsByItem) {
92
+ const itemWithId = item;
93
+ const blockerIds = typeof itemWithId.id === "string"
94
+ ? (blockerIdsByItem?.get(normalizeItemId(itemWithId.id)) ??
95
+ collectBlockedByIdsFromCorpus(itemWithId, [...itemsById.values()]))
96
+ : collectBlockedByIds(item);
97
+ return blockerIds.map((id) => {
48
98
  const blocker = itemsById.get(normalizeItemId(id));
49
99
  if (!blocker) {
50
100
  return { id, title: null, status: null, resolved: false };
@@ -57,6 +107,10 @@ export function resolveItemBlockers(item, itemsById, statusRegistry) {
57
107
  };
58
108
  });
59
109
  }
110
+ /** Resolves an item's blockers against a corpus index with reverse `blocks` support. */
111
+ export function resolveItemBlockers(item, itemsById, statusRegistry) {
112
+ return resolveItemBlockersWithIndex(item, itemsById, statusRegistry);
113
+ }
60
114
  /**
61
115
  * Collects the normalized (trimmed, lowercased) ids of every corpus item that is
62
116
  * blocked under the single shared edge-aware definition: a non-terminal item
@@ -70,6 +124,7 @@ export function resolveItemBlockers(item, itemsById, statusRegistry) {
70
124
  */
71
125
  export function collectDependencyBlockedIds(corpus, statusRegistry) {
72
126
  const itemsById = new Map(corpus.map((item) => [normalizeItemId(item.id), item]));
127
+ const blockerIdsByItem = indexBlockedByIds(corpus);
73
128
  // Same candidate gate as computeActionabilityReport: active statuses plus
74
129
  // lifecycle-blocked statuses, so the two surfaces classify identically.
75
130
  const candidateStatuses = new Set([
@@ -83,7 +138,7 @@ export function collectDependencyBlockedIds(corpus, statusRegistry) {
83
138
  continue;
84
139
  const lifecycleBlocked = statusRegistry.blocked_statuses.has(normalizedStatus);
85
140
  if (lifecycleBlocked ||
86
- resolveItemBlockers(item, itemsById, statusRegistry).some((blocker) => !blocker.resolved)) {
141
+ resolveItemBlockersWithIndex(item, itemsById, statusRegistry, blockerIdsByItem).some((blocker) => !blocker.resolved)) {
87
142
  blocked.add(normalizeItemId(item.id));
88
143
  }
89
144
  }
@@ -122,6 +177,7 @@ function indexCorpus(corpus) {
122
177
  const itemsById = new Map();
123
178
  const childrenByParent = new Map();
124
179
  const blockedByReverse = new Map();
180
+ const blockerIdsByItem = indexBlockedByIds(corpus);
125
181
  for (const item of corpus) {
126
182
  // Index keys are normalized (lowercased) for case-insensitive resolution;
127
183
  // stored values keep the item's original-case id for display.
@@ -133,14 +189,14 @@ function indexCorpus(corpus) {
133
189
  siblings.push(item);
134
190
  childrenByParent.set(parentKey, siblings);
135
191
  }
136
- for (const blockerId of collectBlockedByIds(item)) {
192
+ for (const blockerId of blockerIdsByItem.get(normalizeItemId(item.id))) {
137
193
  const blockerKey = normalizeItemId(blockerId);
138
194
  const dependents = blockedByReverse.get(blockerKey) ?? [];
139
195
  dependents.push(item.id);
140
196
  blockedByReverse.set(blockerKey, dependents);
141
197
  }
142
198
  }
143
- return { itemsById, childrenByParent, blockedByReverse };
199
+ return { itemsById, childrenByParent, blockedByReverse, blockerIdsByItem };
144
200
  }
145
201
  /**
146
202
  * Partitions a candidate set into ready vs blocked leaf work using the corpus to
@@ -154,7 +210,7 @@ function indexCorpus(corpus) {
154
210
  * the candidate order so the caller can apply its own ranking.
155
211
  */
156
212
  export function computeActionabilityReport(candidates, corpus, statusRegistry) {
157
- const { itemsById, childrenByParent, blockedByReverse } = indexCorpus(corpus);
213
+ const { itemsById, childrenByParent, blockedByReverse, blockerIdsByItem } = indexCorpus(corpus);
158
214
  const activeStatuses = new Set([
159
215
  ...resolveActiveStatusSet(statusRegistry),
160
216
  ...statusRegistry.blocked_statuses,
@@ -176,7 +232,7 @@ export function computeActionabilityReport(candidates, corpus, statusRegistry) {
176
232
  containerCount += 1;
177
233
  continue;
178
234
  }
179
- const openBlockers = resolveItemBlockers(item, itemsById, statusRegistry).filter((blocker) => !blocker.resolved);
235
+ const openBlockers = resolveItemBlockersWithIndex(item, itemsById, statusRegistry, blockerIdsByItem).filter((blocker) => !blocker.resolved);
180
236
  const unblocks = (blockedByReverse.get(normalizeItemId(item.id)) ?? [])
181
237
  .filter((dependentId) => nonTerminalIds.has(normalizeItemId(dependentId)))
182
238
  .sort((left, right) => left.localeCompare(right));
@@ -201,4 +257,4 @@ export function computeActionabilityReport(candidates, corpus, statusRegistry) {
201
257
  };
202
258
  }
203
259
  //# sourceMappingURL=actionability.js.map
204
- //# debugId=bf429f76-9722-5e34-a5f0-6ced8d1ed667
260
+ //# debugId=de8a82e1-0b02-5d5a-9086-686529a1ccab
@@ -4,7 +4,7 @@
4
4
  * Formats compact human and machine output for Output.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4a84286a-e1e3-5465-94c9-b44f8e4472d5")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b52d2756-f640-5f53-981f-05fa23fa1718")}catch(e){}}();
8
8
  import { getActiveCommandContext, runActiveCommandOverride, runActiveRendererOverride, runActiveServiceOverrideSync, setActiveCommandResult, } from "../extensions/index.js";
9
9
  import { EXIT_CODE } from "../shared/constants.js";
10
10
  import { isHostOutputSuppressed } from "./output-control.js";
@@ -12,6 +12,7 @@ import { projectMutationResult } from "./mutation-projection.js";
12
12
  import { attachReadOutputContracts } from "../../sdk/context-intent-contracts.js";
13
13
  import { attachOutputTokenAccounting } from "../../sdk/output-token-accounting.js";
14
14
  import { resolveReadOutputEncoding } from "../../sdk/read-output-contracts.js";
15
+ const DECLARED_PROCESS_EXIT_CODES = new Set(Object.values(EXIT_CODE));
15
16
  const NATIVE_OUTPUT_MARKER = "__pm_native_output";
16
17
  let streamErrorHandlersInstalled = false;
17
18
  function isPlainObject(value) {
@@ -388,6 +389,12 @@ export function formatOutput(result, options) {
388
389
  }
389
390
  /** Implements print result for the public runtime surface of this module. */
390
391
  export function printResult(result, options) {
392
+ if (isPlainObject(result) &&
393
+ Number.isInteger(result.exit_code) &&
394
+ DECLARED_PROCESS_EXIT_CODES.has(Number(result.exit_code)) &&
395
+ (process.exitCode === undefined || process.exitCode === EXIT_CODE.SUCCESS)) {
396
+ process.exitCode = Number(result.exit_code);
397
+ }
391
398
  const projected = options.idOnly
392
399
  ? projectMutationResult(result, { idOnly: true })
393
400
  : options.fullChangedFields
@@ -417,4 +424,4 @@ export const outputTestOnly = {
417
424
  renderToonValue,
418
425
  };
419
426
  //# sourceMappingURL=output.js.map
420
- //# debugId=4a84286a-e1e3-5465-94c9-b44f8e4472d5
427
+ //# debugId=b52d2756-f640-5f53-981f-05fa23fa1718
@@ -15,6 +15,16 @@ export declare function sentryFinishCommandSpan(ok: boolean, error?: string, met
15
15
  command_resolution?: TelemetryCommandResolution;
16
16
  resolution_stage?: TelemetryResolutionStage;
17
17
  }): void;
18
+ /**
19
+ * Tag value recorded when a captured error declares no canonical pm error code.
20
+ *
21
+ * The release reliability gate classifies Sentry issues from the `pm.error_code`
22
+ * and `pm.exit_code` tags and fails closed when either is absent. Emitting this
23
+ * sentinel keeps the producer side of that contract total: an undeclared runtime
24
+ * fault is still classifiable (and still blocks, because it resolves to no
25
+ * catalog contract) instead of being unjudgeable for lack of a tag.
26
+ */
27
+ export declare const UNCLASSIFIED_CAPTURED_ERROR_CODE = "unclassified_runtime_error";
18
28
  /** Implements sentry capture cli error for the public runtime surface of this module. */
19
29
  export declare function sentryCaptureCliError(error: unknown): void;
20
30
  /** Implements sentry log cli usage error for the public runtime surface of this module. */
@@ -4,7 +4,7 @@
4
4
  * Integrates Sentry instrumentation and release diagnostics for Helpers.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="48cce5c1-5cca-53cc-8991-f97669251a72")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ffe56aed-b794-5bf4-99fd-e3c5fe065163")}catch(e){}}();
8
8
  import { getSentry } from "./instrument.js";
9
9
  import { PmCliError } from "../shared/errors.js";
10
10
  import { EXIT_CODE } from "../shared/constants.js";
@@ -110,6 +110,60 @@ export function sentryFinishCommandSpan(ok, error, metadata) {
110
110
  activeCommandSpan.end();
111
111
  activeCommandSpan = undefined;
112
112
  }
113
+ /**
114
+ * Tag value recorded when a captured error declares no canonical pm error code.
115
+ *
116
+ * The release reliability gate classifies Sentry issues from the `pm.error_code`
117
+ * and `pm.exit_code` tags and fails closed when either is absent. Emitting this
118
+ * sentinel keeps the producer side of that contract total: an undeclared runtime
119
+ * fault is still classifiable (and still blocks, because it resolves to no
120
+ * catalog contract) instead of being unjudgeable for lack of a tag.
121
+ */
122
+ export const UNCLASSIFIED_CAPTURED_ERROR_CODE = "unclassified_runtime_error";
123
+ /**
124
+ * Reads the declared error contract carried by a thrown value, if any.
125
+ *
126
+ * There is deliberately no `PmCliError` special case: `shouldCaptureCliError`
127
+ * rejects every `PmCliError` before capture, so such a branch would be
128
+ * unreachable — and a `PmCliError` carries a public `code` and a numeric
129
+ * `exitCode`, so the general path below would classify it identically anyway.
130
+ */
131
+ function readCapturedErrorContract(error) {
132
+ const candidate = typeof error === "object" && error !== null
133
+ ? error
134
+ : undefined;
135
+ const hasDeclaredExitCode = typeof candidate?.exitCode === "number";
136
+ const exitCode = hasDeclaredExitCode
137
+ ? Math.trunc(candidate?.exitCode)
138
+ : EXIT_CODE.GENERIC_FAILURE;
139
+ // A declared pm code always travels with a numeric exit code. Requiring both
140
+ // halves keeps a Node errno error (string `code`, no `exitCode`) from being
141
+ // reported as though it were a catalog contract.
142
+ const hasDeclaredErrorCode = typeof candidate?.code === "string" &&
143
+ candidate.code.length > 0 &&
144
+ hasDeclaredExitCode;
145
+ return {
146
+ error_code: hasDeclaredErrorCode
147
+ ? candidate?.code
148
+ : UNCLASSIFIED_CAPTURED_ERROR_CODE,
149
+ exit_code: exitCode,
150
+ };
151
+ }
152
+ /**
153
+ * Builds the contract tags every captured event carries.
154
+ *
155
+ * These are attached to the event itself rather than to the ambient scope
156
+ * because the scope writer (`sentryFinishCommandSpan`) returns early when no
157
+ * command span is active, and the unknown-error path captures before that
158
+ * writer runs.
159
+ */
160
+ function buildCapturedErrorTags(error) {
161
+ const contract = readCapturedErrorContract(error);
162
+ return {
163
+ "pm.error_code": contract.error_code,
164
+ "pm.exit_code": String(contract.exit_code),
165
+ };
166
+ }
113
167
  /** Implements sentry capture cli error for the public runtime surface of this module. */
114
168
  export function sentryCaptureCliError(error) {
115
169
  if (!shouldCaptureCliError(error))
@@ -117,6 +171,7 @@ export function sentryCaptureCliError(error) {
117
171
  const Sentry = getSentry();
118
172
  if (!Sentry)
119
173
  return;
174
+ const tags = buildCapturedErrorTags(error);
120
175
  if (error instanceof Error) {
121
176
  const extras = {};
122
177
  if ("exitCode" in error &&
@@ -127,10 +182,10 @@ export function sentryCaptureCliError(error) {
127
182
  typeof error.context === "object") {
128
183
  extras.error_context = error.context;
129
184
  }
130
- Sentry.captureException(error, { extra: extras });
185
+ Sentry.captureException(error, { extra: extras, tags });
131
186
  }
132
187
  else {
133
- Sentry.captureException(new Error(String(error)));
188
+ Sentry.captureException(new Error(String(error)), { tags });
134
189
  }
135
190
  }
136
191
  /** Implements sentry log cli usage error for the public runtime surface of this module. */
@@ -215,4 +270,4 @@ export async function sentryFlush(timeoutMs = 3000) {
215
270
  }
216
271
  }
217
272
  //# sourceMappingURL=helpers.js.map
218
- //# debugId=48cce5c1-5cca-53cc-8991-f97669251a72
273
+ //# debugId=ffe56aed-b794-5bf4-99fd-e3c5fe065163
@@ -19,6 +19,19 @@ export interface AgentProvenanceObservation {
19
19
  * selected harness declared the dimension but exposed no value this run.
20
20
  */
21
21
  export type AgentProvenance = Readonly<Record<string, AgentProvenanceObservation | null>>;
22
+ /** Bounded reason explaining why one declared provenance dimension was absent. */
23
+ export type AgentProvenanceAbsenceReason = "harness_unavailable" | "resolver_failed" | "resolver_not_configured" | "probes_disabled" | "invalid_value";
24
+ /** Machine-readable resolution outcome for one provenance dimension. */
25
+ export interface AgentProvenanceOutcome {
26
+ /** Whether the dimension resolved without retaining private source material. */
27
+ status: "resolved" | "unavailable" | "failed";
28
+ /** Stable bounded reason for absent or rejected values. */
29
+ reason?: AgentProvenanceAbsenceReason;
30
+ /** Resolver name when a bounded local resolver was attempted. */
31
+ resolver?: AgentProvenanceResolver;
32
+ /** Stable inference contract version used by downstream analytics. */
33
+ rule_version: "v1";
34
+ }
22
35
  /** Privacy-bounded MCP client metadata that can participate in agent detection. */
23
36
  export interface AgentClientInfo {
24
37
  /** Client or harness name reported during protocol initialization. */
@@ -72,6 +85,11 @@ export interface DetectedAgentIdentity {
72
85
  /** Stable declared episode identity when the session supplied one. */
73
86
  episode?: AgentEpisodeIdentity;
74
87
  }
88
+ /** Agent identity plus explicit outcomes for every built-in provenance dimension. */
89
+ export interface DiagnosedAgentIdentity extends DetectedAgentIdentity {
90
+ /** Resolution outcomes that distinguish absence from resolver failure. */
91
+ provenance_outcomes: Readonly<Record<string, AgentProvenanceOutcome>>;
92
+ }
75
93
  /** Public, privacy-safe identity resolution result shared by CLI and SDK hosts. */
76
94
  export interface ResolvedAuthorIdentity extends DetectedAgentIdentity {
77
95
  /** Stable author value written to mutation history. */
@@ -126,6 +144,13 @@ export declare function runWithWorkspaceHarnessSignalDescriptors<T>(descriptors:
126
144
  * traversal, or network requests.
127
145
  */
128
146
  export declare function detectAgentIdentity(signals?: HarnessDetectionSignals): DetectedAgentIdentity;
147
+ /**
148
+ * Diagnose provenance without exposing environment values, paths, or probe data.
149
+ *
150
+ * This additive SDK contract keeps legacy `detectAgentIdentity` projections
151
+ * stable while giving health checks and history writers explicit absence states.
152
+ */
153
+ export declare function diagnoseAgentIdentity(signals?: HarnessDetectionSignals): DiagnosedAgentIdentity;
129
154
  /** Reads the invocation-wide author override through the canonical environment seam. */
130
155
  export declare function readAuthorEnvironment(): string | undefined;
131
156
  /** Updates or clears the invocation-wide author override through the canonical environment seam. */