@unbrained/pm-cli 2026.8.8 → 2026.8.9

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 (144) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +19 -0
  3. package/dist/cli-bundle/bundle-manifest.json +154 -154
  4. package/dist/cli-bundle/chunks/chunk-2DTCZXSD.js +13 -0
  5. package/dist/cli-bundle/chunks/{chunk-ALDHXLPS.js → chunk-5JO6R4BS.js} +2 -2
  6. package/dist/cli-bundle/chunks/chunk-5KN4DZYV.js +194 -0
  7. package/dist/cli-bundle/chunks/chunk-EF43KODO.js +2 -0
  8. package/dist/cli-bundle/chunks/{chunk-NUXRRNAB.js → chunk-GMX5YOI3.js} +25 -25
  9. package/dist/cli-bundle/chunks/chunk-HUV2Z7IS.js +28 -0
  10. package/dist/cli-bundle/chunks/{chunk-SQ7QZFQ6.js → chunk-MHBVCUF2.js} +2 -2
  11. package/dist/cli-bundle/chunks/chunk-PYO5GZU6.js +5 -0
  12. package/dist/cli-bundle/chunks/{chunk-CBLA33YK.js → chunk-RJC7TPF4.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-2ZMXX3Q6.js → chunk-YC3UF2IO.js} +64 -64
  14. package/dist/cli-bundle/chunks/{register-list-query-WFZAMJHZ.js → register-list-query-BUE7PTCU.js} +2 -2
  15. package/dist/cli-bundle/chunks/{register-mutation-SOKKOTHQ.js → register-mutation-FC3XLVIK.js} +2 -2
  16. package/dist/cli-bundle/chunks/{register-operations-5XQETS6E.js → register-operations-YH2WAOXU.js} +2 -2
  17. package/dist/cli-bundle/chunks/{register-setup-2HL5ZHMK.js → register-setup-UQDTNTLJ.js} +2 -2
  18. package/dist/cli-bundle/focused-chunks/chunk-2VVP5RAA.js +153 -0
  19. package/dist/cli-bundle/focused-chunks/{chunk-IAS7PMLG.js → chunk-3GSFUDAI.js} +2 -2
  20. package/dist/cli-bundle/focused-chunks/chunk-3WVHTUAW.js +5 -0
  21. package/dist/cli-bundle/focused-chunks/chunk-4H6MVCK3.js +16 -0
  22. package/dist/cli-bundle/focused-chunks/{chunk-ZOLDTUU7.js → chunk-54TZJ4BM.js} +2 -2
  23. package/dist/cli-bundle/focused-chunks/{chunk-YKPE4PPY.js → chunk-5NK5TJ5D.js} +2 -2
  24. package/dist/cli-bundle/focused-chunks/{chunk-ANTMGYLI.js → chunk-6DO4YQWZ.js} +2 -2
  25. package/dist/cli-bundle/focused-chunks/chunk-73FIJONU.js +2 -0
  26. package/dist/cli-bundle/focused-chunks/{chunk-PL2EYDJK.js → chunk-C3GCHDSQ.js} +29 -27
  27. package/dist/cli-bundle/focused-chunks/{chunk-U646T7Z6.js → chunk-JGRSQZJT.js} +3 -3
  28. package/dist/cli-bundle/focused-chunks/{chunk-YSAHYUXX.js → chunk-KNEHLPBF.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/chunk-MRWVJ3ZG.js +2 -0
  30. package/dist/cli-bundle/focused-chunks/chunk-NL57J7BZ.js +4 -0
  31. package/dist/cli-bundle/focused-chunks/{chunk-DMKOMTTY.js → chunk-P6BBIQRG.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/{chunk-GWI6YIKJ.js → chunk-PZAGVQNN.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/chunk-QDAO3XEK.js +14 -0
  34. package/dist/cli-bundle/focused-chunks/{chunk-SM2PJGP3.js → chunk-T4IGQCSY.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/chunk-U46GQJNY.js +2 -0
  36. package/dist/cli-bundle/focused-chunks/{chunk-TCSAPH33.js → chunk-VRXJSGIT.js} +6 -6
  37. package/dist/cli-bundle/focused-chunks/{chunk-FI6DWU2M.js → chunk-XC2ZW3CJ.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/chunk-ZG54B4XG.js +2 -0
  39. package/dist/cli-bundle/main.js +2 -2
  40. package/dist/cli-bundle/sdk-authoring.js +1 -1
  41. package/dist/cli-bundle/sdk-contracts.js +1 -1
  42. package/dist/cli-bundle/sdk-core.js +29 -29
  43. package/dist/cli-bundle/sdk-governance.js +1 -1
  44. package/dist/cli-bundle/sdk-graph.js +1 -1
  45. package/dist/cli-bundle/sdk-merge.js +1 -1
  46. package/dist/cli-bundle/sdk-query.js +1 -1
  47. package/dist/cli-bundle/sdk-runtime.js +1 -1
  48. package/dist/cli-bundle/sdk-testing.js +1 -1
  49. package/dist/cli-bundle/sdk.js +2 -2
  50. package/dist/core/diagnostics/remediation.js +12 -2
  51. package/dist/core/history/history.js +13 -4
  52. package/dist/core/item/actionability.d.ts +7 -1
  53. package/dist/core/item/actionability.js +71 -15
  54. package/dist/core/shared/author.d.ts +25 -0
  55. package/dist/core/shared/author.js +114 -9
  56. package/dist/sdk/actionability.d.ts +1 -1
  57. package/dist/sdk/actionability.js +3 -3
  58. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +8 -0
  59. package/dist/sdk/cli-contracts/runtime-contracts.js +17 -2
  60. package/dist/sdk/core-governance.d.ts +1 -1
  61. package/dist/sdk/core-governance.js +3 -3
  62. package/dist/sdk/dependencies.d.ts +2 -0
  63. package/dist/sdk/dependencies.js +7 -6
  64. package/dist/sdk/extension/bundled-catalog.js +19 -6
  65. package/dist/sdk/generated-error-code-catalog.js +38 -2
  66. package/dist/sdk/governance/health.js +29 -10
  67. package/dist/sdk/governance/provenance-health.d.ts +26 -0
  68. package/dist/sdk/governance/provenance-health.js +139 -0
  69. package/dist/sdk/governance/validate.js +13 -8
  70. package/dist/sdk/governance.d.ts +1 -0
  71. package/dist/sdk/governance.js +3 -2
  72. package/dist/sdk/graph/assembly.d.ts +4 -0
  73. package/dist/sdk/graph/assembly.js +22 -2
  74. package/dist/sdk/graph/run.d.ts +2 -0
  75. package/dist/sdk/graph/run.js +3 -2
  76. package/dist/sdk/lifecycle/close.js +13 -8
  77. package/dist/sdk/lifecycle/create.js +6 -12
  78. package/dist/sdk/lifecycle/plan.js +6 -3
  79. package/dist/sdk/lifecycle/update.js +6 -20
  80. package/dist/sdk/merge/driver.d.ts +2 -1
  81. package/dist/sdk/merge/driver.js +7 -4
  82. package/dist/sdk/merge/install.js +3 -3
  83. package/dist/sdk/merge/receipts.d.ts +14 -1
  84. package/dist/sdk/merge/receipts.js +36 -8
  85. package/dist/sdk/merge/reconcile.js +21 -4
  86. package/dist/sdk/merge/three-way.d.ts +6 -2
  87. package/dist/sdk/merge/three-way.js +24 -10
  88. package/dist/sdk/query/get.d.ts +11 -0
  89. package/dist/sdk/query/get.js +37 -3
  90. package/dist/sdk/read-output-contracts.d.ts +1 -1
  91. package/dist/sdk/read-output-contracts.js +23 -4
  92. package/dist/sdk/relationship-kinds/contract.d.ts +48 -0
  93. package/dist/sdk/relationship-kinds/contract.js +22 -0
  94. package/dist/sdk/relationships.d.ts +6 -41
  95. package/dist/sdk/relationships.js +12 -126
  96. package/dist/sdk/runtime-primitives.d.ts +1 -1
  97. package/dist/sdk/runtime-primitives.js +3 -3
  98. package/dist/sdk/similarity.d.ts +5 -0
  99. package/dist/sdk/similarity.js +40 -10
  100. package/dist/sdk/structured-mutations.js +5 -2
  101. package/dist/sdk/test/linked-command-detection.d.ts +2 -7
  102. package/dist/sdk/test/linked-command-detection.js +22 -9
  103. package/docs/AGENT_GUIDE.md +2 -1
  104. package/docs/COMMANDS.md +19 -1
  105. package/docs/DEPENDENCY_KIND_CONTRACT.md +29 -0
  106. package/docs/ITEM_READ_PROJECTIONS.md +26 -0
  107. package/docs/MERGE_SAFETY.md +10 -3
  108. package/docs/RELATIONSHIP_GRAPH.md +1 -1
  109. package/docs/SDK_AGENT_SESSION_CONTEXT.md +35 -2
  110. package/docs/SDK_CONTEXT_INTEGRITY.md +16 -1
  111. package/docs/SENTRY_CONTRACT_EPOCHS.md +20 -0
  112. package/docs/agent-task-token-baseline.json +2 -2
  113. package/marketplace.json +2 -2
  114. package/package.json +1 -1
  115. package/packages/pm-beads/package.json +1 -1
  116. package/packages/pm-calendar/package.json +1 -1
  117. package/packages/pm-command-kit/package.json +1 -1
  118. package/packages/pm-digital-twin/package.json +1 -1
  119. package/packages/pm-governance-audit/package.json +1 -1
  120. package/packages/pm-guide-shell/package.json +1 -1
  121. package/packages/pm-kanban/package.json +1 -1
  122. package/packages/pm-lifecycle-hooks/package.json +1 -1
  123. package/packages/pm-linked-test-adapters/package.json +1 -1
  124. package/packages/pm-search-advanced/package.json +1 -1
  125. package/packages/pm-templates/package.json +1 -1
  126. package/packages/pm-todos/package.json +1 -1
  127. package/packages/pm-vcs/package.json +1 -1
  128. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  129. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  130. package/sdk/public-surface.json +231 -27
  131. package/dist/cli-bundle/chunks/chunk-GKA54IJM.js +0 -5
  132. package/dist/cli-bundle/chunks/chunk-KRY7SRUO.js +0 -2
  133. package/dist/cli-bundle/chunks/chunk-MNJ4NNSY.js +0 -26
  134. package/dist/cli-bundle/chunks/chunk-OJPCFDDY.js +0 -13
  135. package/dist/cli-bundle/chunks/chunk-PFSD3DAN.js +0 -194
  136. package/dist/cli-bundle/focused-chunks/chunk-54EU2UVO.js +0 -2
  137. package/dist/cli-bundle/focused-chunks/chunk-5FLBTZJQ.js +0 -2
  138. package/dist/cli-bundle/focused-chunks/chunk-5GJ57YKN.js +0 -2
  139. package/dist/cli-bundle/focused-chunks/chunk-CMDS3KYT.js +0 -14
  140. package/dist/cli-bundle/focused-chunks/chunk-F5B3HBEZ.js +0 -5
  141. package/dist/cli-bundle/focused-chunks/chunk-FNOKJG6N.js +0 -16
  142. package/dist/cli-bundle/focused-chunks/chunk-FPDYXZBK.js +0 -4
  143. package/dist/cli-bundle/focused-chunks/chunk-HCUC62AB.js +0 -2
  144. package/dist/cli-bundle/focused-chunks/chunk-HGNKPSCB.js +0 -153
@@ -4,7 +4,7 @@
4
4
  * Implements the pm deps 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]="a3535267-c69a-5a44-bdf9-02925e02aaeb")}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]="ee0547d9-ae0f-5762-8bff-e25f0a3cd4d5")}catch(e){}}();
