@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
@@ -24,7 +24,7 @@
24
24
  */
25
25
  /** Search/provider/vector-store leaves. Order is the display order in `pm config list` and in error hints. */
26
26
 
27
- !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]="be95f220-5f66-5e8c-8447-996696d02e43")}catch(e){}}();
27
+ !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]="4e50d57b-4502-5ce5-a6dd-0bdc8eba5af4")}catch(e){}}();
28
28
  export const NESTED_SETTING_DESCRIPTORS = [
29
29
  {
30
30
  key: "search_provider",
@@ -207,6 +207,12 @@ export const NESTED_SETTING_DESCRIPTORS = [
207
207
  non_empty: true,
208
208
  summary: "Default author recorded on mutations when --author is not supplied.",
209
209
  },
210
+ {
211
+ key: "agent_identity_probes_enabled",
212
+ path: "agent_identity.probes_enabled",
213
+ kind: "boolean",
214
+ summary: "Allow privacy-bounded local harness provenance probes; no network or subprocess access is permitted.",
215
+ },
210
216
  {
211
217
  key: "mutation_guard_require_attributed_author",
212
218
  path: "mutation_guard.require_attributed_author",
@@ -526,4 +532,4 @@ export function writeNestedSettingValue(settings, descriptor, value) {
526
532
  return true;
527
533
  }
528
534
  //# sourceMappingURL=nested-settings.js.map
529
- //# debugId=be95f220-5f66-5e8c-8447-996696d02e43
535
+ //# debugId=4e50d57b-4502-5ce5-a6dd-0bdc8eba5af4
@@ -41,7 +41,7 @@ export interface ConfigPositionalNotRoutable {
41
41
  /** Restricts config positional result values accepted by command, SDK, and storage contracts. */
42
42
  export type ConfigPositionalResult = ConfigPositionalRouted | ConfigPositionalNotRoutable;
43
43
  /** Canonical snake-case config keys accepted by the config command and positional router. */
44
- export type ConfigKey = "definition_of_done" | "item_format" | "history_missing_stream_policy" | "sprint_release_format_policy" | "parent_reference_policy" | "metadata_validation_profile" | "metadata_required_fields" | "lifecycle_stale_blocker_reason_patterns" | "lifecycle_closure_like_blocked_reason_patterns" | "lifecycle_closure_like_resolution_patterns" | "lifecycle_closure_like_actual_result_patterns" | "governance_preset" | "governance_ownership_enforcement" | "governance_create_mode_default" | "governance_close_validation_default" | "governance_require_close_reason" | "governance_create_default_type" | "governance_workflow_enforcement" | "governance_parent_reference_policy" | "governance_metadata_validation_profile" | "governance_force_required_for_stale_lock" | "test_result_tracking" | "telemetry_tracking" | "context";
44
+ export type ConfigKey = "definition_of_done" | "item_format" | "history_missing_stream_policy" | "sprint_release_format_policy" | "parent_reference_policy" | "metadata_validation_profile" | "metadata_required_fields" | "lifecycle_stale_blocker_reason_patterns" | "lifecycle_closure_like_blocked_reason_patterns" | "lifecycle_closure_like_resolution_patterns" | "lifecycle_closure_like_actual_result_patterns" | "governance_preset" | "governance_ownership_enforcement" | "governance_create_mode_default" | "governance_close_validation_default" | "governance_require_close_reason" | "governance_create_default_type" | "governance_workflow_enforcement" | "governance_parent_reference_policy" | "governance_metadata_validation_profile" | "governance_force_required_for_stale_lock" | "test_result_tracking" | "untrusted_linked_test_execution" | "telemetry_tracking" | "agent_identity_vocabulary" | "context";
45
45
  /**
46
46
  * Resolve which typed flag a positional `pm config set <key> <value>` value should
47
47
  * populate, plus the normalized value.
@@ -10,7 +10,7 @@
10
10
  * good error messages.
11
11
  */
12
12
 
13
- !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]="4f4f5f10-793d-5baa-8985-c0ec855b16c4")}catch(e){}}();
13
+ !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]="77fa2822-1681-59d5-8388-037cf13c45dd")}catch(e){}}();
14
14
  const FORMAT_KEYS = new Set(["item_format"]);
