@unbrained/pm-cli 2026.8.19 → 2026.8.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +41 -0
  3. package/dist/cli/error-guidance.d.ts +20 -0
  4. package/dist/cli/error-guidance.js +29 -30
  5. package/dist/cli/register-list-query.js +12 -10
  6. package/dist/cli/register-structured-mutation.d.ts +2 -0
  7. package/dist/cli/register-structured-mutation.js +29 -6
  8. package/dist/cli-bundle/bundle-manifest.json +156 -148
  9. package/dist/cli-bundle/chunks/chunk-2MA6ZQVZ.js +197 -0
  10. package/dist/cli-bundle/chunks/{chunk-4NRRH7AM.js → chunk-3AFAUHUE.js} +2 -2
  11. package/dist/cli-bundle/chunks/chunk-7VHZS727.js +5 -0
  12. package/dist/cli-bundle/chunks/chunk-BKYB45NQ.js +2092 -0
  13. package/dist/cli-bundle/chunks/{chunk-BHYMXLAE.js → chunk-BUNIEJNE.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-QXSH7BLM.js → chunk-JSLOFXGA.js} +3 -3
  15. package/dist/cli-bundle/chunks/chunk-LARJJ3RK.js +3 -0
  16. package/dist/cli-bundle/chunks/{chunk-TOXJM4WA.js → chunk-LOVTQ52Z.js} +2 -2
  17. package/dist/cli-bundle/chunks/chunk-N3DSV4CH.js +77 -0
  18. package/dist/cli-bundle/chunks/chunk-OCLPLFAY.js +35 -0
  19. package/dist/cli-bundle/chunks/chunk-S4IRYKBU.js +13 -0
  20. package/dist/cli-bundle/chunks/register-list-query-F57EWDEF.js +11 -0
  21. package/dist/cli-bundle/chunks/{register-mutation-AUWVCW4M.js → register-mutation-7IY2D5KO.js} +20 -20
  22. package/dist/cli-bundle/chunks/{register-operations-PZQPHXW5.js → register-operations-FALL3YTU.js} +2 -2
  23. package/dist/cli-bundle/chunks/{register-setup-I4LUHGVW.js → register-setup-HXU7IZZD.js} +2 -2
  24. package/dist/cli-bundle/focused-chunks/chunk-2NIY5NKG.js +18 -0
  25. package/dist/cli-bundle/focused-chunks/{chunk-US7VEYZG.js → chunk-4ERLO7QD.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/chunk-7WZRLCYF.js +50 -0
  27. package/dist/cli-bundle/focused-chunks/{chunk-MCZXYZAF.js → chunk-CKKQSJNN.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/chunk-EEFKYMDR.js +16 -0
  29. package/dist/cli-bundle/focused-chunks/{chunk-ZBIQQYMI.js → chunk-F2A56DHV.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-ESISGDAY.js → chunk-F4YEW5I2.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-ODHQEECS.js → chunk-FH6DYED3.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/chunk-FJ22HNRP.js +2 -0
  33. package/dist/cli-bundle/focused-chunks/chunk-FV5ACOK7.js +2 -0
  34. package/dist/cli-bundle/focused-chunks/chunk-JEAVFOWM.js +2 -0
  35. package/dist/cli-bundle/focused-chunks/{chunk-EXBCLIBU.js → chunk-KDNG7TKQ.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/chunk-NJ63LOP6.js +155 -0
  37. package/dist/cli-bundle/focused-chunks/chunk-NXRTQ7HI.js +2 -0
  38. package/dist/cli-bundle/focused-chunks/{chunk-JDOMQ7VQ.js → chunk-TJ7EMJ46.js} +3 -3
  39. package/dist/cli-bundle/focused-chunks/chunk-UZE7XUZK.js +2 -0
  40. package/dist/cli-bundle/focused-chunks/{chunk-DKPLYW3L.js → chunk-YKBKIEAJ.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/{chunk-VXDSU5MC.js → chunk-ZOSEELYJ.js} +2 -2
  42. package/dist/cli-bundle/main.js +12 -12
  43. package/dist/cli-bundle/sdk-authoring.js +1 -1
  44. package/dist/cli-bundle/sdk-contracts.js +2 -2
  45. package/dist/cli-bundle/sdk-core.js +41 -41
  46. package/dist/cli-bundle/sdk-governance.js +1 -1
  47. package/dist/cli-bundle/sdk-graph.js +1 -1
  48. package/dist/cli-bundle/sdk-merge.js +32 -32
  49. package/dist/cli-bundle/sdk-query.js +1 -1
  50. package/dist/cli-bundle/sdk-runtime.js +1 -1
  51. package/dist/cli-bundle/sdk-testing.js +1 -1
  52. package/dist/cli-bundle/sdk.js +5 -5
  53. package/dist/core/output/mutation-projection.js +26 -2
  54. package/dist/core/shared/constants.d.ts +1 -5
  55. package/dist/core/shared/constants.js +3 -81
  56. package/dist/core/shared/errors.d.ts +16 -0
  57. package/dist/core/shared/errors.js +2 -2
  58. package/dist/core/shared/item-metadata-contract.d.ts +14 -0
  59. package/dist/core/shared/item-metadata-contract.js +90 -0
  60. package/dist/core/store/item-store.d.ts +60 -0
  61. package/dist/core/store/item-store.js +26 -94
  62. package/dist/core/store/tracker-preflight.d.ts +7 -0
  63. package/dist/core/store/tracker-preflight.js +142 -0
  64. package/dist/sdk/agent/closed-domain-contracts.d.ts +25 -0
  65. package/dist/sdk/agent/closed-domain-contracts.js +140 -0
  66. package/dist/sdk/agent/refusal-closure.d.ts +13 -1
  67. package/dist/sdk/agent/refusal-closure.js +45 -3
  68. package/dist/sdk/agent/refusal-reachability.d.ts +26 -0
  69. package/dist/sdk/agent/refusal-reachability.js +26 -2
  70. package/dist/sdk/agent/tracker-preflight-contracts.d.ts +63 -0
  71. package/dist/sdk/agent/tracker-preflight-contracts.js +127 -0
  72. package/dist/sdk/agent-capability-contracts.js +6 -11
  73. package/dist/sdk/annotations.js +6 -7
  74. package/dist/sdk/cli-contracts/completeness.js +8 -2
  75. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -2
  76. package/dist/sdk/cli-contracts/enum-contracts.js +16 -6
  77. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  78. package/dist/sdk/cli-contracts/flag-contracts.js +11 -2
  79. package/dist/sdk/cli-contracts/flag-lexicon-contracts.d.ts +19 -2
  80. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +105 -5
  81. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +2 -2
  82. package/dist/sdk/cli-contracts/grammar-contracts.js +5 -2
  83. package/dist/sdk/cli-contracts/runtime-contracts.js +7 -3
  84. package/dist/sdk/cli-contracts/tool-schema.js +7 -2
  85. package/dist/sdk/cli-contracts.d.ts +2 -2
  86. package/dist/sdk/cli-contracts.js +4 -4
  87. package/dist/sdk/config.d.ts +5 -0
  88. package/dist/sdk/config.js +5 -5
  89. package/dist/sdk/context-intent-runtime.js +7 -4
  90. package/dist/sdk/contracts.d.ts +2 -0
  91. package/dist/sdk/contracts.js +4 -2
  92. package/dist/sdk/core.d.ts +1 -1
  93. package/dist/sdk/core.js +3 -3
  94. package/dist/sdk/dependencies.js +5 -7
  95. package/dist/sdk/dependency-flag-validation.d.ts +1 -1
  96. package/dist/sdk/dependency-flag-validation.js +10 -4
  97. package/dist/sdk/environment/tracker-preflight.d.ts +6 -0
  98. package/dist/sdk/environment/tracker-preflight.js +10 -0
  99. package/dist/sdk/eval.js +5 -7
  100. package/dist/sdk/files.js +6 -10
  101. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +110 -2
  102. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +179 -46
  103. package/dist/sdk/governance/assurance.d.ts +36 -2
  104. package/dist/sdk/governance/assurance.js +184 -10
  105. package/dist/sdk/governance/gc.js +5 -6
  106. package/dist/sdk/governance/health.js +5 -6
  107. package/dist/sdk/governance/reindex.js +5 -6
  108. package/dist/sdk/governance/validate.d.ts +1 -2
  109. package/dist/sdk/governance/validate.js +6 -12
  110. package/dist/sdk/graph/governance.d.ts +7 -5
  111. package/dist/sdk/graph/governance.js +32 -16
  112. package/dist/sdk/graph/run.js +5 -7
  113. package/dist/sdk/graph/traversal.js +14 -5
  114. package/dist/sdk/history-compact.js +6 -9
  115. package/dist/sdk/history-read.js +5 -7
  116. package/dist/sdk/history-redact.js +5 -6
  117. package/dist/sdk/history-repair.js +6 -9
  118. package/dist/sdk/improvement-ledger.js +7 -10
  119. package/dist/sdk/index.d.ts +7 -3
  120. package/dist/sdk/index.js +8 -4
  121. package/dist/sdk/init-agent-guidance.d.ts +5 -3
  122. package/dist/sdk/init-agent-guidance.js +69 -9
  123. package/dist/sdk/lifecycle/append.d.ts +0 -5
  124. package/dist/sdk/lifecycle/append.js +5 -6
  125. package/dist/sdk/lifecycle/claim.d.ts +0 -5
  126. package/dist/sdk/lifecycle/claim.js +6 -9
  127. package/dist/sdk/lifecycle/close-many.d.ts +0 -5
  128. package/dist/sdk/lifecycle/close-many.js +5 -6
  129. package/dist/sdk/lifecycle/close.d.ts +0 -5
  130. package/dist/sdk/lifecycle/close.js +5 -6
  131. package/dist/sdk/lifecycle/copy.d.ts +0 -5
  132. package/dist/sdk/lifecycle/copy.js +5 -6
  133. package/dist/sdk/lifecycle/create.d.ts +0 -5
  134. package/dist/sdk/lifecycle/create.js +5 -9
  135. package/dist/sdk/lifecycle/delete.js +5 -6
  136. package/dist/sdk/lifecycle/focus.d.ts +0 -5
  137. package/dist/sdk/lifecycle/focus.js +5 -6
  138. package/dist/sdk/lifecycle/mcp-actions.d.ts +18 -0
  139. package/dist/sdk/lifecycle/mcp-actions.js +52 -0
  140. package/dist/sdk/lifecycle/plan.d.ts +0 -5
  141. package/dist/sdk/lifecycle/plan.js +5 -6
  142. package/dist/sdk/lifecycle/reopen.d.ts +44 -0
  143. package/dist/sdk/lifecycle/reopen.js +69 -0
  144. package/dist/sdk/lifecycle/restore.js +5 -6
  145. package/dist/sdk/lifecycle/update-many.d.ts +0 -5
  146. package/dist/sdk/lifecycle/update-many.js +5 -6
  147. package/dist/sdk/lifecycle/update.d.ts +31 -5
  148. package/dist/sdk/lifecycle/update.js +140 -19
  149. package/dist/sdk/linked-artifacts.js +6 -7
  150. package/dist/sdk/merge/install.js +5 -6
  151. package/dist/sdk/mutation-events.js +5 -7
  152. package/dist/sdk/package-import-adapters.js +6 -8
  153. package/dist/sdk/profile.js +6 -7
  154. package/dist/sdk/query/activity.js +5 -6
  155. package/dist/sdk/query/calendar.js +5 -6
  156. package/dist/sdk/query/get.d.ts +1 -6
  157. package/dist/sdk/query/get.js +20 -55
  158. package/dist/sdk/query/history.d.ts +0 -5
  159. package/dist/sdk/query/history.js +5 -6
  160. package/dist/sdk/query/list.d.ts +7 -21
  161. package/dist/sdk/query/list.js +38 -54
  162. package/dist/sdk/query/projection-contracts.d.ts +33 -0
  163. package/dist/sdk/query/projection-contracts.js +185 -0
  164. package/dist/sdk/query/search-contracts.d.ts +2 -1
  165. package/dist/sdk/query/search-contracts.js +18 -87
  166. package/dist/sdk/query/search.d.ts +15 -0
  167. package/dist/sdk/query/search.js +34 -10
  168. package/dist/sdk/relationship-kinds/contract.d.ts +8 -0
  169. package/dist/sdk/relationship-kinds/contract.js +13 -13
  170. package/dist/sdk/relationships.d.ts +1 -1
  171. package/dist/sdk/relationships.js +20 -2
  172. package/dist/sdk/runtime-primitives.d.ts +1 -1
  173. package/dist/sdk/runtime-primitives.js +3 -3
  174. package/dist/sdk/runtime.d.ts +6 -0
  175. package/dist/sdk/runtime.js +18 -14
  176. package/dist/sdk/schema-migration.js +6 -7
  177. package/dist/sdk/schema.js +5 -6
  178. package/dist/sdk/similarity.d.ts +13 -0
  179. package/dist/sdk/similarity.js +32 -6
  180. package/dist/sdk/stats.js +5 -8
  181. package/dist/sdk/templates.js +5 -6
  182. package/dist/sdk/test/batch.js +5 -7
  183. package/dist/sdk/test/execution.js +4 -5
  184. package/dist/sdk/test/runs.js +5 -7
  185. package/docs/AGENT_UX_CONTRACTS.md +8 -1
  186. package/docs/COMMANDS.md +13 -1
  187. package/docs/DEPENDENCY_KIND_CONTRACT.md +12 -1
  188. package/docs/README.md +1 -0
  189. package/docs/RECURRENCE_RECOVERY_CONTRACTS.md +151 -0
  190. package/docs/RELATIONSHIP_GRAPH.md +92 -10
  191. package/docs/SDK.md +10 -2
  192. package/docs/SDK_CONTEXT_INTEGRITY.md +45 -0
  193. package/docs/SDK_PRIMITIVE_INVENTORY.md +15 -1
  194. package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -1
  195. package/docs/performance/sdk-entrypoint-import-costs.md +14 -21
  196. package/marketplace.json +2 -2
  197. package/package.json +5 -5
  198. package/packages/pm-beads/package.json +1 -1
  199. package/packages/pm-calendar/package.json +1 -1
  200. package/packages/pm-command-kit/package.json +1 -1
  201. package/packages/pm-digital-twin/package.json +1 -1
  202. package/packages/pm-governance-audit/package.json +1 -1
  203. package/packages/pm-guide-shell/package.json +1 -1
  204. package/packages/pm-kanban/package.json +1 -1
  205. package/packages/pm-lifecycle-hooks/package.json +1 -1
  206. package/packages/pm-linked-test-adapters/package.json +1 -1
  207. package/packages/pm-search-advanced/package.json +1 -1
  208. package/packages/pm-templates/package.json +1 -1
  209. package/packages/pm-todos/package.json +1 -1
  210. package/packages/pm-vcs/package.json +1 -1
  211. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  212. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  213. package/sdk/public-surface.json +640 -44
  214. package/dist/cli-bundle/chunks/chunk-4THEB6PD.js +0 -13
  215. package/dist/cli-bundle/chunks/chunk-GWMXAQOD.js +0 -197
  216. package/dist/cli-bundle/chunks/chunk-HVFQTLYM.js +0 -35
  217. package/dist/cli-bundle/chunks/chunk-OI4XI562.js +0 -5
  218. package/dist/cli-bundle/chunks/chunk-OIOKV6NO.js +0 -2092
  219. package/dist/cli-bundle/chunks/chunk-SARFF5H5.js +0 -3
  220. package/dist/cli-bundle/chunks/chunk-YBMRWW4E.js +0 -77
  221. package/dist/cli-bundle/chunks/register-list-query-Y56KINDU.js +0 -11
  222. package/dist/cli-bundle/focused-chunks/chunk-34QBIYZI.js +0 -155
  223. package/dist/cli-bundle/focused-chunks/chunk-BJRYFVSH.js +0 -2
  224. package/dist/cli-bundle/focused-chunks/chunk-EF6ZS5GH.js +0 -50
  225. package/dist/cli-bundle/focused-chunks/chunk-L623ZPNK.js +0 -2
  226. package/dist/cli-bundle/focused-chunks/chunk-PRHY2IMX.js +0 -18
  227. package/dist/cli-bundle/focused-chunks/chunk-RZU5U6Q7.js +0 -2
  228. package/dist/cli-bundle/focused-chunks/chunk-YBMGXBFV.js +0 -16
  229. package/dist/cli-bundle/focused-chunks/chunk-YLVBJ6GF.js +0 -2
@@ -6,14 +6,14 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Official marketplace for pm CLI — native git-based project management for Claude Code and AI coding agents.",
9
- "version": "2026.8.19"
9
+ "version": "2026.8.21"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "pm-claude",
14
14
  "source": "./plugins/pm-claude",
15
15
  "description": "Native pm CLI integration for Claude Code — 28 MCP tools, 5 workflow skills, 14 slash commands, 4 subagents, hybrid TUI task tracking, session context injection, and coordination subagents for git-based project management without leaving Claude Code.",
16
- "version": "2026.8.19",
16
+ "version": "2026.8.21",
17
17
  "author": {
18
18
  "name": "unbrained",
19
19
  "url": "https://github.com/unbraind/pm-cli"
package/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026.8.21 - 2026-08-21
4
+
5
+ ### Added
6
+
7
+ - Prose-asserted relationships are unmeasured: 1,750 identifier pairs named in item text carry no edge in any direction, and nothing counts the gap ([pm-ob9z4y](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/features/pm-ob9z4y.toon))
8
+
9
+ ### Changed
10
+
11
+ - Provide consistent tracker preflight and executable recovery across SDK, CLI, and MCP ([pm-6qiwan](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/chores/pm-6qiwan.toon))
12
+
13
+ ### Fixed
14
+
15
+ - The blocks ceiling counts fabricated and evidence-cited ordering edges identically, so the historical ordering reconstruction another item mandates cannot land ([pm-c90tfh](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-c90tfh.toon))
16
+ - The dependency remove flag accepts a value its own add flag refuses and reports success on a zero-match, so a mistyped graph repair exits 0 having changed nothing ([pm-gos426](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gos426.toon))
17
+ - All four graph traversal verbs reject the semantic edge kinds the ontology exists to express, so 'what implements this milestone' returns the ordering-kind answer with no sign a semantic one exists ([pm-3dyec2](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-3dyec2.toon))
18
+ - Typed-outcome reachability admits three of ten edge kinds, so the four semantic kinds the ontology exists to express contribute nothing to the invariant they were minted to satisfy ([pm-ayg31c](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-ayg31c.toon))
19
+ - The graph audit raises duplicate dependency rows at warning severity and the only remediation available deletes every copy, so collapsing a duplicate means briefly destroying a real edge ([pm-flnefm](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-flnefm.toon))
20
+
21
+ ### Other
22
+
23
+ - ADR: Ordering assurance partitions evidence-cited blocks from uncited blocks ([pm-jhpby4](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/decisions/pm-jhpby4.toon))
24
+
25
+ ## 2026.8.20 - 2026-08-20
26
+
27
+ ### Added
28
+
29
+ - GH-796: no reopen transition for terminal items, so recurrence is recorded as a duplicate instead of a reopening ([pm-83cz0o](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/features/pm-83cz0o.toon))
30
+
31
+ ### Fixed
32
+
33
+ - GH-529: init --agent-guidance emits run-tests.mjs linked-test example that may not exist in the target repo ([pm-surv](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-surv.toon))
34
+ - GH-527: semantic staleness warning recommends 'pm reindex' which is absent from the base install ([pm-qljv](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-qljv.toon))
35
+ - CodSpeed instrument cache can stall simulation setup until the hosted benchmark gate is canceled ([pm-w16muu](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-w16muu.toon))
36
+ - Make context intents and low-token projection fields fully discoverable ([pm-gy885b](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gy885b.toon))
37
+
38
+ ### Other
39
+
40
+ - Refresh compatible Vitest 4.1.11 and jscpd 5.0.16 patches ([pm-n5ysuk](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/chores/pm-n5ysuk.toon))
41
+ - Consistent flag spellings across commands with preserved aliases and enforced budgets ([pm-fs8q9x](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/tasks/pm-fs8q9x.toon))
42
+ - Refresh compatible Greptile 3.4.1 review tooling ([pm-obmgi3](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/chores/pm-obmgi3.toon))
43
+
3
44
  ## 2026.8.19 - 2026-08-19
4
45
 
5
46
  ### Fixed
@@ -14,6 +14,10 @@ interface GuidanceMessage {
14
14
  examples?: string[];
15
15
  nextSteps?: string[];
16
16
  verificationErrors?: string[];
17
+ flag?: string;
18
+ value?: string;
19
+ unmatchedSelectors?: NonNullable<PmCliErrorContext["unmatched_selectors"]>;
20
+ availableDependencies?: NonNullable<PmCliErrorContext["available_dependencies"]>;
17
21
  recovery?: PmCliErrorRecoveryPayload;
18
22
  }
19
23
  /** Documents the json error envelope payload exchanged by command, SDK, and package integrations. */
@@ -38,6 +42,14 @@ export interface JsonErrorEnvelope {
38
42
  next_steps?: string[];
39
43
  /** Exact integrity verifier findings that caused the operation to refuse. */
40
44
  verification_errors?: string[];
45
+ /** CLI flag whose supplied value violated a shared mutation grammar. */
46
+ flag?: string;
47
+ /** Supplied scalar value that violated a shared mutation grammar. */
48
+ value?: string;
49
+ /** Dependency selectors that matched no stored edge. */
50
+ unmatched_selectors?: NonNullable<PmCliErrorContext["unmatched_selectors"]>;
51
+ /** Compact stored dependency identities available when a removal failed. */
52
+ available_dependencies?: NonNullable<PmCliErrorContext["available_dependencies"]>;
41
53
  /** Value that configures or reports recovery for this contract. */
42
54
  recovery?: PmCliErrorRecoveryPayload;
43
55
  }
@@ -63,6 +75,14 @@ export interface ErrorClassification {
63
75
  next_steps?: string[];
64
76
  /** Exact integrity verifier findings that caused the operation to refuse. */
65
77
  verification_errors?: string[];
78
+ /** CLI flag whose supplied value violated a shared mutation grammar. */
79
+ flag?: string;
80
+ /** Supplied scalar value that violated a shared mutation grammar. */
81
+ value?: string;
82
+ /** Dependency selectors that matched no stored edge. */
83
+ unmatched_selectors?: NonNullable<PmCliErrorContext["unmatched_selectors"]>;
84
+ /** Compact stored dependency identities available when a removal failed. */
85
+ available_dependencies?: NonNullable<PmCliErrorContext["available_dependencies"]>;
66
86
  /** Value that configures or reports recovery for this contract. */
67
87
  recovery?: PmCliErrorRecoveryPayload;
68
88
  }
@@ -1,5 +1,5 @@
1
1
 
2
- !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]="367d9302-9e1e-5813-a913-e4e87f34d8b9")}catch(e){}}();
2
+ !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]="d90c153b-bb1d-57b1-81fd-e0ea7347c520")}catch(e){}}();
3
3
  import { resolveRecoveryCommandName } from "../sdk/agent/command-recovery.js";
