@unbrained/pm-cli 2026.8.22 → 2026.8.24

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 +42 -1
  3. package/dist/cli/description-stdin.js +5 -4
  4. package/dist/cli/error-guidance.d.ts +13 -0
  5. package/dist/cli/error-guidance.js +62 -6
  6. package/dist/cli/extension-command-help.d.ts +5 -0
  7. package/dist/cli/extension-command-help.js +6 -2
  8. package/dist/cli/help-content.d.ts +5 -0
  9. package/dist/cli/help-content.js +56 -3
  10. package/dist/cli/help-json-payload.d.ts +5 -2
  11. package/dist/cli/help-json-payload.js +57 -17
  12. package/dist/cli/main.d.ts +3 -0
  13. package/dist/cli/main.js +39 -5
  14. package/dist/cli/register-annotations.js +5 -5
  15. package/dist/cli/register-mutation.js +77 -31
  16. package/dist/cli/register-operations.d.ts +73 -0
  17. package/dist/cli/register-operations.js +39 -14
  18. package/dist/cli/register-setup.js +3 -3
  19. package/dist/cli/schema-registration-helpers.d.ts +8 -1
  20. package/dist/cli/schema-registration-helpers.js +14 -5
  21. package/dist/cli-bundle/bundle-manifest.json +155 -155
  22. package/dist/cli-bundle/chunks/chunk-AGUL3HUT.js +3 -0
  23. package/dist/cli-bundle/chunks/{chunk-WG4STC36.js → chunk-DJNJBWAQ.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-MYYI3ZOA.js → chunk-I5Q7QSZX.js} +2 -2
  25. package/dist/cli-bundle/chunks/chunk-IW72J5FW.js +2 -0
  26. package/dist/cli-bundle/chunks/{chunk-BWX4SK46.js → chunk-L22NP5MA.js} +66 -66
  27. package/dist/cli-bundle/chunks/chunk-MKE6MD2K.js +36 -0
  28. package/dist/cli-bundle/chunks/{chunk-MZTZQTMS.js → chunk-NXBFO63A.js} +2 -2
  29. package/dist/cli-bundle/chunks/chunk-TEQDR5KI.js +202 -0
  30. package/dist/cli-bundle/chunks/chunk-X7WWQDYQ.js +2 -0
  31. package/dist/cli-bundle/chunks/chunk-YOLLRCLY.js +13 -0
  32. package/dist/cli-bundle/chunks/{chunk-U6GQ4VMV.js → chunk-ZAVCS2GH.js} +4 -4
  33. package/dist/cli-bundle/chunks/{register-list-query-HZKBQNWW.js → register-list-query-37A4P6O4.js} +2 -2
  34. package/dist/cli-bundle/chunks/register-mutation-TBJDHYIT.js +20 -0
  35. package/dist/cli-bundle/chunks/register-operations-WRZNEBUM.js +2 -0
  36. package/dist/cli-bundle/chunks/{register-setup-QK4OTOXN.js → register-setup-H4PDLACD.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-GMYPD4FX.js → chunk-4WP7LNE3.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/chunk-6MUTDXMP.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/chunk-6Z24ZMU3.js +2 -0
  40. package/dist/cli-bundle/focused-chunks/{chunk-2ARQGDDW.js → chunk-BFA6KKCI.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/chunk-CWCN5RLO.js +26 -0
  42. package/dist/cli-bundle/focused-chunks/chunk-FCTT4CZU.js +5 -0
  43. package/dist/cli-bundle/focused-chunks/chunk-GJR6YEMR.js +156 -0
  44. package/dist/cli-bundle/focused-chunks/{chunk-2POVTNLY.js → chunk-IMWTYKII.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/{chunk-D6RBZEJJ.js → chunk-IZNRRCU3.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/{chunk-PMGJUFNQ.js → chunk-MNPECIRL.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/{chunk-A2BC5PQL.js → chunk-O4ZXNJMT.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/chunk-Q63PSLO4.js +2 -0
  49. package/dist/cli-bundle/focused-chunks/chunk-QBP5FSBX.js +4 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-R6SR45XU.js → chunk-QV5UP27O.js} +48 -47
  51. package/dist/cli-bundle/focused-chunks/chunk-RASVBJX5.js +8 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-E2EWYPY6.js → chunk-RPRLENVA.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/chunk-TOFVXBWA.js +19 -0
  54. package/dist/cli-bundle/focused-chunks/{chunk-6S2MO3Q3.js → chunk-WZLSSGEU.js} +2 -2
  55. package/dist/cli-bundle/main.js +18 -17
  56. package/dist/cli-bundle/sdk-authoring.js +1 -1
  57. package/dist/cli-bundle/sdk-contracts.js +2 -2
  58. package/dist/cli-bundle/sdk-core.js +41 -41
  59. package/dist/cli-bundle/sdk-governance.js +1 -1
  60. package/dist/cli-bundle/sdk-graph.js +1 -1
  61. package/dist/cli-bundle/sdk-merge.js +33 -32
  62. package/dist/cli-bundle/sdk-query.js +1 -1
  63. package/dist/cli-bundle/sdk-runtime.js +1 -1
  64. package/dist/cli-bundle/sdk-testing.js +1 -1
  65. package/dist/cli-bundle/sdk.js +6 -5
  66. package/dist/core/config/nested-settings.js +8 -2
  67. package/dist/core/config/positional-value.d.ts +1 -1
  68. package/dist/core/config/positional-value.js +5 -2
  69. package/dist/core/extensions/command-metadata-contract.d.ts +10 -0
  70. package/dist/core/extensions/command-metadata-contract.js +23 -0
  71. package/dist/core/extensions/command-visibility-tier.js +12 -2
  72. package/dist/core/extensions/extension-types.d.ts +6 -0
  73. package/dist/core/extensions/extension-types.js +2 -2
  74. package/dist/core/extensions/loader.js +4 -3
  75. package/dist/core/history/history.js +3 -3
  76. package/dist/core/io/body-file.js +7 -2
  77. package/dist/core/io/bulk-ids-input.d.ts +24 -0
  78. package/dist/core/io/bulk-ids-input.js +113 -0
  79. package/dist/core/item/item-format.js +66 -12
  80. package/dist/core/item/parse.d.ts +22 -2
  81. package/dist/core/item/parse.js +97 -4
  82. package/dist/core/reproducibility/context.d.ts +4 -0
  83. package/dist/core/reproducibility/context.js +14 -8
  84. package/dist/core/shared/author.d.ts +55 -1
  85. package/dist/core/shared/author.js +333 -16
  86. package/dist/core/shared/constants.js +3 -2
  87. package/dist/core/store/settings-validator.d.ts +1 -0
  88. package/dist/core/store/settings-validator.js +6 -3
  89. package/dist/core/store/settings.js +5 -2
  90. package/dist/mcp/server.d.ts +4 -3
  91. package/dist/mcp/server.js +44 -16
  92. package/dist/sdk/agent/identity-config.d.ts +63 -0
  93. package/dist/sdk/agent/identity-config.js +107 -0
  94. package/dist/sdk/agent/refusal-closure-census.d.ts +66 -0
  95. package/dist/sdk/agent/refusal-closure-census.js +144 -0
  96. package/dist/sdk/agent/refusal-corpus-contracts.d.ts +76 -0
  97. package/dist/sdk/agent/refusal-corpus-contracts.js +194 -0
  98. package/dist/sdk/agent-capability-contracts.d.ts +34 -1
  99. package/dist/sdk/agent-capability-contracts.js +104 -6
  100. package/dist/sdk/annotations.d.ts +2 -0
  101. package/dist/sdk/annotations.js +25 -7
  102. package/dist/sdk/cli-contracts/agent-output-contracts.js +6 -4
  103. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -0
  104. package/dist/sdk/cli-contracts/enum-contracts.js +9 -2
  105. package/dist/sdk/cli-contracts/flag-contracts.js +9 -2
  106. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +4 -4
  107. package/dist/sdk/cli-contracts/registration-helpers.js +5 -2
  108. package/dist/sdk/cli-contracts/tool-parameter-tables.js +58 -2
  109. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  110. package/dist/sdk/cli-contracts/tool-schema.js +14 -3
  111. package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +4 -1
  112. package/dist/sdk/cli-contracts/typed-action-inputs.js +2 -2
  113. package/dist/sdk/cli-contracts.d.ts +3 -3
  114. package/dist/sdk/cli-contracts.js +4 -4
  115. package/dist/sdk/comments.js +15 -7
  116. package/dist/sdk/config.d.ts +6 -1
  117. package/dist/sdk/config.js +119 -14
  118. package/dist/sdk/context-intent-contracts.js +4 -2
  119. package/dist/sdk/core-governance.d.ts +1 -1
  120. package/dist/sdk/core-governance.js +3 -3
  121. package/dist/sdk/extension/scaffold.js +11 -5
  122. package/dist/sdk/flag-invocation-contracts.d.ts +2 -0
  123. package/dist/sdk/flag-invocation-contracts.js +30 -3
  124. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +83 -2
  125. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +87 -2
  126. package/dist/sdk/governance/assurance-action.js +30 -10
  127. package/dist/sdk/governance/validate.d.ts +2 -2
  128. package/dist/sdk/governance/validate.js +39 -14
  129. package/dist/sdk/guide-topics.d.ts +0 -5
  130. package/dist/sdk/guide-topics.js +28 -2
  131. package/dist/sdk/history-compact.d.ts +2 -1
  132. package/dist/sdk/history-compact.js +24 -5
  133. package/dist/sdk/history-mcp.js +11 -10
  134. package/dist/sdk/index.d.ts +8 -2
  135. package/dist/sdk/index.js +9 -3
  136. package/dist/sdk/item-transaction.js +19 -12
  137. package/dist/sdk/lifecycle/append.js +4 -4
  138. package/dist/sdk/lifecycle/close-many.js +16 -7
  139. package/dist/sdk/lifecycle/create.js +33 -22
  140. package/dist/sdk/lifecycle/plan.js +24 -6
  141. package/dist/sdk/lifecycle/update-many.js +15 -8
  142. package/dist/sdk/lifecycle/update.d.ts +2 -0
  143. package/dist/sdk/lifecycle/update.js +37 -25
  144. package/dist/sdk/merge/three-way.js +105 -26
  145. package/dist/sdk/read-output-budget.d.ts +21 -0
  146. package/dist/sdk/read-output-budget.js +39 -2
  147. package/dist/sdk/read-output-contracts.d.ts +5 -3
  148. package/dist/sdk/read-output-contracts.js +20 -12
  149. package/dist/sdk/reproducibility/process.d.ts +19 -0
  150. package/dist/sdk/reproducibility/process.js +88 -0
  151. package/dist/sdk/runtime-extended-actions.js +5 -3
  152. package/dist/sdk/runtime-input.d.ts +4 -0
  153. package/dist/sdk/runtime-input.js +98 -23
  154. package/dist/sdk/runtime-primitives.d.ts +3 -2
  155. package/dist/sdk/runtime-primitives.js +5 -4
  156. package/dist/sdk/runtime.js +11 -23
  157. package/dist/sdk/scheduling-shortcuts.js +5 -3
  158. package/dist/sdk/structured-mutations.js +10 -3
  159. package/dist/sdk/test/batch.d.ts +6 -0
  160. package/dist/sdk/test/batch.js +15 -3
  161. package/dist/sdk/test/entry.d.ts +1 -1
  162. package/dist/sdk/test/entry.js +3 -2
  163. package/dist/sdk/test/execution.d.ts +28 -3
  164. package/dist/sdk/test/execution.js +193 -34
  165. package/dist/sdk/test/parsers.d.ts +6 -0
  166. package/dist/sdk/test/parsers.js +21 -2
  167. package/dist/sdk/test/trust.d.ts +33 -0
  168. package/dist/sdk/test/trust.js +207 -0
  169. package/dist/sdk/workspace-contracts.d.ts +3 -0
  170. package/dist/sdk/workspace-contracts.js +3 -2
  171. package/dist/types.d.ts +23 -0
  172. package/dist/types.js +2 -2
  173. package/docs/AGENT_PROVENANCE_ADR.md +41 -5
  174. package/docs/CONFIGURATION.md +4 -0
  175. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +19 -2
  176. package/docs/MERGE_SAFETY.md +15 -1
  177. package/docs/README.md +2 -0
  178. package/docs/READ_OUTPUT_CONTRACTS.md +11 -1
  179. package/docs/RELEASING.md +40 -21
  180. package/docs/REPRODUCIBLE_WORKSPACES.md +42 -8
  181. package/docs/SCRIPTING.md +62 -3
  182. package/docs/SDK.md +17 -0
  183. package/docs/SDK_AGENT_SESSION_CONTEXT.md +6 -4
  184. package/docs/SDK_EVIDENCE_TRACEABILITY.md +1 -1
  185. package/docs/TESTING.md +75 -8
  186. package/docs/agent-task-token-baseline.json +2 -2
  187. package/docs/generated/AGENT_CAPABILITY_ROUTING.md +17 -0
  188. package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -1
  189. package/docs/generated/FLAG_LEXICON_BUDGETS.md +2 -2
  190. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +355 -0
  191. package/marketplace.json +2 -2
  192. package/package.json +2 -2
  193. package/packages/pm-beads/package.json +1 -1
  194. package/packages/pm-calendar/package.json +1 -1
  195. package/packages/pm-command-kit/README.md +9 -11
  196. package/packages/pm-command-kit/extensions/command-kit/index.ts +3 -1
  197. package/packages/pm-command-kit/package.json +1 -1
  198. package/packages/pm-digital-twin/package.json +1 -1
  199. package/packages/pm-governance-audit/package.json +1 -1
  200. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +10 -0
  201. package/packages/pm-guide-shell/package.json +1 -1
  202. package/packages/pm-kanban/package.json +1 -1
  203. package/packages/pm-lifecycle-hooks/package.json +1 -1
  204. package/packages/pm-linked-test-adapters/package.json +1 -1
  205. package/packages/pm-search-advanced/package.json +1 -1
  206. package/packages/pm-templates/package.json +1 -1
  207. package/packages/pm-todos/package.json +1 -1
  208. package/packages/pm-vcs/package.json +1 -1
  209. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  210. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  211. package/scripts/generate-agent-capability-surfaces.mjs +27 -1
  212. package/sdk/public-surface.json +642 -28
  213. package/dist/cli-bundle/chunks/chunk-EMWDM5FI.js +0 -13
  214. package/dist/cli-bundle/chunks/chunk-HYG6LRL4.js +0 -200
  215. package/dist/cli-bundle/chunks/chunk-QI2CT3IX.js +0 -2
  216. package/dist/cli-bundle/chunks/chunk-SMWXHMVB.js +0 -35
  217. package/dist/cli-bundle/chunks/chunk-VMMIL3SI.js +0 -2
  218. package/dist/cli-bundle/chunks/chunk-YBPJAOQQ.js +0 -3
  219. package/dist/cli-bundle/chunks/register-mutation-HTKEEGRD.js +0 -20
  220. package/dist/cli-bundle/chunks/register-operations-6EMRWJJY.js +0 -2
  221. package/dist/cli-bundle/focused-chunks/chunk-2AZT5WXZ.js +0 -2
  222. package/dist/cli-bundle/focused-chunks/chunk-3LKU6PTJ.js +0 -4
  223. package/dist/cli-bundle/focused-chunks/chunk-5SHSBMX2.js +0 -2
  224. package/dist/cli-bundle/focused-chunks/chunk-C4S4A4JJ.js +0 -5
  225. package/dist/cli-bundle/focused-chunks/chunk-L5LDSRO2.js +0 -155
  226. package/dist/cli-bundle/focused-chunks/chunk-MB37AYN6.js +0 -26
  227. package/dist/cli-bundle/focused-chunks/chunk-MCOR37QK.js +0 -2
  228. package/dist/cli-bundle/focused-chunks/chunk-PH2OXXVZ.js +0 -18
  229. package/dist/cli-bundle/focused-chunks/chunk-WZE4LIPW.js +0 -8
@@ -1,6 +1,6 @@
1
1
  /** Generated partition 2 of the exhaustive error-code catalog. */
2
2
 
3
- !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]="4f1bb829-c6be-5a3e-90f2-4b0062aa2dac")}catch(e){}}();
3
+ !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]="8724f8ed-1236-5779-9e97-dc4b35866839")}catch(e){}}();
4
4
  export const PM_ERROR_CODE_CATALOG_PART_2 = [
5
5
  {
6
6
  code: "missing_cli_flag",
@@ -122,6 +122,7 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
122
122
  "cli/main.ts",
123
123
  "cli/register-mutation.ts",
124
124
  "core/telemetry/observability.ts",
125
+ "sdk/governance/assurance-action.ts",
125
126
  "sdk/history-redact.ts",
126
127
  "sdk/invocation-author.ts",
127
128
  ],
@@ -543,6 +544,78 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
543
544
  canonical_code: "redundant_edge",
544
545
  aliases: [],
545
546
  },
