@unbrained/pm-cli 2026.10.11 → 2026.10.13

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 (740) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +45 -0
  3. package/dist/cli/after-command-context-usage.d.ts +8 -8
  4. package/dist/cli/bundle-integrity.d.ts +23 -23
  5. package/dist/cli/commander-usage.d.ts +31 -31
  6. package/dist/cli/commander-usage.js +3 -3
  7. package/dist/cli/error-guidance.d.ts +158 -161
  8. package/dist/cli/error-guidance.js +2 -2
  9. package/dist/cli/extension-command-help.d.ts +68 -68
  10. package/dist/cli/extension-command-options.d.ts +20 -20
  11. package/dist/cli/extension-recovery.d.ts +20 -20
  12. package/dist/cli/help-content.d.ts +16 -16
  13. package/dist/cli/help-content.js +2 -2
  14. package/dist/cli/help-json-payload.d.ts +40 -40
  15. package/dist/cli/help-json-payload.js +1 -1
  16. package/dist/cli/invocation-profile.d.ts +8 -8
  17. package/dist/cli/main.d.ts +166 -165
  18. package/dist/cli/main.js +4 -4
  19. package/dist/cli/migration-gates.d.ts +20 -20
  20. package/dist/cli/register-list-query.d.ts +4 -4
  21. package/dist/cli/register-mutation-options.d.ts +2 -2
  22. package/dist/cli/register-operations.d.ts +68 -63
  23. package/dist/cli/register-operations.js +1 -1
  24. package/dist/cli/register-setup.d.ts +1 -1
  25. package/dist/cli/register-structured-mutation.d.ts +3 -3
  26. package/dist/cli/register-structured-mutation.js +1 -1
  27. package/dist/cli/runtime/activation.d.ts +3 -3
  28. package/dist/cli/runtime/invocation-options.js +1 -1
  29. package/dist/cli/runtime/selection.d.ts +6 -6
  30. package/dist/cli/runtime-compatibility-boundary.d.ts +12 -12
  31. package/dist/cli-bundle/bundle-manifest.json +1 -1
  32. package/dist/cli-bundle/chunks/{chunk-K2UTE75T.js → chunk-AM2XOZKE.js} +2 -2
  33. package/dist/cli-bundle/chunks/{chunk-S445XEYT.js → chunk-APWPC4ZZ.js} +2 -2
  34. package/dist/cli-bundle/chunks/chunk-DJDRHJBP.js +234 -0
  35. package/dist/cli-bundle/chunks/{chunk-RUT3CCAG.js → chunk-DUK5DHI6.js} +2 -2
  36. package/dist/cli-bundle/chunks/chunk-HXHFKXLV.js +2 -0
  37. package/dist/cli-bundle/chunks/chunk-IFPJDJUM.js +20 -0
  38. package/dist/cli-bundle/chunks/{chunk-OBLO45UM.js → chunk-LBDWFWPK.js} +2 -2
  39. package/dist/cli-bundle/chunks/{chunk-ZWRLAOA4.js → chunk-N5EXRYCZ.js} +2 -2
  40. package/dist/cli-bundle/chunks/chunk-PSNS537F.js +30 -0
  41. package/dist/cli-bundle/chunks/{chunk-2JYTSTQP.js → chunk-RL45OYTL.js} +2 -2
  42. package/dist/cli-bundle/chunks/{chunk-ESRACL6K.js → chunk-UBTYYZIE.js} +49 -49
  43. package/dist/cli-bundle/chunks/chunk-WYZGZV2M.js +2 -0
  44. package/dist/cli-bundle/chunks/{chunk-SSY4OSJR.js → chunk-YH6H3UVE.js} +10 -10
  45. package/dist/cli-bundle/chunks/{register-list-query-T6BOR67M.js → register-list-query-BJ742QOR.js} +2 -2
  46. package/dist/cli-bundle/chunks/{register-mutation-6NXR7SAJ.js → register-mutation-GGGBRIH2.js} +3 -3
  47. package/dist/cli-bundle/chunks/register-operations-E6HXYHNM.js +2 -0
  48. package/dist/cli-bundle/chunks/{register-setup-MAYFPKBX.js → register-setup-4ZVTVEPY.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/{chunk-EIOQNLBQ.js → chunk-3LQEBXU5.js} +12 -12
  50. package/dist/cli-bundle/focused-chunks/{chunk-PLTTMQAW.js → chunk-6BTUISKV.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/chunk-73UNAJHD.js +2 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-WAOXID5J.js → chunk-DVK7VKZL.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-SIEGIPNT.js → chunk-F5J3ATMV.js} +16 -16
  54. package/dist/cli-bundle/focused-chunks/chunk-IIKFTJVC.js +2 -0
  55. package/dist/cli-bundle/focused-chunks/chunk-IOTNG6CN.js +2 -0
  56. package/dist/cli-bundle/focused-chunks/{chunk-AU6VJGTY.js → chunk-KGFRQ34R.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/chunk-NNW5BS5L.js +3 -0
  58. package/dist/cli-bundle/focused-chunks/{chunk-KNJR2WUO.js → chunk-QMNAY25P.js} +62 -62
  59. package/dist/cli-bundle/focused-chunks/{chunk-W5AE7GKZ.js → chunk-R23T7GFZ.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/chunk-RAA7SVRA.js +8 -0
  61. package/dist/cli-bundle/focused-chunks/{chunk-52UJEHEV.js → chunk-RU6GCFN3.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{chunk-JGFSSR3G.js → chunk-S6ITXQ5T.js} +5 -5
  63. package/dist/cli-bundle/focused-chunks/{chunk-DMSADMEU.js → chunk-SOB7X4FJ.js} +2 -2
  64. package/dist/cli-bundle/focused-chunks/chunk-UPJA45K7.js +26 -0
  65. package/dist/cli-bundle/main.js +22 -22
  66. package/dist/cli-bundle/sdk-authoring.js +1 -1
  67. package/dist/cli-bundle/sdk-contracts.js +2 -2
  68. package/dist/cli-bundle/sdk-core.js +31 -31
  69. package/dist/cli-bundle/sdk-governance.js +1 -1
  70. package/dist/cli-bundle/sdk-graph.js +1 -1
  71. package/dist/cli-bundle/sdk-merge.js +51 -51
  72. package/dist/cli-bundle/sdk-query.js +1 -1
  73. package/dist/cli-bundle/sdk-runtime.js +1 -1
  74. package/dist/cli-bundle/sdk-testing.js +1 -1
  75. package/dist/cli-bundle/sdk.js +8 -8
  76. package/dist/cli.d.ts +4 -4
  77. package/dist/core/checkpoint/checkpoint-gc.d.ts +32 -32
  78. package/dist/core/checkpoint/mutation-checkpoint.d.ts +34 -34
  79. package/dist/core/config/nested-settings.d.ts +26 -26
  80. package/dist/core/config/positional-value.d.ts +16 -16
  81. package/dist/core/diagnostics/remediation.d.ts +6 -6
  82. package/dist/core/diagnostics/remediation.js +1 -1
  83. package/dist/core/extensions/activation-summary-markdown.d.ts +6 -6
  84. package/dist/core/extensions/activation-summary.d.ts +54 -54
  85. package/dist/core/extensions/activation-transaction.d.ts +7 -7
  86. package/dist/core/extensions/capability-usage.d.ts +26 -26
  87. package/dist/core/extensions/command-hook-context.d.ts +26 -26
  88. package/dist/core/extensions/contribution-inventory.d.ts +21 -21
  89. package/dist/core/extensions/extension-candidate.d.ts +14 -14
  90. package/dist/core/extensions/extension-capability-aliases.d.ts +2 -2
  91. package/dist/core/extensions/extension-policy.d.ts +80 -80
  92. package/dist/core/extensions/extension-types.d.ts +1294 -1285
  93. package/dist/core/extensions/extension-types.js +1 -1
  94. package/dist/core/extensions/flag-definition-validation.d.ts +4 -4
  95. package/dist/core/extensions/item-fields.d.ts +3 -2
  96. package/dist/core/extensions/item-fields.js +1 -1
  97. package/dist/core/extensions/loader.d.ts +36 -36
  98. package/dist/core/extensions/loader.js +1 -1
  99. package/dist/core/extensions/manifest-schema.d.ts +16 -16
  100. package/dist/core/extensions/module-graph-snapshot.d.ts +8 -8
  101. package/dist/core/extensions/read-output-contract.d.ts +5 -0
  102. package/dist/core/extensions/read-output-contract.js +2 -0
  103. package/dist/core/extensions/registration-values.d.ts +1 -1
  104. package/dist/core/extensions/reserved-host-flags.d.ts +6 -6
  105. package/dist/core/extensions/version-compat.d.ts +10 -10
  106. package/dist/core/fs/fs-utils.d.ts +1 -1
  107. package/dist/core/fs/host-environment-errors.d.ts +14 -14
  108. package/dist/core/governance/content-fields.d.ts +31 -31
  109. package/dist/core/governance/issue-codes.d.ts +27 -27
  110. package/dist/core/governance/metadata-coverage.d.ts +91 -91
  111. package/dist/core/history/drift-scan.d.ts +26 -26
  112. package/dist/core/history/event-classification.d.ts +1 -1
  113. package/dist/core/history/event-classification.js +1 -1
  114. package/dist/core/history/event-index.d.ts +41 -41
  115. package/dist/core/history/history-compact-bulk.d.ts +22 -22
  116. package/dist/core/history/history-diff.d.ts +22 -22
  117. package/dist/core/history/history-rewrite.d.ts +66 -66
  118. package/dist/core/history/history-storage-stats.d.ts +31 -31
  119. package/dist/core/history/history-stream-policy.d.ts +12 -12
  120. package/dist/core/history/history.d.ts +22 -22
  121. package/dist/core/history/identity.d.ts +6 -6
  122. package/dist/core/history/operation-contract.d.ts +9 -9
  123. package/dist/core/history/projection.d.ts +15 -15
  124. package/dist/core/history/read.d.ts +4 -4
  125. package/dist/core/history/replay.d.ts +51 -49
  126. package/dist/core/history/replay.js +1 -1
  127. package/dist/core/history/workspace-history.d.ts +101 -101
  128. package/dist/core/io/bulk-ids-input.d.ts +4 -4
  129. package/dist/core/item/actionability.d.ts +40 -40
  130. package/dist/core/item/id.d.ts +3 -3
  131. package/dist/core/item/item-format-version.d.ts +8 -8
  132. package/dist/core/item/item-format.d.ts +37 -35
  133. package/dist/core/item/item-format.js +2 -2
  134. package/dist/core/item/item-type-definition.d.ts +2 -2
  135. package/dist/core/item/parent-reference-policy.d.ts +1 -1
  136. package/dist/core/item/parse.d.ts +12 -12
  137. package/dist/core/item/sprint-release-format.d.ts +2 -2
  138. package/dist/core/item/status-filter.d.ts +4 -4
  139. package/dist/core/item/toon-decode.d.ts +9 -9
  140. package/dist/core/item/type-registry.d.ts +40 -40
  141. package/dist/core/lock/lock-gc.d.ts +50 -50
  142. package/dist/core/lock/lock.d.ts +37 -37
  143. package/dist/core/output/mutation-projection.d.ts +6 -6
  144. package/dist/core/output/output-control.d.ts +4 -4
  145. package/dist/core/output/output.d.ts +40 -40
  146. package/dist/core/output/query-summary.d.ts +5 -5
  147. package/dist/core/packages/manifest.d.ts +50 -50
  148. package/dist/core/policy/workflow-policy-schema.d.ts +306 -306
  149. package/dist/core/policy/workflow-policy-store.d.ts +7 -7
  150. package/dist/core/policy/workflow-policy.d.ts +81 -81
  151. package/dist/core/profile/profile-describe.d.ts +40 -40
  152. package/dist/core/profile/profile-lint.d.ts +20 -20
  153. package/dist/core/profile/profile-plan.d.ts +84 -84
  154. package/dist/core/profile/profile-presets.d.ts +52 -52
  155. package/dist/core/reproducibility/context.d.ts +6 -6
  156. package/dist/core/schema/fields-file.d.ts +54 -54
  157. package/dist/core/schema/item-types-file.d.ts +36 -36
  158. package/dist/core/schema/runtime-field-values.d.ts +2 -2
  159. package/dist/core/schema/runtime-schema.d.ts +86 -86
  160. package/dist/core/schema/status-defs-file.d.ts +36 -36
  161. package/dist/core/schema/type-inference.d.ts +14 -14
  162. package/dist/core/schema/type-workflows.d.ts +22 -22
  163. package/dist/core/search/background-refresh.d.ts +9 -9
  164. package/dist/core/search/bm25.d.ts +19 -19
  165. package/dist/core/search/cache.d.ts +35 -35
  166. package/dist/core/search/corpus.d.ts +12 -12
  167. package/dist/core/search/embedding-batches.d.ts +48 -48
  168. package/dist/core/search/eval.d.ts +49 -49
  169. package/dist/core/search/http-client.d.ts +38 -38
  170. package/dist/core/search/providers.d.ts +41 -41
  171. package/dist/core/search/relevance.d.ts +20 -20
  172. package/dist/core/search/semantic-defaults.d.ts +8 -8
  173. package/dist/core/search/staleness.d.ts +4 -4
  174. package/dist/core/search/vector-stores.d.ts +78 -78
  175. package/dist/core/search/vectorization-metadata.d.ts +6 -6
  176. package/dist/core/sentry/helpers.d.ts +15 -15
  177. package/dist/core/sentry/instrument.d.ts +40 -40
  178. package/dist/core/session/session-state.d.ts +32 -32
  179. package/dist/core/shared/agent-session-context.d.ts +14 -14
  180. package/dist/core/shared/author.d.ts +128 -128
  181. package/dist/core/shared/command-types.d.ts +40 -40
  182. package/dist/core/shared/conflict-markers.d.ts +6 -6
  183. package/dist/core/shared/constants.d.ts +13 -13
  184. package/dist/core/shared/errors.d.ts +194 -183
  185. package/dist/core/shared/errors.js +1 -1
  186. package/dist/core/shared/secret-rules.d.ts +97 -97
  187. package/dist/core/shared/serial-queue.d.ts +8 -8
  188. package/dist/core/shared/split-comma-list.d.ts +6 -6
  189. package/dist/core/shared/time.d.ts +23 -23
  190. package/dist/core/store/item-format-migration.d.ts +10 -10
  191. package/dist/core/store/item-metadata-cache.d.ts +38 -38
  192. package/dist/core/store/item-metadata-query-index.d.ts +79 -79
  193. package/dist/core/store/item-metadata-read-work.d.ts +6 -6
  194. package/dist/core/store/item-store.d.ts +110 -110
  195. package/dist/core/store/paths.d.ts +2 -2
  196. package/dist/core/store/settings-read-cache.d.ts +12 -12
  197. package/dist/core/store/settings-validator.d.ts +165 -165
  198. package/dist/core/store/settings.d.ts +59 -59
  199. package/dist/core/telemetry/observability.d.ts +17 -17
  200. package/dist/core/telemetry/policy.d.ts +3 -3
  201. package/dist/core/telemetry/runtime.d.ts +242 -242
  202. package/dist/core/telemetry/runtime.js +2 -2
  203. package/dist/core/test/background-runs.d.ts +186 -185
  204. package/dist/core/test/background-runs.js +2 -2
  205. package/dist/core/test/item-test-run-tracking.d.ts +6 -6
  206. package/dist/core/test/run-selectors.d.ts +18 -18
  207. package/dist/core/validate/fix-planning.d.ts +50 -50
  208. package/dist/core/validate/missing-by-type.d.ts +4 -4
  209. package/dist/core/validate/missing-link-owners.d.ts +30 -30
  210. package/dist/core/validate/stale-file-classification.d.ts +8 -8
  211. package/dist/mcp/http-server.d.ts +28 -28
  212. package/dist/mcp/legacy-adapter.d.ts +33 -33
  213. package/dist/mcp/runtime-capabilities.d.ts +16 -16
  214. package/dist/mcp/server.d.ts +50 -50
  215. package/dist/mcp/tool-definitions.d.ts +36 -36
  216. package/dist/sdk/agent/closed-domain-contracts.d.ts +18 -18
  217. package/dist/sdk/agent/command-recovery.d.ts +4 -0
  218. package/dist/sdk/agent/command-recovery.js +1 -1
  219. package/dist/sdk/agent/command-suggestions.d.ts +2 -0
  220. package/dist/sdk/agent/command-suggestions.js +1 -1
  221. package/dist/sdk/agent/identity-config.d.ts +32 -32
  222. package/dist/sdk/agent/item-addressing.d.ts +8 -8
  223. package/dist/sdk/agent/refusal-closure-census.d.ts +34 -34
  224. package/dist/sdk/agent/refusal-closure.d.ts +42 -42
  225. package/dist/sdk/agent/refusal-corpus-contracts.d.ts +46 -46
  226. package/dist/sdk/agent/refusal-reachability.d.ts +112 -112
  227. package/dist/sdk/agent/subcommand-recovery.d.ts +25 -25
  228. package/dist/sdk/agent/task-transcript-contracts.d.ts +30 -30
  229. package/dist/sdk/agent/tracker-preflight-contracts.d.ts +38 -38
  230. package/dist/sdk/agent-capability-contracts.d.ts +37 -37
  231. package/dist/sdk/annotations.d.ts +106 -106
  232. package/dist/sdk/author-attribution.d.ts +76 -76
  233. package/dist/sdk/authoring.d.ts +1 -1
  234. package/dist/sdk/authoring.js +1 -1
  235. package/dist/sdk/cli-bootstrap.d.ts +70 -70
  236. package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +63 -63
  237. package/dist/sdk/cli-contracts/command-aliases.d.ts +14 -14
  238. package/dist/sdk/cli-contracts/command-exit-contracts.d.ts +70 -70
  239. package/dist/sdk/cli-contracts/commander-types.d.ts +17 -17
  240. package/dist/sdk/cli-contracts/completeness.d.ts +26 -26
  241. package/dist/sdk/cli-contracts/enum-contracts.d.ts +5 -5
  242. package/dist/sdk/cli-contracts/flag-contracts.d.ts +32 -32
  243. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  244. package/dist/sdk/cli-contracts/flag-lexicon-contracts.d.ts +42 -42
  245. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  246. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +84 -84
  247. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
  248. package/dist/sdk/cli-contracts/registration-helpers.d.ts +37 -40
  249. package/dist/sdk/cli-contracts/registration-helpers.js +1 -1
  250. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +290 -294
  251. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  252. package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +793 -793
  253. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +391 -391
  254. package/dist/sdk/cli-contracts/tool-parameter-tables.d.ts +6 -6
  255. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  256. package/dist/sdk/cli-contracts/tool-schema.d.ts +55 -55
  257. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  258. package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +24 -24
  259. package/dist/sdk/comments.d.ts +44 -44
  260. package/dist/sdk/compile-cache.d.ts +4 -4
  261. package/dist/sdk/completion/shared.d.ts +22 -22
  262. package/dist/sdk/compose.d.ts +156 -156
  263. package/dist/sdk/config.d.ts +123 -123
  264. package/dist/sdk/context/semantic-session-attribution.d.ts +14 -14
  265. package/dist/sdk/context/usage-ledger.d.ts +20 -20
  266. package/dist/sdk/context-intent-contracts.d.ts +50 -50
  267. package/dist/sdk/context-intent-contracts.js +1 -1
  268. package/dist/sdk/context-intent-runtime.d.ts +8 -8
  269. package/dist/sdk/context-packing.d.ts +78 -78
  270. package/dist/sdk/context-relevance.d.ts +189 -180
  271. package/dist/sdk/context-relevance.js +1 -1
  272. package/dist/sdk/context-signal-store.d.ts +84 -84
  273. package/dist/sdk/context-usage.d.ts +92 -92
  274. package/dist/sdk/core.d.ts +1 -0
  275. package/dist/sdk/core.js +1 -1
  276. package/dist/sdk/corpus-shape.d.ts +101 -101
  277. package/dist/sdk/define.d.ts +2 -2
  278. package/dist/sdk/dependencies.d.ts +116 -116
  279. package/dist/sdk/dependency-flag-validation.d.ts +14 -12
  280. package/dist/sdk/dependency-flag-validation.js +1 -1
  281. package/dist/sdk/dependency-provenance.d.ts +30 -30
  282. package/dist/sdk/docs.d.ts +32 -32
  283. package/dist/sdk/duplicates.d.ts +21 -21
  284. package/dist/sdk/environment/agent-environment.d.ts +196 -196
  285. package/dist/sdk/environment/project-runtime-compatibility.d.ts +56 -56
  286. package/dist/sdk/environment/source-context.d.ts +6 -6
  287. package/dist/sdk/error-code-catalog.d.ts +40 -40
  288. package/dist/sdk/errors.d.ts +29 -29
  289. package/dist/sdk/eval.d.ts +45 -45
  290. package/dist/sdk/extension/author-manifest.d.ts +14 -14
  291. package/dist/sdk/extension/bundled-catalog.d.ts +7 -7
  292. package/dist/sdk/extension/describe.d.ts +36 -36
  293. package/dist/sdk/extension/doctor.d.ts +29 -29
  294. package/dist/sdk/extension/install-plan.d.ts +55 -55
  295. package/dist/sdk/extension/install-receipts.d.ts +2 -2
  296. package/dist/sdk/extension/install-runtime.d.ts +8 -8
  297. package/dist/sdk/extension/install-snapshot.d.ts +14 -14
  298. package/dist/sdk/extension/install-sources.d.ts +96 -96
  299. package/dist/sdk/extension/managed-state.d.ts +66 -66
  300. package/dist/sdk/extension/migrations.d.ts +82 -82
  301. package/dist/sdk/extension/output-ownership.d.ts +24 -24
  302. package/dist/sdk/extension/runtime-summary.d.ts +5 -5
  303. package/dist/sdk/extension/scaffold.d.ts +12 -12
  304. package/dist/sdk/extension/shared.d.ts +15 -15
  305. package/dist/sdk/extension/source-resolution.d.ts +30 -30
  306. package/dist/sdk/extension/static-inventory.d.ts +42 -42
  307. package/dist/sdk/extension/update-check.d.ts +10 -10
  308. package/dist/sdk/extension.d.ts +320 -320
  309. package/dist/sdk/files.d.ts +157 -157
  310. package/dist/sdk/flag-invocation-contracts.d.ts +44 -44
  311. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  312. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  313. package/dist/sdk/governance/artifact-ledgers.d.ts +35 -35
  314. package/dist/sdk/governance/artifact-ledgers.js +1 -1
  315. package/dist/sdk/governance/assurance-action.d.ts +68 -68
  316. package/dist/sdk/governance/assurance-action.js +1 -1
  317. package/dist/sdk/governance/assurance-mutation-error.d.ts +36 -36
  318. package/dist/sdk/governance/assurance-presets.d.ts +24 -24
  319. package/dist/sdk/governance/assurance-runtime.d.ts +14 -14
  320. package/dist/sdk/governance/assurance.d.ts +353 -353
  321. package/dist/sdk/governance/boundary-fixtures.d.ts +60 -60
  322. package/dist/sdk/governance/closure-timestamps.d.ts +9 -9
  323. package/dist/sdk/governance/coverage-assurance.d.ts +10 -10
  324. package/dist/sdk/governance/defect-recurrence-coverage.d.ts +75 -75
  325. package/dist/sdk/governance/defect-recurrence-graph.d.ts +18 -18
  326. package/dist/sdk/governance/defect-recurrence.d.ts +186 -181
  327. package/dist/sdk/governance/defect-recurrence.js +1 -1
  328. package/dist/sdk/governance/extension-host-version.d.ts +16 -16
  329. package/dist/sdk/governance/gc.d.ts +48 -48
  330. package/dist/sdk/governance/health-merge-evidence.d.ts +5 -5
  331. package/dist/sdk/governance/health.d.ts +188 -188
  332. package/dist/sdk/governance/hierarchy-validation.d.ts +13 -13
  333. package/dist/sdk/governance/linked-file-report.d.ts +26 -26
  334. package/dist/sdk/governance/merge-receipt-history.d.ts +36 -36
  335. package/dist/sdk/governance/provenance-health.d.ts +64 -64
  336. package/dist/sdk/governance/reindex.d.ts +89 -89
  337. package/dist/sdk/governance/reliability.d.ts +56 -56
  338. package/dist/sdk/governance/stale-work.d.ts +22 -22
  339. package/dist/sdk/governance/status-role-diagnostics.d.ts +12 -12
  340. package/dist/sdk/governance/storage-integrity.d.ts +54 -54
  341. package/dist/sdk/governance/tracked-runtime-cache.d.ts +10 -10
  342. package/dist/sdk/governance/upgrade.d.ts +104 -104
  343. package/dist/sdk/governance/validate-history-drift.d.ts +2 -2
  344. package/dist/sdk/governance/validate-item-reader.d.ts +6 -6
  345. package/dist/sdk/governance/validate.d.ts +191 -191
  346. package/dist/sdk/governance/workflow-completeness.d.ts +15 -15
  347. package/dist/sdk/governance/workflow-policy.d.ts +28 -28
  348. package/dist/sdk/governance/workspace-position.d.ts +46 -46
  349. package/dist/sdk/graph/adapter.d.ts +66 -66
  350. package/dist/sdk/graph/analytics.d.ts +54 -54
  351. package/dist/sdk/graph/assembly.d.ts +80 -80
  352. package/dist/sdk/graph/cache.d.ts +29 -29
  353. package/dist/sdk/graph/cardinality-integrity.d.ts +13 -0
  354. package/dist/sdk/graph/cardinality-integrity.js +2 -0
  355. package/dist/sdk/graph/centrality.d.ts +34 -34
  356. package/dist/sdk/graph/conformance.d.ts +33 -33
  357. package/dist/sdk/graph/deadline-scheduling.d.ts +58 -58
  358. package/dist/sdk/graph/durable-cache.d.ts +26 -26
  359. package/dist/sdk/graph/governance.d.ts +165 -165
  360. package/dist/sdk/graph/hierarchy-integrity.d.ts +52 -52
  361. package/dist/sdk/graph/index.d.ts +1 -0
  362. package/dist/sdk/graph/index.js +1 -1
  363. package/dist/sdk/graph/lifecycle-coverage.d.ts +17 -17
  364. package/dist/sdk/graph/mutation-advisory.d.ts +11 -11
  365. package/dist/sdk/graph/query-contracts.d.ts +10 -10
  366. package/dist/sdk/graph/remediation.d.ts +25 -25
  367. package/dist/sdk/graph/run.d.ts +392 -392
  368. package/dist/sdk/graph/scheduling.d.ts +38 -38
  369. package/dist/sdk/graph/traversal.d.ts +14 -14
  370. package/dist/sdk/guide-topics.d.ts +32 -32
  371. package/dist/sdk/guide.d.ts +62 -62
  372. package/dist/sdk/history/attestation-command.d.ts +12 -12
  373. package/dist/sdk/history/attestation-contract.d.ts +78 -78
  374. package/dist/sdk/history/attestation-scan.d.ts +6 -6
  375. package/dist/sdk/history/maintenance.d.ts +46 -46
  376. package/dist/sdk/history/salvage.d.ts +18 -18
  377. package/dist/sdk/history/subject.d.ts +9 -9
  378. package/dist/sdk/history-analytics.d.ts +84 -84
  379. package/dist/sdk/history-compact.d.ts +103 -103
  380. package/dist/sdk/history-mcp.d.ts +8 -8
  381. package/dist/sdk/history-provenance.d.ts +59 -59
  382. package/dist/sdk/history-read.d.ts +36 -36
  383. package/dist/sdk/history-redact.d.ts +78 -78
  384. package/dist/sdk/history-repair.d.ts +158 -158
  385. package/dist/sdk/history-repair.js +1 -1
  386. package/dist/sdk/improvement-ledger.d.ts +102 -102
  387. package/dist/sdk/index.d.ts +2 -0
  388. package/dist/sdk/index.js +1 -1
  389. package/dist/sdk/init-agent-guidance.d.ts +70 -70
  390. package/dist/sdk/init.d.ts +152 -152
  391. package/dist/sdk/item-children.d.ts +28 -28
  392. package/dist/sdk/item-schedule.d.ts +12 -12
  393. package/dist/sdk/item-transaction.d.ts +100 -100
  394. package/dist/sdk/learnings.d.ts +42 -42
  395. package/dist/sdk/lifecycle/append.d.ts +14 -14
  396. package/dist/sdk/lifecycle/claim.d.ts +60 -60
  397. package/dist/sdk/lifecycle/close-many.d.ts +94 -94
  398. package/dist/sdk/lifecycle/close.d.ts +27 -27
  399. package/dist/sdk/lifecycle/copy.d.ts +18 -18
  400. package/dist/sdk/lifecycle/core-field-recovery.d.ts +7 -0
  401. package/dist/sdk/lifecycle/core-field-recovery.js +2 -0
  402. package/dist/sdk/lifecycle/create.d.ts +82 -82
  403. package/dist/sdk/lifecycle/create.js +1 -1
  404. package/dist/sdk/lifecycle/delete.d.ts +28 -28
  405. package/dist/sdk/lifecycle/focus.d.ts +10 -10
  406. package/dist/sdk/lifecycle/hierarchy-mutation-lock.d.ts +10 -10
  407. package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +1 -1
  408. package/dist/sdk/lifecycle/legacy-none-tokens.d.ts +54 -54
  409. package/dist/sdk/lifecycle/lifecycle-transitions.d.ts +4 -4
  410. package/dist/sdk/lifecycle/mcp-actions.d.ts +10 -10
  411. package/dist/sdk/lifecycle/mutation-command-options.d.ts +116 -116
  412. package/dist/sdk/lifecycle/mutation-facet-contracts.d.ts +6 -0
  413. package/dist/sdk/lifecycle/mutation-facet-contracts.js +2 -0
  414. package/dist/sdk/lifecycle/plan-mutation-receipt.d.ts +42 -42
  415. package/dist/sdk/lifecycle/plan.d.ts +217 -217
  416. package/dist/sdk/lifecycle/reopen.d.ts +29 -24
  417. package/dist/sdk/lifecycle/reopen.js +1 -1
  418. package/dist/sdk/lifecycle/repeatable-metadata-parsers.d.ts +3 -3
  419. package/dist/sdk/lifecycle/restore.d.ts +33 -33
  420. package/dist/sdk/lifecycle/shared-unset-fields.d.ts +19 -19
  421. package/dist/sdk/lifecycle/task-composition.d.ts +4 -4
  422. package/dist/sdk/lifecycle/update-many.d.ts +79 -79
  423. package/dist/sdk/lifecycle/update.d.ts +131 -132
  424. package/dist/sdk/lifecycle/update.js +2 -2
  425. package/dist/sdk/lifecycle-completion.d.ts +22 -22
  426. package/dist/sdk/lifecycle-policy.d.ts +52 -52
  427. package/dist/sdk/linked-artifacts.d.ts +69 -69
  428. package/dist/sdk/mcp/apps.d.ts +32 -32
  429. package/dist/sdk/mcp/authorization.d.ts +76 -76
  430. package/dist/sdk/mcp/discovery.d.ts +111 -111
  431. package/dist/sdk/mcp/interactions.d.ts +61 -61
  432. package/dist/sdk/mcp/protocol.d.ts +78 -78
  433. package/dist/sdk/mcp/skills.d.ts +88 -88
  434. package/dist/sdk/mcp/subscriptions.d.ts +39 -39
  435. package/dist/sdk/mcp/tasks.d.ts +75 -75
  436. package/dist/sdk/mcp/transport.d.ts +11 -11
  437. package/dist/sdk/merge/abandoned-receipts.d.ts +6 -6
  438. package/dist/sdk/merge/driver.d.ts +60 -60
  439. package/dist/sdk/merge/install.d.ts +64 -64
  440. package/dist/sdk/merge/receipt-file-boundary.d.ts +5 -5
  441. package/dist/sdk/merge/receipt-operation.d.ts +6 -6
  442. package/dist/sdk/merge/receipt-schema.d.ts +2 -2
  443. package/dist/sdk/merge/receipts.d.ts +156 -156
  444. package/dist/sdk/merge/reconcile.d.ts +36 -36
  445. package/dist/sdk/merge/reconcile.js +1 -1
  446. package/dist/sdk/merge/three-way.d.ts +77 -76
  447. package/dist/sdk/merge/three-way.js +1 -1
  448. package/dist/sdk/mutation-events.d.ts +84 -84
  449. package/dist/sdk/mutation-guard.d.ts +106 -106
  450. package/dist/sdk/notes.d.ts +52 -52
  451. package/dist/sdk/output/table-rows.d.ts +8 -8
  452. package/dist/sdk/output-contracts.d.ts +38 -38
  453. package/dist/sdk/output-projection.d.ts +142 -142
  454. package/dist/sdk/output-token-accounting.d.ts +27 -27
  455. package/dist/sdk/output.d.ts +28 -28
  456. package/dist/sdk/package-import-adapters.d.ts +54 -54
  457. package/dist/sdk/pagination.d.ts +29 -29
  458. package/dist/sdk/profile.d.ts +123 -123
  459. package/dist/sdk/provenance.d.ts +58 -58
  460. package/dist/sdk/public-surface.json +1 -1
  461. package/dist/sdk/query/activity.d.ts +118 -118
  462. package/dist/sdk/query/aggregate.d.ts +140 -140
  463. package/dist/sdk/query/calendar.d.ts +144 -144
  464. package/dist/sdk/query/complete-list.d.ts +53 -53
  465. package/dist/sdk/query/context.d.ts +395 -395
  466. package/dist/sdk/query/duplicate-candidates.d.ts +1 -1
  467. package/dist/sdk/query/get.d.ts +77 -77
  468. package/dist/sdk/query/history.d.ts +72 -72
  469. package/dist/sdk/query/item-filter-options.d.ts +79 -79
  470. package/dist/sdk/query/list-filter-shared.d.ts +1 -1
  471. package/dist/sdk/query/list.d.ts +188 -188
  472. package/dist/sdk/query/multi-value-filters.d.ts +4 -4
  473. package/dist/sdk/query/next-ready-budget.d.ts +14 -14
  474. package/dist/sdk/query/next.d.ts +137 -137
  475. package/dist/sdk/query/projection-contracts.d.ts +8 -8
  476. package/dist/sdk/query/search/corpus.d.ts +8 -8
  477. package/dist/sdk/query/search/filters.d.ts +5 -5
  478. package/dist/sdk/query/search/input.d.ts +4 -4
  479. package/dist/sdk/query/search/response.d.ts +8 -8
  480. package/dist/sdk/query/search/semantic.d.ts +106 -106
  481. package/dist/sdk/query/search/types.d.ts +85 -85
  482. package/dist/sdk/query/search-contracts.d.ts +65 -65
  483. package/dist/sdk/query/search-pagination.d.ts +19 -19
  484. package/dist/sdk/query/search-rendering.d.ts +25 -25
  485. package/dist/sdk/query/search.d.ts +46 -46
  486. package/dist/sdk/read-output/continuation.d.ts +8 -8
  487. package/dist/sdk/read-output/continuation.js +1 -1
  488. package/dist/sdk/read-output/extension.d.ts +7 -0
  489. package/dist/sdk/read-output/extension.js +2 -0
  490. package/dist/sdk/read-output/options.d.ts +6 -4
  491. package/dist/sdk/read-output/options.js +1 -1
  492. package/dist/sdk/read-output/provenance.d.ts +8 -8
  493. package/dist/sdk/read-output-budget.d.ts +10 -10
  494. package/dist/sdk/read-output-contracts.d.ts +192 -186
  495. package/dist/sdk/read-output-contracts.js +1 -1
  496. package/dist/sdk/read-output-rows.d.ts +6 -6
  497. package/dist/sdk/read-output-session.d.ts +50 -50
  498. package/dist/sdk/relationship-analytics.d.ts +78 -78
  499. package/dist/sdk/relationship-context.d.ts +81 -81
  500. package/dist/sdk/relationship-history.d.ts +109 -109
  501. package/dist/sdk/relationship-kinds/contract.d.ts +34 -34
  502. package/dist/sdk/relationship-migration.d.ts +26 -26
  503. package/dist/sdk/relationships.d.ts +78 -78
  504. package/dist/sdk/reproducibility/process.d.ts +3 -3
  505. package/dist/sdk/runtime/context.d.ts +11 -11
  506. package/dist/sdk/runtime-action-aliases.d.ts +2 -2
  507. package/dist/sdk/runtime-extended-actions.d.ts +8 -8
  508. package/dist/sdk/runtime-input.d.ts +3 -3
  509. package/dist/sdk/runtime-public-contracts.d.ts +78 -78
  510. package/dist/sdk/runtime.d.ts +305 -305
  511. package/dist/sdk/runtime.js +1 -1
  512. package/dist/sdk/scheduling-shortcuts.d.ts +32 -32
  513. package/dist/sdk/schema-migration.d.ts +86 -86
  514. package/dist/sdk/schema.d.ts +355 -355
  515. package/dist/sdk/similarity-scoring.d.ts +10 -10
  516. package/dist/sdk/similarity.d.ts +113 -113
  517. package/dist/sdk/stats.d.ts +108 -108
  518. package/dist/sdk/structured-mutations.d.ts +16 -16
  519. package/dist/sdk/structured-mutations.js +1 -1
  520. package/dist/sdk/telemetry.d.ts +53 -53
  521. package/dist/sdk/templates.d.ts +39 -39
  522. package/dist/sdk/test/batch.d.ts +85 -85
  523. package/dist/sdk/test/batch.js +1 -1
  524. package/dist/sdk/test/command-args.d.ts +4 -0
  525. package/dist/sdk/test/command-args.js +2 -0
  526. package/dist/sdk/test/entry.d.ts +3 -0
  527. package/dist/sdk/test/entry.js +1 -1
  528. package/dist/sdk/test/execution-receipts.d.ts +3 -3
  529. package/dist/sdk/test/execution.d.ts +279 -268
  530. package/dist/sdk/test/execution.js +2 -2
  531. package/dist/sdk/test/json-path.d.ts +2 -2
  532. package/dist/sdk/test/linked-command-detection.d.ts +10 -10
  533. package/dist/sdk/test/measurements.d.ts +11 -11
  534. package/dist/sdk/test/parsers.d.ts +1 -1
  535. package/dist/sdk/test/parsers.js +1 -1
  536. package/dist/sdk/test/prerequisites.d.ts +6 -0
  537. package/dist/sdk/test/prerequisites.js +2 -0
  538. package/dist/sdk/test/runs.d.ts +52 -52
  539. package/dist/sdk/test/trust.d.ts +12 -12
  540. package/dist/sdk/test/trust.js +1 -1
  541. package/dist/sdk/test/update.d.ts +55 -0
  542. package/dist/sdk/test/update.js +2 -0
  543. package/dist/sdk/testing.d.ts +319 -319
  544. package/dist/sdk/traceability/source-traceability.d.ts +65 -65
  545. package/dist/sdk/workspace-contracts.d.ts +37 -37
  546. package/dist/sdk/workspace-memory.d.ts +60 -60
  547. package/dist/sdk/workspace-recipe.d.ts +9 -9
  548. package/dist/sdk/workspace-snapshot.d.ts +97 -97
  549. package/dist/sdk/workspace-transaction-gc.d.ts +32 -32
  550. package/dist/sdk/workspace-transaction.d.ts +47 -47
  551. package/dist/sdk/workspace.d.ts +6 -6
  552. package/dist/types.d.ts +978 -974
  553. package/dist/types.js +1 -1
  554. package/docs/BUILD_AND_RELEASE_ACCEPTANCE.md +5 -2
  555. package/docs/DEFECT_RECURRENCE.md +12 -0
  556. package/docs/EXTENSIONS.md +2 -2
  557. package/docs/LINKED_TEST_EDITS.md +79 -0
  558. package/docs/MERGE_SAFETY.md +27 -1
  559. package/docs/RECURRENCE_RECOVERY_CONTRACTS.md +17 -4
  560. package/docs/RELATIONSHIP_GRAPH.md +26 -0
  561. package/docs/RELEASING.md +25 -8
  562. package/docs/SDK.md +204 -637
  563. package/docs/SDK_CONSUMER_RECEIPTS.md +67 -0
  564. package/docs/SDK_EVIDENCE_TRACEABILITY.md +4 -0
  565. package/docs/TESTING.md +13 -0
  566. package/docs/generated/FLAG_LEXICON_BUDGETS.md +2 -2
  567. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +11 -3
  568. package/docs/performance/runner-qualification.md +36 -0
  569. package/marketplace.json +1 -1
  570. package/node_modules/@opentelemetry/core/build/esm/version.d.ts +1 -1
  571. package/node_modules/@opentelemetry/core/build/esm/version.js +1 -1
  572. package/node_modules/@opentelemetry/core/build/esnext/version.d.ts +1 -1
  573. package/node_modules/@opentelemetry/core/build/esnext/version.js +1 -1
  574. package/node_modules/@opentelemetry/core/build/src/version.d.ts +1 -1
  575. package/node_modules/@opentelemetry/core/build/src/version.js +1 -1
  576. package/node_modules/@opentelemetry/core/package.json +2 -2
  577. package/node_modules/@opentelemetry/resources/build/esm/version.d.ts +1 -1
  578. package/node_modules/@opentelemetry/resources/build/esm/version.js +1 -1
  579. package/node_modules/@opentelemetry/resources/build/esnext/version.d.ts +1 -1
  580. package/node_modules/@opentelemetry/resources/build/esnext/version.js +1 -1
  581. package/node_modules/@opentelemetry/resources/build/src/version.d.ts +1 -1
  582. package/node_modules/@opentelemetry/resources/build/src/version.js +1 -1
  583. package/node_modules/@opentelemetry/resources/package.json +3 -3
  584. package/node_modules/@opentelemetry/sdk-trace/build/esm/StackContextManager.d.ts +57 -0
  585. package/node_modules/@opentelemetry/sdk-trace/build/esm/StackContextManager.js +105 -0
  586. package/node_modules/@opentelemetry/sdk-trace/build/esm/index.d.ts +1 -0
  587. package/node_modules/@opentelemetry/sdk-trace/build/esm/index.js +1 -0
  588. package/node_modules/@opentelemetry/sdk-trace/build/esm/version.d.ts +1 -1
  589. package/node_modules/@opentelemetry/sdk-trace/build/esm/version.js +1 -1
  590. package/node_modules/@opentelemetry/sdk-trace/build/esnext/StackContextManager.d.ts +57 -0
  591. package/node_modules/@opentelemetry/sdk-trace/build/esnext/StackContextManager.js +105 -0
  592. package/node_modules/@opentelemetry/sdk-trace/build/esnext/index.d.ts +1 -0
  593. package/node_modules/@opentelemetry/sdk-trace/build/esnext/index.js +1 -0
  594. package/node_modules/@opentelemetry/sdk-trace/build/esnext/version.d.ts +1 -1
  595. package/node_modules/@opentelemetry/sdk-trace/build/esnext/version.js +1 -1
  596. package/node_modules/@opentelemetry/sdk-trace/build/src/StackContextManager.d.ts +57 -0
  597. package/node_modules/@opentelemetry/sdk-trace/build/src/StackContextManager.js +109 -0
  598. package/node_modules/@opentelemetry/sdk-trace/build/src/index.d.ts +1 -0
  599. package/node_modules/@opentelemetry/sdk-trace/build/src/index.js +3 -1
  600. package/node_modules/@opentelemetry/sdk-trace/build/src/version.d.ts +1 -1
  601. package/node_modules/@opentelemetry/sdk-trace/build/src/version.js +1 -1
  602. package/node_modules/@opentelemetry/sdk-trace/package.json +5 -5
  603. package/node_modules/@opentelemetry/sdk-trace-base/build/esm/version.d.ts +1 -1
  604. package/node_modules/@opentelemetry/sdk-trace-base/build/esm/version.js +1 -1
  605. package/node_modules/@opentelemetry/sdk-trace-base/build/esnext/version.d.ts +1 -1
  606. package/node_modules/@opentelemetry/sdk-trace-base/build/esnext/version.js +1 -1
  607. package/node_modules/@opentelemetry/sdk-trace-base/build/src/version.d.ts +1 -1
  608. package/node_modules/@opentelemetry/sdk-trace-base/build/src/version.js +1 -1
  609. package/node_modules/@opentelemetry/sdk-trace-base/package.json +7 -7
  610. package/node_modules/@sentry/core/build/cjs/browser.js +3 -0
  611. package/node_modules/@sentry/core/build/cjs/fetch.js +10 -9
  612. package/node_modules/@sentry/core/build/cjs/index.js +3 -0
  613. package/node_modules/@sentry/core/build/cjs/integrations/http/add-outgoing-request-breadcrumb.js +2 -1
  614. package/node_modules/@sentry/core/build/cjs/integrations/http/get-outgoing-span-data.js +3 -2
  615. package/node_modules/@sentry/core/build/cjs/integrations/http/server-subscription.js +7 -3
  616. package/node_modules/@sentry/core/build/cjs/integrations/requestdata.js +23 -9
  617. package/node_modules/@sentry/core/build/cjs/server.js +3 -0
  618. package/node_modules/@sentry/core/build/cjs/utils/data-collection/filterCollectedUrl.js +24 -0
  619. package/node_modules/@sentry/core/build/cjs/utils/data-collection/filterKeyValueData.js +17 -23
  620. package/node_modules/@sentry/core/build/cjs/utils/data-collection/filterQueryParams.js +8 -15
  621. package/node_modules/@sentry/core/build/cjs/utils/data-collection/filterUrlQuery.js +20 -0
  622. package/node_modules/@sentry/core/build/cjs/utils/url.js +4 -3
  623. package/node_modules/@sentry/core/build/cjs/utils/version.js +1 -1
  624. package/node_modules/@sentry/core/build/esm/browser.js +1 -0
  625. package/node_modules/@sentry/core/build/esm/fetch.js +10 -9
  626. package/node_modules/@sentry/core/build/esm/index.js +1 -0
  627. package/node_modules/@sentry/core/build/esm/integrations/http/add-outgoing-request-breadcrumb.js +2 -1
  628. package/node_modules/@sentry/core/build/esm/integrations/http/get-outgoing-span-data.js +3 -2
  629. package/node_modules/@sentry/core/build/esm/integrations/http/server-subscription.js +7 -3
  630. package/node_modules/@sentry/core/build/esm/integrations/requestdata.js +23 -9
  631. package/node_modules/@sentry/core/build/esm/package.json +1 -1
  632. package/node_modules/@sentry/core/build/esm/server.js +1 -0
  633. package/node_modules/@sentry/core/build/esm/utils/data-collection/filterCollectedUrl.js +21 -0
  634. package/node_modules/@sentry/core/build/esm/utils/data-collection/filterKeyValueData.js +18 -25
  635. package/node_modules/@sentry/core/build/esm/utils/data-collection/filterQueryParams.js +9 -16
  636. package/node_modules/@sentry/core/build/esm/utils/data-collection/filterUrlQuery.js +18 -0
  637. package/node_modules/@sentry/core/build/esm/utils/url.js +4 -3
  638. package/node_modules/@sentry/core/build/esm/utils/version.js +1 -1
  639. package/node_modules/@sentry/core/build/types/shared-exports.d.ts +1 -0
  640. package/node_modules/@sentry/core/build/types/utils/data-collection/filterCollectedUrl.d.ts +21 -0
  641. package/node_modules/@sentry/core/build/types/utils/data-collection/filterKeyValueData.d.ts +1 -0
  642. package/node_modules/@sentry/core/build/types/utils/data-collection/filterQueryParams.d.ts +2 -3
  643. package/node_modules/@sentry/core/build/types/utils/data-collection/filterUrlQuery.d.ts +13 -0
  644. package/node_modules/@sentry/core/build/types/utils/url.d.ts +4 -1
  645. package/node_modules/@sentry/core/build/types-ts3.8/shared-exports.d.ts +1 -0
  646. package/node_modules/@sentry/core/build/types-ts3.8/utils/data-collection/filterCollectedUrl.d.ts +21 -0
  647. package/node_modules/@sentry/core/build/types-ts3.8/utils/data-collection/filterKeyValueData.d.ts +1 -0
  648. package/node_modules/@sentry/core/build/types-ts3.8/utils/data-collection/filterQueryParams.d.ts +2 -3
  649. package/node_modules/@sentry/core/build/types-ts3.8/utils/data-collection/filterUrlQuery.d.ts +13 -0
  650. package/node_modules/@sentry/core/build/types-ts3.8/utils/url.d.ts +4 -1
  651. package/node_modules/@sentry/core/package.json +3 -2
  652. package/node_modules/@sentry/node/build/cjs/integrations/tracing/vercelai/instrumentation.js +3 -0
  653. package/node_modules/@sentry/node/build/esm/integrations/tracing/vercelai/instrumentation.js +3 -0
  654. package/node_modules/@sentry/node/build/esm/package.json +1 -1
  655. package/node_modules/@sentry/node/package.json +7 -6
  656. package/node_modules/@sentry/node-core/build/cjs/integrations/anr/index.js +1 -1
  657. package/node_modules/@sentry/node-core/build/cjs/integrations/http/httpServerSpansIntegration.js +6 -3
  658. package/node_modules/@sentry/node-core/build/cjs/integrations/local-variables/local-variables-async.js +1 -1
  659. package/node_modules/@sentry/node-core/build/cjs/integrations/node-fetch/undici-instrumentation.js +2 -2
  660. package/node_modules/@sentry/node-core/build/cjs/light/client.js +7 -0
  661. package/node_modules/@sentry/node-core/build/cjs/sdk/client.js +7 -0
  662. package/node_modules/@sentry/node-core/build/cjs/utils/outgoingFetchRequest.js +1 -1
  663. package/node_modules/@sentry/node-core/build/esm/integrations/anr/index.js +1 -1
  664. package/node_modules/@sentry/node-core/build/esm/integrations/anr/worker-script.js +2 -2
  665. package/node_modules/@sentry/node-core/build/esm/integrations/http/httpServerSpansIntegration.js +7 -4
  666. package/node_modules/@sentry/node-core/build/esm/integrations/local-variables/local-variables-async.js +1 -1
  667. package/node_modules/@sentry/node-core/build/esm/integrations/local-variables/worker-script.js +1 -1
  668. package/node_modules/@sentry/node-core/build/esm/integrations/node-fetch/undici-instrumentation.js +3 -3
  669. package/node_modules/@sentry/node-core/build/esm/light/client.js +8 -1
  670. package/node_modules/@sentry/node-core/build/esm/package.json +1 -1
  671. package/node_modules/@sentry/node-core/build/esm/sdk/client.js +8 -1
  672. package/node_modules/@sentry/node-core/build/esm/utils/outgoingFetchRequest.js +2 -2
  673. package/node_modules/@sentry/node-core/build/types/light/client.d.ts +1 -0
  674. package/node_modules/@sentry/node-core/build/types/sdk/client.d.ts +1 -0
  675. package/node_modules/@sentry/node-core/build/types-ts3.8/light/client.d.ts +1 -0
  676. package/node_modules/@sentry/node-core/build/types-ts3.8/sdk/client.d.ts +1 -0
  677. package/node_modules/@sentry/node-core/package.json +5 -4
  678. package/node_modules/@sentry/opentelemetry/build/cjs/{asyncContextStrategy-BJ5buq_A.js → asyncContextStrategy-BR-l9zjD.js} +8 -6
  679. package/node_modules/@sentry/opentelemetry/build/cjs/index.browser.js +1 -1
  680. package/node_modules/@sentry/opentelemetry/build/cjs/index.js +1 -1
  681. package/node_modules/@sentry/opentelemetry/build/esm/{asyncContextStrategy-Bx5F5tCX.js → asyncContextStrategy-BQfM_LMv.js} +9 -7
  682. package/node_modules/@sentry/opentelemetry/build/esm/index.browser.js +1 -1
  683. package/node_modules/@sentry/opentelemetry/build/esm/index.js +2 -2
  684. package/node_modules/@sentry/opentelemetry/build/esm/package.json +1 -1
  685. package/node_modules/@sentry/opentelemetry/package.json +4 -3
  686. package/node_modules/@sentry/server-utils/build/cjs/tracing-channel.js +1 -0
  687. package/node_modules/@sentry/server-utils/build/esm/package.json +1 -1
  688. package/node_modules/@sentry/server-utils/build/esm/tracing-channel.js +1 -0
  689. package/node_modules/@sentry/server-utils/build/types/tracing-channel.d.ts +3 -1
  690. package/node_modules/@sentry/server-utils/build/types-ts3.8/tracing-channel.d.ts +3 -1
  691. package/node_modules/@sentry/server-utils/package.json +4 -3
  692. package/node_modules/cjs-module-lexer/README.md +8 -3
  693. package/node_modules/cjs-module-lexer/dist/lexer.js +1 -1
  694. package/node_modules/cjs-module-lexer/dist/lexer.mjs +2 -2
  695. package/node_modules/cjs-module-lexer/lexer.js +48 -9
  696. package/node_modules/cjs-module-lexer/package.json +3 -2
  697. package/node_modules/es-module-lexer/dist/lexer.asm.js +2 -2
  698. package/node_modules/es-module-lexer/dist/lexer.cjs +1 -1
  699. package/node_modules/es-module-lexer/dist/lexer.js +2 -2
  700. package/node_modules/es-module-lexer/dist/lexer.minimal.asm.js +2 -2
  701. package/node_modules/es-module-lexer/dist/lexer.minimal.cjs +1 -1
  702. package/node_modules/es-module-lexer/dist/lexer.minimal.js +2 -2
  703. package/node_modules/es-module-lexer/package.json +1 -1
  704. package/node_modules/import-in-the-middle/CHANGELOG.md +7 -0
  705. package/node_modules/import-in-the-middle/lib/get-esm-exports.mjs +7 -0
  706. package/node_modules/import-in-the-middle/package.json +1 -1
  707. package/package.json +2 -2
  708. package/packages/pm-beads/extensions/beads/runtime.ts +2 -2
  709. package/packages/pm-beads/package.json +1 -1
  710. package/packages/pm-calendar/package.json +1 -1
  711. package/packages/pm-command-kit/package.json +1 -1
  712. package/packages/pm-digital-twin/package.json +1 -1
  713. package/packages/pm-governance-audit/package.json +1 -1
  714. package/packages/pm-guide-shell/package.json +1 -1
  715. package/packages/pm-kanban/package.json +1 -1
  716. package/packages/pm-lifecycle-hooks/package.json +1 -1
  717. package/packages/pm-linked-test-adapters/package.json +1 -1
  718. package/packages/pm-search-advanced/package.json +1 -1
  719. package/packages/pm-templates/package.json +1 -1
  720. package/packages/pm-todos/package.json +1 -1
  721. package/packages/pm-vcs/package.json +1 -1
  722. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  723. package/plugins/pm-claude/package.json +1 -1
  724. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  725. package/plugins/pm-codex/package.json +1 -1
  726. package/plugins/pm-codex/plugin.json +1 -1
  727. package/runtime-dependencies.json +1 -1
  728. package/scripts/finalize-build.mjs +37 -0
  729. package/dist/cli-bundle/chunks/chunk-BXSXT5Z6.js +0 -2
  730. package/dist/cli-bundle/chunks/chunk-KNW3RSLS.js +0 -30
  731. package/dist/cli-bundle/chunks/chunk-MEWBSWE3.js +0 -2
  732. package/dist/cli-bundle/chunks/chunk-RBPOO46D.js +0 -20
  733. package/dist/cli-bundle/chunks/chunk-YMLF6QT7.js +0 -234
  734. package/dist/cli-bundle/chunks/register-operations-PDOBQZUJ.js +0 -2
  735. package/dist/cli-bundle/focused-chunks/chunk-2CJWTLQG.js +0 -2
  736. package/dist/cli-bundle/focused-chunks/chunk-B3YW6H2I.js +0 -26
  737. package/dist/cli-bundle/focused-chunks/chunk-GVGFUD52.js +0 -8
  738. package/dist/cli-bundle/focused-chunks/chunk-MJQ253F3.js +0 -2
  739. package/dist/cli-bundle/focused-chunks/chunk-PBCYGO7X.js +0 -3
  740. package/dist/cli-bundle/focused-chunks/chunk-WOEZJUA2.js +0 -2
package/docs/SDK.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  The supported programmatic surface is `@unbrained/pm-cli/sdk`.
4
4
 
5
+ API reference consolidation is tracked by
6
+ [pm-4g4qv0](../.agents/pm/tasks/pm-4g4qv0.toon).
7
+
5
8
  Current SDK initialization and migration additions are tracked by
6
9
  [pm-1w3ljt](../.agents/pm/issues/pm-1w3ljt.toon) and
7
10
  [pm-s79kel](../.agents/pm/issues/pm-s79kel.toon). Tiered entrypoints and the
@@ -175,200 +178,37 @@ ungoverned.
175
178
 
176
179
  ## Public Exports
177
180
 
178
- Source of truth:
179
-
180
- - [`src/sdk/index.ts`](../src/sdk/index.ts)
181
- - [`src/sdk/authoring.ts`](../src/sdk/authoring.ts)
182
- - [`src/sdk/contracts.ts`](../src/sdk/contracts.ts)
183
- - [`src/sdk/core.ts`](../src/sdk/core.ts)
184
- - [`src/sdk/governance.ts`](../src/sdk/governance.ts)
185
- - [`src/sdk/graph.ts`](../src/sdk/graph.ts)
186
- - [`src/sdk/merge.ts`](../src/sdk/merge.ts)
187
- - [`src/sdk/query.ts`](../src/sdk/query.ts)
188
- - [`src/sdk/runtime.ts`](../src/sdk/runtime.ts)
189
- - [`src/sdk/annotations.ts`](../src/sdk/annotations.ts)
190
- - [`src/sdk/linked-artifacts.ts`](../src/sdk/linked-artifacts.ts)
191
- - [`src/sdk/files.ts`](../src/sdk/files.ts)
192
- - [`src/sdk/docs.ts`](../src/sdk/docs.ts)
193
- - [`src/sdk/dependencies.ts`](../src/sdk/dependencies.ts)
194
- - [`src/sdk/actionability.ts`](../src/sdk/actionability.ts)
195
- - [`src/sdk/schema.ts`](../src/sdk/schema.ts)
196
- - [`src/sdk/schema-migration.ts`](../src/sdk/schema-migration.ts)
197
- - [`src/sdk/relationships.ts`](../src/sdk/relationships.ts)
198
- - [`src/sdk/graph/index.ts`](../src/sdk/graph/index.ts)
199
- - [`src/sdk/graph/assembly.ts`](../src/sdk/graph/assembly.ts)
200
- - [`src/sdk/graph/traversal.ts`](../src/sdk/graph/traversal.ts)
201
- - [`src/sdk/graph/analytics.ts`](../src/sdk/graph/analytics.ts)
202
- - [`src/sdk/graph/governance.ts`](../src/sdk/graph/governance.ts)
203
- - [`src/sdk/graph/remediation.ts`](../src/sdk/graph/remediation.ts)
204
- - [`src/sdk/graph/cache.ts`](../src/sdk/graph/cache.ts)
205
- - [`src/sdk/graph/durable-cache.ts`](../src/sdk/graph/durable-cache.ts)
206
- - [`src/sdk/graph/adapter.ts`](../src/sdk/graph/adapter.ts)
207
- - [`src/sdk/graph/conformance.ts`](../src/sdk/graph/conformance.ts)
208
- - [`src/sdk/graph/mutation-advisory.ts`](../src/sdk/graph/mutation-advisory.ts)
209
- - [`src/sdk/graph/run.ts`](../src/sdk/graph/run.ts)
210
- - [`src/sdk/relationship-history.ts`](../src/sdk/relationship-history.ts)
211
- - [`src/sdk/relationship-context.ts`](../src/sdk/relationship-context.ts)
212
- - [`src/sdk/context-signal-store.ts`](../src/sdk/context-signal-store.ts)
213
- - [`src/sdk/workspace-memory.ts`](../src/sdk/workspace-memory.ts)
214
- - [`src/sdk/item-metadata-index.ts`](../src/sdk/item-metadata-index.ts)
215
- - [`src/sdk/governance/validate.ts`](../src/sdk/governance/validate.ts)
216
- - [`src/sdk/governance/health.ts`](../src/sdk/governance/health.ts)
217
- - [`src/sdk/governance/gc.ts`](../src/sdk/governance/gc.ts)
218
- - [`src/sdk/merge/index.ts`](../src/sdk/merge/index.ts)
219
- - [`src/sdk/workspace-transaction-gc.ts`](../src/sdk/workspace-transaction-gc.ts)
220
- - [`src/sdk/query/list.ts`](../src/sdk/query/list.ts)
221
- - [`src/sdk/query/complete-list.ts`](../src/sdk/query/complete-list.ts)
222
- - [`src/sdk/query/search.ts`](../src/sdk/query/search.ts)
223
- - [`src/sdk/query/search-pagination.ts`](../src/sdk/query/search-pagination.ts)
224
- - [`src/sdk/query/search-rendering.ts`](../src/sdk/query/search-rendering.ts)
225
- - [`src/sdk/query/item-filter-options.ts`](../src/sdk/query/item-filter-options.ts)
226
- - [`src/sdk/query/parsers.ts`](../src/sdk/query/parsers.ts)
227
- - [`src/sdk/test/execution.ts`](../src/sdk/test/execution.ts)
228
- - [`src/sdk/test/batch.ts`](../src/sdk/test/batch.ts)
229
- - [`src/sdk/test/runs.ts`](../src/sdk/test/runs.ts)
230
- - [`src/sdk/test/parsers.ts`](../src/sdk/test/parsers.ts)
231
- - [`src/sdk/eval.ts`](../src/sdk/eval.ts)
232
- - [`src/sdk/telemetry.ts`](../src/sdk/telemetry.ts)
233
- - [`src/sdk/stats.ts`](../src/sdk/stats.ts)
234
- - [`src/sdk/cli-contracts.ts`](../src/sdk/cli-contracts.ts)
235
- - [`src/sdk/cli-bootstrap.ts`](../src/sdk/cli-bootstrap.ts)
236
- - [`src/sdk/cli-contracts/commander-types.ts`](../src/sdk/cli-contracts/commander-types.ts)
237
- - [`src/sdk/cli-contracts/commander-mutation-options.ts`](../src/sdk/cli-contracts/commander-mutation-options.ts)
238
- - [`src/sdk/structured-mutations.ts`](../src/sdk/structured-mutations.ts)
239
-
240
- Common authoring exports:
241
-
242
- - `defineExtension`
243
- - `composeExtension` / `deriveExtensionCapabilities`
244
- - `mergeExtensionBlueprints` (combine partial blueprints into one for modular authoring)
245
- - `composeExtensionPackage` (author-once capstone: returns both the module and its synthesized manifest)
246
- - `synthesizeExtensionManifest` (generate a complete least-privilege manifest from a blueprint)
247
- - `describeExtensionBlueprint` (static surface map of a blueprint) / `lintExtensionBlueprint` (author-time preflight)
248
- - Blueprint lint treats host-owned global long flags and malformed long syntax as
249
- blocking errors. Exhaustive `ExtensionBlueprintLintCode` consumers must
250
- handle `host_owned_flag_collision` and `malformed_long_flag`; both include
251
- the same remediation used by runtime activation.
252
- - `renderExtensionSurfaceMarkdown` (render a describe summary to a drift-free Markdown reference doc for a package README)
253
- - `checkExtensionManifestCompatibility` (author-time `pm_min_version`/`pm_max_version` check against a target pm version)
254
- - `inspectExtensionManifestSchema` / `lintExtensionManifestSchema` (pure raw-manifest schema inspection and actionable finding boundary)
255
- - `preflightExtension` (one-call capstone: lint + manifest synthesis + version-compat in a single consolidated report)
256
- - `RESERVED_ITEM_FIELD_NAMES` (the shared runtime/authoring denylist); `lintExtensionBlueprint`, preflight, and the test harness reject blueprint item fields that shadow these metadata keys before publication
257
- - `EXTENSION_CAPABILITIES`
258
- - `EXTENSION_CAPABILITY_CONTRACT`
259
- - `EXTENSION_CAPABILITY_CONTRACT_VERSION`
260
- - `EXTENSION_CAPABILITY_LEGACY_ALIASES`
261
- - `EXTENSION_POLICY_MODES`
262
- - `EXTENSION_POLICY_SURFACES`
263
- - `EXTENSION_TRUST_MODES`
264
- - `EXTENSION_SANDBOX_PROFILES`
265
- - `PM_CLI_EXPECTED_ERROR_NAME`
266
- - `createPmCliExpectedError`
267
- - `isPmCliExpectedError`
268
- - `suppressHostOutput` / `isHostOutputSuppressed` / `SUPPRESS_HOST_OUTPUT_MARKER`
269
- for extension commands that already wrote streaming, binary, or otherwise
270
- pre-rendered output and must prevent a second host render
271
-
272
- Registration builders (`define*`, zero-cost identity — see [Authoring Builders](#authoring-builders)):
273
-
274
- - `defineCommand` / `defineFlag` / `defineItemType` / `defineItemField` / `defineMigration`
275
- - `defineProjectProfile` (archetype bundle of types/statuses/fields/workflows/config/templates/packages — powers `pm profile`)
276
- - `defineSearchProvider` / `defineVectorStoreAdapter`
277
- - `defineCommandOverride` / `defineParserOverride` / `definePreflightOverride` / `defineServiceOverride` / `defineRendererOverride`
278
- - `defineImporter` / `defineExporter`
279
- - `defineBeforeCommandHook` / `defineAfterCommandHook` / `defineOnWriteHook` / `defineOnReadHook` / `defineOnIndexHook`
280
-
281
- Project profiles:
282
-
283
- - `defineProjectProfile` / `BUILTIN_PROFILES` / `PROFILE_NAMES` / `resolveProfile` / `listProfiles` / `normalizeProfileName`
284
- - `describeProjectProfile` (pure composition summary — per-dimension counts plus resolved entry identifiers; the project-profile analogue of `describeExtensionBlueprint`) and `describeProfileComposition`
285
- - `lintProjectProfile` (pure, tracker-independent author-time consistency check that grades findings `error`/`warning` across every dimension — invalid/duplicate types, statuses, fields; workflows governing undeclared types or referencing undeclared statuses; unknown/invalid config knobs; templates creating undeclared types; empty package specs) and its `ProjectProfileLintReport` / `ProjectProfileLintFinding` types
286
- - `assertProjectProfile` (the throwing test counterpart: fails on any `error` finding, or on warnings too with `{ strict: true }` — the profile analogue of `assertExtensionBlueprint`)
287
- - `planProfileApplication` (pure, idempotent diff of a profile against the current tracker state) and its `ProfileApplicationPlan` / `ProfileCurrentState` types
288
- - The bundled [pm-kanban exemplar](../packages/pm-kanban/README.md) ships a complete archetype as an installable package: it registers the live schema (`Card` type + flow fields) and exports a `ProjectProfileDefinition` the planner can stage, all on public SDK primitives.
289
-
290
- Author-time lifecycle: `defineProjectProfile` → `lintProjectProfile` / `assertProjectProfile` (validate before registering) → `api.registerProfile` → `describeProjectProfile` / `planProfileApplication` (preview) → `pm profile apply`. Validate a profile in a package test before it ships:
291
-
292
- ```ts
293
- import { assertProjectProfile } from "@unbrained/pm-cli/sdk/testing";
294
-
295
- assertProjectProfile(kanbanProfile); // throws on any error finding
296
- ```
297
-
298
- Package manifest exports:
299
-
300
- - `PM_PACKAGE_RESOURCE_KINDS` (`extensions`, `docs`, `examples`, `assets`, `prompts`)
301
- - `PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS`
302
- - `readPmPackageManifest`
303
- - `collectPackageExtensionDirectories`
304
-
305
- Storage format-version exports (under `@unbrained/pm-cli/sdk/runtime`):
306
-
307
- - `CURRENT_ITEM_FORMAT_VERSION` / `BASELINE_ITEM_FORMAT_VERSION`
308
- - `effectiveItemFormatVersion` (resolve an item's stored version; absent means the baseline)
309
- - `normalizeItemFormatVersion` (persisted form; the baseline is dropped so it is never serialized)
310
- - `classifyItemFormatVersion` (`current` / `outdated` / `ahead`)
311
- - `scanItemFormatVersions` (partition items into outdated/ahead reference lists)
312
-
313
- Command/action contract exports:
314
-
315
- - `PmClient` / `runAction` (high-level in-process action execution for custom tools, bots, CI, and embedded runtimes)
316
- - Typed read primitives on `PmClient`: `get` (including `GetOptions.at` point-in-time reads), `list`, `listAllComplete`, `search`, `context`, `next`, `aggregate`, `stats`, and `duplicates`; direct `getItemAt` reconstructs a canonical historical document without mutation. `listAllComplete` forces an all-status, full, strict, unbounded read and fails closed unless the returned envelope proves source completeness, unique ids, exact counts, no pagination, no field or budget omission, and no session projection. `duplicates` performs one bounded all-status metadata sweep and returns deterministic canonical-candidate and close-command guidance without mutating items.
317
- - Read primitive option/result contracts: `GetOptions` / `GetResult`, `ListOptions` / `ListResult`, `SearchOptions` / `SearchResult`, `ContextOptions` / `ContextResult`, `NextOptions` / `NextResult`, `AggregateOptions` / `AggregateResult`, `StatsCommandOptions` / `StatsResult`. Standard and brief `get` projections omit note bodies but expose `item.notes_count`; deep/full reads return the notes themselves, and narrow consumers can request `notes_count` explicitly.
318
- - Stream projection primitive: `serializeNdjsonRows` frames SDK-owned object rows as newline-delimited JSON without a trailing newline and rejects scalar/array rows, so package transports can match list/search/context CLI semantics without importing presentation code.
319
- - Context relevance primitives: `buildItemContextRelevanceCandidates`, `buildContextSignalSnapshot`, `ContextSignalStore`, `JsonFileContextSignalStoreAdapter`, `parseContextSignalSnapshot`, `defaultScoreContextCandidates`, `scoreContextCandidates`, `scoreContextCandidatesWithActiveExtensions`, `evaluateContextRanking`, `runContextEvaluationScenario`, `runContextEvaluationCorpus`, and `summarizeContextEvaluationReports`
320
- - Context relevance contracts: `ContextRelevanceCandidate`, `ContextRelevanceSignals`, `ContextSignalSnapshot`, `ContextSignalStoreAdapter`, `ContextSignalStoreReadResult`, `ContextRelevanceScorer`, `ContextRelevanceReport`, `ContextEvaluationReader`, `ContextEvaluationScenario`, `ContextEvaluationScenarioReport`, `ContextEvaluationThresholds`, and `ContextEvaluationCorpusReport`
321
- - Context packing and feedback primitives: `packContextCandidates`, `recordContextUsageServing`, `recordContextUsageTouch`, `recordContextUsageTouches`, and `readContextUsageAffinity`
322
- - Large-workspace memory primitives: `buildWorkspaceMemorySnapshot`, `readWorkspaceMemory`, `selectWorkspaceMemoryRollups`, and `searchWorkspaceMemory` build cursor-bound, rebuildable calendar-epoch and epic-lineage summaries. The stock `context` and `search` results attach matching bounded rollups automatically at 10,000 items; smaller projects skip the artifact entirely.
323
- - Persistent metadata-query primitives: `queryItemMetadataIndex` with `ItemMetadataIndexQuery` / `ItemMetadataIndexQueryResult` executes bounded status/type/id/parent/assignee/sprint/release/priority windows without materializing the JSON metadata corpus. It returns `null` on absent, stale, or corrupt derived state so custom hosts can fall back to authoritative reads.
324
- - Schema-evolution primitives: `planSchemaEvolutionMigration` and `runSchemaEvolutionMigration`, plus `PmClient.schemaRenameType`, `schemaRenameField`, and `schemaRemapStatus`, provide deterministic dry-run plans, collision refusal, index-backed candidate selection, per-item immutable history, and crash-resumable workspace transactions.
325
- - Workspace audit primitives: `appendWorkspaceHistoryChange`, `writeWorkspaceJsonWithHistory`, `inspectWorkspaceHistoryState`, `reconcileWorkspaceJsonHistory`, `restoreWorkspaceJsonFromHistory`, `getWorkspaceHistoryPath`, and `WORKSPACE_HISTORY_ID` let package-owned singleton JSON mutations share the CLI's verified `HistoryEntry` stream, prove replay-to-disk agreement, and recover forward without inventing an unaudited side log or rewriting history.
326
- - Typed annotation and relationship primitives on `PmClient`: `comments`, `notes`, `learnings`, `files`, `filesDiscover`, `docs`, `deps`, `graph`, and `append`
327
- - Workspace graph-query runner: `runGraph` (with `GraphCommandOptions`, `GraphResult`, and per-subcommand envelopes) resolves the workspace relationship graph through the shared fingerprint-keyed cache and dispatches bounded `ancestors`/`descendants`/`predecessors`/`successors`/`paths`/`impact`/`analyze`/`audit`/`communities`/`redundancy`/`dominators`/`slack`/`centrality`/`articulation`/`plan` queries with counts-first cost, truncation, and cache metadata; the `pm graph` CLI command and `pm_graph` MCP tool are thin adapters over it.
328
- - Structural graph analytics: `detectRelationshipCommunities` (deterministic label-propagation clustering with `maxIterations`/`minSize` bounds and convergence reporting), `findRedundantRelationshipEdges` (transitive-reduction scan that joins each directed ordering or hierarchy kind with its inverse spelling and returns witness paths), and `computeRelationshipDominators` (Cooper–Harvey–Kennedy immediate dominators with per-node gating weights for bottleneck ranking) — all deterministic, cancellable, and cost-metered like every other graph query.
329
- - Planning and fragility analytics: `analyzeRelationshipSchedule` (Critical Path Method over the order-bearing DAG — earliest/latest start, total float, critical-task classification, and makespan with unit durations, reusing the exact execution forward pass), `computeRelationshipCentrality` (exact Brandes betweenness, Wasserman–Faust closeness, undirected degree, and precedence-oriented dependency fan-in/fan-out per node), and `findRelationshipCutStructure` (iterative Tarjan articulation points and bridges — the single points of failure in the knowledge graph). `forEachMatchedRelationshipEdge` is the shared kind-matched, self-loop-skipping edge iterator these builders reuse. All are deterministic and exact on the bounded workspace.
330
- - Incremental graph cache: `WorkspaceGraphCache`, `workspaceGraphCache`, `resetWorkspaceGraphCache`, and `computeWorkspaceGraphFingerprint` reuse the assembled workspace graph and memoize deterministic query results under a fingerprint that digests every relationship-relevant item field (id, title, status and terminal classification, item type, parent, legacy blocker, structured dependencies), so long-lived hosts stop paying full-workspace assembly per bounded query; `GraphCacheMetadata` reports assembly/result hit-or-miss on every `runGraph` envelope.
331
- - Durable graph index: `openDurableGraphCache`, `persistDurableGraphResult`, `clearDurableGraphCache`, `durableGraphCacheStatus`, `shouldPersistDurableGraphCache`, and the `durableGraphCachePath`/`graphAuditBaselinePath` locators persist fingerprint-keyed deterministic query results across processes under `runtime/graph-cache.json` — atomic writes, corrupt-tolerant decode, bounded retention, never authoritative (rebuildable from item storage), optional below the `GRAPH_DURABLE_CACHE_MIN_ITEMS` threshold; `pm graph index` is the maintenance surface and `cache.durable` the per-envelope observability.
332
- - Temporal audit census: `RelationshipAuditSnapshot`, `diffRelationshipAuditSnapshots`, `saveGraphAuditBaseline`, and `loadGraphAuditBaseline` persist and compare point-in-time governance censuses (signed per-code and per-profile deltas, `same_snapshot` fingerprint equality) behind `pm graph audit --save-baseline` and the automatic `baseline` drift block on later audits.
333
- - Storage-integrity and coverage governance: `collectDuplicateDependencyRows` reports raw same-identity dependency rows duplicated on one holder; `collectOrderingStorageContradictions` reports exact scalar blocker plus opposite-precedence structured rows before graph normalization; `RelationshipCoverageProfile` separates diagnostic `nodes`/`edges` from invariant-bearing `recorded_nodes`/`informative_edges` and independent redundancy/contradiction debt counts; `coverage_by_type` breaks active connectivity down per item type, and `RelationshipAuditOptions.isolateExemptTypes` suppresses coverage findings for policy-valid disconnected types.
334
- - Incremental mutation advisory: `collectNewOrderingCycleWarnings` detects newly created ordering cycles component-scoped around the changed item over a lightweight per-snapshot ordering digraph and emits exact newly stored scalar-versus-structured contradiction evidence before the derived cycle warning (shared registry and `collectOrderingCycles` Tarjan semantics with the audit; no full workspace assembly per mutation).
335
- - Remediation planning: `planRelationshipRemediation` (with `RelationshipRemediationPlan`, `RelationshipRemediationStep`, and operation/confidence/code contracts) derives exact dry-run `remove`/`retype`/`supersede`/`waive`/`investigate` proposals from governance-audit findings and witnessed redundancy rows — evidence-backed, confidence-rated, and never auto-applied.
336
- - Annotation and relationship option/result contracts: `CommentsCommandOptions` / `CommentsResult`, `NotesCommandOptions` / `NotesResult`, `LearningsCommandOptions` / `LearningsResult`, `FilesCommandOptions` / `FilesResult`, `FilesDiscoverOptions` / `FilesDiscoverResult`, `DocsCommandOptions` / `DocsResult`, `DepsCommandOptions` / `DepsResult`, `AppendCommandOptions` / `AppendResult`
337
- - Annotation kernel primitives: `resolveAnnotationInput`, `runAnnotationCommand`, `resolveAnnotationIndex`, `parseAnnotationTextInput`, `limitAnnotationEntries`, `readAnnotationEntries`, `wrapOwnershipConflict`, `isErrnoError`, and their typed input/config/result contracts
338
- - Linked-resource kernel primitives: `runFiles`, `runFilesDiscover`, `runDocs`, `runDeps`, `runLinkedArtifacts`, `assertLinkedArtifactMutationIsUnambiguous`, parsing/normalization/path-validation helpers, and their typed contracts. The CLI files/docs/deps modules are presentation-only re-exports of these SDK implementations. A transaction that resolves one path into both its add and remove sets fails before item or history mutation; split an intentional replacement into two commands so its context remains explicit.
339
- - Actionability primitives: `collectBlockedByIds`, `resolveItemBlockers`, `collectDependencyBlockedIds`, and `computeActionabilityReport` expose the same edge-aware blocked/ready definition used by `pm next`, `pm context`, and `pm list --status blocked`. Embedded schedulers can therefore classify custom lifecycle schemas without importing CLI or core modules.
340
- - Dependency-governance primitives: `collectDanglingDependencyReferences`, `collectMissingDependencyTargetIds`, and `assembleWorkspaceRelationshipGraph` normalize hierarchy, scalar blockers, and structured dependencies into one graph while partitioning missing targets into actionable active holders, informational terminal-history holders, and the legacy `no-active-blocker` sentinel without mutating stored history.
341
- - Relationship graph primitives: `RelationshipKindRegistry`, `createRelationshipKindRegistry`, `assertRelationshipEdgeAllowed`, `RelationshipGraph`, `RelationshipEventLog`, `RelationshipEventStore`, `planRelationshipEventBackfill`, `buildRelationshipContext`, `buildDepsRelationshipContext`, `hierarchyAncestors`, `hierarchyDescendants`, `orderingPredecessors`, `orderingSuccessors`, `enumerateRelationshipPaths`, `auditWorkspaceRelationshipGraph`, `isOrderingRelationshipKind`, and `dependencyToRelationship` provide application-defined edge semantics, durable replay, deterministic legacy migration, bounded semantic traversal, policy-aware governance, and explainable context queries. Mutation adapters should call `assertRelationshipEdgeAllowed` with the active registry before persistence; it resolves aliases and honors custom `allowSelf` definitions while built-in self edges fail before item or history writes. `RelationshipEventLog.stream/project` and their durable-store equivalents page immutable prefixes and fold them into deterministic application state with exact version, processed-count, and as-of metadata. `RelationshipEventStore.appendBatch` validates a complete import under one cross-process lock and atomically publishes it; `skip_identical` resume mode rejects same-id semantic collisions. `RelationshipGraphAdapter`, `createRelationshipGraphSnapshot`, `syncRelationshipGraphAdapter`, `loadRelationshipGraphAdapter`, and `federateRelationshipGraphSnapshots` form the backend-neutral content-addressed projection boundary for database or remote graph packages. `MemoryRelationshipGraphAdapter`, `assertRelationshipGraphAdapterConformance`, and `createRelationshipGraphScaleFixture` give package authors a reference implementation, reusable compatibility contract, and lazy deterministic fixtures through one million nodes. See [Relationship graph semantics](RELATIONSHIP_GRAPH.md).
342
- - Built-in `recurs_from` records that the source is a later occurrence of the target. Its registry contract is directed, `source_after_target`, non-ordering, many-to-many, and persistent across terminal lifecycle states. Local mutation paths enforce strictly later source `created_at` metadata before item or history persistence and return structured source/target evidence when chronology is equal, reversed, or unverifiable. It therefore connects an incident family for traversal and analytics without reclassifying `supersedes` replacements or `duplicate_of` identity collapse.
343
- - Atomic application transactions: `commitWorkspaceTransaction` coordinates ordered, idempotent item and relationship mutations under one workspace writer lock and a durable replay journal. Interrupted work resumes from step inspection; ordinary failures append reverse-order compensations without rewriting immutable histories.
344
- - Multi-branch merge primitives: `mergeItemDocuments`, `mergeHistoryStreams`, `mergeRelationshipEventStreams`, `mergeJsonDocuments`, `runMergeDriver`, `runMergeInstall`, and `runMergeReconcile` provide the same field-aware item, hash-chain-preserving history, sequence-renumbering relationship-event, key-level configuration, and audited post-merge repair-and-verify semantics as `pm merge`; `installMergeFence` and `findGitWorkspaceRoot` let custom init hosts install the same contract with explicit roots, while `buildMergeAttributePatterns`, `refreshMergeAttributeFenceIfInstalled`, and `auditMergeAttributeFence` expose fence coverage, refresh, and validation. See [Multi-Branch Merge Safety](MERGE_SAFETY.md).
345
- - Dependency provenance primitives: `EXTERNAL_DEPENDENCY_SOURCE_KIND`, `EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS`, `isExternalDependencySourceKind`, and `normalizeDependencySeedId` let custom importers preserve cross-workspace dependency ids explicitly while retaining local prefix normalization for ordinary seeds. `source_kind: "external"` is the human-facing alias and persists canonically as `global`; a `blocked_by` row with that provenance is a real external predecessor, so graph governance does not require a fabricated local item or misreport `stale_lifecycle_block`. Newly created dependency rows also carry the effective `author`, `author_source` (`asserted` or `detected`), and a mutation `source_kind`; legacy rows remain readable without invented provenance. Tracked by [pm-6sc8jq](../.agents/pm/issues/pm-6sc8jq.toon).
346
- - Terminal-create primitive: `CreateCommandOptions.closeReason` and `completedAt` allow importers to create an already-terminal item in the same atomic item/history transaction while preserving the source completion time separately from the local `closed_at` mutation time. The equivalent CLI flags are `--close-reason` and `--completed-at`; direct JSON documents map `close_reason` and `completed_at` to the same SDK operation. A missing governed reason returns `close_reason_required` with same-command `pm create` recovery examples. Tracked by [pm-ykdt4m](../.agents/pm/issues/pm-ykdt4m.toon) and [pm-5uclvd](../.agents/pm/issues/pm-5uclvd.toon).
347
- - Compile-cache lifecycle primitive: `pruneCompileCacheGenerations` bounds pm-owned Node bytecode caches to the current package generation; embedded hosts can apply the same upgrade cleanup without importing the executable entrypoint.
348
- - Typed mutation inputs (pm-x29o / GH-601): `PmCreateActionOptions`, `PmUpdateActionOptions`, and `PmCloseActionOptions` (`PmClientCloseActionOptions` on the client method) strip the permissive custom-field index signature from the executable command-option contracts, retaining their exact public keys and value types without a second hand-written shape; the free `create`/`update`/`close` functions and `PmClient` methods share those types. `PmUpdateManyActionOptions`, `PmCloseManyActionOptions`, and `OptionsFromContracts` cover flat action-contract composition. Field typos, object values, invalid scalar kinds, and MCP-only aliases on a `PmClient` command-option bag fail `tsc` under strict. Runtime-schema custom fields use the repeatable `field` option and `PmClient.run` remains the wide escape hatch. Projected list rows expose the typed `ListProjectedItemCore` fields (`row.id` is `string | undefined`, never `unknown`).
349
- - Typed customization primitives on `PmClient`: `init`, `config`, `schema`, `schemaList`, `schemaShow`, `schemaAddType`, `schemaRemoveType`, `schemaAddStatus`, `schemaRemoveStatus`, `schemaAddField`, `schemaRemoveField`, `schemaListFields`, `schemaShowField`, `schemaApplyPreset`, `schemaInferTypes`, `schemaShowStatus`, `profile`, `profileList`, `profileShow`, `profileApply`, and `profileLint`
350
- - Workspace-scaffold primitives: `ensurePmGitignore` and `getPmGitignoreBlock` let custom tools apply the same idempotent runtime/search cache policy as `pm init` without importing CLI internals. Fresh Git-backed `init` also installs the merge fence by default; `InitCommandOptions.mergeFence = false` is the explicit opt-out.
351
- - Schema-evolution primitives: `planSchemaEvolutionMigration`, `runSchemaEvolutionMigration`, and `deriveSchemaEvolutionMigrationId` provide deterministic dry-run plans and crash-resumable execution. Migration ids are optional: execution derives a workspace-and-normalized-request-bound id, while `migrationId` remains an authoritative override for orchestrators that already own idempotency keys.
352
- - Customization primitive option/result contracts: `InitCommandOptions` / `InitResult`, `ConfigCommandOptions` / `ConfigResult`, `SchemaSubcommand` / `SchemaResult` / `SchemaInspectResult`, `SchemaListResult`, `SchemaShowResult`, `SchemaAddTypeResult`, `SchemaRemoveTypeResult`, `SchemaAddStatusResult`, `SchemaRemoveStatusResult`, `SchemaAddFieldResult`, `SchemaRemoveFieldResult`, `SchemaListFieldsResult`, `SchemaShowFieldResult`, `SchemaApplyPresetResult`, `SchemaAddTypeInferResult`, `SchemaShowStatusResult`, `ProfileSubcommand` / `ProfileResult`, `ProfileListResult`, `ProfileShowResult`, `ProfileApplyResult`, `ProfileLintResult`
353
- - Typed governance and maintenance primitives on `PmClient`: `validate`, `health`, `gc`, `historyRedact`, `historyRepair`, `historyRepairAll`, `historyCompact`, and `historyCompactBulk`
354
- - Governance and maintenance option/result contracts: `ValidateCommandOptions` / `ValidateResult`, `RunHealthOptions` / `HealthResult`, `GcCommandOptions` / `GcResult`, `HistoryRedactCommandOptions` / `HistoryRedactResult`, `HistoryRepairCommandOptions` / `HistoryRepairResult` / `HistoryRepairAllResult`, and `HistoryCompactCommandOptions` / `HistoryCompactResult` / `HistoryCompactBulkCommandOptions` / `HistoryCompactBulkResult`
355
- - Direct governance engines: `runValidate`, `runHealth`, and `runGc` are public SDK exports used by the CLI compatibility adapters and by custom policy engines that already own `GlobalOptions`. `runValidate({ counts: true })` and `projectValidateCounts` preserve statuses, warning codes, and scalar count/total maps while removing diagnostic row arrays. Their structured results are identical to CLI JSON output; no shell process or private core import is required.
356
- - Execution and diagnostics engines: `runTest`, `runLinkedTests`, `runTestAll`, `runStartBackgroundRun`, `runTestRunsList`, `runTestRunsStatus`, `runTestRunsLogs`, `runTestRunsStop`, `runTestRunsResume`, `runTestRunsWorker`, `runEval`, `runTelemetry`, and `runStats`. Their CLI modules are compatibility re-exports of SDK-owned implementations.
357
- - Execution and diagnostics contracts: `TestCommandOptions` / `TestResult` / `TestRunResult`, `TestAllCommandOptions` / `TestAllResult`, `StartBackgroundRunCommandOptions` / `StartBackgroundRunResult`, `TestRuns*CommandOptions`, `EvalOptions` / `EvalResult`, `TelemetryCommandOptions` / `TelemetrySubcommand`, and `StatsCommandOptions` / `StatsResult`.
358
- - Linked-test authoring primitives: `parseLinkedTestJsonEntries`, the `parseLinkedTest*` field parsers, `LINKED_TEST_PM_CONTEXT_MODE_VALUES`, `LINKED_TEST_PROTECTED_ENV_KEYS`, `classifyLinkedTestFailure`, `countFailureCategories`, and `summarizeContextPreflight` let custom hosts validate, execute, classify, and report linked tests without duplicating CLI policy.
359
- - Agent command primitives: `normalizeItemAddressInvocation` and `supportsItemIdAlias` project one item-id grammar across CLI adapters; `renderMissingOptionRetry`, `resolveMissingOptionPlaceholder`, and `resolveRecoveryCommandName` preserve attempted argv, derive enum/boolean/scalar recovery arity from flag contracts, and identify the actual command without mistaking a global option value for one; `createUnknownSubcommandError` provides one typed positional refusal with complete allowed values and deterministic nearest retry; `rankCommandPaths` and `scoreCommandPathMatch` provide deterministic synonym/edit-distance/substring ranking; `resolveCreateExplicitEmptyFlag` and `supportsCreateExplicitEmpty` model a considered-but-empty strict repeatable input without inventing metadata or graph edges.
360
- - Positional grammar primitives: `PM_COMMAND_POSITIONAL_CONTRACTS` declares every core and known-package command signature as ordered, typed slots; `PM_POSITIONAL_ACTION_CONTRACTS` promotes positional plan and assurance actions into discoverable virtual command paths with action-scoped flags, examples, and intent. `resolvePmCommandPositionalContract`, `resolvePmPositionalActionContract`, and `verifyPmCommandPositionalContracts` let custom hosts resolve or fail-closed compare the same signatures emitted by runtime contracts. The grammar receipt ratchets distinct semantic shapes through `positional_shape_budget` so a new arity cannot silently expand agent context.
361
- - MCP/CLI option parity primitive: `verifyToolOptionCliParity` compares one `ToolOptionFlagContract` table with its executable `CliFlagContract` table. It fails when the transport-selected canonical flag is absent or when a parameter such as `linkedFile` cannot be invoked using its kebab-case CLI spelling (`--linked-file`) canonically or through a registered alias. Core create/update parity is part of the required command-grammar gate.
362
- - Refusal reachability primitives: generated `PmErrorCodeContract.owned_states` declarations bind stable codes to concrete states, probe ids, entrypoints, and exit classes; `verifyPmRefusalReachability` compares those declarations with real CLI, SDK, MCP, or package observations and fails closed for missing, duplicate, wrong-entrypoint, mismatched, or undeclared probes.
363
- - Typed plan workflow primitives on `PmClient`: `plan`, `planCreate`, `planShow`, `planAddStep`, `planUpdateStep`, `planCompleteStep`, `planBlockStep`, `planReorderStep`, `planRemoveStep`, `planLink`, `planUnlink`, `planDecision`, `planDiscovery`, `planValidation`, `planResume`, `planApprove`, and `planMaterialize`
364
- - Plan contracts: `PlanSubcommand`, `PlanCommandOptions`, `PlanCommandResult`, `PlanResultPlan`, `PlanStepSummary`, `PlanShowDepth`, and `PlanTemplateName`
365
- - Typed package and extension lifecycle primitives on `PmClient`: `extension`, `extensionList`, `extensionActivate`, `extensionDeactivate`, `package`, `packageList`, `packageInstall`, `packageUninstall`, `packageDoctor`, `packageManage`, `packageDescribe`, `packageReload`, `packageCatalog`, `packageActivate`, `packageDeactivate`, `packageMigrate`, and `upgrade`; one-shot `extensionMigrate` and `packageMigrate` helpers mirror those lifecycle actions.
366
- - Lifecycle primitive option/result contracts: `ExtensionCommandOptions` / `ExtensionCommandResult`, `PackageCommandOptions` / `PackageCommandResult`, `UpgradeCommandOptions` / `UpgradeResult`
367
- - `PM_CORE_COMMAND_NAMES`
368
- - `PM_TOOL_ACTIONS`
369
- - `PM_TOOL_PARAMETERS_SCHEMA`
370
- - `PM_PROVIDER_TOOL_PARAMETERS_SCHEMA`
371
- - `PM_TOOL_ACTION_PARAMETER_CONTRACTS`
181
+ The published [SDK surface snapshot](../sdk/public-surface.json) records every
182
+ export, subpath, signature and support classification. Import its installed copy
183
+ from `@unbrained/pm-cli/sdk/public-surface.json` when building discovery or
184
+ compatibility tooling. It is generated from the package export map and checked
185
+ against declarations; consumers do not need a second manually maintained list
186
+ of symbols. Start with `PmClient` for typed actions, then choose a narrow
187
+ entrypoint from [Import Surfaces](#import-surfaces) for direct primitives.
188
+
189
+ Use these focused guides to choose the primitive and understand its policy:
190
+
191
+ | Capability | Reference |
192
+ | --- | --- |
193
+ | Item lifecycle, schema, profiles and initialization | [Customization primitives](SDK_CUSTOMIZATION_PRIMITIVES.md), [Lifecycle](SDK_LIFECYCLE.md) |
194
+ | History, whole-item input, transactions and previews | [Audited mutations](SDK_AUDITED_MUTATIONS.md), [Atomic transactions](#atomic-workspace-transactions), [Schema evolution](#schema-evolution-and-workspace-history) |
195
+ | Context ranking, packing, memory and evaluation | [Context relevance](#context-relevance-and-evaluation), [Context coordination](SDK_CONTEXT_COORDINATION.md) |
196
+ | Annotations, linked files/docs and dependencies | [Linked resources](#linked-resources-and-dependency-governance), [Evidence contracts](SDK_CONTEXT_EVIDENCE_CONTRACTS.md) |
197
+ | Relationships, graph queries, adapters and federation | [Relationship graph](RELATIONSHIP_GRAPH.md) |
198
+ | Merge drivers and immutable history convergence | [Merge safety](MERGE_SAFETY.md) |
199
+ | Execution, diagnostics and linked tests | [Execution](#execution-and-diagnostics), [Linked-test edits](LINKED_TEST_EDITS.md) |
200
+ | Plans and materialization | [Plan workflows](#plan-workflows) |
201
+ | Extension builders and declarative packages | [Authoring builders](#authoring-builders), [Declarative authoring](#declarative-authoring) |
202
+ | Package installation, activation and upgrade | [Extensions](EXTENSIONS.md), [Runtime boundaries](SDK_RUNTIME_BOUNDARIES.md) |
203
+ | Flags, output budgets and deterministic refusals | [Flag contracts](#flag-contracts), [Output budgets](#agent-output-budgets-and-discovery), [Expected errors](#expected-cli-errors) |
204
+ | Package and extension assertions | [Testing helpers](#testing-helpers) |
205
+
206
+ `PmClient.run` is the wide action adapter; typed convenience methods retain their
207
+ exact option contracts. Runtime custom fields use repeatable `field` assignments.
208
+ New symbols require classified surface evidence, and exhaustive consumers must
209
+ follow the migration guidance for changed unions or error codes. The shared
210
+ [primitive inventory](SDK_PRIMITIVE_INVENTORY.md) records CLI/MCP ownership:
211
+ presentation modules import the SDK and have zero private-core edges.
372
212
 
373
213
  ### Build an entire custom project tool
374
214
 
@@ -1064,54 +904,12 @@ the lower-level `runAction`) from `@unbrained/pm-cli/sdk/runtime`. It uses the
1064
904
  same compact, extension-aware dispatcher as the MCP `pm_run` tool:
1065
905
 
1066
906
  ```ts
1067
- import { PmClient, runAction } from "@unbrained/pm-cli/sdk/runtime";
907
+ import { PmClient } from "@unbrained/pm-cli/sdk/runtime";
1068
908
 
1069
- const pm = new PmClient({
1070
- pmRoot: "/path/to/project/.agents/pm",
1071
- author: "ci-agent",
1072
- });
1073
-
1074
- const created = await pm.create({
1075
- title: "Investigate release drift",
1076
- type: "Task",
1077
- status: "open",
1078
- createMode: "progressive",
1079
- });
1080
- await pm.claim(created.item.id, { author: "ci-agent" });
1081
- await pm.update(created.item.id, { status: "in_progress" });
1082
- const open = await pm.list({ status: "open", limit: "20" });
1083
- const recommendation = await pm.next({ readyOnly: true });
1084
- const grouped = await pm.aggregate({ groupBy: "status", count: true });
1085
- const stats = await pm.stats({ metadataCoverage: true });
1086
- await pm.comments(created.item.id, { add: "Investigation context captured." });
1087
- await pm.files(created.item.id, { add: ["src/index.ts"], note: "entrypoint" });
1088
- await pm.docs(created.item.id, {
1089
- add: ["docs/SDK.md"],
1090
- note: "authoring reference",
1091
- });
1092
- const graph = await pm.deps(created.item.id, {
1093
- format: "context",
1094
- maxDepth: 3,
1095
- nodeLimit: 20,
1096
- edgeLimit: 40,
1097
- tokenBudget: 800,
1098
- });
1099
- const types = await pm.schemaList();
1100
- const profiles = await pm.profileList();
1101
- const validation = await pm.validate({ checkResolution: true });
1102
- const health = await pm.health({ checkOnly: true, summary: true });
1103
- const packages = await pm.packageList({ project: true });
1104
- const doctor = await pm.packageDoctor({ project: true, isolated: true });
1105
- const plannedUpgrade = await pm.upgrade(undefined, {
1106
- dryRun: true,
1107
- cliOnly: true,
1108
- });
1109
-
1110
- await runAction({
1111
- action: "context",
1112
- path: "/path/to/project/.agents/pm",
1113
- options: { limit: "10" },
1114
- });
909
+ const pm = new PmClient({ pmRoot: "/workspace/.agents/pm" });
910
+ const corpus = await pm.listAllComplete({ includeBody: true });
911
+ const context = await pm.context({ limit: "10" });
912
+ await pm.run("test", { id: "pm-example", options: { run: true } });
1115
913
  ```
1116
914
 
1117
915
  Mutation convenience methods default to compact changed-field output for agent
@@ -1994,42 +1792,34 @@ Custom tools can evaluate the same behavior without shelling out:
1994
1792
 
1995
1793
  ```ts
1996
1794
  import {
1997
- PmClient,
1998
1795
  runContextEvaluationCorpus,
1999
- type ContextEvaluationScenario,
2000
- type ContextEvaluationThresholds,
2001
1796
  } from "@unbrained/pm-cli/sdk";
2002
1797
 
2003
- const pm = new PmClient({
2004
- pmRoot: ".agents/pm",
2005
- author: "context-quality-ci",
1798
+ const report = await runContextEvaluationCorpus([{
1799
+ id: "returning-agent",
1800
+ surface: "context",
1801
+ options: { limit: "5" },
1802
+ judgments: { "pm-current": 3, "pm-support": 2 },
1803
+ required_ids: ["pm-current"],
1804
+ continuity_ids: ["pm-current", "pm-support"],
1805
+ token_budget: 1200,
1806
+ rationale: "Resume claimed work with its supporting context.",
1807
+ }], pm, {
1808
+ ndcg: 0.9, reciprocal_rank: 0.9, required_recall: 1,
1809
+ continuity_coverage: 1, token_budget_adherence: 1,
2006
1810
  });
2007
-
2008
- const scenarios: ContextEvaluationScenario[] = [
2009
- {
2010
- id: "returning-agent",
2011
- surface: "context",
2012
- options: { limit: "5" },
2013
- judgments: { "pm-current": 3, "pm-support": 2 },
2014
- required_ids: ["pm-current"],
2015
- continuity_ids: ["pm-current", "pm-support"],
2016
- token_budget: 1200,
2017
- rationale: "Resume claimed work with its supporting context.",
2018
- },
2019
- ];
2020
-
2021
- const thresholds: ContextEvaluationThresholds = {
2022
- ndcg: 0.9,
2023
- reciprocal_rank: 0.9,
2024
- required_recall: 1,
2025
- continuity_coverage: 1,
2026
- token_budget_adherence: 1,
2027
- };
2028
-
2029
- const report = await runContextEvaluationCorpus(scenarios, pm, thresholds);
2030
1811
  if (!report.passed) throw new Error(report.failures.join(", "));
2031
1812
  ```
2032
1813
 
1814
+ `PmClient` directly satisfies `ContextEvaluationReader`, including universal
1815
+ budget receipts. The evaluator preserves the complete packet and refuses
1816
+ whole-result omissions with `context_evaluation_read_incomplete` before scoring,
1817
+ including omissions caused by a shared session despite an unbounded per-read
1818
+ budget. Increase the budget or start a fresh session before retrying. Ordinary
1819
+ bounded row selection remains evaluable. Tracked by
1820
+ [pm-i4kxx1](../.agents/pm/tasks/pm-i4kxx1.toon).
1821
+ See [SDK consumer receipts](SDK_CONSUMER_RECEIPTS.md) for recovery and package-generation contracts.
1822
+
2033
1823
  The evaluator calls only the public `context()` / `next()` reader contract. It
2034
1824
  scores nDCG, reciprocal rank, required-item recall, returning-agent continuity,
2035
1825
  and deterministic `ceil(UTF-8 JSON bytes / 4)` token-budget adherence. Reports
@@ -2191,6 +1981,40 @@ capability entry to add before publishing.
2191
1981
 
2192
1982
  ## Minimal Command Extension
2193
1983
 
1984
+ Read-only command handlers can opt into the host output contract with
1985
+ `read_output: { row_keys: ["items"] }`. This public declaration is tracked by
1986
+ [pm-extension-read-output-controls](../.agents/pm/features/pm-extension-read-output-controls.toon).
1987
+ It supports `outputInclude`, `outputLimit`, `outputBudget`, `outputFormat`,
1988
+ `outputSession`, `outputCursor`, and `outputRowContract` through CLI flags,
1989
+ `PmClient.run(action, { options })`, and MCP `pm_run`. Inspect the active
1990
+ command's flags and schemas with `pm contracts --command "<path>" --full`.
1991
+
1992
+ ```ts
1993
+ api.registerCommand({
1994
+ name: "inventory rows",
1995
+ read_output: { row_keys: ["items"] },
1996
+ run: () => ({ items: [{ id: "asset-1", title: "Camera" }], count: 1, total: 1 }),
1997
+ });
1998
+ ```
1999
+
2000
+ The handler must return a structured object. Each declared path must contain
2001
+ an array or object map; paths may be nested, unique and non-overlapping. Use
2002
+ `row_keys: []` for a singleton result. Activation snapshots the declaration,
2003
+ and the host validates the returned collections before projecting them. Avoid
2004
+ reserved metadata and prototype property names. The declaration promises a
2005
+ read-only handler; writers and undeclared commands keep refusing read controls,
2006
+ and native commands/actions retain their existing contracts. A declaration
2007
+ cannot shadow native dispatch; choose a distinct package action.
2008
+
2009
+ Receipts and continuation cursors identify the canonical extension command.
2010
+ Resume with the returned cursor and the same semantic inputs; changed rows
2011
+ refuse stale continuation. A budget that cannot fit useful content returns the
2012
+ shared `output_budget_exceeded` branch, and CLI exits 2. SDK consumers should
2013
+ check `isReadOutputBudgetExceeded` before treating the payload as their result.
2014
+ Packages can describe their own omitted groups with the existing
2015
+ `OutputProjectionDeclaration`; the host also discloses reductions caused by
2016
+ its output controls. JSON and TOON estimates include their receipts.
2017
+
2194
2018
  ```ts
2195
2019
  import { defineExtension } from "@unbrained/pm-cli/sdk";
2196
2020
 
@@ -2839,389 +2663,92 @@ summarizes as empty and lints clean. In a package test, `assertExtensionBlueprin
2839
2663
 
2840
2664
  ## Testing Helpers
2841
2665
 
2842
- Package tests can assert registration contracts without depending on Vitest-specific
2843
- helpers. Every assertion normalizes the expected name, returns the matched registration
2844
- entry, and throws an `Error` that lists what _is_ available when the expectation is
2845
- missing. They are exported from both `@unbrained/pm-cli/sdk/testing` and the main
2846
- `@unbrained/pm-cli/sdk` barrel.
2847
-
2848
- Every named assertion accepts the canonical `{ name: ... }` expectation key.
2849
- The historical surface-specific keys (`command`, `targetCommand`, `provider`,
2850
- `adapter`, `importer`, `exporter`, `field`, `itemType`, `migration`, `profile`,
2851
- `format`, `service`) remain supported aliases for existing packages.
2666
+ Use `@unbrained/pm-cli/sdk/testing` for package assertions and runtime invocation.
2667
+ The aggregate SDK also exports these helpers. Assertions normalize names, return
2668
+ the matched entry, and throw with the available registrations when a match is
2669
+ missing. Named expectations use `{ name }`; historical surface-specific aliases
2670
+ remain supported. Optional `extensionName` limits a match to one extension.
2671
+ The published surface snapshot contains the complete helper signatures.
2852
2672
 
2853
- Activate an in-memory extension module without private loader imports:
2673
+ Prefer `createExtensionTestHarness` when testing a package. Its bound methods
2674
+ select the correct registry, preventing accidental use of a command registry for
2675
+ hooks or services:
2854
2676
 
2855
2677
  ```ts
2856
- import {
2857
- activateExtensionForTest,
2858
- assertRegisteredCommandContract,
2859
- } from "@unbrained/pm-cli/sdk/testing";
2860
-
2861
- const activation = await activateExtensionForTest({
2862
- manifest: {
2863
- name: "hello-ext",
2864
- version: "0.1.0",
2865
- entry: "./index.ts",
2866
- priority: 0,
2867
- capabilities: ["commands", "schema"],
2868
- },
2869
- activate(api) {
2870
- api.registerCommand({
2871
- name: "hello",
2872
- action: "hello",
2873
- description: "Return a deterministic hello payload.",
2874
- flags: [{ long: "--name", value_type: "string" }],
2875
- run: async () => ({ ok: true }),
2876
- });
2877
- },
2878
- });
2879
-
2880
- assertRegisteredCommandContract(activation.registrations, {
2881
- name: "hello",
2882
- action: "hello",
2883
- flags: ["--name"],
2884
- });
2885
- ```
2886
-
2887
- `activateExtensionForTest` uses the real pm activation engine and capability
2888
- guardrails, but it does not discover files or install packages. Use it for unit
2889
- tests of extension registration shape; keep `pm package doctor` and runtime
2890
- contracts in integration tests.
2891
-
2892
- For declarative (`composeExtension`) packages, `assertExtensionBlueprint(blueprint, options?)`
2893
- is the `assert*` family member that preflights the blueprint _without_ activating
2894
- it — it runs `lintExtensionBlueprint` and throws if any finding is error-severity
2895
- (today: a capability a surface exercises but the declared set omits, which would
2896
- fail activation with `extension_capability_missing`). It returns the full
2897
- `ExtensionBlueprintLintResult` on success so a test can still inspect advisory
2898
- warnings:
2899
-
2900
- ```ts
2901
- import { assertExtensionBlueprint } from "@unbrained/pm-cli/sdk/testing";
2902
-
2903
- // Throws if the blueprint and its declared capabilities have drifted; otherwise
2904
- // returns the lint result (including any non-blocking warnings) for inspection.
2905
- const report = assertExtensionBlueprint(blueprint);
2906
- ```
2907
-
2908
- `assertExtensionManifestMatchesBlueprint(manifest, blueprint)` is the **strict**
2909
- bookend to that lenient preflight: where `assertExtensionBlueprint` only fails on
2910
- an _undeclared_ capability and merely warns on an unused one, this assertion fails
2911
- on **both** — so a hand-maintained `manifest.json` stays exactly the least-privilege
2912
- set the blueprint requires (assert what `synthesizeExtensionManifest` would
2913
- otherwise generate). Only `capabilities` are reconciled, since that is the one
2914
- manifest field a blueprint determines:
2915
-
2916
- ```ts
2917
- import { assertExtensionManifestMatchesBlueprint } from "@unbrained/pm-cli/sdk/testing";
2918
-
2919
- // Throws if manifest.capabilities is missing any capability the blueprint uses, or
2920
- // declares any the blueprint never exercises. Returns { used, declared, missing,
2921
- // unused, findings } on an exact match.
2922
- assertExtensionManifestMatchesBlueprint(manifest, blueprint);
2923
- ```
2924
-
2925
- Where the blueprint guards `capabilities`, a manifest's `pm_min_version` /
2926
- `pm_max_version` bounds guard _which pm CLI versions the package supports_.
2927
- Tracker references: `pm-knma` introduced `checkExtensionManifestCompatibility`;
2928
- `pm-hng2` introduced `assertExtensionManifestCompatible`.
2929
- `checkExtensionManifestCompatibility(manifest, { pmVersion, pmMaxVersionExceededMode? })`
2930
- is the author-time inverse of the loader's runtime version gate: it takes the pm
2931
- version you target and returns structured per-bound findings (the same
2932
- `extension_pm_*_version_*` outcomes the loader emits), so you can verify the window
2933
- without installing the package against a real CLI. `assertExtensionManifestCompatible`
2934
- is the throwing CI guard — it fails on a blocking incompatibility (a malformed
2935
- bound, a `pm_min_version` the target is below, or a `block`-mode `pm_max_version`
2936
- the target exceeds) and stays quiet on advisory `*_unchecked` / `*_exceeded_warn`
2937
- warnings, which still load:
2938
-
2939
- Use `lintExtensionManifestSchema(manifest)` when only the manifest vocabulary is
2940
- in scope. It returns stable `manifest_unknown_key` and
2941
- `no_version_bounds_declared` findings without requiring a target pm version.
2942
- Compatibility results retain the existing combined `findings` array, while the
2943
- dedicated lint result gives SDK, CLI, and MCP adapters a stable schema-only
2944
- boundary.
2945
-
2946
- ```ts
2947
- import {
2948
- checkExtensionManifestCompatibility,
2949
- lintExtensionManifestSchema,
2950
- } from "@unbrained/pm-cli/sdk";
2951
- import { assertExtensionManifestCompatible } from "@unbrained/pm-cli/sdk/testing";
2678
+ import { createExtensionTestHarness } from "@unbrained/pm-cli/sdk/testing";
2952
2679
 
2953
- // Inspect every bound outcome against a target version…
2954
- const report = checkExtensionManifestCompatibility(manifest, {
2955
- pmVersion: "2026.6.23",
2680
+ const ext = await createExtensionTestHarness(extensionModule, {
2681
+ capabilities: ["commands", "schema"],
2956
2682
  });
2957
- // report.compatible === false, report.findings[0].code === "pm_min_version_unmet", …
2958
-
2959
- const schema = lintExtensionManifestSchema(manifest);
2960
- // schema.ok === false, schema.findings[0].path === "compatibility", …
2961
-
2962
- // …or fail the package's own suite when a bound would block the load.
2963
- assertExtensionManifestCompatible(manifest, { pmVersion: "2026.6.23" });
2683
+ try {
2684
+ ext.assertCommandContract({ name: "hello", action: "hello", flags: ["--name"] });
2685
+ const invocation = await ext.runCommand({
2686
+ command: "hello", options: { name: "ada" },
2687
+ });
2688
+ // invocation.handled and invocation.result are the real dispatch receipt.
2689
+ } finally {
2690
+ await ext.deactivate();
2691
+ }
2964
2692
  ```
2965
2693
 
2966
- Tracked: [pm-ozaf](../.agents/pm/features/pm-ozaf.toon).
2967
-
2968
- `preflightExtension(blueprint, { identity?, target?, declaredCapabilities? })` is the
2969
- author-time **capstone** that runs all of the above in one call — the static analog
2970
- of `createExtensionTestHarness`, which unified the runtime-test helpers. Rather than
2971
- chaining `lintExtensionBlueprint`, `synthesizeExtensionManifest`, and
2972
- `checkExtensionManifestCompatibility` (and reconciling their separate results)
2973
- before publishing, you read one `ExtensionPreflightReport`: the blueprint is always
2974
- linted; when `identity` is given the complete least-privilege manifest is synthesized
2975
- and returned; when `target` is given the synthesized bounds (or, absent an identity,
2976
- the blueprint's in-module `manifest` mirror) are version-checked. The per-stage
2977
- results are exposed unmodified (`report.blueprint` / `report.manifest` /
2978
- `report.compatibility`) alongside a flattened `report.findings` where each entry is
2979
- tagged by `source` (`"blueprint"` | `"compatibility"`); `report.ok` is `false` if any
2980
- stage produced an `error`. `assertExtensionPreflight(blueprint, options?)` is the
2981
- throwing one-line CI guard over it — it fails listing every blocking finding tagged
2982
- `[source:code]` and stays quiet on advisory warnings, returning the full report on
2983
- success:
2694
+ `activateExtensionForTest` is the lower-level in-memory activation primitive. It
2695
+ uses the real capability guardrails, without filesystem discovery or package
2696
+ installation. Keep `pm package doctor` and runtime contract checks in integration
2697
+ tests: registration shape alone does not prove an install works.
2698
+
2699
+ Author-time checks run without activation:
2700
+
2701
+ - `assertExtensionBlueprint` returns `lintExtensionBlueprint` findings and
2702
+ throws on errors; undeclared capabilities block, while unused capabilities
2703
+ remain advisory.
2704
+ - `assertExtensionManifestMatchesBlueprint` requires the manifest capability
2705
+ set to match exactly, failing for both missing and unused declarations. It
2706
+ reconciles capabilities only, the field the blueprint determines.
2707
+ - `checkExtensionManifestCompatibility` returns per-bound findings against a
2708
+ target `pmVersion`. `assertExtensionManifestCompatible` throws for malformed
2709
+ bounds, an unmet minimum, or a maximum exceeded in block mode; unchecked and
2710
+ exceeded-warning outcomes remain advisory.
2711
+ - `lintExtensionManifestSchema` inspects vocabulary alone, with stable
2712
+ `manifest_unknown_key` and `no_version_bounds_declared` findings.
2713
+ - `preflightExtension` composes blueprint lint, optional identity-based
2714
+ least-privilege manifest synthesis, and optional target compatibility. Its
2715
+ report retains the original stage results plus source-tagged findings.
2716
+ `assertExtensionPreflight` throws for every blocking finding and returns the
2717
+ report otherwise. Without an identity, target checks use the blueprint's
2718
+ manifest mirror.
2984
2719
 
2985
2720
  ```ts
2986
- import { preflightExtension } from "@unbrained/pm-cli/sdk";
2987
2721
  import { assertExtensionPreflight } from "@unbrained/pm-cli/sdk/testing";
2988
2722
 
2989
- // Inspect every author-time stage in one report…
2990
- const report = preflightExtension(blueprint, {
2991
- identity: {
2992
- name: "command-kit",
2993
- version: "1.0.0",
2994
- entry: "./index.ts",
2995
- priority: 0,
2996
- },
2997
- target: { pmVersion: "2026.6.23" },
2998
- });
2999
- // report.manifest.capabilities (derived), report.compatibility.compatible, report.findings[]
3000
-
3001
- // …or guard the whole package in one CI line.
3002
- assertExtensionPreflight(blueprint, {
3003
- identity: {
3004
- name: "command-kit",
3005
- version: "1.0.0",
3006
- entry: "./index.ts",
3007
- priority: 0,
3008
- },
3009
- target: { pmVersion: "2026.6.23" },
3010
- });
3011
- ```
3012
-
3013
- Invoke a registered command handler to assert its behavior (not just that it was
3014
- registered). `runRegisteredCommandForTest` dispatches through pm's real engine and
3015
- returns the `CommandHandlerResult`:
3016
-
3017
- ```ts
3018
- import { runRegisteredCommandForTest } from "@unbrained/pm-cli/sdk/testing";
3019
-
3020
- const invocation = await runRegisteredCommandForTest(activation.commands, {
3021
- command: "hello",
3022
- options: { name: "ada" },
2723
+ const report = assertExtensionPreflight(blueprint, {
2724
+ identity: { name: "command-kit", version: "1.0.0", entry: "./index.ts", priority: 0 },
2725
+ target: { pmVersion: "2026.10.11" },
3023
2726
  });
3024
-
3025
- // invocation.handled === true; invocation.result is the handler's return value.
3026
2727
  ```
3027
2728
 
3028
- Importers and exporters get dedicated name-based helpers so tests never hand-build
3029
- the `"<name> import"` / `"<name> export"` command path. Pass the whole `activation`
3030
- and the registration name:
2729
+ When a custom harness needs individual registries, use this ownership map:
3031
2730
 
3032
- ```ts
3033
- import {
3034
- runRegisteredImporterForTest,
3035
- runRegisteredExporterForTest,
3036
- } from "@unbrained/pm-cli/sdk/testing";
2731
+ | Surface | Registry from `activateExtensionForTest` | Assertion / invocation |
2732
+ | --- | --- | --- |
2733
+ | Commands, schema types/fields, migrations, importers/exporters, search/vector providers | `registrations` | `assertRegisteredCommandContract`, corresponding `assertRegistered*` |
2734
+ | Command overrides | `commands` | `assertRegisteredCommandOverride`, `runRegisteredCommandOverrideForTest` |
2735
+ | Parser overrides | `parsers` | `assertRegisteredParserOverride`, `runRegisteredParserOverrideForTest` |
2736
+ | Preflight overrides | `preflight` | `assertRegisteredPreflightOverride`, `runRegisteredPreflightOverrideForTest` |
2737
+ | Renderers | `renderers` | `assertRegisteredRendererOverride`, `runRegisteredRendererOverrideForTest` |
2738
+ | Services | `services` | `assertRegisteredServiceOverride`, `runRegisteredServiceOverrideForTest` |
2739
+ | Lifecycle hooks | `hooks` | `assertRegisteredHook`, `runRegisteredHookForTest` |
3037
2740
 
3038
- const imported = await runRegisteredImporterForTest(activation, {
3039
- importer: "csv",
3040
- options: { rows: 3 },
3041
- });
3042
- const exported = await runRegisteredExporterForTest(activation, {
3043
- exporter: "csv",
3044
- });
3045
-
3046
- // Both return a CommandHandlerResult: imported.result is the importer's return value.
3047
- ```
3048
-
3049
- Fire a registered lifecycle hook to assert its behavior (the `context` is
3050
- type-safe per `kind`). A clean run returns `[]`; a hook that throws contributes a
3051
- single `extension_hook_failed:*` warning while the others still run:
3052
-
3053
- ```ts
3054
- import { runRegisteredHookForTest } from "@unbrained/pm-cli/sdk/testing";
3055
-
3056
- const warnings = await runRegisteredHookForTest(activation.hooks, {
3057
- kind: "after_command",
3058
- context: { command: "close", args: ["pm-1a2b"], pm_root: "", ok: true },
3059
- });
3060
- // warnings === [] when every after_command hook ran cleanly.
3061
- ```
3062
-
3063
- The override surfaces have parallel invoke helpers that delegate to pm's real
3064
- runners and return the override result verbatim, after guarding that a matching
3065
- override is registered for the target (command / format / service):
3066
-
3067
- ```ts
3068
- import {
3069
- runRegisteredParserOverrideForTest,
3070
- runRegisteredCommandOverrideForTest,
3071
- runRegisteredRendererOverrideForTest,
3072
- runRegisteredServiceOverrideForTest,
3073
- runRegisteredPreflightOverrideForTest,
3074
- } from "@unbrained/pm-cli/sdk/testing";
3075
-
3076
- const parsed = await runRegisteredParserOverrideForTest(activation.parsers, {
3077
- command: "deploy",
3078
- args: ["staging"],
3079
- options: {},
3080
- global: {},
3081
- pm_root: "",
3082
- });
3083
- // parsed.overridden === true; parsed.context holds the rewritten args/options.
3084
-
3085
- const rendered = await runRegisteredRendererOverrideForTest(
3086
- activation.renderers,
3087
- {
3088
- format: "toon",
3089
- result: { id: "pm-1a2b" },
3090
- },
3091
- );
3092
- // rendered.rendered is the custom string the override produced.
3093
- ```
3094
-
3095
- Assert a command registration contract:
3096
-
3097
- ```ts
3098
- import { assertRegisteredCommandContract } from "@unbrained/pm-cli/sdk/testing";
3099
-
3100
- assertRegisteredCommandContract(activation.registrations, {
3101
- name: "hello",
3102
- action: "hello",
3103
- flags: ["--name"],
3104
- });
3105
- ```
3106
-
3107
- Assert importer, exporter, and search-provider registrations against an
3108
- `ExtensionRegistrationRegistry` (from `activation.registrations`). The optional
3109
- `extensionName` narrows the match to a single extension:
3110
-
3111
- ```ts
3112
- import {
3113
- assertRegisteredExporter,
3114
- assertRegisteredImporter,
3115
- assertRegisteredSearchProvider,
3116
- assertRegisteredVectorStoreAdapter,
3117
- } from "@unbrained/pm-cli/sdk/testing";
3118
-
3119
- assertRegisteredImporter(activation.registrations, { name: "jsonl" });
3120
- assertRegisteredExporter(activation.registrations, {
3121
- name: "jsonl",
3122
- extensionName: "my-ext",
3123
- });
3124
- assertRegisteredSearchProvider(activation.registrations, {
3125
- name: "semantic-local",
3126
- });
3127
- assertRegisteredVectorStoreAdapter(activation.registrations, {
3128
- name: "pinecone",
3129
- });
3130
- ```
3131
-
3132
- Use `assertRegisteredVectorStoreAdapter` for packages that call
3133
- `registerVectorStoreAdapter`. It proves the semantic-storage integration is
3134
- present without importing private registry internals or configuring a live
3135
- vector store in unit tests.
3136
-
3137
- Assert package-owned schema registrations the same way. This lets packages prove
3138
- their custom project-management primitives without importing private registry
3139
- types or reading generated schema files:
3140
-
3141
- ```ts
3142
- import {
3143
- assertRegisteredItemField,
3144
- assertRegisteredItemType,
3145
- } from "@unbrained/pm-cli/sdk/testing";
3146
-
3147
- assertRegisteredItemField(activation.registrations, {
3148
- name: "severity",
3149
- extensionName: "incident-ext",
3150
- type: "string",
3151
- });
3152
- assertRegisteredItemType(activation.registrations, {
3153
- name: "Incident",
3154
- folder: "incidents",
3155
- });
3156
- ```
3157
-
3158
- Hooks are surfaced via `activation.hooks` (an `ExtensionHookRegistry`), not the command
3159
- registry, so `assertRegisteredHook` takes the hook registry and a lifecycle `kind`
3160
- (`before_command` | `after_command` | `on_read` | `on_write` | `on_index`):
3161
-
3162
- ```ts
3163
- import { assertRegisteredHook } from "@unbrained/pm-cli/sdk/testing";
3164
-
3165
- const hook = assertRegisteredHook(activation.hooks, {
3166
- kind: "on_write",
3167
- extensionName: "my-ext",
3168
- });
3169
- // hook.run is the registered OnWriteHook handler
3170
- ```
3171
-
3172
- Override registrations from `registerCommand(command, override)`, `registerParser`,
3173
- `registerPreflight`, and `registerRenderer` live on `activation.commands`,
3174
- `activation.parsers`, `activation.preflight`, and `activation.renderers` (not the
3175
- registration registry). Each override helper takes the matching registry and
3176
- returns the registered entry (so you can invoke `entry.run` directly):
3177
-
3178
- ```ts
3179
- import {
3180
- assertRegisteredCommandOverride,
3181
- assertRegisteredParserOverride,
3182
- assertRegisteredPreflightOverride,
3183
- assertRegisteredRendererOverride,
3184
- } from "@unbrained/pm-cli/sdk/testing";
3185
-
3186
- assertRegisteredCommandOverride(activation.commands, { name: "list" });
3187
- assertRegisteredParserOverride(activation.parsers, {
3188
- name: "list",
3189
- extensionName: "my-ext",
3190
- });
3191
- assertRegisteredPreflightOverride(activation.preflight); // preflight overrides are global (no command)
3192
- assertRegisteredRendererOverride(activation.renderers, { name: "toon" });
3193
- ```
3194
-
3195
- Service overrides from `registerService(service, override)` live on
3196
- `activation.services` (an `ExtensionServiceRegistry`), so
3197
- `assertRegisteredServiceOverride` takes the service registry and a known service
3198
- name (`output_format` | `error_format` | `help_format` | `lock_acquire` |
3199
- `lock_release` | `history_append` | `item_store_write` | `item_store_delete`):
3200
-
3201
- ```ts
3202
- import { assertRegisteredServiceOverride } from "@unbrained/pm-cli/sdk/testing";
3203
-
3204
- const service = assertRegisteredServiceOverride(activation.services, {
3205
- name: "output_format",
3206
- extensionName: "my-ext",
3207
- });
3208
- // service.run is the registered ServiceOverride handler
3209
- ```
3210
-
3211
- Schema migrations from `registerMigration(definition)` live on
3212
- `activation.registrations.migrations`. `assertRegisteredMigration` matches by the
3213
- migration `id` and can additionally assert the `mandatory` governance flag (an
3214
- unset flag is treated as non-mandatory):
3215
-
3216
- ```ts
3217
- import { assertRegisteredMigration } from "@unbrained/pm-cli/sdk/testing";
3218
-
3219
- const migration = assertRegisteredMigration(activation.registrations, {
3220
- name: "backfill-severity",
3221
- mandatory: true,
3222
- });
3223
- // migration.definition is the normalized SchemaMigrationDefinition
3224
- ```
2741
+ `runRegisteredCommandForTest` uses the real dispatcher and returns
2742
+ `CommandHandlerResult`. Importer/exporter invocation helpers accept the whole
2743
+ activation plus a registration name, constructing the command path themselves.
2744
+ Override invocation helpers first require a matching registration, then return
2745
+ the real runner result. Hook expectations use lifecycle `kind`; a clean hook run
2746
+ returns no warnings, while a thrown hook contributes `extension_hook_failed:*`
2747
+ and other hooks continue. Preflight overrides are global. Renderer expectations
2748
+ use format and service expectations use a supported service name.
2749
+ `assertRegisteredMigration` matches migration id and can require `mandatory`;
2750
+ an unset flag is non-mandatory. Schema and vector-adapter assertions prove
2751
+ registrations without private imports, generated schema reads or live services.
3225
2752
 
3226
2753
  ### Project profiles (`registerProfile`)
3227
2754
 
@@ -3559,6 +3086,7 @@ For SDK and automation consumers, the key runtime change is the optional `recove
3559
3086
  - `candidate_commands_total`
3560
3087
  - `candidate_commands_truncated`
3561
3088
  - `suggested_retry`
3089
+ - `suggested_retry_args` (pass these argument tokens to the `pm` executable instead of reparsing display text)
3562
3090
 
3563
3091
  Treat `recovery.suggested_retry` as the first-choice deterministic replay
3564
3092
  command when present. Generic missing-option retries preserve every original
@@ -3583,6 +3111,45 @@ contract-discovery hints, not permission to change the requested operation.
3583
3111
  Unknown positional subcommands expose the complete `allowed_values` vocabulary
3584
3112
  and use `suggested_retry` only when a deterministic nearby value exists.
3585
3113
 
3114
+ Tracked by [pm-f05lsg](../.agents/pm/features/pm-f05lsg.toon) and
3115
+ [pm-test-measure-prerequisite](../.agents/pm/issues/pm-test-measure-prerequisite.toon):
3116
+ `resolveMisnestedCommandPath` derives a canonical path from the installed command
3117
+ registry only when an exact suffix under a known namespace has one owner. For
3118
+ example, `pm item update` remains refused and suggests `pm update --help`.
3119
+ Nested refusals retain every registered namespace segment and prefer the longest
3120
+ matching suffix. A shorter suffix is considered only across registered prefixes;
3121
+ an ambiguous longer match never falls back to a guessed shorter command.
3122
+ Inspection does not execute the guessed mutation, and ambiguous or unavailable
3123
+ extension routes receive the usual bounded discovery guidance.
3124
+ Canonical help retry arguments and the first displayed example retain an
3125
+ explicitly selected `--pm-path` and `--no-extensions`, so inspection uses the same
3126
+ tracker and extension policy from any working directory.
3127
+ In-process callers of `runPmCli(args)` do not need to replace `process.argv`:
3128
+ usage and help recovery use the supplied invocation for command selection,
3129
+ tracker scope, extension policy and both text and JSON formatting.
3130
+
3131
+ `runTest(id, { measure: [...] }, global)` requires `run: true`. A missing run
3132
+ returns `test_measure_requires_run` before linked-test mutation, with an executable
3133
+ retry retaining the tracker, measurements, selectors, runtime directives, and
3134
+ explicit actor. It adds no ownership or trust override. When the request also
3135
+ acknowledges trust, recovery opens help and supplies `next_steps`: review the linked
3136
+ commands, acknowledge them in a separate non-executing operation, then run the
3137
+ measurement without the acknowledgement flag. Foreground and background requests
3138
+ use the same prerequisite guard; background recovery retains `--background`.
3139
+ Package authors can call the exported `assertTestMeasurementRun(id, options,
3140
+ global, resolvedPmRoot, background?)` before dispatching their own linked-test
3141
+ runner. It validates only this prerequisite and performs no I/O; `runTest` applies
3142
+ the guard automatically before other execution and trust validation.
3143
+
3144
+ `runTest` also verifies execution before recording measurements. Empty or entirely
3145
+ skipped results, pre-execution refusals, failed process creation and recognised
3146
+ empty test-runner output return `test_measure_requires_execution` with a scoped
3147
+ read-only list retry. Empty summaries in either output stream refuse even when
3148
+ the command exits unsuccessfully, preserving stored measurements and history.
3149
+ A mixed run with an executed command can retain measurements;
3150
+ an executed failing command records a failed run alongside its measurements.
3151
+ Requested link edits remain separate from the resulting measurement evidence.
3152
+
3586
3153
  ## Authoring Pattern
3587
3154
 
3588
3155
  - Keep handlers deterministic and JSON-like.