4
4
  import { renderPmCommand } from "./argv-utils.js";
5
5
  import { discoverNearbyPmRoot } from "../sdk/tracker-root-discovery.js";
@@ -278,15 +278,8 @@ export function renderGuidanceMessage(message) {
278
278
  }
279
279
  return lines.join("\n");
280
280
  }
281
- function guidanceToJsonEnvelope(message, exitCode) {
282
- const payload = {
283
- type: message.type,
284
- code: message.code,
285
- title: message.title,
286
- detail: message.happened,
287
- required: message.required,
288
- exit_code: exitCode,
289
- };
281
+ /** Attach optional actionable fields shared by JSON and classification envelopes. */
282
+ function attachStructuredGuidanceDetails(payload, message) {
290
283
  if (includeWhyInStructuredGuidance(message)) {
291
284
  payload.why = message.why;
292
285
  }
@@ -299,35 +292,37 @@ function guidanceToJsonEnvelope(message, exitCode) {
299
292
  if (message.verificationErrors && message.verificationErrors.length > 0) {
300
293
  payload.verification_errors = message.verificationErrors;
301
294
  }
295
+ if (message.flag !== undefined)
296
+ payload.flag = message.flag;
297
+ if (message.value !== undefined)
298
+ payload.value = message.value;
299
+ if (message.unmatchedSelectors !== undefined)
300
+ payload.unmatched_selectors = message.unmatchedSelectors;
301
+ if (message.availableDependencies !== undefined)
302
+ payload.available_dependencies = message.availableDependencies;
302
303
  if (message.recovery) {
303
304
  payload.recovery = message.recovery;
304
305
  }
305
306
  return payload;
306
307
  }
308
+ function guidanceToJsonEnvelope(message, exitCode) {
309
+ return attachStructuredGuidanceDetails({
310
+ type: message.type,
311
+ code: message.code,
312
+ title: message.title,
313
+ detail: message.happened,
314
+ required: message.required,
315
+ exit_code: exitCode,
316
+ }, message);
317
+ }
307
318
  function guidanceToClassification(message) {
308
- const payload = {
319
+ return attachStructuredGuidanceDetails({
309
320
  type: message.type,
310
321
  code: message.code,
311
322
  title: message.title,
312
323
  detail: message.happened,
313
324
  required: message.required,
314
- };
315
- if (includeWhyInStructuredGuidance(message)) {
316
- payload.why = message.why;
317
- }
318
- if (message.examples && message.examples.length > 0) {
319
- payload.examples = message.examples;
320
- }
321
- if (message.nextSteps && message.nextSteps.length > 0) {
322
- payload.next_steps = message.nextSteps;
323
- }
324
- if (message.verificationErrors && message.verificationErrors.length > 0) {
325
- payload.verification_errors = message.verificationErrors;
326
- }
327
- if (message.recovery) {
328
- payload.recovery = message.recovery;
329
- }
330
- return payload;
325
+ }, message);
331
326
  }
332
327
  function normalizeMessage(message) {
333
328
  return message.replace(/\(outputHelp\)/g, "").trim();
@@ -435,11 +430,15 @@ function applyPmCliErrorContext(guidance, rawMessage, context) {
435
430
  examples,
436
431
  nextSteps,
437
432
  verificationErrors,
433
+ flag: context.flag,
434
+ value: context.value,
435
+ unmatchedSelectors: context.unmatched_selectors,
436
+ availableDependencies: context.available_dependencies,
438
437
  recovery,
439
438
  };
440
439
  }
441
440
  function buildTrackerNotInitializedGuidance(rawMessage, message, context) {
442
- const trackerNotInitialized = message.match(/^Tracker is not initialized at (.+)\. Run pm init first\.$/);
441
+ const trackerNotInitialized = message.match(/^Tracker is not initialized at (.+)\. (?:Run pm init first|Tracker root does not exist\. Run pm init first)\.$/);
443
442
  if (!trackerNotInitialized) {
444
443
  return null;
445
444
  }
@@ -1241,4 +1240,4 @@ export const _testOnly = {
1241
1240
  resolveKnownPackageCommandHint,
1242
1241
  };
1243
1242
  //# sourceMappingURL=error-guidance.js.map
1244
- //# debugId=367d9302-9e1e-5813-a913-e4e87f34d8b9
1243
+ //# debugId=d90c153b-bb1d-57b1-81fd-e0ea7347c520
@@ -1,9 +1,10 @@
1
1
 
2
- !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]="d3206ea9-3bf7-5e23-8b95-2a9078942b6f")}catch(e){}}();
2
+ !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]="102d4534-fb3a-57a3-91d1-db344492b812")}catch(e){}}();
3
3
  import { EXIT_CODE, PmCliError, readSettings, renderRowsAsCsv, renderRowsAsTable, resolvePmRoot, } from "../sdk/runtime-primitives.js";
