@unbrained/pm-cli 2026.8.14 → 2026.8.15

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 (145) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +25 -2
  3. package/dist/cli/commander-usage.js +17 -4
  4. package/dist/cli/error-guidance.d.ts +2 -0
  5. package/dist/cli/error-guidance.js +52 -25
  6. package/dist/cli/main.js +3 -2
  7. package/dist/cli/register-mutation.js +4 -2
  8. package/dist/cli/register-operations.js +5 -5
  9. package/dist/cli-bundle/bundle-manifest.json +150 -150
  10. package/dist/cli-bundle/chunks/{chunk-TXMEUUUY.js → chunk-24GAV7XL.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-TMJ7URWS.js → chunk-AIM6VT2N.js} +9 -9
  12. package/dist/cli-bundle/chunks/chunk-DSWDLTDR.js +197 -0
  13. package/dist/cli-bundle/chunks/{chunk-FIW4P64F.js → chunk-J42EGKDK.js} +2 -2
  14. package/dist/cli-bundle/chunks/chunk-KIEGUBYQ.js +2 -0
  15. package/dist/cli-bundle/chunks/{chunk-SBRKH6OR.js → chunk-KLKYLSDX.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-G5JUB66K.js → chunk-LJHOAVGI.js} +59 -59
  17. package/dist/cli-bundle/chunks/{chunk-BFALV3YP.js → chunk-MEM2ZS3O.js} +2 -2
  18. package/dist/cli-bundle/chunks/chunk-QHPCJWEJ.js +35 -0
  19. package/dist/cli-bundle/chunks/{chunk-XAVMOK6B.js → chunk-WLPDLNEZ.js} +2 -2
  20. package/dist/cli-bundle/chunks/{register-list-query-T3EHHNNV.js → register-list-query-CT3LFDDN.js} +2 -2
  21. package/dist/cli-bundle/chunks/{register-mutation-E27WCLSZ.js → register-mutation-NWEVA5YS.js} +3 -3
  22. package/dist/cli-bundle/chunks/register-operations-AHIAG5KM.js +2 -0
  23. package/dist/cli-bundle/chunks/{register-setup-3YXZ444E.js → register-setup-ZJZFVAKE.js} +2 -2
  24. package/dist/cli-bundle/focused-chunks/chunk-4X57RE4U.js +2 -0
  25. package/dist/cli-bundle/focused-chunks/{chunk-XDNAW5OI.js → chunk-6XKF3PGV.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/chunk-7NJ4QYQ2.js +2 -0
  27. package/dist/cli-bundle/focused-chunks/{chunk-WCVE2NIG.js → chunk-EXZA4257.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/chunk-ITAUHSO6.js +50 -0
  29. package/dist/cli-bundle/focused-chunks/{chunk-4DQ2YERC.js → chunk-KLVUMNXJ.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-K7RWWOAG.js → chunk-KT5XMYSX.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-PPFGQDSI.js → chunk-KTKH4IMG.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/chunk-M67F5AIN.js +8 -0
  33. package/dist/cli-bundle/focused-chunks/{chunk-KSEDUWVZ.js → chunk-NSPYTG6G.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/chunk-OKA6ELTL.js +2 -0
  35. package/dist/cli-bundle/focused-chunks/chunk-PUISBOPP.js +2 -0
  36. package/dist/cli-bundle/focused-chunks/chunk-QLNMCESQ.js +155 -0
  37. package/dist/cli-bundle/focused-chunks/{chunk-LZ4MV3RH.js → chunk-SLKC6QLJ.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/chunk-U65UC4G3.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/{chunk-KFSZ3BP6.js → chunk-WTSER4WJ.js} +6 -6
  40. package/dist/cli-bundle/focused-chunks/{chunk-YOOI3UZX.js → chunk-ZMFXQ7VF.js} +2 -2
  41. package/dist/cli-bundle/main.js +13 -13
  42. package/dist/cli-bundle/sdk-authoring.js +1 -1
  43. package/dist/cli-bundle/sdk-contracts.js +1 -1
  44. package/dist/cli-bundle/sdk-core.js +32 -35
  45. package/dist/cli-bundle/sdk-governance.js +1 -1
  46. package/dist/cli-bundle/sdk-graph.js +1 -1
  47. package/dist/cli-bundle/sdk-merge.js +32 -31
  48. package/dist/cli-bundle/sdk-query.js +1 -1
  49. package/dist/cli-bundle/sdk-runtime.js +1 -1
  50. package/dist/cli-bundle/sdk-testing.js +1 -1
  51. package/dist/cli-bundle/sdk.js +2 -2
  52. package/dist/core/diagnostics/remediation.js +7 -2
  53. package/dist/core/extensions/reserved-host-flags.js +3 -2
  54. package/dist/core/history/replay.d.ts +14 -1
  55. package/dist/core/history/replay.js +45 -8
  56. package/dist/core/output/output.d.ts +2 -0
  57. package/dist/core/output/output.js +3 -2
  58. package/dist/core/shared/command-types.d.ts +2 -0
  59. package/dist/core/shared/command-types.js +2 -2
  60. package/dist/core/shared/errors.d.ts +12 -0
  61. package/dist/core/shared/errors.js +2 -2
  62. package/dist/mcp/tool-definitions.js +9 -5
  63. package/dist/sdk/agent/refusal-reachability.d.ts +61 -0
  64. package/dist/sdk/agent/refusal-reachability.js +91 -3
  65. package/dist/sdk/cli-bootstrap.d.ts +2 -0
  66. package/dist/sdk/cli-bootstrap.js +7 -2
  67. package/dist/sdk/cli-contracts/completeness.js +3 -2
  68. package/dist/sdk/cli-contracts/flag-contracts.js +3 -2
  69. package/dist/sdk/cli-contracts/registration-helpers.js +3 -2
  70. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +5 -0
  71. package/dist/sdk/cli-contracts/runtime-contracts.js +23 -7
  72. package/dist/sdk/cli-contracts/tool-parameter-tables.js +15 -5
  73. package/dist/sdk/cli-contracts/tool-schema.js +10 -3
  74. package/dist/sdk/cli-program.js +3 -2
  75. package/dist/sdk/core.d.ts +2 -2
  76. package/dist/sdk/core.js +3 -3
  77. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +26 -2
  78. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +50 -26
  79. package/dist/sdk/governance/assurance-action.d.ts +7 -1
  80. package/dist/sdk/governance/assurance-action.js +7 -6
  81. package/dist/sdk/governance/assurance-mutation-error.d.ts +42 -1
  82. package/dist/sdk/governance/assurance-mutation-error.js +27 -3
  83. package/dist/sdk/governance/assurance-runtime.js +12 -11
  84. package/dist/sdk/governance/assurance.d.ts +9 -0
  85. package/dist/sdk/governance/assurance.js +80 -14
  86. package/dist/sdk/governance/extension-host-version.d.ts +25 -0
  87. package/dist/sdk/governance/extension-host-version.js +105 -0
  88. package/dist/sdk/governance/health.d.ts +32 -1
  89. package/dist/sdk/governance/health.js +119 -27
  90. package/dist/sdk/governance/provenance-health.d.ts +27 -0
  91. package/dist/sdk/governance/provenance-health.js +95 -3
  92. package/dist/sdk/governance/validate.js +7 -8
  93. package/dist/sdk/governance.d.ts +6 -0
  94. package/dist/sdk/governance.js +8 -2
  95. package/dist/sdk/history-repair.d.ts +13 -1
  96. package/dist/sdk/history-repair.js +62 -18
  97. package/dist/sdk/linked-artifacts.js +16 -5
  98. package/dist/sdk/pagination.d.ts +15 -0
  99. package/dist/sdk/pagination.js +9 -5
  100. package/dist/sdk/query/context.d.ts +5 -1
  101. package/dist/sdk/query/context.js +14 -5
  102. package/dist/sdk/read-output/continuation.d.ts +11 -0
  103. package/dist/sdk/read-output/continuation.js +132 -0
  104. package/dist/sdk/read-output-budget.d.ts +1 -1
  105. package/dist/sdk/read-output-budget.js +14 -10
  106. package/dist/sdk/read-output-contracts.d.ts +66 -2
  107. package/dist/sdk/read-output-contracts.js +183 -19
  108. package/dist/sdk/read-output-rows.d.ts +2 -0
  109. package/dist/sdk/read-output-rows.js +15 -2
  110. package/dist/sdk/runtime-input.js +4 -2
  111. package/docs/ASSURANCE.md +59 -2
  112. package/docs/COMMANDS.md +8 -2
  113. package/docs/READ_OUTPUT_CONTRACTS.md +49 -8
  114. package/docs/RELEASING.md +42 -5
  115. package/docs/SDK_CONTEXT_INTEGRITY.md +64 -2
  116. package/marketplace.json +2 -2
  117. package/package.json +3 -3
  118. package/packages/pm-beads/package.json +1 -1
  119. package/packages/pm-calendar/package.json +1 -1
  120. package/packages/pm-command-kit/package.json +1 -1
  121. package/packages/pm-digital-twin/package.json +1 -1
  122. package/packages/pm-governance-audit/package.json +1 -1
  123. package/packages/pm-guide-shell/package.json +1 -1
  124. package/packages/pm-kanban/package.json +1 -1
  125. package/packages/pm-lifecycle-hooks/package.json +1 -1
  126. package/packages/pm-linked-test-adapters/package.json +1 -1
  127. package/packages/pm-search-advanced/package.json +1 -1
  128. package/packages/pm-templates/package.json +1 -1
  129. package/packages/pm-todos/package.json +1 -1
  130. package/packages/pm-vcs/package.json +1 -1
  131. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  132. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  133. package/sdk/public-surface.json +1133 -187
  134. package/dist/cli-bundle/chunks/chunk-BBOFSVAK.js +0 -197
  135. package/dist/cli-bundle/chunks/chunk-YAMTJL6Y.js +0 -34
  136. package/dist/cli-bundle/chunks/chunk-YSVSMJ2B.js +0 -2
  137. package/dist/cli-bundle/chunks/register-operations-4R6I7CPY.js +0 -2
  138. package/dist/cli-bundle/focused-chunks/chunk-F43TT2QQ.js +0 -8
  139. package/dist/cli-bundle/focused-chunks/chunk-KYUQGTSB.js +0 -2
  140. package/dist/cli-bundle/focused-chunks/chunk-PGXJQLCT.js +0 -155
  141. package/dist/cli-bundle/focused-chunks/chunk-Q4YY3XNF.js +0 -2
  142. package/dist/cli-bundle/focused-chunks/chunk-QK753U3U.js +0 -46
  143. package/dist/cli-bundle/focused-chunks/chunk-QUMB2J27.js +0 -2
  144. package/dist/cli-bundle/focused-chunks/chunk-SM7MTG27.js +0 -2
  145. package/dist/cli-bundle/focused-chunks/chunk-ZM6TZVHC.js +0 -2
@@ -4,7 +4,7 @@
4
4
  * Implements append-only history and replay behavior for Replay.
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]="a1283470-00c7-5e91-8676-e1c1a667537f")}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]="0c37a722-fda7-523e-991c-f8abfb7a1495")}catch(e){}}();
8
8
  import jsonPatch from "fast-json-patch";
