@unbrained/pm-cli 2026.8.22 → 2026.8.23

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 (168) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +28 -0
  3. package/dist/cli/error-guidance.d.ts +13 -0
  4. package/dist/cli/error-guidance.js +62 -6
  5. package/dist/cli/main.js +13 -4
  6. package/dist/cli/register-mutation.js +6 -6
  7. package/dist/cli/register-operations.d.ts +73 -0
  8. package/dist/cli/register-operations.js +39 -14
  9. package/dist/cli/register-setup.js +3 -3
  10. package/dist/cli/schema-registration-helpers.d.ts +8 -1
  11. package/dist/cli/schema-registration-helpers.js +14 -5
  12. package/dist/cli-bundle/bundle-manifest.json +155 -155
  13. package/dist/cli-bundle/chunks/chunk-3ENVHX6C.js +36 -0
  14. package/dist/cli-bundle/chunks/{chunk-QI2CT3IX.js → chunk-DW2CGEMU.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-WG4STC36.js → chunk-EG6CLDZT.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-MYYI3ZOA.js → chunk-F3AI2JFL.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-U6GQ4VMV.js → chunk-HWZ6CELB.js} +4 -4
  18. package/dist/cli-bundle/chunks/chunk-HZBMLSZI.js +201 -0
  19. package/dist/cli-bundle/chunks/chunk-JB4KZWBF.js +3 -0
  20. package/dist/cli-bundle/chunks/chunk-KPH73XXJ.js +2 -0
  21. package/dist/cli-bundle/chunks/{chunk-BWX4SK46.js → chunk-KXPMB2YL.js} +58 -58
  22. package/dist/cli-bundle/chunks/{chunk-MZTZQTMS.js → chunk-QDVHNHAQ.js} +2 -2
  23. package/dist/cli-bundle/chunks/chunk-TFI5V5N2.js +13 -0
  24. package/dist/cli-bundle/chunks/{register-list-query-HZKBQNWW.js → register-list-query-UJB5FMV2.js} +2 -2
  25. package/dist/cli-bundle/chunks/register-mutation-NX5XE4VX.js +20 -0
  26. package/dist/cli-bundle/chunks/register-operations-RXIJIYXC.js +2 -0
  27. package/dist/cli-bundle/chunks/{register-setup-QK4OTOXN.js → register-setup-GFUZEKRE.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/{chunk-2POVTNLY.js → chunk-37Z4OEAP.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/chunk-3UPTYG44.js +8 -0
  30. package/dist/cli-bundle/focused-chunks/{chunk-E2EWYPY6.js → chunk-5S7E72FY.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-GMYPD4FX.js → chunk-AUFH5H35.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/chunk-E7X25GC3.js +2 -0
  33. package/dist/cli-bundle/focused-chunks/{chunk-3LKU6PTJ.js → chunk-FQCSTBWE.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/{chunk-6S2MO3Q3.js → chunk-FZS4H32O.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/chunk-IFLWKY2R.js +156 -0
  36. package/dist/cli-bundle/focused-chunks/{chunk-PMGJUFNQ.js → chunk-JOWDB2MH.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/chunk-LYVSW5VM.js +2 -0
  38. package/dist/cli-bundle/focused-chunks/chunk-MRCNF3U6.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/{chunk-A2BC5PQL.js → chunk-OFVUGTLJ.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/{chunk-2ARQGDDW.js → chunk-OGLQBL46.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/{chunk-R6SR45XU.js → chunk-OY7QAV4Y.js} +48 -47
  42. package/dist/cli-bundle/focused-chunks/chunk-QGFNI65N.js +26 -0
  43. package/dist/cli-bundle/focused-chunks/{chunk-D6RBZEJJ.js → chunk-R27IDGHD.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/chunk-UYRFYCDQ.js +5 -0
  45. package/dist/cli-bundle/focused-chunks/{chunk-PH2OXXVZ.js → chunk-ZHVA42R5.js} +9 -9
  46. package/dist/cli-bundle/main.js +13 -13
  47. package/dist/cli-bundle/sdk-authoring.js +1 -1
  48. package/dist/cli-bundle/sdk-contracts.js +2 -2
  49. package/dist/cli-bundle/sdk-core.js +40 -40
  50. package/dist/cli-bundle/sdk-governance.js +1 -1
  51. package/dist/cli-bundle/sdk-graph.js +1 -1
  52. package/dist/cli-bundle/sdk-merge.js +33 -32
  53. package/dist/cli-bundle/sdk-query.js +1 -1
  54. package/dist/cli-bundle/sdk-runtime.js +1 -1
  55. package/dist/cli-bundle/sdk-testing.js +1 -1
  56. package/dist/cli-bundle/sdk.js +5 -5
  57. package/dist/core/config/nested-settings.js +8 -2
  58. package/dist/core/config/positional-value.d.ts +1 -1
  59. package/dist/core/config/positional-value.js +5 -2
  60. package/dist/core/history/history.js +3 -3
  61. package/dist/core/item/item-format.js +66 -12
  62. package/dist/core/reproducibility/context.d.ts +4 -0
  63. package/dist/core/reproducibility/context.js +14 -8
  64. package/dist/core/shared/author.d.ts +55 -1
  65. package/dist/core/shared/author.js +333 -16
  66. package/dist/core/shared/constants.js +3 -2
  67. package/dist/core/store/settings-validator.d.ts +1 -0
  68. package/dist/core/store/settings-validator.js +6 -3
  69. package/dist/core/store/settings.js +5 -2
  70. package/dist/mcp/server.d.ts +1 -1
  71. package/dist/mcp/server.js +30 -9
  72. package/dist/sdk/agent/identity-config.d.ts +63 -0
  73. package/dist/sdk/agent/identity-config.js +107 -0
  74. package/dist/sdk/agent/refusal-corpus-contracts.d.ts +76 -0
  75. package/dist/sdk/agent/refusal-corpus-contracts.js +194 -0
  76. package/dist/sdk/cli-contracts/agent-output-contracts.js +6 -4
  77. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -0
  78. package/dist/sdk/cli-contracts/enum-contracts.js +9 -2
  79. package/dist/sdk/cli-contracts/flag-contracts.js +9 -2
  80. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +4 -4
  81. package/dist/sdk/cli-contracts/registration-helpers.js +5 -2
  82. package/dist/sdk/cli-contracts/tool-parameter-tables.js +22 -2
  83. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  84. package/dist/sdk/cli-contracts/tool-schema.js +14 -3
  85. package/dist/sdk/cli-contracts.d.ts +3 -3
  86. package/dist/sdk/cli-contracts.js +4 -4
  87. package/dist/sdk/config.d.ts +6 -1
  88. package/dist/sdk/config.js +119 -14
  89. package/dist/sdk/context-intent-contracts.js +4 -2
  90. package/dist/sdk/core-governance.d.ts +1 -1
  91. package/dist/sdk/core-governance.js +3 -3
  92. package/dist/sdk/extension/scaffold.js +11 -5
  93. package/dist/sdk/flag-invocation-contracts.js +4 -2
  94. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +50 -2
  95. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +87 -38
  96. package/dist/sdk/governance/assurance-action.js +30 -10
  97. package/dist/sdk/governance/validate.d.ts +2 -2
  98. package/dist/sdk/governance/validate.js +39 -14
  99. package/dist/sdk/index.d.ts +7 -2
  100. package/dist/sdk/index.js +8 -3
  101. package/dist/sdk/lifecycle/create.js +6 -3
  102. package/dist/sdk/lifecycle/update.js +5 -3
  103. package/dist/sdk/merge/three-way.js +105 -26
  104. package/dist/sdk/read-output-budget.d.ts +21 -0
  105. package/dist/sdk/read-output-budget.js +39 -2
  106. package/dist/sdk/read-output-contracts.d.ts +5 -3
  107. package/dist/sdk/read-output-contracts.js +20 -12
  108. package/dist/sdk/reproducibility/process.d.ts +19 -0
  109. package/dist/sdk/reproducibility/process.js +88 -0
  110. package/dist/sdk/runtime-primitives.d.ts +1 -1
  111. package/dist/sdk/runtime-primitives.js +3 -3
  112. package/dist/sdk/runtime.js +6 -5
  113. package/dist/sdk/test/batch.d.ts +6 -0
  114. package/dist/sdk/test/batch.js +15 -3
  115. package/dist/sdk/test/entry.d.ts +1 -1
  116. package/dist/sdk/test/entry.js +3 -2
  117. package/dist/sdk/test/execution.d.ts +28 -3
  118. package/dist/sdk/test/execution.js +193 -34
  119. package/dist/sdk/test/parsers.d.ts +6 -0
  120. package/dist/sdk/test/parsers.js +21 -2
  121. package/dist/sdk/test/trust.d.ts +33 -0
  122. package/dist/sdk/test/trust.js +207 -0
  123. package/dist/types.d.ts +23 -0
  124. package/dist/types.js +2 -2
  125. package/docs/AGENT_PROVENANCE_ADR.md +41 -5
  126. package/docs/CONFIGURATION.md +4 -0
  127. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +19 -2
  128. package/docs/MERGE_SAFETY.md +15 -1
  129. package/docs/READ_OUTPUT_CONTRACTS.md +11 -1
  130. package/docs/REPRODUCIBLE_WORKSPACES.md +42 -8
  131. package/docs/SDK.md +9 -0
  132. package/docs/SDK_AGENT_SESSION_CONTEXT.md +6 -4
  133. package/docs/SDK_EVIDENCE_TRACEABILITY.md +1 -1
  134. package/docs/TESTING.md +75 -8
  135. package/docs/agent-task-token-baseline.json +2 -2
  136. package/docs/generated/FLAG_LEXICON_BUDGETS.md +2 -2
  137. package/marketplace.json +2 -2
  138. package/package.json +2 -2
  139. package/packages/pm-beads/package.json +1 -1
  140. package/packages/pm-calendar/package.json +1 -1
  141. package/packages/pm-command-kit/package.json +1 -1
  142. package/packages/pm-digital-twin/package.json +1 -1
  143. package/packages/pm-governance-audit/package.json +1 -1
  144. package/packages/pm-guide-shell/package.json +1 -1
  145. package/packages/pm-kanban/package.json +1 -1
  146. package/packages/pm-lifecycle-hooks/package.json +1 -1
  147. package/packages/pm-linked-test-adapters/package.json +1 -1
  148. package/packages/pm-search-advanced/package.json +1 -1
  149. package/packages/pm-templates/package.json +1 -1
  150. package/packages/pm-todos/package.json +1 -1
  151. package/packages/pm-vcs/package.json +1 -1
  152. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  153. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  154. package/sdk/public-surface.json +427 -17
  155. package/dist/cli-bundle/chunks/chunk-EMWDM5FI.js +0 -13
  156. package/dist/cli-bundle/chunks/chunk-HYG6LRL4.js +0 -200
  157. package/dist/cli-bundle/chunks/chunk-SMWXHMVB.js +0 -35
  158. package/dist/cli-bundle/chunks/chunk-VMMIL3SI.js +0 -2
  159. package/dist/cli-bundle/chunks/chunk-YBPJAOQQ.js +0 -3
  160. package/dist/cli-bundle/chunks/register-mutation-HTKEEGRD.js +0 -20
  161. package/dist/cli-bundle/chunks/register-operations-6EMRWJJY.js +0 -2
  162. package/dist/cli-bundle/focused-chunks/chunk-2AZT5WXZ.js +0 -2
  163. package/dist/cli-bundle/focused-chunks/chunk-5SHSBMX2.js +0 -2
  164. package/dist/cli-bundle/focused-chunks/chunk-C4S4A4JJ.js +0 -5
  165. package/dist/cli-bundle/focused-chunks/chunk-L5LDSRO2.js +0 -155
  166. package/dist/cli-bundle/focused-chunks/chunk-MB37AYN6.js +0 -26
  167. package/dist/cli-bundle/focused-chunks/chunk-MCOR37QK.js +0 -2
  168. package/dist/cli-bundle/focused-chunks/chunk-WZE4LIPW.js +0 -8
@@ -1,43 +1,7 @@
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]="4f1bb829-c6be-5a3e-90f2-4b0062aa2dac")}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]="9b6149b0-ca3e-5093-aba5-43385d3368f7")}catch(e){}}();
4
4
  export const PM_ERROR_CODE_CATALOG_PART_2 = [
5
- {
6
- code: "missing_cli_flag",
7
- meaning: "Missing cli flag condition.",
8
- stability: "provisional",
9
- exit_code: 1,
10
- class: "generic_failure",
11
- recovery: "Inspect the structured error guidance and retry the suggested command.",
12
- sources: ["sdk/cli-contracts/tool-option-contracts.ts"],
13
- emitting_commands: ["*"],
14
- canonical_code: "missing_cli_flag",
15
- aliases: [],
16
- },
17
- {
18
- code: "missing_destination",
19
- meaning: "Missing destination condition.",
20
- stability: "provisional",
21
- exit_code: 1,
22
- class: "generic_failure",
23
- recovery: "Inspect the structured error guidance and retry the suggested command.",
24
- sources: ["sdk/cli-contracts/grammar-contracts.ts"],
25
- emitting_commands: ["*"],
26
- canonical_code: "missing_destination",
27
- aliases: [],
28
- },
29
- {
30
- code: "missing_directory",
31
- meaning: "Missing directory condition.",
32
- stability: "stable",
33
- exit_code: 1,
34
- class: "generic_failure",
35
- recovery: "Inspect the structured error guidance and retry the suggested command.",
36
- sources: ["core/diagnostics/remediation.ts"],
37
- emitting_commands: ["*"],
38
- canonical_code: "missing_directory",
39
- aliases: [],
40
- },
41
5
  {
42
6
  code: "missing_init_recovery",
43
7
  meaning: "Missing init recovery condition.",
@@ -122,6 +86,7 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
122
86
  "cli/main.ts",
123
87
  "cli/register-mutation.ts",
124
88
  "core/telemetry/observability.ts",
89
+ "sdk/governance/assurance-action.ts",
125
90
  "sdk/history-redact.ts",
126
91
  "sdk/invocation-author.ts",
127
92
  ],
@@ -543,6 +508,78 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
543
508
  canonical_code: "redundant_edge",
544
509
  aliases: [],
545
510
  },
511
+ {
512
+ code: "refusal_allowed_values_mismatch",
513
+ meaning: "Refusal allowed values mismatch condition.",
514
+ stability: "provisional",
515
+ exit_code: 1,
516
+ class: "generic_failure",
517
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
518
+ sources: ["sdk/agent/refusal-corpus-contracts.ts"],
519
+ emitting_commands: ["*"],
520
+ canonical_code: "refusal_allowed_values_mismatch",
521
+ aliases: [],
522
+ },
523
+ {
524
+ code: "refusal_error_code_mismatch",
525
+ meaning: "Refusal error code mismatch condition.",
526
+ stability: "provisional",
527
+ exit_code: 1,
528
+ class: "generic_failure",
529
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
530
+ sources: ["sdk/agent/refusal-corpus-contracts.ts"],
531
+ emitting_commands: ["*"],
532
+ canonical_code: "refusal_error_code_mismatch",
533
+ aliases: [],
534
+ },
535
+ {
536
+ code: "refusal_exit_code_mismatch",
537
+ meaning: "Refusal exit code mismatch condition.",
538
+ stability: "provisional",
539
+ exit_code: 1,
540
+ class: "generic_failure",
541
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
542
+ sources: ["sdk/agent/refusal-corpus-contracts.ts"],
543
+ emitting_commands: ["*"],
544
+ canonical_code: "refusal_exit_code_mismatch",
545
+ aliases: [],
546
+ },
547
+ {
548
+ code: "refusal_mutated_state",
549
+ meaning: "Refusal mutated state condition.",
550
+ stability: "provisional",
551
+ exit_code: 1,
552
+ class: "generic_failure",
553
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
554
+ sources: ["sdk/agent/refusal-corpus-contracts.ts"],
555
+ emitting_commands: ["*"],
556
+ canonical_code: "refusal_mutated_state",
557
+ aliases: [],
558
+ },
559
+ {
560
+ code: "refusal_probe_missing",
561
+ meaning: "Refusal probe missing condition.",
562
+ stability: "provisional",
563
+ exit_code: 1,
564
+ class: "generic_failure",
565
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
566
+ sources: ["sdk/agent/refusal-corpus-contracts.ts"],
567
+ emitting_commands: ["*"],
568
+ canonical_code: "refusal_probe_missing",
569
+ aliases: [],
570
+ },
571
+ {
572
+ code: "refusal_recovery_failed",
573
+ meaning: "Refusal recovery failed condition.",
574
+ stability: "provisional",
575
+ exit_code: 1,
576
+ class: "generic_failure",
577
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
578
+ sources: ["sdk/agent/refusal-corpus-contracts.ts"],
579
+ emitting_commands: ["*"],
580
+ canonical_code: "refusal_recovery_failed",
581
+ aliases: [],
582
+ },
546
583
  {
547
584
  code: "reindex_already_running",
548
585
  meaning: "Reindex already running condition.",
@@ -1111,6 +1148,18 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
1111
1148
  canonical_code: "undeclared_observation",
1112
1149
  aliases: [],
1113
1150
  },
1151
+ {
1152
+ code: "unexpected_refusal_probe",
1153
+ meaning: "Unexpected refusal probe condition.",
1154
+ stability: "provisional",
1155
+ exit_code: 1,
1156
+ class: "generic_failure",
1157
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1158
+ sources: ["sdk/agent/refusal-corpus-contracts.ts"],
1159
+ emitting_commands: ["*"],
1160
+ canonical_code: "unexpected_refusal_probe",
1161
+ aliases: [],
1162
+ },
1114
1163
  {
1115
1164
  code: "unknown_command",
1116
1165
  meaning: "Unknown command condition.",
@@ -1990,4 +2039,4 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
1990
2039
  },
1991
2040
  ];
1992
2041
  //# sourceMappingURL=generated-error-code-catalog-part-2.js.map
1993
- //# debugId=4f1bb829-c6be-5a3e-90f2-4b0062aa2dac
2042
+ //# debugId=9b6149b0-ca3e-5093-aba5-43385d3368f7
@@ -4,7 +4,7 @@
4
4
  * Normalizes the assurance action vocabulary once for CLI, SDK, and MCP hosts.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="57c12241-812d-5db6-9a07-ca256152b130")}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]="f66a964d-1352-5523-ab91-5177d0d93ce8")}catch(e){}}();
