There's a specific piece of information we need for the parent task, which is to look at the minimum patch which would allow us to handle references with the refines attribute, but without rendering or making it editable. This would be for the purpose of having a partial-rollback strategy in case the hierarchical subreferences end up being problematic.
To display the reference links, CSS counters are used in the existing code. To add the refines, we would probably add another counter and data attribute, like so:
The reference editing dialog needs a new entry which displays the refine attribute, like here
This also needs to save the refine attribute, and probably we should have a combobox which allows to select existing refines. This could be modeled after MWReferenceSearchWidget and related widgets.
The refines attribute itself is passed through to MWReferenceModel.refinesKey. The reference indices itself would have to be calculated similar to https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Cite/+/530399/5/includes/Cite.php
Currently VE shows a warning when the Wikitext contains a reference which is used several times, but I don't see a way to actually select the reference in the editor popup, ie. change the name attribute of the reference. Maybe we could add this while we're at it.