Skip to content

Commit bb47668

Browse files
SashaMITcursoragent
andcommitted
docs(macos): add MAC.md and Apple Vz backend plan; retire Slice B framing
Companion to the manifest revert in the previous commit. Documents the truthful current macOS status and the named path to first-class support. Changes: - docs/MAC.md (new): honest current Mac story — daemon code compiles and runs natively, WASM and data capsules work, MicroVM capsules require Linux and fail closed on Mac per PRINCIPLES.md #11. Includes the trust-delta disclosure (KVM + auditable crosvm vs Apple-signed Virtualization.framework) that the Vz backend cannot erase. - docs/vz-backend/PLAN.md (new): canonical, repo-resident plan for the Apple Virtualization.framework backend (`elastos-vz` as a sibling crate to `elastos-crosvm`, implementing the same ComputeProvider trait). Includes: * "Linux untouched: explicit guarantees" — no edits to elastos-crosvm, no edits to the ComputeProvider trait, all Mac dispatch cfg-gated, CI gate enforcing the file-set * Hypervisor trust delta disclosure * Pre-Work + Phase 0–6 sequencing (~6–10 weeks) * Risk register including code-signing/notarization, entitlements, and the Linux-untouched gate - docs/PC2_CONVERGENCE.md: Slice B framing (in-process / host-binary provider substitution on non-Linux) is marked superseded; the "Apple Hypervisor.framework substrate, out of scope, tracked separately" line is replaced with a pointer to vz-backend/PLAN.md; decision log gains a 2026-05-22 entry recording the switch. - state.md: Support boundary section gains a fail-closed summary of the current Mac status, with cross-references to docs/MAC.md and docs/vz-backend/PLAN.md. No code changes. No Linux behaviour change. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 9fc4a7e commit bb47668

4 files changed

Lines changed: 591 additions & 7 deletions

File tree