8
8
  import { createHash } from "node:crypto";
9
9
  import { EXIT_CODE } from "../../core/shared/constants.js";
10
10
  import { PmCliError } from "../../core/shared/errors.js";
@@ -18,6 +18,7 @@ import { resolvePmRoot } from "../runtime-primitives.js";
18
18
  import { parseRuntimeInteger, readRuntimeString } from "../runtime-input.js";
19
19
  import { analyzeDefectChangeRisk, buildDefectRecurrenceIndex, parseDefectChangeRiskRequest, } from "./defect-recurrence.js";
20
20
  import { defectRecurrenceItemSignals } from "./defect-recurrence-signals.js";
21
+ import { createUnknownSubcommandError } from "../agent/subcommand-recovery.js";
21
22
  let riskIndexCache;
22
23
  /** Assurance registry and evaluation verbs shared by every transport. */
23
24
  export const ASSURANCE_ACTIONS = [
@@ -43,17 +44,36 @@ function parseAction(value) {
43
44
  if (ASSURANCE_ACTIONS.includes(value)) {
44
45
  return value;
45
46
  }
46
- throw new PmCliError(`Unknown assurance action ${value}. Expected: ${ASSURANCE_ACTIONS.join(", ")}`, EXIT_CODE.USAGE);
47
+ throw createUnknownSubcommandError({
48
+ command_path: "assurance",
49
+ token: value,
50
+ allowed: ASSURANCE_ACTIONS,
51
+ display_name: "assurance action",
52
+ });
53
+ }
54
+ /** Throw the shared structured usage refusal for a missing assurance operand. */
55
+ function missingAssuranceArgument(operand, detail, example) {
56
+ throw new PmCliError(detail, EXIT_CODE.USAGE, {
57
+ code: "missing_required_argument",
58
+ required: `Provide the missing assurance operand: ${operand}.`,
59
+ examples: [example],
60
+ recovery: { missing: [operand] },
61
+ });
47
62
  }
48
63
  function parseKind(value) {
49
- if (value &&
50
- ASSURANCE_DECLARATION_KINDS.includes(value)) {
64
+ if (!value) {
65
+ return missingAssuranceArgument("kind", `Assurance declaration kind is required. Expected: ${ASSURANCE_DECLARATION_KINDS.join(", ")}`, "pm assurance list measurement");
66
+ }
67
+ if (ASSURANCE_DECLARATION_KINDS.includes(value)) {
51
68
  return value;
52
69
  }
53
70
  throw new PmCliError(`Assurance declaration kind is required. Expected: ${ASSURANCE_DECLARATION_KINDS.join(", ")}`, EXIT_CODE.USAGE);
54
71
  }
55
72
  function parsePreset(value) {
56
- if (value && ASSURANCE_PRESET_IDS.includes(value)) {
73
+ if (!value) {
74
+ return missingAssuranceArgument("preset", `Assurance preset is required. Expected: ${ASSURANCE_PRESET_IDS.join(", ")}`, "pm assurance apply software-delivery --owner <pm-item-id>");
75
+ }
76
+ if (ASSURANCE_PRESET_IDS.includes(value)) {
57
77
  return value;
58
78
  }
59
79
  throw new PmCliError(`Assurance preset is required. Expected: ${ASSURANCE_PRESET_IDS.join(", ")}`, EXIT_CODE.USAGE);
@@ -61,7 +81,7 @@ function parsePreset(value) {
61
81
  function requireOwner(input) {
62
82
  if (input.owner?.trim())
63
83
  return input.owner.trim();
64
- throw new PmCliError("assurance preset and derivation actions require --owner <pm-item-id>", EXIT_CODE.USAGE);
84
+ return missingAssuranceArgument("owner", "assurance preset and derivation actions require --owner <pm-item-id>", "pm assurance apply software-delivery --owner <pm-item-id>");
65
85
  }
66
86
  function parseDefinition(kind, value) {
67
87
  let parsed = value;
@@ -173,7 +193,7 @@ async function runAdoptionAction(action, input, pmRoot) {
173
193
  };
174
194
  }
175
195
  if (!input.id) {
176
- throw new PmCliError("assurance promote requires an assertion id", EXIT_CODE.USAGE);
196
+ return missingAssuranceArgument("assertion-id", "assurance promote requires an assertion id", "pm assurance promote <assertion-id> --enforcement warn");
177
197
  }
178
198
  if (input.enforcement !== "warn" && input.enforcement !== "block") {
179
199
  throw new PmCliError("assurance promote requires --enforcement warn|block", EXIT_CODE.USAGE);
@@ -186,7 +206,7 @@ async function runAdoptionAction(action, input, pmRoot) {
186
206
  }
187
207
  async function runGateAction(input, pmRoot, runtime) {
188
208
  if (!input.id) {
189
- throw new PmCliError("assurance run requires a gate id", EXIT_CODE.USAGE);
209
+ return missingAssuranceArgument("gate-id", "assurance run requires a gate id", "pm assurance run <gate-id> --trigger ci --dry-run");
190
210
  }
191
211
  const gateId = input.id;
192
212
  if (!input.trigger) {
@@ -320,7 +340,7 @@ export async function runAssuranceAction(input, global = {}, runtime = {}) {
320
340
  if (action === "list")
321
341
  return listAssuranceDeclarations(pmRoot, kind);
322
342
  if (!input.id) {
323
- throw new PmCliError(`assurance ${action} requires an id`, EXIT_CODE.USAGE);
343
+ return missingAssuranceArgument("id", `assurance ${action} requires an id`, `pm assurance ${action} ${kind} <id>`);
324
344
  }
325
345
  const id = input.id;
326
346
  if (action === "show") {
@@ -377,4 +397,4 @@ export function runAssuranceDispatch(args, options, global) {
377
397
  }, global);
378
398
  }
379
399
  //# sourceMappingURL=assurance-action.js.map
380
- //# debugId=57c12241-812d-5db6-9a07-ca256152b130
400
+ //# debugId=f66a964d-1352-5523-ab91-5177d0d93ce8
@@ -231,10 +231,10 @@ declare function buildFilesCheck(items: ItemWithBody[], workspaceRoot: string, p
231
231
  warnings: string[];
232
232
  staleLinkPruneRows: StaleLinkPruneRow[];
233
233
  }>;
234
- declare function buildCommandReferencesCheck(items: ItemWithBody[], idPrefix: string, verboseDiagnostics: boolean): {
234
+ declare function buildCommandReferencesCheck(items: ItemWithBody[], idPrefix: string, verboseDiagnostics: boolean, pmRoot: string): Promise<{
235
235
  check: ValidateCheck;
236
236
  warnings: string[];
237
- };
237
+ }>;
238
238
  /** Apply one planned fix through the SAME audited command paths an operator would use by hand (`pm update` / `pm files --remove` / `pm docs --remove`), so every applied fix carries normal history, locking, and hook behavior. Command modules are imported lazily: plain validate runs stay read-only and never pay the mutation-stack import cost. */
239
239
  declare function applyValidateFix(fix: ValidateFixRecord, global: GlobalOptions, services: ValidateMutationServices): Promise<void>;
240
240
  declare function applyValidateFixes(applicable: ValidateFixRecord[], global: GlobalOptions, services: ValidateMutationServices): Promise<{
@@ -4,7 +4,7 @@
4
4
  * Implements the pm validate command surface and its agent-facing runtime behavior.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="87e3932d-26f0-5d44-ac35-5d0d7d1f4467")}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]="aca69fd7-c47a-5424-b58f-f305f690edd9")}catch(e){}}();
8
8
  import { assertInitializedTracker } from "../environment/tracker-preflight.js";
9
9
  import fs from "node:fs/promises";
10
10
  import { realpathSync } from "node:fs";
@@ -42,6 +42,7 @@ import { createRelationshipKindRegistry, } from "../relationships.js";
42
42
  import { runDocs } from "../docs.js";
43
43
  import { runFiles } from "../files.js";
44
44
  import { extractReferencedPmItemIdsFromCommand } from "../test/linked-command-detection.js";
45
+ import { resolveLinkedTestSourceRef, resolveLinkedTestSourceWorkspaceRoot, resolveLinkedTestTrustBatch, } from "../test/trust.js";
45
46
  import { readValidateItems, } from "./validate-item-reader.js";
46
47
  import { buildValidateHistoryDriftCheck } from "./validate-history-drift.js";
47
48
  import { buildLifecycleParentGraph, detectLifecycleParentCycles, resolveLifecycleDependencyCycleSamplePath, } from "./hierarchy-validation.js";
@@ -1710,23 +1711,40 @@ async function buildFilesCheck(items, workspaceRoot, pmRoot, fileScanMode, inclu
1710
1711
  };
1711
1712
  }
1712
1713
  /* c8 ignore stop */
1713
- /* c8 ignore start -- command preview truncation formatting is covered by command-reference integration fixtures */
1714
- function summarizeCommandReferenceRow(ownerId, referencedId, command) {
1714
+ /** Collapse a linked command to the bounded preview used in validation rows. */
1715
+ function summarizeCommandPreview(command) {
1715
1716
  const normalizedCommand = command.trim().replaceAll(/\s+/g, " ");
1716
- const commandPreview = normalizedCommand.length > 120
1717
+ return normalizedCommand.length > 120
1717
1718
  ? `${normalizedCommand.slice(0, 117)}...`
1718
1719
  : normalizedCommand;
1719
- return `${ownerId}:${referencedId}:${commandPreview}`;
1720
1720
  }
1721
- /* c8 ignore stop */
1721
+ /** Join command-reference identity and its bounded preview for diagnostics. */
1722
+ function summarizeCommandReferenceRow(ownerId, referencedId, command) {
1723
+ return `${ownerId}:${referencedId}:${summarizeCommandPreview(command)}`;
1724
+ }
1725
+ /** Render portable diagnostics for linked tests that this clone has not trusted. */
1726
+ function buildUntrustedLinkedTestRows(linkedTests, trustDecisions) {
1727
+ const rows = [];
1728
+ linkedTests.forEach(({ item, linkedTest }, index) => {
1729
+ const trust = trustDecisions[index];
1730
+ if (trust.trusted)
1731
+ return;
1732
+ const command = summarizeCommandPreview(linkedTest.command ?? "");
1733
+ rows.push(`${item.id}:${trust.source_ref ?? "unknown"}->${trust.current_source_ref ?? "unknown"}:${command}`);
1734
+ });
1735
+ return rows;
1736
+ }
1722
1737
  /* c8 ignore start -- command-reference discovery/stale-id permutations are covered by linked-test integration suites */
1723
- function buildCommandReferencesCheck(items, idPrefix, verboseDiagnostics) {
1738
+ async function buildCommandReferencesCheck(items, idPrefix, verboseDiagnostics, pmRoot) {
1724
1739
  const knownIds = new Set(items.map((item) => item.id.toLowerCase()));
1725
1740
  let linkedCommandsScanned = 0;
1726
1741
  let referencedPmIdCount = 0;
1727
1742
  const referencedPmIds = new Set();
1728
1743
  const staleReferenceRows = [];
1729
1744
  const linkedTests = items.flatMap((item) => (item.tests ?? []).map((linkedTest) => ({ item, linkedTest })));
1745
+ const currentSourceRef = await resolveLinkedTestSourceRef(resolveLinkedTestSourceWorkspaceRoot());
1746
+ const trustDecisions = await resolveLinkedTestTrustBatch(pmRoot, linkedTests.map(({ linkedTest }) => linkedTest), currentSourceRef);
1747
+ const untrustedRows = buildUntrustedLinkedTestRows(linkedTests, trustDecisions);
1730
1748
  for (const { item, linkedTest } of linkedTests) {
1731
1749
  if (typeof linkedTest.command !== "string" ||
1732
1750
  linkedTest.command.trim().length === 0) {
@@ -1751,17 +1769,20 @@ function buildCommandReferencesCheck(items, idPrefix, verboseDiagnostics) {
1751
1769
  ]
1752
1770
  .filter((value) => value.length > 0)
1753
1771
  .sort((left, right) => left.localeCompare(right));
1754
- const warnings = uniqueStaleReferenceRows.length > 0
1755
- ? [
1756
- `validate_command_references_stale_pm_ids:${uniqueStaleReferenceRows.length}`,
1757
- ]
1758
- : [];
1772
+ const warnings = [];
1773
+ if (uniqueStaleReferenceRows.length > 0) {
1774
+ warnings.push(`validate_command_references_stale_pm_ids:${uniqueStaleReferenceRows.length}`);
1775
+ }
1776
+ if (untrustedRows.length > 0) {
1777
+ warnings.push(`validate_linked_test_trust_unacknowledged:${untrustedRows.length}`);
1778
+ }
1759
1779
  const diagnosticLimit = verboseDiagnostics
1760
1780
  ? Number.POSITIVE_INFINITY
1761
1781
  : DIAGNOSTIC_LIST_SUMMARY_LIMIT;
1762
1782
  const summarizedRows = summarizeList(uniqueStaleReferenceRows, diagnosticLimit);
1763
1783
  const summarizedStalePmIds = summarizeList(stalePmIds, diagnosticLimit);
1764
1784
  const summarizedReferencedPmIds = summarizeList([...referencedPmIds].sort((left, right) => left.localeCompare(right)), diagnosticLimit);
1785
+ const summarizedUntrustedRows = summarizeList(untrustedRows, diagnosticLimit);
1765
1786
  return {
1766
1787
  check: {
1767
1788
  name: "command_references",
@@ -1774,6 +1795,10 @@ function buildCommandReferencesCheck(items, idPrefix, verboseDiagnostics) {
1774
1795
  unique_referenced_pm_ids_count: referencedPmIds.size,
1775
1796
  unique_referenced_pm_ids: summarizedReferencedPmIds.values,
1776
1797
  unique_referenced_pm_ids_truncated: summarizedReferencedPmIds.truncated,
1798
+ linked_test_trust_current_source_ref: currentSourceRef ?? null,
1799
+ untrusted_linked_tests_count: untrustedRows.length,
1800
+ untrusted_linked_tests: summarizedUntrustedRows.values,
1801
+ untrusted_linked_tests_truncated: summarizedUntrustedRows.truncated,
1777
1802
  stale_pm_id_references_count: uniqueStaleReferenceRows.length,
1778
1803
  stale_pm_ids_count: stalePmIds.length,
1779
1804
  stale_pm_ids: summarizedStalePmIds.values,
@@ -2093,7 +2118,7 @@ async function executeRequestedValidateChecks(params) {
2093
2118
  recordValidateCheck(state, built, fixHintsEnabled);
2094
2119
  }
2095
2120
  if (params.requestedChecks.has("command_references")) {
2096
- recordValidateCheck(state, buildCommandReferencesCheck(params.items, params.settings.id_prefix, fullDiagnostics), fixHintsEnabled);
2121
+ recordValidateCheck(state, await buildCommandReferencesCheck(params.items, params.settings.id_prefix, fullDiagnostics, params.pmRoot), fixHintsEnabled);
2097
2122
  }
2098
2123
  if (params.requestedChecks.has("history_drift")) {
2099
2124
  recordValidateCheck(state, await buildValidateHistoryDriftCheck(params.pmRoot, params.items, fullDiagnostics), fixHintsEnabled);
@@ -2255,4 +2280,4 @@ export async function runValidate(options, global, services = {}) {
2255
2280
  }
2256
2281
  /* c8 ignore stop */
2257
2282
  //# sourceMappingURL=validate.js.map
2258
- //# debugId=87e3932d-26f0-5d44-ac35-5d0d7d1f4467
2283
+ //# debugId=aca69fd7-c47a-5424-b58f-f305f690edd9
@@ -13,6 +13,7 @@ export { BUILTIN_CORPUS_SHAPES, PM_CORPUS_SHAPE_SCHEMA, buildCorpusShapeItemPlan
13
13
  export * from "./core-governance.js";
14
14
  export { createPmCliProgram } from "./cli-program.js";
15
15
  export { runSearchRefreshWorkerEntrypoint } from "./search-refresh-worker.js";
16
+ export { PM_REPRODUCIBLE_PROCESS_ENV, createReproducibleProcessRunner, resolveReproducibleProcessEnvironment, runWithReproducibleProcessEnvironment, type ReproducibleExecutionSettings, type ReproducibleProcessEnvironment, type ReproducibleProcessRunner, } from "./reproducibility/process.js";
16
17
  export { PM_WORKSPACE_RECIPE_SCHEMA, defineWorkspaceRecipe, executeWorkspaceRecipe, runWithWorkspaceRecipe, type WorkspaceRecipe, type WorkspaceRecipeJsonValue, type WorkspaceRecipeOperation, } from "./workspace-recipe.js";
17
18
  export { SNAPSHOT_SCHEMA, WORKSPACE_SNAPSHOT_ACTIONS, createWorkspaceSnapshot, deleteWorkspaceSnapshot, inspectWorkspaceSnapshot, listWorkspaceSnapshots, planWorkspaceSnapshotRestore, restoreWorkspaceSnapshot, restoreWorkspaceSnapshotWithRecovery, type CreateWorkspaceSnapshotResult, type RestoreWorkspaceSnapshotOptions, type RestoreWorkspaceSnapshotResult, type WorkspaceSnapshotHistoryImpact, type WorkspaceSnapshotManifest, type WorkspaceSnapshotReference, type WorkspaceSnapshotRestorePlan, } from "./workspace-snapshot.js";
18
19
  export { flushTelemetryQueue } from "./telemetry-flush.js";
@@ -48,6 +49,7 @@ export { discoverNearbyPmRoot } from "./tracker-root-discovery.js";
48
49
  export { assertInitializedTracker, assertReadableTrackerRoot, buildTrackerInitializationRecovery, } from "./environment/tracker-preflight.js";
49
50
  export { _testOnly as _testOnlyTemplates, type TemplateSource, } from "./templates.js";
50
51
  export { runConfig, _testOnlyConfigCommand, type NestedSettingResultValue, } from "./config.js";
52
+ export * from "./agent/identity-config.js";
51
53
  export { INIT_AGENT_GUIDANCE_MODE_VALUES, runInitAgentGuidance, _testOnly as _testOnlyInitAgentGuidance, type InitAgentGuidanceMode, type InitAgentGuidanceSummary, type RunInitAgentGuidanceOptions, type RunInitAgentGuidanceResult, } from "./init-agent-guidance.js";
52
54
  export { runInit, summarizeInitResult, _testOnly as _testOnlyInit, type InitAgentGuidanceResult, type InitConciseResult, type InitInstalledPackagesSummary, type InitRegisteredTypePresetSummary, type InitTargetResolution, type InitTypePresetName, } from "./init.js";
53
55
  export { PROFILE_SUBCOMMANDS, formatProfileApplyHuman, formatProfileLintHuman, formatProfileListHuman, formatProfileShowHuman, runProfileApply, runProfileLint, runProfileList, runProfileShow, type ProfileApplyDimension, type ProfileComposition, type ProfileListEntry, } from "./profile.js";
@@ -57,7 +59,7 @@ export type { LocatedItem } from "../core/store/item-store.js";
57
59
  export { PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS, PM_PACKAGE_RESOURCE_KINDS, collectPackageExtensionDirectories, readPmPackageManifest, type PmPackageCatalogLinkMap, type PmPackageCatalogMediaMap, type PmPackageCatalogMetadata, type PmPackageManifest, type PmPackageResourceKind, type PmPackageResourceMap, } from "../core/packages/manifest.js";
58
60
  export type { CommanderOptionAliasContract, CommanderOptionRegistrationContract, } from "./cli-contracts.js";
59
61
  export { ACTIVITY_FLAG_CONTRACTS, ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, ASSURANCE_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLAIM_FLAG_CONTRACTS, CLOSE_ACTION_OPTION_KEYS, CLOSE_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, CLOSE_TASK_FLAG_CONTRACTS, COMMENTS_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONFIG_FLAG_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, COPY_FLAG_CONTRACTS, CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_FLAG_CONTRACTS, DELETE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, DOCS_FLAG_CONTRACTS, EVAL_FLAG_CONTRACTS, EVENT_FLAG_CONTRACTS, EVENTS_FLAG_CONTRACTS, EXTENSION_ACTIVATE_FLAG_CONTRACTS, EXTENSION_ADOPT_ALL_FLAG_CONTRACTS, EXTENSION_ADOPT_FLAG_CONTRACTS, EXTENSION_CATALOG_FLAG_CONTRACTS, EXTENSION_DEACTIVATE_FLAG_CONTRACTS, EXTENSION_DESCRIBE_FLAG_CONTRACTS, EXTENSION_DOCTOR_FLAG_CONTRACTS, EXTENSION_EXPLORE_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, EXTENSION_INIT_FLAG_CONTRACTS, EXTENSION_INSTALL_FLAG_CONTRACTS, EXTENSION_MANAGE_FLAG_CONTRACTS, EXTENSION_MIGRATE_FLAG_CONTRACTS, EXTENSION_RELOAD_FLAG_CONTRACTS, EXTENSION_SCOPE_FLAG_CONTRACTS, EXTENSION_UNINSTALL_FLAG_CONTRACTS, FILES_FLAG_CONTRACTS, FOCUS_FLAG_CONTRACTS, GC_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_COMPACT_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, HISTORY_REDACT_FLAG_CONTRACTS, HISTORY_REPAIR_FLAG_CONTRACTS, HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, INSTALL_FLAG_CONTRACTS, ITEM_MUTATE_FLAG_CONTRACTS, ITEM_COMPLETE_FLAG_CONTRACTS, ITEM_REOPEN_FLAG_CONTRACTS, LEARNINGS_FLAG_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, MEET_FLAG_CONTRACTS, MERGE_FLAG_CONTRACTS, NEXT_COMMANDER_STRING_OPTION_CONTRACTS, NEXT_FLAG_CONTRACTS, NOTES_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PACKAGE_INIT_FLAG_CONTRACTS, PAUSE_TASK_FLAG_CONTRACTS, PLAN_CREATE_METADATA_PARAMETER_KEYS, PLAN_FLAG_CONTRACTS, PM_COMMAND_OUTPUT_BUDGET_CONTRACTS, PM_DIAGNOSTIC_DEGRADATION_STEPS, PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS, PM_DIAGNOSTIC_OUTPUT_CLASSES, PM_CLI_ONLY_TOOL_ACTION_WAIVERS, PM_CORE_COMMAND_NAMES, PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS, PM_ITEM_ACTION_SUBCOMMANDS, PM_DEPRECATED_TOOL_ACTIONS, PM_DISCOVERABLE_TOOL_ACTIONS, PM_EXTENSION_CAPABILITY_CONTRACTS, PM_EXTENSION_POLICY_MODE_CONTRACTS, PM_EXTENSION_POLICY_SURFACE_CONTRACTS, PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS, PM_EXTENSION_SERVICE_NAME_CONTRACTS, PM_EXTENSION_TRUST_MODE_CONTRACTS, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION, PM_TOOL_ACTIONS, analyzePmToolActionParity, PM_TOOL_ACTION_PARAMETER_CONTRACTS, PM_TOOL_PARAMETERS_SCHEMA, PM_TOOL_PARAMETERS_SCHEMA_MAJOR, PM_TOOL_PARAMETERS_SCHEMA_VERSION, PM_OUTPUT_BUDGET_CLASSES, PM_OUTPUT_DEGRADATION_STEPS, PROFILE_FLAG_CONTRACTS, REINDEX_FLAG_CONTRACTS, RELEASE_FLAG_CONTRACTS, REMIND_FLAG_CONTRACTS, RESTORE_FLAG_CONTRACTS, SCHEMA_FLAG_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_FLAG_CONTRACTS, START_TASK_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, SUBCOMMAND_GLOBAL_FLAG_CONTRACTS, TELEMETRY_FLAG_CONTRACTS, TEST_ALL_FLAG_CONTRACTS, TEST_FLAG_CONTRACTS, TEST_RUNS_FLAG_CONTRACTS, TOOL_ACTIVITY_OPTION_CONTRACTS, TOOL_AGGREGATE_OPTION_CONTRACTS, TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE, TOOL_CALENDAR_OPTION_CONTRACTS, TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS, TOOL_CONTEXT_OPTION_CONTRACTS, TOOL_CREATE_OPTION_CONTRACTS, TOOL_CREATE_OPTION_CONTRACT_SOURCE, TOOL_DEPS_OPTION_CONTRACTS, TOOL_GRAPH_OPTION_CONTRACTS, TOOL_LIST_FILTER_OPTION_CONTRACTS, TOOL_SEARCH_FILTER_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE, TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACT_SOURCE, verifyToolOptionCliParity, UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, UPGRADE_FLAG_CONTRACTS, VALIDATE_FLAG_CONTRACTS, WORKSPACE_FLAG_CONTRACTS, buildPmActionToolInputSchema, PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES, compactFlagAliasContracts, createPmCommandOutputBudget, definePmCommandOutputBudget, estimatePmOutputTokens, inferPmOutputBudgetClass, projectPmDiagnosticOutput, projectPmDiagnosticText, analyzeSdkCliParameterCompleteness, isPmExtensionCapabilityContract, isPmExtensionPolicyModeContract, isPmExtensionPolicySurfaceContract, isPmExtensionServiceNameContract, isPmToolAction, hasSubcommandFlagContractsForCommand, readFirstStringFromCommanderOptions, readFirstValueFromCommanderOptions, readStringArrayFromCommanderOptions, resolvePmPositionalActionFlagContracts, resolveSubcommandFlagContractsForCommand, resolvePmCommandOutputBudget, resolvePmDiagnosticOutputBudget, resolvePmToolCustomFieldCollision, toCompletionFlagString, withFlagAliasMetadata, } from "./cli-contracts.js";
60
- export type { CliFlagContract, OptionsFromContracts, PmActionSchemaContract, PmActionToolInputSchemaOptions, PmToolCustomFieldCollision, PmBulkMutationControlOptions, PmBulkMutationFilterOptions, PmCloseActionOptions, PmCloseManyActionOptions, PmCreateActionOptions, PmMutationAttributionOptions, PmOptionScalar, PmCommandOutputBudgetContract, PmDiagnosticDegradationStep, PmDiagnosticOutputBudgetContract, PmDiagnosticOutputClass, PmDiagnosticOutputReceipt, PmOutputBudgetClass, PmOutputDegradationStep, PmProjectedDiagnostic, PmProjectedTextDiagnostic, PmUpdateActionOptions, PmUpdateManyActionOptions, PmExtensionCapabilityContract, PmExtensionPolicyModeContract, PmExtensionPolicySurfaceContract, PmExtensionSandboxProfileContract, PmExtensionServiceNameContract, PmExtensionTrustModeContract, PmToolAction, SdkCliActionParameterCoverage, SdkCliCompletenessContractSource, SdkCliParameterCoverageEntry, SdkCliParameterDisposition, ToolOptionFlagContract, ToolOptionCliParityFinding, ToolOptionCliParityReport, } from "./cli-contracts.js";
62
+ export type { CliFlagContract, OptionsFromContracts, PmActionSchemaContract, PmActionToolInputSchemaOptions, PmToolCustomFieldCollision, PmBulkMutationControlOptions, PmBulkMutationFilterOptions, PmCloseActionOptions, PmCloseManyActionOptions, PmCreateActionOptions, PmMutationAttributionOptions, PmOptionScalar, PmCommandOutputBudgetContract, PmDiagnosticDegradationStep, PmDiagnosticOutputBudgetContract, PmDiagnosticOutputClass, PmDiagnosticOutputReceipt, PmOutputBudgetClass, PmOutputDegradationStep, PmProjectedDiagnostic, PmProjectedTextDiagnostic, PmUpdateActionOptions, PmUpdateManyActionOptions, PmExtensionCapabilityContract, PmExtensionPolicyModeContract, PmExtensionPolicySurfaceContract, PmExtensionSandboxProfileContract, PmExtensionServiceNameContract, PmExtensionTrustModeContract, MergeSubcommand, PmToolAction, SdkCliActionParameterCoverage, SdkCliCompletenessContractSource, SdkCliParameterCoverageEntry, SdkCliParameterDisposition, ToolOptionFlagContract, ToolOptionCliParityFinding, ToolOptionCliParityReport, } from "./cli-contracts.js";
61
63
  export * from "./compose.js";
62
64
  export * from "./governance/assurance.js";
63
65
  export * from "./governance/assurance-action.js";
@@ -124,6 +126,8 @@ export * from "./generated-error-code-catalog.js";
124
126
  export * from "./agent/refusal-reachability.js";
125
127
  export * from "./agent/refusal-closure.js";
126
128
  export * from "./agent/closed-domain-contracts.js";
129
+ export * from "./agent/refusal-corpus-contracts.js";
130
+ export { MERGE_SUBCOMMAND_VALUES } from "./cli-contracts.js";
127
131
  export * from "./agent/tracker-preflight-contracts.js";
128
132
  export * from "./agent/subcommand-recovery.js";
129
133
  export * from "./flag-invocation-contracts.js";
@@ -159,7 +163,8 @@ export { runTelemetry, TELEMETRY_SUBCOMMANDS, type TelemetryCommandOptions, type
159
163
  export { classifyLinkedTestFailure, countFailureCategories, extractReferencedPmItemIdsFromCommand, resolveLinkedTestFailureExitCode, runLinkedTests, runTest, summarizeContextPreflight, type LinkedTestFailureCategory, type TestCommandOptions, type TestResult, type TestRunResult, } from "./test/execution.js";
160
164
  export { TEST_RUN_MEASUREMENT_LIMIT, diffTestRunMeasurements, parseTestRunMeasurements, queryTestRunMeasurementsBelow, type TestRunMeasurementDiff, } from "./test/measurements.js";
161
165
  export { runTestAll, type TestAllCommandOptions, type TestAllItemResult, type TestAllResult, } from "./test/batch.js";
162
- export { LINKED_TEST_ENV_NAME_PATTERN, LINKED_TEST_PM_CONTEXT_MODE_VALUES, LINKED_TEST_PROTECTED_ENV_KEYS, parseLinkedTestAssertionEqualsMap, parseLinkedTestAssertionGteMap, parseLinkedTestBoolean, parseLinkedTestContextMode, parseLinkedTestEnvClear, parseLinkedTestEnvSet, parseLinkedTestJsonEntries, parseLinkedTestMinLines, parseLinkedTestRegexList, parseLinkedTestStringList, type LinkedTestPmContextMode, } from "./test/parsers.js";
166
+ export { LINKED_TEST_ENV_NAME_PATTERN, LINKED_TEST_PM_CONTEXT_MODE_VALUES, LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES, LINKED_TEST_PROTECTED_ENV_KEYS, parseLinkedTestAssertionEqualsMap, parseLinkedTestAssertionGteMap, parseLinkedTestBoolean, parseLinkedTestContextMode, parseLinkedTestEnvClear, parseLinkedTestEnvSet, parseLinkedTestJsonEntries, parseLinkedTestMinLines, parseLinkedTestRegexList, parseLinkedTestStringList, parseLinkedTestWorkspaceContextMode, type LinkedTestPmContextMode, type LinkedTestWorkspaceContextMode, } from "./test/parsers.js";
167
+ export { acknowledgeLinkedTests, attachLinkedTestMutationProvenance, attachLinkedTestProvenance, linkedTestTrustFingerprint, resolveLinkedTestSourceRef, resolveLinkedTestSourceWorkspaceRoot, resolveLinkedTestTrust, resolveLinkedTestTrustBatch, type LinkedTestTrustDecision, } from "./test/trust.js";
163
168
  export { runStartBackgroundRun, runTestRunsWorker, type StartBackgroundRunCommandOptions, type StartBackgroundRunResult, } from "./test/runs.js";
164
169
  export { BUILTIN_PROFILES, listProfiles, normalizeProfileName, PROFILE_NAMES, resolveProfile, type ProfileConfigEntry, type ProfileName, type ProfilePackageRecommendation, type ProfileTemplateEntry, type ProfileTemplateOptions, type ProjectProfileDefinition, type ProjectProfileRegistrationInput, } from "../core/profile/profile-presets.js";
165
170
  export { planProfileApplication, type ProfileApplicationPlan, type ProfileChangeStatus, type ProfileComponentChange, type ProfileConfigChange, type ProfileConfigPlan, type ProfileCurrentState, type ProfilePackagePlan, type ProfileSchemaPlan, type ProfileTemplateChange, type ProfileTemplatePlan, type ProfileWorkflowChange, type ProfileWorkflowPlan, } from "../core/profile/profile-plan.js";
package/dist/sdk/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Defines public SDK APIs and package-author helpers for Index.
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]="483445af-d102-5b49-9b45-8452f8e48ea8")}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]="714cb108-a51f-5f77-b628-dc994e659f45")}catch(e){}}();
8
8
  export { PM_COMMAND_CAPABILITY_CONTRACTS, PM_COMMAND_VISIBILITY_CONTRACTS, PM_MCP_PROMPT_CONTRACTS, PM_MCP_RESOURCE_CONTRACTS, PM_MCP_TOOL_COMMAND_CONTRACTS, listPmCommandsForFamily, listPmCommandsForTier, listPmMcpToolsForProfile, renderPmCommandVisibilityMarkdown, resolvePmCommandCapabilityFamily, resolvePmCommandVisibilityTier, } from "./agent-capability-contracts.js";
9
9
  export * from "./cli-contracts/grammar-contracts.js";
10
10
  export * from "./agent-session-context.js";
@@ -14,6 +14,7 @@ export { BUILTIN_CORPUS_SHAPES, PM_CORPUS_SHAPE_SCHEMA, buildCorpusShapeItemPlan
14
14
  export * from "./core-governance.js";
15
15
  export { createPmCliProgram } from "./cli-program.js";
16
16
  export { runSearchRefreshWorkerEntrypoint } from "./search-refresh-worker.js";
17
+ export { PM_REPRODUCIBLE_PROCESS_ENV, createReproducibleProcessRunner, resolveReproducibleProcessEnvironment, runWithReproducibleProcessEnvironment, } from "./reproducibility/process.js";
17
18
  export { PM_WORKSPACE_RECIPE_SCHEMA, defineWorkspaceRecipe, executeWorkspaceRecipe, runWithWorkspaceRecipe, } from "./workspace-recipe.js";
18
19
  export { SNAPSHOT_SCHEMA, WORKSPACE_SNAPSHOT_ACTIONS, createWorkspaceSnapshot, deleteWorkspaceSnapshot, inspectWorkspaceSnapshot, listWorkspaceSnapshots, planWorkspaceSnapshotRestore, restoreWorkspaceSnapshot, restoreWorkspaceSnapshotWithRecovery, } from "./workspace-snapshot.js";
19
20
  export { flushTelemetryQueue } from "./telemetry-flush.js";
@@ -48,6 +49,7 @@ export { discoverNearbyPmRoot } from "./tracker-root-discovery.js";
48
49
  export { assertInitializedTracker, assertReadableTrackerRoot, buildTrackerInitializationRecovery, } from "./environment/tracker-preflight.js";
49
50
  export { _testOnly as _testOnlyTemplates, } from "./templates.js";
50
51
  export { runConfig, _testOnlyConfigCommand, } from "./config.js";
52
+ export * from "./agent/identity-config.js";
51
53
  export { INIT_AGENT_GUIDANCE_MODE_VALUES, runInitAgentGuidance, _testOnly as _testOnlyInitAgentGuidance, } from "./init-agent-guidance.js";
52
54
  export { runInit, summarizeInitResult, _testOnly as _testOnlyInit, } from "./init.js";
53
55
  export { PROFILE_SUBCOMMANDS, formatProfileApplyHuman, formatProfileLintHuman, formatProfileListHuman, formatProfileShowHuman, runProfileApply, runProfileLint, runProfileList, runProfileShow, } from "./profile.js";
@@ -121,6 +123,8 @@ export * from "./generated-error-code-catalog.js";
121
123
  export * from "./agent/refusal-reachability.js";
122
124
  export * from "./agent/refusal-closure.js";
123
125
  export * from "./agent/closed-domain-contracts.js";
126
+ export * from "./agent/refusal-corpus-contracts.js";
127
+ export { MERGE_SUBCOMMAND_VALUES } from "./cli-contracts.js";
124
128
  export * from "./agent/tracker-preflight-contracts.js";
125
129
  export * from "./agent/subcommand-recovery.js";
126
130
  export * from "./flag-invocation-contracts.js";
@@ -150,7 +154,8 @@ export { runTelemetry, TELEMETRY_SUBCOMMANDS, } from "./telemetry.js";
150
154
  export { classifyLinkedTestFailure, countFailureCategories, extractReferencedPmItemIdsFromCommand, resolveLinkedTestFailureExitCode, runLinkedTests, runTest, summarizeContextPreflight, } from "./test/execution.js";
151
155
  export { TEST_RUN_MEASUREMENT_LIMIT, diffTestRunMeasurements, parseTestRunMeasurements, queryTestRunMeasurementsBelow, } from "./test/measurements.js";
152
156
  export { runTestAll, } from "./test/batch.js";
153
- export { LINKED_TEST_ENV_NAME_PATTERN, LINKED_TEST_PM_CONTEXT_MODE_VALUES, LINKED_TEST_PROTECTED_ENV_KEYS, parseLinkedTestAssertionEqualsMap, parseLinkedTestAssertionGteMap, parseLinkedTestBoolean, parseLinkedTestContextMode, parseLinkedTestEnvClear, parseLinkedTestEnvSet, parseLinkedTestJsonEntries, parseLinkedTestMinLines, parseLinkedTestRegexList, parseLinkedTestStringList, } from "./test/parsers.js";
157
+ export { LINKED_TEST_ENV_NAME_PATTERN, LINKED_TEST_PM_CONTEXT_MODE_VALUES, LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES, LINKED_TEST_PROTECTED_ENV_KEYS, parseLinkedTestAssertionEqualsMap, parseLinkedTestAssertionGteMap, parseLinkedTestBoolean, parseLinkedTestContextMode, parseLinkedTestEnvClear, parseLinkedTestEnvSet, parseLinkedTestJsonEntries, parseLinkedTestMinLines, parseLinkedTestRegexList, parseLinkedTestStringList, parseLinkedTestWorkspaceContextMode, } from "./test/parsers.js";
158
+ export { acknowledgeLinkedTests, attachLinkedTestMutationProvenance, attachLinkedTestProvenance, linkedTestTrustFingerprint, resolveLinkedTestSourceRef, resolveLinkedTestSourceWorkspaceRoot, resolveLinkedTestTrust, resolveLinkedTestTrustBatch, } from "./test/trust.js";
154
159
  export { runStartBackgroundRun, runTestRunsWorker, } from "./test/runs.js";
155
160
  export { BUILTIN_PROFILES, listProfiles, normalizeProfileName, PROFILE_NAMES, resolveProfile, } from "../core/profile/profile-presets.js";
156
161
  export { planProfileApplication, } from "../core/profile/profile-plan.js";
@@ -161,4 +166,4 @@ export * from "./governance.js";
161
166
  export * from "./query.js";
162
167
  export * from "./testing.js";
163
168
  //# sourceMappingURL=index.js.map
164
- //# debugId=483445af-d102-5b49-9b45-8452f8e48ea8
169
+ //# debugId=714cb108-a51f-5f77-b628-dc994e659f45
@@ -4,7 +4,7 @@
4
4
  * Implements the pm create 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]="4dff80ab-acfc-5f81-a546-3f19629d97be")}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]="f8c8e154-737b-58db-9a8b-7f4399342e83")}catch(e){}}();
