@unbrained/pm-cli 2026.8.14 → 2026.8.16

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 (160) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +51 -11
  3. package/dist/cli/commander-usage.js +17 -4
  4. package/dist/cli/error-guidance.d.ts +7 -0
  5. package/dist/cli/error-guidance.js +65 -25
  6. package/dist/cli/main.js +3 -2
  7. package/dist/cli/register-history-author.js +16 -11
  8. package/dist/cli/register-mutation.js +4 -2
  9. package/dist/cli/register-operations.js +5 -5
  10. package/dist/cli-bundle/bundle-manifest.json +148 -148
  11. package/dist/cli-bundle/chunks/chunk-47OQEOQB.js +2 -0
  12. package/dist/cli-bundle/chunks/{chunk-XAVMOK6B.js → chunk-73UGEBRS.js} +2 -2
  13. package/dist/cli-bundle/chunks/chunk-HCIYWD6M.js +35 -0
  14. package/dist/cli-bundle/chunks/{chunk-FIW4P64F.js → chunk-I2LUWWR5.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-SBRKH6OR.js → chunk-IC5W2T34.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-TMJ7URWS.js → chunk-PANOOBIS.js} +9 -9
  17. package/dist/cli-bundle/chunks/{chunk-BFALV3YP.js → chunk-RIS565OA.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-TXMEUUUY.js → chunk-TK6N7HGM.js} +2 -2
  19. package/dist/cli-bundle/chunks/chunk-TOFG2URD.js +197 -0
  20. package/dist/cli-bundle/chunks/{chunk-G5JUB66K.js → chunk-URW4QRMI.js} +65 -59
  21. package/dist/cli-bundle/chunks/{register-list-query-T3EHHNNV.js → register-list-query-EYCXHZAG.js} +2 -2
  22. package/dist/cli-bundle/chunks/register-mutation-7YVIG54J.js +20 -0
  23. package/dist/cli-bundle/chunks/register-operations-KGDNRMCL.js +2 -0
  24. package/dist/cli-bundle/chunks/{register-setup-3YXZ444E.js → register-setup-NVXBOD5I.js} +2 -2
  25. package/dist/cli-bundle/focused-chunks/{chunk-PPFGQDSI.js → chunk-4JPEBFFC.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/chunk-5NMFSX26.js +155 -0
  27. package/dist/cli-bundle/focused-chunks/{chunk-YOOI3UZX.js → chunk-6ROKKT4X.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/chunk-725JSCMP.js +2 -0
  29. package/dist/cli-bundle/focused-chunks/{chunk-XDNAW5OI.js → chunk-C7JUBRFP.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-4DQ2YERC.js → chunk-CODV5LUT.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/chunk-DQ6SMTBF.js +2 -0
  32. package/dist/cli-bundle/focused-chunks/chunk-HAACPSUW.js +2 -0
  33. package/dist/cli-bundle/focused-chunks/{chunk-WCVE2NIG.js → chunk-J4UFYHOD.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/chunk-JX5Z344Q.js +2 -0
  35. package/dist/cli-bundle/focused-chunks/chunk-L4RDYBIQ.js +2 -0
  36. package/dist/cli-bundle/focused-chunks/{chunk-KSEDUWVZ.js → chunk-NJ5RLEFD.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-K7RWWOAG.js → chunk-QYZERYR5.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/chunk-SSNDYZTM.js +8 -0
  39. package/dist/cli-bundle/focused-chunks/chunk-T46KLOIB.js +50 -0
  40. package/dist/cli-bundle/focused-chunks/{chunk-KFSZ3BP6.js → chunk-TZATVC4G.js} +6 -6
  41. package/dist/cli-bundle/focused-chunks/chunk-WY3WRPVN.js +2 -0
  42. package/dist/cli-bundle/main.js +13 -13
  43. package/dist/cli-bundle/sdk-authoring.js +1 -1
  44. package/dist/cli-bundle/sdk-contracts.js +1 -1
  45. package/dist/cli-bundle/sdk-core.js +32 -35
  46. package/dist/cli-bundle/sdk-governance.js +1 -1
  47. package/dist/cli-bundle/sdk-graph.js +1 -1
  48. package/dist/cli-bundle/sdk-merge.js +32 -31
  49. package/dist/cli-bundle/sdk-query.js +1 -1
  50. package/dist/cli-bundle/sdk-runtime.js +1 -1
  51. package/dist/cli-bundle/sdk-testing.js +1 -1
  52. package/dist/cli-bundle/sdk.js +2 -2
  53. package/dist/core/diagnostics/remediation.js +7 -2
  54. package/dist/core/extensions/reserved-host-flags.js +3 -2
  55. package/dist/core/history/replay.d.ts +14 -1
  56. package/dist/core/history/replay.js +45 -8
  57. package/dist/core/history/workspace-history.js +32 -10
  58. package/dist/core/output/output.d.ts +2 -0
  59. package/dist/core/output/output.js +7 -3
  60. package/dist/core/shared/command-types.d.ts +2 -0
  61. package/dist/core/shared/command-types.js +2 -2
  62. package/dist/core/shared/errors.d.ts +14 -0
  63. package/dist/core/shared/errors.js +2 -2
  64. package/dist/core/store/item-store.js +28 -2
  65. package/dist/mcp/tool-definitions.js +9 -5
  66. package/dist/sdk/agent/refusal-reachability.d.ts +69 -0
  67. package/dist/sdk/agent/refusal-reachability.js +159 -3
  68. package/dist/sdk/author-attribution.d.ts +56 -11
  69. package/dist/sdk/author-attribution.js +174 -50
  70. package/dist/sdk/cli-bootstrap.d.ts +2 -0
  71. package/dist/sdk/cli-bootstrap.js +7 -2
  72. package/dist/sdk/cli-contracts/completeness.js +3 -2
  73. package/dist/sdk/cli-contracts/flag-contracts.js +6 -2
  74. package/dist/sdk/cli-contracts/registration-helpers.js +3 -2
  75. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +5 -0
  76. package/dist/sdk/cli-contracts/runtime-contracts.js +23 -7
  77. package/dist/sdk/cli-contracts/tool-parameter-tables.js +22 -5
  78. package/dist/sdk/cli-contracts/tool-schema.js +20 -5
  79. package/dist/sdk/cli-program.js +3 -2
  80. package/dist/sdk/completion.js +11 -4
  81. package/dist/sdk/core.d.ts +2 -2
  82. package/dist/sdk/core.js +3 -3
  83. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +50 -2
  84. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +74 -14
  85. package/dist/sdk/governance/assurance-action.d.ts +7 -1
  86. package/dist/sdk/governance/assurance-action.js +7 -6
  87. package/dist/sdk/governance/assurance-mutation-error.d.ts +42 -1
  88. package/dist/sdk/governance/assurance-mutation-error.js +27 -3
  89. package/dist/sdk/governance/assurance-runtime.js +12 -11
  90. package/dist/sdk/governance/assurance.d.ts +9 -0
  91. package/dist/sdk/governance/assurance.js +80 -14
  92. package/dist/sdk/governance/coverage-assurance.d.ts +24 -0
  93. package/dist/sdk/governance/coverage-assurance.js +61 -0
  94. package/dist/sdk/governance/extension-host-version.d.ts +25 -0
  95. package/dist/sdk/governance/extension-host-version.js +116 -0
  96. package/dist/sdk/governance/health.d.ts +32 -1
  97. package/dist/sdk/governance/health.js +119 -27
  98. package/dist/sdk/governance/provenance-health.d.ts +27 -0
  99. package/dist/sdk/governance/provenance-health.js +95 -3
  100. package/dist/sdk/governance/validate.js +7 -8
  101. package/dist/sdk/governance.d.ts +6 -0
  102. package/dist/sdk/governance.js +8 -2
  103. package/dist/sdk/history-repair.d.ts +13 -1
  104. package/dist/sdk/history-repair.js +62 -18
  105. package/dist/sdk/index.d.ts +2 -1
  106. package/dist/sdk/index.js +4 -3
  107. package/dist/sdk/linked-artifacts.js +16 -5
  108. package/dist/sdk/pagination.d.ts +15 -0
  109. package/dist/sdk/pagination.js +9 -5
  110. package/dist/sdk/query/context.d.ts +5 -1
  111. package/dist/sdk/query/context.js +14 -5
  112. package/dist/sdk/read-output/continuation.d.ts +11 -0
  113. package/dist/sdk/read-output/continuation.js +132 -0
  114. package/dist/sdk/read-output-budget.d.ts +1 -1
  115. package/dist/sdk/read-output-budget.js +14 -10
  116. package/dist/sdk/read-output-contracts.d.ts +66 -2
  117. package/dist/sdk/read-output-contracts.js +185 -19
  118. package/dist/sdk/read-output-rows.d.ts +2 -0
  119. package/dist/sdk/read-output-rows.js +15 -2
  120. package/dist/sdk/runtime-input.js +4 -2
  121. package/dist/sdk/runtime.d.ts +2 -5
  122. package/dist/sdk/runtime.js +3 -2
  123. package/docs/ASSURANCE.md +59 -2
  124. package/docs/COMMANDS.md +8 -2
  125. package/docs/READ_OUTPUT_CONTRACTS.md +55 -8
  126. package/docs/RELEASING.md +54 -11
  127. package/docs/SDK_CONTEXT_INTEGRITY.md +94 -4
  128. package/docs/SDK_CONTEXT_TRUTH_CONTRACTS.md +13 -5
  129. package/marketplace.json +2 -2
  130. package/package.json +3 -3
  131. package/packages/pm-beads/package.json +1 -1
  132. package/packages/pm-calendar/package.json +1 -1
  133. package/packages/pm-command-kit/package.json +1 -1
  134. package/packages/pm-digital-twin/package.json +1 -1
  135. package/packages/pm-governance-audit/package.json +1 -1
  136. package/packages/pm-guide-shell/package.json +1 -1
  137. package/packages/pm-kanban/package.json +1 -1
  138. package/packages/pm-lifecycle-hooks/package.json +1 -1
  139. package/packages/pm-linked-test-adapters/package.json +1 -1
  140. package/packages/pm-search-advanced/package.json +1 -1
  141. package/packages/pm-templates/package.json +1 -1
  142. package/packages/pm-todos/package.json +1 -1
  143. package/packages/pm-vcs/package.json +1 -1
  144. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  145. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  146. package/sdk/public-surface.json +1241 -180
  147. package/dist/cli-bundle/chunks/chunk-BBOFSVAK.js +0 -197
  148. package/dist/cli-bundle/chunks/chunk-YAMTJL6Y.js +0 -34
  149. package/dist/cli-bundle/chunks/chunk-YSVSMJ2B.js +0 -2
  150. package/dist/cli-bundle/chunks/register-mutation-E27WCLSZ.js +0 -20
  151. package/dist/cli-bundle/chunks/register-operations-4R6I7CPY.js +0 -2
  152. package/dist/cli-bundle/focused-chunks/chunk-F43TT2QQ.js +0 -8
  153. package/dist/cli-bundle/focused-chunks/chunk-KYUQGTSB.js +0 -2
  154. package/dist/cli-bundle/focused-chunks/chunk-LZ4MV3RH.js +0 -2
  155. package/dist/cli-bundle/focused-chunks/chunk-PGXJQLCT.js +0 -155
  156. package/dist/cli-bundle/focused-chunks/chunk-Q4YY3XNF.js +0 -2
  157. package/dist/cli-bundle/focused-chunks/chunk-QK753U3U.js +0 -46
  158. package/dist/cli-bundle/focused-chunks/chunk-QUMB2J27.js +0 -2
  159. package/dist/cli-bundle/focused-chunks/chunk-SM7MTG27.js +0 -2
  160. package/dist/cli-bundle/focused-chunks/chunk-ZM6TZVHC.js +0 -2
@@ -5,11 +5,14 @@
5
5
  * envelopes, including dot-delimited nested paths used by graph projections.
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]="03e25a43-f05c-5bc6-a42a-140914e522d5")}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]="0c69ff43-7bbc-5128-9533-bbf15365126b")}catch(e){}}();
9
9
  const BUDGET_METADATA_ROOT_KEYS = new Set([
10
10
  "applied_bound",
11
11
  "completeness",
12
+ "budget_retention_policy",
12
13
  "continuation_contract",
14
+ "continuation_kind",
15
+ "continuation_path",
13
16
  "filters",
14
17
  "omission_receipt",
15
18
  "output_budget_truncation",
@@ -48,6 +51,16 @@ function replaceValueAtPath(result, rowPath, replacement) {
48
51
  target[segments.at(-1)] = replacement;
49
52
  return root;
50
53
  }
54
+ /** Replace one declared row collection with a suffix beginning at an offset. */
55
+ export function sliceReadOutputRowCollection(result, rowPath, offset) {
56
+ const collection = readOutputRowCollections(result).find((entry) => entry.path === rowPath);
57
+ if (!collection)
58
+ return result;
59
+ const replacement = Array.isArray(collection.value)
60
+ ? collection.value.slice(offset)
61
+ : Object.fromEntries(Object.entries(collection.value).slice(offset));
62
+ return replaceValueAtPath(result, rowPath, replacement);
63
+ }
51
64
  /** Resolve declared row paths, falling back to top-level array properties. */
52
65
  export function readOutputRowPaths(result) {
53
66
  const contract = result.row_contract;
@@ -142,4 +155,4 @@ export function boundReadOutputRows(result, amount) {
142
155
  return { result: projected, truncated };
143
156
  }
144
157
  //# sourceMappingURL=read-output-rows.js.map
145
- //# debugId=03e25a43-f05c-5bc6-a42a-140914e522d5
158
+ //# debugId=0c69ff43-7bbc-5128-9533-bbf15365126b
@@ -5,7 +5,7 @@
5
5
  * primitives are shared by native action dispatchers and MCP-specific adapters.
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]="bcda2578-3b01-5e64-9d53-cd32c0f927b8")}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]="0e153ece-4fc0-5134-97f0-c2315aff0031")}catch(e){}}();
9
9
  import { EXIT_CODE } from "../core/shared/constants.js";
