@unbrained/pm-cli 2026.8.21 → 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 (228) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +44 -0
  3. package/dist/cli/error-guidance.d.ts +22 -4
  4. package/dist/cli/error-guidance.js +73 -16
  5. package/dist/cli/main.d.ts +3 -0
  6. package/dist/cli/main.js +51 -9
  7. package/dist/cli/register-mutation.js +6 -6
  8. package/dist/cli/register-operations.d.ts +73 -0
  9. package/dist/cli/register-operations.js +39 -14
  10. package/dist/cli/register-setup.js +3 -3
  11. package/dist/cli/schema-registration-helpers.d.ts +8 -1
  12. package/dist/cli/schema-registration-helpers.js +14 -5
  13. package/dist/cli-bundle/bundle-manifest.json +149 -149
  14. package/dist/cli-bundle/chunks/chunk-3ENVHX6C.js +36 -0
  15. package/dist/cli-bundle/chunks/{chunk-LOVTQ52Z.js → chunk-DW2CGEMU.js} +2 -2
  16. package/dist/cli-bundle/chunks/chunk-EG6CLDZT.js +5 -0
  17. package/dist/cli-bundle/chunks/{chunk-LARJJ3RK.js → chunk-F3AI2JFL.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-N3DSV4CH.js → chunk-HWZ6CELB.js} +8 -8
  19. package/dist/cli-bundle/chunks/chunk-HZBMLSZI.js +201 -0
  20. package/dist/cli-bundle/chunks/chunk-JB4KZWBF.js +3 -0
  21. package/dist/cli-bundle/chunks/chunk-KPH73XXJ.js +2 -0
  22. package/dist/cli-bundle/chunks/{chunk-BKYB45NQ.js → chunk-KXPMB2YL.js} +50 -50
  23. package/dist/cli-bundle/chunks/{chunk-BUNIEJNE.js → chunk-QDVHNHAQ.js} +2 -2
  24. package/dist/cli-bundle/chunks/chunk-TFI5V5N2.js +13 -0
  25. package/dist/cli-bundle/chunks/{register-list-query-F57EWDEF.js → register-list-query-UJB5FMV2.js} +2 -2
  26. package/dist/cli-bundle/chunks/register-mutation-NX5XE4VX.js +20 -0
  27. package/dist/cli-bundle/chunks/register-operations-RXIJIYXC.js +2 -0
  28. package/dist/cli-bundle/chunks/{register-setup-HXU7IZZD.js → register-setup-GFUZEKRE.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/{chunk-F4YEW5I2.js → chunk-37Z4OEAP.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/chunk-3UPTYG44.js +8 -0
  31. package/dist/cli-bundle/focused-chunks/chunk-5S7E72FY.js +16 -0
  32. package/dist/cli-bundle/focused-chunks/{chunk-4ERLO7QD.js → chunk-AUFH5H35.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/chunk-E7X25GC3.js +2 -0
  34. package/dist/cli-bundle/focused-chunks/chunk-FQCSTBWE.js +4 -0
  35. package/dist/cli-bundle/focused-chunks/{chunk-FH6DYED3.js → chunk-FZS4H32O.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/chunk-IFLWKY2R.js +156 -0
  37. package/dist/cli-bundle/focused-chunks/{chunk-YKBKIEAJ.js → chunk-JOWDB2MH.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/chunk-LYVSW5VM.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/chunk-MRCNF3U6.js +2 -0
  40. package/dist/cli-bundle/focused-chunks/{chunk-UZE7XUZK.js → chunk-OFVUGTLJ.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/{chunk-FJ22HNRP.js → chunk-OGLQBL46.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/chunk-OY7QAV4Y.js +51 -0
  43. package/dist/cli-bundle/focused-chunks/chunk-QGFNI65N.js +26 -0
  44. package/dist/cli-bundle/focused-chunks/{chunk-KDNG7TKQ.js → chunk-R27IDGHD.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/chunk-UYRFYCDQ.js +5 -0
  46. package/dist/cli-bundle/focused-chunks/{chunk-2NIY5NKG.js → chunk-ZHVA42R5.js} +9 -9
  47. package/dist/cli-bundle/main.js +13 -13
  48. package/dist/cli-bundle/sdk-authoring.js +1 -1
  49. package/dist/cli-bundle/sdk-contracts.js +2 -2
  50. package/dist/cli-bundle/sdk-core.js +40 -40
  51. package/dist/cli-bundle/sdk-governance.js +1 -1
  52. package/dist/cli-bundle/sdk-graph.js +1 -1
  53. package/dist/cli-bundle/sdk-merge.js +33 -32
  54. package/dist/cli-bundle/sdk-query.js +1 -1
  55. package/dist/cli-bundle/sdk-runtime.js +1 -1
  56. package/dist/cli-bundle/sdk-testing.js +1 -1
  57. package/dist/cli-bundle/sdk.js +5 -5
  58. package/dist/core/config/nested-settings.js +8 -2
  59. package/dist/core/config/positional-value.d.ts +1 -1
  60. package/dist/core/config/positional-value.js +5 -2
  61. package/dist/core/extensions/extension-hook-runtime.js +22 -20
  62. package/dist/core/extensions/extension-types.d.ts +8 -1
  63. package/dist/core/extensions/extension-types.js +2 -2
  64. package/dist/core/extensions/loader.js +7 -3
  65. package/dist/core/extensions/service-ownership.d.ts +8 -0
  66. package/dist/core/extensions/service-ownership.js +20 -0
  67. package/dist/core/history/history.js +3 -3
  68. package/dist/core/item/id.js +20 -5
  69. package/dist/core/item/item-format.js +81 -2
  70. package/dist/core/reproducibility/context.d.ts +4 -0
  71. package/dist/core/reproducibility/context.js +14 -8
  72. package/dist/core/shared/author.d.ts +55 -1
  73. package/dist/core/shared/author.js +333 -16
  74. package/dist/core/shared/constants.js +3 -2
  75. package/dist/core/shared/errors.d.ts +4 -0
  76. package/dist/core/shared/errors.js +2 -2
  77. package/dist/core/store/settings-validator.d.ts +1 -0
  78. package/dist/core/store/settings-validator.js +6 -3
  79. package/dist/core/store/settings.js +5 -2
  80. package/dist/mcp/server.d.ts +1 -1
  81. package/dist/mcp/server.js +30 -9
  82. package/dist/sdk/agent/identity-config.d.ts +63 -0
  83. package/dist/sdk/agent/identity-config.js +107 -0
  84. package/dist/sdk/agent/refusal-corpus-contracts.d.ts +76 -0
  85. package/dist/sdk/agent/refusal-corpus-contracts.js +194 -0
  86. package/dist/sdk/agent/refusal-reachability.d.ts +1 -1
  87. package/dist/sdk/authoring.d.ts +1 -1
  88. package/dist/sdk/authoring.js +2 -2
  89. package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +77 -0
  90. package/dist/sdk/cli-contracts/agent-output-contracts.js +326 -2
  91. package/dist/sdk/cli-contracts/commander-mutation-options.js +3 -3
  92. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -0
  93. package/dist/sdk/cli-contracts/enum-contracts.js +9 -2
  94. package/dist/sdk/cli-contracts/flag-contracts.js +9 -2
  95. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +4 -4
  96. package/dist/sdk/cli-contracts/registration-helpers.js +5 -2
  97. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +3 -1
  98. package/dist/sdk/cli-contracts/runtime-contracts.js +4 -3
  99. package/dist/sdk/cli-contracts/tool-parameter-tables.js +22 -2
  100. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  101. package/dist/sdk/cli-contracts/tool-schema.js +14 -3
  102. package/dist/sdk/cli-contracts.d.ts +4 -4
  103. package/dist/sdk/cli-contracts.js +5 -5
  104. package/dist/sdk/config.d.ts +6 -1
  105. package/dist/sdk/config.js +119 -14
  106. package/dist/sdk/context-intent-contracts.js +4 -2
  107. package/dist/sdk/core-governance.d.ts +1 -1
  108. package/dist/sdk/core-governance.js +3 -3
  109. package/dist/sdk/extension/install-sources.d.ts +1 -1
  110. package/dist/sdk/extension/install-sources.js +6 -3
  111. package/dist/sdk/extension/output-ownership.d.ts +1 -0
  112. package/dist/sdk/extension/output-ownership.js +3 -2
  113. package/dist/sdk/extension/scaffold.js +11 -5
  114. package/dist/sdk/flag-invocation-contracts.js +4 -2
  115. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +74 -2
  116. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +87 -26
  117. package/dist/sdk/governance/assurance-action.js +30 -10
  118. package/dist/sdk/governance/health.d.ts +3 -0
  119. package/dist/sdk/governance/health.js +39 -7
  120. package/dist/sdk/governance/hierarchy-validation.d.ts +29 -0
  121. package/dist/sdk/governance/hierarchy-validation.js +109 -0
  122. package/dist/sdk/governance/validate.d.ts +3 -9
  123. package/dist/sdk/governance/validate.js +84 -111
  124. package/dist/sdk/graph/assembly.d.ts +6 -1
  125. package/dist/sdk/graph/assembly.js +16 -22
  126. package/dist/sdk/graph/governance-contracts.d.ts +1 -1
  127. package/dist/sdk/graph/governance-contracts.js +8 -2
  128. package/dist/sdk/graph/governance.js +46 -2
  129. package/dist/sdk/graph/hierarchy-integrity.d.ts +94 -0
  130. package/dist/sdk/graph/hierarchy-integrity.js +311 -0
  131. package/dist/sdk/graph/index.d.ts +2 -1
  132. package/dist/sdk/graph/index.js +3 -2
  133. package/dist/sdk/graph/remediation.js +32 -2
  134. package/dist/sdk/graph/run.d.ts +31 -2
  135. package/dist/sdk/graph/run.js +80 -31
  136. package/dist/sdk/graph/workspace-relationship-kind-registry.d.ts +8 -0
  137. package/dist/sdk/graph/workspace-relationship-kind-registry.js +28 -0
  138. package/dist/sdk/index.d.ts +8 -3
  139. package/dist/sdk/index.js +9 -4
  140. package/dist/sdk/item-children.js +21 -8
  141. package/dist/sdk/lifecycle/create.js +129 -97
  142. package/dist/sdk/lifecycle/hierarchy-mutation-lock.d.ts +15 -0
  143. package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +25 -0
  144. package/dist/sdk/lifecycle/update.d.ts +2 -0
  145. package/dist/sdk/lifecycle/update.js +174 -84
  146. package/dist/sdk/merge/three-way.js +105 -26
  147. package/dist/sdk/query/complete-list.d.ts +3 -3
  148. package/dist/sdk/query/complete-list.js +46 -3
  149. package/dist/sdk/query/list.d.ts +4 -3
  150. package/dist/sdk/query/list.js +89 -49
  151. package/dist/sdk/read-output-budget.d.ts +21 -0
  152. package/dist/sdk/read-output-budget.js +39 -2
  153. package/dist/sdk/read-output-contracts.d.ts +10 -4
  154. package/dist/sdk/read-output-contracts.js +105 -32
  155. package/dist/sdk/relationship-context.js +3 -4
  156. package/dist/sdk/relationships.js +17 -10
  157. package/dist/sdk/reproducibility/process.d.ts +19 -0
  158. package/dist/sdk/reproducibility/process.js +88 -0
  159. package/dist/sdk/runtime-primitives.d.ts +1 -1
  160. package/dist/sdk/runtime-primitives.js +3 -3
  161. package/dist/sdk/runtime.d.ts +3 -2
  162. package/dist/sdk/runtime.js +7 -5
  163. package/dist/sdk/test/batch.d.ts +6 -0
  164. package/dist/sdk/test/batch.js +26 -6
  165. package/dist/sdk/test/entry.d.ts +1 -1
  166. package/dist/sdk/test/entry.js +3 -2
  167. package/dist/sdk/test/execution.d.ts +28 -3
  168. package/dist/sdk/test/execution.js +201 -34
  169. package/dist/sdk/test/parsers.d.ts +6 -0
  170. package/dist/sdk/test/parsers.js +21 -2
  171. package/dist/sdk/test/trust.d.ts +33 -0
  172. package/dist/sdk/test/trust.js +207 -0
  173. package/dist/types.d.ts +34 -0
  174. package/dist/types.js +2 -2
  175. package/docs/AGENT_PROVENANCE_ADR.md +41 -5
  176. package/docs/AGENT_UX_CONTRACTS.md +20 -4
  177. package/docs/COMMANDS.md +29 -14
  178. package/docs/CONFIGURATION.md +4 -0
  179. package/docs/DEPENDENCY_KIND_CONTRACT.md +31 -3
  180. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +115 -0
  181. package/docs/EXTENSIONS.md +2 -1
  182. package/docs/MERGE_SAFETY.md +15 -1
  183. package/docs/README.md +1 -0
  184. package/docs/READ_OUTPUT_CONTRACTS.md +19 -2
  185. package/docs/RELATIONSHIP_GRAPH.md +6 -3
  186. package/docs/REPRODUCIBLE_WORKSPACES.md +42 -8
  187. package/docs/SDK.md +9 -0
  188. package/docs/SDK_AGENT_SESSION_CONTEXT.md +6 -4
  189. package/docs/SDK_EVIDENCE_TRACEABILITY.md +1 -1
  190. package/docs/TESTING.md +83 -1
  191. package/docs/agent-task-token-baseline.json +2 -2
  192. package/docs/generated/FLAG_LEXICON_BUDGETS.md +2 -2
  193. package/marketplace.json +2 -2
  194. package/package.json +2 -2
  195. package/packages/pm-beads/package.json +1 -1
  196. package/packages/pm-calendar/package.json +1 -1
  197. package/packages/pm-command-kit/package.json +1 -1
  198. package/packages/pm-digital-twin/package.json +1 -1
  199. package/packages/pm-governance-audit/package.json +1 -1
  200. package/packages/pm-guide-shell/package.json +1 -1
  201. package/packages/pm-kanban/package.json +1 -1
  202. package/packages/pm-lifecycle-hooks/package.json +1 -1
  203. package/packages/pm-linked-test-adapters/package.json +1 -1
  204. package/packages/pm-search-advanced/package.json +1 -1
  205. package/packages/pm-templates/package.json +1 -1
  206. package/packages/pm-todos/package.json +1 -1
  207. package/packages/pm-vcs/package.json +1 -1
  208. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  209. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  210. package/sdk/public-surface.json +1021 -53
  211. package/dist/cli-bundle/chunks/chunk-2MA6ZQVZ.js +0 -197
  212. package/dist/cli-bundle/chunks/chunk-3AFAUHUE.js +0 -2
  213. package/dist/cli-bundle/chunks/chunk-7VHZS727.js +0 -5
  214. package/dist/cli-bundle/chunks/chunk-JSLOFXGA.js +0 -3
  215. package/dist/cli-bundle/chunks/chunk-OCLPLFAY.js +0 -35
  216. package/dist/cli-bundle/chunks/chunk-S4IRYKBU.js +0 -13
  217. package/dist/cli-bundle/chunks/register-mutation-7IY2D5KO.js +0 -20
  218. package/dist/cli-bundle/chunks/register-operations-FALL3YTU.js +0 -2
  219. package/dist/cli-bundle/focused-chunks/chunk-7WZRLCYF.js +0 -50
  220. package/dist/cli-bundle/focused-chunks/chunk-CKKQSJNN.js +0 -2
  221. package/dist/cli-bundle/focused-chunks/chunk-EEFKYMDR.js +0 -16
  222. package/dist/cli-bundle/focused-chunks/chunk-F2A56DHV.js +0 -8
  223. package/dist/cli-bundle/focused-chunks/chunk-FV5ACOK7.js +0 -2
  224. package/dist/cli-bundle/focused-chunks/chunk-JEAVFOWM.js +0 -2
  225. package/dist/cli-bundle/focused-chunks/chunk-NJ63LOP6.js +0 -155
  226. package/dist/cli-bundle/focused-chunks/chunk-NXRTQ7HI.js +0 -2
  227. package/dist/cli-bundle/focused-chunks/chunk-TJ7EMJ46.js +0 -4
  228. package/dist/cli-bundle/focused-chunks/chunk-ZOSEELYJ.js +0 -26
@@ -4,7 +4,7 @@
4
4
  * Implements the pm test all 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]="aeb0a1a7-bc73-5c56-bbed-9472c651b5f6")}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]="5d3405c0-14e6-51f5-97a1-355438fd0199")}catch(e){}}();
8
8
  import { assertInitializedTracker } from "../environment/tracker-preflight.js";
9
9
  import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
10
10
  import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
@@ -15,7 +15,7 @@ import { EXIT_CODE } from "../../core/shared/constants.js";
15
15
  import { PmCliError } from "../../core/shared/errors.js";
16
16
  import { nowIso } from "../../core/shared/time.js";
17
17
  import { listAllItemMetadataLight } from "../../core/store/item-store.js";
18
- import { resolveGlobalPmRoot, resolvePmRoot, } from "../../core/store/paths.js";
18
+ import { resolveGlobalPmRoot, resolvePmRoot } from "../../core/store/paths.js";
19
19
  import { readSettings } from "../../core/store/settings.js";
20
20
  import { appendTrackedTestRunSummary } from "../../core/test/item-test-run-tracking.js";
21
21
  import { resolveAuthor } from "../../core/shared/author.js";
@@ -80,6 +80,10 @@ const normalizePmContextModeSignature = (value) => {
80
80
  const normalized = value?.trim().toLowerCase();
81
81
  return normalized && normalized.length > 0 ? normalized : "none";
82
82
  };
83
+ const normalizeWorkspaceContextModeSignature = (value) => {
84
+ const normalized = value?.trim().toLowerCase();
85
+ return normalized && normalized.length > 0 ? normalized : "source";
86
+ };
83
87
  /** Sorts and deduplicates optional assertion string lists. */
84
88
  const normalizeAssertionStrings = (values) => [...new Set(values ?? [])].sort((left, right) => left.localeCompare(right));
85
89
  /** Sorts optional assertion maps into deterministic key order. */
@@ -110,9 +114,10 @@ const buildLinkedTestKey = (test) => {
110
114
  const envSet = normalizeEnvSetSignature(test.env_set);
111
115
  const envClear = normalizeEnvClearSignature(test.env_clear);
112
116
  const pmContextMode = normalizePmContextModeSignature(test.pm_context_mode);
117
+ const workspaceContextMode = normalizeWorkspaceContextModeSignature(test.workspace_context_mode);
113
118
  const sharedHostSafe = test.shared_host_safe === true ? "true" : "false";
114
119
  const assertions = normalizeAssertionSignature(test);
115
- return `${resolveLinkedTestTargetSignature(test)}:${envSet}:${envClear}:${pmContextMode}:${sharedHostSafe}:${assertions}`;
120
+ return `${resolveLinkedTestTargetSignature(test)}:${envSet}:${envClear}:${pmContextMode}:${workspaceContextMode}:${sharedHostSafe}:${assertions}`;
116
121
  };
117
122
  const maxTimeoutSeconds = (current, candidate) => {
118
123
  if (candidate === undefined) {
@@ -227,6 +232,11 @@ const runTestAllItem = async (entry, context) => {
227
232
  requireAssertionsForPm: context.options.requireAssertionsForPm,
228
233
  checkContext: context.options.checkContext,
229
234
  autoPmContext: context.options.autoPmContext,
235
+ workspaceContext: context.options.workspaceContext,
236
+ overrideLinkedWorkspaceContext: context.options.overrideLinkedWorkspaceContext,
237
+ pmRoot: context.pmRoot,
238
+ allowUntrustedLinkedTests: context.options.allowUntrustedLinkedTests,
239
+ untrustedLinkedTestsPolicyEnabled: context.settings.testing.allow_untrusted_linked_tests,
230
240
  })
231
241
  : [];
232
242
  let executedIndex = 0;
@@ -245,7 +255,7 @@ const runTestAllItem = async (entry, context) => {
245
255
  });
246
256
  const summary = countStatuses(runResults);
247
257
  const failureCategories = countFailureCategories(runResults);
248
- const trackingWarnings = await appendTestAllItemTracking(entry, summary, context);
258
+ const trackingWarnings = await appendTestAllItemTracking(entry, summary, runResults, context);
249
259
  return {
250
260
  passed: summary.passed,
251
261
  failed: summary.failed,
@@ -273,7 +283,7 @@ const trackedRunFailed = (summary, options) => [
273
283
  ].includes(true);
274
284
  /** Projects true flags while keeping false values absent from persisted rows. */
275
285
  const optionalTrue = (value) => value ? true : undefined;
276
- const appendTestAllItemTracking = async (entry, summary, context) => {
286
+ const appendTestAllItemTracking = async (entry, summary, runResults, context) => {
277
287
  if (!context.trackingEnabled) {
278
288
  return [];
279
289
  }
@@ -300,6 +310,16 @@ const appendTestAllItemTracking = async (entry, summary, context) => {
300
310
  items: 1,
301
311
  linked_tests: entry.tests.length,
302
312
  fail_on_skipped_triggered: optionalTrue(context.options.failOnSkipped === true && summary.skipped > 0),
313
+ executions: runResults
314
+ .filter((result) => result.command?.trim())
315
+ .slice(0, 32)
316
+ .map((result) => ({
317
+ command: result.command.trim(),
318
+ requested_pm_context_mode: result.execution_context?.requested_pm_context_mode,
319
+ pm_context_mode: result.execution_context?.pm_context_mode,
320
+ workspace_context_mode: result.execution_context?.workspace_context_mode,
321
+ trust_reason: result.execution_context?.trust.reason,
322
+ })),
303
323
  },
304
324
  });
305
325
  }
@@ -487,4 +507,4 @@ export const _testOnlyTestAll = {
487
507
  formatTrackingError,
488
508
  };
489
509
  //# sourceMappingURL=batch.js.map
490
- //# debugId=aeb0a1a7-bc73-5c56-bbed-9472c651b5f6
510
+ //# debugId=5d3405c0-14e6-51f5-97a1-355438fd0199
@@ -1,5 +1,5 @@
1
1
  /** Public contract for structured linked test keys, shared by SDK and presentation-layer consumers. */
2
- export declare const STRUCTURED_LINKED_TEST_KEYS: readonly ["command", "cmd", "path", "scope", "timeout", "timeout_seconds", "pm_context_mode", "env_set", "env_clear", "shared_host_safe", "assert_stdout_contains", "assert_stdout_regex", "assert_stderr_contains", "assert_stderr_regex", "assert_stdout_min_lines", "assert_json_field_equals", "assert_json_field_gte", "note"];
2
+ export declare const STRUCTURED_LINKED_TEST_KEYS: readonly ["command", "cmd", "path", "scope", "timeout", "timeout_seconds", "pm_context_mode", "workspace_context_mode", "env_set", "env_clear", "shared_host_safe", "assert_stdout_contains", "assert_stdout_regex", "assert_stderr_contains", "assert_stderr_regex", "assert_stdout_min_lines", "assert_json_field_equals", "assert_json_field_gte", "note"];
3
3
  /** Implements looks like structured linked test entry for the public runtime surface of this module. */
4
4
  export declare function looksLikeStructuredLinkedTestEntry(raw: string): boolean;
5
5
  /** Implements normalize structured linked test entry for the public runtime surface of this module. */
@@ -4,7 +4,7 @@
4
4
  * Implements the pm linked test entry 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]="2b20ab37-ffbe-5c65-ac0f-800abf876e16")}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]="44e6a87d-0ca5-53af-b199-b66bb2b98fb5")}catch(e){}}();