8
8
  import { assertInitializedTracker } from "../environment/tracker-preflight.js";
9
9
  import { removeFileIfExists, writeFileAtomic, appendHistoryEntry, createHistoryEntry, generateItemId, normalizeItemId, canonicalDocument, normalizeItemMetadata, serializeItemDocument, assertParentReferenceIsNotSelf, isPlaceholderReferenceToken, normalizeParentReferenceValue, validateMissingParentReference, validateSprintOrReleaseValue, assertNoUnknownCsvKeys, createStdinTokenResolver, looksLikeGenericKeyValueEntry, mergeAdditiveTags, parseCsvKv, parseOptionalNonNegativeInteger, parseOptionalNumber, parseTags, resolvePriority, getFocusedItem, normalizeStatusInput, isTerminalStatus, canonicalizeCommandOptionKey, commandOptionFlagLabel, resolveItemTypeRegistry, resolveCommandOptionPolicyState, resolveTypeDefinition, resolveTypeName, validateTypeOptions, acquireLock, printError, buildInvalidTypeError, resolveTypeSynonym, collectRuntimeCreateFieldValues, resolveItemTypesFilePath, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, EXIT_CODE, ITEM_METADATA_KEY_ORDER, PmCliError, nowIso, resolveIsoOrRelative, getActiveExtensionRegistrations, projectAfterCommandItemSnapshot, recordAfterCommandAffectedItem, runActiveCommandHandler, runActiveBeforeMutationHooks, runActiveOnWriteHooks, collectRegisteredItemFieldNames, applyRegisteredItemFieldDefaultsAndValidation, parseRegisteredItemFieldAssignments, listAllItemMetadataLight, locateItem, createMutationGuardSdk, getHistoryPath, getItemPath, resolvePmRoot, readSettings, resolveAuthor, } from "../runtime-primitives.js";
