@unbrained/pm-cli 2026.8.10 → 2026.8.12

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 (243) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +153 -100
  3. package/dist/cli/commander-usage.js +113 -15
  4. package/dist/cli/error-guidance.d.ts +12 -0
  5. package/dist/cli/error-guidance.js +147 -29
  6. package/dist/cli/main.js +38 -19
  7. package/dist/cli/register-annotations.js +56 -3
  8. package/dist/cli/register-assurance.d.ts +8 -0
  9. package/dist/cli/register-assurance.js +52 -0
  10. package/dist/cli/register-files-lookup.js +14 -3
  11. package/dist/cli/register-list-query.js +10 -7
  12. package/dist/cli/register-mutation.js +30 -9
  13. package/dist/cli/register-operations.js +30 -15
  14. package/dist/cli-bundle/bundle-manifest.json +155 -155
  15. package/dist/cli-bundle/chunks/{chunk-TRWXF476.js → chunk-3PS7X6GS.js} +2 -2
  16. package/dist/cli-bundle/chunks/chunk-7KL6KMWF.js +13 -0
  17. package/dist/cli-bundle/chunks/{chunk-EBO7OUUE.js → chunk-BM5YJ2UW.js} +69 -55
  18. package/dist/cli-bundle/chunks/chunk-D55A5AEN.js +33 -0
  19. package/dist/cli-bundle/chunks/chunk-KIKDWECH.js +196 -0
  20. package/dist/cli-bundle/chunks/{chunk-ETML5C6H.js → chunk-KOQMGCTA.js} +47 -47
  21. package/dist/cli-bundle/chunks/chunk-R76342NV.js +2 -0
  22. package/dist/cli-bundle/chunks/chunk-RBTK5EZV.js +5 -0
  23. package/dist/cli-bundle/chunks/chunk-VLUQOIDT.js +2 -0
  24. package/dist/cli-bundle/chunks/chunk-WLAHPSOX.js +3 -0
  25. package/dist/cli-bundle/chunks/register-list-query-XPCJRUUD.js +10 -0
  26. package/dist/cli-bundle/chunks/register-mutation-4RJCBKRS.js +20 -0
  27. package/dist/cli-bundle/chunks/register-operations-2OGISOVR.js +2 -0
  28. package/dist/cli-bundle/chunks/{register-setup-S3KT2LTH.js → register-setup-LLHAKP2V.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/chunk-2DALMVF7.js +5 -0
  30. package/dist/cli-bundle/focused-chunks/chunk-5OQIMELN.js +155 -0
  31. package/dist/cli-bundle/focused-chunks/chunk-5TAGTDRE.js +2 -0
  32. package/dist/cli-bundle/focused-chunks/chunk-ECADZMVC.js +18 -0
  33. package/dist/cli-bundle/focused-chunks/chunk-EJGXRA6B.js +2 -0
  34. package/dist/cli-bundle/focused-chunks/chunk-FFGSZCPK.js +16 -0
  35. package/dist/cli-bundle/focused-chunks/{chunk-IW43E4XL.js → chunk-GQW4BPUT.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/chunk-ISKOBJCM.js +2 -0
  37. package/dist/cli-bundle/focused-chunks/{chunk-75774JWP.js → chunk-JAFRIWVF.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/{chunk-2COZ67XT.js → chunk-KHM2CS2C.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-M6RPIXKC.js → chunk-KPSXVBDV.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/{chunk-34SX654S.js → chunk-KTLOKKCQ.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/chunk-LGYK3NUF.js +8 -0
  42. package/dist/cli-bundle/focused-chunks/{chunk-2EXI2DKR.js → chunk-NBLUKITQ.js} +2 -2
  43. package/dist/cli-bundle/focused-chunks/chunk-NYLOUPOB.js +2 -0
  44. package/dist/cli-bundle/focused-chunks/chunk-Q4T463SD.js +31 -0
  45. package/dist/cli-bundle/focused-chunks/chunk-QVZVY53N.js +2 -0
  46. package/dist/cli-bundle/focused-chunks/{chunk-DZGAHZZV.js → chunk-RWPAWUOT.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/chunk-UTEWXDEQ.js +17 -0
  48. package/dist/cli-bundle/focused-chunks/{chunk-7UN6BHHO.js → chunk-YIAXMC3T.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/chunk-ZMGWAYH7.js +2 -0
  50. package/dist/cli-bundle/main.js +13 -13
  51. package/dist/cli-bundle/sdk-authoring.js +1 -1
  52. package/dist/cli-bundle/sdk-contracts.js +1 -1
  53. package/dist/cli-bundle/sdk-core.js +41 -39
  54. package/dist/cli-bundle/sdk-governance.js +1 -1
  55. package/dist/cli-bundle/sdk-graph.js +1 -1
  56. package/dist/cli-bundle/sdk-merge.js +1 -1
  57. package/dist/cli-bundle/sdk-query.js +1 -1
  58. package/dist/cli-bundle/sdk-runtime.js +1 -1
  59. package/dist/cli-bundle/sdk-testing.js +1 -1
  60. package/dist/cli-bundle/sdk.js +2 -2
  61. package/dist/core/extensions/reserved-host-flags.js +3 -2
  62. package/dist/core/history/drift-scan.js +13 -8
  63. package/dist/core/history/history.d.ts +8 -0
  64. package/dist/core/history/history.js +57 -7
  65. package/dist/core/history/replay.d.ts +9 -1
  66. package/dist/core/history/replay.js +48 -13
  67. package/dist/core/output/output.d.ts +2 -0
  68. package/dist/core/output/output.js +46 -14
  69. package/dist/core/session/session-state.d.ts +47 -0
  70. package/dist/core/session/session-state.js +207 -6
  71. package/dist/core/shared/author.d.ts +7 -1
  72. package/dist/core/shared/author.js +66 -46
  73. package/dist/core/shared/command-types.d.ts +2 -0
  74. package/dist/core/shared/command-types.js +2 -2
  75. package/dist/core/shared/errors.d.ts +13 -0
  76. package/dist/core/shared/errors.js +2 -2
  77. package/dist/core/store/item-metadata-cache.d.ts +1 -1
  78. package/dist/core/store/item-metadata-cache.js +14 -7
  79. package/dist/sdk/agent/refusal-reachability.d.ts +40 -0
  80. package/dist/sdk/agent/refusal-reachability.js +72 -0
  81. package/dist/sdk/agent/subcommand-recovery.d.ts +40 -0
  82. package/dist/sdk/agent/subcommand-recovery.js +84 -0
  83. package/dist/sdk/cli-bootstrap.d.ts +10 -0
  84. package/dist/sdk/cli-bootstrap.js +11 -7
  85. package/dist/sdk/cli-contracts/completeness.js +14 -3
  86. package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
  87. package/dist/sdk/cli-contracts/enum-contracts.js +3 -2
  88. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  89. package/dist/sdk/cli-contracts/flag-contracts.js +20 -2
  90. package/dist/sdk/cli-contracts/registration-helpers.d.ts +20 -3
  91. package/dist/sdk/cli-contracts/registration-helpers.js +18 -12
  92. package/dist/sdk/cli-contracts/runtime-contracts.js +4 -3
  93. package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +515 -0
  94. package/dist/sdk/cli-contracts/schemas/assurance-definition.js +252 -0
  95. package/dist/sdk/cli-contracts/tool-option-contracts.js +3 -2
  96. package/dist/sdk/cli-contracts/tool-parameter-tables.js +99 -2
  97. package/dist/sdk/cli-contracts/tool-schema.d.ts +3 -3
  98. package/dist/sdk/cli-contracts/tool-schema.js +38 -5
  99. package/dist/sdk/cli-contracts.d.ts +1 -1
  100. package/dist/sdk/cli-contracts.js +3 -3
  101. package/dist/sdk/cli-program.js +3 -2
  102. package/dist/sdk/completion.js +23 -8
  103. package/dist/sdk/config.js +9 -3
  104. package/dist/sdk/context/semantic-session-attribution.d.ts +32 -0
  105. package/dist/sdk/context/semantic-session-attribution.js +83 -0
  106. package/dist/sdk/context-intent-contracts.js +45 -4
  107. package/dist/sdk/core-governance.d.ts +3 -1
  108. package/dist/sdk/core-governance.js +5 -3
  109. package/dist/sdk/core.d.ts +2 -1
  110. package/dist/sdk/core.js +3 -2
  111. package/dist/sdk/error-code-catalog.d.ts +13 -0
  112. package/dist/sdk/error-code-catalog.js +35 -2
  113. package/dist/sdk/extension.js +18 -17
  114. package/dist/sdk/files.d.ts +11 -0
  115. package/dist/sdk/files.js +82 -24
  116. package/dist/sdk/generated/generated-error-code-catalog-part-1.d.ts +8 -0
  117. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1585 -0
  118. package/dist/sdk/generated/generated-error-code-catalog-part-2.d.ts +8 -0
  119. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1608 -0
  120. package/dist/sdk/generated-error-code-catalog.js +6 -3121
  121. package/dist/sdk/governance/assurance-action-contracts.d.ts +7 -0
  122. package/dist/sdk/governance/assurance-action-contracts.js +5 -0
  123. package/dist/sdk/governance/assurance-action.d.ts +70 -0
  124. package/dist/sdk/governance/assurance-action.js +200 -0
  125. package/dist/sdk/governance/assurance-limits.d.ts +7 -0
  126. package/dist/sdk/governance/assurance-limits.js +11 -0
  127. package/dist/sdk/governance/assurance-mutation-error.d.ts +7 -0
  128. package/dist/sdk/governance/assurance-mutation-error.js +35 -0
  129. package/dist/sdk/governance/assurance-runtime.d.ts +20 -0
  130. package/dist/sdk/governance/assurance-runtime.js +134 -0
  131. package/dist/sdk/governance/assurance.d.ts +438 -0
  132. package/dist/sdk/governance/assurance.js +804 -0
  133. package/dist/sdk/governance/health.d.ts +3 -1
  134. package/dist/sdk/governance/health.js +21 -4
  135. package/dist/sdk/governance/validate-item-reader.js +3 -3
  136. package/dist/sdk/governance/validate.d.ts +2 -0
  137. package/dist/sdk/governance/validate.js +13 -3
  138. package/dist/sdk/graph/durable-cache.d.ts +1 -1
  139. package/dist/sdk/graph/durable-cache.js +98 -29
  140. package/dist/sdk/graph/governance.d.ts +14 -0
  141. package/dist/sdk/graph/governance.js +34 -9
  142. package/dist/sdk/graph/run.js +8 -3
  143. package/dist/sdk/index.d.ts +7 -2
  144. package/dist/sdk/index.js +9 -4
  145. package/dist/sdk/lifecycle/claim.js +26 -4
  146. package/dist/sdk/lifecycle/focus.js +13 -3
  147. package/dist/sdk/lifecycle/plan.js +8 -3
  148. package/dist/sdk/merge/driver.d.ts +2 -2
  149. package/dist/sdk/merge/driver.js +3 -3
  150. package/dist/sdk/merge/receipts.d.ts +6 -4
  151. package/dist/sdk/merge/receipts.js +7 -5
  152. package/dist/sdk/merge/three-way.d.ts +2 -2
  153. package/dist/sdk/merge/three-way.js +3 -3
  154. package/dist/sdk/output-projection.d.ts +9 -1
  155. package/dist/sdk/output-projection.js +45 -9
  156. package/dist/sdk/provenance.d.ts +38 -0
  157. package/dist/sdk/provenance.js +64 -2
  158. package/dist/sdk/query/activity.d.ts +49 -2
  159. package/dist/sdk/query/activity.js +183 -37
  160. package/dist/sdk/query/context.js +19 -8
  161. package/dist/sdk/query/get.js +19 -2
  162. package/dist/sdk/read-output-contracts.d.ts +5 -1
  163. package/dist/sdk/read-output-contracts.js +17 -2
  164. package/dist/sdk/read-output-session.d.ts +2 -0
  165. package/dist/sdk/read-output-session.js +12 -5
  166. package/dist/sdk/runtime-extended-actions.js +22 -5
  167. package/dist/sdk/runtime-primitives.d.ts +5 -3
  168. package/dist/sdk/runtime-primitives.js +7 -5
  169. package/dist/sdk/runtime-stats-options.js +3 -2
  170. package/dist/sdk/runtime.d.ts +4 -0
  171. package/dist/sdk/runtime.js +34 -34
  172. package/dist/sdk/stats.d.ts +36 -3
  173. package/dist/sdk/stats.js +55 -15
  174. package/dist/sdk/telemetry.js +7 -4
  175. package/dist/sdk/test/execution.d.ts +4 -0
  176. package/dist/sdk/test/execution.js +86 -21
  177. package/dist/sdk/traceability/runtime-files-lookup.d.ts +8 -0
  178. package/dist/sdk/traceability/runtime-files-lookup.js +33 -0
  179. package/dist/sdk/traceability/source-traceability.d.ts +102 -0
  180. package/dist/sdk/traceability/source-traceability.js +293 -0
  181. package/dist/types.d.ts +10 -2
  182. package/dist/types.js +2 -2
  183. package/docs/ASSURANCE.md +137 -0
  184. package/docs/COMMANDS.md +29 -8
  185. package/docs/CONFIGURATION.md +7 -0
  186. package/docs/DEPENDENCY_KIND_CONTRACT.md +10 -8
  187. package/docs/MERGE_SAFETY.md +3 -1
  188. package/docs/OUTPUT_PROJECTION_CONTRACTS.md +26 -13
  189. package/docs/README.md +3 -0
  190. package/docs/READ_OUTPUT_CONTRACTS.md +17 -2
  191. package/docs/RELEASING.md +9 -5
  192. package/docs/SDK.md +12 -1
  193. package/docs/SDK_AGENT_SESSION_CONTEXT.md +52 -5
  194. package/docs/SDK_CONTEXT_EVIDENCE_CONTRACTS.md +53 -0
  195. package/docs/SDK_CONTEXT_INTEGRITY.md +28 -1
  196. package/docs/SDK_EVIDENCE_TRACEABILITY.md +39 -1
  197. package/docs/SDK_RUNTIME_BOUNDARIES.md +36 -1
  198. package/docs/TESTING.md +12 -9
  199. package/docs/TRUSTWORTHY_CONTEXT_EVIDENCE.md +106 -0
  200. package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -0
  201. package/docs/performance/sdk-entrypoint-import-costs.md +6 -2
  202. package/marketplace.json +2 -2
  203. package/package.json +7 -7
  204. package/packages/pm-beads/package.json +1 -1
  205. package/packages/pm-calendar/package.json +1 -1
  206. package/packages/pm-command-kit/package.json +1 -1
  207. package/packages/pm-digital-twin/package.json +1 -1
  208. package/packages/pm-governance-audit/package.json +1 -1
  209. package/packages/pm-guide-shell/package.json +1 -1
  210. package/packages/pm-kanban/package.json +1 -1
  211. package/packages/pm-lifecycle-hooks/package.json +1 -1
  212. package/packages/pm-linked-test-adapters/package.json +1 -1
  213. package/packages/pm-search-advanced/package.json +1 -1
  214. package/packages/pm-templates/extensions/templates/index.ts +9 -3
  215. package/packages/pm-templates/package.json +1 -1
  216. package/packages/pm-todos/package.json +1 -1
  217. package/packages/pm-vcs/package.json +1 -1
  218. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  219. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  220. package/sdk/public-surface.json +1030 -67
  221. package/dist/cli-bundle/chunks/chunk-2QYH4QMI.js +0 -30
  222. package/dist/cli-bundle/chunks/chunk-JUDU4RO4.js +0 -194
  223. package/dist/cli-bundle/chunks/chunk-JZSNADRR.js +0 -5
  224. package/dist/cli-bundle/chunks/chunk-MENWVGJW.js +0 -2
  225. package/dist/cli-bundle/chunks/chunk-S4EITGLA.js +0 -3
  226. package/dist/cli-bundle/chunks/chunk-TIGKWVLA.js +0 -13
  227. package/dist/cli-bundle/chunks/chunk-TSLDTJLQ.js +0 -2
  228. package/dist/cli-bundle/chunks/register-list-query-OJ6ZXKV4.js +0 -10
  229. package/dist/cli-bundle/chunks/register-mutation-DKI7QC7O.js +0 -20
  230. package/dist/cli-bundle/chunks/register-operations-P5OGMT6I.js +0 -2
  231. package/dist/cli-bundle/focused-chunks/chunk-36FTZ2NT.js +0 -2
  232. package/dist/cli-bundle/focused-chunks/chunk-3CQECMKR.js +0 -16
  233. package/dist/cli-bundle/focused-chunks/chunk-CHIBMEZR.js +0 -8
  234. package/dist/cli-bundle/focused-chunks/chunk-FF4MNAYB.js +0 -153
  235. package/dist/cli-bundle/focused-chunks/chunk-GHTN2ILR.js +0 -2
  236. package/dist/cli-bundle/focused-chunks/chunk-I4YM2I7S.js +0 -2
  237. package/dist/cli-bundle/focused-chunks/chunk-IMDTEN7K.js +0 -2
  238. package/dist/cli-bundle/focused-chunks/chunk-JMVA4HKR.js +0 -5
  239. package/dist/cli-bundle/focused-chunks/chunk-KR5RVXLQ.js +0 -31
  240. package/dist/cli-bundle/focused-chunks/chunk-KSNJG4KI.js +0 -16
  241. package/dist/cli-bundle/focused-chunks/chunk-MXYSIQ56.js +0 -18
  242. package/dist/cli-bundle/focused-chunks/chunk-RIIN5V4N.js +0 -2
  243. package/dist/cli-bundle/focused-chunks/chunk-RKWSCYYN.js +0 -2
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8071fd9d-649a-5fce-b342-84b11066d559")}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]="969b5bd2-e7de-5db8-bef2-6748675a100c")}catch(e){}}();
3
3
  export { EXECUTABLE_COMMAND_ALIASES } from "./cli-contracts/command-aliases.js";
4
4
  export { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, NEXT_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, readFirstValueFromCommanderOptions, readFirstStringFromCommanderOptions, readStringArrayFromCommanderOptions, } from "./cli-contracts/commander-types.js";
5
5
  export { CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, } from "./cli-contracts/commander-mutation-options.js";
@@ -9,9 +9,9 @@ export { CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, CREATE_COMMANDER_REPEAT
9
9
  // keep importing everything from "./cli-contracts.js" unchanged.
10
10
  export { PM_EXTENSION_CAPABILITY_CONTRACTS, PM_EXTENSION_SERVICE_NAME_CONTRACTS, PM_EXTENSION_POLICY_MODE_CONTRACTS, PM_EXTENSION_TRUST_MODE_CONTRACTS, PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS, PM_EXTENSION_POLICY_SURFACE_CONTRACTS, PM_CORE_COMMAND_NAMES, PM_CLI_ONLY_TOOL_ACTION_WAIVERS, PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS, PM_TOOL_ACTIONS, analyzePmToolActionParity, isPmToolAction, isPmExtensionCapabilityContract, isPmExtensionServiceNameContract, isPmExtensionPolicyModeContract, isPmExtensionPolicySurfaceContract, } from "./cli-contracts/enum-contracts.js";
11
11
  export { TOOL_LIST_FILTER_OPTION_CONTRACTS, TOOL_AGGREGATE_OPTION_CONTRACTS, TOOL_SEARCH_FILTER_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS, TOOL_CREATE_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS, TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS, TOOL_CALENDAR_OPTION_CONTRACTS, TOOL_ACTIVITY_OPTION_CONTRACTS, TOOL_CONTEXT_OPTION_CONTRACTS, TOOL_DEPS_OPTION_CONTRACTS, TOOL_GRAPH_OPTION_CONTRACTS, TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE, TOOL_CREATE_OPTION_CONTRACT_SOURCE, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE, TOOL_UPDATE_OPTION_CONTRACT_SOURCE, } from "./cli-contracts/tool-option-contracts.js";
12
- export { withFlagAliasMetadata, compactFlagAliasContracts, SUBCOMMAND_GLOBAL_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, COMMENTS_FLAG_CONTRACTS, NOTES_FLAG_CONTRACTS, LEARNINGS_FLAG_CONTRACTS, FILES_FLAG_CONTRACTS, DOCS_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, HISTORY_REDACT_FLAG_CONTRACTS, HISTORY_REPAIR_FLAG_CONTRACTS, HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, HISTORY_COMPACT_FLAG_CONTRACTS, MERGE_FLAG_CONTRACTS, SCHEMA_FLAG_CONTRACTS, PROFILE_FLAG_CONTRACTS, PLAN_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, CONFIG_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, EXTENSION_SCOPE_FLAG_CONTRACTS, EXTENSION_INIT_FLAG_CONTRACTS, EXTENSION_MIGRATE_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PACKAGE_INIT_FLAG_CONTRACTS, EXTENSION_INSTALL_FLAG_CONTRACTS, EXTENSION_UNINSTALL_FLAG_CONTRACTS, EXTENSION_EXPLORE_FLAG_CONTRACTS, EXTENSION_DESCRIBE_FLAG_CONTRACTS, EXTENSION_ADOPT_ALL_FLAG_CONTRACTS, EXTENSION_ACTIVATE_FLAG_CONTRACTS, EXTENSION_DEACTIVATE_FLAG_CONTRACTS, EXTENSION_MANAGE_FLAG_CONTRACTS, EXTENSION_RELOAD_FLAG_CONTRACTS, EXTENSION_DOCTOR_FLAG_CONTRACTS, EXTENSION_CATALOG_FLAG_CONTRACTS, EXTENSION_ADOPT_FLAG_CONTRACTS, INSTALL_FLAG_CONTRACTS, UPGRADE_FLAG_CONTRACTS, REINDEX_FLAG_CONTRACTS, CLOSE_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CLAIM_FLAG_CONTRACTS, RESTORE_FLAG_CONTRACTS, DELETE_FLAG_CONTRACTS, RELEASE_FLAG_CONTRACTS, START_TASK_FLAG_CONTRACTS, PAUSE_TASK_FLAG_CONTRACTS, CLOSE_TASK_FLAG_CONTRACTS, MEET_FLAG_CONTRACTS, EVENT_FLAG_CONTRACTS, EVENTS_FLAG_CONTRACTS, REMIND_FLAG_CONTRACTS, TEST_FLAG_CONTRACTS, TEST_ALL_FLAG_CONTRACTS, TELEMETRY_FLAG_CONTRACTS, TEST_RUNS_FLAG_CONTRACTS, GC_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, VALIDATE_FLAG_CONTRACTS, CREATE_FLAG_CONTRACTS, ITEM_COMPLETE_FLAG_CONTRACTS, ITEM_MUTATE_FLAG_CONTRACTS, COPY_FLAG_CONTRACTS, FOCUS_FLAG_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, CALENDAR_FLAG_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, CONTEXT_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, EVAL_FLAG_CONTRACTS, WORKSPACE_FLAG_CONTRACTS, NEXT_FLAG_CONTRACTS, SEARCH_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, hasSubcommandFlagContractsForCommand, resolveSubcommandFlagContractsForCommand, toCompletionFlagString, } from "./cli-contracts/flag-contracts.js";
12
+ export { withFlagAliasMetadata, compactFlagAliasContracts, SUBCOMMAND_GLOBAL_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, COMMENTS_FLAG_CONTRACTS, NOTES_FLAG_CONTRACTS, LEARNINGS_FLAG_CONTRACTS, FILES_FLAG_CONTRACTS, DOCS_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, HISTORY_REDACT_FLAG_CONTRACTS, HISTORY_REPAIR_FLAG_CONTRACTS, HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, HISTORY_COMPACT_FLAG_CONTRACTS, MERGE_FLAG_CONTRACTS, SCHEMA_FLAG_CONTRACTS, PROFILE_FLAG_CONTRACTS, PLAN_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, CONFIG_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, EXTENSION_SCOPE_FLAG_CONTRACTS, EXTENSION_INIT_FLAG_CONTRACTS, EXTENSION_MIGRATE_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PACKAGE_INIT_FLAG_CONTRACTS, EXTENSION_INSTALL_FLAG_CONTRACTS, EXTENSION_UNINSTALL_FLAG_CONTRACTS, EXTENSION_EXPLORE_FLAG_CONTRACTS, EXTENSION_DESCRIBE_FLAG_CONTRACTS, EXTENSION_ADOPT_ALL_FLAG_CONTRACTS, EXTENSION_ACTIVATE_FLAG_CONTRACTS, EXTENSION_DEACTIVATE_FLAG_CONTRACTS, EXTENSION_MANAGE_FLAG_CONTRACTS, EXTENSION_RELOAD_FLAG_CONTRACTS, EXTENSION_DOCTOR_FLAG_CONTRACTS, EXTENSION_CATALOG_FLAG_CONTRACTS, EXTENSION_ADOPT_FLAG_CONTRACTS, INSTALL_FLAG_CONTRACTS, UPGRADE_FLAG_CONTRACTS, REINDEX_FLAG_CONTRACTS, CLOSE_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CLAIM_FLAG_CONTRACTS, RESTORE_FLAG_CONTRACTS, DELETE_FLAG_CONTRACTS, RELEASE_FLAG_CONTRACTS, START_TASK_FLAG_CONTRACTS, PAUSE_TASK_FLAG_CONTRACTS, CLOSE_TASK_FLAG_CONTRACTS, MEET_FLAG_CONTRACTS, EVENT_FLAG_CONTRACTS, EVENTS_FLAG_CONTRACTS, REMIND_FLAG_CONTRACTS, TEST_FLAG_CONTRACTS, TEST_ALL_FLAG_CONTRACTS, TELEMETRY_FLAG_CONTRACTS, TEST_RUNS_FLAG_CONTRACTS, GC_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, VALIDATE_FLAG_CONTRACTS, ASSURANCE_FLAG_CONTRACTS, CREATE_FLAG_CONTRACTS, ITEM_COMPLETE_FLAG_CONTRACTS, ITEM_MUTATE_FLAG_CONTRACTS, COPY_FLAG_CONTRACTS, FOCUS_FLAG_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, CALENDAR_FLAG_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, CONTEXT_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, EVAL_FLAG_CONTRACTS, WORKSPACE_FLAG_CONTRACTS, NEXT_FLAG_CONTRACTS, SEARCH_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, hasSubcommandFlagContractsForCommand, resolveSubcommandFlagContractsForCommand, toCompletionFlagString, } from "./cli-contracts/flag-contracts.js";
13
13
  export { buildPmActionToolInputSchema, PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES, resolvePmToolCustomFieldCollision, CLOSE_ACTION_OPTION_KEYS, PLAN_CREATE_METADATA_PARAMETER_KEYS, PM_TOOL_ACTION_PARAMETER_CONTRACTS, PM_TOOL_PARAMETERS_SCHEMA_VERSION, PM_TOOL_PARAMETERS_SCHEMA_MAJOR, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION, PM_TOOL_PARAMETERS_SCHEMA, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA, _testOnlyCliContracts, } from "./cli-contracts/tool-schema.js";
14
14
  export { analyzeSdkCliParameterCompleteness, } from "./cli-contracts/completeness.js";
15
15
  export { PM_COMMAND_OUTPUT_BUDGET_CONTRACTS, PM_OUTPUT_BUDGET_CLASSES, PM_OUTPUT_DEGRADATION_STEPS, createPmCommandOutputBudget, definePmCommandOutputBudget, estimatePmOutputTokens, inferPmOutputBudgetClass, resolvePmCommandOutputBudget, } from "./cli-contracts/agent-output-contracts.js";
16
16
  //# sourceMappingURL=cli-contracts.js.map
17
- //# debugId=8071fd9d-649a-5fce-b342-84b11066d559
17
+ //# debugId=969b5bd2-e7de-5db8-bef2-6748675a100c
@@ -4,7 +4,7 @@
4
4
  * Builds the reusable Commander root that embeds pm's universal global contracts.
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]="a410d336-c332-56fc-9a5d-7841a2b3dfa5")}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]="b799c7c2-21b8-5c19-8565-7166e6f06a90")}catch(e){}}();
8
8
  import { Command } from "commander";
9
9
  import { writeStdout } from "../core/output/output.js";
10
10
  /** Create a fresh pm root program suitable for one-shot CLI or embedded hosts. */
@@ -30,6 +30,7 @@ export function createPmCliProgram(version) {
30
30
  .option("--output-budget <tokens>", "Bound estimated tokens in read output")
31
31
  .option("--output-format <toon|json>", "Select the read-output encoding")
32
32
  .option("--output-session <state>", "Carry a JSON session budget and served-item ledger across read calls")
33
+ .option("--output-row-contract", "Include the machine-readable row selector and TOON encoding contract")
33
34
  .option("--quiet", "Suppress stdout output")
34
35
  .option("--no-changed-fields", "Omit the changed_fields array from mutation output (keeps changed_field_count)")
35
36
  .option("--full-changed-fields", "Restore the legacy full mutation envelope and changed_fields array")
@@ -44,4 +45,4 @@ export function createPmCliProgram(version) {
44
45
  .exitOverride();
45
46
  }
46
47
  //# sourceMappingURL=cli-program.js.map
47
- //# debugId=a410d336-c332-56fc-9a5d-7841a2b3dfa5
48
+ //# debugId=b799c7c2-21b8-5c19-8565-7166e6f06a90
@@ -4,11 +4,11 @@
4
4
  * Implements the pm completion 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]="6c9648d7-ab14-5e0d-8793-86ae13643fa6")}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]="fca471b1-155a-5fc4-9aa9-d45e5f1315dd")}catch(e){}}();
