@unbrained/pm-cli 2026.8.20 → 2026.8.22

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 (228) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +38 -0
  3. package/dist/cli/error-guidance.d.ts +29 -4
  4. package/dist/cli/error-guidance.js +43 -43
  5. package/dist/cli/main.d.ts +3 -0
  6. package/dist/cli/main.js +40 -7
  7. package/dist/cli-bundle/bundle-manifest.json +150 -150
  8. package/dist/cli-bundle/chunks/{chunk-L4LGPBJU.js → chunk-BWX4SK46.js} +58 -58
  9. package/dist/cli-bundle/chunks/chunk-EMWDM5FI.js +13 -0
  10. package/dist/cli-bundle/chunks/chunk-HYG6LRL4.js +200 -0
  11. package/dist/cli-bundle/chunks/{chunk-TSMWLCHS.js → chunk-MYYI3ZOA.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-4GB2LTOQ.js → chunk-MZTZQTMS.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-7BRF2BX2.js → chunk-QI2CT3IX.js} +2 -2
  14. package/dist/cli-bundle/chunks/chunk-SMWXHMVB.js +35 -0
  15. package/dist/cli-bundle/chunks/{chunk-US2ZQW2M.js → chunk-U6GQ4VMV.js} +47 -47
  16. package/dist/cli-bundle/chunks/{chunk-K3EN3LK2.js → chunk-VMMIL3SI.js} +2 -2
  17. package/dist/cli-bundle/chunks/chunk-WG4STC36.js +5 -0
  18. package/dist/cli-bundle/chunks/{chunk-XYDDWBZN.js → chunk-YBPJAOQQ.js} +3 -3
  19. package/dist/cli-bundle/chunks/{register-list-query-JSAQCVOC.js → register-list-query-HZKBQNWW.js} +2 -2
  20. package/dist/cli-bundle/chunks/{register-mutation-XJPAW63D.js → register-mutation-HTKEEGRD.js} +2 -2
  21. package/dist/cli-bundle/chunks/{register-operations-DSOSB2XQ.js → register-operations-6EMRWJJY.js} +2 -2
  22. package/dist/cli-bundle/chunks/{register-setup-QUR6QL2C.js → register-setup-QK4OTOXN.js} +2 -2
  23. package/dist/cli-bundle/focused-chunks/{chunk-TDR5OGG3.js → chunk-2ARQGDDW.js} +2 -2
  24. package/dist/cli-bundle/focused-chunks/{chunk-AZBACT5T.js → chunk-2AZT5WXZ.js} +2 -2
  25. package/dist/cli-bundle/focused-chunks/{chunk-M32HFIQB.js → chunk-2POVTNLY.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/chunk-3LKU6PTJ.js +4 -0
  27. package/dist/cli-bundle/focused-chunks/chunk-5SHSBMX2.js +2 -0
  28. package/dist/cli-bundle/focused-chunks/{chunk-UGSS4F5X.js → chunk-6S2MO3Q3.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/{chunk-5L7M4AI7.js → chunk-A2BC5PQL.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/chunk-C4S4A4JJ.js +5 -0
  31. package/dist/cli-bundle/focused-chunks/{chunk-OM65KHGF.js → chunk-D6RBZEJJ.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/chunk-E2EWYPY6.js +16 -0
  33. package/dist/cli-bundle/focused-chunks/{chunk-G3C5ERXG.js → chunk-GMYPD4FX.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/chunk-L5LDSRO2.js +155 -0
  35. package/dist/cli-bundle/focused-chunks/{chunk-BLJCGGID.js → chunk-MB37AYN6.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/chunk-MCOR37QK.js +2 -0
  37. package/dist/cli-bundle/focused-chunks/{chunk-FUREQLQN.js → chunk-PH2OXXVZ.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/{chunk-325UXIO7.js → chunk-PMGJUFNQ.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/chunk-R6SR45XU.js +50 -0
  40. package/dist/cli-bundle/focused-chunks/chunk-WZE4LIPW.js +8 -0
  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 +2 -2
  44. package/dist/cli-bundle/sdk-core.js +40 -40
  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 -32
  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 +5 -5
  52. package/dist/core/extensions/extension-hook-runtime.js +22 -20
  53. package/dist/core/extensions/extension-types.d.ts +8 -1
  54. package/dist/core/extensions/extension-types.js +2 -2
  55. package/dist/core/extensions/loader.js +7 -3
  56. package/dist/core/extensions/service-ownership.d.ts +8 -0
  57. package/dist/core/extensions/service-ownership.js +20 -0
  58. package/dist/core/item/id.js +20 -5
  59. package/dist/core/item/item-format.js +27 -2
  60. package/dist/core/shared/errors.d.ts +20 -0
  61. package/dist/core/shared/errors.js +2 -2
  62. package/dist/core/store/item-store.js +6 -91
  63. package/dist/core/store/tracker-preflight.d.ts +7 -0
  64. package/dist/core/store/tracker-preflight.js +142 -0
  65. package/dist/sdk/agent/refusal-reachability.d.ts +1 -1
  66. package/dist/sdk/agent/tracker-preflight-contracts.d.ts +63 -0
  67. package/dist/sdk/agent/tracker-preflight-contracts.js +127 -0
  68. package/dist/sdk/annotations.js +6 -7
  69. package/dist/sdk/authoring.d.ts +1 -1
  70. package/dist/sdk/authoring.js +2 -2
  71. package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +77 -0
  72. package/dist/sdk/cli-contracts/agent-output-contracts.js +324 -2
  73. package/dist/sdk/cli-contracts/commander-mutation-options.js +3 -3
  74. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +3 -1
  75. package/dist/sdk/cli-contracts/runtime-contracts.js +4 -3
  76. package/dist/sdk/cli-contracts.d.ts +1 -1
  77. package/dist/sdk/cli-contracts.js +3 -3
  78. package/dist/sdk/config.d.ts +5 -0
  79. package/dist/sdk/config.js +5 -5
  80. package/dist/sdk/context-intent-runtime.js +7 -4
  81. package/dist/sdk/contracts.d.ts +1 -0
  82. package/dist/sdk/contracts.js +3 -2
  83. package/dist/sdk/dependencies.js +5 -7
  84. package/dist/sdk/dependency-flag-validation.d.ts +1 -1
  85. package/dist/sdk/dependency-flag-validation.js +10 -4
  86. package/dist/sdk/environment/tracker-preflight.d.ts +6 -0
  87. package/dist/sdk/environment/tracker-preflight.js +10 -0
  88. package/dist/sdk/eval.js +5 -7
  89. package/dist/sdk/extension/install-sources.d.ts +1 -1
  90. package/dist/sdk/extension/install-sources.js +6 -3
  91. package/dist/sdk/extension/output-ownership.d.ts +1 -0
  92. package/dist/sdk/extension/output-ownership.js +3 -2
  93. package/dist/sdk/files.js +6 -10
  94. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +75 -15
  95. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +81 -8
  96. package/dist/sdk/governance/assurance.d.ts +36 -2
  97. package/dist/sdk/governance/assurance.js +184 -10
  98. package/dist/sdk/governance/gc.js +5 -6
  99. package/dist/sdk/governance/health.d.ts +3 -0
  100. package/dist/sdk/governance/health.js +42 -11
  101. package/dist/sdk/governance/hierarchy-validation.d.ts +29 -0
  102. package/dist/sdk/governance/hierarchy-validation.js +109 -0
  103. package/dist/sdk/governance/reindex.js +5 -6
  104. package/dist/sdk/governance/validate.d.ts +2 -9
  105. package/dist/sdk/governance/validate.js +51 -109
  106. package/dist/sdk/graph/assembly.d.ts +6 -1
  107. package/dist/sdk/graph/assembly.js +16 -22
  108. package/dist/sdk/graph/governance-contracts.d.ts +1 -1
  109. package/dist/sdk/graph/governance-contracts.js +8 -2
  110. package/dist/sdk/graph/governance.d.ts +7 -5
  111. package/dist/sdk/graph/governance.js +76 -16
  112. package/dist/sdk/graph/hierarchy-integrity.d.ts +94 -0
  113. package/dist/sdk/graph/hierarchy-integrity.js +311 -0
  114. package/dist/sdk/graph/index.d.ts +2 -1
  115. package/dist/sdk/graph/index.js +3 -2
  116. package/dist/sdk/graph/remediation.js +32 -2
  117. package/dist/sdk/graph/run.d.ts +31 -2
  118. package/dist/sdk/graph/run.js +83 -36
  119. package/dist/sdk/graph/traversal.js +14 -5
  120. package/dist/sdk/graph/workspace-relationship-kind-registry.d.ts +8 -0
  121. package/dist/sdk/graph/workspace-relationship-kind-registry.js +28 -0
  122. package/dist/sdk/history-compact.js +6 -9
  123. package/dist/sdk/history-read.js +5 -7
  124. package/dist/sdk/history-redact.js +5 -6
  125. package/dist/sdk/history-repair.js +6 -9
  126. package/dist/sdk/improvement-ledger.js +7 -10
  127. package/dist/sdk/index.d.ts +4 -2
  128. package/dist/sdk/index.js +5 -3
  129. package/dist/sdk/item-children.js +21 -8
  130. package/dist/sdk/lifecycle/append.d.ts +0 -5
  131. package/dist/sdk/lifecycle/append.js +5 -6
  132. package/dist/sdk/lifecycle/claim.d.ts +0 -5
  133. package/dist/sdk/lifecycle/claim.js +6 -9
  134. package/dist/sdk/lifecycle/close-many.d.ts +0 -5
  135. package/dist/sdk/lifecycle/close-many.js +5 -6
  136. package/dist/sdk/lifecycle/close.d.ts +0 -5
  137. package/dist/sdk/lifecycle/close.js +5 -6
  138. package/dist/sdk/lifecycle/copy.d.ts +0 -5
  139. package/dist/sdk/lifecycle/copy.js +5 -6
  140. package/dist/sdk/lifecycle/create.d.ts +0 -5
  141. package/dist/sdk/lifecycle/create.js +127 -102
  142. package/dist/sdk/lifecycle/delete.js +5 -6
  143. package/dist/sdk/lifecycle/focus.d.ts +0 -5
  144. package/dist/sdk/lifecycle/focus.js +5 -6
  145. package/dist/sdk/lifecycle/hierarchy-mutation-lock.d.ts +15 -0
  146. package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +25 -0
  147. package/dist/sdk/lifecycle/plan.d.ts +0 -5
  148. package/dist/sdk/lifecycle/plan.js +5 -6
  149. package/dist/sdk/lifecycle/restore.js +5 -6
  150. package/dist/sdk/lifecycle/update-many.d.ts +0 -5
  151. package/dist/sdk/lifecycle/update-many.js +5 -6
  152. package/dist/sdk/lifecycle/update.d.ts +2 -5
  153. package/dist/sdk/lifecycle/update.js +211 -84
  154. package/dist/sdk/linked-artifacts.js +6 -7
  155. package/dist/sdk/merge/install.js +5 -6
  156. package/dist/sdk/mutation-events.js +5 -7
  157. package/dist/sdk/package-import-adapters.js +6 -8
  158. package/dist/sdk/profile.js +6 -7
  159. package/dist/sdk/query/activity.js +5 -6
  160. package/dist/sdk/query/calendar.js +5 -6
  161. package/dist/sdk/query/complete-list.d.ts +3 -3
  162. package/dist/sdk/query/complete-list.js +46 -3
  163. package/dist/sdk/query/get.d.ts +0 -5
  164. package/dist/sdk/query/get.js +5 -6
  165. package/dist/sdk/query/history.d.ts +0 -5
  166. package/dist/sdk/query/history.js +5 -6
  167. package/dist/sdk/query/list.d.ts +4 -3
  168. package/dist/sdk/query/list.js +92 -54
  169. package/dist/sdk/query/search.js +5 -7
  170. package/dist/sdk/read-output-contracts.d.ts +5 -1
  171. package/dist/sdk/read-output-contracts.js +87 -22
  172. package/dist/sdk/relationship-context.js +3 -4
  173. package/dist/sdk/relationship-kinds/contract.d.ts +8 -0
  174. package/dist/sdk/relationship-kinds/contract.js +13 -13
  175. package/dist/sdk/relationships.d.ts +1 -1
  176. package/dist/sdk/relationships.js +27 -2
  177. package/dist/sdk/runtime.d.ts +3 -2
  178. package/dist/sdk/runtime.js +3 -2
  179. package/dist/sdk/schema-migration.js +6 -7
  180. package/dist/sdk/schema.js +5 -6
  181. package/dist/sdk/stats.js +5 -8
  182. package/dist/sdk/templates.js +5 -6
  183. package/dist/sdk/test/batch.js +15 -9
  184. package/dist/sdk/test/execution.js +12 -5
  185. package/dist/sdk/test/runs.js +5 -7
  186. package/dist/types.d.ts +11 -0
  187. package/dist/types.js +2 -2
  188. package/docs/AGENT_UX_CONTRACTS.md +24 -1
  189. package/docs/COMMANDS.md +29 -14
  190. package/docs/DEPENDENCY_KIND_CONTRACT.md +40 -1
  191. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +98 -0
  192. package/docs/EXTENSIONS.md +2 -1
  193. package/docs/README.md +1 -0
  194. package/docs/READ_OUTPUT_CONTRACTS.md +9 -2
  195. package/docs/RECURRENCE_RECOVERY_CONTRACTS.md +37 -0
  196. package/docs/RELATIONSHIP_GRAPH.md +97 -12
  197. package/docs/SDK_PRIMITIVE_INVENTORY.md +15 -1
  198. package/docs/TESTING.md +15 -0
  199. package/marketplace.json +2 -2
  200. package/package.json +1 -1
  201. package/packages/pm-beads/package.json +1 -1
  202. package/packages/pm-calendar/package.json +1 -1
  203. package/packages/pm-command-kit/package.json +1 -1
  204. package/packages/pm-digital-twin/package.json +1 -1
  205. package/packages/pm-governance-audit/package.json +1 -1
  206. package/packages/pm-guide-shell/package.json +1 -1
  207. package/packages/pm-kanban/package.json +1 -1
  208. package/packages/pm-lifecycle-hooks/package.json +1 -1
  209. package/packages/pm-linked-test-adapters/package.json +1 -1
  210. package/packages/pm-search-advanced/package.json +1 -1
  211. package/packages/pm-templates/package.json +1 -1
  212. package/packages/pm-todos/package.json +1 -1
  213. package/packages/pm-vcs/package.json +1 -1
  214. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  215. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  216. package/sdk/public-surface.json +848 -56
  217. package/dist/cli-bundle/chunks/chunk-2RDVGYWE.js +0 -13
  218. package/dist/cli-bundle/chunks/chunk-BLVQHFSY.js +0 -35
  219. package/dist/cli-bundle/chunks/chunk-CU25EQVV.js +0 -5
  220. package/dist/cli-bundle/chunks/chunk-RS3IV2R6.js +0 -197
  221. package/dist/cli-bundle/focused-chunks/chunk-6AHG2YW7.js +0 -50
  222. package/dist/cli-bundle/focused-chunks/chunk-GXWQBE3T.js +0 -8
  223. package/dist/cli-bundle/focused-chunks/chunk-JWKEDZJI.js +0 -4
  224. package/dist/cli-bundle/focused-chunks/chunk-KYZ6JGPL.js +0 -155
  225. package/dist/cli-bundle/focused-chunks/chunk-Q47EX4DI.js +0 -2
  226. package/dist/cli-bundle/focused-chunks/chunk-RIHDMCUM.js +0 -2
  227. package/dist/cli-bundle/focused-chunks/chunk-T4ZFY7ZJ.js +0 -16
  228. package/dist/cli-bundle/focused-chunks/chunk-Z3PLWSGM.js +0 -2
@@ -1,6 +1,6 @@
1
1
  /** @module cli/commands/dependency-flag-validation */
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f9c9b926-c912-548e-a9c7-64c2c69767cd")}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]="d6f359cb-2bc9-5f96-8789-db91512d0bd5")}catch(e){}}();
4
4
  import { EXIT_CODE } from "../core/shared/constants.js";
5
5
  import { PmCliError } from "../core/shared/errors.js";
6
6
  import { toErrorMessage } from "../core/shared/primitives.js";
@@ -9,9 +9,15 @@ import { isExternalDependencySourceKind } from "./dependency-provenance.js";
9
9
  import { resolveWorkspaceRelationshipKindRegistry } from "./graph/assembly.js";
10
10
  import { assertRelationshipEdgeAllowed, } from "./relationships.js";
11
11
  /** Reject malformed shorthand before item-id prefix normalization can create a dangling graph node. */
12
- export function assertValidBareDependencyFlagValue(value, structured) {
12
+ export function assertValidBareDependencyFlagValue(value, structured, flag = "--dep") {
13
13
  if (!structured && /[:,=]/.test(value)) {
14
- throw new PmCliError(`Invalid --dep value "${value}". Use a bare item id or id=<id>,kind=<kind>.`, EXIT_CODE.USAGE);
14
+ throw new PmCliError(`Invalid ${flag} value "${value}". Use a bare item id or id=<id>,kind=<kind>.`, EXIT_CODE.USAGE, {
15
+ code: "dependency_flag_value_invalid",
16
+ reason: "malformed_dependency_shorthand",
17
+ flag,
18
+ value,
19
+ required: "Use a bare item id or an explicit id=<id>,kind=<kind> entry.",
20
+ });
15
21
  }
16
22
  }
17
23
  /**
@@ -148,4 +154,4 @@ export async function assertDependencyTargetsResolvable(params) {
148
154
  return missingTargets.map((target) => `dependency_target_unresolved:${target}`);
149
155
  }
150
156
  //# sourceMappingURL=dependency-flag-validation.js.map
151
- //# debugId=f9c9b926-c912-548e-a9c7-64c2c69767cd
157
+ //# debugId=d6f359cb-2bc9-5f96-8789-db91512d0bd5
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @module sdk/environment/tracker-preflight
3
+ *
4
+ * Exposes tracker initialization and filesystem preflight primitives to SDK consumers.
5
+ */
6
+ export { assertInitializedTracker, assertReadableTrackerRoot, buildTrackerInitializationRecovery, } from "../../core/store/tracker-preflight.js";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @module sdk/environment/tracker-preflight
3
+ *
4
+ * Exposes tracker initialization and filesystem preflight primitives to SDK consumers.
5
+ */
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]="745b9c3b-538c-558f-b018-b406ca4318f0")}catch(e){}}();
8
+ export { assertInitializedTracker, assertReadableTrackerRoot, buildTrackerInitializationRecovery, } from "../../core/store/tracker-preflight.js";
9
+ //# sourceMappingURL=tracker-preflight.js.map
10
+ //# debugId=745b9c3b-538c-558f-b018-b406ca4318f0
package/dist/sdk/eval.js CHANGED
@@ -10,15 +10,15 @@
10
10
  * instead of silently degrading retrieval quality.
11
11
  */
12
12
 
13
- !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]="b90a064c-f423-5bf7-9fbf-1fb273c7b5af")}catch(e){}}();
13
+ !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]="9cc9405b-d2b8-59aa-893f-54892595788a")}catch(e){}}();
14
+ import { assertInitializedTracker } from "./environment/tracker-preflight.js";
14
15
  import fs from "node:fs/promises";
