Repository navigation
iOS: load deployed BEAMs from numbered, committed directories (MOB-408) - #207
Merged
Merged
Conversation
mob_beam.m loaded a physical iPhone's deployed BEAMs from Documents/otp/<app> whenever it existed, so mob_dev had to replace that directory in place, with devicectl --remove-existing-content, which empties the app's whole data container; and a copy that died part-way left an override the app could not boot from. ios/mob_code_versions.h (header-only, run by test/native/code_versions_test.c): load the highest Documents/otp/<app>.versions/<N> that has its .mob_complete marker, else the legacy Documents/otp/<app>, else the bundle. Having chosen a version, delete the lower-numbered ones (marker first) and the legacy dir; keep higher uncommitted ones (a deploy may be in progress). Development builds create <app>.versions/ at boot, which is how mob_dev knows the runtime reads it. Decision: decisions/2026-10-15-ios-versioned-code-dirs.md.
…8 review) Review: the decision record claimed a downgrade was always caught and called the --native run's own push 'the first deploy after'. Say that moving mob across 0.9.20 without --native needs --native (mob_dev's boot check reports it), list every legacy writer in the header, note that concurrent deploys can pick the same N.
mob_dev waits for mob_diag_beams_dir.txt after relaunching; write it as soon as the choice is final rather than after deleting old versions. CHANGELOG: the boot check runs when mob_dev relaunches the app. Rewrap the decision record.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MOB-408, runtime half. Pairs with GenericJam/mob_dev#142 (deployer half, mob_dev 0.7.28).
Problem
mob_beam.mloaded a physical iPhone's deployed BEAMs fromDocuments/otp/<app>whenever that directory existed. mob_dev had to replace it in place withdevicectl --remove-existing-content, which empties the app's whole data container (measured on an iPhone SE, devicectl 642.16, iOS 26.5.2: Documents, the SQLite DB, Library and tmp all gone), and an interrupted copy left an override the app couldn't boot from.Change
ios/mob_code_versions.h(header-only C, run bytest/native/code_versions_test.c):Documents/otp/<app>.versions/<N>that has its.mob_completemarker (mob_dev copies the marker only after the upload is verified), else the legacyDocuments/otp/<app>, else the bundle;N, delete lowerNs (marker first) and the legacy dir; keep higher uncommitted ones (may be a deploy in progress);<app>.versions/at each boot, which tells mob_dev the runtime reads the layout.Decision:
decisions/2026-10-15-ios-versioned-code-dirs.md(and an amendment to2026-10-01-ios-dist-cookie-file.md). CI's native_lint lists the new header and test.Verification
make -C test/native run:code_versions_test: ok; a mutation that ignores the marker, one that GCsN == keeponly, and one that dropsFTW_PHYSeach fail it.d408on this branch + the mob_dev branch: sentinels (Documents file, SQLite row, nested dir, Library file, a sibling inDocuments/otp) survived ~16 deploys; versions 1→12 loaded and older ones deleted; a deploy whose devicectl copy was killed mid-upload (382 of 448 entries) and one whosemixwas killed both left the previous version booting; the next deploy removed the partial dirs. A--nativedowngrade to mob 0.9.19 then deploys into the legacy dir without wiping anything.Review
Codex rate-limited (until 17:26) → reviewer subagent: MERGE (no blocking; doc claims fixed in d7df5c1; the cross-version should-fix is handled by mob_dev's boot check). Re-review: see comment below.