Galaxy Shell / docs
Docs / Interface and features

Handoff: starting Galaxy Shell on macOS

openspec/changes/archive/2026-11-09-macos-handoff/design.md · Edit on GitHub ↗

On this page

Handoff: starting Galaxy Shell on macOS

Doc status: history. Dated handoff of 2026-11-09 for the first macOS session; the live state is in docs/macos.md and docs/portability-platform-contract.md. native/wgpu-bridge, which it names, was removed on 2026-11-10 (docs/gles-removal-plan.md, step 2): the seven shared -core.wgsl passes that survive are in native/wgpu-renderer/src/effects/, and black-hole.wgsl and the other wrappers of the bridge are only in Git history (up to d785cce8). Checked 2026-11-10.

Written on 2026-11-09 for the first session on the owner's Mac. Read AGENTS.md first: most of its rules are about the Linux session in use and do not apply on the Mac, but the rules about evidence, scope, no em dash (U+2014), worktrees and decisions with quotes do.

Where the project is

  • The owner's order (2026-11-06): Linux, then macOS, then Windows. There is one Mac and no Windows machine ("Temos muito para fazer para fazer funcionar no Linux com as alterações, podemos focar nisso, depois Mac, e depois windows").
  • Linux is nearly through its phase. The Smithay compositor runs the wgpu effects backend by default since 2026-11-09 (docs/wgpu-release-plan.md, section "wgpu é o padrão"). The F9 overview theme effects were the last GLES-only effect and are in review.
  • First macOS run on 2026-11-09 (Mac16,1, Apple M4, macOS 26.5.2, one built-in Retina display): E1 parts A, B and C ran. Claims measured there are marked [macOS] in docs/portability-platform-contract.md; every other macOS claim is still [pendente]. Results: docs/macos.md, section "E1 no macOS (2026-11-09)".

Status of the first steps (2026-11-09)

Step State Evidence or block
Part B, drawing Done, aceito-macos for what it measured Metal, PostMultiplied and Opaque, 60 s at 1280x720, GPU timestamps; run-macos.py
Part A, preflight Done preflight.cjs under Electron 45 and Node 26; OpenCode 2.1.4 runs, so D0 is not stopped
Part C, windows Done, with the owner's grant, revoked at the end run-windows-macos.py; an arbitrary child of the granted app inherits Accessibility, so D1 on macOS waits for an own-identity helper or the owner. Focus in three conditions, a second monitor and Team ID signing are still open
Plan step 3, chat on the Mac Started 2026-11-09 after the owner's "Yes, start the chat": the core and the Electron host run with OpenCode 2.1.4 on a synthetic profile docs/macos.md, "Etapa 3 no macOS"; pending: visual check, a real provider, supervision, the preparer on macOS
Linux side of the probe change Written, not run on Linux cargo test, Clippy and a run-linux.py --seconds 5 smoke on the Linux machine

Found on the Mac and not in the plan before: no flock(1) (the core refuses to start), no O_EXLOCK in Node's fs.constants (the raw value works), the Electron main process opens the inspector on SIGUSR1 even with --disable-sigusr1, wgpu Metal has no PreMultiplied alpha, and Metal writes the end-of-pass timestamp only when the command buffer completes. Part C added: the Accessibility grant follows the app that LaunchServices started and every process it launches (an unrelated Python child moved a window), is lost when the CDHash changes, and AXMinimized can return success without minimizing.

What Galaxy Shell is on macOS

Not a compositor. macOS does not let us replace the WindowServer, so the Mac version is an application on the existing desktop (docs/portability-platform-contract.md, Resultado proposto):

Layer macOS
Interface The same React/shadcn sources in Electron, with its own integration
Desktop Accessibility (AX) on the WindowServer
GPU wgpu on Metal
External windows Native management; special effects on them are an open investigation

Parity with the Linux canvas, window frames and effects on other applications is not a requirement and may not be possible. The WGSL shaders of native/wgpu-bridge (removed on 2026-11-10; the shared passes are now in native/wgpu-renderer/src/effects/) carry over to Metal; the GLES to Vulkan dma-buf transport does not, so moving pixels between Electron and wgpu needs its own measured path (plan, step 5).

The first task: experiment E1 on the Mac

