docs(vision): commenta perché camera resta fuori dal pattern client
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) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014BBnuACZSCJqXrMYC3LUMU
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user