@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.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +28 -0
- package/dist/cli/error-guidance.d.ts +13 -0
- package/dist/cli/error-guidance.js +62 -6
- package/dist/cli/main.js +13 -4
- package/dist/cli/register-mutation.js +6 -6
- package/dist/cli/register-operations.d.ts +73 -0
- package/dist/cli/register-operations.js +39 -14
- package/dist/cli/register-setup.js +3 -3
- package/dist/cli/schema-registration-helpers.d.ts +8 -1
- package/dist/cli/schema-registration-helpers.js +14 -5
- package/dist/cli-bundle/bundle-manifest.json +155 -155
- package/dist/cli-bundle/chunks/chunk-3ENVHX6C.js +36 -0
- package/dist/cli-bundle/chunks/{chunk-QI2CT3IX.js → chunk-DW2CGEMU.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WG4STC36.js → chunk-EG6CLDZT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MYYI3ZOA.js → chunk-F3AI2JFL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-U6GQ4VMV.js → chunk-HWZ6CELB.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-HZBMLSZI.js +201 -0
- package/dist/cli-bundle/chunks/chunk-JB4KZWBF.js +3 -0
- package/dist/cli-bundle/chunks/chunk-KPH73XXJ.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-BWX4SK46.js → chunk-KXPMB2YL.js} +58 -58
- package/dist/cli-bundle/chunks/{chunk-MZTZQTMS.js → chunk-QDVHNHAQ.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-TFI5V5N2.js +13 -0
- package/dist/cli-bundle/chunks/{register-list-query-HZKBQNWW.js → register-list-query-UJB5FMV2.js} +2 -2
- package/dist/cli-bundle/chunks/register-mutation-NX5XE4VX.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-RXIJIYXC.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-QK4OTOXN.js → register-setup-GFUZEKRE.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-2POVTNLY.js → chunk-37Z4OEAP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-3UPTYG44.js +8 -0
- package/dist/cli-bundle/focused-chunks/{chunk-E2EWYPY6.js → chunk-5S7E72FY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-GMYPD4FX.js → chunk-AUFH5H35.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-E7X25GC3.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-3LKU6PTJ.js → chunk-FQCSTBWE.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-6S2MO3Q3.js → chunk-FZS4H32O.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-IFLWKY2R.js +156 -0
- package/dist/cli-bundle/focused-chunks/{chunk-PMGJUFNQ.js → chunk-JOWDB2MH.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-LYVSW5VM.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-MRCNF3U6.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-A2BC5PQL.js → chunk-OFVUGTLJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-2ARQGDDW.js → chunk-OGLQBL46.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-R6SR45XU.js → chunk-OY7QAV4Y.js} +48 -47
- package/dist/cli-bundle/focused-chunks/chunk-QGFNI65N.js +26 -0
- package/dist/cli-bundle/focused-chunks/{chunk-D6RBZEJJ.js → chunk-R27IDGHD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-UYRFYCDQ.js +5 -0
- package/dist/cli-bundle/focused-chunks/{chunk-PH2OXXVZ.js → chunk-ZHVA42R5.js} +9 -9
- package/dist/cli-bundle/main.js +13 -13
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +2 -2
- package/dist/cli-bundle/sdk-core.js +40 -40
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +33 -32
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +5 -5
- package/dist/core/config/nested-settings.js +8 -2
- package/dist/core/config/positional-value.d.ts +1 -1
- package/dist/core/config/positional-value.js +5 -2
- package/dist/core/history/history.js +3 -3
- package/dist/core/item/item-format.js +66 -12
- package/dist/core/reproducibility/context.d.ts +4 -0
- package/dist/core/reproducibility/context.js +14 -8
- package/dist/core/shared/author.d.ts +55 -1
- package/dist/core/shared/author.js +333 -16
- package/dist/core/shared/constants.js +3 -2
- package/dist/core/store/settings-validator.d.ts +1 -0
- package/dist/core/store/settings-validator.js +6 -3
- package/dist/core/store/settings.js +5 -2
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.js +30 -9
- package/dist/sdk/agent/identity-config.d.ts +63 -0
- package/dist/sdk/agent/identity-config.js +107 -0
- package/dist/sdk/agent/refusal-corpus-contracts.d.ts +76 -0
- package/dist/sdk/agent/refusal-corpus-contracts.js +194 -0
- package/dist/sdk/cli-contracts/agent-output-contracts.js +6 -4
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -0
- package/dist/sdk/cli-contracts/enum-contracts.js +9 -2
- package/dist/sdk/cli-contracts/flag-contracts.js +9 -2
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +4 -4
- package/dist/sdk/cli-contracts/registration-helpers.js +5 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +22 -2
- package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +14 -3
- package/dist/sdk/cli-contracts.d.ts +3 -3
- package/dist/sdk/cli-contracts.js +4 -4
- package/dist/sdk/config.d.ts +6 -1
- package/dist/sdk/config.js +119 -14
- package/dist/sdk/context-intent-contracts.js +4 -2
- package/dist/sdk/core-governance.d.ts +1 -1
- package/dist/sdk/core-governance.js +3 -3
- package/dist/sdk/extension/scaffold.js +11 -5
- package/dist/sdk/flag-invocation-contracts.js +4 -2
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +50 -2
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +87 -38
- package/dist/sdk/governance/assurance-action.js +30 -10
- package/dist/sdk/governance/validate.d.ts +2 -2
- package/dist/sdk/governance/validate.js +39 -14
- package/dist/sdk/index.d.ts +7 -2
- package/dist/sdk/index.js +8 -3
- package/dist/sdk/lifecycle/create.js +6 -3
- package/dist/sdk/lifecycle/update.js +5 -3
- package/dist/sdk/merge/three-way.js +105 -26
- package/dist/sdk/read-output-budget.d.ts +21 -0
- package/dist/sdk/read-output-budget.js +39 -2
- package/dist/sdk/read-output-contracts.d.ts +5 -3
- package/dist/sdk/read-output-contracts.js +20 -12
- package/dist/sdk/reproducibility/process.d.ts +19 -0
- package/dist/sdk/reproducibility/process.js +88 -0
- package/dist/sdk/runtime-primitives.d.ts +1 -1
- package/dist/sdk/runtime-primitives.js +3 -3
- package/dist/sdk/runtime.js +6 -5
- package/dist/sdk/test/batch.d.ts +6 -0
- package/dist/sdk/test/batch.js +15 -3
- package/dist/sdk/test/entry.d.ts +1 -1
- package/dist/sdk/test/entry.js +3 -2
- package/dist/sdk/test/execution.d.ts +28 -3
- package/dist/sdk/test/execution.js +193 -34
- package/dist/sdk/test/parsers.d.ts +6 -0
- package/dist/sdk/test/parsers.js +21 -2
- package/dist/sdk/test/trust.d.ts +33 -0
- package/dist/sdk/test/trust.js +207 -0
- package/dist/types.d.ts +23 -0
- package/dist/types.js +2 -2
- package/docs/AGENT_PROVENANCE_ADR.md +41 -5
- package/docs/CONFIGURATION.md +4 -0
- package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +19 -2
- package/docs/MERGE_SAFETY.md +15 -1
- package/docs/READ_OUTPUT_CONTRACTS.md +11 -1
- package/docs/REPRODUCIBLE_WORKSPACES.md +42 -8
- package/docs/SDK.md +9 -0
- package/docs/SDK_AGENT_SESSION_CONTEXT.md +6 -4
- package/docs/SDK_EVIDENCE_TRACEABILITY.md +1 -1
- package/docs/TESTING.md +75 -8
- package/docs/agent-task-token-baseline.json +2 -2
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +2 -2
- package/marketplace.json +2 -2
- package/package.json +2 -2
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/sdk/public-surface.json +427 -17
- package/dist/cli-bundle/chunks/chunk-EMWDM5FI.js +0 -13
- package/dist/cli-bundle/chunks/chunk-HYG6LRL4.js +0 -200
- package/dist/cli-bundle/chunks/chunk-SMWXHMVB.js +0 -35
- package/dist/cli-bundle/chunks/chunk-VMMIL3SI.js +0 -2
- package/dist/cli-bundle/chunks/chunk-YBPJAOQQ.js +0 -3
- package/dist/cli-bundle/chunks/register-mutation-HTKEEGRD.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-6EMRWJJY.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2AZT5WXZ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-5SHSBMX2.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-C4S4A4JJ.js +0 -5
- package/dist/cli-bundle/focused-chunks/chunk-L5LDSRO2.js +0 -155
- package/dist/cli-bundle/focused-chunks/chunk-MB37AYN6.js +0 -26
- package/dist/cli-bundle/focused-chunks/chunk-MCOR37QK.js +0 -2
- 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]="
|
|
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=
|
|
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]="
|
|
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=
|
|
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]="
|
|
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
|
|
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=
|
|
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]="
|
|
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
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
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=
|
|
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.
|
|
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]="
|
|
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
|
-
/**
|
|
31
|
-
export
|
|
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
|
-
|
|
34
|
+
const state = {
|
|
34
35
|
...normalized,
|
|
35
36
|
clockReads: 0,
|
|
36
37
|
tokenReads: 0,
|
|
37
|
-
}
|
|
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=
|
|
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. */
|