@unbrained/pm-cli 2026.9.4 → 2026.9.6

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 (277) hide show
  1. package/.agents/skills/HARNESS_COMPATIBILITY.md +1 -1
  2. package/.agents/skills/README.md +2 -2
  3. package/.agents/skills/pm-developer/SKILL.md +4 -1
  4. package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +10 -0
  5. package/.agents/skills/pm-developer/references/GRAPH_AND_RELATIONSHIPS.md +3 -1
  6. package/.agents/skills/pm-extensions/SKILL.md +2 -2
  7. package/.agents/skills/pm-extensions/references/LIFECYCLE.md +3 -3
  8. package/.agents/skills/pm-extensions/references/TROUBLESHOOTING.md +3 -3
  9. package/.agents/skills/pm-user/SKILL.md +2 -0
  10. package/.agents/skills/pm-user/references/BACKLOG_SHAPING.md +5 -0
  11. package/.agents/skills/pm-user/references/WORKFLOWS.md +20 -5
  12. package/.claude-plugin/marketplace.json +2 -2
  13. package/CHANGELOG.md +58 -3
  14. package/dist/cli/commander-usage.d.ts +2 -0
  15. package/dist/cli/commander-usage.js +15 -12
  16. package/dist/cli/help-json-payload.js +12 -7
  17. package/dist/cli/main.js +22 -11
  18. package/dist/cli/register-list-query.js +4 -2
  19. package/dist/cli/register-mutation.js +4 -2
  20. package/dist/cli/register-operations.js +17 -8
  21. package/dist/cli-bundle/bundle-manifest.json +153 -161
  22. package/dist/cli-bundle/chunks/chunk-AZDFJGH6.js +9 -0
  23. package/dist/cli-bundle/chunks/{chunk-V72UV7QS.js → chunk-BAX2BYUW.js} +73 -73
  24. package/dist/cli-bundle/chunks/{chunk-HI6BHPCU.js → chunk-CKOL5U7J.js} +51 -51
  25. package/dist/cli-bundle/chunks/{chunk-A24WAVE6.js → chunk-JT6XF6GE.js} +2 -2
  26. package/dist/cli-bundle/chunks/{chunk-I2AS367G.js → chunk-JX4DH4WC.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-YW4QK2G7.js → chunk-NPN5I67J.js} +2 -2
  28. package/dist/cli-bundle/chunks/chunk-OF76PSDQ.js +5 -0
  29. package/dist/cli-bundle/chunks/chunk-QUWFABDM.js +232 -0
  30. package/dist/cli-bundle/chunks/{chunk-RI4XNOYS.js → chunk-RWWBOWJ5.js} +2 -2
  31. package/dist/cli-bundle/chunks/chunk-WGAOYSYH.js +40 -0
  32. package/dist/cli-bundle/chunks/{chunk-X6CMGV6L.js → chunk-WI2AYPA7.js} +2 -2
  33. package/dist/cli-bundle/chunks/{register-list-query-Z5YYSJJG.js → register-list-query-5JL52D33.js} +3 -3
  34. package/dist/cli-bundle/chunks/{register-mutation-ELSP6I4I.js → register-mutation-ZPG7KMVP.js} +4 -4
  35. package/dist/cli-bundle/chunks/register-operations-I5W3KMGB.js +2 -0
  36. package/dist/cli-bundle/chunks/{register-setup-E2AE72QG.js → register-setup-H4SVAVX7.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-3646BZ4W.js → chunk-3BZEOXLT.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/chunk-AL5ON6K6.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/chunk-CHC2IDXA.js +6 -0
  40. package/dist/cli-bundle/focused-chunks/chunk-CK6QFAPZ.js +20 -0
  41. package/dist/cli-bundle/focused-chunks/{chunk-NBMJD6MK.js → chunk-EZR3GHFE.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/chunk-H2WJWK7L.js +56 -0
  43. package/dist/cli-bundle/focused-chunks/{chunk-53IHPICX.js → chunk-LIJIA4TY.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/{chunk-25UJBH4M.js → chunk-M6PBRFSH.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/{chunk-AJR3OP2E.js → chunk-NTPY5GSO.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/chunk-P5O7MP5Y.js +2 -0
  47. package/dist/cli-bundle/focused-chunks/chunk-PDMW2E36.js +177 -0
  48. package/dist/cli-bundle/focused-chunks/{chunk-MHKUIPJW.js → chunk-PEFABF7E.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/{chunk-6PWPQKDN.js → chunk-QTVCLMSZ.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/{chunk-7N2TV7WZ.js → chunk-QTZRBUYA.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/chunk-SGQST3PQ.js +12 -0
  52. package/dist/cli-bundle/focused-chunks/chunk-UKHASMMP.js +10 -0
  53. package/dist/cli-bundle/focused-chunks/chunk-ZPEKQHOC.js +2 -0
  54. package/dist/cli-bundle/main.js +22 -15
  55. package/dist/cli-bundle/sdk-authoring.js +1 -1
  56. package/dist/cli-bundle/sdk-contracts.js +2 -2
  57. package/dist/cli-bundle/sdk-core.js +37 -37
  58. package/dist/cli-bundle/sdk-governance.js +1 -1
  59. package/dist/cli-bundle/sdk-graph.js +1 -1
  60. package/dist/cli-bundle/sdk-merge.js +42 -39
  61. package/dist/cli-bundle/sdk-query.js +1 -1
  62. package/dist/cli-bundle/sdk-runtime.js +1 -1
  63. package/dist/cli-bundle/sdk-testing.js +1 -1
  64. package/dist/cli-bundle/sdk.js +9 -9
  65. package/dist/core/extensions/extension-types.d.ts +2 -0
  66. package/dist/core/extensions/extension-types.js +2 -2
  67. package/dist/core/extensions/module-graph-snapshot.js +5 -4
  68. package/dist/core/fs/host-environment-errors.d.ts +27 -0
  69. package/dist/core/fs/host-environment-errors.js +142 -0
  70. package/dist/core/history/drift-scan.d.ts +5 -0
  71. package/dist/core/history/drift-scan.js +16 -6
  72. package/dist/core/history/event-classification.d.ts +1 -1
  73. package/dist/core/history/event-classification.js +3 -2
  74. package/dist/core/history/history.js +37 -5
  75. package/dist/core/history/identity.d.ts +15 -0
  76. package/dist/core/history/identity.js +31 -0
  77. package/dist/core/history/projection.js +50 -17
  78. package/dist/core/history/read.js +6 -3
  79. package/dist/core/history/replay.d.ts +1 -2
  80. package/dist/core/history/replay.js +4 -4
  81. package/dist/core/history/version-address.d.ts +13 -0
  82. package/dist/core/history/version-address.js +33 -0
  83. package/dist/core/item/actionability.d.ts +21 -1
  84. package/dist/core/item/actionability.js +45 -10
  85. package/dist/core/item/id.js +8 -4
  86. package/dist/core/item/item-type-definition.d.ts +2 -0
  87. package/dist/core/item/item-type-definition.js +9 -2
  88. package/dist/core/item/type-registry.d.ts +5 -1
  89. package/dist/core/item/type-registry.js +9 -4
  90. package/dist/core/output/mutation-projection.js +12 -5
  91. package/dist/core/shared/errors.d.ts +8 -0
  92. package/dist/core/shared/errors.js +2 -2
  93. package/dist/core/store/item-metadata-query-index.js +13 -10
  94. package/dist/core/store/item-metadata-read-work.d.ts +19 -0
  95. package/dist/core/store/item-metadata-read-work.js +44 -0
  96. package/dist/core/store/item-store.d.ts +14 -0
  97. package/dist/core/store/item-store.js +52 -10
  98. package/dist/core/store/settings-validator.js +3 -2
  99. package/dist/core/validate/fix-planning.d.ts +1 -1
  100. package/dist/core/validate/fix-planning.js +2 -2
  101. package/dist/core/validate/missing-link-owners.d.ts +1 -1
  102. package/dist/core/validate/missing-link-owners.js +5 -3
  103. package/dist/core/validate/stale-file-classification.d.ts +6 -4
  104. package/dist/core/validate/stale-file-classification.js +20 -5
  105. package/dist/mcp/server.js +12 -5
  106. package/dist/sdk/actionability.d.ts +1 -1
  107. package/dist/sdk/actionability.js +3 -3
  108. package/dist/sdk/cli-contracts/command-aliases.js +11 -2
  109. package/dist/sdk/cli-contracts/completeness.js +4 -3
  110. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  111. package/dist/sdk/cli-contracts/flag-contracts.js +31 -5
  112. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +21 -13
  113. package/dist/sdk/cli-contracts/grammar-contracts.js +11 -2
  114. package/dist/sdk/cli-contracts/runtime-contracts.js +5 -2
  115. package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +254 -5
  116. package/dist/sdk/cli-contracts/schemas/assurance-definition.js +52 -2
  117. package/dist/sdk/cli-contracts/tool-parameter-tables.js +30 -6
  118. package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
  119. package/dist/sdk/cli-contracts/tool-schema.js +32 -7
  120. package/dist/sdk/context/usage-ledger.d.ts +41 -0
  121. package/dist/sdk/context/usage-ledger.js +186 -0
  122. package/dist/sdk/context-intent-contracts.js +3 -3
  123. package/dist/sdk/context-usage.d.ts +18 -9
  124. package/dist/sdk/context-usage.js +44 -121
  125. package/dist/sdk/define.d.ts +1 -1
  126. package/dist/sdk/define.js +2 -2
  127. package/dist/sdk/dependency-provenance.d.ts +7 -0
  128. package/dist/sdk/dependency-provenance.js +14 -4
  129. package/dist/sdk/duplicates.d.ts +2 -0
  130. package/dist/sdk/duplicates.js +3 -2
  131. package/dist/sdk/environment/host-environment-errors.d.ts +5 -27
  132. package/dist/sdk/environment/host-environment-errors.js +4 -137
  133. package/dist/sdk/extension/install-runtime.js +9 -6
  134. package/dist/sdk/extension/install-snapshot.js +7 -6
  135. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +104 -56
  136. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +50 -2
  137. package/dist/sdk/governance/assurance-action.d.ts +3 -2
  138. package/dist/sdk/governance/assurance-action.js +23 -11
  139. package/dist/sdk/governance/assurance-runtime.d.ts +2 -0
  140. package/dist/sdk/governance/assurance-runtime.js +6 -3
  141. package/dist/sdk/governance/defect-recurrence-coverage.d.ts +93 -0
  142. package/dist/sdk/governance/defect-recurrence-coverage.js +189 -0
  143. package/dist/sdk/governance/defect-recurrence-graph.d.ts +33 -0
  144. package/dist/sdk/governance/defect-recurrence-graph.js +121 -0
  145. package/dist/sdk/governance/defect-recurrence.d.ts +8 -0
  146. package/dist/sdk/governance/defect-recurrence.js +118 -17
  147. package/dist/sdk/governance/health.d.ts +17 -2
  148. package/dist/sdk/governance/health.js +31 -10
  149. package/dist/sdk/governance/linked-file-report.d.ts +41 -0
  150. package/dist/sdk/governance/linked-file-report.js +72 -0
  151. package/dist/sdk/governance/validate-history-drift.js +16 -5
  152. package/dist/sdk/governance/validate.d.ts +5 -2
  153. package/dist/sdk/governance/validate.js +21 -37
  154. package/dist/sdk/governance.d.ts +2 -0
  155. package/dist/sdk/governance.js +4 -2
  156. package/dist/sdk/guide-topics.js +116 -2
  157. package/dist/sdk/history/salvage.d.ts +35 -0
  158. package/dist/sdk/history/salvage.js +248 -0
  159. package/dist/sdk/history-compact.js +32 -37
  160. package/dist/sdk/history-read.d.ts +3 -2
  161. package/dist/sdk/history-read.js +6 -3
  162. package/dist/sdk/history-repair.d.ts +12 -0
  163. package/dist/sdk/history-repair.js +60 -13
  164. package/dist/sdk/lifecycle/claim.d.ts +4 -0
  165. package/dist/sdk/lifecycle/claim.js +9 -3
  166. package/dist/sdk/lifecycle/close.d.ts +8 -0
  167. package/dist/sdk/lifecycle/close.js +16 -8
  168. package/dist/sdk/lifecycle/create.js +9 -12
  169. package/dist/sdk/lifecycle/restore.d.ts +1 -0
  170. package/dist/sdk/lifecycle/restore.js +19 -7
  171. package/dist/sdk/lifecycle/update.js +12 -12
  172. package/dist/sdk/lifecycle-policy.d.ts +3 -0
  173. package/dist/sdk/lifecycle-policy.js +2 -2
  174. package/dist/sdk/merge/abandoned-receipts.d.ts +15 -0
  175. package/dist/sdk/merge/abandoned-receipts.js +47 -0
  176. package/dist/sdk/merge/driver.js +4 -2
  177. package/dist/sdk/merge/index.d.ts +1 -0
  178. package/dist/sdk/merge/index.js +2 -2
  179. package/dist/sdk/merge/receipt-operation.d.ts +15 -0
  180. package/dist/sdk/merge/receipt-operation.js +97 -0
  181. package/dist/sdk/merge/receipt-schema.d.ts +20 -0
  182. package/dist/sdk/merge/receipt-schema.js +398 -0
  183. package/dist/sdk/merge/receipts.d.ts +16 -7
  184. package/dist/sdk/merge/receipts.js +54 -340
  185. package/dist/sdk/merge/reconcile.d.ts +2 -0
  186. package/dist/sdk/merge/reconcile.js +11 -4
  187. package/dist/sdk/output-projection.d.ts +3 -1
  188. package/dist/sdk/output-projection.js +11 -3
  189. package/dist/sdk/public-surface.json +1 -0
  190. package/dist/sdk/query/context.d.ts +9 -0
  191. package/dist/sdk/query/context.js +33 -21
  192. package/dist/sdk/query/duplicate-candidates.d.ts +7 -0
  193. package/dist/sdk/query/duplicate-candidates.js +71 -0
  194. package/dist/sdk/query/get.d.ts +2 -2
  195. package/dist/sdk/query/get.js +9 -8
  196. package/dist/sdk/query/history.d.ts +11 -0
  197. package/dist/sdk/query/history.js +34 -10
  198. package/dist/sdk/query/next.d.ts +15 -1
  199. package/dist/sdk/query/next.js +43 -20
  200. package/dist/sdk/query.d.ts +3 -0
  201. package/dist/sdk/query.js +5 -2
  202. package/dist/sdk/read-output-session.js +5 -3
  203. package/dist/sdk/runtime-primitives.d.ts +1 -1
  204. package/dist/sdk/runtime-primitives.js +3 -3
  205. package/dist/sdk/runtime.js +4 -2
  206. package/dist/sdk/similarity.d.ts +24 -3
  207. package/dist/sdk/similarity.js +50 -55
  208. package/dist/types.d.ts +2 -0
  209. package/dist/types.js +2 -2
  210. package/docs/AGENT_GUIDE.md +58 -1
  211. package/docs/BOUNDED_CONTEXT_READS.md +185 -0
  212. package/docs/CLOSE_EVIDENCE_RECOVERY.md +35 -0
  213. package/docs/COMMANDS.md +30 -8
  214. package/docs/CONTEXT_RELEVANCE.md +16 -4
  215. package/docs/DEFECT_RECURRENCE.md +80 -6
  216. package/docs/EXTENSIONS.md +18 -19
  217. package/docs/HISTORY_RECOVERY.md +146 -0
  218. package/docs/MERGE_SAFETY.md +50 -0
  219. package/docs/OUTPUT_PROJECTION_CONTRACTS.md +66 -0
  220. package/docs/PR_REVIEW_LOOP.md +18 -3
  221. package/docs/README.md +19 -1
  222. package/docs/RELEASING.md +31 -13
  223. package/docs/SDK_CONTEXT_TRUTH_CONTRACTS.md +24 -1
  224. package/docs/SDK_EXECUTION_CONTRACTS.md +105 -0
  225. package/docs/SDK_LIFECYCLE.md +27 -0
  226. package/docs/SDK_RUNTIME_BOUNDARIES.md +11 -0
  227. package/docs/TESTING.md +5 -0
  228. package/docs/agent-task-token-baseline.json +17 -17
  229. package/docs/agent-task-transcripts.json +2 -1
  230. package/docs/generated/FLAG_LEXICON_BUDGETS.md +11 -11
  231. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +11 -3
  232. package/marketplace.json +2 -2
  233. package/package.json +8 -6
  234. package/packages/pm-beads/package.json +1 -1
  235. package/packages/pm-calendar/package.json +1 -1
  236. package/packages/pm-command-kit/package.json +1 -1
  237. package/packages/pm-digital-twin/package.json +1 -1
  238. package/packages/pm-governance-audit/README.md +10 -1
  239. package/packages/pm-governance-audit/extensions/governance-audit/dedupe-audit.ts +50 -65
  240. package/packages/pm-governance-audit/extensions/governance-audit/index.ts +2 -2
  241. package/packages/pm-governance-audit/extensions/governance-audit/sdk.ts +1 -0
  242. package/packages/pm-governance-audit/package.json +1 -1
  243. package/packages/pm-guide-shell/package.json +1 -1
  244. package/packages/pm-kanban/package.json +1 -1
  245. package/packages/pm-lifecycle-hooks/package.json +1 -1
  246. package/packages/pm-linked-test-adapters/package.json +1 -1
  247. package/packages/pm-search-advanced/package.json +1 -1
  248. package/packages/pm-templates/package.json +1 -1
  249. package/packages/pm-todos/package.json +1 -1
  250. package/packages/pm-vcs/package.json +1 -1
  251. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  252. package/plugins/pm-claude/skills/pm-audit/SKILL.md +2 -2
  253. package/plugins/pm-claude/skills/pm-developer/SKILL.md +2 -2
  254. package/plugins/pm-claude/skills/pm-planner/SKILL.md +2 -2
  255. package/plugins/pm-claude/skills/pm-release/SKILL.md +2 -2
  256. package/plugins/pm-claude/skills/pm-workflow/SKILL.md +3 -3
  257. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  258. package/plugins/pm-codex/skills/pm-auditor/SKILL.md +2 -2
  259. package/plugins/pm-codex/skills/pm-native/SKILL.md +3 -4
  260. package/plugins/pm-codex/skills/pm-release/SKILL.md +2 -2
  261. package/scripts/finalize-build.mjs +13 -1
  262. package/dist/cli-bundle/chunks/chunk-6XSKPNCF.js +0 -230
  263. package/dist/cli-bundle/chunks/chunk-OGBVU67G.js +0 -5
  264. package/dist/cli-bundle/chunks/chunk-TXW6VL33.js +0 -38
  265. package/dist/cli-bundle/chunks/chunk-VGLHECAP.js +0 -9
  266. package/dist/cli-bundle/chunks/register-operations-OH7R3ZT4.js +0 -2
  267. package/dist/cli-bundle/focused-chunks/chunk-4YRAVI43.js +0 -12
  268. package/dist/cli-bundle/focused-chunks/chunk-5P4HVOWG.js +0 -176
  269. package/dist/cli-bundle/focused-chunks/chunk-636VVQ7F.js +0 -54
  270. package/dist/cli-bundle/focused-chunks/chunk-B3A6MJYE.js +0 -2
  271. package/dist/cli-bundle/focused-chunks/chunk-BFDDJ2T2.js +0 -2
  272. package/dist/cli-bundle/focused-chunks/chunk-BHUIRZWQ.js +0 -9
  273. package/dist/cli-bundle/focused-chunks/chunk-JADHHPY6.js +0 -6
  274. package/dist/cli-bundle/focused-chunks/chunk-NSKBLHVI.js +0 -20
  275. package/dist/cli-bundle/focused-chunks/chunk-P2GOAOQN.js +0 -2
  276. package/dist/cli-bundle/focused-chunks/chunk-YARWJM2B.js +0 -2
  277. package/sdk/public-surface.json +0 -33034
@@ -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]="f9059953-1d3c-5c1c-b739-4ad6cc8815a3")}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]="35c194c8-a164-5c90-9baa-9f2fc25c9bfb")}catch(e){}}();
4
4
  export const PM_ERROR_CODE_CATALOG_PART_1 = [
5
5
  {
6
6
  code: "acceptance_criteria_mutation_conflict",
@@ -690,8 +690,8 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
690
690
  exit_code: 4,
691
691
  class: "conflict",
692
692
  recovery: "Inspect the structured error guidance and retry the suggested command.",
693
- sources: ["sdk/similarity.ts"],
694
- emitting_commands: ["*"],
693
+ sources: ["sdk/query/duplicate-candidates.ts"],
694
+ emitting_commands: ["duplicate-candidates"],
695
695
  canonical_code: "duplicate_sweep_cost_limit",
696
696
  aliases: [],
697
697
  },
@@ -1163,6 +1163,18 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1163
1163
  canonical_code: "history_author_acknowledge_target_unreadable",
1164
1164
  aliases: [],
1165
1165
  },
1166
+ {
1167
+ code: "history_baseline_unavailable",
1168
+ meaning: "History baseline unavailable condition.",
1169
+ stability: "provisional",
1170
+ exit_code: 1,
1171
+ class: "generic_failure",
1172
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1173
+ sources: ["core/history/projection.ts"],
1174
+ emitting_commands: ["*"],
1175
+ canonical_code: "history_baseline_unavailable",
1176
+ aliases: [],
1177
+ },
1166
1178
  {
1167
1179
  code: "history_drift_chain_mismatch",
1168
1180
  meaning: "History drift chain mismatch condition.",
@@ -1235,6 +1247,18 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1235
1247
  canonical_code: "history_drift_version_skew",
1236
1248
  aliases: ["validate_history_drift_version_skews"],
1237
1249
  },
1250
+ {
1251
+ code: "history_json_invalid",
1252
+ meaning: "History json invalid condition.",
1253
+ stability: "provisional",
1254
+ exit_code: 1,
1255
+ class: "generic_failure",
1256
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1257
+ sources: ["core/history/read.ts"],
1258
+ emitting_commands: ["*"],
1259
+ canonical_code: "history_json_invalid",
1260
+ aliases: [],
1261
+ },
1238
1262
  {
1239
1263
  code: "history_merge_conflict_markers_detected",
1240
1264
  meaning: "History merge conflict markers detected condition.",
@@ -1247,6 +1271,30 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1247
1271
  canonical_code: "merge_conflict_markers_detected",
1248
1272
  aliases: [],
1249
1273
  },
1274
+ {
1275
+ code: "history_replay_invalid",
1276
+ meaning: "History replay invalid condition.",
1277
+ stability: "provisional",
1278
+ exit_code: 1,
1279
+ class: "generic_failure",
1280
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1281
+ sources: ["core/history/projection.ts"],
1282
+ emitting_commands: ["*"],
1283
+ canonical_code: "history_replay_invalid",
1284
+ aliases: [],
1285
+ },
1286
+ {
1287
+ code: "history_salvage_refused",
1288
+ meaning: "History salvage refused condition.",
1289
+ stability: "provisional",
1290
+ exit_code: 4,
1291
+ class: "conflict",
1292
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1293
+ sources: ["sdk/history/salvage.ts"],
1294
+ emitting_commands: ["*"],
1295
+ canonical_code: "history_salvage_refused",
1296
+ aliases: [],
1297
+ },
1250
1298
  {
1251
1299
  code: "history_stream_over_compact_threshold",
1252
1300
  meaning: "History stream over compact threshold condition.",
@@ -1295,6 +1343,30 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1295
1343
  canonical_code: "history_unknown_author_events",
1296
1344
  aliases: ["validate_history_unknown_author_events"],
1297
1345
  },
1346
+ {
1347
+ code: "history_version_mapping_unavailable",
1348
+ meaning: "History version mapping unavailable condition.",
1349
+ stability: "provisional",
1350
+ exit_code: 2,
1351
+ class: "usage",
1352
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1353
+ sources: ["core/history/version-address.ts"],
1354
+ emitting_commands: ["*"],
1355
+ canonical_code: "history_version_mapping_unavailable",
1356
+ aliases: [],
1357
+ },
1358
+ {
1359
+ code: "history_version_pruned",
1360
+ meaning: "History version pruned condition.",
1361
+ stability: "provisional",
1362
+ exit_code: 2,
1363
+ class: "usage",
1364
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1365
+ sources: ["core/history/projection.ts"],
1366
+ emitting_commands: ["*"],
1367
+ canonical_code: "history_version_pruned",
1368
+ aliases: [],
1369
+ },
1298
1370
  {
1299
1371
  code: "host_environment_capacity_fault",
1300
1372
  meaning: "Host environment capacity fault condition.",
@@ -1302,7 +1374,7 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1302
1374
  exit_code: 1,
1303
1375
  class: "generic_failure",
1304
1376
  recovery: "Inspect the structured error guidance and retry the suggested command.",
1305
- sources: ["sdk/environment/host-environment-errors.ts"],
1377
+ sources: ["core/fs/host-environment-errors.ts"],
1306
1378
  emitting_commands: ["*"],
1307
1379
  canonical_code: "host_environment_capacity_fault",
1308
1380
  aliases: [],
@@ -1314,7 +1386,7 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1314
1386
  exit_code: 2,
1315
1387
  class: "usage",
1316
1388
  recovery: "Inspect the structured error guidance and retry the suggested command.",
1317
- sources: ["sdk/environment/host-environment-errors.ts"],
1389
+ sources: ["core/fs/host-environment-errors.ts"],
1318
1390
  emitting_commands: ["*"],
1319
1391
  canonical_code: "host_environment_operation_invalid",
1320
1392
  aliases: [],
@@ -1326,7 +1398,7 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1326
1398
  exit_code: 1,
1327
1399
  class: "generic_failure",
1328
1400
  recovery: "Inspect the structured error guidance and retry the suggested command.",
1329
- sources: ["sdk/environment/host-environment-errors.ts"],
1401
+ sources: ["core/fs/host-environment-errors.ts"],
1330
1402
  emitting_commands: ["*"],
1331
1403
  canonical_code: "host_environment_permission_fault",
1332
1404
  aliases: [],
@@ -1338,7 +1410,7 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1338
1410
  exit_code: 1,
1339
1411
  class: "generic_failure",
1340
1412
  recovery: "Inspect the structured error guidance and retry the suggested command.",
1341
- sources: ["sdk/environment/host-environment-errors.ts"],
1413
+ sources: ["core/fs/host-environment-errors.ts"],
1342
1414
  emitting_commands: ["*"],
1343
1415
  canonical_code: "host_environment_resource_fault",
1344
1416
  aliases: [],
@@ -1797,6 +1869,18 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1797
1869
  canonical_code: "item_already_active",
1798
1870
  aliases: [],
1799
1871
  },
1872
+ {
1873
+ code: "item_document_encoding_invalid",
1874
+ meaning: "Item document encoding invalid condition.",
1875
+ stability: "provisional",
1876
+ exit_code: 4,
1877
+ class: "conflict",
1878
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1879
+ sources: ["core/store/item-store.ts"],
1880
+ emitting_commands: ["*"],
1881
+ canonical_code: "item_document_encoding_invalid",
1882
+ aliases: [],
1883
+ },
1800
1884
  {
1801
1885
  code: "item_document_invalid",
1802
1886
  meaning: "Item document invalid condition.",
@@ -1833,6 +1917,18 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1833
1917
  canonical_code: "item_id_collision",
1834
1918
  aliases: [],
1835
1919
  },
1920
+ {
1921
+ code: "item_identity_reserved",
1922
+ meaning: "Item identity reserved condition.",
1923
+ stability: "provisional",
1924
+ exit_code: 4,
1925
+ class: "conflict",
1926
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1927
+ sources: ["core/history/history.ts"],
1928
+ emitting_commands: ["*"],
1929
+ canonical_code: "item_identity_reserved",
1930
+ aliases: [],
1931
+ },
1836
1932
  {
1837
1933
  code: "item_not_found",
1838
1934
  meaning: "Item not found condition.",
@@ -2124,54 +2220,6 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
2124
2220
  canonical_code: "merge_reconcile_receipt_evidence_untrusted",
2125
2221
  aliases: [],
2126
2222
  },
2127
- {
2128
- code: "merge_root_not_found",
2129
- meaning: "Merge root not found condition.",
2130
- stability: "stable",
2131
- exit_code: 3,
2132
- class: "not_found",
2133
- recovery: "Inspect the structured error guidance and retry the suggested command.",
2134
- sources: ["sdk/merge/install.ts"],
2135
- emitting_commands: ["*"],
2136
- canonical_code: "merge_root_not_found",
2137
- aliases: [],
2138
- },
2139
- {
2140
- code: "missing_allowed_values",
2141
- meaning: "Missing allowed values condition.",
2142
- stability: "provisional",
2143
- exit_code: 1,
2144
- class: "generic_failure",
2145
- recovery: "Inspect the structured error guidance and retry the suggested command.",
2146
- sources: ["sdk/agent/refusal-closure.ts"],
2147
- emitting_commands: ["*"],
2148
- canonical_code: "missing_allowed_values",
2149
- aliases: [],
2150
- },
2151
- {
2152
- code: "missing_budget",
2153
- meaning: "Missing budget condition.",
2154
- stability: "provisional",
2155
- exit_code: 1,
2156
- class: "generic_failure",
2157
- recovery: "Inspect the structured error guidance and retry the suggested command.",
2158
- sources: ["sdk/cli-contracts/flag-lexicon-contracts.ts"],
2159
- emitting_commands: ["*"],
2160
- canonical_code: "missing_budget",
2161
- aliases: [],
2162
- },
2163
- {
2164
- code: "missing_cli_flag",
2165
- meaning: "Missing cli flag condition.",
2166
- stability: "provisional",
2167
- exit_code: 1,
2168
- class: "generic_failure",
2169
- recovery: "Inspect the structured error guidance and retry the suggested command.",
2170
- sources: ["sdk/cli-contracts/tool-option-contracts.ts"],
2171
- emitting_commands: ["*"],
2172
- canonical_code: "missing_cli_flag",
2173
- aliases: [],
2174
- },
2175
2223
  ];
