@unbrained/pm-cli 2026.8.15 → 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 (98) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +26 -9
  3. package/dist/cli/error-guidance.d.ts +5 -0
  4. package/dist/cli/error-guidance.js +15 -2
  5. package/dist/cli/register-history-author.js +16 -11
  6. package/dist/cli-bundle/bundle-manifest.json +142 -142
  7. package/dist/cli-bundle/chunks/{chunk-KIEGUBYQ.js → chunk-47OQEOQB.js} +2 -2
  8. package/dist/cli-bundle/chunks/{chunk-WLPDLNEZ.js → chunk-73UGEBRS.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-QHPCJWEJ.js → chunk-HCIYWD6M.js} +34 -34
  10. package/dist/cli-bundle/chunks/{chunk-J42EGKDK.js → chunk-I2LUWWR5.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-KLKYLSDX.js → chunk-IC5W2T34.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-AIM6VT2N.js → chunk-PANOOBIS.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-MEM2ZS3O.js → chunk-RIS565OA.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-24GAV7XL.js → chunk-TK6N7HGM.js} +2 -2
  15. package/dist/cli-bundle/chunks/chunk-TOFG2URD.js +197 -0
  16. package/dist/cli-bundle/chunks/{chunk-LJHOAVGI.js → chunk-URW4QRMI.js} +47 -41
  17. package/dist/cli-bundle/chunks/{register-list-query-CT3LFDDN.js → register-list-query-EYCXHZAG.js} +2 -2
  18. package/dist/cli-bundle/chunks/{register-mutation-NWEVA5YS.js → register-mutation-7YVIG54J.js} +4 -4
  19. package/dist/cli-bundle/chunks/{register-operations-AHIAG5KM.js → register-operations-KGDNRMCL.js} +2 -2
  20. package/dist/cli-bundle/chunks/{register-setup-ZJZFVAKE.js → register-setup-NVXBOD5I.js} +2 -2
  21. package/dist/cli-bundle/focused-chunks/{chunk-KTKH4IMG.js → chunk-4JPEBFFC.js} +2 -2
  22. package/dist/cli-bundle/focused-chunks/chunk-5NMFSX26.js +155 -0
  23. package/dist/cli-bundle/focused-chunks/{chunk-ZMFXQ7VF.js → chunk-6ROKKT4X.js} +2 -2
  24. package/dist/cli-bundle/focused-chunks/{chunk-OKA6ELTL.js → chunk-725JSCMP.js} +2 -2
  25. package/dist/cli-bundle/focused-chunks/{chunk-6XKF3PGV.js → chunk-C7JUBRFP.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/{chunk-KLVUMNXJ.js → chunk-CODV5LUT.js} +2 -2
  27. package/dist/cli-bundle/focused-chunks/chunk-DQ6SMTBF.js +2 -0
  28. package/dist/cli-bundle/focused-chunks/chunk-HAACPSUW.js +2 -0
  29. package/dist/cli-bundle/focused-chunks/{chunk-EXZA4257.js → chunk-J4UFYHOD.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-7NJ4QYQ2.js → chunk-JX5Z344Q.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-PUISBOPP.js → chunk-L4RDYBIQ.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/{chunk-NSPYTG6G.js → chunk-NJ5RLEFD.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/{chunk-KT5XMYSX.js → chunk-QYZERYR5.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/{chunk-M67F5AIN.js → chunk-SSNDYZTM.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/{chunk-ITAUHSO6.js → chunk-T46KLOIB.js} +45 -45
  36. package/dist/cli-bundle/focused-chunks/{chunk-WTSER4WJ.js → chunk-TZATVC4G.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/chunk-WY3WRPVN.js +2 -0
  38. package/dist/cli-bundle/main.js +10 -10
  39. package/dist/cli-bundle/sdk-authoring.js +1 -1
  40. package/dist/cli-bundle/sdk-contracts.js +1 -1
  41. package/dist/cli-bundle/sdk-core.js +27 -27
  42. package/dist/cli-bundle/sdk-governance.js +1 -1
  43. package/dist/cli-bundle/sdk-graph.js +1 -1
  44. package/dist/cli-bundle/sdk-merge.js +32 -32
  45. package/dist/cli-bundle/sdk-query.js +1 -1
  46. package/dist/cli-bundle/sdk-runtime.js +1 -1
  47. package/dist/cli-bundle/sdk-testing.js +1 -1
  48. package/dist/cli-bundle/sdk.js +2 -2
  49. package/dist/core/history/workspace-history.js +32 -10
  50. package/dist/core/output/output.js +6 -3
  51. package/dist/core/shared/errors.d.ts +2 -0
  52. package/dist/core/shared/errors.js +2 -2
  53. package/dist/core/store/item-store.js +28 -2
  54. package/dist/sdk/agent/refusal-reachability.d.ts +10 -2
  55. package/dist/sdk/agent/refusal-reachability.js +71 -3
  56. package/dist/sdk/author-attribution.d.ts +56 -11
  57. package/dist/sdk/author-attribution.js +174 -50
  58. package/dist/sdk/cli-contracts/flag-contracts.js +5 -2
  59. package/dist/sdk/cli-contracts/tool-parameter-tables.js +9 -2
  60. package/dist/sdk/cli-contracts/tool-schema.js +12 -4
  61. package/dist/sdk/completion.js +11 -4
  62. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +38 -14
  63. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +38 -2
  64. package/dist/sdk/governance/coverage-assurance.d.ts +24 -0
  65. package/dist/sdk/governance/coverage-assurance.js +61 -0
  66. package/dist/sdk/governance/extension-host-version.js +20 -9
  67. package/dist/sdk/index.d.ts +2 -1
  68. package/dist/sdk/index.js +4 -3
  69. package/dist/sdk/read-output-contracts.js +5 -3
  70. package/dist/sdk/runtime.d.ts +2 -5
  71. package/dist/sdk/runtime.js +3 -2
  72. package/docs/READ_OUTPUT_CONTRACTS.md +7 -1
  73. package/docs/RELEASING.md +13 -7
  74. package/docs/SDK_CONTEXT_INTEGRITY.md +33 -5
  75. package/docs/SDK_CONTEXT_TRUTH_CONTRACTS.md +13 -5
  76. package/marketplace.json +2 -2
  77. package/package.json +1 -1
  78. package/packages/pm-beads/package.json +1 -1
  79. package/packages/pm-calendar/package.json +1 -1
  80. package/packages/pm-command-kit/package.json +1 -1
  81. package/packages/pm-digital-twin/package.json +1 -1
  82. package/packages/pm-governance-audit/package.json +1 -1
  83. package/packages/pm-guide-shell/package.json +1 -1
  84. package/packages/pm-kanban/package.json +1 -1
  85. package/packages/pm-lifecycle-hooks/package.json +1 -1
  86. package/packages/pm-linked-test-adapters/package.json +1 -1
  87. package/packages/pm-search-advanced/package.json +1 -1
  88. package/packages/pm-templates/package.json +1 -1
  89. package/packages/pm-todos/package.json +1 -1
  90. package/packages/pm-vcs/package.json +1 -1
  91. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  92. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  93. package/sdk/public-surface.json +131 -16
  94. package/dist/cli-bundle/chunks/chunk-DSWDLTDR.js +0 -197
  95. package/dist/cli-bundle/focused-chunks/chunk-4X57RE4U.js +0 -2
  96. package/dist/cli-bundle/focused-chunks/chunk-QLNMCESQ.js +0 -155
  97. package/dist/cli-bundle/focused-chunks/chunk-SLKC6QLJ.js +0 -2
  98. package/dist/cli-bundle/focused-chunks/chunk-U65UC4G3.js +0 -2
@@ -4,7 +4,8 @@
4
4
  * Provides reusable diagnostics for mutation-author provenance in tracker history.
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]="4fd16197-979e-5269-bed7-f2fb0e2038c2")}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]="b389e521-f689-5895-a5f4-08c3866b3ea3")}catch(e){}}();
8
+ import { createHash } from "node:crypto";
8
9
  import fs from "node:fs/promises";