9
9
  import { ITEM_METADATA_KEY_ORDER } from "../shared/constants.js";
10
10
  import { canonicalDocument } from "../item/item-format.js";
@@ -219,8 +219,35 @@ export function lenientApplyReplayPatch(current, patch) {
219
219
  };
220
220
  return { document, convertedReplaceToAdd, skippedOps };
221
221
  }
222
+ /**
223
+ * Resolve the hash epoch a repair must retain.
224
+ *
225
+ * A valid stream is authoritative even when legacy entries omit the version
226
+ * field. For a broken stream, one consistent explicit epoch remains
227
+ * authoritative; fully implicit legacy streams stay on epoch 1. Only an
228
+ * irreconcilably mixed stream falls forward to the current epoch.
229
+ */
230
+ export function resolveHistoryRepairItemHashVersion(entries) {
231
+ const verified = verifyHistoryChainWithVersion(entries);
232
+ if (verified.ok && verified.item_hash_version !== undefined) {
233
+ return verified.item_hash_version;
234
+ }
235
+ const explicitVersions = [
236
+ ...new Set(entries
237
+ .map((entry) => entry.item_hash_version)
238
+ .filter((version) => version !== undefined &&
239
+ SUPPORTED_HISTORY_ITEM_HASH_VERSIONS.includes(version))),
240
+ ];
241
+ if (explicitVersions.length === 1) {
242
+ return explicitVersions[0];
243
+ }
244
+ if (explicitVersions.length === 0) {
245
+ return 1;
246
+ }
247
+ return CURRENT_HISTORY_ITEM_HASH_VERSION;
248
+ }
222
249
  /** Re-anchor a drifted history chain: replay every entry from empty, recompute the before/after hashes, and only rewrite a patch when the original op set no longer strictly applies (legacy drift). Clean entries keep their patch verbatim so the on-disk diff stays minimal. The returned chain verifies via verifyHistoryChain. */
