@unbrained/pm-cli 2026.9.5 → 2026.9.6
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 +32 -2
- package/dist/cli/main.js +10 -8
- package/dist/cli/register-operations.js +13 -8
- package/dist/cli-bundle/bundle-manifest.json +150 -158
- package/dist/cli-bundle/chunks/chunk-AZDFJGH6.js +9 -0
- package/dist/cli-bundle/chunks/{chunk-WWAEGW4V.js → chunk-BAX2BYUW.js} +66 -66
- package/dist/cli-bundle/chunks/{chunk-IBYREGSP.js → chunk-CKOL5U7J.js} +51 -51
- package/dist/cli-bundle/chunks/{chunk-ZRAQS3UA.js → chunk-JT6XF6GE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HUAQITVW.js → chunk-JX4DH4WC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QPZHQY2O.js → chunk-NPN5I67J.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-66VPKFP2.js → chunk-OF76PSDQ.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-QUWFABDM.js +232 -0
- package/dist/cli-bundle/chunks/{chunk-3HBDTJRK.js → chunk-RWWBOWJ5.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-WGAOYSYH.js +40 -0
- package/dist/cli-bundle/chunks/{chunk-SF6SM6U5.js → chunk-WI2AYPA7.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-AYKGODWT.js → register-list-query-5JL52D33.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-YZYG53SQ.js → register-mutation-ZPG7KMVP.js} +2 -2
- package/dist/cli-bundle/chunks/register-operations-I5W3KMGB.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-UJCRVGBG.js → register-setup-H4SVAVX7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-QL66QNWG.js → chunk-3BZEOXLT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-AL5ON6K6.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-CHC2IDXA.js +6 -0
- package/dist/cli-bundle/focused-chunks/chunk-CK6QFAPZ.js +20 -0
- package/dist/cli-bundle/focused-chunks/{chunk-WOCIPMW7.js → chunk-EZR3GHFE.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-H2WJWK7L.js +56 -0
- package/dist/cli-bundle/focused-chunks/{chunk-3ASU6WGI.js → chunk-LIJIA4TY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-H5FOGAVD.js → chunk-M6PBRFSH.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-B2TTQGFG.js → chunk-NTPY5GSO.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-P5O7MP5Y.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-PDMW2E36.js +177 -0
- package/dist/cli-bundle/focused-chunks/{chunk-YEF5PQQ2.js → chunk-PEFABF7E.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-KWWCBWFO.js → chunk-QTVCLMSZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-4OSHLNUE.js → chunk-QTZRBUYA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-SGQST3PQ.js +12 -0
- package/dist/cli-bundle/focused-chunks/chunk-UKHASMMP.js +10 -0
- package/dist/cli-bundle/focused-chunks/chunk-ZPEKQHOC.js +2 -0
- package/dist/cli-bundle/main.js +20 -20
- 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 +37 -37
- 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 +42 -42
- 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 +9 -9
- package/dist/core/extensions/module-graph-snapshot.js +5 -4
- package/dist/core/fs/host-environment-errors.d.ts +27 -0
- package/dist/core/fs/host-environment-errors.js +142 -0
- package/dist/core/output/mutation-projection.js +12 -5
- package/dist/core/store/item-metadata-query-index.js +13 -10
- package/dist/core/store/item-metadata-read-work.d.ts +19 -0
- package/dist/core/store/item-metadata-read-work.js +44 -0
- package/dist/core/store/item-store.js +6 -2
- package/dist/core/validate/fix-planning.d.ts +1 -1
- package/dist/core/validate/fix-planning.js +2 -2
- package/dist/core/validate/missing-link-owners.d.ts +1 -1
- package/dist/core/validate/missing-link-owners.js +5 -3
- package/dist/core/validate/stale-file-classification.d.ts +6 -4
- package/dist/core/validate/stale-file-classification.js +20 -5
- package/dist/mcp/server.js +12 -5
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +7 -5
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +4 -3
- package/dist/sdk/cli-contracts/grammar-contracts.js +11 -2
- package/dist/sdk/cli-contracts/runtime-contracts.js +5 -2
- package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +254 -5
- package/dist/sdk/cli-contracts/schemas/assurance-definition.js +52 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +18 -6
- package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
- package/dist/sdk/cli-contracts/tool-schema.js +17 -5
- package/dist/sdk/context/usage-ledger.d.ts +41 -0
- package/dist/sdk/context/usage-ledger.js +186 -0
- package/dist/sdk/context-usage.d.ts +18 -9
- package/dist/sdk/context-usage.js +37 -112
- package/dist/sdk/dependency-provenance.d.ts +7 -0
- package/dist/sdk/dependency-provenance.js +14 -4
- package/dist/sdk/duplicates.d.ts +2 -0
- package/dist/sdk/duplicates.js +3 -2
- package/dist/sdk/environment/host-environment-errors.d.ts +5 -27
- package/dist/sdk/environment/host-environment-errors.js +4 -137
- package/dist/sdk/extension/install-runtime.js +9 -6
- package/dist/sdk/extension/install-snapshot.js +7 -6
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +8 -8
- package/dist/sdk/governance/assurance-action.d.ts +3 -2
- package/dist/sdk/governance/assurance-action.js +23 -11
- package/dist/sdk/governance/assurance-runtime.d.ts +2 -0
- package/dist/sdk/governance/assurance-runtime.js +6 -3
- package/dist/sdk/governance/defect-recurrence-coverage.d.ts +93 -0
- package/dist/sdk/governance/defect-recurrence-coverage.js +189 -0
- package/dist/sdk/governance/defect-recurrence-graph.d.ts +33 -0
- package/dist/sdk/governance/defect-recurrence-graph.js +121 -0
- package/dist/sdk/governance/defect-recurrence.d.ts +8 -0
- package/dist/sdk/governance/defect-recurrence.js +118 -17
- package/dist/sdk/governance/health.d.ts +17 -2
- package/dist/sdk/governance/health.js +31 -10
- package/dist/sdk/governance/linked-file-report.d.ts +41 -0
- package/dist/sdk/governance/linked-file-report.js +72 -0
- package/dist/sdk/governance/validate.d.ts +5 -2
- package/dist/sdk/governance/validate.js +21 -37
- package/dist/sdk/governance.d.ts +2 -0
- package/dist/sdk/governance.js +4 -2
- package/dist/sdk/history-repair.d.ts +7 -0
- package/dist/sdk/history-repair.js +48 -13
- package/dist/sdk/lifecycle/close.d.ts +8 -0
- package/dist/sdk/lifecycle/close.js +16 -8
- package/dist/sdk/lifecycle/create.js +9 -12
- package/dist/sdk/lifecycle/update.js +12 -12
- package/dist/sdk/lifecycle-policy.d.ts +3 -0
- package/dist/sdk/lifecycle-policy.js +2 -2
- package/dist/sdk/merge/abandoned-receipts.d.ts +15 -0
- package/dist/sdk/merge/abandoned-receipts.js +47 -0
- package/dist/sdk/merge/driver.js +4 -2
- package/dist/sdk/merge/index.d.ts +1 -0
- package/dist/sdk/merge/index.js +2 -2
- package/dist/sdk/merge/receipt-operation.d.ts +15 -0
- package/dist/sdk/merge/receipt-operation.js +97 -0
- package/dist/sdk/merge/receipt-schema.d.ts +20 -0
- package/dist/sdk/merge/receipt-schema.js +398 -0
- package/dist/sdk/merge/receipts.d.ts +16 -7
- package/dist/sdk/merge/receipts.js +54 -340
- package/dist/sdk/merge/reconcile.d.ts +2 -0
- package/dist/sdk/merge/reconcile.js +11 -4
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/duplicate-candidates.d.ts +7 -0
- package/dist/sdk/query/duplicate-candidates.js +71 -0
- package/dist/sdk/query/get.js +7 -7
- package/dist/sdk/query.d.ts +2 -0
- package/dist/sdk/query.js +4 -2
- package/dist/sdk/read-output-session.js +5 -3
- package/dist/sdk/runtime.js +4 -2
- package/dist/sdk/similarity.d.ts +24 -3
- package/dist/sdk/similarity.js +50 -55
- package/docs/AGENT_GUIDE.md +23 -2
- package/docs/BOUNDED_CONTEXT_READS.md +185 -0
- package/docs/CLOSE_EVIDENCE_RECOVERY.md +35 -0
- package/docs/COMMANDS.md +30 -8
- package/docs/CONTEXT_RELEVANCE.md +16 -4
- package/docs/DEFECT_RECURRENCE.md +80 -6
- package/docs/EXTENSIONS.md +18 -19
- package/docs/MERGE_SAFETY.md +50 -0
- package/docs/OUTPUT_PROJECTION_CONTRACTS.md +66 -0
- package/docs/PR_REVIEW_LOOP.md +18 -3
- package/docs/README.md +18 -1
- package/docs/RELEASING.md +6 -2
- package/docs/SDK_LIFECYCLE.md +27 -0
- package/docs/SDK_RUNTIME_BOUNDARIES.md +11 -0
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +1 -1
- package/marketplace.json +2 -2
- package/package.json +6 -3
- 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/README.md +10 -1
- package/packages/pm-governance-audit/extensions/governance-audit/dedupe-audit.ts +50 -65
- package/packages/pm-governance-audit/extensions/governance-audit/index.ts +2 -2
- package/packages/pm-governance-audit/extensions/governance-audit/sdk.ts +1 -0
- 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/dist/cli-bundle/chunks/chunk-LUI4E32I.js +0 -231
- package/dist/cli-bundle/chunks/chunk-SVK5Y64D.js +0 -40
- package/dist/cli-bundle/chunks/chunk-V5GBD5KV.js +0 -9
- package/dist/cli-bundle/chunks/register-operations-KFSCC7QV.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-24IG6ONG.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-3ITLIBKS.js +0 -56
- package/dist/cli-bundle/focused-chunks/chunk-3NQD5YDG.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-65N6JHAN.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-GUBM3RGY.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-JX3RCVCX.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-MV752SUC.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-PKIPMCFS.js +0 -6
- package/dist/cli-bundle/focused-chunks/chunk-RJMR2JIF.js +0 -9
- package/dist/cli-bundle/focused-chunks/chunk-WIUPWIZR.js +0 -177
|
@@ -1,142 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module sdk/host-environment-errors
|
|
3
|
-
*
|
|
4
|
-
* Classifies host filesystem/resource failures at SDK boundaries without
|
|
5
|
-
* leaking local paths or swallowing genuine implementation defects.
|
|
3
|
+
* Public SDK compatibility surface for path-redacted host filesystem refusals.
|
|
6
4
|
*/
|
|
7
5
|
|
|
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
|
-
|
|
10
|
-
import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
11
|
-
import { PmCliError } from "../../core/shared/errors.js";
|
|
12
|
-
const HOST_ENVIRONMENT_FAULTS = new Map([
|
|
13
|
-
[
|
|
14
|
-
"EACCES",
|
|
15
|
-
{
|
|
16
|
-
summary: "was denied filesystem permission",
|
|
17
|
-
recovery: "Grant the required filesystem access, then retry.",
|
|
18
|
-
category: "permission",
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
[
|
|
22
|
-
"EDQUOT",
|
|
23
|
-
{
|
|
24
|
-
summary: "exceeded the filesystem quota",
|
|
25
|
-
recovery: "Raise or reclaim the filesystem quota, then retry.",
|
|
26
|
-
category: "capacity",
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
[
|
|
30
|
-
"EMFILE",
|
|
31
|
-
{
|
|
32
|
-
summary: "exhausted the process file-descriptor limit",
|
|
33
|
-
recovery: "Close unused file handles or raise the process limit, then retry.",
|
|
34
|
-
category: "resource",
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
[
|
|
38
|
-
"ENFILE",
|
|
39
|
-
{
|
|
40
|
-
summary: "exhausted the host file-descriptor limit",
|
|
41
|
-
recovery: "Free host file descriptors or raise the host limit, then retry.",
|
|
42
|
-
category: "resource",
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
[
|
|
46
|
-
"ENOMEM",
|
|
47
|
-
{
|
|
48
|
-
summary: "ran out of available memory",
|
|
49
|
-
recovery: "Free memory or reduce concurrent work, then retry.",
|
|
50
|
-
category: "resource",
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
[
|
|
54
|
-
"ENOSPC",
|
|
55
|
-
{
|
|
56
|
-
summary: "ran out of storage space",
|
|
57
|
-
recovery: "Free storage on the filesystem holding the project, then retry.",
|
|
58
|
-
category: "capacity",
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
[
|
|
62
|
-
"EPERM",
|
|
63
|
-
{
|
|
64
|
-
summary: "was denied by the host permission policy",
|
|
65
|
-
recovery: "Grant the required filesystem permission, then retry.",
|
|
66
|
-
category: "permission",
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
[
|
|
70
|
-
"EROFS",
|
|
71
|
-
{
|
|
72
|
-
summary: "targeted a read-only filesystem",
|
|
73
|
-
recovery: "Use a writable project filesystem or remount it read-write, then retry.",
|
|
74
|
-
category: "permission",
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
]);
|
|
78
|
-
const OPERATION_PATTERN = /^[a-z][a-z0-9_]{0,63}$/u;
|
|
79
|
-
const HOST_ENVIRONMENT_ERRNO_NAMES = new Map([
|
|
80
|
-
[osConstants.errno.EACCES, "EACCES"],
|
|
81
|
-
[osConstants.errno.EDQUOT, "EDQUOT"],
|
|
82
|
-
[osConstants.errno.EMFILE, "EMFILE"],
|
|
83
|
-
[osConstants.errno.ENFILE, "ENFILE"],
|
|
84
|
-
[osConstants.errno.ENOMEM, "ENOMEM"],
|
|
85
|
-
[osConstants.errno.ENOSPC, "ENOSPC"],
|
|
86
|
-
[osConstants.errno.EPERM, "EPERM"],
|
|
87
|
-
[osConstants.errno.EROFS, "EROFS"],
|
|
88
|
-
].filter(([errno]) => Number.isInteger(errno)));
|
|
89
|
-
const HOST_ENVIRONMENT_FAULT_CODES = {
|
|
90
|
-
capacity: { code: "host_environment_capacity_fault" },
|
|
91
|
-
permission: { code: "host_environment_permission_fault" },
|
|
92
|
-
resource: { code: "host_environment_resource_fault" },
|
|
93
|
-
};
|
|
94
|
-
/** Return a declared host errno only when it represents recoverable environment state. */
|
|
95
|
-
export function classifyHostEnvironmentFault(error) {
|
|
96
|
-
if (typeof error !== "object" || error === null) {
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
const errorRecord = error;
|
|
100
|
-
if (typeof errorRecord.code === "string" &&
|
|
101
|
-
HOST_ENVIRONMENT_FAULTS.has(errorRecord.code)) {
|
|
102
|
-
return errorRecord.code;
|
|
103
|
-
}
|
|
104
|
-
if (typeof errorRecord.errno !== "number" ||
|
|
105
|
-
!Number.isInteger(errorRecord.errno)) {
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
return HOST_ENVIRONMENT_ERRNO_NAMES.get(Math.abs(errorRecord.errno)) ?? null;
|
|
109
|
-
}
|
|
110
|
-
/** Translate one known host fault into a stable path-redacted SDK refusal. */
|
|
111
|
-
export function translateHostEnvironmentFault(error, operation, options = {}) {
|
|
112
|
-
const errno = classifyHostEnvironmentFault(error);
|
|
113
|
-
if (errno === null)
|
|
114
|
-
return null;
|
|
115
|
-
if (!OPERATION_PATTERN.test(operation)) {
|
|
116
|
-
throw new PmCliError("Host environment operation labels must be bounded identifiers.", EXIT_CODE.USAGE, { code: "host_environment_operation_invalid", field: "operation" });
|
|
117
|
-
}
|
|
118
|
-
const fault = HOST_ENVIRONMENT_FAULTS.get(errno);
|
|
119
|
-
return new PmCliError(`Host filesystem operation ${operation} ${fault.summary}.`, EXIT_CODE.GENERIC_FAILURE, {
|
|
120
|
-
code: options.codes?.[fault.category] ??
|
|
121
|
-
HOST_ENVIRONMENT_FAULT_CODES[fault.category].code,
|
|
122
|
-
reason: errno,
|
|
123
|
-
required: fault.recovery,
|
|
124
|
-
why: options.why ??
|
|
125
|
-
"The operating system refused a required project filesystem operation.",
|
|
126
|
-
nextSteps: [fault.recovery, ...(options.nextSteps ?? [])],
|
|
127
|
-
...(options.suggestedRetry
|
|
128
|
-
? { recovery: { suggested_retry: options.suggestedRetry } }
|
|
129
|
-
: {}),
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
/** Run one SDK filesystem stage and translate only declared host faults. */
|
|
133
|
-
export async function withHostEnvironmentBoundary(operation, run, options = {}) {
|
|
134
|
-
try {
|
|
135
|
-
return await run();
|
|
136
|
-
}
|
|
137
|
-
catch (error) {
|
|
138
|
-
throw translateHostEnvironmentFault(error, operation, options) ?? error;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
6
|
+
!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]="8a0d8f6e-f4ff-5a0c-9205-d28e03df72b9")}catch(e){}}();
|
|
7
|
+
export { classifyHostEnvironmentFault, translateHostEnvironmentFault, withHostEnvironmentBoundary, } from "../../core/fs/host-environment-errors.js";
|
|
141
8
|
//# sourceMappingURL=host-environment-errors.js.map
|
|
142
|
-
//# debugId=
|
|
9
|
+
//# debugId=8a0d8f6e-f4ff-5a0c-9205-d28e03df72b9
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Provides cross-platform extension copy safety and owner-bound install locks.
|
|
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]="b100fde9-412b-587b-85ac-532117e2253f")}catch(e){}}();
|
|
8
|
+
import { withHostEnvironmentBoundary } from "../../core/fs/host-environment-errors.js";
|
|
8
9
|
import { randomUUID } from "node:crypto";
|
|
9
10
|
import fs from "node:fs/promises";
|
|
10
11
|
import os from "node:os";
|
|
@@ -88,7 +89,7 @@ export const resolveCanonicalExtensionInstallDestination = async (destinationDir
|
|
|
88
89
|
return path.join(canonicalDestinationParent, path.basename(resolvedDestination));
|
|
89
90
|
};
|
|
90
91
|
/** Copy an extension without recursively copying a destination nested below its source. */
|
|
91
|
-
export const copyExtensionDirectoryWithoutSelfNesting = async (sourceDirectory, destinationDirectory, copyDirectory, temporaryDirectory = os.tmpdir()) => {
|
|
92
|
+
export const copyExtensionDirectoryWithoutSelfNesting = async (sourceDirectory, destinationDirectory, copyDirectory, temporaryDirectory = os.tmpdir()) => withHostEnvironmentBoundary("extension_install_copy", async () => {
|
|
92
93
|
const resolvedSource = path.resolve(sourceDirectory);
|
|
93
94
|
const canonicalSource = await fs
|
|
94
95
|
.realpath(resolvedSource)
|
|
@@ -148,13 +149,15 @@ export const copyExtensionDirectoryWithoutSelfNesting = async (sourceDirectory,
|
|
|
148
149
|
finally {
|
|
149
150
|
await fs.rm(stagingRoot, { recursive: true, force: true });
|
|
150
151
|
}
|
|
151
|
-
};
|
|
152
|
+
});
|
|
152
153
|
/** Copy one extension directory with bounded transient-race retries. */
|
|
153
154
|
export const copyExtensionDirectoryForInstall = async (sourceDirectory, destinationDirectory, copyDirectory = fs.cp) => {
|
|
154
155
|
for (let attempt = 1; attempt <= EXTENSION_INSTALL_COPY_ATTEMPTS; attempt += 1) {
|
|
155
156
|
try {
|
|
156
|
-
await
|
|
157
|
-
|
|
157
|
+
await withHostEnvironmentBoundary("extension_install_copy", async () => {
|
|
158
|
+
await fs.rm(destinationDirectory, { recursive: true, force: true });
|
|
159
|
+
await copyExtensionDirectoryWithoutSelfNesting(sourceDirectory, destinationDirectory, copyDirectory);
|
|
160
|
+
});
|
|
158
161
|
return;
|
|
159
162
|
}
|
|
160
163
|
catch (error) {
|
|
@@ -308,4 +311,4 @@ export const withExtensionInstallLock = async (settingsRoot, destinationDirector
|
|
|
308
311
|
}
|
|
309
312
|
};
|
|
310
313
|
//# sourceMappingURL=install-runtime.js.map
|
|
311
|
-
//# debugId=
|
|
314
|
+
//# debugId=b100fde9-412b-587b-85ac-532117e2253f
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Captures and restores extension files and metadata around install persistence.
|
|
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]="58ec3f16-267a-5a31-abd2-df46bb82b716")}catch(e){}}();
|
|
8
|
+
import { withHostEnvironmentBoundary } from "../../core/fs/host-environment-errors.js";
|
|
8
9
|
import fs from "node:fs/promises";
|
|
9
10
|
import path from "node:path";
|
|
10
11
|
import { getSettingsPath } from "../../core/store/paths.js";
|
|
@@ -17,7 +18,7 @@ export const readOptionalMetadataFile = async (filePath) => fs.readFile(filePath
|
|
|
17
18
|
throw error;
|
|
18
19
|
});
|
|
19
20
|
/** Capture extension files and metadata before applying an install mutation. */
|
|
20
|
-
export const captureExtensionInstallSnapshot = async (selectedRoot, settingsRoot, destinationDirectory, destinationExists, backupDirectory) => {
|
|
21
|
+
export const captureExtensionInstallSnapshot = async (selectedRoot, settingsRoot, destinationDirectory, destinationExists, backupDirectory) => withHostEnvironmentBoundary("extension_install_backup", async () => {
|
|
21
22
|
const managedStatePath = resolveManagedExtensionStatePath(selectedRoot);
|
|
22
23
|
const settingsPath = getSettingsPath(settingsRoot);
|
|
23
24
|
const [managedStateContents, settingsContents] = await Promise.all([
|
|
@@ -39,9 +40,9 @@ export const captureExtensionInstallSnapshot = async (selectedRoot, settingsRoot
|
|
|
39
40
|
settingsPath,
|
|
40
41
|
settingsContents,
|
|
41
42
|
};
|
|
42
|
-
};
|
|
43
|
+
});
|
|
43
44
|
/** Restore directory and metadata snapshots after a partially persisted install. */
|
|
44
|
-
export const restoreExtensionInstallSnapshot = async (snapshot) => {
|
|
45
|
+
export const restoreExtensionInstallSnapshot = async (snapshot) => withHostEnvironmentBoundary("extension_install_rollback", async () => {
|
|
45
46
|
await fs.rm(snapshot.destinationDirectory, { recursive: true, force: true });
|
|
46
47
|
if (snapshot.destinationExists) {
|
|
47
48
|
await fs.cp(snapshot.backupDirectory, snapshot.destinationDirectory, {
|
|
@@ -61,6 +62,6 @@ export const restoreExtensionInstallSnapshot = async (snapshot) => {
|
|
|
61
62
|
await fs.writeFile(filePath, contents);
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
|
-
};
|
|
65
|
+
});
|
|
65
66
|
//# sourceMappingURL=install-snapshot.js.map
|
|
66
|
-
//# debugId=
|
|
67
|
+
//# debugId=58ec3f16-267a-5a31-abd2-df46bb82b716
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Generated partition 1 of the exhaustive error-code catalog. */
|
|
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]="35c194c8-a164-5c90-9baa-9f2fc25c9bfb")}catch(e){}}();
|
|
4
4
|
export const PM_ERROR_CODE_CATALOG_PART_1 = [
|
|
5
5
|
{
|
|
6
6
|
code: "acceptance_criteria_mutation_conflict",
|
|
@@ -690,8 +690,8 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
|
|
|
690
690
|
exit_code: 4,
|
|
691
691
|
class: "conflict",
|
|
692
692
|
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
693
|
-
sources: ["sdk/
|
|
694
|
-
emitting_commands: ["
|
|
693
|
+
sources: ["sdk/query/duplicate-candidates.ts"],
|
|
694
|
+
emitting_commands: ["duplicate-candidates"],
|
|
695
695
|
canonical_code: "duplicate_sweep_cost_limit",
|
|
696
696
|
aliases: [],
|
|
697
697
|
},
|
|
@@ -1374,7 +1374,7 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
|
|
|
1374
1374
|
exit_code: 1,
|
|
1375
1375
|
class: "generic_failure",
|
|
1376
1376
|
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
1377
|
-
sources: ["
|
|
1377
|
+
sources: ["core/fs/host-environment-errors.ts"],
|
|
1378
1378
|
emitting_commands: ["*"],
|
|
1379
1379
|
canonical_code: "host_environment_capacity_fault",
|
|
1380
1380
|
aliases: [],
|
|
@@ -1386,7 +1386,7 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
|
|
|
1386
1386
|
exit_code: 2,
|
|
1387
1387
|
class: "usage",
|
|
1388
1388
|
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
1389
|
-
sources: ["
|
|
1389
|
+
sources: ["core/fs/host-environment-errors.ts"],
|
|
1390
1390
|
emitting_commands: ["*"],
|
|
1391
1391
|
canonical_code: "host_environment_operation_invalid",
|
|
1392
1392
|
aliases: [],
|
|
@@ -1398,7 +1398,7 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
|
|
|
1398
1398
|
exit_code: 1,
|
|
1399
1399
|
class: "generic_failure",
|
|
1400
1400
|
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
1401
|
-
sources: ["
|
|
1401
|
+
sources: ["core/fs/host-environment-errors.ts"],
|
|
1402
1402
|
emitting_commands: ["*"],
|
|
1403
1403
|
canonical_code: "host_environment_permission_fault",
|
|
1404
1404
|
aliases: [],
|
|
@@ -1410,7 +1410,7 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
|
|
|
1410
1410
|
exit_code: 1,
|
|
1411
1411
|
class: "generic_failure",
|
|
1412
1412
|
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
1413
|
-
sources: ["
|
|
1413
|
+
sources: ["core/fs/host-environment-errors.ts"],
|
|
1414
1414
|
emitting_commands: ["*"],
|
|
1415
1415
|
canonical_code: "host_environment_resource_fault",
|
|
1416
1416
|
aliases: [],
|
|
@@ -2222,4 +2222,4 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
|
|
|
2222
2222
|
},
|
|
2223
2223
|
];
|
|
2224
2224
|
//# sourceMappingURL=generated-error-code-catalog-part-1.js.map
|
|
2225
|
-
//# debugId=
|
|
2225
|
+
//# debugId=35c194c8-a164-5c90-9baa-9f2fc25c9bfb
|
|
@@ -3,8 +3,9 @@ import { type AssuranceBundleMutationReceipt, type AssuranceDeclaration, type As
|
|
|
3
3
|
import { type AssuranceDerivedProposal, type AssurancePreset, type AssurancePresetId } from "./assurance-presets.js";
|
|
4
4
|
import { type CreateAssuranceWorkspaceContextOptions } from "./assurance-runtime.js";
|
|
5
5
|
import { type DefectChangeRiskReport } from "./defect-recurrence.js";
|
|
6
|
+
import { type DefectRecurrenceCoverageReport } from "./defect-recurrence-coverage.js";
|
|
6
7
|
/** Assurance registry and evaluation verbs shared by every transport. */
|
|
7
|
-
export declare const ASSURANCE_ACTIONS: readonly ["list", "show", "put", "remove", "run", "verdicts", "presets", "apply", "derive", "promote", "risk"];
|
|
8
|
+
export declare const ASSURANCE_ACTIONS: readonly ["list", "show", "put", "remove", "run", "verdicts", "presets", "apply", "derive", "promote", "risk", "lineages"];
|
|
8
9
|
/** Assurance declaration kinds shared by every transport. */
|
|
9
10
|
export declare const ASSURANCE_DECLARATION_KINDS: readonly ["measurement", "assertion", "gate"];
|
|
10
11
|
/** Assurance action verb. */
|
|
@@ -52,7 +53,7 @@ export interface AssuranceActionRuntimeOptions {
|
|
|
52
53
|
workspace?: Omit<CreateAssuranceWorkspaceContextOptions, "tree_id" | "trigger">;
|
|
53
54
|
}
|
|
54
55
|
/** Result union returned by transport-neutral assurance execution. */
|
|
55
|
-
export type AssuranceActionResult = AssuranceDeclaration | AssuranceMutationReceipt | AssuranceGateVerdict | AssuranceBundleMutationReceipt | AssurancePreset | DefectChangeRiskReport | {
|
|
56
|
+
export type AssuranceActionResult = AssuranceDeclaration | AssuranceMutationReceipt | AssuranceGateVerdict | AssuranceBundleMutationReceipt | AssurancePreset | DefectChangeRiskReport | DefectRecurrenceCoverageReport | {
|
|
56
57
|
items: AssuranceDerivedProposal[];
|
|
57
58
|
count: number;
|
|
58
59
|
applied?: AssuranceBundleMutationReceipt;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Normalizes the assurance action vocabulary once for CLI, SDK, and MCP hosts.
|
|
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]="811330eb-207d-5e27-9786-72c1fba7d4c9")}catch(e){}}();
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
9
|
import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
10
10
|
import { PmCliError } from "../../core/shared/errors.js";
|
|
@@ -18,6 +18,8 @@ import { resolvePmRoot } from "../runtime-primitives.js";
|
|
|
18
18
|
import { parseRuntimeInteger, readRuntimeString } from "../runtime-input.js";
|
|
19
19
|
import { analyzeDefectChangeRisk, buildDefectRecurrenceIndex, parseDefectChangeRiskRequest, } from "./defect-recurrence.js";
|
|
20
20
|
import { defectRecurrenceItemSignals } from "./defect-recurrence-signals.js";
|
|
21
|
+
import { readDefectRecurrenceRecord } from "./defect-recurrence-graph.js";
|
|
22
|
+
import { analyzeDefectRecurrenceCoverage, parseDefectRecurrenceCoverageRequest, } from "./defect-recurrence-coverage.js";
|
|
21
23
|
import { createUnknownSubcommandError } from "../agent/subcommand-recovery.js";
|
|
22
24
|
let riskIndexCache;
|
|
23
25
|
/** Assurance registry and evaluation verbs shared by every transport. */
|
|
@@ -33,6 +35,7 @@ export const ASSURANCE_ACTIONS = [
|
|
|
33
35
|
"derive",
|
|
34
36
|
"promote",
|
|
35
37
|
"risk",
|
|
38
|
+
"lineages",
|
|
36
39
|
];
|
|
37
40
|
/** Assurance declaration kinds shared by every transport. */
|
|
38
41
|
export const ASSURANCE_DECLARATION_KINDS = [
|
|
@@ -245,9 +248,9 @@ function throwRiskUsageError(error) {
|
|
|
245
248
|
: "assurance risk request is invalid", EXIT_CODE.USAGE);
|
|
246
249
|
}
|
|
247
250
|
/** Parse JSON or object risk definitions without wrapping workspace failures. */
|
|
248
|
-
function
|
|
251
|
+
function parseRecurrenceActionRequest(input) {
|
|
249
252
|
if (input.limit !== undefined) {
|
|
250
|
-
throw new PmCliError(
|
|
253
|
+
throw new PmCliError(`assurance ${input.action} does not accept --limit; set limit inside the definition`, EXIT_CODE.USAGE);
|
|
251
254
|
}
|
|
252
255
|
let definition = input.definition;
|
|
253
256
|
if (typeof definition === "string") {
|
|
@@ -255,11 +258,13 @@ function parseRiskActionRequest(input) {
|
|
|
255
258
|
definition = JSON.parse(definition);
|
|
256
259
|
}
|
|
257
260
|
catch (error) {
|
|
258
|
-
throw new PmCliError(
|
|
261
|
+
throw new PmCliError(`assurance ${input.action} definition must be valid JSON`, EXIT_CODE.USAGE, { reason: error instanceof Error ? error.message : "invalid_json" });
|
|
259
262
|
}
|
|
260
263
|
}
|
|
261
264
|
try {
|
|
262
|
-
return
|
|
265
|
+
return input.action === "lineages"
|
|
266
|
+
? parseDefectRecurrenceCoverageRequest(definition)
|
|
267
|
+
: parseDefectChangeRiskRequest(definition);
|
|
263
268
|
}
|
|
264
269
|
catch (error) {
|
|
265
270
|
return throwRiskUsageError(error);
|
|
@@ -285,7 +290,10 @@ function buildCachedRiskIndex(pmRoot, request, items) {
|
|
|
285
290
|
const itemFingerprints = new Map(items.map((item) => [
|
|
286
291
|
item.id,
|
|
287
292
|
createHash("sha256")
|
|
288
|
-
.update(stableStringify(
|
|
293
|
+
.update(stableStringify([
|
|
294
|
+
defectRecurrenceItemSignals(item),
|
|
295
|
+
readDefectRecurrenceRecord(item),
|
|
296
|
+
]))
|
|
289
297
|
.digest("hex"),
|
|
290
298
|
]));
|
|
291
299
|
const reusable = cached?.policy_serialized === policySerialized ? cached : undefined;
|
|
@@ -304,13 +312,17 @@ function buildCachedRiskIndex(pmRoot, request, items) {
|
|
|
304
312
|
return index;
|
|
305
313
|
}
|
|
306
314
|
/** Evaluate one serialized change-risk request against authoritative PM metadata. */
|
|
307
|
-
async function
|
|
308
|
-
const request =
|
|
315
|
+
async function runRecurrenceAction(input, pmRoot) {
|
|
316
|
+
const request = parseRecurrenceActionRequest(input);
|
|
309
317
|
const context = await createAssuranceWorkspaceContext(pmRoot, {
|
|
318
|
+
strict_read: true,
|
|
310
319
|
include_history: false,
|
|
311
320
|
resolve_tree: false,
|
|
312
321
|
});
|
|
313
322
|
try {
|
|
323
|
+
if (!("change" in request)) {
|
|
324
|
+
return analyzeDefectRecurrenceCoverage(request.policy, context.items, request);
|
|
325
|
+
}
|
|
314
326
|
return analyzeDefectChangeRisk(buildCachedRiskIndex(pmRoot, request, context.items), request.change, { cursor: request.cursor, limit: request.limit });
|
|
315
327
|
}
|
|
316
328
|
catch (error) {
|
|
@@ -333,8 +345,8 @@ export async function runAssuranceAction(input, global = {}, runtime = {}) {
|
|
|
333
345
|
if (action === "run") {
|
|
334
346
|
return runGateAction(input, pmRoot, runtime);
|
|
335
347
|
}
|
|
336
|
-
if (
|
|
337
|
-
return
|
|
348
|
+
if (["risk", "lineages"].includes(action)) {
|
|
349
|
+
return runRecurrenceAction(input, pmRoot);
|
|
338
350
|
}
|
|
339
351
|
const kind = parseKind(input.kind);
|
|
340
352
|
if (action === "list")
|
|
@@ -397,4 +409,4 @@ export function runAssuranceDispatch(args, options, global) {
|
|
|
397
409
|
}, global);
|
|
398
410
|
}
|
|
399
411
|
//# sourceMappingURL=assurance-action.js.map
|
|
400
|
-
//# debugId=
|
|
412
|
+
//# debugId=811330eb-207d-5e27-9786-72c1fba7d4c9
|
|
@@ -3,6 +3,8 @@ import type { AssuranceEvaluationContext, AssuranceExternalMeasurementResult, As
|
|
|
3
3
|
export type AssuranceProviderResolver = (source: AssuranceProviderSource) => Promise<AssuranceExternalMeasurementResult>;
|
|
4
4
|
/** Workspace binding options. */
|
|
5
5
|
export interface CreateAssuranceWorkspaceContextOptions {
|
|
6
|
+
/** Refuse incomplete item or directory reads through the public strict-list contract. */
|
|
7
|
+
strict_read?: boolean;
|
|
6
8
|
/** Explicit tree identity; otherwise the current Git commit is used. */
|
|
7
9
|
tree_id?: string;
|
|
8
10
|
/** Load immutable item history for history-backed measurements. */
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
* and verdict semantics in the host-neutral assurance module.
|
|
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]="cdf52e5c-86cf-5540-bc08-bfc274a1fdf9")}catch(e){}}();
|
|
9
9
|
import { execFile } from "node:child_process";
|
|
10
10
|
import { promisify } from "node:util";
|
|
11
11
|
import { runGraph } from "../graph/run.js";
|
|
12
12
|
import { runHealth } from "./health.js";
|
|
13
13
|
import { runValidate } from "./validate.js";
|
|
14
|
+
import { runList } from "../query/list.js";
|
|
14
15
|
import { AssuranceSourceResolutionError } from "./assurance-mutation-error.js";
|
|
15
16
|
import { getActiveExtensionRegistrations, resolvePortableWorkspaceContext, } from "../../core/extensions/index.js";
|
|
16
17
|
import { resolveRegisteredAssuranceMeasurementProvider } from "../../core/extensions/runtime-registrations.js";
|
|
@@ -161,7 +162,9 @@ export async function createAssuranceWorkspaceContext(pmRoot, options = {}) {
|
|
|
161
162
|
const settings = await readSettings(pmRoot);
|
|
162
163
|
const typeRegistry = resolveItemTypeRegistry(settings);
|
|
163
164
|
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
164
|
-
const metadata =
|
|
165
|
+
const metadata = options.strict_read === true
|
|
166
|
+
? (await runList(undefined, { status: "all", full: true, noTruncate: true, strictRead: true }, { path: pmRoot })).items
|
|
167
|
+
: await listAllItemMetadata(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema);
|
|
165
168
|
const items = metadata.map((item) => ({
|
|
166
169
|
...item,
|
|
167
170
|
id: item.id,
|
|
@@ -233,4 +236,4 @@ export async function createAssuranceWorkspaceContext(pmRoot, options = {}) {
|
|
|
233
236
|
};
|
|
234
237
|
}
|
|
235
238
|
//# sourceMappingURL=assurance-runtime.js.map
|
|
236
|
-
//# debugId=
|
|
239
|
+
//# debugId=cdf52e5c-86cf-5540-bc08-bfc274a1fdf9
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { AssuranceItemRecord } from "./assurance.js";
|
|
2
|
+
import { type DefectEscapeClass, type DefectRecurrencePolicy } from "./defect-recurrence.js";
|
|
3
|
+
/** Bounded recurrence-evidence selection shared by SDK and transport hosts. */
|
|
4
|
+
export interface DefectRecurrenceCoverageOptions {
|
|
5
|
+
/** Maximum item rows returned, from 1 through 100; defaults to 25. */
|
|
6
|
+
limit?: number;
|
|
7
|
+
/** Continuation tied to the policy, complete recurrence evidence, and filter. */
|
|
8
|
+
cursor?: string;
|
|
9
|
+
/** Return only unregistered or missing items; totals always describe the full graph. */
|
|
10
|
+
uncoveredOnly?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Serialized request for the shared assurance lineages action. */
|
|
13
|
+
export interface DefectRecurrenceCoverageRequest extends DefectRecurrenceCoverageOptions {
|
|
14
|
+
/** Project- or package-owned versioned family policy. */
|
|
15
|
+
policy: DefectRecurrencePolicy;
|
|
16
|
+
}
|
|
17
|
+
/** Validate lineage-policy and paging input at the untrusted transport boundary. */
|
|
18
|
+
export declare function parseDefectRecurrenceCoverageRequest(value: unknown): DefectRecurrenceCoverageRequest;
|
|
19
|
+
/** One registered, unregistered, or missing member of a recorded recurrence lineage. */
|
|
20
|
+
export interface DefectRecurrenceCoverageRow {
|
|
21
|
+
/** Recorded item id or missing local reference. */
|
|
22
|
+
item_id: string;
|
|
23
|
+
/** Current component identity, derived from its lexically first item id. */
|
|
24
|
+
lineage_id: string;
|
|
25
|
+
/** Full component size, independent of the returned page. */
|
|
26
|
+
lineage_item_count: number;
|
|
27
|
+
/** Explicitly registered families covering this component. */
|
|
28
|
+
family_ids: string[];
|
|
29
|
+
/** Whether the local item exists in the supplied authoritative corpus. */
|
|
30
|
+
present: boolean;
|
|
31
|
+
/** Stable named finding when registration or the target record is absent. */
|
|
32
|
+
finding?: "unregistered_recurrence_item" | "missing_recurrence_item";
|
|
33
|
+
}
|
|
34
|
+
/** Complete population counts and bounded recurrence-policy evidence. */
|
|
35
|
+
export interface DefectRecurrenceCoverageReport {
|
|
36
|
+
/** False if any recorded recurrence member is unregistered or missing. */
|
|
37
|
+
ok: boolean;
|
|
38
|
+
/** Identity of policy, recurrence evidence, and selected filter. */
|
|
39
|
+
fingerprint: string;
|
|
40
|
+
/** Current page; every row remains connected to its complete lineage. */
|
|
41
|
+
items: DefectRecurrenceCoverageRow[];
|
|
42
|
+
/** Selected row count before pagination. */
|
|
43
|
+
total: number;
|
|
44
|
+
/** Whether another page remains. */
|
|
45
|
+
has_more: boolean;
|
|
46
|
+
/** Cursor for the next page when has_more is true. */
|
|
47
|
+
next_cursor?: string;
|
|
48
|
+
/** Independent denominator including covered, uncovered, and absent local references. */
|
|
49
|
+
population: {
|
|
50
|
+
/** Explicit statement that the denominator is not the family registry. */
|
|
51
|
+
scope: "all_recorded_recurrence_items";
|
|
52
|
+
/** Unique participating local ids, including missing references. */
|
|
53
|
+
item_count: number;
|
|
54
|
+
/** Connected recurrence components. */
|
|
55
|
+
lineage_count: number;
|
|
56
|
+
/** Unique directed local recurrence edges. */
|
|
57
|
+
edge_count: number;
|
|
58
|
+
/** Existing members with an explicitly seeded registered family. */
|
|
59
|
+
covered_item_count: number;
|
|
60
|
+
/** Existing or missing members without a seeded registered family. */
|
|
61
|
+
uncovered_item_count: number;
|
|
62
|
+
/** Referenced ids missing from the authoritative item corpus. */
|
|
63
|
+
missing_item_count: number;
|
|
64
|
+
/** Members with an explicit recognized escape classification. */
|
|
65
|
+
classified_item_count: number;
|
|
66
|
+
/** Members without a recognized classification; never counted as non-escapes. */
|
|
67
|
+
unclassified_item_count: number;
|
|
68
|
+
/** Recorded classification counts over the entire population. */
|
|
69
|
+
class_counts: Record<DefectEscapeClass, number>;
|
|
70
|
+
/** Production-defect fraction only when every participant is classified; null otherwise. */
|
|
71
|
+
escape_rate: number | null;
|
|
72
|
+
/** Known production defects divided by the entire population, explicitly a lower bound. */
|
|
73
|
+
escape_rate_lower_bound: number | null;
|
|
74
|
+
};
|
|
75
|
+
/** Budgets on the policy's families cannot certify uncovered or unclassified members. */
|
|
76
|
+
budget_scope: "registered_families_only";
|
|
77
|
+
/** Declared performance accounting; connectivity never uses a depth cutoff. */
|
|
78
|
+
cost: {
|
|
79
|
+
/** Input item records inspected. */
|
|
80
|
+
items_scanned: number;
|
|
81
|
+
/** Recurrence edges traversed. */
|
|
82
|
+
edges_scanned: number;
|
|
83
|
+
/** Maximum emitted item rows. */
|
|
84
|
+
row_limit: number;
|
|
85
|
+
};
|
|
86
|
+
/** Stable machine selector. */
|
|
87
|
+
row_contract: {
|
|
88
|
+
row_keys: ["items"];
|
|
89
|
+
jq_selector: ".items[]";
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/** Evaluate all local recurs_from lineages before applying any result-row limit. */
|
|
93
|
+
export declare function analyzeDefectRecurrenceCoverage(policy: DefectRecurrencePolicy, items: readonly AssuranceItemRecord[], options?: DefectRecurrenceCoverageOptions): DefectRecurrenceCoverageReport;
|