9
10
  import path from "node:path";
10
11
  import { appendWorkspaceAuditEvent, WORKSPACE_HISTORY_ID, } from "../core/history/workspace-history.js";
@@ -204,6 +205,111 @@ export const scanHistoryAuthorAttribution = async (pmRoot, sampleLimit = 20, inc
204
205
  ...(includeActionableEvents ? { actionable_events: actionableEvents } : {}),
205
206
  };
206
207
  };
208
+ /** Deduplicate and deterministically order history coordinates. */
209
+ function normalizeUnknownAuthorHistoryEvents(events) {
210
+ return [
211
+ ...new Map(events.map((event) => [
212
+ `${event.item_id}:${event.line}`,
213
+ { item_id: event.item_id, line: event.line },
214
+ ])).values(),
215
+ ].sort((left, right) => left.item_id.localeCompare(right.item_id) || left.line - right.line);
216
+ }
217
+ /** Read the append-only set of previously dispositioned coordinates. */
218
+ async function readAcknowledgedUnknownEvents(pmRoot) {
219
+ try {
220
+ return collectAcknowledgedUnknownEvents(await fs.readFile(path.join(pmRoot, "history", "_workspace.jsonl"), "utf8"));
221
+ }
222
+ catch {
223
+ return new Set();
224
+ }
225
+ }
226
+ /** Check whether a coordinate can safely name one immutable history line. */
227
+ function isValidUnknownAuthorHistoryEvent(event) {
228
+ return ((event.item_id === WORKSPACE_HISTORY_ID ||
229
+ /^[a-z0-9][a-z0-9-]*$/iu.test(event.item_id)) &&
230
+ Number.isSafeInteger(event.line) &&
231
+ event.line >= 1);
232
+ }
233
+ /** Resolve one coordinate against its preloaded immutable source stream. */
234
+ function resolveAcknowledgmentPlanCoordinate(event, acknowledgedEvents, sourceLines) {
235
+ const sourceLine = sourceLines[event.line - 1] ?? "";
236
+ let parsed;
237
+ try {
238
+ parsed = JSON.parse(sourceLine);
239
+ }
240
+ catch {
241
+ refuseAuthorAcknowledgmentArgument(`Unknown-author acknowledgment target ${event.item_id}:${event.line} is not readable.`, { code: "history_author_acknowledge_target_unreadable" });
242
+ }
243
+ if (classifyHistoryAuthorEvent(parsed) !== "actionable_unknown") {
244
+ refuseAuthorAcknowledgmentArgument(`Author acknowledgment target ${event.item_id}:${event.line} is not an actionable unknown-author event.`, { code: "history_author_acknowledge_target_not_actionable" });
245
+ }
246
+ return {
247
+ ...event,
248
+ source_event_hash: createHash("sha256").update(sourceLine).digest("hex"),
249
+ disposition: acknowledgedEvents.has(`${event.item_id}:${event.line}`)
250
+ ? "already_acknowledged"
251
+ : "actionable",
252
+ };
253
+ }
254
+ async function resolveUnknownAuthorAcknowledgmentPlan(pmRoot, selector, coordinateLimit) {
255
+ const explicitEvents = selector.events ?? [];
256
+ const selectorCount = Number(selector.all_actionable === true) +
257
+ Number(explicitEvents.length > 0);
258
+ if (selectorCount === 0) {
259
+ refuseAuthorAcknowledgmentArgument("Specify exactly one selector: events or all_actionable.", { code: "history_author_acknowledge_selector_required" });
260
+ }
261
+ if (selectorCount > 1) {
262
+ refuseAuthorAcknowledgmentArgument("Author acknowledgment accepts either explicit events or all_actionable, not both.", { code: "history_author_acknowledge_selector_conflict" });
263
+ }
264
+ if (!Number.isSafeInteger(coordinateLimit) || coordinateLimit < 0) {
265
+ refuseAuthorAcknowledgmentArgument("Author acknowledgment coordinate_limit must be a non-negative integer.", { code: "history_author_acknowledge_preview_limit_invalid" });
266
+ }
267
+ const selectedEvents = normalizeUnknownAuthorHistoryEvents(selector.all_actionable === true
268
+ ? (await scanHistoryAuthorAttribution(pmRoot, 0, true))
269
+ .actionable_events
270
+ : explicitEvents);
271
+ const acknowledgedEvents = await readAcknowledgedUnknownEvents(pmRoot);
272
+ const sourceLinesByItem = new Map();
273
+ for (const event of selectedEvents) {
274
+ if (!isValidUnknownAuthorHistoryEvent(event)) {
275
+ refuseAuthorAcknowledgmentArgument(`Unknown-author acknowledgment target ${event.item_id}:${event.line} is not readable.`, { code: "history_author_acknowledge_target_unreadable" });
276
+ }
277
+ if (sourceLinesByItem.has(event.item_id))
278
+ continue;
279
+ try {
280
+ sourceLinesByItem.set(event.item_id, (await fs.readFile(path.join(pmRoot, "history", `${event.item_id}.jsonl`), "utf8")).split(/\r?\n/u));
281
+ }
282
+ catch {
283
+ refuseAuthorAcknowledgmentArgument(`Unknown-author acknowledgment target ${event.item_id}:${event.line} is not readable.`, { code: "history_author_acknowledge_target_unreadable" });
284
+ }
285
+ }
286
+ const completeCoordinates = selectedEvents.map((event) => resolveAcknowledgmentPlanCoordinate(event, acknowledgedEvents, sourceLinesByItem.get(event.item_id)));
287
+ const kind = selector.all_actionable === true ? "all_actionable" : "events";
288
+ const planFingerprint = createHash("sha256")
289
+ .update(JSON.stringify({
290
+ version: 1,
291
+ selection: kind,
292
+ coordinates: completeCoordinates,
293
+ }))
294
+ .digest("hex");
295
+ const actionableCount = completeCoordinates.filter(({ disposition }) => disposition === "actionable").length;
296
+ return {
297
+ plan: {
298
+ selection: { kind },
299
+ selected_count: completeCoordinates.length,
300
+ actionable_count: actionableCount,
301
+ already_acknowledged_count: completeCoordinates.length - actionableCount,
302
+ omitted_count: Math.max(0, completeCoordinates.length - coordinateLimit),
303
+ coordinates: completeCoordinates.slice(0, coordinateLimit),
304
+ plan_fingerprint: planFingerprint,
305
+ },
306
+ completeCoordinates,
307
+ };
308
+ }
309
+ /** Resolve a deterministic, source-bound author-acknowledgement preview. */
310
+ export async function planUnknownAuthorHistoryAcknowledgment(pmRoot, selector, coordinateLimit = 50) {
311
+ return (await resolveUnknownAuthorAcknowledgmentPlan(pmRoot, selector, coordinateLimit)).plan;
312
+ }
207
313
  /** Resolve the mutually exclusive CLI and SDK acknowledgment selectors. */