8
8
  import { getActiveExtensionRegistrations } from "../core/extensions/index.js";
9
9
  import { pathExists } from "../core/fs/fs-utils.js";
10
10
  import { resolveItemTypeRegistry } from "../core/item/type-registry.js";
@@ -637,7 +637,7 @@ function buildTreeOrGraphDepsResult(id, format, options, index, maxDepth, collap
637
637
  budget.reasons.add("token_budget");
638
638
  }
639
639
  }
640
- function attachDepsProjection(result, summaryOnly) {
640
+ function attachDepsProjection(result, summaryOnly, legacyAliasCounts = {}) {
641
641
  const group = {
642
642
  name: result.format === "tree"
643
643
  ? "dependency_tree"
@@ -648,6 +648,7 @@ function attachDepsProjection(result, summaryOnly) {
648
648
  };
649
649
  return {
650
650
  ...result,
651
+ legacy_alias_counts: legacyAliasCounts,
651
652
  projection: {
652
653
  mode: summaryOnly ? "summary" : "full",
653
654
  declared_field_groups: [group],
@@ -705,16 +706,16 @@ export async function runDeps(id, options, global) {
705
706
  rootEvidence,
706
707
  summaryOnly,
707
708
  outputFormat: global.json === true ? "json" : "toon",
708
- }), summaryOnly);
709
+ }), summaryOnly, lookup.assembly.legacyAliasCounts);
709
710
  }
