Build the editor-facing completion contract: return bounded snippets that begin with the user's prefix, in deterministic order.
Required APIdef complete_prefix(prefix, snippets, limit):
return completionsBehaviorThink through the mechanism first if you want the extra reasoning step. It never blocks the editor.
complete_prefix('pri', ['print()', 'private', 'append()'], 2)the editor receives relevant candidates
complete_prefix('xyz', ['print()'], 3)an empty completion set is valid
2 hidden edge tests run after the visible contract passes.
Run Tests to see the contract verdicts here.