Companion’s offline store is a purpose-built field vault, not a thin wrapper around a default SQLite file.
One database serves both the officer window and the tray Agent.
Until a result is sealed to its destination, that vault is the shift’s working memory —
so the engine is shaped around survival, recovery, and honest evidence, not a catalogue of toggles.
It never shares state with AlcoMaster Control.
◎
A durable write path
Commits run through a power-loss-minded journal (WAL with strict synchronous behaviour),
checkpointed often enough that an abrupt shutdown does not strand a day’s work in an oversized log.
Clean exit folds the journal and refreshes a snapshot when the queue has moved.
When the volume is critically short of free space, the engine refuses further writes:
better a clear pause than a half-written store.
Integrity is part of the open path, not a later diagnostic. Structure is checked when the vault wakes
and again while it works; residual shared-memory files from a crashed process are cleared before
a healthy file is mistaken for a broken one. Corruption is quarantined with a reason —
not papered over — and recovery promotes the newest backup that still proves sound.
◆
Snapshots that earn their place
FieldCritical treats backup as continuous discipline, not a nightly afterthought.
Verified cold copies roll in the product vault, with a secondary mirror on the machine
so one damaged tree does not strand the queue.
Retrieve and Send — the moments that matter — trigger an explicit verified snapshot,
so the last known-good state tracks real field work rather than a fixed clock alone.
◇
Two processes, one mind
UI and Agent open the same vault by design: one can pull while the other finishes a send.
Cross-process locks keep restore, backup, and flush from racing each other;
contended access waits and retries instead of discarding the queue.
Single-instance guards and crash logs sit beside the store so the field PC stays
one coherent system, not two apps fighting over a file.
▣
Security as chain of custody
Resilience without authenticity is incomplete. Machine-local signing on cold backups
means restore will not quietly accept a planted substitute when a key is present;
CRC sidecars catch truncated or bit-rotted copies before they are promoted.
The vault is hardened with best-effort NTFS access control on the host.
Unsent results are never auto-purged — retention only releases what has already been successfully sent.
When a package leaves the device, the destination file is the record of truth:
sealed with digests the officer can see, not merely a green tick in the UI.
An append-only audit trails retrieve, send, seal, calibration, and restore —
who, which machine, which result — without rewriting history.
The vault itself is standalone: its own install, own data root, own keys and locks —
independent of the Control console on any other desk.