@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
  * Defines SDK command-contract metadata for Tool Parameter Tables.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9a679120-6f16-5588-b4d4-91c90a2fe385")}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]="ddb90f7e-f3ca-56d8-be75-13e238da306c")}catch(e){}}();
8
8
  import { PLAN_HARNESS_VALUES, PLAN_MODE_VALUES, PLAN_STEP_LINK_KIND_VALUES, PLAN_STEP_STATUS_VALUES, } from "../../types/index.js";
9
9
  import { PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS } from "../read-output-session.js";
10
10
  import { ASSURANCE_DEFINITION_SCHEMA } from "./schemas/assurance-definition.js";
@@ -20,7 +20,9 @@ export const PM_TOOL_PARAMETER_PROPERTIES = {
20
20
  outputLimit: {
21
21
  anyOf: [{ type: "integer", minimum: 1 }, { const: "unbounded" }],
22
22
  },
23
- outputBudget: { type: "integer", minimum: 1 },
23
+ outputBudget: {
24
+ anyOf: [{ type: "integer", minimum: 1 }, { const: "unbounded" }],
25
+ },
24
26
  outputFormat: { type: "string", enum: ["json", "toon"] },
25
27
  outputSession: {
26
28
  anyOf: [
@@ -55,6 +57,7 @@ export const PM_TOOL_PARAMETER_PROPERTIES = {
55
57
  },
56
58
  ],
57
59
  },
60
+ outputCursor: { type: "string", minLength: 1 },
58
61
  outputRowContract: { type: "boolean" },
59
62
  path: { type: "string" },
60
63
  pmExecutable: { type: "string" },
@@ -476,6 +479,7 @@ export const PM_TOOL_PARAMETER_PROPERTIES = {
476
479
  edit: { type: "integer", minimum: 1 },
477
480
  delete: { type: "integer", minimum: 1 },
478
481
  dryRun: { type: "boolean" },
482
+ normalizeProvenance: { type: "boolean" },
479
483
  all: { type: "boolean" },
480
484
  clear: { type: "boolean" },
481
485
  cliOnly: { type: "boolean" },
@@ -940,8 +944,8 @@ export const PM_TOOL_PARAMETER_METADATA = {
940
944
  examples: [10, "unbounded"],
941
945
  },
942
946
  outputBudget: {
943
- description: "Universal estimated-token ceiling for a read result.",
944
- examples: [600, 1200],
947
+ description: "Universal estimated-token ceiling for a read result, or unbounded to disable the shared ceiling.",
948
+ examples: [600, 1200, "unbounded"],
945
949
  },
946
950
  outputFormat: {
947
951
  description: "Universal read-result encoding selector.",
@@ -959,6 +963,9 @@ export const PM_TOOL_PARAMETER_METADATA = {
959
963
  },
960
964
  ],
961
965
  },
966
+ outputCursor: {
967
+ description: "Opaque continuation cursor returned when a declared row collection is compacted by the output budget.",
968
+ },
962
969
  outputRowContract: {
963
970
  description: "Include the row selector and TOON row-encoding contract on a read result.",
964
971
  },
@@ -1393,6 +1400,9 @@ export const PM_TOOL_PARAMETER_METADATA = {
1393
1400
  dryRun: {
1394
1401
  description: "Preview command effects without mutating storage artifacts.",
1395
1402
  },
1403
+ normalizeProvenance: {
1404
+ description: "For history-repair: remove invalid legacy provenance observations and emit only aggregate privacy-safe repair evidence.",
1405
+ },
1396
1406
  all: {
1397
1407
  description: "For history-repair action: scan every stream for drift and repair each drifted stream in one audited pass (mutually exclusive with id).",
1398
1408
  },
@@ -2049,4 +2059,4 @@ export const PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
2049
2059
  },
2050
2060
  };
2051
2061
  //# sourceMappingURL=tool-parameter-tables.js.map
2052
- //# debugId=9a679120-6f16-5588-b4d4-91c90a2fe385
2062
+ //# debugId=ddb90f7e-f3ca-56d8-be75-13e238da306c
@@ -7,7 +7,7 @@
7
7
  * consumers from a single source of truth.
8
8
  */
9
9
 
10
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d4550d60-3907-528e-b984-c8ca90b7a4e8")}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]="aa58e280-0a39-5285-a451-811e60481661")}catch(e){}}();
11
11
  import { normalizeUniqueStringList } from "./string-lists.js";
