← Back to the chapter · Next detail →
Technical detail · Edge AI: Deployment Validation and Runtime Design
Follow the inference gate
The runtime gate below makes the ownership concrete. It preprocesses the window consistently and runs the model. Below the confidence threshold, it stores evidence and takes the safe fallback. An approved local label triggers an action and event report; an observation label reports without acting. The state diagram follows those same branches into monitoring.
def handle_sensor_window(window, model, policy, device):
features = device.preprocess(window)
result = model.predict(features)
if result.confidence < policy.minimum_confidence:
device.store_evidence(window, reason="low_confidence")
return device.safe_fallback("needs_review")
if result.label in policy.local_action_labels:
device.act(result.label)
device.report_event(result.summary())
return "acted_locally"
device.report_event(result.summary())
return "observed"