docs/MAC.md

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# macOS
2+
3+
Honest current status of `elastos-runtime` on macOS, plus the named path
4+
to first-class support.
5+
6+
> This document is the truthful Mac-side companion to
7+
> [`state.md`](../state.md) ("Support boundary"). If anything in this file
8+
> conflicts with the canonical [`PRINCIPLES.md`](../PRINCIPLES.md) or
9+
> [`state.md`](../state.md), those win.
10+
11+
## TL;DR
12+
13+
- The runtime daemon **compiles and runs natively on macOS** today (Apple
14+
Silicon, `aarch64-apple-darwin`). Developers can build and iterate on
15+
the daemon code without a Linux VM.
16+
- `WASM` and `data` capsules — for example `home`, `system`, `chat-room`,
17+
`gba-emulator` — run natively on macOS with the same isolation
18+
guarantees they have on Linux (wasmtime sandbox + capability tokens).
19+
- `MicroVM` capsules **do not yet run on macOS**. The repo refuses to
20+
pretend otherwise: `elastos setup --list` will report
21+
`[skip] <name> — not available for darwin-arm64` for any `type: microvm`
22+
capsule. This is intentional fail-closed behaviour per
23+
[`PRINCIPLES.md` #11 *Fail Closed, Then Explain*](../PRINCIPLES.md).
24+
- The named, scoped project that makes macOS a first-class ElastOS host
25+
with **identical microVM isolation** to Linux is the **Apple
26+
Virtualization.framework backend** ([`vz-backend/PLAN.md`](vz-backend/PLAN.md)).
27+
28+
## What runs natively on macOS today
29+
30+
| Capsule kind | Substrate | Status on Mac |
31+
|---|---|---|
32+
| `type: wasm` (e.g. `home`, `system`, `chat-room`) | wasmtime, capability tokens | Same as Linux |
33+
| `type: data` (e.g. `documents`, `library`, `inbox`, `gba-emulator`) | static assets, served by gateway | Same as Linux |
34+
| `type: microvm` (e.g. `chat`, `agent`, `localhost-provider`, `did-provider`, `shell`, `webspace-provider`, `ipfs-provider`, `tunnel-provider`, ...) | KVM + crosvm | **Not on macOS yet.** See "Path to first-class support" below. |
35+
36+
The browser-hosted Home surface
37+
(`http://127.0.0.1:8090/apps/home/`) and its child apps (System, Inbox,
38+
Documents, Library, Chat Room, GBA) are reachable from macOS through
39+
`elastos gateway`. This matches [`state.md`](../state.md) L88: *"The
40+
default Home path must remain a KVM-independent browser-hosted adapter
41+
so macOS and Windows stay in scope without pretending to offer Linux
42+
parity."*
43+
44+
## Why MicroVM capsules don't run on Mac yet
45+
46+
ElastOS's central security thesis — *every `type: microvm` capsule in
47+
its own hardware-isolated microVM, communicating only through Carrier
48+
with explicit capability tokens* — is true on Linux via KVM + the
49+
[`elastos-crosvm`](../elastos/crates/elastos-crosvm/) crate. KVM is a
50+
Linux-kernel feature; macOS does not have it.
51+
52+
The runtime preserves that contract by failing closed when the
53+
substrate is missing, rather than silently swapping to a weaker
54+
isolation model. The supervisor explicitly checks:
55+
56+
```rust
57+
// elastos/crates/elastos-server/src/supervisor.rs (L930)
58+
if !elastos_crosvm::is_supported() {
59+
bail!("/dev/kvm not available — crosvm requires KVM. Cannot launch capsule '{name}'.");
60+
}
61+
```
62+
63+
That is the truthful, principled answer on Mac today: *the substrate is
64+
not available, so the capsule will not run.* Not a downgrade.
65+
66+
> **Note on Slice B (commits `a02045e`, `a229638`, `d623ba7`):** an
67+
> earlier exploratory branch added darwin entries to
68+
> [`components.json`](../components.json) for `shell`,
69+
> `localhost-provider`, `did-provider`, and `webspace-provider`. Those
70+
> entries were misleading — they implied "this `type: microvm` capsule
71+
> runs natively on Mac" while in fact the runtime was launching them as
72+
> plain host-binary subprocesses without microVM isolation. The
73+
> Pre-Work step of [`vz-backend/PLAN.md`](vz-backend/PLAN.md) removes
74+
> those entries so the manifest tells the truth. The daemon-portability
75+
> improvements from those same commits (`pid_is_alive`,
76+
> `ELASTOS_DATA_DIR`, smoke-script Bash 3.2 portability, the
77+
> [`elastos-crosvm`](../elastos/crates/elastos-crosvm/) `cfg`-gated
78+
> non-Linux build) are preserved — they are universally-good
79+
> portability work and do not touch the Linux microVM substrate.
80+
81+
## Path to first-class support
82+
83+
The named, scoped project is the **Apple Virtualization.framework
84+
backend**. Read the full plan in
85+
[`vz-backend/PLAN.md`](vz-backend/PLAN.md). Headlines:
86+
87+
- **Strategy.** Add `elastos-vz` as a *sibling* crate to
88+
[`elastos-crosvm`](../elastos/crates/elastos-crosvm/), implementing
89+
the same
90+
[`ComputeProvider` trait](../elastos/crates/elastos-compute/src/traits.rs)
91+
on top of Apple's `Virtualization.framework`. No edits to
92+
[`elastos-crosvm`](../elastos/crates/elastos-crosvm/). No edits to
93+
the trait. No edits to the capsules. No edits to Carrier. No edits to
94+
the capability-token plane. Linux execution path byte-equivalent to
95+
pre-change.
96+
- **End state.** Every `type: microvm` capsule artifact that runs on
97+
Linux runs on Mac with **identical hardware-enforced isolation,
98+
identical Carrier semantics, identical capability tokens, identical
99+
fail-closed behaviour**. The capsule itself does not know it is on
100+
Mac.
101+
- **Effort.** 6–10 weeks for one focused systems-Rust engineer, phased
102+
Pre-Work → Phase 0 (1 wk research) → Phase 1 (scaffold) → Phase 2
103+
(first guest boot) → Phase 3 (virtio plumbing) → Phase 4 (first
104+
capsule end-to-end) → Phase 5 (hardening) → Phase 6 (ship).
105+
106+
## Honest trust delta
107+
108+
For [`PRINCIPLES.md` #12 *Docs, Code, Tests, and Ops Must Agree*](../PRINCIPLES.md),
109+
the one honest difference between Linux and macOS isolation that the
110+
Vz backend does *not* erase:
111+
112+
| | Linux today | macOS after Vz backend |
113+
|---|---|---|
114+
| Hardware isolation | CPU virt extensions (VT-x / SVM / ARM EL2) | CPU virt extensions (Apple Silicon EL2) |
115+
| Hypervisor | [`elastos-crosvm`](../elastos/crates/elastos-crosvm/) — open source, auditable, vendored | Apple `Virtualization.framework` — closed source, signed and shipped with macOS |
116+
| Trust source | We audit crosvm | We trust Apple's signed binary |
117+
| Integrity verification | Implicit (distro packaging) | Apple System Integrity Protection + binary code signing |
118+
119+
**Net:** hardware-level isolation parity is full. The trust *source*
120+
differs. This is the same trade-off Docker Desktop, OrbStack, Lima,
121+
Tart, and every Mac-targeting VMM accepts. We disclose the delta
122+
honestly; we do not paper over it.
123+
124+
The capability-token plane, the Carrier transport, the capsule
125+
artifact, and the fail-closed semantics are **unchanged** by this
126+
trade-off.
127+
128+
## What this means for users today
129+
130+
- **You can develop the daemon code on a Mac.** `cargo build` and
131+
`cargo test` work. The daemon process runs, gateway serves the
132+
browser Home, WASM and data capsules execute.
133+
- **You cannot run microVM capsules on a Mac.** Until the Vz backend
134+
lands, install of any `type: microvm` capsule will be skipped with a
135+
clear "not available for darwin-arm64" message. To run the full
136+
microVM-isolated ElastOS today, use Linux (`x86_64-linux` or
137+
`aarch64-linux`).
138+
- **If you need to test microVM capsules from a Mac**, run the runtime
139+
inside a Linux VM (Lima, Apple Vz-managed manually, or a remote
140+
Linux host) and connect to it. This mirrors how Docker Desktop and
141+
the Kubernetes control plane handle the Mac case.
142+
143+
## Cross-references
144+
145+
- The plan: [`docs/vz-backend/PLAN.md`](vz-backend/PLAN.md)
146+
- The principles this plan obeys: [`PRINCIPLES.md`](../PRINCIPLES.md)
147+
(#10, #11, #12 in particular)
148+
- The runtime's support boundary: [`state.md`](../state.md)
149+
("Support boundary" section)
150+
- The convergence context with PC2/Home:
151+
[`docs/PC2_CONVERGENCE.md`](PC2_CONVERGENCE.md)
152+
- The Linux microVM substrate (untouched by this work):
153+
[`elastos/crates/elastos-crosvm/`](../elastos/crates/elastos-crosvm/)

docs/PC2_CONVERGENCE.md

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,39 @@ unchanged.
173173

174174
### Slice B — Critical providers available on non-Linux (Layer 2)
175175

176-
**Status:** scope concretized; implementation open.
176+
> **Superseded (2026-05-22).** The original framing of Slice B —
177+
> *make MicroVM-typed providers available on non-Linux as in-process /
178+
> host-binary substitutes* — has been retired. After the exploratory
179+
> attempt landed in commit `a02045e`, review against
180+
> [`PRINCIPLES.md` #10 *One Canonical Path* and #11 *Fail Closed, Then
181+
> Explain*](../PRINCIPLES.md) concluded that running a `type: microvm`
182+
> capsule as an unsandboxed host subprocess on Mac silently downgrades
183+
> the isolation contract those capsules declare. The principled path is
184+
> to give Mac a real microVM substrate, not a soft alternate.
185+
>
186+
> **The replacement project is the Apple Virtualization.framework
187+
> backend**[`docs/vz-backend/PLAN.md`](vz-backend/PLAN.md). It adds
188+
> `elastos-vz` as a sibling crate to
189+
> [`elastos-crosvm`](../elastos/crates/elastos-crosvm/) implementing the
190+
> same
191+
> [`ComputeProvider` trait](../elastos/crates/elastos-compute/src/traits.rs)
192+
> on Apple Vz. Linux code untouched; Mac gains identical hardware-isolated
193+
> microVM execution.
194+
>
195+
> **Pre-Work for that plan has reverted the misleading darwin entries**
196+
> added to [`components.json`](../components.json) in `a02045e` for
197+
> `shell`, `localhost-provider`, `did-provider`, and `webspace-provider`.
198+
> The daemon-portability improvements from the same commits
199+
> (`pid_is_alive`, `ELASTOS_DATA_DIR`, smoke-script Bash 3.2 portability,
200+
> the `elastos-crosvm` `cfg`-gated non-Linux build, the `darwin-arm64`
201+
> platform identity, and the universal-platform demo-capsule installs
202+
> `chat-room` / `gba-emulator` / `gba-ucity`) are kept — they do not
203+
> touch the Linux microVM substrate.
204+
>
205+
> The original Slice B prose below is preserved for historical context.
206+
207+
**Status:** ~~scope concretized; implementation open.~~ Superseded — see
208+
[`vz-backend/PLAN.md`](vz-backend/PLAN.md).
177209

178210
**Smallest shippable slice:** make `localhost-provider` available as an
179211
**in-process provider** on non-Linux. The runtime already registers
@@ -228,8 +260,10 @@ itself once; substrate selection is a runtime-policy detail bound to
228260
attributable.
229261
- A WASM substrate variant of these providers. Possibly correct
230262
long-term, but bigger than Layer 2. Layer 2 should not block on it.
231-
- An Apple Hypervisor.framework substrate. Out of scope here; tracked
232-
separately.
263+
- ~~An Apple Hypervisor.framework substrate. Out of scope here; tracked
264+
separately.~~ — now the **named replacement** for this slice's
265+
intent. See [`vz-backend/PLAN.md`](vz-backend/PLAN.md). Apple
266+
`Virtualization.framework`, not the older `Hypervisor.framework`.
233267

234268
### Slice C — Platform identity on macOS
235269

@@ -332,9 +366,12 @@ ships until its gate passes.
332366
10. **Launcher Slice 2 + 3** as the underlying capsule and registry
333367
contracts harden
334368

335-
Apple Hypervisor.framework substrate, dedicated browser capsule, and
336-
deeper Puter-derived UI deprecation are explicitly later. They should
337-
not distort the immediate sequence above.
369+
The Apple Virtualization.framework backend
370+
([`vz-backend/PLAN.md`](vz-backend/PLAN.md)) is the named replacement
371+
for Slice B's intent; its sequencing is owned by that plan and runs
372+
independently of the launcher slices above. Dedicated browser capsule
373+
and deeper Puter-derived UI deprecation are explicitly later. They
374+
should not distort the immediate sequence above.
338375

339376
## Decision Log Stub
340377

@@ -347,3 +384,14 @@ Track decisions here when they pin down a previously open choice.
347384
`localhost-provider` only, not WASM-substrate provider rework.
348385
Driver: matches existing `documents-provider` in-process mechanism,
349386
fewer new concepts.
387+
- **2026-05-22** — Slice B retired in favour of a native Apple
388+
Virtualization.framework backend ([`vz-backend/PLAN.md`](vz-backend/PLAN.md)).
389+
Driver: running a `type: microvm` capsule as an unsandboxed host
390+
subprocess violates [`PRINCIPLES.md` #10 and #11](../PRINCIPLES.md);
391+
the principled fix is a real microVM substrate on Mac, not a soft
392+
alternate. The Vz backend gives Mac identical hardware-enforced
393+
isolation to Linux/KVM while leaving the
394+
[`elastos-crosvm`](../elastos/crates/elastos-crosvm/) Linux code path
395+
untouched. Pre-Work reverts the misleading darwin entries in
396+
[`components.json`](../components.json) added by `a02045e`; the
397+
daemon-portability improvements from that commit chain are kept.

0 commit comments

Comments
 (0)