710
711
  if (summaryOnly) {
711
712
  return attachDepsProjection({
712
713
  id,
713
714
  format,
714
715
  ...countDependencyGraph(id, index, maxDepth),
715
- }, true);
716
+ }, true, Object.fromEntries(Object.entries(assembleWorkspaceRelationshipGraph(items, (status) => isTerminalStatus(status, statusRegistry)).legacyAliasCounts)));
716
717
  }
717
- return attachDepsProjection(buildTreeOrGraphDepsResult(id, format, options, index, maxDepth, collapse, global.json === true ? "json" : "toon"), false);
718
+ return attachDepsProjection(buildTreeOrGraphDepsResult(id, format, options, index, maxDepth, collapse, global.json === true ? "json" : "toon"), false, Object.fromEntries(Object.entries(assembleWorkspaceRelationshipGraph(items, (status) => isTerminalStatus(status, statusRegistry)).legacyAliasCounts)));
718
719
  }
719
720
  //# sourceMappingURL=dependencies.js.map
720
- //# debugId=a3535267-c69a-5a44-bdf9-02925e02aaeb
721
+ //# debugId=ee0547d9-ae0f-5762-8bff-e25f0a3cd4d5
@@ -4,7 +4,7 @@
4
4
  * Implements extension package-management support for Bundled Catalog.
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]="27a2b542-853e-52e1-ad80-11bab01b07a2")}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]="259656b0-09b7-52c5-8f54-52ac29eec607")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { collectPackageExtensionDirectories, PM_PACKAGE_RESOURCE_KINDS, readPmPackageManifest, } from "../../core/packages/manifest.js";
@@ -187,7 +187,7 @@ function buildBundledCatalogLinks(manifest) {
187
187
  };
188
188
  }
189
189
  /** Build one bundled-package catalog entry from its manifest, marking it `installed` when the managed state for `scope` already records the package by built-in alias or resolved location, and projecting the metadata-only resource kinds (everything except installable `extensions`) that the package ships. */
