On this page

Named conduits, ownership transfer, and severing๏ƒ

Prerequisite: links and permissions. Names make dynamic conduits discoverable through their frame's cloud. They also make a useful application vocabulary: platform, services, and workflows can identify independently owned parts of a system.

Find the owner๏ƒ

The cloud lessons show lookup of already-created named conduits. Choose a distinct name for each root in the same frame. A fresh root still comes from a fresh book; lookup does not create a second root for an existing book.

Transfer stewardship๏ƒ

transfer_spell_ownership(...) moves stewardship to the target conduit and returns a report. The saved lesson requests move_creations=True, inspects the report, and resolves from the new home. Read that report when diagnosing a transfer; sharing and moving ownership have different lifecycle consequences.

End the relationship๏ƒ

sever_link(...) removes the relationship and the contracts carried by it. The sever lesson attempts another borrower meld, then checks the owner's live object. This distinguishes the borrower's resolution rights from the owner's retained creation. Application references you already hold still need their own lifecycle policy.

Finish with the connected-subsystem walkthrough.

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    source_book = dynamic_spellbook()
 3    spell_id = source_book.bind(spell=MigratingService, existence="unique")
 4    source = source_book.conjure(dynamic=True, name="old-home")
 5    target = dynamic_spellbook().conjure(dynamic=True, name="new-home")
 6    source.link(target)
 7
 8    report = source.transfer_spell_ownership(
 9        spell=spell_id, target_conduit=target, move_creations=True,
10    )
11
12    # THE PREFLIGHT SUMMARY IS THE POINT. Ownership moving is not a silent
13    # side effect - it hands back an auditable report of what it did.
14    assert isinstance(report, dict) and report, report
15    print("transfer report keys:", sorted(report))
16
17    # THE NEW HOME CAN MELD IT.
18    moved = target.meld(spell=MigratingService)
19    assert isinstance(moved, MigratingService)
20    print("new home melds it:", type(moved).__name__)
21
22    # AND THE OLD HOME CANNOT. This is the assertion that makes it a
23    # TRANSFER rather than a share - if the source could still meld it,
24    # ownership would have been copied, not moved.
25    try:
26        source.meld(spell=MigratingService)
27        raise AssertionError(
28            "the source still melds it - that is sharing, not transfer"
29        )
30    except Exception as gone:
31        print("old home refused -", type(gone).__name__, ":",
32              str(gone)[:70])
33        print("  stewardship MOVED. A copy would have left both able to")
34        print("  meld, and then `ownership` would mean nothing")

Runnable examples๏ƒ

All intermediate examples ยท Level contents ยท Full contents

Canonical page source