@@ -6,7 +6,15 @@ app="${1:?usage: verify-macos-runtime.sh /path/to/OpenCodex.app}"
66executable=" $( /usr/libexec/PlistBuddy -c ' Print :CFBundleExecutable' " $app /Contents/Info.plist" ) "
77[[ -n " $executable " && " $executable " != * /* ]] || { echo ' Invalid app executable name' >&2 ; exit 1; }
88scratch=" $( mktemp -d " ${TMPDIR:-/ tmp} /opencodex-bundle-check.XXXXXX" ) "
9- trap ' rm -rf "$scratch"' EXIT
9+ proxy_pid=" "
10+ cleanup () {
11+ if [[ -n " $proxy_pid " ]]; then
12+ kill " $proxy_pid " 2> /dev/null || true
13+ wait " $proxy_pid " 2> /dev/null || true
14+ fi
15+ rm -rf " $scratch "
16+ }
17+ trap cleanup EXIT
1018
1119codesign --verify --strict --deep " $app "
1220verify_member () {
@@ -39,4 +47,32 @@ value = json.loads(pathlib.Path(sys.argv[1]).read_text())
3947assert value.get("schema") == "ocx-resolve/1", "Unexpected resolve schema"
4048assert value.get("liveness", {}).get("status") in ("live", "absent-proven"), "Unusable resolve result"
4149PY
42- printf ' %s\n' ' PASS: macOS signatures, exact entitlements, hardened runtime, Liquid Glass and bundled CLI resolve'
50+
51+ # Reproduce the packaged-keyring boundary from an unrelated cwd. Source-tree smoke tests prove the
52+ # OS store, but they do not prove that Bun can find the N-API addon outside its virtual `$bunfs`.
53+ mkdir -p " $scratch /home" " $scratch /work"
54+ (
55+ cd " $scratch /work"
56+ HOME=" $scratch /home" OPENCODEX_HOME=" $scratch /home/.opencodex" \
57+ " $app /Contents/MacOS/ocx" start --port 10179 > " $scratch /proxy.log" 2>&1
58+ ) &
59+ proxy_pid=$!
60+ for _ in $( seq 1 30) ; do
61+ curl -fsS http://127.0.0.1:10179/healthz > /dev/null 2>&1 && break
62+ sleep 1
63+ done
64+ curl -fsS http://127.0.0.1:10179/healthz > /dev/null
65+ (
66+ cd " $scratch /work"
67+ HOME=" $scratch /home" OPENCODEX_HOME=" $scratch /home/.opencodex" \
68+ " $app /Contents/MacOS/ocx" provider keychain openai status --json > " $scratch /keyring.json"
69+ )
70+ python3 - " $scratch /keyring.json" << 'PY '
71+ import json, pathlib, sys
72+ value = json.loads(pathlib.Path(sys.argv[1]).read_text())
73+ assert value.get("keychainAvailable") is True, "Packaged keyring binding is unavailable"
74+ PY
75+ kill " $proxy_pid " 2> /dev/null || true
76+ wait " $proxy_pid " 2> /dev/null || true
77+ proxy_pid=" "
78+ printf ' %s\n' ' PASS: macOS signatures, entitlements, hardened runtime, Liquid Glass, bundled CLI resolve and packaged keyring'
0 commit comments