# Learn by running examples The example curriculum lives alongside Melder's source, organized into the same four levels: Beginner, Intermediate, Advanced, and Expert. ## Your first working graph [Hello Melder](hello-melder.md) binds one ordinary class, conjures a conduit, and resolves an instance. The page displays the actual saved script. ## Choose a level | Level | Focus | | --- | --- | | [🟢 Beginner](../beginner/index.md) | First graph, addresses, lifetimes, scopes, cleanup | | [🟡 Intermediate](../intermediate/index.md) | Configuration and connected subsystems | | [🟠Advanced](../advanced/index.md) | Isolated worlds, inspection, precise targeting | | [🔵 Expert](../expert/index.md) | Agent operations, persistence, research, governed change | Run saved scripts from a checkout with Melder installed and the supported free-threaded interpreter selected. Keep accompanying helper files with any lesson that imports them. ## All 133 saved examples
133 examples
The sixty-second first contact - bind one class, conjure a conduit, meld an instance. The whole DGR in four lines.
The one decision every binding makes - where does instance reuse stop? unique = one shared instance; many = fresh construction per meld. This is Existence, the heart of the bind vocabulary.
Spells are not only classes - functions and ready-made objects bind with the same verb. RUNTIME LAW (proven by the harness): callable and pre-built spells are always "unique" - the factory…
Two implementations of one shape, told apart by binding_name - the beginner door into disambiguation (spellframes come later).
Scopes without ceremony - a lesser conduit is a child resolution scope; unique_per_conduit gives each scope its own instance while plain unique stays shared across the family.
Failing well on day one - every exception melder raises at you is catchable from the root namespace. No internal paths, ever.
The vocabulary enums all accept their string names too - config files and CLI flags can drive registration without importing the enums. Both spellings resolve to the same lifecycles.
Teardown is part of registration - disposal_method_names tells melder which methods to call on YOUR instances when their owner cleans up. No base class, no protocol: name the method, done.…
Spellframes are the grouping key above binding names - one frame key collects a family of related bindings, and (spellframe, binding_name) is the full lookup address.
Teardown is a verb you own - conduit.cleanup() then book.cleanup(), in that order, and a cleaned book refuses further work loudly. (Disposal hooks you registered fire during this walk - see…
Registration is just Python - bind a whole list of classes with a plain loop. No special batch API needed, ever.
An agent's first sixty seconds with melder: read the workflow map from help(), read the version, then open the hardcopy system docs the package carries about itself. No filesystem, no web -…
unique, studied closely - ONE instance for the whole world: root conduit, child scopes, everywhere. The widest sharing mode.
many, studied closely - construction EVERY meld, no caching anywhere. The mode for request-shaped, disposable things.
unique_per_conduit - each conduit scope holds its OWN single instance; stable inside the scope, separate across scopes.
Type hints and melding are friends - annotate what you meld and your editor (and your agent) knows every attribute from there on. melder ships py.typed, so checkers see real types, not Any.
Protocols describe a SHAPE; bindings fill it - two implementations of one Protocol, chosen by binding name, called through the shared shape. Static duck typing meets dependency injection,…
The composition root - ONE function that binds the whole world and hands back the conduit. Configured things are BUILT there and bound as instances; everything else in the app just melds.…
The whole beginner lifecycle vocabulary on one page. Three modes answer one question - where does instance reuse stop? - and three is enough to build real things. (Three more exist for…
Your constructor defaults ARE the configuration - a class with default arguments melds without any extra setup. melder calls YOUR __init__; Python fills the defaults.
The rhythm of every melder program: bind everything FIRST, conjure ONCE, meld everywhere after. Three verbs, one order.
binding_name is a SUB-key - the same name under two different frames is two different addresses. (frame, name) is always the full address; names never collide across frames.
The three mistakes everyone makes in hour one, and what melder says back. Learn the error shapes once and debugging is easy.
One spell name, one visible spell - CURRENT RUNTIME TRUTH (probe- proven): conjure refuses ANY two spells sharing a name, even across frames, even with different internals. The working…
Spellframes are CATEGORIES. Organize one world's spells by the resolution ideas your app already has - "repositories", "notifiers" - and (category, name) becomes the full address. The…
THE ADDRESS LAW (run-proven + doc-canon): every spell lives at one (frame_key, binding_key) address - frame_key is your spellframe, or the spell's normalized name if you gave none;…
App structure 101 - main() owns the conduit and PASSES it to the functions that need things. Don't re-conjure, don't stash globals: the conduit is the world handle, hand it around like one.
Melded objects are YOUR objects - no proxies, no wrappers, no magic subclasses. What comes back IS the instance: identity checks hold, isinstance holds, and it works everywhere a plain…
"many" means ISOLATED - each melded instance owns its own state; mutating one never leaks into the next. The confusion this example prevents: expecting fresh objects to share anything.
Binding the SAME class twice is refused - spells are content-fingerprinted and one fingerprint registers once. When one shape must serve two roles, make two shapes: subclass it (see 24).
existence is not optional - the bind vocabulary is explicit by design. Forgetting it fails LOUDLY at bind time, not quietly at meld time. The error type is printed for the record.
Two factory shapes, one law each - a FUNCTION spell is unique (one shared product); when you want a fresh object per meld, the factory must be a CLASS bound "many".
A registry of ready-made same-typed objects. Spell names must be unique per book (probe-proven), so N instances of one class bind as ONE registry spell - the dict is the spell, lookup stays…
unique vs unique_per_conduit in the SAME conduit tree - the side-by-side that makes scope reach click.
disposal_method_names takes a LIST - complex resources name every teardown verb they need, and the printed order documents how the runtime walks them.
One book conjures ONE conduit, ever (probe-proven: a second conjure raises RuntimeError). Multiple scopes come from lesser conduits; multiple roots come from multiple books.
The whole bind vocabulary on one page - every kwarg a beginner will meet, printed as a cheatsheet next to a registration that uses ALL of them at once.
Closing the dict-style loop - a small helper melds a whole frame family into a plain {name: instance} dict, because the (frame, name) address space maps 1:1 onto the dicts users already…
An agent classifying the library itself - walk md.__all__ and sort every name into callable vocabulary vs types vs errors vs metadata, producing the machine-readable inventory an agent…
Build and use a small application across separate Python modules: ordinary objects, one bootstrap, a TYPE_CHECKING consumer, constructor injection, shared resources, fresh handlers, and…
YOU own the memory now - not the GC. A DI runtime HOLDS what it builds: your `unique` instance lives in the conduit's creations store, so dropping YOUR variable frees nothing - Python's…
Declarative binding - tag classes where they live with @md.scan_bind, then register the whole module in one scan() call. The decorator stores intent only; nothing binds until scan time.
Every link in the fluent chain, one binder reused across registrations: existence (explicit and shorthand), permissions, spellframe grouping, binding names, and constructor kwargs.
Hooks ride the registration, not the call site - pre, activation, and post hooks attach through the fluent chain and fire around instance creation. The printed order IS the documentation;…
Spellspaces are entered resolution rooms - one conduit can open many, and unique_per_spell_space pins one instance per room: stable inside a space, separate across spaces.
unique_per_conduit_lineage - one instance per FAMILY: the root and every lesser descendant share the same object. A second family would need its own book (one book conjures ONE root -…
Spell metadata via bind kwargs (landed 2026-07-19): any extra keyword on bind() threads into the Spell's own kwargs channel and lands on spell.metadata - tag your registrations with…
Lesser conduits - lightweight CHILD SCOPES grown from a root with create_lesser_conduit(). A lesser conduit rides its root's world: it resolves the same spells without being a second root…
Two honest ways to construct with configuration: a factory that closes over its config (bind-site), and override at meld - a FLAT dict of keyword overrides for the melded spell's OWN…
block, the third permission - declared today, felt when sharing and contracting exist (intermediate+). A beginner learns the word and that the book accepts it.
The fluent registration hand - SpellBinder reads like a sentence: bind(X).as_unique().named("primary").finalize(). finalize() returns the spell id string and resets the binder for the next…
Permissions are LINKING vocabulary (owner ruling): read / create / block govern what LINKED conduits may do with your bindings in dynamic worlds - they are not a local-meld concept at all.…
Even a lambda is a spell - it MUST carry a binding_name (the law the runtime enforces); melds address it by (frame, name) because binding_name alone is never an address. Callable = unique.
bind() answers with the spell's id string - keep it, and the book will hand the living Spell record back on request.
The book is inspectable - the spells mapping hands back every registration as SpellIndex -> Spell, the system's two domain nouns, straight off the root namespace.
THE DI heart - annotate a constructor parameter with a bound class and melder injects it. Dependencies resolve recursively; you meld the top and the graph assembles itself.
SpellMap - the declarative DI placeholder. As a constructor DEFAULT it declares exactly which spell fills the parameter, including frame + binding_name targeting. Exactly-one law: ambiguous…
Collection DI - annotate list[Shape] and receive EVERY bound implementation in registration order. The plugin pattern in one annotation; zero matches is a legal empty list.
"Is it already alive?" without creating it - has_live_creation mirrors meld's exact lookup but stops before construction. Doc-canon: the no-create probe for agents and diagnostics.
SpellbookConfiguration - the book's policy object. with_defaults() is easy mode; set_property tunes the knobs; conjure VALIDATES AND FREEZES it (frozen config refuses mutation - fail fast,…
Conjure runs the compile pipeline (phases 1-11) through the PhaseScheduler - a worker pool with a barrier timeout. Two config knobs tune it: workers per spellbook and the barrier timeout.…
Dynamic mode END TO END under the settle-then-inherit law: 1) A fresh world has no mode yet. The FIRST conjure(dynamic=True) SETTLES the world dynamic - and the posture locks. 2) Every…
Permissions LIVE - they are the sharing policy on a contract. "create" lets the borrower construct/resolve fully; "read" is resolve-only across the link. This is where the vocabulary from…
Ownership is transferable (dynamic mode) - a spell's stewardship moves to another conduit with an auditable preflight summary. Creations can move too; contracts unshare; lineage revalidates.
The ConduitCloud - the world's phone book for dynamic NAMED roots. Reached publicly from any conduit; look peers up by name instead of passing references around.
Clusters - named groups of dynamic conduits that AUTO-SHARE cluster-scoped spells. unique_per_conduit_cluster finally comes alive: one instance per cluster, shared by every member. (This…
Conduit CATEGORIES are your factory layer. Instead of writing an abstract factory in front of your scopes, NAME conduits after the resolution ideas your app already has - "platform",…
sever_link - the UNDO of the whole dynamic arc. Contracts ride links, so when the link dies, everything shared across it dies with it: the borrower loses resolution of every pulled spell on…
upgrade_to_normal - a lesser conduit GROWS UP in place. Lessers are unnamed child scopes (lesson 07); in a dynamic world one can be promoted to a full named citizen: registered in the…
Scopes that END. A lesser conduit is a scope you can THROW AWAY: build one for a job, meld what the job needs, then cleanup() the child - its per-conduit creations are disposed through the…
SpellbookConfiguration, knob by knob - part 1: DISPOSAL. Two set-once properties describe teardown policy: disposal (bool) - stored flag; matched names drive calls disposal_method_names…
SpellbookConfiguration DEFINED - the core settings you can set, what each one means, and the four laws that guard them. This is the book's policy object: it decides teardown and how hard…
SpellbookConfiguration hooks, family 1: the MELD PIPELINE. add_hook(spellbook_id, name, fn) registers callbacks keyed to a BOOK - the configuration can serve many books, so hooks say whose…
SpellbookConfiguration hooks, family 2: the CONDUIT LIFECYCLE. Five moments of a conduit's life are observable: on_conduit_pre_created / on_conduit_post_created / on_conduit_activated at…
SpellbookConfiguration hooks, families 3+4: LINKING and CONTRACTS - the dynamic arc becomes observable. Register on the owner book and watch its side of the story: on_conduit_post_link - a…
ONE SPELLBOOK CONFIGURATION SHARED BY EVERY BOOK. When several books make up one subsystem, per-book configs drift - one book's teardown vocabulary says "close", another forgot it. The fix…
SpellContract - the LATE-BOUND socket. A SpellMap says "resolve this from MY book" and must be satisfiable at conjure. A SpellContract says "someone will hand me this later", and stays OPEN…
THE CONDUIT CLOUD - the frame's shared registry of conduits, and the first object in this tier that is owned by the WORLD rather than by you. You reach it from any conduit: cloud =…
Deep override - the ">"-path form. A path of parameter names walks the dependency graph from the melded root and REPLACES the actual object at that socket:…
Aetheric frames are WORLDS - the categories arc, act three. Act 1 (beginner 25): spellframes categorize spells WITHIN a world. Act 2 (intermediate 26): conduits categorize worlds of…
Frame POSTURE through the public door. configure_aether_frame() is the manual fluent path: set the world's system_state BEFORE anyone conjures, and every conjure then INHERITS it - no…
Logging through the AetherUtilitySystem - the process-wide provider host every runtime object resolves its logger from. THE BOOT LAW: melder boots SILENT. Aether starts with a null…
THE FRAME POSTURE CHEATSHEET - every AethericFrameConfiguration knob and what it does, in one runnable page (the advanced twin of beginner 37). The posture is the WORLD's law book: set…
THE POSTURE OBJECT ITSELF. Lesson 05 mapped the 14 knobs; this one picks the object up and handles it. The headline: this config is CONSTRUCTOR-FIRST, not fluent-first - alone among…
TWO DOORS TO ONE CONFIG, AND THE LADDER BEHIND THEM. Aether hands you two ways to build its root configuration: aether.create_configuration() -> AetherConfiguration…
TURNING THE NEXUS ON - and discovering that it does NOT climb the same ladder Aether does. Lesson 07 taught Aether's rule: freeze, then activate, then bring the subsystem up, in that order,…
OPENING A RIFT - and meeting melder's most repeated law for the third time in three lessons. THE PATH (each step needs the one above it) nexus = md.Nexus()…
THE ROOM. Every Rift owns exactly one, and the law around it is stricter than people expect: A RIFT OWNS ONE PRIMARY ROOM, ITS KIND IS CHOSEN ONCE AT CREATION, AND IT IS NEVER SWITCHED.…
WHAT THE ROOM KIND ACTUALLY CHANGES. StaticRiftSpace and CapabilityRiftSpace override exactly TWO properties of RiftSpace, and they are the two that matter: command_system…
THE WORKSTATION - the room's binding canvas, and the last fixture in arc B. Every RiftSpace owns one, whatever its kind. WHAT IT IS: a room-local scratchpad that holds things across steps.…
THE FRAME VIEWER - the room's read surface, and the first place in melder where the AIX claim stops being a design philosophy and becomes methods you can call. IT IS A FACADE, AND IT SAYS…
THE DESCRIBE LADDER - why the read surface is not one fat describe() per thing, and why that shape is aimed at agents. Look at what ViewSpell offers for a single spell:…
THE READ SURFACE REPORTS ITS OWN BLIND SPOTS. Arc C closes on the most unusual thing in the viewer family, and the most useful one if you are an agent. START FROM THE PROBLEM. You call…
WARD POLICIES - how permissive a conduit is about contracting with other conduits, and the three refusals that come with the door. A policy is broader than a visibility flag. It governs…
TAKING A CHECKPOINT - and settling which configuration ladder is the house rule. YOU HAVE NOW SEEN THREE SUBSYSTEMS COME UP. lesson 07 Aether you finalize, you activate the config, THEN…
THE LOADING HALF - and the one place in melder where a successful return deliberately does NOT mean what you would assume. TWO PLACES A CHECKPOINT CAN LIVE created an id exists in the…
THE OTHER TWO OVERRIDE FORMS. Lesson 01 taught the PATH form - "transport>credentials" - which names a socket exactly. There are three targeting forms in total, and melder states all of…
BOOTING A POD. Advanced 17-18 taught checkpoint and load as two verbs you call yourself. This is the operator's version: one entry point that runs the whole restart flow in a fixed…
THE ASYMMETRY AT THE EDGE OF YOUR WORLD, demonstrated rather than described. Melder never speaks to your database - it calls YOUR callables. So the interesting question is what happens when…
MUTATION RESEARCH - melder's record of how a world CHANGED, not what it currently is. Everything up to here described a runtime. This describes its history. THE SHAPE MutationResearch the…
DERIVE A DIFF, THREE WAYS, AND WATCH THE ANSWER CHANGE. Version records are full objects; "what changed" is computed on demand and never written back. "A verdict is an answer, not a fact…
THE ONE TOOL THAT WRITES TO DISK. Every surface in this curriculum so far reads: viewers read, crystals read, diffs derive, research records. ProtocolCrafter is the exception, and its own…
THE LAST TWO PUBLIC NAMES, and what they say about the whole configuration story the curriculum has been tracking since advanced 07. MutationResearchConfiguration has exactly TWO knobs:…
THE CODEGEN ROOM - where an agent writes code that becomes part of a running world, and the gate it has to get through first. This is the only room kind where the caller supplies EXECUTABLE…
HOW AN AGENT REACHES MUTATION RESEARCH - and the discovery that access to it is GRADUATED BY ROOM KIND, exactly the way the conduit surface was in advanced 11. MEASURE THE THREE ROOMS AND…
PUT YOUR WORLD IN YOUR OWN DATABASE - and notice what melder does NOT do to get it there. This wires a real mesh, seals a real checkpoint, and watches the bytes arrive. MELDER NEVER IMPORTS…
OVERRIDES WHEN THE GRAPH IS DEEP. Advanced 19 taught the three TARGETING FORMS - path, *unique, **broadcast - on a shallow graph where the difference between them is mostly convenience.…
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…
THE CODEGEN LOOP, ACTUALLY RUN. Expert 07 introduced the room and named its three verbs. This drives them: an agent asks permission, writes code into a named world, and reads back what it…
ONE CODEGEN ROOM, SEVERAL WORLDS. Expert 11 attached a rift to a frame; 12 ran the loop against one. This is the shape you actually end up with: a single workshop wired to several frames,…
COMPOSITIONS - naming a SET of spells as one thing, and then asking questions about the thing instead of about its members. Expert 03 taught residency: a spell lives in exactly one lane.…
CAMPAIGNS - the WHY, carried without anyone remembering to carry it. Expert 14 built a subsystem and left one argument dangling: `research_group_history(group_id, campaign=...)`. This is…
CHANGING THE WIRING WHILE THE WORLD RUNS. A dynamic world can gain a relationship after it is built: two conduits link, one pulls a spell it does not own into its contract, and the next…
LINEAGES, AND THE STAGING HALF OF A HOT SWAP. An index is a version LINEAGE with exactly one SELECTED member. This lesson builds one, stages a second version onto it, and shows that staging…
YOU DO NOT READ A SYSTEM DOCUMENT, YOU ADDRESS IT. Four documents hang off the package root and answer AT IMPORT - before Aether boots, before a Spellbook exists, before anything is…
THE GRAPH DOCUMENTS. Expert 18 addressed prose by section. The two graph documents carry the same prose surface AND a real graph: nodes, edges, traversal, and blast radius - answered at…
THE WORKBENCH. A codegen room is not just a place to run code - it has a WORKSTATION, a room-local canvas where an agent keeps named handles on things between commands. Advanced 12…
REAL CODEGEN, AND SEVERAL AGENTS DOING IT AT ONCE. Expert 12 drove the loop once, on one thread. This is the shape melder is actually built for: four agents, four rooms, one shared world,…
FORESIGHT. An agent about to replace a version can ask what the replacement WOULD do - what it defines, what it imports, how it differs from what is there, what it would break, and whether…
BRANCHING, AND WHY A JOIN CAN REFUSE. Research lanes are melder's branches: parallel lines of versions over one world, anchored to each other, finished by joining. It looks like git until…
SEAL A WORLD, THEN UNFOLD IT AGAIN. Expert 01 taught the pod-boot ORDER; expert 09 taught what crosses the wire. This is the round trip itself - checkpoint a live world, put it in the…
RESEARCH SETS, PLURAL. Everything so far used the default set and never said there was a choice. A ResearchSet is a whole INDEPENDENT BODY OF HISTORY over the same runtime - its own lanes,…
THE LOOP TURNED MORE THAN ONCE - AND THE TWO BOOKS IT WRITES. Expert 12 drove the codegen verbs once. This iterates them, and in doing so hits the distinction that catches everyone: a…
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,…
NO FILE, NO DATABASE, NO DRIVER - A PYTHON STRING. Merge two research lanes, turn the whole record into TEXT, throw the live set away, and rebuild it from that text with its identity…
THE CRYSTAL WELL - reading the code your world RECORDED, at four grains, and the one comparison law that makes any of it trustworthy. Expert 04 said diffs are derived, never stored. This is…
THE HALF OF A MERGE THAT JOIN REFUSES TO DO, on code the room actually generated. Expert 23 said it outright: "Reconciliation-by- content is not a join concern: compose in the codegen…
LANES ARE ORGANISED AFTER THE FACT, NOT PLANNED IN ADVANCE. Expert 23 cut branches and joined them. This is the other three verbs - the ones for when you got the shape wrong the first time.…
ASK A WHOLE SUBSYSTEM WHAT IT WOULD BREAK. Expert 14 built compositions - a set of versions pinned as one unit. This asks the two questions you actually have about one: how far does it…
WHAT A SYNTHETIC MODULE ACTUALLY IS, and why one crystal shape holds both it and a file on your disk. Lessons 26, 27, 29, 30 and 32 all MAKE synthetic modules. None of them says what one…
KEEP TWO SEPARATE WORLDS OF RECORD IN ONE PROCESS. Every lesson so far has recorded into one nameless place. It has a name - "default" - and you can have others. A PROFILE IS WHERE…
THE ADMISSION GATE, and why it is not a mutex. Expert 16 rewired a running world and 17 staged a swap on a live object. Neither said what makes those safe. This does. MELDER HAS THREE GATES…
NOTHING IN THIS FILE EXISTS WHEN THE PROCESS STARTS. Three classes are written as text at runtime, become real importable modules with no file on disk, get bound as spells, and come out as…