docs(wiki): close the session's loose threads — bay printer question, vocabulary-in-code decision, training note, guard family, OQ #16 settled

Claude-Session: https://claude.ai/code/session_01FWncR69HgGPuei1dLrW3cU
This commit is contained in:
2026-09-06 22:37:57 +02:00
parent e67f0ccef0
commit ec44547122
5 changed files with 33 additions and 5 deletions
+10
View File
@@ -324,6 +324,16 @@ manifest (Car Wash → `carwash`; a future Bar → `bar`). Rules:
- **The wash till prints on its own printer (2026-09-06).** Printer role `wash-desk`; the
wash till's Z-report and vouchers go there, falling back to the booth printer — see
[[printer-roles-failover]].
- **Is a desk printer required? (user, 2026-09-06)** No, in either policy. With *Pagesa në
kabinë* the wash till takes no money at all — orders ride the parking ticket, the booth
prints the receipt and the booth Z carries the wash line — so the wash shift is offered but
reconciles nothing (a desk printer would sit idle). With *Pagesa në lavazh* the till's Z and
vouchers exist and prefer the desk printer, but fall back to the booth's; printing is
best-effort, the signed event is the record. Where a desk printer becomes genuinely
required is a piece that does not exist: a **customer receipt at bay payment** (today the
customer gets nothing on paper). If built, it prints on the desk only, no fallback, and
Setup should warn when the policy is bay payment with no `wash-desk` printer. Also open:
hiding the wash till section on the desk when the policy is booth payment.
## Where the fraud control actually lives
+4 -2
View File
@@ -144,5 +144,7 @@ procurement. (See [[parking-system-architecture]] §10.)
meanings (`session:read` as "works the booth till", `report:read` as "may open the socket")
and a composer at the wrong altitude. Decision + three moves (per-desk till guards, jobs on
top of the grid, a permission-scoped live feed) on [[venue-modules]] §"Permissions matrix";
moves built 2026-09-05. Open: default supervisor bundle, re-applying jobs after a module
update, signing role edits.
moves built 2026-09-05. The three loose ends closed 2026-09-06: the supervisor bundle
already carried `subscription:*` (stale note); roles now remember the jobs they follow and
a grown job is re-applied with one click, never silently; every role edit is signed as a
`config_change`. **Settled** — details on [[venue-modules]] §"Permissions matrix" Status.
+9 -3
View File
@@ -173,9 +173,15 @@ vehicle. The Hikvision push's `detectionTarget` only says `vehicle`/`human` on t
**As built (2026-09-06) — the app plumbing; the model is the open half.** Decisions from the user:
a flagged downgrade is *recorded only* (no reason prompt), and Setup maps the vision vocabulary
onto the site's own categories ("car, sedan, hatchback → Vetura").
- **Vocabulary.** `VEHICLE_CLASSES` in `@parking/shared` (car, sedan, hatchback, suv, minivan,
pickup, van, truck, bus, motorcycle). The service's `/analyze` `vehicle.body_type` +
`confidence` carry it; the Node client normalises and drops anything outside the list.
- **Vocabulary — lives in code, on purpose (user, 2026-09-06).** `VEHICLE_CLASSES` in
`@parking/shared` (car, sedan, hatchback, suv, minivan, pickup, van, truck, bus, motorcycle) is
the model's contract, not site data: a site cannot invent a class the camera never emits, so
the list is a constant, a new class ships as a release with the model that produces it, and
sites only MAP it (Veture, Makine, Fuoristrade — whatever they call their categories). Stored
mappings hold the ids, so labels can be renamed freely and a retired id is filtered out
silently. The Setup chips show the canonical ids (lowercase monospace), never a translation,
so they read as what they are. The service's `/analyze` `vehicle.body_type` + `confidence`
carry it; the Node client normalises and drops anything outside the list.
- **Record.** `snapshot.ts` writes the read into the same unsigned `device_events` row as the plate
(or a row of its own when the plate was unreadable); `vehicleForIdentity()` resolves it like the
plate (entry over exit, newest first). Never on the ledger by itself.
+2
View File
@@ -29,6 +29,8 @@ Authentication and authorization, kept **fully local** — a direct consequence
`roles` + `role_permissions` tables, composed by an admin from a **code-defined permission grid**
(`@parking/shared` `PERMISSIONS` = `resource:action`, e.g. `tariff:update`, `payment:create`,
`event:void`). A `preHandler` `requirePermission(...)` per route checks a PERMISSION, not a role
(all of the listed; `requireAnyPermission(...)`, 2026-09-06, for a read two jobs share — the
Car Wash price list is the desk's under `carwash:read` and Setup's under `site:read`)
name. The JWT carries `roleId` (not the permission list); the guard resolves the role's permission
set per-request from an **in-memory cache** (`bumpPermsCache()` on any role write), so editing a
role applies immediately — no re-login, no token bloat. No Casbin/engine needed at this scale.
+8
View File
@@ -282,3 +282,11 @@ read. Composed `model_version` reads `<plate>+yolox:yolox_s.onnx@640`.
maps to Vetura and no downgrade fires; vans, trucks, buses and motorcycles do separate. Phase B
(a body-type classifier on the pilot's own frames — every wash order is a labelled frame) is
what closes that gap; the detector's box is the crop it will classify.
- **Training (user asked, 2026-09-06): YOLOX-S needs none.** It ships trained on COCO and is a
finished detector; its limit is vocabulary, not quality. Phase B is a *different, smaller*
model — a classifier over the detector's crop, not a retrained detector — fine-tuned on a small
Apache-licensed backbone. Data: a few hundred crops per category to start, a couple of
thousand is comfortable, all from the pilot's own lane and camera. Labels are NOT the
operator's picks (untrusted — [[threat-model]]) but a trusted reviewer's, gathered through the
[[vision-review-outbox]]. Expect 85–95 % on frontal gate views once tuned — enough to flag,
never to bill, which is why the flag records and the site threshold exists.