You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adopt the unified runtime architecture defined in ADR-014 (drafted in #C, finalised in the epic discussion #A). Restructure iroh-http-core so that the FFI dispatch and Iroh transport adapter are the only places carrying custom code, and the rest is composed from standard tower / tower-http / hyper / hyper-util building blocks.
Scope is intentionally vague right now. It will be defined by the assessment in #C and the discussion in #A. Once ADR-014 is merged, this issue gets rewritten with concrete tracer-bullet slices.
Evidence
See parent epic #A and assessment #C.
Likely (but not yet confirmed) shape
Based on initial discussion, the rework will probably involve some subset of:
A single Body newtype around UnsyncBoxBody<Bytes, BoxError> so all middleware composes without HRTB headaches.
An axum-style Service<Request<Body>, Response = Response<Body>, Error = Infallible> contract at the hyper boundary, with errors converted to responses inside the service.
The standard tower-http stack (CompressionLayer, RequestDecompressionLayer, TimeoutLayer, ConcurrencyLimitLayer, LoadShedLayer, AddExtensionLayer) composed once, type-erased via BoxCloneSyncService, shared across connections.
An extracted FFI dispatch service that handles the JS-bridge concerns separately from the tower-service concerns.
Removal of bespoke pieces (TowerErrorHandler, possibly parts of the per-connection task spawning) where standard equivalents exist.
Summary
Adopt the unified runtime architecture defined in ADR-014 (drafted in #C, finalised in the epic discussion #A). Restructure
iroh-http-coreso that the FFI dispatch and Iroh transport adapter are the only places carrying custom code, and the rest is composed from standard tower / tower-http / hyper / hyper-util building blocks.Evidence
See parent epic #A and assessment #C.
Likely (but not yet confirmed) shape
Based on initial discussion, the rework will probably involve some subset of:
Bodynewtype aroundUnsyncBoxBody<Bytes, BoxError>so all middleware composes without HRTB headaches.Service<Request<Body>, Response = Response<Body>, Error = Infallible>contract at the hyper boundary, with errors converted to responses inside the service.CompressionLayer,RequestDecompressionLayer,TimeoutLayer,ConcurrencyLimitLayer,LoadShedLayer,AddExtensionLayer) composed once, type-erased viaBoxCloneSyncService, shared across connections.TowerErrorHandler, possibly parts of the per-connection task spawning) where standard equivalents exist.The actual list will be confirmed against the assessment in #C.
Impact
core/shrinks to genuinely necessary pieces, each justified by an ADR-013 comment.Remediation
Will be defined as a checklist of tracer-bullet vertical slices, each with its own PR and green CI, after #C lands. Likely shape:
Bodynewtype (no behaviour change).Error = Infallible, move error→response inside.RequestService.RequestDecompressionLayer(closes feat(core): add inbound request body decompression on serve path #153).TowerErrorHandlerand any other now-redundant code.Acceptance criteria
mainwith green CI.docs/architecture.mdupdated to reflect the new runtime.tower::Service/ body-type / error-handling code incore/without ADR-013 justification.Part of #A. Blocked by #B and #C.