10
10
  import { requireTerminalReasonWithRecovery } from "../lifecycle-policy.js";
@@ -17,8 +17,9 @@ import { acquireHierarchyMutationLock } from "./hierarchy-mutation-lock.js";
17
17
  import { normalizeRiskInput, normalizeSeverityInput, parseConfidenceInput, parseRegressionInput, } from "./metadata-normalizers.js";
18
18
  import { applyLegacyNoneCollectionNormalizers, createLegacyNoneCollectionNormalizers, assertNoLegacyNoneToken, assertNoLegacyNoneTokens, isLegacyNoneToken, } from "./legacy-none-tokens.js";
19
19
  import { suggestNextLifecycleTransition, } from "./lifecycle-transitions.js";
20
- import { parseLinkedTestAssertionEqualsMap, parseLinkedTestAssertionGteMap, parseLinkedTestBoolean, parseLinkedTestContextMode, parseLinkedTestEnvClear, parseLinkedTestEnvSet, parseLinkedTestMinLines, parseLinkedTestRegexList, parseLinkedTestStringList, } from "../test/parsers.js";
20
+ import { parseLinkedTestAssertionEqualsMap, parseLinkedTestAssertionGteMap, parseLinkedTestBoolean, parseLinkedTestContextMode, parseLinkedTestEnvClear, parseLinkedTestEnvSet, parseLinkedTestMinLines, parseLinkedTestRegexList, parseLinkedTestStringList, parseLinkedTestWorkspaceContextMode, } from "../test/parsers.js";
21
21
  import { looksLikeStructuredLinkedTestEntry, normalizeStructuredLinkedTestEntry, } from "../test/entry.js";