15
16
  import path from "node:path";
16
17
  import { aggregateEvalMetrics, DEFAULT_EVAL_K, EVAL_QUERY_SET_EXAMPLE, EVAL_QUERY_SET_SCHEMA_ID, evaluateRanking, parseEvalQuerySet, } from "../core/search/eval.js";
17
18
  import { EXIT_CODE } from "../core/shared/constants.js";
18
19
  import { PmCliError } from "../core/shared/errors.js";
19
20
  import { coercePositiveInteger } from "../core/shared/primitives.js";
20
- import { pathExists } from "../core/fs/fs-utils.js";
21
- import { getSettingsPath, resolvePmRoot } from "../core/store/paths.js";
21
+ import { resolvePmRoot } from "../core/store/paths.js";
22
22
  import { runSearch } from "./query/search.js";
23
23
  export { EVAL_QUERY_SET_CONTRACT, EVAL_QUERY_SET_EXAMPLE, EVAL_QUERY_SET_SCHEMA_ID, parseEvalQuerySet, } from "../core/search/eval.js";
24
24
  /** Relative location (under the pm root) of the default golden-query set. A git-tracked, human-curated file so relevance ground truth lives alongside the tracker it evaluates. */
@@ -170,9 +170,7 @@ const buildEvalResult = (k, reports, rawMetrics, failUnder) => {
170
170
  */
171
171
  export const runEval = async (options, global) => {
172
172
  const pmRoot = resolvePmRoot(process.cwd(), global.path);
173
- if (!(await pathExists(getSettingsPath(pmRoot)))) {
174
- throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
175
- }
173
+ await assertInitializedTracker(pmRoot);
176
174
  const k = parseEvalK(options.k);
177
175
  const defaultMode = parseEvalMode(options.mode);
178
176
  const failUnder = parseFailUnder(options.failUnder);
@@ -190,4 +188,4 @@ export const runEval = async (options, global) => {
190
188
  return buildEvalResult(k, reports, rawMetrics, failUnder);
191
189
  };
192
190
  //# sourceMappingURL=eval.js.map
193
- //# debugId=b90a064c-f423-5bf7-9fbf-1fb273c7b5af
191
+ //# debugId=9cc9405b-d2b8-59aa-893f-54892595788a
@@ -91,7 +91,7 @@ export declare function runGitCommand(args: string[], execRunner?: typeof execFi
91
91
  export declare function resolveNpmCommandName(platform?: NodeJS.Platform): "npm" | "npm.cmd";
92
92
  /** Implements should run npm command in shell for the public runtime surface of this module. */
93
93
  export declare function shouldRunNpmCommandInShell(platform?: NodeJS.Platform): boolean;
94
- declare function runNpmCommand(args: string[], cwd?: string, execRunner?: typeof execFileAsync, platform?: NodeJS.Platform): Promise<string>;
94
+ declare function runNpmCommand(args: string[], cwd?: string, execRunner?: typeof execFileAsync, platform?: NodeJS.Platform, environment?: NodeJS.ProcessEnv): Promise<string>;
95
95
  declare function npmPackageNameFromSpec(spec: string): string;
96
96
  /** Implements check whether npm not found error for the public runtime surface of this module. */
97
97
  export declare function isNpmNotFoundError(error: unknown): boolean;
@@ -4,7 +4,7 @@
4
4
  * Implements extension package-management support for Install Sources.
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]="8994c8e2-8e3a-5e00-a3ca-7bd553c045d7")}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]="89b84412-aa15-5868-95b3-c8d898b1f480")}catch(e){}}();
8
8
  import { execFile } from "node:child_process";
