# The workstation an agents workbench **🔵 Expert · Lesson 20** 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 introduced it as a store. This is what it is FOR. THE LOOP THAT MAKES IT A WORKBENCH workstation.bind_object("service", obj) workstation.set_target("service") commands.execute_target_method("compute", bind_as_name="result") workstation.set_target("result") A command's RETURN VALUE becomes the next named binding. So an agent works in steps, each one addressable by a name it chose, without carrying objects around in its own head or re-deriving them from the runtime on every call. THREE STORES, ONE NAMESPACE EACH bind_object / bind_attribute / bind_method Binding one name into two stores is allowed - they do not collide on WRITE. But a bare `get(name)` must resolve UNIQUELY, and when two stores answer it REFUSES as ambiguous rather than picking one. So the stores are separate for writing and deliberately unmerged for reading; `get(name, store=...)` is how you mean one of them. `describe_bindings()` reports FIVE keys, not four: the fifth is `target_store`, which names WHICH store the active target came from, so a target round-trips through `get(name, store=...)`. STRONG OR WEAK, AND THE CHOICE IS ENFORCED `weak_ref=True` on something that cannot be weak-referenced RAISES rather than silently storing it strongly. A silent degrade would pin an object the caller believed was collectable - the bug you find three weeks later as a memory graph that never shrinks. AND A COLLECTED WEAK BINDING TELLS THE ROOM. Weak-binding collection publishes an event into the room's own event system, so "the thing I was holding went away" is something an agent can be TOLD rather than discover by dereferencing a hole. TWO WAYS TO STOP POINTING AT SOMETHING, AND THEY DIFFER clear_target() deselect; the binding stays, the object lives cleanup_target() call cleanup ON the target, then deselect One is putting the tool down. The other is dismantling it. THE SECURITY LINE, STATED PLAINLY `CommandSystem` gates runtime access BEFORE a bind and leaves already-bound workstation objects OUTSIDE post-bind ACL policing. Getting a handle is the checkpoint; using the handle you were granted is not re-litigated on every call. Know which side of that line you are on when you bind something. AND THE WORKSTATION NEVER FABRICATES. It stores room-local bindings only - it will not construct, resolve, or meld anything for you. Resolution is the command system's job; holding is the workstation's. `cleanup()` clears the stores and deliberately does NOT clean the objects inside them, because it did not make them. ## 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/20_the_workstation_an_agents_workbench.py ``` ```powershell py -3.14t UX_and_AIX_experiences/04_expert/20_the_workstation_an_agents_workbench.py ``` {download}`Download this collection <../../downloads/expert-examples.zip>` · [Source on GitHub](https://github.com/Synaptic724/melder/blob/0895ce795453cd87e35d70665957b4e89aad3317/UX_and_AIX_experiences/04_expert/20_the_workstation_an_agents_workbench.py) ## Public surface rift.space.workstation - bind_object / bind_attribute / bind_method / get / release / describe_bindings / set_target / get_target / clear_target, and command_system.execute_target_method(bind_as_name=...) ## Code ```{literalinclude} ../../downloads/04_expert/20_the_workstation_an_agents_workbench.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 - [Agent rooms and explicit authority](../../expert/agent-rooms.md)