12
12
  import { PM_TOOL_ACTIONS } from "./enum-contracts.js";
13
13
  import { TOOL_CREATE_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS, TOOL_CONTEXT_OPTION_CONTRACTS, TOOL_ACTIVITY_OPTION_CONTRACTS, TOOL_LIST_FILTER_OPTION_CONTRACTS, TOOL_AGGREGATE_OPTION_CONTRACTS, TOOL_SEARCH_FILTER_OPTION_CONTRACTS, TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS, } from "./tool-option-contracts.js";
@@ -31,6 +31,7 @@ const PM_TOOL_READ_OUTPUT_PARAMETER_KEYS = [
31
31
  "outputBudget",
32
32
  "outputFormat",
33
33
  "outputSession",
34
+ "outputCursor",
34
35
  "outputRowContract",
35
36
  ];
36
37
  /** Canonical top-level MCP properties that take precedence over runtime custom fields. */
@@ -621,7 +622,13 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
621
622
  },
622
623
  "history-repair": {
623
624
  // Exactly one of `id` (single stream) or `all` (bulk drift repair) is required.
624
- optional: ["id", "all", "dryRun", ...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],
625
+ optional: [
626
+ "id",
627
+ "all",
628
+ "dryRun",
629
+ "normalizeProvenance",
630
+ ...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS,
631
+ ],
625
632
  oneOfRequired: [["id"], ["all"]],
626
633
  },
627
634
  "history-author-acknowledge": {
@@ -1573,4 +1580,4 @@ export const _testOnlyCliContracts = {
1573
1580
  withFlagAliasMetadata,
1574
1581
  };
1575
1582
  //# sourceMappingURL=tool-schema.js.map
1576
- //# debugId=d4550d60-3907-528e-b984-c8ca90b7a4e8
1583
+ //# debugId=aa58e280-0a39-5285-a451-811e60481661
@@ -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]="304d0901-79d3-593d-a789-410e28d59948")}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]="03d46cbf-73bc-50c9-b4e6-e7329ee53076")}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|unbounded>", "Bound estimated tokens in read output or explicitly disable the default ceiling")
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-cursor <cursor>", "Resume a budget-compacted declared row collection")
33
34
  .option("--output-row-contract", "Include the machine-readable row selector and TOON encoding contract")
34
35
  .option("--quiet", "Suppress stdout output")
35
36
  .option("--no-changed-fields", "Omit the changed_fields array from mutation output (keeps changed_field_count)")
@@ -45,4 +46,4 @@ export function createPmCliProgram(version) {
45
46
  .exitOverride();
46
47
  }
47
48
  //# sourceMappingURL=cli-program.js.map
