# Spellbook config defined **🟡 Intermediate · Lesson 31** 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 the conjure pipeline works. Nothing here is exotic - explicit values, four rules. THE CORE SETTINGS disposal (bool) Stored configuration metadata; matched method names drive disposal calls. disposal_method_names (list[str]) The teardown VOCABULARY - the method names that mean "clean yourself up" in this system. Cleanup calls whichever of them each object actually has (beginner 08 showed it firing). enforce_priority_disposal_methods (bool, default False) Place the matching book block last (False) or first (True). Shared names always keep the book's order; spell-only names keep their own order. Set this before binding. phase_scheduler_workers_per_spellbook (int) How many worker threads run the conjure pipeline. Conjure compiles and validates every spell in phases - more workers means more of that in parallel. phase_scheduler_barrier_timeout_milliseconds (int) How long a phase barrier waits for a straggler before refusing loudly. This is the anti-hang knob: a broken spell fails your startup with an error, never a frozen process. THE FOUR LAWS 1) CLOSED REGISTRY - an unknown key refuses. No typo silently becomes a setting. 2) IDEMPOTENT PAIR - the two disposal items are set-ONCE. A world's teardown story must not change mid-flight. 3) FREEZE - conjure validates and freezes the whole object. Configuration is a pre-flight surface, period. 4) COMPLETION - hand a book YOUR configuration and you own completing it. with_defaults() is easy mode; a bare config refuses at conjure-time validation. ## Before you run Use the [Intermediate guide](../../intermediate/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/02_intermediate/31_spellbook_config_defined.py ``` ```powershell py -3.14t UX_and_AIX_experiences/02_intermediate/31_spellbook_config_defined.py ``` {download}`Download this collection <../../downloads/intermediate-examples.zip>` · [Source on GitHub](https://github.com/Synaptic724/melder/blob/1211e838099a342c9dde48f064b1e772b6060e13/UX_and_AIX_experiences/02_intermediate/31_spellbook_config_defined.py) ## Public surface core configuration settings, the four refusal laws ## Code ```{literalinclude} ../../downloads/02_intermediate/31_spellbook_config_defined.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 intermediate examples](index.md) · [Level guide](../../intermediate/index.md) ## Related guides - [Configuration before conjure](../../intermediate/configuration.md)