Why the Second Suggestion Was the One You Wanted
We spend most of our research time on ranking rather than generation, and the reason is a number we did not like: for a long stretch, twenty-two per cent of accepted suggestions were the second one offered, not the first.
Generic beats specific, until it does not
A model trained on the whole world of public code prefers the shape the whole world uses. Your repository is not the whole world. It has a logger, a result type and an error convention, and the completion that uses them is often ranked second behind the one that would compile anywhere.
Ranking against the repository
The fix was to score candidates against the conventions the index has already observed: which helpers this package calls, which error type crosses this boundary, which naming pattern the sibling functions use. None of it is clever. All of it is local.
Second-suggestion acceptance fell from twenty-two per cent to six. Total acceptance rose by nine points. The model did not change.