48
- //# debugId=304d0901-79d3-593d-a789-410e28d59948
49
+ //# debugId=03d46cbf-73bc-50c9-b4e6-e7329ee53076
@@ -7,8 +7,8 @@ export { BASELINE_ITEM_FORMAT_VERSION, BUILTIN_ITEM_TYPE_VALUES, CONFIDENCE_TEXT
7
7
  export * from "./core-governance.js";
8
8
  export * from "./agent-session-context.js";
9
9
  export { isAlreadyClaimedError } from "./lifecycle/claim.js";
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
+ export { PM_READ_OUTPUT_DIMENSIONS, PM_READ_OUTPUT_OPTION_FLAGS, PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS, PM_READ_OUTPUT_SURFACE_CONTRACTS, applyReadOutputDimensions, decodeReadOutputContinuationCursor, encodeReadOutputContinuationCursor, isReadOutputBudgetExceeded, resolveReadOutputDimensions, resolveReadOutputEncoding, resolveReadOutputSurface, validateReadOutputOptions, } from "./read-output-contracts.js";
11
11
  export { applyReadOutputSessionReferences, attachReadOutputSessionReceipt, parseReadOutputSession, readOutputSessionRemainingTokens, } from "./read-output-session.js";
12
- export type { PmReadOutputBudgetExceeded, PmReadOutputDimension, PmReadOutputLegacyAlias, PmReadOutputOptions, PmReadOutputReceipt, PmReadOutputResult, PmReadOutputResultFor, PmReadOutputSurface, PmReadOutputSurfaceContract, } from "./read-output-contracts.js";
12
+ export type { PmReadOutputBudgetExceeded, PmReadOutputContinuation, PmReadOutputCursorEnvelope, PmReadOutputDimension, PmReadOutputLegacyAlias, PmReadOutputOptions, PmReadOutputReceipt, PmReadOutputResult, PmReadOutputResultFor, PmReadOutputSurface, PmReadOutputSurfaceContract, } from "./read-output-contracts.js";
13
13
  export type { PmReadOutputSessionReceipt, PmReadOutputSessionReference, PmReadOutputSessionState, } from "./read-output-session.js";
14
14
  export type { ItemDocument, ItemMetadata, ItemStatus, ItemType, PmSettings, } from "../types/index.js";
package/dist/sdk/core.js CHANGED
@@ -4,12 +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]="2e0a2422-64c7-5ad3-867c-04479171fa27")}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]="dfc95179-77dd-5762-9bcc-c6bb461ff553")}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
11
  export { isAlreadyClaimedError } from "./lifecycle/claim.js";
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
+ export { PM_READ_OUTPUT_DIMENSIONS, PM_READ_OUTPUT_OPTION_FLAGS, PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS, PM_READ_OUTPUT_SURFACE_CONTRACTS, applyReadOutputDimensions, decodeReadOutputContinuationCursor, encodeReadOutputContinuationCursor, isReadOutputBudgetExceeded, resolveReadOutputDimensions, resolveReadOutputEncoding, resolveReadOutputSurface, validateReadOutputOptions, } from "./read-output-contracts.js";
13
13
  export { applyReadOutputSessionReferences, attachReadOutputSessionReceipt, parseReadOutputSession, readOutputSessionRemainingTokens, } from "./read-output-session.js";
14
14
  //# sourceMappingURL=core.js.map
15
- //# debugId=2e0a2422-64c7-5ad3-867c-04479171fa27
15
+ //# debugId=dfc95179-77dd-5762-9bcc-c6bb461ff553
@@ -1,6 +1,6 @@
1
1
  /** Generated partition 1 of the exhaustive error-code catalog. */
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="92b7b390-4d50-5210-8209-9ade302498c2")}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]="3891c17c-c79d-54d4-8b62-da8fe9c1eaf4")}catch(e){}}();
4
4
  export const PM_ERROR_CODE_CATALOG_PART_1 = [
5
5
  {
6
6
  code: "acceptance_criteria_mutation_conflict",
@@ -1592,6 +1592,30 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1592
1592
  canonical_code: "manifest_capabilities_absent",
1593
1593
  aliases: [],
1594
1594
  },
1595
+ {
1596
+ code: "merge_conflict_markers_detected",
1597
+ meaning: "Merge conflict markers detected condition.",
1598
+ stability: "stable",
1599
+ exit_code: 1,
1600
+ class: "generic_failure",
1601
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1602
+ sources: ["core/item/item-format.ts"],
1603
+ emitting_commands: ["*"],
1604
+ canonical_code: "merge_conflict_markers_detected",
1605
+ aliases: ["history_merge_conflict_markers_detected"],
1606
+ },
1607
+ {
1608
+ code: "merge_decisions_unreviewed",
1609
+ meaning: "Merge decisions unreviewed condition.",
1610
+ stability: "provisional",
1611
+ exit_code: 1,
1612
+ class: "generic_failure",
1613
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1614
+ sources: ["core/diagnostics/remediation.ts"],
1615
+ emitting_commands: ["*"],
1616
+ canonical_code: "merge_decisions_unreviewed",
1617
+ aliases: [],
1618
+ },
1595
1619
  ];
1596
1620
  //# sourceMappingURL=generated-error-code-catalog-part-1.js.map