2176
2224
  //# sourceMappingURL=generated-error-code-catalog-part-1.js.map
2177
- //# debugId=f9059953-1d3c-5c1c-b739-4ad6cc8815a3
2225
+ //# debugId=35c194c8-a164-5c90-9baa-9f2fc25c9bfb
@@ -1,7 +1,55 @@
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]="f1a77960-6191-5e11-9622-4250be7b0e89")}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]="aa8f034d-d4b6-595b-af76-f7203d062971")}catch(e){}}();
4
4
  export const PM_ERROR_CODE_CATALOG_PART_2 = [
5
+ {
6
+ code: "merge_root_not_found",
7
+ meaning: "Merge root not found condition.",
8
+ stability: "stable",
9
+ exit_code: 3,
10
+ class: "not_found",
11
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
12
+ sources: ["sdk/merge/install.ts"],
13
+ emitting_commands: ["*"],
14
+ canonical_code: "merge_root_not_found",
15
+ aliases: [],
16
+ },
17
+ {
18
+ code: "missing_allowed_values",
19
+ meaning: "Missing allowed values condition.",
20
+ stability: "provisional",
21
+ exit_code: 1,
22
+ class: "generic_failure",
23
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
24
+ sources: ["sdk/agent/refusal-closure.ts"],
25
+ emitting_commands: ["*"],
26
+ canonical_code: "missing_allowed_values",
27
+ aliases: [],
28
+ },
29
+ {
30
+ code: "missing_budget",
31
+ meaning: "Missing budget condition.",
32
+ stability: "provisional",
33
+ exit_code: 1,
34
+ class: "generic_failure",
35
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
36
+ sources: ["sdk/cli-contracts/flag-lexicon-contracts.ts"],
37
+ emitting_commands: ["*"],
38
+ canonical_code: "missing_budget",
39
+ aliases: [],
40
+ },
41
+ {
42
+ code: "missing_cli_flag",
43
+ meaning: "Missing cli flag 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/cli-contracts/tool-option-contracts.ts"],
49
+ emitting_commands: ["*"],
50
+ canonical_code: "missing_cli_flag",
51
+ aliases: [],
52
+ },
5
53
  {
6
54
  code: "missing_destination",
7
55
  meaning: "Missing destination condition.",
@@ -2186,4 +2234,4 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
2186
2234
  },
