What is "information leak from test to train" ? Is stratification by target a leak? It's common practice to do procedures such as standardization and even missing value imputation (commonly based on some means) after train/test split - otherwise it is treated as information leak from test to train.
But what sort of "leaks" we are worried about? If I impute "Apple" to empty "device_brand" fields, where "device_os" is "iOS" - and only after that perform train/test split, is it a "leak"?
Another example - in imbalanced classification problems, it's common practice to explicitly preserve class balance while splitting dataset to train/test. But why stratification (preserving class balance) is not considered as info leak by the same reason?
Are there more or less formal rules, what sort of data preprocessing can be done before train/test splitting, and what can't?

To answer the final question: "What sort of data preprocessing can be done before train/test splitting, and what can't?"
None of it. Aside from removing undeniably corrupted data maybe (e.g. a human male weighing 0.75 kg) nothing else should be done in terms of preprocessing. We should design all our pre-processing based on our training set only and then apply it to our test set.
Regarding the original comments and queries on stratification:
You raise a valid point. The main reason why stratification is usually not a problem is that stratification (e.g. sampling such that both our training and test sets have an approximately equal proportion of positive examples) is done to ensure that our model is trained and evaluated on subsets of data that closely reflect the entire dataset's reality; we thus avoid sampling variation leading us to misleading insights.
If we then choose to somehow alter the class proportion in our training set (usually not a great idea but let's assume we want to), our test set still needs to reflect the reality captured in our original raw sample. For the particular example in the post: imputing Apple to a device_brand field is fine if device_brand is an explanatory feature, this is just a pre-processing step for one of our features. We can do the same in our test set as it does not alter our targets. Nevertheless, if device_brand is our target/response variable then we actively change our task at hand! We do not predict something reflects the reality our model is expected to operate in! It is not the imputation that is the problem, it is the role of the feature being imputed!
As a rule of thumb: Changing our target variable's characteristics is a dubious practice and should be avoided. That is because it hurts the generalisability of our model responses and can mislead our assessment of its performance. Changing our explanatory features based on training set insights is usually fine. That is because this amounts to preprocessing our data and giving our learner a (hopefully) easier feature space to explore while keeping what we aim to predict unchanged.
