Skip to content

feat: integrate optional native iSH Pi ExecutionEnv on iOS - #7

Merged
sugarforever merged 6 commits into
mainfrom
codex/ios-ish-execution
Oct 23, 2026
Merged

sugarforever merged 6 commits into
mainfrom
codex/ios-ish-execution

Conversation

@sugarforever

@sugarforever sugarforever commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Closes #6

Moose now has an opt-in, real iOS iSH-backed Pi Durable ExecutionEnv. Pi read/write/edit and bash share each conversation's persistent guest root, and the actual React Native/Hermes application executes the pinned iSH core locally. The existing Expo environment remains the default; enable the experiment with npm run prepare:ish and EXPO_PUBLIC_MOOSE_ISH=1 npm run ios.

The original feasibility probe and its failing host-mount audit are retained as historical reproducers. The embedded path adds a surviving supervisor, inherited execution domains and explicit syscall/mount restrictions; it does not use a host shell, Node in Hermes or a remote backend.

Changes

  • Add docs/ios-ish-setup-guide.md, modeled on the Android Termux phone guide: prerequisites, initial manual steps, controlled/model checks, daily operation, errors, automatic setup behavior, diagnostics and a physical-device acceptance record. Link it from README and execution notes. Preserve main’s v0.7.0 recovery, Skill folders and live tool-activity changes.

  • Merge latest main (a8e0511, v0.7.0), retaining Android Termux automatic setup, diagnostics, native capabilities and its reduced executor profile. iSH retains its own durable bash tool and approved native capabilities.

  • Expand README with complete iOS prerequisites, dependency preparation, native build, persistent development flags, device-signing caveat, model configuration, controlled smoke, backend switching and troubleshooting. iOS needs no companion app/service or pairing.

  • Fix fresh-root /dev initialization found by the clean-seed verifier; a regression failed before the fix and passes on host/UIKit.

  • Add the embedded native core, private per-workspace fakefs roots, explicit argv/cwd/env/stdin, binary streaming, exit status, bounded output and cancellation/reaping of descendants.

  • Add a local React Native module with process-wide job/journal/admission ownership across bridge reloads. Invalidating one generation cancels its own commands. Persistent stable command IDs prevent automatic replay; process restart marks unfinished commands interrupted.

  • Implement the real Pi file/shell contract, applicable environment conformance, and an explicitly unsafe bash tool that durably records its command ID before guest effects.

  • Enforce native task/file/backing-memory/transfer limits and bounded bridge admission. Document the finite 10,000-ID journal, file-transfer bounds and the absence of aggregate disk or total app-RSS quotas.

  • Keep the integration optional and iOS-only; preserve default Expo behavior, existing transcripts, credentials and unrelated workspaces. Checkpoint branches get separate roots rather than file snapshots.

  • Add reproducible source builds, controlled model-transport app smoke, native lifecycle regressions and licensing/source notices. Generated binaries/rootfs are not committed or published.

Validation (2026-10-23)

  • npm run verify passed: 237 tests, three Termux installer tests, typecheck, portable Pi/SQLite smoke, runtime generation, Android and iOS Hermes resource exports. The 29 real-core adapter tests are intentionally separate.
  • Actual host core tests, production Objective-C bridge regressions, and 33 Pi adapter/boundary tests passed (29 real-core cases plus four unit cases). The real-core suite includes all 24 applicable official Pi conformance cases and a 9 MiB shell-output spill. The standalone signed Termux service smoke also passed without model requests.
  • Fresh simulator configuration/integration verification on 2026-10-23 passed: default prepare:ish, rebuilt native client, installed source-manifest/rootfs checks, arm64 UIKit core/production-bridge lifecycle/resource/cancellation tests, all 33 host adapter tests, and the actual React Native/Hermes controlled Pi write/edit/bash/read smoke. See the simulator validation record in docs/ios-ish-setup-guide.md; physical-device/background/real-model flows remain unvalidated.
  • Actual Moose Debug native build and iPhone 17 Pro / iOS 26.2 simulator smoke passed: controlled OpenAI SSE → Pi write/edit/bash/read → real iSH, plus transcript/SQLite/file reopen, checkpoint isolation and traversal rejection.
  • Expo Doctor: 20/20 under the current project configuration. Upstream compiler/gadget-alignment and Xcode script warnings remain.

Remaining limits / draft status

Keep this PR draft for experimental native review and distribution decisions. Physical-device operation, signed device app/IPA, device suspension/foreground recovery and real-account/paid-model calls were not performed. iOS may suspend commands. The interpreter shares the app process and is not a separate VM; Linux syscall support is partial, the guest uses POSIX /bin/sh, and network access is disabled.

Before distributing any binary linking iSH, select a compatible whole-program license and supply the applicable complete corresponding app/kernel/package source and licenses. This PR neither publishes a binary nor establishes App Store approval. See docs/ios-ish-execution.md for reproducible commands, exact bounds and evidence.

@sugarforever sugarforever changed the title WIP: validate native iSH execution and expose embedding blockers feat: integrate optional native iSH Pi ExecutionEnv on iOS Oct 20, 2026
@sugarforever
sugarforever marked this pull request as ready for review October 23, 2026 00:53
@sugarforever
sugarforever merged commit 78eaeea into main Oct 23, 2026
1 check passed
@sugarforever
sugarforever deleted the codex/ios-ish-execution branch October 23, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support iOS iSH Linux execution through Pi Durable Environment

1 participant