15
15
  const CRITERIA_KEYS = new Set([
16
16
  "definition_of_done",
@@ -36,13 +36,16 @@ const POLICY_KEYS = new Set([
36
36
  "governance_metadata_validation_profile",
37
37
  "governance_force_required_for_stale_lock",
38
38
  "test_result_tracking",
39
+ "untrusted_linked_test_execution",
39
40
  "telemetry_tracking",
41
+ "agent_identity_vocabulary",
40
42
  ]);
41
43
  /** Policy keys whose only valid values are enabled/disabled. For these we accept the intuitive synonyms off/on/true/false. Other policy keys pass through unchanged so their own validators report the precise allowed set. */
42
44
  const ENABLED_DISABLED_POLICY_KEYS = new Set([
43
45
  "governance_require_close_reason",
44
46
  "governance_force_required_for_stale_lock",
45
47
  "test_result_tracking",
48
+ "untrusted_linked_test_execution",
46
49
  "telemetry_tracking",
47
50
  ]);
48
51
  const ENABLED_DISABLED_SYNONYMS = {
@@ -104,4 +107,4 @@ export function resolveConfigPositionalValue(canonicalKeyOrAlias, value) {
104
107
  return { routable: true, flag: "policy", value: policyValue };
105
108
  }
106
109
  //# sourceMappingURL=positional-value.js.map
107
- //# debugId=4f4f5f10-793d-5baa-8985-c0ec855b16c4
110
+ //# debugId=77fa2822-1681-59d5-8388-037cf13c45dd
@@ -4,7 +4,7 @@
4
4
  * Implements append-only history and replay behavior for 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]="2fc7f675-3500-5abb-8d5c-9ca9caa803b6")}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]="f7cf18cb-0068-58ad-bd7f-759a5d91eb9f")}catch(e){}}();
8
8
  import jsonPatch from "fast-json-patch";
9
9
  import { ITEM_METADATA_KEY_ORDER } from "../shared/constants.js";
10
10
  import { runActiveServiceOverride } from "../extensions/index.js";
@@ -178,7 +178,7 @@ export function createHistoryEntry(params) {
178
178
  const patch = normalizeHistoryPatchOps(beforePatchCanonical, rawPatch);
179
179
  const agentIdentity = resolveHistoryAgentIdentity(params.author);
180
180
  const provenanceOutcomes = agentIdentity.harness
181
- ? Object.fromEntries(Object.entries(diagnoseAgentIdentity().provenance_outcomes).filter(([, outcome]) => outcome.status === "failed"))
181
+ ? Object.fromEntries(Object.entries(diagnoseAgentIdentity().provenance_outcomes).filter(([, outcome]) => outcome.resolver !== undefined && outcome.status !== "resolved"))
182
182
  : undefined;
183
183
  const context = provenanceOutcomes === undefined || Object.keys(provenanceOutcomes).length === 0
184
184
  ? params.context
@@ -292,4 +292,4 @@ export const _testOnly = {
292
292
  isDefinedPointerPath,
293
293
  };
294
294
  //# sourceMappingURL=history.js.map
295
- //# debugId=2fc7f675-3500-5abb-8d5c-9ca9caa803b6
295
+ //# debugId=f7cf18cb-0068-58ad-bd7f-759a5d91eb9f
@@ -4,7 +4,7 @@
4
4
  * Defines item parsing, formatting, and lifecycle helpers for Item Format.
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]="5eac19ec-235e-5e6f-8ae7-4725f99c9d7f")}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]="65a90a42-eecb-57d3-9f78-3a5f1bc3abd3")}catch(e){}}();
8
8
  import { encode as encodeToon } from "@toon-format/toon";