9
9
  import fs from "node:fs/promises";
10
10
  import os from "node:os";
@@ -200,12 +200,15 @@ export function resolveNpmCommandName(platform = process.platform) {
200
200
  export function shouldRunNpmCommandInShell(platform = process.platform) {
201
201
  return platform === "win32";
202
202
  }
203
- async function runNpmCommand(args, cwd, execRunner = execFileAsync, platform = process.platform) {
203
+ async function runNpmCommand(args, cwd, execRunner = execFileAsync, platform = process.platform, environment = process.env) {
204
204
  const npmCommand = resolveNpmCommandName(platform);
205
+ const env = Object.fromEntries(Object.entries(environment).filter(([key]) => key.toLowerCase() !== "npm_config_allow_scripts"));
206
+ env.NPM_CONFIG_ALLOW_SCRIPTS = "";
205
207
  try {
206
208
  const result = await execRunner(npmCommand, args, {
207
209
  cwd,
208
210
  encoding: "utf8",
211
+ env,
209
212
  shell: shouldRunNpmCommandInShell(platform),
210
213
  });
211
214
  return (result.stdout ?? "").trim();
@@ -959,4 +962,4 @@ export const _testOnlyInstallSources = {
959
962
  runNpmCommand,
960
963
  };
961
964
  //# sourceMappingURL=install-sources.js.map
962
- //# debugId=8994c8e2-8e3a-5e00-a3ca-7bd553c045d7
965
+ //# debugId=89b84412-aa15-5868-95b3-c8d898b1f480
@@ -4,6 +4,7 @@ interface OutputActivationSummary {
4
4
  service: string;
5
5
  layer: string;
6
6
  name: string;
7
+ passThrough?: boolean;
7
8
  }>;
8
9
  };
9
10
  renderers: {
@@ -4,7 +4,7 @@
4
4
  * Classifies output overrides against manifest-declared command ownership.
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]="0dc7b063-dc72-595f-8e40-8a06f9db69e1")}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]="e5a4cea9-ac5d-5bda-9f7c-6cf8cf9e9998")}catch(e){}}();
8
8
  import { normalizeExtensionNameForMatch } from "./shared.js";