223
- export function reanchorHistoryEntries(entries) {
250
+ export function reanchorHistoryEntries(entries, itemHashVersion = resolveHistoryRepairItemHashVersion(entries)) {
224
251
  const unsupportedIndex = entries.findIndex((entry) => entry.item_hash_version !== undefined &&
225
252
  !SUPPORTED_HISTORY_ITEM_HASH_VERSIONS.includes(entry.item_hash_version));
226
253
  if (unsupportedIndex >= 0) {
@@ -233,9 +260,11 @@ export function reanchorHistoryEntries(entries) {
233
260
  let entriesPatchRepaired = 0;
234
261
  let convertedReplaceToAdd = 0;
235
262
  let skippedOps = 0;
263
+ const explicitItemHashVersion = itemHashVersion !== 1 ||
264
+ entries.some((entry) => entry.item_hash_version !== undefined);
236
265
  for (let index = 0; index < entries.length; index += 1) {
237
266
  const entry = entries[index];
238
- const beforeHash = replayHash(replay, CURRENT_HISTORY_ITEM_HASH_VERSION);
267
+ const beforeHash = replayHash(replay, itemHashVersion);
239
268
  const strict = tryApplyReplayPatch(replay, entry.patch);
240
269
  let next;
241
270
  let outPatch;
@@ -257,18 +286,24 @@ export function reanchorHistoryEntries(entries) {
257
286
  skippedOps += entrySkipped;
258
287
  entriesPatchRepaired += 1;
259
288
  }
260
- const afterHash = replayHash(next, CURRENT_HISTORY_ITEM_HASH_VERSION);
289
+ const afterHash = replayHash(next, itemHashVersion);
261
290
  const rehashed = beforeHash !== entry.before_hash || afterHash !== entry.after_hash;
262
291
  if (rehashed) {
263
292
  entriesRehashed += 1;
264
293
  }
265
- rewritten.push({
294
+ const rewrittenEntry = {
266
295
  ...entry,
267
296
  patch: outPatch,
268
297
  before_hash: beforeHash,
269
298
  after_hash: afterHash,
270
- item_hash_version: CURRENT_HISTORY_ITEM_HASH_VERSION,
271
- });
299
+ };
300
+ if (explicitItemHashVersion) {
301
+ rewrittenEntry.item_hash_version = itemHashVersion;
302
+ }
303
+ else {
304
+ delete rewrittenEntry.item_hash_version;
305
+ }
306
+ rewritten.push(rewrittenEntry);
272
307
  details.push({
273
308
  index: index + 1,
274
309
  rehashed,
@@ -286,6 +321,8 @@ export function reanchorHistoryEntries(entries) {
286
321
  convertedReplaceToAdd,
287
322
  skippedOps,
288
323
  details,
324
+ itemHashVersion,
325
+ explicitItemHashVersion,
289
326
  };
290
327
  }
291
328
  /** Implements history entries to raw for the public runtime surface of this module. */
@@ -296,4 +333,4 @@ export function historyEntriesToRaw(entries) {
296
333
  return `${entries.map((entry) => JSON.stringify(entry)).join("\n")}\n`;
297
334
  }
298
335
  //# sourceMappingURL=replay.js.map
299
- //# debugId=a1283470-00c7-5e91-8676-e1c1a667537f
336
+ //# debugId=0c37a722-fda7-523e-991c-f8abfb7a1495
@@ -24,6 +24,8 @@ export interface OutputOptions {
24
24
  outputFormat?: "toon" | "json";
25
25
  /** Caller-carried cross-call budget and served-item state. */
26
26
  outputSession?: string;
27
+ /** Opaque budget-compaction continuation cursor. */
28
+ outputCursor?: string;
27
29
  /** Include machine-readable row location and row-encoding metadata. */
28
30
  outputRowContract?: boolean;
29
31
  /** Fallback output format used when callers do not provide an override. */
@@ -4,7 +4,7 @@
4
4
  * Formats compact human and machine output for Output.
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]="88eb8f29-72a2-536f-8fc9-394ed3e0e0fb")}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]="bccd5918-1a51-5258-8d66-1960c51523cf")}catch(e){}}();
8
8
  import { getActiveCommandContext, runActiveCommandOverride, runActiveRendererOverride, runActiveServiceOverrideSync, setActiveCommandResult, } from "../extensions/index.js";