208
314
  export function resolveUnknownAuthorAcknowledgmentSelector(rawEvents, allActionable) {
209
315
  const hasExplicitEvents = rawEvents.length > 0;
@@ -254,11 +360,19 @@ export function acknowledgeUnknownAuthorHistoryEventsFromTransport(pmRoot, input
254
360
  return acknowledgeUnknownAuthorHistoryEvents(pmRoot, {
255
361
  events: selector.events,
256
362
  all_actionable: selector.all_actionable,
363
+ dry_run: input.dryRun === true || input.dry_run === true,
364
+ plan_fingerprint: readRuntimeString(input, "planFingerprint") ??
365
+ readRuntimeString(input, "plan_fingerprint"),
366
+ coordinate_limit: typeof input.limit === "number"
367
+ ? input.limit
368
+ : typeof input.limit === "string"
369
+ ? Number(input.limit)
370
+ : undefined,
257
371
  attributed_author: readRuntimeString(input, "attributedAuthor") ??
258
372
  readRuntimeString(input, "attributed_author") ??
259
- "",
260
- reviewer: readRuntimeString(input, "reviewer") ?? "",
261
- reason: readRuntimeString(input, "reason") ?? "",
373
+ undefined,
374
+ reviewer: readRuntimeString(input, "reviewer"),
375
+ reason: readRuntimeString(input, "reason"),
262
376
  });
263
377
  }
264
378
  /**
@@ -266,23 +380,21 @@ export function acknowledgeUnknownAuthorHistoryEventsFromTransport(pmRoot, input
266
380
  * rewriting their original streams.
267
381
  */
268
382
  export async function acknowledgeUnknownAuthorHistoryEvents(pmRoot, options) {
269
- const reviewer = options.reviewer.trim();
270
- const attributedAuthor = options.attributed_author.trim();
271
- const reason = options.reason.trim();
272
- const explicitEvents = options.events ?? [];
273
- const selectorCount = Number(options.all_actionable === true) + Number(explicitEvents.length > 0);
274
- if (selectorCount === 0) {
275
- refuseAuthorAcknowledgmentArgument("Specify exactly one selector: events or all_actionable.", { code: "history_author_acknowledge_selector_required" });
383
+ const reviewer = options.reviewer?.trim() ?? "";
384
+ const attributedAuthor = options.attributed_author?.trim() ?? "";
385
+ const reason = options.reason?.trim() ?? "";
386
+ const resolved = await resolveUnknownAuthorAcknowledgmentPlan(pmRoot, options, options.coordinate_limit ?? 50);
387
+ if (options.dry_run === true) {
388
+ return {
389
+ dry_run: true,
390
+ mutated: false,
391
+ acknowledged: 0,
392
+ outcome: "preview",
393
+ exit_code: EXIT_CODE.SUCCESS,
394
+ plan: resolved.plan,
395
+ };
276
396
  }
277
- if (selectorCount > 1) {
278
- refuseAuthorAcknowledgmentArgument("Author acknowledgment accepts either explicit events or all_actionable, not both.", { code: "history_author_acknowledge_selector_conflict" });
279
- }
280
- const selectedEvents = options.all_actionable === true
281
- ? (await scanHistoryAuthorAttribution(pmRoot, 0, true))
282
- .actionable_events
283
- : explicitEvents;
284
397
  const requiredValuesMissing = [
285
- selectedEvents.length > 0,
286
398
  reviewer.length > 0,
287
399
  reviewer.toLowerCase() !== "unknown",
288
400
  attributedAuthor.length > 0,
@@ -292,34 +404,35 @@ export async function acknowledgeUnknownAuthorHistoryEvents(pmRoot, options) {
292
404
  if (requiredValuesMissing) {
293
405
  refuseAuthorAcknowledgmentArgument("Author acknowledgment requires events, reviewer, attributed_author, and reason.", { code: "history_author_acknowledge_required_values_missing" });
294
406
  }
295
- const uniqueEvents = [
296
- ...new Map(selectedEvents.map((event) => [
297
- `${event.item_id}:${event.line}`,
298
- { item_id: event.item_id, line: event.line },
299
- ])).values(),
300
- ].sort((left, right) => left.item_id.localeCompare(right.item_id) || left.line - right.line);
301
- for (const event of uniqueEvents) {
302
- const invalidCoordinate = [
303
- event.item_id === WORKSPACE_HISTORY_ID ||
304
- /^[a-z0-9][a-z0-9-]*$/i.test(event.item_id),
305
- Number.isSafeInteger(event.line),
306
- event.line >= 1,
307
- ].includes(false);
308
- if (invalidCoordinate) {
309
- refuseAuthorAcknowledgmentArgument(`Unknown-author acknowledgment target ${event.item_id}:${event.line} is not readable.`, { code: "history_author_acknowledge_target_unreadable" });
310
- }
311
- let parsed;
312
- try {
313
- const raw = await fs.readFile(path.join(pmRoot, "history", `${event.item_id}.jsonl`), "utf8");
314
- const line = raw.split(/\r?\n/)[event.line - 1];
315
- parsed = JSON.parse(line ?? "");
316
- }
317
- catch {
318
- refuseAuthorAcknowledgmentArgument(`Unknown-author acknowledgment target ${event.item_id}:${event.line} is not readable.`, { code: "history_author_acknowledge_target_unreadable" });
319
- }
320
- if (classifyHistoryAuthorEvent(parsed) !== "actionable_unknown") {
321
- refuseAuthorAcknowledgmentArgument(`Author acknowledgment target ${event.item_id}:${event.line} is not an actionable unknown-author event.`, { code: "history_author_acknowledge_target_not_actionable" });
322
- }
407
+ if (!options.plan_fingerprint?.trim()) {
408
+ refuseAuthorAcknowledgmentArgument("Author acknowledgment apply requires plan_fingerprint from a fresh dry-run preview.", {
409
+ code: "history_author_acknowledge_plan_fingerprint_required",
410
+ recovery: {
411
+ suggested_retry: "Rerun history-author-acknowledge with --dry-run, then pass --plan-fingerprint <value>.",
412
+ },
413
+ });
414
+ }
415
+ if (options.plan_fingerprint.trim() !== resolved.plan.plan_fingerprint) {
416
+ throw new PmCliError("Author acknowledgment selection changed after preview; no history was mutated.", EXIT_CODE.CONFLICT, {
417
+ code: "history_author_acknowledge_plan_conflict",
418
+ recovery: {
419
+ suggested_retry: "Rerun history-author-acknowledge with --dry-run and apply the fresh plan_fingerprint.",
420
+ },
421
+ });
422
+ }
423
+ const eventsToAcknowledge = resolved.completeCoordinates
424
+ .filter(({ disposition }) => resolved.plan.selection.kind === "events" ||
425
+ disposition === "actionable")
426
+ .map(({ item_id, line }) => ({ item_id, line }));
427
+ if (eventsToAcknowledge.length === 0) {
428
+ return {
429
+ dry_run: false,
430
+ mutated: false,
431
+ acknowledged: 0,
432
+ outcome: "no_effect",
433
+ exit_code: EXIT_CODE.NO_EFFECT,
434
+ plan: resolved.plan,
435
+ };
323
436
  }
324
437
  const settings = await readSettings(pmRoot);
325
438
  const appended = await appendWorkspaceAuditEvent({
@@ -328,7 +441,7 @@ export async function acknowledgeUnknownAuthorHistoryEvents(pmRoot, options) {
328
441
  author: reviewer,
329
442
  context: {
330
443
  author_acknowledgment: {
331
- events: uniqueEvents,
444
+ events: eventsToAcknowledge,
332
445
  attributed_author: attributedAuthor,
333
446
  },
334
447
  },
@@ -336,10 +449,21 @@ export async function acknowledgeUnknownAuthorHistoryEvents(pmRoot, options) {
336
449
  lockTtlSeconds: settings.locks.ttl_seconds,
337
450
  lockWaitMs: settings.locks.wait_ms,
338
451
  });
452
+ const effectResult = resolved.plan.actionable_count > 0 &&
453
+ resolved.plan.already_acknowledged_count > 0
454
+ ? {
455
+ outcome: "partial_effect",
456
+ exit_code: EXIT_CODE.PARTIAL_EFFECT,
457
+ }
458
+ : { outcome: "effect", exit_code: EXIT_CODE.SUCCESS };
339
459
  return {
340
- acknowledged: uniqueEvents.length,
460
+ dry_run: false,
461
+ mutated: true,
462
+ acknowledged: eventsToAcknowledge.length,
463
+ ...effectResult,
464
+ plan: resolved.plan,
341
465
  history_path: appended.historyPath,
342
466
  };
343
467
  }
344
468
  //# sourceMappingURL=author-attribution.js.map
345
- //# debugId=4fd16197-979e-5269-bed7-f2fb0e2038c2
469
+ //# debugId=b389e521-f689-5895-a5f4-08c3866b3ea3
@@ -7,7 +7,7 @@
7
7
  * flag surface stays single-sourced across the CLI, SDK, and MCP boundaries.
8
8
  */
9
9
 
10
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="512c41c1-624f-517c-abc3-4448b49cd9e6")}catch(e){}}();
10
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c82d9b50-274f-585d-be0e-9a0c5067b9e9")}catch(e){}}();
11
11
  import { normalizeUniqueStringList } from "./string-lists.js";
12
12
  import { RESERVED_EXTENSION_HOST_FLAGS } from "../../core/extensions/reserved-host-flags.js";
13
13
  function normalizeFlagAliasKey(flag) {
@@ -351,6 +351,9 @@ export const HISTORY_REPAIR_FLAG_CONTRACTS = [
351
351
  export const HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS = [
352
352
  { flag: "--event", repeatable: true },
353
353
  { flag: "--all-actionable" },
354
+ { flag: "--dry-run" },
355
+ { flag: "--plan-fingerprint" },
356
+ { flag: "--limit", value_type: "number" },
354
357
  { flag: "--attributed-author", aliases: ["--attributed_author"] },
355
358
  { flag: "--reviewer" },
356
359
  { flag: "--reason" },
@@ -1818,4 +1821,4 @@ export function toCompletionFlagString(flagContracts, includeGlobal = true) {
1818
1821
  return normalizeUniqueStringList(all).join(" ");
1819
1822
  }
1820
1823
  //# sourceMappingURL=flag-contracts.js.map
1821
- //# debugId=512c41c1-624f-517c-abc3-4448b49cd9e6
1824
+ //# debugId=c82d9b50-274f-585d-be0e-9a0c5067b9e9
@@ -4,7 +4,7 @@
4
4
  * Defines SDK command-contract metadata for Tool Parameter Tables.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ddb90f7e-f3ca-56d8-be75-13e238da306c")}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]="cb6f6915-307c-58e7-a892-3dff4c7ae399")}catch(e){}}();
8
8
  import { PLAN_HARNESS_VALUES, PLAN_MODE_VALUES, PLAN_STEP_LINK_KIND_VALUES, PLAN_STEP_STATUS_VALUES, } from "../../types/index.js";
9
9
  import { PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS } from "../read-output-session.js";
10
10
  import { ASSURANCE_DEFINITION_SCHEMA } from "./schemas/assurance-definition.js";
@@ -229,6 +229,7 @@ export const PM_TOOL_PARAMETER_PROPERTIES = {
229
229
  parent: { type: "string" },
230
230
  reviewer: { type: "string" },
231
231
  attributedAuthor: { type: "string" },
232
+ planFingerprint: { type: "string", pattern: "^[a-f0-9]{64}$" },
232
233
  historyEvent: { type: "array", items: { type: "string" } },
233
234
  risk: { type: "string" },
234
235
  confidence: { anyOf: [{ type: "string" }, { type: "number" }] },
@@ -1197,6 +1198,12 @@ export const PM_TOOL_PARAMETER_METADATA = {
1197
1198
  description: "Unknown-author history target in <item-id>:<one-based-line> form.",
1198
1199
  examples: [["pm-example:4", "pm-example:5"]],
1199
1200
  },
1201
+ planFingerprint: {
1202
+ description: "Exact SHA-256 returned by a history-author-acknowledge dry-run preview; apply refuses stale or changed source coordinates.",
1203
+ examples: [
1204
+ "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
1205
+ ],
1206
+ },
1200
1207
  estimate: {
1201
1208
  description: "Estimated effort in minutes.",
1202
1209
  examples: [60, "120"],
@@ -2059,4 +2066,4 @@ export const PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
2059
2066
  },
2060
2067
  };
2061
2068
  //# sourceMappingURL=tool-parameter-tables.js.map
2062
- //# debugId=ddb90f7e-f3ca-56d8-be75-13e238da306c
2069
+ //# debugId=cb6f6915-307c-58e7-a892-3dff4c7ae399
@@ -7,7 +7,7 @@
7
7
  * consumers from a single source of truth.
8
8
  */
9
9
 
10
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="aa58e280-0a39-5285-a451-811e60481661")}catch(e){}}();
10
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1d6089b2-ab59-59ad-a475-9a6ef1356b40")}catch(e){}}();
11
11
  import { normalizeUniqueStringList } from "./string-lists.js";
12
12
  import { PM_TOOL_ACTIONS } from "./enum-contracts.js";
13
13
  import { TOOL_CREATE_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS, TOOL_CONTEXT_OPTION_CONTRACTS, TOOL_ACTIVITY_OPTION_CONTRACTS, TOOL_LIST_FILTER_OPTION_CONTRACTS, TOOL_AGGREGATE_OPTION_CONTRACTS, TOOL_SEARCH_FILTER_OPTION_CONTRACTS, TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS, } from "./tool-option-contracts.js";
@@ -632,8 +632,16 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
632
632
  oneOfRequired: [["id"], ["all"]],
633
633
  },
634
634
  "history-author-acknowledge": {
635
- required: ["attributedAuthor", "reviewer", "reason"],
636
- optional: ["historyEvent", "allActionable"],
635
+ optional: [
636
+ "historyEvent",
637
+ "allActionable",
638
+ "dryRun",
639
+ "planFingerprint",
640
+ "limit",
641
+ "attributedAuthor",
642
+ "reviewer",
643
+ "reason",
644
+ ],
637
645
  oneOfRequired: [["historyEvent"], ["allActionable"]],
638
646
  },
639
647
  "history-compact": {
@@ -1580,4 +1588,4 @@ export const _testOnlyCliContracts = {
1580
1588
  withFlagAliasMetadata,
1581
1589
  };
1582
1590
  //# sourceMappingURL=tool-schema.js.map
1583
- //# debugId=aa58e280-0a39-5285-a451-811e60481661
1591
+ //# debugId=1d6089b2-ab59-59ad-a475-9a6ef1356b40
@@ -4,11 +4,11 @@
4
4
  * Implements the pm completion command surface and its agent-facing runtime behavior.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fca471b1-155a-5fc4-9aa9-d45e5f1315dd")}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]="c337a436-ac3e-5447-9c76-de9aeebb2a1c")}catch(e){}}();
8
8
  import { EXIT_CODE, PmCliError } from "./runtime-primitives.js";
9
9
  import { listPmCommandsForTier } from "./agent-capability-contracts.js";
10
10
  import { SCAFFOLD_CAPABILITIES } from "./extension/scaffold.js";
11
- import { AGGREGATE_FLAG_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, CONTEXT_FLAG_CONTRACTS, COPY_FLAG_CONTRACTS, FOCUS_FLAG_CONTRACTS, MEET_FLAG_CONTRACTS, REMIND_FLAG_CONTRACTS, CREATE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, NEXT_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PLAN_FLAG_CONTRACTS, SEARCH_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, EVENTS_FLAG_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, toCompletionFlagString, } from "./cli-contracts.js";
11
+ import { AGGREGATE_FLAG_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, CONTEXT_FLAG_CONTRACTS, COPY_FLAG_CONTRACTS, FOCUS_FLAG_CONTRACTS, MEET_FLAG_CONTRACTS, REMIND_FLAG_CONTRACTS, CREATE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, NEXT_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PLAN_FLAG_CONTRACTS, SEARCH_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, EVENTS_FLAG_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, toCompletionFlagString, } from "./cli-contracts.js";
12
12
  import { BUILTIN_ITEM_TYPE_VALUES, STATUS_VALUES } from "../types/index.js";
13
13
  import { listGuideTopicIds } from "./guide-topics.js";
14
14
  const VALID_SHELLS = ["bash", "zsh", "fish"];
@@ -29,6 +29,7 @@ const UPDATE_MANY_FLAGS = toCompletionFlagString(UPDATE_MANY_FLAG_CONTRACTS);
29
29
  const CLOSE_MANY_FLAGS = toCompletionFlagString(CLOSE_MANY_FLAG_CONTRACTS);
30
30
  const ACTIVITY_FLAGS = toCompletionFlagString(ACTIVITY_FLAG_CONTRACTS);
31
31
  const HISTORY_FLAGS = toCompletionFlagString(HISTORY_FLAG_CONTRACTS);
32
+ const HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS = toCompletionFlagString(HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, false);
32
33
  const EVENTS_FLAGS = toCompletionFlagString(EVENTS_FLAG_CONTRACTS);
33
34
  const CALENDAR_FLAGS = toCompletionFlagString(CALENDAR_FLAG_CONTRACTS);
34
35
  const CONTEXT_FLAGS = toCompletionFlagString(CONTEXT_FLAG_CONTRACTS);
@@ -648,7 +649,7 @@ export function generateBashScript(itemTypes = [], tags = [], eagerTagExpansion
648
649
  ` COMPREPLY=(${compgen("--before --ids --all-over --closed --all-streams --min-entries --dry-run --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
649
650
  " ;;",
650
651
  " history-author-acknowledge)",
651
- ` COMPREPLY=(${compgen("--event --all-actionable --attributed-author --reviewer --reason --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
652
+ ` COMPREPLY=(${compgen(`${HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS} --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)})`,
652
653
  " ;;",
653
654
  " get)",
654
655
  ` COMPREPLY=(${compgen(GET_FLAGS)})`,
@@ -1199,6 +1200,9 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
1199
1200
  _arguments \\
1200
1201
  '*--event[Actionable unknown-author event]:item_and_line' \\
1201
1202
  '--all-actionable[Select every currently actionable event]' \\
1203
+ '--dry-run[Preview a deterministic source-bound plan]' \\
1204
+ '--plan-fingerprint[Apply the exact dry-run plan]:sha256' \\
1205
+ '--limit[Maximum coordinate rows returned in the plan]:number' \\
1202
1206
  '--attributed-author[Principal attributed by maintainer review]:author' \\
1203
1207
  '--reviewer[Reviewer recording the disposition]:reviewer' \\
1204
1208
  '--reason[Evidence-backed review rationale]:reason' \\
@@ -2308,6 +2312,9 @@ complete -c pm -n '__fish_seen_subcommand_from history-compact' -l message -d 'A
2308
2312
  complete -c pm -n '__fish_seen_subcommand_from history-compact' -l force -d 'Force ownership/lock override'
2309
2313
  complete -c pm -n '__fish_seen_subcommand_from history-author-acknowledge' -l event -d 'Actionable unknown-author event' -r
2310
2314
  complete -c pm -n '__fish_seen_subcommand_from history-author-acknowledge' -l all-actionable -d 'Select every currently actionable event'
2315
+ complete -c pm -n '__fish_seen_subcommand_from history-author-acknowledge' -l dry-run -d 'Preview a deterministic source-bound plan'
2316
+ complete -c pm -n '__fish_seen_subcommand_from history-author-acknowledge' -l plan-fingerprint -d 'Apply the exact dry-run plan' -r
2317
+ complete -c pm -n '__fish_seen_subcommand_from history-author-acknowledge' -l limit -d 'Maximum coordinate rows returned in the plan' -r
2311
2318
  complete -c pm -n '__fish_seen_subcommand_from history-author-acknowledge' -l attributed-author -d 'Principal attributed by maintainer review' -r
2312
2319
  complete -c pm -n '__fish_seen_subcommand_from history-author-acknowledge' -l reviewer -d 'Reviewer recording the disposition' -r
2313
2320
  complete -c pm -n '__fish_seen_subcommand_from history-author-acknowledge' -l reason -d 'Evidence-backed review rationale' -r
@@ -2762,4 +2769,4 @@ export function runCompletion(shell, itemTypes = [], tags = [], eagerTagExpansio
2762
2769
  };
2763
2770
  }
2764
2771
  //# sourceMappingURL=completion.js.map
2765
- //# debugId=fca471b1-155a-5fc4-9aa9-d45e5f1315dd
2772
+ //# debugId=c337a436-ac3e-5447-9c76-de9aeebb2a1c
@@ -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]="3891c17c-c79d-54d4-8b62-da8fe9c1eaf4")}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]="515e0f67-1d1d-5ee7-9000-bbe9aa201507")}catch(e){}}();
4
4
  export const PM_ERROR_CODE_CATALOG_PART_1 = [
5
5
  {
6
6
  code: "acceptance_criteria_mutation_conflict",
@@ -806,6 +806,42 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
806
806
  canonical_code: "github_source_entry_unbuilt",
807
807
  aliases: [],
808
808
  },
809
+ {
810
+ code: "history_author_acknowledge_plan_conflict",
811
+ meaning: "History author acknowledge plan conflict condition.",
812
+ stability: "provisional",
813
+ exit_code: 4,
814
+ class: "conflict",
815
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
816
+ sources: ["sdk/author-attribution.ts"],
817
+ emitting_commands: ["*"],
818
+ canonical_code: "history_author_acknowledge_plan_conflict",
819
+ aliases: [],
820
+ },
821
+ {
822
+ code: "history_author_acknowledge_plan_fingerprint_required",
823
+ meaning: "History author acknowledge plan fingerprint required condition.",
824
+ stability: "provisional",
825
+ exit_code: 2,
826
+ class: "usage",
827
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
828
+ sources: ["sdk/author-attribution.ts"],
829
+ emitting_commands: ["*"],
830
+ canonical_code: "history_author_acknowledge_plan_fingerprint_required",
831
+ aliases: [],
832
+ },
833
+ {
834
+ code: "history_author_acknowledge_preview_limit_invalid",
835
+ meaning: "History author acknowledge preview limit invalid condition.",
836
+ stability: "provisional",
837
+ exit_code: 2,
838
+ class: "usage",
839
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
840
+ sources: ["sdk/author-attribution.ts"],
841
+ emitting_commands: ["*"],
842
+ canonical_code: "history_author_acknowledge_preview_limit_invalid",
843
+ aliases: [],
844
+ },
809
845
  {
810
846
  code: "history_author_acknowledge_required_values_missing",
811
847
  meaning: "History author acknowledge required values missing condition.",
@@ -1604,18 +1640,6 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1604
1640
  canonical_code: "merge_conflict_markers_detected",
1605
1641
  aliases: ["history_merge_conflict_markers_detected"],
1606
1642
  },
1607
- {
1608
- code: "merge_decisions_unreviewed",
1609
- meaning: "Merge decisions unreviewed condition.",
1610
- stability: "provisional",
1611
- exit_code: 1,
1612
- class: "generic_failure",
1613
- recovery: "Inspect the structured error guidance and retry the suggested command.",
1614
- sources: ["core/diagnostics/remediation.ts"],
1615
- emitting_commands: ["*"],
1616
- canonical_code: "merge_decisions_unreviewed",
1617
- aliases: [],
1618
- },
1619
1643
  ];
1620
1644
  //# sourceMappingURL=generated-error-code-catalog-part-1.js.map
1621
- //# debugId=3891c17c-c79d-54d4-8b62-da8fe9c1eaf4
1645
+ //# debugId=515e0f67-1d1d-5ee7-9000-bbe9aa201507
@@ -1,7 +1,19 @@
1
1
  /** Generated partition 2 of the exhaustive error-code catalog. */
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5d64a86d-6ba6-5bbe-a83a-9703690a851e")}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]="e17917c7-8433-5de1-a895-ca5a03ce03da")}catch(e){}}();
4
4
  export const PM_ERROR_CODE_CATALOG_PART_2 = [
5
+ {
6
+ code: "merge_decisions_unreviewed",
7
+ meaning: "Merge decisions unreviewed condition.",
8
+ stability: "provisional",
9
+ exit_code: 1,
10
+ class: "generic_failure",
11
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
12
+ sources: ["core/diagnostics/remediation.ts"],
13
+ emitting_commands: ["*"],
14
+ canonical_code: "merge_decisions_unreviewed",
15
+ aliases: [],
16
+ },
5
17
  {
6
18
  code: "merge_git_config_unwritable",
7
19
  meaning: "Merge git config unwritable condition.",
@@ -774,6 +786,18 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
774
786
  canonical_code: "tracker_root_not_directory",
775
787
  aliases: [],
776
788
  },
789
+ {
790
+ code: "tracker_root_unreadable",
791
+ meaning: "Tracker root unreadable condition.",
792
+ stability: "provisional",
793
+ exit_code: 1,
794
+ class: "generic_failure",
795
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
796
+ sources: ["core/store/item-store.ts"],
797
+ emitting_commands: ["*"],
798
+ canonical_code: "tracker_root_unreadable",
799
+ aliases: [],
800
+ },
777
801
  {
778
802
  code: "type_duplicate",
779
803
  meaning: "Type duplicate condition.",
@@ -1507,6 +1531,18 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
1507
1531
  canonical_code: "workflow_type_unknown",
1508
1532
  aliases: [],
1509
1533
  },
1534
+ {
1535
+ code: "workspace_history_chain_invalid",
1536
+ meaning: "Workspace history chain invalid condition.",
1537
+ stability: "provisional",
1538
+ exit_code: 4,
1539
+ class: "conflict",
1540
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1541
+ sources: ["core/history/workspace-history.ts"],
1542
+ emitting_commands: ["*"],
1543
+ canonical_code: "workspace_history_chain_invalid",
1544
+ aliases: [],
1545
+ },
1510
1546
  {
1511
1547
  code: "workspace_history_state_conflict",
1512
1548
  meaning: "Workspace history state conflict condition.",
@@ -1629,4 +1665,4 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
1629
1665
  },
1630
1666
  ];
1631
1667
  //# sourceMappingURL=generated-error-code-catalog-part-2.js.map
1632
- //# debugId=5d64a86d-6ba6-5bbe-a83a-9703690a851e
1668
+ //# debugId=e17917c7-8433-5de1-a895-ca5a03ce03da
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @module sdk/governance/coverage-assurance
3
+ *
4
+ * Provides exact integer coverage assurance for repository and package gates.
5
+ */
6
+ /** Coverage metrics required by the exact repository quality contract. */
7
+ export declare const PM_EXACT_COVERAGE_METRICS: readonly ["lines", "branches", "functions", "statements"];
8
+ /** Required exact coverage metric. */
9
+ export type PmExactCoverageMetric = (typeof PM_EXACT_COVERAGE_METRICS)[number];
10
+ /** One exact uncovered-count finding. */
11
+ export interface PmCoverageDeficit {
12
+ /** Coverage summary entry or source filename. */
13
+ file: string;
14
+ /** Deficient required metric. */
15
+ metric: PmExactCoverageMetric;
16
+ /** Integer statements or paths not covered. */
17
+ uncovered: number;
18
+ /** Exact covered count. */
19
+ covered: number;
20
+ /** Exact total count. */
21
+ total: number;
22
+ }
23
+ /** Return exact uncovered counts for every summary entry and required metric. */
24
+ export declare function findCoverageDeficits(summary: unknown): PmCoverageDeficit[];