A market-signal collector runs on a schedule and writes observations to SQLite. On the morning of August 10 it died in the write step with a unique-constraint violation. Nobody noticed for four days, because the scoring step that runs afterwards completed and logged its usual count of 33 saved results. The log ended the way it always ended.

What the index changed

A migration the day before had changed the model from a one-time census to a daily observation. Part of that was a unique index on the natural key, so that the same signal observed on a later day updates rather than duplicates. The sibling collector that writes to the same table was converted to an upsert in that migration. This one was not. Its docstring still carried the census-era rule in full: never update or delete an existing snapshot, insert only. The code matched the docstring and the docstring was obsolete.

The index went in on the ninth. The first day the collector saw a key it had seen before was the tenth. That is when it died, and that is the only day it could have.

The first clue was a file count

The dump directory the collector writes before saving held five files from August 3 and one from August 10. That gap, not the log, was what showed the run had stopped partway. The service manager's record of a non-zero exit code was the trigger for looking at all.

The fix copied the sibling's proven upsert rather than writing a new one. It returns new, updated, or same for each point, records a run even when zero calls are made, and tallies received, new, changed, and unchanged separately. Insert-or-ignore was specifically not used, because that discards a re-observation silently, and in this system an observation that nothing changed is data rather than waste.

Verification ran against a copy first: the sixty points that had killed the run all came back as same, a second pass left the signal table at 10,312 rows and the observation history at 16,032, and only the run counter moved, from 27 to 29. Then the real database, then the shell wrapper, then the scheduled job by force. Exit code zero for the first time since the tenth. Whether any other collector had been missed by the same migration was not checked.