547
+ {
548
+ code: "refusal_allowed_values_mismatch",
549
+ meaning: "Refusal allowed values mismatch condition.",
550
+ stability: "provisional",
551
+ exit_code: 1,
552
+ class: "generic_failure",
553
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
554
+ sources: ["sdk/agent/refusal-corpus-contracts.ts"],
555
+ emitting_commands: ["*"],
556
+ canonical_code: "refusal_allowed_values_mismatch",
557
+ aliases: [],
558
+ },
559
+ {
560
+ code: "refusal_error_code_mismatch",
561
+ meaning: "Refusal error code mismatch condition.",
562
+ stability: "provisional",
563
+ exit_code: 1,
564
+ class: "generic_failure",
565
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
566
+ sources: ["sdk/agent/refusal-corpus-contracts.ts"],
567
+ emitting_commands: ["*"],
568
+ canonical_code: "refusal_error_code_mismatch",
569
+ aliases: [],
570
+ },
571
+ {
572
+ code: "refusal_exit_code_mismatch",
573
+ meaning: "Refusal exit code mismatch condition.",
574
+ stability: "provisional",
575
+ exit_code: 1,
576
+ class: "generic_failure",
577
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
578
+ sources: ["sdk/agent/refusal-corpus-contracts.ts"],
579
+ emitting_commands: ["*"],
580
+ canonical_code: "refusal_exit_code_mismatch",
581
+ aliases: [],
582
+ },
583
+ {
584
+ code: "refusal_mutated_state",
585
+ meaning: "Refusal mutated state condition.",
586
+ stability: "provisional",
587
+ exit_code: 1,
588
+ class: "generic_failure",
589
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
590
+ sources: ["sdk/agent/refusal-corpus-contracts.ts"],
591
+ emitting_commands: ["*"],
592
+ canonical_code: "refusal_mutated_state",
593
+ aliases: [],
594
+ },
595
+ {
596
+ code: "refusal_probe_missing",
597
+ meaning: "Refusal probe missing condition.",
598
+ stability: "provisional",
599
+ exit_code: 1,
600
+ class: "generic_failure",
601
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
602
+ sources: ["sdk/agent/refusal-corpus-contracts.ts"],
603
+ emitting_commands: ["*"],
604
+ canonical_code: "refusal_probe_missing",
605
+ aliases: [],
606
+ },
607
+ {
608
+ code: "refusal_recovery_failed",
609
+ meaning: "Refusal recovery failed condition.",
610
+ stability: "provisional",
611
+ exit_code: 1,
612
+ class: "generic_failure",
613
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
614
+ sources: ["sdk/agent/refusal-corpus-contracts.ts"],
615
+ emitting_commands: ["*"],
616
+ canonical_code: "refusal_recovery_failed",
617
+ aliases: [],
618
+ },
546
619
  {
547
620
  code: "reindex_already_running",
548
621
  meaning: "Reindex already running condition.",
@@ -1111,6 +1184,18 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
1111
1184
  canonical_code: "undeclared_observation",
1112
1185
  aliases: [],
1113
1186
  },