9
9
  import { isDeepStrictEqual } from "node:util";
10
10
  import { CONFIDENCE_TEXT_VALUES, ISSUE_SEVERITY_VALUES, PLAN_STEP_STATUS_VALUES, RECURRENCE_FREQUENCY_VALUES, RECURRENCE_WEEKDAY_VALUES, STATUS_VALUES, weekdayOrderIndex, } from "../../types/index.js";
@@ -24,6 +24,19 @@ const LINKED_TEST_PM_CONTEXT_MODE_VALUES = new Set([
24
24
  "tracker",
25
25
  "auto",
26
26
  ]);
27
+ const LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES = new Set([
28
+ "source",
29
+ "isolated",
30
+ "snapshot",
31
+ ]);
32
+ const LINKED_TEST_TRUST_REASON_VALUES = new Set([
33
+ "legacy",
34
+ "local_mutation",
35
+ "local_source_ref",
36
+ "acknowledged",
37
+ "invalid_provenance",
38
+ "foreign_source_ref",
39
+ ]);
27
40
  const ITEM_TEST_RUN_STATUS_VALUES = new Set([
28
41
  "passed",
29
42
  "failed",
@@ -602,6 +615,12 @@ function normalizeTestRunMeasurements(value) {
602
615
  return deduplicated.length > 0 ? deduplicated : undefined;
603
616
  }
604
617
  /** Normalize and bound command/context provenance retained for a test run. */
618
+ function normalizeTestRunEnum(value, allowedValues) {
619
+ return typeof value === "string" && allowedValues.has(value)
620
+ ? value
621
+ : undefined;
622
+ }
623
+ /** Normalize and bound command/context provenance retained for a test run. */
605
624
  function normalizeTestRunExecutions(values) {
606
625
  if (!Array.isArray(values))
607
626
  return undefined;
@@ -612,16 +631,10 @@ function normalizeTestRunExecutions(values) {
612
631
  .slice(0, 32)
613
632
  .map((execution) => ({
614
633
  command: execution.command.trim(),
615
- requested_pm_context_mode: execution.requested_pm_context_mode === "schema" ||
616
- execution.requested_pm_context_mode === "tracker" ||
617
- execution.requested_pm_context_mode === "auto"
618
- ? execution.requested_pm_context_mode
619
- : undefined,
620
- pm_context_mode: execution.pm_context_mode === "schema" ||
621
- execution.pm_context_mode === "tracker" ||
622
- execution.pm_context_mode === "auto"
623
- ? execution.pm_context_mode
624
- : undefined,
634
+ requested_pm_context_mode: normalizeTestRunEnum(execution.requested_pm_context_mode, LINKED_TEST_PM_CONTEXT_MODE_VALUES),
635
+ pm_context_mode: normalizeTestRunEnum(execution.pm_context_mode, LINKED_TEST_PM_CONTEXT_MODE_VALUES),
636
+ workspace_context_mode: normalizeTestRunEnum(execution.workspace_context_mode, LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES),
637
+ trust_reason: normalizeTestRunEnum(execution.trust_reason, LINKED_TEST_TRUST_REASON_VALUES),
625
638
  }));
626
639
  return executions.length > 0 ? executions : undefined;
627
640
  }
@@ -708,6 +721,45 @@ function normalizeLinkedTestContextMode(value) {
708
721
  }
709
722
  return normalized;
710
723
  }
724
+ function normalizeLinkedTestWorkspaceContextMode(value) {
725
+ const normalized = value?.trim().toLowerCase();
726
+ if (!normalized ||
727
+ !LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES.has(normalized)) {
728
+ return undefined;
729
+ }
730
+ return normalized;
731
+ }
732
+ function normalizeLinkedTestProvenance(value, invalid) {
733
+ if (invalid === true) {
734
+ return { provenance_invalid: true };
735
+ }
736
+ if (value === undefined) {
737
+ return {};
738
+ }
739
+ if (!isPlainObjectRecord(value)) {
740
+ return { provenance_invalid: true };
741
+ }
742
+ const author = trimStringOrUndefined(value.author);
743
+ const createdAt = trimStringOrUndefined(value.created_at);
744
+ const sourceKind = value.source_kind;
745
+ if (!author ||
746
+ !createdAt ||
747
+ !isTimestampLiteral(createdAt) ||
748
+ (sourceKind !== "local_mutation" && sourceKind !== "merge_union")) {
749
+ // Preserve malformed provenance as an explicit runtime sentinel. Dropping
750
+ // it would make a tampered entry indistinguishable from a trusted legacy
751
+ // command in the clone-local trust resolver.
752
+ return { provenance_invalid: true };
753
+ }
754
+ return {
755
+ provenance: {
756
+ author,
757
+ created_at: createdAt,
758
+ source_kind: sourceKind,
759
+ source_ref: trimStringOrUndefined(value.source_ref),
760
+ },
761
+ };
762
+ }
711
763
  function normalizeLinkedTest(value) {
712
764
  const test = {
713
765
  command: value.command?.trim() || undefined,
@@ -719,6 +771,8 @@ function normalizeLinkedTest(value) {
719
771
  ? value.timeout_seconds
720
772
  : undefined,
721
773
  pm_context_mode: normalizeLinkedTestContextMode(value.pm_context_mode),
774
+ workspace_context_mode: normalizeLinkedTestWorkspaceContextMode(value.workspace_context_mode),
775
+ ...normalizeLinkedTestProvenance(value.provenance, value.provenance_invalid),
722
776
  env_set: normalizeStringRecord(value.env_set),
723
777
  env_clear: normalizeTrimmedStringList(value.env_clear),
724
778
  shared_host_safe: value.shared_host_safe === true ? true : undefined,
@@ -1418,4 +1472,4 @@ export const _testOnlyItemFormat = {
1418
1472
  sortTests,
1419
1473
  };
1420
1474
  //# sourceMappingURL=item-format.js.map
1421
- //# debugId=5eac19ec-235e-5e6f-8ae7-4725f99c9d7f
1475
+ //# debugId=65a90a42-eecb-57d3-9f78-3a5f1bc3abd3
@@ -7,8 +7,12 @@ export interface ReproducibleExecutionSettings {
7
7
  /** Milliseconds advanced after each clock read. */
8
8
  tickMs: number;
9
9
  }
10
+ /** Runs async operations against one shared deterministic sequence. */
11
+ export type ReproducibleExecutionRunner = <T>(operation: () => Promise<T>) => Promise<T>;
10
12
  /** Validate and normalize deterministic execution settings before work starts. */
11
13
  export declare function validateReproducibleExecutionSettings(settings: ReproducibleExecutionSettings): ReproducibleExecutionSettings;
14
+ /** Create a runner whose serial operations share deterministic clock and entropy state. */
15
+ export declare function createReproducibleExecutionRunner(settings: ReproducibleExecutionSettings): ReproducibleExecutionRunner;
12
16
  /** Run an isolated async operation with deterministic clock and entropy state. */
13
17
  export declare function runWithReproducibleExecution<T>(settings: ReproducibleExecutionSettings, operation: () => Promise<T>): Promise<T>;
14
18
  /** Return the next deterministic clock value, or undefined outside a recipe. */
@@ -2,10 +2,11 @@
2
2
  * @module core/reproducibility/context
3
3
  *
4
4
  * Provides opt-in deterministic time and identifier entropy for reproducible
5
- * workspace executions. The default CLI path never installs this context.
5
+ * workspace executions. SDK recipes and supported process adapters install
6
+ * this context explicitly; default execution remains nondeterministic.
6
7
  */
7
8
 
8
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="cc84ae55-6dc4-57d4-b7de-c43ae1fb4603")}catch(e){}}();
9
+ !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]="aacc48ae-e9b2-5c8e-945f-89d05aff48e8")}catch(e){}}();
9
10
  import crypto from "node:crypto";
