Supervised a PhD to 90% of completion; take credit for 100%; what could go wrong?
On a generic CV, I would simply make a section of "Graduate students supervised and co-supervised", and include this student. In this context it wouldn't be necessary to go into detail about whether the supervision was "to completion".
But for something like a promotion dossier, where you're asked to tick boxes, I would go to whoever is responsible for overseeing the evaluation process (department head, promotion committee chair, etc), explain the situation, and ask what you should do. If at all possible, get an answer in writing. Then, when you fill out the form, attach a note saying something like:
One student was supervised by me for about 90% of their thesis work (stages X, Y, Z), and then changed supervisors for the last 10%; I am officially listed as their deputy supervisor. I spoke with Department Head Smith on October 24, 2018, and she advised that it was appropriate to include this student as "supervised to completion".
If Smith says "no, don't count it", then you attach a similar note saying "Smith said not to include this student, but I believe that this is a similar accomplishment to supervising a student to completion".
Since academic achievement is generally self-reported and "honor system", this means that any attempt to "cheat" is seen as a serious ethical offense. If someone on the evaluation committee is hostile to you, they could use something like this as ammunition to wreck your entire promotion case. ("Candidate says supervised to completion, but student's dissertation shows someone else as supervisor. Clear-cut fraud.") So that's what could go wrong. But if you disclose the situation, and get someone else to pre-approve the way you're filling the form, you eliminate the possibility; maybe it won't be counted in your favor, but at least you can't be accused of fraud.
The fact that you ask, makes me think that you believe it would be at least a bit wrong. Anything that looks like dishonesty in an academic's statements or record can be very serious.
I suggest two things. One is to be completely honest about it as you have been here. But the other is to talk to the student in question and perhaps get a statement/recommendation from him/her about your helpfulness. A recommendation from a student for a professor might be a very powerful statement to a hiring committee.
What could go wrong:
- You might not be given a chance to explain it.
- Once someone realizes you fudged this detail a little, it might call all of the other details in your cv into question.