Every piece of work has an owner.
Request ownership is a structural rule: work created for a request must settle or clean up with that request.
Handler scope
The handler scope owns tasks and resources needed while route code is running. Use context.fork() for child work and context.use() for acquired resources.
Delivery scope
Returning a Response does not mean its body has finished. The delivery scope owns producers, file handles, sockets, and cleanup needed until the body completes or disconnects.
context.delivery.use(() => producer.close())
return new Response(producer.stream())Cancellation
The first typed cancellation reason wins and propagates through the ownership tree. Later failures do not erase the original cause.
Cleanup order
Resources are released once in reverse acquisition order. This keeps dependency teardown predictable on success, failure, disconnect, and shutdown.