9
9
  import { EXIT_CODE } from "../shared/constants.js";
10
10
  import { isHostOutputSuppressed } from "./output-control.js";
@@ -366,6 +366,7 @@ function formatEffectiveOutput(effectiveResult, nativeOutput, options) {
366
366
  ["outputBudget", options.outputBudget],
367
367
  ["outputFormat", options.outputFormat],
368
368
  ["outputSession", options.outputSession],
369
+ ["outputCursor", options.outputCursor],
369
370
  ["outputRowContract", options.outputRowContract],
370
371
  ].filter((entry) => entry[1] !== undefined)),
371
372
  };
@@ -464,4 +465,4 @@ export const outputTestOnly = {
464
465
  renderToonValue,
465
466
  };
466
467
  //# sourceMappingURL=output.js.map
467
- //# debugId=88eb8f29-72a2-536f-8fc9-394ed3e0e0fb
468
+ //# debugId=bccd5918-1a51-5258-8d66-1960c51523cf
@@ -29,6 +29,8 @@ export interface GlobalOptions {
29
29
  outputFormat?: "toon" | "json";
30
30
  /** Caller-carried cross-call budget and served-item state. */
31
31
  outputSession?: string;
32
+ /** Opaque budget-compaction continuation cursor. */
33
+ outputCursor?: string;
32
34
  /** Include the machine-readable row selector and TOON encoding contract. */
33
35
  outputRowContract?: boolean;
34
36
  /** Filesystem path used for path resolution. */
@@ -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]="044af354-3047-5fd4-ae65-458a259dedca")}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]="525dce5a-3824-5c45-aa61-bd8b132bd973")}catch(e){}}();
3
3
  export {};
4
4
  //# sourceMappingURL=command-types.js.map
5
- //# debugId=044af354-3047-5fd4-ae65-458a259dedca
5
+ //# debugId=525dce5a-3824-5c45-aa61-bd8b132bd973
@@ -32,6 +32,8 @@ export interface PmCliErrorRecoveryPayload {
32
32
  candidate_commands_total?: number;
33
33
  /** Whether additional accepting command paths were omitted from this payload. */
34
34
  candidate_commands_truncated?: boolean;
35
+ /** Declared lexicon membership of an option rejected by the attempted path. */
36
+ option_scope?: "declared_on_path" | "declared_elsewhere" | "declared_nowhere";
35
37
  /** Value that configures or reports suggested retry for this contract. */
36
38
  suggested_retry?: string;
37
39
  /** Elapsed time in milliseconds for retry after. */
@@ -53,6 +55,16 @@ export interface PmCliErrorContext {
53
55
  reason?: string;
54
56
  /** Metadata field responsible for a validation failure, when known. */
55
57
  field?: string;
58
+ /** Assurance gate whose evaluation was refused, when known. */
59
+ gate_id?: string;
60
+ /** Assurance assertion whose evaluation was refused, when known. */
61
+ assertion_id?: string;
62
+ /** Assurance measurement whose source could not resolve, when known. */
63
+ measurement_id?: string;
64
+ /** Assurance measurement source kind involved in a refusal, when known. */
65
+ source_kind?: string;
66
+ /** Validate or health check selected by an assurance source, when known. */
67
+ check?: string;
56
68
  /** Serialization format involved in a parse failure. */
57
69
  format?: string;
58
70
  /** Item format version involved in a compatibility failure. */
@@ -1,6 +1,6 @@
1
1
  /** Implements the exported pm cli error runtime abstraction for core/shared/errors.ts. */
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]="62fb0ba7-643f-5b33-870b-df875559610a")}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]="d1a7b5e2-0915-5f00-8b5a-38af814e1ea1")}catch(e){}}();
4
4
  export class PmCliError extends Error {
5
5
  /** Value that configures or reports exit code for this contract. */
6
6
  exitCode;
@@ -18,4 +18,4 @@ export class PmCliError extends Error {
18
18
  }
19
19
  }
20
20
  //# sourceMappingURL=errors.js.map
21
- //# debugId=62fb0ba7-643f-5b33-870b-df875559610a
21
+ //# debugId=d1a7b5e2-0915-5f00-8b5a-38af814e1ea1
@@ -4,7 +4,7 @@
4
4
  * Defines the Tool Definitions module for pm CLI source.
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]="cde81c26-97fa-5236-b807-e944ba4af321")}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]="d440a41a-ae54-55fd-b939-5404a1edcdd7")}catch(e){}}();
8
8
  import { GRAPH_SUBCOMMAND_VALUES, PM_TOOL_ACTIONS, } from "../sdk/cli-contracts/enum-contracts.js";
9
9
  import { buildPmActionToolInputSchema } from "../sdk/cli-contracts/tool-schema.js";
10
10
  import { RUNTIME_STATUS_ROLE_VALUES } from "../types.js";
@@ -20,9 +20,8 @@ const READ_OUTPUT_TOOL_PROPERTIES = {
20
20
  description: "Universal read row ceiling, or unbounded to disable the shared ceiling.",
21
21
  },
22
22
  outputBudget: {
23
- type: "integer",
24
- minimum: 1,
25
- description: "Universal estimated-token ceiling for a read result.",
23
+ anyOf: [{ type: "integer", minimum: 1 }, { const: "unbounded" }],
24
+ description: "Universal estimated-token ceiling, or unbounded to return the complete read result.",
26
25
  },
