# A world that outlives its own runtime **🔵 Expert · Lesson 27** TEAR THE RUNTIME DOWN ON PURPOSE, THEN COME BACK. Expert 24 walked the five checkpoint verbs while the world stayed up. This is the harder half: seal a world, DESTROY the Aether singleton, collect the garbage, and unfold the record into a runtime that has never seen it. THE ONE FACT THE WHOLE LESSON TURNS ON Ledger -> in-process, dies with the singleton Cache -> bytes at rest, survives it `create_checkpoint()` mints into the LEDGER. That is memory. Tear the root down without flushing and the checkpoint goes with it - nothing to come back to and NO ERROR to tell you so, because nothing went wrong. `flush_checkpoint(id)` is what makes a record outlive the process. THE TEARDOWN IS PUBLIC, AND IDENTITY-CHECKED aether.cleanup() Singleton bookkeeping is cleared in a `finally` - `_instance` and `_initialized` - so it resets even when a child teardown raises. Before that `finally` existed, one failing child left a CLEANED HUSK installed as the process singleton for the rest of the run. `cleanup()` IS the reset; the private `_reset_singleton_for_tests` beside it is for test isolation, and nothing below reaches for it. `gc.collect()` here is real work, not ceremony: melder cleans deterministically rather than leaving owned objects to the collector, so a collect is how the old world is PROVEN gone. AND THE LAST RUNG DEMANDS A COMPLETE BUNDLE Unfolding into a virgin runtime is the strictest act here and the one that can refuse. `load_checkpoint` is MEDIATED: the folded chain PRE-FLIGHTS before any replay, and a `blockers` verdict refuses at the one seam owning authoritative folded truth. A refusal ends "nothing was built" - all-or-nothing declining to START rather than half-building a world and unwinding it. THE CHAIN COMES FROM THE LEDGER, which is the part worth knowing. `plan_checkpoint_load` detaches the target's SAME-PROFILE CHAIN in creation order, not the single id you named. After a teardown the fresh ledger is empty and `reload_cached_checkpoint` restores only the id you ask for - so a world sealed across SEVERAL checkpoints and partially reloaded folds an INCOMPLETE chain and refuses exactly as a corrupt one would. Seal more than once and you want `flush_checkpoint()` with NO argument, then every id back. ## Before you run Use the [Expert guide](../../expert/index.md) for prerequisite concepts. Run from a checkout with Melder installed and Python 3.14 free-threading selected. The collection download includes the level's local helper modules. ## Run the saved script ```bash python UX_and_AIX_experiences/04_expert/27_a_world_that_outlives_its_own_runtime.py ``` ```powershell py -3.14t UX_and_AIX_experiences/04_expert/27_a_world_that_outlives_its_own_runtime.py ``` {download}`Download this collection <../../downloads/expert-examples.zip>` · [Source on GitHub](https://github.com/Synaptic724/melder/blob/90d52e0a12cb0743d62568d5a19ce954a54443bc/UX_and_AIX_experiences/04_expert/27_a_world_that_outlives_its_own_runtime.py) ## Public surface md.Crystallizer create_checkpoint / flush_checkpoint / list_checkpoint_ids / list_cached_checkpoint_ids / reload_cached_checkpoint / load_checkpoint, md.Aether cleanup, and the codegen room's validate_codegen / execute_codegen / materialize_codegen across the boundary ## Code ```{literalinclude} ../../downloads/04_expert/27_a_world_that_outlives_its_own_runtime.py :language: python :linenos: ``` ## Check the outcome The script contains its own assertions or demonstrated refusal paths. Run it to evaluate those checks against your installed version. The code above is taken directly from the saved file; no run output is invented here. [More expert examples](index.md) · [Level guide](../../expert/index.md) ## Related guides - [Restore and cold boot](../../expert/restore.md) - [Complete operational walkthroughs](../../expert/walkthroughs.md) ## API contracts - [Aether](../../reference/api/configuration/aether.md) - [Crystallizer](../../reference/api/persistence/crystallizer.md)