10
10
  import { PmCliError } from "../core/shared/errors.js";
11
11
  import { asRecordClone } from "../core/shared/primitives.js";
@@ -83,6 +83,7 @@ export function actionGlobalOptions(args) {
83
83
  outputLimit: readRuntimeScalarString(args, "outputLimit"),
84
84
  outputBudget: readRuntimeScalarString(args, "outputBudget"),
85
85
  outputSession: readRuntimeString(args, "outputSession"),
86
+ outputCursor: readRuntimeString(args, "outputCursor"),
86
87
  outputFormat: outputFormat === "json" || outputFormat === "toon"
87
88
  ? outputFormat
88
89
  : undefined,
@@ -167,6 +168,7 @@ const UNIVERSAL_READ_OUTPUT_OPTION_KEYS = [
167
168
  "outputBudget",
168
169
  "outputFormat",
169
170
  "outputSession",
171
+ "outputCursor",
170
172
  ];
171
173
  /** Reconcile MCP array/scalar option spellings with CLI flag expectations. */
172
174
  export function normalizeMcpOptionsArrays(options, action) {
@@ -501,4 +503,4 @@ export function updateManyOptionsFromFlat(options) {
501
503
  };
502
504
  }
503
505
  //# sourceMappingURL=runtime-input.js.map
504
- //# debugId=bcda2578-3b01-5e64-9d53-cd32c0f927b8
506
+ //# debugId=0e153ece-4fc0-5134-97f0-c2315aff0031
@@ -33,7 +33,7 @@ import { type GcCommandOptions, type GcResult } from "./governance/gc.js";
33
33
  import { type HealthResult, type RunHealthOptions } from "./governance/health.js";
34
34
  import { type ValidateCommandOptions, type ValidateCountsResult, type ValidateResult } from "./governance/validate.js";
35
35
  import { type ExtensionCommandOptions, type ExtensionCommandResult } from "./extension.js";
36
- import { type AcknowledgeUnknownAuthorEventsOptions } from "./author-attribution.js";
36
+ import { type AcknowledgeUnknownAuthorEventsOptions, type UnknownAuthorAcknowledgmentResult } from "./author-attribution.js";
37
37
  import { type HistoryCompactBulkCommandOptions, type HistoryCompactBulkResult, type HistoryCompactCommandOptions, type HistoryCompactResult } from "./history-compact.js";
38
38
  import { type HistoryRedactCommandOptions, type HistoryRedactResult } from "./history-redact.js";
39
39
  import { type HistoryRepairAllResult, type HistoryRepairCommandOptions, type HistoryRepairResult } from "./history-repair.js";
@@ -250,10 +250,7 @@ export declare class PmClient {
250
250
  /** Compact an explicit or policy-selected set of history streams. */
251
251
  historyCompactBulk(options: HistoryCompactBulkCommandOptions): Promise<HistoryCompactBulkResult>;
252
252
  /** Disposition immutable unknown-author events through append-only audit history. */
253
- historyAuthorAcknowledge(options: AcknowledgeUnknownAuthorEventsOptions): Promise<{
254
- acknowledged: number;
255
- history_path: string;
256
- }>;
253
+ historyAuthorAcknowledge(options: AcknowledgeUnknownAuthorEventsOptions): Promise<UnknownAuthorAcknowledgmentResult>;
257
254
  /** Run any typed plan workflow primitive through the shared CLI/MCP engine. */
258
255
  plan(subcommand: PlanSubcommand, id?: string, options?: PlanCommandOptions, stepRef?: string, reorderTo?: number): Promise<PlanCommandResult>;
259
256
  /** Create a durable plan with optional ordered seed steps. */
@@ -4,7 +4,7 @@
4
4
  * Defines public SDK APIs and package-author helpers for Runtime.
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]="a387cd7a-cb16-5082-80e1-9632ebd02480")}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]="bedbe090-60c3-5935-a656-da4997cd80f7")}catch(e){}}();
8
8
  export { PM_GITIGNORE_END, PM_GITIGNORE_START, ensurePmGitignore, getPmGitignoreBlock, } from "./workspace.js";