1187
+ {
1188
+ code: "unexpected_refusal_probe",
1189
+ meaning: "Unexpected refusal probe condition.",
1190
+ stability: "provisional",
1191
+ exit_code: 1,
1192
+ class: "generic_failure",
1193
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1194
+ sources: ["sdk/agent/refusal-corpus-contracts.ts"],
1195
+ emitting_commands: ["*"],
1196
+ canonical_code: "unexpected_refusal_probe",
1197
+ aliases: [],
1198
+ },
1114
1199
  {
1115
1200
  code: "unknown_command",
1116
1201
  meaning: "Unknown command condition.",
@@ -1990,4 +2075,4 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
1990
2075
  },
1991
2076
  ];
1992
2077
  //# sourceMappingURL=generated-error-code-catalog-part-2.js.map
1993
- //# debugId=4f1bb829-c6be-5a3e-90f2-4b0062aa2dac
2078
+ //# debugId=8724f8ed-1236-5779-9e97-dc4b35866839
@@ -4,7 +4,7 @@
4
4
  * Normalizes the assurance action vocabulary once for CLI, SDK, and MCP hosts.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="57c12241-812d-5db6-9a07-ca256152b130")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f66a964d-1352-5523-ab91-5177d0d93ce8")}catch(e){}}();
8
8
  import { createHash } from "node:crypto";
9
9
  import { EXIT_CODE } from "../../core/shared/constants.js";
10
10
  import { PmCliError } from "../../core/shared/errors.js";
@@ -18,6 +18,7 @@ import { resolvePmRoot } from "../runtime-primitives.js";
18
18
  import { parseRuntimeInteger, readRuntimeString } from "../runtime-input.js";
19
19
  import { analyzeDefectChangeRisk, buildDefectRecurrenceIndex, parseDefectChangeRiskRequest, } from "./defect-recurrence.js";
20
20
  import { defectRecurrenceItemSignals } from "./defect-recurrence-signals.js";
21
+ import { createUnknownSubcommandError } from "../agent/subcommand-recovery.js";
21
22
  let riskIndexCache;
22
23
  /** Assurance registry and evaluation verbs shared by every transport. */
