bfe64032d8
Turborepo (pnpm workspaces) with all dependencies pinned to latest mutually-compatible versions: turbo 2.9, TypeScript 6, Fastify 5, React 19, Vite 8, better-sqlite3 12 + Drizzle ORM 0.45. Layout: - apps/server Fastify backend (local JWT auth + role guard, /health) - apps/web React 19 + Vite 8 operator SPA - packages/db Drizzle schema on SQLite/WAL; append-only events + users - packages/devices reader/printer/relay adapter interfaces (intent-only relay) - packages/shared shared domain types Architecture constraints from the design wiki are encoded in the scaffold: append-only hash-chained + signed event log, device-agnostic adapters, "a barrier is not a door" (relay expresses intent only), fully-local offline-first auth. wiki/ is an LLM-maintained Obsidian knowledge base (28 pages) ingested from the architecture & design notes, with its own maintenance schema. Verified: pnpm install, full turbo build (5/5), server boots and serves /health, drizzle-kit generates the initial migration.
27 lines
1.1 KiB
Markdown
27 lines
1.1 KiB
Markdown
---
|
|
type: concept
|
|
tags: [parking, security, integrity]
|
|
sources: [parking-system-architecture]
|
|
updated: 2026-06-14
|
|
---
|
|
|
|
# Append-Only Event Chain
|
|
|
|
The core integrity mechanism against operator fraud (see [[threat-model]]). (See
|
|
[[parking-system-architecture]] §3.)
|
|
|
|
Three layered properties:
|
|
|
|
1. **Append-only event model.** Entry/exit events are never edited or deleted, only appended. A
|
|
"void" is itself a **recorded event**, not an erasure.
|
|
2. **Tamper-evident chaining.** Each event stores the **hash of the previous event** (a hash
|
|
chain). Reordering or deleting **breaks the chain visibly**.
|
|
3. **Hardware-backed signing.** The **[[atecc608]]** secure element signs each event with a
|
|
non-extractable key. This is what makes the chain **unforgeable** rather than merely
|
|
self-consistent — someone who owns the machine still cannot forge a valid entry.
|
|
|
|
It only becomes trustworthy as an external fraud control when paired with [[reconciliation]]
|
|
against an authority the operator can't alter. Every device event — including those ingested
|
|
from the [[uhppote-controller]] via [[event-log-ingestion]] — should land in this host-side
|
|
chain.
|