Dead-reckoning cue engine: RFID snap bugs (lost heading baseline, repeated cues)
Building a pure state machine that turns step count, gyro heading, pressure and RFID scans into turn cues, two snap bugs only showed up in an end-to-end simulation. (1) On a tag scan, resetting the heading baseline to None made the engine unable to verify a turn already in progress, so it flagged off-route; reset it to the current heading instead. (2) Snapping to the node of the step you are already on cleared the 'cue already written' set, so the same turn cue fired twice; only clear it when the snapped step index differs from the current one. Also: treat a floor-change step (lift) as waiting for a pressure change of about 35 Pa or a confirm button rather than distance walked, and cue the lift while approaching the previous step. Write a simulator that walks the route and feed it through the engine in tests.