22
+ import { attachLinkedTestMutationProvenance } from "../test/trust.js";
22
23
  import { COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR, COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_AUTHOR, parseCommandUnsetTargets, resolveRuntimeUnsetFieldDefinition, } from "./shared-unset-fields.js";
23
24
  import { ensureEnumValue } from "./recurrence-parsers.js";
24
25
  import { assertDependencyEdgesAllowed, assertDependencyTargetsResolvable, assertValidBareDependencyFlagValue, } from "../dependency-flag-validation.js";
@@ -327,6 +328,7 @@ export function parseTests(raw) {
327
328
  ? parseOptionalNumber(timeoutRaw, "timeout_seconds")
328
329
  : undefined,
329
330
  pm_context_mode: parseLinkedTestContextMode(kv.pm_context_mode, "--test"),
331
+ workspace_context_mode: parseLinkedTestWorkspaceContextMode(kv.workspace_context_mode, "--test"),
330
332
  env_set: parseLinkedTestEnvSet(kv.env_set, "--test"),
331
333
  env_clear: parseLinkedTestEnvClear(kv.env_clear, "--test"),
332
334
  shared_host_safe: parseLinkedTestBoolean(kv.shared_host_safe, "--test", "shared_host_safe"),
@@ -1605,6 +1607,7 @@ export async function runCreate(options, global) {
1605
1607
  const learnings = parseLogSeed("--learning", resolvedOptions.learning, nowValue, author);
1606
1608
  const files = parseFiles(resolvedOptions.file);
1607
1609
  const tests = parseTests(resolvedOptions.test);
1610
+ tests.values = await attachLinkedTestMutationProvenance(tests.values, author, nowValue);
1608
1611
  const docs = parseDocs(resolvedOptions.doc);
1609
1612
  const reminders = parseReminders(resolvedOptions.reminder, nowValue);
1610
1613
  const events = parseEvents(resolvedOptions.event, nowValue);
@@ -1915,4 +1918,4 @@ export const _testOnlyCreateCommand = {
1915
1918
  typeOptionExampleValue,
1916
1919
  };
1917
1920
  //# sourceMappingURL=create.js.map
1918
- //# debugId=4dff80ab-acfc-5f81-a546-3f19629d97be
1921
+ //# debugId=f8c8e154-737b-58db-9a8b-7f4399342e83
@@ -4,7 +4,7 @@
4
4
  * Implements the pm update 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]="7c1729f8-4a67-5746-a1bf-351f862ceb66")}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]="c88f01be-6abe-5fa2-9792-3f54e61bb282")}catch(e){}}();
