On this page

Restore and cold boot๏ƒ

Prerequisite: persistence and custody. Keep the record operations separate from rebuilding a runtime:

  1. create_checkpoint records the checkpoint in the in-process ledger.

  2. flush_checkpoint seals it to the local cache.

  3. reload_cached_checkpoint brings cached record data back into the ledger.

  4. load_checkpoint attempts to rebuild the selected world through its public operations.

Inspect the report๏ƒ

A restore report carries status, built counts, shortfalls, and identity translation. Runtime identities are rebuilt; the translation information connects recorded and new identities. The separate research-record JSON lesson preserves the identity of the record it hydrates. Those are different contracts.

Preflight can refuse an incomplete chain before construction. Preserve the full required profile chain when preparing a cold start; reloading a single checkpoint does not imply every predecessor has been reloaded.

Restore named lesser structure๏ƒ

Run Named scopes in Nexus and restore for a successful replay with assertions. It records a named job beneath an unnamed parent, tears down the live roots and restores from the retained in-memory checkpoint. This is different from a process restart, which also needs the flush/reload steps above.

Dynamic named scopes carry their name, parent and root relationships. Required unnamed ancestry is saved as supporting values inside named records. Restoring rebuilds one shared Book/root and its children in parent order with fresh IDs; unnamed support stays outside Cloud discovery. Scope names do not restore the mutable contents of previously created objects. A later meld creates fresh state.

Released names disappear from later checkpoints while earlier sealed checkpoints retain their earlier structure. Formations rooted at a named lesser include its required ancestry and selected subtree. Record schema 3.0.0 makes older root-only readers refuse safely; valid older root-only records remain readable.

Quiesce ordinary lesser/SpellSpace creation, cleanup and lineage changes during live restore. Transaction load authority does not drain those pool cycles.

Follow both demonstrations๏ƒ

Expert 24 keeps the recorder alive and retires the original root before rebuilding it. Expert 27 flushes, tears down the root, creates a new runtime, and reads the cache again. The latter deliberately reports an admission refusal if the bundle is incomplete. A script finishing successfully therefore does not, on its own, prove a complete world was restored. Read the reported status, built resources, and shortfalls.

CrystallizerBootstrap packages the restart sequence into a one-shot operation: activate, attach configured storage, reload, verify, load, report. Its empty-history case differs from a broken chain. Use the pod-boot lesson for its complete setup.

The workflow in code๏ƒ

These are the core steps from the saved example. Use its complete linked script for all class definitions and setup.

 1def main() -> None:
 2    """Capture a live named hierarchy, retire it and rebuild fresh structural identities.
 3
 4    Contract:
 5        Single-threaded: no scope acquisition/return races with load_checkpoint.
 6        The recorder remains alive, so this demonstrates in-memory replay; flush
 7        and reload are required when crossing process teardown instead.
 8    Returns:
 9        None.
10    """
11    recorder = md.Crystallizer()
12    recorder.activate(md.CrystallizerConfigurationBuilder().with_defaults().activate())
13    nexus = md.Nexus()
14    nexus_configuration = nexus.create_configuration()
15    nexus_configuration.with_rift_creation_enabled(True)
16    nexus_configuration.with_allowed_target_frame_names(["named-jobs"])
17    nexus.activate(nexus_configuration)
18
19    configuration = md.SpellbookConfiguration("named-jobs").with_defaults().finalize()
20    book = md.Spellbook(aetheric_frame="named-jobs", configuration=configuration)
21    book.configure_aether_frame(
22        system_state="dynamic", disposal=None, disposal_method_names=None,
23        rift_enabled=True, ai_native=True,
24    )
25    book.bind(spell=JobNotebook, existence="unique_per_conduit", permissions="create")
26    root = book.conjure(name="job-owner")
27    observer = open_observer("before-restore")
28    try:
29        commands = observer.space.command_system
30        job = commands.create_lesser_conduit(root.id, frame_name="named-jobs", name="job-42")
31        observer.refresh_runtime_projections(frame_names=("named-jobs",))
32        assert commands.get_conduit_by_name("job-42", frame_name="named-jobs") is job
33        print("The capability command creates a named job; explicit refresh admits its new ID.")
34
35        job.cleanup()
36        assert "job-42" not in commands.list_conduit_names(frame_name="named-jobs")
37        next_job = commands.create_lesser_conduit(root.id, frame_name="named-jobs", name="job-43")
38        assert commands.get_conduit_by_name("job-43", frame_name="named-jobs") is next_job
39        print("Named reuse updates the existing ID's descriptor without an in-command refresh.")
40
41        support = root.create_lesser_conduit()
42        nested = support.create_lesser_conduit(name="nested-job")
43        original_id, support_id = nested.id, support.id
44        original = nested.meld("JobNotebook")
45        original.notes.append("not part of the structural record")
46        observer.refresh_runtime_projections(frame_names=("named-jobs",))
47        checkpoint = recorder.create_checkpoint()
48        print("Checkpoint captured names and unnamed supporting ancestry, not notebook contents.")
49    finally:
50        observer.cleanup()
51        root.permanent_cleanup()
52
53    report = recorder.load_checkpoint(checkpoint)
54    assert report["status"] == "complete"
55    cloud = md.Aether().get_conduit_cloud("named-jobs")
56    restored_root = cloud.get_conduit_by_name("job-owner")
57    restored = cloud.get_conduit_by_name("nested-job")
58    restored_observer = open_observer("after-restore")
59    try:
60        assert restored.id != original_id
61        assert report["identity_map"][original_id] == restored.id
62        assert support_id in report["identity_map"]
63        assert not cloud.has_conduit_id(report["identity_map"][support_id])
64        assert restored.meld("JobNotebook").notes == []
65        assert restored_observer.space.command_system.get_conduit_by_name(
66            "nested-job", frame_name="named-jobs",
67        ) is restored
68        print("Restore rebuilt named scopes with fresh IDs and retained the unnamed ancestor.")
69        print("A new meld creates an empty notebook; earlier application data is not restored.")
70    finally:
71        restored_observer.cleanup()
72        restored_root.permanent_cleanup()

Runnable examples๏ƒ

All expert examples ยท Level contents ยท Full contents

Canonical page source