@unbrained/pm-cli 2026.8.9 → 2026.8.10

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 (172) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +40 -0
  3. package/dist/cli/commander-usage.js +17 -12
  4. package/dist/cli/help-json-payload.js +51 -16
  5. package/dist/cli/main.js +7 -6
  6. package/dist/cli-bundle/bundle-manifest.json +165 -165
  7. package/dist/cli-bundle/chunks/chunk-2QYH4QMI.js +30 -0
  8. package/dist/cli-bundle/chunks/{chunk-YC3UF2IO.js → chunk-EBO7OUUE.js} +57 -57
  9. package/dist/cli-bundle/chunks/{chunk-GMX5YOI3.js → chunk-ETML5C6H.js} +48 -48
  10. package/dist/cli-bundle/chunks/chunk-JUDU4RO4.js +194 -0
  11. package/dist/cli-bundle/chunks/{chunk-PYO5GZU6.js → chunk-JZSNADRR.js} +5 -5
  12. package/dist/cli-bundle/chunks/{chunk-EF43KODO.js → chunk-MENWVGJW.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-5JO6R4BS.js → chunk-S4EITGLA.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-2DTCZXSD.js → chunk-TIGKWVLA.js} +9 -9
  15. package/dist/cli-bundle/chunks/{chunk-RJC7TPF4.js → chunk-TRWXF476.js} +2 -2
  16. package/dist/cli-bundle/chunks/chunk-TSLDTJLQ.js +2 -0
  17. package/dist/cli-bundle/chunks/{register-list-query-BUE7PTCU.js → register-list-query-OJ6ZXKV4.js} +2 -2
  18. package/dist/cli-bundle/chunks/{register-mutation-FC3XLVIK.js → register-mutation-DKI7QC7O.js} +2 -2
  19. package/dist/cli-bundle/chunks/register-operations-P5OGMT6I.js +2 -0
  20. package/dist/cli-bundle/chunks/{register-setup-UQDTNTLJ.js → register-setup-S3KT2LTH.js} +2 -2
  21. package/dist/cli-bundle/focused-chunks/{chunk-6DO4YQWZ.js → chunk-2COZ67XT.js} +2 -2
  22. package/dist/cli-bundle/focused-chunks/chunk-2EXI2DKR.js +4 -0
  23. package/dist/cli-bundle/focused-chunks/{chunk-KNEHLPBF.js → chunk-34SX654S.js} +2 -2
  24. package/dist/cli-bundle/focused-chunks/chunk-36FTZ2NT.js +2 -0
  25. package/dist/cli-bundle/focused-chunks/chunk-3CQECMKR.js +16 -0
  26. package/dist/cli-bundle/focused-chunks/chunk-75774JWP.js +6 -0
  27. package/dist/cli-bundle/focused-chunks/{chunk-MRWVJ3ZG.js → chunk-7UN6BHHO.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/{chunk-VRXJSGIT.js → chunk-CHIBMEZR.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/chunk-DZGAHZZV.js +3 -0
  30. package/dist/cli-bundle/focused-chunks/chunk-FF4MNAYB.js +153 -0
  31. package/dist/cli-bundle/focused-chunks/{chunk-ZG54B4XG.js → chunk-GHTN2ILR.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/chunk-I4YM2I7S.js +2 -0
  33. package/dist/cli-bundle/focused-chunks/chunk-IMDTEN7K.js +2 -0
  34. package/dist/cli-bundle/focused-chunks/chunk-IW43E4XL.js +2 -0
  35. package/dist/cli-bundle/focused-chunks/{chunk-3WVHTUAW.js → chunk-JMVA4HKR.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/{chunk-C3GCHDSQ.js → chunk-KR5RVXLQ.js} +31 -31
  37. package/dist/cli-bundle/focused-chunks/chunk-KSNJG4KI.js +16 -0
  38. package/dist/cli-bundle/focused-chunks/{chunk-73FIJONU.js → chunk-M6RPIXKC.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/chunk-MXYSIQ56.js +18 -0
  40. package/dist/cli-bundle/focused-chunks/chunk-RIIN5V4N.js +2 -0
  41. package/dist/cli-bundle/focused-chunks/{chunk-U46GQJNY.js → chunk-RKWSCYYN.js} +2 -2
  42. package/dist/cli-bundle/main.js +13 -13
  43. package/dist/cli-bundle/sdk-authoring.js +1 -1
  44. package/dist/cli-bundle/sdk-contracts.js +1 -1
  45. package/dist/cli-bundle/sdk-core.js +38 -38
  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 +1 -1
  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 +2 -2
  53. package/dist/core/diagnostics/remediation.js +9 -9
  54. package/dist/core/fs/fs-utils.d.ts +10 -0
  55. package/dist/core/fs/fs-utils.js +16 -4
  56. package/dist/core/item/item-format.js +3 -32
  57. package/dist/core/schema/fields-file.d.ts +1 -2
  58. package/dist/core/schema/fields-file.js +4 -11
  59. package/dist/core/schema/runtime-schema.js +3 -10
  60. package/dist/core/schema/status-defs-file.d.ts +1 -2
  61. package/dist/core/schema/status-defs-file.js +4 -32
  62. package/dist/core/schema/status-token.d.ts +2 -0
  63. package/dist/core/schema/status-token.js +32 -0
  64. package/dist/core/schema/type-workflows.d.ts +1 -2
  65. package/dist/core/schema/type-workflows.js +4 -11
  66. package/dist/core/shared/author.d.ts +1 -1
  67. package/dist/core/shared/author.js +21 -8
  68. package/dist/core/shared/errors.d.ts +4 -0
  69. package/dist/core/shared/errors.js +2 -2
  70. package/dist/core/shared/text-normalization.d.ts +1 -1
  71. package/dist/core/shared/text-normalization.js +2 -2
  72. package/dist/sdk/agent/command-recovery.d.ts +4 -0
  73. package/dist/sdk/agent/command-recovery.js +52 -0
  74. package/dist/sdk/agent/command-suggestions.d.ts +4 -0
  75. package/dist/sdk/agent/command-suggestions.js +67 -0
  76. package/dist/sdk/agent/create-option-policy.d.ts +12 -0
  77. package/dist/sdk/agent/create-option-policy.js +32 -0
  78. package/dist/sdk/agent/item-addressing.d.ts +19 -0
  79. package/dist/sdk/agent/item-addressing.js +208 -0
  80. package/dist/sdk/cli-bootstrap.d.ts +1 -1
  81. package/dist/sdk/cli-bootstrap.js +20 -5
  82. package/dist/sdk/cli-contracts/commander-mutation-options.js +16 -4
  83. package/dist/sdk/cli-contracts/flag-contracts.js +62 -21
  84. package/dist/sdk/cli-contracts/registration-helpers.js +10 -2
  85. package/dist/sdk/cli-contracts/runtime-contracts.js +5 -3
  86. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +6 -0
  87. package/dist/sdk/cli-contracts/tool-option-contracts.js +4 -2
  88. package/dist/sdk/cli-contracts/tool-parameter-tables.js +19 -4
  89. package/dist/sdk/cli-contracts/tool-schema.js +17 -4
  90. package/dist/sdk/context-intent-runtime.js +8 -5
  91. package/dist/sdk/context-signal-store.d.ts +34 -0
  92. package/dist/sdk/context-signal-store.js +24 -2
  93. package/dist/sdk/dependency-flag-validation.d.ts +15 -1
  94. package/dist/sdk/dependency-flag-validation.js +54 -2
  95. package/dist/sdk/generated-error-code-catalog.js +74 -2
  96. package/dist/sdk/governance/health.js +14 -7
  97. package/dist/sdk/governance/provenance-health.d.ts +13 -0
  98. package/dist/sdk/governance/provenance-health.js +63 -17
  99. package/dist/sdk/governance/validate-item-reader.d.ts +13 -0
  100. package/dist/sdk/governance/validate-item-reader.js +18 -0
  101. package/dist/sdk/governance/validate.d.ts +2 -2
  102. package/dist/sdk/governance/validate.js +15 -6
  103. package/dist/sdk/index.d.ts +4 -0
  104. package/dist/sdk/index.js +6 -2
  105. package/dist/sdk/lifecycle/close.js +17 -14
  106. package/dist/sdk/lifecycle/create.d.ts +2 -0
  107. package/dist/sdk/lifecycle/create.js +62 -9
  108. package/dist/sdk/lifecycle/update-many.js +39 -27
  109. package/dist/sdk/lifecycle/update.d.ts +6 -1
  110. package/dist/sdk/lifecycle/update.js +47 -10
  111. package/dist/sdk/merge/index.d.ts +1 -1
  112. package/dist/sdk/merge/index.js +3 -3
  113. package/dist/sdk/merge/install.d.ts +4 -0
  114. package/dist/sdk/merge/install.js +28 -16
  115. package/dist/sdk/merge/receipts.d.ts +3 -0
  116. package/dist/sdk/merge/receipts.js +81 -17
  117. package/dist/sdk/output-projection.js +24 -4
  118. package/dist/sdk/query/context.d.ts +2 -0
  119. package/dist/sdk/query/context.js +7 -4
  120. package/dist/sdk/query/light-metadata.d.ts +3 -0
  121. package/dist/sdk/query/light-metadata.js +19 -0
  122. package/dist/sdk/runtime.d.ts +4 -1
  123. package/dist/sdk/runtime.js +8 -3
  124. package/dist/sdk/schema-migration.js +7 -9
  125. package/dist/sdk/similarity-scoring.d.ts +1 -2
  126. package/dist/sdk/similarity-scoring.js +4 -16
  127. package/dist/sdk/workspace-snapshot.d.ts +4 -0
  128. package/dist/sdk/workspace-snapshot.js +24 -11
  129. package/docs/AGENT_GUIDE.md +3 -1
  130. package/docs/COMMANDS.md +8 -5
  131. package/docs/MERGE_SAFETY.md +7 -5
  132. package/docs/README.md +2 -5
  133. package/docs/READ_OUTPUT_CONTRACTS.md +2 -2
  134. package/docs/SDK.md +33 -8
  135. package/docs/SDK_AGENT_SESSION_CONTEXT.md +3 -2
  136. package/docs/SDK_CONTEXT.md +97 -0
  137. package/docs/SDK_CONTEXT_INTEGRITY.md +18 -3
  138. package/docs/agent-task-token-baseline.json +2 -2
  139. package/marketplace.json +2 -2
  140. package/package.json +5 -4
  141. package/packages/pm-beads/package.json +1 -1
  142. package/packages/pm-calendar/package.json +1 -1
  143. package/packages/pm-command-kit/package.json +1 -1
  144. package/packages/pm-digital-twin/package.json +1 -1
  145. package/packages/pm-governance-audit/package.json +1 -1
  146. package/packages/pm-guide-shell/package.json +1 -1
  147. package/packages/pm-kanban/package.json +1 -1
  148. package/packages/pm-lifecycle-hooks/package.json +1 -1
  149. package/packages/pm-linked-test-adapters/package.json +1 -1
  150. package/packages/pm-search-advanced/package.json +1 -1
  151. package/packages/pm-templates/package.json +1 -1
  152. package/packages/pm-todos/package.json +1 -1
  153. package/packages/pm-vcs/package.json +1 -1
  154. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  155. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  156. package/sdk/public-surface.json +194 -26
  157. package/dist/cli-bundle/chunks/chunk-5KN4DZYV.js +0 -194
  158. package/dist/cli-bundle/chunks/chunk-HUV2Z7IS.js +0 -28
  159. package/dist/cli-bundle/chunks/chunk-MHBVCUF2.js +0 -2
  160. package/dist/cli-bundle/chunks/register-operations-YH2WAOXU.js +0 -2
  161. package/dist/cli-bundle/focused-chunks/chunk-2VVP5RAA.js +0 -153
  162. package/dist/cli-bundle/focused-chunks/chunk-3GSFUDAI.js +0 -2
  163. package/dist/cli-bundle/focused-chunks/chunk-4H6MVCK3.js +0 -16
  164. package/dist/cli-bundle/focused-chunks/chunk-54TZJ4BM.js +0 -2
  165. package/dist/cli-bundle/focused-chunks/chunk-5NK5TJ5D.js +0 -2
  166. package/dist/cli-bundle/focused-chunks/chunk-JGRSQZJT.js +0 -18
  167. package/dist/cli-bundle/focused-chunks/chunk-NL57J7BZ.js +0 -4
  168. package/dist/cli-bundle/focused-chunks/chunk-P6BBIQRG.js +0 -6
  169. package/dist/cli-bundle/focused-chunks/chunk-PZAGVQNN.js +0 -3
  170. package/dist/cli-bundle/focused-chunks/chunk-QDAO3XEK.js +0 -14
  171. package/dist/cli-bundle/focused-chunks/chunk-T4IGQCSY.js +0 -2
  172. package/dist/cli-bundle/focused-chunks/chunk-XC2ZW3CJ.js +0 -2
@@ -4,10 +4,10 @@
4
4
  * Implements the pm contracts 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]="fc28e3a8-c827-5ccc-918a-12d6bf1a1592")}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]="081c3d07-0cf1-5bad-80ff-2d37be8ee887")}catch(e){}}();
