Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

docs(adr/spec): document the macOS sidecar CA exception

yexisu9016b09d61a6
diff --git a/docs/adr/provider-system-certificates.md b/docs/adr/provider-system-certificates.md
index 5fcbd5852..9db7fc4df 100644
--- a/docs/adr/provider-system-certificates.md
+++ b/docs/adr/provider-system-certificates.md
@@ -16,13 +16,26 @@ probe of Electron 43.6.0 / Node 24.20.0 confirmed that this flag includes the
system roots in the default CA set. The older Node 22.16.0 behavior reported in
#714 is not evidence that the current packaged runtime lacks this capability.
+On macOS the Electron 43 build does not honor that contract (issue #1187): the
+flag replaces the bundled Mozilla roots with the enumerated system set, and
+that enumeration misses public anchors it should include — a chain anchored at
+GlobalSign Root CA - R3 fails with `UNABLE_TO_GET_ISSUER_CERT` while the same
+runtime without the flag verifies it, and stock Node 24 with the same flag
+verifies the same chain. A probe alone cannot fix the enumeration, so the
+sidecar reproduces Node's documented additive semantics itself.
+
## Decision
-The desktop launcher passes `--use-system-ca` before the sidecar entry point.
-Node combines its bundled roots with system roots and inherited
-`NODE_EXTRA_CA_CERTS`. Certificate chain, expiration and hostname validation
-remain enabled. The app neither installs roots nor exports a certificate bundle.
-The operating system's existing trust policy is the authority for local roots.
+The desktop launcher passes `--use-system-ca` before the sidecar entry point
+on Windows and Linux. On macOS the launcher omits the flag; instead the
+sidecar merges its bundled roots, the inherited `NODE_EXTRA_CA_CERTS` set,
+and the system-store certificates into the default CA set at startup
+(`tls.setDefaultCACertificates`, agent-runtime `system-ca`). Either way the
+effective trust set is the same: bundled roots, system roots, and an inherited
+extra-CA file, deduplicated by content. Certificate chain, expiration and
+hostname validation remain enabled. The app neither installs roots nor exports
+a certificate bundle. The operating system's existing trust policy is the
+authority for local roots.
This applies to the desktop sidecar's default Node TLS clients, including the
direct, HTTP proxy and SOCKS provider transports. It is a process-level default,
diff --git a/docs/spec/03-runtime/02-agent-runtime.md b/docs/spec/03-runtime/02-agent-runtime.md
index 59664469e..b9ae1141c 100644
--- a/docs/spec/03-runtime/02-agent-runtime.md
+++ b/docs/spec/03-runtime/02-agent-runtime.md
@@ -1619,11 +1619,16 @@ browseable.
### Provider certificate trust (issue #714)
-The desktop sidecar starts with Node's `--use-system-ca`, retaining bundled
-roots and inherited `NODE_EXTRA_CA_CERTS`. It uses the OS trust store without
-turning off chain or hostname validation. Restart after updating local trust
-or the extra-CA startup environment. Headless pi-host launch behavior and
-System/Direct/Custom proxy routing are unchanged.
+The desktop sidecar's effective trust set is the union of Node's bundled
+roots, the inherited `NODE_EXTRA_CA_CERTS` set, and the OS trust store, with
+chain and hostname validation on. On Windows and Linux the launcher passes
+Node's `--use-system-ca` to obtain the system roots. On macOS the Electron
+build applies that flag by replacing the bundled roots instead of adding them
+and its system enumeration misses public anchors (issue #1187), so the
+launcher omits the flag and the sidecar merges the three sets into the default
+CA set itself at startup (`agent-runtime system-ca`). Restart after updating
+local trust or the extra-CA startup environment. Headless pi-host launch
+behavior and System/Direct/Custom proxy routing are unchanged.
Explicit certificate verification errors are terminal for both setup and
stream recovery in main sessions and built-in delegates. Their structured