@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.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +44 -0
- package/dist/cli/error-guidance.d.ts +22 -4
- package/dist/cli/error-guidance.js +73 -16
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.js +51 -9
- 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 +149 -149
- package/dist/cli-bundle/chunks/chunk-3ENVHX6C.js +36 -0
- package/dist/cli-bundle/chunks/{chunk-LOVTQ52Z.js → chunk-DW2CGEMU.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-EG6CLDZT.js +5 -0
- package/dist/cli-bundle/chunks/{chunk-LARJJ3RK.js → chunk-F3AI2JFL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-N3DSV4CH.js → chunk-HWZ6CELB.js} +8 -8
- 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-BKYB45NQ.js → chunk-KXPMB2YL.js} +50 -50
- package/dist/cli-bundle/chunks/{chunk-BUNIEJNE.js → chunk-QDVHNHAQ.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-TFI5V5N2.js +13 -0
- package/dist/cli-bundle/chunks/{register-list-query-F57EWDEF.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-HXU7IZZD.js → register-setup-GFUZEKRE.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-F4YEW5I2.js → chunk-37Z4OEAP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-3UPTYG44.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-5S7E72FY.js +16 -0
- package/dist/cli-bundle/focused-chunks/{chunk-4ERLO7QD.js → chunk-AUFH5H35.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-E7X25GC3.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-FQCSTBWE.js +4 -0
- package/dist/cli-bundle/focused-chunks/{chunk-FH6DYED3.js → chunk-FZS4H32O.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-IFLWKY2R.js +156 -0
- package/dist/cli-bundle/focused-chunks/{chunk-YKBKIEAJ.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-UZE7XUZK.js → chunk-OFVUGTLJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-FJ22HNRP.js → chunk-OGLQBL46.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-OY7QAV4Y.js +51 -0
- package/dist/cli-bundle/focused-chunks/chunk-QGFNI65N.js +26 -0
- package/dist/cli-bundle/focused-chunks/{chunk-KDNG7TKQ.js → chunk-R27IDGHD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-UYRFYCDQ.js +5 -0
- package/dist/cli-bundle/focused-chunks/{chunk-2NIY5NKG.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/extensions/extension-hook-runtime.js +22 -20
- package/dist/core/extensions/extension-types.d.ts +8 -1
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/loader.js +7 -3
- package/dist/core/extensions/service-ownership.d.ts +8 -0
- package/dist/core/extensions/service-ownership.js +20 -0
- package/dist/core/history/history.js +3 -3
- package/dist/core/item/id.js +20 -5
- package/dist/core/item/item-format.js +81 -2
- 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/shared/errors.d.ts +4 -0
- package/dist/core/shared/errors.js +2 -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/agent/refusal-reachability.d.ts +1 -1
- package/dist/sdk/authoring.d.ts +1 -1
- package/dist/sdk/authoring.js +2 -2
- package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +77 -0
- package/dist/sdk/cli-contracts/agent-output-contracts.js +326 -2
- package/dist/sdk/cli-contracts/commander-mutation-options.js +3 -3
- 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/runtime-contracts.d.ts +3 -1
- package/dist/sdk/cli-contracts/runtime-contracts.js +4 -3
- 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 +4 -4
- package/dist/sdk/cli-contracts.js +5 -5
- 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/install-sources.d.ts +1 -1
- package/dist/sdk/extension/install-sources.js +6 -3
- package/dist/sdk/extension/output-ownership.d.ts +1 -0
- package/dist/sdk/extension/output-ownership.js +3 -2
- 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 +74 -2
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +87 -26
- package/dist/sdk/governance/assurance-action.js +30 -10
- package/dist/sdk/governance/health.d.ts +3 -0
- package/dist/sdk/governance/health.js +39 -7
- package/dist/sdk/governance/hierarchy-validation.d.ts +29 -0
- package/dist/sdk/governance/hierarchy-validation.js +109 -0
- package/dist/sdk/governance/validate.d.ts +3 -9
- package/dist/sdk/governance/validate.js +84 -111
- package/dist/sdk/graph/assembly.d.ts +6 -1
- package/dist/sdk/graph/assembly.js +16 -22
- package/dist/sdk/graph/governance-contracts.d.ts +1 -1
- package/dist/sdk/graph/governance-contracts.js +8 -2
- package/dist/sdk/graph/governance.js +46 -2
- package/dist/sdk/graph/hierarchy-integrity.d.ts +94 -0
- package/dist/sdk/graph/hierarchy-integrity.js +311 -0
- package/dist/sdk/graph/index.d.ts +2 -1
- package/dist/sdk/graph/index.js +3 -2
- package/dist/sdk/graph/remediation.js +32 -2
- package/dist/sdk/graph/run.d.ts +31 -2
- package/dist/sdk/graph/run.js +80 -31
- package/dist/sdk/graph/workspace-relationship-kind-registry.d.ts +8 -0
- package/dist/sdk/graph/workspace-relationship-kind-registry.js +28 -0
- package/dist/sdk/index.d.ts +8 -3
- package/dist/sdk/index.js +9 -4
- package/dist/sdk/item-children.js +21 -8
- package/dist/sdk/lifecycle/create.js +129 -97
- package/dist/sdk/lifecycle/hierarchy-mutation-lock.d.ts +15 -0
- package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +25 -0
- package/dist/sdk/lifecycle/update.d.ts +2 -0
- package/dist/sdk/lifecycle/update.js +174 -84
- package/dist/sdk/merge/three-way.js +105 -26
- package/dist/sdk/query/complete-list.d.ts +3 -3
- package/dist/sdk/query/complete-list.js +46 -3
- package/dist/sdk/query/list.d.ts +4 -3
- package/dist/sdk/query/list.js +89 -49
- 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 +10 -4
- package/dist/sdk/read-output-contracts.js +105 -32
- package/dist/sdk/relationship-context.js +3 -4
- package/dist/sdk/relationships.js +17 -10
- 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.d.ts +3 -2
- package/dist/sdk/runtime.js +7 -5
- package/dist/sdk/test/batch.d.ts +6 -0
- package/dist/sdk/test/batch.js +26 -6
- 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 +201 -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 +34 -0
- package/dist/types.js +2 -2
- package/docs/AGENT_PROVENANCE_ADR.md +41 -5
- package/docs/AGENT_UX_CONTRACTS.md +20 -4
- package/docs/COMMANDS.md +29 -14
- package/docs/CONFIGURATION.md +4 -0
- package/docs/DEPENDENCY_KIND_CONTRACT.md +31 -3
- package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +115 -0
- package/docs/EXTENSIONS.md +2 -1
- package/docs/MERGE_SAFETY.md +15 -1
- package/docs/README.md +1 -0
- package/docs/READ_OUTPUT_CONTRACTS.md +19 -2
- package/docs/RELATIONSHIP_GRAPH.md +6 -3
- 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 +83 -1
- 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 +1021 -53
- package/dist/cli-bundle/chunks/chunk-2MA6ZQVZ.js +0 -197
- package/dist/cli-bundle/chunks/chunk-3AFAUHUE.js +0 -2
- package/dist/cli-bundle/chunks/chunk-7VHZS727.js +0 -5
- package/dist/cli-bundle/chunks/chunk-JSLOFXGA.js +0 -3
- package/dist/cli-bundle/chunks/chunk-OCLPLFAY.js +0 -35
- package/dist/cli-bundle/chunks/chunk-S4IRYKBU.js +0 -13
- package/dist/cli-bundle/chunks/register-mutation-7IY2D5KO.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-FALL3YTU.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-7WZRLCYF.js +0 -50
- package/dist/cli-bundle/focused-chunks/chunk-CKKQSJNN.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-EEFKYMDR.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-F2A56DHV.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-FV5ACOK7.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-JEAVFOWM.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-NJ63LOP6.js +0 -155
- package/dist/cli-bundle/focused-chunks/chunk-NXRTQ7HI.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-TJ7EMJ46.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-ZOSEELYJ.js +0 -26
|
@@ -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 extension runtime contracts and governance for Extension Hook Runtime.
|
|
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]="d1dd5d4f-5f08-5e52-b109-d066f92ae3b3")}catch(e){}}();
|
|
8
8
|
import { cloneCommandOptionsSnapshot, cloneContextSnapshot, cloneGlobalOptionsSnapshot, normalizeCommandName, } from "./extension-runtime-helpers.js";
|
|
9
9
|
import { stableValueEquals } from "../shared/serialization.js";
|
|
10
10
|
import { EXIT_CODE } from "../shared/constants.js";
|
|
@@ -480,6 +480,20 @@ function isLegacyOutputPayloadEcho(result, context, serviceContext) {
|
|
|
480
480
|
result !== null &&
|
|
481
481
|
stableValueEquals(result, serviceContext.payload));
|
|
482
482
|
}
|
|
483
|
+
function resolveMatchedServiceDecision(matched, decision, warnings) {
|
|
484
|
+
if (!decision.handled) {
|
|
485
|
+
return undefined;
|
|
486
|
+
}
|
|
487
|
+
if (matched.passThrough === true) {
|
|
488
|
+
warnings.push(`extension_service_pass_through_contract_violated:${matched.layer}:${matched.name}:${matched.service}`);
|
|
489
|
+
return undefined;
|
|
490
|
+
}
|
|
491
|
+
return {
|
|
492
|
+
handled: true,
|
|
493
|
+
result: decision.result,
|
|
494
|
+
warnings,
|
|
495
|
+
};
|
|
496
|
+
}
|
|
483
497
|
/** Implements run service override sync for the public runtime surface of this module. */
|
|
484
498
|
export function runServiceOverrideSync(services, context) {
|
|
485
499
|
const matches = matchingServiceOverrides(services, context.service);
|
|
@@ -499,15 +513,9 @@ export function runServiceOverrideSync(services, context) {
|
|
|
499
513
|
warnings.push(`extension_output_format_payload_echo_deprecated:${matched.layer}:${matched.name}`);
|
|
500
514
|
continue;
|
|
501
515
|
}
|
|
502
|
-
const
|
|
503
|
-
if (
|
|
504
|
-
|
|
505
|
-
}
|
|
506
|
-
return {
|
|
507
|
-
handled: true,
|
|
508
|
-
result: decision.result,
|
|
509
|
-
warnings,
|
|
510
|
-
};
|
|
516
|
+
const resolved = resolveMatchedServiceDecision(matched, resolveServiceOverrideValue(result, context), warnings);
|
|
517
|
+
if (resolved)
|
|
518
|
+
return resolved;
|
|
511
519
|
}
|
|
512
520
|
catch {
|
|
513
521
|
warnings.push(`extension_service_override_failed:${matched.layer}:${matched.name}:${matched.service}`);
|
|
@@ -534,15 +542,9 @@ export async function runServiceOverride(services, context) {
|
|
|
534
542
|
warnings.push(`extension_output_format_payload_echo_deprecated:${matched.layer}:${matched.name}`);
|
|
535
543
|
continue;
|
|
536
544
|
}
|
|
537
|
-
const
|
|
538
|
-
if (
|
|
539
|
-
|
|
540
|
-
}
|
|
541
|
-
return {
|
|
542
|
-
handled: true,
|
|
543
|
-
result: decision.result,
|
|
544
|
-
warnings,
|
|
545
|
-
};
|
|
545
|
+
const resolved = resolveMatchedServiceDecision(matched, resolveServiceOverrideValue(result, context), warnings);
|
|
546
|
+
if (resolved)
|
|
547
|
+
return resolved;
|
|
546
548
|
}
|
|
547
549
|
catch {
|
|
548
550
|
warnings.push(`extension_service_override_failed:${matched.layer}:${matched.name}:${matched.service}`);
|
|
@@ -695,4 +697,4 @@ export function runRendererOverride(renderers, context) {
|
|
|
695
697
|
}
|
|
696
698
|
}
|
|
697
699
|
//# sourceMappingURL=extension-hook-runtime.js.map
|
|
698
|
-
//# debugId=
|
|
700
|
+
//# debugId=d1dd5d4f-5f08-5e52-b109-d066f92ae3b3
|
|
@@ -483,6 +483,11 @@ export type ServiceOverrideDecision = {
|
|
|
483
483
|
};
|
|
484
484
|
/** Restricts service override values accepted by command, SDK, and storage contracts. */
|
|
485
485
|
export type ServiceOverride = (context: ServiceOverrideContext) => unknown | ServiceOverrideDecision;
|
|
486
|
+
/** Host-enforced ownership metadata for a service override. */
|
|
487
|
+
export interface ServiceOverrideOwnership {
|
|
488
|
+
/** Declare that the callback may only decline. Any handled result is ignored and diagnosed by the host. */
|
|
489
|
+
passThrough?: boolean;
|
|
490
|
+
}
|
|
486
491
|
/** Documents the registered extension hook payload exchanged by command, SDK, and package integrations. */
|
|
487
492
|
export interface RegisteredExtensionHook<THook> {
|
|
488
493
|
/** Value that configures or reports layer for this contract. */
|
|
@@ -1187,6 +1192,8 @@ export interface RegisteredExtensionServiceOverride {
|
|
|
1187
1192
|
service: ExtensionServiceName;
|
|
1188
1193
|
/** Value that configures or reports run for this contract. */
|
|
1189
1194
|
run: ServiceOverride;
|
|
1195
|
+
/** Whether the host forbids this callback from handling the service payload. */
|
|
1196
|
+
passThrough?: boolean;
|
|
1190
1197
|
}
|
|
1191
1198
|
/** Documents the registered extension renderer override payload exchanged by command, SDK, and package integrations. */
|
|
1192
1199
|
export interface RegisteredExtensionRendererOverride {
|
|
@@ -1464,7 +1471,7 @@ export interface ExtensionApi {
|
|
|
1464
1471
|
/** Value that configures or reports register preflight for this contract. */
|
|
1465
1472
|
registerPreflight(override: PreflightOverride | ScopedPreflightOverrideDefinition): void;
|
|
1466
1473
|
/** Value that configures or reports register service for this contract. */
|
|
1467
|
-
registerService(service: ExtensionServiceName, override: ServiceOverride): void;
|
|
1474
|
+
registerService(service: ExtensionServiceName, override: ServiceOverride, ownership?: ServiceOverrideOwnership): void;
|
|
1468
1475
|
/** Value that configures or reports register flags for this contract. */
|
|
1469
1476
|
registerFlags(targetCommand: string, flags: FlagDefinition[]): void;
|
|
1470
1477
|
/** Value that configures or reports register item fields for this contract. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Public contract for known extension capabilities, shared by SDK and presentation-layer consumers. */
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="87454a57-b62e-560a-b66f-3c15d4a95cc2")}catch(e){}}();
|
|
4
4
|
export const KNOWN_EXTENSION_CAPABILITIES = [
|
|
5
5
|
"commands",
|
|
6
6
|
"renderers",
|
|
@@ -100,4 +100,4 @@ export function createDefaultExtensionGovernancePolicy() {
|
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
//# sourceMappingURL=extension-types.js.map
|
|
103
|
-
//# debugId=
|
|
103
|
+
//# debugId=87454a57-b62e-560a-b66f-3c15d4a95cc2
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements extension runtime contracts and governance for Loader.
|
|
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]="10311c96-5cba-5021-a8c5-82abd6eeb6f5")}catch(e){}}();
|
|
8
8
|
import fs from "node:fs/promises";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { pathToFileURL } from "node:url";
|
|
@@ -19,6 +19,7 @@ import { KNOWN_ITEM_FIELD_TYPES, normalizeItemFieldType, suggestKnownItemFieldTy
|
|
|
19
19
|
import { snapshotExtensionModuleGraph } from "./module-graph-snapshot.js";
|
|
20
20
|
import { captureExtensionActivationRollback } from "./activation-transaction.js";
|
|
21
21
|
import { collectPreflightCollisionWarnings, normalizePreflightOverride, } from "./preflight-ownership.js";
|
|
22
|
+
import { normalizeServiceOverrideOwnership } from "./service-ownership.js";
|
|
22
23
|
import { assertCommandDefinitionMetadataStrings } from "./command-visibility-tier.js";
|
|
23
24
|
import { buildImportExportContext, resolveImportExportArtifactOutput, } from "./exporter-output-contract.js";
|
|
24
25
|
import { asRegistrationRecord, assertOptionalBooleanField, assertOptionalFlagDefaultField, assertOptionalStringArrayField, assertOptionalStringField, normalizeOptionalStringArrayField, } from "./registration-validation.js";
|
|
@@ -1569,7 +1570,7 @@ class ExtensionApiRegistrar {
|
|
|
1569
1570
|
...normalized,
|
|
1570
1571
|
});
|
|
1571
1572
|
}
|
|
1572
|
-
registerService(service, override) {
|
|
1573
|
+
registerService(service, override, ownership = {}) {
|
|
1573
1574
|
assertExtensionCapability(this.#loadedExtension, "services", "registerService");
|
|
1574
1575
|
const normalizedService = String(service).trim().toLowerCase();
|
|
1575
1576
|
if (!isExtensionServiceName(normalizedService)) {
|
|
@@ -1584,6 +1585,9 @@ class ExtensionApiRegistrar {
|
|
|
1584
1585
|
name: this.#loadedExtension.name,
|
|
1585
1586
|
service: normalizedService,
|
|
1586
1587
|
run: override,
|
|
1588
|
+
...(normalizeServiceOverrideOwnership(ownership)
|
|
1589
|
+
? { passThrough: true }
|
|
1590
|
+
: {}),
|
|
1587
1591
|
});
|
|
1588
1592
|
}
|
|
1589
1593
|
registerRenderer(format, renderer, ownership = {}) {
|
|
@@ -2216,4 +2220,4 @@ export const _testOnlyLoader = {
|
|
|
2216
2220
|
},
|
|
2217
2221
|
};
|
|
2218
2222
|
//# sourceMappingURL=loader.js.map
|
|
2219
|
-
//# debugId=
|
|
2223
|
+
//# debugId=10311c96-5cba-5021-a8c5-82abd6eeb6f5
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/extensions/service-ownership
|
|
3
|
+
*
|
|
4
|
+
* Validates host-enforced ownership metadata for extension service overrides.
|
|
5
|
+
*/
|
|
6
|
+
import type { ServiceOverrideOwnership } from "./extension-types.js";
|
|
7
|
+
/** Validate one service ownership declaration and return its normalized pass-through flag. */
|
|
8
|
+
export declare function normalizeServiceOverrideOwnership(ownership: ServiceOverrideOwnership): boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Validate one service ownership declaration and return its normalized pass-through flag. */
|
|
2
|
+
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a30142c8-b04d-5878-8497-c902ff299e94")}catch(e){}}();
|
|
4
|
+
export function normalizeServiceOverrideOwnership(ownership) {
|
|
5
|
+
if (ownership === null ||
|
|
6
|
+
typeof ownership !== "object" ||
|
|
7
|
+
Array.isArray(ownership)) {
|
|
8
|
+
throw new TypeError("registerService ownership must be an object");
|
|
9
|
+
}
|
|
10
|
+
if (Reflect.ownKeys(ownership).some((key) => key !== "passThrough")) {
|
|
11
|
+
throw new TypeError("registerService ownership supports only passThrough");
|
|
12
|
+
}
|
|
13
|
+
if (ownership.passThrough !== undefined &&
|
|
14
|
+
typeof ownership.passThrough !== "boolean") {
|
|
15
|
+
throw new TypeError("registerService ownership.passThrough must be a boolean when provided");
|
|
16
|
+
}
|
|
17
|
+
return ownership.passThrough === true;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=service-ownership.js.map
|
|
20
|
+
//# debugId=a30142c8-b04d-5878-8497-c902ff299e94
|
|
@@ -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
|
package/dist/core/item/id.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Defines item parsing, formatting, and lifecycle helpers for Id.
|
|
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]="6b3f1585-ab12-57ca-80eb-d3cebc384c52")}catch(e){}}();
|
|
8
8
|
import crypto from "node:crypto";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { TYPE_TO_FOLDER } from "../shared/constants.js";
|
|
@@ -12,10 +12,25 @@ import { pathExists } from "../fs/fs-utils.js";
|
|
|
12
12
|
import { nextReproducibleToken } from "../reproducibility/context.js";
|
|
13
13
|
/** Implements normalize prefix for the public runtime surface of this module. */
|
|
14
14
|
export function normalizePrefix(input) {
|
|
15
|
-
const normalized =
|
|
16
|
-
|
|
15
|
+
const normalized = [];
|
|
16
|
+
let separatorPending = false;
|
|
17
|
+
for (const character of (input ?? "").toLowerCase()) {
|
|
18
|
+
const codePoint = character.charCodeAt(0);
|
|
19
|
+
const isAsciiDigit = codePoint >= 48 && codePoint <= 57;
|
|
20
|
+
const isAsciiLetter = codePoint >= 97 && codePoint <= 122;
|
|
21
|
+
if (!isAsciiDigit && !isAsciiLetter) {
|
|
22
|
+
separatorPending = normalized.length > 0;
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (separatorPending) {
|
|
26
|
+
normalized.push("-");
|
|
27
|
+
separatorPending = false;
|
|
28
|
+
}
|
|
29
|
+
normalized.push(character);
|
|
30
|
+
}
|
|
31
|
+
if (normalized.length === 0)
|
|
17
32
|
return "pm-";
|
|
18
|
-
return normalized.
|
|
33
|
+
return `${normalized.join("")}-`;
|
|
19
34
|
}
|
|
20
35
|
/** Implements normalize raw item id for the public runtime surface of this module. */
|
|
21
36
|
export function normalizeRawItemId(input) {
|
|
@@ -91,4 +106,4 @@ export async function generateItemId(pmRoot, prefix, options = {}) {
|
|
|
91
106
|
throw new Error(`Unable to generate unique id after ${attempts} attempts`);
|
|
92
107
|
}
|
|
93
108
|
//# sourceMappingURL=id.js.map
|
|
94
|
-
//# debugId=
|
|
109
|
+
//# debugId=6b3f1585-ab12-57ca-80eb-d3cebc384c52
|
|
@@ -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",
|
|
@@ -601,6 +614,30 @@ function normalizeTestRunMeasurements(value) {
|
|
|
601
614
|
.slice(0, 32);
|
|
602
615
|
return deduplicated.length > 0 ? deduplicated : undefined;
|
|
603
616
|
}
|
|
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. */
|
|
624
|
+
function normalizeTestRunExecutions(values) {
|
|
625
|
+
if (!Array.isArray(values))
|
|
626
|
+
return undefined;
|
|
627
|
+
const executions = values
|
|
628
|
+
.filter((execution) => execution &&
|
|
629
|
+
typeof execution.command === "string" &&
|
|
630
|
+
execution.command.trim().length > 0)
|
|
631
|
+
.slice(0, 32)
|
|
632
|
+
.map((execution) => ({
|
|
633
|
+
command: execution.command.trim(),
|
|
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),
|
|
638
|
+
}));
|
|
639
|
+
return executions.length > 0 ? executions : undefined;
|
|
640
|
+
}
|
|
604
641
|
function normalizeTestRunSummary(value) {
|
|
605
642
|
const runId = typeof value.run_id === "string" ? value.run_id.trim() : "";
|
|
606
643
|
const kind = value.kind === "test" || value.kind === "test-all" ? value.kind : "test";
|
|
@@ -623,6 +660,7 @@ function normalizeTestRunSummary(value) {
|
|
|
623
660
|
linked_tests: normalizeNonNegativeInteger(value.linked_tests),
|
|
624
661
|
fail_on_skipped_triggered: value.fail_on_skipped_triggered === true ? true : undefined,
|
|
625
662
|
measurements: normalizeTestRunMeasurements(value.measurements),
|
|
663
|
+
executions: normalizeTestRunExecutions(value.executions),
|
|
626
664
|
};
|
|
627
665
|
deleteUndefinedFields(summary);
|
|
628
666
|
return summary;
|
|
@@ -683,6 +721,45 @@ function normalizeLinkedTestContextMode(value) {
|
|
|
683
721
|
}
|
|
684
722
|
return normalized;
|
|
685
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
|
+
}
|
|
686
763
|
function normalizeLinkedTest(value) {
|
|
687
764
|
const test = {
|
|
688
765
|
command: value.command?.trim() || undefined,
|
|
@@ -694,6 +771,8 @@ function normalizeLinkedTest(value) {
|
|
|
694
771
|
? value.timeout_seconds
|
|
695
772
|
: undefined,
|
|
696
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),
|
|
697
776
|
env_set: normalizeStringRecord(value.env_set),
|
|
698
777
|
env_clear: normalizeTrimmedStringList(value.env_clear),
|
|
699
778
|
shared_host_safe: value.shared_host_safe === true ? true : undefined,
|
|
@@ -1393,4 +1472,4 @@ export const _testOnlyItemFormat = {
|
|
|
1393
1472
|
sortTests,
|
|
1394
1473
|
};
|
|
1395
1474
|
//# sourceMappingURL=item-format.js.map
|
|
1396
|
-
//# 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. */
|