@kungfu-tech/buildchain 2.5.5-alpha.4 → 2.5.5-alpha.5
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/docs/cli.md +8 -4
- package/docs/release-passport.md +9 -5
- package/docs/versioning.md +5 -0
- package/package.json +1 -1
- package/packages/core/release-passport.js +44 -0
package/docs/cli.md
CHANGED
|
@@ -276,10 +276,14 @@ platform packages with version, dist-tag, and digest evidence. Verification
|
|
|
276
276
|
fails closed if supplied sections are internally incomplete or point to
|
|
277
277
|
artifacts without matching evidence.
|
|
278
278
|
|
|
279
|
-
`--impact-json` supplies the surface-aware impact ledger.
|
|
280
|
-
`
|
|
281
|
-
|
|
282
|
-
`surfaceImpacts`
|
|
279
|
+
`--impact-json` supplies the surface-aware impact ledger. Production release
|
|
280
|
+
passports (`release/*`) and major publish-gate passports require
|
|
281
|
+
`surfaceImpacts[]`; alpha, local, and legacy passport contexts keep it
|
|
282
|
+
optional. When `surfaceImpacts[]` is required or supplied, the verifier requires
|
|
283
|
+
each entry to include an id, impact, and rationale, and requires
|
|
284
|
+
`versionImpact.final` to match the highest declared surface impact. The
|
|
285
|
+
collector copies `versionImpact` plus `surfaceImpacts` into
|
|
286
|
+
`buildchain.release.json`. This lets
|
|
283
287
|
`buildchain explain release --for agent --json` state why a release is patch,
|
|
284
288
|
minor, or major instead of relying on file-path memory.
|
|
285
289
|
|
package/docs/release-passport.md
CHANGED
|
@@ -106,11 +106,15 @@ dist-tag, registry, role, platform, and digest, so agents do not need to stitch
|
|
|
106
106
|
npm facts back together from the lower-level evidence files.
|
|
107
107
|
`buildSummary`, `platformArtifactManifests`, and `distTagPromotion` preserve the
|
|
108
108
|
build and npm dist-tag evidence chain in the same passport.
|
|
109
|
-
`impact.json` can be supplied with `--impact-json
|
|
110
|
-
`
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
`impact.json` can be supplied with `--impact-json`. Production release
|
|
110
|
+
passports (`release/*`) and major publish-gate passports require
|
|
111
|
+
`surfaceImpacts[]`; alpha, local, and legacy passport contexts keep the field
|
|
112
|
+
optional. When `surfaceImpacts[]` is required or supplied, verification fails
|
|
113
|
+
closed unless each entry has an id, impact, and rationale, and
|
|
114
|
+
`versionImpact.final` matches the highest surface impact. For example, KFD-2
|
|
115
|
+
content can remain patch while an additive `registry.kind` field on the
|
|
116
|
+
machine-consumed KFD registry schema records a minor `kfd-registry-schema`
|
|
117
|
+
surface impact.
|
|
114
118
|
|
|
115
119
|
Verify a release passport:
|
|
116
120
|
|
package/docs/versioning.md
CHANGED
|
@@ -46,6 +46,11 @@ The release passport records this as `surfaceImpacts[]` plus
|
|
|
46
46
|
so an agent cannot silently label a release patch when one machine surface needs
|
|
47
47
|
minor review.
|
|
48
48
|
|
|
49
|
+
`surfaceImpacts[]` is mandatory for production release passports (`release/*`)
|
|
50
|
+
and major publish-gate passports. Alpha, local, and legacy passport contexts
|
|
51
|
+
keep the field optional so temporary validation can proceed without pretending
|
|
52
|
+
to be a production release decision.
|
|
53
|
+
|
|
49
54
|
Example: a KFD document such as KFD-2 is content and remains patch, but adding a
|
|
50
55
|
`kind` field to the machine-consumed KFD `registry.json` is an additive change
|
|
51
56
|
to the `kfd-registry-schema` surface and therefore requires minor-impact
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kungfu-tech/buildchain",
|
|
3
|
-
"version": "2.5.5-alpha.
|
|
3
|
+
"version": "2.5.5-alpha.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Buildchain Release Passport, release governance, CLI toolkit, and site facts.",
|
|
6
6
|
"repository": "https://github.com/kungfu-systems/buildchain",
|
|
@@ -59,6 +59,43 @@ function highestImpactLevel(levels = []) {
|
|
|
59
59
|
return highest;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
function surfaceImpactRequirement({ passport = {}, impact = {} } = {}) {
|
|
63
|
+
const release = passport?.release && typeof passport.release === "object" ? passport.release : {};
|
|
64
|
+
const impactRelease = impact?.release && typeof impact.release === "object" ? impact.release : {};
|
|
65
|
+
const channel = optionalString(release.channel || impactRelease.channel).toLowerCase();
|
|
66
|
+
const targetRef = optionalString(
|
|
67
|
+
release.targetRef ||
|
|
68
|
+
release.target_ref ||
|
|
69
|
+
impactRelease.targetRef ||
|
|
70
|
+
impactRelease.target_ref,
|
|
71
|
+
).toLowerCase();
|
|
72
|
+
if (channel === "release" || targetRef.startsWith("release/")) {
|
|
73
|
+
return {
|
|
74
|
+
required: true,
|
|
75
|
+
type: "production-release",
|
|
76
|
+
reason: "production release passports require surfaceImpacts[] so agents can audit the final version impact",
|
|
77
|
+
channel,
|
|
78
|
+
targetRef,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
if (channel === "major" || targetRef === "publish-gate/major" || targetRef === "major-gate") {
|
|
82
|
+
return {
|
|
83
|
+
required: true,
|
|
84
|
+
type: "major-gate",
|
|
85
|
+
reason: "major publish gates require surfaceImpacts[] so breaking-surface rationale is explicit",
|
|
86
|
+
channel,
|
|
87
|
+
targetRef,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
required: false,
|
|
92
|
+
type: channel || (targetRef ? "non-production-release" : "legacy"),
|
|
93
|
+
reason: "surfaceImpacts[] is optional for alpha, local, and legacy passport contexts",
|
|
94
|
+
channel,
|
|
95
|
+
targetRef,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
62
99
|
function stableJson(value) {
|
|
63
100
|
if (Array.isArray(value)) {
|
|
64
101
|
return `[${value.map(stableJson).join(",")}]`;
|
|
@@ -1132,6 +1169,10 @@ export function createReleaseCheckReport({
|
|
|
1132
1169
|
const passportSurfaceImpacts = Array.isArray(passport?.surfaceImpacts) ? passport.surfaceImpacts : [];
|
|
1133
1170
|
const declaredFinalImpact = normalizeImpactLevel(impact?.versionImpact?.final || impact?.classification);
|
|
1134
1171
|
const computedFinalImpact = highestImpactLevel(surfaceImpacts.map((entry) => entry.impact));
|
|
1172
|
+
const requiredSurfaceImpacts = surfaceImpactRequirement({ passport, impact });
|
|
1173
|
+
if (requiredSurfaceImpacts.required && surfaceImpacts.length === 0) {
|
|
1174
|
+
issues.push(issue("error", "impact.surfaceImpacts.required", "surfaceImpacts[] is required for this release passport type", requiredSurfaceImpacts));
|
|
1175
|
+
}
|
|
1135
1176
|
if (surfaceImpacts.length > 0) {
|
|
1136
1177
|
for (const [index, entry] of surfaceImpacts.entries()) {
|
|
1137
1178
|
if (!entry.id) {
|
|
@@ -1167,6 +1208,7 @@ export function createReleaseCheckReport({
|
|
|
1167
1208
|
checkedAt,
|
|
1168
1209
|
ok,
|
|
1169
1210
|
trust: ok ? "pass" : "fail",
|
|
1211
|
+
surfaceImpactRequirement: requiredSurfaceImpacts,
|
|
1170
1212
|
completeness: {
|
|
1171
1213
|
artifactCount: artifacts.length,
|
|
1172
1214
|
evidenceArtifactCount: evidenceArtifacts.length,
|
|
@@ -1182,6 +1224,7 @@ export function createReleaseCheckReport({
|
|
|
1182
1224
|
impactPresent: Boolean(impact),
|
|
1183
1225
|
agentIndexPresent: Boolean(agentIndex),
|
|
1184
1226
|
productMechanismPresent: Boolean(productMechanism),
|
|
1227
|
+
surfaceImpactsRequired: requiredSurfaceImpacts.required,
|
|
1185
1228
|
surfaceImpactCount: surfaceImpacts.length,
|
|
1186
1229
|
versionImpact: impact?.versionImpact?.final || "",
|
|
1187
1230
|
},
|
|
@@ -1278,6 +1321,7 @@ export async function explainReleasePassport({ passportLocation, forAudience = "
|
|
|
1278
1321
|
impact: {
|
|
1279
1322
|
versionImpact: passport.versionImpact || {},
|
|
1280
1323
|
surfaceImpacts: Array.isArray(passport.surfaceImpacts) ? passport.surfaceImpacts : [],
|
|
1324
|
+
surfaceImpactRequirement: report.surfaceImpactRequirement,
|
|
1281
1325
|
breaking: Boolean(passport.versionImpact?.final === "major"),
|
|
1282
1326
|
migrationRequired: Boolean(passport.versionImpact?.final === "major"),
|
|
1283
1327
|
summary: passport.versionImpact?.rationale || "",
|