27
26
  outputFormat: {
28
27
  type: "string",
@@ -32,6 +31,11 @@ const READ_OUTPUT_TOOL_PROPERTIES = {
32
31
  outputSession: {
33
32
  ...CANONICAL_OUTPUT_SESSION_TOOL_PROPERTY,
34
33
  },
34
+ outputCursor: {
35
+ type: "string",
36
+ minLength: 1,
37
+ description: "Opaque continuation cursor returned after budget compaction of a declared row collection.",
38
+ },
35
39
  };
36
40
  /** MCP transport parameters layered over every canonical action schema. */
37
41
  export const TOOL_SCHEMA_BASE = {
@@ -739,4 +743,4 @@ export function buildMcpToolContracts() {
739
743
  }).sort((left, right) => left.name.localeCompare(right.name));
740
744
  }
741
745
  //# sourceMappingURL=tool-definitions.js.map
742
- //# debugId=cde81c26-97fa-5236-b807-e944ba4af321
746
+ //# debugId=d440a41a-ae54-55fd-b939-5404a1edcdd7
@@ -36,5 +36,66 @@ export interface PmRefusalReachabilityReport {
36
36
  /** Stable, sorted conformance findings. */
37
37
  findings: PmRefusalReachabilityFinding[];
38
38
  }
39
+ /** Recovery-reference kinds emitted by structured refusal envelopes. */
40
+ export declare const PM_RECOVERY_REFERENCE_KINDS: readonly ["suggested_retry", "candidate_command", "example", "next_step"];
41
+ /** Recovery-reference kind emitted by a refusal. */
42
+ export type PmRecoveryReferenceKind = (typeof PM_RECOVERY_REFERENCE_KINDS)[number];
43
+ /** One derived promise that another invocation or command path is reachable. */
44
+ export interface PmRecoveryReferenceObligation {
45
+ /** Stable reference identifier derived from its emitting envelope. */
46
+ id: string;
47
+ /** Refusal probe that emitted the reference. */
48
+ probe_id: string;
49
+ /** Typed recovery vocabulary rather than prose inference. */
50
+ kind: PmRecoveryReferenceKind;
51
+ /** Exact emitted command or recovery text. */
52
+ value: string;
53
+ }
54
+ /** Result of executing or resolving one derived recovery obligation. */
55
+ export interface PmRecoveryReferenceObservation {
56
+ /** Stable obligation identifier. */
57
+ id: string;
58
+ /** Whether the promised recovery or command path was reachable. */
59
+ reachable: boolean;
60
+ /** How the promise was discharged. */
61
+ proof: "executed" | "declared_command_path" | "linked_execution";
62
+ }
63
+ /** Coverage totals for one emitted recovery-reference kind. */
64
+ export interface PmRecoveryReferenceKindCoverage {
65
+ /** Typed reference kind. */
66
+ kind: PmRecoveryReferenceKind;
67
+ /** Derived obligations of this kind. */
68
+ declared: number;
69
+ /** Obligations with one observation. */
70
+ observed: number;
71
+ /** Obligations proven reachable. */
72
+ passed: number;
73
+ }
74
+ /** One recovery-reference coverage failure. */
75
+ export interface PmRecoveryReferenceFinding {
76
+ /** Stable finding kind for assurance and CI. */
77
+ kind: "duplicate_obligation" | "duplicate_observation" | "missing_observation" | "unreachable_reference" | "undeclared_observation";
78
+ /** Obligation or observation identifier. */
79
+ reference_id: string;
80
+ /** Human-readable mismatch summary. */
81
+ detail: string;
82
+ }
83
+ /** Complete cross-kind recovery-reference coverage receipt. */
84
+ export interface PmRecoveryReferenceReport {
85
+ /** Whether every derived reference was uniquely proven reachable. */
86
+ ok: boolean;
87
+ /** Total references derived from real refusal envelopes. */
88
+ declared_reference_count: number;
89
+ /** Total reference observations supplied. */
90
+ observed_reference_count: number;
91
+ /** Reachable fraction across the declared obligation set. */
92
+ pass_fraction: number;
93
+ /** Stable coverage buckets, including zero-population kinds. */
94
+ coverage_by_kind: PmRecoveryReferenceKindCoverage[];
95
+ /** Stable, sorted conformance findings. */
96
+ findings: PmRecoveryReferenceFinding[];
97
+ }
39
98
  /** Compare declared refusal states with real-entrypoint observations. */
40
99
  export declare function verifyPmRefusalReachability(catalog: readonly PmErrorCodeContract[], observations: readonly PmRefusalProbeObservation[]): PmRefusalReachabilityReport;
100
+ /** Verify executable and declared-path proof for emitted recovery references. */
101
+ export declare function verifyPmRecoveryReferences(obligations: readonly PmRecoveryReferenceObligation[], observations: readonly PmRecoveryReferenceObservation[]): PmRecoveryReferenceReport;
@@ -1,6 +1,13 @@
1
- /** Compare declared refusal states with real-entrypoint observations. */
1
+ /** Recovery-reference kinds emitted by structured refusal envelopes. */
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]="55318c8e-1fbd-5abd-b18f-f0cc1f81dd5c")}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]="631031be-883f-5a1d-bcb6-498208cf7922")}catch(e){}}();
4
+ export const PM_RECOVERY_REFERENCE_KINDS = [
5
+ "suggested_retry",
6
+ "candidate_command",
7
+ "example",
8
+ "next_step",
9
+ ];
10
+ /** Compare declared refusal states with real-entrypoint observations. */
4
11
  export function verifyPmRefusalReachability(catalog, observations) {
5
12
  const declarations = catalog.flatMap((contract) => (contract.owned_states ?? []).map((state) => ({ contract, state })));
6
13
  const findings = [];
@@ -68,5 +75,86 @@ export function verifyPmRefusalReachability(catalog, observations) {
68
75
  findings,
69
76
  };
70
77
  }