1597
- //# debugId=92b7b390-4d50-5210-8209-9ade302498c2
1621
+ //# debugId=3891c17c-c79d-54d4-8b62-da8fe9c1eaf4
@@ -1,31 +1,7 @@
1
1
  /** Generated partition 2 of the exhaustive error-code catalog. */
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b129c0ca-3d57-551c-945c-300547b74ff5")}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]="5d64a86d-6ba6-5bbe-a83a-9703690a851e")}catch(e){}}();
4
4
  export const PM_ERROR_CODE_CATALOG_PART_2 = [
5
- {
6
- code: "merge_conflict_markers_detected",
7
- meaning: "Merge conflict markers detected condition.",
8
- stability: "stable",
9
- exit_code: 1,
10
- class: "generic_failure",
11
- recovery: "Inspect the structured error guidance and retry the suggested command.",
12
- sources: ["core/item/item-format.ts"],
13
- emitting_commands: ["*"],
14
- canonical_code: "merge_conflict_markers_detected",
15
- aliases: ["history_merge_conflict_markers_detected"],
16
- },
17
- {
18
- code: "merge_decisions_unreviewed",
19
- meaning: "Merge decisions unreviewed condition.",
20
- stability: "provisional",
21
- exit_code: 1,
22
- class: "generic_failure",
23
- recovery: "Inspect the structured error guidance and retry the suggested command.",
24
- sources: ["core/diagnostics/remediation.ts"],
25
- emitting_commands: ["*"],
26
- canonical_code: "merge_decisions_unreviewed",
27
- aliases: [],
28
- },
29
5
  {
30
6
  code: "merge_git_config_unwritable",
31
7
  meaning: "Merge git config unwritable condition.",
@@ -363,6 +339,54 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
363
339
  canonical_code: "project_runtime_stale_read",
364
340
  aliases: [],
365
341
  },
342
+ {
343
+ code: "provenance_value_domain_invalid",
344
+ meaning: "Provenance value domain invalid condition.",
345
+ stability: "provisional",
346
+ exit_code: 2,
347
+ class: "usage",
348
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
349
+ sources: ["core/diagnostics/remediation.ts"],
350
+ emitting_commands: ["*"],
351
+ canonical_code: "provenance_value_domain_invalid",
352
+ aliases: [],
353
+ },
354
+ {
355
+ code: "read_output_cursor_command_mismatch",
356
+ meaning: "Read output cursor command mismatch condition.",
357
+ stability: "provisional",
358
+ exit_code: 2,
359
+ class: "usage",
360
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
361
+ sources: ["sdk/read-output/continuation.ts"],
362
+ emitting_commands: ["*"],
363
+ canonical_code: "read_output_cursor_command_mismatch",
364
+ aliases: [],
365
+ },
366
+ {
367
+ code: "read_output_cursor_invalid",
368
+ meaning: "Read output cursor invalid condition.",
369
+ stability: "provisional",
370
+ exit_code: 2,
371
+ class: "usage",
372
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
373
+ sources: ["sdk/read-output/continuation.ts"],
374
+ emitting_commands: ["*"],
375
+ canonical_code: "read_output_cursor_invalid",
376
+ aliases: [],
377
+ },
378
+ {
379
+ code: "read_output_cursor_stale",
380
+ meaning: "Read output cursor stale condition.",
381
+ stability: "provisional",
382
+ exit_code: 2,
383
+ class: "usage",
384
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
385
+ sources: ["sdk/read-output/continuation.ts"],
386
+ emitting_commands: ["*"],
387
+ canonical_code: "read_output_cursor_stale",
388
+ aliases: [],
389
+ },
366
390
  {
367
391
  code: "redundant_edge",
368
392
  meaning: "Redundant edge condition.",
@@ -1605,4 +1629,4 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
1605
1629
  },
1606
1630
  ];
1607
1631
  //# sourceMappingURL=generated-error-code-catalog-part-2.js.map
1608
- //# debugId=b129c0ca-3d57-551c-945c-300547b74ff5
1632
+ //# debugId=5d64a86d-6ba6-5bbe-a83a-9703690a851e
@@ -6,6 +6,7 @@
6
6
  import type { GlobalOptions } from "../../core/shared/command-types.js";
7
7
  import { type AssuranceBundleMutationReceipt, type AssuranceDeclaration, type AssuranceGateVerdict, type AssuranceMutationReceipt } from "./assurance.js";
8
8
  import { type AssuranceDerivedProposal, type AssurancePreset, type AssurancePresetId } from "./assurance-presets.js";
9
+ import { type CreateAssuranceWorkspaceContextOptions } from "./assurance-runtime.js";
9
10
  /** Assurance registry and evaluation verbs shared by every transport. */
10
11
  export declare const ASSURANCE_ACTIONS: readonly ["list", "show", "put", "remove", "run", "verdicts", "presets", "apply", "derive", "promote"];
11
12
  /** Assurance declaration kinds shared by every transport. */
