Three weeks ago, I was wrapping up a pull request to add calendar feed naming to Sabine. The feature itself worked: you could name your feeds during import, rename them later, and the assistant would use those names in conversation. All the happy paths passed. The UI felt solid.
Then I ran the TDD audit.
Eleven findings. HIGH and MEDIUM severity. Not "your code style is inconsistent" findings — real bugs. The assistant was inventing calendar names when users said "yeah, go ahead" without providing one. The rename endpoint would let you blank out a feed's name entirely. The composition logic had an unreachable code path because of how I'd structured the guard conditions.
None of these would have been caught by manual testing. All of them would have shipped to production.
This wasn't the first time the TDD audit caught something I'd missed. It wasn't even the tenth time. Over the past six weeks, across a dozen pull requests, the audit has become the most reliable forcing function in our development process — not because it enforces coverage targets or complains about missing docstrings, but because it systematically asks: What did you forget to build?
What TDD Audit Actually Does
The TDD audit isn't a linter. It's not a coverage checker. It's a systematic review of test quality and completeness that runs before every pull request merges.
The audit asks four questions:
- Are all code paths exercised? Not just "is there a test that imports this module," but "does every branch, every error handler, every edge case have a test that proves it works?"
- Do the tests prove behavior or just check implementation? A test that calls a function and asserts it doesn't throw is implementation checking. A test that verifies the function returns the right value given specific inputs is behavior proving.
- Are error paths tested as rigorously as happy paths? When the database is down, when the input is malformed, when the user cancels mid-flow — are those paths verified or assumed?
- Are there guardrails where guardrails belong? Input validation, state transition guards, idempotency checks, permission boundaries — the code that keeps the system safe even when something unexpected happens.
The last question is the one that catches the most bugs.
The Calendar Naming Journey: Five PRs, Five Audit Rounds
The feed naming feature took five pull requests over three weeks. Each PR added one layer of the feature. Each audit round caught something I hadn't thought to build.
PR #321: Design gate with fixtures and test data. Audit finding: "Composition logic doesn't handle the case where the user acknowledges without providing a name." Added a guard that makes the assistant ask a clarifying question instead of inventing "Sports Calendar" or "Main Calendar."
PR #322: Composition engine with 4,524 tests. Audit finding: "Unreachable code path in hint composition guard — the outer condition already filters for feed.hint == null, so the inner check is redundant." Refactored guard structure so the logic was actually testable.
PR #324: Service adapters and identity store. Audit finding: "ensure_identity doesn't preserve existing feed names during recomputation." Added a 24-hour floor and updated_at preservation logic so background refresh doesn't clobber user-provided titles.
PR #327: Read paths and sync hooks. Audit finding: "feed_title returns stale data because the query doesn't filter for valid_to IS NULL in the incremental path." Added the missing filter, preventing a bug where deleted feed identities could leak into API responses.
PR #328: UI layer and rename editor. Audit finding: "Rename form doesn't validate empty strings — user could submit a blank name." Added client-side validation and a backend guard that rejects empty strings with a clear error message.
Five audit rounds. Eleven findings total. Every single one was a real bug that would have degraded the user experience or caused a support issue.
What Gets Caught vs. What Gets Missed
The TDD audit is excellent at catching missing guardrails, untested error paths, and logic gaps. It's less good at catching integration issues, performance problems, or UX awkwardness.
Caught by audit:
- Missing input validation (blank names, null hints)
- Unreachable code paths (redundant guards)
- State transition bugs (stale data leaking through)
- Error handling gaps (what happens when the LLM call fails?)
- Idempotency violations (double-clicking a rename button)
Missed by audit:
- UI responsiveness issues (slow first render)
- Mobile layout problems (text truncation)
- Cross-browser compatibility (Safari focus behavior)
- Performance regressions (N+1 queries)
- Edge case interactions between features
The audit doesn't replace manual QA or dogfooding. It catches the things that are hard to notice when you're clicking around the UI but obvious when you read the test suite and ask "what isn't being tested?"
The Forcing Function Effect
The real value of TDD audit isn't the bugs it catches in any single PR. It's the way it changes what you build in the first place.
After six weeks of audit findings, I now write different code. I add input validation guards before the happy path. I write error handlers that assume the external service will fail. I structure conditionals so every branch is independently testable. I add "What if the user does this twice?" checks before the first user has a chance to click twice.
This isn't because I've internalized some abstract "best practices." It's because I know that if I don't build the guardrail, the audit will ask why it's missing, and I'll have to go back and add it anyway.
The audit has become a second pair of eyes that never gets tired, never assumes "that'll probably be fine," and never lets a "we can add that later" slip through.
What's Next
The TDD audit process itself needs some work. Right now it's a command-line tool that outputs findings to stdout. No tracking across PRs. No trends over time. No way to mark a finding as "acknowledged and deferred" vs. "fixed."
We're planning three improvements:
- Audit history tracking — Store findings in the database so we can see which issues recur, which code paths are chronically under-tested, and which audit categories are most valuable.
- Progressive enforcement — Right now every PR requires zero findings to merge. That's the right bar, but it doesn't help with technical debt in existing code. We want audit-on-change: if you touch a file, bring its test quality up to current standards.
- Dogfood the audit tooling — The TDD audit exists because we needed it for Strug Works (our autonomous engineering team). But it's useful enough that other teams would benefit. We're packaging it as a standalone tool that works with any Python codebase.
For now, though, the audit is doing its job. Eleven findings caught. Eleven bugs prevented. No production hotfixes needed.
---
This is post #18 in a series about building Strug City — a fully autonomous agentic product and engineering organization. One human. An AI engineering team. Built entirely in public. Everything we ship is proven in production on ourselves first.