8
8
  import { EXIT_CODE, SETTINGS_DEFAULTS, PmCliError, activateExtensions, getActiveExtensionRegistrations, loadExtensions, pathExists, commandOptionFlagLabel, resolveCommandOptionPolicyState, resolveItemTypeRegistry, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, getSettingsPath, resolvePmRoot, readSettings, } from "../runtime-primitives.js";
9
9
  import { buildMcpToolContracts, } from "../../mcp/tool-definitions.js";
10
- import { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLAIM_FLAG_CONTRACTS, CLOSE_TASK_FLAG_CONTRACTS, COMMENTS_FLAG_CONTRACTS, CLOSE_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONFIG_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_FLAG_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_FLAG_CONTRACTS, DELETE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, DOCS_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_UNINSTALL_FLAG_CONTRACTS, FILES_FLAG_CONTRACTS, GC_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, HISTORY_COMPACT_FLAG_CONTRACTS, HISTORY_REDACT_FLAG_CONTRACTS, HISTORY_REPAIR_FLAG_CONTRACTS, HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, INSTALL_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, ITEM_COMPLETE_FLAG_CONTRACTS, ITEM_MUTATE_FLAG_CONTRACTS, LEARNINGS_FLAG_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, MERGE_FLAG_CONTRACTS, NOTES_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PACKAGE_INIT_FLAG_CONTRACTS, 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_OUTPUT_DEGRADATION_STEPS, PLAN_FLAG_CONTRACTS, PM_CORE_COMMAND_NAMES, PM_TOOL_ACTIONS, PM_TOOL_PARAMETERS_SCHEMA, REINDEX_FLAG_CONTRACTS, RELEASE_FLAG_CONTRACTS, RESTORE_FLAG_CONTRACTS, SCHEMA_FLAG_CONTRACTS, PROFILE_FLAG_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, EVAL_FLAG_CONTRACTS, WORKSPACE_FLAG_CONTRACTS, NEXT_FLAG_CONTRACTS, SEARCH_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, START_TASK_FLAG_CONTRACTS, PAUSE_TASK_FLAG_CONTRACTS, TELEMETRY_FLAG_CONTRACTS, TEST_ALL_FLAG_CONTRACTS, TEST_FLAG_CONTRACTS, TEST_RUNS_FLAG_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, UPGRADE_FLAG_CONTRACTS, VALIDATE_FLAG_CONTRACTS, compactFlagAliasContracts, resolvePmCommandOutputBudget, } from "../cli-contracts.js";
10
+ import { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLAIM_FLAG_CONTRACTS, CLOSE_TASK_FLAG_CONTRACTS, COMMENTS_FLAG_CONTRACTS, CLOSE_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONFIG_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, COPY_FLAG_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_FLAG_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_FLAG_CONTRACTS, DELETE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, DOCS_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_UNINSTALL_FLAG_CONTRACTS, FILES_FLAG_CONTRACTS, FOCUS_FLAG_CONTRACTS, GC_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, HISTORY_COMPACT_FLAG_CONTRACTS, HISTORY_REDACT_FLAG_CONTRACTS, HISTORY_REPAIR_FLAG_CONTRACTS, HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, INSTALL_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, ITEM_COMPLETE_FLAG_CONTRACTS, ITEM_MUTATE_FLAG_CONTRACTS, LEARNINGS_FLAG_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, MERGE_FLAG_CONTRACTS, NOTES_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PACKAGE_INIT_FLAG_CONTRACTS, 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_OUTPUT_DEGRADATION_STEPS, PLAN_FLAG_CONTRACTS, PM_CORE_COMMAND_NAMES, PM_TOOL_ACTIONS, PM_TOOL_PARAMETERS_SCHEMA, REINDEX_FLAG_CONTRACTS, RELEASE_FLAG_CONTRACTS, RESTORE_FLAG_CONTRACTS, SCHEMA_FLAG_CONTRACTS, PROFILE_FLAG_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, EVAL_FLAG_CONTRACTS, WORKSPACE_FLAG_CONTRACTS, NEXT_FLAG_CONTRACTS, SEARCH_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, START_TASK_FLAG_CONTRACTS, PAUSE_TASK_FLAG_CONTRACTS, TELEMETRY_FLAG_CONTRACTS, TEST_ALL_FLAG_CONTRACTS, TEST_FLAG_CONTRACTS, TEST_RUNS_FLAG_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, UPGRADE_FLAG_CONTRACTS, VALIDATE_FLAG_CONTRACTS, compactFlagAliasContracts, resolvePmCommandOutputBudget, } from "../cli-contracts.js";
11
11
  import { GOVERNANCE_CLOSE_VALIDATION_DEFAULT_VALUES, GOVERNANCE_CREATE_MODE_DEFAULT_VALUES, GOVERNANCE_OWNERSHIP_ENFORCEMENT_VALUES, GOVERNANCE_WORKFLOW_ENFORCEMENT_VALUES, } from "../../types.js";
