feat(carwash): advisory vehicle category from the entry camera — mapping, pre-select, downgrade flag

The app plumbing for venue-modules.md §"Vehicle category from vision"; the model is the
open half (no bundled recognizer emits body_type yet, so the desk shows nothing until
phase A lands in the vision service).

- Shared: VEHICLE_CLASSES vocabulary, VehicleRead, CARWASH_VISION_THRESHOLD_DEFAULT,
  reason code carwash.categoryDowngrade; settings/order/lookup views carry the read.
- Vision contract: /analyze vehicle.body_type + confidence (service schema); the Node
  client normalises to the vocabulary and drops the rest.
- Record: snapshot.ts stores the read in the plate's device_events row (or its own when
  the plate was unreadable); vehicleForIdentity() resolves it like the plate.
- Car wash: carwash_categories.vision_classes (site mapping "car, sedan → Vetura"),
  carwash_config.vision_threshold (signed config_change when it moves), four vision
  columns on orders — migration 0030. Lookup returns vision + suggestedCategoryId.
- Desk pre-selects the mapped category and shows the read + snapshot thumbnail; Setup
  offers class chips per category and the threshold. Operator decides.
- Flag: a read at/above the threshold whose mapped category prices HIGHER than the chosen
  one signs one `anomaly` (both categories/prices, operator, snapshot) and stores its id on
  the order. Equal/upgrade/unsure/unmapped → nothing. Recorded only, never blocks, no
  reason prompt (user, 2026-09-06).

Tests in carwash.test.ts; wiki venue-modules (As built), opencv-anpr-service, log.

Claude-Session: https://claude.ai/code/session_01FWncR69HgGPuei1dLrW3cU
This commit is contained in:
2026-09-06 13:37:34 +02:00
parent 50c18405b6
commit 5e1395db18
19 changed files with 511 additions and 32 deletions
+11
View File
@@ -3080,3 +3080,14 @@ click). Every role create/update/delete appends a `config_change` (`role.<id>`,
name + permissions + jobs, operator); a no-op resave signs nothing. The stale "should
booth-supervisor carry subscription:*" note is closed — it already does. Tests: routes/roles.test.ts.
Updated [[venue-modules]] §Permissions matrix status, [[local-jwt-auth]].
## [2026-09-06] ingest | Vision vehicle category — app plumbing built, model pending
Decisions (user): a flagged downgrade is recorded only; Setup maps vision classes onto the site's
categories. Built: `VEHICLE_CLASSES` vocabulary + `VehicleRead` (shared); `/analyze`
`vehicle.body_type`/`confidence` in the service schema and the Node client; the read stored in the
plate's `device_events` row (`vehicleForIdentity`); `carwash_categories.vision_classes`,
`carwash_config.vision_threshold`, four vision columns on orders (migration 0030); Setup chips per
category + threshold; the desk pre-selects the mapped category and shows the read + thumbnail;
a confident, pricier-mapped read with a cheaper choice signs `anomaly carwash.categoryDowngrade`
(both categories/prices, operator, snapshot) — never blocks. No recognizer emits body_type yet.
Tests in carwash.test.ts. Updated [[venue-modules]] (As built), [[opencv-anpr-service]].