# Scope Work and Resources [Architecture and design home](../../architecture.md) ## Reader Question How should a web request, job, session, or nested operation receive an honest lifetime? ## Short Answer Choose the narrowest owner that matches the work. Frame-wide services use `unique`; request/session state commonly uses `unique_per_conduit`; child work can share lineage state; request-local ephemeral objects can live in an active `SpellSpace`; stateless work can use `many`. ![Melder ownership and lifetime map](../../../media/architecture/diagrams/rendered/ownership_lifetimes.svg) {download}`Editable diagram source <../../../media/architecture/diagrams/source/ownership_lifetimes.mmd>` ## A Typical Request Shape ```python root = book.conjure() request_scope = root.create_lesser_conduit() try: handler = request_scope.meld("RequestHandler") handler.handle() finally: request_scope.cleanup() ``` The root retains broad services. The lesser conduit owns request-specific creations and inherits only the lifetimes designed to cross the lineage boundary. ## Why This Design Is Strong The object graph and lifetime graph agree. Reuse decisions are made by the owning store, and teardown can run deterministically when the scope ends rather than waiting for GC. ## Tradeoffs The application must end scopes deliberately and choose lifetime semantics during registration. This adds lifecycle design work and prevents accidental process-global state. ## Where to Go Next - [Ownership and lifetimes](../02_architecture/ownership_and_lifetimes.md) - [Isolate worlds](isolate_worlds.md) for a wider boundary. Evidence: - [Scope-ordering matrix](https://github.com/Synaptic724/melder/blob/a30a754d0bb61db0b142936010cdb82cffecec6f/tests/integration/melder/conduit/test_conduit_integration_scope_ordering_matrix.py) - [Spell-space safety](https://github.com/Synaptic724/melder/blob/a30a754d0bb61db0b142936010cdb82cffecec6f/tests/integration/melder/conduit/test_conduit_integration_spellspace_scope_safety.py) --- [Canonical source](https://github.com/Synaptic724/melder/blob/a30a754d0bb61db0b142936010cdb82cffecec6f/architecture_and_design/03_usage/scope_work.md) ยท [Full contents](../../../contents.md)