release-macos-layout.test.mjs
48 lines 2.2 KB
Raw
sha256:bd1eb24434d281fe65142038c1bf217493421f5a86880c22dff7e6037d2d4700 feat(companion): add production macOS distribution path Human minor ⚠ breaking 25 days ago
1 import assert from 'node:assert/strict';
2 import fs from 'node:fs';
3 import test from 'node:test';
4
5 const release = JSON.parse(fs.readFileSync('release/macos/release.json', 'utf8'));
6 const appPlist = fs.readFileSync('release/macos/plists/App-Info.plist', 'utf8');
7 const agentPlist = fs.readFileSync('release/macos/plists/LaunchAgent.plist', 'utf8');
8 const distribution = fs.readFileSync('release/macos/Distribution.xml', 'utf8');
9 const preinstall = fs.readFileSync('release/macos/pkg-scripts/preinstall', 'utf8');
10
11 test('release identity, platform, and installer metadata agree', () => {
12 assert.equal(release.version, '0.1.0');
13 assert.equal(release.build, 100);
14 assert.deepEqual(release.architectures, ['arm64']);
15 assert.equal(release.minimumMacOS, '14.0');
16 assert.equal(release.hosted.origin, 'https://mcp.knowtation.store');
17 assert.equal(release.hosted.nativeOAuthIssuer, `${release.hosted.origin}/api/v1/auth/native`);
18 assert.deepEqual(release.hosted.scopes, ['vault:read', 'vault:write']);
19 assert.deepEqual(
20 release.optionalExternalTools.map((entry) => entry.command),
21 ['git', 'muse'],
22 );
23 assert.ok(release.optionalExternalTools.every((entry) => entry.bundled === false));
24 assert.match(appPlist, /store\.knowtation\.companion/);
25 assert.match(appPlist, /<string>0\.1\.0<\/string>/);
26 assert.match(appPlist, /<string>100<\/string>/);
27 assert.match(agentPlist, /store\.knowtation\.companion\.custody/);
28 assert.match(agentPlist, /<key>MachServices<\/key>/);
29 assert.match(agentPlist, /<key>BundleProgram<\/key>/);
30 assert.match(distribution, /min="14\.0"/);
31 assert.match(distribution, /store\.knowtation\.pkg/);
32 assert.match(distribution, /require-scripts="true"/);
33 assert.match(preinstall, /installed_build > 100/);
34 assert.match(preinstall, /rollback is rejected/);
35 });
36
37 test('release entitlements do not disable library validation or permit debugging', () => {
38 for (const file of [
39 'release/macos/entitlements/app.plist',
40 'release/macos/entitlements/custody.plist',
41 'release/macos/entitlements/launcher.plist',
42 'release/macos/entitlements/runtime.plist',
43 ]) {
44 const text = fs.readFileSync(file, 'utf8');
45 assert.doesNotMatch(text, /get-task-allow/);
46 assert.doesNotMatch(text, /disable-library-validation/);
47 }
48 });
File History 1 commit
sha256:bd1eb24434d281fe65142038c1bf217493421f5a86880c22dff7e6037d2d4700 feat(companion): add production macOS distribution path Human minor ⚠ 25 days ago