@@ -49,6 +50,11 @@ export interface AssuranceActionInput {
49
50
  /** Explicit next assertion enforcement level. */
50
51
  enforcement?: string;
51
52
  }
53
+ /** Embedding-host capabilities used only while evaluating assurance actions. */
54
+ export interface AssuranceActionRuntimeOptions {
55
+ /** Workspace adapters and provider capabilities supplied by an SDK host. */
56
+ workspace?: Omit<CreateAssuranceWorkspaceContextOptions, "tree_id" | "trigger">;
57
+ }
52
58
  /** Result union returned by transport-neutral assurance execution. */
53
59
  export type AssuranceActionResult = AssuranceDeclaration | AssuranceMutationReceipt | AssuranceGateVerdict | AssuranceBundleMutationReceipt | AssurancePreset | {
54
60
  items: AssuranceDerivedProposal[];
@@ -89,6 +95,6 @@ export type AssuranceActionResult = AssuranceDeclaration | AssuranceMutationRece
89
95
  };
90
96
  };
91
97
  /** Execute one assurance request through the public assurance SDK primitives. */
92
- export declare function runAssuranceAction(input: AssuranceActionInput, global?: Pick<GlobalOptions, "path">): Promise<AssuranceActionResult>;
98
+ export declare function runAssuranceAction(input: AssuranceActionInput, global?: Pick<GlobalOptions, "path">, runtime?: AssuranceActionRuntimeOptions): Promise<AssuranceActionResult>;
93
99
  /** Normalize a generic SDK or MCP argument envelope into one assurance request. */
94
100
  export declare function runAssuranceDispatch(args: Record<string, unknown>, options: Record<string, unknown>, global: GlobalOptions): Promise<AssuranceActionResult>;
@@ -1,12 +1,12 @@
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]="36dfa230-06bd-5902-a0c9-94a7c34cda90")}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]="06d21369-1339-54b2-8d78-442f02e24cef")}catch(e){}}();
3
3
  import { EXIT_CODE } from "../../core/shared/constants.js";
4
4
  import { PmCliError } from "../../core/shared/errors.js";
5
5
  import { ASSURANCE_GATE_TRIGGERS, evaluateAssuranceGate, getAssuranceDeclaration, listAssuranceDeclarations, listAssuranceVerdicts, putAssuranceDeclaration, recordAssuranceVerdict, removeAssuranceDeclaration, } from "./assurance.js";
6
6
  import { ASSURANCE_PRESET_IDS, acceptAssuranceProposals, applyAssurancePreset, createAssurancePreset, deriveAssuranceProposals, promoteAssuranceAssertion, } from "./assurance-presets.js";
7
7
  import { MAX_ASSURANCE_VERDICT_LIMIT } from "./assurance-limits.js";
8
8
  import { normalizeAssuranceEvaluation, normalizeAssuranceMutation, } from "./assurance-mutation-error.js";
9
- import { createAssuranceWorkspaceContext } from "./assurance-runtime.js";
9
+ import { createAssuranceWorkspaceContext, } from "./assurance-runtime.js";
10
10
  import { resolvePmRoot } from "../runtime-primitives.js";
11
11
  import { parseRuntimeInteger, readRuntimeString } from "../runtime-input.js";
12
12
  /** Assurance registry and evaluation verbs shared by every transport. */
@@ -173,7 +173,7 @@ async function runAdoptionAction(action, input, pmRoot) {
173
173
  message: input.message,
174
174
  }));
175
175
  }