2187
2235
  ];
2188
2236
  //# sourceMappingURL=generated-error-code-catalog-part-2.js.map
2189
- //# debugId=f1a77960-6191-5e11-9622-4250be7b0e89
2237
+ //# debugId=aa8f034d-d4b6-595b-af76-f7203d062971
@@ -3,8 +3,9 @@ import { type AssuranceBundleMutationReceipt, type AssuranceDeclaration, type As
3
3
  import { type AssuranceDerivedProposal, type AssurancePreset, type AssurancePresetId } from "./assurance-presets.js";
4
4
  import { type CreateAssuranceWorkspaceContextOptions } from "./assurance-runtime.js";
5
5
  import { type DefectChangeRiskReport } from "./defect-recurrence.js";
6
+ import { type DefectRecurrenceCoverageReport } from "./defect-recurrence-coverage.js";
6
7
  /** Assurance registry and evaluation verbs shared by every transport. */
7
- export declare const ASSURANCE_ACTIONS: readonly ["list", "show", "put", "remove", "run", "verdicts", "presets", "apply", "derive", "promote", "risk"];
8
+ export declare const ASSURANCE_ACTIONS: readonly ["list", "show", "put", "remove", "run", "verdicts", "presets", "apply", "derive", "promote", "risk", "lineages"];
8
9
  /** Assurance declaration kinds shared by every transport. */
9
10
  export declare const ASSURANCE_DECLARATION_KINDS: readonly ["measurement", "assertion", "gate"];
10
11
  /** Assurance action verb. */
@@ -52,7 +53,7 @@ export interface AssuranceActionRuntimeOptions {
52
53
  workspace?: Omit<CreateAssuranceWorkspaceContextOptions, "tree_id" | "trigger">;
53
54
  }
54
55
  /** Result union returned by transport-neutral assurance execution. */
55
- export type AssuranceActionResult = AssuranceDeclaration | AssuranceMutationReceipt | AssuranceGateVerdict | AssuranceBundleMutationReceipt | AssurancePreset | DefectChangeRiskReport | {
56
+ export type AssuranceActionResult = AssuranceDeclaration | AssuranceMutationReceipt | AssuranceGateVerdict | AssuranceBundleMutationReceipt | AssurancePreset | DefectChangeRiskReport | DefectRecurrenceCoverageReport | {
56
57
  items: AssuranceDerivedProposal[];
57
58
  count: number;
58
59
  applied?: AssuranceBundleMutationReceipt;
@@ -4,7 +4,7 @@
4
4
  * Normalizes the assurance action vocabulary once for CLI, SDK, and MCP hosts.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f66a964d-1352-5523-ab91-5177d0d93ce8")}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]="811330eb-207d-5e27-9786-72c1fba7d4c9")}catch(e){}}();
8
8
  import { createHash } from "node:crypto";
9
9
  import { EXIT_CODE } from "../../core/shared/constants.js";
10
10
  import { PmCliError } from "../../core/shared/errors.js";
@@ -18,6 +18,8 @@ import { resolvePmRoot } from "../runtime-primitives.js";
18
18
  import { parseRuntimeInteger, readRuntimeString } from "../runtime-input.js";
19
19
  import { analyzeDefectChangeRisk, buildDefectRecurrenceIndex, parseDefectChangeRiskRequest, } from "./defect-recurrence.js";
20
20
  import { defectRecurrenceItemSignals } from "./defect-recurrence-signals.js";
21
+ import { readDefectRecurrenceRecord } from "./defect-recurrence-graph.js";
22
+ import { analyzeDefectRecurrenceCoverage, parseDefectRecurrenceCoverageRequest, } from "./defect-recurrence-coverage.js";
21
23
  import { createUnknownSubcommandError } from "../agent/subcommand-recovery.js";
22
24
  let riskIndexCache;
23
25
  /** Assurance registry and evaluation verbs shared by every transport. */
@@ -33,6 +35,7 @@ export const ASSURANCE_ACTIONS = [
33
35
  "derive",
34
36
  "promote",
35
37
  "risk",
38
+ "lineages",
36
39
  ];
37
40
  /** Assurance declaration kinds shared by every transport. */
38
41
  export const ASSURANCE_DECLARATION_KINDS = [
@@ -245,9 +248,9 @@ function throwRiskUsageError(error) {
245
248
  : "assurance risk request is invalid", EXIT_CODE.USAGE);
246
249
  }
247
250
  /** Parse JSON or object risk definitions without wrapping workspace failures. */
248
- function parseRiskActionRequest(input) {
251
+ function parseRecurrenceActionRequest(input) {
249
252
  if (input.limit !== undefined) {
250
- throw new PmCliError("assurance risk does not accept --limit; set limit inside the risk definition", EXIT_CODE.USAGE);
253
+ throw new PmCliError(`assurance ${input.action} does not accept --limit; set limit inside the definition`, EXIT_CODE.USAGE);
251
254
  }
252
255
  let definition = input.definition;
253
256
  if (typeof definition === "string") {
@@ -255,11 +258,13 @@ function parseRiskActionRequest(input) {
255
258
  definition = JSON.parse(definition);
256
259
  }
257
260
  catch (error) {
258
- throw new PmCliError("assurance risk definition must be valid JSON", EXIT_CODE.USAGE, { reason: error instanceof Error ? error.message : "invalid_json" });
261
+ throw new PmCliError(`assurance ${input.action} definition must be valid JSON`, EXIT_CODE.USAGE, { reason: error instanceof Error ? error.message : "invalid_json" });
259
262
  }
260
263
  }
261
264
  try {
262
- return parseDefectChangeRiskRequest(definition);
265
+ return input.action === "lineages"
266
+ ? parseDefectRecurrenceCoverageRequest(definition)
267
+ : parseDefectChangeRiskRequest(definition);
263
268
  }
264
269
  catch (error) {
265
270
  return throwRiskUsageError(error);
@@ -285,7 +290,10 @@ function buildCachedRiskIndex(pmRoot, request, items) {
285
290
  const itemFingerprints = new Map(items.map((item) => [
286
291
  item.id,
287
292
  createHash("sha256")
288
- .update(stableStringify(defectRecurrenceItemSignals(item)))
293
+ .update(stableStringify([
294
+ defectRecurrenceItemSignals(item),
295
+ readDefectRecurrenceRecord(item),
296
+ ]))
289
297
  .digest("hex"),
290
298
  ]));
291
299
  const reusable = cached?.policy_serialized === policySerialized ? cached : undefined;
@@ -304,13 +312,17 @@ function buildCachedRiskIndex(pmRoot, request, items) {
304
312
  return index;
305
313
  }
306
314
  /** Evaluate one serialized change-risk request against authoritative PM metadata. */
307
- async function runRiskAction(input, pmRoot) {
308
- const request = parseRiskActionRequest(input);
315
+ async function runRecurrenceAction(input, pmRoot) {
316
+ const request = parseRecurrenceActionRequest(input);
309
317
  const context = await createAssuranceWorkspaceContext(pmRoot, {
318
+ strict_read: true,
310
319
  include_history: false,
311
320
  resolve_tree: false,
312
321
  });
313
322
  try {
323
+ if (!("change" in request)) {
324
+ return analyzeDefectRecurrenceCoverage(request.policy, context.items, request);
325
+ }
314
326
  return analyzeDefectChangeRisk(buildCachedRiskIndex(pmRoot, request, context.items), request.change, { cursor: request.cursor, limit: request.limit });
315
327
  }
316
328
  catch (error) {
@@ -333,8 +345,8 @@ export async function runAssuranceAction(input, global = {}, runtime = {}) {
333
345
  if (action === "run") {
334
346
  return runGateAction(input, pmRoot, runtime);
335
347
  }
336
- if (action === "risk") {
337
- return runRiskAction(input, pmRoot);
348
+ if (["risk", "lineages"].includes(action)) {
349
+ return runRecurrenceAction(input, pmRoot);
338
350
  }
339
351
  const kind = parseKind(input.kind);
340
352
  if (action === "list")
@@ -397,4 +409,4 @@ export function runAssuranceDispatch(args, options, global) {
397
409
  }, global);
398
410
  }
399
411
  //# sourceMappingURL=assurance-action.js.map
400
- //# debugId=f66a964d-1352-5523-ab91-5177d0d93ce8
412
+ //# debugId=811330eb-207d-5e27-9786-72c1fba7d4c9
@@ -3,6 +3,8 @@ import type { AssuranceEvaluationContext, AssuranceExternalMeasurementResult, As
3
3
  export type AssuranceProviderResolver = (source: AssuranceProviderSource) => Promise<AssuranceExternalMeasurementResult>;
4
4
  /** Workspace binding options. */
5
5
  export interface CreateAssuranceWorkspaceContextOptions {
6
+ /** Refuse incomplete item or directory reads through the public strict-list contract. */
7
+ strict_read?: boolean;
6
8
  /** Explicit tree identity; otherwise the current Git commit is used. */
7
9
  tree_id?: string;
8
10
  /** Load immutable item history for history-backed measurements. */
@@ -5,12 +5,13 @@
5
5
  * and verdict semantics in the host-neutral assurance module.
6
6
  */
7
7
 
8
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f9c26dab-b2fb-5ca0-b575-682b4b0bb830")}catch(e){}}();
8
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="cdf52e5c-86cf-5540-bc08-bfc274a1fdf9")}catch(e){}}();
9
9
  import { execFile } from "node:child_process";
10
10
  import { promisify } from "node:util";
11
11
  import { runGraph } from "../graph/run.js";
12
12
  import { runHealth } from "./health.js";
13
13
  import { runValidate } from "./validate.js";
14
+ import { runList } from "../query/list.js";
14
15
  import { AssuranceSourceResolutionError } from "./assurance-mutation-error.js";
15
16
  import { getActiveExtensionRegistrations, resolvePortableWorkspaceContext, } from "../../core/extensions/index.js";
16
17
  import { resolveRegisteredAssuranceMeasurementProvider } from "../../core/extensions/runtime-registrations.js";
@@ -161,7 +162,9 @@ export async function createAssuranceWorkspaceContext(pmRoot, options = {}) {
161
162
  const settings = await readSettings(pmRoot);
162
163
  const typeRegistry = resolveItemTypeRegistry(settings);
163
164
  const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
164
- const metadata = await listAllItemMetadata(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema);
165
+ const metadata = options.strict_read === true
166
+ ? (await runList(undefined, { status: "all", full: true, noTruncate: true, strictRead: true }, { path: pmRoot })).items
167
+ : await listAllItemMetadata(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema);
165
168
  const items = metadata.map((item) => ({
166
169
  ...item,
167
170
  id: item.id,
@@ -233,4 +236,4 @@ export async function createAssuranceWorkspaceContext(pmRoot, options = {}) {
233
236
  };
234
237
  }
235
238
  //# sourceMappingURL=assurance-runtime.js.map
236
- //# debugId=f9c26dab-b2fb-5ca0-b575-682b4b0bb830
239
+ //# debugId=cdf52e5c-86cf-5540-bc08-bfc274a1fdf9
@@ -0,0 +1,93 @@
1
+ import type { AssuranceItemRecord } from "./assurance.js";
2
+ import { type DefectEscapeClass, type DefectRecurrencePolicy } from "./defect-recurrence.js";
3
+ /** Bounded recurrence-evidence selection shared by SDK and transport hosts. */
4
+ export interface DefectRecurrenceCoverageOptions {
5
+ /** Maximum item rows returned, from 1 through 100; defaults to 25. */
6
+ limit?: number;
7
+ /** Continuation tied to the policy, complete recurrence evidence, and filter. */
8
+ cursor?: string;
9
+ /** Return only unregistered or missing items; totals always describe the full graph. */
10
+ uncoveredOnly?: boolean;
11
+ }
12
+ /** Serialized request for the shared assurance lineages action. */
13
+ export interface DefectRecurrenceCoverageRequest extends DefectRecurrenceCoverageOptions {
14
+ /** Project- or package-owned versioned family policy. */
15
+ policy: DefectRecurrencePolicy;
16
+ }
17
+ /** Validate lineage-policy and paging input at the untrusted transport boundary. */
18
+ export declare function parseDefectRecurrenceCoverageRequest(value: unknown): DefectRecurrenceCoverageRequest;
19
+ /** One registered, unregistered, or missing member of a recorded recurrence lineage. */
20
+ export interface DefectRecurrenceCoverageRow {
21
+ /** Recorded item id or missing local reference. */
22
+ item_id: string;
23
+ /** Current component identity, derived from its lexically first item id. */
24
+ lineage_id: string;
25
+ /** Full component size, independent of the returned page. */
26
+ lineage_item_count: number;
27
+ /** Explicitly registered families covering this component. */
28
+ family_ids: string[];
29
+ /** Whether the local item exists in the supplied authoritative corpus. */
30
+ present: boolean;
31
+ /** Stable named finding when registration or the target record is absent. */
32
+ finding?: "unregistered_recurrence_item" | "missing_recurrence_item";
33
+ }
34
+ /** Complete population counts and bounded recurrence-policy evidence. */
35
+ export interface DefectRecurrenceCoverageReport {
36
+ /** False if any recorded recurrence member is unregistered or missing. */
37
+ ok: boolean;
38
+ /** Identity of policy, recurrence evidence, and selected filter. */
39
+ fingerprint: string;
40
+ /** Current page; every row remains connected to its complete lineage. */
41
+ items: DefectRecurrenceCoverageRow[];
42
+ /** Selected row count before pagination. */
43
+ total: number;
44
+ /** Whether another page remains. */
45
+ has_more: boolean;
46
+ /** Cursor for the next page when has_more is true. */
47
+ next_cursor?: string;
48
+ /** Independent denominator including covered, uncovered, and absent local references. */
49
+ population: {
50
+ /** Explicit statement that the denominator is not the family registry. */
51
+ scope: "all_recorded_recurrence_items";
52
+ /** Unique participating local ids, including missing references. */
53
+ item_count: number;
54
+ /** Connected recurrence components. */
55
+ lineage_count: number;
56
+ /** Unique directed local recurrence edges. */
57
+ edge_count: number;
58
+ /** Existing members with an explicitly seeded registered family. */
59
+ covered_item_count: number;
60
+ /** Existing or missing members without a seeded registered family. */
61
+ uncovered_item_count: number;
62
+ /** Referenced ids missing from the authoritative item corpus. */
63
+ missing_item_count: number;
64
+ /** Members with an explicit recognized escape classification. */
65
+ classified_item_count: number;
66
+ /** Members without a recognized classification; never counted as non-escapes. */
67
+ unclassified_item_count: number;
68
+ /** Recorded classification counts over the entire population. */
69
+ class_counts: Record<DefectEscapeClass, number>;
70
+ /** Production-defect fraction only when every participant is classified; null otherwise. */
71
+ escape_rate: number | null;
72
+ /** Known production defects divided by the entire population, explicitly a lower bound. */
73
+ escape_rate_lower_bound: number | null;
74
+ };
75
+ /** Budgets on the policy's families cannot certify uncovered or unclassified members. */
76
+ budget_scope: "registered_families_only";
77
+ /** Declared performance accounting; connectivity never uses a depth cutoff. */
78
+ cost: {
79
+ /** Input item records inspected. */
80
+ items_scanned: number;
81
+ /** Recurrence edges traversed. */
82
+ edges_scanned: number;
83
+ /** Maximum emitted item rows. */
84
+ row_limit: number;
85
+ };
86
+ /** Stable machine selector. */
87
+ row_contract: {
88
+ row_keys: ["items"];
89
+ jq_selector: ".items[]";
90
+ };
91
+ }
92
+ /** Evaluate all local recurs_from lineages before applying any result-row limit. */
93
+ export declare function analyzeDefectRecurrenceCoverage(policy: DefectRecurrencePolicy, items: readonly AssuranceItemRecord[], options?: DefectRecurrenceCoverageOptions): DefectRecurrenceCoverageReport;