8
8
  import { EXIT_CODE, PmCliError } from "./runtime-primitives.js";
9
9
  import { listPmCommandsForTier } from "./agent-capability-contracts.js";
10
10
  import { SCAFFOLD_CAPABILITIES } from "./extension/scaffold.js";
11
- import { AGGREGATE_FLAG_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, CONTEXT_FLAG_CONTRACTS, COPY_FLAG_CONTRACTS, FOCUS_FLAG_CONTRACTS, MEET_FLAG_CONTRACTS, REMIND_FLAG_CONTRACTS, CREATE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, NEXT_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PLAN_FLAG_CONTRACTS, SEARCH_FLAG_CONTRACTS, EVENTS_FLAG_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, toCompletionFlagString, } from "./cli-contracts.js";
11
+ import { AGGREGATE_FLAG_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, CONTEXT_FLAG_CONTRACTS, COPY_FLAG_CONTRACTS, FOCUS_FLAG_CONTRACTS, MEET_FLAG_CONTRACTS, REMIND_FLAG_CONTRACTS, CREATE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, NEXT_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PLAN_FLAG_CONTRACTS, SEARCH_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, EVENTS_FLAG_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, toCompletionFlagString, } from "./cli-contracts.js";
12
12
  import { BUILTIN_ITEM_TYPE_VALUES, STATUS_VALUES } from "../types/index.js";