9
9
  /** Collect doctor warnings for output overrides without an explicit command or result ownership boundary. */
10
10
  export function collectGlobalOutputOverrideDoctorWarnings(activationResult, loadResult) {
@@ -13,6 +13,7 @@ export function collectGlobalOutputOverrideDoctorWarnings(activationResult, load
13
13
  : []));
14
14
  const serviceWarnings = activationResult.services.overrides
15
15
  .filter((entry) => entry.service === "output_format")
16
+ .filter((entry) => entry.passThrough !== true)
16
17
  .filter((entry) => !commandScopedOwners.has(`${entry.layer}:${normalizeExtensionNameForMatch(entry.name)}`))
17
18
  .map((entry) => `extension_output_service_override_global:${entry.service}:${entry.layer}:${entry.name}`);
18
19
  const rendererWarnings = activationResult.renderers.overrides
@@ -22,4 +23,4 @@ export function collectGlobalOutputOverrideDoctorWarnings(activationResult, load
22
23
  return [...new Set([...serviceWarnings, ...rendererWarnings])].sort((left, right) => left.localeCompare(right));
23
24
  }
24
25
  //# sourceMappingURL=output-ownership.js.map
25
- //# debugId=0dc7b063-dc72-595f-8e40-8a06f9db69e1
26
+ //# debugId=e5a4cea9-ac5d-5bda-9f7c-6cf8cf9e9998
package/dist/sdk/files.js CHANGED
@@ -4,10 +4,10 @@
4
4
  * Implements the pm files 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]="515cd35c-8e0e-51d4-8ad9-1cea5be8a572")}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]="ed504f2b-8b78-5fca-a4a7-7b0709a65533")}catch(e){}}();
