@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
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/agent-identity-config
|
|
3
|
+
*
|
|
4
|
+
* Pure and versioned mutation planning for legacy author interpretation. The
|
|
5
|
+
* public summaries deliberately expose counts and revisions, never alias
|
|
6
|
+
* spellings, so config discovery is useful without leaking historical names.
|
|
7
|
+
*/
|
|
8
|
+
/** Persisted legacy-author interpretation vocabulary. */
|
|
9
|
+
export interface AgentIdentityVocabulary {
|
|
10
|
+
/** Monotonic interpretation revision. */
|
|
11
|
+
version: number;
|
|
12
|
+
/** Exact legacy author spelling to canonical harness namespace. */
|
|
13
|
+
aliases: Record<string, string>;
|
|
14
|
+
}
|
|
15
|
+
/** Privacy-safe vocabulary projection used by config get/list/export. */
|
|
16
|
+
export interface AgentIdentityVocabularySummary {
|
|
17
|
+
/** Current interpretation revision. */
|
|
18
|
+
version: number;
|
|
19
|
+
/** Number of exact legacy spellings configured. */
|
|
20
|
+
alias_count: number;
|
|
21
|
+
}
|
|
22
|
+
/** Supported vocabulary mutations. */
|
|
23
|
+
export type AgentIdentityVocabularyOperation = "add" | "remove" | "clear";
|
|
24
|
+
/** One typed vocabulary mutation and optional residual-coverage census. */
|
|
25
|
+
export interface AgentIdentityVocabularyMutationInput {
|
|
26
|
+
/** Exact operation applied to the vocabulary. */
|
|
27
|
+
operation: AgentIdentityVocabularyOperation;
|
|
28
|
+
/** Exact legacy spelling required by add/remove. */
|
|
29
|
+
legacy_author?: string;
|
|
30
|
+
/** Canonical lowercase harness namespace required by add. */
|
|
31
|
+
canonical_harness?: string;
|
|
32
|
+
/** Optional bounded author census used only to count still-unmapped values. */
|
|
33
|
+
observed_authors?: readonly string[];
|
|
34
|
+
}
|
|
35
|
+
/** Privacy-safe dry-run or committed mutation preview. */
|
|
36
|
+
export interface AgentIdentityVocabularyMutationPreview {
|
|
37
|
+
/** Operation that was evaluated. */
|
|
38
|
+
operation: AgentIdentityVocabularyOperation;
|
|
39
|
+
/** Whether persistence would change. */
|
|
40
|
+
changed: boolean;
|
|
41
|
+
/** Revision before the operation. */
|
|
42
|
+
version_before: number;
|
|
43
|
+
/** Revision after the operation, equal when idempotent. */
|
|
44
|
+
version_after: number;
|
|
45
|
+
/** Alias count after the operation. */
|
|
46
|
+
alias_count: number;
|
|
47
|
+
/** Unique non-canonical authors not covered after the operation. */
|
|
48
|
+
residual_author_count: number;
|
|
49
|
+
}
|
|
50
|
+
/** Planned vocabulary plus a privacy-safe result preview. */
|
|
51
|
+
export interface AgentIdentityVocabularyMutationPlan {
|
|
52
|
+
/** Complete value suitable for settings persistence. */
|
|
53
|
+
vocabulary: AgentIdentityVocabulary;
|
|
54
|
+
/** Public mutation result with no alias spellings. */
|
|
55
|
+
preview: AgentIdentityVocabularyMutationPreview;
|
|
56
|
+
}
|
|
57
|
+
/** Return only the revision and count suitable for config discovery surfaces. */
|
|
58
|
+
export declare function summarizeAgentIdentityVocabulary(vocabulary: AgentIdentityVocabulary | undefined): AgentIdentityVocabularySummary;
|
|
59
|
+
/**
|
|
60
|
+
* Validate and plan one exact mutation. A real change increments the revision
|
|
61
|
+
* exactly once; identical adds and absent removes are idempotent.
|
|
62
|
+
*/
|
|
63
|
+
export declare function planAgentIdentityVocabularyMutation(current: AgentIdentityVocabulary | undefined, input: AgentIdentityVocabularyMutationInput): AgentIdentityVocabularyMutationPlan;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/agent-identity-config
|
|
3
|
+
*
|
|
4
|
+
* Pure and versioned mutation planning for legacy author interpretation. The
|
|
5
|
+
* public summaries deliberately expose counts and revisions, never alias
|
|
6
|
+
* spellings, so config discovery is useful without leaking historical names.
|
|
7
|
+
*/
|
|
8
|
+
|
|
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]="09703f32-9491-5d3a-9f90-f038d9982e17")}catch(e){}}();
|
|
10
|
+
const HARNESS_NAMESPACE_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;
|
|
11
|
+
const MAX_AUTHOR_LENGTH = 128;
|
|
12
|
+
const MAX_OBSERVED_AUTHORS = 10_000;
|
|
13
|
+
function requireLegacyAuthor(value) {
|
|
14
|
+
const author = value?.trim();
|
|
15
|
+
if (!author || author === "__proto__" || author.length > MAX_AUTHOR_LENGTH) {
|
|
16
|
+
throw new Error(`A legacy author must contain 1-${MAX_AUTHOR_LENGTH} characters.`);
|
|
17
|
+
}
|
|
18
|
+
return author;
|
|
19
|
+
}
|
|
20
|
+
function requireCanonicalHarness(value) {
|
|
21
|
+
const harness = value?.trim().toLowerCase();
|
|
22
|
+
if (!harness || !HARNESS_NAMESPACE_PATTERN.test(harness)) {
|
|
23
|
+
throw new Error("A canonical harness must be a lowercase dash-separated namespace.");
|
|
24
|
+
}
|
|
25
|
+
return harness;
|
|
26
|
+
}
|
|
27
|
+
function orderedAliases(aliases) {
|
|
28
|
+
return Object.fromEntries(Object.entries(aliases).sort(([left], [right]) => left.localeCompare(right)));
|
|
29
|
+
}
|
|
30
|
+
function countResidualAuthors(observed, aliases) {
|
|
31
|
+
const residual = new Set();
|
|
32
|
+
for (const raw of (observed ?? []).slice(0, MAX_OBSERVED_AUTHORS)) {
|
|
33
|
+
const author = raw.trim().slice(0, MAX_AUTHOR_LENGTH);
|
|
34
|
+
if (author.length === 0 ||
|
|
35
|
+
author.startsWith("harness:") ||
|
|
36
|
+
Object.hasOwn(aliases, author)) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
residual.add(author);
|
|
40
|
+
}
|
|
41
|
+
return residual.size;
|
|
42
|
+
}
|
|
43
|
+
function applyAddOperation(aliases, input) {
|
|
44
|
+
const legacyAuthor = requireLegacyAuthor(input.legacy_author);
|
|
45
|
+
const canonicalHarness = requireCanonicalHarness(input.canonical_harness);
|
|
46
|
+
if (legacyAuthor === canonicalHarness ||
|
|
47
|
+
legacyAuthor === `harness:${canonicalHarness}` ||
|
|
48
|
+
legacyAuthor.startsWith("harness:")) {
|
|
49
|
+
throw new Error(`The legacy author "${legacyAuthor}" is already canonical and must not be aliased.`);
|
|
50
|
+
}
|
|
51
|
+
if (aliases[legacyAuthor] === canonicalHarness)
|
|
52
|
+
return false;
|
|
53
|
+
aliases[legacyAuthor] = canonicalHarness;
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
function applyVocabularyOperation(aliases, input) {
|
|
57
|
+
if (input.operation === "add")
|
|
58
|
+
return applyAddOperation(aliases, input);
|
|
59
|
+
if (input.operation === "remove") {
|
|
60
|
+
const legacyAuthor = requireLegacyAuthor(input.legacy_author);
|
|
61
|
+
if (!Object.hasOwn(aliases, legacyAuthor))
|
|
62
|
+
return false;
|
|
63
|
+
delete aliases[legacyAuthor];
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
if (input.operation === "clear") {
|
|
67
|
+
const changed = Object.keys(aliases).length > 0;
|
|
68
|
+
for (const key of Object.keys(aliases))
|
|
69
|
+
delete aliases[key];
|
|
70
|
+
return changed;
|
|
71
|
+
}
|
|
72
|
+
const exhaustive = input.operation;
|
|
73
|
+
throw new Error(`Unsupported vocabulary operation: ${String(exhaustive)}`);
|
|
74
|
+
}
|
|
75
|
+
/** Return only the revision and count suitable for config discovery surfaces. */
|
|
76
|
+
export function summarizeAgentIdentityVocabulary(vocabulary) {
|
|
77
|
+
return {
|
|
78
|
+
version: vocabulary?.version ?? 1,
|
|
79
|
+
alias_count: Object.keys(vocabulary?.aliases ?? {}).length,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Validate and plan one exact mutation. A real change increments the revision
|
|
84
|
+
* exactly once; identical adds and absent removes are idempotent.
|
|
85
|
+
*/
|
|
86
|
+
export function planAgentIdentityVocabularyMutation(current, input) {
|
|
87
|
+
const versionBefore = current?.version ?? 1;
|
|
88
|
+
const aliases = { ...current?.aliases };
|
|
89
|
+
const changed = applyVocabularyOperation(aliases, input);
|
|
90
|
+
const vocabulary = {
|
|
91
|
+
version: changed ? versionBefore + 1 : versionBefore,
|
|
92
|
+
aliases: orderedAliases(aliases),
|
|
93
|
+
};
|
|
94
|
+
return {
|
|
95
|
+
vocabulary,
|
|
96
|
+
preview: {
|
|
97
|
+
operation: input.operation,
|
|
98
|
+
changed,
|
|
99
|
+
version_before: versionBefore,
|
|
100
|
+
version_after: vocabulary.version,
|
|
101
|
+
alias_count: Object.keys(vocabulary.aliases).length,
|
|
102
|
+
residual_author_count: countResidualAuthors(input.observed_authors, vocabulary.aliases),
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=identity-config.js.map
|
|
107
|
+
//# debugId=09703f32-9491-5d3a-9f90-f038d9982e17
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type PmCommandPositionalContract } from "../cli-contracts/grammar-contracts.js";
|
|
2
|
+
/** Shared executable shape for a refusal that must not mutate tracker state. */
|
|
3
|
+
export interface PmGrammarRefusalContract {
|
|
4
|
+
/** Stable probe identity used by ratchets and evidence. */
|
|
5
|
+
probe_id: string;
|
|
6
|
+
/** Canonical command path under test. */
|
|
7
|
+
command: string;
|
|
8
|
+
/** Exact argv expected to refuse. */
|
|
9
|
+
refusal_args: readonly string[];
|
|
10
|
+
/** Exact help argv that must execute successfully after the refusal. */
|
|
11
|
+
recovery_args: readonly string[];
|
|
12
|
+
/** Stable problem-envelope code expected from the refusal. */
|
|
13
|
+
error_code: "invalid_argument_value" | "missing_lifecycle_target" | "missing_required_argument" | "unknown_subcommand";
|
|
14
|
+
}
|
|
15
|
+
/** One required positional omission derived from the grammar declaration. */
|
|
16
|
+
export interface PmRequiredArgumentRefusalContract extends PmGrammarRefusalContract {
|
|
17
|
+
/** Stable positional name deliberately omitted by the probe. */
|
|
18
|
+
missing_argument: string;
|
|
19
|
+
/** Zero-based slot index in the command's declared positional signature. */
|
|
20
|
+
missing_argument_index: number;
|
|
21
|
+
}
|
|
22
|
+
/** One invalid action probe for a closed positional subcommand family. */
|
|
23
|
+
export interface PmSubcommandRefusalContract extends PmGrammarRefusalContract {
|
|
24
|
+
/** Invalid action token used to reach the refusal. */
|
|
25
|
+
rejected_value: string;
|
|
26
|
+
/** Complete authoritative action domain expected in recovery. */
|
|
27
|
+
allowed_values: readonly string[];
|
|
28
|
+
}
|
|
29
|
+
/** Runtime evidence for one grammar-derived refusal probe. */
|
|
30
|
+
export interface PmGrammarRefusalObservation {
|
|
31
|
+
/** Probe identity matching a declared contract. */
|
|
32
|
+
probe_id: string;
|
|
33
|
+
/** Machine-readable code emitted by the refusal. */
|
|
34
|
+
error_code: string;
|
|
35
|
+
/** Process exit code emitted by the refusal. */
|
|
36
|
+
exit_code: number;
|
|
37
|
+
/** Allowed values emitted for a closed action family. */
|
|
38
|
+
allowed_values: readonly string[];
|
|
39
|
+
/** Whether the advertised help recovery exited successfully. */
|
|
40
|
+
recovery_succeeded: boolean;
|
|
41
|
+
/** Whether any tracker state changed while executing the refusal. */
|
|
42
|
+
refusal_mutated_state: boolean;
|
|
43
|
+
/** Repository-relative tracker paths changed by the refusal, when measured. */
|
|
44
|
+
mutated_paths?: readonly string[];
|
|
45
|
+
}
|
|
46
|
+
/** Stable reason a grammar-derived refusal failed closure. */
|
|
47
|
+
export type PmGrammarRefusalFindingCode = "refusal_allowed_values_mismatch" | "refusal_error_code_mismatch" | "refusal_exit_code_mismatch" | "refusal_mutated_state" | "refusal_probe_missing" | "refusal_recovery_failed" | "unexpected_refusal_probe";
|
|
48
|
+
/** One actionable grammar-derived refusal closure failure. */
|
|
49
|
+
export interface PmGrammarRefusalFinding {
|
|
50
|
+
/** Stable machine-readable failure category. */
|
|
51
|
+
code: PmGrammarRefusalFindingCode;
|
|
52
|
+
/** Probe associated with the finding. */
|
|
53
|
+
probe_id: string;
|
|
54
|
+
/** Human-readable failure detail. */
|
|
55
|
+
detail: string;
|
|
56
|
+
}
|
|
57
|
+
/** Aggregate closure receipt for the grammar-derived refusal corpus. */
|
|
58
|
+
export interface PmGrammarRefusalClosureReport {
|
|
59
|
+
/** Whether every declared probe refused safely and recovered. */
|
|
60
|
+
ok: boolean;
|
|
61
|
+
/** Number of declared probes. */
|
|
62
|
+
probe_count: number;
|
|
63
|
+
/** Number of probes without findings. */
|
|
64
|
+
closed_probe_count: number;
|
|
65
|
+
/** Stable actionable failures. */
|
|
66
|
+
findings: PmGrammarRefusalFinding[];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Return one omission probe for every required slot in the declared grammar.
|
|
70
|
+
* Earlier positionals receive deterministic, non-mutating placeholder values.
|
|
71
|
+
*/
|
|
72
|
+
export declare function listPmRequiredArgumentRefusalContracts(contracts?: readonly PmCommandPositionalContract[]): PmRequiredArgumentRefusalContract[];
|
|
73
|
+
/** Return one invalid-action probe for every required positional action family. */
|
|
74
|
+
export declare function listPmSubcommandRefusalContracts(contracts?: readonly PmCommandPositionalContract[]): PmSubcommandRefusalContract[];
|
|
75
|
+
/** Score exact code, exit, domain, state-safety, and recovery closure. */
|
|
76
|
+
export declare function scorePmGrammarRefusalClosure(contracts: readonly (PmRequiredArgumentRefusalContract | PmSubcommandRefusalContract)[], observations: readonly PmGrammarRefusalObservation[]): PmGrammarRefusalClosureReport;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/agent/refusal-corpus-contracts
|
|
3
|
+
*
|
|
4
|
+
* Derives executable refusal probes from the public CLI grammar. The corpus is
|
|
5
|
+
* fail-closed: adding a required positional slot or action-dispatching command
|
|
6
|
+
* automatically adds a probe, while an action family without an authoritative
|
|
7
|
+
* value domain throws during contract construction.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
!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]="2e90ea29-2708-5af8-b390-599be97718e7")}catch(e){}}();
|
|
11
|
+
import { PLAN_SUBCOMMANDS } from "../lifecycle/plan.js";
|
|
12
|
+
import { PROFILE_SUBCOMMANDS } from "../profile.js";
|
|
13
|
+
import { SCHEMA_SUBCOMMANDS } from "../schema.js";
|
|
14
|
+
import { GRAPH_SUBCOMMAND_VALUES, MERGE_SUBCOMMAND_VALUES, } from "../cli-contracts/enum-contracts.js";
|
|
15
|
+
import { PM_COMMAND_DESTINATION_CONTRACTS, PM_COMMAND_POSITIONAL_CONTRACTS, PM_POSITIONAL_ACTION_CONTRACTS, } from "../cli-contracts/grammar-contracts.js";
|
|
16
|
+
import { resolveSubcommandFlagContractsForCommand } from "../cli-contracts/flag-contracts.js";
|
|
17
|
+
const REJECTED_ACTION = "not-a-declared-action";
|
|
18
|
+
function positionalPlaceholder(command, slot) {
|
|
19
|
+
if (command.startsWith("assurance ") && slot.name === "kind") {
|
|
20
|
+
return "measurement";
|
|
21
|
+
}
|
|
22
|
+
switch (slot.value_kind) {
|
|
23
|
+
case "integer":
|
|
24
|
+
return "1";
|
|
25
|
+
case "item_id":
|
|
26
|
+
return "pm-domain";
|
|
27
|
+
case "action":
|
|
28
|
+
throw new Error(`Cannot synthesize a preceding action value for positional slot ${slot.name}.`);
|
|
29
|
+
default:
|
|
30
|
+
return "example";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function probeSlug(value) {
|
|
34
|
+
return value.replaceAll(/[^a-z0-9]+/gu, "-").replaceAll(/^-|-$/gu, "");
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Return one omission probe for every required slot in the declared grammar.
|
|
38
|
+
* Earlier positionals receive deterministic, non-mutating placeholder values.
|
|
39
|
+
*/
|
|
40
|
+
export function listPmRequiredArgumentRefusalContracts(contracts = PM_COMMAND_POSITIONAL_CONTRACTS.filter((contract) => PM_COMMAND_DESTINATION_CONTRACTS.some((destination) => destination.command === contract.command &&
|
|
41
|
+
destination.disposition !== "package_owned"))) {
|
|
42
|
+
return contracts
|
|
43
|
+
.flatMap((contract) => contract.slots.flatMap((slot, index) => {
|
|
44
|
+
if (!slot.required)
|
|
45
|
+
return [];
|
|
46
|
+
const commandArguments = contract.command.split(" ");
|
|
47
|
+
const requiredFlagArguments = resolveSubcommandFlagContractsForCommand(contract.command).flatMap((flagContract) => flagContract.required
|
|
48
|
+
? [
|
|
49
|
+
flagContract.flag,
|
|
50
|
+
...(flagContract.value_name ? ["example"] : []),
|
|
51
|
+
]
|
|
52
|
+
: []);
|
|
53
|
+
const isVirtualAction = PM_POSITIONAL_ACTION_CONTRACTS.some((actionContract) => actionContract.command === contract.command);
|
|
54
|
+
return [
|
|
55
|
+
{
|
|
56
|
+
probe_id: `required-argument-${probeSlug(contract.command)}-${probeSlug(slot.name)}`,
|
|
57
|
+
command: contract.command,
|
|
58
|
+
refusal_args: [
|
|
59
|
+
...commandArguments,
|
|
60
|
+
...contract.slots
|
|
61
|
+
.slice(0, index)
|
|
62
|
+
.map((priorSlot) => positionalPlaceholder(contract.command, priorSlot)),
|
|
63
|
+
...requiredFlagArguments,
|
|
64
|
+
],
|
|
65
|
+
recovery_args: [...commandArguments, "--help"],
|
|
66
|
+
error_code: isVirtualAction && !contract.command.startsWith("assurance ")
|
|
67
|
+
? "invalid_argument_value"
|
|
68
|
+
: /^extension (?:activate|adopt|deactivate|uninstall)$/u.test(contract.command)
|
|
69
|
+
? "missing_lifecycle_target"
|
|
70
|
+
: "missing_required_argument",
|
|
71
|
+
missing_argument: slot.name,
|
|
72
|
+
missing_argument_index: index,
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
}))
|
|
76
|
+
.sort((left, right) => left.probe_id.localeCompare(right.probe_id));
|
|
77
|
+
}
|
|
78
|
+
function positionalActionValues(command) {
|
|
79
|
+
switch (command) {
|
|
80
|
+
case "assurance":
|
|
81
|
+
case "workspace snapshot":
|
|
82
|
+
return PM_POSITIONAL_ACTION_CONTRACTS.filter(({ parent }) => parent === command).map(({ action }) => action);
|
|
83
|
+
case "graph":
|
|
84
|
+
return GRAPH_SUBCOMMAND_VALUES;
|
|
85
|
+
case "merge":
|
|
86
|
+
return MERGE_SUBCOMMAND_VALUES;
|
|
87
|
+
case "plan":
|
|
88
|
+
return PLAN_SUBCOMMANDS;
|
|
89
|
+
case "profile":
|
|
90
|
+
return PROFILE_SUBCOMMANDS;
|
|
91
|
+
case "schema":
|
|
92
|
+
return SCHEMA_SUBCOMMANDS;
|
|
93
|
+
default:
|
|
94
|
+
throw new Error(`Required positional action family ${command} has no authoritative value domain.`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/** Return one invalid-action probe for every required positional action family. */
|
|
98
|
+
export function listPmSubcommandRefusalContracts(contracts = PM_COMMAND_POSITIONAL_CONTRACTS) {
|
|
99
|
+
return contracts
|
|
100
|
+
.filter(({ slots }) => slots[0]?.required === true && slots[0].value_kind === "action")
|
|
101
|
+
.map(({ command }) => {
|
|
102
|
+
const commandArguments = command.split(" ");
|
|
103
|
+
return {
|
|
104
|
+
probe_id: `unknown-subcommand-${probeSlug(command)}`,
|
|
105
|
+
command,
|
|
106
|
+
refusal_args: [...commandArguments, REJECTED_ACTION],
|
|
107
|
+
recovery_args: [...commandArguments, "--help"],
|
|
108
|
+
error_code: "unknown_subcommand",
|
|
109
|
+
rejected_value: REJECTED_ACTION,
|
|
110
|
+
allowed_values: [...positionalActionValues(command)].sort(),
|
|
111
|
+
};
|
|
112
|
+
})
|
|
113
|
+
.sort((left, right) => left.probe_id.localeCompare(right.probe_id));
|
|
114
|
+
}
|
|
115
|
+
function sameValues(left, right) {
|
|
116
|
+
const sortedRight = [...right].sort();
|
|
117
|
+
return (left.length === right.length &&
|
|
118
|
+
[...left].sort().every((value, index) => value === sortedRight[index]));
|
|
119
|
+
}
|
|
120
|
+
function scoreGrammarRefusalObservation(contract, observation) {
|
|
121
|
+
if (!observation) {
|
|
122
|
+
return [
|
|
123
|
+
{
|
|
124
|
+
code: "refusal_probe_missing",
|
|
125
|
+
probe_id: contract.probe_id,
|
|
126
|
+
detail: `${contract.probe_id} has no runtime observation.`,
|
|
127
|
+
},
|
|
128
|
+
];
|
|
129
|
+
}
|
|
130
|
+
const findings = [];
|
|
131
|
+
if (observation.error_code !== contract.error_code) {
|
|
132
|
+
findings.push({
|
|
133
|
+
code: "refusal_error_code_mismatch",
|
|
134
|
+
probe_id: contract.probe_id,
|
|
135
|
+
detail: `${contract.probe_id} emitted ${observation.error_code || "<none>"}; expected ${contract.error_code}.`,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
if (observation.exit_code !== 2) {
|
|
139
|
+
findings.push({
|
|
140
|
+
code: "refusal_exit_code_mismatch",
|
|
141
|
+
probe_id: contract.probe_id,
|
|
142
|
+
detail: `${contract.probe_id} exited ${observation.exit_code}; expected usage exit 2.`,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
if ("allowed_values" in contract &&
|
|
146
|
+
!sameValues(observation.allowed_values, contract.allowed_values)) {
|
|
147
|
+
findings.push({
|
|
148
|
+
code: "refusal_allowed_values_mismatch",
|
|
149
|
+
probe_id: contract.probe_id,
|
|
150
|
+
detail: `${contract.probe_id} did not expose its complete action domain.`,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
if (!observation.recovery_succeeded) {
|
|
154
|
+
findings.push({
|
|
155
|
+
code: "refusal_recovery_failed",
|
|
156
|
+
probe_id: contract.probe_id,
|
|
157
|
+
detail: `${contract.probe_id} help recovery did not succeed.`,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
if (observation.refusal_mutated_state) {
|
|
161
|
+
findings.push({
|
|
162
|
+
code: "refusal_mutated_state",
|
|
163
|
+
probe_id: contract.probe_id,
|
|
164
|
+
detail: `${contract.probe_id} changed tracker state while refusing input${observation.mutated_paths?.length ? `: ${observation.mutated_paths.join(", ")}` : "."}`,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
return findings;
|
|
168
|
+
}
|
|
169
|
+
/** Score exact code, exit, domain, state-safety, and recovery closure. */
|
|
170
|
+
export function scorePmGrammarRefusalClosure(contracts, observations) {
|
|
171
|
+
const contractsById = new Map(contracts.map((contract) => [contract.probe_id, contract]));
|
|
172
|
+
const observationsById = new Map(observations.map((observation) => [observation.probe_id, observation]));
|
|
173
|
+
const findings = [
|
|
174
|
+
...contracts.flatMap((contract) => scoreGrammarRefusalObservation(contract, observationsById.get(contract.probe_id))),
|
|
175
|
+
...observations
|
|
176
|
+
.filter((observation) => !contractsById.has(observation.probe_id))
|
|
177
|
+
.map((observation) => ({
|
|
178
|
+
code: "unexpected_refusal_probe",
|
|
179
|
+
probe_id: observation.probe_id,
|
|
180
|
+
detail: `${observation.probe_id} has no declared grammar refusal contract.`,
|
|
181
|
+
})),
|
|
182
|
+
];
|
|
183
|
+
findings.sort((left, right) => left.probe_id.localeCompare(right.probe_id) ||
|
|
184
|
+
left.code.localeCompare(right.code));
|
|
185
|
+
const failedProbeIds = new Set(findings.map(({ probe_id: probeId }) => probeId));
|
|
186
|
+
return {
|
|
187
|
+
ok: findings.length === 0,
|
|
188
|
+
probe_count: contracts.length,
|
|
189
|
+
closed_probe_count: contracts.filter(({ probe_id: probeId }) => !failedProbeIds.has(probeId)).length,
|
|
190
|
+
findings,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=refusal-corpus-contracts.js.map
|
|
194
|
+
//# debugId=2e90ea29-2708-5af8-b390-599be97718e7
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* output policy without coupling package authors to pm's renderer.
|
|
7
7
|
*/
|
|
8
8
|
|
|
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]="
|
|
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]="1d338971-5a60-5b4e-b4c8-0705c8e8c98c")}catch(e){}}();
|
|
10
10
|
import { PM_CORE_COMMAND_NAMES } from "./enum-contracts.js";
|
|
11
11
|
/** Stable degradation stages applied when an output exceeds its token budget. */
|
|
12
12
|
export const PM_OUTPUT_DEGRADATION_STEPS = [
|
|
@@ -218,8 +218,10 @@ function compactDiagnosticRecovery(value) {
|
|
|
218
218
|
"retry_after_ms",
|
|
219
219
|
]) {
|
|
220
220
|
const candidate = value[key];
|
|
221
|
-
if (Array.isArray(candidate))
|
|
222
|
-
compact[key] =
|
|
221
|
+
if (Array.isArray(candidate)) {
|
|
222
|
+
compact[key] =
|
|
223
|
+
key === "suggested_retry_args" ? candidate : candidate.slice(0, 3);
|
|
224
|
+
}
|
|
223
225
|
else if (candidate !== undefined)
|
|
224
226
|
compact[key] = candidate;
|
|
225
227
|
}
|
|
@@ -473,4 +475,4 @@ export function projectPmDiagnosticText(output, correctiveAction, options = {})
|
|
|
473
475
|
};
|
|
474
476
|
}
|
|
475
477
|
//# sourceMappingURL=agent-output-contracts.js.map
|
|
476
|
-
//# debugId=
|
|
478
|
+
//# debugId=1d338971-5a60-5b4e-b4c8-0705c8e8c98c
|
|
@@ -28,6 +28,10 @@ export declare const PM_CORE_COMMAND_NAMES: readonly ["init", "config", "extensi
|
|
|
28
28
|
export declare const GRAPH_SUBCOMMAND_VALUES: readonly ["ancestors", "descendants", "predecessors", "successors", "paths", "impact", "analyze", "audit", "communities", "redundancy", "dominators", "slack", "centrality", "articulation", "plan", "index"];
|
|
29
29
|
/** Restricts graph subcommand values accepted by command, SDK, and MCP contracts. */
|
|
30
30
|
export type GraphSubcommand = (typeof GRAPH_SUBCOMMAND_VALUES)[number];
|
|
31
|
+
/** Supported values accepted by the merge subcommand contract across CLI and SDK surfaces. */
|
|
32
|
+
export declare const MERGE_SUBCOMMAND_VALUES: readonly ["install", "reconcile", "report", "driver"];
|
|
33
|
+
/** Restricts merge subcommand values accepted by command and SDK contracts. */
|
|
34
|
+
export type MergeSubcommand = (typeof MERGE_SUBCOMMAND_VALUES)[number];
|
|
31
35
|
/** Nested lifecycle verbs flattened by SDK and MCP package actions. */
|
|
32
36
|
export declare const PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS: readonly ["init", "install", "uninstall", "explore", "manage", "describe", "reload", "doctor", "catalog", "adopt", "adopt-all", "activate", "deactivate"];
|
|
33
37
|
/** Noun-first item lifecycle verbs flattened for SDK and MCP dispatch. */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Defines SDK command-contract metadata for Enum Contracts.
|
|
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]="3935bae8-0a40-59ea-aca6-64e238d1f318")}catch(e){}}();
|
|
8
8
|
import { KNOWN_EXTENSION_CAPABILITIES, KNOWN_EXTENSION_POLICY_MODES, KNOWN_EXTENSION_POLICY_SURFACES, KNOWN_EXTENSION_SANDBOX_PROFILES, KNOWN_EXTENSION_SERVICE_NAMES, KNOWN_EXTENSION_TRUST_MODES, } from "../../core/extensions/extension-types.js";
|
|
9
9
|
import { PM_COMMAND_ALIAS_CONTRACTS } from "./command-aliases.js";
|
|
10
10
|
/** Public contract for pm extension capability contracts, shared by SDK and presentation-layer consumers. */
|
|
@@ -124,6 +124,13 @@ export const GRAPH_SUBCOMMAND_VALUES = [
|
|
|
124
124
|
"plan",
|
|
125
125
|
"index",
|
|
126
126
|
];
|
|
127
|
+
/** Supported values accepted by the merge subcommand contract across CLI and SDK surfaces. */
|
|
128
|
+
export const MERGE_SUBCOMMAND_VALUES = [
|
|
129
|
+
"install",
|
|
130
|
+
"reconcile",
|
|
131
|
+
"report",
|
|
132
|
+
"driver",
|
|
133
|
+
];
|
|
127
134
|
/** Nested lifecycle verbs flattened by SDK and MCP package actions. */
|
|
128
135
|
export const PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS = [
|
|
129
136
|
"init",
|
|
@@ -208,4 +215,4 @@ export function isPmExtensionPolicySurfaceContract(value) {
|
|
|
208
215
|
return PM_EXTENSION_POLICY_SURFACE_CONTRACTS.includes(value);
|
|
209
216
|
}
|
|
210
217
|
//# sourceMappingURL=enum-contracts.js.map
|
|
211
|
-
//# debugId=
|
|
218
|
+
//# debugId=3935bae8-0a40-59ea-aca6-64e238d1f318
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* flag surface stays single-sourced across the CLI, SDK, and MCP boundaries.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!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]="
|
|
10
|
+
!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]="6664bc8f-e5da-5593-a2df-ac45f1cef09e")}catch(e){}}();
|
|
11
11
|
import { normalizeUniqueStringList } from "./string-lists.js";
|
|
12
12
|
import { RESERVED_EXTENSION_HOST_FLAGS } from "../../core/extensions/reserved-host-flags.js";
|
|
13
13
|
import { PM_POSITIONAL_ACTION_CONTRACTS, } from "./grammar-contracts.js";
|
|
@@ -894,6 +894,10 @@ export const TEST_FLAG_CONTRACTS = [
|
|
|
894
894
|
{ flag: "--shared-host-safe" },
|
|
895
895
|
{ flag: "--pm-context" },
|
|
896
896
|
{ flag: "--override-linked-pm-context" },
|
|
897
|
+
{ flag: "--workspace-context" },
|
|
898
|
+
{ flag: "--override-linked-workspace-context" },
|
|
899
|
+
{ flag: "--allow-untrusted-linked-tests" },
|
|
900
|
+
{ flag: "--acknowledge-linked-tests" },
|
|
897
901
|
{ flag: "--fail-on-context-mismatch" },
|
|
898
902
|
{ flag: "--fail-on-skipped" },
|
|
899
903
|
{ flag: "--fail-on-empty-test-run" },
|
|
@@ -920,6 +924,9 @@ export const TEST_ALL_FLAG_CONTRACTS = [
|
|
|
920
924
|
{ flag: "--shared-host-safe" },
|
|
921
925
|
{ flag: "--pm-context" },
|
|
922
926
|
{ flag: "--override-linked-pm-context" },
|
|
927
|
+
{ flag: "--workspace-context" },
|
|
928
|
+
{ flag: "--override-linked-workspace-context" },
|
|
929
|
+
{ flag: "--allow-untrusted-linked-tests" },
|
|
923
930
|
{ flag: "--fail-on-context-mismatch" },
|
|
924
931
|
{ flag: "--fail-on-skipped" },
|
|
925
932
|
{ flag: "--fail-on-empty-test-run" },
|
|
@@ -1901,4 +1908,4 @@ export function toCompletionFlagString(flagContracts, includeGlobal = true) {
|
|
|
1901
1908
|
return normalizeUniqueStringList(all).join(" ");
|
|
1902
1909
|
}
|
|
1903
1910
|
//# sourceMappingURL=flag-contracts.js.map
|
|
1904
|
-
//# debugId=
|
|
1911
|
+
//# debugId=6664bc8f-e5da-5593-a2df-ac45f1cef09e
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* per-command growth budgets.
|
|
6
6
|
*/
|
|
7
7
|
|
|
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]="
|
|
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]="8320177c-e95d-5d14-a914-4ac37230c0b9")}catch(e){}}();
|
|
9
9
|
import { hasSubcommandFlagContractsForCommand, resolveSubcommandFlagContractsForCommand, } from "./flag-contracts.js";
|
|
10
10
|
import { PM_COMMAND_CAPABILITY_CONTRACTS, } from "../agent-capability-contracts.js";
|
|
11
11
|
import { enrichCliFlagInvocationContracts } from "../flag-invocation-contracts.js";
|
|
@@ -153,8 +153,8 @@ const PM_COMMAND_FLAG_BUDGET_MAXIMUMS = Object.freeze({
|
|
|
153
153
|
docs: 30,
|
|
154
154
|
deps: 32,
|
|
155
155
|
plan: 109,
|
|
156
|
-
test:
|
|
157
|
-
"test-all":
|
|
156
|
+
test: 52,
|
|
157
|
+
"test-all": 40,
|
|
158
158
|
telemetry: 21,
|
|
159
159
|
stats: 29,
|
|
160
160
|
health: 36,
|
|
@@ -337,4 +337,4 @@ export function renderPmFlagLexiconMarkdown() {
|
|
|
337
337
|
].join("\n");
|
|
338
338
|
}
|
|
339
339
|
//# sourceMappingURL=flag-lexicon-contracts.js.map
|
|
340
|
-
//# debugId=
|
|
340
|
+
//# debugId=8320177c-e95d-5d14-a914-4ac37230c0b9
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides CLI runtime support for Registration Helpers.
|
|
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]="01742f33-d1e8-5684-a585-2add88ddb73c")}catch(e){}}();
|
|
8
8
|
import { Option } from "commander";
|
|
9
9
|
import { pathExists, refreshSearchArtifactsForMutation, shouldRunSearchRefreshInForeground, EXIT_CODE, PmCliError, printError, printResult, writeStdout, getSettingsPath, resolvePmRoot, readSettings, runActiveServiceOverride, setActiveCommandResult, } from "../runtime-primitives.js";
|
|
10
10
|
import { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, NEXT_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, readFirstValueFromCommanderOptions, readFirstStringFromCommanderOptions, readStringArrayFromCommanderOptions, } from "../cli-contracts.js";
|
|
@@ -259,6 +259,9 @@ function pushSharedBackgroundTestCommandArgs(args, options) {
|
|
|
259
259
|
pushOptionalBooleanFlag(args, "--shared-host-safe", options.sharedHostSafe);
|
|
260
260
|
pushOptionalValueFlag(args, "--pm-context", options.pmContext);
|
|
261
261
|
pushOptionalBooleanFlag(args, "--override-linked-pm-context", options.overrideLinkedPmContext);
|
|
262
|
+
pushOptionalValueFlag(args, "--workspace-context", options.workspaceContext);
|
|
263
|
+
pushOptionalBooleanFlag(args, "--override-linked-workspace-context", options.overrideLinkedWorkspaceContext);
|
|
264
|
+
pushOptionalBooleanFlag(args, "--allow-untrusted-linked-tests", options.allowUntrustedLinkedTests);
|
|
262
265
|
pushOptionalBooleanFlag(args, "--fail-on-context-mismatch", options.failOnContextMismatch);
|
|
263
266
|
pushOptionalBooleanFlag(args, "--fail-on-skipped", options.failOnSkipped);
|
|
264
267
|
pushOptionalBooleanFlag(args, "--fail-on-empty-test-run", options.failOnEmptyTestRun);
|
|
@@ -985,4 +988,4 @@ export const _testOnly = {
|
|
|
985
988
|
collectMutationItemIds,
|
|
986
989
|
};
|
|
987
990
|
//# sourceMappingURL=registration-helpers.js.map
|
|
988
|
-
//# debugId=
|
|
991
|
+
//# debugId=01742f33-d1e8-5684-a585-2add88ddb73c
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Defines SDK command-contract metadata for Tool Parameter Tables.
|
|
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]="fc485dff-5576-536e-86b2-8cc167d4513c")}catch(e){}}();
|
|
8
8
|
import { PLAN_HARNESS_VALUES, PLAN_MODE_VALUES, PLAN_STEP_LINK_KIND_VALUES, PLAN_STEP_STATUS_VALUES, } from "../../types/index.js";
|
|
9
9
|
import { PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS } from "../read-output-session.js";
|
|
10
10
|
import { ASSURANCE_DEFINITION_SCHEMA } from "./schemas/assurance-definition.js";
|
|
@@ -398,6 +398,13 @@ export const PM_TOOL_PARAMETER_PROPERTIES = {
|
|
|
398
398
|
ignoreGlobal: { type: "boolean" },
|
|
399
399
|
pmContext: { type: "string", enum: ["schema", "tracker", "auto"] },
|
|
400
400
|
overrideLinkedPmContext: { type: "boolean" },
|
|
401
|
+
workspaceContext: {
|
|
402
|
+
type: "string",
|
|
403
|
+
enum: ["source", "isolated", "snapshot"],
|
|
404
|
+
},
|
|
405
|
+
overrideLinkedWorkspaceContext: { type: "boolean" },
|
|
406
|
+
allowUntrustedLinkedTests: { type: "boolean" },
|
|
407
|
+
acknowledgeLinkedTests: { type: "boolean" },
|
|
401
408
|
failOnContextMismatch: { type: "boolean" },
|
|
402
409
|
failOnSkipped: { type: "boolean" },
|
|
403
410
|
failOnEmptyTestRun: { type: "boolean" },
|
|
@@ -1376,6 +1383,19 @@ export const PM_TOOL_PARAMETER_METADATA = {
|
|
|
1376
1383
|
overrideLinkedPmContext: {
|
|
1377
1384
|
description: "Force run-level --pm-context to override per-linked-test pm_context_mode metadata for all linked-test entries.",
|
|
1378
1385
|
},
|
|
1386
|
+
workspaceContext: {
|
|
1387
|
+
description: "Source-workspace mode: source preserves read-only source context, isolated omits it for self-sandboxing commands, and snapshot runs from a temporary workspace paired with the selected tracker sandbox.",
|
|
1388
|
+
examples: ["source", "isolated", "snapshot"],
|
|
1389
|
+
},
|
|
1390
|
+
overrideLinkedWorkspaceContext: {
|
|
1391
|
+
description: "Force run-level --workspace-context over per-linked-test workspace_context_mode metadata.",
|
|
1392
|
+
},
|
|
1393
|
+
allowUntrustedLinkedTests: {
|
|
1394
|
+
description: "Explicitly execute commands not yet trusted by this clone when testing.allow_untrusted_linked_tests is also enabled.",
|
|
1395
|
+
},
|
|
1396
|
+
acknowledgeLinkedTests: {
|
|
1397
|
+
description: "Record clone-local trust for the item's current linked commands without executing them.",
|
|
1398
|
+
},
|
|
1379
1399
|
failOnContextMismatch: {
|
|
1380
1400
|
description: "Fail linked PM command runs when source and sandbox tracker item counts differ.",
|
|
1381
1401
|
},
|
|
@@ -2072,4 +2092,4 @@ export const PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
|
|
|
2072
2092
|
},
|
|
2073
2093
|
};
|
|
2074
2094
|
//# sourceMappingURL=tool-parameter-tables.js.map
|
|
2075
|
-
//# debugId=
|
|
2095
|
+
//# debugId=fc485dff-5576-536e-86b2-8cc167d4513c
|