10
11
  import { AsyncLocalStorage } from "node:async_hooks";
11
12
  const executionStorage = new AsyncLocalStorage();
@@ -19,7 +20,7 @@ export function validateReproducibleExecutionSettings(settings) {
19
20
  if (!Number.isSafeInteger(settings.tickMs) || settings.tickMs < 0) {
20
21
  throw new Error("Reproducible workspace tickMs must be a non-negative integer");
21
22
  }
22
- if (settings.seed.length === 0) {
23
+ if (settings.seed.trim().length === 0) {
23
24
  throw new Error("Reproducible workspace seed must not be empty");
24
25
  }
25
26
  return {
@@ -27,14 +28,19 @@ export function validateReproducibleExecutionSettings(settings) {
27
28
  clock: new Date(clockMs).toISOString(),
28
29
  };
29
30
  }
30
- /** Run an isolated async operation with deterministic clock and entropy state. */
31
- export async function runWithReproducibleExecution(settings, operation) {
31
+ /** Create a runner whose serial operations share deterministic clock and entropy state. */
32
+ export function createReproducibleExecutionRunner(settings) {
32
33
  const normalized = validateReproducibleExecutionSettings(settings);
33
- return executionStorage.run({
34
+ const state = {
34
35
  ...normalized,
35
36
  clockReads: 0,
36
37
  tokenReads: 0,
37
- }, operation);
38
+ };
39
+ return (operation) => executionStorage.run(state, operation);
40
+ }
41
+ /** Run an isolated async operation with deterministic clock and entropy state. */
42
+ export async function runWithReproducibleExecution(settings, operation) {
43
+ return createReproducibleExecutionRunner(settings)(operation);
38
44
  }
39
45
  /** Return the next deterministic clock value, or undefined outside a recipe. */
40
46
  export function nextReproducibleTimestamp() {
@@ -74,4 +80,4 @@ export function nextReproducibleToken(length) {
74
80
  return token;
75
81
  }
76
82
  //# sourceMappingURL=context.js.map
77
- //# debugId=cc84ae55-6dc4-57d4-b7de-c43ae1fb4603
83
+ //# debugId=aacc48ae-e9b2-5c8e-945f-89d05aff48e8
@@ -6,7 +6,7 @@ export type AgentModelSource = "override" | "environment" | "mcp_client" | "argv
6
6
  /** Stable built-in provenance dimensions understood by the default runtime. */
7
7
  export declare const AGENT_PROVENANCE_DIMENSIONS: readonly ["model", "effort", "role", "topic", "version"];
8
8
  /** Built-in, bounded local resolver names accepted by harness descriptors. */
9
- export type AgentProvenanceResolver = "ai_agent_version" | "claude_session_file";
9
+ export type AgentProvenanceResolver = "ai_agent_version" | "claude_session_file" | "codex_session_file";
10
10
  /** One bounded provenance value and the signal class that supplied it. */
11
11
  export interface AgentProvenanceObservation {
12
12
  /** Bounded descriptive value retained in local history. */
@@ -74,6 +74,49 @@ export interface HarnessSignalDescriptor {
74
74
  /** Literal, case-insensitive MCP client-name markers. */
75
75
  client_names?: readonly string[];
76
76
  }
77
+ /** Versioned package-replaceable provenance contract for one agent harness. */
78
+ export interface AgentProvenanceAdapter {
79
+ /** Public adapter contract revision. */
80
+ contract_version: 1;
81
+ /** Adapter implementation revision supplied by pm or a package. */
82
+ adapter_version: string;
83
+ /** Explicit replacement precedence; built-ins use zero. */
84
+ priority: number;
85
+ /** Stable lowercase harness namespace. */
86
+ harness: string;
87
+ /** Executable detection and provenance descriptor. */
88
+ descriptor: HarnessSignalDescriptor;
89
+ /** Provenance dimensions intentionally covered by the adapter. */
90
+ supported_dimensions: readonly string[];
91
+ /** Privacy classes the adapter may inspect. */
92
+ native_sources: readonly ("environment" | "argv" | "mcp_client" | "session_file")[];
93
+ /** Hard bounds shared by runtime probes and package review. */
94
+ probe_policy: {
95
+ max_bytes: number;
96
+ max_lines: number;
97
+ network_access: false;
98
+ subprocess_access: false;
99
+ };
100
+ /** Stable normalization vocabulary declarations. */
101
+ normalization: {
102
+ model_family: "v1";
103
+ effort: "v1";
104
+ preserve_raw: true;
105
+ };
106
+ /** Confidence of a value read directly from the declared sources. */
107
+ confidence: "high" | "medium" | "low";
108
+ /** Bounded reasons for intentionally uncovered dimensions. */
109
+ waivers?: Readonly<Record<string, string>>;
110
+ }
111
+ /** One raw and normalized adapter value with its stable vocabulary revision. */
112
+ export interface NormalizedAgentProvenanceAdapterValue {
113
+ /** Bounded value retained exactly as observed. */
114
+ raw: string;
115
+ /** Stable cross-harness family or vocabulary value. */
116
+ normalized: string;
117
+ /** Normalization vocabulary revision. */
118
+ vocabulary: "v1";
119
+ }
77
120
  /** Public, privacy-safe agent observation shared by CLI, SDK, and MCP hosts. */
78
121
  export interface DetectedAgentIdentity {
79
122
  /** Normalized harness namespace when automatic detection succeeded. */
@@ -128,6 +171,8 @@ export interface HarnessDetectionSignals {
128
171
  }
129
172
  /** Built-in agent descriptors evaluated before package and workspace additions. */
130
173
  export declare const BUILTIN_HARNESS_SIGNAL_DESCRIPTORS: readonly HarnessSignalDescriptor[];
174
+ /** Built-in versioned adapters for supported interactive agent harnesses. */
175
+ export declare const BUILTIN_AGENT_PROVENANCE_ADAPTERS: readonly AgentProvenanceAdapter[];
131
176
  /**
132
177
  * Register package-provided harness signals until the returned disposer runs.
133
178
  *
@@ -136,6 +181,15 @@ export declare const BUILTIN_HARNESS_SIGNAL_DESCRIPTORS: readonly HarnessSignalD
136
181
  * repeated extension activation remains idempotent.
137
182
  */
138
183
  export declare function registerHarnessSignalDescriptors(descriptors: readonly HarnessSignalDescriptor[]): () => void;
184
+ /** Return the effective built-in or explicitly higher-priority package adapters. */
185
+ export declare function listAgentProvenanceAdapters(): readonly AgentProvenanceAdapter[];
186
+ /**
187
+ * Register package adapters until disposal. Replacing a built-in requires an
188
+ * explicitly greater priority; equal-priority ambiguity fails closed.
189
+ */
190
+ export declare function registerAgentProvenanceAdapters(adapters: readonly AgentProvenanceAdapter[]): () => void;
191
+ /** Normalize model-family or effort vocabulary while retaining the raw value. */
192
+ export declare function normalizeAgentProvenanceAdapterValue(dimension: "model" | "effort", value: string): NormalizedAgentProvenanceAdapterValue;
139
193
  /** Run one invocation with host-provided detection signals available downstream. */
140
194
  export declare function runWithHarnessDetectionSignals<T>(signals: HarnessDetectionSignals, callback: () => T): T;
141
195
  /** Run one invocation with workspace-provided descriptors available downstream. */