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
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
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
85class ClosedLedger(Ledger):
86 """closed-world's own Ledger - a new class, so its own spell_id."""
87
88
89class ObservableLedger(Ledger):
90 """observable's own Ledger - a new class, so its own spell_id."""
91
92
93class UnlistedLedger(Ledger):
94 """unlisted's own Ledger - a new class, so its own spell_id."""
95
96
97class WorkshopLedger(Ledger):
98 """workshop's own Ledger - a new class, so its own spell_id."""
99
100
101def _postured_frame(frame_name: str, spell: type[Ledger], *,
102 dynamic: bool = False) -> None:
103 """Build one frame with the posture AR needs, bind that frame's own
104 Ledger class in it, then settle it."""
105 book = md.Spellbook(aetheric_frame=frame_name)
106 # Each frame binds its OWN Ledger class: a spell_id is the SHA256 of
107 # the class's code, with neither the frame nor the binding_name in
108 # it, so one class bound in two frames is refused (advanced 02).
109 book.bind(spell=spell, existence="unique", binding_name=frame_name)
110 if dynamic:
111 book.configure_aether_frame(
112 system_state="dynamic",
113 disposal=None,
114 disposal_method_names=None,
115 rift_enabled=True,
116 ai_native=True,
117 )
118 else:
119 book.configure_aether_frame(
120 system_state=None,
121 disposal=None,
122 disposal_method_names=None,
123 rift_enabled=True,
124 )
125 # Conjure PUBLISHES the descriptor and FREEZES the posture. Both are
126 # preconditions for attachment, and both happen here.
127 book.conjure(name=f"{frame_name}-root")
128
129
130def main() -> None:
131 # A frame that never opted in. This is the default, on purpose.
132 closed = md.Spellbook(aetheric_frame="closed-world")
133 closed.bind(spell=ClosedLedger, existence="unique",
134 binding_name="closed-world")
135 closed.conjure(name="closed-root")
136
137 # ...and three that did. 'unlisted' is postured EXACTLY like
138 # 'observable' - the only thing that will differ is the Nexus's own
139 # policy, which is how we isolate gate A from gate B.
140 _postured_frame("observable", ObservableLedger)
141 _postured_frame("unlisted", UnlistedLedger)
142 _postured_frame("workshop", WorkshopLedger, dynamic=True)
143 print("four frames: one default, two rift-enabled, one AI-native")
144
145 # The Rift domain has to be live before any of this matters - and the
146 # NEXUS has to be told which worlds it may reach. The shipped
147 # allow-list is ("default",), so every frame here is foreign to it.
148 nexus = md.Nexus()
149 system_configuration = nexus.create_configuration()
150 system_configuration.with_rift_creation_enabled(True)
151 system_configuration.with_allowed_target_frame_names(
152 ["observable", "workshop", "closed-world"],
153 )
154 # Two worlds get attached below, and the budget is NEXUS-WIDE.
155 system_configuration.with_multiple_target_frames(True)
156 system_configuration.with_max_target_frame_count(4)
157 nexus.activate(system_configuration)
158 assert nexus.is_activated is True
159 print("nexus activated; allow-list names 3 of the 4 worlds")
160
161 # A capability room, then ATTACH it to the world that opted in AND is
162 # named by the observer's policy. Both parties agreed.
163 rift_configuration = nexus.create_rift_configuration()
164 rift_configuration.with_space_type("capability")
165 rift = nexus.create_rift(configuration=rift_configuration,
166 rift_name="observer")
167 rift.mark_active()
168 rift.create_frame_link("observable")
169 print()
170 print("attached: a capability rift now targets 'observable'")
171
172 # GATE A - THE OBSERVER SAID NO. 'unlisted' is postured identically to
173 # 'observable'; the only difference is that the Nexus never named it.
174 # The frame's consent is irrelevant here, and note WHICH gate answers:
175 # policy is checked BEFORE posture is ever consulted.
176 try:
177 rift.create_frame_link("unlisted")
178 raise AssertionError("expected a refusal: not on the allow-list")
179 except ValueError as error:
180 assert "not allowed by Nexus policy" in str(error)
181 print("refused 'unlisted' -", error)
182 print(" same posture as 'observable' - the OBSERVER refused it")
183
184 # GATE B - THE WORLD SAID NO. 'closed-world' IS on the allow-list, so
185 # policy passes and the posture gate answers instead. Opposite party,
186 # opposite reason, and the message names which.
187 try:
188 rift.create_frame_link("closed-world")
189 raise AssertionError("expected a refusal: rift_enabled is False")
190 except ValueError as error:
191 assert "rift_enabled" in str(error)
192 print("refused 'closed-world' -", error)
193 print(" allow-listed, but never opted in - the WORLD refused it")
194
195 # A CODEGEN room raises the bar twice more: ai_native AND dynamic.
196 codegen_configuration = nexus.create_rift_configuration()
197 codegen_configuration.with_space_type("codegen")
198 codegen_rift = nexus.create_rift(configuration=codegen_configuration,
199 rift_name="maker")
200 codegen_rift.mark_active()
201
202 # 'observable' is rift-enabled but NOT ai-native, so codegen refuses it
203 # while capability accepted it. Same frame, different room, different
204 # answer - the posture is read against what the room can DO.
205 try:
206 codegen_rift.create_frame_link("observable")
207 raise AssertionError("expected a refusal: codegen needs ai_native")
208 except ValueError as error:
209 print()
210 print("codegen refused 'observable' -", error)
211
212 codegen_rift.create_frame_link("workshop")
213 print("codegen attached to 'workshop', which is dynamic AND ai-native")
214
215 # THE BUDGET IS NEXUS-WIDE, NOT PER RIFT. Two rifts, two different
216 # worlds, and they spent TWO of max_target_frame_count between them -
217 # which is why this lesson had to raise the cap from its default of 1
218 # even though no single rift targets more than one world.
219 print()
220 print("two rifts hold two target frames; the cap is shared, not")
221 print("per-rift - target frames are ref-counted across the Nexus")
222
223 print()
224 print("attachment is the authority boundary - checked once, there")
225 print("a frame is observable because IT said so, before it settled")
226 print("and reachable because the OBSERVER said so - both, or neither")
227
228
229if __name__ == "__main__":
230 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.