23
24
  export const ASSURANCE_ACTIONS = [
@@ -43,17 +44,36 @@ function parseAction(value) {
43
44
  if (ASSURANCE_ACTIONS.includes(value)) {
44
45
  return value;
45
46
  }
46
- throw new PmCliError(`Unknown assurance action ${value}. Expected: ${ASSURANCE_ACTIONS.join(", ")}`, EXIT_CODE.USAGE);
47
+ throw createUnknownSubcommandError({
48
+ command_path: "assurance",
49
+ token: value,
50
+ allowed: ASSURANCE_ACTIONS,
51
+ display_name: "assurance action",
52
+ });
53
+ }
54
+ /** Throw the shared structured usage refusal for a missing assurance operand. */
55
+ function missingAssuranceArgument(operand, detail, example) {
56
+ throw new PmCliError(detail, EXIT_CODE.USAGE, {
57
+ code: "missing_required_argument",
58
+ required: `Provide the missing assurance operand: ${operand}.`,
59
+ examples: [example],
60
+ recovery: { missing: [operand] },
61
+ });
47
62
  }
48
63
  function parseKind(value) {
49
- if (value &&
50
- ASSURANCE_DECLARATION_KINDS.includes(value)) {
64
+ if (!value) {
65
+ return missingAssuranceArgument("kind", `Assurance declaration kind is required. Expected: ${ASSURANCE_DECLARATION_KINDS.join(", ")}`, "pm assurance list measurement");
66
+ }
67
+ if (ASSURANCE_DECLARATION_KINDS.includes(value)) {
51
68
  return value;
52
69
  }
53
70
  throw new PmCliError(`Assurance declaration kind is required. Expected: ${ASSURANCE_DECLARATION_KINDS.join(", ")}`, EXIT_CODE.USAGE);
54
71
  }
55
72
  function parsePreset(value) {
56
- if (value && ASSURANCE_PRESET_IDS.includes(value)) {
73
+ if (!value) {
74
+ return missingAssuranceArgument("preset", `Assurance preset is required. Expected: ${ASSURANCE_PRESET_IDS.join(", ")}`, "pm assurance apply software-delivery --owner <pm-item-id>");
75
+ }
76
+ if (ASSURANCE_PRESET_IDS.includes(value)) {
57
77
  return value;
58
78
  }
59
79
  throw new PmCliError(`Assurance preset is required. Expected: ${ASSURANCE_PRESET_IDS.join(", ")}`, EXIT_CODE.USAGE);
@@ -61,7 +81,7 @@ function parsePreset(value) {
61
81
  function requireOwner(input) {
62
82
  if (input.owner?.trim())
63
83
  return input.owner.trim();
64
- throw new PmCliError("assurance preset and derivation actions require --owner <pm-item-id>", EXIT_CODE.USAGE);
84
+ return missingAssuranceArgument("owner", "assurance preset and derivation actions require --owner <pm-item-id>", "pm assurance apply software-delivery --owner <pm-item-id>");
65
85
  }
66
86
  function parseDefinition(kind, value) {
67
87
  let parsed = value;
@@ -173,7 +193,7 @@ async function runAdoptionAction(action, input, pmRoot) {
173
193
  };
174
194
  }
175
195
  if (!input.id) {
176
- throw new PmCliError("assurance promote requires an assertion id", EXIT_CODE.USAGE);
196
+ return missingAssuranceArgument("assertion-id", "assurance promote requires an assertion id", "pm assurance promote <assertion-id> --enforcement warn");
177
197
  }
178
198
  if (input.enforcement !== "warn" && input.enforcement !== "block") {
179
199
  throw new PmCliError("assurance promote requires --enforcement warn|block", EXIT_CODE.USAGE);
@@ -186,7 +206,7 @@ async function runAdoptionAction(action, input, pmRoot) {
186
206
  }
187
207
  async function runGateAction(input, pmRoot, runtime) {
188
208
  if (!input.id) {
189
- throw new PmCliError("assurance run requires a gate id", EXIT_CODE.USAGE);
209
+ return missingAssuranceArgument("gate-id", "assurance run requires a gate id", "pm assurance run <gate-id> --trigger ci --dry-run");
190
210
  }
191
211
  const gateId = input.id;
192
212
  if (!input.trigger) {
@@ -320,7 +340,7 @@ export async function runAssuranceAction(input, global = {}, runtime = {}) {
320
340
  if (action === "list")
321
341
  return listAssuranceDeclarations(pmRoot, kind);
322
342
  if (!input.id) {
323
- throw new PmCliError(`assurance ${action} requires an id`, EXIT_CODE.USAGE);
343
+ return missingAssuranceArgument("id", `assurance ${action} requires an id`, `pm assurance ${action} ${kind} <id>`);
324
344
  }
325
345
  const id = input.id;
326
346
  if (action === "show") {
@@ -377,4 +397,4 @@ export function runAssuranceDispatch(args, options, global) {
377
397
  }, global);
378
398
  }
379
399
  //# sourceMappingURL=assurance-action.js.map
380
- //# debugId=57c12241-812d-5db6-9a07-ca256152b130
400
+ //# debugId=f66a964d-1352-5523-ab91-5177d0d93ce8
@@ -231,10 +231,10 @@ declare function buildFilesCheck(items: ItemWithBody[], workspaceRoot: string, p
231
231
  warnings: string[];
232
232
  staleLinkPruneRows: StaleLinkPruneRow[];
233
233
  }>;
234
- declare function buildCommandReferencesCheck(items: ItemWithBody[], idPrefix: string, verboseDiagnostics: boolean): {
234
+ declare function buildCommandReferencesCheck(items: ItemWithBody[], idPrefix: string, verboseDiagnostics: boolean, pmRoot: string): Promise<{
235
235
  check: ValidateCheck;
236
236
  warnings: string[];
237
- };
237
+ }>;
238
238
  /** Apply one planned fix through the SAME audited command paths an operator would use by hand (`pm update` / `pm files --remove` / `pm docs --remove`), so every applied fix carries normal history, locking, and hook behavior. Command modules are imported lazily: plain validate runs stay read-only and never pay the mutation-stack import cost. */
239
239
  declare function applyValidateFix(fix: ValidateFixRecord, global: GlobalOptions, services: ValidateMutationServices): Promise<void>;
240
240
  declare function applyValidateFixes(applicable: ValidateFixRecord[], global: GlobalOptions, services: ValidateMutationServices): Promise<{
@@ -4,7 +4,7 @@
4
4
  * Implements the pm validate command surface and its agent-facing runtime behavior.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="87e3932d-26f0-5d44-ac35-5d0d7d1f4467")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="aca69fd7-c47a-5424-b58f-f305f690edd9")}catch(e){}}();
8
8
  import { assertInitializedTracker } from "../environment/tracker-preflight.js";
9
9
  import fs from "node:fs/promises";
10
10
  import { realpathSync } from "node:fs";
@@ -42,6 +42,7 @@ import { createRelationshipKindRegistry, } from "../relationships.js";
42
42
  import { runDocs } from "../docs.js";
43
43
  import { runFiles } from "../files.js";
44
44
  import { extractReferencedPmItemIdsFromCommand } from "../test/linked-command-detection.js";
45
+ import { resolveLinkedTestSourceRef, resolveLinkedTestSourceWorkspaceRoot, resolveLinkedTestTrustBatch, } from "../test/trust.js";
45
46
  import { readValidateItems, } from "./validate-item-reader.js";
46
47
  import { buildValidateHistoryDriftCheck } from "./validate-history-drift.js";
47
48
  import { buildLifecycleParentGraph, detectLifecycleParentCycles, resolveLifecycleDependencyCycleSamplePath, } from "./hierarchy-validation.js";
@@ -1710,23 +1711,40 @@ async function buildFilesCheck(items, workspaceRoot, pmRoot, fileScanMode, inclu
1710
1711
  };
1711
1712
  }
1712
1713
  /* c8 ignore stop */
1713
- /* c8 ignore start -- command preview truncation formatting is covered by command-reference integration fixtures */
1714
- function summarizeCommandReferenceRow(ownerId, referencedId, command) {
1714
+ /** Collapse a linked command to the bounded preview used in validation rows. */
1715
+ function summarizeCommandPreview(command) {
1715
1716
  const normalizedCommand = command.trim().replaceAll(/\s+/g, " ");
1716
- const commandPreview = normalizedCommand.length > 120
1717
+ return normalizedCommand.length > 120
1717
1718
  ? `${normalizedCommand.slice(0, 117)}...`
1718
1719
  : normalizedCommand;
1719
- return `${ownerId}:${referencedId}:${commandPreview}`;
1720
1720
  }
1721
- /* c8 ignore stop */
1721
+ /** Join command-reference identity and its bounded preview for diagnostics. */
1722
+ function summarizeCommandReferenceRow(ownerId, referencedId, command) {
1723
+ return `${ownerId}:${referencedId}:${summarizeCommandPreview(command)}`;
1724
+ }
1725
+ /** Render portable diagnostics for linked tests that this clone has not trusted. */
1726
+ function buildUntrustedLinkedTestRows(linkedTests, trustDecisions) {
1727
+ const rows = [];
1728
+ linkedTests.forEach(({ item, linkedTest }, index) => {
1729
+ const trust = trustDecisions[index];
1730
+ if (trust.trusted)
1731
+ return;
1732
+ const command = summarizeCommandPreview(linkedTest.command ?? "");
1733
+ rows.push(`${item.id}:${trust.source_ref ?? "unknown"}->${trust.current_source_ref ?? "unknown"}:${command}`);
1734
+ });
1735
+ return rows;
1736
+ }
1722
1737
  /* c8 ignore start -- command-reference discovery/stale-id permutations are covered by linked-test integration suites */
1723
- function buildCommandReferencesCheck(items, idPrefix, verboseDiagnostics) {
1738
+ async function buildCommandReferencesCheck(items, idPrefix, verboseDiagnostics, pmRoot) {
1724
1739
  const knownIds = new Set(items.map((item) => item.id.toLowerCase()));
1725
1740
  let linkedCommandsScanned = 0;
1726
1741
  let referencedPmIdCount = 0;
1727
1742
  const referencedPmIds = new Set();
1728
1743
  const staleReferenceRows = [];
1729
1744
  const linkedTests = items.flatMap((item) => (item.tests ?? []).map((linkedTest) => ({ item, linkedTest })));
1745
+ const currentSourceRef = await resolveLinkedTestSourceRef(resolveLinkedTestSourceWorkspaceRoot());
1746
+ const trustDecisions = await resolveLinkedTestTrustBatch(pmRoot, linkedTests.map(({ linkedTest }) => linkedTest), currentSourceRef);
1747
+ const untrustedRows = buildUntrustedLinkedTestRows(linkedTests, trustDecisions);
1730
1748
  for (const { item, linkedTest } of linkedTests) {
1731
1749
  if (typeof linkedTest.command !== "string" ||
1732
1750
  linkedTest.command.trim().length === 0) {
@@ -1751,17 +1769,20 @@ function buildCommandReferencesCheck(items, idPrefix, verboseDiagnostics) {
1751
1769
  ]
1752
1770
  .filter((value) => value.length > 0)
1753
1771
  .sort((left, right) => left.localeCompare(right));
1754
- const warnings = uniqueStaleReferenceRows.length > 0
1755
- ? [
1756
- `validate_command_references_stale_pm_ids:${uniqueStaleReferenceRows.length}`,
1757
- ]
1758
- : [];
1772
+ const warnings = [];
1773
+ if (uniqueStaleReferenceRows.length > 0) {
1774
+ warnings.push(`validate_command_references_stale_pm_ids:${uniqueStaleReferenceRows.length}`);
1775
+ }
1776
+ if (untrustedRows.length > 0) {
1777
+ warnings.push(`validate_linked_test_trust_unacknowledged:${untrustedRows.length}`);
1778
+ }
1759
1779
  const diagnosticLimit = verboseDiagnostics
1760
1780
  ? Number.POSITIVE_INFINITY
1761
1781
  : DIAGNOSTIC_LIST_SUMMARY_LIMIT;
1762
1782
  const summarizedRows = summarizeList(uniqueStaleReferenceRows, diagnosticLimit);
1763
1783
  const summarizedStalePmIds = summarizeList(stalePmIds, diagnosticLimit);
1764
1784
  const summarizedReferencedPmIds = summarizeList([...referencedPmIds].sort((left, right) => left.localeCompare(right)), diagnosticLimit);
1785
+ const summarizedUntrustedRows = summarizeList(untrustedRows, diagnosticLimit);
1765
1786
  return {
1766
1787
  check: {
1767
1788
  name: "command_references",
@@ -1774,6 +1795,10 @@ function buildCommandReferencesCheck(items, idPrefix, verboseDiagnostics) {
1774
1795
  unique_referenced_pm_ids_count: referencedPmIds.size,
1775
1796
  unique_referenced_pm_ids: summarizedReferencedPmIds.values,
1776
1797
  unique_referenced_pm_ids_truncated: summarizedReferencedPmIds.truncated,
1798
+ linked_test_trust_current_source_ref: currentSourceRef ?? null,
1799
+ untrusted_linked_tests_count: untrustedRows.length,
1800
+ untrusted_linked_tests: summarizedUntrustedRows.values,
1801
+ untrusted_linked_tests_truncated: summarizedUntrustedRows.truncated,
1777
1802
  stale_pm_id_references_count: uniqueStaleReferenceRows.length,
1778
1803
  stale_pm_ids_count: stalePmIds.length,
1779
1804
  stale_pm_ids: summarizedStalePmIds.values,
@@ -2093,7 +2118,7 @@ async function executeRequestedValidateChecks(params) {
2093
2118
  recordValidateCheck(state, built, fixHintsEnabled);
2094
2119
  }
2095
2120
  if (params.requestedChecks.has("command_references")) {
2096
- recordValidateCheck(state, buildCommandReferencesCheck(params.items, params.settings.id_prefix, fullDiagnostics), fixHintsEnabled);
2121
+ recordValidateCheck(state, await buildCommandReferencesCheck(params.items, params.settings.id_prefix, fullDiagnostics, params.pmRoot), fixHintsEnabled);
2097
2122
  }
2098
2123
  if (params.requestedChecks.has("history_drift")) {
2099
2124
  recordValidateCheck(state, await buildValidateHistoryDriftCheck(params.pmRoot, params.items, fullDiagnostics), fixHintsEnabled);
@@ -2255,4 +2280,4 @@ export async function runValidate(options, global, services = {}) {
2255
2280
  }
2256
2281
  /* c8 ignore stop */
2257
2282
  //# sourceMappingURL=validate.js.map
2258
- //# debugId=87e3932d-26f0-5d44-ac35-5d0d7d1f4467
2283
+ //# debugId=aca69fd7-c47a-5424-b58f-f305f690edd9
@@ -1,8 +1,3 @@
1
- /**
2
- * @module cli/guide-topics
3
- *
4
- * Provides CLI runtime support for Guide Topics.
5
- */
6
1
  /** Describes one documentation file surfaced by a progressive-disclosure guide topic. */
7
2
  export interface GuideDocReference {
8
3
  /** Filesystem path used for path resolution. */
@@ -1,9 +1,35 @@
1
+ /**
2
+ * @module cli/guide-topics
3
+ *
4
+ * Provides CLI runtime support for Guide Topics.
5
+ */
1
6
 
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]="7be35c3f-df6f-5ed6-b887-a7d8d53910a7")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3e5f92c9-c299-592d-a7ab-a6f9998159f0")}catch(e){}}();
8
+ import { listPmCommandCapabilityGroups } from "./agent-capability-contracts.js";
3
9
  function normalizeTopicToken(value) {
4
10
  return value.trim().toLowerCase().replaceAll("_", "-");
5
11
  }
6
12
  const GUIDE_TOPICS = [
13
+ {
14
+ id: "capabilities",
15
+ aliases: ["capability-map", "families", "routing"],
16
+ title: "Generated Capability Routing",
17
+ summary: "Route work through command families generated from the canonical agent capability contract.",
18
+ intent: "Use this as the drift-free entrypoint when selecting a CLI, MCP, completion, documentation, or extension command surface.",
19
+ commands: listPmCommandCapabilityGroups().flatMap(({ commands }) => commands.map((command) => `pm ${command}`)),
20
+ workflows: [],
21
+ docs: [
22
+ {
23
+ path: "docs/generated/AGENT_CAPABILITY_ROUTING.md",
24
+ purpose: "Generated command-to-family routing table.",
25
+ },
26
+ {
27
+ path: "docs/generated/AGENT_COMMAND_SURFACE.md",
28
+ purpose: "Generated visibility-tier and family table.",
29
+ },
30
+ ],
31
+ related: ["commands", "workflows", "extensions"],
32
+ },
7
33
  {
8
34
  id: "quickstart",
9
35
  aliases: ["start", "getting-started", "bootstrap"],
@@ -565,4 +591,4 @@ export function resolveGuideTopic(rawTopic) {
565
591
  return TOPIC_BY_TOKEN.get(normalized) ?? null;
566
592
  }
567
593
  //# sourceMappingURL=guide-topics.js.map
568
- //# debugId=7be35c3f-df6f-5ed6-b887-a7d8d53910a7
594
+ //# debugId=3e5f92c9-c299-592d-a7ab-a6f9998159f0
@@ -1,4 +1,5 @@
1
1
  import { type HistoryCompactBulkSkipReason, type HistoryCompactScope } from "../core/history/history-compact-bulk.js";
2
+ import { type BulkIdsValue } from "../core/io/bulk-ids-input.js";
2
3
  import type { GlobalOptions } from "../core/shared/command-types.js";
3
4
  /** Documents the history compact command options payload exchanged by command, SDK, and package integrations. */
4
5
  export interface HistoryCompactCommandOptions {
@@ -58,7 +59,7 @@ export declare const HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES = 3;
58
59
  /** Documents the bulk history compact command options payload exchanged by command, SDK, and package integrations. */
59
60
  export interface HistoryCompactBulkCommandOptions {
60
61
  /** Value that configures or reports ids for this contract. */
61
- ids?: string[];
62
+ ids?: BulkIdsValue;
62
63
  /** Value that configures or reports scope for this contract. */
63
64
  scope?: HistoryCompactScope;
64
65
  /** Value that configures or reports all over for this contract. */
@@ -4,7 +4,7 @@
4
4
  * Implements the pm history compact command surface and its agent-facing runtime behavior.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="adcf4d1b-689d-52cb-903b-5fba857707f3")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="31152621-df59-54a5-a28d-63119e734e6e")}catch(e){}}();
8
8
  import { assertInitializedTracker } from "./environment/tracker-preflight.js";
9
9
  import fs from "node:fs/promises";
10
10
  import path from "node:path";
@@ -19,6 +19,7 @@ import { lifecycleClassifierFromStatusRegistry } from "../core/governance/metada
19
19
  import { resolveRuntimeStatusRegistry } from "../core/schema/runtime-schema.js";
20
20
  import { listAllItemMetadataLight } from "../core/store/item-store.js";
21
21
  import { pathExists, readFileIfExists } from "../core/fs/fs-utils.js";
22
+ import { normalizeBulkIdsValue, parseBulkIdsText, } from "../core/io/bulk-ids-input.js";
22
23
  import { EXIT_CODE } from "../core/shared/constants.js";
23
24
  import { PmCliError } from "../core/shared/errors.js";
24
25
  import { nowIso } from "../core/shared/time.js";
@@ -301,6 +302,21 @@ export async function runHistoryCompact(id, options, global) {
301
302
  }
302
303
  /** Default entry floor below which a stream is treated as already compact. */
303
304
  export const HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES = 3;
305
+ function normalizeHistoryCompactBulkOptions(options) {
306
+ const normalizedIdsText = normalizeBulkIdsValue(options.ids);
307
+ if (options.ids !== undefined && normalizedIdsText === "") {
308
+ throw new PmCliError("history-compact ids requires at least one valid item ID.", EXIT_CODE.USAGE, {
309
+ code: "bulk_ids_input_empty",
310
+ required: "Provide one or more string or finite numeric IDs; non-finite and unsupported selector values are rejected.",
311
+ });
312
+ }
313
+ return {
314
+ ...options,
315
+ ids: normalizedIdsText === undefined
316
+ ? undefined
317
+ : parseBulkIdsText(normalizedIdsText),
318
+ };
319
+ }
304
320
  /** Enforce the `pm history-compact` target contract shared by the CLI and MCP surfaces: exactly one selection mode — a single item `<id>`, an explicit `--ids` list, or a scan selector (`--all-over` / `--closed` / `--all-streams`). */
305
321
  export function assertHistoryCompactTarget(id, bulk) {
306
322
  const hasIds = bulk.ids !== undefined && bulk.ids.length > 0;
@@ -436,6 +452,7 @@ async function runHistoryCompactBulkRow(params) {
436
452
  * configured policy drives the sweep.
437
453
  */
438
454
  export async function runHistoryCompactBulk(options, global) {
455
+ const normalizedOptions = normalizeHistoryCompactBulkOptions(options);
439
456
  const pmRoot = resolvePmRoot(process.cwd(), global.path);
440
457
  await assertInitializedTracker(pmRoot);
441
458
  const settings = await readSettings(pmRoot);
@@ -445,14 +462,16 @@ export async function runHistoryCompactBulk(options, global) {
445
462
  settings,
446
463
  typeToFolder: typeRegistry.type_to_folder,
447
464
  });
448
- const mode = options.ids !== undefined && options.ids.length > 0 ? "ids" : "scan";
465
+ const mode = normalizedOptions.ids !== undefined && normalizedOptions.ids.length > 0
466
+ ? "ids"
467
+ : "scan";
449
468
  const minEntries = options.minEntries ?? HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES;
450
469
  const policy = settings.history.compact_policy;
451
470
  const policyThresholdApplied = mode === "scan" && options.allOver === undefined && policy.enabled;
452
471
  const allOver = options.allOver ??
453
472
  (policyThresholdApplied ? policy.max_entries : undefined);
454
473
  const selection = selectHistoryCompactBulkTargets(candidates, {
455
- ids: options.ids,
474
+ ids: normalizedOptions.ids,
456
475
  scope: options.scope,
457
476
  minEntries,
458
477
  allOver,
@@ -469,7 +488,7 @@ export async function runHistoryCompactBulk(options, global) {
469
488
  for (const row of selection) {
470
489
  const outcome = await runHistoryCompactBulkRow({
471
490
  row,
472
- options,
491
+ options: normalizedOptions,
473
492
  dryRun,
474
493
  global,
475
494
  });
@@ -502,4 +521,4 @@ export async function runHistoryCompactBulk(options, global) {
502
521
  };
503
522
  }
504
523
  //# sourceMappingURL=history-compact.js.map
505
- //# debugId=adcf4d1b-689d-52cb-903b-5fba857707f3
524
+ //# debugId=31152621-df59-54a5-a28d-63119e734e6e
@@ -1,5 +1,6 @@
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]="f762b5e6-8224-531f-9dd1-f71dc18c3ddf")}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]="4888a558-7f50-5c28-8e29-fcd19180cbd4")}catch(e){}}();
3
+ import { normalizeBulkIdsValue, parseBulkIdsText, } from "../core/io/bulk-ids-input.js";
3
4
  import { EXIT_CODE } from "../core/shared/constants.js";
4
5
  import { PmCliError } from "../core/shared/errors.js";
5
6
  import { assertHistoryCompactTarget, runHistoryCompact, runHistoryCompactBulk, } from "./history-compact.js";
@@ -17,14 +18,14 @@ export function runMcpHistoryRepairAction(context) {
17
18
  /** Dispatch single or bounded bulk history compaction from an MCP payload. */
18
19
  export function runMcpHistoryCompactAction(context) {
19
20
  const idsSource = context.options.ids;
20
- const ids = Array.isArray(idsSource)
21
- ? idsSource.map(String).filter((value) => value.trim().length > 0)
22
- : typeof idsSource === "string"
23
- ? idsSource
24
- .split(",")
25
- .map((value) => value.trim())
26
- .filter(Boolean)
27
- : undefined;
21
+ const normalizedIds = normalizeBulkIdsValue(idsSource);
22
+ if (idsSource !== undefined && normalizedIds === "") {
23
+ throw new PmCliError("history-compact ids requires at least one valid item ID.", EXIT_CODE.USAGE, {
24
+ code: "bulk_ids_input_empty",
25
+ required: "Provide one or more string or finite numeric IDs; non-finite and unsupported selector values are rejected.",
26
+ });
27
+ }
28
+ const ids = normalizedIds === undefined ? undefined : parseBulkIdsText(normalizedIds);
28
29
  const allOver = parseRuntimeInteger(context.options.allOver ?? context.options.all_over, "history-compact allOver");
29
30
  const minEntries = parseRuntimeInteger(context.options.minEntries ?? context.options.min_entries, "history-compact minEntries");
30
31
  const explicitScope = readRuntimeString(context.options, "scope");
@@ -65,4 +66,4 @@ export function runMcpHistoryCompactAction(context) {
65
66
  }, context.global);
66
67
  }
67
68
  //# sourceMappingURL=history-mcp.js.map
68
- //# debugId=f762b5e6-8224-531f-9dd1-f71dc18c3ddf
69
+ //# debugId=4888a558-7f50-5c28-8e29-fcd19180cbd4
@@ -13,6 +13,7 @@ export { BUILTIN_CORPUS_SHAPES, PM_CORPUS_SHAPE_SCHEMA, buildCorpusShapeItemPlan
13
13
  export * from "./core-governance.js";
14
14
  export { createPmCliProgram } from "./cli-program.js";
15
15
  export { runSearchRefreshWorkerEntrypoint } from "./search-refresh-worker.js";
16
+ export { PM_REPRODUCIBLE_PROCESS_ENV, createReproducibleProcessRunner, resolveReproducibleProcessEnvironment, runWithReproducibleProcessEnvironment, type ReproducibleExecutionSettings, type ReproducibleProcessEnvironment, type ReproducibleProcessRunner, } from "./reproducibility/process.js";
16
17
  export { PM_WORKSPACE_RECIPE_SCHEMA, defineWorkspaceRecipe, executeWorkspaceRecipe, runWithWorkspaceRecipe, type WorkspaceRecipe, type WorkspaceRecipeJsonValue, type WorkspaceRecipeOperation, } from "./workspace-recipe.js";
17
18
  export { SNAPSHOT_SCHEMA, WORKSPACE_SNAPSHOT_ACTIONS, createWorkspaceSnapshot, deleteWorkspaceSnapshot, inspectWorkspaceSnapshot, listWorkspaceSnapshots, planWorkspaceSnapshotRestore, restoreWorkspaceSnapshot, restoreWorkspaceSnapshotWithRecovery, type CreateWorkspaceSnapshotResult, type RestoreWorkspaceSnapshotOptions, type RestoreWorkspaceSnapshotResult, type WorkspaceSnapshotHistoryImpact, type WorkspaceSnapshotManifest, type WorkspaceSnapshotReference, type WorkspaceSnapshotRestorePlan, } from "./workspace-snapshot.js";
18
19
  export { flushTelemetryQueue } from "./telemetry-flush.js";
@@ -48,6 +49,7 @@ export { discoverNearbyPmRoot } from "./tracker-root-discovery.js";
48
49
  export { assertInitializedTracker, assertReadableTrackerRoot, buildTrackerInitializationRecovery, } from "./environment/tracker-preflight.js";
49
50
  export { _testOnly as _testOnlyTemplates, type TemplateSource, } from "./templates.js";
50
51
  export { runConfig, _testOnlyConfigCommand, type NestedSettingResultValue, } from "./config.js";
52
+ export * from "./agent/identity-config.js";
51
53
  export { INIT_AGENT_GUIDANCE_MODE_VALUES, runInitAgentGuidance, _testOnly as _testOnlyInitAgentGuidance, type InitAgentGuidanceMode, type InitAgentGuidanceSummary, type RunInitAgentGuidanceOptions, type RunInitAgentGuidanceResult, } from "./init-agent-guidance.js";
52
54
  export { runInit, summarizeInitResult, _testOnly as _testOnlyInit, type InitAgentGuidanceResult, type InitConciseResult, type InitInstalledPackagesSummary, type InitRegisteredTypePresetSummary, type InitTargetResolution, type InitTypePresetName, } from "./init.js";
53
55
  export { PROFILE_SUBCOMMANDS, formatProfileApplyHuman, formatProfileLintHuman, formatProfileListHuman, formatProfileShowHuman, runProfileApply, runProfileLint, runProfileList, runProfileShow, type ProfileApplyDimension, type ProfileComposition, type ProfileListEntry, } from "./profile.js";
@@ -57,7 +59,7 @@ export type { LocatedItem } from "../core/store/item-store.js";
57
59
  export { PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS, PM_PACKAGE_RESOURCE_KINDS, collectPackageExtensionDirectories, readPmPackageManifest, type PmPackageCatalogLinkMap, type PmPackageCatalogMediaMap, type PmPackageCatalogMetadata, type PmPackageManifest, type PmPackageResourceKind, type PmPackageResourceMap, } from "../core/packages/manifest.js";
58
60
  export type { CommanderOptionAliasContract, CommanderOptionRegistrationContract, } from "./cli-contracts.js";
59
61
  export { ACTIVITY_FLAG_CONTRACTS, ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, ASSURANCE_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLAIM_FLAG_CONTRACTS, CLOSE_ACTION_OPTION_KEYS, CLOSE_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, CLOSE_TASK_FLAG_CONTRACTS, COMMENTS_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONFIG_FLAG_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, COPY_FLAG_CONTRACTS, CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_FLAG_CONTRACTS, DELETE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, DOCS_FLAG_CONTRACTS, EVAL_FLAG_CONTRACTS, EVENT_FLAG_CONTRACTS, EVENTS_FLAG_CONTRACTS, EXTENSION_ACTIVATE_FLAG_CONTRACTS, EXTENSION_ADOPT_ALL_FLAG_CONTRACTS, EXTENSION_ADOPT_FLAG_CONTRACTS, EXTENSION_CATALOG_FLAG_CONTRACTS, EXTENSION_DEACTIVATE_FLAG_CONTRACTS, EXTENSION_DESCRIBE_FLAG_CONTRACTS, EXTENSION_DOCTOR_FLAG_CONTRACTS, EXTENSION_EXPLORE_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, EXTENSION_INIT_FLAG_CONTRACTS, EXTENSION_INSTALL_FLAG_CONTRACTS, EXTENSION_MANAGE_FLAG_CONTRACTS, EXTENSION_MIGRATE_FLAG_CONTRACTS, EXTENSION_RELOAD_FLAG_CONTRACTS, EXTENSION_SCOPE_FLAG_CONTRACTS, EXTENSION_UNINSTALL_FLAG_CONTRACTS, FILES_FLAG_CONTRACTS, FOCUS_FLAG_CONTRACTS, GC_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_COMPACT_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, HISTORY_REDACT_FLAG_CONTRACTS, HISTORY_REPAIR_FLAG_CONTRACTS, HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, INSTALL_FLAG_CONTRACTS, ITEM_MUTATE_FLAG_CONTRACTS, ITEM_COMPLETE_FLAG_CONTRACTS, ITEM_REOPEN_FLAG_CONTRACTS, LEARNINGS_FLAG_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, MEET_FLAG_CONTRACTS, MERGE_FLAG_CONTRACTS, NEXT_COMMANDER_STRING_OPTION_CONTRACTS, NEXT_FLAG_CONTRACTS, NOTES_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PACKAGE_INIT_FLAG_CONTRACTS, PAUSE_TASK_FLAG_CONTRACTS, PLAN_CREATE_METADATA_PARAMETER_KEYS, PLAN_FLAG_CONTRACTS, PM_COMMAND_OUTPUT_BUDGET_CONTRACTS, PM_DIAGNOSTIC_DEGRADATION_STEPS, PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS, PM_DIAGNOSTIC_OUTPUT_CLASSES, PM_CLI_ONLY_TOOL_ACTION_WAIVERS, PM_CORE_COMMAND_NAMES, PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS, PM_ITEM_ACTION_SUBCOMMANDS, PM_DEPRECATED_TOOL_ACTIONS, PM_DISCOVERABLE_TOOL_ACTIONS, PM_EXTENSION_CAPABILITY_CONTRACTS, PM_EXTENSION_POLICY_MODE_CONTRACTS, PM_EXTENSION_POLICY_SURFACE_CONTRACTS, PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS, PM_EXTENSION_SERVICE_NAME_CONTRACTS, PM_EXTENSION_TRUST_MODE_CONTRACTS, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION, PM_TOOL_ACTIONS, analyzePmToolActionParity, PM_TOOL_ACTION_PARAMETER_CONTRACTS, PM_TOOL_PARAMETERS_SCHEMA, PM_TOOL_PARAMETERS_SCHEMA_MAJOR, PM_TOOL_PARAMETERS_SCHEMA_VERSION, PM_OUTPUT_BUDGET_CLASSES, PM_OUTPUT_DEGRADATION_STEPS, PROFILE_FLAG_CONTRACTS, REINDEX_FLAG_CONTRACTS, RELEASE_FLAG_CONTRACTS, REMIND_FLAG_CONTRACTS, RESTORE_FLAG_CONTRACTS, SCHEMA_FLAG_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_FLAG_CONTRACTS, START_TASK_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, SUBCOMMAND_GLOBAL_FLAG_CONTRACTS, TELEMETRY_FLAG_CONTRACTS, TEST_ALL_FLAG_CONTRACTS, TEST_FLAG_CONTRACTS, TEST_RUNS_FLAG_CONTRACTS, TOOL_ACTIVITY_OPTION_CONTRACTS, TOOL_AGGREGATE_OPTION_CONTRACTS, TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE, TOOL_CALENDAR_OPTION_CONTRACTS, TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS, TOOL_CONTEXT_OPTION_CONTRACTS, TOOL_CREATE_OPTION_CONTRACTS, TOOL_CREATE_OPTION_CONTRACT_SOURCE, TOOL_DEPS_OPTION_CONTRACTS, TOOL_GRAPH_OPTION_CONTRACTS, TOOL_LIST_FILTER_OPTION_CONTRACTS, TOOL_SEARCH_FILTER_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE, TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACT_SOURCE, verifyToolOptionCliParity, UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, UPGRADE_FLAG_CONTRACTS, VALIDATE_FLAG_CONTRACTS, WORKSPACE_FLAG_CONTRACTS, buildPmActionToolInputSchema, PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES, compactFlagAliasContracts, createPmCommandOutputBudget, definePmCommandOutputBudget, estimatePmOutputTokens, inferPmOutputBudgetClass, projectPmDiagnosticOutput, projectPmDiagnosticText, analyzeSdkCliParameterCompleteness, isPmExtensionCapabilityContract, isPmExtensionPolicyModeContract, isPmExtensionPolicySurfaceContract, isPmExtensionServiceNameContract, isPmToolAction, hasSubcommandFlagContractsForCommand, readFirstStringFromCommanderOptions, readFirstValueFromCommanderOptions, readStringArrayFromCommanderOptions, resolvePmPositionalActionFlagContracts, resolveSubcommandFlagContractsForCommand, resolvePmCommandOutputBudget, resolvePmDiagnosticOutputBudget, resolvePmToolCustomFieldCollision, toCompletionFlagString, withFlagAliasMetadata, } from "./cli-contracts.js";
60
- export type { CliFlagContract, OptionsFromContracts, PmActionSchemaContract, PmActionToolInputSchemaOptions, PmToolCustomFieldCollision, PmBulkMutationControlOptions, PmBulkMutationFilterOptions, PmCloseActionOptions, PmCloseManyActionOptions, PmCreateActionOptions, PmMutationAttributionOptions, PmOptionScalar, PmCommandOutputBudgetContract, PmDiagnosticDegradationStep, PmDiagnosticOutputBudgetContract, PmDiagnosticOutputClass, PmDiagnosticOutputReceipt, PmOutputBudgetClass, PmOutputDegradationStep, PmProjectedDiagnostic, PmProjectedTextDiagnostic, PmUpdateActionOptions, PmUpdateManyActionOptions, PmExtensionCapabilityContract, PmExtensionPolicyModeContract, PmExtensionPolicySurfaceContract, PmExtensionSandboxProfileContract, PmExtensionServiceNameContract, PmExtensionTrustModeContract, PmToolAction, SdkCliActionParameterCoverage, SdkCliCompletenessContractSource, SdkCliParameterCoverageEntry, SdkCliParameterDisposition, ToolOptionFlagContract, ToolOptionCliParityFinding, ToolOptionCliParityReport, } from "./cli-contracts.js";
62
+ export type { CliFlagContract, OptionsFromContracts, PmActionSchemaContract, PmActionToolInputSchemaOptions, PmToolCustomFieldCollision, PmBulkMutationControlOptions, PmBulkMutationFilterOptions, PmCloseActionOptions, PmCloseManyActionOptions, PmCreateActionOptions, PmMutationAttributionOptions, PmOptionScalar, PmCommandOutputBudgetContract, PmDiagnosticDegradationStep, PmDiagnosticOutputBudgetContract, PmDiagnosticOutputClass, PmDiagnosticOutputReceipt, PmOutputBudgetClass, PmOutputDegradationStep, PmProjectedDiagnostic, PmProjectedTextDiagnostic, PmUpdateActionOptions, PmUpdateManyActionOptions, PmExtensionCapabilityContract, PmExtensionPolicyModeContract, PmExtensionPolicySurfaceContract, PmExtensionSandboxProfileContract, PmExtensionServiceNameContract, PmExtensionTrustModeContract, MergeSubcommand, PmToolAction, SdkCliActionParameterCoverage, SdkCliCompletenessContractSource, SdkCliParameterCoverageEntry, SdkCliParameterDisposition, ToolOptionFlagContract, ToolOptionCliParityFinding, ToolOptionCliParityReport, } from "./cli-contracts.js";
61
63
  export * from "./compose.js";
62
64
  export * from "./governance/assurance.js";
63
65
  export * from "./governance/assurance-action.js";
@@ -122,8 +124,11 @@ export * from "./error-runtime.js";
122
124
  export * from "./error-code-catalog.js";
123
125
  export * from "./generated-error-code-catalog.js";
124
126
  export * from "./agent/refusal-reachability.js";
127
+ export * from "./agent/refusal-closure-census.js";
125
128
  export * from "./agent/refusal-closure.js";
126
129
  export * from "./agent/closed-domain-contracts.js";
130
+ export * from "./agent/refusal-corpus-contracts.js";
131
+ export { MERGE_SUBCOMMAND_VALUES } from "./cli-contracts.js";
127
132
  export * from "./agent/tracker-preflight-contracts.js";
128
133
  export * from "./agent/subcommand-recovery.js";
129
134
  export * from "./flag-invocation-contracts.js";
@@ -159,7 +164,8 @@ export { runTelemetry, TELEMETRY_SUBCOMMANDS, type TelemetryCommandOptions, type
159
164
  export { classifyLinkedTestFailure, countFailureCategories, extractReferencedPmItemIdsFromCommand, resolveLinkedTestFailureExitCode, runLinkedTests, runTest, summarizeContextPreflight, type LinkedTestFailureCategory, type TestCommandOptions, type TestResult, type TestRunResult, } from "./test/execution.js";
160
165
  export { TEST_RUN_MEASUREMENT_LIMIT, diffTestRunMeasurements, parseTestRunMeasurements, queryTestRunMeasurementsBelow, type TestRunMeasurementDiff, } from "./test/measurements.js";
161
166
  export { runTestAll, type TestAllCommandOptions, type TestAllItemResult, type TestAllResult, } from "./test/batch.js";
162
- export { LINKED_TEST_ENV_NAME_PATTERN, LINKED_TEST_PM_CONTEXT_MODE_VALUES, LINKED_TEST_PROTECTED_ENV_KEYS, parseLinkedTestAssertionEqualsMap, parseLinkedTestAssertionGteMap, parseLinkedTestBoolean, parseLinkedTestContextMode, parseLinkedTestEnvClear, parseLinkedTestEnvSet, parseLinkedTestJsonEntries, parseLinkedTestMinLines, parseLinkedTestRegexList, parseLinkedTestStringList, type LinkedTestPmContextMode, } from "./test/parsers.js";
167
+ export { LINKED_TEST_ENV_NAME_PATTERN, LINKED_TEST_PM_CONTEXT_MODE_VALUES, LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES, LINKED_TEST_PROTECTED_ENV_KEYS, parseLinkedTestAssertionEqualsMap, parseLinkedTestAssertionGteMap, parseLinkedTestBoolean, parseLinkedTestContextMode, parseLinkedTestEnvClear, parseLinkedTestEnvSet, parseLinkedTestJsonEntries, parseLinkedTestMinLines, parseLinkedTestRegexList, parseLinkedTestStringList, parseLinkedTestWorkspaceContextMode, type LinkedTestPmContextMode, type LinkedTestWorkspaceContextMode, } from "./test/parsers.js";
168
+ export { acknowledgeLinkedTests, attachLinkedTestMutationProvenance, attachLinkedTestProvenance, linkedTestTrustFingerprint, resolveLinkedTestSourceRef, resolveLinkedTestSourceWorkspaceRoot, resolveLinkedTestTrust, resolveLinkedTestTrustBatch, type LinkedTestTrustDecision, } from "./test/trust.js";
163
169
  export { runStartBackgroundRun, runTestRunsWorker, type StartBackgroundRunCommandOptions, type StartBackgroundRunResult, } from "./test/runs.js";
164
170
  export { BUILTIN_PROFILES, listProfiles, normalizeProfileName, PROFILE_NAMES, resolveProfile, type ProfileConfigEntry, type ProfileName, type ProfilePackageRecommendation, type ProfileTemplateEntry, type ProfileTemplateOptions, type ProjectProfileDefinition, type ProjectProfileRegistrationInput, } from "../core/profile/profile-presets.js";
165
171
  export { planProfileApplication, type ProfileApplicationPlan, type ProfileChangeStatus, type ProfileComponentChange, type ProfileConfigChange, type ProfileConfigPlan, type ProfileCurrentState, type ProfilePackagePlan, type ProfileSchemaPlan, type ProfileTemplateChange, type ProfileTemplatePlan, type ProfileWorkflowChange, type ProfileWorkflowPlan, } from "../core/profile/profile-plan.js";