@unbrained/pm-cli 2026.10.3 → 2026.10.5

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 (742) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +28 -2
  3. package/dist/cli/after-command-context-usage.js +1 -1
  4. package/dist/cli/argv-utils.js +1 -1
  5. package/dist/cli/bootstrap-args.js +1 -1
  6. package/dist/cli/bundle-integrity.js +2 -2
  7. package/dist/cli/command-namespaces.js +1 -1
  8. package/dist/cli/commander-usage.d.ts +1 -1
  9. package/dist/cli/commander-usage.js +7 -4
  10. package/dist/cli/commands/annotations/comments.js +1 -1
  11. package/dist/cli/commands/annotations/docs.js +1 -1
  12. package/dist/cli/commands/annotations/files.js +1 -1
  13. package/dist/cli/commands/annotations/learnings.js +1 -1
  14. package/dist/cli/commands/annotations/notes.js +1 -1
  15. package/dist/cli/commands/extension/describe.js +1 -1
  16. package/dist/cli/commands/extension/extension.js +1 -1
  17. package/dist/cli/commands/extension/scaffold.js +1 -1
  18. package/dist/cli/commands/extension/shared.js +1 -1
  19. package/dist/cli/commands/governance/gc.js +1 -1
  20. package/dist/cli/commands/governance/health.js +1 -1
  21. package/dist/cli/commands/governance/telemetry.js +1 -1
  22. package/dist/cli/commands/governance/validate.js +1 -1
  23. package/dist/cli/commands/history/activity.js +1 -1
  24. package/dist/cli/commands/history/history-compact.js +1 -1
  25. package/dist/cli/commands/history/history-redact.js +1 -1
  26. package/dist/cli/commands/history/history-repair.js +1 -1
  27. package/dist/cli/commands/history/history.js +1 -1
  28. package/dist/cli/commands/history/restore.js +1 -1
  29. package/dist/cli/commands/lifecycle/append.js +1 -1
  30. package/dist/cli/commands/lifecycle/claim.js +1 -1
  31. package/dist/cli/commands/lifecycle/close-many.js +1 -1
  32. package/dist/cli/commands/lifecycle/close.js +1 -1
  33. package/dist/cli/commands/lifecycle/copy.js +1 -1
  34. package/dist/cli/commands/lifecycle/create.js +1 -1
  35. package/dist/cli/commands/lifecycle/delete.js +1 -1
  36. package/dist/cli/commands/lifecycle/focus.js +1 -1
  37. package/dist/cli/commands/lifecycle/plan.js +1 -1
  38. package/dist/cli/commands/lifecycle/update-many.js +1 -1
  39. package/dist/cli/commands/lifecycle/update.js +1 -1
  40. package/dist/cli/commands/query/aggregate.js +1 -1
  41. package/dist/cli/commands/query/context.js +1 -1
  42. package/dist/cli/commands/query/deps.js +1 -1
  43. package/dist/cli/commands/query/duplicates.js +1 -1
  44. package/dist/cli/commands/query/eval.js +1 -1
  45. package/dist/cli/commands/query/get.js +1 -1
  46. package/dist/cli/commands/query/graph.js +1 -1
  47. package/dist/cli/commands/query/list.js +1 -1
  48. package/dist/cli/commands/query/next.js +1 -1
  49. package/dist/cli/commands/query/search.js +1 -1
  50. package/dist/cli/commands/query/stats.js +1 -1
  51. package/dist/cli/commands/test/test-all.js +1 -1
  52. package/dist/cli/commands/test/test-runs.js +1 -1
  53. package/dist/cli/commands/test/test.js +1 -1
  54. package/dist/cli/commands/workspace/config.js +1 -1
  55. package/dist/cli/commands/workspace/contracts.js +1 -1
  56. package/dist/cli/commands/workspace/init.js +1 -1
  57. package/dist/cli/commands/workspace/merge.js +1 -1
  58. package/dist/cli/commands/workspace/profile.js +1 -1
  59. package/dist/cli/commands/workspace/schema.js +1 -1
  60. package/dist/cli/commands/workspace/upgrade.js +1 -1
  61. package/dist/cli/context-intent-invocation.js +1 -1
  62. package/dist/cli/description-stdin.js +1 -1
  63. package/dist/cli/error-guidance.js +3 -1
  64. package/dist/cli/extension-command-help.js +5 -3
  65. package/dist/cli/extension-command-options.js +1 -1
  66. package/dist/cli/extension-recovery.js +1 -1
  67. package/dist/cli/help-content.js +5 -2
  68. package/dist/cli/help-json-payload.js +6 -3
  69. package/dist/cli/invocation-profile.js +2 -2
  70. package/dist/cli/main.js +5 -5
  71. package/dist/cli/migration-gates.js +1 -1
  72. package/dist/cli/option-values.js +1 -1
  73. package/dist/cli/public.js +1 -1
  74. package/dist/cli/register-annotations.js +1 -1
  75. package/dist/cli/register-assurance.js +1 -1
  76. package/dist/cli/register-files-lookup.js +1 -1
  77. package/dist/cli/register-history-activity.js +1 -1
  78. package/dist/cli/register-history-author.js +1 -1
  79. package/dist/cli/register-history-maintenance.js +2 -2
  80. package/dist/cli/register-list-query.js +10 -10
  81. package/dist/cli/register-mutation-options.js +1 -1
  82. package/dist/cli/register-mutation.js +2 -2
  83. package/dist/cli/register-operations.js +1 -1
  84. package/dist/cli/register-setup.js +1 -1
  85. package/dist/cli/register-structured-mutation.js +1 -1
  86. package/dist/cli/registration-helpers.js +1 -1
  87. package/dist/cli/runtime/activation.js +1 -1
  88. package/dist/cli/runtime/invocation-options.js +1 -1
  89. package/dist/cli/runtime/projection-retry.js +1 -1
  90. package/dist/cli/runtime/selection.js +1 -1
  91. package/dist/cli/runtime/telemetry-outcome.js +1 -1
  92. package/dist/cli/runtime-compatibility-boundary.d.ts +1 -1
  93. package/dist/cli/runtime-compatibility-boundary.js +4 -4
  94. package/dist/cli/schema/registration.js +2 -2
  95. package/dist/cli/schema-registration-helpers.js +1 -1
  96. package/dist/cli/search-refresh.js +1 -1
  97. package/dist/cli/stats-analytics-json.js +1 -1
  98. package/dist/cli/telemetry-flush.js +1 -1
  99. package/dist/cli-bundle/bundle-manifest.json +162 -162
  100. package/dist/cli-bundle/chunks/chunk-3CYOBJUK.js +3 -0
  101. package/dist/cli-bundle/chunks/chunk-5MNOWZPN.js +3 -0
  102. package/dist/cli-bundle/chunks/chunk-AJ7H6XUF.js +20 -0
  103. package/dist/cli-bundle/chunks/chunk-D332RXZ7.js +80 -0
  104. package/dist/cli-bundle/chunks/chunk-HRJ6G6ZG.js +31 -0
  105. package/dist/cli-bundle/chunks/chunk-KRVI56QE.js +6 -0
  106. package/dist/cli-bundle/chunks/chunk-N4YGSG6F.js +238 -0
  107. package/dist/cli-bundle/chunks/chunk-OOLYASYJ.js +2 -0
  108. package/dist/cli-bundle/chunks/chunk-R7CG2DB7.js +2 -0
  109. package/dist/cli-bundle/chunks/chunk-TGMONGWX.js +2 -0
  110. package/dist/cli-bundle/chunks/chunk-UZ7BIUCI.js +2 -0
  111. package/dist/cli-bundle/chunks/{chunk-44UGMMQ6.js → chunk-VZ63DEVJ.js} +3 -3
  112. package/dist/cli-bundle/chunks/chunk-WFZ4UEOB.js +2 -0
  113. package/dist/cli-bundle/chunks/chunk-YVBRASXO.js +8 -0
  114. package/dist/cli-bundle/chunks/{chunk-5XKF5SQV.js → chunk-Z66DWDAU.js} +91 -91
  115. package/dist/cli-bundle/chunks/{register-list-query-DYCGUQEW.js → register-list-query-75QXHIFH.js} +11 -11
  116. package/dist/cli-bundle/chunks/register-mutation-YS54SCHG.js +20 -0
  117. package/dist/cli-bundle/chunks/register-operations-6KHZQSYJ.js +2 -0
  118. package/dist/cli-bundle/chunks/register-setup-RTATEN2M.js +2 -0
  119. package/dist/cli-bundle/focused-chunks/{chunk-3BIYG72P.js → chunk-2CVX3KR3.js} +2 -2
  120. package/dist/cli-bundle/focused-chunks/chunk-5C3IDDW7.js +2 -0
  121. package/dist/cli-bundle/focused-chunks/{chunk-DBD4W4QP.js → chunk-ABV67XCC.js} +3 -3
  122. package/dist/cli-bundle/focused-chunks/chunk-B5RSLVE6.js +3 -0
  123. package/dist/cli-bundle/focused-chunks/chunk-C224METM.js +20 -0
  124. package/dist/cli-bundle/focused-chunks/chunk-CLDPTMQY.js +6 -0
  125. package/dist/cli-bundle/focused-chunks/chunk-DDRN42PB.js +8 -0
  126. package/dist/cli-bundle/focused-chunks/{chunk-EJN7DY3B.js → chunk-DOVTUKJQ.js} +2 -2
  127. package/dist/cli-bundle/focused-chunks/chunk-ECBOPEJE.js +75 -0
  128. package/dist/cli-bundle/focused-chunks/chunk-GITOYRUW.js +165 -0
  129. package/dist/cli-bundle/focused-chunks/chunk-GUIF3WVC.js +30 -0
  130. package/dist/cli-bundle/focused-chunks/chunk-LE4JUCRR.js +3 -0
  131. package/dist/cli-bundle/focused-chunks/{chunk-HFAW3FJQ.js → chunk-PSXFFQFT.js} +2 -2
  132. package/dist/cli-bundle/focused-chunks/chunk-RHIH6XIW.js +12 -0
  133. package/dist/cli-bundle/focused-chunks/chunk-UDYRVBOZ.js +2 -0
  134. package/dist/cli-bundle/focused-chunks/chunk-XV5RV4ZT.js +2 -0
  135. package/dist/cli-bundle/focused-chunks/{chunk-XRSCIYHR.js → chunk-YMU42COG.js} +2 -2
  136. package/dist/cli-bundle/main.js +28 -28
  137. package/dist/cli-bundle/sdk-authoring.js +1 -1
  138. package/dist/cli-bundle/sdk-contracts.js +2 -2
  139. package/dist/cli-bundle/sdk-core.js +32 -32
  140. package/dist/cli-bundle/sdk-governance.js +1 -1
  141. package/dist/cli-bundle/sdk-graph.js +1 -1
  142. package/dist/cli-bundle/sdk-merge.js +55 -55
  143. package/dist/cli-bundle/sdk-query.js +1 -1
  144. package/dist/cli-bundle/sdk-runtime.js +1 -1
  145. package/dist/cli-bundle/sdk-testing.js +1 -1
  146. package/dist/cli-bundle/sdk.js +10 -10
  147. package/dist/cli.js +1 -1
  148. package/dist/core/checkpoint/checkpoint-gc.js +1 -1
  149. package/dist/core/checkpoint/mutation-checkpoint.js +2 -2
  150. package/dist/core/config/nested-settings.js +1 -1
  151. package/dist/core/config/positional-value.js +1 -1
  152. package/dist/core/diagnostics/remediation.js +1 -1
  153. package/dist/core/extensions/activation-summary-markdown.js +2 -1
  154. package/dist/core/extensions/activation-summary.js +1 -1
  155. package/dist/core/extensions/activation-transaction.js +1 -1
  156. package/dist/core/extensions/capability-usage.js +1 -1
  157. package/dist/core/extensions/command-hook-context.js +1 -1
  158. package/dist/core/extensions/command-metadata-contract.js +1 -1
  159. package/dist/core/extensions/command-visibility-tier.js +1 -1
  160. package/dist/core/extensions/contribution-inventory.js +1 -1
  161. package/dist/core/extensions/exporter-output-contract.js +1 -1
  162. package/dist/core/extensions/extension-candidate.js +1 -1
  163. package/dist/core/extensions/extension-capability-aliases.js +1 -1
  164. package/dist/core/extensions/extension-hook-runtime.js +1 -1
  165. package/dist/core/extensions/extension-policy.js +1 -1
  166. package/dist/core/extensions/extension-registries.js +1 -1
  167. package/dist/core/extensions/extension-runtime-helpers.js +1 -1
  168. package/dist/core/extensions/extension-types.d.ts +8 -1
  169. package/dist/core/extensions/extension-types.js +1 -1
  170. package/dist/core/extensions/flag-definition-validation.js +1 -1
  171. package/dist/core/extensions/flag-value-types.js +1 -1
  172. package/dist/core/extensions/index.js +1 -1
  173. package/dist/core/extensions/item-field-types.js +1 -1
  174. package/dist/core/extensions/item-fields.js +1 -1
  175. package/dist/core/extensions/loader.js +1 -1
  176. package/dist/core/extensions/manifest-parser.js +1 -1
  177. package/dist/core/extensions/manifest-schema.js +1 -1
  178. package/dist/core/extensions/module-graph-snapshot.js +1 -1
  179. package/dist/core/extensions/preflight-ownership.js +1 -1
  180. package/dist/core/extensions/registration-contracts.js +1 -1
  181. package/dist/core/extensions/registration-validation.js +1 -1
  182. package/dist/core/extensions/registration-values.js +1 -1
  183. package/dist/core/extensions/reserved-host-flags.js +1 -1
  184. package/dist/core/extensions/runtime-registrations.js +1 -1
  185. package/dist/core/extensions/service-ownership.js +1 -1
  186. package/dist/core/extensions/version-compat.js +1 -1
  187. package/dist/core/fs/atomic-create.js +1 -1
  188. package/dist/core/fs/fs-utils.js +2 -2
  189. package/dist/core/fs/host-environment-errors.js +1 -1
  190. package/dist/core/fs/index.js +1 -1
  191. package/dist/core/fs/path-utils.js +1 -1
  192. package/dist/core/governance/content-fields.js +1 -1
  193. package/dist/core/governance/issue-codes.js +1 -1
  194. package/dist/core/governance/metadata-coverage.js +1 -1
  195. package/dist/core/history/digest.js +1 -1
  196. package/dist/core/history/drift-cache.js +3 -3
  197. package/dist/core/history/drift-scan.d.ts +4 -0
  198. package/dist/core/history/drift-scan.js +1 -1
  199. package/dist/core/history/event-classification.js +1 -1
  200. package/dist/core/history/event-index.js +8 -7
  201. package/dist/core/history/history-compact-bulk.js +1 -1
  202. package/dist/core/history/history-diff.js +1 -1
  203. package/dist/core/history/history-rewrite.js +1 -1
  204. package/dist/core/history/history-storage-stats.js +1 -1
  205. package/dist/core/history/history-stream-policy.js +1 -1
  206. package/dist/core/history/history.js +2 -2
  207. package/dist/core/history/identity.js +1 -1
  208. package/dist/core/history/index.js +1 -1
  209. package/dist/core/history/operation-contract.js +1 -1
  210. package/dist/core/history/projection.js +1 -1
  211. package/dist/core/history/read.js +1 -1
  212. package/dist/core/history/replay.js +2 -1
  213. package/dist/core/history/tombstone.js +1 -1
  214. package/dist/core/history/version-address.js +1 -1
  215. package/dist/core/history/workspace-history.js +2 -2
  216. package/dist/core/io/body-file.js +1 -1
  217. package/dist/core/io/bulk-ids-input.js +2 -1
  218. package/dist/core/item/actionability.js +1 -1
  219. package/dist/core/item/dependency-reference.js +1 -1
  220. package/dist/core/item/id.js +1 -1
  221. package/dist/core/item/index.js +1 -1
  222. package/dist/core/item/item-format-version.js +1 -1
  223. package/dist/core/item/item-format.js +6 -4
  224. package/dist/core/item/item-record.js +1 -1
  225. package/dist/core/item/item-type-definition.js +1 -1
  226. package/dist/core/item/parent-reference-policy.js +1 -1
  227. package/dist/core/item/parse.js +8 -2
  228. package/dist/core/item/plan-lifecycle.js +1 -1
  229. package/dist/core/item/priority.js +1 -1
  230. package/dist/core/item/sprint-release-format.js +1 -1
  231. package/dist/core/item/status-filter.js +1 -1
  232. package/dist/core/item/status.js +1 -1
  233. package/dist/core/item/toon-decode.js +1 -1
  234. package/dist/core/item/type-registry.js +1 -1
  235. package/dist/core/item/type-synonyms.js +1 -1
  236. package/dist/core/lock/index.js +1 -1
  237. package/dist/core/lock/lock-gc.js +1 -1
  238. package/dist/core/lock/lock.js +3 -3
  239. package/dist/core/output/mutation-projection.js +1 -1
  240. package/dist/core/output/output-control.js +1 -1
  241. package/dist/core/output/output.js +22 -10
  242. package/dist/core/output/query-summary.js +1 -1
  243. package/dist/core/output/tabular.js +3 -1
  244. package/dist/core/packages/manifest.js +1 -1
  245. package/dist/core/packages/root.js +1 -1
  246. package/dist/core/policy/workflow-policy-schema.js +1 -1
  247. package/dist/core/policy/workflow-policy-store.js +1 -1
  248. package/dist/core/policy/workflow-policy.js +1 -1
  249. package/dist/core/profile/profile-describe.js +1 -1
  250. package/dist/core/profile/profile-lint.js +1 -1
  251. package/dist/core/profile/profile-plan.js +1 -1
  252. package/dist/core/profile/profile-presets.js +25 -1
  253. package/dist/core/reproducibility/context.js +1 -1
  254. package/dist/core/schema/fields-file.js +2 -2
  255. package/dist/core/schema/item-types-file.js +2 -2
  256. package/dist/core/schema/runtime-field-filters.js +1 -1
  257. package/dist/core/schema/runtime-field-values.js +1 -1
  258. package/dist/core/schema/runtime-schema.js +2 -2
  259. package/dist/core/schema/status-defs-file.js +2 -2
  260. package/dist/core/schema/status-token.js +1 -1
  261. package/dist/core/schema/type-inference.js +1 -1
  262. package/dist/core/schema/type-presets.js +1 -1
  263. package/dist/core/schema/type-workflows.js +1 -1
  264. package/dist/core/search/background-refresh.js +2 -2
  265. package/dist/core/search/bm25.js +1 -1
  266. package/dist/core/search/cache.js +2 -2
  267. package/dist/core/search/corpus.js +1 -1
  268. package/dist/core/search/embedding-batches.js +1 -1
  269. package/dist/core/search/eval-thresholds.js +1 -1
  270. package/dist/core/search/eval.js +1 -1
  271. package/dist/core/search/http-client.js +1 -1
  272. package/dist/core/search/providers.js +1 -1
  273. package/dist/core/search/relevance.js +1 -1
  274. package/dist/core/search/semantic-defaults.js +1 -1
  275. package/dist/core/search/staleness.js +1 -1
  276. package/dist/core/search/vector-stores.js +2 -2
  277. package/dist/core/search/vectorization-metadata.js +1 -1
  278. package/dist/core/sentry/helpers.js +1 -1
  279. package/dist/core/sentry/instrument.js +1 -1
  280. package/dist/core/session/session-state.js +1 -1
  281. package/dist/core/shared/agent-session-context.js +1 -1
  282. package/dist/core/shared/author.js +5 -1
  283. package/dist/core/shared/command-line.js +1 -1
  284. package/dist/core/shared/command-types.js +1 -1
  285. package/dist/core/shared/conflict-markers.js +1 -1
  286. package/dist/core/shared/constants.js +1 -1
  287. package/dist/core/shared/errors.js +1 -1
  288. package/dist/core/shared/html-entity-decode.js +1 -1
  289. package/dist/core/shared/index.js +1 -1
  290. package/dist/core/shared/item-metadata-contract.js +1 -1
  291. package/dist/core/shared/lazy-module.js +1 -1
  292. package/dist/core/shared/levenshtein.js +1 -1
  293. package/dist/core/shared/memo.js +1 -1
  294. package/dist/core/shared/numeric-parsers.js +1 -1
  295. package/dist/core/shared/option-alias-visibility.js +1 -1
  296. package/dist/core/shared/primitives.js +1 -1
  297. package/dist/core/shared/secret-rules.js +1 -1
  298. package/dist/core/shared/serial-queue.js +1 -1
  299. package/dist/core/shared/serialization.js +1 -1
  300. package/dist/core/shared/split-comma-list.js +1 -1
  301. package/dist/core/shared/text-normalization.js +1 -1
  302. package/dist/core/shared/time.js +2 -1
  303. package/dist/core/store/index.js +1 -1
  304. package/dist/core/store/item-format-migration.js +1 -1
  305. package/dist/core/store/item-metadata-cache.js +1 -1
  306. package/dist/core/store/item-metadata-query-index.js +7 -7
  307. package/dist/core/store/item-metadata-read-work.js +1 -1
  308. package/dist/core/store/item-store.js +1 -1
  309. package/dist/core/store/paths.js +1 -1
  310. package/dist/core/store/settings-concurrency.js +1 -1
  311. package/dist/core/store/settings-read-cache.js +1 -1
  312. package/dist/core/store/settings-validator.js +1 -1
  313. package/dist/core/store/settings.d.ts +11 -2
  314. package/dist/core/store/settings.js +3 -3
  315. package/dist/core/store/tracker-preflight.js +1 -1
  316. package/dist/core/telemetry/consent.js +2 -2
  317. package/dist/core/telemetry/observability.js +1 -1
  318. package/dist/core/telemetry/policy.js +1 -1
  319. package/dist/core/telemetry/read-sampling.js +2 -2
  320. package/dist/core/telemetry/runtime.js +9 -5
  321. package/dist/core/test/background-runs.js +3 -3
  322. package/dist/core/test/item-test-run-tracking.js +1 -1
  323. package/dist/core/test/run-selectors.js +1 -1
  324. package/dist/core/validate/estimate-defaults.js +1 -1
  325. package/dist/core/validate/fix-planning.js +1 -1
  326. package/dist/core/validate/linked-artifact-reference.js +1 -1
  327. package/dist/core/validate/missing-by-type.js +1 -1
  328. package/dist/core/validate/missing-link-owners.js +1 -1
  329. package/dist/core/validate/stale-file-classification.js +1 -1
  330. package/dist/mcp/http-server.js +6 -4
  331. package/dist/mcp/legacy-adapter.js +1 -1
  332. package/dist/mcp/runtime-capabilities.js +1 -1
  333. package/dist/mcp/server.js +4 -4
  334. package/dist/mcp/tool-definitions.js +1 -1
  335. package/dist/sdk/actionability.js +1 -1
  336. package/dist/sdk/agent/closed-domain-contracts.js +1 -1
  337. package/dist/sdk/agent/command-recovery.js +1 -1
  338. package/dist/sdk/agent/command-suggestions.js +1 -1
  339. package/dist/sdk/agent/create-option-policy.js +1 -1
  340. package/dist/sdk/agent/identity-config.js +1 -1
  341. package/dist/sdk/agent/item-addressing.js +1 -1
  342. package/dist/sdk/agent/refusal-closure-census.js +2 -1
  343. package/dist/sdk/agent/refusal-closure.js +1 -1
  344. package/dist/sdk/agent/refusal-corpus-contracts.js +1 -1
  345. package/dist/sdk/agent/refusal-reachability.js +3 -1
  346. package/dist/sdk/agent/subcommand-recovery.js +1 -1
  347. package/dist/sdk/agent/task-transcript-contracts.js +1 -1
  348. package/dist/sdk/agent/tracker-preflight-contracts.js +1 -1
  349. package/dist/sdk/agent-capability-contracts.js +3 -1
  350. package/dist/sdk/agent-session-context.js +1 -1
  351. package/dist/sdk/annotations.js +1 -1
  352. package/dist/sdk/author-attribution.js +1 -1
  353. package/dist/sdk/authoring.js +1 -1
  354. package/dist/sdk/cli-bootstrap.js +1 -1
  355. package/dist/sdk/cli-contracts/agent-output-contracts.js +5 -3
  356. package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +1 -1
  357. package/dist/sdk/cli-contracts/command-aliases.js +1 -1
  358. package/dist/sdk/cli-contracts/command-exit-contracts.js +1 -1
  359. package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
  360. package/dist/sdk/cli-contracts/commander-types.js +1 -1
  361. package/dist/sdk/cli-contracts/completeness.js +1 -1
  362. package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
  363. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  364. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +2 -1
  365. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
  366. package/dist/sdk/cli-contracts/registration-helpers.js +7 -7
  367. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  368. package/dist/sdk/cli-contracts/schemas/assurance-definition.js +1 -1
  369. package/dist/sdk/cli-contracts/string-lists.js +1 -1
  370. package/dist/sdk/cli-contracts/tool-option-contracts.js +1 -1
  371. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  372. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  373. package/dist/sdk/cli-contracts/typed-action-inputs.js +1 -1
  374. package/dist/sdk/cli-contracts.js +1 -1
  375. package/dist/sdk/cli-program.js +1 -1
  376. package/dist/sdk/command-line.js +1 -1
  377. package/dist/sdk/comments.js +1 -1
  378. package/dist/sdk/compile-cache.js +1 -1
  379. package/dist/sdk/completion/bash.js +2 -1
  380. package/dist/sdk/completion/fish.js +13 -7
  381. package/dist/sdk/completion/shared.js +1 -1
  382. package/dist/sdk/completion/zsh.js +14 -8
  383. package/dist/sdk/completion.js +1 -1
  384. package/dist/sdk/compose.js +1 -1
  385. package/dist/sdk/config.js +1 -1
  386. package/dist/sdk/context/recency.js +1 -1
  387. package/dist/sdk/context/semantic-session-attribution.js +1 -1
  388. package/dist/sdk/context/usage-egress.js +1 -1
  389. package/dist/sdk/context/usage-ledger.js +6 -3
  390. package/dist/sdk/context-intent-contracts.js +1 -1
  391. package/dist/sdk/context-intent-runtime.js +1 -1
  392. package/dist/sdk/context-packing.js +1 -1
  393. package/dist/sdk/context-relevance.js +1 -1
  394. package/dist/sdk/context-signal-store.js +2 -2
  395. package/dist/sdk/context-usage.js +1 -1
  396. package/dist/sdk/contracts.js +1 -1
  397. package/dist/sdk/core-governance.js +1 -1
  398. package/dist/sdk/core.js +1 -1
  399. package/dist/sdk/corpus-shape.js +1 -1
  400. package/dist/sdk/define.js +1 -1
  401. package/dist/sdk/dependencies.js +1 -1
  402. package/dist/sdk/dependency-flag-validation.js +1 -1
  403. package/dist/sdk/dependency-provenance.js +1 -1
  404. package/dist/sdk/docs.js +1 -1
  405. package/dist/sdk/duplicates.js +1 -1
  406. package/dist/sdk/environment/agent-environment.js +1 -1
  407. package/dist/sdk/environment/host-environment-errors.js +1 -1
  408. package/dist/sdk/environment/project-runtime-compatibility.js +2 -1
  409. package/dist/sdk/environment/source-context.js +1 -1
  410. package/dist/sdk/environment/tracker-preflight.js +1 -1
  411. package/dist/sdk/error-code-catalog.js +1 -1
  412. package/dist/sdk/error-runtime.js +1 -1
  413. package/dist/sdk/errors.js +1 -1
  414. package/dist/sdk/eval.js +1 -1
  415. package/dist/sdk/extension/author-manifest.js +1 -1
  416. package/dist/sdk/extension/bundled-catalog.js +1 -1
  417. package/dist/sdk/extension/concurrency.js +1 -1
  418. package/dist/sdk/extension/copy-scope.js +1 -1
  419. package/dist/sdk/extension/custom-field-collisions.js +1 -1
  420. package/dist/sdk/extension/describe.js +4 -2
  421. package/dist/sdk/extension/doctor.js +1 -1
  422. package/dist/sdk/extension/install-plan.js +1 -1
  423. package/dist/sdk/extension/install-receipts.js +1 -1
  424. package/dist/sdk/extension/install-runtime.js +3 -3
  425. package/dist/sdk/extension/install-snapshot.js +1 -1
  426. package/dist/sdk/extension/install-sources.js +5 -5
  427. package/dist/sdk/extension/managed-state.js +2 -2
  428. package/dist/sdk/extension/migrations.js +2 -2
  429. package/dist/sdk/extension/output-ownership.js +1 -1
  430. package/dist/sdk/extension/runtime-summary.js +1 -1
  431. package/dist/sdk/extension/scaffold.js +11 -4
  432. package/dist/sdk/extension/shared.js +1 -1
  433. package/dist/sdk/extension/source-resolution.js +1 -1
  434. package/dist/sdk/extension/static-inventory.js +1 -1
  435. package/dist/sdk/extension/update-check.js +1 -1
  436. package/dist/sdk/extension-command-context.js +1 -1
  437. package/dist/sdk/extension-contracts.js +1 -1
  438. package/dist/sdk/extension.js +1 -1
  439. package/dist/sdk/files.js +1 -1
  440. package/dist/sdk/flag-invocation-contracts.js +1 -1
  441. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  442. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  443. package/dist/sdk/generated-error-code-catalog.js +1 -1
  444. package/dist/sdk/governance/assurance-action-contracts.js +1 -1
  445. package/dist/sdk/governance/assurance-action.js +1 -1
  446. package/dist/sdk/governance/assurance-limits.js +1 -1
  447. package/dist/sdk/governance/assurance-mutation-error.js +1 -1
  448. package/dist/sdk/governance/assurance-presets.js +1 -1
  449. package/dist/sdk/governance/assurance-runtime.js +1 -1
  450. package/dist/sdk/governance/assurance.js +4 -4
  451. package/dist/sdk/governance/boundary-fixtures.js +1 -1
  452. package/dist/sdk/governance/closure-timestamps.js +1 -1
  453. package/dist/sdk/governance/coverage-assurance.js +1 -1
  454. package/dist/sdk/governance/defect-recurrence-coverage.js +1 -1
  455. package/dist/sdk/governance/defect-recurrence-graph.js +1 -1
  456. package/dist/sdk/governance/defect-recurrence-signals.js +1 -1
  457. package/dist/sdk/governance/defect-recurrence.js +1 -1
  458. package/dist/sdk/governance/extension-host-version.js +1 -1
  459. package/dist/sdk/governance/gc.js +1 -1
  460. package/dist/sdk/governance/health-merge-evidence.js +1 -1
  461. package/dist/sdk/governance/health.js +2 -1
  462. package/dist/sdk/governance/hierarchy-validation.js +1 -1
  463. package/dist/sdk/governance/linked-file-report.js +1 -1
  464. package/dist/sdk/governance/merge-receipt-history.js +1 -1
  465. package/dist/sdk/governance/provenance-health.js +4 -1
  466. package/dist/sdk/governance/reindex.js +5 -4
  467. package/dist/sdk/governance/stale-work.js +1 -1
  468. package/dist/sdk/governance/status-role-diagnostics.js +1 -1
  469. package/dist/sdk/governance/storage-integrity.js +1 -1
  470. package/dist/sdk/governance/tracked-runtime-cache.js +1 -1
  471. package/dist/sdk/governance/upgrade.js +2 -2
  472. package/dist/sdk/governance/validate-history-drift.js +1 -1
  473. package/dist/sdk/governance/validate-item-reader.js +1 -1
  474. package/dist/sdk/governance/validate-normalization.js +1 -1
  475. package/dist/sdk/governance/validate.js +1 -1
  476. package/dist/sdk/governance/workflow-completeness.js +1 -1
  477. package/dist/sdk/governance/workflow-policy.js +3 -3
  478. package/dist/sdk/governance/workspace-position.js +2 -1
  479. package/dist/sdk/governance.js +1 -1
  480. package/dist/sdk/graph/adapter.js +1 -1
  481. package/dist/sdk/graph/analytics.js +1 -1
  482. package/dist/sdk/graph/assembly.js +1 -1
  483. package/dist/sdk/graph/cache.js +1 -1
  484. package/dist/sdk/graph/centrality.js +1 -1
  485. package/dist/sdk/graph/conformance.js +1 -1
  486. package/dist/sdk/graph/deadline-scheduling.js +1 -1
  487. package/dist/sdk/graph/durable-cache.js +1 -1
  488. package/dist/sdk/graph/governance-contracts.js +1 -1
  489. package/dist/sdk/graph/governance.js +1 -1
  490. package/dist/sdk/graph/hierarchy-integrity.js +1 -1
  491. package/dist/sdk/graph/index.js +1 -1
  492. package/dist/sdk/graph/lifecycle-coverage.js +1 -1
  493. package/dist/sdk/graph/mutation-advisory.js +1 -1
  494. package/dist/sdk/graph/query-contracts.js +1 -1
  495. package/dist/sdk/graph/remediation.js +1 -1
  496. package/dist/sdk/graph/run.js +1 -1
  497. package/dist/sdk/graph/scheduling.js +1 -1
  498. package/dist/sdk/graph/traversal.js +1 -1
  499. package/dist/sdk/graph/workspace-relationship-kind-registry.js +1 -1
  500. package/dist/sdk/graph.js +1 -1
  501. package/dist/sdk/guide-topics.js +1 -1
  502. package/dist/sdk/guide.js +8 -1
  503. package/dist/sdk/history/attestation-command.js +1 -1
  504. package/dist/sdk/history/attestation-contract.js +1 -1
  505. package/dist/sdk/history/attestation-scan.js +1 -1
  506. package/dist/sdk/history/attestation.js +1 -1
  507. package/dist/sdk/history/maintenance.js +1 -1
  508. package/dist/sdk/history/salvage.js +3 -2
  509. package/dist/sdk/history/subject.js +1 -1
  510. package/dist/sdk/history-analytics.js +1 -1
  511. package/dist/sdk/history-compact.js +1 -1
  512. package/dist/sdk/history-mcp.js +1 -1
  513. package/dist/sdk/history-provenance.js +1 -1
  514. package/dist/sdk/history-read.js +1 -1
  515. package/dist/sdk/history-redact.js +1 -1
  516. package/dist/sdk/history-repair.js +1 -1
  517. package/dist/sdk/improvement-ledger-validation.js +1 -1
  518. package/dist/sdk/improvement-ledger.js +2 -2
  519. package/dist/sdk/index.js +1 -1
  520. package/dist/sdk/init-agent-guidance.js +16 -2
  521. package/dist/sdk/init.js +16 -2
  522. package/dist/sdk/invocation-author.js +1 -1
  523. package/dist/sdk/item-children.js +1 -1
  524. package/dist/sdk/item-metadata-index.js +1 -1
  525. package/dist/sdk/item-schedule.js +1 -1
  526. package/dist/sdk/item-transaction.js +1 -1
  527. package/dist/sdk/learnings.js +1 -1
  528. package/dist/sdk/lifecycle/append.js +4 -2
  529. package/dist/sdk/lifecycle/claim.js +1 -1
  530. package/dist/sdk/lifecycle/close-many.js +1 -1
  531. package/dist/sdk/lifecycle/close.js +1 -1
  532. package/dist/sdk/lifecycle/copy.js +1 -1
  533. package/dist/sdk/lifecycle/create.js +1 -1
  534. package/dist/sdk/lifecycle/delete.js +1 -1
  535. package/dist/sdk/lifecycle/event-validation-messages.js +1 -1
  536. package/dist/sdk/lifecycle/focus.js +1 -1
  537. package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +1 -1
  538. package/dist/sdk/lifecycle/legacy-none-tokens.js +1 -1
  539. package/dist/sdk/lifecycle/lifecycle-transitions.js +1 -1
  540. package/dist/sdk/lifecycle/mcp-actions.js +1 -1
  541. package/dist/sdk/lifecycle/metadata-normalizers.js +1 -1
  542. package/dist/sdk/lifecycle/mutation-command-options.js +1 -1
  543. package/dist/sdk/lifecycle/plan-mutation-receipt.js +1 -1
  544. package/dist/sdk/lifecycle/plan.js +1 -1
  545. package/dist/sdk/lifecycle/recurrence-parsers.js +1 -1
  546. package/dist/sdk/lifecycle/reopen.js +1 -1
  547. package/dist/sdk/lifecycle/repeatable-metadata-parsers.js +2 -1
  548. package/dist/sdk/lifecycle/restore.js +1 -1
  549. package/dist/sdk/lifecycle/shared-unset-fields.js +1 -1
  550. package/dist/sdk/lifecycle/task-composition.js +1 -1
  551. package/dist/sdk/lifecycle/update-many.js +1 -1
  552. package/dist/sdk/lifecycle/update.js +2 -1
  553. package/dist/sdk/lifecycle-completion.js +1 -1
  554. package/dist/sdk/lifecycle-policy.js +1 -1
  555. package/dist/sdk/linked-artifacts.js +2 -1
  556. package/dist/sdk/mcp/apps.js +1 -1
  557. package/dist/sdk/mcp/authorization.js +1 -1
  558. package/dist/sdk/mcp/discovery.js +1 -1
  559. package/dist/sdk/mcp/interactions.js +1 -1
  560. package/dist/sdk/mcp/protocol.js +1 -1
  561. package/dist/sdk/mcp/skills.js +3 -1
  562. package/dist/sdk/mcp/subscriptions.js +1 -1
  563. package/dist/sdk/mcp/tasks.js +2 -2
  564. package/dist/sdk/mcp/transport.js +1 -1
  565. package/dist/sdk/merge/abandoned-receipts.js +1 -1
  566. package/dist/sdk/merge/driver.js +1 -1
  567. package/dist/sdk/merge/index.js +1 -1
  568. package/dist/sdk/merge/install.js +4 -2
  569. package/dist/sdk/merge/receipt-file-boundary.js +1 -1
  570. package/dist/sdk/merge/receipt-operation.js +1 -1
  571. package/dist/sdk/merge/receipt-schema.js +1 -1
  572. package/dist/sdk/merge/receipts.js +4 -4
  573. package/dist/sdk/merge/reconcile.js +1 -1
  574. package/dist/sdk/merge/three-way.js +3 -2
  575. package/dist/sdk/merge/worktree-config.js +1 -1
  576. package/dist/sdk/merge.js +1 -1
  577. package/dist/sdk/mutation-events.js +1 -1
  578. package/dist/sdk/mutation-guard.js +1 -1
  579. package/dist/sdk/notes.js +1 -1
  580. package/dist/sdk/output-contracts.js +1 -1
  581. package/dist/sdk/output-projection.js +1 -1
  582. package/dist/sdk/output-token-accounting.js +1 -1
  583. package/dist/sdk/output.js +2 -1
  584. package/dist/sdk/ownership-source.js +1 -1
  585. package/dist/sdk/package-import-adapters.js +1 -1
  586. package/dist/sdk/package-migrations.js +1 -1
  587. package/dist/sdk/package-runtime-options.js +1 -1
  588. package/dist/sdk/pagination.js +1 -1
  589. package/dist/sdk/profile.js +5 -1
  590. package/dist/sdk/provenance.js +1 -1
  591. package/dist/sdk/public-surface.json +1 -1
  592. package/dist/sdk/query/activity.js +1 -1
  593. package/dist/sdk/query/aggregate.js +1 -1
  594. package/dist/sdk/query/calendar.js +4 -1
  595. package/dist/sdk/query/complete-list.js +1 -1
  596. package/dist/sdk/query/context.js +2 -1
  597. package/dist/sdk/query/duplicate-candidates.js +1 -1
  598. package/dist/sdk/query/get.d.ts +14 -2
  599. package/dist/sdk/query/get.js +1 -1
  600. package/dist/sdk/query/history.js +1 -1
  601. package/dist/sdk/query/item-filter-options.js +1 -1
  602. package/dist/sdk/query/light-metadata.js +1 -1
  603. package/dist/sdk/query/list-filter-shared.js +1 -1
  604. package/dist/sdk/query/list.js +1 -1
  605. package/dist/sdk/query/multi-value-filters.js +1 -1
  606. package/dist/sdk/query/next-ready-budget.js +1 -1
  607. package/dist/sdk/query/next.js +2 -1
  608. package/dist/sdk/query/parsers.js +1 -1
  609. package/dist/sdk/query/projection-contracts.js +1 -1
  610. package/dist/sdk/query/search/corpus.js +2 -1
  611. package/dist/sdk/query/search/filters.js +1 -1
  612. package/dist/sdk/query/search/input.js +1 -1
  613. package/dist/sdk/query/search/lexical.js +1 -1
  614. package/dist/sdk/query/search/response.js +1 -1
  615. package/dist/sdk/query/search/semantic.js +3 -2
  616. package/dist/sdk/query/search/types.js +1 -1
  617. package/dist/sdk/query/search-contracts.js +1 -1
  618. package/dist/sdk/query/search-pagination.d.ts +1 -1
  619. package/dist/sdk/query/search-pagination.js +1 -1
  620. package/dist/sdk/query/search-rendering.js +1 -1
  621. package/dist/sdk/query/search.js +1 -1
  622. package/dist/sdk/query/workspace-contracts.js +1 -1
  623. package/dist/sdk/query.js +1 -1
  624. package/dist/sdk/read-output/continuation.js +1 -1
  625. package/dist/sdk/read-output/options.js +1 -1
  626. package/dist/sdk/read-output/provenance.js +1 -1
  627. package/dist/sdk/read-output-budget.js +1 -1
  628. package/dist/sdk/read-output-contracts.js +1 -1
  629. package/dist/sdk/read-output-rows.js +1 -1
  630. package/dist/sdk/read-output-session.js +1 -1
  631. package/dist/sdk/relationship-analytics.js +1 -1
  632. package/dist/sdk/relationship-context.js +1 -1
  633. package/dist/sdk/relationship-history.js +7 -4
  634. package/dist/sdk/relationship-kinds/contract.js +1 -1
  635. package/dist/sdk/relationship-migration.js +1 -1
  636. package/dist/sdk/relationships.js +1 -1
  637. package/dist/sdk/reproducibility/process.js +1 -1
  638. package/dist/sdk/runtime/actions.js +1 -1
  639. package/dist/sdk/runtime/context.js +1 -1
  640. package/dist/sdk/runtime/schema-preview.js +1 -1
  641. package/dist/sdk/runtime/schema.js +1 -1
  642. package/dist/sdk/runtime-action-aliases.js +1 -1
  643. package/dist/sdk/runtime-extended-actions.js +1 -1
  644. package/dist/sdk/runtime-input.js +1 -1
  645. package/dist/sdk/runtime-primitives.js +1 -1
  646. package/dist/sdk/runtime-public-contracts.js +1 -1
  647. package/dist/sdk/runtime-stats-options.js +1 -1
  648. package/dist/sdk/runtime.js +1 -1
  649. package/dist/sdk/scheduling-shortcuts.js +1 -1
  650. package/dist/sdk/schema-migration.js +4 -3
  651. package/dist/sdk/schema.js +7 -1
  652. package/dist/sdk/search-refresh-worker.js +1 -1
  653. package/dist/sdk/similarity-scoring.js +1 -1
  654. package/dist/sdk/similarity.js +1 -1
  655. package/dist/sdk/start-task-status.js +1 -1
  656. package/dist/sdk/stats.js +1 -1
  657. package/dist/sdk/structured-mutations.js +1 -1
  658. package/dist/sdk/telemetry-flush.js +1 -1
  659. package/dist/sdk/telemetry.js +4 -3
  660. package/dist/sdk/templates.js +26 -2
  661. package/dist/sdk/test/batch.js +2 -2
  662. package/dist/sdk/test/entry.js +1 -1
  663. package/dist/sdk/test/execution.js +6 -5
  664. package/dist/sdk/test/json-path.js +1 -1
  665. package/dist/sdk/test/linked-command-detection.js +1 -1
  666. package/dist/sdk/test/measurements.js +1 -1
  667. package/dist/sdk/test/parsers.js +1 -1
  668. package/dist/sdk/test/runs.js +1 -1
  669. package/dist/sdk/test/trust.js +2 -2
  670. package/dist/sdk/test/workspace-snapshot.js +1 -1
  671. package/dist/sdk/testing.js +7 -4
  672. package/dist/sdk/traceability/runtime-files-lookup.js +1 -1
  673. package/dist/sdk/traceability/source-traceability.js +2 -1
  674. package/dist/sdk/tracker-root-discovery.js +1 -1
  675. package/dist/sdk/workspace-contracts-cache.js +1 -1
  676. package/dist/sdk/workspace-contracts.js +1 -1
  677. package/dist/sdk/workspace-memory.js +2 -2
  678. package/dist/sdk/workspace-recipe.js +1 -1
  679. package/dist/sdk/workspace-snapshot.js +5 -4
  680. package/dist/sdk/workspace-transaction-gc.js +1 -1
  681. package/dist/sdk/workspace-transaction.js +2 -2
  682. package/dist/sdk/workspace.js +3 -2
  683. package/dist/types/index.js +1 -1
  684. package/dist/types.js +1 -1
  685. package/docs/AGENT_EVIDENCE_CONSISTENCY.md +88 -0
  686. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +25 -0
  687. package/docs/GET_READ_EVIDENCE.md +68 -0
  688. package/docs/OUTPUT_PROJECTION_CONTRACTS.md +23 -0
  689. package/docs/README.md +2 -0
  690. package/docs/SDK_AUDITED_MUTATIONS.md +35 -0
  691. package/docs/TESTING.md +8 -0
  692. package/docs/ecosystem-review-2026-09-28.json +2864 -3157
  693. package/marketplace.json +2 -2
  694. package/package.json +1 -1
  695. package/packages/pm-beads/package.json +1 -1
  696. package/packages/pm-calendar/package.json +1 -1
  697. package/packages/pm-command-kit/package.json +1 -1
  698. package/packages/pm-digital-twin/package.json +1 -1
  699. package/packages/pm-governance-audit/package.json +1 -1
  700. package/packages/pm-guide-shell/package.json +1 -1
  701. package/packages/pm-kanban/package.json +1 -1
  702. package/packages/pm-lifecycle-hooks/package.json +1 -1
  703. package/packages/pm-linked-test-adapters/package.json +1 -1
  704. package/packages/pm-search-advanced/package.json +1 -1
  705. package/packages/pm-templates/package.json +1 -1
  706. package/packages/pm-todos/package.json +1 -1
  707. package/packages/pm-vcs/extensions/vcs/index.ts +4 -2
  708. package/packages/pm-vcs/package.json +1 -1
  709. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  710. package/plugins/pm-claude/package.json +2 -2
  711. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  712. package/plugins/pm-codex/package.json +2 -2
  713. package/plugins/pm-codex/plugin.json +1 -1
  714. package/scripts/finalize-build.mjs +3 -2
  715. package/dist/cli-bundle/chunks/chunk-3AF2R3Y6.js +0 -6
  716. package/dist/cli-bundle/chunks/chunk-6ST3SCQ6.js +0 -2
  717. package/dist/cli-bundle/chunks/chunk-6Z4IV2MC.js +0 -8
  718. package/dist/cli-bundle/chunks/chunk-DEZPZOQ7.js +0 -2
  719. package/dist/cli-bundle/chunks/chunk-FW5LJXQY.js +0 -31
  720. package/dist/cli-bundle/chunks/chunk-H2DZW6I6.js +0 -3
  721. package/dist/cli-bundle/chunks/chunk-H7CXQBGQ.js +0 -2
  722. package/dist/cli-bundle/chunks/chunk-KP7NBQK3.js +0 -80
  723. package/dist/cli-bundle/chunks/chunk-MKXBCBAN.js +0 -20
  724. package/dist/cli-bundle/chunks/chunk-QPKQKSQU.js +0 -238
  725. package/dist/cli-bundle/chunks/chunk-SGFQQXFD.js +0 -2
  726. package/dist/cli-bundle/chunks/chunk-YCBGZF3T.js +0 -2
  727. package/dist/cli-bundle/chunks/chunk-YDWKGUQU.js +0 -3
  728. package/dist/cli-bundle/chunks/register-mutation-5PT3NW3A.js +0 -20
  729. package/dist/cli-bundle/chunks/register-operations-QDDQOAAV.js +0 -2
  730. package/dist/cli-bundle/chunks/register-setup-BBX67YMA.js +0 -2
  731. package/dist/cli-bundle/focused-chunks/chunk-4FFPGNCJ.js +0 -6
  732. package/dist/cli-bundle/focused-chunks/chunk-73DA7ISY.js +0 -75
  733. package/dist/cli-bundle/focused-chunks/chunk-E754JDLY.js +0 -2
  734. package/dist/cli-bundle/focused-chunks/chunk-FKK2HI3S.js +0 -2
  735. package/dist/cli-bundle/focused-chunks/chunk-GMYUNHST.js +0 -3
  736. package/dist/cli-bundle/focused-chunks/chunk-HIA2ZF64.js +0 -12
  737. package/dist/cli-bundle/focused-chunks/chunk-UTRSM3ZK.js +0 -8
  738. package/dist/cli-bundle/focused-chunks/chunk-VVWYI2X7.js +0 -2
  739. package/dist/cli-bundle/focused-chunks/chunk-WAJNX4RN.js +0 -20
  740. package/dist/cli-bundle/focused-chunks/chunk-WCY6HRZO.js +0 -30
  741. package/dist/cli-bundle/focused-chunks/chunk-YC32ZSLS.js +0 -165
  742. package/dist/cli-bundle/focused-chunks/chunk-ZIXFMIUL.js +0 -3
