The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(release): ship macOS module digests instead of archives; share bundled-module signing
M3gA-Mind632d57c57615
diff --git a/scripts/__tests__/stage-modules.test.mjs b/scripts/__tests__/stage-modules.test.mjsindex 8abf206fad..9916f95ade 100644--- a/scripts/__tests__/stage-modules.test.mjs+++ b/scripts/__tests__/stage-modules.test.mjs@@ -14,6 +14,7 @@ import {download,hostKeyForTarget,extractWindowsZip,+ keepsArchive,} from "../release/stage-modules.mjs";const HOST_KEYS = [@@ -106,6 +107,12 @@ test("host keys follow the Rust target triple, not the runner", () => {assert.throws(() => hostKeyForTarget("wasm32-unknown-unknown"), /no bundled modules/);});+test("only macOS bundles replace the archive with its digest marker", () => {+ for (const hostKey of HOST_KEYS) {+ assert.equal(keepsArchive(hostKey), !hostKey.startsWith("macos-"), hostKey);+ }+});+async function withServer(handler, run) {const server = createServer(handler);await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));diff --git a/scripts/build-macos-signed.sh b/scripts/build-macos-signed.shindex 27bb068af1..4db134b50f 100755--- a/scripts/build-macos-signed.sh+++ b/scripts/build-macos-signed.sh@@ -127,6 +127,10 @@ unset APPLE_ID APPLE_PASSWORD APPLE_TEAM_IDenv | grep -E 'APPLE|TAURI|VITE' || true+# Same pinned modules as CI's "Bundle pinned native modules" step; on macOS+# each archive is replaced by its digest marker (see stage-modules.mjs).+node scripts/release/stage-modules.mjs+cd appecho "Building now... ${BUILD_ARGS[@]}"pnpm tauri build "${BUILD_ARGS[@]}"@@ -188,6 +192,9 @@ for bin in "$APP_PATH/Contents/Resources/"openhuman-core-*; do"$bin"done+# Bundled native modules (shared with scripts/release/sign-and-notarize-macos.sh)+bash scripts/release/macos-bundled-modules.sh sign "$APP_PATH" "$ENTITLEMENTS" "$APPLE_SIGNING_IDENTITY"+# Sign the .app bundle (signs main exe + updates seal)echo " Signing .app bundle..."codesign --force --options runtime \@@ -200,6 +207,8 @@ echoecho "Verifying code signature..."codesign --verify --deep --strict --verbose=2 "$APP_PATH"echo "Signature OK."+# Run even with --skip-notarize, so a local build fails where CI would.+bash scripts/release/macos-bundled-modules.sh check "$APP_PATH/Contents/Resources/bundled-modules"# ── Notarize ──────────────────────────────────────────────────────────if $SKIP_NOTARIZE; thendiff --git a/scripts/release/check-macos-bundled-signatures.sh b/scripts/release/check-macos-bundled-signatures.shdeleted file mode 100755index d18e36953d..0000000000--- a/scripts/release/check-macos-bundled-signatures.sh+++ /dev/null@@ -1,44 +0,0 @@-#!/usr/bin/env bash-# Fail when any Mach-O under a bundled-modules directory — loose, or inside a-# shipped .tar.gz release archive — lacks what notarization demands: a-# Developer ID signature, hardened runtime and a secure timestamp. Apple's-# notary service unpacks nested archives, so archive members count too.-#-# Usage: check-macos-bundled-signatures.sh <bundled-modules dir>-set -euo pipefail--ROOT="${1:?Usage: check-macos-bundled-signatures.sh <bundled-modules dir>}"-[ -d "$ROOT" ] || { echo "[sign-check] no bundled modules at $ROOT"; exit 0; }--SCRATCH="$(mktemp -d)"-trap 'rm -rf "$SCRATCH"' EXIT-BAD=0--check_tree() { # <dir> <label prefix>- while IFS= read -r -d '' f; do- file -b "$f" | grep -q '^Mach-O' || continue- info="$(codesign -dvv "$f" 2>&1 || true)"- problems=""- grep -q '^Authority=Developer ID Application' <<<"$info" || problems+=" no-developer-id"- grep -q '^Timestamp=' <<<"$info" || problems+=" no-timestamp"- grep -q '^CodeDirectory.*flags=.*runtime' <<<"$info" || problems+=" no-hardened-runtime"- if [ -n "$problems" ]; then- echo "[sign-check] UNSIGNED for notarization:$problems: $2${f#"$1"/}"- BAD=1- fi- done < <(find "$1" -type f -print0)-}--check_tree "$ROOT" ""-while IFS= read -r -d '' archive; do- dest="$SCRATCH/$(basename "$archive")"- mkdir -p "$dest"- tar -xzf "$archive" -C "$dest"- check_tree "$dest" "${archive#"$ROOT"/}/"-done < <(find "$ROOT" -name '*.tar.gz' -type f -print0)--if [ "$BAD" -ne 0 ]; then- echo "[sign-check] ERROR: notarization would reject the Mach-O files above" >&2- exit 1-fi-echo "[sign-check] every Mach-O under $ROOT is notarization-ready"diff --git a/scripts/release/macos-bundled-modules.sh b/scripts/release/macos-bundled-modules.shnew file mode 100755index 0000000000..fa32ebc99e--- /dev/null+++ b/scripts/release/macos-bundled-modules.sh@@ -0,0 +1,76 @@+#!/usr/bin/env bash+# Bundled native modules in a macOS .app, shared by the CI release signer+# (sign-and-notarize-macos.sh) and the local signed build+# (build-macos-signed.sh) so both ship the same thing.+#+# Usage:+# macos-bundled-modules.sh sign <app_path> <entitlements_plist> <identity>+# macos-bundled-modules.sh check <bundled-modules dir>+#+# sign: codesign every Mach-O under Contents/Resources/bundled-modules with+# hardened runtime and a secure timestamp. Run before sealing the .app.+# tinybus pins the module *archive* digest, and on macOS stage-modules.mjs+# replaces that archive with its `.sha256` marker, so signing the extracted+# files in place does not break admission. Every Mach-O, not only the dylib:+# tinycomputer ships helper executables beside its library.+#+# check: fail when any Mach-O under the directory — loose, or inside a shipped+# .tar.gz — lacks what notarization demands: a Developer ID signature,+# hardened runtime and a secure timestamp. Apple's notary service unpacks+# nested archives, so archive members count too.+set -euo pipefail++cmd="${1:-}"+case "$cmd" in+ sign)+ APP_PATH="${2:?sign needs <app_path>}"+ ENTITLEMENTS="${3:?sign needs <entitlements_plist>}"+ IDENTITY="${4:?sign needs <identity>}"+ while IFS= read -r -d '' bin; do+ file -b "$bin" | grep -q '^Mach-O' || continue+ echo "[sign] Signing bundled module: ${bin#"$APP_PATH/Contents/Resources/"}"+ codesign --force --options runtime \+ --entitlements "$ENTITLEMENTS" \+ --sign "$IDENTITY" \+ --timestamp \+ "$bin"+ done < <(find "$APP_PATH/Contents/Resources/bundled-modules" -type f -print0 2>/dev/null)+ ;;+ check)+ ROOT="${2:?check needs <bundled-modules dir>}"+ [ -d "$ROOT" ] || { echo "[sign-check] no bundled modules at $ROOT"; exit 0; }+ SCRATCH="$(mktemp -d)"+ trap 'rm -rf "$SCRATCH"' EXIT+ BAD=0+ check_tree() { # <dir> <label prefix>+ while IFS= read -r -d '' f; do+ file -b "$f" | grep -q '^Mach-O' || continue+ info="$(codesign -dvv "$f" 2>&1 || true)"+ problems=""+ grep -q '^Authority=Developer ID Application' <<<"$info" || problems+=" no-developer-id"+ grep -q '^Timestamp=' <<<"$info" || problems+=" no-timestamp"+ grep -q '^CodeDirectory.*flags=.*runtime' <<<"$info" || problems+=" no-hardened-runtime"+ if [ -n "$problems" ]; then+ echo "[sign-check] UNSIGNED for notarization:$problems: $2${f#"$1"/}"+ BAD=1+ fi+ done < <(find "$1" -type f -print0)+ }+ check_tree "$ROOT" ""+ while IFS= read -r -d '' archive; do+ dest="$SCRATCH/$(basename "$archive")"+ mkdir -p "$dest"+ tar -xzf "$archive" -C "$dest"+ check_tree "$dest" "${archive#"$ROOT"/}/"+ done < <(find "$ROOT" -name '*.tar.gz' -type f -print0)+ if [ "$BAD" -ne 0 ]; then+ echo "[sign-check] ERROR: notarization would reject the Mach-O files above" >&2+ exit 1+ fi+ echo "[sign-check] every Mach-O under $ROOT is notarization-ready"+ ;;+ *)+ sed -n '2,/^set -euo/p' "$0" | sed '$d' >&2+ exit 1+ ;;+esacdiff --git a/scripts/release/sign-and-notarize-macos.sh b/scripts/release/sign-and-notarize-macos.shindex 3a5edcdb79..0dd0017951 100755--- a/scripts/release/sign-and-notarize-macos.sh+++ b/scripts/release/sign-and-notarize-macos.sh@@ -123,15 +123,8 @@ for bin in "$APP_PATH/Contents/Resources/"openhuman-core-*; docodesign_hardened "$bin"done-# Bundled native modules: notarization rejects unsigned Mach-O under Resources/.-# tinybus pins the module *archive* digest, not the extracted files, so signing-# them in place does not break admission. Every Mach-O, not only the dylib:-# tinycomputer ships helper executables beside its library.-while IFS= read -r -d '' bin; do- file -b "$bin" | grep -q '^Mach-O' || continue- echo "[sign] Signing bundled module: ${bin#"$APP_PATH/Contents/Resources/"}"- codesign_hardened "$bin"-done < <(find "$APP_PATH/Contents/Resources/bundled-modules" -type f -print0 2>/dev/null)+# Bundled native modules (shared with build-macos-signed.sh).+bash "$(dirname "$0")/macos-bundled-modules.sh" sign "$APP_PATH" "$ENTITLEMENTS" "$APPLE_SIGNING_IDENTITY"# ── Outer .app bundle ───────────────────────────────────────────────────────echo "[sign] Signing .app bundle..."@@ -143,7 +136,7 @@ codesign --verify --deep --strict --verbose=2 "$APP_PATH"# Fail here, with every offending path, rather than after a notarization# round trip. This includes Mach-O inside the pinned release archives.-bash "$(dirname "$0")/check-macos-bundled-signatures.sh" "$APP_PATH/Contents/Resources/bundled-modules"+bash "$(dirname "$0")/macos-bundled-modules.sh" check "$APP_PATH/Contents/Resources/bundled-modules"# ── Notarize ─────────────────────────────────────────────────────────────────echo "[sign] Notarizing..."diff --git a/scripts/release/stage-modules.mjs b/scripts/release/stage-modules.mjsindex 8e56775136..367adc3c84 100644--- a/scripts/release/stage-modules.mjs+++ b/scripts/release/stage-modules.mjs@@ -4,7 +4,8 @@// installer, release tarball or bench image needs no GitHub access to load a// module. The output layout is `<id>/<version>/<host_key>/<archive>` plus the// extracted library, which is what `modules::ops::set_bundled_releases_dir`-// (or `OPENHUMAN_BUNDLED_MODULES`) points at.+// (or `OPENHUMAN_BUNDLED_MODULES`) points at. On macOS the archive is replaced+// by `<archive>.sha256` holding its verified pin (see `keepsArchive`).//// Usage: node scripts/release/stage-modules.mjs [--target TRIPLE | --host-key KEY] [--output DIR]//@@ -66,6 +67,17 @@ export function hostKeyForTarget(triple) {throw new Error(`no bundled modules for target ${triple}`);}+/**+ * Whether the staged entry keeps its release archive. A notarized macOS app+ * cannot: Apple's notary service unpacks it and rejects the unsigned Mach-O+ * inside, and signing them would change the pinned bytes. There the archive is+ * replaced by its verified digest, which tinybus admits from the installer+ * bundle only; the extracted files are signed and sealed with the app.+ */+export function keepsArchive(hostKey) {+ return !hostKey.startsWith("macos-");+}+export function bundledAssets(source, hostKey) {const names = parseAllList(source);const records = parseRecords(source);@@ -188,6 +200,10 @@ export async function stageModules({ hostKey = defaultHostKey(), output = OUTPUTif (librariesUnder(dir).length !== 1) {throw new Error(`${asset.id}: expected exactly one native library in the release archive`);}+ if (!keepsArchive(asset.hostKey)) {+ writeFileSync(`${archive}.sha256`, `${actual}\n`);+ rmSync(archive);+ }console.log(`[bundled-modules] staged ${asset.id} ${asset.version} (${asset.hostKey})`);}console.log(`[bundled-modules] staged ${assets.length} verified releases for ${hostKey}`);