8
+ import { assertInitializedTracker } from "./environment/tracker-preflight.js";
8
9
  import fs from "node:fs/promises";
9
10
  import path from "node:path";
10
- import { pathExists } from "../core/fs/fs-utils.js";
11
11
  import { getActiveExtensionRegistrations, hasActiveOnReadHooks, } from "../core/extensions/index.js";
12
12
  import { resolveItemTypeRegistry } from "../core/item/type-registry.js";
13
13
  import { EXIT_CODE } from "../core/shared/constants.js";
@@ -15,7 +15,7 @@ import { PmCliError } from "../core/shared/errors.js";
15
15
  import { locateItem, listAllItemMetadata, mutateItem, readLocatedItem, } from "../core/store/item-store.js";
16
16
  import { readItemMetadataDerivedIndexState } from "../core/store/item-metadata-cache.js";
17
17
  import { queryLinkedFileMetadataIndex } from "../core/store/item-metadata-query-index.js";
18
- import { getSettingsPath, resolvePmRoot, resolveWorkspaceRoot, } from "../core/store/paths.js";
18
+ import { resolvePmRoot, resolveWorkspaceRoot, } from "../core/store/paths.js";
19
19
  import { readSettings } from "../core/store/settings.js";
20
20
  import { resolveAuthor } from "../core/shared/author.js";
21
21
  import { isPathWithinDirectory } from "../core/fs/path-utils.js";