4
4
  import { renderPmCommandAliasMigrationHint, resolvePmCommandAlias, } from "../sdk/cli-contracts.js";
5
5
  import { EVAL_QUERY_SET_SCHEMA_ID } from "../sdk/eval.js";
6
6
  import { applyContextIntentProjection } from "../sdk/context-intent-contracts.js";
7
+ import { renderPmClosedDomainHelp } from "../sdk/agent/closed-domain-contracts.js";
7
8
  import { serializeNdjsonRows, serializeNdjsonStream, } from "../sdk/output.js";
8
9
  import { listMutationEvents, subscribeMutationEventBatches, subscribeMutationEvents, } from "../sdk/mutation-events.js";
9
10
  import { runActivity } from "./commands/activity.js";
@@ -191,6 +192,7 @@ async function runRegisteredListCommand(params) {
191
192
  }
192
193
  }
193
194
  applyDefaultListProjection(listOptions, effectiveName);
195
+ Object.assign(listOptions, { projectionCommand: effectiveName });
194
196
  if (effectiveExcludeTerminal)
195
197
  listOptions.excludeTerminal = true;
196
198
  listOptions.dependencyBlocked = effectiveDependencyBlocked;
@@ -213,7 +215,7 @@ function registerListCommand(program, descriptor) {
213
215
  command.option("--all", "Include every lifecycle status");
214
216
  }