176
- async function runGateAction(input, pmRoot) {
176
+ async function runGateAction(input, pmRoot, runtime) {
177
177
  if (!input.id) {
178
178
  throw new PmCliError("assurance run requires a gate id", EXIT_CODE.USAGE);
179
179
  }
@@ -188,6 +188,7 @@ async function runGateAction(input, pmRoot) {
188
188
  const [document, workspaceContext] = await Promise.all([
189
189
  readDocument(pmRoot),
190
190
  createAssuranceWorkspaceContext(pmRoot, {
191
+ ...runtime.workspace,
191
192
  tree_id: input.tree,
192
193
  trigger,
193
194
  }),
@@ -205,7 +206,7 @@ async function runGateAction(input, pmRoot) {
205
206
  return verdict;
206
207
  }
207
208
  /** Execute one assurance request through the public assurance SDK primitives. */
208
- export async function runAssuranceAction(input, global = {}) {
209
+ export async function runAssuranceAction(input, global = {}, runtime = {}) {
209
210
  const action = parseAction(input.action);
210
211
  const pmRoot = resolvePmRoot(process.cwd(), global.path);
211
212
  if (action === "presets" ||
@@ -218,7 +219,7 @@ export async function runAssuranceAction(input, global = {}) {
218
219
  return runVerdictsAction(input, pmRoot);
219
220
  }
220
221
  if (action === "run") {
221
- return runGateAction(input, pmRoot);
222
+ return runGateAction(input, pmRoot, runtime);
222
223
  }
223
224
  const kind = parseKind(input.kind);
224
225
  if (action === "list")
@@ -281,4 +282,4 @@ export function runAssuranceDispatch(args, options, global) {
281
282
  }, global);
282
283
  }
283
284
  //# sourceMappingURL=assurance-action.js.map
284
- //# debugId=36dfa230-06bd-5902-a0c9-94a7c34cda90
285
+ //# debugId=06d21369-1339-54b2-8d78-442f02e24cef
@@ -1,3 +1,29 @@
1
+ /** Machine-readable location of a refused assurance evaluation. */
2
+ export interface AssuranceEvaluationRefusalContext {
3
+ /** Gate being evaluated. */
4
+ gate_id?: string;
5
+ /** Assertion whose measurement failed. */
6
+ assertion_id?: string;
7
+ /** Measurement whose source failed. */
8
+ measurement_id?: string;
9
+ /** Measurement source discriminant. */
10
+ source_kind?: string;
11
+ /** Field selected from a graph, validate, or health result. */
12
+ field?: string;
13
+ /** Validate or health check selected by the source. */
14
+ check?: string;
15
+ }
16
+ /** Machine-readable location of a failed measurement source resolution. */
17
+ export interface AssuranceSourceResolutionContext {
18
+ /** Measurement that owns the failed source, once evaluation identifies it. */
19
+ measurement_id?: string;
20
+ /** Measurement source discriminant. */
21
+ source_kind: string;
22
+ /** Field selected from the source result. */
23
+ field: string;
24
+ /** Optional validate or health check selector. */
25
+ check?: string;
26
+ }
1
27
  /** Expected declaration-validation or mutation-policy refusal. */
2
28
  export declare class AssuranceMutationRefusalError extends TypeError {
3
29
  /** Create one typed refusal while retaining TypeError compatibility for SDK callers. */
@@ -5,8 +31,23 @@ export declare class AssuranceMutationRefusalError extends TypeError {
5
31
  }
6
32
  /** Expected gate-policy refusal caused by an incomplete or disallowed provider contract. */
7
33
  export declare class AssuranceEvaluationRefusalError extends TypeError {
34
+ /** Structured evaluation location retained across CLI, SDK, and MCP. */
35
+ readonly context: AssuranceEvaluationRefusalContext;
8
36
  /** Create one typed refusal while retaining TypeError compatibility for SDK callers. */
9
- constructor(message: string);
37
+ constructor(message: string, context?: AssuranceEvaluationRefusalContext);
38
+ }
39
+ /** Expected failure to resolve one declared external measurement source. */
40
+ export declare class AssuranceSourceResolutionError extends TypeError {
41
+ /** Measurement that owns the failed source, once evaluation identifies it. */
42
+ readonly measurement_id?: string;
43
+ /** Measurement source discriminant. */
44
+ readonly source_kind: string;
45
+ /** Field selected from the source result. */
46
+ readonly field: string;
47
+ /** Optional validate or health check selector. */
48
+ readonly check?: string;
49
+ /** Create one source-local refusal before gate context is attached. */
50
+ constructor(message: string, context: AssuranceSourceResolutionContext);
10
51
  }
11
52
  /** Normalize only expected assurance mutation refusals for CLI and MCP hosts. */
12
53
  export declare function normalizeAssuranceMutation<T>(operation: () => Promise<T>): Promise<T>;
@@ -5,7 +5,7 @@
5
5
  * faults before transport layers normalize them into stable usage errors.
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]="93a32771-bf95-5df4-8019-b6be45a5051b")}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]="d2d5135a-8110-527e-8530-653b25b792a4")}catch(e){}}();
9
9
  import { EXIT_CODE } from "../../core/shared/constants.js";