@@ -371,9 +371,7 @@ async function queryFilesLookupSource(params) {
371
371
  export async function runFilesLookup(options, global) {
372
372
  const pmRoot = resolvePmRoot(process.cwd(), global.path);
373
373
  const workspaceRoot = resolveWorkspaceRoot(pmRoot);
374
- if (!(await pathExists(getSettingsPath(pmRoot)))) {
375
- throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
376
- }
374
+ await assertInitializedTracker(pmRoot);
377
375
  const paths = await normalizeFilesLookupPaths(options.paths, workspaceRoot);
378
376
  if (options.lineRange && paths.length !== 1) {
379
377
  throw new PmCliError("Files lookup line attribution requires exactly one source path.", EXIT_CODE.USAGE);
@@ -428,9 +426,7 @@ export async function runFilesLookup(options, global) {
428
426
  export async function runFilesDiscover(id, options, global) {
429
427
  const pmRoot = resolvePmRoot(process.cwd(), global.path);
430
428
  const workspaceRoot = resolveWorkspaceRoot(pmRoot);
431
- if (!(await pathExists(getSettingsPath(pmRoot)))) {
432
- throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
433
- }
429
+ await assertInitializedTracker(pmRoot);
434
430
  const settings = await readSettings(pmRoot);
435
431
  const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
436
432
  const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
@@ -537,4 +533,4 @@ export async function runFilesDiscover(id, options, global) {
537
533
  };
538
534
  }
539
535
  //# sourceMappingURL=files.js.map
540
- //# debugId=515cd35c-8e0e-51d4-8ad9-1cea5be8a572
536
+ //# debugId=ed504f2b-8b78-5fca-a4a7-7b0709a65533
@@ -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]="145e12fa-839c-59da-840b-e2a0f3f13065")}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]="2903ebb9-541a-5636-ae3c-e996d3f0cec4")}catch(e){}}();
4
4
  export const PM_ERROR_CODE_CATALOG_PART_1 = [
5
5
  {
6
6
  code: "acceptance_criteria_mutation_conflict",
@@ -494,6 +494,30 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
494
494
  canonical_code: "dependency_edge_not_allowed",
495
495
  aliases: [],
496
496
  },
497
+ {
498
+ code: "dependency_flag_value_invalid",
499
+ meaning: "Dependency flag value invalid condition.",
500
+ stability: "provisional",
501
+ exit_code: 2,
502
+ class: "usage",
503
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
504
+ sources: ["sdk/dependency-flag-validation.ts"],
505
+ emitting_commands: ["*"],
506
+ canonical_code: "dependency_flag_value_invalid",
507
+ aliases: [],
508
+ },
509
+ {
510
+ code: "dependency_remove_no_match",
511
+ meaning: "Dependency remove no match condition.",
512
+ stability: "provisional",
513
+ exit_code: 3,
514
+ class: "not_found",
515
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
516
+ sources: ["sdk/lifecycle/update.ts"],
517
+ emitting_commands: ["update"],
518
+ canonical_code: "dependency_remove_no_match",
519
+ aliases: [],
520
+ },
497
521
  {
498
522
  code: "dependency_target_not_found",
499
523
  meaning: "Dependency target not found condition.",
@@ -681,7 +705,7 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
681
705
  exit_code: 1,
682
706
  class: "generic_failure",
683
707
  recovery: "Inspect the structured error guidance and retry the suggested command.",
684
- sources: ["sdk/agent/refusal-closure.ts"],
708
+ sources: ["sdk/agent/refusal-closure.ts", "sdk/agent/tracker-preflight-contracts.ts"],
685
709
  emitting_commands: ["*"],
686
710
  canonical_code: "error_code_mismatch",
687
711
  aliases: [],
@@ -710,6 +734,18 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
710
734
  canonical_code: "event_index_unavailable",
711
735
  aliases: [],
712
736
  },
737
+ {
738
+ code: "exit_code_mismatch",
739
+ meaning: "Exit code mismatch condition.",
740
+ stability: "provisional",
741
+ exit_code: 1,
742
+ class: "generic_failure",
743
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
744
+ sources: ["sdk/agent/tracker-preflight-contracts.ts"],
745
+ emitting_commands: ["*"],
746
+ canonical_code: "exit_code_mismatch",
747
+ aliases: [],
748
+ },
713
749
  {
714
750
  code: "extension_command_activation_failed",
715
751
  meaning: "Extension command activation failed condition.",
@@ -926,6 +962,42 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
926
962
  canonical_code: "github_source_entry_unbuilt",
927
963
  aliases: [],
928
964
  },
965
+ {
966
+ code: "hierarchy_cardinality_created",
967
+ meaning: "Hierarchy cardinality created condition.",
968
+ stability: "provisional",
969
+ exit_code: 4,
970
+ class: "conflict",
971
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
972
+ sources: ["sdk/graph/hierarchy-integrity.ts"],
973
+ emitting_commands: ["*"],
974
+ canonical_code: "hierarchy_cardinality_created",
975
+ aliases: [],
976
+ },
977
+ {
978
+ code: "hierarchy_cycle_created",
979
+ meaning: "Hierarchy cycle created condition.",
980
+ stability: "provisional",
981
+ exit_code: 4,
982
+ class: "conflict",
983
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
984
+ sources: ["sdk/graph/hierarchy-integrity.ts"],
985
+ emitting_commands: ["*"],
986
+ canonical_code: "hierarchy_cycle_created",
987
+ aliases: [],
988
+ },
989
+ {
990
+ code: "hierarchy_parent_divergence_created",
991
+ meaning: "Hierarchy parent divergence created condition.",
992
+ stability: "provisional",
993
+ exit_code: 4,
994
+ class: "conflict",
995
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
996
+ sources: ["sdk/graph/hierarchy-integrity.ts"],
997
+ emitting_commands: ["*"],
998
+ canonical_code: "hierarchy_parent_divergence_created",
999
+ aliases: [],
1000
+ },
929
1001
  {
930
1002
  code: "history_author_acknowledge_plan_conflict",
931
1003
  meaning: "History author acknowledge plan conflict condition.",
@@ -1896,18 +1968,6 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1896
1968
  canonical_code: "missing_budget",
1897
1969
  aliases: [],
1898
1970
  },
1899
- {
1900
- code: "missing_cli_flag",
1901
- meaning: "Missing cli flag condition.",
1902
- stability: "provisional",
1903
- exit_code: 1,
1904
- class: "generic_failure",
1905
- recovery: "Inspect the structured error guidance and retry the suggested command.",
1906
- sources: ["sdk/cli-contracts/tool-option-contracts.ts"],
1907
- emitting_commands: ["*"],
1908
- canonical_code: "missing_cli_flag",
1909
- aliases: [],
1910
- },
1911
1971
  ];
1912
1972
  //# sourceMappingURL=generated-error-code-catalog-part-1.js.map
