Problem. HostState hard-codes concrete cow/chain/store fields and the ten WIT impls bind to it; restart also rebuilds the linker and duplicates the store-construction literal.
Change. Introduce a Clone Components bundle of the trait-bounded backends; make HostState<C> generic; rewrite the ten impl ... Host for HostState blocks as impl<C: ..>; thread the generic through Linker/Store/Supervisor. Add HostState::<C>::new(&Components, &ModuleCtx) used by both load_one and reinstantiate_one, removing the duplicated build.
Files. host/state.rs, all host/impls/*.rs, supervisor.rs, bootstrap.rs.
Risk / size. High blast-radius but mechanical; land isolated. Single largest diff. Size: L.
Depends on. the backend traits (E2).
Problem.
HostStatehard-codes concretecow/chain/storefields and the ten WIT impls bind to it; restart also rebuilds the linker and duplicates the store-construction literal.Change. Introduce a
CloneComponentsbundle of the trait-bounded backends; makeHostState<C>generic; rewrite the tenimpl ... Host for HostStateblocks asimpl<C: ..>; thread the generic throughLinker/Store/Supervisor. AddHostState::<C>::new(&Components, &ModuleCtx)used by bothload_oneandreinstantiate_one, removing the duplicated build.Files.
host/state.rs, allhost/impls/*.rs,supervisor.rs,bootstrap.rs.Risk / size. High blast-radius but mechanical; land isolated. Single largest diff. Size: L.
Depends on. the backend traits (E2).