12
12
  import { BRIEF_LIST_FIELDS, DEFAULT_COMPACT_LIST_FIELDS, LIST_COMMAND_DEFAULT_PROJECTIONS, } from "../query/list.js";
13
13
  import { getActiveContextIntentContracts, } from "../context-intent-contracts.js";
@@ -308,6 +308,8 @@ const CORE_COMMAND_FLAG_CONTRACT_ENTRIES = [
308
308
  ["create", CREATE_FLAG_CONTRACTS],
309
309
  ["item mutate", ITEM_MUTATE_FLAG_CONTRACTS],
310
310
  ["item complete", ITEM_COMPLETE_FLAG_CONTRACTS],
311
+ ["copy", COPY_FLAG_CONTRACTS],
312
+ ["focus", FOCUS_FLAG_CONTRACTS],
311
313
  ["update", UPDATE_FLAG_CONTRACTS],
312
314
  ["update-many", UPDATE_MANY_FLAG_CONTRACTS],
313
315
  ["upgrade", UPGRADE_FLAG_CONTRACTS],
@@ -1869,4 +1871,4 @@ export const _testOnlyContractsCommand = {
1869
1871
  toRuntimeShortFlagToken,
1870
1872
  };
1871
1873
  //# sourceMappingURL=runtime-contracts.js.map
1872
- //# debugId=fc28e3a8-c827-5ccc-918a-12d6bf1a1592
1874
+ //# debugId=081c3d07-0cf1-5bad-80ff-2d37be8ee887
@@ -170,6 +170,9 @@ export declare const TOOL_CREATE_OPTION_CONTRACT_SOURCE: readonly [{
170
170
  }, {
171
171
  readonly param: "allowMissingParent";
172
172
  readonly flag: "--allow-missing-parent";
173
+ }, {
174
+ readonly param: "allowUnresolvedDeps";
175
+ readonly flag: "--allow-unresolved-deps";
173
176
  }, {
174
177
  readonly param: "allowDuplicate";
175
178
  readonly flag: "--allow-duplicate";
@@ -325,6 +328,9 @@ export declare const TOOL_UPDATE_OPTION_CONTRACT_SOURCE: readonly [{
325
328
  }, {
326
329
  readonly param: "allowMissingParent";
327
330
  readonly flag: "--allow-missing-parent";
331
+ }, {
332
+ readonly param: "allowUnresolvedDeps";
333
+ readonly flag: "--allow-unresolved-deps";
328
334
  }, {
329
335
  readonly param: "dep";
330
336
  readonly flag: "--dep";
@@ -1,6 +1,6 @@
1
1
  /** Returns fresh option contract objects so exported arrays cannot share mutable entries. */
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]="13ab1164-d2b1-5954-80e8-08c6b12779da")}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]="26955ae3-1aca-503e-9492-46652285d17a")}catch(e){}}();
4
4
  function cloneOptionContracts(contracts) {
5
5
  return contracts.map((contract) => ({ ...contract }));
6
6
  }
