Implement compose(middlewares) that chains async middleware functions
(like Koa.js). Each middleware receives (req, next) where next() calls
the following middleware.
solve creates middlewares from a declarative ops array and runs them:
{op:'set', key, val} — adds key to req then calls next(){op:'stop'} — marks req.stopped = true, does not call next()Return the final req state after compose(middlewares)(req) resolves.
Sample tests