From f3d07d2d66efe3dfb0d1abfa005f0b73f9a78404 Mon Sep 17 00:00:00 2001 From: Ondrej Rafaj Date: Sat, 31 Oct 2026 18:51:09 +0000 Subject: [PATCH 1/6] Add signed macOS releases and named microscope verification --- README.md | 2 ++ docs/macos-release.md | 24 +++++++++++++++++++ scripts/e2e.mjs | 12 +++++++++- scripts/release-macos.sh | 51 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 docs/macos-release.md create mode 100644 scripts/release-macos.sh diff --git a/README.md b/README.md index b7b47df..d36ce2f 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ npm run dist:win # Windows installer and portable exe, in release/ npm run dist:mac # macOS dmg and zip, in release/ (run on a Mac) ``` +For a signed, notarized Mac package and physical-microscope verification, see [the macOS release guide](docs/macos-release.md). + If the app says the camera is busy, another program has it. Close the Camera app, Teams, or a browser tab using the camera; Electroscope keeps retrying and connects as soon as it is free. ## Develop diff --git a/docs/macos-release.md b/docs/macos-release.md new file mode 100644 index 0000000..98a46d5 --- /dev/null +++ b/docs/macos-release.md @@ -0,0 +1,24 @@ +# macOS release + +The Mac app uses the same viewer and MCP implementation as Windows. Build on an Apple Silicon Mac with Node 24 and the UnlikeOtherAI Developer ID Application certificate (team `23B7GTLBN7`). Camera permission is requested by macOS when the app first opens a camera. + +Install dependencies with `npm ci`, then run `npm run typecheck`, `npm test`, `npm run build`, and `node scripts/e2e.mjs --fake`. + +Unlock the existing signing keychain and set `CSC_KEYCHAIN` to its path if it is outside the default keychain search list. Load the protected notarization environment into the shell; it must define `APP_STORE_CONNECT_API_KEY_PATH`, `APP_STORE_CONNECT_API_KEY_ID`, and `APP_STORE_CONNECT_API_ISSUER_ID`. Keep credentials outside the repository and disable shell tracing. From a clean committed worktree, run: + +```sh +bash scripts/release-macos.sh +``` + +The script builds an arm64 app, verifies the UnlikeOtherAI signature, submits it to Apple, staples the accepted ticket, checks Gatekeeper, and writes a ZIP, source revision, byte count, and SHA-256 under `release/`. It does not upload or publish the package. + +Test the signed app with the physical microscope, using its camera-list label: + +```sh +ELECTROSCOPE_EXE="$PWD/release/mac-arm64/Electroscope.app/Contents/MacOS/Electroscope" \ + ELECTROSCOPE_CAMERA='GENERAL - UVC' node scripts/e2e.mjs +``` + +Allow camera access in the macOS prompt. The suite selects the named camera and checks the live viewer, all MCP tools, drawing with Command-Z, image pixels, and saving full-resolution photos. It writes screenshots and captures to `test-output/real/`. Synthetic-camera checks are separate from physical-camera verification. + +Copy the verified app to `/Applications/Electroscope.app`, then repeat the hardware suite with `ELECTROSCOPE_EXE` pointing inside the installed bundle. Launch the installed app normally and select the microscope; the choice persists across launches. Keep release artifacts and test evidence outside disposable worktrees before cleanup. diff --git a/scripts/e2e.mjs b/scripts/e2e.mjs index 783ba00..73112ee 100644 --- a/scripts/e2e.mjs +++ b/scripts/e2e.mjs @@ -2,6 +2,7 @@ // node scripts/e2e.mjs real camera // node scripts/e2e.mjs --fake Chromium's synthetic camera (CI) // ELECTROSCOPE_EXE= tests a packaged build instead of the source tree. +// ELECTROSCOPE_CAMERA=