@unbrained/pm-cli 2026.8.19 → 2026.8.21
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 +41 -0
- package/dist/cli/error-guidance.d.ts +20 -0
- package/dist/cli/error-guidance.js +29 -30
- package/dist/cli/register-list-query.js +12 -10
- package/dist/cli/register-structured-mutation.d.ts +2 -0
- package/dist/cli/register-structured-mutation.js +29 -6
- package/dist/cli-bundle/bundle-manifest.json +156 -148
- package/dist/cli-bundle/chunks/chunk-2MA6ZQVZ.js +197 -0
- package/dist/cli-bundle/chunks/{chunk-4NRRH7AM.js → chunk-3AFAUHUE.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-7VHZS727.js +5 -0
- package/dist/cli-bundle/chunks/chunk-BKYB45NQ.js +2092 -0
- package/dist/cli-bundle/chunks/{chunk-BHYMXLAE.js → chunk-BUNIEJNE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QXSH7BLM.js → chunk-JSLOFXGA.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-LARJJ3RK.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-TOXJM4WA.js → chunk-LOVTQ52Z.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-N3DSV4CH.js +77 -0
- package/dist/cli-bundle/chunks/chunk-OCLPLFAY.js +35 -0
- package/dist/cli-bundle/chunks/chunk-S4IRYKBU.js +13 -0
- package/dist/cli-bundle/chunks/register-list-query-F57EWDEF.js +11 -0
- package/dist/cli-bundle/chunks/{register-mutation-AUWVCW4M.js → register-mutation-7IY2D5KO.js} +20 -20
- package/dist/cli-bundle/chunks/{register-operations-PZQPHXW5.js → register-operations-FALL3YTU.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-I4LUHGVW.js → register-setup-HXU7IZZD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-2NIY5NKG.js +18 -0
- package/dist/cli-bundle/focused-chunks/{chunk-US7VEYZG.js → chunk-4ERLO7QD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-7WZRLCYF.js +50 -0
- package/dist/cli-bundle/focused-chunks/{chunk-MCZXYZAF.js → chunk-CKKQSJNN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-EEFKYMDR.js +16 -0
- package/dist/cli-bundle/focused-chunks/{chunk-ZBIQQYMI.js → chunk-F2A56DHV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ESISGDAY.js → chunk-F4YEW5I2.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ODHQEECS.js → chunk-FH6DYED3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-FJ22HNRP.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-FV5ACOK7.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-JEAVFOWM.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-EXBCLIBU.js → chunk-KDNG7TKQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-NJ63LOP6.js +155 -0
- package/dist/cli-bundle/focused-chunks/chunk-NXRTQ7HI.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-JDOMQ7VQ.js → chunk-TJ7EMJ46.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-UZE7XUZK.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-DKPLYW3L.js → chunk-YKBKIEAJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-VXDSU5MC.js → chunk-ZOSEELYJ.js} +2 -2
- package/dist/cli-bundle/main.js +12 -12
- 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 +41 -41
- 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 +32 -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/output/mutation-projection.js +26 -2
- package/dist/core/shared/constants.d.ts +1 -5
- package/dist/core/shared/constants.js +3 -81
- package/dist/core/shared/errors.d.ts +16 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/item-metadata-contract.d.ts +14 -0
- package/dist/core/shared/item-metadata-contract.js +90 -0
- package/dist/core/store/item-store.d.ts +60 -0
- package/dist/core/store/item-store.js +26 -94
- package/dist/core/store/tracker-preflight.d.ts +7 -0
- package/dist/core/store/tracker-preflight.js +142 -0
- package/dist/sdk/agent/closed-domain-contracts.d.ts +25 -0
- package/dist/sdk/agent/closed-domain-contracts.js +140 -0
- package/dist/sdk/agent/refusal-closure.d.ts +13 -1
- package/dist/sdk/agent/refusal-closure.js +45 -3
- package/dist/sdk/agent/refusal-reachability.d.ts +26 -0
- package/dist/sdk/agent/refusal-reachability.js +26 -2
- package/dist/sdk/agent/tracker-preflight-contracts.d.ts +63 -0
- package/dist/sdk/agent/tracker-preflight-contracts.js +127 -0
- package/dist/sdk/agent-capability-contracts.js +6 -11
- package/dist/sdk/annotations.js +6 -7
- package/dist/sdk/cli-contracts/completeness.js +8 -2
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -2
- package/dist/sdk/cli-contracts/enum-contracts.js +16 -6
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +11 -2
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.d.ts +19 -2
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +105 -5
- package/dist/sdk/cli-contracts/grammar-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts/grammar-contracts.js +5 -2
- package/dist/sdk/cli-contracts/runtime-contracts.js +7 -3
- package/dist/sdk/cli-contracts/tool-schema.js +7 -2
- package/dist/sdk/cli-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts.js +4 -4
- package/dist/sdk/config.d.ts +5 -0
- package/dist/sdk/config.js +5 -5
- package/dist/sdk/context-intent-runtime.js +7 -4
- package/dist/sdk/contracts.d.ts +2 -0
- package/dist/sdk/contracts.js +4 -2
- package/dist/sdk/core.d.ts +1 -1
- package/dist/sdk/core.js +3 -3
- package/dist/sdk/dependencies.js +5 -7
- package/dist/sdk/dependency-flag-validation.d.ts +1 -1
- package/dist/sdk/dependency-flag-validation.js +10 -4
- package/dist/sdk/environment/tracker-preflight.d.ts +6 -0
- package/dist/sdk/environment/tracker-preflight.js +10 -0
- package/dist/sdk/eval.js +5 -7
- package/dist/sdk/files.js +6 -10
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +110 -2
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +179 -46
- package/dist/sdk/governance/assurance.d.ts +36 -2
- package/dist/sdk/governance/assurance.js +184 -10
- package/dist/sdk/governance/gc.js +5 -6
- package/dist/sdk/governance/health.js +5 -6
- package/dist/sdk/governance/reindex.js +5 -6
- package/dist/sdk/governance/validate.d.ts +1 -2
- package/dist/sdk/governance/validate.js +6 -12
- package/dist/sdk/graph/governance.d.ts +7 -5
- package/dist/sdk/graph/governance.js +32 -16
- package/dist/sdk/graph/run.js +5 -7
- package/dist/sdk/graph/traversal.js +14 -5
- package/dist/sdk/history-compact.js +6 -9
- package/dist/sdk/history-read.js +5 -7
- package/dist/sdk/history-redact.js +5 -6
- package/dist/sdk/history-repair.js +6 -9
- package/dist/sdk/improvement-ledger.js +7 -10
- package/dist/sdk/index.d.ts +7 -3
- package/dist/sdk/index.js +8 -4
- package/dist/sdk/init-agent-guidance.d.ts +5 -3
- package/dist/sdk/init-agent-guidance.js +69 -9
- package/dist/sdk/lifecycle/append.d.ts +0 -5
- package/dist/sdk/lifecycle/append.js +5 -6
- package/dist/sdk/lifecycle/claim.d.ts +0 -5
- package/dist/sdk/lifecycle/claim.js +6 -9
- package/dist/sdk/lifecycle/close-many.d.ts +0 -5
- package/dist/sdk/lifecycle/close-many.js +5 -6
- package/dist/sdk/lifecycle/close.d.ts +0 -5
- package/dist/sdk/lifecycle/close.js +5 -6
- package/dist/sdk/lifecycle/copy.d.ts +0 -5
- package/dist/sdk/lifecycle/copy.js +5 -6
- package/dist/sdk/lifecycle/create.d.ts +0 -5
- package/dist/sdk/lifecycle/create.js +5 -9
- package/dist/sdk/lifecycle/delete.js +5 -6
- package/dist/sdk/lifecycle/focus.d.ts +0 -5
- package/dist/sdk/lifecycle/focus.js +5 -6
- package/dist/sdk/lifecycle/mcp-actions.d.ts +18 -0
- package/dist/sdk/lifecycle/mcp-actions.js +52 -0
- package/dist/sdk/lifecycle/plan.d.ts +0 -5
- package/dist/sdk/lifecycle/plan.js +5 -6
- package/dist/sdk/lifecycle/reopen.d.ts +44 -0
- package/dist/sdk/lifecycle/reopen.js +69 -0
- package/dist/sdk/lifecycle/restore.js +5 -6
- package/dist/sdk/lifecycle/update-many.d.ts +0 -5
- package/dist/sdk/lifecycle/update-many.js +5 -6
- package/dist/sdk/lifecycle/update.d.ts +31 -5
- package/dist/sdk/lifecycle/update.js +140 -19
- package/dist/sdk/linked-artifacts.js +6 -7
- package/dist/sdk/merge/install.js +5 -6
- package/dist/sdk/mutation-events.js +5 -7
- package/dist/sdk/package-import-adapters.js +6 -8
- package/dist/sdk/profile.js +6 -7
- package/dist/sdk/query/activity.js +5 -6
- package/dist/sdk/query/calendar.js +5 -6
- package/dist/sdk/query/get.d.ts +1 -6
- package/dist/sdk/query/get.js +20 -55
- package/dist/sdk/query/history.d.ts +0 -5
- package/dist/sdk/query/history.js +5 -6
- package/dist/sdk/query/list.d.ts +7 -21
- package/dist/sdk/query/list.js +38 -54
- package/dist/sdk/query/projection-contracts.d.ts +33 -0
- package/dist/sdk/query/projection-contracts.js +185 -0
- package/dist/sdk/query/search-contracts.d.ts +2 -1
- package/dist/sdk/query/search-contracts.js +18 -87
- package/dist/sdk/query/search.d.ts +15 -0
- package/dist/sdk/query/search.js +34 -10
- package/dist/sdk/relationship-kinds/contract.d.ts +8 -0
- package/dist/sdk/relationship-kinds/contract.js +13 -13
- package/dist/sdk/relationships.d.ts +1 -1
- package/dist/sdk/relationships.js +20 -2
- package/dist/sdk/runtime-primitives.d.ts +1 -1
- package/dist/sdk/runtime-primitives.js +3 -3
- package/dist/sdk/runtime.d.ts +6 -0
- package/dist/sdk/runtime.js +18 -14
- package/dist/sdk/schema-migration.js +6 -7
- package/dist/sdk/schema.js +5 -6
- package/dist/sdk/similarity.d.ts +13 -0
- package/dist/sdk/similarity.js +32 -6
- package/dist/sdk/stats.js +5 -8
- package/dist/sdk/templates.js +5 -6
- package/dist/sdk/test/batch.js +5 -7
- package/dist/sdk/test/execution.js +4 -5
- package/dist/sdk/test/runs.js +5 -7
- package/docs/AGENT_UX_CONTRACTS.md +8 -1
- package/docs/COMMANDS.md +13 -1
- package/docs/DEPENDENCY_KIND_CONTRACT.md +12 -1
- package/docs/README.md +1 -0
- package/docs/RECURRENCE_RECOVERY_CONTRACTS.md +151 -0
- package/docs/RELATIONSHIP_GRAPH.md +92 -10
- package/docs/SDK.md +10 -2
- package/docs/SDK_CONTEXT_INTEGRITY.md +45 -0
- package/docs/SDK_PRIMITIVE_INVENTORY.md +15 -1
- package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -1
- package/docs/performance/sdk-entrypoint-import-costs.md +14 -21
- package/marketplace.json +2 -2
- package/package.json +5 -5
- 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 +640 -44
- package/dist/cli-bundle/chunks/chunk-4THEB6PD.js +0 -13
- package/dist/cli-bundle/chunks/chunk-GWMXAQOD.js +0 -197
- package/dist/cli-bundle/chunks/chunk-HVFQTLYM.js +0 -35
- package/dist/cli-bundle/chunks/chunk-OI4XI562.js +0 -5
- package/dist/cli-bundle/chunks/chunk-OIOKV6NO.js +0 -2092
- package/dist/cli-bundle/chunks/chunk-SARFF5H5.js +0 -3
- package/dist/cli-bundle/chunks/chunk-YBMRWW4E.js +0 -77
- package/dist/cli-bundle/chunks/register-list-query-Y56KINDU.js +0 -11
- package/dist/cli-bundle/focused-chunks/chunk-34QBIYZI.js +0 -155
- package/dist/cli-bundle/focused-chunks/chunk-BJRYFVSH.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-EF6ZS5GH.js +0 -50
- package/dist/cli-bundle/focused-chunks/chunk-L623ZPNK.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-PRHY2IMX.js +0 -18
- package/dist/cli-bundle/focused-chunks/chunk-RZU5U6Q7.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-YBMGXBFV.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-YLVBJ6GF.js +0 -2
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/store/tracker-preflight
|
|
3
|
+
*
|
|
4
|
+
* Owns the filesystem preflight shared by tracker-reading SDK primitives.
|
|
5
|
+
*/
|
|
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]="8b0efe32-43f5-51ed-b1d5-5c26a3ae5bf0")}catch(e){}}();
|
|
8
|
+
import fs from "node:fs/promises";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
import { EXIT_CODE } from "../shared/constants.js";
|
|
11
|
+
import { PmCliError, } from "../shared/errors.js";
|
|
12
|
+
import { pathExists } from "../fs/fs-utils.js";
|
|
13
|
+
import { getSettingsPath } from "./paths.js";
|
|
14
|
+
function isErrno(error, code) {
|
|
15
|
+
return (typeof error === "object" &&
|
|
16
|
+
error !== null &&
|
|
17
|
+
"code" in error &&
|
|
18
|
+
error.code === code);
|
|
19
|
+
}
|
|
20
|
+
/** Build the non-interactive, tokenized retry that initializes a selected tracker root. */
|
|
21
|
+
export function buildTrackerInitializationRecovery(pmRoot) {
|
|
22
|
+
const suggestedRetryArguments = [
|
|
23
|
+
"--pm-path",
|
|
24
|
+
pmRoot,
|
|
25
|
+
"init",
|
|
26
|
+
"--defaults",
|
|
27
|
+
"--agent-guidance",
|
|
28
|
+
"skip",
|
|
29
|
+
];
|
|
30
|
+
return {
|
|
31
|
+
suggested_retry: `pm ${suggestedRetryArguments
|
|
32
|
+
.map((argument) => `'${argument.replaceAll("'", `'"'"'`)}'`)
|
|
33
|
+
.join(" ")}`,
|
|
34
|
+
suggested_retry_args: suggestedRetryArguments,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function trackerRootNotDirectoryError(pmRoot) {
|
|
38
|
+
return new PmCliError(`Tracker root is not a directory at ${pmRoot}.`, EXIT_CODE.USAGE, {
|
|
39
|
+
code: "tracker_root_not_directory",
|
|
40
|
+
reason: "not_a_directory",
|
|
41
|
+
resolved_path: pmRoot,
|
|
42
|
+
nextSteps: [
|
|
43
|
+
"Pass a tracker directory, usually <workspace>/.agents/pm, rather than a file path.",
|
|
44
|
+
],
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function trackerRootUnreadableError(pmRoot) {
|
|
48
|
+
return new PmCliError(`Tracker root is not readable at ${pmRoot}.`, EXIT_CODE.GENERIC_FAILURE, {
|
|
49
|
+
code: "tracker_root_unreadable",
|
|
50
|
+
reason: "unreadable",
|
|
51
|
+
resolved_path: pmRoot,
|
|
52
|
+
nextSteps: [
|
|
53
|
+
"Grant read and directory-search permission to the tracker root, then retry.",
|
|
54
|
+
],
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
async function assertMissingRootAncestors(pmRoot) {
|
|
58
|
+
const resolvedRoot = path.resolve(pmRoot);
|
|
59
|
+
const filesystemRoot = path.parse(resolvedRoot).root;
|
|
60
|
+
let ancestor = path.dirname(resolvedRoot);
|
|
61
|
+
while (ancestor !== filesystemRoot) {
|
|
62
|
+
let ancestorStats;
|
|
63
|
+
try {
|
|
64
|
+
ancestorStats = await fs.stat(ancestor);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
if (isErrno(error, "ENOTDIR")) {
|
|
68
|
+
throw trackerRootNotDirectoryError(pmRoot);
|
|
69
|
+
}
|
|
70
|
+
if (!isErrno(error, "ENOENT")) {
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
ancestor = path.dirname(ancestor);
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (!ancestorStats.isDirectory()) {
|
|
77
|
+
throw trackerRootNotDirectoryError(pmRoot);
|
|
78
|
+
}
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/** Require a tracker root to be a readable directory without requiring initialized settings. */
|
|
83
|
+
export async function assertReadableTrackerRoot(pmRoot) {
|
|
84
|
+
let stats;
|
|
85
|
+
try {
|
|
86
|
+
stats = await fs.stat(pmRoot);
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
if (isErrno(error, "ENOENT")) {
|
|
90
|
+
await assertMissingRootAncestors(pmRoot);
|
|
91
|
+
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Tracker root does not exist. Run pm init first.`, EXIT_CODE.NOT_FOUND, {
|
|
92
|
+
code: "tracker_root_missing",
|
|
93
|
+
reason: "missing",
|
|
94
|
+
resolved_path: pmRoot,
|
|
95
|
+
nextSteps: [
|
|
96
|
+
"Confirm the tracker root path or initialize it with the emitted retry.",
|
|
97
|
+
],
|
|
98
|
+
recovery: buildTrackerInitializationRecovery(pmRoot),
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
if (isErrno(error, "ENOTDIR")) {
|
|
102
|
+
throw trackerRootNotDirectoryError(pmRoot);
|
|
103
|
+
}
|
|
104
|
+
if (isErrno(error, "EACCES") || isErrno(error, "EPERM")) {
|
|
105
|
+
throw trackerRootUnreadableError(pmRoot);
|
|
106
|
+
}
|
|
107
|
+
throw error;
|
|
108
|
+
}
|
|
109
|
+
if (!stats.isDirectory()) {
|
|
110
|
+
throw trackerRootNotDirectoryError(pmRoot);
|
|
111
|
+
}
|
|
112
|
+
if (process.platform !== "win32" &&
|
|
113
|
+
((stats.mode & 0o444) === 0 || (stats.mode & 0o111) === 0)) {
|
|
114
|
+
throw trackerRootUnreadableError(pmRoot);
|
|
115
|
+
}
|
|
116
|
+
try {
|
|
117
|
+
const directory = await fs.opendir(pmRoot);
|
|
118
|
+
await directory.close();
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
if (isErrno(error, "EACCES") || isErrno(error, "EPERM")) {
|
|
122
|
+
throw trackerRootUnreadableError(pmRoot);
|
|
123
|
+
}
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/** Require the selected tracker root and its settings marker before an SDK command reads or mutates project state. */
|
|
128
|
+
export async function assertInitializedTracker(pmRoot) {
|
|
129
|
+
await assertReadableTrackerRoot(pmRoot);
|
|
130
|
+
if (await pathExists(getSettingsPath(pmRoot))) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND, {
|
|
134
|
+
code: "tracker_not_initialized",
|
|
135
|
+
reason: "settings_missing",
|
|
136
|
+
resolved_path: pmRoot,
|
|
137
|
+
nextSteps: ["Initialize the selected tracker root with the emitted retry."],
|
|
138
|
+
recovery: buildTrackerInitializationRecovery(pmRoot),
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=tracker-preflight.js.map
|
|
142
|
+
//# debugId=8b0efe32-43f5-51ed-b1d5-5c26a3ae5bf0
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** A closed-domain refusal that can be executed and recovered automatically. */
|
|
2
|
+
export interface PmClosedDomainContract {
|
|
3
|
+
/** Stable assurance identity. */
|
|
4
|
+
probe_id: string;
|
|
5
|
+
/** Public command accepting the constrained flag. */
|
|
6
|
+
command: string;
|
|
7
|
+
/** Constrained option spelling. */
|
|
8
|
+
flag: string;
|
|
9
|
+
/** Invalid token used to prove the refusal path. */
|
|
10
|
+
rejected_value: string;
|
|
11
|
+
/** Exact argv that must refuse the invalid token. */
|
|
12
|
+
refusal_args: readonly string[];
|
|
13
|
+
/** Complete stable core domain accepted by the command. */
|
|
14
|
+
allowed_values: readonly string[];
|
|
15
|
+
/** Exact argv expected in the refusal's executable recovery. */
|
|
16
|
+
suggested_retry_args: readonly string[];
|
|
17
|
+
/** Stable machine-readable error code that owns the refusal. */
|
|
18
|
+
error_code: "projection_options_mutually_exclusive" | "unknown_context_intent" | "unknown_field_projection";
|
|
19
|
+
/** Whether a complete accepted-value domain is required in the refusal. */
|
|
20
|
+
allowed_values_required?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** Return the complete stable core refusal corpus shared by every public surface. */
|
|
23
|
+
export declare function listCoreClosedDomainContracts(): PmClosedDomainContract[];
|
|
24
|
+
/** Render a compact but complete core-domain description for command help. */
|
|
25
|
+
export declare function renderPmClosedDomainHelp(command: string, flag: "--fields" | "--for"): string;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/agent/closed-domain-contracts
|
|
3
|
+
*
|
|
4
|
+
* Declares executable closed-domain refusals once for SDK consumers, CLI help,
|
|
5
|
+
* and repository assurance. Runtime schema fields can extend field domains
|
|
6
|
+
* without changing the stable core corpus.
|
|
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]="35d4f3d7-7ec2-5a8b-bd96-f7e73c658737")}catch(e){}}();
|
|
10
|
+
import { PM_CONTEXT_INTENT_CONTRACTS } from "../context-intent-contracts.js";
|
|
11
|
+
import { LIST_COMMAND_DEFAULT_PROJECTIONS, listGetProjectionFields, listListProjectionFields, listSearchProjectionFields, } from "../query/projection-contracts.js";
|
|
12
|
+
const REJECTED_INTENT = "not-a-declared-intent";
|
|
13
|
+
const REJECTED_FIELD = "not-a-declared-field";
|
|
14
|
+
/** Return the complete stable core refusal corpus shared by every public surface. */
|
|
15
|
+
export function listCoreClosedDomainContracts() {
|
|
16
|
+
const positionalArguments = {
|
|
17
|
+
get: ["pm-domain"],
|
|
18
|
+
search: ["Domain query"],
|
|
19
|
+
};
|
|
20
|
+
const intentContracts = [
|
|
21
|
+
...new Set(PM_CONTEXT_INTENT_CONTRACTS.map(({ command }) => command)),
|
|
22
|
+
].map((command) => {
|
|
23
|
+
const commandContracts = PM_CONTEXT_INTENT_CONTRACTS.filter((candidate) => candidate.command === command);
|
|
24
|
+
const contract = commandContracts[0];
|
|
25
|
+
const positionals = positionalArguments[contract.command] ?? [];
|
|
26
|
+
return {
|
|
27
|
+
probe_id: `${contract.command}-invalid-intent`,
|
|
28
|
+
command: contract.command,
|
|
29
|
+
flag: "--for",
|
|
30
|
+
rejected_value: REJECTED_INTENT,
|
|
31
|
+
refusal_args: [
|
|
32
|
+
contract.command,
|
|
33
|
+
...positionals,
|
|
34
|
+
"--for",
|
|
35
|
+
REJECTED_INTENT,
|
|
36
|
+
],
|
|
37
|
+
allowed_values: commandContracts.map(({ intent }) => intent).sort(),
|
|
38
|
+
suggested_retry_args: [
|
|
39
|
+
contract.command,
|
|
40
|
+
...positionals,
|
|
41
|
+
"--for",
|
|
42
|
+
contract.intent,
|
|
43
|
+
],
|
|
44
|
+
error_code: "unknown_context_intent",
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
const listFields = listListProjectionFields();
|
|
48
|
+
const listFieldContracts = Object.keys(LIST_COMMAND_DEFAULT_PROJECTIONS).map((command) => ({
|
|
49
|
+
probe_id: `${command}-invalid-field`,
|
|
50
|
+
command,
|
|
51
|
+
flag: "--fields",
|
|
52
|
+
rejected_value: REJECTED_FIELD,
|
|
53
|
+
refusal_args: [command, "--fields", REJECTED_FIELD],
|
|
54
|
+
allowed_values: listFields,
|
|
55
|
+
suggested_retry_args: [
|
|
56
|
+
command,
|
|
57
|
+
"--fields",
|
|
58
|
+
"id,title,status",
|
|
59
|
+
"--limit",
|
|
60
|
+
"10",
|
|
61
|
+
],
|
|
62
|
+
error_code: "unknown_field_projection",
|
|
63
|
+
}));
|
|
64
|
+
const contracts = [
|
|
65
|
+
...intentContracts,
|
|
66
|
+
...listFieldContracts,
|
|
67
|
+
{
|
|
68
|
+
probe_id: "get-invalid-field",
|
|
69
|
+
command: "get",
|
|
70
|
+
flag: "--fields",
|
|
71
|
+
rejected_value: REJECTED_FIELD,
|
|
72
|
+
refusal_args: ["get", "pm-domain", "--fields", REJECTED_FIELD],
|
|
73
|
+
allowed_values: listGetProjectionFields(),
|
|
74
|
+
suggested_retry_args: ["get", "pm-domain", "--fields", "id,title,status"],
|
|
75
|
+
error_code: "unknown_field_projection",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
probe_id: "list-mutually-exclusive-projection",
|
|
79
|
+
command: "list",
|
|
80
|
+
flag: "--projection",
|
|
81
|
+
rejected_value: "--brief+--full",
|
|
82
|
+
refusal_args: ["list", "--brief", "--full"],
|
|
83
|
+
allowed_values: [],
|
|
84
|
+
suggested_retry_args: ["list", "--brief"],
|
|
85
|
+
error_code: "projection_options_mutually_exclusive",
|
|
86
|
+
allowed_values_required: false,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
probe_id: "get-mutually-exclusive-projection",
|
|
90
|
+
command: "get",
|
|
91
|
+
flag: "--projection",
|
|
92
|
+
rejected_value: "--full+--fields",
|
|
93
|
+
refusal_args: ["get", "pm-domain", "--full", "--fields", "id"],
|
|
94
|
+
allowed_values: [],
|
|
95
|
+
suggested_retry_args: ["get", "pm-domain", "--full"],
|
|
96
|
+
error_code: "projection_options_mutually_exclusive",
|
|
97
|
+
allowed_values_required: false,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
probe_id: "search-mutually-exclusive-projection",
|
|
101
|
+
command: "search",
|
|
102
|
+
flag: "--projection",
|
|
103
|
+
rejected_value: "--full+--fields",
|
|
104
|
+
refusal_args: ["search", "Domain query", "--full", "--fields", "id"],
|
|
105
|
+
allowed_values: [],
|
|
106
|
+
suggested_retry_args: ["search", "Domain query", "--full"],
|
|
107
|
+
error_code: "projection_options_mutually_exclusive",
|
|
108
|
+
allowed_values_required: false,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
probe_id: "search-invalid-field",
|
|
112
|
+
command: "search",
|
|
113
|
+
flag: "--fields",
|
|
114
|
+
rejected_value: REJECTED_FIELD,
|
|
115
|
+
refusal_args: ["search", "Domain query", "--fields", REJECTED_FIELD],
|
|
116
|
+
allowed_values: listSearchProjectionFields(),
|
|
117
|
+
suggested_retry_args: [
|
|
118
|
+
"search",
|
|
119
|
+
"Domain query",
|
|
120
|
+
"--fields",
|
|
121
|
+
"id,title,status,score",
|
|
122
|
+
],
|
|
123
|
+
error_code: "unknown_field_projection",
|
|
124
|
+
},
|
|
125
|
+
];
|
|
126
|
+
return contracts.sort((left, right) => left.probe_id.localeCompare(right.probe_id));
|
|
127
|
+
}
|
|
128
|
+
/** Render a compact but complete core-domain description for command help. */
|
|
129
|
+
export function renderPmClosedDomainHelp(command, flag) {
|
|
130
|
+
const contract = listCoreClosedDomainContracts().find((candidate) => candidate.command === command && candidate.flag === flag);
|
|
131
|
+
if (!contract)
|
|
132
|
+
return "No stable core values are declared.";
|
|
133
|
+
const canonicalValues = contract.allowed_values.filter((value) => !value.startsWith("item."));
|
|
134
|
+
const runtimeSuffix = flag === "--fields"
|
|
135
|
+
? " item.<field> aliases and configured runtime metadata fields are also accepted."
|
|
136
|
+
: " Configured package and workspace intents may extend this domain.";
|
|
137
|
+
return `Allowed core values: ${canonicalValues.join("|")}.${runtimeSuffix}`;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=closed-domain-contracts.js.map
|
|
140
|
+
//# debugId=35d4f3d7-7ec2-5a8b-bd96-f7e73c658737
|
|
@@ -10,15 +10,27 @@ export interface PmRefusalClosureObservation {
|
|
|
10
10
|
rejected_value: string;
|
|
11
11
|
/** Complete accepted domain emitted by the refusal. */
|
|
12
12
|
allowed_values: readonly string[];
|
|
13
|
+
/** Stable error code emitted by the refusal. */
|
|
14
|
+
error_code?: string;
|
|
15
|
+
/** Contract-owned error code required for this refusal. */
|
|
16
|
+
expected_error_code?: string;
|
|
17
|
+
/** Contract-owned complete accepted domain. */
|
|
18
|
+
expected_allowed_values?: readonly string[];
|
|
19
|
+
/** Whether an accepted-value domain is required for this refusal class. */
|
|
20
|
+
allowed_values_required?: boolean;
|
|
13
21
|
/** Exact command emitted for recovery. */
|
|
14
22
|
suggested_retry: string;
|
|
23
|
+
/** Shell-free argv emitted for safe programmatic recovery. */
|
|
24
|
+
suggested_retry_args?: readonly string[];
|
|
25
|
+
/** Contract-owned argv required for deterministic recovery. */
|
|
26
|
+
expected_suggested_retry_args?: readonly string[];
|
|
15
27
|
/** Whether executing the advertised retry succeeded. */
|
|
16
28
|
retry_succeeded: boolean;
|
|
17
29
|
}
|
|
18
30
|
/** One missing or contradictory recovery primitive. */
|
|
19
31
|
export interface PmRefusalClosureFinding {
|
|
20
32
|
/** Stable finding code. */
|
|
21
|
-
code: "accepted_rejected_value" | "duplicate_probe" | "empty_corpus" | "missing_allowed_values" | "missing_suggested_retry" | "non_refusal_exit" | "retry_failed";
|
|
33
|
+
code: "accepted_rejected_value" | "duplicate_probe" | "error_code_mismatch" | "empty_corpus" | "incomplete_allowed_values" | "missing_allowed_values" | "missing_suggested_retry_args" | "missing_suggested_retry" | "non_refusal_exit" | "suggested_retry_args_mismatch" | "retry_failed";
|
|
22
34
|
/** Stable corpus identifier. */
|
|
23
35
|
probe_id: string;
|
|
24
36
|
/** Actionable mismatch detail. */
|
|
@@ -5,8 +5,48 @@
|
|
|
5
5
|
* an agent to recover without another discovery round trip.
|
|
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]="0ec8c375-e58e-5ce4-b0aa-8a8a4dfa0778")}catch(e){}}();
|
|
9
9
|
import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
10
|
+
/** Compare a refusal with its optional SDK-owned exact contract. */
|
|
11
|
+
function listContractObservationFindings(observation) {
|
|
12
|
+
return [
|
|
13
|
+
observation.expected_error_code !== undefined &&
|
|
14
|
+
observation.error_code !== observation.expected_error_code
|
|
15
|
+
? {
|
|
16
|
+
code: "error_code_mismatch",
|
|
17
|
+
probe_id: observation.probe_id,
|
|
18
|
+
detail: `Expected error code ${observation.expected_error_code}, received ${observation.error_code ?? "<missing>"}.`,
|
|
19
|
+
}
|
|
20
|
+
: undefined,
|
|
21
|
+
observation.expected_allowed_values !== undefined &&
|
|
22
|
+
JSON.stringify([...observation.allowed_values].sort()) !==
|
|
23
|
+
JSON.stringify([...observation.expected_allowed_values].sort())
|
|
24
|
+
? {
|
|
25
|
+
code: "incomplete_allowed_values",
|
|
26
|
+
probe_id: observation.probe_id,
|
|
27
|
+
detail: "The refusal's accepted domain differs from the SDK-owned domain contract.",
|
|
28
|
+
}
|
|
29
|
+
: undefined,
|
|
30
|
+
observation.expected_suggested_retry_args !== undefined &&
|
|
31
|
+
(observation.suggested_retry_args?.length ?? 0) === 0
|
|
32
|
+
? {
|
|
33
|
+
code: "missing_suggested_retry_args",
|
|
34
|
+
probe_id: observation.probe_id,
|
|
35
|
+
detail: "The refusal omitted shell-free suggested retry arguments.",
|
|
36
|
+
}
|
|
37
|
+
: undefined,
|
|
38
|
+
observation.expected_suggested_retry_args !== undefined &&
|
|
39
|
+
(observation.suggested_retry_args?.length ?? 0) > 0 &&
|
|
40
|
+
JSON.stringify(observation.suggested_retry_args) !==
|
|
41
|
+
JSON.stringify(observation.expected_suggested_retry_args)
|
|
42
|
+
? {
|
|
43
|
+
code: "suggested_retry_args_mismatch",
|
|
44
|
+
probe_id: observation.probe_id,
|
|
45
|
+
detail: "The refusal's suggested retry arguments differ from the SDK-owned contract.",
|
|
46
|
+
}
|
|
47
|
+
: undefined,
|
|
48
|
+
];
|
|
49
|
+
}
|
|
10
50
|
/** Return every closure defect contributed by one unique observation. */
|
|
11
51
|
function listObservationFindings(observation) {
|
|
12
52
|
return [
|
|
@@ -17,7 +57,8 @@ function listObservationFindings(observation) {
|
|
|
17
57
|
detail: `${observation.entrypoint} returned exit code ${observation.exit_code}; a structured usage refusal must return ${EXIT_CODE.USAGE}.`,
|
|
18
58
|
}
|
|
19
59
|
: undefined,
|
|
20
|
-
observation.
|
|
60
|
+
observation.allowed_values_required !== false &&
|
|
61
|
+
observation.allowed_values.length === 0
|
|
21
62
|
? {
|
|
22
63
|
code: "missing_allowed_values",
|
|
23
64
|
probe_id: observation.probe_id,
|
|
@@ -45,6 +86,7 @@ function listObservationFindings(observation) {
|
|
|
45
86
|
detail: "The advertised suggested retry did not succeed.",
|
|
46
87
|
}
|
|
47
88
|
: undefined,
|
|
89
|
+
...listContractObservationFindings(observation),
|
|
48
90
|
];
|
|
49
91
|
}
|
|
50
92
|
/** Score structured closed-domain refusals and executable retries. */
|
|
@@ -89,4 +131,4 @@ export function scorePmRefusalClosure(observations) {
|
|
|
89
131
|
};
|
|
90
132
|
}
|
|
91
133
|
//# sourceMappingURL=refusal-closure.js.map
|
|
92
|
-
//# debugId=
|
|
134
|
+
//# debugId=0ec8c375-e58e-5ce4-b0aa-8a8a4dfa0778
|
|
@@ -139,6 +139,28 @@ export interface PmRecoveryReferenceReport {
|
|
|
139
139
|
/** Stable, sorted conformance findings. */
|
|
140
140
|
findings: PmRecoveryReferenceFinding[];
|
|
141
141
|
}
|
|
142
|
+
/** Per-kind runtime evidence; counts do not claim one observation per source location. */
|
|
143
|
+
export interface PmRecoveryProducerRuntimeCoverage {
|
|
144
|
+
/** Typed recovery-reference kind. */
|
|
145
|
+
kind: PmRecoveryReferenceKind;
|
|
146
|
+
/** Literal source producers discovered for the kind. */
|
|
147
|
+
source_producers: number;
|
|
148
|
+
/** Distinct runtime values observed for the kind. */
|
|
149
|
+
runtime_values: number;
|
|
150
|
+
}
|
|
151
|
+
/** Unified per-kind source-census and runtime-value coverage receipt. */
|
|
152
|
+
export interface PmRecoveryProducerRuntimeReport {
|
|
153
|
+
/** Whether every source-declared kind emitted at least one runtime value. */
|
|
154
|
+
ok: boolean;
|
|
155
|
+
/** Source producer denominator. */
|
|
156
|
+
source_producer_count: number;
|
|
157
|
+
/** Distinct runtime-value denominator. */
|
|
158
|
+
runtime_value_count: number;
|
|
159
|
+
/** Stable per-kind source and runtime coverage. */
|
|
160
|
+
coverage_by_kind: PmRecoveryProducerRuntimeCoverage[];
|
|
161
|
+
/** Kinds with source producers but no runtime evidence. */
|
|
162
|
+
missing_runtime_kinds: PmRecoveryReferenceKind[];
|
|
163
|
+
}
|
|
142
164
|
/** Census syntax-parsed structured-envelope producers without executing source code. */
|
|
143
165
|
export declare function censusPmRecoveryReferenceProducers(sources: readonly PmRecoveryProducerSource[]): PmRecoveryProducerCensusReport;
|
|
144
166
|
/** Derive typed obligations from every recognized recovery field in an emitted envelope. */
|
|
@@ -147,3 +169,7 @@ export declare function derivePmRecoveryReferenceObligations(probeId: string, en
|
|
|
147
169
|
export declare function verifyPmRefusalReachability(catalog: readonly PmErrorCodeContract[], observations: readonly PmRefusalProbeObservation[]): PmRefusalReachabilityReport;
|
|
148
170
|
/** Verify executable and declared-path proof for emitted recovery references. */
|
|
149
171
|
export declare function verifyPmRecoveryReferences(obligations: readonly PmRecoveryReferenceObligation[], observations: readonly PmRecoveryReferenceObservation[]): PmRecoveryReferenceReport;
|
|
172
|
+
/** Join source-census counts to distinct emitted runtime values by typed kind. */
|
|
173
|
+
export declare function verifyPmRecoveryProducerRuntimeCoverage(census: PmRecoveryProducerCensusReport, obligations: readonly PmRecoveryReferenceObligation[]): PmRecoveryProducerRuntimeReport;
|
|
174
|
+
/** Honest kind-level name for the compatibility implementation above. */
|
|
175
|
+
export declare const verifyPmRecoveryKindRuntimeCoverage: typeof verifyPmRecoveryProducerRuntimeCoverage;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* generated public error-code catalog.
|
|
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]="4f4e7daa-14aa-5dad-8a30-79a4d76159d4")}catch(e){}}();
|
|
9
9
|
import * as nodeModule from "node:module";
|
|
10
10
|
/** Recovery-reference kinds emitted by structured refusal envelopes. */
|
|
11
11
|
export const PM_RECOVERY_REFERENCE_KINDS = [
|
|
@@ -566,5 +566,29 @@ export function verifyPmRecoveryReferences(obligations, observations) {
|
|
|
566
566
|
findings,
|
|
567
567
|
};
|
|
568
568
|
}
|
|
569
|
+
/** Join source-census counts to distinct emitted runtime values by typed kind. */
|
|
570
|
+
export function verifyPmRecoveryProducerRuntimeCoverage(census, obligations) {
|
|
571
|
+
const runtimeValuesByKind = new Map(PM_RECOVERY_REFERENCE_KINDS.map((kind) => [kind, new Set()]));
|
|
572
|
+
for (const obligation of obligations) {
|
|
573
|
+
runtimeValuesByKind.get(obligation.kind).add(obligation.value);
|
|
574
|
+
}
|
|
575
|
+
const coverageByKind = PM_RECOVERY_REFERENCE_KINDS.map((kind) => ({
|
|
576
|
+
kind,
|
|
577
|
+
source_producers: census.producer_count_by_kind[kind],
|
|
578
|
+
runtime_values: runtimeValuesByKind.get(kind).size,
|
|
579
|
+
}));
|
|
580
|
+
const missingRuntimeKinds = coverageByKind
|
|
581
|
+
.filter(({ source_producers: sourceProducers, runtime_values: runtimeValues }) => sourceProducers > 0 && runtimeValues === 0)
|
|
582
|
+
.map(({ kind }) => kind);
|
|
583
|
+
return {
|
|
584
|
+
ok: census.ok && missingRuntimeKinds.length === 0,
|
|
585
|
+
source_producer_count: census.producer_count,
|
|
586
|
+
runtime_value_count: coverageByKind.reduce((total, { runtime_values: runtimeValues }) => total + runtimeValues, 0),
|
|
587
|
+
coverage_by_kind: coverageByKind,
|
|
588
|
+
missing_runtime_kinds: missingRuntimeKinds,
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
/** Honest kind-level name for the compatibility implementation above. */
|
|
592
|
+
export const verifyPmRecoveryKindRuntimeCoverage = verifyPmRecoveryProducerRuntimeCoverage;
|
|
569
593
|
//# sourceMappingURL=refusal-reachability.js.map
|
|
570
|
-
//# debugId=
|
|
594
|
+
//# debugId=4f4e7daa-14aa-5dad-8a30-79a4d76159d4
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/agent/tracker-preflight-contracts
|
|
3
|
+
*
|
|
4
|
+
* Declares and scores executable recovery for tracker filesystem preflight failures.
|
|
5
|
+
*/
|
|
6
|
+
/** Filesystem states distinguished by the shared tracker preflight. */
|
|
7
|
+
export type PmTrackerPreflightFailureKind = "missing_root" | "settings_missing" | "not_directory" | "unreadable_root";
|
|
8
|
+
/** Recovery behavior that is safe for a tracker preflight failure. */
|
|
9
|
+
export type PmTrackerPreflightRecoveryKind = "initialize" | "select_directory" | "repair_permissions";
|
|
10
|
+
/** Static refusal and recovery obligation for one tracker filesystem state. */
|
|
11
|
+
export interface PmTrackerPreflightRecoveryContract {
|
|
12
|
+
/** Stable probe identifier used by repository gates and evidence. */
|
|
13
|
+
probe_id: string;
|
|
14
|
+
/** Filesystem state created by the executable probe. */
|
|
15
|
+
failure_kind: PmTrackerPreflightFailureKind;
|
|
16
|
+
/** Stable structured error code required from CLI and SDK transports. */
|
|
17
|
+
expected_error_code: string;
|
|
18
|
+
/** Process exit code required from the CLI transport. */
|
|
19
|
+
expected_exit_code: 1 | 2 | 3;
|
|
20
|
+
/** Safe recovery behavior for this filesystem state. */
|
|
21
|
+
recovery_kind: PmTrackerPreflightRecoveryKind;
|
|
22
|
+
}
|
|
23
|
+
/** Runtime evidence captured from one executable tracker preflight probe. */
|
|
24
|
+
export interface PmTrackerPreflightRecoveryObservation {
|
|
25
|
+
/** Stable probe identifier from the corresponding contract. */
|
|
26
|
+
probe_id: string;
|
|
27
|
+
/** Structured error code emitted by the refusal. */
|
|
28
|
+
error_code: string;
|
|
29
|
+
/** Process exit code emitted by the refusal. */
|
|
30
|
+
exit_code: number;
|
|
31
|
+
/** Recovery behavior exercised by the probe driver. */
|
|
32
|
+
recovery_kind: PmTrackerPreflightRecoveryKind;
|
|
33
|
+
/** Tokenized retry emitted by the refusal, or an empty list when no deterministic retry is safe. */
|
|
34
|
+
suggested_retry_args: string[];
|
|
35
|
+
/** Whether the emitted retry or safe alternate-root retry executed successfully. */
|
|
36
|
+
retry_succeeded: boolean;
|
|
37
|
+
/** Whether a file-path refusal incorrectly recommended tracker initialization. */
|
|
38
|
+
unsafe_init_recommended: boolean;
|
|
39
|
+
}
|
|
40
|
+
/** Actionable failure emitted by the tracker preflight closure scorer. */
|
|
41
|
+
export interface PmTrackerPreflightRecoveryFinding {
|
|
42
|
+
/** Stable finding code for automation and ratchets. */
|
|
43
|
+
code: "missing_probe" | "error_code_mismatch" | "exit_code_mismatch" | "recovery_kind_mismatch" | "missing_init_recovery" | "unsafe_init_recovery" | "retry_failed";
|
|
44
|
+
/** Probe that failed its recovery obligation. */
|
|
45
|
+
probe_id: string;
|
|
46
|
+
/** Human-readable explanation of the failed obligation. */
|
|
47
|
+
detail: string;
|
|
48
|
+
}
|
|
49
|
+
/** Aggregate executable-closure report for the tracker preflight corpus. */
|
|
50
|
+
export interface PmTrackerPreflightRecoveryReport {
|
|
51
|
+
/** Whether every declared probe met its refusal and recovery contract. */
|
|
52
|
+
ok: boolean;
|
|
53
|
+
/** Number of declared tracker preflight probes. */
|
|
54
|
+
probe_count: number;
|
|
55
|
+
/** Number of probes with no findings. */
|
|
56
|
+
closed_probe_count: number;
|
|
57
|
+
/** Deterministically ordered failed obligations. */
|
|
58
|
+
findings: PmTrackerPreflightRecoveryFinding[];
|
|
59
|
+
}
|
|
60
|
+
/** Return defensive copies of every core tracker preflight recovery contract. */
|
|
61
|
+
export declare function listTrackerPreflightRecoveryContracts(): PmTrackerPreflightRecoveryContract[];
|
|
62
|
+
/** Score runtime observations against the complete tracker preflight recovery corpus. */
|
|
63
|
+
export declare function scoreTrackerPreflightRecoveryClosure(observations: readonly PmTrackerPreflightRecoveryObservation[]): PmTrackerPreflightRecoveryReport;
|