fix: verify packaged PI ownership boundaries

This commit is contained in:
2026-08-24 13:58:08 +08:00
parent 13efe84d42
commit 0d03d00ebf
4 changed files with 68 additions and 11 deletions

View File

@@ -7,6 +7,7 @@ import { afterEach, describe, expect, it } from 'vitest';
import {
assertNodeEngineCompatible,
classifyOpenCodeResourcePaths,
collectAbsoluteManifestValues,
collectForbiddenResourcePaths,
defaultProductExecutable,
@@ -81,6 +82,15 @@ describe('final Pi product artifact verification', () => {
expect(await collectForbiddenResourcePaths(root)).toEqual([
'pi-runtime/node_modules/opencode-ai',
]);
expect(classifyOpenCodeResourcePaths([
'app.asar.unpacked/resources/opencode-runtime',
'pi-runtime/node_modules/@earendil-works/pi-ai/dist/providers/opencode.js',
])).toEqual({
productOwned: ['app.asar.unpacked/resources/opencode-runtime'],
upstreamPiProvider: [
'pi-runtime/node_modules/@earendil-works/pi-ai/dist/providers/opencode.js',
],
});
});
it('uses final unpacked-product paths and strictly parses verifier options', () => {