@@ -1,3 +1,3 @@
1
- !(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d9ef3878-afce-5983-8fe9-8a896f82d0a7")}catch(e2){}})();import{mkdir,readFile}from"node:fs/promises";import path from"node:path";import{acquireLock}from"../core/lock/lock.js";import{isFileMissingError,writeFileAtomic}from"../core/fs/fs-utils.js";import{nowIso}from"../core/shared/time.js";class WorkspaceTransactionInterruptedError extends Error{constructor(message="Workspace transaction interrupted"){super(message);this.name="WorkspaceTransactionInterruptedError"}}const WORKSPACE_TRANSACTION_LOCK_ID="sdk-workspace-transaction";const TRANSACTION_ID_PATTERN=/^[a-zA-Z0-9._-]+$/;const DEFAULT_LOCK_TTL_SECONDS=30;const DEFAULT_LOCK_WAIT_MS=3e3;function requiredIdentifier(value,label){if(typeof value!=="string")throw new TypeError(`${label} must be a string`);const normalized=value.trim();if(!normalized||!TRANSACTION_ID_PATTERN.test(normalized))throw new TypeError(`${label} must match [a-zA-Z0-9._-]+`);return normalized}function requiredText(value,label){if(typeof value!=="string")throw new TypeError(`${label} must be a string`);const normalized=value.trim();if(!normalized)throw new TypeError(`${label} must be non-empty`);return normalized}function validateWorkspaceTransactionIdentity(options){return{pmRoot:requiredText(options.pmRoot,"Transaction pmRoot"),transactionId:requiredIdentifier(options.transactionId,"Transaction id"),author:requiredText(options.author,"Transaction author")}}function positiveInteger(value,fallback,label){const resolved=value??fallback;if(!Number.isInteger(resolved)||resolved<=0)throw new TypeError(`${label} must be a positive integer`);return resolved}function journalPath(pmRoot,transactionId){return path.join(pmRoot,"transactions","sdk",`${transactionId}.json`)}async function writeJournal(pmRoot,journal){journal.updatedAt=nowIso();const target=journalPath(pmRoot,journal.transactionId);await mkdir(path.dirname(target),{recursive:true});await writeFileAtomic(target,`${JSON.stringify(journal,null,2)}
2
- `)}function hasValidJournalMetadata(journal){return Number.isInteger(journal.attempt)&&typeof journal.author==="string"&&typeof journal.createdAt==="string"&&typeof journal.updatedAt==="string"}function createResultMap(source){return Object.assign(Object.create(null),source)}function cloneJournalValue(value,label){try{const serialized=JSON.stringify(value,(_key,nestedValue)=>{if(typeof nestedValue==="number"&&!Number.isFinite(nestedValue))throw new TypeError(`${label} contains a non-finite number`);if(nestedValue===void 0||typeof nestedValue==="function"||typeof nestedValue==="symbol")throw new TypeError(`${label} contains a non-JSON value`);return nestedValue});return JSON.parse(serialized)}catch(error){throw new TypeError(`${label} must be JSON serializable`,{cause:error})}}function cloneOptionalJournalValue(value,label){return value===void 0?void 0:cloneJournalValue(value,label)}function setJournalEntry(target,stepId,value,label){const cloned=cloneOptionalJournalValue(value,label);if(cloned===void 0)delete target[stepId];else target[stepId]=cloned}function isJournalMap(value){return value!==null&&typeof value==="object"&&!Array.isArray(value)}function hasUniqueKnownStepIds(value,stepIds){return Array.isArray(value)&&new Set(value).size===value.length&&value.every(stepId=>typeof stepId==="string"&&stepIds.includes(stepId))}function hasValidJournalLifecycle(journal,stepIds){if(!hasUniqueKnownStepIds(journal.startedStepIds,stepIds)||!hasUniqueKnownStepIds(journal.completedStepIds,stepIds)||!isJournalMap(journal.results)||!isJournalMap(journal.compensationData))return false;const startedStepIds=journal.startedStepIds;const started=new Set(startedStepIds);const completedStepIds=journal.completedStepIds;const completed=new Set(completedStepIds);if(Object.keys(journal.compensationData).some(stepId=>!started.has(stepId))||Object.keys(journal.results).some(stepId=>!completed.has(stepId)))return false;if(journal.status==="committed")return stepIds.every(stepId=>completed.has(stepId));return journal.status!=="compensated"||completed.size===0&&started.size===0}function parseJournal(raw,transactionId,stepIds){let parsed;try{parsed=JSON.parse(raw)}catch{throw new TypeError(`Workspace transaction ${transactionId} journal is invalid JSON`)}if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))throw new TypeError(`Workspace transaction ${transactionId} journal is invalid`);const journal=parsed;const identityMatches=journal.schemaVersion===1&&journal.transactionId===transactionId;const stepsMatch=Array.isArray(journal.stepIds)&&journal.stepIds.length===stepIds.length&&journal.stepIds.every((stepId,index)=>stepId===stepIds[index]);const lifecycleMatches=hasValidJournalLifecycle(journal,stepIds);const metadataMatches=hasValidJournalMetadata(journal);const statusMatches=["applying","compensating","compensated","committed"].includes(String(journal.status));if(!identityMatches||!stepsMatch||!lifecycleMatches||!metadataMatches||!statusMatches)throw new TypeError(`Workspace transaction ${transactionId} journal does not match the supplied plan`);return{...journal,results:createResultMap(journal.results),compensationData:createResultMap(journal.compensationData)}}async function prepareJournalForApply(options,transactionId,author,stepIds,existing){let journal=existing;const recovered=journal!==void 0;if(journal?.status==="compensating")await compensateAppliedSteps(options,journal);if(journal===void 0||journal.status==="compensated"){const timestamp=nowIso();journal={schemaVersion:1,transactionId,author,status:"applying",attempt:(journal?.attempt??0)+1,createdAt:journal?.createdAt??timestamp,updatedAt:timestamp,stepIds,startedStepIds:[],completedStepIds:[],results:createResultMap(),compensationData:createResultMap()};await writeJournal(options.pmRoot,journal);await emitTransition(options,journal,"prepared")}return{journal,recovered}}async function applyPreparedTransaction(options,journal,recovered){try{await discoverAppliedSteps(journal,options.steps);await writeJournal(options.pmRoot,journal);const completed=new Set(journal.completedStepIds);const started=new Set(journal.startedStepIds);for(const step of options.steps){if(completed.has(step.id))continue;const inspection=await step.inspect();let result=cloneOptionalJournalValue(inspection.result,`Step ${step.id} result`);if(inspection.state!=="applied"){const compensationData=await step.prepareCompensation?.();setJournalEntry(journal.compensationData,step.id,compensationData,`Step ${step.id} compensation data`);started.add(step.id);journal.startedStepIds=options.steps.map(candidate=>candidate.id).filter(stepId=>started.has(stepId));await writeJournal(options.pmRoot,journal);const appliedResult=await step.apply();result=cloneOptionalJournalValue(appliedResult,`Step ${step.id} result`)}await emitTransition(options,journal,"step_applied",step.id);completed.add(step.id);journal.completedStepIds=options.steps.map(candidate=>candidate.id).filter(stepId=>completed.has(stepId));setJournalEntry(journal.results,step.id,result,`Step ${step.id} result`);await writeJournal(options.pmRoot,journal);await emitTransition(options,journal,"step_recorded",step.id)}await emitTransition(options,journal,"committing");journal.status="committed";await writeJournal(options.pmRoot,journal);await emitTransition(options,journal,"committed");return{transactionId:journal.transactionId,status:"committed",recovered,results:createResultMap(journal.results)}}catch(error){if(error instanceof WorkspaceTransactionInterruptedError||journal.status==="committed")throw error;try{await compensateAppliedSteps(options,journal)}catch(compensationError){throw new AggregateError([error,compensationError],`Workspace transaction failed and compensation failed: ${String(compensationError)}`,{cause:compensationError})}throw error}}async function loadJournal(pmRoot,transactionId,stepIds){try{return parseJournal(await readFile(journalPath(pmRoot,transactionId),"utf8"),transactionId,stepIds)}catch(error){if(error!==null&&typeof error==="object"&&"code"in error&&isFileMissingError(error))return void 0;throw error}}async function emitTransition(options,journal,transition,stepId){await options.onTransition?.({transactionId:journal.transactionId,attempt:journal.attempt,transition,...stepId===void 0?{}:{stepId}})}async function discoverAppliedSteps(journal,steps){const completed=new Set;const results=createResultMap();for(const step of steps){const inspection=await step.inspect();if(inspection.state==="applied"){completed.add(step.id);setJournalEntry(results,step.id,inspection.result,`Step ${step.id} result`)}}journal.results=results;journal.completedStepIds=steps.map(step=>step.id).filter(stepId=>completed.has(stepId))}async function compensateAppliedSteps(options,journal){journal.status="compensating";await writeJournal(options.pmRoot,journal);await emitTransition(options,journal,"compensating");const completed=new Set(journal.completedStepIds);const started=new Set(journal.startedStepIds);for(const step of[...options.steps].reverse()){if(!started.has(step.id)&&!completed.has(step.id))continue;let shouldCompensate;try{shouldCompensate=started.has(step.id)&&(await step.inspect()).state==="applied"}catch{shouldCompensate=started.has(step.id)}if(shouldCompensate){await emitTransition(options,journal,"step_compensating",step.id);await step.compensate(journal.compensationData[step.id])}completed.delete(step.id);started.delete(step.id);journal.completedStepIds=options.steps.map(candidate=>candidate.id).filter(stepId=>completed.has(stepId));journal.startedStepIds=options.steps.map(candidate=>candidate.id).filter(stepId=>started.has(stepId));delete journal.results[step.id];delete journal.compensationData[step.id];await writeJournal(options.pmRoot,journal);await emitTransition(options,journal,"step_compensated",step.id)}journal.status="compensated";await writeJournal(options.pmRoot,journal);await emitTransition(options,journal,"compensated")}async function commitWorkspaceTransaction(options){const{pmRoot,transactionId,author}=validateWorkspaceTransactionIdentity(options);const lockTtlSeconds=positiveInteger(options.lockTtlSeconds,DEFAULT_LOCK_TTL_SECONDS,"Transaction lock TTL");const lockWaitMs=positiveInteger(options.lockWaitMs,DEFAULT_LOCK_WAIT_MS,"Transaction lock wait");const steps=[...options.steps];if(steps.length===0)throw new TypeError("Workspace transaction requires at least one step");const stepIds=steps.map(step=>{const stepId=requiredIdentifier(step.id,"Transaction step id");if(stepId!==step.id)throw new TypeError("Transaction step id must not contain surrounding whitespace");return stepId});if(new Set(stepIds).size!==stepIds.length)throw new TypeError("Workspace transaction step ids must be unique");const stableOptions={...options,pmRoot,transactionId,author,steps,lockTtlSeconds,lockWaitMs};const release=await acquireLock(pmRoot,WORKSPACE_TRANSACTION_LOCK_ID,lockTtlSeconds,author,false,false,lockWaitMs);try{const existing=await loadJournal(pmRoot,transactionId,stepIds);const recovered=existing!==void 0;if(existing?.status==="committed")return{transactionId,status:"committed",recovered:true,results:createResultMap(existing.results)};const prepared=await prepareJournalForApply(stableOptions,transactionId,author,stepIds,existing);return await applyPreparedTransaction(stableOptions,prepared.journal,recovered||prepared.recovered)}finally{await release()}}export{WorkspaceTransactionInterruptedError,commitWorkspaceTransaction,validateWorkspaceTransactionIdentity};
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0bd9a904-c076-5c2a-a9d8-42a543625e33")}catch{}})();import{mkdir,readFile}from"node:fs/promises";import path from"node:path";import{acquireLock}from"../core/lock/lock.js";import{isFileMissingError,writeFileAtomic}from"../core/fs/fs-utils.js";import{nowIso}from"../core/shared/time.js";class WorkspaceTransactionInterruptedError extends Error{constructor(message="Workspace transaction interrupted"){super(message),this.name="WorkspaceTransactionInterruptedError"}}const WORKSPACE_TRANSACTION_LOCK_ID="sdk-workspace-transaction",TRANSACTION_ID_PATTERN=/^[a-zA-Z0-9._-]+$/,DEFAULT_LOCK_TTL_SECONDS=30,DEFAULT_LOCK_WAIT_MS=3e3;function requiredIdentifier(value,label){if(typeof value!="string")throw new TypeError(`${label} must be a string`);const normalized=value.trim();if(!normalized||!TRANSACTION_ID_PATTERN.test(normalized))throw new TypeError(`${label} must match [a-zA-Z0-9._-]+`);return normalized}function requiredText(value,label){if(typeof value!="string")throw new TypeError(`${label} must be a string`);const normalized=value.trim();if(!normalized)throw new TypeError(`${label} must be non-empty`);return normalized}function validateWorkspaceTransactionIdentity(options){return{pmRoot:requiredText(options.pmRoot,"Transaction pmRoot"),transactionId:requiredIdentifier(options.transactionId,"Transaction id"),author:requiredText(options.author,"Transaction author")}}function positiveInteger(value,fallback,label){const resolved=value??fallback;if(!Number.isInteger(resolved)||resolved<=0)throw new TypeError(`${label} must be a positive integer`);return resolved}function journalPath(pmRoot,transactionId){return path.join(pmRoot,"transactions","sdk",`${transactionId}.json`)}async function writeJournal(pmRoot,journal){journal.updatedAt=nowIso();const target=journalPath(pmRoot,journal.transactionId);await mkdir(path.dirname(target),{recursive:!0}),await writeFileAtomic(target,`${JSON.stringify(journal,null,2)}
2
+ `)}function hasValidJournalMetadata(journal){return Number.isInteger(journal.attempt)&&typeof journal.author=="string"&&typeof journal.createdAt=="string"&&typeof journal.updatedAt=="string"}function createResultMap(source){return Object.assign(Object.create(null),source)}function cloneJournalValue(value,label){try{const serialized=JSON.stringify(value,(_key,nestedValue)=>{if(typeof nestedValue=="number"&&!Number.isFinite(nestedValue))throw new TypeError(`${label} contains a non-finite number`);if(nestedValue===void 0||typeof nestedValue=="function"||typeof nestedValue=="symbol")throw new TypeError(`${label} contains a non-JSON value`);return nestedValue});return JSON.parse(serialized)}catch(error){throw new TypeError(`${label} must be JSON serializable`,{cause:error})}}function cloneOptionalJournalValue(value,label){return value===void 0?void 0:cloneJournalValue(value,label)}function setJournalEntry(target,stepId,value,label){const cloned=cloneOptionalJournalValue(value,label);cloned===void 0?delete target[stepId]:target[stepId]=cloned}function isJournalMap(value){return value!==null&&typeof value=="object"&&!Array.isArray(value)}function hasUniqueKnownStepIds(value,stepIds){return Array.isArray(value)&&new Set(value).size===value.length&&value.every(stepId=>typeof stepId=="string"&&stepIds.includes(stepId))}function hasValidJournalLifecycle(journal,stepIds){if(!hasUniqueKnownStepIds(journal.startedStepIds,stepIds)||!hasUniqueKnownStepIds(journal.completedStepIds,stepIds)||!isJournalMap(journal.results)||!isJournalMap(journal.compensationData))return!1;const startedStepIds=journal.startedStepIds,started=new Set(startedStepIds),completedStepIds=journal.completedStepIds,completed=new Set(completedStepIds);return Object.keys(journal.compensationData).some(stepId=>!started.has(stepId))||Object.keys(journal.results).some(stepId=>!completed.has(stepId))?!1:journal.status==="committed"?stepIds.every(stepId=>completed.has(stepId)):journal.status!=="compensated"||completed.size===0&&started.size===0}function parseJournal(raw,transactionId,stepIds){let parsed;try{parsed=JSON.parse(raw)}catch{throw new TypeError(`Workspace transaction ${transactionId} journal is invalid JSON`)}if(!parsed||typeof parsed!="object"||Array.isArray(parsed))throw new TypeError(`Workspace transaction ${transactionId} journal is invalid`);const journal=parsed,identityMatches=journal.schemaVersion===1&&journal.transactionId===transactionId,stepsMatch=Array.isArray(journal.stepIds)&&journal.stepIds.length===stepIds.length&&journal.stepIds.every((stepId,index)=>stepId===stepIds[index]),lifecycleMatches=hasValidJournalLifecycle(journal,stepIds),metadataMatches=hasValidJournalMetadata(journal),statusMatches=["applying","compensating","compensated","committed"].includes(String(journal.status));if(!identityMatches||!stepsMatch||!lifecycleMatches||!metadataMatches||!statusMatches)throw new TypeError(`Workspace transaction ${transactionId} journal does not match the supplied plan`);return{...journal,results:createResultMap(journal.results),compensationData:createResultMap(journal.compensationData)}}async function prepareJournalForApply(options,transactionId,author,stepIds,existing){let journal=existing;const recovered=journal!==void 0;if(journal?.status==="compensating"&&await compensateAppliedSteps(options,journal),journal===void 0||journal.status==="compensated"){const timestamp=nowIso();journal={schemaVersion:1,transactionId,author,status:"applying",attempt:(journal?.attempt??0)+1,createdAt:journal?.createdAt??timestamp,updatedAt:timestamp,stepIds,startedStepIds:[],completedStepIds:[],results:createResultMap(),compensationData:createResultMap()},await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"prepared")}return{journal,recovered}}async function applyPreparedTransaction(options,journal,recovered){try{await discoverAppliedSteps(journal,options.steps),await writeJournal(options.pmRoot,journal);const completed=new Set(journal.completedStepIds),started=new Set(journal.startedStepIds);for(const step of options.steps){if(completed.has(step.id))continue;const inspection=await step.inspect();let result=cloneOptionalJournalValue(inspection.result,`Step ${step.id} result`);if(inspection.state!=="applied"){const compensationData=await step.prepareCompensation?.();setJournalEntry(journal.compensationData,step.id,compensationData,`Step ${step.id} compensation data`),started.add(step.id),journal.startedStepIds=options.steps.map(candidate=>candidate.id).filter(stepId=>started.has(stepId)),await writeJournal(options.pmRoot,journal);const appliedResult=await step.apply();result=cloneOptionalJournalValue(appliedResult,`Step ${step.id} result`)}await emitTransition(options,journal,"step_applied",step.id),completed.add(step.id),journal.completedStepIds=options.steps.map(candidate=>candidate.id).filter(stepId=>completed.has(stepId)),setJournalEntry(journal.results,step.id,result,`Step ${step.id} result`),await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"step_recorded",step.id)}return await emitTransition(options,journal,"committing"),journal.status="committed",await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"committed"),{transactionId:journal.transactionId,status:"committed",recovered,results:createResultMap(journal.results)}}catch(error){if(error instanceof WorkspaceTransactionInterruptedError||journal.status==="committed")throw error;try{await compensateAppliedSteps(options,journal)}catch(compensationError){throw new AggregateError([error,compensationError],`Workspace transaction failed and compensation failed: ${String(compensationError)}`,{cause:compensationError})}throw error}}async function loadJournal(pmRoot,transactionId,stepIds){try{return parseJournal(await readFile(journalPath(pmRoot,transactionId),"utf8"),transactionId,stepIds)}catch(error){if(error!==null&&typeof error=="object"&&"code"in error&&isFileMissingError(error))return;throw error}}async function emitTransition(options,journal,transition,stepId){await options.onTransition?.({transactionId:journal.transactionId,attempt:journal.attempt,transition,...stepId===void 0?{}:{stepId}})}async function discoverAppliedSteps(journal,steps){const completed=new Set,results=createResultMap();for(const step of steps){const inspection=await step.inspect();inspection.state==="applied"&&(completed.add(step.id),setJournalEntry(results,step.id,inspection.result,`Step ${step.id} result`))}journal.results=results,journal.completedStepIds=steps.map(step=>step.id).filter(stepId=>completed.has(stepId))}async function compensateAppliedSteps(options,journal){journal.status="compensating",await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"compensating");const completed=new Set(journal.completedStepIds),started=new Set(journal.startedStepIds);for(const step of[...options.steps].reverse()){if(!started.has(step.id)&&!completed.has(step.id))continue;let shouldCompensate;try{shouldCompensate=started.has(step.id)&&(await step.inspect()).state==="applied"}catch{shouldCompensate=started.has(step.id)}shouldCompensate&&(await emitTransition(options,journal,"step_compensating",step.id),await step.compensate(journal.compensationData[step.id])),completed.delete(step.id),started.delete(step.id),journal.completedStepIds=options.steps.map(candidate=>candidate.id).filter(stepId=>completed.has(stepId)),journal.startedStepIds=options.steps.map(candidate=>candidate.id).filter(stepId=>started.has(stepId)),delete journal.results[step.id],delete journal.compensationData[step.id],await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"step_compensated",step.id)}journal.status="compensated",await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"compensated")}async function commitWorkspaceTransaction(options){const{pmRoot,transactionId,author}=validateWorkspaceTransactionIdentity(options),lockTtlSeconds=positiveInteger(options.lockTtlSeconds,DEFAULT_LOCK_TTL_SECONDS,"Transaction lock TTL"),lockWaitMs=positiveInteger(options.lockWaitMs,DEFAULT_LOCK_WAIT_MS,"Transaction lock wait"),steps=[...options.steps];if(steps.length===0)throw new TypeError("Workspace transaction requires at least one step");const stepIds=steps.map(step=>{const stepId=requiredIdentifier(step.id,"Transaction step id");if(stepId!==step.id)throw new TypeError("Transaction step id must not contain surrounding whitespace");return stepId});if(new Set(stepIds).size!==stepIds.length)throw new TypeError("Workspace transaction step ids must be unique");const stableOptions={...options,pmRoot,transactionId,author,steps,lockTtlSeconds,lockWaitMs},release=await acquireLock(pmRoot,WORKSPACE_TRANSACTION_LOCK_ID,lockTtlSeconds,author,!1,!1,lockWaitMs);try{const existing=await loadJournal(pmRoot,transactionId,stepIds),recovered=existing!==void 0;if(existing?.status==="committed")return{transactionId,status:"committed",recovered:!0,results:createResultMap(existing.results)};const prepared=await prepareJournalForApply(stableOptions,transactionId,author,stepIds,existing);return await applyPreparedTransaction(stableOptions,prepared.journal,recovered||prepared.recovered)}finally{await release()}}export{WorkspaceTransactionInterruptedError,commitWorkspaceTransaction,validateWorkspaceTransactionIdentity};
3
3
  //# sourceMappingURL=workspace-transaction.js.map
@@ -1,5 +1,6 @@
1
- !(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5b131b40-e139-5a7d-a6ef-633fe2cbee64")}catch(e2){}})();import{isFileMissingError}from"../core/fs/fs-utils.js";import{readFile,writeFile}from"node:fs/promises";import path from"node:path";import{EXIT_CODE}from"../core/shared/constants.js";import{PmCliError}from"../core/shared/errors.js";const PM_GITIGNORE_START="# pm-cli:runtime-cache:start";const PM_GITIGNORE_END="# pm-cli:runtime-cache:end";const PM_GITIGNORE_DEFAULT_TRACKER_ROOT=".agents/pm";const PM_GITIGNORE_RUNTIME_DIRECTORIES=["runtime/","search/","locks/","transactions/","checkpoints/"];const PM_GITIGNORE_TRACKED_FILES=["search/eval-queries.json"];async function withGitignorePermissionRecovery(operation){try{return await operation()}catch(error){if(error instanceof Error&&"code"in error&&typeof error.code==="string"&&["EACCES","EPERM","EROFS"].includes(error.code)){throw new PmCliError("The workspace .gitignore is not writable.",EXIT_CODE.GENERIC_FAILURE,{code:"init_gitignore_unwritable",reason:error.code.toLowerCase(),required:"Grant the current user read and write access to the workspace .gitignore before initialization.",why:"pm init must publish its managed runtime-cache ignore fence without replacing unrelated entries.",nextSteps:["Grant read and write access to the workspace .gitignore and rerun pm init.","If the workspace is intentionally read-only, initialize pm in a writable workspace or clone."]})}throw error}}function normalizeTrackerRelativeRoot(trackerRelativeRoot){return trackerRelativeRoot.replaceAll("\\","/").replace(/^\.\/+/,"").replace(/\/+$/,"")}function isPathOutsideRoot(relativePath){const normalized=relativePath.replaceAll("\\","/");return path.isAbsolute(relativePath)||normalized===".."||normalized.startsWith("../")}function getPmGitignoreBlock(trackerRelativeRoot=PM_GITIGNORE_DEFAULT_TRACKER_ROOT){const root=normalizeTrackerRelativeRoot(trackerRelativeRoot);return[PM_GITIGNORE_START,...PM_GITIGNORE_RUNTIME_DIRECTORIES.map(directory=>directory==="search/"?`${root}/${directory}*`:`${root}/${directory}`),...PM_GITIGNORE_TRACKED_FILES.map(file=>`!${root}/${file}`),PM_GITIGNORE_END].join("\n")}async function ensurePmGitignore(workspaceRoot,options={}){const gitignorePath=path.join(workspaceRoot,".gitignore");let trackerRelativeRoot=PM_GITIGNORE_DEFAULT_TRACKER_ROOT;if(options.pmRoot!==void 0){const relative=normalizeTrackerRelativeRoot(path.relative(path.resolve(workspaceRoot),path.resolve(options.pmRoot)));if(isPathOutsideRoot(relative)){return{path:gitignorePath,changed:false}}if(relative.length>0){trackerRelativeRoot=relative}}let current="";try{current=await withGitignorePermissionRecovery(()=>readFile(gitignorePath,"utf8"))}catch(error){if(!(error instanceof Error&&"code"in error&&isFileMissingError(error))){throw error}}const start=current.indexOf(PM_GITIGNORE_START);const end=current.indexOf(PM_GITIGNORE_END);const withoutManagedBlock=start>=0&&end>=start?`${current.slice(0,start)}${current.slice(end+PM_GITIGNORE_END.length)}`:current;const prefix=withoutManagedBlock.trimEnd();const next=`${prefix.length>0?`${prefix}
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1de99e25-e132-5071-833e-37361b4cc7e6")}catch{}})();import{isFileMissingError}from"../core/fs/fs-utils.js";import{readFile,writeFile}from"node:fs/promises";import path from"node:path";import{EXIT_CODE}from"../core/shared/constants.js";import{PmCliError}from"../core/shared/errors.js";const PM_GITIGNORE_START="# pm-cli:runtime-cache:start",PM_GITIGNORE_END="# pm-cli:runtime-cache:end",PM_GITIGNORE_DEFAULT_TRACKER_ROOT=".agents/pm",PM_GITIGNORE_RUNTIME_DIRECTORIES=["runtime/","search/","locks/","transactions/","checkpoints/"],PM_GITIGNORE_TRACKED_FILES=["search/eval-queries.json"];async function withGitignorePermissionRecovery(operation){try{return await operation()}catch(error){throw error instanceof Error&&"code"in error&&typeof error.code=="string"&&["EACCES","EPERM","EROFS"].includes(error.code)?new PmCliError("The workspace .gitignore is not writable.",EXIT_CODE.GENERIC_FAILURE,{code:"init_gitignore_unwritable",reason:error.code.toLowerCase(),required:"Grant the current user read and write access to the workspace .gitignore before initialization.",why:"pm init must publish its managed runtime-cache ignore fence without replacing unrelated entries.",nextSteps:["Grant read and write access to the workspace .gitignore and rerun pm init.","If the workspace is intentionally read-only, initialize pm in a writable workspace or clone."]}):error}}function normalizeTrackerRelativeRoot(trackerRelativeRoot){return trackerRelativeRoot.replaceAll("\\","/").replace(/^\.\/+/,"").replace(/\/+$/,"")}function isPathOutsideRoot(relativePath){const normalized=relativePath.replaceAll("\\","/");return path.isAbsolute(relativePath)||normalized===".."||normalized.startsWith("../")}function getPmGitignoreBlock(trackerRelativeRoot=PM_GITIGNORE_DEFAULT_TRACKER_ROOT){const root=normalizeTrackerRelativeRoot(trackerRelativeRoot);return[PM_GITIGNORE_START,...PM_GITIGNORE_RUNTIME_DIRECTORIES.map(directory=>directory==="search/"?`${root}/${directory}*`:`${root}/${directory}`),...PM_GITIGNORE_TRACKED_FILES.map(file=>`!${root}/${file}`),PM_GITIGNORE_END].join(`
2
+ `)}async function ensurePmGitignore(workspaceRoot,options={}){const gitignorePath=path.join(workspaceRoot,".gitignore");let trackerRelativeRoot=PM_GITIGNORE_DEFAULT_TRACKER_ROOT;if(options.pmRoot!==void 0){const relative=normalizeTrackerRelativeRoot(path.relative(path.resolve(workspaceRoot),path.resolve(options.pmRoot)));if(isPathOutsideRoot(relative))return{path:gitignorePath,changed:!1};relative.length>0&&(trackerRelativeRoot=relative)}let current="";try{current=await withGitignorePermissionRecovery(()=>readFile(gitignorePath,"utf8"))}catch(error){if(!(error instanceof Error&&"code"in error&&isFileMissingError(error)))throw error}const start=current.indexOf(PM_GITIGNORE_START),end=current.indexOf(PM_GITIGNORE_END),prefix=(start>=0&&end>=start?`${current.slice(0,start)}${current.slice(end+PM_GITIGNORE_END.length)}`:current).trimEnd(),next=`${prefix.length>0?`${prefix}
2
3
 
3
4
  `:""}${getPmGitignoreBlock(trackerRelativeRoot)}
4
- `;if(next===current){return{path:gitignorePath,changed:false}}await withGitignorePermissionRecovery(()=>writeFile(gitignorePath,next,"utf8"));return{path:gitignorePath,changed:true}}export{PM_GITIGNORE_DEFAULT_TRACKER_ROOT,PM_GITIGNORE_END,PM_GITIGNORE_RUNTIME_DIRECTORIES,PM_GITIGNORE_START,PM_GITIGNORE_TRACKED_FILES,ensurePmGitignore,getPmGitignoreBlock,isPathOutsideRoot};
5
+ `;return next===current?{path:gitignorePath,changed:!1}:(await withGitignorePermissionRecovery(()=>writeFile(gitignorePath,next,"utf8")),{path:gitignorePath,changed:!0})}export{PM_GITIGNORE_DEFAULT_TRACKER_ROOT,PM_GITIGNORE_END,PM_GITIGNORE_RUNTIME_DIRECTORIES,PM_GITIGNORE_START,PM_GITIGNORE_TRACKED_FILES,ensurePmGitignore,getPmGitignoreBlock,isPathOutsideRoot};
5
6
  //# sourceMappingURL=workspace.js.map
@@ -1,2 +1,2 @@
1
- !(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0ca7f52c-fb31-5cd9-b689-a918f4e61816")}catch(e2){}})();export*from"../types.js";
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0ca7f52c-fb31-5cd9-b689-a918f4e61816")}catch{}})();export*from"../types.js";
2
2
  //# sourceMappingURL=index.js.map
package/dist/types.js CHANGED
@@ -1,2 +1,2 @@
1
- !(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e33ee377-aae0-5158-9af6-e6081287a85b")}catch(e2){}})();const BUILTIN_ITEM_TYPE_VALUES=["Epic","Feature","Task","Chore","Issue","Decision","Event","Reminder","Milestone","Meeting","Plan"];const ITEM_TYPE_VALUES=BUILTIN_ITEM_TYPE_VALUES;const STATUS_VALUES=["draft","open","in_progress","blocked","closed","canceled"];const RUNTIME_STATUS_ROLE_VALUES=["draft","active","blocked","terminal","terminal_done","terminal_canceled","default_open","default_close","default_cancel"];const RUNTIME_FIELD_TYPE_VALUES=["string","number","boolean","string_array","array","object"];const RUNTIME_FIELD_COMMAND_VALUES=["create","update","update_many","list","search","calendar","context"];const RUNTIME_UNKNOWN_FIELD_POLICY_VALUES=["allow","warn","reject"];const DEPENDENCY_KIND_VALUES=["blocks","parent","child","parent_child","child_of","related","related_to","discovered_from","blocked_by","incident_from","epic","implements","recurs_from","supersedes","task","verifies"];const SCOPE_VALUES=["project","global"];const RISK_VALUES=["low","medium","high","critical"];const ISSUE_SEVERITY_VALUES=["low","medium","high","critical"];const CONFIDENCE_TEXT_VALUES=["low","medium","high"];const ITEM_FORMAT_VALUES=["toon","json_markdown"];const SPRINT_RELEASE_FORMAT_POLICY_VALUES=["warn","strict_error"];const PARENT_REFERENCE_POLICY_VALUES=["warn","strict_error"];const VALIDATE_METADATA_PROFILE_VALUES=["core","strict","custom"];const GOVERNANCE_PRESET_VALUES=["minimal","default","strict","custom"];const GOVERNANCE_OWNERSHIP_ENFORCEMENT_VALUES=["none","warn","strict"];const GOVERNANCE_CREATE_MODE_DEFAULT_VALUES=["progressive","strict"];const GOVERNANCE_CLOSE_VALIDATION_DEFAULT_VALUES=["off","warn","strict"];const GOVERNANCE_WORKFLOW_ENFORCEMENT_VALUES=["off","warn","strict"];const GOVERNANCE_DUPLICATE_DETECTION_MODE_VALUES=["off","advisory","strict"];const VALIDATE_METADATA_REQUIRED_FIELD_VALUES=["author","acceptance_criteria","estimated_minutes","close_reason","reviewer","risk","confidence","sprint","release"];const RECURRENCE_FREQUENCY_VALUES=["daily","weekly","monthly","yearly"];const RECURRENCE_WEEKDAY_VALUES=["mon","tue","wed","thu","fri","sat","sun"];function weekdayOrderIndex(value){return RECURRENCE_WEEKDAY_VALUES.indexOf(value)}const PLAN_MODE_VALUES=["draft","research","review","approved","executing","paused","completed","superseded"];const PLAN_STEP_STATUS_VALUES=["pending","in_progress","completed","blocked","skipped","superseded"];const PLAN_HARNESS_VALUES=["codex","claude-code","cursor","generic"];const PLAN_STEP_LINK_KIND_VALUES=["related","blocks","blocked_by","depends_on","discovered_from","implements","recurs_from","verifies","supersedes"];const CONTEXT_DEPTH_VALUES=["brief","standard","deep","full"];const CONTEXT_SECTION_VALUES=["hierarchy","activity","progress","recently_created","unparented","blockers","files","workload","staleness","tests"];export{BUILTIN_ITEM_TYPE_VALUES,CONFIDENCE_TEXT_VALUES,CONTEXT_DEPTH_VALUES,CONTEXT_SECTION_VALUES,DEPENDENCY_KIND_VALUES,GOVERNANCE_CLOSE_VALIDATION_DEFAULT_VALUES,GOVERNANCE_CREATE_MODE_DEFAULT_VALUES,GOVERNANCE_DUPLICATE_DETECTION_MODE_VALUES,GOVERNANCE_OWNERSHIP_ENFORCEMENT_VALUES,GOVERNANCE_PRESET_VALUES,GOVERNANCE_WORKFLOW_ENFORCEMENT_VALUES,ISSUE_SEVERITY_VALUES,ITEM_FORMAT_VALUES,ITEM_TYPE_VALUES,PARENT_REFERENCE_POLICY_VALUES,PLAN_HARNESS_VALUES,PLAN_MODE_VALUES,PLAN_STEP_LINK_KIND_VALUES,PLAN_STEP_STATUS_VALUES,RECURRENCE_FREQUENCY_VALUES,RECURRENCE_WEEKDAY_VALUES,RISK_VALUES,RUNTIME_FIELD_COMMAND_VALUES,RUNTIME_FIELD_TYPE_VALUES,RUNTIME_STATUS_ROLE_VALUES,RUNTIME_UNKNOWN_FIELD_POLICY_VALUES,SCOPE_VALUES,SPRINT_RELEASE_FORMAT_POLICY_VALUES,STATUS_VALUES,VALIDATE_METADATA_PROFILE_VALUES,VALIDATE_METADATA_REQUIRED_FIELD_VALUES,weekdayOrderIndex};
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e6847fdd-b2c1-5503-b510-56fdfdcf933f")}catch{}})();const BUILTIN_ITEM_TYPE_VALUES=["Epic","Feature","Task","Chore","Issue","Decision","Event","Reminder","Milestone","Meeting","Plan"],ITEM_TYPE_VALUES=BUILTIN_ITEM_TYPE_VALUES,STATUS_VALUES=["draft","open","in_progress","blocked","closed","canceled"],RUNTIME_STATUS_ROLE_VALUES=["draft","active","blocked","terminal","terminal_done","terminal_canceled","default_open","default_close","default_cancel"],RUNTIME_FIELD_TYPE_VALUES=["string","number","boolean","string_array","array","object"],RUNTIME_FIELD_COMMAND_VALUES=["create","update","update_many","list","search","calendar","context"],RUNTIME_UNKNOWN_FIELD_POLICY_VALUES=["allow","warn","reject"],DEPENDENCY_KIND_VALUES=["blocks","parent","child","parent_child","child_of","related","related_to","discovered_from","blocked_by","incident_from","epic","implements","recurs_from","supersedes","task","verifies"],SCOPE_VALUES=["project","global"],RISK_VALUES=["low","medium","high","critical"],ISSUE_SEVERITY_VALUES=["low","medium","high","critical"],CONFIDENCE_TEXT_VALUES=["low","medium","high"],ITEM_FORMAT_VALUES=["toon","json_markdown"],SPRINT_RELEASE_FORMAT_POLICY_VALUES=["warn","strict_error"],PARENT_REFERENCE_POLICY_VALUES=["warn","strict_error"],VALIDATE_METADATA_PROFILE_VALUES=["core","strict","custom"],GOVERNANCE_PRESET_VALUES=["minimal","default","strict","custom"],GOVERNANCE_OWNERSHIP_ENFORCEMENT_VALUES=["none","warn","strict"],GOVERNANCE_CREATE_MODE_DEFAULT_VALUES=["progressive","strict"],GOVERNANCE_CLOSE_VALIDATION_DEFAULT_VALUES=["off","warn","strict"],GOVERNANCE_WORKFLOW_ENFORCEMENT_VALUES=["off","warn","strict"],GOVERNANCE_DUPLICATE_DETECTION_MODE_VALUES=["off","advisory","strict"],VALIDATE_METADATA_REQUIRED_FIELD_VALUES=["author","acceptance_criteria","estimated_minutes","close_reason","reviewer","risk","confidence","sprint","release"],RECURRENCE_FREQUENCY_VALUES=["daily","weekly","monthly","yearly"],RECURRENCE_WEEKDAY_VALUES=["mon","tue","wed","thu","fri","sat","sun"];function weekdayOrderIndex(value){return RECURRENCE_WEEKDAY_VALUES.indexOf(value)}const PLAN_MODE_VALUES=["draft","research","review","approved","executing","paused","completed","superseded"],PLAN_STEP_STATUS_VALUES=["pending","in_progress","completed","blocked","skipped","superseded"],PLAN_HARNESS_VALUES=["codex","claude-code","cursor","generic"],PLAN_STEP_LINK_KIND_VALUES=["related","blocks","blocked_by","depends_on","discovered_from","implements","recurs_from","verifies","supersedes"],CONTEXT_DEPTH_VALUES=["brief","standard","deep","full"],CONTEXT_SECTION_VALUES=["hierarchy","activity","progress","recently_created","unparented","blockers","files","workload","staleness","tests"];export{BUILTIN_ITEM_TYPE_VALUES,CONFIDENCE_TEXT_VALUES,CONTEXT_DEPTH_VALUES,CONTEXT_SECTION_VALUES,DEPENDENCY_KIND_VALUES,GOVERNANCE_CLOSE_VALIDATION_DEFAULT_VALUES,GOVERNANCE_CREATE_MODE_DEFAULT_VALUES,GOVERNANCE_DUPLICATE_DETECTION_MODE_VALUES,GOVERNANCE_OWNERSHIP_ENFORCEMENT_VALUES,GOVERNANCE_PRESET_VALUES,GOVERNANCE_WORKFLOW_ENFORCEMENT_VALUES,ISSUE_SEVERITY_VALUES,ITEM_FORMAT_VALUES,ITEM_TYPE_VALUES,PARENT_REFERENCE_POLICY_VALUES,PLAN_HARNESS_VALUES,PLAN_MODE_VALUES,PLAN_STEP_LINK_KIND_VALUES,PLAN_STEP_STATUS_VALUES,RECURRENCE_FREQUENCY_VALUES,RECURRENCE_WEEKDAY_VALUES,RISK_VALUES,RUNTIME_FIELD_COMMAND_VALUES,RUNTIME_FIELD_TYPE_VALUES,RUNTIME_STATUS_ROLE_VALUES,RUNTIME_UNKNOWN_FIELD_POLICY_VALUES,SCOPE_VALUES,SPRINT_RELEASE_FORMAT_POLICY_VALUES,STATUS_VALUES,VALIDATE_METADATA_PROFILE_VALUES,VALIDATE_METADATA_REQUIRED_FIELD_VALUES,weekdayOrderIndex};
2
2
  //# sourceMappingURL=types.js.map
@@ -0,0 +1,88 @@
1
+ # Agent evidence consistency
2
+
3
+ Trackers: [pm-gh1383](../.agents/pm/issues/pm-gh1383.toon),
4
+ [pm-gh1385](../.agents/pm/issues/pm-gh1385.toon), and
5
+ [pm-7wzc6f](../.agents/pm/issues/pm-7wzc6f.toon). Distribution verification:
6
+ [pm-2evidence-dist](../.agents/pm/issues/pm-2evidence-dist.toon).
7
+
8
+ ## Agent quick context
9
+
10
+ Evidence must retain its literal text, validation must compare a consistent
11
+ item/history pair, and recovery help must identify a declared command. These
12
+ contracts apply to ordinary project work and to the evidence used for recursive
13
+ self-improvement.
14
+
15
+ ## Literal annotations
16
+
17
+ `comments`, `notes`, and `learnings` preserve positional annotation bodies through
18
+ bootstrap normalization. A prefix such as `TDD:` or `add:` is evidence text.
19
+ The same text is preserved when supplied through `--add`, `--file`, `--stdin`,
20
+ `--add -`, or `--file -`.
21
+
22
+ ```bash
23
+ pm comments <id> "TDD: regression reproduced before the fix"
24
+ pm notes <id> --file evidence.txt
25
+ pm learnings <id> --stdin
26
+ ```
27
+
28
+ The annotation SDK still supports its explicit `text:` and `text=` structured
29
+ input syntax. Files and standard input remain literal text sources. Other
30
+ commands retain their supported bare-key option normalization.
31
+
32
+ ## Consistent history validation
33
+
34
+ Validation first scans the captured corpus. An ordinary writer can advance an
35
+ item and its history after that capture. An item-hash discrepancy is therefore
36
+ read again while holding the same item mutation lock used by ordinary writers.
37
+ This fresh source/history pair determines the finding. A reread whose declared
38
+ identity differs from the locked identity fails before any finding is replaced.
39
+
40
+ Clean rows and history-only findings do not incur another item read or lock
41
+ acquisition. Each item-hash discrepancy gets one bounded recheck. Lock contention
42
+ and missing or unreadable item source are reported as failures; validation does
43
+ not steal locks or certify an unread pair.
44
+ Missing histories, malformed streams, record-chain corruption, unsupported
45
+ epochs, and identity discontinuities retain their strict findings. History-only
46
+ diagnostics remain available to repair workflows even when a writer owns the item.
47
+ Workspace singleton findings retain their own verification semantics.
48
+
49
+ The core `scanHistoryDrift` API continues to compare the snapshots supplied by
50
+ its caller. Its strict `scanItemHistoryDrift` companion shares stream verification
51
+ without loading or writing the corpus cache or rereading workspace history and
52
+ governed documents. Workspace checks run once in the initial corpus scan.
53
+
54
+ ## Declared recovery help
55
+
56
+ An unknown option has no declared value arity. In an invocation such as
57
+ `pm --unknown-option synthetic-value context`, the parser cannot safely assume
58
+ that `synthetic-value` is a command. Recovery falls back to `pm --help --all`
59
+ unless the inferred target belongs to the core or active runtime command surface.
60
+ Known commands, command-first invocations, namespaced aliases, and options with
61
+ an equals value retain command-specific recovery help.
62
+
63
+ ## Verification
64
+
65
+ The regression owner exercises real isolated tracker persistence, all annotation
66
+ transports, strict corruption cases, writer-lock contention, cache preservation,
67
+ identity binding, bounded cache reads, and public bootstrap normalization:
68
+
69
+ ```bash
70
+ node scripts/run-tests.mjs test -- tests/unit/regressions/agent-evidence-consistency.spec.ts
71
+ node scripts/release/agent-evidence-consistency-control.mjs
72
+ node scripts/release/agent-evidence-consistency-control.mjs --negative-control
73
+ ```
74
+
75
+ The final command must exit with status `1`: each disposable source mutation
76
+ must fail its selected regression. A failure caused by unrelated setup is not
77
+ accepted as regression proof.
78
+
79
+ Build finalization also compacts redundant syntax in retained runtime modules.
80
+ Exported names, module paths, declarations, bundled files and original source
81
+ maps remain covered by real filesystem and Node consumer tests. The npm artifact
82
+ must satisfy its existing size ceiling before installed npm/npx/bunx acceptance.
83
+
84
+ Packed SDK continuation acceptance stages the actual publish selectors and
85
+ unchanged package manifest in a disposable source directory before invoking
86
+ `npm pack`. This avoids traversing development dependencies while retaining
87
+ the real tarball, public SDK export, and existing process and test time limits.
88
+ Installed package smoke acceptance separately verifies dependency installation.
@@ -67,6 +67,31 @@ remains complete and `recovery.suggested_retry_args` is atomic: the projector
67
67
  either retains the executable argv or removes the recovery rather than slicing
68
68
  it into a dead command.
69
69
 
70
+ Enum, date, get-depth, and minimum intent-budget validation producers attach the failed metadata
71
+ `field` and supplied `value` to `PmCliError.context`; closed domains also attach
72
+ the complete legal values, including the accepted `full` depth alias. CLI
73
+ attribution normalizes camelCase and snake_case fields to an actually supplied
74
+ canonical flag, so `tokenBudget` identifies `--token-budget`. Explicit flag
75
+ metadata retains its spelling. Argument order and unrelated valid flags cannot
76
+ become the refusal owner. The error-context `value` is text, including the
77
+ textual representation of numeric SDK inputs. Compound projection conflicts
78
+ identify their flag without inventing a rejected scalar. Missing items identify
79
+ the `id` operand.
80
+ When the producer cannot identify a field or value, the diagnostic retains the
81
+ command surface and omits the unknown scalar. Policy evidence takes precedence
82
+ over syntactic attribution. Tracked by [pm-gh1365](../.agents/pm/issues/pm-gh1365.toon).
83
+
84
+ `--json` and `--output-format json` (including `--output-format=json`) select
85
+ JSON on stderr for parser and execution errors as well as successful output.
86
+ The canonical `--output-format` selector wins when combined with `--json`, so
87
+ `--output-format toon --json` retains text diagnostics. Exit codes are unchanged.
88
+ The executable's project-runtime compatibility warnings and refusals use that
89
+ same SDK selector, including repeated formats and the `--` terminator. A JSON
90
+ stale-read warning is emitted after successful dispatch; a failed read emits its
91
+ typed error alone so stderr remains one JSON value. Text warnings retain their
92
+ pre-dispatch presentation.
93
+ Tracked by [pm-gh1366](../.agents/pm/issues/pm-gh1366.toon).
94
+
70
95
  The deterministic ladder is:
71
96
 
72
97
  1. full diagnostic;
@@ -0,0 +1,68 @@
1
+ # Actionable item-read evidence
2
+
3
+ Trackers: [pm-gh1388](../.agents/pm/issues/pm-gh1388.toon),
4
+ [pm-gh1389](../.agents/pm/issues/pm-gh1389.toon).
5
+
6
+ The public SDK item query supplies the same evidence to CLI and MCP callers.
7
+ Standard and deep current reads include a `blockers` facet when the item declares
8
+ prerequisites through its legacy `blocked_by` scalar or `blocked_by` dependency
9
+ edges. `blockers.open` supplies each nonterminal target's ID, title and status;
10
+ `blockers.closed_count` counts terminal targets using the runtime status registry.
11
+ Repeated scalar/edge references are deduplicated by the shared actionability
12
+ primitive. Missing targets and external references remain unresolved, with null
13
+ status, so they cannot silently authorize work.
14
+ Short local references resolve to their verified full IDs and count once even
15
+ when both forms are stored. Rows under `open` are unresolved by definition;
16
+ they omit the redundant `resolved: false` flag while retaining resolver context.
17
+ Legacy text that is not a portable filename remains unresolved and never causes
18
+ a lookup outside the registered item folders.
19
+ A target file with a different embedded item identity refuses the read with an
20
+ identity conflict rather than borrowing an unrelated item's terminal status.
21
+
22
+ `blockers.scope` is `declared`: the facet resolves forward declarations from this
23
+ item, without enumerating unrelated items. Reverse `blocks` relationships require
24
+ a corpus graph or actionability query. The stored scalar remains a compatibility
25
+ field and identifies only the last scalar value. Standard reads replace that
26
+ partial scalar with the complete declared facet; `--fields blocked_by` and
27
+ `--full` retain access to the stored scalar. Storage and provenance are preserved.
28
+ Ordinary dependency rows retain `id` and `kind`; `--full`, `--depth full`, and
29
+ `--fields dependencies` restore the stored timestamp and author/source columns.
30
+ The `dependency_provenance` omission receipt names `--fields dependencies` as the
31
+ narrow restoration. This presentation change preserves every stored edge.
32
+ The receipt describes attribution actually withheld by the selected projection.
33
+ Legacy rows with no timestamp remain complete under full or explicit reads;
34
+ following the restoration never invents a timestamp or repeats a false omission.
35
+ Rows containing only identities and kinds have no attribution to withhold.
36
+ Field selection takes precedence when combined with `--depth full`: a narrow
37
+ selector still discloses withheld attribution, while selecting `dependencies`
38
+ restores its complete stored rows.
39
+
40
+ ```bash
41
+ pm get <id>
42
+ pm get <id> --depth brief
43
+ pm get <id> --fields blockers
44
+ ```
45
+
46
+ Brief and selected reads disclose material withheld blocker evidence with the
47
+ compact `--full` restoration. Use `--fields blockers` for the narrow facet alone;
48
+ `item.blockers` is an equivalent selector.
49
+ Historical reads preserve historical metadata and omit current blocker status.
50
+ An explicit historical blocker projection refuses with current-read guidance,
51
+ because a present-day target status cannot certify a past prerequisite state.
52
+
53
+ Omission receipts account for what the result actually renders. A reminder or
54
+ event supplied through `schedule.reminders` or `schedule.events` is included even
55
+ when its metadata alias is absent. Nonempty files, tests and docs rendered under
56
+ `linked` are included too. Narrow selectors continue to disclose unselected
57
+ material members; the stable linked envelope's empty placeholders do not certify
58
+ that unrequested artifact contents were returned.
59
+
60
+ ```bash
61
+ pm get <id> --fields schedule.reminders
62
+ pm get <id> --fields linked.tests
63
+ ```
64
+
65
+ The regression suite creates actual disposable tracker data and checks open,
66
+ terminal, custom-terminal, missing and external prerequisites; brief restoration;
67
+ historical separation; and independent schedule/artifact alias projections.
68
+ No source tracker, mocked resolver or suppressed drift check is involved.
@@ -232,6 +232,29 @@ activity limits so the built-in orientation declaration remains feasible on a
232
232
  large tracker. All five intent commands accept the same
233
233
  `--token-budget` override. Explicit `--depth` and `--limit` controls still win.
234
234
 
235
+ Context omission instructions request the named section, for example
236
+ `--section files`, so they can be appended while retaining `--for handoff` or
237
+ `--for orient`. An explicit depth suppresses the intent's default section subset;
238
+ an explicit section remains authoritative at any depth. Workspace memory that
239
+ is already present is never reported as omitted. The original filters and token
240
+ budget remain binding; an oversized restoration reports its remaining budget
241
+ constraint. Tracked by [pm-gh1367](../.agents/pm/issues/pm-gh1367.toon).
242
+
243
+ For namespaced commands, options supplied on an ancestor apply only when the
244
+ selected leaf declares them. `context --tag urgent next` forwards the tag;
245
+ a leaf-supplied limit takes precedence. `context next --depth deep` and
246
+ `context --depth deep next` fail with `unknown_option`, because `next` does not
247
+ declare a depth projection. Inspect the leaf's help before applying context
248
+ controls to it. Tracked by [pm-gh1368](../.agents/pm/issues/pm-gh1368.toon).
249
+
250
+ Ownership compositions use the resolved canonical item ID in every stage and
251
+ the root receipt, including short-ID invocations. Default CLI/MCP start, pause,
252
+ and close receipts expose the final status and aggregate changed-field count
253
+ without repeating item bodies. `--full-changed-fields` and typed SDK methods
254
+ retain complete constituent results. A failed later step reports the canonical
255
+ item and prior durable mutation without implying rollback.
256
+ Tracked by [pm-gh1369](../.agents/pm/issues/pm-gh1369.toon).
257
+
235
258
  If a selected result exceeds its budget, long explanatory strings compact
236
259
  first, followed by deterministic root-row reduction that retains at least one
237
260
  useful row and reports `budget_row_compaction`. Only a result whose minimum
package/docs/README.md CHANGED
@@ -35,6 +35,8 @@ pm guide release --json
35
35
  - [Onboarding](ONBOARDING.md) - first-two-hours maintainer and contributor setup.
36
36
  - [Agent Guide](AGENT_GUIDE.md) - canonical agent loop, tracker linking, and token-minimal command choices.
37
37
  - [Agent Read and Test Receipts](AGENT_READ_AND_TEST_RECEIPTS.md) - JSON help provenance, linked-test persistence, and history diff continuation.
38
+ - [Agent Evidence Consistency](AGENT_EVIDENCE_CONSISTENCY.md) - literal annotations, concurrent history validation, and declared recovery help.
39
+ - [Actionable Item-read Evidence](GET_READ_EVIDENCE.md) - declared blocker status, historical separation, and truthful schedule/artifact omission receipts.
38
40
  - [Command Reference](COMMANDS.md) - command families with examples and when to use each family.
39
41
  - [Context and Operations Namespaces](COMMAND_NAMESPACES.md) - native navigation, diagnostics, event streams, and compatibility aliases.
40
42
  - [CLI Scripting Contract](SCRIPTING.md) - exit codes, flat mutation receipts versus read envelopes, stdout/stderr boundaries, stable JSON fields, uniform OR filters, and shell composition recipes.
@@ -3,6 +3,7 @@
3
3
  The extension settings contract is tracked by
4
4
  [pm-wtqltn](../.agents/pm/issues/pm-wtqltn.toon). Full-item JSON annotation
5
5
  integrity is tracked by [pm-2589e6](../.agents/pm/issues/pm-2589e6.toon).
6
+ Canonical previews are tracked by [pm-2sef82](../.agents/pm/features/pm-2sef82.toon).
6
7
 
7
8
  ## Extension settings
8
9
 
@@ -36,10 +37,44 @@ the same operation ID can then be used for the real mutation. A normal return
36
37
  also reports `changed` and `dry_run`. Invalid results fail before writing, and
37
38
  a history-append failure restores the previous settings bytes. The callback
38
39
  must derive its complete next settings object from the locked `current` value.
40
+ The callback receives normalized inline settings with defaults and preset knobs
41
+ even when the source file is sparse. Returning that tree unchanged retains the
42
+ original source bytes, including unknown fields, without creating an audit event.
43
+ Changed writes apply known-setting changes to the captured source through the
44
+ standard serializer, preserving sparse omissions and unrecognized fields in
45
+ unchanged containers for forward compatibility. Those fields remain outside the
46
+ typed callback and canonical preview. Replacing an array replaces its complete
47
+ contents, as in normal settings writes. Present legacy values are canonicalized
48
+ on a changed write; an identity no-op still retains the original bytes.
49
+ The host also validates the final serialized bytes before committing, so a
50
+ proposal that changes while being serialized cannot persist invalid settings.
39
51
  The host applies the standard settings serializer, including legacy format
40
52
  coercion and collection-name sanitization, and runs active `onWrite` hooks
41
53
  after a changed write.
42
54
 
55
+ Request `includePreview: true` to receive an optional `preview` settings tree
56
+ alongside the receipt. The host resolves it from the exact serialized bytes
57
+ inside the audit lock, using the same defaults and governance presets as normal
58
+ settings reads. A named `minimal` preset therefore reports ownership `none`
59
+ even if the callback proposed `strict`. Custom presets retain their configured
60
+ knobs. Legacy formats and collection names reflect their canonical persisted
61
+ values. This tree describes inline settings before optional file-backed schema
62
+ overlays; it does not load or create those files.
63
+
64
+ Use `dryRun: true, includePreview: true` to inspect the result before applying
65
+ the same operation. A fresh no-op also includes its canonical tree. An idempotent
66
+ replay omits `preview`: the original callback is not re-executed, and later
67
+ settings changes cannot reconstruct its historical proposal. Receipts remain
68
+ three booleans when the option is absent. Direct SDK dry runs read configuration
69
+ without executing read hooks, scaffolding optional schemas, or populating the
70
+ hydrated settings cache. Mutation callbacks should only derive settings and
71
+ avoid external side effects.
72
+
73
+ For an extension that requires previews, set its manifest `pm_min_version` to
74
+ a published host release containing this option. Check for `preview` on a fresh
75
+ dry-run operation before applying settings, while allowing replay receipts to
76
+ omit it as described above.
77
+
43
78
  ## Full-item JSON updates
44
79
 
45
80
  `pm update <id> --stdin-json` accepts a full item read document. New comments,
package/docs/TESTING.md CHANGED
@@ -575,6 +575,14 @@ pm test <item-id> --run --workspace-context snapshot --override-linked-workspace
575
575
  must be physically disjoint; overlapping roots fail before copying with a
576
576
  diagnostic directing the caller to a temporary root outside the checkout.
577
577
 
578
+ Snapshot target probes treat only `ENOENT` as absence and propagate other
579
+ filesystem failures. They use explicit error handling so Node 22 and older
580
+ Node 24 releases retain the same dangling-link behavior; the async `stat`
581
+ `throwIfNoEntry` option was added in
582
+ [Node 24.15](https://nodejs.org/download/release/v24.20.0/docs/api/fs.html#fspromisesstatpath-options).
583
+ The real filesystem and CLI snapshot suite runs in the required Node 22
584
+ telemetry regression job and native Windows regression job before merge.
585
+
578
586
  The real-filesystem regression for this contract is tracked by
579
587
  [pm-5iwfkj](../.agents/pm/issues/pm-5iwfkj.toon).
580
588