From 85d7976f4eccdf64814e40e4b3973f7e9c18a14a Mon Sep 17 00:00:00 2001 From: AdrianoDev Date: Sun, 16 Aug 2026 19:49:21 +0200 Subject: [PATCH] =?UTF-8?q?docs(vision):=20commenta=20perch=C3=A9=20camera?= =?UTF-8?q?=20resta=20fuori=20dal=20pattern=20client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MeasurementCreate.input_method accetta solo usb_caliper|manual anche se l'enum ORM e il database permettono ormai camera. È voluto: una misura da camera deve nascere in vision_service.execute_task, mai da un client che posta JSON direttamente - non c'è dietro né immagine, né grafo, né engine_version. Commento aggiunto perché non venga "corretto" tornando alla lettera dell'enum. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_014BBnuACZSCJqXrMYC3LUMU --- src/backend/models/api/measurement.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/backend/models/api/measurement.py b/src/backend/models/api/measurement.py index 4b5980e..7aabeb3 100644 --- a/src/backend/models/api/measurement.py +++ b/src/backend/models/api/measurement.py @@ -12,6 +12,11 @@ class MeasurementCreate(BaseModel): value: float lot_number: Optional[str] = Field(None, max_length=100) serial_number: Optional[str] = Field(None, max_length=100) + # "camera" is deliberately absent from this pattern, even though the ORM + # enum and the database allow it. Do not add it here: a camera + # measurement must be produced by vision_service.execute_task, never by a + # client posting JSON straight to this endpoint - there is no image, no + # graph and no engine_version behind a value that arrived this way. input_method: str = Field("manual", pattern="^(usb_caliper|manual)$") input_duration_ms: Optional[int] = Field(None, ge=0) # The production this belongs to, when one is open at the station.