@@ -183,6 +183,7 @@ export const TOOL_CREATE_OPTION_CONTRACT_SOURCE = [
183
183
  { param: "message", flag: "--message", allowEmpty: true },
184
184
  { param: "assignee", flag: "--assignee" },
185
185
  { param: "allowMissingParent", flag: "--allow-missing-parent" },
186
+ { param: "allowUnresolvedDeps", flag: "--allow-unresolved-deps" },
186
187
  { param: "allowDuplicate", flag: "--allow-duplicate", booleanish: true },
187
188
  { param: "reminder", flag: "--reminder", repeatable: true },
188
189
  { param: "event", flag: "--event", repeatable: true },
@@ -235,6 +236,7 @@ export const TOOL_UPDATE_OPTION_CONTRACT_SOURCE = [
235
236
  { param: "message", flag: "--message", allowEmpty: true },
236
237
  { param: "assignee", flag: "--assignee" },
237
238
  { param: "allowMissingParent", flag: "--allow-missing-parent" },
239
+ { param: "allowUnresolvedDeps", flag: "--allow-unresolved-deps" },
238
240
  { param: "dep", flag: "--dep", repeatable: true },
239
241
  { param: "depRemove", flag: "--dep-remove", repeatable: true },
240
242
  { param: "replaceDeps", flag: "--replace-deps" },
@@ -421,4 +423,4 @@ export const TOOL_GRAPH_OPTION_CONTRACTS = [
421
423
  { param: "summary", flag: "--summary" },
422
424
  ];
423
425
  //# sourceMappingURL=tool-option-contracts.js.map
424
- //# debugId=13ab1164-d2b1-5954-80e8-08c6b12779da
426
+ //# debugId=26955ae3-1aca-503e-9492-46652285d17a
@@ -4,7 +4,7 @@
4
4
  * Defines SDK command-contract metadata for Tool Parameter Tables.
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]="35c4b819-02d6-582a-a7eb-fe3f4a4903d9")}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]="6e0b4ff7-5aca-562b-b36c-c0c53987138d")}catch(e){}}();
8
8
  import { PLAN_HARNESS_VALUES, PLAN_MODE_VALUES, PLAN_STEP_LINK_KIND_VALUES, PLAN_STEP_STATUS_VALUES, } from "../../types/index.js";
9
9
  import { PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS } from "../read-output-session.js";
10
10
  /** Public contract for pm tool parameter properties, shared by SDK and presentation-layer consumers. */
@@ -164,6 +164,7 @@ export const PM_TOOL_PARAMETER_PROPERTIES = {
164
164
  },
165
165
  idOnly: { type: "boolean" },
166
166
  allowMissingParent: { type: "boolean" },
167
+ allowUnresolvedDeps: { type: "boolean" },
167
168
  allowDuplicate: { type: "boolean" },
168
169
  duplicateOf: { type: "string" },
169
170
  configAction: { type: "string", enum: ["get", "set", "list", "export"] },
@@ -979,6 +980,10 @@ export const PM_TOOL_PARAMETER_METADATA = {
979
980
  allowDuplicate: {
980
981
  description: "Explicitly proceed when strict similarity governance finds likely duplicate items.",
981
982
  },
983
+ allowUnresolvedDeps: {
984
+ description: "Permit unresolved local dependency targets while returning dependency_target_unresolved warning receipts. Cross-workspace references should use source_kind=external instead.",
985
+ examples: [true],
986
+ },
982
987
  requiredTypes: {
983
988
  description: "Restrict a custom field's requirement to specific item types (schema add-field).",
984
989
  examples: [["Bug"], ["Story", "Spike"]],
@@ -1074,7 +1079,7 @@ export const PM_TOOL_PARAMETER_METADATA = {
1074
1079
  examples: [["error path covered by a regression test"]],
1075
1080
  },
1076
1081
  removeAc: {
1077
- description: "Acceptance criteria removed individually by exact text match (one criterion per entry).",
1082
+ description: "Acceptance criteria removed individually by exact text match; the mutation fails atomically if any selector is unmatched (one criterion per entry).",
1078
1083
  examples: [["superseded manual QA step"]],
1079
1084
  },
1080
1085
  removeTags: {
@@ -1106,7 +1111,7 @@ export const PM_TOOL_PARAMETER_METADATA = {
1106
1111
  examples: [60, "120"],
1107
1112
  },
1108
1113
  acceptanceCriteria: {
1109
- description: "Acceptance criteria text.",
1114
+ description: "Complete acceptance-criteria text supplied while creating or replacing an item field.",
1110
1115
  },
1111
1116
  author: {
1112
1117
  description: "Intentional mutation-author override. Agent harness identity is automatic when omitted.",
@@ -1764,6 +1769,16 @@ export const PM_TOOL_PARAMETER_METADATA = {
1764
1769
  * because its single `name` property must cover every action at once.
1765
1770
  */
1766
1771
  export const PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
1772
+ update: {
1773
+ acceptanceCriteria: {
1774
+ description: "Complete acceptance-criteria replacement text. Use removeAc plus addAc together for an atomic one-entry repair that preserves unrelated criteria.",
1775
+ },
1776
+ },
1777
+ "update-many": {
1778
+ acceptanceCriteria: {
1779
+ description: "Complete acceptance-criteria replacement text. Use removeAc plus addAc together for an atomic one-entry repair that preserves unrelated criteria.",
1780
+ },
1781
+ },
1767
1782
  stats: {
1768
1783
  since: {
1769
1784
  description: "Inclusive ISO 8601 timestamp or negative duration lower bound for provenance and fleet analytics.",
@@ -1907,4 +1922,4 @@ export const PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
1907
1922
  },
1908
1923
  };
1909
1924
  //# sourceMappingURL=tool-parameter-tables.js.map
1910
- //# debugId=35c4b819-02d6-582a-a7eb-fe3f4a4903d9
1925
+ //# debugId=6e0b4ff7-5aca-562b-b36c-c0c53987138d
@@ -7,7 +7,7 @@
7
7
  * consumers from a single source of truth.
8
8
  */
9
9
 
10
- !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]="d9f01e68-6b54-5861-a4b5-ae40613c2047")}catch(e){}}();
10
+ !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]="4ce3417b-2ccc-5304-8275-30f6eb749db8")}catch(e){}}();
11
11
  import { normalizeUniqueStringList } from "./string-lists.js";
