On this page

Pointing a rift at your own frame๏ƒ

๐Ÿ”ต Expert ยท Lesson 11

AR ONTO YOUR OWN WORLD. Advanced 09 built a Rift and deliberately stopped short of targeting - it said so in its own text, because until 2026-08-03 the capability was genuinely unreachable from import melder. This is the lesson that finishes it.

THE CHAIN, AND EVERY LINK IS A REFUSAL POINT

  1. POSTURE book.configure_aether_frame(rift_enabled=True) 2. PUBLISH book.conjure() -> descriptor truth exists 3. ALLOW config.with_allowed_target_frame_names([...]) 4. ENABLE nexus.activate(config) -> the Rift domain is live 5. CREATE nexus.create_rift(...) -> a Rift with one room 6. ATTACH rift.create_frame_link(frame_name)

ATTACHMENT IS TWO-PARTY CONSENT, AND THAT IS THE WHOLE LESSON

Step 6 runs TWO INDEPENDENT GATES, owned by two different parties, in this order (Rift.create_frame_link):

A. THE OBSERVER'S POLICY Nexus._validate_target_frame_names denied_target_frame_names - deny is checked FIRST and wins allowed_target_frame_names - and it is NOT EMPTY by default

B. THE WORLD'S POSTURE _validate_target_frame_runtime_requirements rift_enabled=True on the target frame - ALWAYS ai_native_enabled on the target frame - codegen rooms system_state == dynamic - codegen rooms

NEITHER SIDE CAN GRANT ALONE. The Nexus says which worlds it may ever reach; the frame says whether it consents to being read. A perfectly postured frame that is not on the allow-list refuses, and an allow-listed frame with no posture refuses. Both refusals appear below, because seeing only one of them teaches half the model.

THE DEFAULT ALLOW-LIST IS ("default",) - NOT EMPTY That is the detail that surprises everyone, including whoever wrote the first draft of this lesson. An EMPTY allow-list would mean "no restriction" (the check is skipped when it is falsy). Melder ships a one-name list instead, so a fresh Nexus can target exactly one conventionally-named world and every other world must be named deliberately. Default-deny, expressed as data rather than as a flag.

AND IT ONLY GOVERNS FOREIGN WORLDS. Nexus-managed frames skip gate A entirely - a Nexus does not need to put itself on its own allow-list.

THERE IS ALSO A BUDGET, AND IT IS NEXUS-WIDE allow_multiple_target_frames default False max_target_frame_count default 1 Target frames are REF-COUNTED ACROSS RIFTS, so two rifts attaching two different worlds spend two of the budget, not one each. Attach a second world with the defaults in place and you get "Multiple target frames are disabled." - which is a budget refusal, not a policy one.

WHY rift_enabled DEFAULTS FALSE, AND SHOULD It is the frame's OPT-IN TO BEING OBSERVED. A world does not become inspectable because something else decided to look at it. You say so, once, before the frame settles - and after conjure the posture is frozen, so a world's observability is fixed for its whole life.

THE PART WORTH SITTING WITH Melder does not check permissions when the AR asks a question. It checks them when the AR ATTACHES, and then never again. Attachment is the authority boundary; everything after it is reading a world that already agreed to be read.

AND THE ORDER IS NOT NEGOTIABLE. Posture must precede conjure, because conjure freezes it. Conjure must precede attach, because attach requires descriptor truth. Get it wrong and you get a refusal that names which link broke, not a mysterious empty view.

Before you run๏ƒ

Use the Expert guide 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๏ƒ

python UX_and_AIX_experiences/04_expert/11_pointing_a_rift_at_your_own_frame.py
py -3.14t UX_and_AIX_experiences/04_expert/11_pointing_a_rift_at_your_own_frame.py

Download this collection ยท Source on GitHub

Public surface๏ƒ

configure_aether_frame(rift_enabled=..., ai_native=...), with_allowed_target_frame_names, with_multiple_target_frames, with_max_target_frame_count, Nexus.create_rift, Rift.create_frame_link, both gates