78
+ /** Verify executable and declared-path proof for emitted recovery references. */
79
+ export function verifyPmRecoveryReferences(obligations, observations) {
80
+ const findings = [];
81
+ const declaredIds = new Set();
82
+ const duplicateIds = new Set();
83
+ for (const obligation of obligations) {
84
+ if (declaredIds.has(obligation.id)) {
85
+ duplicateIds.add(obligation.id);
86
+ findings.push({
87
+ kind: "duplicate_obligation",
88
+ reference_id: obligation.id,
89
+ detail: `Recovery obligation ${obligation.id} was declared more than once.`,
90
+ });
91
+ continue;
92
+ }
93
+ declaredIds.add(obligation.id);
94
+ }
95
+ const observationsById = new Map();
96
+ for (const observation of observations) {
97
+ if (observationsById.has(observation.id)) {
98
+ findings.push({
99
+ kind: "duplicate_observation",
100
+ reference_id: observation.id,
101
+ detail: `Recovery reference ${observation.id} was observed more than once.`,
102
+ });
103
+ continue;
104
+ }
105
+ observationsById.set(observation.id, observation);
106
+ if (!declaredIds.has(observation.id)) {
107
+ findings.push({
108
+ kind: "undeclared_observation",
109
+ reference_id: observation.id,
110
+ detail: `Recovery observation ${observation.id} has no emitted obligation.`,
111
+ });
112
+ }
113
+ }
114
+ for (const obligation of obligations) {
115
+ if (duplicateIds.has(obligation.id))
116
+ continue;
117
+ const observation = observationsById.get(obligation.id);
118
+ if (!observation) {
119
+ findings.push({
120
+ kind: "missing_observation",
121
+ reference_id: obligation.id,
122
+ detail: `No reachability proof was recorded for ${obligation.kind} ${obligation.value}.`,
123
+ });
124
+ }
125
+ else if (!observation.reachable) {
126
+ findings.push({
127
+ kind: "unreachable_reference",
128
+ reference_id: obligation.id,
129
+ detail: `Recovery reference ${obligation.value} did not reach its promised target.`,
130
+ });
131
+ }
132
+ }
133
+ const coverageByKind = PM_RECOVERY_REFERENCE_KINDS.map((kind) => {
134
+ const kindObligations = obligations.filter((obligation) => obligation.kind === kind);
135
+ const kindObservations = kindObligations
136
+ .filter((obligation) => !duplicateIds.has(obligation.id))
137
+ .map((obligation) => observationsById.get(obligation.id))
138
+ .filter((observation) => observation !== undefined);
139
+ return {
140
+ kind,
141
+ declared: kindObligations.length,
142
+ observed: kindObservations.length,
143
+ passed: kindObservations.filter(({ reachable }) => reachable).length,
144
+ };
145
+ });
146
+ findings.sort((left, right) => left.reference_id !== right.reference_id
147
+ ? left.reference_id.localeCompare(right.reference_id)
148
+ : left.kind.localeCompare(right.kind));
149
+ const passed = coverageByKind.reduce((total, coverage) => total + coverage.passed, 0);
150
+ return {
151
+ ok: findings.length === 0,
152
+ declared_reference_count: obligations.length,
153
+ observed_reference_count: observations.length,
154
+ pass_fraction: declaredIds.size === 0 ? 1 : passed / declaredIds.size,
155
+ coverage_by_kind: coverageByKind,
156
+ findings,
157
+ };
158
+ }
71
159
  //# sourceMappingURL=refusal-reachability.js.map
72
- //# debugId=55318c8e-1fbd-5abd-b18f-f0cc1f81dd5c
160
+ //# debugId=631031be-883f-5a1d-bcb6-498208cf7922
@@ -31,6 +31,8 @@ export interface BootstrapGlobalOptions {
31
31
  outputFormat?: "toon" | "json";
32
32
  /** Caller-carried cross-call budget and served-item state. */
33
33
  outputSession?: string;
34
+ /** Opaque budget-compaction continuation cursor. */
35
+ outputCursor?: string;
34
36
  /** Whether machine-readable row discovery metadata is requested. */
35
37
  outputRowContract?: boolean;
36
38
  /** Invocation-wide mutation author override. */
@@ -4,7 +4,7 @@
4
4
  * Provides public bootstrap argument normalization for embedded CLI hosts.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7b3209a8-8580-542c-9e80-21d04df3f61f")}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]="eccdb2d2-da6f-555b-ba1b-8339f9b64f1a")}catch(e){}}();
8
8
  import { EXECUTABLE_COMMAND_ALIASES, resolveSubcommandFlagContractsForCommand, } from "./cli-contracts.js";
9
9
  export { EXECUTABLE_COMMAND_ALIASES };
10
10
  import { levenshteinDistanceWithinLimit } from "../core/shared/levenshtein.js";
@@ -20,6 +20,7 @@ const GLOBAL_VALUE_CONSUMING_FLAGS = new Set([
20
20
  "--output-budget",
21
21
  "--output-format",
22
22
  "--output-session",
23
+ "--output-cursor",
23
24
  ]);
24
25
  const OUTPUT_VALUE_FLAGS = new Set([
25
26
  "--output-include",
@@ -27,6 +28,7 @@ const OUTPUT_VALUE_FLAGS = new Set([
27
28
  "--output-budget",
28
29
  "--output-format",
29
30
  "--output-session",
31
+ "--output-cursor",
30
32
  ]);
31
33
  /** Whether a global value-consuming flag uses its inline `--flag=value` form. */
32
34
  const isInlineGlobalValueToken = (token) => {
@@ -117,6 +119,9 @@ export function parseBootstrapGlobalOptions(argv) {
117
119
  ...(state.outputValues.get("--output-session") === undefined
118
120
  ? {}
119
121
  : { outputSession: state.outputValues.get("--output-session") }),
122
+ ...(state.outputValues.get("--output-cursor") === undefined
123
+ ? {}
124
+ : { outputCursor: state.outputValues.get("--output-cursor") }),
120
125
  ...(state.author === ""
121
126
  ? { authorMissingValue: true }
122
127
  : state.author !== undefined
@@ -890,4 +895,4 @@ export const _testOnly = {
890
895
  resolveCanonicalFlag,
891
896
  };
892
897
  //# sourceMappingURL=cli-bootstrap.js.map
893
- //# debugId=7b3209a8-8580-542c-9e80-21d04df3f61f
898
+ //# debugId=eccdb2d2-da6f-555b-ba1b-8339f9b64f1a
@@ -7,7 +7,7 @@
7
7
  * a hand-picked test list.
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]="cf238c71-1626-5e48-9207-7acf22c0d680")}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]="8b227cb2-a30d-5384-b9c2-558603181c67")}catch(e){}}();
11
11
  import { PM_TOOL_ACTIONS } from "./enum-contracts.js";
