Skip to content

Commit 0c3dc85

Browse files
authored
fix(packaging): verify bundled resources from manifest (#3587)
* fix(packaging): verify bundled resources from contract Consume AionCore managed-resources/manifest.json in packaging and Windows install verification. Reject missing, invalid, duplicate, or old-version-only managed Node and ACP resources, and update the legacy ACP artifact script to current package pins. * test(build): strengthen managed resource verifier gates Reject non-numeric managed resources schemaVersion values in the Windows installer verifier and add focused prepare-aioncore gate coverage for Actions artifacts, GitHub release downloads, and local binary fallback inputs. * test(packaging): skip POSIX fake aioncore gates on Windows * chore(packaging): bump bundled AionCore to v0.1.47 --------- Co-authored-by: zynx <>
1 parent 6d911bc commit 0c3dc85

10 files changed

Lines changed: 1092 additions & 368 deletions

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@
257257
"engines": {
258258
"node": ">=22 <25"
259259
},
260-
"aioncoreVersion": "v0.1.46",
260+
"aioncoreVersion": "v0.1.47",
261261
"electronRebuild": {
262262
"electronVersion": "^37.3.1"
263263
},

packages/shared-scripts/src/prepare-aioncore.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const { execSync, execFileSync } = require('child_process');
1919
const fs = require('fs');
2020
const os = require('os');
2121
const path = require('path');
22+
const { verifyBundledAioncoreResources } = require('./verify-bundled-aioncore-resources');
2223

2324
const GITHUB_OWNER = 'iOfficeAI';
2425
const GITHUB_REPO = 'AionCore';
@@ -135,6 +136,19 @@ function prepareManagedResources(binaryPath, targetDir) {
135136
return bundleOut;
136137
}
137138

139+
function verifyPreparedAioncoreBundle(projectRoot, platform, arch) {
140+
const result = verifyBundledAioncoreResources({
141+
resourcesDir: path.join(projectRoot, 'resources'),
142+
electronPlatformName: platform,
143+
targetArch: arch,
144+
});
145+
if (result.missing.length > 0 || result.failures.length > 0) {
146+
const summary = result.missing.length > 0 ? result.missing.join(', ') : JSON.stringify(result.failures);
147+
throw new Error(`Prepared aioncore bundle is missing required bundled resource(s): ${summary}`);
148+
}
149+
return result;
150+
}
151+
138152
// ---------------------------------------------------------------------------
139153
// Source resolvers
140154
// ---------------------------------------------------------------------------
@@ -480,6 +494,7 @@ function prepareAioncore(options) {
480494
files: [binaryName, 'managed-resources/'],
481495
};
482496
writeJson(path.join(targetDir, 'manifest.json'), manifest);
497+
verifyPreparedAioncoreBundle(projectRoot, platform, arch);
483498
console.log(` Using local aioncore bundle: ${resolvedLocalBundleDir}`);
484499
return { prepared: true, dir: targetDir, sourceType: 'local-bundle' };
485500
}
@@ -555,6 +570,7 @@ function prepareAioncore(options) {
555570
};
556571

557572
writeJson(path.join(targetDir, 'manifest.json'), manifest);
573+
verifyPreparedAioncoreBundle(projectRoot, platform, arch);
558574
console.log(
559575
` Bundled aioncore prepared: resources/bundled-aioncore/${runtimeKey}/${binaryName} [source=${sourceType}]`
560576
);
@@ -571,4 +587,5 @@ module.exports = {
571587
getActionsArtifactMissingMessage,
572588
getActionsArtifactName,
573589
prepareAioncore,
590+
verifyPreparedAioncoreBundle,
574591
};

0 commit comments

Comments
 (0)