8
8
  import { assertInitializedTracker } from "../environment/tracker-preflight.js";
9
9
  import { COMMON_MUTATION_COMMAND_OPTION_KEYS, canonicalizeCommandOptionKey, commandOptionFlagLabel, resolveItemTypeRegistry, resolveCommandOptionPolicyState, resolveTypeDefinition, resolveTypeName, validateTypeOptions, normalizeItemId, toItemRecord, buildInvalidTypeError, assertParentReferenceIsNotSelf, normalizeParentReferenceValue, validateMissingParentReference, validateSprintOrReleaseValue, applyAcceptanceCriteriaMutations, applyTagRemovals, assertNoUnknownCsvKeys, createStdinTokenResolver, looksLikeGenericKeyValueEntry, mergeAdditiveTags, parseCsvKv, parseOptionalNonNegativeInteger, parseOptionalNumber, parseTags, splitAcceptanceCriteria, resolvePriority, normalizeStatusInput, isTerminalStatus, collectRuntimeUpdateFieldValues, resolveItemTypesFilePath, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, describeAllowedTransitions, evaluateTransition, resolveTypeWorkflows, EXIT_CODE, PmCliError, stableValueEquals, resolveIsoOrRelative, getActiveExtensionRegistrations, collectRegisteredItemFieldNames, applyRegisteredItemFieldDefaultsAndValidation, parseRegisteredItemFieldAssignments, buildItemNotFoundError, listAllItemMetadataLight, locateItem, readLocatedItem, resolvePmRoot, readSettings, resolveAuthor, } from "../runtime-primitives.js";