215
217
  command
216
- .option("--for <intent>", "Apply a declared context intent projection")
218
+ .option("--for <intent>", `Apply a declared context intent projection. ${renderPmClosedDomainHelp("list", "--for")}`)
217
219
  .option("--token-budget <n>", "Override the selected intent's maximum estimated output tokens")
218
220
  .option("--type <value>", "Filter by item type (repeatable or comma-separated; matches any)", collect)
219
221
  .option("--tag <value>", "Filter by tag (repeatable or comma-separated; matches any)", collect)
@@ -245,7 +247,7 @@ function registerListCommand(program, descriptor) {
245
247
  .option("--compact", "Render compact list projection fields (mutually exclusive with --brief/--full/--fields)")
246
248
  .option("--brief", "Ultra-compact output: id, status, type, title only (agent-optimized, mutually exclusive with --compact/--full/--fields)")
247
249
  .option("--full", "Render full list projection fields (mutually exclusive with --compact/--brief/--fields)")
248
- .option("--fields <value>", "Render custom comma-separated list fields (mutually exclusive with --compact/--brief/--full; valid: --fields id,title)")
250
+ .option("--fields <value>", `Render custom comma-separated list fields (mutually exclusive with --compact/--brief/--full). ${renderPmClosedDomainHelp(name, "--fields")}`)
249
251
  .option("--sort <value>", "Sort field: priority|deadline|updated_at|created_at|title|parent (aliases: updated, created)")
250
252
  .option("--order <value>", "Sort order: asc|desc (requires --sort)")
251
253
  .option("--tree", "Render rows in parent/child tree order")
@@ -696,7 +698,7 @@ export function registerListQueryCommands(program, options) {
696
698
  .command("context")
697
699
  .alias("ctx")
698
700
  .description("Show a token-efficient project context snapshot for next-work decisions.")
699
- .option("--for <intent>", "Apply a declared context intent projection")
701
+ .option("--for <intent>", `Apply a declared context intent projection. ${renderPmClosedDomainHelp("context", "--for")}`)
700
702
  .option("--date <value>", "Anchor date/time for agenda window calculations (ISO/date string or relative)")
701
703
  .option("--from <value>", "Agenda lower bound (ISO/date string or relative)")
702
704
  .option("--to <value>", "Agenda upper bound (ISO/date string or relative)")
@@ -732,7 +734,7 @@ export function registerListQueryCommands(program, options) {
732
734
  const nextCommand = program
733
735
  .command("next")
734
736
  .description("Recommend the next actionable (unblocked, ready) work item with rationale + blocked companion.")
735
- .option("--for <intent>", "Apply a declared context intent projection")
737
+ .option("--for <intent>", `Apply a declared context intent projection. ${renderPmClosedDomainHelp("next", "--for")}`)
736
738
  .option("--type <value>", "Filter candidate items by type")
737
739
  .option("--tag <value>", "Filter candidate items by tag")
738
740
  .option("--priority <value>", "Filter candidate items by priority")
@@ -761,7 +763,7 @@ export function registerListQueryCommands(program, options) {
761
763
  .argument("<keywords...>", "Keyword query tokens")
762
764
  .description("Search items with keyword, semantic, or hybrid retrieval. Inline field:value tokens " +
763
765
  "(tag:/status:/type:/priority:) in the query are parsed as filters, e.g. 'auth tag:area:search status:open'.")
764
- .option("--for <intent>", "Apply a declared context intent projection")
766
+ .option("--for <intent>", `Apply a declared context intent projection. ${renderPmClosedDomainHelp("search", "--for")}`)
765
767
  .option("--token-budget <n>", "Override the selected intent's maximum estimated output tokens")
766
768
  .option("--mode <value>", "Search mode: keyword|semantic|hybrid (default: keyword)")
767
769
  .option("--semantic", "Shorthand for --mode semantic")
@@ -790,7 +792,7 @@ export function registerListQueryCommands(program, options) {
790
792
  .option("--parent <value>", "Filter by parent item ID")
791
793
  .option("--compact", "Render compact search hits (default; mutually exclusive with --full/--fields)")
792
794
  .option("--full", "Render full search hits with nested item payloads (mutually exclusive with --compact/--fields)")
793
- .option("--fields <value>", "Render custom comma-separated search hit fields (mutually exclusive with --compact/--full; valid: --fields id,title,score; invalid: --full --fields id,title)")
795
+ .option("--fields <value>", `Render custom comma-separated search hit fields (mutually exclusive with --compact/--full). ${renderPmClosedDomainHelp("search", "--fields")}`)
794
796
  .option("--format <value>", "Search output format override: json|ndjson|toon")
795
797
  .option("--limit <n>", "Limit returned item count")
796
798
  .option("--after <cursor>", "Continue after an opaque next_cursor from a previous search response");
@@ -815,11 +817,11 @@ export function registerListQueryCommands(program, options) {
815
817
  const getCommand = program
816
818
  .command("get")
817
819
  .argument("<id>", "Item id")
818
- .option("--for <intent>", "Apply a declared context intent projection")
820
+ .option("--for <intent>", `Apply a declared context intent projection. ${renderPmClosedDomainHelp("get", "--for")}`)
819
821
  .option("--token-budget <n>", "Override the selected intent's maximum estimated output tokens")
820
822
  .option("--depth <value>", "Detail depth: brief|standard|deep|full (full aliases deep; default: standard)")
821
823
  .option("--full", "Explicit full item read; equivalent to --depth deep (mutually exclusive with --depth/--fields)")
822
- .option("--fields <value>", "Render custom comma-separated item metadata fields (for example: --fields id,title,status,parent,type)")
824
+ .option("--fields <value>", `Render custom comma-separated item metadata fields. ${renderPmClosedDomainHelp("get", "--fields")}`)
823
825
  .option("--tree", "Include descendants rooted at the requested item")
824
826
  .option("--tree-depth <n>", "Maximum subtree depth for --tree descendants")
825
827
  .option("--at <version-or-timestamp>", "Reconstruct a verified historical item state without mutating it")
@@ -922,4 +924,4 @@ export const _testOnlyRegisterListQuery = {
922
924
  parseListFormat,
923
925
  };
924
926
  //# sourceMappingURL=register-list-query.js.map
925
- //# debugId=d3206ea9-3bf7-5e23-8b95-2a9078942b6f
927
+ //# debugId=102d4534-fb3a-57a3-91d1-db344492b812
@@ -4,6 +4,7 @@
4
4
  * Registers the noun-first CLI adapter for public SDK atomic item mutations.
5
5
  */
6
6
  import type { Command } from "commander";
7
+ declare function runItemReopenAction(id: string, reason: string, options: Record<string, unknown>, command: Command): Promise<void>;
7
8
  declare function runItemMutateAction(options: Record<string, unknown>, command: Command): Promise<void>;
8
9
  declare function runItemCompleteAction(id: string, positionalReason: string | undefined, options: Record<string, unknown>, command: Command): Promise<void>;
9
10
  /** Register `pm item mutate`, the stable noun-first atomic batch surface. */
@@ -12,5 +13,6 @@ export declare function registerStructuredMutationCommands(program: Command): vo
12
13
  export declare const structuredMutationTestOnly: {
13
14
  runItemCompleteAction: typeof runItemCompleteAction;
14
15
  runItemMutateAction: typeof runItemMutateAction;
16
+ runItemReopenAction: typeof runItemReopenAction;
15
17
  };
16
18
  export {};
@@ -1,9 +1,23 @@
1
1
 
2
- !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]="94fe3b7b-3aeb-5a31-a3a5-d85ae7e1ac83")}catch(e){}}();
2
+ !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]="3b23ded4-a821-5ff0-8783-927875d0457b")}catch(e){}}();
3
3
  import { createStdinTokenResolver, EXIT_CODE, PmCliError, readSettings, resolveAuthor, resolvePmRoot, } from "../sdk/runtime-primitives.js";