10
10
  import { PmCliError } from "../../core/shared/errors.js";
11
11
  /** Expected declaration-validation or mutation-policy refusal. */
@@ -18,10 +18,33 @@ export class AssuranceMutationRefusalError extends TypeError {
18
18
  }
19
19
  /** Expected gate-policy refusal caused by an incomplete or disallowed provider contract. */
20
20
  export class AssuranceEvaluationRefusalError extends TypeError {
21
+ /** Structured evaluation location retained across CLI, SDK, and MCP. */
22
+ context;
21
23
  /** Create one typed refusal while retaining TypeError compatibility for SDK callers. */
22
- constructor(message) {
24
+ constructor(message, context = {}) {
23
25
  super(message);
24
26
  this.name = "AssuranceEvaluationRefusalError";
27
+ this.context = context;
28
+ }
29
+ }
30
+ /** Expected failure to resolve one declared external measurement source. */
31
+ export class AssuranceSourceResolutionError extends TypeError {
32
+ /** Measurement that owns the failed source, once evaluation identifies it. */
33
+ measurement_id;
34
+ /** Measurement source discriminant. */
35
+ source_kind;
36
+ /** Field selected from the source result. */
37
+ field;
38
+ /** Optional validate or health check selector. */
39
+ check;
40
+ /** Create one source-local refusal before gate context is attached. */
41
+ constructor(message, context) {
42
+ super(message);
43
+ this.name = "AssuranceSourceResolutionError";
44
+ this.measurement_id = context.measurement_id;
45
+ this.source_kind = context.source_kind;
46
+ this.field = context.field;
47
+ this.check = context.check;
25
48
  }
26
49
  }
27
50
  /** Normalize only expected assurance mutation refusals for CLI and MCP hosts. */
@@ -49,10 +72,11 @@ export async function normalizeAssuranceEvaluation(operation) {
49
72
  throw new PmCliError(error.message, EXIT_CODE.USAGE, {
50
73
  code: "invalid_argument_value",
51
74
  reason: "assurance_evaluation_refused",
75
+ ...error.context,
52
76
  });
53
77
  }
54
78
  throw error;
55
79
  }
56
80
  }
57
81
  //# sourceMappingURL=assurance-mutation-error.js.map
58
- //# debugId=93a32771-bf95-5df4-8019-b6be45a5051b
82
+ //# debugId=d2d5135a-8110-527e-8530-653b25b792a4
@@ -5,12 +5,13 @@
5
5
  * and verdict semantics in the host-neutral assurance module.
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]="7c99dfd8-2fa4-56c4-8191-229701eab251")}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]="f9c26dab-b2fb-5ca0-b575-682b4b0bb830")}catch(e){}}();
9
9
  import { execFile } from "node:child_process";
10
10
  import { promisify } from "node:util";
11
11
  import { runGraph } from "../graph/run.js";
12
12
  import { runHealth } from "./health.js";
13
13
  import { runValidate } from "./validate.js";
14
+ import { AssuranceSourceResolutionError } from "./assurance-mutation-error.js";
14
15
  import { getActiveExtensionRegistrations, resolvePortableWorkspaceContext, } from "../../core/extensions/index.js";
15
16
  import { resolveRegisteredAssuranceMeasurementProvider } from "../../core/extensions/runtime-registrations.js";
16
17
  import { stableStringify } from "../../core/shared/serialization.js";
@@ -86,13 +87,13 @@ async function runRegisteredProvider(provider, source, pmRoot, trigger) {
86
87
  clearTimeout(timeoutHandle);
87
88
  }
88
89
  }
