fix(report): flag unsupported openclaw bundle metadata
Some checks are pending
Check / Node 22 (push) Waiting to run
Some checks are pending
Check / Node 22 (push) Waiting to run
This commit is contained in:
parent
4bc5fbcfa3
commit
2eda65a8a9
@ -154,6 +154,7 @@ export function summarizePackage(packagePath, packageJson, options = {}) {
|
||||
: null,
|
||||
install: summarizeOpenClawInstall(packageJson.openclaw.install),
|
||||
release: summarizeOpenClawRelease(packageJson.openclaw.release),
|
||||
unsupportedMetadata: unsupportedOpenClawPackageMetadata(packageJson.openclaw),
|
||||
}
|
||||
: null;
|
||||
|
||||
@ -249,6 +250,23 @@ export function classifyPackageContracts({ fixture, inspection, fixtureReport })
|
||||
});
|
||||
}
|
||||
|
||||
if ((packageSummary.openclaw?.unsupportedMetadata ?? []).length > 0) {
|
||||
warnings.push({
|
||||
fixture: fixture.id,
|
||||
code: "package-openclaw-unsupported-metadata",
|
||||
level: "warning",
|
||||
message: "package declares unsupported OpenClaw metadata",
|
||||
evidence: packageSummary.openclaw.unsupportedMetadata,
|
||||
});
|
||||
decisions.push({
|
||||
fixture: fixture.id,
|
||||
decision: "plugin-upstream-fix",
|
||||
seam: "package-metadata",
|
||||
action: "Remove unsupported OpenClaw metadata; native plugins use openclaw.plugin.json plus supported package openclaw fields.",
|
||||
evidence: packageSummary.openclaw.unsupportedMetadata.join(", "),
|
||||
});
|
||||
}
|
||||
|
||||
const installMetadataIssues = packageInstallMetadataIssues(packageSummary);
|
||||
if (installMetadataIssues.length > 0) {
|
||||
warnings.push({
|
||||
@ -952,6 +970,15 @@ function summarizeOpenClawRelease(release) {
|
||||
};
|
||||
}
|
||||
|
||||
function unsupportedOpenClawPackageMetadata(openclaw) {
|
||||
if (!openclaw || typeof openclaw !== "object") {
|
||||
return [];
|
||||
}
|
||||
return Object.keys(openclaw)
|
||||
.filter((key) => key === "bundle")
|
||||
.map((key) => `openclaw.${key}`);
|
||||
}
|
||||
|
||||
function summarizeNpmPack(packageJson, openclaw) {
|
||||
const files = arrayValues(packageJson.files).map(normalizePackagePath).filter((item) => item.length > 0);
|
||||
return {
|
||||
|
||||
@ -32,6 +32,7 @@ export const knownIssueCodes = new Set([
|
||||
"package-npm-pack-unavailable",
|
||||
"package-openclaw-entry-missing",
|
||||
"package-openclaw-metadata-missing",
|
||||
"package-openclaw-unsupported-metadata",
|
||||
"package-plugin-api-compat-missing",
|
||||
"package-typescript-source-entrypoint",
|
||||
"provider-auth-env-vars",
|
||||
@ -194,6 +195,12 @@ export const issueMetadataByCode = {
|
||||
decision: "plugin-upstream-fix",
|
||||
title: "OpenClaw package metadata is missing",
|
||||
},
|
||||
"package-openclaw-unsupported-metadata": {
|
||||
severity: "P2",
|
||||
owner: "plugin",
|
||||
decision: "plugin-upstream-fix",
|
||||
title: "package declares unsupported OpenClaw metadata",
|
||||
},
|
||||
"package-plugin-api-compat-missing": {
|
||||
severity: "P2",
|
||||
owner: "plugin",
|
||||
@ -370,6 +377,7 @@ function issueClassFor(code, options) {
|
||||
"package-npm-pack-unavailable",
|
||||
"package-openclaw-entry-missing",
|
||||
"package-openclaw-metadata-missing",
|
||||
"package-openclaw-unsupported-metadata",
|
||||
"package-plugin-api-compat-missing",
|
||||
"package-install-metadata-incomplete",
|
||||
"reserved-sdk-import",
|
||||
|
||||
@ -544,6 +544,9 @@ test("compatibility fixture summary reads manifests and OpenClaw package metadat
|
||||
publishToClawHub: true,
|
||||
publishToNpm: true,
|
||||
},
|
||||
bundle: {
|
||||
includeInCore: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
null,
|
||||
@ -604,6 +607,7 @@ test("compatibility fixture summary reads manifests and OpenClaw package metadat
|
||||
publishToClawHub: true,
|
||||
publishToNpm: true,
|
||||
});
|
||||
assert.deepEqual(report.package.openclaw.unsupportedMetadata, ["openclaw.bundle"]);
|
||||
assert.deepEqual(report.package.openclaw.entrypoints[0], {
|
||||
kind: "extension",
|
||||
specifier: "src/index.js",
|
||||
@ -739,6 +743,7 @@ test("package contract classifier reports broken install and release metadata",
|
||||
publishToClawHub: true,
|
||||
publishToNpm: true,
|
||||
},
|
||||
unsupportedMetadata: ["openclaw.bundle"],
|
||||
entrypoints: [
|
||||
{
|
||||
kind: "extension",
|
||||
@ -755,6 +760,7 @@ test("package contract classifier reports broken install and release metadata",
|
||||
|
||||
assert.ok(result.warnings.some((finding) => finding.code === "package-install-metadata-incomplete"));
|
||||
assert.ok(result.warnings.some((finding) => finding.code === "package-min-host-version-drift"));
|
||||
assert.ok(result.warnings.some((finding) => finding.code === "package-openclaw-unsupported-metadata"));
|
||||
assert.ok(result.decisions.some((decision) => decision.seam === "package-metadata"));
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user