190
- function buildBundledCatalogPackageEntry(manifest, bundledEntry, scope, installedBuiltinAliases, installedLocations) {
190
+ function buildBundledCatalogPackageEntry(manifest, bundledEntry, aliases, scope, installedBuiltinAliases, installedLocations) {
191
191
  const installScopeFlag = scope === "global" ? "--global" : "--project";
192
192
  const metadataOnlyResources = Object.fromEntries(PM_PACKAGE_RESOURCE_KINDS.filter((resourceKind) => resourceKind !== "extensions")
193
193
  .map((resourceKind) => [
@@ -197,9 +197,10 @@ function buildBundledCatalogPackageEntry(manifest, bundledEntry, scope, installe
197
197
  .filter(([, entries]) => Array.isArray(entries) && entries.length > 0));
198
198
  return {
199
199
  alias: bundledEntry.alias,
200
+ aliases,
200
201
  bundled: true,
201
202
  available: true,
202
- installed: installedBuiltinAliases.has(bundledEntry.alias) ||
203
+ installed: aliases.some((alias) => installedBuiltinAliases.has(alias)) ||
203
204
  installedLocations.has(path.resolve(bundledEntry.package_root)),
204
205
  install_target: bundledEntry.alias,
205
206
  install_command: `pm install ${bundledEntry.alias} ${installScopeFlag}`,
@@ -240,9 +241,20 @@ export async function buildBundledPackageCatalog(scope, global, options = {}) {
240
241
  .filter((value) => typeof value === "string" && value.trim().length > 0)
241
242
  .map((value) => value.trim().toLowerCase()));
242
243
  const packages = [];
243
- for (const bundledEntry of await collectBundledPackageEntries()) {
244
+ const bundledEntriesByRoot = new Map();
245
+ for (const entry of await collectBundledPackageEntries()) {
246
+ const packageRoot = path.resolve(entry.package_root);
247
+ const groupedEntries = bundledEntriesByRoot.get(packageRoot) ?? [];
248
+ groupedEntries.push(entry);
249
+ bundledEntriesByRoot.set(packageRoot, groupedEntries);
250
+ }
251
+ for (const bundledEntries of bundledEntriesByRoot.values()) {
252
+ const bundledEntry = bundledEntries[0];
253
+ const aliases = bundledEntries
254
+ .map((entry) => entry.alias)
255
+ .sort((left, right) => left.localeCompare(right));
244
256
  const manifest = await readPmPackageManifest(bundledEntry.package_root);
245
- packages.push(buildBundledCatalogPackageEntry(manifest, bundledEntry, scope, installedBuiltinAliases, installedLocations));
257
+ packages.push(buildBundledCatalogPackageEntry(manifest, bundledEntry, aliases, scope, installedBuiltinAliases, installedLocations));
246
258
  }
247
259
  const fields = parsePackageCatalogFields(options.fields);
248
260
  const outputPackages = fields
@@ -258,6 +270,7 @@ export async function buildBundledPackageCatalog(scope, global, options = {}) {
258
270
  }
259
271
  const PACKAGE_CATALOG_FIELD_KEYS = new Set([
260
272
  "alias",
273
+ "aliases",
261
274
  "bundled",
262
275
  "available",
263
276
  "installed",
@@ -317,4 +330,4 @@ export const _testOnlyBundledCatalog = {
317
330
  projectPackageCatalogEntry,
318
331
  };
319
332
  //# sourceMappingURL=bundled-catalog.js.map
320
- //# debugId=27a2b542-853e-52e1-ad80-11bab01b07a2
333
+ //# debugId=259656b0-09b7-52c5-8f54-52ac29eec607
@@ -4,7 +4,7 @@
4
4
  * Generated by scripts/generate-error-code-catalog.mjs. Do not edit manually.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8a086b83-e46b-5694-be66-9114b0d87e12")}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]="bcb7a0a9-268f-5cf8-aefc-766b67e92168")}catch(e){}}();
8
8
  import { definePmErrorCodeCatalog } from "./error-code-catalog.js";
9
9
  /** Exhaustive catalog generated from literal error guidance declarations. */
10
10
  export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
@@ -1469,6 +1469,18 @@ export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
1469
1469
  canonical_code: "merge_conflict_markers_detected",
1470
1470
  aliases: ["history_merge_conflict_markers_detected"],
1471
1471
  },
1472
+ {
1473
+ code: "merge_decisions_unreviewed",
1474
+ meaning: "Merge decisions unreviewed condition.",
1475
+ stability: "provisional",
1476
+ exit_code: 1,
1477
+ class: "generic_failure",
1478
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1479
+ sources: ["core/diagnostics/remediation.ts"],
1480
+ emitting_commands: ["*"],
1481
+ canonical_code: "merge_decisions_unreviewed",
1482
+ aliases: [],
1483
+ },
1472
1484
  {
1473
1485
  code: "merge_git_config_unwritable",
1474
1486
  meaning: "Merge git config unwritable condition.",
@@ -1481,6 +1493,18 @@ export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
1481
1493
  canonical_code: "merge_git_config_unwritable",
1482
1494
  aliases: [],
1483
1495
  },
1496
+ {
1497
+ code: "merge_reconcile_discards_require_acceptance",
1498
+ meaning: "Merge reconcile discards require acceptance condition.",
1499
+ stability: "provisional",
1500
+ exit_code: 4,
1501
+ class: "conflict",
1502
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1503
+ sources: ["sdk/merge/reconcile.ts"],
1504
+ emitting_commands: ["*"],
1505
+ canonical_code: "merge_reconcile_discards_require_acceptance",
1506
+ aliases: [],
1507
+ },
1484
1508
  {
1485
1509
  code: "merge_root_not_found",
1486
1510
  meaning: "Merge root not found condition.",
@@ -2587,6 +2611,18 @@ export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
2587
2611
  canonical_code: "validate_lifecycle_stale_blockers",
2588
2612
  aliases: [],
2589
2613
  },
2614
+ {
2615
+ code: "validate_merge_decisions_unreviewed",
2616
+ meaning: "Validate merge decisions unreviewed condition.",
2617
+ stability: "provisional",
2618
+ exit_code: 1,
2619
+ class: "generic_failure",
2620
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
2621
+ sources: ["core/diagnostics/remediation.ts"],
2622
+ emitting_commands: ["*"],
2623
+ canonical_code: "validate_merge_decisions_unreviewed",
2624
+ aliases: [],
2625
+ },
2590
2626
  {
2591
2627
  code: "validate_merge_fence_drift",
2592
2628
  meaning: "Validate merge fence drift condition.",
@@ -3021,4 +3057,4 @@ export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
3021
3057
  },
3022
3058
  ]);
3023
3059
  //# sourceMappingURL=generated-error-code-catalog.js.map
3024
- //# debugId=8a086b83-e46b-5694-be66-9114b0d87e12
3060
+ //# debugId=bcb7a0a9-268f-5cf8-aefc-766b67e92168
@@ -4,7 +4,7 @@
4
4
  * Implements the pm health command surface and its agent-facing runtime behavior.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4efa3db2-6be7-5650-b1c7-d80e125694aa")}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]="97e1ed14-cd36-5910-b829-4619af6080e1")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
@@ -35,12 +35,13 @@ import { readSettingsWithMetadata } from "../../core/store/settings.js";
35
35
  import { buildRemediationMap } from "../../core/diagnostics/remediation.js";
36
36
  import { scanHistoryAuthorAttribution, } from "../author-attribution.js";
37
37
  import { readManagedExtensionState } from "../extension.js";
38
+ import { scanProvenanceResolverHealth } from "./provenance-health.js";
38
39
  import { applyStoredExtensionMigrationState } from "../extension/migrations.js";
39
40
  import { buildCapabilityContractMetadata, buildRegistrationCollisionRemediation, collectUnknownCapabilityGuidance, } from "../extension/doctor.js";
40
41
  import { scanStaleInProgressItems, } from "./stale-work.js";
41
42
  import { scanTrackedRuntimeCache } from "./tracked-runtime-cache.js";
42
43
  import { auditMergeDriverConfiguration, findGitWorkspaceRoot, } from "../merge/install.js";
43
- import { listMergeReceipts } from "../merge/receipts.js";
44
+ import { listMergeReceipts, partitionMergeReceipts, } from "../merge/receipts.js";
44
45
  const PM_TELEMETRY_SOURCE_CONTEXT_SET = new Set(PM_TELEMETRY_SOURCE_CONTEXT_VALUES);
45
46
  const STALE_VECTORIZATION_SUMMARY_LIMIT = 25;
46
47
  const BRIEF_HEALTH_DETAIL_LIMIT = 8;
@@ -58,6 +59,7 @@ function isAdvisoryHealthWarning(warning, requireMergeDrivers = false) {
58
59
  return (warning.startsWith("telemetry_") ||
59
60
  warning.startsWith("history_stream_over_compact_threshold:") ||
60
61
  warning.startsWith("stale_in_progress_items:") ||
62
+ warning.startsWith("provenance_resolver_zero_success:") ||
61
63
  (!requireMergeDrivers &&
62
64
  warning.startsWith("merge_driver_configuration_missing:")));
63
65
  }
@@ -318,7 +320,10 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema, requireMergeDri
318
320
  const mergeDriverAudit = gitWorkspaceRoot === null
319
321
  ? null
320
322
  : await auditMergeDriverConfiguration(gitWorkspaceRoot);
321
- const pendingMergeReceipts = gitWorkspaceRoot === null ? [] : await listMergeReceipts(gitWorkspaceRoot);
323
+ const pendingMergeReceipts = gitWorkspaceRoot === null
324
+ ? []
325
+ : await listMergeReceipts(gitWorkspaceRoot, { includeLossless: true });
326
+ const { pendingDecisions: pendingMergeDecisions, lossless: losslessMergeReceipts, } = partitionMergeReceipts(pendingMergeReceipts);
322
327
  const mergeDriverInstallationMissing = mergeDriverAudit?.status === "missing" &&
323
328
  mergeDriverAudit.missing_keys.length === 5 &&
324
329
  mergeDriverAudit.drifted_keys.length === 0;
@@ -343,8 +348,8 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema, requireMergeDri
343
348
  `merge_driver_configuration_${mergeDriverInstallationMissing ? "missing" : "drift"}:${mergeDriverAudit.missing_keys.length + mergeDriverAudit.drifted_keys.length}`,
344
349
  ]
345
350
  : []),
346
- ...(pendingMergeReceipts.length > 0
347
- ? [`merge_decisions_unreviewed:${pendingMergeReceipts.length}`]
351
+ ...(pendingMergeDecisions.length > 0
352
+ ? [`merge_decisions_unreviewed:${pendingMergeDecisions.length}`]
348
353
  : []),
349
354
  ];
350
355
  const normalizedWarnings = [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
@@ -369,7 +374,8 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema, requireMergeDri
369
374
  ? 0
370
375
  : mergeDriverAudit.missing_keys.length +
371
376
  mergeDriverAudit.drifted_keys.length,
372
- pending_merge_decisions: pendingMergeReceipts.length,
377
+ pending_merge_decisions: pendingMergeDecisions.length,
378
+ lossless_merge_receipts: losslessMergeReceipts.length,
373
379
  },
374
380
  item_unreadable: itemScan.unreadable,
375
381
  item_conflict_markers: itemScan.conflictMarkers,
@@ -392,7 +398,10 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema, requireMergeDri
392
398
  required: requireMergeDrivers,
393
399
  },
394
400
  pending_merge_decision_items: [
395
- ...new Set(pendingMergeReceipts.map((receipt) => receipt.item_id)),
401
+ ...new Set(pendingMergeDecisions.map((receipt) => receipt.item_id)),
402
+ ].sort((left, right) => left.localeCompare(right)),
403
+ lossless_merge_receipt_items: [
404
+ ...new Set(losslessMergeReceipts.map((receipt) => receipt.item_id)),
396
405
  ].sort((left, right) => left.localeCompare(right)),
397
406
  },
398
407
  },
@@ -1693,7 +1702,7 @@ const resolveUnknownAuthorEventCount = (authorAttribution) => authorAttribution.
1693
1702
  /** Preserve actionable-author semantics for current and legacy scan payloads. */
1694
1703
  const resolveActionableUnknownAuthorEventCount = (authorAttribution) => authorAttribution.actionable_unknown_event_count ??
1695
1704
  resolveUnknownAuthorEventCount(authorAttribution);
1696
- function buildStorageHealthCheck(items, settings, historySummary, authorAttribution, staleInProgress) {
1705
+ function buildStorageHealthCheck(items, settings, historySummary, authorAttribution, staleInProgress, provenanceResolverOutcomes) {
1697
1706
  const unknownAuthorEventCount = resolveUnknownAuthorEventCount(authorAttribution);
1698
1707
  const actionableUnknownAuthorEventCount = resolveActionableUnknownAuthorEventCount(authorAttribution);
1699
1708
  const hasAuthorEvents = unknownAuthorEventCount > 0;
@@ -1726,6 +1735,9 @@ function buildStorageHealthCheck(items, settings, historySummary, authorAttribut
1726
1735
  ...(hasStaleInProgressItems
1727
1736
  ? { stale_in_progress: staleInProgress }
1728
1737
  : {}),
1738
+ ...(provenanceResolverOutcomes.length > 0
1739
+ ? { provenance_resolver_outcomes: provenanceResolverOutcomes }
1740
+ : {}),
1729
1741
  ...(historySummary.max_entries !== null
1730
1742
  ? {
1731
1743
  compact_policy: {
@@ -1756,6 +1768,7 @@ function collectHealthWarnings(params) {
1756
1768
  ...params.historySummary.warnings,
1757
1769
  ...params.authorAttributionWarnings,
1758
1770
  ...params.staleInProgressWarnings,
1771
+ ...params.provenanceWarnings,
1759
1772
  ...params.locksCheck.warnings,
1760
1773
  ...params.integrityCheck.warnings,
1761
1774
  ...params.historyDriftCheck.warnings,
@@ -1779,6 +1792,7 @@ function buildHealthRemediationSources(params) {
1779
1792
  ...params.historySummary.over_threshold.map((id) => `history_stream_over_compact_threshold:${id}`),
1780
1793
  ...params.authorAttributionWarnings,
1781
1794
  ...params.staleInProgressWarnings,
1795
+ ...params.provenanceWarnings,
1782
1796
  ],
1783
1797
  locks: params.locksCheck.warnings,
1784
1798
  integrity: params.integrityCheck.warnings,
@@ -1865,6 +1879,9 @@ export async function runHealth(global, options = {}) {
1865
1879
  in_progress_status: settings.schema.workflow.in_progress_status,
1866
1880
  threshold_hours: settings.mutation_guard.stale_in_progress_hours,
1867
1881
  }));
1882
+ const provenanceResolverHealth = await scanProvenanceResolverHealth(pmRoot);
1883
+ const provenanceResolverOutcomes = provenanceResolverHealth.outcomes;
1884
+ const provenanceWarnings = provenanceResolverHealth.warnings;
1868
1885
  const locksCheck = await buildLocksCheck(pmRoot);
1869
1886
  const integrityCheck = skipPolicy.skipIntegrity
1870
1887
  ? buildSkippedHealthCheck("integrity")
@@ -1881,7 +1898,7 @@ export async function runHealth(global, options = {}) {
1881
1898
  buildSettingsValuesHealthCheck(settingWarnings),
1882
1899
  telemetryCheck.check,
1883
1900
  extensionCheck.check,
1884
- buildStorageHealthCheck(items, settings, historySummary, authorAttribution, staleInProgress.scan),
1901
+ buildStorageHealthCheck(items, settings, historySummary, authorAttribution, staleInProgress.scan, provenanceResolverOutcomes),
1885
1902
  locksCheck.check,
1886
1903
  integrityCheck.check,
1887
1904
  historyDriftCheck.check,
@@ -1898,6 +1915,7 @@ export async function runHealth(global, options = {}) {
1898
1915
  historySummary,
1899
1916
  authorAttributionWarnings,
1900
1917
  staleInProgressWarnings: staleInProgress.warnings,
1918
+ provenanceWarnings,
1901
1919
  locksCheck,
1902
1920
  integrityCheck,
1903
1921
  historyDriftCheck,
@@ -1914,6 +1932,7 @@ export async function runHealth(global, options = {}) {
1914
1932
  historySummary,
1915
1933
  authorAttributionWarnings,
1916
1934
  staleInProgressWarnings: staleInProgress.warnings,
1935
+ provenanceWarnings,
1917
1936
  locksCheck,
1918
1937
  integrityCheck,
1919
1938
  historyDriftCheck,
@@ -1964,4 +1983,4 @@ export const _testOnlyHealthCommand = {
1964
1983
  warningCode,
1965
1984
  };
1966
1985
  //# sourceMappingURL=health.js.map
1967
- //# debugId=4efa3db2-6be7-5650-b1c7-d80e125694aa
1986
+ //# debugId=97e1ed14-cd36-5910-b829-4619af6080e1
@@ -0,0 +1,26 @@
1
+ /** Aggregated resolver attempts for one harness provenance dimension. */
2
+ export interface ProvenanceResolverHealthOutcome {
3
+ /** Detected harness namespace. */
4
+ harness: string;
5
+ /** Provenance dimension resolved by the bounded resolver. */
6
+ dimension: string;
7
+ /** Built-in resolver name. */
8
+ resolver: string;
9
+ /** Events on which the resolver was actually attempted. */
10
+ attempts: number;
11
+ /** Attempted events that produced a bounded value. */
12
+ successes: number;
13
+ }
14
+ /** Bounded provenance health result suitable for `pm health` adapters. */
15
+ export interface ProvenanceResolverHealthScan {
16
+ /** Stable resolver outcome aggregates. */
17
+ outcomes: ProvenanceResolverHealthOutcome[];
18
+ /** Advisory warnings for attempted resolvers with no success. */
19
+ warnings: string[];
20
+ /** Number of nonblank history events inspected. */
21
+ events_read: number;
22
+ /** Whether an event or byte ceiling omitted history input. */
23
+ truncated: boolean;
24
+ }
25
+ /** Scan immutable history without failing over malformed streams owned by integrity checks. */
26
+ export declare function scanProvenanceResolverHealth(pmRoot: string, eventLimit?: number): Promise<ProvenanceResolverHealthScan>;
@@ -0,0 +1,139 @@
1
+ /**
2
+ * @module sdk/governance/provenance-health
3
+ *
4
+ * Reads bounded, privacy-safe provenance resolver outcomes for health checks.
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]="68d4d540-a878-57f1-b2ae-00b111f94b43")}catch(e){}}();
8
+ import fs from "node:fs/promises";
9
+ import path from "node:path";
10
+ const DEFAULT_PROVENANCE_HISTORY_BYTE_LIMIT = 8_388_608;
11
+ function isRecord(value) {
12
+ return typeof value === "object" && value !== null && !Array.isArray(value);
13
+ }
14
+ async function listHistoryFiles(pmRoot) {
15
+ try {
16
+ return (await fs.readdir(path.join(pmRoot, "history")))
17
+ .filter((file) => file.endsWith(".jsonl"))
18
+ .sort();
19
+ }
20
+ catch {
21
+ return [];
22
+ }
23
+ }
24
+ async function readHistoryFile(pmRoot, file, byteLimit) {
25
+ let handle;
26
+ try {
27
+ handle = await fs.open(path.join(pmRoot, "history", file), "r");
28
+ const size = (await handle.stat()).size;
29
+ const length = Math.min(size, Math.max(0, byteLimit));
30
+ const buffer = Buffer.alloc(length);
31
+ const { bytesRead } = await handle.read(buffer, 0, length, 0);
32
+ const decoded = buffer.subarray(0, bytesRead).toString("utf8");
33
+ const complete = bytesRead >= size;
34
+ const finalNewline = decoded.lastIndexOf("\n");
35
+ let content = decoded;
36
+ if (!complete) {
37
+ content = finalNewline === -1 ? "" : decoded.slice(0, finalNewline + 1);
38
+ }
39
+ return {
40
+ content,
41
+ bytesRead,
42
+ complete,
43
+ };
44
+ }
45
+ catch {
46
+ return null;
47
+ }
48
+ finally {
49
+ await handle?.close();
50
+ }
51
+ }
52
+ function parseHistoryEntry(line) {
53
+ try {
54
+ const value = JSON.parse(line);
55
+ return isRecord(value) ? value : null;
56
+ }
57
+ catch {
58
+ return null;
59
+ }
60
+ }
61
+ function collectResolverOutcomes(entry, aggregates) {
62
+ if (!isRecord(entry.context))
63
+ return;
64
+ const outcomes = entry.context.agent_provenance_outcomes;
65
+ if (!isRecord(outcomes) || typeof entry.agent_harness !== "string")
66
+ return;
67
+ for (const [dimension, rawOutcome] of Object.entries(outcomes)) {
68
+ if (!isRecord(rawOutcome) || typeof rawOutcome.resolver !== "string") {
69
+ continue;
70
+ }
71
+ if (rawOutcome.status !== "resolved" && rawOutcome.status !== "failed") {
72
+ continue;
73
+ }
74
+ const key = `${entry.agent_harness}\0${dimension}\0${rawOutcome.resolver}`;
75
+ const aggregate = aggregates.get(key) ?? {
76
+ harness: entry.agent_harness,
77
+ dimension,
78
+ resolver: rawOutcome.resolver,
79
+ attempts: 0,
80
+ successes: 0,
81
+ };
82
+ aggregate.attempts += 1;
83
+ if (rawOutcome.status === "resolved")
84
+ aggregate.successes += 1;
85
+ aggregates.set(key, aggregate);
86
+ }
87
+ }
88
+ function collectHistoryContent(content, aggregates, eventLimit, initialEventsRead) {
89
+ let eventsRead = initialEventsRead;
90
+ for (const line of content.split("\n")) {
91
+ if (line.trim().length === 0)
92
+ continue;
93
+ if (eventsRead >= eventLimit)
94
+ return { eventsRead, truncated: true };
95
+ eventsRead += 1;
96
+ const entry = parseHistoryEntry(line);
97
+ if (entry)
98
+ collectResolverOutcomes(entry, aggregates);
99
+ }
100
+ return { eventsRead, truncated: false };
101
+ }
102
+ /** Scan immutable history without failing over malformed streams owned by integrity checks. */
103
+ export async function scanProvenanceResolverHealth(pmRoot, eventLimit = 10_000) {
104
+ const aggregates = new Map();
105
+ let eventsRead = 0;
106
+ let bytesRead = 0;
107
+ let truncated = false;
108
+ for (const file of await listHistoryFiles(pmRoot)) {
109
+ const history = await readHistoryFile(pmRoot, file, Math.max(0, DEFAULT_PROVENANCE_HISTORY_BYTE_LIMIT - bytesRead));
110
+ if (history === null)
111
+ continue;
112
+ bytesRead += history.bytesRead;
113
+ const collected = collectHistoryContent(history.content, aggregates, eventLimit, eventsRead);
114
+ eventsRead = collected.eventsRead;
115
+ if (collected.truncated) {
116
+ truncated = true;
117
+ break;
118
+ }
119
+ if (!history.complete) {
120
+ truncated = true;
121
+ break;
122
+ }
123
+ }
124
+ const outcomes = [...aggregates.values()].sort((left, right) => left.harness.localeCompare(right.harness) ||
125
+ left.dimension.localeCompare(right.dimension) ||
126
+ left.resolver.localeCompare(right.resolver));
127
+ return {
128
+ outcomes,
129
+ warnings: truncated
130
+ ? []
131
+ : outcomes
132
+ .filter((outcome) => outcome.attempts > 0 && outcome.successes === 0)
133
+ .map((outcome) => `provenance_resolver_zero_success:${outcome.harness}:${outcome.dimension}:${outcome.resolver}:${String(outcome.attempts)}`),
134
+ events_read: eventsRead,
135
+ truncated,
136
+ };
137
+ }
138
+ //# sourceMappingURL=provenance-health.js.map
139
+ //# debugId=68d4d540-a878-57f1-b2ae-00b111f94b43
@@ -4,7 +4,7 @@
4
4
  * Implements the pm validate 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]="f8048210-9e9f-585b-b0df-a34eca521cc3")}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]="f4fe9337-9b1c-590f-9071-d685559bb7b9")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import { realpathSync } from "node:fs";
10
10
  import { execFile } from "node:child_process";
@@ -35,7 +35,7 @@ import { buildMissingLinkedPathRows, summarizeMissingLinkedPathRows, } from "../
35
35
  import { assertProjectionModeChoice, } from "../output-projection.js";
36
36
  import { collectDanglingDependencyReferences } from "../graph/assembly.js";
37
37
  import { auditMergeAttributeFence, auditMergeDriverConfiguration, findGitWorkspaceRoot, resolveProjectMergeTypeFolders, } from "../merge/install.js";
38
- import { listMergeReceipts } from "../merge/receipts.js";
38
+ import { listMergeReceipts, partitionMergeReceipts, } from "../merge/receipts.js";
39
39
  import { scanStorageIntegrity } from "./storage-integrity.js";
40
40
  import { scanTrackedRuntimeCache } from "./tracked-runtime-cache.js";
41
41
  import { scanHistoryAuthorAttribution } from "../author-attribution.js";
@@ -2100,9 +2100,10 @@ async function buildStorageIntegrityCheck(pmRoot, items, typeToFolder, settings)
2100
2100
  }
2101
2101
  const pendingMergeReceipts = gitWorkspaceRoot === null
2102
2102
  ? []
2103
- : await listMergeReceipts(gitWorkspaceRoot);
2104
- if (pendingMergeReceipts.length > 0) {
2105
- warnings.push(`validate_merge_decisions_unreviewed:${pendingMergeReceipts.length}`);
2103
+ : await listMergeReceipts(gitWorkspaceRoot, { includeLossless: true });
2104
+ const { pendingDecisions: pendingMergeDecisions, lossless: losslessMergeReceipts, } = partitionMergeReceipts(pendingMergeReceipts);
2105
+ if (pendingMergeDecisions.length > 0) {
2106
+ warnings.push(`validate_merge_decisions_unreviewed:${pendingMergeDecisions.length}`);
2106
2107
  }
2107
2108
  return {
2108
2109
  check: {
@@ -2115,9 +2116,13 @@ async function buildStorageIntegrityCheck(pmRoot, items, typeToFolder, settings)
2115
2116
  ...scan,
2116
2117
  merge_fence: fenceAudit,
2117
2118
  merge_driver_configuration: mergeDriverAudit,
2118
- pending_merge_decision_count: pendingMergeReceipts.length,
2119
+ pending_merge_decision_count: pendingMergeDecisions.length,
2119
2120
  pending_merge_decision_items: [
2120
- ...new Set(pendingMergeReceipts.map((receipt) => receipt.item_id)),
2121
+ ...new Set(pendingMergeDecisions.map((receipt) => receipt.item_id)),
2122
+ ].sort((left, right) => left.localeCompare(right)),
2123
+ lossless_merge_receipt_count: losslessMergeReceipts.length,
2124
+ lossless_merge_receipt_items: [
2125
+ ...new Set(losslessMergeReceipts.map((receipt) => receipt.item_id)),
2121
2126
  ].sort((left, right) => left.localeCompare(right)),
2122
2127
  tracked_runtime_cache: {
2123
2128
  tracker_relative_root: trackedRuntimeCache.tracker_relative_root,
@@ -2332,4 +2337,4 @@ export async function runValidate(options, global, services = {}) {
2332
2337
  }
2333
2338
  /* c8 ignore stop */
2334
2339
  //# sourceMappingURL=validate.js.map
2335
- //# debugId=f8048210-9e9f-585b-b0df-a34eca521cc3
2340
+ //# debugId=f4fe9337-9b1c-590f-9071-d685559bb7b9
@@ -12,4 +12,5 @@ export { runUpgrade, type UpgradeCliResult, type UpgradeCommandOptions, type Upg
12
12
  export * from "./governance/validate.js";
13
13
  export * from "./author-attribution.js";
14
14
  export * from "./mutation-guard.js";
15
+ export * from "./governance/provenance-health.js";
15
16
  export * from "./similarity.js";
@@ -4,7 +4,7 @@
4
4
  * Provides validation, health, integrity, and mutation-policy primitives.
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]="708c1c46-ce32-56ff-812f-71f825ad7ec4")}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]="8e8c2de1-7bff-57c6-8e71-9c27e9e76eaa")}catch(e){}}();
8
8
  export * from "./governance/gc.js";
9
9
  export * from "./governance/health.js";
10
10
  export { runReindex, } from "./governance/reindex.js";
@@ -14,6 +14,7 @@ export { runUpgrade, } from "./governance/upgrade.js";
14
14
  export * from "./governance/validate.js";
15
15
  export * from "./author-attribution.js";
16
16
  export * from "./mutation-guard.js";
17
+ export * from "./governance/provenance-health.js";
17
18
  export * from "./similarity.js";
18
19
  //# sourceMappingURL=governance.js.map
19
- //# debugId=708c1c46-ce32-56ff-812f-71f825ad7ec4
20
+ //# debugId=8e8c2de1-7bff-57c6-8e71-9c27e9e76eaa
@@ -127,7 +127,11 @@ export interface WorkspaceRelationshipAssembly {
127
127
  dangling: DanglingDependencyReferenceSummary;
128
128
  /** Raw same-identity duplicated dependency rows found before graph dedup. */
129
129
  duplicateRows: DuplicateDependencyRow[];
130
+ /** Raw legacy alias rows grouped by accepted spelling before graph canonicalization. */
131
+ legacyAliasCounts: Record<string, number>;
130
132
  }
133
+ /** Count raw dependency rows that use a registered compatibility alias instead of its canonical kind. */
134
+ export declare function collectLegacyDependencyAliasCounts(items: readonly DependencyReferenceHolder[], registry?: RelationshipKindRegistry): Record<string, number>;
131
135
  /**
132
136
  * Build the shared workspace relationship graph including missing placeholder
133
137
  * nodes. One assembly serves every bounded query in an invocation — dependency
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8368a519-4c09-540e-b0fb-f74cfdc1d7b2")}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]="62ec8e0e-658e-5a32-b458-439d5ffd1229")}catch(e){}}();
3
3
  import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
4
4
  import { RelationshipGraph, createRelationshipKindRegistry, } from "../relationships.js";
5
5
  import { isExternalDependencySourceKind } from "../dependency-provenance.js";
@@ -191,6 +191,25 @@ export function collectExternalDependencyTargetIds(items) {
191
191
  }
192
192
  return [...targets.values()].sort((left, right) => left.localeCompare(right));
193
193
  }
194
+ /** Count raw dependency rows that use a registered compatibility alias instead of its canonical kind. */
195
+ export function collectLegacyDependencyAliasCounts(items, registry = resolveWorkspaceRelationshipKindRegistry()) {
196
+ const counts = {};
197
+ for (const item of items) {
198
+ for (const dependency of item.dependencies ?? []) {
199
+ if (typeof dependency !== "object" || dependency === null)
200
+ continue;
201
+ const rawKind = dependency.kind;
202
+ if (typeof rawKind !== "string")
203
+ continue;
204
+ const normalized = rawKind.trim().toLowerCase().replaceAll("-", "_");
205
+ const definition = registry.resolve(rawKind);
206
+ if (definition && normalized !== definition.kind) {
207
+ counts[normalized] = (counts[normalized] ?? 0) + 1;
208
+ }
209
+ }
210
+ }
211
+ return Object.fromEntries(Object.entries(counts).sort(([left], [right]) => left.localeCompare(right)));
212
+ }
194
213
  /**
195
214
  * Build the shared workspace relationship graph including missing placeholder
196
215
  * nodes. One assembly serves every bounded query in an invocation — dependency
@@ -277,7 +296,8 @@ export function assembleWorkspaceRelationshipGraph(items, isTerminal, registry)
277
296
  missingIdSet: new Set(missingIds.map((id) => id.toLowerCase())),
278
297
  dangling,
279
298
  duplicateRows: collectDuplicateDependencyRows(safeItems, isTerminal),
299
+ legacyAliasCounts: collectLegacyDependencyAliasCounts(safeItems, relationshipRegistry),
280
300
  };
281
301
  }
282
302
  //# sourceMappingURL=assembly.js.map
283
- //# debugId=8368a519-4c09-540e-b0fb-f74cfdc1d7b2
303
+ //# debugId=62ec8e0e-658e-5a32-b458-439d5ffd1229
@@ -194,6 +194,8 @@ export interface GraphAuditResult {
194
194
  affected_subjects_by_code: Record<string, number>;
195
195
  /** Structural coverage metrics computed during the audit. */
196
196
  profile: RelationshipAuditReport["profile"];
197
+ /** Stored legacy relationship aliases grouped by spelling; canonical graph counts remain in profile. */
198
+ legacy_alias_counts?: Record<string, number>;
197
199
  /** Ordered findings with bounded evidence samples; absent with summary. */
198
200
  findings?: RelationshipAuditReport["findings"];
199
201
  /** Signed change since the persisted census baseline; absent when no baseline exists. */