- zone-anpr-poc: H.264 instead of MJPEG (load, delay, a car in the zone,
staff traffic, bad weather); the relay-less test copy is left running
- event-driven-refactor (new): the user's decisions of 2026-11-23, what
is not decided, what they touch in today's code; waits for the user's
guidelines
- passage-confirmation: the 2026-11-19 phase order superseded; where the
video work lives
- vision-hardening, zone-anpr-poc-review: on-screen label read as a
plate (moved by the user), day-time oversized box, still pause carried
over
- pointers on vision-service, camera-live-view, lane-presence-and-anpr-entry,
dingtian-vs-mqtt, entry gates, standing decisions, open questions,
overview, index
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZgP5oZdzvo92Eouc9eRv5
- /live/<camera>.mjpg: the newest decoded frame with the vehicle boxes,
re-encoded once for all viewers; idle while nobody watches
- the page shows that stream instead of polling a still every 700 ms
- metrics: stream codec, seconds to the first picture, viewers, live
frames a second, network in
- config: decode_threads (CAP_PROP_N_THREADS; 1 removes the frames the
H.264 decoder holds back per extra thread), live_quality
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZgP5oZdzvo92Eouc9eRv5
- passage-confirmation: unexplained passages as the audit witness and the
phase-1 order (2026-11-19), first recordings, and the decisions of
2026-11-22: the zone flow (last crossing counts, no decision while the zone
is busy, an uncrossed open is abandoned) and the read-then-fire relay rules.
- zone-anpr-poc: the prototype on park-lab, its builds, the live R2 trials and
the turn-back judged as passed; park-lab as the worst-case site.
- zone-anpr-plate-trials: plate reading measured (inverting does not help; the
still is the main reader; the plate reads only on a short stretch of the
approach), the day and wet-night trials, and the two fixes that followed.
- zone-anpr-poc-review: the code review of 2026-11-21 with a status table of
what the later builds fixed.
- vision-hardening: the work list the user deferred to another session.
- zkteco-cmp200-barrier, append-only-event-chain, reconciliation,
open-questions, overview, index, log: cross-references and updates.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZgP5oZdzvo92Eouc9eRv5
A standalone prototype of passage confirmation, tried on park-lab against the
real lane, relays and barrier (wiki: concepts/zone-anpr-poc.md).
- zone_anpr.py: vehicle detection on the camera stream, a drawn zone and
crossing line, and the zone flow: nothing is decided while the zone is busy;
when it is free the last crossing decides (A -> B passed, otherwise
abandoned -> close relay). Relays follow read-then-fire with an online probe
and a check before every datagram; disarmed by default. Plates are read from
hi-res stills and stream frames into one consensus.
- test_flow.py: 65 offline checks of the flow, the relay rules against a mock
board, and the plate reads. No camera, model or relay needed.
- recordings/ + replay_recordings.py: the followed car's boxes for 48 real
entry visits of 2026-11-21/22, replayed through the judging code.
- trial_report.py: per-visit report of a drive, run on park-lab.
The detector model, local config and outputs are not committed (.gitignore).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZgP5oZdzvo92Eouc9eRv5
Incident analysis of 2026-11-20, measured read-only on park-2: nightly full
backups on the same disk push it past 70%, where the snapshot valve deletes
all but 500 snapshots and likely freezes the server. Records the manual
cleanup, the deferred fixes and the next deadline, and notes the findings on
backup-recovery, entry-exit-points, vision-review-outbox and open-questions.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZgP5oZdzvo92Eouc9eRv5
tauri-plugin-websocket starts reading at the handshake but its JS wrapper
only takes a listener after connect() resolves, so the server's immediate
hello (full device list) could be dropped: the desktop footer showed only
devices that pushed later. Call the plugin's commands directly with our own
channel listening from the start; hold early frames until onopen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZgP5oMncSaVmKRKk1UvN4
Our own line-crossing rule for cameras that have none: draw a segment over
the camera's live picture, sides A and B, and pick which crossing counts.
Stored as camera config.crossing (CrossingLine in @parking/shared, points
normalised to the frame, side A on the screen-left of p1→p2), validated on
save; null clears it. Nothing consumes it yet (passage confirmation).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZgP5oMncSaVmKRKk1UvN4
On the Snapshot side the large view steps through that camera's snapshots (‹ older,
› newer, also ← →), muted at either end; the caption carries the date and always names
the picture on screen (the previous one stays while the next loads; a pruned still says
"unavailable"). The tile stays on the newest; closing resets. New read-only route
GET /api/cameras/:deviceId/snapshots/:snapshotId/neighbors (session:read), ordered by
(capturedAt, id) like latest-snapshot, bounded to seek the device/time index.
Also carries the user's own label edits in en.ts / sq.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZgP5oMncSaVmKRKk1UvN4
Measured: the 10 fps cap cut the 12.5 fps entry camera to ~7 fps and added ~40 ms; the server
otherwise adds no measurable delay. CAMERA_LIVE_MAX_FPS still sets a cap when wanted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZgP5oMncSaVmKRKk1UvN4
Clicking a tile's picture opens a large view that streams live on demand (vehicle event
or not), with a Live / Snapshot switch — a camera-started stream can be stopped to see the
last snapshot, and a snapshot can be switched to live. Closing the view returns the tile to
automatic: a user-started stream stops, a camera-started one carries on in the tile. The
tile and the large view share one live socket. Live is marked by a pulsing green badge.
Verified in headless Firefox against the park-lab cameras.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZgP5oMncSaVmKRKk1UvN4
Footer camera chips open/close a tile per camera (bottom right, ~15% wide, stacking
leftwards); the open set is a per-user preference (users.open_cameras). A tile shows the
camera's newest entry/exit snapshot and switches to live video while that camera pushes
vehicle events (per-camera activity, same 30 s TTL as lane status).
- devices: RTSP MJPEG client + RFC 2435 RTP/JPEG reassembly; Hikvision openLiveStream()
on the sub-stream (x02, must be MJPEG — H.264 is refused with that reason)
- server: CameraLiveHub (one shared upstream per camera, latest-frame delivery, fps cap,
linger, backoff), CameraActivity, /api/cameras/:id/latest-snapshot, WS
/api/cameras/:id/live (shared handshake auth with /api/ws + device:read),
PUT /api/auth/open-cameras, migration 0033 (open_cameras + snapshot device/time index)
- web: CameraDock, footer toggles, binary frames in the platform socket (Tauri too)
- .gitattributes: *.jpg / *.bin binary (byte-exact test fixtures)
Verified on park-lab cameras end to end and in headless Firefox.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- lpr-camera: DS-2CD1043G2-LIU (4MP) and DS-2CD1083G2-LIU (8MP) both serve
main-stream ISAPI snapshots; only concurrent pulls 503
- passage-confirmation: park-lab rig (entry .6, exit .7, one shared lane),
camera capabilities, shared-lane open question
- dingtian-relay: 'config api timeout' = HTTP session check on; works with the
session cookie on this firmware; resolution and triage
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- entities/zkteco-cmp200-barrier: terminal map from the CMP200 manuals, board
photo findings (v1.2 layout, RS485 socket empty), relay-contact drive from
the Dingtian, interlocked close relay, limit outputs as status inputs
- concepts/passage-confirmation: barrier model open question answered for the
unit on hand
- decisions/appliance-provisioning: Komodo gotchas 14-16 from the park-lab
reinstall (2026-11-13)
- index and log entries
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZgP5ofaSqgLGHMGSL3xYN
Text files normalised to LF; images, icons, fonts and PDFs marked binary;
wiki/raw/ left byte-for-byte (one legacy SQL source is committed with CRLF).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Wiki pages written on 2026-10-24 but left uncommitted before the Windows to
Linux migration: passage-confirmation concept, open question 20, deploy and
query log entries, index line, incident and barrier page updates. Drops the
stray tracked __pycache__ file. Line endings normalised to LF.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
park-2 (2026-10-24): GET /api/sessions/active ran ~2 s synchronously — PayStation.activeSessions
called quote() per open unpaid transient (664 rows), each 3-4 unindexed ledger_events scans by
identity — 2234x/day. The frozen event loop made the Dingtian driver's 2 s timer fire before the
already-received UDP reply (timers run before poll I/O), so healthy pulses logged "timeout"; the
subscription flow then unwound before firing the camera or writing the sessions row, leaving
signed entries with no snapshot. Cost grew ~120 ms/day with the operator's open-ticket count.
- pay-station: price every list row from the one ledger scan (rows grouped per identity ->
#quoteFromRows); tariff resolver built once per request; quote(identity) wraps the same core.
validations: sessionValidationsFromRows / liveValidationsFromRows. Test pins list == quote().
- db 0032_hot_path_indexes: ledger_events(identity,index), device_events(category,kind,
occurred_at), device_events(kind,occurred_at), snapshots(identity), sessions(state),
sessions(subscription_id,state). Additive.
- access-dingtian binaryUdp: defer the timeout rejection with setImmediate so a datagram that
already arrived wins over an expired timer.
- subscription-flow: snapshot fired and session cache written/closed BEFORE the pulse.
wiki/concepts/park-2-event-loop-stall.md has the full analysis.
A NodeMCU v3 (ESP8266) that speaks the Dingtian wire contract (binary UDP 60000 with
relay_pw, string UDP 60001, config CGI incl. the setconfig gotcha, userset.cgi, Digest
input push) so the booth's existing driver needs no change, plus a heartbeat/command/
watchdog path to an ephemeral cloud stand-in (poc/cloud-standin.mjs). Verified at park-lab:
the booth's assign flow configured it like real hardware and a button press reached the
booth (401→Digest→200) and the cloud with the booth's status. Watchdog probes /health and
power-cycles the PC via a spare relay with backoff. IO behind one interface for the ESP32/
Dingtian port.
wiki: relay-proxy-firmware page; esp32-flashability-test runbook (esptool lock test);
dingtian-relay "can we flash our own firmware" (vendor locks the standard SKU);
site-device-installation: booth ufw must allow device-net → 3000 (push targets PORT, not
Caddy's 80); open-questions: cloud takeover vs signed ledger (parked).
.gitignore: firmware venv/.pio/secrets.h.
- resources.toml: repoint the park-lab stack from art-docker-station to the
dedicated park-lab Periphery; drop the shared-host port remaps
(HTTP_PORT/SERVER_PORT/VISION_HOST_PORT); entitle every registered module
(parking,validation,carwash); pin TAG=stage-9659373 (park-2's image).
- appliance-provisioning §5: both CLASS= lines in /etc/grub.d/10_linux work
for --unrestricted (the else-branch interpolates the first); submenu stays
restricted; conffile note.
- appliance-provisioning §1: authentication/Admin/is_enabled=1 means a BIOS
admin password IS set; writes without it fail "Operation not supported",
wrong ones "Permission denied"; feed it via read -rs.
- fleet-deployment-komodo: park-lab back on a dedicated box (2026-10-20),
preflight list (docker group, periphery enable + linger, reboot so the user
manager picks up the group), destroy the old stack on the previous host.
Follow-up to ec01591. A first decision that threw was cached and replayed
to repeats inside the window, and the telemetry hook on it had no rejection
handler, so one throwing flow became an unhandled rejection per repeat. A
failed decision is now forgotten (the next read decides afresh) and the
hook handles rejection. The recent-reads map prunes above 512 entries and
never exceeds 4096, whatever a misbehaving reader sends.
park-2, 2026-10-11: the DT-008 entry reader reported one card twice 560 ms
apart; the permit flow opened two sessions on the same permit and pulsed the
barrier twice (caught by the new relay-pulse log). The 24h before showed
2 entry + 2 exit opens within 2 s of the previous one.
ReadDispatcher now treats the same value from the same reader inside the
reader's debounceMs window as ONE presentation: the first verdict is replayed
(same beep, no second decision, nothing signed twice) and the repeat lands in
device_events as unsigned telemetry. Every lane and every credential kind,
so a ticket re-scanned at exit inside its grace period no longer signs a
noSession refusal for a car that just left. The window slides with repeats;
a repeat arriving while the first read is still deciding gets that decision.
The window is a Setup field on all three reader drivers ("Same-code
debounce (ms)", default 5000, 0 = off); readers configured before the field
existed get the default.
Measured on park-2 (i5-9500): a main-stream pull is ~0.1s and /analyze
~0.25s while the host sat under 3% CPU; the loop's fixed 1s sleep was the
limit (one frame per ~1.35s). The camera's picture endpoint is single-
threaded (4 parallel GETs -> two 503s) and the vision service serialises
inference, so no threads: pulls are back-to-back and serial per camera,
~3 fps. ANPR_POLL_MS is now a floor (default 0).
The loop no longer breaks on the first confident plate, and the 12s
camera-level debounce is gone: 40 of 57 plate-driven opens at park-2 had a
push dropped in that blind window, so a tailgating car was never looked at.
Each confident plate is settled once per loop (emit / anpr-skip / decline)
and the loop runs on while the camera keeps pushing, so a second car is
read by the same loop. Debounce is keyed deviceId:plate only; the card/QR
mid-poll guard is per subscriber instead of aborting the loop; the pass
sample is one per plated car. ANPR_POLL_WINDOW_MS=0 is honoured (it used to
fall back to 8s silently).
The camera event model was re-confirmed from 2780 pushes: every push is an
independent VMD/active with activePostCount=1, ~1.2s apart while a car
moves, never inactive. Nothing is held for 30s on the camera side.
park-2's cameras burned Beijing time into every frame: factory zone CST-8,
and the sync compared instants only, so zero drift meant the zone was never
touched. The G3H firmware also accepts a POSIX zone with a DST rule, echoes
it back, and ignores the rule.
syncClock now derives the site's current UTC offset as a fixed Hikvision
zone (hikvisionFixedZone) and rewrites it when it differs, sending the clock
with it. The device monitor adds a third trigger beside offline->ready and
the 24h backstop: the moment the site's UTC offset changes, so a DST switch
is handled within one poll. ClockSyncResult reports zoneChanged/timeZone.
Both park-2 cameras were set to CST-2:00:00 by hand on 2026-10-09; this
must be deployed there before 2026-10-25 or the OSD reads 1h ahead from
that day until it is.
One pulse path, pulseBarrier (relay-pulse.ts), for all six callers: entry
button/operator mint, reader and booth exits, subscription opens, manual
(forgiven) exits and the setup relay test. Each pulse writes an info line
naming relay, controller, direction, identity and operator, and inserts a
device_events row of kind "relay" for success and failure alike; failures
are still re-thrown so each flow keeps its own anomaly handling.
Prompted by the 2026-10-09 park-2 "barrier opened by itself" claim: the
ledger showed the why, but nothing recorded the moment a relay was actually
driven. The signed ledger stays the authority; this is unsigned telemetry.
Also git-ignores tmp/ (site snapshots pulled for incident review).
BarrierLight gains onOpen/opening (not presence-gated). For an operator with
barrier:create + own shift the exit tile is labelled 'manual exit', clickable and
opens the manual-exit dialog while still showing the lane state; for everyone else it
stays the plain 'Dalje' light. The separate ghost button is removed. Wiki as-built note.