Consumes per-id [(UInt64, Bool)] in-zone flags, keeps a rolling history per tracked id, and emits a downstream-resolved oneof t[[UInt64], [Observation.Event]] — per-id transition codes, or enter/exit events.
Typical backends
Restricted-zone alarm — track, containment-test, classify the crossing, gate, and post.
Footfall counter publishing crossing counts over MQTT.
Visualized transition review overlaying enter/exit on tracked objects.
Caveats
- I/O contractThe output is the current classification per id this tick, relative to where the id was first seen — not a one-shot edge. While an id stays inside (having started outside) every tick keeps emitting an enter code, so diff against the previous tick downstream if one-shot alerts are needed. Empty input yields empty output.
- Parameter interactionThe decision is a majority vote over the last
history_size ticks, so a transition can land up to history_size minus one ticks late; a tie (possible on even history_size when the window is exactly split) returns no-change. - State lifetimePer-id state persists across ticks; an id unseen for longer than
forget_threshold frames is forgotten, and a temporary exit-then-reentry within that gap is not treated as a fresh entry. - Hard constraintTracking-id stability matters: if the upstream tracker re-uses an id across different objects, the component emits ghost transitions.
- CostPure CPU; per-tick cost grows with the number of active ids and the history length, and both configuration keys are captured once at startup.