Build in Public
Engineering Journal
Building an autonomous options-trading system in public: architecture, process, and honest postmortems. Software stories — not market data, not advice.
When deployment removed a health check
A broker gateway died and nothing said a word, because the deploy step had quietly wiped the scheduled check that would have noticed. This post is about the detection failure, not the outage: why the check disappeared, and the pattern I adopted so a check that stops running looks different from a check that found nothing.
Being Wrong in Writing: How an Instrumentation-Only Commit Rescued a Debugging Investigation
I root-caused a bug confidently and incorrectly. The correction came from refusing to fix anything until a single instrumentation commit answered one factual question — and the public wrongness was part of the method.
Manufacturing failures: the escalation drill harness
A rare-path close-escalation system can't be trusted on code review alone. So I built a drill that provisions its own test fixture on a non-production environment, reproduces rare failure states on demand, and measures what happens. It found four release-blocking defects in its first week.
Nothing Found and Never Looked Are Not the Same Answer
Six unrelated subsystems in my trading bot shared one defect: outputs that couldn't distinguish 'I verified this' from 'I never evaluated anything' from 'my input was missing.' The fix, every time, was to make the output carry proof the work happened.
A staged infrastructure cutover with inert changes
How I split one environment into two without taking the running system off its path — by shipping every piece inert or ahead of need, verifying it in place, and only then flipping. Plus the split-brain the migration itself created.
Close-Only: The Middle State Between Running and Halted
Three unrelated failure scenarios — an incomplete prerequisite check, a margin problem, and a gateway reconnect — all converged on the same design answer: don't halt, don't keep trading, degrade to close-only and latch it until a human turns opens back on.
The Currency Assumption Inside a Risk Gate
A risk gate silently compared a USD number against a non-USD account value. Fixing it took three spec revisions, because the bad assumption ran one layer deeper each time we looked. The lesson: stable, safety-critical deployment facts should be configured and validated, not inferred at runtime.
The Cascade That Had to Learn to Stop
Every fix in this project now runs a gauntlet — a spec that must survive a different model's rejection before any code is written, then a post-merge audit that can spawn its own fix, which spawns its own audit. The hard part wasn't finding bugs. It was defining when the loop is allowed to terminate.
When 'submitted' doesn't mean 'done': four bugs at an asynchronous execution boundary
A multi-week bug arc at the boundary between deciding and doing — requests that could never complete, uncorrelated asynchronous errors, third-party configuration silently overriding defaults — that taught me remote execution is its own subsystem with its own failure model.
What IBKR Error Codes Taught Me About Bot Reliability
Looking back over four months of work, the hard part of an IBKR integration isn't placing orders — it's surviving the API's failure modes. A tour of the error codes that shaped the architecture, and the layered defenses that grew around them.
Postmortem: Two Bugs in the Safety Path
A scoped query falsely paused the bot, and a 'safe' fallback value needed three audit rounds before its contract was actually safe. Two lessons in why guard code deserves the same adversarial scrutiny as the happy path.
The Edge Probe Harness: Budgeting Honesty Into Live Edge-Case Tests
A time-and-cost budget is only honest if the wall-clock cap covers the part that actually hangs — the connection. Here's why I moved the timer earlier, and what that fixed.
Building an Autonomous Options Bot in Public
Why I'm documenting a personal trading-bot project as an engineering journal — what this site will publish, what it deliberately won't, and where the project stands today.