@unbrained/pm-cli 2026.10.4 → 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 (732) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +11 -0
  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.js +4 -4
  93. package/dist/cli/schema/registration.js +2 -2
  94. package/dist/cli/schema-registration-helpers.js +1 -1
  95. package/dist/cli/search-refresh.js +1 -1
  96. package/dist/cli/stats-analytics-json.js +1 -1
  97. package/dist/cli/telemetry-flush.js +1 -1
  98. package/dist/cli-bundle/bundle-manifest.json +163 -163
  99. package/dist/cli-bundle/chunks/chunk-3CYOBJUK.js +3 -0
  100. package/dist/cli-bundle/chunks/chunk-5MNOWZPN.js +3 -0
  101. package/dist/cli-bundle/chunks/chunk-AJ7H6XUF.js +20 -0
  102. package/dist/cli-bundle/chunks/chunk-D332RXZ7.js +80 -0
  103. package/dist/cli-bundle/chunks/chunk-HRJ6G6ZG.js +31 -0
  104. package/dist/cli-bundle/chunks/chunk-KRVI56QE.js +6 -0
  105. package/dist/cli-bundle/chunks/chunk-N4YGSG6F.js +238 -0
  106. package/dist/cli-bundle/chunks/{chunk-7CE2DJMA.js → chunk-OOLYASYJ.js} +2 -2
  107. package/dist/cli-bundle/chunks/chunk-R7CG2DB7.js +2 -0
  108. package/dist/cli-bundle/chunks/chunk-TGMONGWX.js +2 -0
  109. package/dist/cli-bundle/chunks/chunk-UZ7BIUCI.js +2 -0
  110. package/dist/cli-bundle/chunks/{chunk-GZMWISWW.js → chunk-VZ63DEVJ.js} +3 -3
  111. package/dist/cli-bundle/chunks/chunk-WFZ4UEOB.js +2 -0
  112. package/dist/cli-bundle/chunks/chunk-YVBRASXO.js +8 -0
  113. package/dist/cli-bundle/chunks/{chunk-SMKHR6BM.js → chunk-Z66DWDAU.js} +87 -87
  114. package/dist/cli-bundle/chunks/{register-list-query-QBGXO5JJ.js → register-list-query-75QXHIFH.js} +11 -11
  115. package/dist/cli-bundle/chunks/register-mutation-YS54SCHG.js +20 -0
  116. package/dist/cli-bundle/chunks/register-operations-6KHZQSYJ.js +2 -0
  117. package/dist/cli-bundle/chunks/register-setup-RTATEN2M.js +2 -0
  118. package/dist/cli-bundle/focused-chunks/{chunk-Q6DJ5DFQ.js → chunk-2CVX3KR3.js} +2 -2
  119. package/dist/cli-bundle/focused-chunks/chunk-5C3IDDW7.js +2 -0
  120. package/dist/cli-bundle/focused-chunks/{chunk-467EW5RL.js → chunk-ABV67XCC.js} +3 -3
  121. package/dist/cli-bundle/focused-chunks/chunk-B5RSLVE6.js +3 -0
  122. package/dist/cli-bundle/focused-chunks/chunk-C224METM.js +20 -0
  123. package/dist/cli-bundle/focused-chunks/chunk-CLDPTMQY.js +6 -0
  124. package/dist/cli-bundle/focused-chunks/chunk-DDRN42PB.js +8 -0
  125. package/dist/cli-bundle/focused-chunks/{chunk-7O4NUJVO.js → chunk-DOVTUKJQ.js} +2 -2
  126. package/dist/cli-bundle/focused-chunks/chunk-ECBOPEJE.js +75 -0
  127. package/dist/cli-bundle/focused-chunks/chunk-GITOYRUW.js +165 -0
  128. package/dist/cli-bundle/focused-chunks/chunk-GUIF3WVC.js +30 -0
  129. package/dist/cli-bundle/focused-chunks/chunk-LE4JUCRR.js +3 -0
  130. package/dist/cli-bundle/focused-chunks/{chunk-HFAW3FJQ.js → chunk-PSXFFQFT.js} +2 -2
  131. package/dist/cli-bundle/focused-chunks/chunk-RHIH6XIW.js +12 -0
  132. package/dist/cli-bundle/focused-chunks/chunk-UDYRVBOZ.js +2 -0
  133. package/dist/cli-bundle/focused-chunks/chunk-XV5RV4ZT.js +2 -0
  134. package/dist/cli-bundle/focused-chunks/{chunk-JCVMOSWQ.js → chunk-YMU42COG.js} +2 -2
  135. package/dist/cli-bundle/main.js +27 -27
  136. package/dist/cli-bundle/sdk-authoring.js +1 -1
  137. package/dist/cli-bundle/sdk-contracts.js +2 -2
  138. package/dist/cli-bundle/sdk-core.js +32 -32
  139. package/dist/cli-bundle/sdk-governance.js +1 -1
  140. package/dist/cli-bundle/sdk-graph.js +1 -1
  141. package/dist/cli-bundle/sdk-merge.js +55 -55
  142. package/dist/cli-bundle/sdk-query.js +1 -1
  143. package/dist/cli-bundle/sdk-runtime.js +1 -1
  144. package/dist/cli-bundle/sdk-testing.js +1 -1
  145. package/dist/cli-bundle/sdk.js +10 -10
  146. package/dist/cli.js +1 -1
  147. package/dist/core/checkpoint/checkpoint-gc.js +1 -1
  148. package/dist/core/checkpoint/mutation-checkpoint.js +2 -2
  149. package/dist/core/config/nested-settings.js +1 -1
  150. package/dist/core/config/positional-value.js +1 -1
  151. package/dist/core/diagnostics/remediation.js +1 -1
  152. package/dist/core/extensions/activation-summary-markdown.js +2 -1
  153. package/dist/core/extensions/activation-summary.js +1 -1
  154. package/dist/core/extensions/activation-transaction.js +1 -1
  155. package/dist/core/extensions/capability-usage.js +1 -1
  156. package/dist/core/extensions/command-hook-context.js +1 -1
  157. package/dist/core/extensions/command-metadata-contract.js +1 -1
  158. package/dist/core/extensions/command-visibility-tier.js +1 -1
  159. package/dist/core/extensions/contribution-inventory.js +1 -1
  160. package/dist/core/extensions/exporter-output-contract.js +1 -1
  161. package/dist/core/extensions/extension-candidate.js +1 -1
  162. package/dist/core/extensions/extension-capability-aliases.js +1 -1
  163. package/dist/core/extensions/extension-hook-runtime.js +1 -1
  164. package/dist/core/extensions/extension-policy.js +1 -1
  165. package/dist/core/extensions/extension-registries.js +1 -1
  166. package/dist/core/extensions/extension-runtime-helpers.js +1 -1
  167. package/dist/core/extensions/extension-types.js +1 -1
  168. package/dist/core/extensions/flag-definition-validation.js +1 -1
  169. package/dist/core/extensions/flag-value-types.js +1 -1
  170. package/dist/core/extensions/index.js +1 -1
  171. package/dist/core/extensions/item-field-types.js +1 -1
  172. package/dist/core/extensions/item-fields.js +1 -1
  173. package/dist/core/extensions/loader.js +1 -1
  174. package/dist/core/extensions/manifest-parser.js +1 -1
  175. package/dist/core/extensions/manifest-schema.js +1 -1
  176. package/dist/core/extensions/module-graph-snapshot.js +1 -1
  177. package/dist/core/extensions/preflight-ownership.js +1 -1
  178. package/dist/core/extensions/registration-contracts.js +1 -1
  179. package/dist/core/extensions/registration-validation.js +1 -1
  180. package/dist/core/extensions/registration-values.js +1 -1
  181. package/dist/core/extensions/reserved-host-flags.js +1 -1
  182. package/dist/core/extensions/runtime-registrations.js +1 -1
  183. package/dist/core/extensions/service-ownership.js +1 -1
  184. package/dist/core/extensions/version-compat.js +1 -1
  185. package/dist/core/fs/atomic-create.js +1 -1
  186. package/dist/core/fs/fs-utils.js +2 -2
  187. package/dist/core/fs/host-environment-errors.js +1 -1
  188. package/dist/core/fs/index.js +1 -1
  189. package/dist/core/fs/path-utils.js +1 -1
  190. package/dist/core/governance/content-fields.js +1 -1
  191. package/dist/core/governance/issue-codes.js +1 -1
  192. package/dist/core/governance/metadata-coverage.js +1 -1
  193. package/dist/core/history/digest.js +1 -1
  194. package/dist/core/history/drift-cache.js +3 -3
  195. package/dist/core/history/drift-scan.d.ts +4 -0
  196. package/dist/core/history/drift-scan.js +1 -1
  197. package/dist/core/history/event-classification.js +1 -1
  198. package/dist/core/history/event-index.js +8 -7
  199. package/dist/core/history/history-compact-bulk.js +1 -1
  200. package/dist/core/history/history-diff.js +1 -1
  201. package/dist/core/history/history-rewrite.js +1 -1
  202. package/dist/core/history/history-storage-stats.js +1 -1
  203. package/dist/core/history/history-stream-policy.js +1 -1
  204. package/dist/core/history/history.js +2 -2
  205. package/dist/core/history/identity.js +1 -1
  206. package/dist/core/history/index.js +1 -1
  207. package/dist/core/history/operation-contract.js +1 -1
  208. package/dist/core/history/projection.js +1 -1
  209. package/dist/core/history/read.js +1 -1
  210. package/dist/core/history/replay.js +2 -1
  211. package/dist/core/history/tombstone.js +1 -1
  212. package/dist/core/history/version-address.js +1 -1
  213. package/dist/core/history/workspace-history.js +2 -2
  214. package/dist/core/io/body-file.js +1 -1
  215. package/dist/core/io/bulk-ids-input.js +2 -1
  216. package/dist/core/item/actionability.js +1 -1
  217. package/dist/core/item/dependency-reference.js +1 -1
  218. package/dist/core/item/id.js +1 -1
  219. package/dist/core/item/index.js +1 -1
  220. package/dist/core/item/item-format-version.js +1 -1
  221. package/dist/core/item/item-format.js +6 -4
  222. package/dist/core/item/item-record.js +1 -1
  223. package/dist/core/item/item-type-definition.js +1 -1
  224. package/dist/core/item/parent-reference-policy.js +1 -1
  225. package/dist/core/item/parse.js +8 -2
  226. package/dist/core/item/plan-lifecycle.js +1 -1
  227. package/dist/core/item/priority.js +1 -1
  228. package/dist/core/item/sprint-release-format.js +1 -1
  229. package/dist/core/item/status-filter.js +1 -1
  230. package/dist/core/item/status.js +1 -1
  231. package/dist/core/item/toon-decode.js +1 -1
  232. package/dist/core/item/type-registry.js +1 -1
  233. package/dist/core/item/type-synonyms.js +1 -1
  234. package/dist/core/lock/index.js +1 -1
  235. package/dist/core/lock/lock-gc.js +1 -1
  236. package/dist/core/lock/lock.js +3 -3
  237. package/dist/core/output/mutation-projection.js +1 -1
  238. package/dist/core/output/output-control.js +1 -1
  239. package/dist/core/output/output.js +22 -10
  240. package/dist/core/output/query-summary.js +1 -1
  241. package/dist/core/output/tabular.js +3 -1
  242. package/dist/core/packages/manifest.js +1 -1
  243. package/dist/core/packages/root.js +1 -1
  244. package/dist/core/policy/workflow-policy-schema.js +1 -1
  245. package/dist/core/policy/workflow-policy-store.js +1 -1
  246. package/dist/core/policy/workflow-policy.js +1 -1
  247. package/dist/core/profile/profile-describe.js +1 -1
  248. package/dist/core/profile/profile-lint.js +1 -1
  249. package/dist/core/profile/profile-plan.js +1 -1
  250. package/dist/core/profile/profile-presets.js +25 -1
  251. package/dist/core/reproducibility/context.js +1 -1
  252. package/dist/core/schema/fields-file.js +2 -2
  253. package/dist/core/schema/item-types-file.js +2 -2
  254. package/dist/core/schema/runtime-field-filters.js +1 -1
  255. package/dist/core/schema/runtime-field-values.js +1 -1
  256. package/dist/core/schema/runtime-schema.js +2 -2
  257. package/dist/core/schema/status-defs-file.js +2 -2
  258. package/dist/core/schema/status-token.js +1 -1
  259. package/dist/core/schema/type-inference.js +1 -1
  260. package/dist/core/schema/type-presets.js +1 -1
  261. package/dist/core/schema/type-workflows.js +1 -1
  262. package/dist/core/search/background-refresh.js +2 -2
  263. package/dist/core/search/bm25.js +1 -1
  264. package/dist/core/search/cache.js +2 -2
  265. package/dist/core/search/corpus.js +1 -1
  266. package/dist/core/search/embedding-batches.js +1 -1
  267. package/dist/core/search/eval-thresholds.js +1 -1
  268. package/dist/core/search/eval.js +1 -1
  269. package/dist/core/search/http-client.js +1 -1
  270. package/dist/core/search/providers.js +1 -1
  271. package/dist/core/search/relevance.js +1 -1
  272. package/dist/core/search/semantic-defaults.js +1 -1
  273. package/dist/core/search/staleness.js +1 -1
  274. package/dist/core/search/vector-stores.js +2 -2
  275. package/dist/core/search/vectorization-metadata.js +1 -1
  276. package/dist/core/sentry/helpers.js +1 -1
  277. package/dist/core/sentry/instrument.js +1 -1
  278. package/dist/core/session/session-state.js +1 -1
  279. package/dist/core/shared/agent-session-context.js +1 -1
  280. package/dist/core/shared/author.js +5 -1
  281. package/dist/core/shared/command-line.js +1 -1
  282. package/dist/core/shared/command-types.js +1 -1
  283. package/dist/core/shared/conflict-markers.js +1 -1
  284. package/dist/core/shared/constants.js +1 -1
  285. package/dist/core/shared/errors.js +1 -1
  286. package/dist/core/shared/html-entity-decode.js +1 -1
  287. package/dist/core/shared/index.js +1 -1
  288. package/dist/core/shared/item-metadata-contract.js +1 -1
  289. package/dist/core/shared/lazy-module.js +1 -1
  290. package/dist/core/shared/levenshtein.js +1 -1
  291. package/dist/core/shared/memo.js +1 -1
  292. package/dist/core/shared/numeric-parsers.js +1 -1
  293. package/dist/core/shared/option-alias-visibility.js +1 -1
  294. package/dist/core/shared/primitives.js +1 -1
  295. package/dist/core/shared/secret-rules.js +1 -1
  296. package/dist/core/shared/serial-queue.js +1 -1
  297. package/dist/core/shared/serialization.js +1 -1
  298. package/dist/core/shared/split-comma-list.js +1 -1
  299. package/dist/core/shared/text-normalization.js +1 -1
  300. package/dist/core/shared/time.js +2 -1
  301. package/dist/core/store/index.js +1 -1
  302. package/dist/core/store/item-format-migration.js +1 -1
  303. package/dist/core/store/item-metadata-cache.js +1 -1
  304. package/dist/core/store/item-metadata-query-index.js +7 -7
  305. package/dist/core/store/item-metadata-read-work.js +1 -1
  306. package/dist/core/store/item-store.js +1 -1
  307. package/dist/core/store/paths.js +1 -1
  308. package/dist/core/store/settings-concurrency.js +1 -1
  309. package/dist/core/store/settings-read-cache.js +1 -1
  310. package/dist/core/store/settings-validator.js +1 -1
  311. package/dist/core/store/settings.js +3 -3
  312. package/dist/core/store/tracker-preflight.js +1 -1
  313. package/dist/core/telemetry/consent.js +2 -2
  314. package/dist/core/telemetry/observability.js +1 -1
  315. package/dist/core/telemetry/policy.js +1 -1
  316. package/dist/core/telemetry/read-sampling.js +2 -2
  317. package/dist/core/telemetry/runtime.js +9 -5
  318. package/dist/core/test/background-runs.js +3 -3
  319. package/dist/core/test/item-test-run-tracking.js +1 -1
  320. package/dist/core/test/run-selectors.js +1 -1
  321. package/dist/core/validate/estimate-defaults.js +1 -1
  322. package/dist/core/validate/fix-planning.js +1 -1
  323. package/dist/core/validate/linked-artifact-reference.js +1 -1
  324. package/dist/core/validate/missing-by-type.js +1 -1
  325. package/dist/core/validate/missing-link-owners.js +1 -1
  326. package/dist/core/validate/stale-file-classification.js +1 -1
  327. package/dist/mcp/http-server.js +6 -4
  328. package/dist/mcp/legacy-adapter.js +1 -1
  329. package/dist/mcp/runtime-capabilities.js +1 -1
  330. package/dist/mcp/server.js +4 -4
  331. package/dist/mcp/tool-definitions.js +1 -1
  332. package/dist/sdk/actionability.js +1 -1
  333. package/dist/sdk/agent/closed-domain-contracts.js +1 -1
  334. package/dist/sdk/agent/command-recovery.js +1 -1
  335. package/dist/sdk/agent/command-suggestions.js +1 -1
  336. package/dist/sdk/agent/create-option-policy.js +1 -1
  337. package/dist/sdk/agent/identity-config.js +1 -1
  338. package/dist/sdk/agent/item-addressing.js +1 -1
  339. package/dist/sdk/agent/refusal-closure-census.js +2 -1
  340. package/dist/sdk/agent/refusal-closure.js +1 -1
  341. package/dist/sdk/agent/refusal-corpus-contracts.js +1 -1
  342. package/dist/sdk/agent/refusal-reachability.js +3 -1
  343. package/dist/sdk/agent/subcommand-recovery.js +1 -1
  344. package/dist/sdk/agent/task-transcript-contracts.js +1 -1
  345. package/dist/sdk/agent/tracker-preflight-contracts.js +1 -1
  346. package/dist/sdk/agent-capability-contracts.js +3 -1
  347. package/dist/sdk/agent-session-context.js +1 -1
  348. package/dist/sdk/annotations.js +1 -1
  349. package/dist/sdk/author-attribution.js +1 -1
  350. package/dist/sdk/authoring.js +1 -1
  351. package/dist/sdk/cli-bootstrap.js +1 -1
  352. package/dist/sdk/cli-contracts/agent-output-contracts.js +5 -3
  353. package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +1 -1
  354. package/dist/sdk/cli-contracts/command-aliases.js +1 -1
  355. package/dist/sdk/cli-contracts/command-exit-contracts.js +1 -1
  356. package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
  357. package/dist/sdk/cli-contracts/commander-types.js +1 -1
  358. package/dist/sdk/cli-contracts/completeness.js +1 -1
  359. package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
  360. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  361. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +2 -1
  362. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
  363. package/dist/sdk/cli-contracts/registration-helpers.js +7 -7
  364. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  365. package/dist/sdk/cli-contracts/schemas/assurance-definition.js +1 -1
  366. package/dist/sdk/cli-contracts/string-lists.js +1 -1
  367. package/dist/sdk/cli-contracts/tool-option-contracts.js +1 -1
  368. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  369. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  370. package/dist/sdk/cli-contracts/typed-action-inputs.js +1 -1
  371. package/dist/sdk/cli-contracts.js +1 -1
  372. package/dist/sdk/cli-program.js +1 -1
  373. package/dist/sdk/command-line.js +1 -1
  374. package/dist/sdk/comments.js +1 -1
  375. package/dist/sdk/compile-cache.js +1 -1
  376. package/dist/sdk/completion/bash.js +2 -1
  377. package/dist/sdk/completion/fish.js +13 -7
  378. package/dist/sdk/completion/shared.js +1 -1
  379. package/dist/sdk/completion/zsh.js +14 -8
  380. package/dist/sdk/completion.js +1 -1
  381. package/dist/sdk/compose.js +1 -1
  382. package/dist/sdk/config.js +1 -1
  383. package/dist/sdk/context/recency.js +1 -1
  384. package/dist/sdk/context/semantic-session-attribution.js +1 -1
  385. package/dist/sdk/context/usage-egress.js +1 -1
  386. package/dist/sdk/context/usage-ledger.js +6 -3
  387. package/dist/sdk/context-intent-contracts.js +1 -1
  388. package/dist/sdk/context-intent-runtime.js +1 -1
  389. package/dist/sdk/context-packing.js +1 -1
  390. package/dist/sdk/context-relevance.js +1 -1
  391. package/dist/sdk/context-signal-store.js +2 -2
  392. package/dist/sdk/context-usage.js +1 -1
  393. package/dist/sdk/contracts.js +1 -1
  394. package/dist/sdk/core-governance.js +1 -1
  395. package/dist/sdk/core.js +1 -1
  396. package/dist/sdk/corpus-shape.js +1 -1
  397. package/dist/sdk/define.js +1 -1
  398. package/dist/sdk/dependencies.js +1 -1
  399. package/dist/sdk/dependency-flag-validation.js +1 -1
  400. package/dist/sdk/dependency-provenance.js +1 -1
  401. package/dist/sdk/docs.js +1 -1
  402. package/dist/sdk/duplicates.js +1 -1
  403. package/dist/sdk/environment/agent-environment.js +1 -1
  404. package/dist/sdk/environment/host-environment-errors.js +1 -1
  405. package/dist/sdk/environment/project-runtime-compatibility.js +2 -1
  406. package/dist/sdk/environment/source-context.js +1 -1
  407. package/dist/sdk/environment/tracker-preflight.js +1 -1
  408. package/dist/sdk/error-code-catalog.js +1 -1
  409. package/dist/sdk/error-runtime.js +1 -1
  410. package/dist/sdk/errors.js +1 -1
  411. package/dist/sdk/eval.js +1 -1
  412. package/dist/sdk/extension/author-manifest.js +1 -1
  413. package/dist/sdk/extension/bundled-catalog.js +1 -1
  414. package/dist/sdk/extension/concurrency.js +1 -1
  415. package/dist/sdk/extension/copy-scope.js +1 -1
  416. package/dist/sdk/extension/custom-field-collisions.js +1 -1
  417. package/dist/sdk/extension/describe.js +4 -2
  418. package/dist/sdk/extension/doctor.js +1 -1
  419. package/dist/sdk/extension/install-plan.js +1 -1
  420. package/dist/sdk/extension/install-receipts.js +1 -1
  421. package/dist/sdk/extension/install-runtime.js +3 -3
  422. package/dist/sdk/extension/install-snapshot.js +1 -1
  423. package/dist/sdk/extension/install-sources.js +5 -5
  424. package/dist/sdk/extension/managed-state.js +2 -2
  425. package/dist/sdk/extension/migrations.js +2 -2
  426. package/dist/sdk/extension/output-ownership.js +1 -1
  427. package/dist/sdk/extension/runtime-summary.js +1 -1
  428. package/dist/sdk/extension/scaffold.js +11 -4
  429. package/dist/sdk/extension/shared.js +1 -1
  430. package/dist/sdk/extension/source-resolution.js +1 -1
  431. package/dist/sdk/extension/static-inventory.js +1 -1
  432. package/dist/sdk/extension/update-check.js +1 -1
  433. package/dist/sdk/extension-command-context.js +1 -1
  434. package/dist/sdk/extension-contracts.js +1 -1
  435. package/dist/sdk/extension.js +1 -1
  436. package/dist/sdk/files.js +1 -1
  437. package/dist/sdk/flag-invocation-contracts.js +1 -1
  438. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  439. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  440. package/dist/sdk/generated-error-code-catalog.js +1 -1
  441. package/dist/sdk/governance/assurance-action-contracts.js +1 -1
  442. package/dist/sdk/governance/assurance-action.js +1 -1
  443. package/dist/sdk/governance/assurance-limits.js +1 -1
  444. package/dist/sdk/governance/assurance-mutation-error.js +1 -1
  445. package/dist/sdk/governance/assurance-presets.js +1 -1
  446. package/dist/sdk/governance/assurance-runtime.js +1 -1
  447. package/dist/sdk/governance/assurance.js +4 -4
  448. package/dist/sdk/governance/boundary-fixtures.js +1 -1
  449. package/dist/sdk/governance/closure-timestamps.js +1 -1
  450. package/dist/sdk/governance/coverage-assurance.js +1 -1
  451. package/dist/sdk/governance/defect-recurrence-coverage.js +1 -1
  452. package/dist/sdk/governance/defect-recurrence-graph.js +1 -1
  453. package/dist/sdk/governance/defect-recurrence-signals.js +1 -1
  454. package/dist/sdk/governance/defect-recurrence.js +1 -1
  455. package/dist/sdk/governance/extension-host-version.js +1 -1
  456. package/dist/sdk/governance/gc.js +1 -1
  457. package/dist/sdk/governance/health-merge-evidence.js +1 -1
  458. package/dist/sdk/governance/health.js +2 -1
  459. package/dist/sdk/governance/hierarchy-validation.js +1 -1
  460. package/dist/sdk/governance/linked-file-report.js +1 -1
  461. package/dist/sdk/governance/merge-receipt-history.js +1 -1
  462. package/dist/sdk/governance/provenance-health.js +4 -1
  463. package/dist/sdk/governance/reindex.js +5 -4
  464. package/dist/sdk/governance/stale-work.js +1 -1
  465. package/dist/sdk/governance/status-role-diagnostics.js +1 -1
  466. package/dist/sdk/governance/storage-integrity.js +1 -1
  467. package/dist/sdk/governance/tracked-runtime-cache.js +1 -1
  468. package/dist/sdk/governance/upgrade.js +2 -2
  469. package/dist/sdk/governance/validate-history-drift.js +1 -1
  470. package/dist/sdk/governance/validate-item-reader.js +1 -1
  471. package/dist/sdk/governance/validate-normalization.js +1 -1
  472. package/dist/sdk/governance/validate.js +1 -1
  473. package/dist/sdk/governance/workflow-completeness.js +1 -1
  474. package/dist/sdk/governance/workflow-policy.js +3 -3
  475. package/dist/sdk/governance/workspace-position.js +2 -1
  476. package/dist/sdk/governance.js +1 -1
  477. package/dist/sdk/graph/adapter.js +1 -1
  478. package/dist/sdk/graph/analytics.js +1 -1
  479. package/dist/sdk/graph/assembly.js +1 -1
  480. package/dist/sdk/graph/cache.js +1 -1
  481. package/dist/sdk/graph/centrality.js +1 -1
  482. package/dist/sdk/graph/conformance.js +1 -1
  483. package/dist/sdk/graph/deadline-scheduling.js +1 -1
  484. package/dist/sdk/graph/durable-cache.js +1 -1
  485. package/dist/sdk/graph/governance-contracts.js +1 -1
  486. package/dist/sdk/graph/governance.js +1 -1
  487. package/dist/sdk/graph/hierarchy-integrity.js +1 -1
  488. package/dist/sdk/graph/index.js +1 -1
  489. package/dist/sdk/graph/lifecycle-coverage.js +1 -1
  490. package/dist/sdk/graph/mutation-advisory.js +1 -1
  491. package/dist/sdk/graph/query-contracts.js +1 -1
  492. package/dist/sdk/graph/remediation.js +1 -1
  493. package/dist/sdk/graph/run.js +1 -1
  494. package/dist/sdk/graph/scheduling.js +1 -1
  495. package/dist/sdk/graph/traversal.js +1 -1
  496. package/dist/sdk/graph/workspace-relationship-kind-registry.js +1 -1
  497. package/dist/sdk/graph.js +1 -1
  498. package/dist/sdk/guide-topics.js +1 -1
  499. package/dist/sdk/guide.js +8 -1
  500. package/dist/sdk/history/attestation-command.js +1 -1
  501. package/dist/sdk/history/attestation-contract.js +1 -1
  502. package/dist/sdk/history/attestation-scan.js +1 -1
  503. package/dist/sdk/history/attestation.js +1 -1
  504. package/dist/sdk/history/maintenance.js +1 -1
  505. package/dist/sdk/history/salvage.js +3 -2
  506. package/dist/sdk/history/subject.js +1 -1
  507. package/dist/sdk/history-analytics.js +1 -1
  508. package/dist/sdk/history-compact.js +1 -1
  509. package/dist/sdk/history-mcp.js +1 -1
  510. package/dist/sdk/history-provenance.js +1 -1
  511. package/dist/sdk/history-read.js +1 -1
  512. package/dist/sdk/history-redact.js +1 -1
  513. package/dist/sdk/history-repair.js +1 -1
  514. package/dist/sdk/improvement-ledger-validation.js +1 -1
  515. package/dist/sdk/improvement-ledger.js +2 -2
  516. package/dist/sdk/index.js +1 -1
  517. package/dist/sdk/init-agent-guidance.js +16 -2
  518. package/dist/sdk/init.js +16 -2
  519. package/dist/sdk/invocation-author.js +1 -1
  520. package/dist/sdk/item-children.js +1 -1
  521. package/dist/sdk/item-metadata-index.js +1 -1
  522. package/dist/sdk/item-schedule.js +1 -1
  523. package/dist/sdk/item-transaction.js +1 -1
  524. package/dist/sdk/learnings.js +1 -1
  525. package/dist/sdk/lifecycle/append.js +4 -2
  526. package/dist/sdk/lifecycle/claim.js +1 -1
  527. package/dist/sdk/lifecycle/close-many.js +1 -1
  528. package/dist/sdk/lifecycle/close.js +1 -1
  529. package/dist/sdk/lifecycle/copy.js +1 -1
  530. package/dist/sdk/lifecycle/create.js +1 -1
  531. package/dist/sdk/lifecycle/delete.js +1 -1
  532. package/dist/sdk/lifecycle/event-validation-messages.js +1 -1
  533. package/dist/sdk/lifecycle/focus.js +1 -1
  534. package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +1 -1
  535. package/dist/sdk/lifecycle/legacy-none-tokens.js +1 -1
  536. package/dist/sdk/lifecycle/lifecycle-transitions.js +1 -1
  537. package/dist/sdk/lifecycle/mcp-actions.js +1 -1
  538. package/dist/sdk/lifecycle/metadata-normalizers.js +1 -1
  539. package/dist/sdk/lifecycle/mutation-command-options.js +1 -1
  540. package/dist/sdk/lifecycle/plan-mutation-receipt.js +1 -1
  541. package/dist/sdk/lifecycle/plan.js +1 -1
  542. package/dist/sdk/lifecycle/recurrence-parsers.js +1 -1
  543. package/dist/sdk/lifecycle/reopen.js +1 -1
  544. package/dist/sdk/lifecycle/repeatable-metadata-parsers.js +2 -1
  545. package/dist/sdk/lifecycle/restore.js +1 -1
  546. package/dist/sdk/lifecycle/shared-unset-fields.js +1 -1
  547. package/dist/sdk/lifecycle/task-composition.js +1 -1
  548. package/dist/sdk/lifecycle/update-many.js +1 -1
  549. package/dist/sdk/lifecycle/update.js +2 -1
  550. package/dist/sdk/lifecycle-completion.js +1 -1
  551. package/dist/sdk/lifecycle-policy.js +1 -1
  552. package/dist/sdk/linked-artifacts.js +2 -1
  553. package/dist/sdk/mcp/apps.js +1 -1
  554. package/dist/sdk/mcp/authorization.js +1 -1
  555. package/dist/sdk/mcp/discovery.js +1 -1
  556. package/dist/sdk/mcp/interactions.js +1 -1
  557. package/dist/sdk/mcp/protocol.js +1 -1
  558. package/dist/sdk/mcp/skills.js +3 -1
  559. package/dist/sdk/mcp/subscriptions.js +1 -1
  560. package/dist/sdk/mcp/tasks.js +2 -2
  561. package/dist/sdk/mcp/transport.js +1 -1
  562. package/dist/sdk/merge/abandoned-receipts.js +1 -1
  563. package/dist/sdk/merge/driver.js +1 -1
  564. package/dist/sdk/merge/index.js +1 -1
  565. package/dist/sdk/merge/install.js +4 -2
  566. package/dist/sdk/merge/receipt-file-boundary.js +1 -1
  567. package/dist/sdk/merge/receipt-operation.js +1 -1
  568. package/dist/sdk/merge/receipt-schema.js +1 -1
  569. package/dist/sdk/merge/receipts.js +4 -4
  570. package/dist/sdk/merge/reconcile.js +1 -1
  571. package/dist/sdk/merge/three-way.js +3 -2
  572. package/dist/sdk/merge/worktree-config.js +1 -1
  573. package/dist/sdk/merge.js +1 -1
  574. package/dist/sdk/mutation-events.js +1 -1
  575. package/dist/sdk/mutation-guard.js +1 -1
  576. package/dist/sdk/notes.js +1 -1
  577. package/dist/sdk/output-contracts.js +1 -1
  578. package/dist/sdk/output-projection.js +1 -1
  579. package/dist/sdk/output-token-accounting.js +1 -1
  580. package/dist/sdk/output.js +2 -1
  581. package/dist/sdk/ownership-source.js +1 -1
  582. package/dist/sdk/package-import-adapters.js +1 -1
  583. package/dist/sdk/package-migrations.js +1 -1
  584. package/dist/sdk/package-runtime-options.js +1 -1
  585. package/dist/sdk/pagination.js +1 -1
  586. package/dist/sdk/profile.js +5 -1
  587. package/dist/sdk/provenance.js +1 -1
  588. package/dist/sdk/public-surface.json +1 -1
  589. package/dist/sdk/query/activity.js +1 -1
  590. package/dist/sdk/query/aggregate.js +1 -1
  591. package/dist/sdk/query/calendar.js +4 -1
  592. package/dist/sdk/query/complete-list.js +1 -1
  593. package/dist/sdk/query/context.js +2 -1
  594. package/dist/sdk/query/duplicate-candidates.js +1 -1
  595. package/dist/sdk/query/get.d.ts +14 -2
  596. package/dist/sdk/query/get.js +1 -1
  597. package/dist/sdk/query/history.js +1 -1
  598. package/dist/sdk/query/item-filter-options.js +1 -1
  599. package/dist/sdk/query/light-metadata.js +1 -1
  600. package/dist/sdk/query/list-filter-shared.js +1 -1
  601. package/dist/sdk/query/list.js +1 -1
  602. package/dist/sdk/query/multi-value-filters.js +1 -1
  603. package/dist/sdk/query/next-ready-budget.js +1 -1
  604. package/dist/sdk/query/next.js +2 -1
  605. package/dist/sdk/query/parsers.js +1 -1
  606. package/dist/sdk/query/projection-contracts.js +1 -1
  607. package/dist/sdk/query/search/corpus.js +2 -1
  608. package/dist/sdk/query/search/filters.js +1 -1
  609. package/dist/sdk/query/search/input.js +1 -1
  610. package/dist/sdk/query/search/lexical.js +1 -1
  611. package/dist/sdk/query/search/response.js +1 -1
  612. package/dist/sdk/query/search/semantic.js +3 -2
  613. package/dist/sdk/query/search/types.js +1 -1
  614. package/dist/sdk/query/search-contracts.js +1 -1
  615. package/dist/sdk/query/search-pagination.js +1 -1
  616. package/dist/sdk/query/search-rendering.js +1 -1
  617. package/dist/sdk/query/search.js +1 -1
  618. package/dist/sdk/query/workspace-contracts.js +1 -1
  619. package/dist/sdk/query.js +1 -1
  620. package/dist/sdk/read-output/continuation.js +1 -1
  621. package/dist/sdk/read-output/options.js +1 -1
  622. package/dist/sdk/read-output/provenance.js +1 -1
  623. package/dist/sdk/read-output-budget.js +1 -1
  624. package/dist/sdk/read-output-contracts.js +1 -1
  625. package/dist/sdk/read-output-rows.js +1 -1
  626. package/dist/sdk/read-output-session.js +1 -1
  627. package/dist/sdk/relationship-analytics.js +1 -1
  628. package/dist/sdk/relationship-context.js +1 -1
  629. package/dist/sdk/relationship-history.js +7 -4
  630. package/dist/sdk/relationship-kinds/contract.js +1 -1
  631. package/dist/sdk/relationship-migration.js +1 -1
  632. package/dist/sdk/relationships.js +1 -1
  633. package/dist/sdk/reproducibility/process.js +1 -1
  634. package/dist/sdk/runtime/actions.js +1 -1
  635. package/dist/sdk/runtime/context.js +1 -1
  636. package/dist/sdk/runtime/schema-preview.js +1 -1
  637. package/dist/sdk/runtime/schema.js +1 -1
  638. package/dist/sdk/runtime-action-aliases.js +1 -1
  639. package/dist/sdk/runtime-extended-actions.js +1 -1
  640. package/dist/sdk/runtime-input.js +1 -1
  641. package/dist/sdk/runtime-primitives.js +1 -1
  642. package/dist/sdk/runtime-public-contracts.js +1 -1
  643. package/dist/sdk/runtime-stats-options.js +1 -1
  644. package/dist/sdk/runtime.js +1 -1
  645. package/dist/sdk/scheduling-shortcuts.js +1 -1
  646. package/dist/sdk/schema-migration.js +4 -3
  647. package/dist/sdk/schema.js +7 -1
  648. package/dist/sdk/search-refresh-worker.js +1 -1
  649. package/dist/sdk/similarity-scoring.js +1 -1
  650. package/dist/sdk/similarity.js +1 -1
  651. package/dist/sdk/start-task-status.js +1 -1
  652. package/dist/sdk/stats.js +1 -1
  653. package/dist/sdk/structured-mutations.js +1 -1
  654. package/dist/sdk/telemetry-flush.js +1 -1
  655. package/dist/sdk/telemetry.js +4 -3
  656. package/dist/sdk/templates.js +26 -2
  657. package/dist/sdk/test/batch.js +2 -2
  658. package/dist/sdk/test/entry.js +1 -1
  659. package/dist/sdk/test/execution.js +6 -5
  660. package/dist/sdk/test/json-path.js +1 -1
  661. package/dist/sdk/test/linked-command-detection.js +1 -1
  662. package/dist/sdk/test/measurements.js +1 -1
  663. package/dist/sdk/test/parsers.js +1 -1
  664. package/dist/sdk/test/runs.js +1 -1
  665. package/dist/sdk/test/trust.js +2 -2
  666. package/dist/sdk/test/workspace-snapshot.js +1 -1
  667. package/dist/sdk/testing.js +7 -4
  668. package/dist/sdk/traceability/runtime-files-lookup.js +1 -1
  669. package/dist/sdk/traceability/source-traceability.js +2 -1
  670. package/dist/sdk/tracker-root-discovery.js +1 -1
  671. package/dist/sdk/workspace-contracts-cache.js +1 -1
  672. package/dist/sdk/workspace-contracts.js +1 -1
  673. package/dist/sdk/workspace-memory.js +2 -2
  674. package/dist/sdk/workspace-recipe.js +1 -1
  675. package/dist/sdk/workspace-snapshot.js +5 -4
  676. package/dist/sdk/workspace-transaction-gc.js +1 -1
  677. package/dist/sdk/workspace-transaction.js +2 -2
  678. package/dist/sdk/workspace.js +3 -2
  679. package/dist/types/index.js +1 -1
  680. package/dist/types.js +1 -1
  681. package/docs/AGENT_EVIDENCE_CONSISTENCY.md +88 -0
  682. package/docs/GET_READ_EVIDENCE.md +68 -0
  683. package/docs/README.md +2 -0
  684. package/marketplace.json +2 -2
  685. package/package.json +1 -1
  686. package/packages/pm-beads/package.json +1 -1
  687. package/packages/pm-calendar/package.json +1 -1
  688. package/packages/pm-command-kit/package.json +1 -1
  689. package/packages/pm-digital-twin/package.json +1 -1
  690. package/packages/pm-governance-audit/package.json +1 -1
  691. package/packages/pm-guide-shell/package.json +1 -1
  692. package/packages/pm-kanban/package.json +1 -1
  693. package/packages/pm-lifecycle-hooks/package.json +1 -1
  694. package/packages/pm-linked-test-adapters/package.json +1 -1
  695. package/packages/pm-search-advanced/package.json +1 -1
  696. package/packages/pm-templates/package.json +1 -1
  697. package/packages/pm-todos/package.json +1 -1
  698. package/packages/pm-vcs/extensions/vcs/index.ts +4 -2
  699. package/packages/pm-vcs/package.json +1 -1
  700. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  701. package/plugins/pm-claude/package.json +2 -2
  702. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  703. package/plugins/pm-codex/package.json +2 -2
  704. package/plugins/pm-codex/plugin.json +1 -1
  705. package/scripts/finalize-build.mjs +3 -2
  706. package/dist/cli-bundle/chunks/chunk-7UVXKI7K.js +0 -2
  707. package/dist/cli-bundle/chunks/chunk-D7Z2ZMJL.js +0 -3
  708. package/dist/cli-bundle/chunks/chunk-DEZPZOQ7.js +0 -2
  709. package/dist/cli-bundle/chunks/chunk-J52QIRRZ.js +0 -80
  710. package/dist/cli-bundle/chunks/chunk-JDKD3WGG.js +0 -6
  711. package/dist/cli-bundle/chunks/chunk-JQ7DW663.js +0 -2
  712. package/dist/cli-bundle/chunks/chunk-QXIDOOWT.js +0 -20
  713. package/dist/cli-bundle/chunks/chunk-SGFQQXFD.js +0 -2
  714. package/dist/cli-bundle/chunks/chunk-V3U77H3V.js +0 -31
  715. package/dist/cli-bundle/chunks/chunk-XZDWAYJC.js +0 -3
  716. package/dist/cli-bundle/chunks/chunk-Y6VRBTP3.js +0 -238
  717. package/dist/cli-bundle/chunks/chunk-YAAFYFS4.js +0 -8
  718. package/dist/cli-bundle/chunks/register-mutation-53ZLT4RX.js +0 -20
  719. package/dist/cli-bundle/chunks/register-operations-OBK2FXUU.js +0 -2
  720. package/dist/cli-bundle/chunks/register-setup-HM3OCBH2.js +0 -2
  721. package/dist/cli-bundle/focused-chunks/chunk-2JFYR56O.js +0 -2
  722. package/dist/cli-bundle/focused-chunks/chunk-32EVUSS4.js +0 -8
  723. package/dist/cli-bundle/focused-chunks/chunk-5GUSO2P4.js +0 -20
  724. package/dist/cli-bundle/focused-chunks/chunk-6XBRADQQ.js +0 -3
  725. package/dist/cli-bundle/focused-chunks/chunk-CURTIIQT.js +0 -2
  726. package/dist/cli-bundle/focused-chunks/chunk-IJUWEEEB.js +0 -6
  727. package/dist/cli-bundle/focused-chunks/chunk-JMJK2L4Z.js +0 -3
  728. package/dist/cli-bundle/focused-chunks/chunk-KG3H4UZZ.js +0 -30
  729. package/dist/cli-bundle/focused-chunks/chunk-MHQ2XICU.js +0 -2
  730. package/dist/cli-bundle/focused-chunks/chunk-RJV6QVJE.js +0 -75
  731. package/dist/cli-bundle/focused-chunks/chunk-ZE2JZ7R6.js +0 -12
  732. package/dist/cli-bundle/focused-chunks/chunk-ZLEN4HZD.js +0 -165