4
4
  import { buildItemCompletionMutations, commitItemCompletion, commitItemMutations, } from "../sdk/item-transaction.js";
5
+ import { runReopen } from "../sdk/lifecycle/reopen.js";
5
6
  import { parseAtomicMutationControls, resolveItemMutationDocument, } from "../sdk/structured-mutations.js";
6
- import { collect, getGlobalOptions, printResult, } from "./registration-helpers.js";
7
+ import { collect, getGlobalOptions, invalidateSearchCachesForMutation, printResult, } from "./registration-helpers.js";
8
+ async function runItemReopenAction(id, reason, options, command) {
9
+ const globalOptions = getGlobalOptions(command);
10
+ const result = await runReopen(id, reason, {
11
+ status: typeof options.status === "string" ? options.status : undefined,
12
+ author: typeof options.author === "string"
13
+ ? options.author
14
+ : globalOptions.author,
15
+ message: typeof options.message === "string" ? options.message : undefined,
16
+ force: options.force === true,
17
+ }, globalOptions);
18
+ await invalidateSearchCachesForMutation(globalOptions, result);
19
+ printResult(result, globalOptions);
20
+ }
7
21
  async function runItemMutateAction(options, command) {
8
22
  const globalOptions = getGlobalOptions(command);
9
23
  const input = await createStdinTokenResolver().resolveValue("-", "--stdin-json");
@@ -130,7 +144,15 @@ export function registerStructuredMutationCommands(program) {
130
144
  const itemCommand = program.commands.find((command) => command.name() === "item") ??
131
145
  program
132
146
  .command("item")
133
- .description("Run item lifecycle and mutation operations.");
147
+ .description("Run item lifecycle operations.");
148
+ itemCommand
149
+ .command("reopen <id> <reason>")
150
+ .option("--status <value>", "Active target status: open or in_progress")
151
+ .option("--message <value>", "Human-readable recurrence history message")
152
+ .option("--force", "Override ownership or stale-lock conflicts")
153
+ .option("--author <value>", "Mutation author")
154
+ .description("Reopen terminal work with recurrence evidence.")
155
+ .action(runItemReopenAction);
134
156
  itemCommand
135
157
  .command("mutate")
136
158
  .requiredOption("--transaction-id <value>", "Stable idempotency key used to resume an interrupted batch")
@@ -140,7 +162,7 @@ export function registerStructuredMutationCommands(program) {
140
162
  .option("--lock-ttl-seconds <n>", "Workspace transaction lock lifetime in seconds")
141
163
  .option("--lock-wait-ms <n>", "Maximum time to wait for the workspace transaction lock")
142
164
  .option("--author <value>", "Mutation author")
143
- .description("Apply create/update/close/release mutations atomically through the public pm SDK.")
165
+ .description("Apply SDK-backed mutations atomically.")
144
166
  .action(runItemMutateAction);
145
167
  itemCommand
146
168
  .command("complete <id> [reason]")
@@ -162,13 +184,14 @@ export function registerStructuredMutationCommands(program) {
162
184
  .option("--dry-run", "Validate and preview completion without writing")
163
185
  .option("--force", "Override lifecycle and ownership conflicts")
164
186
  .option("--author <value>", "Completion author")
165
- .description("Record evidence, close the item, and release its claim atomically.")
187
+ .description("Close with evidence and release the claim.")
166
188
  .action(runItemCompleteAction);
167
189
  }
168
190
  /** Internal action hooks used by exhaustive source-level registration tests. */
169
191
  export const structuredMutationTestOnly = {
170
192
  runItemCompleteAction,
171
193
  runItemMutateAction,
194
+ runItemReopenAction,
172
195
  };
173
196
  //# sourceMappingURL=register-structured-mutation.js.map
174
- //# debugId=94fe3b7b-3aeb-5a31-a3a5-d85ae7e1ac83
197
+ //# debugId=3b23ded4-a821-5ff0-8783-927875d0457b