12
12
  import { PM_TOOL_ACTIONS } from "./enum-contracts.js";
13
13
  import { TOOL_CREATE_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS, TOOL_CONTEXT_OPTION_CONTRACTS, TOOL_ACTIVITY_OPTION_CONTRACTS, TOOL_LIST_FILTER_OPTION_CONTRACTS, TOOL_AGGREGATE_OPTION_CONTRACTS, TOOL_SEARCH_FILTER_OPTION_CONTRACTS, TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS, } from "./tool-option-contracts.js";
@@ -784,8 +784,21 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
784
784
  required: ["id", "target"],
785
785
  optional: AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS,
786
786
  },
787
- update: { required: ["id"], optional: UPDATE_CONTRACT_PARAMETER_KEYS },
788
- "update-many": { optional: UPDATE_MANY_CONTRACT_PARAMETER_KEYS },
787
+ update: {
788
+ required: ["id"],
789
+ optional: UPDATE_CONTRACT_PARAMETER_KEYS,
790
+ mutuallyExclusive: [
791
+ ["acceptanceCriteria", "addAc"],
792
+ ["acceptanceCriteria", "removeAc"],
793
+ ],
794
+ },
795
+ "update-many": {
796
+ optional: UPDATE_MANY_CONTRACT_PARAMETER_KEYS,
797
+ mutuallyExclusive: [
798
+ ["acceptanceCriteria", "addAc"],
799
+ ["acceptanceCriteria", "removeAc"],
800
+ ],
801
+ },
789
802
  close: {
790
803
  required: ["id"],
791
804
  optional: [
@@ -1512,4 +1525,4 @@ export const _testOnlyCliContracts = {
1512
1525
  withFlagAliasMetadata,
1513
1526
  };
1514
1527
  //# sourceMappingURL=tool-schema.js.map
1515
- //# debugId=d9f01e68-6b54-5861-a4b5-ae40613c2047
1528
+ //# debugId=4ce3417b-2ccc-5304-8275-30f6eb749db8
@@ -6,9 +6,10 @@
6
6
  * SDK entrypoint.
7
7
  */
8
8
 
9
- !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]="55ecd7ff-0047-5fd1-9f6f-f45602fce1bb")}catch(e){}}();
9
+ !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]="7ba0243e-98d1-5aef-bd47-54f0b630be58")}catch(e){}}();
10
10
  import { readFile } from "node:fs/promises";
11
11
  import path from "node:path";
12
+ import { isFileAbsentError } from "../core/fs/fs-utils.js";
12
13
  import { runWithContextIntentContracts, } from "./context-intent-contracts.js";
13
14
  /** Conventional workspace declaration file relative to the tracker root. */
14
15
  export const PM_CONTEXT_INTENTS_FILE = "context-intents.json";
@@ -56,9 +57,11 @@ export async function readWorkspaceContextIntentContracts(pmRoot) {
56
57
  source = await readFile(declarationPath, "utf8");
57
58
  }
58
59
  catch (error) {
59
- if (isRecord(error) &&
60
- typeof error.code === "string" &&
61
- error.code === "ENOENT") {
60
+ // Absent declarations are the norm. `ENOTDIR` counts as absent too: when
61
+ // the tracker root is a regular file the declaration cannot exist, and the
62
+ // authoritative root guard downstream owns that refusal — this optional
63
+ // read must not pre-empt it with a raw runtime fault.
64
+ if (isFileAbsentError(error)) {
62
65
  return [];
63
66
  }
64
67
  throw error;
@@ -107,4 +110,4 @@ export async function runWithDiscoveredContextIntentContracts(options, run) {
107
110
  return await runWithContextIntentContracts(layers, run);
108
111
  }
109
112
  //# sourceMappingURL=context-intent-runtime.js.map
110
- //# debugId=55ecd7ff-0047-5fd1-9f6f-f45602fce1bb
113
+ //# debugId=7ba0243e-98d1-5aef-bd47-54f0b630be58
@@ -52,7 +52,41 @@ export interface ContextSignalStoreReadResult {
52
52
  cache_status: "fresh" | "rebuilt";
53
53
  /** Non-fatal recovery diagnostics. */
54
54
  warnings: readonly string[];
55
+ /** Actionable meanings and executable recovery commands for every warning. */
56
+ warning_details?: readonly ContextSignalStoreWarningDetail[];
55
57
  }
58
+ /** Stable recovery contract for one context signal-store warning. */
59
+ export interface ContextSignalStoreWarningDetail {
60
+ /** Machine-readable warning code also present in `warnings`. */
61
+ code: "context_signal_store_invalid" | "context_signal_store_stale" | "context_signal_store_write_failed";
62
+ /** Bounded explanation of the observed derived-state condition. */
63
+ meaning: string;
64
+ /** Safe executable command that retries or confirms recovery. */
65
+ recovery_command: "pm context";
66
+ /** Expected observable effect of the recovery command. */
67
+ recovery_effect: string;
68
+ }
69
+ /** Canonical actionable contracts shared by CLI, SDK, MCP, and package hosts. */
70
+ export declare const CONTEXT_SIGNAL_STORE_WARNING_DETAILS: {
71
+ readonly context_signal_store_invalid: {
72
+ readonly code: "context_signal_store_invalid";
73
+ readonly meaning: "The persisted context-signal snapshot was unreadable or invalid and was rebuilt from authoritative items.";
74
+ readonly recovery_command: "pm context";
75
+ readonly recovery_effect: "Re-read context and confirm the rebuilt snapshot can be loaded without the warning.";
76
+ };
77
+ readonly context_signal_store_stale: {
78
+ readonly code: "context_signal_store_stale";
79
+ readonly meaning: "The persisted context-signal snapshot did not match the authoritative cursor or item corpus and was rebuilt.";
80
+ readonly recovery_command: "pm context";
81
+ readonly recovery_effect: "Re-read context and confirm the rebuilt snapshot is now fresh.";
82
+ };
83
+ readonly context_signal_store_write_failed: {
84
+ readonly code: "context_signal_store_write_failed";
85
+ readonly meaning: "Context signals were rebuilt in memory, but the derived snapshot could not be persisted.";
86
+ readonly recovery_command: "pm context";
87
+ readonly recovery_effect: "Retry the derived snapshot write and confirm the warning clears after storage access is restored.";
88
+ };
89
+ };
56
90
  /** Workspace-bound feature-store options used by CLI, MCP, and SDK readers. */
57
91
  export interface ReadWorkspaceContextSignalsOptions extends BuildItemContextRelevanceCandidatesOptions {
58
92
  /** Tracker root containing rebuildable runtime state. */
@@ -6,7 +6,7 @@
6
6
  * history, while stale, absent, or corrupt snapshots rebuild transparently.
7
7
  */
8
8
 
9
- !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]="a502be8f-57da-53c2-8de0-118a15688d93")}catch(e){}}();
9
+ !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]="2a0f64cf-f6a4-5304-921d-c83b98d3a31f")}catch(e){}}();
10
10
  import fs from "node:fs/promises";
