printguard.mainloads and validates configuration, configures logging, and wires signal handling.printguard.runner.HeadlessServiceorchestrates model loading, MQTT connectivity, stream sessions, and shutdown.printguard.streamprovides frame sources for HTTP MJPEG or OpenCV-backed transports.printguard.modelloads ONNX artifacts and produces per-frame predictions.printguard.policyconverts raw predictions into stable user-facing classification and print-quality values.printguard.statethrottles MQTT state publication and heartbeat behavior.printguard.healthwrites a local health snapshot that powers the containerHEALTHCHECK.
- keep transport, policy, and publication concerns separate
- keep runtime state explicit through typed snapshots and enums
- fail fast on invalid configuration
- prefer simple files and local health signals over adding a web control plane