@agent-teams/engineering-foundation 1.4.1 → 1.5.0
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/dist/capabilities/public-api-compatibility/adapters/inbound/authority/growth-authority-contract.d.ts +10 -0
- package/dist/capabilities/public-api-compatibility/adapters/inbound/authority/growth-authority-contract.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/inbound/authority/growth-authority-contract.js +2 -0
- package/dist/capabilities/public-api-compatibility/adapters/inbound/authority/growth-authority-contract.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/crypto/node-change-fingerprint.d.ts +2 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/crypto/node-change-fingerprint.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/crypto/node-change-fingerprint.js +4 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/crypto/node-change-fingerprint.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/artifact-public-api-evidence.d.ts +7 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/artifact-public-api-evidence.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/artifact-public-api-evidence.js +16 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/artifact-public-api-evidence.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/filesystem-public-api-repository.d.ts +6 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/filesystem-public-api-repository.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/filesystem-public-api-repository.js +22 -2
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/filesystem-public-api-repository.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/growth-invocation.d.ts +3 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/growth-invocation.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/growth-invocation.js +10 -7
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/growth-invocation.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/growth-metadata-root-sources.d.ts +13 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/growth-metadata-root-sources.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/growth-metadata-root-sources.js +38 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/growth-metadata-root-sources.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/growth-report-writer.d.ts +3 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/growth-report-writer.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/growth-report-writer.js +17 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/growth-report-writer.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-baseline-mapper.d.ts +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-baseline-mapper.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-baseline-mapper.js +6 -2
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-baseline-mapper.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-evidence-files.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-evidence-files.js +64 -26
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-evidence-files.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/reviewrouter/reviewrouter-growth-authority-acl.d.ts +18 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/reviewrouter/reviewrouter-growth-authority-acl.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/reviewrouter/reviewrouter-growth-authority-acl.js +51 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/reviewrouter/reviewrouter-growth-authority-acl.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/reviewrouter/strict-json-response.d.ts +5 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/reviewrouter/strict-json-response.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/reviewrouter/strict-json-response.js +118 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/reviewrouter/strict-json-response.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/reviewrouter/verified-growth-input-context.d.ts +28 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/reviewrouter/verified-growth-input-context.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/reviewrouter/verified-growth-input-context.js +163 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/reviewrouter/verified-growth-input-context.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/reviewrouter/verified-growth-observation.d.ts +8 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/reviewrouter/verified-growth-observation.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/reviewrouter/verified-growth-observation.js +59 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/reviewrouter/verified-growth-observation.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/api.d.ts +1 -0
- package/dist/capabilities/public-api-compatibility/api.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/model/growth-admission-context.d.ts +9 -0
- package/dist/capabilities/public-api-compatibility/application/model/growth-admission-context.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/model/growth-authority.d.ts +243 -0
- package/dist/capabilities/public-api-compatibility/application/model/growth-authority.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/model/growth-authority.js +5 -0
- package/dist/capabilities/public-api-compatibility/application/model/growth-authority.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/policies/default-type-argument-equivalence.d.ts +15 -0
- package/dist/capabilities/public-api-compatibility/application/policies/default-type-argument-equivalence.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/policies/default-type-argument-equivalence.js +282 -0
- package/dist/capabilities/public-api-compatibility/application/policies/default-type-argument-equivalence.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-growth-admission.d.ts +18 -2
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-growth-admission.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-growth-admission.js +35 -15
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-growth-admission.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-growth-release-compatibility.d.ts +4 -2
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-growth-release-compatibility.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-growth-release-compatibility.js +76 -9
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-growth-release-compatibility.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-initial-release.d.ts +15 -0
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-initial-release.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-initial-release.js +26 -0
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-initial-release.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-public-api-compatibility.d.ts +1 -1
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-public-api-compatibility.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-public-api-compatibility.js +19 -10
- package/dist/capabilities/public-api-compatibility/application/policies/evaluate-public-api-compatibility.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/policies/normalize-growth-observation.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/policies/normalize-growth-observation.js +2 -1
- package/dist/capabilities/public-api-compatibility/application/policies/normalize-growth-observation.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/policies/project-growth-report.js +47 -19
- package/dist/capabilities/public-api-compatibility/application/policies/project-growth-report.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/policies/validate-growth-authority-primitives.d.ts +18 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-growth-authority-primitives.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-growth-authority-primitives.js +153 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-growth-authority-primitives.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-growth-authority.d.ts +24 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-growth-authority.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-growth-authority.js +610 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-growth-authority.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-growth-installed-inventory.d.ts +8 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-growth-installed-inventory.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-growth-installed-inventory.js +11 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-growth-installed-inventory.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-growth-metadata-root.d.ts +13 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-growth-metadata-root.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-growth-metadata-root.js +121 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-growth-metadata-root.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/ports/change-fingerprint.d.ts +2 -1
- package/dist/capabilities/public-api-compatibility/application/ports/change-fingerprint.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/ports/growth-authority.d.ts +17 -0
- package/dist/capabilities/public-api-compatibility/application/ports/growth-authority.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/ports/growth-authority.js +2 -0
- package/dist/capabilities/public-api-compatibility/application/ports/growth-authority.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/ports/growth-input-context.d.ts +11 -1
- package/dist/capabilities/public-api-compatibility/application/ports/growth-input-context.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/ports/public-api-repository.d.ts +6 -0
- package/dist/capabilities/public-api-compatibility/application/ports/public-api-repository.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/admit-sdk-growth.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/admit-sdk-growth.js +31 -5
- package/dist/capabilities/public-api-compatibility/application/use-cases/admit-sdk-growth.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/analyze-public-api-compatibility.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/analyze-public-api-compatibility.js +8 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/analyze-public-api-compatibility.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/check-sdk-growth.d.ts +11 -2
- package/dist/capabilities/public-api-compatibility/application/use-cases/check-sdk-growth.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/check-sdk-growth.js +11 -8
- package/dist/capabilities/public-api-compatibility/application/use-cases/check-sdk-growth.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/preflight-public-api-promotions.d.ts +2 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/preflight-public-api-promotions.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/preflight-public-api-promotions.js +16 -4
- package/dist/capabilities/public-api-compatibility/application/use-cases/preflight-public-api-promotions.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/promote-public-api-baselines.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/promote-public-api-baselines.js +24 -11
- package/dist/capabilities/public-api-compatibility/application/use-cases/promote-public-api-baselines.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/qualify-sdk-growth.d.ts +16 -0
- package/dist/capabilities/public-api-compatibility/application/use-cases/qualify-sdk-growth.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/use-cases/qualify-sdk-growth.js +45 -0
- package/dist/capabilities/public-api-compatibility/application/use-cases/qualify-sdk-growth.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/authority-module.d.ts +30 -0
- package/dist/capabilities/public-api-compatibility/authority-module.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/authority-module.js +142 -0
- package/dist/capabilities/public-api-compatibility/authority-module.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/module.d.ts +16 -0
- package/dist/capabilities/public-api-compatibility/module.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/module.js +6 -6
- package/dist/capabilities/public-api-compatibility/module.js.map +1 -1
- package/dist/composition/quality-coverage.d.ts +1 -1
- package/dist/composition/quality-coverage.d.ts.map +1 -1
- package/dist/composition/sdk-growth-authority.d.ts +13 -0
- package/dist/composition/sdk-growth-authority.d.ts.map +1 -0
- package/dist/composition/sdk-growth-authority.js +19 -0
- package/dist/composition/sdk-growth-authority.js.map +1 -0
- package/dist/features/validation-reporting/api.d.ts +1 -1
- package/dist/features/validation-reporting/api.d.ts.map +1 -1
- package/dist/features/validation-reporting/api.js.map +1 -1
- package/dist/features/validation-reporting/application/model.d.ts +2 -3
- package/dist/features/validation-reporting/application/model.d.ts.map +1 -1
- package/dist/sdk-growth-authority.d.ts +15 -0
- package/dist/sdk-growth-authority.d.ts.map +1 -0
- package/dist/sdk-growth-authority.js +2 -0
- package/dist/sdk-growth-authority.js.map +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
const IDENTIFIER = "[A-Za-z_$][A-Za-z0-9_$]*";
|
|
2
|
+
const TYPE_ATOM = `${IDENTIFIER}(?:\\.${IDENTIFIER})*`;
|
|
3
|
+
const TYPE_ALIAS = new RegExp(`^(export type ${IDENTIFIER}(?:<([^<>\\r\\n]+)>)? = )(${IDENTIFIER})(?:<(${TYPE_ATOM}(?:, ${TYPE_ATOM})*)>)?;$`, "u");
|
|
4
|
+
const GENERIC_DECLARATION = new RegExp(`^export (?:declare )?(?:abstract )?(class|interface|type) (${IDENTIFIER})<([^<>\\r\\n]+)>(?=$| extends | implements | = )`, "u");
|
|
5
|
+
const TOP_LEVEL_TYPE_DECLARATION = new RegExp(`^export (?:declare )?(?:abstract )?(?:class|interface|type|enum) (${IDENTIFIER})(?:<| |$)`, "u");
|
|
6
|
+
const TYPE_PARAMETER = new RegExp(`^(${IDENTIFIER})(?: extends (${TYPE_ATOM}))?(?: = (${TYPE_ATOM}))?$`, "u");
|
|
7
|
+
const LEADING_TYPE_NAME = new RegExp(`^(${IDENTIFIER})(?:\\.|$)`, "u");
|
|
8
|
+
const RESERVED_IDENTIFIERS = new Set([
|
|
9
|
+
"any",
|
|
10
|
+
"await",
|
|
11
|
+
"bigint",
|
|
12
|
+
"boolean",
|
|
13
|
+
"break",
|
|
14
|
+
"case",
|
|
15
|
+
"catch",
|
|
16
|
+
"class",
|
|
17
|
+
"const",
|
|
18
|
+
"continue",
|
|
19
|
+
"debugger",
|
|
20
|
+
"default",
|
|
21
|
+
"delete",
|
|
22
|
+
"do",
|
|
23
|
+
"else",
|
|
24
|
+
"enum",
|
|
25
|
+
"export",
|
|
26
|
+
"extends",
|
|
27
|
+
"false",
|
|
28
|
+
"finally",
|
|
29
|
+
"for",
|
|
30
|
+
"function",
|
|
31
|
+
"if",
|
|
32
|
+
"implements",
|
|
33
|
+
"import",
|
|
34
|
+
"in",
|
|
35
|
+
"infer",
|
|
36
|
+
"instanceof",
|
|
37
|
+
"interface",
|
|
38
|
+
"intrinsic",
|
|
39
|
+
"keyof",
|
|
40
|
+
"let",
|
|
41
|
+
"never",
|
|
42
|
+
"new",
|
|
43
|
+
"null",
|
|
44
|
+
"number",
|
|
45
|
+
"object",
|
|
46
|
+
"package",
|
|
47
|
+
"private",
|
|
48
|
+
"protected",
|
|
49
|
+
"public",
|
|
50
|
+
"readonly",
|
|
51
|
+
"return",
|
|
52
|
+
"static",
|
|
53
|
+
"string",
|
|
54
|
+
"super",
|
|
55
|
+
"switch",
|
|
56
|
+
"symbol",
|
|
57
|
+
"this",
|
|
58
|
+
"throw",
|
|
59
|
+
"true",
|
|
60
|
+
"try",
|
|
61
|
+
"typeof",
|
|
62
|
+
"undefined",
|
|
63
|
+
"unique",
|
|
64
|
+
"unknown",
|
|
65
|
+
"var",
|
|
66
|
+
"void",
|
|
67
|
+
"while",
|
|
68
|
+
"with",
|
|
69
|
+
"yield"
|
|
70
|
+
]);
|
|
71
|
+
const SUPPORTED_KEYWORD_TYPE_ATOMS = new Set([
|
|
72
|
+
"any",
|
|
73
|
+
"bigint",
|
|
74
|
+
"boolean",
|
|
75
|
+
"false",
|
|
76
|
+
"never",
|
|
77
|
+
"null",
|
|
78
|
+
"number",
|
|
79
|
+
"object",
|
|
80
|
+
"string",
|
|
81
|
+
"symbol",
|
|
82
|
+
"this",
|
|
83
|
+
"true",
|
|
84
|
+
"undefined",
|
|
85
|
+
"unknown",
|
|
86
|
+
"void"
|
|
87
|
+
]);
|
|
88
|
+
function isSupportedTypeAtom(type) {
|
|
89
|
+
if (SUPPORTED_KEYWORD_TYPE_ATOMS.has(type)) {
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
return type.split(".").every((part) => !RESERVED_IDENTIFIERS.has(part));
|
|
93
|
+
}
|
|
94
|
+
function parseTypeParameters(header) {
|
|
95
|
+
const names = [];
|
|
96
|
+
const defaults = [];
|
|
97
|
+
const seenNames = new Set();
|
|
98
|
+
let sawDefault = false;
|
|
99
|
+
for (const parameter of header.split(", ")) {
|
|
100
|
+
const match = TYPE_PARAMETER.exec(parameter);
|
|
101
|
+
const name = match?.[1];
|
|
102
|
+
const constraint = match?.[2];
|
|
103
|
+
const defaultType = match?.[3];
|
|
104
|
+
if (match === null ||
|
|
105
|
+
name === undefined ||
|
|
106
|
+
RESERVED_IDENTIFIERS.has(name) ||
|
|
107
|
+
(constraint !== undefined && !isSupportedTypeAtom(constraint)) ||
|
|
108
|
+
(defaultType !== undefined && !isSupportedTypeAtom(defaultType)) ||
|
|
109
|
+
seenNames.has(name) ||
|
|
110
|
+
(sawDefault && defaultType === undefined)) {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
names.push(name);
|
|
114
|
+
defaults.push(defaultType);
|
|
115
|
+
seenNames.add(name);
|
|
116
|
+
sawDefault = defaultType !== undefined;
|
|
117
|
+
}
|
|
118
|
+
return Object.freeze({
|
|
119
|
+
names: Object.freeze(names),
|
|
120
|
+
defaults: Object.freeze(defaults)
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function parseDirectTypeAlias(signature) {
|
|
124
|
+
const match = TYPE_ALIAS.exec(signature);
|
|
125
|
+
if (match === null || match[1] === undefined || match[3] === undefined) {
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
const parameters = match[2] === undefined
|
|
129
|
+
? Object.freeze({ names: Object.freeze([]), defaults: Object.freeze([]) })
|
|
130
|
+
: parseTypeParameters(match[2]);
|
|
131
|
+
if (parameters === undefined) {
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
const aliasArguments = match[4]?.split(", ") ?? [];
|
|
135
|
+
if (!aliasArguments.every(isSupportedTypeAtom)) {
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
return Object.freeze({
|
|
139
|
+
header: match[1],
|
|
140
|
+
parameterNames: new Set(parameters.names),
|
|
141
|
+
target: match[3],
|
|
142
|
+
arguments: Object.freeze(aliasArguments)
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
function parseGenericDeclaration(signature) {
|
|
146
|
+
const match = GENERIC_DECLARATION.exec(signature);
|
|
147
|
+
if (match === null ||
|
|
148
|
+
match[1] === undefined ||
|
|
149
|
+
match[2] === undefined ||
|
|
150
|
+
match[3] === undefined) {
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
const parameters = parseTypeParameters(match[3]);
|
|
154
|
+
if (parameters === undefined) {
|
|
155
|
+
return undefined;
|
|
156
|
+
}
|
|
157
|
+
return Object.freeze({
|
|
158
|
+
name: match[2],
|
|
159
|
+
kind: match[1] === "class"
|
|
160
|
+
? "Class"
|
|
161
|
+
: match[1] === "interface"
|
|
162
|
+
? "Interface"
|
|
163
|
+
: "TypeAlias",
|
|
164
|
+
parameterNames: new Set(parameters.names),
|
|
165
|
+
defaults: parameters.defaults
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function unchangedTopLevelType(name, releasedItems, currentItems) {
|
|
169
|
+
const candidates = (items) => items.filter((item) => {
|
|
170
|
+
if (item.parentKind !== "EntryPoint") {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
return TOP_LEVEL_TYPE_DECLARATION.exec(item.signature)?.[1] === name;
|
|
174
|
+
});
|
|
175
|
+
const released = candidates(releasedItems);
|
|
176
|
+
const current = candidates(currentItems);
|
|
177
|
+
if (released.length !== 1 || current.length !== 1) {
|
|
178
|
+
return undefined;
|
|
179
|
+
}
|
|
180
|
+
const before = released[0];
|
|
181
|
+
const after = current[0];
|
|
182
|
+
if (before === undefined ||
|
|
183
|
+
after === undefined ||
|
|
184
|
+
before.canonicalReference !== after.canonicalReference ||
|
|
185
|
+
before.kind !== after.kind ||
|
|
186
|
+
before.parentKind !== after.parentKind ||
|
|
187
|
+
before.parentReference !== after.parentReference ||
|
|
188
|
+
before.signature !== after.signature) {
|
|
189
|
+
return undefined;
|
|
190
|
+
}
|
|
191
|
+
return before;
|
|
192
|
+
}
|
|
193
|
+
function unchangedTarget(name, releasedItems, currentItems) {
|
|
194
|
+
const target = unchangedTopLevelType(name, releasedItems, currentItems);
|
|
195
|
+
if (target === undefined) {
|
|
196
|
+
return undefined;
|
|
197
|
+
}
|
|
198
|
+
const declaration = parseGenericDeclaration(target.signature);
|
|
199
|
+
return declaration?.kind === target.kind ? declaration : undefined;
|
|
200
|
+
}
|
|
201
|
+
function hasUnchangedTypeAtomBinding(type, releasedItems, currentItems, stableTypeBindings) {
|
|
202
|
+
if (SUPPORTED_KEYWORD_TYPE_ATOMS.has(type)) {
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
if (type.includes(".")) {
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
return (unchangedTopLevelType(type, releasedItems, currentItems) !== undefined ||
|
|
209
|
+
stableTypeBindings.has(type));
|
|
210
|
+
}
|
|
211
|
+
function omittedArgumentsEqualDefaults(shorter, longer, declaration, bindings) {
|
|
212
|
+
if (shorter.arguments.length >= longer.arguments.length ||
|
|
213
|
+
longer.arguments.length > declaration.defaults.length) {
|
|
214
|
+
return false;
|
|
215
|
+
}
|
|
216
|
+
for (const [index, argument] of shorter.arguments.entries()) {
|
|
217
|
+
if (longer.arguments[index] !== argument) {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
for (let index = shorter.arguments.length; index < longer.arguments.length; index += 1) {
|
|
222
|
+
const declaredDefault = declaration.defaults[index];
|
|
223
|
+
const leadingName = declaredDefault === undefined
|
|
224
|
+
? undefined
|
|
225
|
+
: LEADING_TYPE_NAME.exec(declaredDefault)?.[1];
|
|
226
|
+
if (declaredDefault === undefined ||
|
|
227
|
+
declaredDefault !== longer.arguments[index] ||
|
|
228
|
+
leadingName === undefined ||
|
|
229
|
+
declaration.parameterNames.has(leadingName) ||
|
|
230
|
+
shorter.parameterNames.has(leadingName) ||
|
|
231
|
+
!hasUnchangedTypeAtomBinding(declaredDefault, bindings.releasedItems, bindings.currentItems, bindings.stableTypeBindings)) {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
/** A comparison-only exception for one direct type-alias default-argument spelling. */
|
|
238
|
+
export function hasEquivalentTrailingDefaultTypeArguments(input) {
|
|
239
|
+
if (input.releasedItem.kind !== "TypeAlias" ||
|
|
240
|
+
input.currentItem.kind !== "TypeAlias" ||
|
|
241
|
+
input.releasedItem.parentKind !== "EntryPoint" ||
|
|
242
|
+
input.currentItem.parentKind !== "EntryPoint") {
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
const released = parseDirectTypeAlias(input.releasedItem.signature);
|
|
246
|
+
const current = parseDirectTypeAlias(input.currentItem.signature);
|
|
247
|
+
if (released === undefined ||
|
|
248
|
+
current === undefined ||
|
|
249
|
+
released.header !== current.header ||
|
|
250
|
+
released.target !== current.target ||
|
|
251
|
+
released.parameterNames.has(released.target) ||
|
|
252
|
+
current.parameterNames.has(current.target)) {
|
|
253
|
+
return false;
|
|
254
|
+
}
|
|
255
|
+
const target = unchangedTarget(released.target, input.releasedItems, input.currentItems);
|
|
256
|
+
if (target === undefined) {
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
259
|
+
const bindings = Object.freeze({
|
|
260
|
+
releasedItems: input.releasedItems,
|
|
261
|
+
currentItems: input.currentItems,
|
|
262
|
+
stableTypeBindings: input.stableTypeBindings ?? new Set()
|
|
263
|
+
});
|
|
264
|
+
return released.arguments.length < current.arguments.length
|
|
265
|
+
? omittedArgumentsEqualDefaults(released, current, target, bindings)
|
|
266
|
+
: omittedArgumentsEqualDefaults(current, released, target, bindings);
|
|
267
|
+
}
|
|
268
|
+
/** Names whose unique public canonical identity is byte-stable across all governed packages. */
|
|
269
|
+
export function collectUnchangedPublicTypeBindings(pairs) {
|
|
270
|
+
const comparablePairs = pairs.filter(({ released, current }) => released.extractorVersion === current.extractorVersion);
|
|
271
|
+
const releasedItems = comparablePairs.flatMap(({ released }) => released.entrypoints.flatMap(({ items }) => items));
|
|
272
|
+
const currentItems = comparablePairs.flatMap(({ current }) => current.entrypoints.flatMap(({ items }) => items));
|
|
273
|
+
const names = new Set();
|
|
274
|
+
for (const item of [...releasedItems, ...currentItems]) {
|
|
275
|
+
const name = TOP_LEVEL_TYPE_DECLARATION.exec(item.signature)?.[1];
|
|
276
|
+
if (name !== undefined) {
|
|
277
|
+
names.add(name);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return new Set([...names].filter((name) => unchangedTopLevelType(name, releasedItems, currentItems) !== undefined));
|
|
281
|
+
}
|
|
282
|
+
//# sourceMappingURL=default-type-argument-equivalence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-type-argument-equivalence.js","sourceRoot":"","sources":["../../../../../src/capabilities/public-api-compatibility/application/policies/default-type-argument-equivalence.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAG,0BAA0B,CAAC;AAC9C,MAAM,SAAS,GAAG,GAAG,UAAU,SAAS,UAAU,IAAI,CAAC;AACvD,MAAM,UAAU,GAAG,IAAI,MAAM,CAC3B,iBAAiB,UAAU,6BAA6B,UAAU,SAAS,SAAS,QAAQ,SAAS,UAAU,EAC/G,GAAG,CACJ,CAAC;AACF,MAAM,mBAAmB,GAAG,IAAI,MAAM,CACpC,8DAA8D,UAAU,mDAAmD,EAC3H,GAAG,CACJ,CAAC;AACF,MAAM,0BAA0B,GAAG,IAAI,MAAM,CAC3C,qEAAqE,UAAU,YAAY,EAC3F,GAAG,CACJ,CAAC;AACF,MAAM,cAAc,GAAG,IAAI,MAAM,CAC/B,KAAK,UAAU,iBAAiB,SAAS,aAAa,SAAS,MAAM,EACrE,GAAG,CACJ,CAAC;AACF,MAAM,iBAAiB,GAAG,IAAI,MAAM,CAAC,KAAK,UAAU,YAAY,EAAE,GAAG,CAAC,CAAC;AACvE,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC;IACnC,KAAK;IACL,OAAO;IACP,QAAQ;IACR,SAAS;IACT,OAAO;IACP,MAAM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C,CAAC,CAAC,CAAC;QAClE,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,GAAG,CACZ,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,CACf,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAqB,CAAC,IAAI,EAAE,aAAa,EAAE,YAAY,CAAC,KAAK,SAAS,CACjF,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
import type { GrowthAdmissionResult, GrowthComparison, GrowthDecision, GrowthDecisionAuthority } from "../model/growth-admission.js";
|
|
1
|
+
import type { GrowthAdmissionDiagnostic, GrowthAdmissionResult, GrowthComparison, GrowthDecision, GrowthDecisionAuthority } from "../model/growth-admission.js";
|
|
2
2
|
import type { GrowthDigest } from "../model/growth-observation.js";
|
|
3
3
|
import type { ChangeFingerprint } from "../ports/change-fingerprint.js";
|
|
4
|
-
export declare function growthDecisionDigest(decision:
|
|
4
|
+
export declare function growthDecisionDigest(decision: unknown, fingerprint: ChangeFingerprint): GrowthDigest;
|
|
5
|
+
export interface PreparedGrowthDecisions {
|
|
6
|
+
readonly budgetExceeded: boolean;
|
|
7
|
+
/** Every structurally valid original, including duplicate IDs. */
|
|
8
|
+
readonly decisions: readonly {
|
|
9
|
+
readonly decision: GrowthDecision;
|
|
10
|
+
readonly authorityEligible: boolean;
|
|
11
|
+
}[];
|
|
12
|
+
/** The only proposals for which external authority may be requested. */
|
|
13
|
+
readonly authorityCandidates: readonly GrowthDecision[];
|
|
14
|
+
readonly diagnostics: readonly GrowthAdmissionDiagnostic[];
|
|
15
|
+
}
|
|
16
|
+
/** Shared bounded preparation for ordinary admission and trusted authority.
|
|
17
|
+
* No decision is hashed until the complete raw collection is within budget.
|
|
18
|
+
* Malformed and duplicate originals remain visible to admission diagnostics,
|
|
19
|
+
* while only valid unique IDs may be sent to an authority provider. */
|
|
20
|
+
export declare function prepareGrowthDecisions(rawDecisions: readonly unknown[]): PreparedGrowthDecisions;
|
|
5
21
|
/** Exact PR admission only. The independent released policy's failure is final;
|
|
6
22
|
* authority must bind the entire normalized decision, not merely its ID. */
|
|
7
23
|
export declare function evaluateGrowthAdmission(input: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate-growth-admission.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/public-api-compatibility/application/policies/evaluate-growth-admission.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"evaluate-growth-admission.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/public-api-compatibility/application/policies/evaluate-growth-admission.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,cAAc,EAAE,uBAAuB,EAAoB,MAAM,8BAA8B,CAAC;AAElL,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAaxE,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,GAAG,YAAY,CAEpG;AAqDD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,kEAAkE;IAClE,QAAQ,CAAC,SAAS,EAAE,SAAS;QAC3B,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;QAClC,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;KACrC,EAAE,CAAC;IACJ,wEAAwE;IACxE,QAAQ,CAAC,mBAAmB,EAAE,SAAS,cAAc,EAAE,CAAC;IACxD,QAAQ,CAAC,WAAW,EAAE,SAAS,yBAAyB,EAAE,CAAC;CAC5D;AAED;;;uEAGuE;AACvE,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,SAAS,OAAO,EAAE,GAAG,uBAAuB,CAoChG;AAED;4EAC4E;AAC5E,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,SAAS,OAAO,EAAE,CAAC;IACvC,QAAQ,CAAC,SAAS,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACvD,QAAQ,CAAC,aAAa,EAAE,UAAU,GAAG,UAAU,GAAG,YAAY,CAAC;CAChE,EAAE,WAAW,EAAE,iBAAiB,GAAG,qBAAqB,CAyCxD"}
|
package/dist/capabilities/public-api-compatibility/application/policies/evaluate-growth-admission.js
CHANGED
|
@@ -70,13 +70,18 @@ function withinDecisionBudget(rawDecisions) {
|
|
|
70
70
|
}
|
|
71
71
|
return true;
|
|
72
72
|
}
|
|
73
|
-
/**
|
|
74
|
-
|
|
73
|
+
/** Shared bounded preparation for ordinary admission and trusted authority.
|
|
74
|
+
* No decision is hashed until the complete raw collection is within budget.
|
|
75
|
+
* Malformed and duplicate originals remain visible to admission diagnostics,
|
|
76
|
+
* while only valid unique IDs may be sent to an authority provider. */
|
|
77
|
+
export function prepareGrowthDecisions(rawDecisions) {
|
|
75
78
|
if (!withinDecisionBudget(rawDecisions)) {
|
|
76
|
-
return
|
|
79
|
+
return { budgetExceeded: true, decisions: [], authorityCandidates: [], diagnostics: decisionBudgetExhausted().diagnostics };
|
|
77
80
|
}
|
|
81
|
+
const diagnostics = [];
|
|
78
82
|
const decisions = [];
|
|
79
83
|
const counts = new Map();
|
|
84
|
+
const claimCounts = new Map();
|
|
80
85
|
for (const raw of rawDecisions) {
|
|
81
86
|
let decision;
|
|
82
87
|
try {
|
|
@@ -89,6 +94,9 @@ function prepareDecisions(rawDecisions, diagnostics) {
|
|
|
89
94
|
}
|
|
90
95
|
decisions.push(decision);
|
|
91
96
|
counts.set(decision.decisionId, (counts.get(decision.decisionId) ?? 0) + 1);
|
|
97
|
+
for (const claim of decision.transitions) {
|
|
98
|
+
claimCounts.set(claim, (claimCounts.get(claim) ?? 0) + 1);
|
|
99
|
+
}
|
|
92
100
|
}
|
|
93
101
|
for (const [id, occurrences] of counts) {
|
|
94
102
|
if (occurrences > 1) {
|
|
@@ -96,8 +104,16 @@ function prepareDecisions(rawDecisions, diagnostics) {
|
|
|
96
104
|
remediation: "Use one exact decision record per decision ID." });
|
|
97
105
|
}
|
|
98
106
|
}
|
|
99
|
-
|
|
100
|
-
.
|
|
107
|
+
const overlapping = new Set(decisions
|
|
108
|
+
.filter((decision) => decision.transitions.some((claim) => (claimCounts.get(claim) ?? 0) > 1))
|
|
109
|
+
.map((decision) => decision.decisionId));
|
|
110
|
+
const prepared = decisions.map((decision) => ({
|
|
111
|
+
decision,
|
|
112
|
+
authorityEligible: counts.get(decision.decisionId) === 1 && !overlapping.has(decision.decisionId)
|
|
113
|
+
})).toSorted((left, right) => compareGrowthStrings(left.decision.decisionId, right.decision.decisionId));
|
|
114
|
+
return { budgetExceeded: false, decisions: prepared,
|
|
115
|
+
authorityCandidates: prepared.filter((entry) => entry.authorityEligible).map((entry) => entry.decision),
|
|
116
|
+
diagnostics };
|
|
101
117
|
}
|
|
102
118
|
/** Exact PR admission only. The independent released policy's failure is final;
|
|
103
119
|
* authority must bind the entire normalized decision, not merely its ID. */
|
|
@@ -116,24 +132,28 @@ export function evaluateGrowthAdmission(input, fingerprint) {
|
|
|
116
132
|
const transitions = validateTransitions(input.comparison.status === "complete" ? input.comparison.transitions : input.comparison.findings, fingerprint);
|
|
117
133
|
const actual = new Map(transitions.map((entry) => [entry.fingerprint, entry]));
|
|
118
134
|
const claimed = new Set(), admitted = new Set();
|
|
119
|
-
const
|
|
120
|
-
if (
|
|
135
|
+
const prepared = prepareGrowthDecisions(input.decisions);
|
|
136
|
+
if (prepared.budgetExceeded) {
|
|
121
137
|
return decisionBudgetExhausted();
|
|
122
138
|
}
|
|
123
|
-
|
|
124
|
-
|
|
139
|
+
diagnostics.push(...prepared.diagnostics);
|
|
140
|
+
const authorityRows = growthUniqueSorted(input.authority, (entry) => entry.decisionId);
|
|
141
|
+
const authorities = new Map(authorityRows.map((entry) => [entry.decisionId, entry]));
|
|
142
|
+
for (const { decision, authorityEligible } of prepared.decisions) {
|
|
125
143
|
const subject = decision.decisionId;
|
|
126
144
|
const exactDiagnostics = exactDecisionDiagnostics(decision, actual, claimed, fingerprint);
|
|
127
145
|
diagnostics.push(...exactDiagnostics);
|
|
128
|
-
let valid = exactDiagnostics.length === 0;
|
|
146
|
+
let valid = exactDiagnostics.length === 0 && authorityEligible;
|
|
129
147
|
for (const entry of decision.transitions) {
|
|
130
148
|
claimed.add(entry);
|
|
131
149
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
150
|
+
if (authorityEligible) {
|
|
151
|
+
const authority = authorities.get(subject);
|
|
152
|
+
if (authority?.ownerRef !== decision.ownerRef || authority.decisionDigest !== growthDecisionDigest(decision, fingerprint)) {
|
|
153
|
+
add("growth-owner-evidence-unavailable", subject, "Supply independently validated owner evidence binding this complete decision and its exact transitions.");
|
|
154
|
+
incomplete = true;
|
|
155
|
+
valid = false;
|
|
156
|
+
}
|
|
137
157
|
}
|
|
138
158
|
if (valid) {
|
|
139
159
|
for (const entry of decision.transitions) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate-growth-admission.js","sourceRoot":"","sources":["../../../../../src/capabilities/public-api-compatibility/application/policies/evaluate-growth-admission.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAEjF,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAClH,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtH,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,+EAA+E;AAC/E,SAAS,uBAAuB,CAAC,KAAc;IAC7C,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;QAAC,MAAM,IAAI,+BAA+B,CAAC,2BAA2B,CAAC,CAAC;IAAC,CAAC;IACzG,OAAO,EAAE,GAAG,KAAK;QACf,WAAW,EAAE,kBAAkB,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC;QACpE,WAAW,EAAE,kBAAkB,CAAC,KAAK,CAAC,WAAW,EAAE,mBAAmB,CAAC;QACvE,oBAAoB,EAAE,kBAAkB,CAAC,KAAK,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,EAAE,CAAC;AAChG,CAAC;AACD,MAAM,UAAU,oBAAoB,CAAC,
|
|
1
|
+
{"version":3,"file":"evaluate-growth-admission.js","sourceRoot":"","sources":["../../../../../src/capabilities/public-api-compatibility/application/policies/evaluate-growth-admission.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAEjF,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAClH,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtH,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,+EAA+E;AAC/E,SAAS,uBAAuB,CAAC,KAAc;IAC7C,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;QAAC,MAAM,IAAI,+BAA+B,CAAC,2BAA2B,CAAC,CAAC;IAAC,CAAC;IACzG,OAAO,EAAE,GAAG,KAAK;QACf,WAAW,EAAE,kBAAkB,CAAC,KAAK,C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;IACnF,CAAC;IACD,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YACzC,GAAG,CAAC,8BAA8B,EAAE,UAAU,CAAC,WAAW,EAAE,6FAA6F,CAAC,CAAC;QAC7J,CAAC;IACH,CAAC;IACD,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACnD,MAAM,CAAC,GAAG,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;QACpE,OAAO,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,eAAe,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACpD,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;AACzK,CAAC;AAED,SAAS,eAAe,CAAC,UAAmB,EAAE,WAAiD;IAC7F,IAAI,UAAU,EAAE,CAAC;QAAC,OAAO,YAAY,CAAC;IAAC,CAAC;IACxC,OAAO,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC;AAC5D,CAAC"}
|
|
@@ -9,12 +9,14 @@ export interface GrowthReleaseCompatibilityResult {
|
|
|
9
9
|
readonly reasons: readonly string[];
|
|
10
10
|
}
|
|
11
11
|
/** Existing v1 comparator and SemVer policy on each original snapshot branch.
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* An initial history value needs the trusted S3 adapter's receipt qualification.
|
|
13
|
+
* It proves absence of published compatibility obligations; it does
|
|
14
|
+
* not synthesize a v1 baseline or waive first-surface admission. */
|
|
14
15
|
export declare function evaluateGrowthReleaseCompatibility(input: {
|
|
15
16
|
readonly current: readonly GrowthCompatibilityPackage[];
|
|
16
17
|
readonly released: readonly GrowthReleasedPackage[];
|
|
17
18
|
readonly extractorVersion: string;
|
|
18
19
|
readonly acceptedDecisions: AcceptedDecisionEvidence;
|
|
20
|
+
readonly authorityReceiptDigest?: string;
|
|
19
21
|
}, fingerprint: ChangeFingerprint): GrowthReleaseCompatibilityResult;
|
|
20
22
|
//# sourceMappingURL=evaluate-growth-release-compatibility.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate-growth-release-compatibility.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/public-api-compatibility/application/policies/evaluate-growth-release-compatibility.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,OAAO,KAAK,EAAE,0BAA0B,EAAkB,MAAM,gCAAgC,CAAC;AAEjG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"evaluate-growth-release-compatibility.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/public-api-compatibility/application/policies/evaluate-growth-release-compatibility.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,OAAO,KAAK,EAAE,0BAA0B,EAAkB,MAAM,gCAAgC,CAAC;AAEjG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAOxE,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,GAAG,YAAY,CAAC;IACxD,QAAQ,CAAC,WAAW,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACtD,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AA0ED;;;oEAGoE;AACpE,wBAAgB,kCAAkC,CAAC,KAAK,EAAE;IACxD,QAAQ,CAAC,OAAO,EAAE,SAAS,0BAA0B,EAAE,CAAC;IACxD,QAAQ,CAAC,QAAQ,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACpD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,iBAAiB,EAAE,wBAAwB,CAAC;IACrD,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CAC1C,EAAE,WAAW,EAAE,iBAAiB,GAAG,gCAAgC,CAyCnE"}
|
|
@@ -2,15 +2,39 @@ import { GrowthObservationInvariantError } from "../model/growth-observation.js"
|
|
|
2
2
|
import { growthUniqueSorted } from "./normalize-growth-observation.js";
|
|
3
3
|
import { classifyPublicApiChange, evaluatePublicApiCompatibility } from "./evaluate-public-api-compatibility.js";
|
|
4
4
|
import { isApprovedBreakingChangeAccepted } from "./accepted-breaking-change.js";
|
|
5
|
-
|
|
5
|
+
import { collectUnchangedPublicTypeBindings } from "./default-type-argument-equivalence.js";
|
|
6
|
+
import { evaluateInitialReleasePolicy } from "./evaluate-initial-release.js";
|
|
7
|
+
function compareBranch(row, released, current, dependencies) {
|
|
6
8
|
if (row.releaseEvidence.status !== "available") {
|
|
7
9
|
throw new GrowthObservationInvariantError("growth-release-evidence-unavailable");
|
|
8
10
|
}
|
|
9
|
-
const change = classifyPublicApiChange(released, current, fingerprint);
|
|
11
|
+
const change = classifyPublicApiChange(released, current, dependencies.fingerprint, dependencies.stableTypeBindings);
|
|
10
12
|
const approval = row.policy.approvedBreakingChanges.find((entry) => entry.fingerprint === change.fingerprint);
|
|
11
13
|
return evaluatePublicApiCompatibility({ policy: row.policy, released, current, change,
|
|
12
14
|
releaseEvidence: row.releaseEvidence.value,
|
|
13
|
-
acceptedDecision: approval === undefined ? undefined : isApprovedBreakingChangeAccepted(approval, accepted) });
|
|
15
|
+
acceptedDecision: approval === undefined ? undefined : isApprovedBreakingChangeAccepted(approval, dependencies.accepted) });
|
|
16
|
+
}
|
|
17
|
+
function collectGrowthStableTypeBindings(current, released) {
|
|
18
|
+
const currentByPackage = new Map(current.map((entry) => [entry.packageName, entry]));
|
|
19
|
+
if (current.length !== released.length
|
|
20
|
+
|| released.some((row) => !currentByPackage.has(row.packageName))) {
|
|
21
|
+
return new Set();
|
|
22
|
+
}
|
|
23
|
+
const pairs = [];
|
|
24
|
+
for (const row of released) {
|
|
25
|
+
if (row.evidence.kind === "initial-unreleased") {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
const candidate = currentByPackage.get(row.packageName);
|
|
29
|
+
if (candidate === undefined
|
|
30
|
+
|| row.evidence.typed.status !== "available"
|
|
31
|
+
|| candidate.typed.snapshot.status !== "available"
|
|
32
|
+
|| row.evidence.typed.value.extractorVersion !== candidate.typed.snapshot.value.extractorVersion) {
|
|
33
|
+
return new Set();
|
|
34
|
+
}
|
|
35
|
+
pairs.push({ released: row.evidence.typed.value, current: candidate.typed.snapshot.value });
|
|
36
|
+
}
|
|
37
|
+
return collectUnchangedPublicTypeBindings(pairs);
|
|
14
38
|
}
|
|
15
39
|
function assertBranch(snapshot, packageName, extractor) {
|
|
16
40
|
if (snapshot.status === "available" && (snapshot.value.packageName !== packageName
|
|
@@ -18,13 +42,51 @@ function assertBranch(snapshot, packageName, extractor) {
|
|
|
18
42
|
throw new GrowthObservationInvariantError("growth-compatibility-provenance-mismatch");
|
|
19
43
|
}
|
|
20
44
|
}
|
|
45
|
+
function evaluateInitialUnreleased(input) {
|
|
46
|
+
if (input.row.evidence.kind !== "initial-unreleased") {
|
|
47
|
+
throw new GrowthObservationInvariantError("growth-release-kind-mismatch");
|
|
48
|
+
}
|
|
49
|
+
if (input.row.evidence.history.status !== "available" || !qualified(input.row, input.authorityReceiptDigest)) {
|
|
50
|
+
input.reasons.push(`${input.row.packageName}:initial-unreleased-proof-not-qualified`);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (input.row.releaseEvidence.status !== "available") {
|
|
54
|
+
input.reasons.push(`${input.row.packageName}:release-evidence-unavailable`);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const policy = evaluateInitialReleasePolicy(input.row.packageName, input.row.releaseEvidence.value);
|
|
58
|
+
if (policy.status === "rejected") {
|
|
59
|
+
input.reasons.push(`${input.row.packageName}:initial-release-${policy.failure}`);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
for (const branch of ["typed", "artifact"]) {
|
|
63
|
+
const next = input.candidate[branch].snapshot;
|
|
64
|
+
const extractor = branch === "typed" ? input.extractorVersion : "package-artifact-inventory/1";
|
|
65
|
+
assertBranch(next, input.row.packageName, extractor);
|
|
66
|
+
if (next.status !== "available") {
|
|
67
|
+
input.reasons.push(`${input.row.packageName}:${branch}:compatibility-evidence-unavailable`);
|
|
68
|
+
}
|
|
69
|
+
else if (next.value.packageVersion !== input.row.releaseEvidence.value.packageVersion) {
|
|
70
|
+
throw new GrowthObservationInvariantError("growth-release-version-mismatch");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function qualified(row, authorityReceiptDigest) {
|
|
75
|
+
return /^sha256:[a-f0-9]{64}$/u.test(authorityReceiptDigest ?? "")
|
|
76
|
+
&& /^sha256:[a-f0-9]{64}$/u.test(row.qualification?.receiptDigest ?? "")
|
|
77
|
+
&& row.qualification?.receiptDigest === authorityReceiptDigest;
|
|
78
|
+
}
|
|
21
79
|
/** Existing v1 comparator and SemVer policy on each original snapshot branch.
|
|
22
|
-
*
|
|
23
|
-
*
|
|
80
|
+
* An initial history value needs the trusted S3 adapter's receipt qualification.
|
|
81
|
+
* It proves absence of published compatibility obligations; it does
|
|
82
|
+
* not synthesize a v1 baseline or waive first-surface admission. */
|
|
24
83
|
export function evaluateGrowthReleaseCompatibility(input, fingerprint) {
|
|
25
84
|
const current = growthUniqueSorted(input.current, (entry) => entry.packageName);
|
|
26
85
|
const released = growthUniqueSorted(input.released, (entry) => entry.packageName);
|
|
27
86
|
const diagnostics = [], reasons = [];
|
|
87
|
+
const currentByPackage = new Map(current.map((entry) => [entry.packageName, entry]));
|
|
88
|
+
const releasedPackages = new Set(released.map((entry) => entry.packageName));
|
|
89
|
+
const stableTypeBindings = collectGrowthStableTypeBindings(current, released);
|
|
28
90
|
if (current.length === 0) {
|
|
29
91
|
reasons.push("growth-compatibility-topology-unavailable");
|
|
30
92
|
}
|
|
@@ -32,15 +94,20 @@ export function evaluateGrowthReleaseCompatibility(input, fingerprint) {
|
|
|
32
94
|
if (row.policy.packageName !== row.packageName) {
|
|
33
95
|
throw new GrowthObservationInvariantError("growth-release-policy-package-mismatch");
|
|
34
96
|
}
|
|
35
|
-
const candidate =
|
|
97
|
+
const candidate = currentByPackage.get(row.packageName);
|
|
36
98
|
if (candidate === undefined) {
|
|
37
99
|
reasons.push(`${row.packageName}:removed-package-compatibility-unavailable`);
|
|
38
100
|
continue;
|
|
39
101
|
}
|
|
40
102
|
if (row.evidence.kind === "initial-unreleased") {
|
|
41
|
-
|
|
103
|
+
evaluateInitialUnreleased({ row, candidate, extractorVersion: input.extractorVersion,
|
|
104
|
+
authorityReceiptDigest: input.authorityReceiptDigest, reasons });
|
|
42
105
|
continue;
|
|
43
106
|
}
|
|
107
|
+
if (!qualified(row, input.authorityReceiptDigest)) {
|
|
108
|
+
// Qualification controls admission, not observation of available breakage.
|
|
109
|
+
reasons.push(`${row.packageName}:released-proof-not-qualified`);
|
|
110
|
+
}
|
|
44
111
|
if (row.releaseEvidence.status !== "available") {
|
|
45
112
|
reasons.push(`${row.packageName}:release-evidence-unavailable`);
|
|
46
113
|
continue;
|
|
@@ -60,11 +127,11 @@ export function evaluateGrowthReleaseCompatibility(input, fingerprint) {
|
|
|
60
127
|
if (next.value.packageVersion !== row.releaseEvidence.value.packageVersion) {
|
|
61
128
|
throw new GrowthObservationInvariantError("growth-release-version-mismatch");
|
|
62
129
|
}
|
|
63
|
-
diagnostics.push(...compareBranch(row, previous.value, next.value, input.acceptedDecisions, fingerprint));
|
|
130
|
+
diagnostics.push(...compareBranch(row, previous.value, next.value, { accepted: input.acceptedDecisions, fingerprint, stableTypeBindings }));
|
|
64
131
|
}
|
|
65
132
|
}
|
|
66
133
|
for (const row of current) {
|
|
67
|
-
if (!
|
|
134
|
+
if (!releasedPackages.has(row.packageName)) {
|
|
68
135
|
reasons.push(`${row.packageName}:released-history-unavailable`);
|
|
69
136
|
}
|
|
70
137
|
}
|