TrueMend was pointed at its own source code as a stress test: 25 Python files comprising the analysis engine, patch system, MCP server, CLI, and tests. The audit needed to find real issues that manual review had missed — then fix them without breaking any of the 693 existing tests.
The audit identified 16 critical issues and 2 logic bugs, organized into 6 prioritized batches by severity class:
| Batch | Category | Found | Status |
|---|---|---|---|
| 1 Logic bugs | Off-by-one, wrong return | 2 | Already fixed |
| 2 Crash paths | Unguarded JSON parsing | 9 | 8 done, 1 new fix |
| 3 Silent swallowing | Bare except, no logging | 4 | 3 done, 1 improved |
| 4 Type safety | SgNode missing annotations | 6 | 3 done, 3 annotated |
| 5 Bare dict types | Untyped dict parameters | 6 | 4 done, 2 fixed |
| 6 Standards | Long functions, deep nesting | 12 | 10 done, 2 extracted |
Each batch was applied sequentially with full test-suite validation between rounds. Fixes ranged from type annotations and log improvements to function extraction and JSON decode guards. The system identified that many issues were already addressed — avoiding redundant changes.
73% of flagged issues were already resolved, demonstrating the cumulative effect of iterative quality passes. The remaining 6 fixes each targeted a specific defect class.