13
13
  import { listGuideTopicIds } from "./guide-topics.js";
14
14
  const VALID_SHELLS = ["bash", "zsh", "fish"];
@@ -38,6 +38,7 @@ const DUPLICATES_FLAGS = toCompletionFlagString(DUPLICATES_FLAG_CONTRACTS);
38
38
  const GRAPH_FLAGS = toCompletionFlagString(GRAPH_FLAG_CONTRACTS);
39
39
  const GUIDE_FLAGS = toCompletionFlagString(GUIDE_FLAG_CONTRACTS);
40
40
  const SEARCH_FLAGS = toCompletionFlagString(SEARCH_FLAG_CONTRACTS);
41
+ const STATS_FLAGS = toCompletionFlagString(STATS_FLAG_CONTRACTS);
41
42
  const HEALTH_FLAGS = toCompletionFlagString(HEALTH_FLAG_CONTRACTS);
42
43
  const INIT_FLAGS = toCompletionFlagString(INIT_FLAG_CONTRACTS);
43
44
  const CONTRACTS_FLAGS = toCompletionFlagString(CONTRACTS_FLAG_CONTRACTS);
@@ -608,7 +609,7 @@ export function generateBashScript(itemTypes = [], tags = [], eagerTagExpansion
608
609
  ` COMPREPLY=(${compgen("--add --stdin --file --edit --delete --limit --full-history --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
609
610
  " ;;",
610
611
  " files)",
611
- ` COMPREPLY=(${compgen("discover lookup --add --add-glob --remove --migrate --list --apply --note --append-stable --validate-paths --scope --limit --offset --no-truncate --strict-read --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
612
+ ` COMPREPLY=(${compgen("discover lookup --add --add-glob --remove --migrate --list --apply --note --append-stable --validate-paths --scope --limit --offset --no-truncate --strict-read --explain --lines --decision-depth --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
612
613
  " ;;",
613
614
  " docs)",
614
615
  ` COMPREPLY=(${compgen("--add --add-glob --remove --migrate --note --validate-paths --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
@@ -623,7 +624,7 @@ export function generateBashScript(itemTypes = [], tags = [], eagerTagExpansion
623
624
  ` COMPREPLY=(${compgen(`ancestors descendants predecessors successors paths impact analyze audit communities redundancy dominators slack centrality articulation plan index ${GRAPH_FLAGS}`)})`,
624
625
  " ;;",
625
626
  " test)",
626
- ` COMPREPLY=(${compgen("--add --add-json --remove --list --run --match --only-index --only-last --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
627
+ ` COMPREPLY=(${compgen("--add --add-json --remove --remove-index --list --run --match --only-index --only-last --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
627
628
  " ;;",
628
629
  " test-all)",
629
630
  ` COMPREPLY=(${compgen("--status --limit --offset --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
@@ -677,7 +678,7 @@ export function generateBashScript(itemTypes = [], tags = [], eagerTagExpansion
677
678
  ` COMPREPLY=(${compgen("--dry-run --scope --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
678
679
  " ;;",
679
680
  " stats)",
680
- ` COMPREPLY=(${compgen("--storage --metadata-coverage --field-utilization --by-assignee --by-tag --by-priority --tag-prefix --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
681
+ ` COMPREPLY=(${compgen(STATS_FLAGS)})`,
681
682
  " ;;",
682
683
  " close|close-task)",
683
684
  ` COMPREPLY=(${compgen(CLOSE_MUTATION_FLAGS)})`,
@@ -788,6 +789,7 @@ _pm() {
788
789
  '--output-budget[Set the universal estimated-token ceiling]:tokens' \\
789
790
  '--output-format[Select the universal read encoding]:(toon json)' \\
790
791
  '--output-session[Carry cross-call read budget and served-item state]:state' \\
792
+ '--output-row-contract[Include row schema metadata in read output]' \\
791
793
  '--no-changed-fields[Omit changed_fields array from mutation output]' \\
792
794
  '--pm-path[Explicit tracker storage path for this command]:path:_files -/' \\
793
795
  '--path[Compatibility alias for --pm-path]:path:_files -/' \\
@@ -1304,13 +1306,14 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
1304
1306
  '--to[Upper timestamp bound (ISO/date string or relative)]:date' \\
1305
1307
  '--limit[Max entries]:number' \\
1306
1308
  '--compact[Condensed activity projection]' \\
1309
+ '--raw[Emit raw compact per-event activity output]' \\
1307
1310
  '--full[Show full activity entries]' \\
1308
1311
  '--provenance[Patch-free identity and agent provenance projection]' \\
1309
1312
  '--provenance-summary[Include bounded provenance completeness counts]' \\
1310
1313
  '*--harness[Filter by recorded or vocabulary-resolved harness]:harness' \\
1311
1314
  '*--agent-instance[Filter by privacy-safe agent instance]:instance' \\
1312
1315
  '*--provenance-filter[Filter by exact declared provenance value]:dimension=value' \\
1313
- '--stream[Emit line-delimited JSON rows]:mode' \\
1316
+ '--stream[Emit line-delimited JSON rows (requires --json)]:mode' \\
1314
1317
  '--json[Output JSON]' \\
1315
1318
  '--quiet[Suppress stdout]'
1316
1319
  ;;
@@ -1336,6 +1339,7 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
1336
1339
  ;;
1337
1340
  stats)
1338
1341
  _arguments \\
1342
+ '--include-empty[Include registered zero-count type and status buckets]' \\
1339
1343
  '--storage[Include aggregate history-stream storage metrics]' \\
1340
1344
  '--metadata-coverage[Include metadata coverage percentages overall and by type]' \\
1341
1345
  '--field-utilization[Include content-field utilization rates across all items]' \\
@@ -1412,6 +1416,9 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
1412
1416
  '--offset[Skip the first lookup matches]:number' \\
1413
1417
  '--no-truncate[Return every lookup match]' \\
1414
1418
  '--strict-read[Require authoritative source reads]' \\
1419
+ '--explain[Include ranked source-to-work rationale]' \\
1420
+ '--lines[Attribute an inclusive source line range]:start_end' \\
1421
+ '--decision-depth[Maximum governing-decision relationship depth]:number' \\
1415
1422
  '--author[Mutation author]:author' \\
1416
1423
  '--message[History message]:message' \\
1417
1424
  '--force[Force override]' \\
@@ -1457,6 +1464,7 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
1457
1464
  '--add[Add linked test entry]:entry' \\
1458
1465
  '--add-json[Add linked test entry from JSON object/array]:json' \\
1459
1466
  '--remove[Remove linked test entry by command/path]:entry' \\
1467
+ '--remove-index[Remove linked test entry by 1-based index]:index' \\
1460
1468
  '--list[List linked tests without mutating]' \\
1461
1469
  '--run[Run linked tests]' \\
1462
1470
  '--match[Run linked tests whose command/path contains substring]:substring' \\
@@ -1816,6 +1824,7 @@ complete -c pm -l output-limit -d 'Set the universal read row ceiling' -r
1816
1824
  complete -c pm -l output-budget -d 'Set the universal estimated-token ceiling' -r
1817
1825
  complete -c pm -l output-format -d 'Select the universal read encoding' -r -a 'toon json'
1818
1826
  complete -c pm -l output-session -d 'Carry cross-call read budget and served-item state' -r
1827
+ complete -c pm -l output-row-contract -d 'Include row schema metadata in read output'
1819
1828
  complete -c pm -l no-changed-fields -d 'Omit changed_fields array from mutation output'
1820
1829
  complete -c pm -l id-only -d 'Print only id and status for single-item mutation output'
1821
1830
  complete -c pm -l pm-path -d 'Explicit tracker storage path for this command' -r
@@ -2137,6 +2146,9 @@ complete -c pm -n '__fish_seen_subcommand_from files' -l limit -d 'Maximum looku
2137
2146
  complete -c pm -n '__fish_seen_subcommand_from files' -l offset -d 'Skip the first lookup matches' -r
2138
2147
  complete -c pm -n '__fish_seen_subcommand_from files' -l no-truncate -d 'Return every lookup match'
2139
2148
  complete -c pm -n '__fish_seen_subcommand_from files' -l strict-read -d 'Require authoritative source reads'
2149
+ complete -c pm -n '__fish_seen_subcommand_from files' -l explain -d 'Include ranked source-to-work rationale'
2150
+ complete -c pm -n '__fish_seen_subcommand_from files' -l lines -d 'Attribute an inclusive source line range' -r
2151
+ complete -c pm -n '__fish_seen_subcommand_from files' -l decision-depth -d 'Maximum governing-decision relationship depth' -r
2140
2152
 
2141
2153
 
2142
2154
  # search flags
@@ -2363,13 +2375,14 @@ complete -c pm -n '__fish_seen_subcommand_from activity' -l from -d 'Lower times
2363
2375
  complete -c pm -n '__fish_seen_subcommand_from activity' -l to -d 'Upper timestamp bound (ISO/date string or relative)' -r
2364
2376
  complete -c pm -n '__fish_seen_subcommand_from activity' -l limit -d 'Max activity entries' -r
2365
2377
  complete -c pm -n '__fish_seen_subcommand_from activity' -l compact -d 'Condensed activity projection'
2378
+ complete -c pm -n '__fish_seen_subcommand_from activity' -l raw -d 'Emit raw compact per-event activity output'
2366
2379
  complete -c pm -n '__fish_seen_subcommand_from activity' -l full -d 'Show full activity entries'
2367
2380
  complete -c pm -n '__fish_seen_subcommand_from activity' -l provenance -d 'Patch-free identity and agent provenance projection'
2368
2381
  complete -c pm -n '__fish_seen_subcommand_from activity' -l provenance-summary -d 'Include bounded provenance completeness counts'
2369
2382
  complete -c pm -n '__fish_seen_subcommand_from activity' -l harness -d 'Filter by recorded or vocabulary-resolved harness' -r
2370
2383
  complete -c pm -n '__fish_seen_subcommand_from activity' -l agent-instance -d 'Filter by privacy-safe agent instance' -r
2371
2384
  complete -c pm -n '__fish_seen_subcommand_from activity' -l provenance-filter -d 'Filter by exact declared provenance value' -r
2372
- complete -c pm -n '__fish_seen_subcommand_from activity' -l stream -d 'Emit line-delimited JSON rows'
2385
+ complete -c pm -n '__fish_seen_subcommand_from activity' -l stream -d 'Emit line-delimited JSON rows (requires --json)'
2373
2386
  complete -c pm -n '__fish_seen_subcommand_from contracts' -l action -d 'Filter schema by tool action' -r
2374
2387
  complete -c pm -n '__fish_seen_subcommand_from contracts' -l command -d 'Scope output to one command (narrow-by-default)' -r
2375
2388
  complete -c pm -n '__fish_seen_subcommand_from contracts' -l summary -d 'Return compact command intent summary'
@@ -2427,6 +2440,7 @@ complete -c pm -n '__fish_seen_subcommand_from comments notes learnings' -l forc
2427
2440
  complete -c pm -n '__fish_seen_subcommand_from test' -l add -d 'Add linked test entry' -r
2428
2441
  complete -c pm -n '__fish_seen_subcommand_from test' -l add-json -d 'Add linked test entry from JSON object/array' -r
2429
2442
  complete -c pm -n '__fish_seen_subcommand_from test' -l remove -d 'Remove linked test entry' -r
2443
+ complete -c pm -n '__fish_seen_subcommand_from test' -l remove-index -d 'Remove linked test entry by 1-based index' -r
2430
2444
  complete -c pm -n '__fish_seen_subcommand_from test' -l list -d 'List linked tests without mutating'
2431
2445
  complete -c pm -n '__fish_seen_subcommand_from test' -l run -d 'Run linked tests'
2432
2446
  complete -c pm -n '__fish_seen_subcommand_from test' -l match -d 'Run linked tests whose command/path contains substring' -r
@@ -2483,6 +2497,7 @@ complete -c pm -n '__fish_seen_subcommand_from gc' -l dry-run -d 'Preview cleanu
2483
2497
  complete -c pm -n '__fish_seen_subcommand_from gc' -l scope -d 'Limit cleanup to index/embeddings/runtime/locks scopes' -r
2484
2498
 
2485
2499
  # stats flags
2500
+ complete -c pm -n '__fish_seen_subcommand_from stats' -l include-empty -d 'Include registered zero-count type and status buckets'
2486
2501
  complete -c pm -n '__fish_seen_subcommand_from stats' -l storage -d 'Include aggregate history-stream storage metrics'
2487
2502
  complete -c pm -n '__fish_seen_subcommand_from stats' -l metadata-coverage -d 'Include metadata coverage percentages overall and by type'
2488
2503
  complete -c pm -n '__fish_seen_subcommand_from stats' -l field-utilization -d 'Include content-field utilization rates across all items'
@@ -2747,4 +2762,4 @@ export function runCompletion(shell, itemTypes = [], tags = [], eagerTagExpansio
2747
2762
  };
2748
2763
  }
2749
2764
  //# sourceMappingURL=completion.js.map
2750
- //# debugId=6c9648d7-ab14-5e0d-8793-86ae13643fa6
2765
+ //# debugId=fca471b1-155a-5fc4-9aa9-d45e5f1315dd
@@ -4,7 +4,7 @@
4
4
  * Implements the pm config 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]="2a186a29-9d21-5ebe-9c66-3e889253b15b")}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]="a9a8d99c-df4e-55b3-81f5-27124d598c5f")}catch(e){}}();
8
8
  import { pathExists } from "../core/fs/fs-utils.js";
9
9
  import { resolveConfigPositionalValue, } from "../core/config/positional-value.js";
10
10
  import { NESTED_SETTING_DESCRIPTORS, parseNestedSettingValue, readNestedSettingValue, resolveNestedSettingDescriptor, writeNestedSettingValue, } from "../core/config/nested-settings.js";
@@ -16,6 +16,7 @@ import { buildInvalidTypeError } from "../core/schema/item-types-file.js";
16
16
  import { resolveItemTypesFilePath } from "../core/schema/runtime-schema.js";
17
17
  import { EXIT_CODE } from "../core/shared/constants.js";
18
18
  import { PmCliError } from "../core/shared/errors.js";
19
+ import { createUnknownSubcommandError } from "./agent/subcommand-recovery.js";
19
20
  import { migrateItemFilesToFormat } from "../core/store/item-format-migration.js";
20
21
  import { getSettingsPath, resolveGlobalPmRoot, resolvePmRoot, } from "../core/store/paths.js";
21
22
  import { readSettingsWithMetadata, writeSettings, } from "../core/store/settings.js";
@@ -181,7 +182,12 @@ function normalizeAction(value) {
181
182
  value === "export") {
182
183
  return value;
183
184
  }
184
- throw new PmCliError(`Invalid config action "${value}". Allowed: get, set, list, export`, EXIT_CODE.USAGE);
185
+ throw createUnknownSubcommandError({
186
+ command_path: "config",
187
+ token: value.trim() || "<empty>",
188
+ allowed: ["export", "get", "list", "set"],
189
+ token_kind: "action",
190
+ });
185
191
  }
186
192
  function normalizeKey(value) {
187
193
  const key = CONFIG_KEY_BY_ALIAS[value];
@@ -1091,4 +1097,4 @@ export const _testOnlyConfigCommand = {
1091
1097
  normalizeWarnings,
1092
1098
  };
1093
1099
  //# sourceMappingURL=config.js.map
1094
- //# debugId=2a186a29-9d21-5ebe-9c66-3e889253b15b
1100
+ //# debugId=a9a8d99c-df4e-55b3-81f5-27124d598c5f
@@ -0,0 +1,32 @@
1
+ import { type AgentSemanticAttribution } from "../../core/session/session-state.js";
2
+ import { readSettings } from "../../core/store/settings.js";
3
+ /** Resolve an item's canonical parent lineage under a strict depth bound. */
4
+ export declare function resolveSemanticLineageIds(pmRoot: string, settings: Awaited<ReturnType<typeof readSettings>>, itemId: string): Promise<string[]>;
5
+ /** Record one successful claim and its bounded canonical lineage. */
6
+ export declare function recordClaimSemanticAttribution(params: {
7
+ pmRoot: string;
8
+ settings: Awaited<ReturnType<typeof readSettings>>;
9
+ principal: string;
10
+ itemId: string;
11
+ }): Promise<void>;
12
+ /** Remove one released claim from the active semantic workset. */
13
+ export declare function recordReleaseSemanticAttribution(params: {
14
+ pmRoot: string;
15
+ principal: string;
16
+ itemId: string;
17
+ }): Promise<void>;
18
+ /** Set or clear focused semantic work with canonical lineage evidence. */
19
+ export declare function recordFocusSemanticAttribution(params: {
20
+ pmRoot: string;
21
+ settings: Awaited<ReturnType<typeof readSettings>>;
22
+ principal: string;
23
+ itemId?: string;
24
+ }): Promise<void>;
25
+ /** Public constants used by scale and negative-control tests. */
26
+ export declare const SEMANTIC_ATTRIBUTION_LIMITS: {
27
+ readonly lineage_depth: 16;
28
+ readonly active_items: 64;
29
+ readonly evidence_rows: 32;
30
+ };
31
+ /** Convert bounded claim/focus evidence into normalized context affinity. */
32
+ export declare function semanticAttributionAffinity(attribution: AgentSemanticAttribution | undefined): Readonly<Record<string, number>> | undefined;
@@ -0,0 +1,83 @@
1
+ /**
2
+ * @module sdk/semantic-session-attribution
3
+ *
4
+ * Maintains bounded claimed/focused lineage evidence used by automatic
5
+ * mutation provenance without scanning history or retaining prompt content.
6
+ */
7
+
8
+ !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]="97c1e310-3cd9-5846-a54c-d019b0351541")}catch(e){}}();
9
+ import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
10
+ import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
11
+ import { recordClaimedWorkAttribution, recordFocusedWorkAttribution, releaseClaimedWorkAttribution, } from "../../core/session/session-state.js";
12
+ import { locateItem, readLocatedItem } from "../../core/store/item-store.js";
13
+ const MAX_SEMANTIC_LINEAGE_DEPTH = 16;
14
+ /** Resolve an item's canonical parent lineage under a strict depth bound. */
15
+ export async function resolveSemanticLineageIds(pmRoot, settings, itemId) {
16
+ const typeToFolder = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations()).type_to_folder;
17
+ const lineage = [];
18
+ const seen = new Set();
19
+ let cursor = itemId;
20
+ while (cursor && lineage.length < MAX_SEMANTIC_LINEAGE_DEPTH) {
21
+ const normalized = cursor.trim().toLowerCase();
22
+ if (!normalized || seen.has(normalized))
23
+ break;
24
+ seen.add(normalized);
25
+ const located = await locateItem(pmRoot, cursor, settings.id_prefix, settings.item_format, typeToFolder);
26
+ if (!located)
27
+ break;
28
+ const loaded = await readLocatedItem(located, { schema: settings.schema });
29
+ lineage.push(loaded.document.metadata.id);
30
+ cursor = loaded.document.metadata.parent;
31
+ }
32
+ return lineage;
33
+ }
34
+ /** Record one successful claim and its bounded canonical lineage. */
35
+ export async function recordClaimSemanticAttribution(params) {
36
+ await recordClaimedWorkAttribution({
37
+ pmRoot: params.pmRoot,
38
+ principal: params.principal,
39
+ itemId: params.itemId,
40
+ lineageIds: await resolveSemanticLineageIds(params.pmRoot, params.settings, params.itemId),
41
+ });
42
+ }
43
+ /** Remove one released claim from the active semantic workset. */
44
+ export async function recordReleaseSemanticAttribution(params) {
45
+ await releaseClaimedWorkAttribution(params);
46
+ }
47
+ /** Set or clear focused semantic work with canonical lineage evidence. */
48
+ export async function recordFocusSemanticAttribution(params) {
49
+ await recordFocusedWorkAttribution({
50
+ pmRoot: params.pmRoot,
51
+ principal: params.principal,
52
+ ...(params.itemId
53
+ ? {
54
+ itemId: params.itemId,
55
+ lineageIds: await resolveSemanticLineageIds(params.pmRoot, params.settings, params.itemId),
56
+ }
57
+ : {}),
58
+ });
59
+ }
60
+ /** Public constants used by scale and negative-control tests. */
61
+ export const SEMANTIC_ATTRIBUTION_LIMITS = {
62
+ lineage_depth: MAX_SEMANTIC_LINEAGE_DEPTH,
63
+ active_items: 64,
64
+ evidence_rows: 32,
65
+ };
66
+ /** Convert bounded claim/focus evidence into normalized context affinity. */
67
+ export function semanticAttributionAffinity(attribution) {
68
+ if (!attribution)
69
+ return undefined;
70
+ const affinity = {};
71
+ for (const itemId of attribution.active_item_ids)
72
+ affinity[itemId] = 1;
73
+ if (attribution.focused_item_id)
74
+ affinity[attribution.focused_item_id] = 1;
75
+ for (const evidence of attribution.evidence) {
76
+ const lineage = /^lineage:(.+)$/u.exec(evidence)?.[1];
77
+ if (lineage && affinity[lineage] === undefined)
78
+ affinity[lineage] = 0.75;
79
+ }
80
+ return Object.keys(affinity).length > 0 ? affinity : undefined;
81
+ }
82
+ //# sourceMappingURL=semantic-session-attribution.js.map
83
+ //# debugId=97c1e310-3cd9-5846-a54c-d019b0351541
@@ -5,11 +5,11 @@
5
5
  * workspace configuration, and packages.
6
6
  */
7
7
 
8
- !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]="e48a306e-debb-5e66-ae9b-68bf17fa405f")}catch(e){}}();
8
+ !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]="fa03d543-ff0d-5556-8558-9bed82838a58")}catch(e){}}();
9
9
  import { AsyncLocalStorage } from "node:async_hooks";
10
10
  import { attachOutputOmissionReceipt } from "./output-projection.js";
11
11
  import { encodeQueryCursor } from "./pagination.js";
12
- import { applyReadOutputDimensions } from "./read-output-contracts.js";
12
+ import { applyReadOutputDimensions, stabilizeReadOutputReceiptEstimates, } from "./read-output-contracts.js";
13
13
  import { EXIT_CODE } from "../core/shared/constants.js";
14
14
  import { PmCliError } from "../core/shared/errors.js";
15
15
  /** Built-in intent projections shared by CLI, SDK, MCP, and package authors. */
@@ -590,14 +590,55 @@ function collapseContinuationMetadata(options, result) {
590
590
  };
591
591
  return projected;
592
592
  }
593
+ /** Return whether one projected value is a mutable output record. */
594
+ function isOutputRecord(value) {
595
+ return value !== null && typeof value === "object" && !Array.isArray(value);
596
+ }
597
+ /** Read one numeric fixed-point estimate from an optional receipt. */
598
+ function receiptEstimate(value, field) {
599
+ if (!isOutputRecord(value))
600
+ return undefined;
601
+ return typeof value[field] === "number" ? value[field] : undefined;
602
+ }
603
+ /** Stabilize every token receipt after suppressing discovery-only metadata. */
604
+ function stabilizeSuppressedRowContractReceipts(result, options) {
605
+ let finalized = result;
606
+ for (let iteration = 0; iteration < 8; iteration += 1) {
607
+ const previousContextEstimate = receiptEstimate(finalized.context_intent, "estimated_tokens");
608
+ const previousReadEstimate = receiptEstimate(finalized.read_output, "estimated_tokens");
609
+ const previousSessionEstimate = receiptEstimate(finalized.read_session, "spent_this_call_tokens");
610
+ if (isOutputRecord(finalized.context_intent)) {
611
+ updateContextIntentEstimate(finalized, finalized.context_intent);
612
+ }
613
+ finalized = stabilizeReadOutputReceiptEstimates(finalized, options);
614
+ if (receiptEstimate(finalized.context_intent, "estimated_tokens") ===
615
+ previousContextEstimate &&
616
+ receiptEstimate(finalized.read_output, "estimated_tokens") ===
617
+ previousReadEstimate &&
618
+ receiptEstimate(finalized.read_session, "spent_this_call_tokens") ===
619
+ previousSessionEstimate) {
620
+ break;
621
+ }
622
+ }
623
+ return finalized;
624
+ }
593
625
  /** Attach universal row, omission, and optional intent-budget contracts in rendering order. */
594
626
  export function attachReadOutputContracts(command, options, result) {
595
627
  const disclosedResult = attachOutputOmissionReceipt(command, result);
596
- return typeof disclosedResult === "object" &&
628
+ const projected = typeof disclosedResult === "object" &&
597
629
  disclosedResult !== null &&
598
630
  !Array.isArray(disclosedResult)
599
631
  ? applyReadOutputDimensions(command ?? "", options, collapseContinuationMetadata(options, attachContextIntentReceipt(command ?? "", options, disclosedResult)))
600
632
  : disclosedResult;
633
+ if (options.outputRowContract === true ||
634
+ options.output_row_contract === true ||
635
+ typeof projected !== "object" ||
636
+ projected === null ||
637
+ Array.isArray(projected) ||
638
+ !Object.hasOwn(projected, "row_contract")) {
639
+ return projected;
640
+ }
641
+ return stabilizeSuppressedRowContractReceipts(Object.fromEntries(Object.entries(projected).filter(([key]) => key !== "row_contract")), options);
601
642
  }
602
643
  //# sourceMappingURL=context-intent-contracts.js.map
603
- //# debugId=e48a306e-debb-5e66-ae9b-68bf17fa405f
644
+ //# debugId=fa03d543-ff0d-5556-8558-9bed82838a58
@@ -5,5 +5,7 @@
5
5
  * exposed by both the focused core entrypoint and the complete SDK barrel.
6
6
  */
7
7
  export { AGENT_PROVENANCE_DIMENSIONS, BUILTIN_HARNESS_SIGNAL_DESCRIPTORS, diagnoseAgentIdentity, detectAgentIdentity, detectHarnessIdentity, readAuthorEnvironment, registerHarnessSignalDescriptors, resolveAuthorIdentity, runWithHarnessDetectionSignals, runWithWorkspaceHarnessSignalDescriptors, writeAuthorEnvironment, type AgentClientInfo, type AgentModelSource, type AgentProvenance, type AgentProvenanceAbsenceReason, type AgentProvenanceObservation, type AgentProvenanceOutcome, type AuthorSource, type DetectedAgentIdentity, type DiagnosedAgentIdentity, type HarnessDetectionSignals, type HarnessSignalDescriptor, type ResolvedAuthorIdentity, } from "../core/shared/author.js";
8
- export { analyzeAgentProvenanceDescriptorCoverage, groupHistoryByEpisode, resolveHistoryEpisodeGroupIdentity, summarizeAgentProvenance, summarizeAgentModelProvenance, type AgentEpisodeGroup, type AgentModelProvenanceCoverage, type AgentProvenanceDimensionCoverage, type AgentProvenanceDescriptorCoverage, } from "./provenance.js";
8
+ export { SEMANTIC_ATTRIBUTION_LIMITS, recordClaimSemanticAttribution, recordFocusSemanticAttribution, recordReleaseSemanticAttribution, resolveSemanticLineageIds, semanticAttributionAffinity, } from "./context/semantic-session-attribution.js";
9
+ export { explainSourceTraceability, parseSourceLineRange, type SourceDecisionPath, type SourceLineRange, type SourceTraceabilityEvidence, type SourceTraceabilityExplanation, type SourceTraceabilityRationale, type SourceTraceabilityReceipt, } from "./traceability/source-traceability.js";
10
+ export { analyzeAgentProvenanceDescriptorCoverage, evaluateSemanticAttributionCoverage, groupHistoryByEpisode, resolveHistoryEpisodeGroupIdentity, summarizeAgentProvenance, summarizeAgentModelProvenance, type AgentEpisodeGroup, type AgentModelProvenanceCoverage, type AgentProvenanceDimensionCoverage, type AgentProvenanceDescriptorCoverage, type AgentSemanticAttributionCoverage, type AgentSemanticAttributionCoverageGate, } from "./provenance.js";
9
11
  export { analyzeSdkCliParameterCompleteness, type SdkCliActionParameterCoverage, type SdkCliCompletenessContractSource, type SdkCliParameterCoverageEntry, type SdkCliParameterDisposition, } from "./cli-contracts.js";
@@ -5,9 +5,11 @@
5
5
  * exposed by both the focused core entrypoint and the complete SDK barrel.
6
6
  */
7
7
 
8
- !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]="7442357d-52b9-5461-9ac4-3acd898334da")}catch(e){}}();
8
+ !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]="d19cfa31-a02f-53a7-8685-5d169d6e051d")}catch(e){}}();
9
9
  export { AGENT_PROVENANCE_DIMENSIONS, BUILTIN_HARNESS_SIGNAL_DESCRIPTORS, diagnoseAgentIdentity, detectAgentIdentity, detectHarnessIdentity, readAuthorEnvironment, registerHarnessSignalDescriptors, resolveAuthorIdentity, runWithHarnessDetectionSignals, runWithWorkspaceHarnessSignalDescriptors, writeAuthorEnvironment, } from "../core/shared/author.js";
10
- export { analyzeAgentProvenanceDescriptorCoverage, groupHistoryByEpisode, resolveHistoryEpisodeGroupIdentity, summarizeAgentProvenance, summarizeAgentModelProvenance, } from "./provenance.js";
10
+ export { SEMANTIC_ATTRIBUTION_LIMITS, recordClaimSemanticAttribution, recordFocusSemanticAttribution, recordReleaseSemanticAttribution, resolveSemanticLineageIds, semanticAttributionAffinity, } from "./context/semantic-session-attribution.js";
11
+ export { explainSourceTraceability, parseSourceLineRange, } from "./traceability/source-traceability.js";
12
+ export { analyzeAgentProvenanceDescriptorCoverage, evaluateSemanticAttributionCoverage, groupHistoryByEpisode, resolveHistoryEpisodeGroupIdentity, summarizeAgentProvenance, summarizeAgentModelProvenance, } from "./provenance.js";
11
13
  export { analyzeSdkCliParameterCompleteness, } from "./cli-contracts.js";
12
14
  //# sourceMappingURL=core-governance.js.map
13
- //# debugId=7442357d-52b9-5461-9ac4-3acd898334da
15
+ //# debugId=d19cfa31-a02f-53a7-8685-5d169d6e051d
@@ -3,9 +3,10 @@
3
3
  *
4
4
  * Provides the stable item lifecycle client and universal project data types.
5
5
  */
6
- export { BASELINE_ITEM_FORMAT_VERSION, BUILTIN_ITEM_TYPE_VALUES, CONFIDENCE_TEXT_VALUES, CURRENT_ITEM_FORMAT_VERSION, DEPENDENCY_KIND_VALUES, EXIT_CODE, ISSUE_SEVERITY_VALUES, ITEM_TYPE_VALUES, PM_CLI_EXPECTED_ERROR_NAME, PmCliError, PmClient, RISK_VALUES, STATUS_VALUES, canonicalDocument, classifyItemFormatVersion, createPmCliExpectedError, effectiveItemFormatVersion, emptyImportedDocument, isPmCliExpectedError, normalizeItemFormatVersion, normalizeItemId, normalizeStatusInput, nowIso, runAction, serializeItemDocument, aggregate, append, claim, claimNext, close, comments, context, copy, create, deleteItem, deps, docs, files, filesDiscover, focus, get, graph, learnings, list, next, notes, release, restore, search, update, type AggregateOptions, type AggregateResult, type AggregateRow, type AppendCommandOptions, type AppendResult, type ClaimNextOptions, type ClaimResult, type CloseResult, type CommentsCommandOptions, type CommentsResult, type ContextOptions, type ContextResult, type CopyResult, type CreateResult, type Dependency, type DeleteResult, type DepsCommandOptions, type DepsResult, type DocsCommandOptions, type DocsResult, type FilesCommandOptions, type FilesDiscoverOptions, type FilesDiscoverResult, type FilesResult, type FocusResult, type GetOptions, type GetResult, type ItemFormatVersionScanEntry, type ItemFormatVersionScanResult, type ItemFormatVersionStatus, type LearningsCommandOptions, type LearningsResult, type ListOptions, type ListResult, type NextOptions, type NextResult, type NotesCommandOptions, type NotesResult, type PmActionInput, type PmActionName, type PmActionOptions, type PmClientOptions, type ReleaseResult, type RestoreResult, type SearchOptions, type SearchResult, type UpdateResult, } from "./runtime.js";
6
+ export { BASELINE_ITEM_FORMAT_VERSION, BUILTIN_ITEM_TYPE_VALUES, CONFIDENCE_TEXT_VALUES, CURRENT_ITEM_FORMAT_VERSION, DEPENDENCY_KIND_VALUES, EXIT_CODE, ISSUE_SEVERITY_VALUES, ITEM_TYPE_VALUES, PM_CLI_EXPECTED_ERROR_NAME, PmCliError, PmClient, RISK_VALUES, STATUS_VALUES, canonicalDocument, classifyItemFormatVersion, createPmCliExpectedError, effectiveItemFormatVersion, emptyImportedDocument, isPmCliExpectedError, normalizeItemFormatVersion, normalizeItemId, normalizeStatusInput, nowIso, runAction, serializeItemDocument, aggregate, append, claim, claimNext, close, comments, context, copy, create, deleteItem, deps, docs, files, filesDiscover, focus, get, graph, learnings, list, next, notes, release, restore, search, update, type AggregateOptions, type AggregateResult, type AggregateRow, type AssuranceActionInput, type AssuranceActionResult, type AppendCommandOptions, type AppendResult, type ClaimNextOptions, type ClaimResult, type CloseResult, type CommentsCommandOptions, type CommentsResult, type ContextOptions, type ContextResult, type CopyResult, type CreateResult, type Dependency, type DeleteResult, type DepsCommandOptions, type DepsResult, type DocsCommandOptions, type DocsResult, type FilesCommandOptions, type FilesDiscoverOptions, type FilesDiscoverResult, type FilesResult, type FocusResult, type GetOptions, type GetResult, type ItemFormatVersionScanEntry, type ItemFormatVersionScanResult, type ItemFormatVersionStatus, type LearningsCommandOptions, type LearningsResult, type ListOptions, type ListResult, type NextOptions, type NextResult, type NotesCommandOptions, type NotesResult, type PmActionInput, type PmActionName, type PmActionOptions, type PmClientOptions, type ReleaseResult, type RestoreResult, type SearchOptions, type SearchResult, type UpdateResult, } from "./runtime.js";
7
7
  export * from "./core-governance.js";
8
8
  export * from "./agent-session-context.js";
9
+ export { isAlreadyClaimedError } from "./lifecycle/claim.js";
9
10
  export { PM_READ_OUTPUT_DIMENSIONS, PM_READ_OUTPUT_OPTION_FLAGS, PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS, PM_READ_OUTPUT_SURFACE_CONTRACTS, applyReadOutputDimensions, isReadOutputBudgetExceeded, resolveReadOutputDimensions, resolveReadOutputEncoding, resolveReadOutputSurface, validateReadOutputOptions, } from "./read-output-contracts.js";
10
11
  export { applyReadOutputSessionReferences, attachReadOutputSessionReceipt, parseReadOutputSession, readOutputSessionRemainingTokens, } from "./read-output-session.js";
11
12
  export type { PmReadOutputBudgetExceeded, PmReadOutputDimension, PmReadOutputLegacyAlias, PmReadOutputOptions, PmReadOutputReceipt, PmReadOutputResult, PmReadOutputResultFor, PmReadOutputSurface, PmReadOutputSurfaceContract, } from "./read-output-contracts.js";
package/dist/sdk/core.js CHANGED
@@ -4,11 +4,12 @@
4
4
  * Provides the stable item lifecycle client and universal project data types.
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]="54d31df7-e708-585d-9fb2-3c5ddfcc6138")}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]="2e0a2422-64c7-5ad3-867c-04479171fa27")}catch(e){}}();
8
8
  export { BASELINE_ITEM_FORMAT_VERSION, BUILTIN_ITEM_TYPE_VALUES, CONFIDENCE_TEXT_VALUES, CURRENT_ITEM_FORMAT_VERSION, DEPENDENCY_KIND_VALUES, EXIT_CODE, ISSUE_SEVERITY_VALUES, ITEM_TYPE_VALUES, PM_CLI_EXPECTED_ERROR_NAME, PmCliError, PmClient, RISK_VALUES, STATUS_VALUES, canonicalDocument, classifyItemFormatVersion, createPmCliExpectedError, effectiveItemFormatVersion, emptyImportedDocument, isPmCliExpectedError, normalizeItemFormatVersion, normalizeItemId, normalizeStatusInput, nowIso, runAction, serializeItemDocument, aggregate, append, claim, claimNext, close, comments, context, copy, create, deleteItem, deps, docs, files, filesDiscover, focus, get, graph, learnings, list, next, notes, release, restore, search, update, } from "./runtime.js";
9
9
  export * from "./core-governance.js";
10
10
  export * from "./agent-session-context.js";
11
+ export { isAlreadyClaimedError } from "./lifecycle/claim.js";
11
12
  export { PM_READ_OUTPUT_DIMENSIONS, PM_READ_OUTPUT_OPTION_FLAGS, PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS, PM_READ_OUTPUT_SURFACE_CONTRACTS, applyReadOutputDimensions, isReadOutputBudgetExceeded, resolveReadOutputDimensions, resolveReadOutputEncoding, resolveReadOutputSurface, validateReadOutputOptions, } from "./read-output-contracts.js";
12
13
  export { applyReadOutputSessionReferences, attachReadOutputSessionReceipt, parseReadOutputSession, readOutputSessionRemainingTokens, } from "./read-output-session.js";
13
14
  //# sourceMappingURL=core.js.map
14
- //# debugId=54d31df7-e708-585d-9fb2-3c5ddfcc6138
15
+ //# debugId=2e0a2422-64c7-5ad3-867c-04479171fa27
@@ -8,6 +8,17 @@
8
8
  export type PmErrorCodeStability = "provisional" | "stable";
9
9
  /** Semantic process-exit class shared by shell and SDK consumers. */
10
10
  export type PmErrorCodeClass = "generic_failure" | "usage" | "not_found" | "conflict" | "dependency_failed";
11
+ /** One externally observable refusal state and its executable entrypoint probe. */
12
+ export interface PmRefusalStateContract {
13
+ /** Stable semantic state owned by the error code. */
14
+ state: string;
15
+ /** Stable probe identifier implemented by the entrypoint conformance suite. */
16
+ probe_id: string;
17
+ /** Public command roots through which the state must remain reachable. */
18
+ entrypoints: string[];
19
+ /** Exit class expected when the probe reaches the state. */
20
+ expected_exit_class: PmErrorCodeClass;
21
+ }
11
22
  /** Stable shell exit-code taxonomy shared by every structured error. */
12
23
  export declare const PM_ERROR_CODE_EXIT_CLASS_CONTRACTS: readonly [{
13
24
  readonly exit_code: 1;
@@ -47,6 +58,8 @@ export interface PmErrorCodeContract {
47
58
  canonical_code?: string;
48
59
  /** Stable compatibility spellings that resolve to this canonical code. */
49
60
  aliases?: string[];
61
+ /** Observable states this code claims, each backed by a real-entrypoint probe. */
62
+ owned_states?: PmRefusalStateContract[];
50
63
  }
51
64
  /** Validate, normalize, sort, and freeze an error-code catalog. */
52
65
  export declare function definePmErrorCodeCatalog(declarations: readonly PmErrorCodeContract[]): readonly PmErrorCodeContract[];
@@ -6,7 +6,7 @@
6
6
  */
7
7
  /** Stable shell exit-code taxonomy shared by every structured error. */
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]="393243a5-dd90-52c1-a9c1-588fd33f8b6a")}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]="c76fa303-6672-5c1e-9cf5-3a08bd3a7814")}catch(e){}}();
10
10
  export const PM_ERROR_CODE_EXIT_CLASS_CONTRACTS = [
11
11
  { exit_code: 1, class: "generic_failure" },
12
12
  { exit_code: 2, class: "usage" },
@@ -21,6 +21,34 @@ function normalizeContractList(values) {
21
21
  ...new Set(values.map((value) => value.trim()).filter(Boolean)),
22
22
  ].sort();
23
23
  }
24
+ function normalizeOwnedStates(states) {
25
+ if (!states)
26
+ return [];
27
+ const seenStates = new Set();
28
+ const seenProbes = new Set();
29
+ return states
30
+ .map((state) => {
31
+ const normalizedState = state.state.trim();
32
+ const probeId = state.probe_id.trim();
33
+ const entrypoints = normalizeContractList(state.entrypoints);
34
+ if (!/^[a-z][a-z0-9_]*$/.test(normalizedState) ||
35
+ !/^[a-z][a-z0-9-]*$/.test(probeId) ||
36
+ entrypoints.length === 0 ||
37
+ seenStates.has(normalizedState) ||
38
+ seenProbes.has(probeId)) {
39
+ throw new TypeError("Invalid pm refusal state contract");
40
+ }
41
+ seenStates.add(normalizedState);
42
+ seenProbes.add(probeId);
43
+ return {
44
+ state: normalizedState,
45
+ probe_id: probeId,
46
+ entrypoints,
47
+ expected_exit_class: state.expected_exit_class,
48
+ };
49
+ })
50
+ .sort((left, right) => left.state.localeCompare(right.state));
51
+ }
24
52
  function isValidNormalizedErrorCodeContract(declaration, sources, emittingCommands, canonicalCode, aliases) {
25
53
  return ![
26
54
  [1, 2, 3, 4, 5].includes(declaration.exit_code),
@@ -86,9 +114,13 @@ export function definePmErrorCodeCatalog(declarations) {
86
114
  const emittingCommands = normalizeContractList(declaration.emitting_commands);
87
115
  const canonicalCode = (declaration.canonical_code ?? code).trim();
88
116
  const aliases = normalizeContractList(declaration.aliases ?? []);
117
+ const ownedStates = normalizeOwnedStates(declaration.owned_states);
89
118
  if (!isValidNormalizedErrorCodeContract(declaration, sources, emittingCommands, canonicalCode, aliases)) {
90
119
  throw new TypeError(`Invalid pm error code contract: ${code}`);
91
120
  }
121
+ if (ownedStates.some((state) => state.expected_exit_class !== declaration.class)) {
122
+ throw new TypeError(`Invalid pm refusal state exit class: ${code}`);
123
+ }
92
124
  return Object.freeze({
93
125
  ...declaration,
94
126
  code,
@@ -98,6 +130,7 @@ export function definePmErrorCodeCatalog(declarations) {
98
130
  emitting_commands: emittingCommands,
99
131
  canonical_code: canonicalCode,
100
132
  aliases,
133
+ owned_states: ownedStates,
101
134
  });
102
135
  });
103
136
  validateErrorCodeAliases(normalized);
@@ -118,4 +151,4 @@ export function resolvePmErrorCodeContract(code, catalog) {
118
151
  return contract;
119
152
  }
120
153
  //# sourceMappingURL=error-code-catalog.js.map
121
- //# debugId=393243a5-dd90-52c1-a9c1-588fd33f8b6a
154
+ //# debugId=c76fa303-6672-5c1e-9cf5-3a08bd3a7814