  AMS-02 on the International Space Station has been releasing data of
unprecedented accuracy. This poses new challenges for their interpretation. We
refine the methodology to get a statistically sound determination of the
cosmic-ray propagation parameters. We inspect the numerical precision of the
model calculation, nuclear cross-section uncertainties, and energy correlations
in data systematic errors. We used the 1D diffusion model in USINE. Our
$\chi^2$ analysis includes a covariance matrix of errors for AMS-02 systematics
and nuisance parameters to account for cross-section uncertainties. Mock data
were used to validate some of our choices. We show that any mis-modelling of
nuclear cross-section values or the energy correlation length of the covariance
matrix of errors biases the analysis. It also makes good models ($\chi^2_{\rm
min}/{\rm dof}\approx1$) appear as excluded ($\chi^2_{\rm min}/{\rm dof}\gg1$).
We provide a framework to mitigate these effects (AMS-02 data are interpreted
in a companion paper). New production cross-section data and the publication by
the AMS-02 collaboration of a covariance matrix of errors for each data set
would be an important step towards an unbiased view of cosmic-ray propagation
in the Galaxy.

High Energy Astrophysical Phenomena;High Energy Physics - Phenomenology