12
12
  import { resolveSubcommandFlagContractsForCommand, } from "./flag-contracts.js";
13
13
  import { pmToolActionParameterKeys } from "./tool-schema.js";
@@ -23,6 +23,7 @@ const CLI_TRANSPORT_FLAGS = new Set([
23
23
  "--output-budget",
24
24
  "--output-format",
25
25
  "--output-session",
26
+ "--output-cursor",
26
27
  "--output-row-contract",
27
28
  "--no-changed-fields",
28
29
  "--no-extensions",
@@ -383,4 +384,4 @@ export function analyzeSdkCliParameterCompleteness(source = {}) {
383
384
  });
384
385
  }
385
386
  //# sourceMappingURL=completeness.js.map
386
- //# debugId=cf238c71-1626-5e48-9207-7acf22c0d680
387
+ //# debugId=8b227cb2-a30d-5384-b9c2-558603181c67
@@ -7,7 +7,7 @@
7
7
  * flag surface stays single-sourced across the CLI, SDK, and MCP boundaries.
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]="a5a2c81f-8870-5111-b13c-74c362098d54")}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]="512c41c1-624f-517c-abc3-4448b49cd9e6")}catch(e){}}();
11
11
  import { normalizeUniqueStringList } from "./string-lists.js";
12
12
  import { RESERVED_EXTENSION_HOST_FLAGS } from "../../core/extensions/reserved-host-flags.js";
13
13
  function normalizeFlagAliasKey(flag) {
@@ -342,6 +342,7 @@ export const HISTORY_REPAIR_FLAG_CONTRACTS = [
342
342
  { flag: "--id", value_name: "item-id" },
343
343
  { flag: "--all" },
344
344
  { flag: "--dry-run" },
345
+ { flag: "--normalize-provenance" },
345
346
  { flag: "--author" },
346
347
  { flag: "--message" },
347
348
  { flag: "--force" },
@@ -1817,4 +1818,4 @@ export function toCompletionFlagString(flagContracts, includeGlobal = true) {
1817
1818
  return normalizeUniqueStringList(all).join(" ");
1818
1819
  }
1819
1820
  //# sourceMappingURL=flag-contracts.js.map
1820
- //# debugId=a5a2c81f-8870-5111-b13c-74c362098d54
1821
+ //# debugId=512c41c1-624f-517c-abc3-4448b49cd9e6
@@ -4,7 +4,7 @@
4
4
  * Provides CLI runtime support for Registration Helpers.
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]="daefefd1-3b0b-513d-8b8c-ab17f90b995a")}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]="8d60b13c-c58a-506f-adc9-2414dd69edef")}catch(e){}}();
8
8
  import { Option } from "commander";
9
9
  import { pathExists, refreshSearchArtifactsForMutation, shouldRunSearchRefreshInForeground, EXIT_CODE, PmCliError, printError, printResult, writeStdout, getSettingsPath, resolvePmRoot, readSettings, runActiveServiceOverride, setActiveCommandResult, } from "../runtime-primitives.js";
10
10
  import { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, NEXT_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, readFirstValueFromCommanderOptions, readFirstStringFromCommanderOptions, readStringArrayFromCommanderOptions, } from "../cli-contracts.js";