11
11
  import path from "node:path";
12
12
  import { createHash, randomUUID } from "node:crypto";
@@ -24,6 +24,27 @@ const STORED_CONTEXT_SIGNAL_NAMES = [
24
24
  "risk_pressure",
25
25
  "knowledge_density",
26
26
  ];
27
+ /** Canonical actionable contracts shared by CLI, SDK, MCP, and package hosts. */
28
+ export const CONTEXT_SIGNAL_STORE_WARNING_DETAILS = {
29
+ context_signal_store_invalid: {
30
+ code: "context_signal_store_invalid",
31
+ meaning: "The persisted context-signal snapshot was unreadable or invalid and was rebuilt from authoritative items.",
32
+ recovery_command: "pm context",
33
+ recovery_effect: "Re-read context and confirm the rebuilt snapshot can be loaded without the warning.",
34
+ },
35
+ context_signal_store_stale: {
36
+ code: "context_signal_store_stale",
37
+ meaning: "The persisted context-signal snapshot did not match the authoritative cursor or item corpus and was rebuilt.",
38
+ recovery_command: "pm context",
39
+ recovery_effect: "Re-read context and confirm the rebuilt snapshot is now fresh.",
40
+ },
41
+ context_signal_store_write_failed: {
42
+ code: "context_signal_store_write_failed",
43
+ meaning: "Context signals were rebuilt in memory, but the derived snapshot could not be persisted.",
44
+ recovery_command: "pm context",
45
+ recovery_effect: "Retry the derived snapshot write and confirm the warning clears after storage access is restored.",
46
+ },
47
+ };
27
48
  function isRecord(value) {
28
49
  return typeof value === "object" && value !== null && !Array.isArray(value);
29
50
  }
@@ -245,6 +266,7 @@ export class ContextSignalStore {
245
266
  })),
246
267
  cache_status: fresh ? "fresh" : "rebuilt",
247
268
  warnings,
269
+ warning_details: warnings.map((warning) => CONTEXT_SIGNAL_STORE_WARNING_DETAILS[warning]),
248
270
  };
249
271
  }
250
272
  }
@@ -288,4 +310,4 @@ export async function readWorkspaceContextSignals(items, options) {
288
310
  return store.readOrRebuild(items, { ...options, sourceCursor, source });
289
311
  }
290
312
  //# sourceMappingURL=context-signal-store.js.map
291
- //# debugId=a502be8f-57da-53c2-8de0-118a15688d93
313
+ //# debugId=2a0f64cf-f6a4-5304-921d-c83b98d3a31f
@@ -1,4 +1,4 @@
1
- import type { Dependency } from "../types/index.js";
1
+ import type { Dependency, ItemFormat } from "../types/index.js";
2
2
  import { type RelationshipKindRegistry } from "./relationships.js";
3
3
  /** Reject malformed shorthand before item-id prefix normalization can create a dangling graph node. */
4
4
  export declare function assertValidBareDependencyFlagValue(value: string, structured: boolean): void;
@@ -7,3 +7,17 @@ export declare function assertValidBareDependencyFlagValue(value: string, struct
7
7
  * ontology before a create or update mutation writes item or history state.
8
8
  */
9
9
  export declare function assertDependencyEdgesAllowed(holderId: string, dependencies: readonly Dependency[] | undefined, registry?: RelationshipKindRegistry): void;
10
+ /**
11
+ * Resolve every newly supplied local dependency before a mutation commits.
12
+ * Explicit external provenance bypasses workspace lookup, while the opt-in
13
+ * unresolved mode returns durable warning tokens instead of pretending that
14
+ * the graph edge resolved successfully.
15
+ */
16
+ export declare function assertDependencyTargetsResolvable(params: {
17
+ pmRoot: string;
18
+ dependencies: readonly Dependency[] | undefined;
19
+ idPrefix: string;
20
+ itemFormat: ItemFormat;
21
+ typeToFolder: Record<string, string>;
22
+ allowUnresolved?: boolean;
23
+ }): Promise<string[]>;
@@ -1,9 +1,11 @@
1
1
  /** @module cli/commands/dependency-flag-validation */
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]="1c1314f1-b54f-562c-b6f0-950fcac4c9cc")}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]="e7cd6092-ed18-52ea-94a0-03bed42eb858")}catch(e){}}();
4
4
  import { EXIT_CODE } from "../core/shared/constants.js";
5
5
  import { PmCliError } from "../core/shared/errors.js";
6
6
  import { toErrorMessage } from "../core/shared/primitives.js";
7
+ import { locateItem } from "../core/store/item-store.js";
8
+ import { isExternalDependencySourceKind } from "./dependency-provenance.js";
7
9
  import { resolveWorkspaceRelationshipKindRegistry } from "./graph/assembly.js";
8
10
  import { assertRelationshipEdgeAllowed, } from "./relationships.js";
9
11
  /** Reject malformed shorthand before item-id prefix normalization can create a dangling graph node. */
@@ -29,5 +31,55 @@ export function assertDependencyEdgesAllowed(holderId, dependencies, registry =
29
31
  }
30
32
  }
31
33
  }
