Upstream: crates/rune/README.md § Compatible edits and restart boundaries at 65f8eb43f710, MIT © Anomaly. Bundled by build-rune-apps; links point at this snapshot or at GitHub at that rev.

Compatible edits and restart boundaries

The launcher validates Rust syntax, then copies compatible edits into a private compiler mirror. It accepts function-body changes in Settings' main.rs. Use stable keys to preserve node identity.

Restart needed is printed before publishing changes to state/type declarations, function signatures, imports, constants, const-fn bodies, impl methods, startup code, dependencies, assets or framework code. This catches same-size field/type changes too; size_of alone cannot. Syntax errors stay outside the mirror until fixed. Stop and rerun the command after an incompatible change (--local and scripts/rune-hot rebuild and relaunch on their own). State is not migrated across restarts. Function attributes other than doc, inline, cold and allow also keep the whole body in the restart contract, since attribute macros can generate persistent types.

Keep persistent state in AppSpec::init's returned value. Tip-crate statics and thread locals can reset after any patch; use them only for disposable caches. Do not retain view-owned trait objects in app state. Rune replaces its event-handler trait objects at the patch boundary. Arbitrary cached vtables, background callbacks and initializer edits do not hot-reload. Use this launcher, not raw dx serve, to keep the source guard. poll and on_key go through the patch table each call, like the view. setup runs once at startup, so edits to it, and to helpers only it calls, take effect after a restart.

If a patched view panics, in any window or overlay, Rune logs it and renders the original startup view against the retained state, discarding the failed view's context changes and memo cache. A panicking patched poll or on_key falls back to the startup callback the same way, keeping whatever it changed before the panic. A later patch is still attempted. Handler-closure panics are not caught; neither are panics in the original fallbacks. This recovery requires Rust's unwinding panic mode and does not undo interior-mutability side effects performed by a view before it panics. Physical iOS devices are unsupported by this backend.