  We aim to constrain the internal structure and composition of HD 15337 b and
c, two short-period planets situated on opposite sides of the radius valley,
using new transit photometry and radial velocity data. We acquire 6 new transit
visits with the CHaracterising ExOPlanet Satellite (CHEOPS) and 32 new radial
velocity measurements from the High Accuracy Radial Velocity Planet Searcher
(HARPS) to improve the accuracy of the mass and radius estimates for both
planets. We reanalyse light curves from TESS sectors 3 and 4 and analyse new
data from sector 30, correcting for long-term stellar activity. Subsequently,
we perform a joint fit of the TESS and CHEOPS light curves, and all available
RV data from HARPS and the Planet Finder Spectrograph (PFS). Our model fits the
planetary signals, the stellar activity signal and the instrumental
decorrelation model for the CHEOPS data simultaneously. The stellar activity
was modelled using a Gaussian-process regression on both the RV and activity
indicators. We finally employ a Bayesian retrieval code to determine the
internal composition and structure of the planets. We derive updated and highly
precise parameters for the HD 15337 system. Our improved precision on the
planetary parameters makes HD 15337 b one of the most precisely characterised
rocky exoplanets, with radius and mass measurements achieving a precision
better than 2\% and 7\%, respectively. We are able to improve the precision of
the radius measurement of HD 15337 c to 3\%. Our results imply that the
composition of HD 15337 b is predominantly rocky, while HD 15337 c exhibits a
gas envelope with a mass of at least $0.01\ M_\oplus$.Our results lay the
groundwork for future studies, which can further unravel the atmospheric
evolution of these exoplanets and give new insights into their composition and
formation history and the causes behind the radius gap.