34
+ /**
35
+ * Resolve every newly supplied local dependency before a mutation commits.
36
+ * Explicit external provenance bypasses workspace lookup, while the opt-in
37
+ * unresolved mode returns durable warning tokens instead of pretending that
38
+ * the graph edge resolved successfully.
39
+ */
40
+ export async function assertDependencyTargetsResolvable(params) {
41
+ const localTargets = [
42
+ ...new Set((params.dependencies ?? [])
43
+ .filter((dependency) => !isExternalDependencySourceKind(dependency.source_kind))
44
+ .map((dependency) => dependency.id)),
45
+ ];
46
+ const resolutions = await Promise.all(localTargets.map(async (target) => ({
47
+ target,
48
+ located: await locateItem(params.pmRoot, target, params.idPrefix, params.itemFormat, params.typeToFolder),
49
+ })));
50
+ const targets = resolutions
51
+ .filter(({ located }) => located === null)
52
+ .map(({ target }) => target)
53
+ .sort((left, right) => (left < right ? -1 : 1));
54
+ if (targets.length === 0) {
55
+ return [];
56
+ }
57
+ if (params.allowUnresolved === true) {
58
+ return targets.map((target) => `dependency_target_unresolved:${target}`);
59
+ }
60
+ throw new PmCliError(`Dependency target${targets.length === 1 ? "" : "s"} not found: ${targets.join(", ")}`, EXIT_CODE.NOT_FOUND, {
61
+ code: "dependency_target_not_found",
62
+ reason: "unresolved_local_dependency",
63
+ required: "Every local dependency target must exist before the edge is committed.",
64
+ why: "Fail-fast target resolution prevents dangling graph nodes and preserves reliable traversal semantics.",
65
+ unresolved_targets: targets,
66
+ examples: [
67
+ "--dep id=<existing-item-id>,kind=related",
68
+ "--dep id=<external-id>,kind=related,source_kind=external",
69
+ "--allow-unresolved-deps --dep id=<future-item-id>,kind=related",
70
+ ],
71
+ nextSteps: [
72
+ `Create or correct ${targets.length === 1 ? "the target" : "the targets"}, then retry the mutation.`,
73
+ "Use source_kind=external for a cross-workspace reference.",
74
+ "Use --allow-unresolved-deps only when the dangling local edge is intentional.",
75
+ ],
76
+ recovery: {
77
+ recovery_mode: "compact",
78
+ missing: targets,
79
+ suggested_flags: ["--allow-unresolved-deps"],
80
+ suggested_retry: `pm search "${targets[0]}" --limit 10`,
81
+ },
82
+ });
83
+ }
32
84
  //# sourceMappingURL=dependency-flag-validation.js.map
33
- //# debugId=1c1314f1-b54f-562c-b6f0-950fcac4c9cc
85
+ //# debugId=e7cd6092-ed18-52ea-94a0-03bed42eb858
@@ -4,10 +4,34 @@
4
4
  * Generated by scripts/generate-error-code-catalog.mjs. Do not edit manually.
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]="bcb7a0a9-268f-5cf8-aefc-766b67e92168")}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]="94952ea0-bfe7-5d64-9ac4-101c483b4c55")}catch(e){}}();
8
8
  import { definePmErrorCodeCatalog } from "./error-code-catalog.js";
9
9
  /** Exhaustive catalog generated from literal error guidance declarations. */
10
10
  export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
11
+ {
12
+ code: "acceptance_criteria_mutation_conflict",
13
+ meaning: "Acceptance criteria mutation conflict condition.",
14
+ stability: "provisional",
15
+ exit_code: 2,
16
+ class: "usage",
17
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
18
+ sources: ["sdk/lifecycle/update.ts"],
19
+ emitting_commands: ["update", "update-many"],
20
+ canonical_code: "acceptance_criteria_mutation_conflict",
21
+ aliases: [],
22
+ },
23
+ {
24
+ code: "acceptance_criteria_remove_unmatched",
25
+ meaning: "Acceptance criteria remove unmatched condition.",
26
+ stability: "provisional",
27
+ exit_code: 3,
28
+ class: "not_found",
29
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
30
+ sources: ["sdk/lifecycle/update-many.ts", "sdk/lifecycle/update.ts"],
31
+ emitting_commands: ["update", "update-many"],
32
+ canonical_code: "acceptance_criteria_remove_unmatched",
33
+ aliases: [],
34
+ },
11
35
  {
12
36
  code: "acceptance_criteria_semicolon_forbidden",
13
37
  meaning: "Acceptance criteria semicolon forbidden condition.",
@@ -308,6 +332,42 @@ export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
308
332
  canonical_code: "conflicting_lifecycle_owner",
309
333
  aliases: [],
310
334
  },
335
+ {
336
+ code: "context_signal_store_invalid",
337
+ meaning: "Context signal store invalid condition.",
338
+ stability: "provisional",
339
+ exit_code: 2,
340
+ class: "usage",
341
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
342
+ sources: ["sdk/context-signal-store.ts"],
343
+ emitting_commands: ["*"],
344
+ canonical_code: "context_signal_store_invalid",
345
+ aliases: [],
346
+ },
347
+ {
348
+ code: "context_signal_store_stale",
349
+ meaning: "Context signal store stale condition.",
350
+ stability: "provisional",
351
+ exit_code: 1,
352
+ class: "generic_failure",
353
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
354
+ sources: ["sdk/context-signal-store.ts"],
355
+ emitting_commands: ["*"],
356
+ canonical_code: "context_signal_store_stale",
357
+ aliases: [],
358
+ },
359
+ {
360
+ code: "context_signal_store_write_failed",
361
+ meaning: "Context signal store write failed condition.",
362
+ stability: "provisional",
363
+ exit_code: 1,
364
+ class: "generic_failure",
365
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
366
+ sources: ["sdk/context-signal-store.ts"],
367
+ emitting_commands: ["*"],
368
+ canonical_code: "context_signal_store_write_failed",
369
+ aliases: [],
370
+ },
311
371
  {
312
372
  code: "context_takes_no_item_argument",
313
373
  meaning: "Context takes no item argument condition.",
@@ -356,6 +416,18 @@ export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
356
416
  canonical_code: "dependency_edge_not_allowed",
357
417
  aliases: [],
358
418
  },
419
+ {
420
+ code: "dependency_target_not_found",
421
+ meaning: "Dependency target not found condition.",
422
+ stability: "provisional",
423
+ exit_code: 3,
424
+ class: "not_found",
425
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
426
+ sources: ["sdk/dependency-flag-validation.ts"],
427
+ emitting_commands: ["*"],
428
+ canonical_code: "dependency_target_not_found",
429
+ aliases: [],
430
+ },
359
431
  {
360
432
  code: "duplicate_command",
361
433
  meaning: "Duplicate command condition.",
@@ -3057,4 +3129,4 @@ export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
3057
3129
  },
3058
3130
  ]);
3059
3131
  //# sourceMappingURL=generated-error-code-catalog.js.map
3060
- //# debugId=bcb7a0a9-268f-5cf8-aefc-766b67e92168
3132
+ //# debugId=94952ea0-bfe7-5d64-9ac4-101c483b4c55
@@ -4,7 +4,7 @@
4
4
  * Implements the pm health 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]="97e1ed14-cd36-5910-b829-4619af6080e1")}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]="539b0cb4-5e20-51e2-a33e-1a43ca961f05")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
@@ -28,7 +28,7 @@ import { toNonEmptyStringOrUndefined } from "../../core/shared/primitives.js";
28
28
  import { nowIso } from "../../core/shared/time.js";
29
29
  import { parseItemDocument } from "../../core/item/item-format.js";
30
30
  import { effectiveItemFormatVersion, scanItemFormatVersions, } from "../../core/item/item-format-version.js";
