# An agent builds a working system **🔵 Expert · Lesson 36** 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 LIVE OBJECTS that do actual work. Then we make more of them. This is the demo. Everything else in the tier explains a rule; this one just does the thing. THE LOOP, ONE MORE TIME BUT WITH A PAYOFF validate_codegen may this exist? materialize_codegen make it a real module import it resolves like anything else bind it becomes a spell with custody meld you get an OBJECT Five steps from a string to something you can call a method on. AND THE OBJECTS ARE ORDINARY. That is the part worth sitting with. Once melded, a generated class is not a special "dynamic" thing you handle with tongs. It is an object. It has state, you call methods on it, you pass it around, it participates in the same lifecycle as a class you typed by hand. The generated-ness stops mattering the moment it lands. MULTIPLE OBJECTS FROM ONE GENERATED CLASS. `existence="many"` means every meld builds a NEW instance, so an agent can write one class and you can run a hundred independent copies of it - separate state, no shared surprises. `existence="unique"` gives you the same object back every time. Same generated source, two population models, and you choose per binding. WHY THIS SURVIVES A REBOOT, IN ONE LINE: the module has no file, so its SOURCE IS THE RECORD (expert 33). A world made of generated code is reproducible rather than merely re-runnable - which is what makes any of this more than a clever trick. ## Before you run Use the [Expert guide](../../expert/index.md) 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 ```bash python UX_and_AIX_experiences/04_expert/36_an_agent_builds_a_working_system.py ``` ```powershell py -3.14t UX_and_AIX_experiences/04_expert/36_an_agent_builds_a_working_system.py ``` {download}`Download this collection <../../downloads/expert-examples.zip>` · [Source on GitHub](https://github.com/Synaptic724/melder/blob/a30a754d0bb61db0b142936010cdb82cffecec6f/UX_and_AIX_experiences/04_expert/36_an_agent_builds_a_working_system.py) ## Public surface validate_codegen / materialize_codegen, Spellbook.bind with existence unique and many, Conduit.meld, and the generated objects actually running ## Code ```{literalinclude} ../../downloads/04_expert/36_an_agent_builds_a_working_system.py :language: python :linenos: ``` ## 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](index.md) · [Level guide](../../expert/index.md) ## Related guides - [Build a working system from generated code](../../expert/codegen.md) - [Complete operational walkthroughs](../../expert/walkthroughs.md) ## API contracts - [Spellbook](../../reference/api/binding/spellbook.md) - [Conduit](../../reference/api/resolution/conduit.md)