@@ -112,6 +112,7 @@ export function getGlobalOptions(command) {
112
112
  outputLimit: readStringCommandOption(opts, "outputLimit"),
113
113
  outputBudget: readStringCommandOption(opts, "outputBudget"),
114
114
  outputSession: readStringCommandOption(opts, "outputSession"),
115
+ outputCursor: readStringCommandOption(opts, "outputCursor"),
115
116
  ...(opts.outputRowContract === true ? { outputRowContract: true } : {}),
116
117
  ...(opts.outputFormat === "toon" || opts.outputFormat === "json"
117
118
  ? { outputFormat: opts.outputFormat }
@@ -984,4 +985,4 @@ export const _testOnly = {
984
985
  collectMutationItemIds,
985
986
  };
986
987
  //# sourceMappingURL=registration-helpers.js.map
987
- //# debugId=daefefd1-3b0b-513d-8b8c-ab17f90b995a
988
+ //# debugId=8d60b13c-c58a-506f-adc9-2414dd69edef
@@ -148,6 +148,11 @@ export interface ContractsResult {
148
148
  close_validation_modes: string[];
149
149
  workflow_enforcement_modes: string[];
150
150
  };
151
+ /** Authoritative assurance declaration vocabularies for SDK and host validation. */
152
+ assurance_contracts?: {
153
+ measurement_source_kinds: readonly string[];
154
+ gate_triggers: readonly string[];
155
+ };
151
156
  /** Value that configures or reports mcp tools for this contract. */
152
157
  mcp_tools?: McpToolContract[];
153
158
  /** Built-in intent-scoped read projections available to CLI, SDK, MCP, and package consumers. */
@@ -4,7 +4,7 @@
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]="c0995490-5838-5c91-af77-9ce387e41a1f")}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]="8cdd82c3-979e-5f7f-bc72-592c7e55f11c")}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
10
  import { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, ASSURANCE_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";
@@ -18,6 +18,7 @@ import { PM_ERROR_CODE_CATALOG } from "../generated-error-code-catalog.js";
18
18
  import { resolvePmCommandOutputEnvelope, } from "../output-contracts.js";
19
19
  import { PM_COMMAND_EXIT_OUTCOME_CONTRACTS, resolvePmCommandExitContract, } from "./command-exit-contracts.js";
20
20
  import { BUILTIN_RELATIONSHIP_KINDS } from "../relationship-kinds/contract.js";
21
+ import { ASSURANCE_GATE_TRIGGERS, ASSURANCE_MEASUREMENT_SOURCE_KINDS, } from "../governance/assurance.js";
21
22
  const AGENT_BOOTSTRAP_FLAGS = new Map([
22
23
  [
23
24
  "claim",
@@ -1328,7 +1329,8 @@ function resolveContractsSelection(options) {
1328
1329
  fullOutput,
1329
1330
  omitUnfilteredSchema: unfilteredDefaultBriefMode,
1330
1331
  omitUnfilteredCommandFlags: unfilteredDefaultBriefMode,
1331
- omitUnfilteredCommanderAliases: unfilteredDefaultBriefMode,
1332
+ omitUnfilteredCommanderAliases: unfilteredDefaultBriefMode ||
1333
+ (selectedCommand !== undefined && !fullOutput),
1332
1334
  };
1333
1335
  }
1334
1336
  function assertSingleContractsProjection(selection) {
@@ -1781,20 +1783,26 @@ function createContractsResult(selection, schemaContext, actionContext, outputCo
1781
1783
  : {}),
1782
1784
  };
1783
1785
  }
1784
- function attachRuntimeContractsResult(result, runtime) {
1786
+ function attachRuntimeContractsResult(result, runtime, selection) {
1787
+ const selectedCommand = selection.selectedCommand;
1785
1788
  result.runtime_schema = {
1786
1789
  statuses: runtime.statusRegistry.definitions.map((definition) => definition.id),
1787
1790
  open_status: runtime.statusRegistry.open_status,
1788
1791
  close_status: runtime.statusRegistry.close_status,
1789
1792
  canceled_status: runtime.statusRegistry.canceled_status,
1790
1793
  types: [...runtime.typeRegistry.types],
1791
- fields_by_command: Object.fromEntries([...runtime.runtimeFieldRegistry.command_to_fields.entries()].map(([command, definitions]) => [
1794
+ fields_by_command: Object.fromEntries([...runtime.runtimeFieldRegistry.command_to_fields.entries()]
1795
+ .filter(([command]) => selectedCommand === undefined || command === selectedCommand)
1796
+ .map(([command, definitions]) => [
1792
1797
  command,
1793
1798
  [
1794
1799
  ...new Set(definitions.map((definition) => `--${definition.cli_flag}`)),
1795
1800
  ].sort((left, right) => left.localeCompare(right)),
1796
1801
  ])),
1797
1802
  };
1803
+ if (selectedCommand !== undefined && !selection.fullOutput) {
1804
+ return;
1805
+ }
1798
1806
  result.extension_contracts = {
1799
1807
  capabilities: [...PM_EXTENSION_CAPABILITY_CONTRACTS],
1800
1808
  services: [...PM_EXTENSION_SERVICE_NAME_CONTRACTS],
@@ -1877,7 +1885,9 @@ function attachCommanderAliasContractsResult(result, selection) {
1877
1885
  result.commander_aliases = buildCommanderAliasSurface();
1878
1886
  return;
1879
1887
  }
1880
- result.commander_aliases_omitted_reason = "unfiltered_default_brief";
1888
+ result.commander_aliases_omitted_reason = selection.selectedCommand
1889
+ ? "command_scoped"
1890
+ : "unfiltered_default_brief";
1881
1891
  }
1882
1892
  /** Attach the compact agent-facing command semantics shared by summary and full projections. */
1883
1893
  function attachAgentCommandContractsResult(result, outputCommands, extensionCommandContracts) {
@@ -1908,11 +1918,17 @@ export async function runContracts(options, global) {
1908
1918
  }
1909
1919
  const commandAliases = buildCommandAliasSurface(commands);
1910
1920
  if (!(selection.flagsOnly && !selection.fullOutput)) {
1911
- attachRuntimeContractsResult(result, runtime);
1921
+ attachRuntimeContractsResult(result, runtime, selection);
1912
1922
  }
1913
1923
  attachSchemaContractsResult(result, selection, schemaContext, extensionCommandContracts);
1914
1924
  attachFlagContractsResult(result, selection, runtime, outputCommands, commandAliases);
1915
1925
  attachCommanderAliasContractsResult(result, selection);
1926
+ if (selection.selectedCommand === "assurance" || selection.fullOutput) {
1927
+ result.assurance_contracts = {
1928
+ measurement_source_kinds: [...ASSURANCE_MEASUREMENT_SOURCE_KINDS],
1929
+ gate_triggers: [...ASSURANCE_GATE_TRIGGERS],
1930
+ };
1931
+ }
1916
1932
  // pm-4os2: snapshot the static MCP tool surface in the full projection so
1917
1933
  // `pnpm contracts:check` (CI static gate) fails on unintended inputSchema
1918
1934
  // drift in src/mcp/tool-definitions.ts.
@@ -1967,4 +1983,4 @@ export const _testOnlyContractsCommand = {
1967
1983
  toRuntimeShortFlagToken,
1968
1984
  };
1969
1985
  //# sourceMappingURL=runtime-contracts.js.map
1970
- //# debugId=c0995490-5838-5c91-af77-9ce387e41a1f
1986
+ //# debugId=8cdd82c3-979e-5f7f-bc72-592c7e55f11c