Repository navigation
feat(apple): add opt-in OpenClaw ID node foundation - #194201
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR adds opt-in Swift node enrollment, trust verification, native tunnel transport, and a private macOS worker bridge. Example: An Apple node needs to reach wss://studio.example/ through OpenClaw ID.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 6 items remain Keep this maintainer-directed draft open: it provides distinct Apple transport foundations, but two correctness defects need repair and the explicit draft hold remains. Priority: P2 Decision needed
Before merge
Findings
Tests
Agent review detailsHow this fits togetherApple clients supply a node identity and invitation; shared Swift verifies Discovery evidence and carries node or worker traffic through the native iroh binding, with a private Unix socket adapting macOS worker traffic. flowchart LR
A[Node invitation and identity] --> B[Swift enrollment and trust]
B --> C[Node tunnel owner]
D[Gateway channel] --> C
E[Private macOS worker bridge] --> C
C --> F[Native iroh binding]
F --> G[Remote Gateway ingress]
Technical reviewBest possible solution: Keep the existing trust, tunnel, and socket owners, accept valid reset-bearing descriptors without changing pins, and interrupt blocked writes before waiting for close cleanup. Do we have a high-confidence way to reproduce the issue? Source establishes rejection of valid reset-bearing descriptors and the blocked-write close cycle; no target code or tests were executed. Is this the best way to solve the issue? The staged Swift adapters coherently reuse the native binding and local socket owner, but descriptor parsing must follow the current protocol and close cancellation must release the actual blocked writer. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 31a65d5def1a. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: The new node and worker authority boundary needs final-effect revocation evidence before merge. EvidenceSecurity concerns:
What I checked:
Likely related people:
PR surfaceSource +2830, Tests +1530, Config +90, Other +110. Total +4560 across 28 files. Added test files: 6. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 6, 2026, 11:36 AM ET / 16:36 UTC. |
031aad5 to
69e19a5
Compare
ae4fc19 to
0304d77
Compare
0304d77 to
b526fd9
Compare
69e19a5 to
7f9243b
Compare
Refs openclaw-517.7, openclaw-517.8
Retry uncertain enrollment delivery with identical signed redemption bytes. Keep default Swift consumers artifact-free and prove the native package in a dedicated Apple workflow. Refs: openclaw-517.7, openclaw-517.8
Use the approved macOS-only packaging mode while iOS cross-compilation is blocked upstream. Preserve both macOS architecture builds and the default/native Swift checks. Refs: openclaw-517.7, openclaw-517.8
Copy CryptoKit raw bytes into owned scratch before wiping the native handoff. Regression covers normal and throwing handoffs, stable public identities and signatures, and repeated seed delivery. Tracks openclaw-02e.
f7d7aec to
e0c7c2e
Compare
A Gateway-signed snapshot whose binding_seq exceeds the verified root-signed binding was refused but still merged into durable trust, so later honest snapshots for the same binding were refused until a newer binding arrived. Refuse it before merging, keeping only the verified binding pin.
…ring for Periphery The shared dead-code intersection flags the new node API because neither app calls it until the Mac wiring lands. Ignore commands name that consumer; the now-used performIfActive drops its superfluous ignore.
2c5e770 to
87fe626
Compare
|
Merged via squash.
|
* feat(apple): add node enrollment and tunnel foundation Refs openclaw-517.7, openclaw-517.8 * feat(apple): add opt-in native node transport Retry uncertain enrollment delivery with identical signed redemption bytes. Keep default Swift consumers artifact-free and prove the native package in a dedicated Apple workflow. Refs: openclaw-517.7, openclaw-517.8 * ci(apple): validate native transport on macOS only Use the approved macOS-only packaging mode while iOS cross-compilation is blocked upstream. Preserve both macOS architecture builds and the default/native Swift checks. Refs: openclaw-517.7, openclaw-517.8 * fix(apple): retain independent node binding retirement * feat(apple): persist node trust and refresh enrollment after restart * fix(apple): accept reset descriptors and unblock queued close * fix(apple): preserve node identity across native seed handoff Copy CryptoKit raw bytes into owned scratch before wiping the native handoff. Regression covers normal and throwing handoffs, stable public identities and signatures, and repeated seed delivery. Tracks openclaw-02e. * fix: preserve Apple node trust and worker download state * fix: keep unshipped Apple enrollment schema at v1 * style(apple): normalize native node Swift formatting * style(apple): use failable decoding for validated UTF-8 * fix(apple): validate raw hex bytes before UTF-8 conversion * style(apple): document intentional lossy close-reason decoding * fix(macos): stage native iroh package for app builds * ci(apple): declare cache-free Node setup in the native workflow * test(apple): a binding-ahead snapshot must not lock out honest snapshots * fix(apple): refuse binding-ahead snapshots without retaining their facts A Gateway-signed snapshot whose binding_seq exceeds the verified root-signed binding was refused but still merged into durable trust, so later honest snapshots for the same binding were refused until a newer binding arrived. Refuse it before merging, keeping only the verified binding pin. * chore(apple): mark the OpenClaw ID node API as consumed by Mac app wiring for Periphery The shared dead-code intersection flags the new node API because neither app calls it until the Mac wiring lands. Ignore commands name that consumer; the now-used performIfActive drops its superfluous ignore. * chore(apple): mark unpackaged endpoint witnesses for Periphery
Related: #194174 (native iroh FFI, merged as
1c996b16cd71), #196445 (stacked re-bind follow-up), #196759 (Mac enrollment app wiring)What Problem This Solves
Apple nodes (macOS and iOS) have no way to enroll with and connect to a Gateway through OpenClaw ID. They need a node-role-only enrollment, trust and tunnel foundation, plus a private macOS worker bridge, before any app can offer that connection.
User Impact
No user-visible change on its own. This is an opt-in library foundation: default builds stay artifact-free and unchanged, and the native transport only links with
OPENCLAW_IROH_NATIVE=1and a source-built XCFramework. Without native packaging, binding fails closed with a readable error. App wiring lands in #196759 on top of #196445.The node identity key (W) never grants operator authority.
Migration note: the app-private
node-enrollment.sqliteschema has never shipped and is defined in place atuser_version = 1. Pre-release development stores are refused unchanged and must be recreated (re-enroll the node). No user database is reset automatically.Why This Change Was Made
Shared Swift code in
OpenClawKitowns:AfterFirstUnlockThisDeviceOnlyKeychain service, separate from the phone/Mac operator identity);The app-private SQLite store (
OpenClawIDNodeTrustStore, two STRICT tables,synchronous = FULL) is separate from Gateway shared state and client credentials because their owners, schemas and lifecycles differ. W and join secrets never enter SQLite.The macOS bridge serves the node worker over an owner-only Unix socket (0700 directory, 0600 socket) and restricts it to worker routes.
scripts/lib/mac-swift-build.shstages the native crate forscripts/package-mac-app.shonly whenOPENCLAW_IROH_NATIVE=1. A path-filteredapple-node-nativeworkflow checks the default artifact-free build, builds a same-revision universal macOS XCFramework, and runs the native Swift–Rust loopback and opted-in shared tests.Schema (
apple-node-enrollments-v1)Documented in
docs/reference/database-schemas. #196445 amends this unshipped v1 in place (adds a nullablesnapshot_gateway_key).Evidence
Head
4522cf9205b8: mainc686c16f212f, then the previous 14 commits (zero-context range-diff againstf7d7aec209da: 14/14 identical, no conflicts), then five new commits:apple-node-native.ymldeclarescache-mode: "off"on its Node setup, which main's CI cache guard (test/scripts/ci-workflow-guards.test.ts) requires. The guard failed the first ready-state run (checks-node-compact-small-1-1, run 43181002425) and passes locally after the change (207/207).binding_seqexceeds the verified root-signed binding is now refused before any of its facts are merged; only the verified binding pin is kept. Previously its binding retirement was persisted, so later honest snapshots for the same binding were refused until a newer binding arrived. Exploiting that needed a compromised Gateway signing key; this matches the canonical protocol rule inpackages/openclaw-id-protocol/src/freshness/freshness.ts..rollback. It passes with the fix in this head's CI.// periphery:ignorecommands naming that consumer, following the existing convention inOpenClawKit, andperformIfActivedrops its now-superfluous ignore. The unpackaged endpoint's protocol witnesses carry their own commands so the class-level ignore is not reported as superfluous. No code changed.Earlier proof:
e0c7c2e94680(before the three commits above):swift build --build-tests, then tests run undersandbox-execwith network, the real home directory, Keychain/preferences IPC,launchctlandopendenied. SharedOpenClawIDNodesuites 31/31 passed; macOS bridge suites (MacNodeOpenClawID*) 20/20 passed. No installed app, Keychain or profile was touched.test/scripts/package-mac-app.test.ts88 passed, 12 Darwin-only skipped on Linux;bash -n scripts/lib/mac-swift-build.shandgit diff --checkclean.f7d7aec209da, patch-identical):scripts/package-mac-app.shwithOPENCLAW_IROH_NATIVE=1, release arm64, ad-hoc signed, failed before the staging fix (missing staged crate) and passed after it; the app verified withcodesign --verify --deep --strictand exports 54 iroh FFI symbols.apple-node-nativeworkflow and broad CI pass, includingopenclaw/ci-gate.e0c7c2e94680found one P2 (the binding-ahead snapshot above) and no P0/P1; it is fixed here, and a delta re-review covers the fix.apple-node-nativerun on this head (artifact-free and native-enabled shared suites plus the Swift–Rust loopback), not a fresh isolated Studio run.Live evidence
Signed Personal Team build 2611000399 ran on a Mac Studio on 2026-11-11 against a real Gateway over OpenClaw ID. That build contained this foundation as part of #196759 (which stacks on #196445), plus fixes from #197421 (now carried by #197585) and the macOS packaging fix #197383 (landed
f817a8b). Observed:Limits: that build is not this exact head and includes changes outside this PR, so it supports the foundation's real-device behavior but does not qualify this PR in isolation. Not covered: re-bind on a real device, sleep/wake, network change, in-place app update, TCC prompts, Intel Macs, iOS.
Known gaps
OpenClawIDNodeVerifiedTarget.inithas 8 parameters;OpenClawIDNodeEnrollmentTestsexceeds the type body length.