1913
- //# debugId=145e12fa-839c-59da-840b-e2a0f3f13065
1973
+ //# debugId=2903ebb9-541a-5636-ae3c-e996d3f0cec4
@@ -1,7 +1,19 @@
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]="8555c35d-af49-53cd-b782-e9d2fbf65d2f")}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]="4f1bb829-c6be-5a3e-90f2-4b0062aa2dac")}catch(e){}}();
4
4
  export const PM_ERROR_CODE_CATALOG_PART_2 = [
5
+ {
6
+ code: "missing_cli_flag",
7
+ meaning: "Missing cli flag condition.",
8
+ stability: "provisional",
9
+ exit_code: 1,
10
+ class: "generic_failure",
11
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
12
+ sources: ["sdk/cli-contracts/tool-option-contracts.ts"],
13
+ emitting_commands: ["*"],
14
+ canonical_code: "missing_cli_flag",
15
+ aliases: [],
16
+ },
5
17
  {
6
18
  code: "missing_destination",
7
19
  meaning: "Missing destination condition.",
@@ -26,6 +38,18 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
26
38
  canonical_code: "missing_directory",
27
39
  aliases: [],
28
40
  },
41
+ {
42
+ code: "missing_init_recovery",
43
+ meaning: "Missing init recovery condition.",
44
+ stability: "provisional",
45
+ exit_code: 1,
46
+ class: "generic_failure",
47
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
48
+ sources: ["sdk/agent/tracker-preflight-contracts.ts"],
49
+ emitting_commands: ["*"],
50
+ canonical_code: "missing_init_recovery",
51
+ aliases: [],
52
+ },
29
53
  {
30
54
  code: "missing_lifecycle_target",
31
55
  meaning: "Missing lifecycle target condition.",
@@ -74,6 +98,18 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
74
98
  canonical_code: "missing_parameter_alias",
75
99
  aliases: [],
76
100
  },
101
+ {
102
+ code: "missing_probe",
103
+ meaning: "Missing probe condition.",
104
+ stability: "provisional",
105
+ exit_code: 1,
106
+ class: "generic_failure",
107
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
108
+ sources: ["sdk/agent/tracker-preflight-contracts.ts"],
109
+ emitting_commands: ["*"],
110
+ canonical_code: "missing_probe",
111
+ aliases: [],
112
+ },
77
113
  {
78
114
  code: "missing_required_argument",
79
115
  meaning: "Missing required argument condition.",
@@ -483,6 +519,18 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
483
519
  canonical_code: "read_output_cursor_stale",
484
520
  aliases: [],
485
521
  },
522
+ {
523
+ code: "recovery_kind_mismatch",
524
+ meaning: "Recovery kind mismatch condition.",
525
+ stability: "provisional",
526
+ exit_code: 1,
527
+ class: "generic_failure",
528
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
529
+ sources: ["sdk/agent/tracker-preflight-contracts.ts"],
530
+ emitting_commands: ["*"],
531
+ canonical_code: "recovery_kind_mismatch",
532
+ aliases: [],
533
+ },
486
534
  {
487
535
  code: "redundant_edge",
488
536
  meaning: "Redundant edge condition.",
@@ -586,7 +634,7 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
586
634
  exit_code: 1,
587
635
  class: "generic_failure",
588
636
  recovery: "Inspect the structured error guidance and retry the suggested command.",
589
- sources: ["sdk/agent/refusal-closure.ts"],
637
+ sources: ["sdk/agent/refusal-closure.ts", "sdk/agent/tracker-preflight-contracts.ts"],
590
638
  emitting_commands: ["*"],
591
639
  canonical_code: "retry_failed",
592
640
  aliases: [],
@@ -970,12 +1018,16 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
970
1018
  exit_code: 3,
971
1019
  class: "not_found",
972
1020
  recovery: "Inspect the structured error guidance and retry the suggested command.",
973
- sources: ["cli/error-guidance.ts", "core/telemetry/observability.ts"],
1021
+ sources: [
1022
+ "cli/error-guidance.ts",
1023
+ "core/store/tracker-preflight.ts",
1024
+ "core/telemetry/observability.ts",
1025
+ ],
974
1026
  emitting_commands: ["*"],
975
1027
  canonical_code: "tracker_not_initialized",
976
1028
  aliases: [],
977
1029
  owned_states: [
978
- { state: "selected_tracker_root_is_a_regular_file", probe_id: "tracker-root-regular-file", entrypoints: ["list"], expected_exit_class: "not_found" },
1030
+ { state: "selected_tracker_root_exists_without_settings", probe_id: "tracker-root-settings-missing", entrypoints: ["list"], expected_exit_class: "not_found" },
979
1031
  ],
980
1032
  },
981
1033
  {
@@ -985,10 +1037,13 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
985
1037
  exit_code: 3,
986
1038
  class: "not_found",
987
1039
  recovery: "Inspect the structured error guidance and retry the suggested command.",
988
- sources: ["core/store/item-store.ts"],
1040
+ sources: ["core/store/tracker-preflight.ts"],
989
1041
  emitting_commands: ["*"],
990
1042
  canonical_code: "tracker_root_missing",
991
1043
  aliases: [],
1044
+ owned_states: [
1045
+ { state: "selected_tracker_root_does_not_exist", probe_id: "tracker-root-missing", entrypoints: ["list"], expected_exit_class: "not_found" },
1046
+ ],
992
1047
  },
993
1048
  {
994
1049
  code: "tracker_root_not_directory",
@@ -997,10 +1052,13 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
997
1052
  exit_code: 2,
998
1053
  class: "usage",
999
1054
  recovery: "Inspect the structured error guidance and retry the suggested command.",
1000
- sources: ["core/store/item-store.ts"],
1055
+ sources: ["core/store/tracker-preflight.ts"],
1001
1056
  emitting_commands: ["*"],
1002
1057
  canonical_code: "tracker_root_not_directory",
1003
1058
  aliases: [],
1059
+ owned_states: [
1060
+ { state: "selected_tracker_root_is_a_regular_file", probe_id: "tracker-root-not-directory", entrypoints: ["list"], expected_exit_class: "usage" },
1061
+ ],
1004
1062
  },
1005
1063
  {
1006
1064
  code: "tracker_root_unreadable",
@@ -1009,10 +1067,13 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
1009
1067
  exit_code: 1,
1010
1068
  class: "generic_failure",
1011
1069
  recovery: "Inspect the structured error guidance and retry the suggested command.",
1012
- sources: ["core/store/item-store.ts"],
1070
+ sources: ["core/store/tracker-preflight.ts"],
1013
1071
  emitting_commands: ["*"],
1014
1072
  canonical_code: "tracker_root_unreadable",
1015
1073
  aliases: [],
1074
+ owned_states: [
1075
+ { state: "selected_tracker_root_is_not_readable", probe_id: "tracker-root-unreadable", entrypoints: ["list"], expected_exit_class: "generic_failure" },
1076
+ ],
1016
1077
  },
1017
1078
  {
1018
1079
  code: "type_duplicate",
@@ -1219,6 +1280,18 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
1219
1280
  { state: "package_lifecycle_token_is_not_declared", probe_id: "package-unknown-action", entrypoints: ["package"], expected_exit_class: "usage" },
1220
1281
  ],
1221
1282
  },
