feat: native SwiftUI Crabbox iOS app (crabbox.sh client + on-device/sandbox LLM + islo)#379
feat: native SwiftUI Crabbox iOS app (crabbox.sh client + on-device/sandbox LLM + islo)#379zozo123 wants to merge 11 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 15, 2026, 1:04 PM ET / 17:04 UTC. Summary Reproducibility: not applicable. for a bug as a whole; the blocking coordinator endpoint and credential-boundary issues are source-reproducible from PR-head code and current main routes. Review metrics: 3 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land only after maintainers approve the mobile product and security boundary, align the coordinator client with the supported workspace/lease API, constrain credential endpoints, replace or pin the bootstrap path, add real simulator/device proof, and get CI green. Do we have a high-confidence way to reproduce the issue? Not applicable for a bug as a whole; the blocking coordinator endpoint and credential-boundary issues are source-reproducible from PR-head code and current main routes. Is this the best way to solve the issue? No; the branch remains too broad and WIP to merge before the coordinator API, credential boundary, proof, CI, and mobile ownership questions are resolved. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d45ca8a916d9. Label changesLabel changes:
Label justifications:
Evidence reviewedSecurity concerns:
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review Implemented the review blockers that can be handled from this environment:
Remaining proof caveat is documented in the PR body: this machine does not have full Xcode/ |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
WIP don't merge... but fix extensively. |
The mobile/ surface is now a genuinely native iOS app (no web wrapper, no Expo), built around a portable Swift core: - CrabboxKit: pure URL/navigation/state logic + LLM/sandbox clients (OllamaClient, SandboxEngine, IsloClient, CoordinatorClient, SandboxProvisioner). Builds and unit-tests on macOS AND Linux. - App (SwiftUI): Portal (WKWebView of crabbox.sh with native chrome, HTTPS-only ATS, OAuth-persisting data store), Assistant (engine-agnostic chat over on-device MLX / sandbox Ollama / Apple Foundation Models), and Sandboxes (provision + chat from the phone via crabbox.sh coordinator or the optional direct islo.dev provider). - crabbox-sim: headless e2e (17 scenarios / 13 invariants) driving the exact reduce() the app uses, plus a tiny-LLM (Ollama qwen2.5:0.5b) agentic driver with a deterministic fallback; runnable on an islo sandbox. - crabbox-mac: native WKWebView preview harness (no Xcode needed). - XcodeGen project.yml; CI builds the package on Linux+macOS and xcodebuilds the iOS app (unsigned, build-only). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Live testing against api.islo.dev revealed the islo API requires a session
JWT, not the raw API key as Bearer. IsloClient now exchanges the API key at
POST /auth/token ({access_key} -> {session_token, expires_in}) and caches the
JWT, matching the islo Go SDK customauth flow. Also parse the {"items":[…]}
list shape and tolerate id-or-name. Verified end-to-end: auth, create, list,
delete a real sandbox via crabbox-sim --islo-demo.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Live e2e against api.islo.dev surfaced (and this fixes) the full launch-an-LLM-sandbox path the app's Sandboxes tab drives: - exec/stream SSE: parse named 'event: stdout|stderr|exit' blocks (not JSON-in-data:), so command output and exit codes are read correctly. - bootstrap: install zstd (required by the Ollama installer on the islo image), drop 'set -e' (the readiness curl loop's first miss aborted it), bind Ollama to 0.0.0.0 so the islo share can reach it. - run the multi-minute install+pull DETACHED (nohup+setsid via a base64'd script): islo's exec/stream has a max duration and was SIGTERM'ing the foreground bootstrap (exit 143). The provisioner now returns immediately and readiness is polled; detached jobs persist across islo execs (verified). Verified: crabbox-sim --islo-demo with CRABBOX_ISLO_LLM=1 provisions a sandbox, boots Ollama + qwen2.5:0.5b, and gets a real chat reply, then cleans up. Headless sim still 18/18, 0 invariant violations. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Assistant declared a private `enum Theme` that collided with the shared
`Theme` in Theme.swift — same-module file-scope types clash regardless of
`private`, failing the iOS xcodebuild ('invalid redeclaration of Theme').
Use the shared Theme (it already provides bg/panel/accent/subtle/hairline).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- scripts/install-on-device.sh: build + free-provisioning install onto a connected iPhone (requires full Xcode; one command given a Team ID). - scripts/verify-islo-key.sh: prove an islo key end-to-end (key read from a 600 file, never argv/transcript); --llm runs the full Ollama-on-sandbox chat. - docs: document the live --islo-demo path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
README now has a step-by-step device-install guide: Xcode/disk/Team-ID prereqs, the one-command scripts/install-on-device.sh (free provisioning), the Xcode-GUI alternative, trusting the dev cert, entering the islo key in-app, and verifying the islo key on the Mac first. install-on-device.sh gains a DEVICE_ID override so detection degrades gracefully. distribution.md points to the script. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
Evolves
mobile/into a genuinely native SwiftUI iOS app whose first screen is a Crabbox command runner, not the website. The app now links Crabbox's Go CLI package as an in-processCrabboxMobilestatic library and can run commands such as:That calls islo.dev from the iPhone using the user's islo key stored in Keychain. iOS cannot spawn a separate desktop-style CLI binary, so this PR compiles the Go command engine into the app and calls it through a tiny C/Swift bridge.
Architecture
crabbox ...command lines, executes them through the linked GoCrabboxMobilecore when present, and falls back to coordinator/v1/workspacesterminal sessions for builds that omit the Go core.mobile/go/crabboxmobileexportsCrabboxMobileRun/CrabboxMobileFree, importsinternal/cliplus the mobile-safeisloprovider, and is compiled by Xcode viascripts/build-crabbox-mobile-core.sh.Validation
swift buildswift run crabbox-sim— 18 scenarios, 74 steps, 0 invariant violationsCGO_ENABLED=1 GOOS=ios GOARCH=arm64 go build -buildmode=c-archive -o /tmp/crabboxmobile-final/libcrabboxmobile.a ./mobile/go/crabboxmobilego test ./mobile/go/crabboxmobilegit diff --checkLocal
swift testis currently blocked on this Mac because the active toolchain is/Library/Developer/CommandLineToolsand XCTest is unavailable without full Xcode selected.Install
Full Xcode is still required for a physical iPhone install. The install script now also checks for Go because Xcode builds the embedded CrabboxMobile core before compiling the Swift app:
cd mobile DEVELOPMENT_TEAM=XXXXXXXXXX ./scripts/install-on-device.sh