E1 is defined in docs/portability-platform-contract.md, section 5. It is throwaway, lives in experiments/portability-probe/, imports no product code and changes no profile. Three parts; each result maps to a concrete decision in the table "Aceite e decisões" there.

  1. Part B, drawing (start here; it is the owner's main interest). A transparent window, a test texture and the black hole effect in WGSL on Metal, 60 s at 1280x720. Report adapter, backend, alpha_modes, present mode, frame p50/p95/p99, missed frames, process CPU and memory, GPU timestamps or indisponível, bytes copied per frame, reduced motion respected. The Linux probe today is Wayland-only (winit with wayland, wgpu with vulkan/gles, require_nested() in src/main.rs, a Linux runner run-linux.py). Add a macOS target to the same probe: cfg(target_os = "macos") for winit's AppKit backend and wgpu's metal feature, its own small runner (run-macos.py), and the shader from native/wgpu-bridge/src/black-hole.wgsl (history: the file left with the bridge on 2026-11-10; its body is native/wgpu-renderer/src/effects/black-hole-core.wgsl). Keep the Linux path and its tests unchanged.
  2. Part A, preflight (Node and Electron 45, no GPU). The list in the contract: fs.constants, key delivery on fd 3 with fstat(3).isSocket(), UV_FS_O_EXLOCK, lockf released on death, rename over an open file, directory.sync(), killing a process tree, links and a path with a space, SIGUSR1 and process._debugProcess, node:sqlite, opencode --version. If OpenCode does not run, stop: there is no conversation, so no D0 on macOS.
  3. Part C, windows (Rust, Accessibility). Opens its own target window and moves, resizes, minimizes, restores, opens a child dialog and requests focus; latency, refusals, identity and DPI against Electron's screen. Every operation first without the Accessibility permission, then with it, then after a rebuild, then as a helper of another process, then from an arbitrary child of the same parent, then with the binary swapped on the same path. A grant that follows the path or reaches a child of the core blocks D1 on macOS until the owner decides (contract, "Transporte do auxiliar").

Rules for the probe on the Mac

  • Part C changes only windows it opened. Of other windows it only counts them, with no title, path or application recorded.
  • No pixels captured. Reports are local JSON with synthetic data under ~/.codex/artifacts/qa/galaxy-shell/<date>-e1/, with $HOME, user name, monitor and adapter normalized. No upload anywhere.
  • No elevation, no SIP change, no change to system focus settings.
  • Package the probe with its own bundle id and launch it with open, so the permission does not land on the Terminal. Revoke it at the end with tccutil reset Accessibility <id> and record that in the report.
  • Clean environment for every part: temporary HOME and XDG_*, so OpenCode never touches the real storage.
  • New systems use the Galaxy Shell name from the first line: bundle id, executable, profile directory and package (docs/naming.md, New systems). Do not create agent-native-os paths on the Mac.

Prerequisites to confirm on the Mac

Apple Silicon, current macOS, Xcode Command Line Tools, Rust (the probe pins 1.93), Node and the project's Electron 45, ad-hoc signing. Ideally two monitors, one Retina and one not. Record the Mac model and monitors in the report. A VM or cross-compiling does not count as proof.

Acceptance states

A result on the Mac is aceito-macos only for what its report measured on real hardware. Code that never ran on the Mac stays escrito-sem-aceite and off in the product. Failures are valid results. Write the report into docs/macos.md (a new dated section) and the decisions into docs/work-log-2026-11.md (or the current month's log), with the owner's quotes.

After E1

Plan steps 3 and 4: split the core from its Linux dependencies (D-Bus, PAM, /proc, Wayland browser discovery, Linux paths; inventory in the contract, section 1) and build the first Mac desktop version (floating chat, launching, listing and arranging windows, monitors and DPI, shortcuts, contextual controls, recovery). Only what E1 proved enters those steps.

Pointers

  • docs/portability-platform-contract.md, Roteiro de portabilidade: the plan and its steps; docs/macos.md: the Mac results.
  • docs/portability-platform-contract.md: inventory, D0/D1 contract, matrix per system, E1.
  • experiments/portability-probe/README.md: the Linux probe, its runner and limits.
  • native/wgpu-bridge/: the WGSL passes that are expected to carry over. Removed on 2026-11-10; the surviving passes are in native/wgpu-renderer/src/effects/.
  • docs/naming.md: Galaxy Shell naming on new systems.