Why Thousands of Tests Couldn't Catch the Bugs in My AI Trading Bot

This is a story about the bugs my tests couldn’t find, and the check that found them anyway. TopSet is the trading system I built and run on my own accounts. It picks stocks with machine-learning models, rebalances on a schedule and places real orders through two brokers, Alpaca and Tradier. AI agents wrote most of the code, and my first post about it described the test gate that decides what merges: thousands of tests, a weekly 100-run soak and a few results I refuse to let change quietly. That gate still matters, but over time I learned that each kind of test answers a different question, and none of them answers the one I care about most: do my records match the broker’s? A mock broker
…