31
- import { listAllItemMetadata, listAllItemMetadataWithBody, } from "../../core/store/item-store.js";
31
+ import { listAllItemMetadataLight, listAllItemMetadataWithBody, } from "../../core/store/item-store.js";
32
32
  import { PM_TELEMETRY_SOURCE_CONTEXT_VALUES, TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS, TELEMETRY_SCHEMA_VERSION, } from "../../core/telemetry/runtime.js";
33
33
  import { getItemFormatFromPath, getSettingsPath, ITEM_FILE_EXTENSIONS, resolveGlobalPmRoot, resolvePmRoot, } from "../../core/store/paths.js";
34
34
  import { readSettingsWithMetadata } from "../../core/store/settings.js";
@@ -322,7 +322,10 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema, requireMergeDri
322
322
  : await auditMergeDriverConfiguration(gitWorkspaceRoot);
323
323
  const pendingMergeReceipts = gitWorkspaceRoot === null
324
324
  ? []
325
- : await listMergeReceipts(gitWorkspaceRoot, { includeLossless: true });
325
+ : await listMergeReceipts(gitWorkspaceRoot, {
326
+ includeLossless: true,
327
+ pmRoot,
328
+ });
326
329
  const { pendingDecisions: pendingMergeDecisions, lossless: losslessMergeReceipts, } = partitionMergeReceipts(pendingMergeReceipts);
327
330
  const mergeDriverInstallationMissing = mergeDriverAudit?.status === "missing" &&
328
331
  mergeDriverAudit.missing_keys.length === 5 &&
@@ -1652,7 +1655,7 @@ function resolveHealthSkipPolicy(options) {
1652
1655
  }
1653
1656
  async function readHealthItems(params) {
1654
1657
  if (params.skipPolicy.skipDrift && params.skipPolicy.skipVectors) {
1655
- return listAllItemMetadata(params.pmRoot, params.settings.item_format, params.typeRegistry.type_to_folder, params.itemReadWarnings, params.settings.schema);
1658
+ return listAllItemMetadataLight(params.pmRoot, params.settings.item_format, params.typeRegistry.type_to_folder, params.itemReadWarnings, params.settings.schema);
1656
1659
  }
1657
1660
  return listAllItemMetadataWithBody(params.pmRoot, params.settings.item_format, params.typeRegistry.type_to_folder, params.itemReadWarnings, params.settings.schema);
1658
1661
  }
@@ -1702,7 +1705,7 @@ const resolveUnknownAuthorEventCount = (authorAttribution) => authorAttribution.
1702
1705
  /** Preserve actionable-author semantics for current and legacy scan payloads. */
1703
1706
  const resolveActionableUnknownAuthorEventCount = (authorAttribution) => authorAttribution.actionable_unknown_event_count ??
1704
1707
  resolveUnknownAuthorEventCount(authorAttribution);
1705
- function buildStorageHealthCheck(items, settings, historySummary, authorAttribution, staleInProgress, provenanceResolverOutcomes) {
1708
+ function buildStorageHealthCheck(items, settings, historySummary, authorAttribution, staleInProgress, provenanceResolverOutcomes, provenanceInvalidValues) {
1706
1709
  const unknownAuthorEventCount = resolveUnknownAuthorEventCount(authorAttribution);
1707
1710
  const actionableUnknownAuthorEventCount = resolveActionableUnknownAuthorEventCount(authorAttribution);
1708
1711
  const hasAuthorEvents = unknownAuthorEventCount > 0;
@@ -1738,6 +1741,9 @@ function buildStorageHealthCheck(items, settings, historySummary, authorAttribut
1738
1741
  ...(provenanceResolverOutcomes.length > 0
1739
1742
  ? { provenance_resolver_outcomes: provenanceResolverOutcomes }
1740
1743
  : {}),
1744
+ ...(provenanceInvalidValues.length > 0
1745
+ ? { provenance_invalid_values: provenanceInvalidValues }
1746
+ : {}),
1741
1747
  ...(historySummary.max_entries !== null
1742
1748
  ? {
1743
1749
  compact_policy: {
@@ -1881,6 +1887,7 @@ export async function runHealth(global, options = {}) {
1881
1887
  }));
1882
1888
  const provenanceResolverHealth = await scanProvenanceResolverHealth(pmRoot);
1883
1889
  const provenanceResolverOutcomes = provenanceResolverHealth.outcomes;
1890
+ const provenanceInvalidValues = provenanceResolverHealth.invalid_values;
1884
1891
  const provenanceWarnings = provenanceResolverHealth.warnings;
1885
1892
  const locksCheck = await buildLocksCheck(pmRoot);
1886
1893
  const integrityCheck = skipPolicy.skipIntegrity
@@ -1898,7 +1905,7 @@ export async function runHealth(global, options = {}) {
1898
1905
  buildSettingsValuesHealthCheck(settingWarnings),
1899
1906
  telemetryCheck.check,
1900
1907
  extensionCheck.check,
1901
- buildStorageHealthCheck(items, settings, historySummary, authorAttribution, staleInProgress.scan, provenanceResolverOutcomes),
1908
+ buildStorageHealthCheck(items, settings, historySummary, authorAttribution, staleInProgress.scan, provenanceResolverOutcomes, provenanceInvalidValues),
1902
1909
  locksCheck.check,
1903
1910
  integrityCheck.check,
1904
1911
  historyDriftCheck.check,
@@ -1983,4 +1990,4 @@ export const _testOnlyHealthCommand = {
1983
1990
  warningCode,
1984
1991
  };
1985
1992
  //# sourceMappingURL=health.js.map
1986
- //# debugId=97e1ed14-cd36-5910-b829-4619af6080e1
1993
+ //# debugId=539b0cb4-5e20-51e2-a33e-1a43ca961f05
@@ -11,10 +11,23 @@ export interface ProvenanceResolverHealthOutcome {
11
11
  /** Attempted events that produced a bounded value. */
12
12
  successes: number;
13
13
  }
14
+ /** Aggregate for legacy provenance values that violate the bounded domain. */
15
+ export interface ProvenanceValueHealthFinding {
16
+ /** Detected harness namespace. */
17
+ harness: string;
18
+ /** Provenance dimension containing the invalid value. */
19
+ dimension: string;
20
+ /** Privacy-safe invalid-value class. */
21
+ kind: "boolean" | "single_digit";
22
+ /** Events containing this invalid value class. */
23
+ count: number;
24
+ }
14
25
  /** Bounded provenance health result suitable for `pm health` adapters. */
15
26
  export interface ProvenanceResolverHealthScan {
16
27
  /** Stable resolver outcome aggregates. */
17
28
  outcomes: ProvenanceResolverHealthOutcome[];
29
+ /** Aggregated invalid legacy values without retaining the values themselves. */
30
+ invalid_values: ProvenanceValueHealthFinding[];
18
31
  /** Advisory warnings for attempted resolvers with no success. */
19
32
  warnings: string[];
20
33
  /** Number of nonblank history events inspected. */