89
- function valueAtPath(input, field) {
90
+ function valueAtPath(input, field, sourceKind, check) {
90
91
  let current = input;
91
92
  for (const segment of field.split(".")) {
92
93
  if (typeof current !== "object" ||
93
94
  current === null ||
94
95
  Array.isArray(current)) {
95
- throw new TypeError(`assurance field ${field} is not present`);
96
+ throw new AssuranceSourceResolutionError(`assurance field ${field} is not present`, { source_kind: sourceKind, field, ...(check ? { check } : {}) });
96
97
  }
97
98
  current = current[segment];
98
99
  }
@@ -102,17 +103,17 @@ function valueAtPath(input, field) {
102
103
  current.every((entry) => typeof entry === "string")) {
103
104
  return current;
104
105
  }
105
- throw new TypeError(`assurance field ${field} must resolve to a finite number or string array`);
106
+ throw new AssuranceSourceResolutionError(`assurance field ${field} must resolve to a finite number or string array`, { source_kind: sourceKind, field, ...(check ? { check } : {}) });
106
107
  }
107
- function checkValue(result, checkName, field) {
108
+ function checkValue(result, checkName, field, sourceKind) {
108
109
  const check = result.checks.find((entry) => entry.name === checkName);
109
110
  if (!check)
110
- throw new TypeError(`assurance check ${checkName} is not present`);
111
+ throw new AssuranceSourceResolutionError(`assurance check ${checkName} is not present`, { source_kind: sourceKind, field, check: checkName });
111
112
  const value = field === "status" || field === "ok"
112
113
  ? check.ok
113
114
  ? 0
114
115
  : 1
115
- : valueAtPath(check.details, field);
116
+ : valueAtPath(check.details, field, sourceKind, checkName);
116
117
  return { value, population_size: 1, cost: result.checks.length };
117
118
  }
118
119
  async function resolveTreeId(pmRoot, explicit) {
@@ -205,7 +206,7 @@ export async function createAssuranceWorkspaceContext(pmRoot, options = {}) {
205
206
  }
206
207
  const result = await pending;
207
208
  return {
208
- value: valueAtPath(result, source.field),
209
+ value: valueAtPath(result, source.field, source.kind),
209
210
  population_size: items.length,
210
211
  cost: items.length,
211
212
  };
@@ -213,12 +214,12 @@ export async function createAssuranceWorkspaceContext(pmRoot, options = {}) {
213
214
  if (source.kind === "validate") {
214
215
  validateRun ??= runValidate({ counts: true }, global);
215
216
  const result = await validateRun;
216
- return checkValue(result, source.check, source.field);
217
+ return checkValue(result, source.check, source.field, source.kind);
217
218
  }
218
219
  if (source.kind === "health") {
219
220
  healthRun ??= runHealth(global, { checkOnly: true, full: true });
220
221
  const result = await healthRun;
221
- return checkValue(result, source.check, source.field);
222
+ return checkValue(result, source.check, source.field, source.kind);
222
223
  }
223
224
  const hostProvider = options.providers?.[source.provider];
224
225
  if (hostProvider)
@@ -232,4 +233,4 @@ export async function createAssuranceWorkspaceContext(pmRoot, options = {}) {
232
233
  };
233
234
  }
234
235
  //# sourceMappingURL=assurance-runtime.js.map
235
- //# debugId=7c99dfd8-2fa4-56c4-8191-229701eab251
236
+ //# debugId=f9c26dab-b2fb-5ca0-b575-682b4b0bb830
@@ -2,6 +2,8 @@
2
2
  export declare const ASSURANCE_DOCUMENT_VERSION: 1;
3
3
  /** Supported lifecycle points that can evaluate a gate. */
4
4
  export declare const ASSURANCE_GATE_TRIGGERS: readonly ["pre-commit", "pre-push", "pre-merge", "ci", "pre-release", "post-release", "scheduled", "on-claim", "on-close"];
5
+ /** Supported discriminants for built-in, delegated, and derived measurements. */
6
+ export declare const ASSURANCE_MEASUREMENT_SOURCE_KINDS: readonly ["items", "dependency_kind", "graph", "validate", "health", "history", "links", "provider", "derived"];
5
7
  /** Gate lifecycle trigger. */
6
8
  export type AssuranceGateTrigger = (typeof ASSURANCE_GATE_TRIGGERS)[number];
7
9
  /** Assertion enforcement strength. */
@@ -401,6 +403,13 @@ export interface AssuranceGateVerdict {
401
403
  exit_code: 0 | 1;
402
404
  /** Per-assertion receipts. */
403
405
  assertions: AssuranceAssertionVerdict[];
406
+ /** Total assertions evaluated before any transport projection or compaction. */
407
+ assertions_total: number;
408
+ /** Stable selector for iterating assertion evidence across transports. */
409
+ row_contract: {
410
+ row_keys: ["assertions"];
411
+ jq_selector: ".assertions[]";
412
+ };
404
413
  /** Aggregate compute receipt. */
405
414
  cost: AssuranceMeasurementCost;
406
415
  }