8
8
  import { EXIT_CODE } from "../../core/shared/constants.js";
9
9
  import { PmCliError } from "../../core/shared/errors.js";
10
10
  // Keys accepted inside a structured linked-test entry. `cmd` is an alias for
@@ -18,6 +18,7 @@ export const STRUCTURED_LINKED_TEST_KEYS = [
18
18
  "timeout",
19
19
  "timeout_seconds",
20
20
  "pm_context_mode",
21
+ "workspace_context_mode",
21
22
  "env_set",
22
23
  "env_clear",
23
24
  "shared_host_safe",
@@ -71,4 +72,4 @@ export function normalizeStructuredLinkedTestEntry(kv, optionName) {
71
72
  return normalizedKv;
72
73
  }
73
74
  //# sourceMappingURL=entry.js.map
74
- //# debugId=2b20ab37-ffbe-5c65-ac0f-800abf876e16
75
+ //# debugId=44e6a87d-0ca5-53af-b199-b66bb2b98fb5
@@ -1,10 +1,11 @@
1
1
  import type { GlobalOptions } from "../../core/shared/command-types.js";
2
2
  import { resolveAuthor } from "../../core/shared/author.js";
3
3
  import { runInit } from "../init.js";
4
- import { type LinkedTestPmContextMode } from "./parsers.js";
4
+ import { type LinkedTestPmContextMode, type LinkedTestWorkspaceContextMode } from "./parsers.js";
5
5
  import { type LinkedTestRunSelection } from "../../core/test/run-selectors.js";
6
6
  import type { LinkedTest, LinkScope, TestRunMeasurement } from "../../types/index.js";
7
7
  import { type TestRunMeasurementDiff } from "./measurements.js";
8
+ import { type LinkedTestTrustDecision } from "./trust.js";
8
9
  type ResolvedLinkedTestPmContextMode = Exclude<LinkedTestPmContextMode, "auto">;
9
10
  interface LinkedTestExecutionResult {
10
11
  stdout: string;
@@ -61,6 +62,14 @@ export interface TestCommandOptions {
61
62
  pmContext?: string;
62
63
  /** Value that configures or reports override linked pm context for this contract. */
63
64
  overrideLinkedPmContext?: boolean;
65
+ /** Source-workspace visibility and working-directory mode. */
66
+ workspaceContext?: string;
67
+ /** Force the run-level workspace mode over per-test metadata. */
68
+ overrideLinkedWorkspaceContext?: boolean;
69
+ /** Explicitly permit an untrusted linked command when project policy also permits it. */
70
+ allowUntrustedLinkedTests?: boolean;
71
+ /** Record clone-local acknowledgement for the item's current linked tests. */
72
+ acknowledgeLinkedTests?: boolean;
64
73
  /** Value that configures or reports fail on context mismatch for this contract. */
65
74
  failOnContextMismatch?: boolean;
66
75
  /** Value that configures or reports fail on skipped for this contract. */
@@ -87,7 +96,7 @@ export interface TestCommandOptions {
87
96
  metricDiff?: string;
88
97
  }
89
98
  /** Restricts linked test failure category values accepted by command, SDK, and storage contracts. */
90
- export type LinkedTestFailureCategory = "infra_collision" | "assertion_failure" | "empty_run" | "timeout" | "max_buffer" | "spawn_error" | "signal";
99
+ export type LinkedTestFailureCategory = "infra_collision" | "trust_refusal" | "assertion_failure" | "empty_run" | "timeout" | "max_buffer" | "spawn_error" | "signal";
91
100
  /** Documents the test run result payload exchanged by command, SDK, and package integrations. */
92
101
  export interface TestRunResult {
93
102
  /** Value that configures or reports command for this contract. */
@@ -118,6 +127,11 @@ export interface TestRunResult {
118
127
  mismatch_detected: boolean;
119
128
  project_extensions_seeded: boolean;
120
129
  global_extensions_seeded: boolean;
130
+ requested_workspace_context_mode: LinkedTestWorkspaceContextMode;
131
+ workspace_context_mode: LinkedTestWorkspaceContextMode;
132
+ working_directory: string;
133
+ source_workspace_root: string;
134
+ trust: LinkedTestTrustDecision;
121
135
  };
122
136
  /** Value that configures or reports stdout for this contract. */
123
137
  stdout?: string;
@@ -195,7 +209,7 @@ declare function segmentInvokesRecursiveTestAll(segment: string): boolean;
195
209
  declare function parseLinkedTestTimeoutSeconds(timeoutSecondsRaw: string | undefined, timeoutAliasRaw: string | undefined): number | undefined;
196
210
  declare function parseAddJsonEntries(raw: string[] | undefined): LinkedTest[];
197
211
  declare function endLinkedTestProgress(context: LinkedTestProgressContext, executionResult: Pick<LinkedTestExecutionResult, "timedOut" | "maxBufferExceeded" | "outputTruncated" | "exitCode" | "signal">, startedAt: number, mode: LinkedTestProgressMode): void;
198
- declare function runLinkedTestCommand(command: string, timeoutMs: number, env: NodeJS.ProcessEnv, progressContext: LinkedTestProgressContext, progressMode: LinkedTestProgressMode): Promise<LinkedTestExecutionResult>;
212
+ declare function runLinkedTestCommand(command: string, timeoutMs: number, env: NodeJS.ProcessEnv, progressContext: LinkedTestProgressContext, progressMode: LinkedTestProgressMode, cwd?: string): Promise<LinkedTestExecutionResult>;
199
213
  declare function formatLinkedTestExecutionError(result: LinkedTestExecutionResult, timeoutMs: number): string;
200
214
  /** Implements classify linked test failure for the public runtime surface of this module. */
201
215
  export declare function classifyLinkedTestFailure(result: Pick<LinkedTestExecutionResult, "stdout" | "stderr" | "spawnError" | "signal" | "timedOut" | "maxBufferExceeded">): LinkedTestFailureCategory;
@@ -228,6 +242,11 @@ interface RunLinkedTestsOptions {
228
242
  requireAssertionsForPm?: boolean;
229
243
  checkContext?: boolean;
230
244
  autoPmContext?: boolean;
245
+ workspaceContext?: string;
246
+ overrideLinkedWorkspaceContext?: boolean;
247
+ pmRoot?: string;
248
+ allowUntrustedLinkedTests?: boolean;
249
+ untrustedLinkedTestsPolicyEnabled?: boolean;
231
250
  }
232
251
  interface LinkedTestSandboxLayout {
233
252
  root: string;
@@ -235,6 +254,8 @@ interface LinkedTestSandboxLayout {
235
254
  schemaGlobalPmPath: string;
236
255
  trackerProjectPmPath: string;
237
256
  trackerGlobalPmPath: string;
257
+ workspaceSnapshotRoot: string;
258
+ workspaceIsolatedRoot: string;
238
259
  }
239
260
  interface LinkedTestSandboxCounts {
240
261
  sourceProjectItemCount: number;
@@ -255,6 +276,10 @@ declare function buildLinkedTestExecutionContext(params: {
255
276
  requestedPmContextMode: LinkedTestPmContextMode;
256
277
  effectivePmContextMode: ResolvedLinkedTestPmContextMode;
257
278
  autoPmContextApplied: boolean;
279
+ requestedWorkspaceContextMode: LinkedTestWorkspaceContextMode;
280
+ workspaceContextMode: LinkedTestWorkspaceContextMode;
281
+ sourceWorkspaceRoot: string;
282
+ trust: LinkedTestTrustDecision;
258
283
  }): NonNullable<TestRunResult["execution_context"]>;
259
284
  /** Implements run linked tests for the public runtime surface of this module. */
260
285
  export declare function runLinkedTests(tests: LinkedTest[], defaultTimeoutSeconds: number | undefined, options?: RunLinkedTestsOptions): Promise<TestRunResult[]>;