@@ -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.
@@ -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.
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.
package/marketplace.json CHANGED
@@ -5,13 +5,13 @@
5
5
  "url": "https://github.com/unbraind/pm-cli"
6
6
  },
7
7
  "description": "Official marketplace for pm CLI — native git-based project management for Claude Code and AI coding agents.",
8
- "version": "2026.10.4",
8
+ "version": "2026.10.5",
9
9
  "plugins": [
10
10
  {
11
11
  "name": "pm-claude",
12
12
  "source": "./plugins/pm-claude",
13
13
  "description": "Native pm CLI integration for Claude Code — 32 MCP tools, 14 workflow skills with slash invocations, 4 subagents, hybrid TUI task tracking, session context injection, and coordination subagents for git-based project management without leaving Claude Code.",
14
- "version": "2026.10.4",
14
+ "version": "2026.10.5",
15
15
  "author": {
16
16
  "name": "unbrained",
17
17
  "url": "https://github.com/unbraind/pm-cli"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-cli",
3
- "version": "2026.10.4",
3
+ "version": "2026.10.5",
4
4
  "description": "Git-native project management CLI for humans and agents.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.10.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-beads",
3
- "version": "2026.10.4",
3
+ "version": "2026.10.5",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party pm package for importing Beads JSONL records.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-calendar",
3
- "version": "2026.10.4",
3
+ "version": "2026.10.5",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party pm package for calendar and agenda views.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-command-kit",
3
- "version": "2026.10.4",
3
+ "version": "2026.10.5",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party pm exemplar package for the commands capability: registerCommand, registerFlags, and registerParser.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-digital-twin",
3
- "version": "2026.10.4",
3
+ "version": "2026.10.5",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Beyond-PM exemplar: a temporal production-facility digital twin built entirely on public pm SDK and extension primitives.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-governance-audit",
3
- "version": "2026.10.4",
3
+ "version": "2026.10.5",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party pm package for governance audit and normalization workflows.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-guide-shell",
3
- "version": "2026.10.4",
3
+ "version": "2026.10.5",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party pm package for guide and shell completion workflows.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-kanban",
3
- "version": "2026.10.4",
3
+ "version": "2026.10.5",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party pm archetype package: a complete Kanban continuous-flow profile built on public SDK primitives.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-lifecycle-hooks",
3
- "version": "2026.10.4",
3
+ "version": "2026.10.5",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party pm package demonstrating safe lifecycle hook registration.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-linked-test-adapters",
3
- "version": "2026.10.4",
3
+ "version": "2026.10.5",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party pm package for optional linked-test run management adapters and reporters.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-search-advanced",
3
- "version": "2026.10.4",
3
+ "version": "2026.10.5",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party pm package for semantic, hybrid, and reindex search workflows.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-templates",
3
- "version": "2026.10.4",
3
+ "version": "2026.10.5",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party pm package for reusable create templates.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-todos",
3
- "version": "2026.10.4",
3
+ "version": "2026.10.5",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party pm package for Todo markdown import and export.",
@@ -357,14 +357,16 @@ function isNonEmptyString(value: unknown): value is string {
357
357
  return typeof value === "string" && Boolean(value.trim());
358
358
  }
359
359
 
360
- function requiredChangesetRef(item: Partial<ItemMetadata>, id: string): string {
360
+ /** Require a changeset reference from the selected SDK item projection without depending on unrelated edge attribution. */
361
+ function requiredChangesetRef(item: GetResult["item"], id: string): string {
361
362
  if (!isNonEmptyString(item.vcs_ref))
362
363
  throw new TypeError(`vcs Changeset ${id} is missing vcs_ref`);
363
364
  return item.vcs_ref.trim();
364
365
  }
365
366
 
367
+ /** Recognize this merge through its status, resolution and ref fields in any SDK detail projection. */
366
368
  function matchesCommittedChangeset(
367
- item: Partial<ItemMetadata>,
369
+ item: GetResult["item"],
368
370
  refId: string,
369
371
  resolution: string,
370
372
  ): boolean {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-vcs-sdk-exemplar",
3
- "version": "2026.10.4",
3
+ "version": "2026.10.5",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Beyond-PM exemplar: a VCS-style changeset workflow built entirely on public pm SDK and extension primitives.",
@@ -3,7 +3,7 @@
3
3
  "name": "pm-claude",
4
4
  "displayName": "pm CLI",
5
5
  "description": "Native pm CLI integration for Claude Code — 32 MCP tools, 14 skills with slash invocations, 4 subagents (coordinator, delivery-chain, triage, verification), hybrid TUI task tracking (pm as persistent store + Claude Code task panel as live view), session context injection, and full git-based project management without leaving Claude Code.",
6
- "version": "2026.10.4",
6
+ "version": "2026.10.5",
7
7
  "author": {
8
8
  "name": "unbrained",
9
9
  "url": "https://github.com/unbraind/pm-cli"
@@ -2,8 +2,8 @@
2
2
  "name": "pm-claude-runtime",
3
3
  "private": true,
4
4
  "type": "module",
5
- "version": "2026.10.4",
5
+ "version": "2026.10.5",
6
6
  "dependencies": {
7
- "@unbrained/pm-cli": "2026.10.4"
7
+ "@unbrained/pm-cli": "2026.10.5"
8
8
  }
9
9
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pm-codex",
3
- "version": "2026.10.4",
3
+ "version": "2026.10.5",
4
4
  "description": "Native Codex integration for pm-cli with bundled MCP tools, skills, commands, and agent workflows.",
5
5
  "author": {
6
6
  "name": "unbrained",
@@ -2,8 +2,8 @@
2
2
  "name": "pm-codex-runtime",
3
3
  "private": true,
4
4
  "type": "module",
5
- "version": "2026.10.4",
5
+ "version": "2026.10.5",
6
6
  "dependencies": {
7
- "@unbrained/pm-cli": "2026.10.4"
7
+ "@unbrained/pm-cli": "2026.10.5"
8
8
  }
9
9
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "pm-codex",
4
- "version": "2026.10.4",
4
+ "version": "2026.10.5",
5
5
  "description": "Repository-native project context workflows and a version-pinned pm MCP server for Codex.",
6
6
  "author": {
7
7
  "name": "unbrained",
@@ -5,6 +5,7 @@ import path from "node:path";
5
5
  import { pathToFileURL } from "node:url";
6
6
  import { build } from "esbuild";
7
7
 
8
+ /** Check optional emitted executables before chmod, treating only absent files as optional and propagating other stat failures. */
8
9
  async function outputExists(filePath) {
9
10
  try {
10
11
  await stat(filePath);
@@ -22,7 +23,7 @@ async function outputExists(filePath) {
22
23
  }
23
24
  }
24
25
 
25
- /** Compact retained runtime modules without changing identifiers, module boundaries, or declarations. */
26
+ /** Compact redundant runtime syntax without changing identifiers, module boundaries, or declarations. */
26
27
  export async function compactRuntimeOutputs(directory) {
27
28
  const entryPoints = [];
28
29
  for await (const relative of glob("**/*.js", {
@@ -46,7 +47,7 @@ export async function compactRuntimeOutputs(directory) {
46
47
  target: "node22",
47
48
  minifyWhitespace: true,
48
49
  minifyIdentifiers: false,
49
- minifySyntax: false,
50
+ minifySyntax: true,
50
51
  sourcemap: true,
51
52
  sourcesContent: true,
52
53
  legalComments: "inline",
@@ -1,2 +0,0 @@
1
- import{Fa as p,Ga as i,Ha as v,Ia as _}from"./chunk-J52QIRRZ.js";import{cb as h}from"./chunk-Y6VRBTP3.js";import u from"node:fs/promises";import c from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="3425a1da-ef02-5235-a3b7-158d9efd12a2")}catch{}})();function f(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ENOENT"}function b(e){return e!=="invalid"&&e!=="unreadable"}function j(e){let r=JSON.parse(e);if(typeof r!="object"||r===null||Array.isArray(r))throw new SyntaxError("Invalid settings object");let t=r.extensions;if(t===void 0)return{enabled:[],disabled:[]};if(typeof t!="object"||t===null||Array.isArray(t))throw new SyntaxError("Invalid extensions settings");let n=t;if(n.enabled!==void 0&&(!Array.isArray(n.enabled)||!n.enabled.every(a=>typeof a=="string"))||n.disabled!==void 0&&(!Array.isArray(n.disabled)||!n.disabled.every(a=>typeof a=="string")))throw new SyntaxError("Invalid extension enablement lists");return{enabled:n.enabled??[],disabled:n.disabled??[]}}async function S(e){let r;try{r=await u.readFile(e,"utf8")}catch(t){return f(t)?{status:"absent",enabled:[],disabled:[]}:{status:"unreadable",enabled:[],disabled:[],error:{code:"settings_unreadable",path:e}}}try{return{status:"ok",...j(r)}}catch{return{status:"invalid",enabled:[],disabled:[],error:{code:"settings_invalid",path:e}}}}async function A(e){let r;try{r=await u.readFile(e,"utf8")}catch(t){if(f(t))try{if((await u.stat(c.dirname(e))).isDirectory())return{status:"absent",entries:[]}}catch(n){if(f(n))return{status:"absent",entries:[]}}return{status:"unreadable",entries:[],error:{code:"managed_state_unreadable",path:e}}}try{let t=JSON.parse(r),n=_(t);if(!n||typeof t!="object"||t===null||!Array.isArray(t.entries)||n.entries.length!==t.entries.length)throw new SyntaxError("Invalid managed extension state");return{status:"ok",entries:n.entries}}catch{return{status:"invalid",entries:[],error:{code:"managed_state_invalid",path:e}}}}async function I(e){try{return{directories:(await u.readdir(e,{withFileTypes:!0})).filter(t=>t.isDirectory()).map(t=>t.name).sort((t,n)=>t.localeCompare(n))}}catch(r){return f(r)?{directories:[]}:{directories:[],error:{code:"extensions_unreadable",path:e}}}}async function D(e){let r;try{r=await u.readFile(e,"utf8")}catch(t){return f(t)?{manifest:null,error:{code:"manifest_invalid",path:e}}:{manifest:null,error:{code:"manifest_unreadable",path:e}}}try{let t=v(JSON.parse(r));return t?{manifest:t}:{manifest:null,error:{code:"manifest_invalid",path:e}}}catch{return{manifest:null,error:{code:"manifest_invalid",path:e}}}}function M(e){let r=e.manifest?.name??e.directory,t=new Set(p(e.settings.enabled)),n=new Set(p(e.settings.disabled)),a=!b(e.settings.status)||!e.manifest?null:!n.has(r)&&(t.size===0||t.has(r)),o=b(e.managed.status)?e.managed.entries.some(d=>i(d.name)===i(r)||i(d.directory)===i(e.directory)):null;return{name:r,directory:e.directory,scope:e.scope,installed:!0,status:e.manifest?a===!1?"inactive":"installed":"malformed_manifest",configured_enabled:a,managed:o,runtime_active:null,...e.manifest?{version:e.manifest.version}:{}}}async function R(e){let r=e.scope??"project",t=r==="global"?h(e.cwd??process.cwd()):e.pmRoot,n=c.join(t,"extensions"),a=await S(c.join(t,"settings.json")),o=await A(c.join(n,".managed-extensions.json")),d=await I(n),l=[];for(let s of[a,o,d])s.error&&l.push(s.error);let m=e.name?.trim(),y=[];for(let s of d.directories){let x=c.join(n,s,"manifest.json"),g=await D(x);g.error&&l.push(g.error);let w=M({directory:s,scope:r,manifest:g.manifest,settings:a,managed:o});m&&![w.name,s].some(E=>i(E)===i(m))||y.push(w)}return m&&y.length===0&&l.every(s=>s.code!=="extensions_unreadable")&&y.push({name:m,directory:null,scope:r,installed:!1,status:"absent",configured_enabled:b(a.status)?!1:null,managed:b(o.status)?!1:null,runtime_active:null}),{scope:r,complete:l.length===0,settings_status:a.status,managed_state_status:o.status,extensions:y,errors:l}}export{R as a};
2
- //# sourceMappingURL=chunk-7UVXKI7K.js.map
@@ -1,3 +0,0 @@
1
- import{a as k,c as I,d as A,e as _,k as T,m as C}from"./chunk-JDKD3WGG.js";import{Db as b,Eb as v,Fb as R}from"./chunk-QXIDOOWT.js";import{Gc as E,Hn as H,Jf as D,Mf as m,Nf as y,Ro as f,Uo as g,Vo as a,Zl as x,mp as w,na as c,pa as p}from"./chunk-Y6VRBTP3.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="631e56aa-4d7e-58b6-bbea-a0d320716b82")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="0bcdd63c-5fd3-585d-a6c5-9393029ef864")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="4dce4f19-071c-54a8-be0d-5975d9e3b34b")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="f330a0c5-a967-5383-9c27-efa4a39e0f0d")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="420952ed-9a04-55dd-bcb8-804d81582002")}catch{}})();function B(t,e){if(typeof t!="string")return;let o=Number.parseInt(t,10);if(!/^\d+$/.test(t.trim())||!Number.isSafeInteger(o))throw new p(`history-compact ${e} must be a non-negative integer.`,c.USAGE);return o}async function O(t,e,o){let r=f(o),n=Date.now(),i=await x(a(e,"ids")),l=i===void 0?void 0:H(i),d=B(e.allOver,"--all-over"),u=B(e.minEntries,"--min-entries");if(e.closed===!0&&e.allStreams===!0)throw new p("history-compact: --closed and --all-streams are mutually exclusive; pick one lifecycle scope.",c.USAGE);let s=e.closed===!0?"closed":e.allStreams===!0?"all-streams":void 0;if((l!==void 0||d!==void 0||s!==void 0)&&typeof e.before=="string")throw new p("history-compact: --before applies only in single-id mode (bulk mode always compacts full streams).",c.USAGE);if(I(t,{ids:l,allOver:d,scope:s}),t!==void 0&&u!==void 0)throw new p("history-compact: --min-entries applies only in bulk mode (single-id mode compacts the named stream).",c.USAGE);if(t===void 0){let h=await A({ids:l,scope:s,allOver:d,minEntries:u,dryRun:e.dryRun===!0,author:a(e,"author"),message:a(e,"message"),force:!!e.force},r);m(h,r),h.totals.items_errored>0&&(process.exitCode=c.GENERIC_FAILURE)}else{let h=await k(t,{before:a(e,"before"),dryRun:e.dryRun===!0,author:a(e,"author"),message:a(e,"message"),force:!!e.force},r);m(h,r)}r.profile&&y(`profile:command=history-compact took_ms=${Date.now()-n}`)}async function S(t,e,o,r){let n=f(r),i=Date.now(),l=await C(t,e,{author:a(o,"author"),message:a(o,"message"),force:!!o.force},n);await w(n,l),m(l,n),n.profile&&y(`profile:command=restore took_ms=${Date.now()-i}`)}async function N(t,e){let o=f(e),r=await T({verify:a(t,"verify"),output:a(t,"output"),hashAlgorithm:a(t,"hashAlgorithm")},o);"format"in r?(E(r),o.quiet||D(`${JSON.stringify(r,null,2)}
2
- `)):m(r,o),"ok"in r&&!r.ok&&(process.exitCode=c.GENERIC_FAILURE)}function ee(t,e){t.command(e?"attest":"history-attest",{hidden:!e}).summary("Export or verify history proof.").option("--verify <file>","Compare retained streams with a detached JSON proof").option("--output <file>","Create a proof file and return a compact receipt").option("--hash-algorithm <name>","Bundle digest algorithm: sha256 (default) or sha512").description("Export exact-byte history commitments, or verify an independently retained proof without tracker writes.").action(N),t.command("restore",{hidden:!e}).summary("Restore a version.").argument("<id>","Item id").argument("<target>","Restore target timestamp or version number").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership/lock override").description("Restore an item to an earlier timestamp or version.").action(S),t.command(e?"redact":"history-redact",{hidden:!e}).summary("Redact sensitive values.").argument("<id>","Item id").option("--literal <value>","Literal string to redact (repeatable)",g).option("--regex <value>","Regex pattern to redact (repeatable; accepts /pattern/flags or raw pattern)",g).option("--replacement <value>",'Replacement string (default: "[redacted]")').option("--dry-run","Preview redaction impact without writing item/history files").option("--author <value>","Mutation author").option("--message <value>","Audit history message for the redaction marker entry").option("--force","Force ownership/lock override").description("Redact sensitive literals/patterns from an item history stream and recompute hashes.").action(async(o,r,n)=>{let i=f(n),l=Date.now(),d=Array.isArray(r.literal)?r.literal:void 0,u=Array.isArray(r.regex)?r.regex:void 0,s=await _(o,{literal:d,regex:u,replacement:a(r,"replacement"),dryRun:r.dryRun===!0,author:a(r,"author"),message:a(r,"message"),force:!!r.force},i);s.changed&&!s.dry_run&&await w(i,s),m(s,i),i.profile&&y(`profile:command=history-redact took_ms=${Date.now()-l}`)}),t.command(e?"repair":"history-repair",{hidden:!e}).summary("Repair drift.").argument("[id]","Item id (omit with --all)").option("--salvage-tail","Recover invalid tail; requires verified prefix").option("--all","Scan every stream for drift and repair each drifted stream in one audited pass").option("--dry-run","Preview the re-anchor impact without writing the history file").option("--normalize-provenance","Remove invalid provenance; return aggregate-only evidence").option("--author <value>","Mutation author").option("--message <value>","Audit history message for the repair marker entry").option("--force","Force ownership/lock override").description("Re-anchor a drifted item history chain (recompute hashes, reconcile with the on-disk item) and record an audit marker. Use --all to repair every drifted stream.").action(async(o,r,n)=>{let i=f(n),l=Date.now(),d=r.all===!0;v(o,d);let u={dryRun:r.dryRun===!0,author:a(r,"author"),message:a(r,"message"),force:!!r.force,normalizeProvenance:r.normalizeProvenance===!0,salvageTail:r.salvageTail===!0};if(d){let s=await R(u,i);m(s,i),s.totals.failed>0&&(process.exitCode=c.GENERIC_FAILURE)}else{let s=await b(o,u,i);m(s,i)}i.profile&&y(`profile:command=history-repair took_ms=${Date.now()-l}`)}),t.command(e?"compact":"history-compact",{hidden:!e}).summary("Compact streams.").argument("[id]","Item id (omit when using a bulk selector)").option("--before <value>","Compact entries strictly before this version number or ISO timestamp (single-id mode only)").option("--ids <value>","Bulk IDs: comma/newline text, - stdin, or @path file").option("--all-over <n>","Bulk: compact every stream with more than N entries").option("--closed","Bulk: compact only closed (terminal) items' streams").option("--all-streams","Bulk: compact every history stream regardless of lifecycle state").option("--min-entries <n>","Bulk: skip streams with at most N entries (already compact; default 3)").option("--dry-run","Preview compaction impact without writing the history file").option("--author <value>","Mutation author").option("--message <value>","Audit history message for the compaction marker entry").option("--force","Force ownership/lock override").description("Compact item history streams into a synthetic baseline plus retained tail entries. Pass an item id for one stream, or a bulk selector (--ids/--all-over/--closed/--all-streams) to compact many.").action(O)}export{ee as a};
3
- //# sourceMappingURL=chunk-D7Z2ZMJL.js.map
@@ -1,2 +0,0 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="a269ae22-2e52-5b3d-aa53-cafd0a5d3062")}catch{}})();
2
- //# sourceMappingURL=chunk-DEZPZOQ7.js.map