9
9
  export { SEARCH_EXTENSION_FLAG_DEFINITIONS } from "./extension-contracts.js";
10
10
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -442,6 +442,7 @@ export class PmClient {
442
442
  return this.runTyped("history-author-acknowledge", {
443
443
  historyEvent: (options.events ?? []).map((event) => `${event.item_id}:${String(event.line)}`),
444
444
  allActionable: options.all_actionable === true,
445
+ dryRun: options.dry_run === true, planFingerprint: options.plan_fingerprint, limit: options.coordinate_limit,
445
446
  attributedAuthor: options.attributed_author,
446
447
  reviewer: options.reviewer,
447
448
  reason: options.reason,
@@ -1932,4 +1933,4 @@ async function loadWorkspaceExtensionRegistrations(pmRoot, settings, cwd) {
1932
1933
  }
1933
1934
  }
1934
1935
  //# sourceMappingURL=runtime.js.map
1935
- //# debugId=a387cd7a-cb16-5082-80e1-9632ebd02480
1936
+ //# debugId=bedbe090-60c3-5935-a656-da4997cd80f7
package/docs/ASSURANCE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Project Assurance Primitives
2
2
 
3
- Tracker: [pm-2lex4r](../.agents/pm/features/pm-2lex4r.toon), [pm-lyfu7b](../.agents/pm/features/pm-lyfu7b.toon), [pm-wn6wot](../.agents/pm/features/pm-wn6wot.toon), [pm-91xeam](../.agents/pm/features/pm-91xeam.toon), [pm-uhv1m5](../.agents/pm/features/pm-uhv1m5.toon), [pm-m7bb7r](../.agents/pm/features/pm-m7bb7r.toon), [pm-py7qv2](../.agents/pm/issues/pm-py7qv2.toon), [pm-33mjrw](../.agents/pm/issues/pm-33mjrw.toon), [pm-q6n8sj](../.agents/pm/issues/pm-q6n8sj.toon), [pm-h06944](../.agents/pm/issues/pm-h06944.toon), [pm-dwj33e](../.agents/pm/decisions/pm-dwj33e.toon)
3
+ Tracker: [pm-2lex4r](../.agents/pm/features/pm-2lex4r.toon), [pm-lyfu7b](../.agents/pm/features/pm-lyfu7b.toon), [pm-wn6wot](../.agents/pm/features/pm-wn6wot.toon), [pm-91xeam](../.agents/pm/features/pm-91xeam.toon), [pm-uhv1m5](../.agents/pm/features/pm-uhv1m5.toon), [pm-m7bb7r](../.agents/pm/features/pm-m7bb7r.toon), [pm-py7qv2](../.agents/pm/issues/pm-py7qv2.toon), [pm-33mjrw](../.agents/pm/issues/pm-33mjrw.toon), [pm-q6n8sj](../.agents/pm/issues/pm-q6n8sj.toon), [pm-h06944](../.agents/pm/issues/pm-h06944.toon), [pm-88mo8m](../.agents/pm/issues/pm-88mo8m.toon), [pm-atnfh4](../.agents/pm/issues/pm-atnfh4.toon), [pm-xmmafu](../.agents/pm/issues/pm-xmmafu.toon), [pm-4ok4ex](../.agents/pm/tasks/pm-4ok4ex.toon), [pm-dwj33e](../.agents/pm/decisions/pm-dwj33e.toon)
4
4
 
5
5
  ## Agent Quick Context
6
6
 
@@ -43,6 +43,14 @@ Measurements support these built-in sources:
43
43
  | `derived` | Combine numeric measurements with deterministic arithmetic and cycle detection. |
44
44
  | `provider` | Delegate a measurement to an explicitly supplied host/package resolver. |
45
45
 
46
+ `ASSURANCE_MEASUREMENT_SOURCE_KINDS` and `ASSURANCE_GATE_TRIGGERS` are the
47
+ public SDK constants for these closed vocabularies. Runtime validation rejects
48
+ missing arrays and unknown discriminants with `AssuranceMutationRefusalError`;
49
+ it never persists an unrecognized source or leaks an incidental JavaScript
50
+ property-access error. Hosts that generate forms or package schemas can obtain
51
+ the same values from `pm contracts --command assurance --json` under
52
+ `assurance_contracts`.
53
+
46
54
  Each measurement may declare `max_cost`. Evaluation fails closed when the total abstract compute units exceed that ceiling. Every result reports units, scanned items, scanned history rows, provider calls, duration, population size, and contributors.
47
55
 
48
56
  One workspace context memoizes identical graph operations and the shared
@@ -263,15 +271,64 @@ await pm.assurance({
263
271
  });
264
272
  ```
265
273
 
266
- For direct host composition, use `evaluateMeasurement`, `evaluateAssuranceGate`, `createAssuranceWorkspaceContext`, the preset/derivation helpers, and the audited declaration/verdict helpers exported from `@unbrained/pm-cli/sdk`. Active extension registrations are discovered automatically. Embedding hosts may additionally pass stable resolver ids and matching `provider_capabilities` to `createAssuranceWorkspaceContext`; an absent resolver or capability fails loudly. The core evaluator bounds concurrent assertions and expression operands, and workspace history loading uses bounded concurrency; item-only callers can explicitly skip history and Git identity resolution.
274
+ For direct host composition, use `evaluateMeasurement`, `evaluateAssuranceGate`, `createAssuranceWorkspaceContext`, the preset/derivation helpers, and the audited declaration/verdict helpers exported from `@unbrained/pm-cli/sdk` and its focused `@unbrained/pm-cli/sdk/governance` entrypoint. Active extension registrations are discovered automatically. Embedding hosts may additionally pass stable resolver ids and matching `provider_capabilities` to `createAssuranceWorkspaceContext`; an absent resolver or capability fails loudly. The core evaluator bounds concurrent assertions and expression operands, and workspace history loading uses bounded concurrency; item-only callers can explicitly skip history and Git identity resolution.
275
+
276
+ Hosts that want the normal action transport and its audited registry lookup can
277
+ pass the same adapters as the third `runAssuranceAction` argument. The request
278
+ and project path remain transport data; resolver capabilities remain explicit
279
+ runtime authority:
280
+
281
+ ```ts
282
+ await runAssuranceAction(
283
+ {
284
+ action: "run",
285
+ id: "repository-static-quality",
286
+ trigger: "ci",
287
+ dry_run: true,
288
+ },
289
+ { path: ".agents/pm" },
290
+ {
291
+ workspace: {
292
+ include_history: false,
293
+ providers: {
294
+ "repository-quality": resolveRepositoryQualityMeasurement,
295
+ },
296
+ provider_capabilities: {
297
+ "repository-quality": { cost_class: "high", network: false },
298
+ },
299
+ },
300
+ },
301
+ );
302
+ ```
303
+
304
+ This is the migration boundary for repository automation: scripts may remain
305
+ focused process adapters, while assertion composition, provider policy,
306
+ negative controls, lifecycle triggers, and verdicts move into ordinary
307
+ assurance declarations. `scripts/release/gate-registry.json` records every
308
+ gate script as migrated, provider-backed, or retained and fails unless the
309
+ migrated/provider-backed population is the majority.
310
+
311
+ `AssuranceMutationRefusalError` and `AssuranceEvaluationRefusalError` are
312
+ exported from both `@unbrained/pm-cli/sdk` and
313
+ `@unbrained/pm-cli/sdk/governance`, so hosts can classify expected declaration
314
+ or evaluation refusals without parsing messages. Source-resolution refusals
315
+ also carry the gate, assertion, measurement, source kind, field, and optional
316
+ health/validate check, so a zero value remains distinct from an absent or
317
+ mistyped field.
267
318
 
268
319
  Generic SDK and MCP dispatch use `action: "assurance"` with `subcommand` set to `list`, `show`, `put`, `remove`, `run`, `verdicts`, `presets`, `apply`, `derive`, or `promote`. Discover the current machine contract instead of copying parameter lists:
269
320
 
270
321
  ```bash
271
322
  pm contracts --action assurance --schema-only --json
272
323
  pm contracts --command assurance --flags-only --json
324
+ pm contracts --command assurance --json
273
325
  ```
274
326
 
327
+ Command-scoped contract output omits unrelated extension, governance,
328
+ relationship, and Commander-alias catalogs unless `--full` is requested. This
329
+ keeps the selected action schema and its assurance vocabularies complete under
330
+ the default output budget instead of truncating the very enum a caller needs.
331
+
275
332
  ## Verdict Contract
276
333
 
277
334
  A gate emits one object containing:
package/docs/COMMANDS.md CHANGED
@@ -4,6 +4,8 @@ This is a task-oriented command guide. For exact flags, use runtime help because
4
4
 
5
5
  Tracked implementation updates: [pm-52eh](../.agents/pm/features/pm-52eh.toon), [pm-mcxr](../.agents/pm/issues/pm-mcxr.toon), [pm-qd3woa](../.agents/pm/issues/pm-qd3woa.toon), [pm-ypuc39](../.agents/pm/issues/pm-ypuc39.toon), [pm-tz2ikr](../.agents/pm/issues/pm-tz2ikr.toon), the schema-migration recovery contract [pm-s79kel](../.agents/pm/issues/pm-s79kel.toon), the lossless mutation contracts [pm-x3dq0l](../.agents/pm/issues/pm-x3dq0l.toon), [pm-lppm6y](../.agents/pm/issues/pm-lppm6y.toon), and [pm-embm6t](../.agents/pm/issues/pm-embm6t.toon), and the SDK-first agent grammar tranche [pm-p316vn](../.agents/pm/issues/pm-p316vn.toon), [pm-st7wgu](../.agents/pm/issues/pm-st7wgu.toon), [pm-mkinft](../.agents/pm/issues/pm-mkinft.toon), [pm-ulqu](../.agents/pm/issues/pm-ulqu.toon), [pm-qmjx](../.agents/pm/issues/pm-qmjx.toon), [pm-4bzq](../.agents/pm/features/pm-4bzq.toon), [pm-x2vx](../.agents/pm/issues/pm-x2vx.toon), and [pm-g543](../.agents/pm/issues/pm-g543.toon).
6
6
 
7
+ Workspace-integrity contracts are tracked by [pm-22rzjp](../.agents/pm/issues/pm-22rzjp.toon), [pm-76fkpp](../.agents/pm/issues/pm-76fkpp.toon), [pm-igdvfq](../.agents/pm/issues/pm-igdvfq.toon), [pm-643e0k](../.agents/pm/issues/pm-643e0k.toon), and [pm-larv4r](../.agents/pm/issues/pm-larv4r.toon).
8
+
7
9
  ```bash
8
10
  pm <command> --help
9
11
  pm <command> --help --json
@@ -965,6 +967,8 @@ pm history-repair <id> --dry-run
965
967
  pm history-repair <id> --message "re-anchor legacy drift"
966
968
  pm history-repair --all --dry-run
967
969
  pm history-repair --all --message "bulk re-anchor drifted streams"
970
+ pm history-repair --all --normalize-provenance --dry-run
971
+ pm history-repair --all --normalize-provenance --message "normalize invalid legacy provenance"
968
972
  pm activity # item digest for the last 24 hours
969
973
  pm activity --raw --id <id> --limit 50
970
974
  pm activity --full --id <id> --limit 50
@@ -1020,8 +1024,10 @@ For governance dashboards, `--metadata-coverage` adds a `metadata_coverage` bloc
1020
1024
  `history-redact` rewrites matching history payloads deterministically, recomputes hash chains, and appends an auditable `history_redact` marker entry when changes are applied. Its result reports only `literal_count`, `regex_count`, `total_count`, and whether the default replacement was selected; literal values, regex source text, and replacement text are never echoed in CLI, SDK, MCP, recovery, profile, or telemetry output. Treat regex text as sensitive input because it can contain the exact material being removed.
1021
1025
  `history-compact` rewrites long streams into a synthetic checkpoint baseline plus a retained tail (`--before` accepts a 1-based version or ISO timestamp), re-anchors hashes, verifies integrity, and appends an auditable `history_compact` marker when applied.
1022
1026
  `history-compact` bulk mode (mutually exclusive with a positional `<id>`) compacts many streams in one audited pass. Select with `--ids <a,b,c>` (an explicit list — used on its own, not combined with the scan selectors below), or a scan: `--all-over <N>` (every stream with more than N entries) and/or a lifecycle filter `--closed` (terminal items only) or `--all-streams` (every stream). `--closed` and `--all-streams` are mutually exclusive. `--min-entries <N>` (default 3) skips already-compact streams; when `history.compact_policy` is enabled and `--all-over` is omitted, the policy's `max_entries` becomes the default threshold. `--before` is single-id only and is rejected in bulk mode. Each selected stream runs the same single-item compaction; one failing stream never aborts the rest — the result reports `totals` (`streams_considered`/`selected`/`items_compacted`/`items_skipped`/`items_errored`) plus one row per stream (`compacted`/`skipped` with a `skip_reason`/`errored`), and the command exits non-zero only if any stream errored.
1023
- `history-repair` re-anchors a drifted history chain when `pm health`/`pm validate --check-history-drift` report stale hashes: it replays the stream, recomputes every before/after hash, repairs legacy patch ops that no longer strictly apply, reconciles the latest hash with the on-disk item, and appends an auditable `history_repair` marker. It never modifies item content and is a safe no-op on a clean stream.
1024
- `history-repair --all` (mutually exclusive with `<id>`) runs the same drift scan `pm health` uses and applies the audited single-stream repair (ownership check, lock, post-repair no-drift verification, `--message` audit marker, per-stream `--force`) to every drifted stream in one pass. One failing stream never aborts the rest: the result lists one compact row per drifted stream (`repaired` / `skipped_clean` / `failed`) plus `totals`, and the command exits non-zero only if any stream failed.
1027
+ `history-repair` re-anchors a drifted history chain when `pm health`/`pm validate --check-history-drift` report stale hashes: it replays the stream, recomputes every before/after hash using the stream's detected hash epoch, repairs legacy patch ops that no longer strictly apply, reconciles the latest hash with the on-disk item, and appends an auditable `history_repair` marker. It never modifies item content and is a safe no-op on a clean stream. The result reports the before/after hash versions and whether the epoch was preserved or selected for an ambiguous broken stream, preventing old/new runtimes from alternately rewriting an otherwise consistent legacy chain.
1028
+ `history-repair --all` (mutually exclusive with `<id>`) runs the same drift scan `pm health` uses and applies the audited single-stream repair (ownership check, lock, post-repair no-drift verification, `--message` audit marker, per-stream `--force`) to every drifted stream in one pass. One failing stream never aborts the rest: the result lists one compact row per targeted stream (`repaired` / `skipped_clean` / `failed`) plus `totals`, and the command exits non-zero only if any stream failed. Add `--normalize-provenance` to include streams containing invalid boolean or single-digit provenance observations. The normalizer removes only those invalid observations and writes aggregate harness/dimension/kind counts in the audit receipt; it never echoes or retains the removed value.
1029
+
1030
+ Every `pm health` projection exposes `findings` and `failed_because`. A finding binds one warning token to its owning check, stable code, `advisory|gate_failing` severity, and either an executable remediation or `no_safe_automatic_remediation`. Extension health also publishes `host_version_census`, which enumerates the host and every pm-cli copy resolved by loaded extensions across npm/pnpm layouts. A version mismatch makes the extension check non-clean; matching workspace-linked or deduplicated copies remain healthy.
1025
1031
 
1026
1032
  `pm health --verbose-author-events --json` includes the complete actionable unknown-author coordinate list and an explicit `samples_truncated` marker. After evidence review, `pm history-author-acknowledge --all-actionable --attributed-author <principal> --reviewer <reviewer> --reason <evidence>` records one append-only disposition for the current complete set. `--all-actionable` and repeatable `--event <item-id:line>` are mutually exclusive; reviewer, attributed author, and reason remain mandatory.
1027
1033
 
@@ -1,17 +1,17 @@
1
1
  # Universal Read Output Contracts
2
2
 
3
- Tracker references: [pm-hb7ug8](../.agents/pm/features/pm-hb7ug8.toon), [pm-cxr0jb](../.agents/pm/features/pm-cxr0jb.toon), [pm-hid9g1](../.agents/pm/features/pm-hid9g1.toon), [pm-h8tpeh](../.agents/pm/features/pm-h8tpeh.toon), [pm-sb0tns](../.agents/pm/issues/pm-sb0tns.toon), [pm-gjjurs](../.agents/pm/issues/pm-gjjurs.toon), [pm-eugaqy](../.agents/pm/issues/pm-eugaqy.toon), [pm-jt8aa2](../.agents/pm/issues/pm-jt8aa2.toon), and [pm-kyjdne](../.agents/pm/issues/pm-kyjdne.toon).
3
+ Tracker references: [pm-hb7ug8](../.agents/pm/features/pm-hb7ug8.toon), [pm-cxr0jb](../.agents/pm/features/pm-cxr0jb.toon), [pm-hid9g1](../.agents/pm/features/pm-hid9g1.toon), [pm-h8tpeh](../.agents/pm/features/pm-h8tpeh.toon), [pm-5t33or](../.agents/pm/features/pm-5t33or.toon), [pm-sb0tns](../.agents/pm/issues/pm-sb0tns.toon), [pm-gjjurs](../.agents/pm/issues/pm-gjjurs.toon), [pm-eugaqy](../.agents/pm/issues/pm-eugaqy.toon), [pm-jt8aa2](../.agents/pm/issues/pm-jt8aa2.toon), [pm-kyjdne](../.agents/pm/issues/pm-kyjdne.toon), [pm-8nev0o](../.agents/pm/issues/pm-8nev0o.toon), [pm-e5gl05](../.agents/pm/issues/pm-e5gl05.toon), [pm-cha95z](../.agents/pm/tasks/pm-cha95z.toon), and [pm-2qvq7a](../.agents/pm/issues/pm-2qvq7a.toon).
4
4
 
5
5
  ## Agent Quick Context
6
6
 
7
7
  Every built-in read surface uses four output dimensions: what to include, how much to return, how much the result may cost, and how to encode it. The same canonical controls work through the CLI, SDK, MCP, generated schemas, runtime contracts, and shell completions.
8
8
 
9
- | Dimension | CLI | SDK and MCP | Meaning |
10
- | --------- | ------------------------------- | --------------- | ---------------------------------------------------------------------- |
11
- | Include | `--output-include <csv>` | `outputInclude` | Retain named fields or sections, or select a declared projection mode. |
12
- | Amount | `--output-limit <n\|unbounded>` | `outputLimit` | Bound shared row collections. |
13
- | Cost | `--output-budget <tokens>` | `outputBudget` | Fail closed when even the compact result cannot fit. |
14
- | Encoding | `--output-format <toon\|json>` | `outputFormat` | Select the CLI renderer and record the requested encoding. |
9
+ | Dimension | CLI | SDK and MCP | Meaning |
10
+ | --------- | -------------------------------- | --------------- | ---------------------------------------------------------------------- |
11
+ | Include | `--output-include <csv>` | `outputInclude` | Retain named fields or sections, or select a declared projection mode. |
12
+ | Amount | `--output-limit <n\|unbounded>` | `outputLimit` | Bound shared row collections. |
13
+ | Cost | `--output-budget <n\|unbounded>` | `outputBudget` | Fail closed when even the compact result cannot fit. |
14
+ | Encoding | `--output-format <toon\|json>` | `outputFormat` | Select the CLI renderer and record the requested encoding. |
15
15
 
16
16
  The contract covers `list`, `context`, `search`, `get`, `next`, `health`, `deps`, `graph`, `history`, `activity`, `validate`, `events`, `contracts`, `comments`, `notes`, `files`, `docs`, `stats`, and `aggregate`, including list aliases and `ctx`.
17
17
 
@@ -117,6 +117,18 @@ tracker content.
117
117
 
118
118
  Resolution is deterministic: canonical controls win over command-local compatibility options, which win over intent defaults, which win over command defaults. Existing options such as `--fields`, `--limit`, `--token-budget`, `--format`, `--brief`, and `--full` remain accepted. Contract output marks them as hidden compatibility aliases and supplies a migration hint; traversal, cursor, side-effect, and streaming controls instead receive an explicit behavior-preservation hint because a static output control cannot replace their semantics. Callers that omit the four shaping dimensions retain the established data projection; the one intentional envelope correction is that repeated `row_contract` metadata is now opt-in.
119
119
 
120
+ Completeness spellings preserve their established promise. `pm list-all` and
121
+ list-family `--no-truncate` imply an unbounded cost dimension when the caller
122
+ does not supply `--output-budget`; they cannot silently return a budget-trimmed
123
+ subset while claiming to return every matched row. An explicit canonical
124
+ budget still has precedence and may request a bounded result deliberately.
125
+ The same SDK-native rule applies to every declared complete-result spelling,
126
+ including `contracts --full`: explicit completeness defeats only the implicit
127
+ default ceiling. If an explicit caller budget cannot retain any useful domain
128
+ result, the CLI still prints the parseable omission receipt but exits 2; a
129
+ consumer therefore cannot interpret the missing command or action arrays as a
130
+ successful empty contract.
131
+
120
132
  ```bash
121
133
  pm list-open --output-include id,title,status --output-limit 10
122
134
  pm context --for orient --output-budget 900 --output-format toon
@@ -127,7 +139,41 @@ pm contracts --full --json
127
139
 
128
140
  Every projected result carries a `read_output` receipt with the requested dimensions, precedence, observed compatibility aliases, deterministic estimated token count, string/row compaction signals, and budget outcome. Budget degradation discovers nested arrays as well as declared result rows, so validation diagnostics and other governance payloads compact their inner findings before the useful result is omitted. `compacted_row_paths` names every reduced collection without redefining those nested arrays as ordinary pagination rows.
129
141
 
130
- When rows are dropped to satisfy a ceiling, the result also carries `output_budget_truncation`, naming the binding budget and its source, any explicitly requested dimension the budget overrode, every compacted collection path, and an executable recovery instruction — a default ceiling can override an explicit `--output-limit unbounded`, and that override is reported rather than silent. If no useful content can fit, `PmReadOutputBudgetExceeded` provides a discriminated omission result and reports `omitted_result_estimated_tokens`, the last useful-result estimate before omission; use `isReadOutputBudgetExceeded` before accessing result-specific fields. Universal controls are rejected on mutation commands and on the mutation mode of hybrid commands such as `comments`, `notes`, `files`, and `docs`.
142
+ When rows are dropped to satisfy a ceiling, the result also carries `output_budget_truncation`, naming the binding budget and its source, any explicitly requested dimension the budget overrode, every compacted collection path, and executable CLI/SDK/MCP recovery options — a default ceiling can override an explicit `--output-limit unbounded`, and that override is reported rather than silent. If a producer supplied an opaque item-page cursor, compaction rebases it to the last row actually returned and reports `continuation_cursor_rebased: true`; following the cursor therefore cannot skip rows removed from the middle of a producer page. If no useful content can fit, `PmReadOutputBudgetExceeded` provides a discriminated omission result, a compact `{ outputBudget: "unbounded" }` recovery object, and `omitted_result_estimated_tokens`, the last useful-result estimate before omission; use `isReadOutputBudgetExceeded` before accessing result-specific fields. Universal controls are rejected on mutation commands and on the mutation mode of hybrid commands such as `comments`, `notes`, `files`, and `docs`.
143
+
144
+ Cursor recovery carries the opaque value once in `recovery.cursor` and declares
145
+ the accepting `cli`, `sdk`, and `mcp` binding beside it. This avoids
146
+ serializing the same cursor once per transport while retaining an executable,
147
+ machine-readable binding for each surface.
148
+
149
+ Budget-compacted declared row paths are independently resumable. The
150
+ disclosure's `continuations` entries name the row path, retained/remaining/total
151
+ counts, and an opaque cursor. `continuation_kind` distinguishes a rebased
152
+ producer cursor, a universal output cursor, and a terminal page;
153
+ `next_cursor` mirrors the first universal entry for ordinary one-path
154
+ consumers. Replay the same query and budget
155
+ with `--output-cursor <cursor>` / `outputCursor`. The cursor validates the
156
+ command, declared row path, total, and stable row identities before slicing, so
157
+ a mismatched or stale replay fails closed instead of skipping evidence. A
158
+ bounded recovery therefore does not require replacing a 600-token request with
159
+ an unbounded multi-megabyte response;
160
+ `recovery_budget_multiplier: 1` declares that each next page retains the same
161
+ useful-result ceiling.
162
+
163
+ Assurance declares `budget_retention_policy: verdict_priority`: failing block,
164
+ warn, and observe rows precede retired and passing rows while preserving order
165
+ within each class. `assertions_total` remains the pre-projection denominator,
166
+ and the `assertions` row path uses the same continuation primitive. A blocking
167
+ verdict consequently keeps its causal evidence on the first bounded page even
168
+ when the failing assertion was declared last.
169
+
170
+ Diagnostic gates retain bounded, actionable predicates. Every metadata field
171
+ required by the active validation profile emits a numeric count, including
172
+ zero, so assurance expressions can distinguish a clean check from a missing
173
+ key. Health retains at most 100 warning rows and reports `warning_count`,
174
+ `warning_limit`, and `warnings_truncated`; `--strict-exit` defaults to summary
175
+ projection unless `--full` is explicit, keeping the failing check identities
176
+ and warning codes inside the ordinary budget.
131
177
 
132
178
  ## SDK and Package Usage
133
179
 
@@ -150,6 +196,7 @@ const result = await pm.list({
150
196
  spent_tokens: 0,
151
197
  seen_item_ids: [],
152
198
  },
199
+ // Supply outputCursor from output_budget_truncation to fetch the next row page.
153
200
  });
154
201
  ```
155
202
 
package/docs/RELEASING.md CHANGED
@@ -24,7 +24,10 @@ Tracked documentation work: [pm-u9d0](../.agents/pm/epics/pm-u9d0.toon),
24
24
  [pm-lwnifd](../.agents/pm/issues/pm-lwnifd.toon), and SDK-bound reliability
25
25
  classification [pm-dqtzva](../.agents/pm/issues/pm-dqtzva.toon).
26
26
  The local/hosted gate selection contract is tracked by
27
- [pm-ei6x66](../.agents/pm/tasks/pm-ei6x66.toon).
27
+ [pm-ei6x66](../.agents/pm/tasks/pm-ei6x66.toon). Release-candidate analyzer
28
+ provenance is tracked by [pm-u1baah](../.agents/pm/issues/pm-u1baah.toon), and
29
+ authoritative blocker-recovery run selection by
30
+ [pm-db8onn](../.agents/pm/issues/pm-db8onn.toon).
28
31
 
29
32
  ## Version Policy
30
33
 
@@ -75,11 +78,15 @@ Policy:
75
78
  created, a non-`github-actions[bot]` closure of the exact bot-created
76
79
  `Auto Release blocked` issue on the same UTC day triggers one preparation
77
80
  retry
78
- - if today's tag already exists, blocker closure reruns and watches the exact
79
- tag-driven Release workflow instead of invoking release preparation or
80
- creating an ordinal replacement; an already-successful run is recorded as
81
+ - if today's tag already exists, blocker closure bypasses release-preparation
82
+ provenance, dependency installation, and build work, then selects immutable
83
+ Release evidence across both tag-push and guarded workflow-dispatch runs; a
84
+ completed success is authoritative over stale failures and is recorded as
81
85
  recovered without republishing
82
86
  - release preparation must pass all quality and compatibility gates before commit+tag push
87
+ - before dependency installation or build, auto-release verifies that the
88
+ candidate has exact-commit analyzer results or an immutable tree-identical
89
+ reviewed PR head with successful DeepScan and CodeFactor results
83
90
  - `CHANGELOG.md` is generated by the latest npm `pm-changelog` package (`pm install npm:pm-changelog --project`, then `pm changelog generate --mode replace --all-release-tags`) from closed tracker items across git release tag windows and checked in CI; do not edit it by hand
84
91
  - protected-branch pushes require `RELEASE_PAT`; Auto Release fails fast before the expensive release gates when `push=true`, `dry_run=false`, and that secret is not configured
85
92
  - release reliability gating requires `SENTRY_PERSONAL_ADMIN_TOKEN` for issue-threshold checks; Auto Release fails before creating the version commit/tag when the token is missing and `push=true`, while sourcemap upload remains optional through `SENTRY_AUTH_TOKEN`
@@ -88,9 +95,12 @@ Policy:
88
95
  - when scheduled failures continue across multiple UTC days, auto-release supersedes a stale open blocker with a fresh current-day blocker so same-day retry detection follows the latest scheduled failure
89
96
  - closing the exact bot-created `Auto Release blocked: scheduled run failed`
90
97
  issue as a maintainer or agent records a same-day retry marker, then either
91
- retries preparation when no tag exists or reruns the exact existing tag's
92
- Release workflow; it comments with the recovered tag on success and reopens
93
- the same issue on failure. A second close on the same UTC day is refused
98
+ retries preparation when no tag exists or watches an active exact-tag Release
99
+ workflow. If only failed or missing evidence exists, it dispatches the
100
+ reviewed current `release.yml` from `main` with the immutable tag input; it
101
+ never reruns historical workflow code. It comments with the recovered tag on
102
+ success and reopens the same issue on failure. A second close on the same UTC
103
+ day is refused
94
104
  before release mutation and reported as `retry_already_attempted`, and
95
105
  workflow cleanup closures by `github-actions[bot]` are ignored.
96
106
  - after a scheduled run publishes a tag and the downstream release workflow succeeds, auto-release closes any open `Auto Release blocked` issue so the GitHub tracker reflects current release health
@@ -196,8 +206,9 @@ The build writes `dist/cli-bundle/bundle-manifest.json` atomically with SHA-256
196
206
 
197
207
  4. Run the same release pipeline locally.
198
208
 
199
- Push the final implementation commit first, wait for DeepScan and CodeFactor to
200
- finish on that reviewed SHA, then run the canonical registry-owned preflight:
209
+ Push the final implementation commit through a reviewed pull request first,
210
+ wait for DeepScan and CodeFactor to finish on that reviewed SHA, then run the
211
+ canonical registry-owned preflight:
201
212
 
202
213
  ```bash
203
214
  pnpm verify:preflight
@@ -207,7 +218,8 @@ The registry supplies the ordered executable plan, command arguments,
207
218
  environment, capture policy, and explicit skip policy. Its receipt distinguishes
208
219
  passed checks from declared skips. The same registry maps named PR, nightly,
209
220
  and release workflow gates; hosted-only entries must explain why no faithful
210
- local equivalent exists.
221
+ local equivalent exists. Analyzer provenance is the first executable step, so
222
+ an unreleasable candidate fails before build, coverage, or package work.
211
223
 
212
224
  The preflight includes the mandatory local hosted-analysis proof:
213
225
 
@@ -218,13 +230,44 @@ pnpm quality:hosted-analysis
218
230
  The gate accepts only DeepScan's explicit zero-new-issue status and
219
231
  CodeFactor's explicit no-issues result. Both contexts are required by `main`
220
232
  branch protection, and the release pipeline reruns the same immutable-tree
221
- proof. It reads the release commit first. When GitHub does not copy app results
233
+ proof. The gate reads branch protection through REST first; if that transport
234
+ is unavailable or its core API quota is exhausted, it queries the equivalent
235
+ GraphQL rules across every cursor-paginated page and still requires one exact
236
+ `main` rule with strict updates plus both analyzer contexts. Malformed,
237
+ truncated, missing, or ambiguous admin policy data fails closed. GitHub Actions'
238
+ ephemeral token cannot request the repository `Administration: read` permission
239
+ required by both of those policy surfaces. When both admin transports reject
240
+ that token, the gate uses the contents-readable `GET /branches/main` summary
241
+ and requires that the exact candidate is the current protected branch head,
242
+ protection is enabled and enforced, and CodeFactor plus DeepScan are effective
243
+ required contexts. That summary intentionally cannot attest the admin-only
244
+ strict-update setting: its receipt reports `strict: null`,
245
+ `strict_verified: false`, and `verification_scope: effective_required_checks`
246
+ instead of inventing a positive result. Exact or immutable identical-tree
247
+ analyzer provenance remains mandatory and is emitted beside the policy receipt,
248
+ so the restricted-token recovery cannot admit an unanalyzed or different-tree
249
+ candidate. A maintainer token with administration-read access still verifies
250
+ and reports `strict: true` through REST or paginated GraphQL. It reads the
251
+ release commit first. When GitHub does not copy app results
222
252
  onto a merge commit, the gate may reuse a reviewed merge-parent or squash-PR
223
253
  head only when its immutable Git tree SHA exactly matches the release commit.
224
254
  Squash provenance additionally requires one unambiguous GitHub association to a
225
255
  closed PR merged into `main` with the release commit as its merge commit.
226
256
  Missing, ambiguous, or different-tree provenance fails closed.
227
257
 
258
+ The supported default-branch arrival path is a reviewed pull request. A direct
259
+ push to `main` is releasable only if both analyzers attached successful evidence
260
+ to that exact commit; when they did not, the gate explicitly refuses the
261
+ candidate instead of letting the next scheduled release discover the missing
262
+ precondition after expensive work. CI runs `Release analyzer readiness (main)`
263
+ on every product-relevant push to `main`, providing continuous visibility
264
+ between release attempts. If GitHub's commit-association endpoint has not yet
265
+ published a new merge, the gate reads the pull-request number from GitHub's
266
+ standard merge message and accepts it only after the immutable PR resource
267
+ confirms that exact merge SHA, `main` base, and reviewed head. Remediate a
268
+ refused direct-main candidate by landing the next tree-changing fix through a
269
+ reviewed PR; never copy, synthesize, or bypass analyzer evidence.
270
+
228
271
  ```bash
229
272
  # Read-only parity check
230
273
  pnpm release:pipeline:dry-run
@@ -1,6 +1,6 @@
1
1
  # SDK Context Integrity
2
2
 
3
- Tracker: [pm-0k19l7](../.agents/pm/issues/pm-0k19l7.toon), [pm-9stazf](../.agents/pm/issues/pm-9stazf.toon), [pm-tu71](../.agents/pm/issues/pm-tu71.toon), [pm-0xmajx](../.agents/pm/issues/pm-0xmajx.toon), [pm-7rrqsk](../.agents/pm/issues/pm-7rrqsk.toon), [pm-ety1qc](../.agents/pm/issues/pm-ety1qc.toon), [pm-lu6sca](../.agents/pm/features/pm-lu6sca.toon), [pm-5y05kq](../.agents/pm/issues/pm-5y05kq.toon), [pm-gjjurs](../.agents/pm/issues/pm-gjjurs.toon), [pm-h97qxd](../.agents/pm/issues/pm-h97qxd.toon), [pm-h06944](../.agents/pm/issues/pm-h06944.toon), and [pm-5t33or](../.agents/pm/features/pm-5t33or.toon).
3
+ Tracker: [pm-0k19l7](../.agents/pm/issues/pm-0k19l7.toon), [pm-9stazf](../.agents/pm/issues/pm-9stazf.toon), [pm-tu71](../.agents/pm/issues/pm-tu71.toon), [pm-0xmajx](../.agents/pm/issues/pm-0xmajx.toon), [pm-7rrqsk](../.agents/pm/issues/pm-7rrqsk.toon), [pm-ety1qc](../.agents/pm/issues/pm-ety1qc.toon), [pm-lu6sca](../.agents/pm/features/pm-lu6sca.toon), [pm-5y05kq](../.agents/pm/issues/pm-5y05kq.toon), [pm-gjjurs](../.agents/pm/issues/pm-gjjurs.toon), [pm-h97qxd](../.agents/pm/issues/pm-h97qxd.toon), [pm-h06944](../.agents/pm/issues/pm-h06944.toon), [pm-5t33or](../.agents/pm/features/pm-5t33or.toon), [pm-in23qu](../.agents/pm/issues/pm-in23qu.toon), [pm-h8tpeh](../.agents/pm/features/pm-h8tpeh.toon), [pm-okgxwa](../.agents/pm/issues/pm-okgxwa.toon), [pm-22rzjp](../.agents/pm/issues/pm-22rzjp.toon), [pm-76fkpp](../.agents/pm/issues/pm-76fkpp.toon), [pm-igdvfq](../.agents/pm/issues/pm-igdvfq.toon), [pm-643e0k](../.agents/pm/issues/pm-643e0k.toon), [pm-larv4r](../.agents/pm/issues/pm-larv4r.toon), [pm-mcxk8v](../.agents/pm/issues/pm-mcxk8v.toon), and [pm-2zkvxm](../.agents/pm/issues/pm-2zkvxm.toon).
4
4
 
5
5
  ## Agent Quick Context
6
6
 
@@ -54,7 +54,48 @@ rows. This lets governance envelopes reduce diagnostic findings before
54
54
  omitting the whole verdict without redefining a nested tag or remediation list
55
55
  as a pagination row. Receipts name every `compacted_row_paths` entry; a complete
56
56
  omission also records the useful result's pre-omission estimate, while the
57
- universal recovery remains `--output-budget unbounded`.
57
+ recovery names a bounded budget increase when no declared row path can resume.
58
+
59
+ Budget-compacted declared rows instead publish a bounded `outputCursor`
60
+ continuation on every transport. The cursor resumes the first withheld row and
61
+ rejects a command, path, row-total, or stable-identity mismatch. This gives SDK
62
+ and package loops a recursive self-improvement primitive: consume a bounded
63
+ page, update context, and continue without abandoning the ceiling.
64
+
65
+ `context --explain-ranking` projects explanations to the focus rows actually
66
+ served. `candidate_count` records the scorer population and `omitted_count`
67
+ records explanations intentionally withheld, while each returned row retains
68
+ its rank, baseline rank, score, and per-signal contributions. Explanation cost
69
+ therefore scales with the answer rather than with the active workspace.
70
+
71
+ Unknown-option recovery is likewise derived from the declared flag lexicon.
72
+ The structured `option_scope` is `declared_on_path`, `declared_elsewhere`, or
73
+ `declared_nowhere`; accepting command paths are included only for the second
74
+ case, while the third names the nearest current-path spellings and explicitly
75
+ terminates the otherwise-unbounded command search.
76
+
77
+ ## Executable recovery-reference coverage
78
+
79
+ Structured refusal guidance is a forward-reference contract, not decorative
80
+ text. `verifyPmRecoveryReferences` accepts obligations derived from real error
81
+ envelopes and observations produced by executing a retry, resolving a declared
82
+ command path, or linking prose to an already executed recovery. Its report
83
+ includes the total obligation set, pass fraction, sorted findings, and stable
84
+ coverage buckets for `suggested_retry`, `candidate_command`, `example`,
85
+ `next_step`, `migration_hint`, and `restore_with`, including zero-population
86
+ buckets. `derivePmRecoveryReferenceObligations` walks emitted envelopes and
87
+ generated read-output contracts, so tests cannot silently omit a producer
88
+ family. Each obligation declares `recovery`, `replacement`, or
89
+ `behavior_preserving` semantics and its proof must demonstrate the same
90
+ promise.
91
+
92
+ The repository integration corpus drives real CLI refusals, executes the
93
+ emitted retry in a temporary tracker, compares candidate commands with the
94
+ unbounded runtime contract enumeration, and binds examples and next steps to
95
+ those proofs. A seeded unreachable observation must lower the pass fraction
96
+ and produce `unreachable_reference`. The same corpus is a provider-backed
97
+ blocking assertion in `repository-context-quality`, so a well-formed but broken
98
+ recovery promise cannot pass CI merely because its text or target flag exists.
58
99
 
59
100
  ## Row discovery and exact output receipts
60
101
 
@@ -92,17 +133,32 @@ SDK callers use `fullHistory: true`; MCP callers use `full: true`. The default s
92
133
 
93
134
  ## Author acknowledgment coordinates
94
135
 
95
- CLI, SDK, and MCP use the same selector and coordinate parser for `history-author-acknowledge`. A coordinate is `<item-id>:<line>` or `_workspace:<line>`, with a positive one-based line number. Exactly one of explicit events or `all_actionable` is required.
136
+ CLI, SDK, and MCP use the same selector and coordinate parser for `history-author-acknowledge`. A coordinate is `<item-id>:<line>` or `_workspace:<line>`, with a positive one-based line number. Exactly one of explicit events or `all_actionable` is required. Applying is a two-step operation: dry-run returns a deterministic SHA-256 over the complete, ordered coordinate set and every exact source-line hash; apply requires that fingerprint and refuses stale source or selection drift with `CONFLICT` exit 4 before writing history.
96
137
 
97
138
  ```bash
98
139
  pm history-author-acknowledge \
99
140
  --event _workspace:4 \
141
+ --dry-run
142
+
143
+ pm history-author-acknowledge \
144
+ --event _workspace:4 \
145
+ --plan-fingerprint <sha256-from-preview> \
100
146
  --attributed-author import-agent \
101
147
  --reviewer maintainer \
102
148
  --reason "Verified workspace provenance"
103
149
  ```
104
150
 
105
- The SDK exposes `resolveUnknownAuthorAcknowledgmentSelector` and `parseUnknownAuthorHistoryEventCoordinates` so packages never need a private copy of this grammar. Health and validate map actionable unknown-author warnings directly to this append-only acknowledgment command instead of sending callers through another diagnostic loop.
151
+ Preview coordinates are bounded with `--limit`, but the fingerprint and counts always cover the complete selection. Plans distinguish already acknowledged coordinates, and apply reports `effect`, `no_effect` (exit 6), or `partial_effect` (exit 7). Bulk selection appends only newly actionable rows, while explicit coordinates may append a superseding disposition as described below. The SDK exposes `planUnknownAuthorHistoryAcknowledgment`, `resolveUnknownAuthorAcknowledgmentSelector`, and `parseUnknownAuthorHistoryEventCoordinates` so packages never need a private copy of this grammar. Health and validate map actionable unknown-author warnings directly to this append-only acknowledgment command instead of sending callers through another diagnostic loop.
152
+
153
+ An explicit `--event` selection is also the append-only correction path: if a
154
+ coordinate already has a disposition, preview marks it
155
+ `already_acknowledged`, and fingerprint-bound apply appends a later disposition
156
+ that supersedes the earlier attribution. Recover the original coordinates from
157
+ `context.author_acknowledgment.events` in the applicable
158
+ `history/_workspace.jsonl` record, preview those same coordinates, and apply the
159
+ fresh fingerprint with the corrected author and review evidence. By contrast,
160
+ `--all-actionable` intentionally selects only undispositioned rows; an empty
161
+ bulk selection remains `no_effect` and never repeats existing dispositions.
106
162
 
107
163
  ## Health provider boundary
108
164
 
@@ -116,6 +172,14 @@ That agreement check reads only local history and JSON files: mismatched,
116
172
  missing, or unreadable singleton paths become bounded `history_drift` evidence
117
173
  without enabling embeddings, vector-store access, or any other provider I/O.
118
174
 
175
+ Every SDK operation that requires a valid `_workspace` chain refuses the same
176
+ way when verification fails. The typed `workspace_history_chain_invalid`
177
+ conflict includes `verification_errors` in CLI JSON and SDK error context plus
178
+ an executable `pm history _workspace --verify --json` recovery command. This
179
+ keeps deliberate corruption tests and recoverable tracker drift out of the
180
+ unexpected-runtime-error channel without weakening the fail-closed mutation
181
+ boundary.
182
+
119
183
  Brief and summary check-only health projections use the scalar-only metadata
120
184
  reader. Validation uses collection-bearing metadata for evidence and
121
185
  relationship checks and materializes bodies only when strict history-drift
@@ -134,6 +198,26 @@ never succeeded. The same bounded pass classifies bare boolean and single-digit
134
198
  values across every recorded provenance dimension, publishes only aggregate
135
199
  harness/dimension/kind counts, and never echoes the historical value.
136
200
 
201
+ `historyRepair` and `historyRepairAll` retain the detected history hash epoch
202
+ instead of unconditionally upgrading it. `normalizeProvenance: true` adds a
203
+ privacy-safe repair mode that removes invalid bounded observations and records
204
+ only aggregate counts/classes in the synthetic audit event. The bulk form
205
+ selects both drifted streams and streams requiring provenance normalization.
206
+
207
+ Health results are self-indexing: every retained warning has a `findings` row
208
+ with its owning check, stable code, severity, and either executable remediation
209
+ or an explicit safe refusal. `failed_because` contains the exact warning tokens
210
+ that decide `ok: false` and survives brief/summary projection. Extension health
211
+ adds a host-version census by resolving the pm-cli package visible from each
212
+ loaded extension; npm/pnpm duplicate-version skew is gate-failing while matching
213
+ workspace-linked and deduplicated copies remain green.
214
+
215
+ Linked file/doc add parsing uses one SDK allowlist. Whitespace-free filesystem
216
+ paths and scheme-prefixed URLs remain positional even when a path or query
217
+ contains `=`. Leading assignment syntax, including malformed URL-plus-note
218
+ input, must use the declared `path`, `scope`, and `note` keys or fail before
219
+ mutation.
220
+
137
221
  ## Replication and refusal gate
138
222
 
139
223
  `scripts/release/surface-replication-sets.json` declares replicated SDK, CLI, MCP, documentation, and test members. `pnpm quality:surface-replication` activates sets from the Git changeset, verifies every member invariant, and reports:
@@ -145,6 +229,12 @@ harness/dimension/kind counts, and never echoes the historical value.
145
229
  - an AST-derived denominator of identical named rule bodies, declared coverage,
146
230
  and a non-decreasing detected-cluster floor.
147
231
 
232
+ Trigger entries may constrain a shared file with `changed_lines_contain_any`.
233
+ The set then activates only when an added or removed diff line carries one of
234
+ those contract markers. Missing diff evidence fails closed and activates the
235
+ set, while an unrelated hunk in the same shared table does not force artificial
236
+ edits across every replicated member.
237
+
148
238
  Query waivers directly with:
149
239
 
150
240
  ```bash