10
10
  import { mutateItemWithHistoryContextResolver } from "../../core/store/item-store.js";
@@ -22,6 +22,7 @@ import { resolveWorkspaceRelationshipKindRegistry } from "../graph/assembly.js";
22
22
  import { acquireHierarchyMutationLock } from "./hierarchy-mutation-lock.js";
23
23
  import { DEPENDENCY_KIND_VALUES, ISSUE_SEVERITY_VALUES, RISK_VALUES, } from "../../types/index.js";
24
24
  import { parseDocs, parseFiles, parseLogSeed, parseTests, requireStringOption, } from "./create.js";
25
+ import { attachLinkedTestMutationProvenance } from "../test/trust.js";
25
26
  import { COMMON_UNSET_FIELD_DEFINITIONS_AFTER_CLOSE_REASON_BEFORE_AUTHOR, COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR, COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_CLOSE_REASON, parseCommandUnsetTargets, resolveRuntimeUnsetFieldDefinition, } from "./shared-unset-fields.js";
26
27
  const UPDATE_UNSET_FIELD_DEFINITIONS = [
27
28
  ...COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_CLOSE_REASON,
@@ -590,7 +591,7 @@ function docKey(value) {
590
591
  return `${value.path}::${value.scope}`;
591
592
  }
592
593
  function testKey(value) {
593
- return `${value.command}::${value.path ?? ""}::${value.scope}::${value.pm_context_mode ?? ""}`;
594
+ return `${value.command}::${value.path ?? ""}::${value.scope}::${value.pm_context_mode ?? ""}::${value.workspace_context_mode ?? ""}`;
594
595
  }
595
596
  function matchesDependencySelector(value, selector) {
596
597
  if (value.id.trim().toLowerCase() !== selector.id.trim().toLowerCase()) {
@@ -1871,6 +1872,7 @@ async function runUpdateWithContext(id, options, global, execution = {}) {
1871
1872
  const learningUpdates = parseLogSeed("--learning", options.learning, nowIso, author);
1872
1873
  const fileUpdates = parseFiles(options.file);
1873
1874
  const testUpdates = parseTests(options.test);
1875
+ testUpdates.values = await attachLinkedTestMutationProvenance(testUpdates.values, author, nowIso);
1874
1876
  const docUpdates = parseDocs(options.doc);
1875
1877
  const workflowTransitionWarnings = [];
1876
1878
  const parentReference = await resolveParentReferenceForUpdate({
@@ -2109,4 +2111,4 @@ export const _testOnlyUpdateCommand = {
2109
2111
  resolveRuntimeUnsetDefinition: (token, registry) => resolveRuntimeUnsetFieldDefinition(token, "update", registry),
2110
2112
  };
2111
2113
  //# sourceMappingURL=update.js.map
2112
- //# debugId=7c1729f8-4a67-5746-a1bf-351f862ceb66
2114
+ //# debugId=c88f01be-6abe-5fa2-9792-3f54e61bb282