Code๏ƒ

  1"""
  2TIER: expert (11)
  3GOAL: AR ONTO YOUR OWN WORLD. Advanced 09 built a Rift and deliberately
  4      stopped short of targeting - it said so in its own text, because
  5      until 2026-08-03 the capability was genuinely unreachable from
  6      `import melder`. This is the lesson that finishes it.
  7
  8      THE CHAIN, AND EVERY LINK IS A REFUSAL POINT
  9
 10        1. POSTURE   book.configure_aether_frame(rift_enabled=True)
 11        2. PUBLISH   book.conjure()            -> descriptor truth exists
 12        3. ALLOW     config.with_allowed_target_frame_names([...])
 13        4. ENABLE    nexus.activate(config)    -> the Rift domain is live
 14        5. CREATE    nexus.create_rift(...)    -> a Rift with one room
 15        6. ATTACH    rift.create_frame_link(frame_name)
 16
 17      ATTACHMENT IS TWO-PARTY CONSENT, AND THAT IS THE WHOLE LESSON
 18
 19      Step 6 runs TWO INDEPENDENT GATES, owned by two different parties,
 20      in this order (`Rift.create_frame_link`):
 21
 22        A. THE OBSERVER'S POLICY  Nexus._validate_target_frame_names
 23             denied_target_frame_names   - deny is checked FIRST and wins
 24             allowed_target_frame_names  - and it is NOT EMPTY by default
 25
 26        B. THE WORLD'S POSTURE    _validate_target_frame_runtime_requirements
 27             rift_enabled=True   on the target frame      - ALWAYS
 28             ai_native_enabled   on the target frame      - codegen rooms
 29             system_state == dynamic                      - codegen rooms
 30
 31      NEITHER SIDE CAN GRANT ALONE. The Nexus says which worlds it may
 32      ever reach; the frame says whether it consents to being read. A
 33      perfectly postured frame that is not on the allow-list refuses, and
 34      an allow-listed frame with no posture refuses. Both refusals appear
 35      below, because seeing only one of them teaches half the model.
 36
 37      THE DEFAULT ALLOW-LIST IS `("default",)` - NOT EMPTY
 38      That is the detail that surprises everyone, including whoever wrote
 39      the first draft of this lesson. An EMPTY allow-list would mean "no
 40      restriction" (the check is skipped when it is falsy). Melder ships a
 41      one-name list instead, so a fresh Nexus can target exactly one
 42      conventionally-named world and every other world must be named
 43      deliberately. Default-deny, expressed as data rather than as a flag.
 44
 45      AND IT ONLY GOVERNS FOREIGN WORLDS. Nexus-managed frames skip gate A
 46      entirely - a Nexus does not need to put itself on its own allow-list.
 47
 48      THERE IS ALSO A BUDGET, AND IT IS NEXUS-WIDE
 49        allow_multiple_target_frames  default False
 50        max_target_frame_count        default 1
 51      Target frames are REF-COUNTED ACROSS RIFTS, so two rifts attaching
 52      two different worlds spend two of the budget, not one each. Attach a
 53      second world with the defaults in place and you get "Multiple target
 54      frames are disabled." - which is a budget refusal, not a policy one.
 55
 56      WHY rift_enabled DEFAULTS FALSE, AND SHOULD
 57      It is the frame's OPT-IN TO BEING OBSERVED. A world does not become
 58      inspectable because something else decided to look at it. You say
 59      so, once, before the frame settles - and after conjure the posture
 60      is frozen, so a world's observability is fixed for its whole life.
 61
 62      THE PART WORTH SITTING WITH
 63      Melder does not check permissions when the AR asks a question. It
 64      checks them when the AR ATTACHES, and then never again. Attachment
 65      is the authority boundary; everything after it is reading a world
 66      that already agreed to be read.
 67
 68      AND THE ORDER IS NOT NEGOTIABLE. Posture must precede conjure,
 69      because conjure freezes it. Conjure must precede attach, because
 70      attach requires descriptor truth. Get it wrong and you get a
 71      refusal that names which link broke, not a mysterious empty view.
 72SURFACE EXERCISED: configure_aether_frame(rift_enabled=..., ai_native=...),
 73                   with_allowed_target_frame_names,
 74                   with_multiple_target_frames, with_max_target_frame_count,
 75                   Nexus.create_rift, Rift.create_frame_link, both gates
 76VERIFY: RUN GREEN 2026-08-03 on the owner's 3.14t harness.
 77"""
 78import melder as md
 79
 80
 81class Ledger:
 82    pass
 83
 84
 85def _postured_frame(frame_name: str, *, dynamic: bool = False) -> None:
 86    """Build one frame with the posture AR needs, then settle it."""
 87    book = md.Spellbook(aetheric_frame=frame_name)
 88    # binding_name keeps the spell_id distinct per frame - identity is
 89    # process-wide and the frame is not in the fingerprint (advanced 02).
 90    book.bind(spell=Ledger, existence="unique", binding_name=frame_name)
 91    if dynamic:
 92        book.configure_aether_frame(
 93            system_state="dynamic",
 94            disposal=None,
 95            disposal_method_names=None,
 96            rift_enabled=True,
 97            ai_native=True,
 98        )
 99    else:
100        book.configure_aether_frame(
101            system_state=None,
102            disposal=None,
103            disposal_method_names=None,
104            rift_enabled=True,
105        )
106    # Conjure PUBLISHES the descriptor and FREEZES the posture. Both are
107    # preconditions for attachment, and both happen here.
108    book.conjure(name=f"{frame_name}-root")
109
110
111def main() -> None:
112    # A frame that never opted in. This is the default, on purpose.
113    closed = md.Spellbook(aetheric_frame="closed-world")
114    closed.bind(spell=Ledger, existence="unique", binding_name="closed-world")
115    closed.conjure(name="closed-root")
116
117    # ...and three that did. 'unlisted' is postured EXACTLY like
118    # 'observable' - the only thing that will differ is the Nexus's own
119    # policy, which is how we isolate gate A from gate B.
120    _postured_frame("observable")
121    _postured_frame("unlisted")
122    _postured_frame("workshop", dynamic=True)
123    print("four frames: one default, two rift-enabled, one AI-native")
124
125    # The Rift domain has to be live before any of this matters - and the
126    # NEXUS has to be told which worlds it may reach. The shipped
127    # allow-list is ("default",), so every frame here is foreign to it.
128    nexus = md.Nexus()
129    system_configuration = nexus.create_configuration()
130    system_configuration.with_rift_creation_enabled(True)
131    system_configuration.with_allowed_target_frame_names(
132        ["observable", "workshop", "closed-world"],
133    )
134    # Two worlds get attached below, and the budget is NEXUS-WIDE.
135    system_configuration.with_multiple_target_frames(True)
136    system_configuration.with_max_target_frame_count(4)
137    nexus.activate(system_configuration)
138    assert nexus.is_activated is True
139    print("nexus activated; allow-list names 3 of the 4 worlds")
140
141    # A capability room, then ATTACH it to the world that opted in AND is
142    # named by the observer's policy. Both parties agreed.
143    rift_configuration = nexus.create_rift_configuration()
144    rift_configuration.with_space_type("capability")
145    rift = nexus.create_rift(configuration=rift_configuration,
146                             rift_name="observer")
147    rift.mark_active()
148    rift.create_frame_link("observable")
149    print()
150    print("attached: a capability rift now targets 'observable'")
151
152    # GATE A - THE OBSERVER SAID NO. 'unlisted' is postured identically to
153    # 'observable'; the only difference is that the Nexus never named it.
154    # The frame's consent is irrelevant here, and note WHICH gate answers:
155    # policy is checked BEFORE posture is ever consulted.
156    try:
157        rift.create_frame_link("unlisted")
158        raise AssertionError("expected a refusal: not on the allow-list")
159    except ValueError as error:
160        assert "not allowed by Nexus policy" in str(error)
161        print("refused 'unlisted' -", error)
162        print("  same posture as 'observable' - the OBSERVER refused it")
163
164    # GATE B - THE WORLD SAID NO. 'closed-world' IS on the allow-list, so
165    # policy passes and the posture gate answers instead. Opposite party,
166    # opposite reason, and the message names which.
167    try:
168        rift.create_frame_link("closed-world")
169        raise AssertionError("expected a refusal: rift_enabled is False")
170    except ValueError as error:
171        assert "rift_enabled" in str(error)
172        print("refused 'closed-world' -", error)
173        print("  allow-listed, but never opted in - the WORLD refused it")
174
175    # A CODEGEN room raises the bar twice more: ai_native AND dynamic.
176    codegen_configuration = nexus.create_rift_configuration()
177    codegen_configuration.with_space_type("codegen")
178    codegen_rift = nexus.create_rift(configuration=codegen_configuration,
179                                     rift_name="maker")
180    codegen_rift.mark_active()
181
182    # 'observable' is rift-enabled but NOT ai-native, so codegen refuses it
183    # while capability accepted it. Same frame, different room, different
184    # answer - the posture is read against what the room can DO.
185    try:
186        codegen_rift.create_frame_link("observable")
187        raise AssertionError("expected a refusal: codegen needs ai_native")
188    except ValueError as error:
189        print()
190        print("codegen refused 'observable' -", error)
191
192    codegen_rift.create_frame_link("workshop")
193    print("codegen attached to 'workshop', which is dynamic AND ai-native")
194
195    # THE BUDGET IS NEXUS-WIDE, NOT PER RIFT. Two rifts, two different
196    # worlds, and they spent TWO of max_target_frame_count between them -
197    # which is why this lesson had to raise the cap from its default of 1
198    # even though no single rift targets more than one world.
199    print()
200    print("two rifts hold two target frames; the cap is shared, not")
201    print("per-rift - target frames are ref-counted across the Nexus")
202
203    print()
204    print("attachment is the authority boundary - checked once, there")
205    print("a frame is observable because IT said so, before it settled")
206    print("and reachable because the OBSERVER said so - both, or neither")
207
208
209if __name__ == "__main__":
210    main()

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 ยท Level guide

API contracts๏ƒ