// Logistics × Real-Time AI Audit
Auditing a freight tracking stack
A read of the wire contract, the write path, the connect handler and the history table — ending in the specific places your dispatch map is allowed to be wrong, and what each costs to close.
// The problem
Why this is hard
Almost every defect in a tracking stack is invisible until the day it is expensive. A payload with nowhere to put a capture time produces correct-looking data until a device buffers. A history table with no index is never slow until someone queries it. A connect handler that re-authorises is fine until a deploy. None of them appear in a metric, none produce an error, and all of them are visible in an afternoon to somebody reading the right four files in the right order.
// How we do it
The approach for this fit
The wire contract first
What a position payload can and cannot say, and what the server is therefore forced to invent. This is upstream of every other finding: a contract that cannot carry a capture time makes correct replay impossible rather than merely unimplemented.
The write path and its guards
Whether the live pointer is overwritten unconditionally, whether a retry can be told from a stop, and whether anything is idempotent. Read from the code, not inferred from behaviour.
The reconnect and re-subscribe path
What the client does on connect, and whether the server's room membership survives it. Transport recovery is not application recovery, and the difference is one handler.
The history table's access path
What is written, what reads it, and what the first real query will cost. The fastest-growing object in a tracking system is usually the last one anybody indexed, because nothing reads it yet.
// Proof
Measured on our own hardware
for one order's history, unindexed
A Seq Scan at ten million rows against 0.04 ms with the index — and it produces no slow query until somebody writes the first reader, which is what makes it an audit finding rather than an incident.
loss on a link told to lose none
Why a reported figure is not a finding. The same link's loss rate moved more than twentyfold with queue depth alone, so an audit reads where a number came from before it reads the number.
storage for the composite index
301 MB against 65 MB at ten million rows. Two thirds of that is btree deduplication, which collapses a repeated foreign key and cannot touch a near-unique pair; the rest is the second column itself. The right index is a trade, and an audit is where you find out which way it goes.
Not a client outcome and not a vendor figure — numbers we took, on hardware we can name, with the method to be published alongside them.
// FAQ
Common questions
// Part of
Where this sits
// Let's build
Building Auditing a freight tracking stack?
Tell us where you are. We reply within a day with a concrete next step.