Repository navigation
Build isolated Dev and Prod Agent desktop packages on master - #1072
Conversation
|
Maple development preview: https://57a263e0.maple-ca8.pages.dev Commit: Uses development API, billing, flags and PCR configuration. Cloudflare Access applies. |
Compile without signing credentials, then verify same-run profile and source metadata before packaging on a fresh runner. Keep deterministic Linux SquashFS timestamps without conflicting inherited environment settings.
AnthonyRonning
left a comment
There was a problem hiding this comment.
Summary: The design is careful and mostly sound. Each build's profile is fixed at compile time and checked against the commit it was built from. Dev and Prod get separate app IDs, data folders and update feeds. The app and the DMG are each notarized and stapled, and downloaded artifacts are checked again on fresh machines. Three things should be fixed before merging: one setting will cancel signed master runs, only the macOS builds are actually signed, and the signing job runs the binary it signs. The signed path has also never run.
Fix before merging
1. Each master push cancels the signed run already in progress. agent-desktop-build.yml:15-17 sets cancel-in-progress: true, grouped by branch, so a new merge kills any signing or notarization still running. Master gets about 5–6 pushes a day (22 on the busiest day in the last month), and a run takes 30+ minutes before notarization, so on busy days most commits won't get downloads. Every other signing or publishing workflow in the repo uses cancel-in-progress: false. Fix: cancel-in-progress: ${{ github.event_name == 'pull_request' }}.
2. The Linux builds aren't signed or attested. macOS gets Developer ID signing and notarization. The Linux AppImage only ships a SHA256SUMS file inside the same zip, which catches corruption but not tampering. The workflow test blocks attestation outright (test_agent_workflows.py:181), while Research's master build already attests (desktop-build.yml:68-73). Suggestion: add actions/attest-build-provenance to the master macos and linux jobs, with id-token: write and attestations: write on those jobs only. Anyone can then check a download with gh attestation verify <file> -R MaplePrivacyLabs/Maple.
3. The signing job runs the binary it signs. Splitting compile and sign into separate jobs is meant to keep dependency code away from the Apple credentials, but the macos job runs the freshly built maple-agent:
- before signing:
verify-prebuilt-release.sh:23,package-release.sh:36 - after
codesign, while the temporary signing keychain is still unlocked:macos-release-app.sh:133 - from the finished DMG:
verify-release.sh:84
export -n stops the secrets being inherited, but a same-user process can still read the step's starting environment (as ps -E does). It can also sign with the unlocked keychain through /usr/bin/codesign, because the partition list allows codesign: without a prompt. So a compromised crate can still reach the key. This also conflicts with the CODEOWNERS header ("code that runs inside credential-bearing jobs require[s] the release owner's review"), since app/src/** and crates/** aren't code-owned. It's no worse than Research, which compiles with signing secrets present, but the docs claim more than it delivers. Fix: embed the build-info JSON as static bytes (for example a dedicated Mach-O section) and check it in the macos job without executing anything. Move the launch and duplicate-Swift-runtime checks to verify-macos, which has no credentials.
Decide on purpose
4. Every master push builds, signs and notarizes both profiles, whatever changed (agent-desktop-build.yml:49-52). That costs about 2× 23 min of large macOS runners, 4 notarizations and 2× 23 min of 8-core Linux per push. 93 of the last 155 master pushes (30 days) didn't touch anything agent_change_detection.py selects. Option: gate push events with the detector, building anyway if detection fails as agent-ci.yml does, and keep workflow_dispatch as the "always build" button. test_master_and_manual_packaging_do_not_depend_on_available_diff_history and the needs.changes.outputs.agent assertion encode the current choice.
5. The first master merge will be the first real signed run. On this PR, "Signed macOS" and "Verify downloaded macOS" were skipped, which is expected because the signing secrets only exist on master. That leaves real Apple tooling untested: the keychain import, finding the signing identity without adding the keychain to the search list, notarization credentials stored in a temporary keychain, stapling, and the verifier on macos-26. The tests fake those tools. Either do one signed package-release.sh prod locally on an Apple Silicon Mac, or fix #1 first so the first master run can't be cancelled, then watch it.
6. CI never opens a window. The launch smoke tests only run --version and --build-info, which exit before GPUI starts; the PR body already lists GUI validation as pending. Linux is the riskiest: AppRun pairs a bundled glibc (from nixpkgs pinned 2026-08-29) with the host's Mesa or NVIDIA drivers, which can break on distros newer than that pin. Do a manual pass (GNOME Wayland, X11, one NVIDIA machine, one recent Fedora) before pointing people at the downloads, or add a headless GUI smoke.
Nits
- On macOS, Dev reuses the Prod icon (
macos-release-app.sh:66), while Linux Dev gets a "DEV" badge. With both installed, it's hard to tell which account you're in. - The temporary keychain locks after an hour idle (
-lut 3600,macos-release-app.sh:103) and its password is thrown away, so a notarization that takes over an hour can't finish. The keychain is deleted at exit anyway, so remove the timeout. - The Rust caches are keyed per profile (L91, L223), but Dev and Prod build identical dependencies; one shared key would halve the storage.
- The raw, unsigned
*-prebuiltbinaries sit next to the real downloads for 30 days (L102). Shorten their retention. - Dev's pricing, portal and checkout-return links go to production trymaple.ai (
billing.rs:14-18). This is documented, but it mixes environments. develop-maple-agent/SKILL.md:46should also nameagent-desktop-build.ymlas a selector consumer.- Scope check: only macOS on Apple Silicon and Linux x86_64 (no Windows, Intel Mac or Linux arm64). Actions downloads need a GitHub login, expire after 30 days, and have no stable "latest" link.
Verification
- Read the full diff and compared it with
desktop-build.yml,agent-ci.ymland the signing docs. - All checks on the current head (
6ecafbb) are green. - Re-ran locally: the packaging fixtures (48 tests), the workflow, signing and Xcode contract tests (40, with yq-go), the change-detection tests and
actionlintall pass. - Not verified: anything signed or notarized, and the app's window on any platform.
Generated by Claude Code
Every master push now builds downloadable GPUI Maple Agent Dev and Prod packages: Developer ID signed/notarized macOS ARM64 bundles and Linux x86_64 AppImages. The profiles have distinct application IDs, state directories, service/PCR configuration, and update-tag namespaces; they coexist with Research and never adopt its state. Dev pricing and payment return links use the existing app-dev.trymaple.ai host, while Prod uses trymaple.ai.
macOS compiles without signing credentials, then packages on a fresh protected-master runner. The signer reads a dedicated Mach-O metadata section to bind the binary to the profile and exact source commit; it never executes artifact code. Credential-free verification checks the downloaded package, CLI metadata, Swift runtime, and actual GPUI window/first-render startup. Linux verifies its audited runtime closure and launches the downloaded AppImage in a non-root Ubuntu container without Nix or network access.
Final master files receive GitHub provenance, and fresh verifiers constrain it to this workflow, master, and the exact source SHA. Each master run completes independently; only superseded PR previews cancel. Stable artifact names support partial retries. Final downloads remain available for 30 days and internal prebuilt binaries for 7 days. Dev macOS uses the DEV-badged icon, and the temporary signing keychain cannot time out during notarization.
These are Actions downloads. This workflow does not create releases, advance update feeds, publish Prod web, or activate other architectures/platforms. PR macOS previews are unsigned; trusted-master signing and provenance cannot run on PR refs. Per-profile caches remain isolated because the runtime embeds different PCR trust settings.
Validation on head 4565dbb:
b3f0c1b012d8a803ce2cae1b4c0a4d48ebfbcb7d.Current-head preview downloads (macOS is unsigned):
The first signed Agent master run and Linux X11/Wayland/GPU coverage remain unverified. The existing Research master signing/notarization succeeded after the Apple Account email update; that does not substitute for proof of this new Agent signer.