Define the smallest production inference boundary: validate model version, compute a score, and return structured errors instead of crashing.
Required APIdef handle_request(request, model):
return responseBehaviorThink through the mechanism first if you want the extra reasoning step. It never blocks the editor.
handle_request({'version': 'v1', 'value': 3}, {'version': 'v1', 'weight': 2})the service contract returns a predictable response
handle_request({'version': 'v2', 'value': 3}, {'version': 'v1', 'weight': 2})serving the wrong model is a correctness failure
2 hidden edge tests run after the visible contract passes.
Run Tests to see the contract verdicts here.