1283
+ {
1284
+ code: "unsafe_init_recovery",
1285
+ meaning: "Unsafe init recovery condition.",
1286
+ stability: "provisional",
1287
+ exit_code: 1,
1288
+ class: "generic_failure",
1289
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1290
+ sources: ["sdk/agent/tracker-preflight-contracts.ts"],
1291
+ emitting_commands: ["*"],
1292
+ canonical_code: "unsafe_init_recovery",
1293
+ aliases: [],
1294
+ },
1222
1295
  {
1223
1296
  code: "unsupported_update_option",
1224
1297
  meaning: "Unsupported update option condition.",
@@ -1917,4 +1990,4 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
1917
1990
  },
1918
1991
  ];
1919
1992
  //# sourceMappingURL=generated-error-code-catalog-part-2.js.map
1920
- //# debugId=8555c35d-af49-53cd-b782-e9d2fbf65d2f
1993
+ //# debugId=4f1bb829-c6be-5a3e-90f2-4b0062aa2dac
@@ -3,7 +3,7 @@ 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
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"];
6
+ export declare const ASSURANCE_MEASUREMENT_SOURCE_KINDS: readonly ["items", "dependency_kind", "prose_edge_gap", "graph", "validate", "health", "history", "links", "provider", "derived"];
7
7
  /** Gate lifecycle trigger. */
8
8
  export type AssuranceGateTrigger = (typeof ASSURANCE_GATE_TRIGGERS)[number];
9
9
  /** Assertion enforcement strength. */
@@ -20,6 +20,8 @@ export interface AssuranceDependencyRecord {
20
20
  id: string;
21
21
  /** Typed relationship kind. */
22
22
  kind: string;
23
+ /** Provenance channel that created or justified the edge. */
24
+ source_kind?: string;
23
25
  }
24
26
  /** Minimal item projection consumed by built-in measurement sources. */
25
27
  export interface AssuranceItemRecord {
@@ -80,6 +82,32 @@ export interface AssuranceDependencyKindSource {
80
82
  kind: "dependency_kind";
81
83
  /** Relationship kind to count. */
82
84
  dependency_kind: string;
85
+ /** Require an exact dependency provenance channel. */
86
+ source_kind?: string;
87
+ /** Require a dependency provenance channel with this prefix. */
88
+ source_kind_prefix?: string;
89
+ /** Require dependency provenance to be present or missing. */
90
+ source_kind_state?: "present" | "missing";
91
+ }
92
+ /** Evidence-backed exemption from prose-to-edge parity. */
93
+ export interface AssuranceProseEdgeExemption {
94
+ /** Holder whose prose contains the reference. */
95
+ holder_id: string;
96
+ /** Optional referenced item; omission exempts every matching pair on the holder. */
97
+ target_id?: string;
98
+ /** Optional literal that must occur in the same prose segment as the reference. */
99
+ text_contains?: string;
100
+ /** Reviewable explanation for why no typed edge should exist. */
101
+ reason: string;
102
+ }
103
+ /** Prose-reference parity source evaluated directly over authoritative item rows. */
104
+ export interface AssuranceProseEdgeGapSource {
105
+ /** Source discriminant. */
106
+ kind: "prose_edge_gap";
107
+ /** Explicit false-positive ledger; every row requires a reason. */
108
+ exemptions?: AssuranceProseEdgeExemption[];
109
+ /** Maximum diagnostic contributors retained after the counts are computed. */
110
+ sample_limit?: number;
83
111
  }
84
112
  /** Graph-analytics source delegated to a host adapter. */
85
113
  export interface AssuranceGraphSource {
@@ -170,7 +198,7 @@ export interface AssuranceDerivedSource {
170
198
  expression: AssuranceDerivedExpression;
171
199
  }
172
200
  /** Complete measurement source vocabulary. */
173
- export type AssuranceMeasurementSource = AssuranceItemsSource | AssuranceDependencyKindSource | AssuranceGraphSource | AssuranceValidateSource | AssuranceHealthSource | AssuranceHistorySource | AssuranceLinksSource | AssuranceProviderSource | AssuranceDerivedSource;
201
+ export type AssuranceMeasurementSource = AssuranceItemsSource | AssuranceDependencyKindSource | AssuranceProseEdgeGapSource | AssuranceGraphSource | AssuranceValidateSource | AssuranceHealthSource | AssuranceHistorySource | AssuranceLinksSource | AssuranceProviderSource | AssuranceDerivedSource;
174
202
  /** Persisted measurement declaration. */
175
203
  export interface AssuranceMeasurementDefinition {
176
204
  /** Stable registry id. */
@@ -302,6 +330,8 @@ export interface AssuranceExternalMeasurementResult {
302
330
  cost: number;
303
331
  /** Optional contributors that moved the value. */
304
332
  contributors?: string[];
333
+ /** Optional exact named sub-populations within the observed value. */
334
+ partitions?: Readonly<Record<string, number>>;
305
335
  }
306
336
  /** SDK evaluation inputs supplied by a host. */
307
337
  export interface AssuranceEvaluationContext {
@@ -348,6 +378,8 @@ export interface AssuranceMeasurementResult {
348
378
  cost: AssuranceMeasurementCost;
349
379
  /** Optional contributors. */
350
380
  contributors: string[];
381
+ /** Optional exact named sub-populations within the observed value. */
382
+ partitions?: Readonly<Record<string, number>>;
351
383
  }
352
384
  /** Structured assertion bound. */
353
385
  export interface AssuranceBound {
@@ -384,6 +416,8 @@ export interface AssuranceAssertionVerdict {
384
416
  cost: AssuranceMeasurementCost;
385
417
  /** Optional contributors. */
386
418
  contributors: string[];
419
+ /** Optional exact named sub-populations within the observed value. */
420
+ partitions?: Readonly<Record<string, number>>;
387
421
  }
388
422
  /** Complete gate verdict shared by every presentation and execution surface. */
389
423
  export interface AssuranceGateVerdict {